This commit was manufactured by cvs2svn to create branch 'gdb_6_2-branch'.

Sprout from ezannoni_pie-20040323-branch 2004-03-23 23:05:53 UTC nobody 'This commit was manufactured by cvs2svn to create branch'
Cherrypick from master 2004-07-09 19:29:56 UTC Paul N. Hilfinger <hilfinger@adacore.com> 'Remove ARI problems:':
    ChangeLog
    MAINTAINERS
    Makefile.def
    Makefile.in
    Makefile.tpl
    bfd/ChangeLog
    bfd/Makefile.am
    bfd/Makefile.in
    bfd/aix386-core.c
    bfd/aix5ppc-core.c
    bfd/aout-adobe.c
    bfd/aout-target.h
    bfd/aout-tic30.c
    bfd/aoutf1.h
    bfd/aoutx.h
    bfd/archive.c
    bfd/archures.c
    bfd/bfd-in.h
    bfd/bfd-in2.h
    bfd/bfd.c
    bfd/bfdio.c
    bfd/binary.c
    bfd/bout.c
    bfd/cache.c
    bfd/cisco-core.c
    bfd/coff-alpha.c
    bfd/coff-arm.c
    bfd/coff-h8300.c
    bfd/coff-i386.c
    bfd/coff-mips.c
    bfd/coff-ppc.c
    bfd/coff-rs6000.c
    bfd/coff-sh.c
    bfd/coff64-rs6000.c
    bfd/coffcode.h
    bfd/coffgen.c
    bfd/cofflink.c
    bfd/config.bfd
    bfd/configure
    bfd/configure.in
    bfd/cpu-arm.c
    bfd/cpu-cr16c.c
    bfd/cpu-crx.c
    bfd/cpu-h8300.c
    bfd/cpu-m68k.c
    bfd/cpu-ns32k.c
    bfd/cpu-sh.c
    bfd/doc/ChangeLog
    bfd/doc/Makefile.in
    bfd/doc/bfdint.texi
    bfd/dwarf1.c
    bfd/dwarf2.c
    bfd/ecoff.c
    bfd/ecofflink.c
    bfd/ecoffswap.h
    bfd/elf-bfd.h
    bfd/elf-eh-frame.c
    bfd/elf-hppa.h
    bfd/elf-m10200.c
    bfd/elf-m10300.c
    bfd/elf.c
    bfd/elf32-arm.h
    bfd/elf32-cr16c.c
    bfd/elf32-cris.c
    bfd/elf32-crx.c
    bfd/elf32-d10v.c
    bfd/elf32-d30v.c
    bfd/elf32-dlx.c
    bfd/elf32-fr30.c
    bfd/elf32-frv.c
    bfd/elf32-gen.c
    bfd/elf32-h8300.c
    bfd/elf32-hppa.c
    bfd/elf32-i370.c
    bfd/elf32-i386.c
    bfd/elf32-i860.c
    bfd/elf32-ip2k.c
    bfd/elf32-iq2000.c
    bfd/elf32-m32r.c
    bfd/elf32-m68hc11.c
    bfd/elf32-m68hc12.c
    bfd/elf32-m68hc1x.c
    bfd/elf32-m68hc1x.h
    bfd/elf32-m68k.c
    bfd/elf32-mcore.c
    bfd/elf32-mips.c
    bfd/elf32-openrisc.c
    bfd/elf32-or32.c
    bfd/elf32-ppc.c
    bfd/elf32-s390.c
    bfd/elf32-sh-symbian.c
    bfd/elf32-sh.c
    bfd/elf32-sh64-com.c
    bfd/elf32-sh64.c
    bfd/elf32-sparc.c
    bfd/elf32-v850.c
    bfd/elf32-vax.c
    bfd/elf32-xstormy16.c
    bfd/elf32-xtensa.c
    bfd/elf64-alpha.c
    bfd/elf64-gen.c
    bfd/elf64-hppa.c
    bfd/elf64-mips.c
    bfd/elf64-mmix.c
    bfd/elf64-ppc.c
    bfd/elf64-s390.c
    bfd/elf64-sh64.c
    bfd/elf64-sparc.c
    bfd/elf64-x86-64.c
    bfd/elfarm-nabi.c
    bfd/elfcode.h
    bfd/elflink.c
    bfd/elfn32-mips.c
    bfd/elfxx-ia64.c
    bfd/elfxx-mips.c
    bfd/elfxx-mips.h
    bfd/elfxx-target.h
    bfd/hash.c
    bfd/hp300hpux.c
    bfd/hppabsd-core.c
    bfd/hpux-core.c
    bfd/i386linux.c
    bfd/i386msdos.c
    bfd/i386os9k.c
    bfd/ieee.c
    bfd/ihex.c
    bfd/irix-core.c
    bfd/libaout.h
    bfd/libbfd-in.h
    bfd/libbfd.c
    bfd/libbfd.h
    bfd/libcoff-in.h
    bfd/libcoff.h
    bfd/libecoff.h
    bfd/linker.c
    bfd/lynx-core.c
    bfd/m68klinux.c
    bfd/m88kopenbsd.c
    bfd/mach-o.c
    bfd/merge.c
    bfd/mmo.c
    bfd/netbsd-core.c
    bfd/nlm-target.h
    bfd/nlm32-alpha.c
    bfd/nlm32-ppc.c
    bfd/nlm32-sparc.c
    bfd/nlmcode.h
    bfd/oasys.c
    bfd/opncls.c
    bfd/osf-core.c
    bfd/pdp11.c
    bfd/pe-i386.c
    bfd/pe-mips.c
    bfd/peXXigen.c
    bfd/pef.c
    bfd/pei-i386.c
    bfd/po/SRC-POTFILES.in
    bfd/po/bfd.pot
    bfd/po/fr.po
    bfd/ppcboot.c
    bfd/ptrace-core.c
    bfd/reloc.c
    bfd/reloc16.c
    bfd/riscix.c
    bfd/rs6000-core.c
    bfd/sco5-core.c
    bfd/section.c
    bfd/simple.c
    bfd/som.c
    bfd/som.h
    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/version.h
    bfd/vms-gsd.c
    bfd/vms-misc.c
    bfd/vms-tir.c
    bfd/vms.c
    bfd/xcofflink.c
    bfd/xsym.c
    config-ml.in
    config.sub
    config/ChangeLog
    config/acx.m4
    configure
    configure.in
    cpu/ChangeLog
    cpu/iq2000.opc
    cpu/m32r.opc
    gdb/ChangeLog
    gdb/ChangeLog-2002
    gdb/MAINTAINERS
    gdb/Makefile.in
    gdb/NEWS
    gdb/PROBLEMS
    gdb/acconfig.h
    gdb/acinclude.m4
    gdb/aclocal.m4
    gdb/ada-exp.y
    gdb/ada-lang.c
    gdb/ada-lang.h
    gdb/ada-lex.l
    gdb/ada-typeprint.c
    gdb/ada-valprint.c
    gdb/aix-thread.c
    gdb/alpha-linux-tdep.c
    gdb/alpha-nat.c
    gdb/alpha-osf1-tdep.c
    gdb/alpha-tdep.c
    gdb/alpha-tdep.h
    gdb/alphabsd-nat.c
    gdb/alphafbsd-tdep.c
    gdb/alphanbsd-tdep.c
    gdb/amd64-linux-nat.c
    gdb/amd64-linux-tdep.c
    gdb/amd64-nat.c
    gdb/amd64-tdep.c
    gdb/amd64-tdep.h
    gdb/amd64bsd-nat.c
    gdb/amd64fbsd-nat.c
    gdb/amd64nbsd-tdep.c
    gdb/amd64obsd-nat.c
    gdb/amd64obsd-tdep.c
    gdb/annotate.c
    gdb/annotate.h
    gdb/arch-utils.c
    gdb/arch-utils.h
    gdb/arm-linux-tdep.c
    gdb/arm-tdep.c
    gdb/arm-tdep.h
    gdb/armnbsd-nat.c
    gdb/armnbsd-tdep.c
    gdb/avr-tdep.c
    gdb/blockframe.c
    gdb/breakpoint.c
    gdb/breakpoint.h
    gdb/bsd-kvm.c
    gdb/bsd-kvm.h
    gdb/c-exp.y
    gdb/c-lang.c
    gdb/c-typeprint.c
    gdb/cli/cli-cmds.c
    gdb/cli/cli-decode.c
    gdb/cli/cli-script.c
    gdb/cli/cli-setshow.c
    gdb/coffread.c
    gdb/command.h
    gdb/complaints.c
    gdb/config.in
    gdb/config/alpha/xm-alphalinux.h
    gdb/config/alpha/xm-alphaosf.h
    gdb/config/arm/tm-embed.h
    gdb/config/djgpp/fnchange.lst
    gdb/config/i386/fbsd.mh
    gdb/config/i386/fbsd64.mh
    gdb/config/i386/i386.mt
    gdb/config/i386/i386gnu.mt
    gdb/config/i386/i386sol2.mh
    gdb/config/i386/i386sol2.mt
    gdb/config/i386/linux.mt
    gdb/config/i386/linux64.mt
    gdb/config/i386/nbsdelf.mh
    gdb/config/i386/ncr3000.mt
    gdb/config/i386/nm-i386gnu.h
    gdb/config/i386/nm-i386sco4.h
    gdb/config/i386/nm-i386sco5.h
    gdb/config/i386/obsd.mh
    gdb/config/i386/obsd64.mh
    gdb/config/i386/tm-cygwin.h
    gdb/config/i386/tm-i386lynx.h
    gdb/config/i386/tm-i386sol2.h
    gdb/config/i386/tm-linux.h
    gdb/config/i386/tm-nto.h
    gdb/config/i386/tm-vxworks.h
    gdb/config/ia64/tm-aix.h
    gdb/config/ia64/tm-linux.h
    gdb/config/m68k/nbsd.mt
    gdb/config/m68k/nbsdaout.mh
    gdb/config/m68k/nbsdelf.mh
    gdb/config/m68k/nm-nbsd.h
    gdb/config/m68k/nm-nbsdaout.h
    gdb/config/m68k/obsd.mh
    gdb/config/m68k/obsd.mt
    gdb/config/m68k/tm-nbsd.h
    gdb/config/m68k/tm-obsd.h
    gdb/config/m88k/nm-obsd.h
    gdb/config/m88k/obsd.mh
    gdb/config/m88k/obsd.mt
    gdb/config/mips/tm-irix5.h
    gdb/config/mips/tm-irix6.h
    gdb/config/mips/tm-linux.h
    gdb/config/mips/tm-mips.h
    gdb/config/mips/tm-nbsd.h
    gdb/config/nm-bsd.h
    gdb/config/nm-linux.h
    gdb/config/nm-nbsd.h
    gdb/config/nm-sysv4.h
    gdb/config/pa/linux.mh
    gdb/config/pa/linux.mt
    gdb/config/pa/nm-hppah.h
    gdb/config/pa/nm-linux.h
    gdb/config/pa/nm-obsd.h
    gdb/config/pa/obsd.mh
    gdb/config/pa/obsd.mt
    gdb/config/pa/tm-bsd.h
    gdb/config/pa/tm-hppa.h
    gdb/config/pa/tm-hppa64.h
    gdb/config/pa/tm-hppah.h
    gdb/config/pa/tm-linux.h
    gdb/config/pa/xm-linux.h
    gdb/config/powerpc/nm-obsd.h
    gdb/config/powerpc/obsd.mh
    gdb/config/powerpc/obsd.mt
    gdb/config/rs6000/nm-rs6000.h
    gdb/config/rs6000/tm-rs6000.h
    gdb/config/sparc/linux.mt
    gdb/config/sparc/linux64.mt
    gdb/config/sparc/nbsdelf.mh
    gdb/config/sparc/sol2-64.mt
    gdb/config/sparc/sol2.mh
    gdb/config/sparc/sol2.mt
    gdb/config/sparc/tm-sol2.h
    gdb/config/vax/nbsd.mt
    gdb/config/vax/nbsdaout.mh
    gdb/config/vax/nbsdelf.mh
    gdb/config/vax/nm-nbsd.h
    gdb/config/vax/nm-nbsdaout.h
    gdb/config/vax/nm-obsd.h
    gdb/config/vax/obsd.mh
    gdb/config/vax/tm-nbsd.h
    gdb/config/vax/tm-vaxbsd.h
    gdb/config/vax/xm-vax.h
    gdb/configure
    gdb/configure.host
    gdb/configure.in
    gdb/configure.tgt
    gdb/core-aout.c
    gdb/core-regset.c
    gdb/corefile.c
    gdb/corelow.c
    gdb/cp-support.c
    gdb/cp-support.h
    gdb/cp-valprint.c
    gdb/cris-tdep.c
    gdb/d10v-tdep.c
    gdb/dbxread.c
    gdb/defs.h
    gdb/dictionary.c
    gdb/doc/ChangeLog
    gdb/doc/annotate.texinfo
    gdb/doc/gdb.texinfo
    gdb/doc/gdbint.texinfo
    gdb/doc/observer.texi
    gdb/doc/stabs.texinfo
    gdb/dsrec.c
    gdb/dummy-frame.c
    gdb/dummy-frame.h
    gdb/dwarf2-frame.c
    gdb/dwarf2expr.c
    gdb/dwarf2loc.c
    gdb/dwarf2read.c
    gdb/dwarfread.c
    gdb/elfread.c
    gdb/eval.c
    gdb/exec.c
    gdb/expression.h
    gdb/f-lang.c
    gdb/fbsd-proc.c
    gdb/findvar.c
    gdb/frame-unwind.c
    gdb/frame-unwind.h
    gdb/frame.c
    gdb/frame.h
    gdb/frv-linux-tdep.c
    gdb/frv-tdep.c
    gdb/frv-tdep.h
    gdb/gcore.c
    gdb/gdb-events.c
    gdb/gdb-events.h
    gdb/gdb-events.sh
    gdb/gdb-mi.el
    gdb/gdbarch.c
    gdb/gdbarch.h
    gdb/gdbarch.sh
    gdb/gdbcore.h
    gdb/gdbthread.h
    gdb/gdbtypes.h
    gdb/gnu-nat.c
    gdb/go32-nat.c
    gdb/h8300-tdep.c
    gdb/hppa-hpux-tdep.c
    gdb/hppa-linux-nat.c
    gdb/hppa-linux-tdep.c
    gdb/hppa-tdep.c
    gdb/hppa-tdep.h
    gdb/hppabsd-nat.c
    gdb/hppabsd-tdep.c
    gdb/hppah-nat.c
    gdb/hpread.c
    gdb/hpux-thread.c
    gdb/i386-cygwin-tdep.c
    gdb/i386-linux-nat.c
    gdb/i386-linux-tdep.c
    gdb/i386-nto-tdep.c
    gdb/i386-sol2-tdep.c
    gdb/i386-tdep.c
    gdb/i386-tdep.h
    gdb/i386bsd-nat.c
    gdb/i386bsd-tdep.c
    gdb/i386fbsd-nat.c
    gdb/i386nbsd-nat.c
    gdb/i386nbsd-tdep.c
    gdb/i386obsd-tdep.c
    gdb/i386v4-nat.c
    gdb/i387-tdep.c
    gdb/ia64-tdep.c
    gdb/infcall.c
    gdb/infcmd.c
    gdb/inferior.h
    gdb/inflow.c
    gdb/infptrace.c
    gdb/infrun.c
    gdb/inftarg.c
    gdb/infttrace.c
    gdb/infttrace.h
    gdb/interps.c
    gdb/irix5-nat.c
    gdb/jv-lang.c
    gdb/language.c
    gdb/language.h
    gdb/libunwind-frame.c
    gdb/lin-lwp.c
    gdb/linespec.c
    gdb/linux-nat.c
    gdb/linux-nat.h
    gdb/lynx-nat.c
    gdb/m2-lang.c
    gdb/m32r-tdep.c
    gdb/m68hc11-tdep.c
    gdb/m68k-tdep.c
    gdb/m68k-tdep.h
    gdb/m68kbsd-nat.c
    gdb/m68kbsd-tdep.c
    gdb/m68klinux-nat.c
    gdb/m68klinux-tdep.c
    gdb/m88k-tdep.c
    gdb/m88k-tdep.h
    gdb/m88kbsd-nat.c
    gdb/main.c
    gdb/mcore-tdep.c
    gdb/mdebugread.c
    gdb/mi/mi-cmd-break.c
    gdb/mi/mi-cmd-env.c
    gdb/mi/mi-cmd-file.c
    gdb/mi/mi-cmd-stack.c
    gdb/mi/mi-cmd-var.c
    gdb/mi/mi-cmds.c
    gdb/mi/mi-cmds.h
    gdb/mi/mi-interp.c
    gdb/mi/mi-main.c
    gdb/minsyms.c
    gdb/mips-linux-tdep.c
    gdb/mips-nat.c
    gdb/mips-tdep.c
    gdb/mips-tdep.h
    gdb/mipsnbsd-tdep.c
    gdb/mipsnbsd-tdep.h
    gdb/mipsread.c
    gdb/mn10300-tdep.c
    gdb/monitor.c
    gdb/ns32k-tdep.c
    gdb/ns32k-tdep.h
    gdb/ns32knbsd-nat.c
    gdb/nto-procfs.c
    gdb/nto-tdep.c
    gdb/objc-lang.c
    gdb/objfiles.c
    gdb/objfiles.h
    gdb/observer.c
    gdb/observer.sh
    gdb/ocd.c
    gdb/ocd.h
    gdb/osabi.c
    gdb/p-lang.c
    gdb/pa64solib.c
    gdb/parse.c
    gdb/parser-defs.h
    gdb/ppc-bdm.c
    gdb/ppc-linux-nat.c
    gdb/ppc-linux-tdep.c
    gdb/ppc-sysv-tdep.c
    gdb/ppc-tdep.h
    gdb/ppcnbsd-nat.c
    gdb/ppcnbsd-tdep.c
    gdb/ppcobsd-nat.c
    gdb/ppcobsd-tdep.c
    gdb/ppcobsd-tdep.h
    gdb/procfs.c
    gdb/rdi-share/ardi.c
    gdb/regcache.c
    gdb/regset.c
    gdb/regset.h
    gdb/remote-e7000.c
    gdb/remote-m32r-sdi.c
    gdb/remote-mips.c
    gdb/remote-rdi.c
    gdb/remote-rdp.c
    gdb/remote-sds.c
    gdb/remote-sim.c
    gdb/remote-st.c
    gdb/remote-vx.c
    gdb/remote-vx68.c
    gdb/remote-vxmips.c
    gdb/remote.c
    gdb/remote.h
    gdb/rs6000-nat.c
    gdb/rs6000-tdep.c
    gdb/s390-tdep.c
    gdb/scm-lang.c
    gdb/sentinel-frame.c
    gdb/ser-tcp.c
    gdb/ser-unix.c
    gdb/serial.c
    gdb/serial.h
    gdb/sh-tdep.c
    gdb/sh64-tdep.c
    gdb/shnbsd-tdep.c
    gdb/sol-thread.c
    gdb/solib-aix5.c
    gdb/solib-svr4.c
    gdb/somread.c
    gdb/somsolib.c
    gdb/source.c
    gdb/source.h
    gdb/sparc-linux-tdep.c
    gdb/sparc-sol2-tdep.c
    gdb/sparc-tdep.c
    gdb/sparc64-sol2-tdep.c
    gdb/sparc64-tdep.c
    gdb/sparc64fbsd-tdep.c
    gdb/sparc64nbsd-tdep.c
    gdb/sparc64obsd-tdep.c
    gdb/sparcnbsd-nat.c
    gdb/sparcnbsd-tdep.c
    gdb/sparcobsd-tdep.c
    gdb/stabsread.c
    gdb/stack.c
    gdb/symfile-mem.c
    gdb/symfile.c
    gdb/symfile.h
    gdb/symtab.c
    gdb/symtab.h
    gdb/target.c
    gdb/target.h
    gdb/testsuite/ChangeLog
    gdb/testsuite/Makefile.in
    gdb/testsuite/configure
    gdb/testsuite/configure.in
    gdb/testsuite/gdb.ada/Makefile.in
    gdb/testsuite/gdb.ada/bar.adb
    gdb/testsuite/gdb.ada/bar.ads
    gdb/testsuite/gdb.ada/gnat_ada.gpr.in
    gdb/testsuite/gdb.ada/null_record.adb
    gdb/testsuite/gdb.ada/null_record.exp
    gdb/testsuite/gdb.arch/e500-prologue.c
    gdb/testsuite/gdb.arch/e500-prologue.exp
    gdb/testsuite/gdb.arch/e500-regs.exp
    gdb/testsuite/gdb.arch/i386-cpuid.h
    gdb/testsuite/gdb.arch/i386-prologue.c
    gdb/testsuite/gdb.arch/i386-prologue.exp
    gdb/testsuite/gdb.arch/i386-sse.c
    gdb/testsuite/gdb.arch/i386-sse.exp
    gdb/testsuite/gdb.arch/i386-unwind.c
    gdb/testsuite/gdb.arch/i386-unwind.exp
    gdb/testsuite/gdb.arch/powerpc-aix-prologue.c
    gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp
    gdb/testsuite/gdb.asm/asm-source.exp
    gdb/testsuite/gdb.asm/pa.inc
    gdb/testsuite/gdb.base/attach.exp
    gdb/testsuite/gdb.base/auxv.exp
    gdb/testsuite/gdb.base/bigcore.c
    gdb/testsuite/gdb.base/bigcore.exp
    gdb/testsuite/gdb.base/call-sc.c
    gdb/testsuite/gdb.base/call-sc.exp
    gdb/testsuite/gdb.base/charset.exp
    gdb/testsuite/gdb.base/ending-run.exp
    gdb/testsuite/gdb.base/float.exp
    gdb/testsuite/gdb.base/foll-fork.exp
    gdb/testsuite/gdb.base/gcore.exp
    gdb/testsuite/gdb.base/gdb1250.exp
    gdb/testsuite/gdb.base/lineinc.c
    gdb/testsuite/gdb.base/lineinc.exp
    gdb/testsuite/gdb.base/lineinc1.h
    gdb/testsuite/gdb.base/lineinc2.h
    gdb/testsuite/gdb.base/lineinc3.h
    gdb/testsuite/gdb.base/long_long.c
    gdb/testsuite/gdb.base/long_long.exp
    gdb/testsuite/gdb.base/pending.exp
    gdb/testsuite/gdb.base/sep-proc.c
    gdb/testsuite/gdb.base/sep.c
    gdb/testsuite/gdb.base/sep.exp
    gdb/testsuite/gdb.base/shlib-call.exp
    gdb/testsuite/gdb.base/sigaltstack.c
    gdb/testsuite/gdb.base/sigaltstack.exp
    gdb/testsuite/gdb.base/sigbpt.c
    gdb/testsuite/gdb.base/sigbpt.exp
    gdb/testsuite/gdb.base/siginfo.c
    gdb/testsuite/gdb.base/siginfo.exp
    gdb/testsuite/gdb.base/signals.exp
    gdb/testsuite/gdb.base/signull.c
    gdb/testsuite/gdb.base/signull.exp
    gdb/testsuite/gdb.base/sigstep.c
    gdb/testsuite/gdb.base/sigstep.exp
    gdb/testsuite/gdb.base/sizeof.exp
    gdb/testsuite/gdb.base/structs.exp
    gdb/testsuite/gdb.base/structs2.exp
    gdb/testsuite/gdb.cp/pr-574.cc
    gdb/testsuite/gdb.cp/printmethod.cc
    gdb/testsuite/gdb.cp/psmang1.cc
    gdb/testsuite/gdb.cp/psmang2.cc
    gdb/testsuite/gdb.cp/ref-types.cc
    gdb/testsuite/gdb.cp/templates.exp
    gdb/testsuite/gdb.cp/try_catch.cc
    gdb/testsuite/gdb.cp/userdef.cc
    gdb/testsuite/gdb.cp/virtfunc.cc
    gdb/testsuite/gdb.gdb/observer.exp
    gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp
    gdb/testsuite/gdb.java/jmain.exp
    gdb/testsuite/gdb.java/jmain.java
    gdb/testsuite/gdb.java/jmisc.exp
    gdb/testsuite/gdb.java/jmisc1.exp
    gdb/testsuite/gdb.mi/mi-file.exp
    gdb/testsuite/gdb.mi/mi2-file.exp
    gdb/testsuite/gdb.stabs/exclfwd.exp
    gdb/testsuite/gdb.stabs/exclfwd.h
    gdb/testsuite/gdb.stabs/exclfwd1.c
    gdb/testsuite/gdb.stabs/exclfwd2.c
    gdb/testsuite/gdb.stabs/weird.exp
    gdb/testsuite/gdb.threads/manythreads.c
    gdb/testsuite/gdb.threads/manythreads.exp
    gdb/testsuite/gdb.threads/pthread_cond_wait.c
    gdb/testsuite/gdb.threads/pthread_cond_wait.exp
    gdb/testsuite/gdb.threads/pthreads.exp
    gdb/testsuite/lib/ada.exp
    gdb/testsuite/lib/compiler.c
    gdb/testsuite/lib/compiler.cc
    gdb/testsuite/lib/gdb.exp
    gdb/thread-db.c
    gdb/thread.c
    gdb/top.c
    gdb/tracepoint.c
    gdb/tracepoint.h
    gdb/trad-frame.h
    gdb/tramp-frame.c
    gdb/tramp-frame.h
    gdb/tui/tui-hooks.c
    gdb/tui/tui-io.c
    gdb/tui/tui-regs.c
    gdb/tui/tui.c
    gdb/utils.c
    gdb/uw-thread.c
    gdb/v850-tdep.c
    gdb/v850ice.c
    gdb/valarith.c
    gdb/valops.c
    gdb/value.h
    gdb/values.c
    gdb/varobj.c
    gdb/vax-tdep.c
    gdb/vax-tdep.h
    gdb/vaxbsd-nat.c
    gdb/vaxnbsd-tdep.c
    gdb/version.in
    gdb/win32-nat.c
    gdb/wince.c
    gdb/xcoffsolib.c
    gdb/xstormy16-tdep.c
    include/ChangeLog
    include/bfdlink.h
    include/coff/ChangeLog
    include/coff/ecoff.h
    include/coff/internal.h
    include/coff/mips.h
    include/demangle.h
    include/dis-asm.h
    include/elf/ChangeLog
    include/elf/common.h
    include/elf/cr16c.h
    include/elf/crx.h
    include/elf/m32r.h
    include/elf/mips.h
    include/elf/sh.h
    include/gdb/ChangeLog
    include/gdb/callback.h
    include/hashtab.h
    include/opcode/ChangeLog
    include/opcode/crx.h
    include/opcode/i386.h
    include/opcode/m68k.h
    include/splay-tree.h
    libiberty/ChangeLog
    libiberty/Makefile.in
    libiberty/config.in
    libiberty/configure
    libiberty/configure.ac
    libiberty/cp-demangle.c
    libiberty/cp-demangle.h
    libiberty/hashtab.c
    libiberty/lrealpath.c
    libiberty/mkstemps.c
    libiberty/pex-win32.c
    libiberty/strerror.c
    libiberty/testsuite/demangle-expected
    opcodes/ChangeLog
    opcodes/Makefile.am
    opcodes/Makefile.in
    opcodes/arc-ext.c
    opcodes/configure
    opcodes/configure.in
    opcodes/crx-dis.c
    opcodes/crx-opc.c
    opcodes/disassemble.c
    opcodes/h8300-dis.c
    opcodes/i386-dis.c
    opcodes/ia64-asmtab.c
    opcodes/ia64-gen.c
    opcodes/ia64-opc-a.c
    opcodes/m32r-asm.c
    opcodes/m68k-dis.c
    opcodes/m68k-opc.c
    opcodes/po/fr.po
    opcodes/ppc-opc.c
    opcodes/s390-opc.txt
    opcodes/sh-dis.c
    opcodes/sh-opc.h
    opcodes/sparc-opc.c
    sim/arm/ChangeLog
    sim/arm/armemu.c
    sim/common/ChangeLog
    sim/common/callback.c
    sim/common/dv-glue.c
    sim/common/run.c
    sim/common/sim-basics.h
    sim/common/sim-load.c
    sim/common/syscall.c
    sim/d10v/ChangeLog
    sim/d10v/interp.c
    sim/h8300/ChangeLog
    sim/h8300/compile.c
    sim/m32r/ChangeLog
    sim/m32r/Makefile.in
    sim/m68hc11/ChangeLog
    sim/m68hc11/interp.c
    sim/mips/ChangeLog
    sim/mips/configure
    sim/mips/configure.in
    sim/mips/interp.c
    sim/mips/mips.igen
    sim/mips/sb1.igen
    sim/mips/sim-main.h
    sim/mn10200/ChangeLog
    sim/mn10200/interp.c
    sim/mn10300/ChangeLog
    sim/mn10300/Makefile.in
    sim/mn10300/am33-2.igen
    sim/mn10300/am33.igen
    sim/mn10300/configure.in
    sim/mn10300/interp.c
    sim/mn10300/mn10300.igen
    sim/mn10300/mn10300_sim.h
    sim/mn10300/op_utils.c
    sim/ppc/ChangeLog
    sim/ppc/Makefile.in
    sim/ppc/configure
    sim/ppc/configure.in
    sim/ppc/e500_registers.h
    sim/ppc/hw_htab.c
    sim/ppc/hw_init.c
    sim/testsuite/ChangeLog
    sim/testsuite/lib/sim-defs.exp
    sim/testsuite/sim/h8300/ChangeLog
    sim/testsuite/sim/h8300/band.s
    sim/testsuite/sim/h8300/biand.s
    sim/testsuite/sim/h8300/bset.s
    sim/testsuite/sim/h8300/div.s
    sim/testsuite/sim/h8300/mul.s
    sim/testsuite/sim/mips/ChangeLog
    sim/testsuite/sim/mips/basic.exp
    sim/testsuite/sim/mips/fpu64-ps-sb1.s
    sim/testsuite/sim/mips/fpu64-ps.s
    sim/testsuite/sim/mips/hilo-hazard-1.s
    sim/testsuite/sim/mips/hilo-hazard-2.s
    sim/testsuite/sim/mips/hilo-hazard-3.s
    sim/testsuite/sim/mips/mdmx-ob-sb1.s
    sim/testsuite/sim/mips/mdmx-ob.s
    sim/testsuite/sim/mips/utils-fpu.inc
    sim/testsuite/sim/mips/utils-mdmx.inc
    src-release
Delete:
    bfd/elflink.h
    bfd/mpw-config.in
    bfd/mpw-make.sed
    gdb/ada-tasks.c
    gdb/config/i386/embed.mt
    gdb/config/i386/go32.mt
    gdb/config/i386/i386aout.mt
    gdb/config/i386/i386nw.mt
    gdb/config/i386/i386v.mt
    gdb/config/i386/interix.mh
    gdb/config/i386/interix.mt
    gdb/config/i386/nm-interix.h
    gdb/config/i386/tm-go32.h
    gdb/config/i386/tm-i386.h
    gdb/config/m68k/3b1.mh
    gdb/config/m68k/3b1.mt
    gdb/config/m68k/delta68.mh
    gdb/config/m68k/delta68.mt
    gdb/config/m68k/dpx2.mh
    gdb/config/m68k/dpx2.mt
    gdb/config/m68k/m68klynx.mh
    gdb/config/m68k/m68klynx.mt
    gdb/config/m68k/m68kv4.mh
    gdb/config/m68k/m68kv4.mt
    gdb/config/m68k/nbsdaout.mt
    gdb/config/m68k/nm-delta68.h
    gdb/config/m68k/nm-dpx2.h
    gdb/config/m68k/nm-m68klynx.h
    gdb/config/m68k/nm-sun2.h
    gdb/config/m68k/nm-sun3.h
    gdb/config/m68k/nm-sysv4.h
    gdb/config/m68k/sun2os3.mh
    gdb/config/m68k/sun2os3.mt
    gdb/config/m68k/sun2os4.mh
    gdb/config/m68k/sun2os4.mt
    gdb/config/m68k/sun3os3.mh
    gdb/config/m68k/sun3os3.mt
    gdb/config/m68k/sun3os4.mh
    gdb/config/m68k/sun3os4.mt
    gdb/config/m68k/tm-3b1.h
    gdb/config/m68k/tm-delta68.h
    gdb/config/m68k/tm-dpx2.h
    gdb/config/m68k/tm-m68klynx.h
    gdb/config/m68k/tm-m68kv4.h
    gdb/config/m68k/tm-sun2.h
    gdb/config/m68k/tm-sun2os4.h
    gdb/config/m68k/tm-sun3.h
    gdb/config/m68k/tm-sun3os4.h
    gdb/config/m68k/xm-3b1.h
    gdb/config/m68k/xm-delta68.h
    gdb/config/m68k/xm-dpx2.h
    gdb/config/m68k/xm-m68kv4.h
    gdb/config/m68k/xm-nbsd.h
    gdb/config/m68k/xm-sun2.h
    gdb/config/m68k/xm-sun3.h
    gdb/config/m68k/xm-sun3os4.h
    gdb/config/mips/decstation.mh
    gdb/config/mips/littlemips.mh
    gdb/config/mips/mipsv4.mh
    gdb/config/mips/mipsv4.mt
    gdb/config/mips/news-mips.mh
    gdb/config/mips/nm-mips.h
    gdb/config/mips/nm-news-mips.h
    gdb/config/mips/nm-riscos.h
    gdb/config/mips/riscos.mh
    gdb/config/mips/tm-mipsv4.h
    gdb/config/mips/xm-mips.h
    gdb/config/mips/xm-mipsv4.h
    gdb/config/mips/xm-riscos.h
    gdb/config/sparc/tm-nbsd64.h
    gdb/config/tm-sunos.h
    gdb/delta68-nat.c
    gdb/dpx2-nat.c
    gdb/i386-interix-nat.c
    gdb/i386-interix-tdep.c
    gdb/m68knbsd-nat.c
    gdb/m68knbsd-tdep.c
    gdb/observer.h
    gdb/sun3-nat.c
    gdb/testsuite/gdb.base/gdb1476.c
    gdb/testsuite/gdb.base/gdb1476.exp
    gdb/testsuite/gdb.cp/pr-1553.cc
    gdb/testsuite/gdb.cp/pr-1553.exp
    gdb/testsuite/gdb.java/jmisc2.exp
    gdb/xmodem.c
    gdb/xmodem.h
    include/mpw/ChangeLog
    include/mpw/README
    include/mpw/dir.h
    include/mpw/dirent.h
    include/mpw/fcntl.h
    include/mpw/grp.h
    include/mpw/mpw.h
    include/mpw/pwd.h
    include/mpw/spin.h
    include/mpw/stat.h
    include/mpw/sys/file.h
    include/mpw/sys/param.h
    include/mpw/sys/resource.h
    include/mpw/sys/stat.h
    include/mpw/sys/time.h
    include/mpw/sys/types.h
    include/mpw/utime.h
    include/mpw/varargs.h
    mpw-README
    mpw-build.in
    mpw-config.in
    mpw-configure
    mpw-install
    opcodes/mpw-config.in
    opcodes/mpw-make.sed
    sim/mn10300/gencode.c
    sim/mn10300/simops.c
diff --git a/ChangeLog b/ChangeLog
index 56ba3dc..799db0a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,344 @@
+2004-07-08  Alexandre Oliva  <aoliva@redhat.com>
+
+	* Makefile.def (host_modules): Set bootstrap=true for flex.
+	* Makefile.tpl (all-gcc): Depend on texinfo and flex.
+	* Makefile.in: Rebuilt.
+
+2004-07-01  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.def (build_modules): Add bison, byacc, flex,
+	m4, texinfo.
+	(flags_to_pass): Add FLEX.
+	* Makefile.tpl (BUILD_DIR_PREFIX, BASE_EXPORTS): New.
+	(BUILD_EXPORTS, HOST_EXPORTS, BASE_TARGET_EXPORTS): Include it.
+	(DEFAULT_YACC, USUAL_YACC, DEFAULT_LEX, USUAL_LEX, DEFAULT_M4,
+	DEFAULT_MAKEINFO): Remove.
+	(CONFIGURED_YACC, CONFIGURED_FLEX, CONFIGURED_BISON,
+	CONFIGURED_LEX, CONFIGURED_M4, CONFIGURED_MAKEINFO): Substitute.
+	(YACC, FLEX, BISON, LEX, M4, MAKEINFO): Define to look into
+	objdir or else use configured tool.
+	(all-build): New.
+	(all): Depend on it.
+	(Build module dependencies): Add.
+	* Makefile.in: Regenerate.
+	* configure.in: Better support for multiple build modules,
+	matching what is done for host/target modules.  Do not look
+	for "plausible" locations of build tools if Canadian cross.
+	Use autoconf's AC_PROG_CC to find a C compiler.  Define
+	BUILD_DIR_PREFIX.  Look for flex, makeinfo and m4.
+	* configure: Regenerate.
+
+2004-06-22  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.tpl (HOST_EXPORTS): Fix pasto.
+	* Makefile.in: Regenerate.
+
+2004-06-22  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.tpl (configure-build-[+module+],
+	configure-[+module+], configure-target-[+module+]): Pass
+	[+extra_configure_args+].
+	(all-build-[+module+], all-[+module+], check-[+module+],
+	install-[+module+], [+make_target+]-[+module+],
+	all-target-[+module+], check-target-[+module+],
+	install-target-[+module+], [+make_target+]-target-[+module+]):
+	Pass [+extra_make_args+].
+	(HOST_EXPORTS): Include the former GCC_HOST_EXPORTS.
+	(GCC_HOST_EXPORTS): Remove.
+	(configure-gcc, all-gcc, GCC_STRAP_TARGETS, profiledbootstrap,
+	cross, check-gcc, check-gcc-c++, install-gcc,
+	gcc-no-fixedincludes, [+make_target+]-gcc, stage[+id+]-bubble):
+	Replace GCC_HOST_EXPORTS with HOST_EXPORTS.
+	* Makefile.in: Regenerate.
+
+2004-06-21  Christopher Faylor  <cgf@alum.bu.edu>
+
+	* configure.in: Check for srcdir/winsup rather than build directory
+	winsup.
+	* configure: Regenerate.
+
+2004-06-17  Corinna Vinschen  <vinschen@redhat.com>
+
+	* configure.in: Don't build Cygwin native newlib if winsup
+	directory is missing.  Emit warning instead.
+	* configure: Regenerate.
+
+2004-06-09  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.tpl (touch-stage[+id+]): New.
+	(restage[+prev+]): Depend on touch-stage[+id+].
+
+	* Makefile.tpl (RECURSE_FLAGS_TO_PASS): New.
+	Use it throughout.
+
+	* Makefile.def: Add profile and feedback bootstrap stages.
+	Remove next field from bootstrap stages.
+	* Makefile.tpl (LN, LN_S): Substitute.
+	(stageN-start, stageN-end): Use double-colon rules, to
+	provide a hook for additional setup commands.
+	(distclean-stageN-gcc, restageN): Create dependencies from
+	[+prev+], not from [+next+].
+	(stageN-bubble): Add commands for successive stages from
+	[+prev+], using double-colon rules.
+	(all-stageN-gcc): Fix typo.
+	(stagefeedback-start, profiledbootstrap): New.
+	* Makefile.in: Regenerate.
+	* configure.in: Call ACX_PROG_LN.
+	* configure: Regenerate.
+
+2004-06-03  Paolo Bonzini  <bonzini@gnu.org>
+
+	* configure.in: Fix --enable-bootstrap breakage introduced in trees
+	without gcc.
+	* configure: Regenerate.
+
+2004-06-01  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.tpl: Fix typo.
+	* Makefile.in: Regenerate.
+
+2004-06-01  Paolo Bonzini <bonzini@gnu.org>
+
+	* configure.in: Remove new- prefix from toplevel
+	bootstrap targets.
+	* configure: Regenerate.
+
+2004-06-01  Paolo Bonzini <bonzini@gnu.org>
+
+	Merge this patch from the gcc tree:
+
+	2004-05-30  Andreas Jaeger  <aj@suse.de>
+		    Jim Wilson <wilson@specifixinc.com>
+
+	* config-ml.in: Pass FFLAGS and ADAFLAGS for multilibs, handle F77
+	like CC.
+
+2004-06-01  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.tpl (all.normal): Rename to all.
+	(all): Replace with a rule to pick the default
+	target from configure.
+	(all-gcc, configure-gcc): Use conditionals to
+	do nothing when toplevel bootstrap is going on.
+	(GCC directory bootstrap) [gcc-bootstrap]: Disable.
+	(Toplevel bootstrap) [gcc-no-bootstrap]: Disable.
+	* configure.in: Support --enable-bootstrap.
+
+	* Makefile.def: Remove new- prefix from toplevel
+	bootstrap targets.
+	* Makefile.tpl: Likewise.
+
+	* Makefile.def: Add bootstrap_stage 4.  Add bootstrap2
+	target.
+
+	* Makefile.tpl (Toplevel bootstrap): Pass $(BASE_FLAGS_TO_PASS)
+	$(RECURSE_FLAGS) to recursive invocation of make.
+
+	* Makefile.in: Regenerate.
+	* configure: Regenerate.
+
+2004-05-27  Daniel Jacobowitz  <dan@debian.org>
+
+	* configure.in: Fix sed invocation for GFORTRAN_FOR_TARGET.
+	* configure: Regenerate.
+
+2004-05-25  Daniel Jacobowitz  <drow@false.org>
+
+	* Makefile.tpl (BUILD_EXPORTS, HOST_EXPORTS, GCC_HOST_EXPORTS)
+	(STAGE_HOST_EXPORTS, BASE_TARGET_EXPORTS, RAW_CXX_TARGET_EXPORTS)
+	(NORMAL_TARGET_EXPORTS): New macros.  Use them in all the recursive
+	targets.
+	* Makefile.in: Regenerate.
+
+2005-05-24  Paolo Bonzini <bonzini@gnu.org>
+
+	* configure.in: Test the ability to symlink directories.
+	* configure: Regenerate.
+
+	* Makefile.def (bootstrap-stage): New definitions.
+	* Makefile.tpl (configure-stage1-gcc,
+	configure-stage2-gcc, configure-stage3-gcc,
+	all-stage1-gcc, all-stage2-gcc, all-stage3-gcc,
+	new-bootstrap, new-cleanstrap, new-restage1, new-restage2,
+	new-restage3, compare): Autogenerate, see Makefile.in
+	entry for behavioral changes.
+	(distclean-stage1, new-stage1-start, new-stage1-end,
+	new-stage1-bubble, distclean-stage2, new-stage2-start,
+	new-stage2-end, new-stage2-bubble, distclean-stage3,
+	new-stage3-start, new-stage3-end): New autogenerated targets.
+	(objext, prebootstrap, BOOT_CFLAGS,
+	POSTSTAGE1_FLAGS_TO_PASS): Move above the autogenerated
+	targets.
+
+	* Makefile.in: Regenerate.
+	(distclean-stage1, new-stage1-start, new-stage1-end,
+	new-stage1-bubble, distclean-stage2, new-stage2-start,
+	new-stage2-end, new-stage2-bubble, distclean-stage3,
+	new-stage3-start, new-stage3-end): New targets.
+	(all-stage1-gcc): Move prebootstrap dependency from here...
+	(configure-stage1-gcc): ...to here.
+	(new-bootstrap): Use bubble targets.
+	(new-cleanstrap, new-restage1, new-restage2, new-restage3):
+	Use per-stage distclean targets.
+	(configure-stage1-gcc, configure-stage2-gcc,
+	configure-stage3-gcc, all-stage1-gcc,
+	all-stage2-gcc, all-stage3-gcc, new-bootstrap):
+	Use new-stageN-start to prepare the tree.
+
+2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.def (host_modules): add libcpp.
+	* Makefile.tpl: Add dependencies on and for libcpp.
+	* Makefile.in: Regenerate.
+	* configure.in: Add libcpp host module.
+	* configure: Regenerate.
+
+2004-05-17  Zack Weinberg  <zack@codesourcery.com>
+
+	* Makefile.def, Makefile.tpl, configure.in: Remove all mention
+	of libf2c.
+	* configure, Makefile.in: Regenerate.
+
+2004-05-13  Diego Novillo  <dnovillo@redhat.com>
+
+	Merge from tree-ssa-20020619-branch.
+
+	* Makefile.def: Add libbanshee, libmudflap and libgfortran.
+	* Makefile.tpl (BUILD_CONFIGDIRS): Add libbanshee.
+	(HOST_GMPLIBS): Define.
+	(HOST_GMPINC): Define.
+	(TARGET_LIB_PATH): Add libmudflap.
+	(GFORTRAN_FOR_TARGET): Define.
+	(configure-build*): Export GFORTRAN.
+	(configure-gcc): Export GMPLIBS and GMPINC.
+	(all-gcc): Add maybe-all-libbanshee.
+	(configure-target-libgfortran): Define.
+	* Makefile.in: Regenerate.
+	* configure.in (host_libs): Add libbanshee.
+	(target_libraries): Add target-libmudflap and target-libgfortran.
+	Add --with-libbanshee.
+	Handle --disable-libmudflap.
+	(*-*-freebsd*): Use with_gmp.
+	Add $(libgcj) to noconfigdirs.
+	* configure: Regenerate.
+	* depcomp: New file.
+	* MAINTAINERS: Add tree-ssa maintainers.
+
+2004-04-28  Paolo Bonzini  <bonzini@gnu.org>
+
+	* config/acx.m4: Fix fastcompare support for new-bootstrap.
+	* configure: Regenerate.
+
+2004-04-27  Paolo Bonzini  <bonzini@gnu.org>
+
+	Revert:
+	2004-04-26  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.def (flags_to_pass): Remove *dir variables that
+	are passed to the modules via TOPLEVEL_CONFIGURE_ARGUMENTS,
+	as well as prefix and exec_prefix.
+	* Makefile.in: Regenerate.
+
+2004-04-26  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.def (host_modules): Mark with the bootstrap
+	flag packages on which gcc depends.
+	* Makefile.tpl (all-bootstrap): Use it.
+	* Makefile.in: Regenerate.
+
+2004-04-26  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.def (flags_to_pass): Remove *dir variables that
+	are passed to the modules via TOPLEVEL_CONFIGURE_ARGUMENTS,
+	as well as prefix and exec_prefix.
+	* Makefile.in: Regenerate.
+
+2004-04-26  Paolo Bonzini  <bonzini@gnu.org>
+
+	* configure.in: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
+	* configure: Regenerate.
+	* config/acx.m4: Mutuate ACX_PROG_CMP_IGNORE_INITIAL from gcc.
+	* gcc/Makefile.tpl (compare): Use the result of the test.
+	* gcc/Makefile.in: Regenerate.
+
+2004-04-23  Paolo Bonzini  <bonzini@gnu.org>
+
+	* Makefile.tpl (all-stage1-gcc, all-stage2-gcc, all-stage3-gcc):
+	Always relocate gcc and prev-gcc to the original names, even
+	if the build fails.
+	(new-cleanstrap, new-restage1, new-restage2, new-restage3):
+	New targets.
+
+2004-04-19  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* configure.in (mips*-*-irix5*): Enable ld.
+	* configure: Regenerate.
+
+2004-04-15  James E Wilson  <wilson@specifixinc.com>
+
+	* Makefile.tpl (configure-[+module+], configure-gcc,
+	configure-stage1-gcc, configure-stage2-gcc, configure-stage3-gcc):
+	Set and export LDFLAGS.
+	* Makefile.in: Regenerate.
+
+2004-04-09  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+	PR bootstrap/14871
+	* Makefile.tpl: If we don't have built-in-tree target tools,
+	use the ones found by configure rather than hacking around with
+	program_transform_name.
+	* configure.in: Give Makefile.tpl the information necessary
+	to do that.
+	* Makefile.in: Regenerate.
+	* configure: Regenerate.
+
+2004-04-06  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+	PR bootstrap/14760
+	* configure.in: When computing baseargs, strip *all* copies of
+	offending options.  Also, don't match/substitute the trailing space,
+	so that this actually works when two similar options are separated by
+	only one space.
+	* configure: Regenerate.
+
+2004-04-06  David Edelsohn  <edelsohn@gnu.org>
+
+	* configure.in (powerpc-*-aix*): Remove target-libada from noconfigdirs.
+	(rs6000-*-aix*): Same.
+	* configure: Regenerate.
+
+2004-03-25  Stan Shebs  <shebs@apple.com>
+
+	Remove MPW support, no longer used.
+	* mpw-README, mpw-build.in, mpw-config.in, mpw-configure,
+	mpw-install: Remove files.
+	* src-release (DEVO_SUPPORT): Remove names of removed files.
+	* MAINTAINERS: Likewise.
+
+2004-03-24  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+	* Makefile.tpl (top level bootstrap support): Remove now-unneeded
+	STRICT_WARN, WARN_CFLAGS flags passed down to make.
+	* Makefile.in: Regenerate.
+
+	* configure.in (top level bootstrap support): Rework --enable-werror
+	to set @stage2_werror_flag@.
+	* configure: Regenerate.
+	* Makefile.tpl (top level bootstrap support): Pass
+	@stage2_werror_flag@ down to configure in stages 2 and 3.
+	* Makefile.in: Regenerate.
+
+2004-03-23  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+	* Makefile.tpl (new-bootstrap): Set CC and CC_FOR_BUILD in configure
+	for stages 2 and 3 as well as in make.  As a consequence, remove
+	OUTPUT_OPTION (now detected by configure) from the flags passed down
+	to make.
+	* Makefile.in: Regenerate.
+
+	* Makefile.tpl (new-bootstrap): Fix typo.
+	* Makefile.in: Regenerate.
+
 2004-03-22  Nathanael Nerode  <neroden@gcc.gnu.org>
 
 	* Makefile.tpl: Rearrange by moving recursive_targets rules
@@ -28,10 +369,10 @@
 	* Makefile.in: Regenerate.
 
 2004-03-15  Paolo Bonzini  <bonzini@gnu.org>
-            Nathanael Nerode  <neroden@gcc.gnu.org>
+	    Nathanael Nerode  <neroden@gcc.gnu.org>
 
 	* configure.in (DEFAULT_YACC, DEFAULT_M4, DEFAULT_LEX):
-        Set with AC_CHECK_PROGS.
+	Set with AC_CHECK_PROGS.
 	* configure.in: Fix comment typo from last patch.
 	* configure: Regenerate.
 
@@ -43,14 +384,14 @@
 	* configure: Regenerate.
 
 2004-03-12  Eric Botcazou  <ebotcazou@gcc.gnu.org>
-            Paolo Bonzini  <bonzini@gnu.org>
+	    Paolo Bonzini  <bonzini@gnu.org>
 
 	PR bootstrap/14522
 	* configure.in: Cope with shells that do not support unquoted ^
 	* configure: Regenerate.
 
 2004-03-11  Eric Botcazou  <ebotcazou@gcc.gnu.org>
-            Paolo Bonzini  <bonzini@gnu.org>
+	    Paolo Bonzini  <bonzini@gnu.org>
 
 	PR bootstrap/14522
 	* configure.in: Cope with shell that do not support nesting
@@ -125,7 +466,7 @@
 	    Nathanael Nerode  <neroden@gcc.gnu.org>
 
 	PR ada/6637, PR ada/5911
-        Merge with libada-branch:
+	Merge with libada-branch:
 	* configure.in, Makefile.tpl, Makefile.def: Add target-libada,
 	with appropriate dependencies. Add --enable-libada configure switch.
 	* configure, Makefile.in: Regenerate.
@@ -138,14 +479,14 @@
 2004-02-02  Jeff Johnston  <jjohnstn@redhat.com>
 
 	* COPYING.NEWLIB: Update Red Hat license to 2004.
-	
+
 2004-01-23  DJ Delorie  <dj@redhat.com>
 
 	* Makefile.def (target_modules) [libiberty]: Don't stage.
 	* Makefile.in: Rebuilt.
 
 2004-01-23  Jeff Johnston  <jjohnstn@redhat.com>
-	
+
 	* COPYING.NEWLIB: Update to include copyrights for new
 	iconv code.
 
@@ -197,7 +538,7 @@
 	* configure: Regenerated.
 
 2003-12-21  Bernardo Innocenti  <bernie@develer.com>
- 
+
  	* configure.in (*-*-uclinux): Exclude newlib, libgloss and rda.
  	* configure: Regenerated.
 
@@ -217,7 +558,7 @@
 
 2003-11-27  Jeff Johnston  <jjohnstn@redhat.com>
 
-        * COPYING.NEWLIB: Add license info for long long routines added to
+	* COPYING.NEWLIB: Add license info for long long routines added to
 	stdlib.
 
 2003-11-14  Arnaud Charlet  <charlet@act-europe.fr>
@@ -297,7 +638,7 @@
 2003-09-04  Robert Millan  <robertmh@gnu.org>
 
 	* configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet.
-	
+
 2003-09-02  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
 	* configure.in: Ensure arguments to sed are properly spaced.
@@ -328,7 +669,7 @@
 	* configure.in: When testing with_libs and with_headers, treat
 	'no' as unset.  Based on a patch by Dan Kegel <dank@kegel.com>.
 	* configure: Regenerate.
-	
+
 	* configure.in (TOPLEVEL_CONFIGURE_ARGUMENTS): Quote properly for
 	make, shell, etc.
 	(baseargs): Likewise.
@@ -460,14 +801,14 @@
 
 	* configure.in: Update testsuite_flags to new location.
 	* configure. Regenerate.
-	
+
 2003-06-18  Nathanael Nerode  <neroden@gcc.gnu.org>
 
 	* Makefile.tpl: Remove BUILD_CC stuff.
 	* Makefile.in: Regenerate.
 
 2003-06-14  H.J. Lu <hongjiu.lu@intel.com>
- 
+
 	* config.guess: Update to 2003-06-12 version.
 	* config.sub: Update to 2003-06-13 version.
 
@@ -476,7 +817,7 @@
 	* MAINTAINERS: Add myself as MIPS co-maintainer.
 
 2003-06-12  H.J. Lu <hongjiu.lu@intel.com>
- 
+
 	* config.guess: Update to 2003-06-06 version.
 	* config.sub: Update to 2003-06-06 version.
 
@@ -541,10 +882,10 @@
 
 2003-05-28  Jeff Johnston  <jjohnstn@redhat.com>
 
-        * COPYING.NEWLIB: Add license info for newlib/libc/sys/linux/stdlib.
+	* COPYING.NEWLIB: Add license info for newlib/libc/sys/linux/stdlib.
 
 2003-05-21  DJ Delorie  <dj@redhat.com>
-	
+
 	* Makefile.tpl (configure-target-libiberty): Depend only on gcc, not
 	newlib or libgloss.
 	* Makefile.in: Regenerate.
@@ -562,7 +903,7 @@
 2003-05-19  Nathanael Nerode  <neroden@gcc.gnu.org>
 
 	* configure.in: Switch more things to use maybe dependencies.
-	* Makefile.tpl: Switch more things to use maybe dependencies.  
+	* Makefile.tpl: Switch more things to use maybe dependencies.
 	Factor out common code from autogen IF statements.
 	* configure: Regenerate.
 	* Makefile.in: Regenerate.
@@ -608,8 +949,8 @@
 
 2003-05-02  Chris Demetriou  <cgd@broadcom.com>
 
-        * Makefile.tpl: Require "makeinfo" from texinfo 4.2 or later.
-        * Makefile.in: Regenerate.
+	* Makefile.tpl: Require "makeinfo" from texinfo 4.2 or later.
+	* Makefile.in: Regenerate.
 
 2003-04-27  Daniel Jacobowitz  <drow@mvista.com>
 
@@ -856,8 +1197,8 @@
 
 2003-01-07  Christopher Faylor  <cgf@redhat.com>
 
-        * configure.in: Add AC_PREREQ for consistency.
-        * configure: Regenerate.
+	* configure.in: Add AC_PREREQ for consistency.
+	* configure: Regenerate.
 
 2003-01-06  Andrew Cagney  <ac131313@redhat.com>
 
@@ -1028,9 +1369,9 @@
 
 2002-12-12  Jeff Johnston  <jjohnstn@redhat.com>
 
-        * COPYING.NEWLIB: Update list of alternate Regent of California
-        licenses and discuss official revoking of advertising clause.
-        * COPYING.LIBGLOSS: Ditto.
+	* COPYING.NEWLIB: Update list of alternate Regent of California
+	licenses and discuss official revoking of advertising clause.
+	* COPYING.LIBGLOSS: Ditto.
 
 2002-12-12  Alexandre Oliva  <aoliva@redhat.com>
 
@@ -3149,7 +3490,7 @@
 	Bad merge removed these two changes.
 
 Tue Apr 13 22:50:54 1999  Donn Terry (donn@interix.com)
-	                  Martin Heller (Ing.-Buero_Heller@t-online.de)
+			  Martin Heller (Ing.-Buero_Heller@t-online.de)
 
 	* config.guess (interix Alpha): Add.
 
@@ -5458,8 +5799,8 @@
 Sun Jun 23 22:41:54 1996  Geoffrey Noer  <noer@cygnus.com>
 
 	* configure.in: enable dosrel for cygwin32-hosted builds,
-	        remove diff from the list of things not buildable
-	        via Canadian Cross
+		remove diff from the list of things not buildable
+		via Canadian Cross
 
 Sat Jun 22 11:39:01 1996  Jason Merrill  <jason@yorick.cygnus.com>
 
diff --git a/MAINTAINERS b/MAINTAINERS
index c9ad6b3..8c9696b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4,7 +4,7 @@
 COPYING, COPYING.LIB, README
 	http://gnu.org.
 
-Makefile.in; configure; configure.in; src-release
+Makefile.*; configure; configure.in; src-release
 	Please notify the following of any committed patches.
 		binutils@sources.redhat.com
 		gdb-patches@sources.redhat.com
@@ -21,8 +21,7 @@
 	May need separate opcodes/ or sim/ approval for
 		commits of regenerated files there.
 
-config.guess; config.sub; dejagnu/config.guess; dejagnu/config.sub;
-readline/support/config.sub; readline/support/config.guess
+config.guess; config.sub; readline/support/config.{sub,guess}
 	config: http://savannah.gnu.org/projects/config
 	Patches to config-patches@gnu.org.
 	Changes need to be done in tandem with the official CONFIG
@@ -36,10 +35,6 @@
 dejagnu/
 	dejagnu: http://www.gnu.org/software/dejagnu/
 	Patches to bug-dejagnu@gnu.org
-	Avoid making changes to the local repository; please send
-	patches upstream.  Important and approved patches can be
-	checked into the src repository, otheriwse patches will be
-	imported from the next release.
 
 gdb/; mmalloc/; readline/; sim/; GDB's part of include/ & dejagnu/
 	gdb: http://sources.redhat.com/gdb/
@@ -59,8 +54,8 @@
 	Otherwise, changes are automatically merged, usually within
 	a day.
 
-ltconfig; ltmain.sh
-	libtool: http://gnu.org
+ltconfig; ltmain.sh; ltcf-*.sh
+	libtool: http://www.gnu.org/software/libtool/
 	Changes need to be done in tandem with the official LIBTOOL
 	sources or submitted to the master file maintainer and brought
 	in via a merge.
@@ -80,7 +75,7 @@
 	http://sources.redhat.com/newlib/
 	Patches to newlib@sources.redhat.com.
 
-sid/; SID's part of cgen/ & dejagnu/
+sid/; SID's part of cgen/
 	sid: http://sources.redhat.com/sid/
 	Patches to sid@sources.redhat.com
 
@@ -100,10 +95,8 @@
 	General discussion cygwin@sources.redhat.com.
 	See also winsup/MAINTAINERS.
 
-expect/; config-ml.in; mpw-README; mpw-build.in; mpw-config.in;
-mpw-configure; mpw-install; setup.com; missing; makefile.vms; utils/;
-config/; config.if; makefile.vms; missing; ylwrap; mkdep; etc/;
-install-sh; intl/
+config-ml.in; setup.com; missing; makefile.vms; utils/; config/;
+config.if; makefile.vms; missing; ylwrap; mkdep; etc/; install-sh; intl/
 	Ask DJ Delorie <dj@redhat.com> after reading the libiberty entry.
 
 modules file
diff --git a/Makefile.def b/Makefile.def
index 5a68098..21f2c7c 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -25,6 +25,12 @@
 // that recursive target in its Makefile.
 
 build_modules= { module= libiberty; };
+build_modules= { module= libbanshee; };
+build_modules= { module= bison; };
+build_modules= { module= byacc; };
+build_modules= { module= flex; };
+build_modules= { module= m4; };
+build_modules= { module= texinfo; };
 
 host_modules= { module= ash; };
 host_modules= { module= autoconf; };
@@ -32,9 +38,9 @@
 host_modules= { module= bash; };
 host_modules= { module= bfd; };
 host_modules= { module= opcodes; };
-host_modules= { module= binutils; };
-host_modules= { module= bison; no_check_cross= true; };
-host_modules= { module= byacc; no_check_cross= true; };
+host_modules= { module= binutils; bootstrap=true; };
+host_modules= { module= bison; no_check_cross= true; bootstrap=true; };
+host_modules= { module= byacc; no_check_cross= true; bootstrap=true; };
 host_modules= { module= bzip2; };
 host_modules= { module= dejagnu; };
 host_modules= { module= diff; };
@@ -44,8 +50,8 @@
 host_modules= { module= fileutils; };
 host_modules= { module= findutils; };
 host_modules= { module= find; };
-host_modules= { module= flex; no_check_cross= true; };
-host_modules= { module= gas; };
+host_modules= { module= flex; no_check_cross= true; bootstrap=true; };
+host_modules= { module= gas; bootstrap=true; };
 host_modules= { module= gawk; };
 host_modules= { module= gettext; };
 host_modules= { module= gnuserv; };
@@ -53,13 +59,15 @@
 host_modules= { module= gzip; };
 host_modules= { module= hello; };
 host_modules= { module= indent; };
-host_modules= { module= intl; };
+host_modules= { module= intl; bootstrap=true; };
 host_modules= { module= tcl;
                 missing=mostlyclean; };
 host_modules= { module= itcl; };
-host_modules= { module= ld; };
+host_modules= { module= ld; bootstrap=true; };
+host_modules= { module= libcpp; bootstrap=true; };
 host_modules= { module= libgui; };
-host_modules= { module= libiberty; };
+host_modules= { module= libbanshee; bootstrap=true; no_install=true; };
+host_modules= { module= libiberty; bootstrap=true; };
 host_modules= { module= libtool; };
 host_modules= { module= m4; };
 host_modules= { module= make; };
@@ -77,13 +85,13 @@
 host_modules= { module= sid; };
 host_modules= { module= sim; };
 host_modules= { module= tar; };
-host_modules= { module= texinfo; no_install= true; };
+host_modules= { module= texinfo; no_install= true; bootstrap=true; };
 host_modules= { module= textutils; };
 host_modules= { module= time; };
 host_modules= { module= uudecode; };
 host_modules= { module= wdiff; };
 host_modules= { module= zip; no_check_cross=true; };
-host_modules= { module= zlib; no_install=true; no_check=true; };
+host_modules= { module= zlib; no_install=true; no_check=true; bootstrap=true; };
 host_modules= { module= gdb; with_x=true; };
 host_modules= { module= expect; with_x=true; };
 host_modules= { module= guile; with_x=true; };
@@ -97,8 +105,9 @@
 host_modules= { module= utils; no_check=true; };
 
 target_modules = { module= libstdc++-v3; raw_cxx=true; };
+target_modules = { module= libmudflap; };
 target_modules = { module= newlib; };
-target_modules = { module= libf2c; };
+target_modules = { module= libgfortran; };
 target_modules = { module= libobjc; };
 target_modules = { module= libtermcap; no_check=true; stage=true;
                    missing=mostlyclean;
@@ -173,6 +182,7 @@
 flags_to_pass = { flag= CC_FOR_BUILD ; };
 flags_to_pass = { flag= CXX_FOR_BUILD ; };
 flags_to_pass = { flag= EXPECT ; };
+flags_to_pass = { flag= FLEX ; };
 flags_to_pass = { flag= INSTALL ; };
 flags_to_pass = { flag= INSTALL_DATA ; };
 flags_to_pass = { flag= INSTALL_PROGRAM ; };
@@ -202,9 +212,43 @@
 flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; };
 flags_to_pass = { flag= GCJ_FOR_TARGET ; };
+flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; };
 flags_to_pass = { flag= LD_FOR_TARGET ; };
 flags_to_pass = { flag= LIBCFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= LIBCXXFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= NM_FOR_TARGET ; };
 flags_to_pass = { flag= RANLIB_FOR_TARGET ; };
 flags_to_pass = { flag= WINDRES_FOR_TARGET ; };
+
+// Toplevel bootstrap
+bootstrap_stage = {
+	id=1 ;
+	extra_configure_flags='--disable-intermodule \
+	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"' ;
+	extra_make_flags='CFLAGS="$(STAGE1_CFLAGS)"' ; };
+bootstrap_stage = {
+	id=2 ; prev=1 ;
+	bootstrap_target=bootstrap2 ;
+	extra_configure_flags="@stage2_werror_flag@" ;
+	extra_make_flags="" ; };
+bootstrap_stage = {
+	id=3 ; prev=2 ;
+	compare_target=compare ;
+	bootstrap_target=bootstrap ;
+	cleanstrap_target=cleanstrap ;
+	extra_configure_flags="@stage2_werror_flag@" ;
+	extra_make_flags="" ; };
+bootstrap_stage = {
+	id=4 ; prev=3 ;
+	compare_target=compare3 ;
+	bootstrap_target=bootstrap4 ;
+	extra_configure_flags="@stage2_werror_flag@" ;
+	extra_make_flags="" ; };
+bootstrap_stage = {
+	id=profile ; prev=1 ;
+	extra_configure_flags="@stage2_werror_flag@" ;
+	extra_make_flags='CFLAGS="$(BOOT_CFLAGS) -fprofile-generate"' ; };
+bootstrap_stage = {
+	id=feedback ; prev=1 ;
+	extra_configure_flags="@stage2_werror_flag@" ;
+	extra_make_flags='CFLAGS="$(BOOT_CFLAGS) -fprofile-use"' ; };
diff --git a/Makefile.in b/Makefile.in
index 68f43e6..489c642 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3,7 +3,7 @@
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002, 2003 Free Software Foundation
+#   1999, 2000, 2001, 2002, 2003, 2004 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
@@ -65,6 +65,8 @@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_DATA = @INSTALL_DATA@
+LN = @LN@
+LN_S = @LN_S@
 
 # -------------------------------------------------
 # Miscellaneous non-standard autoconf-set variables
@@ -102,18 +104,79 @@
   $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
 # This is the list of directories to be built for the build system.
-BUILD_CONFIGDIRS = libiberty
+BUILD_CONFIGDIRS = libiberty libbanshee
 # Build programs are put under this directory.
 BUILD_SUBDIR = @build_subdir@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the build system.
 BUILD_CONFIGARGS = @build_configargs@
 
+# This is the list of variables to export in the environment when
+# configuring any subdirectory.  It must also be exported whenever
+# recursing into a build directory in case that directory's Makefile
+# re-runs configure.
+BASE_EXPORTS = \
+	FLEX="$(FLEX)"; export FLEX; \
+	LEX="$(LEX)"; export LEX; \
+	BISON="$(BISON)"; export BISON; \
+	YACC="$(YACC)"; export YACC; \
+	M4="$(M4)"; export M4; \
+	MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
+
+# This is the list of variables to export in the environment when
+# configuring subdirectories for the build system.
+BUILD_EXPORTS = \
+	$(BASE_EXPORTS) \
+	AR="$(AR_FOR_BUILD)"; export AR; \
+	AS="$(AS_FOR_BUILD)"; export AS; \
+	CC="$(CC_FOR_BUILD)"; export CC; \
+	CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+	CXX="$(CXX_FOR_BUILD)"; export CXX; \
+	CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+	GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+	GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
+	DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
+	LD="$(LD_FOR_BUILD)"; export LD; \
+	LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
+	NM="$(NM_FOR_BUILD)"; export NM; \
+	RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
+	WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES;
+
 # This is the list of directories to built for the host system.
 SUBDIRS = @configdirs@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the host system.
 HOST_CONFIGARGS = @host_configargs@
+# This is the list of variables to export in the environment when
+# configuring subdirectories for the host system.
+HOST_EXPORTS = \
+	$(BASE_EXPORTS) \
+	CC="$(CC)"; export CC; \
+	CFLAGS="$(CFLAGS)"; export CFLAGS; \
+	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+	CXX="$(CXX)"; export CXX; \
+	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
+	AR="$(AR)"; export AR; \
+	AS="$(AS)"; export AS; \
+	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
+	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
+	LD="$(LD)"; export LD; \
+	LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
+	NM="$(NM)"; export NM; \
+	RANLIB="$(RANLIB)"; export RANLIB; \
+	WINDRES="$(WINDRES)"; export WINDRES; \
+	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
+	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
+	GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
+	GMPINC="$(HOST_GMPINC)"; export GMPINC;
+
+# Similar, for later GCC stages.
+STAGE_HOST_EXPORTS = \
+	$(HOST_EXPORTS) \
+	CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
+	CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD;
 
 # This is set by the configure script to the list of directories which
 # should be built using the target tools.
@@ -123,6 +186,38 @@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the target.
 TARGET_CONFIGARGS = @target_configargs@
+# This is the list of variables to export in the environment when
+# configuring subdirectories for the host system.
+BASE_TARGET_EXPORTS = \
+	$(BASE_EXPORTS) \
+	AR="$(AR_FOR_TARGET)"; export AR; \
+	AS="$(AS_FOR_TARGET)"; export AS; \
+	CC="$(CC_FOR_TARGET)"; export CC; \
+	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+	GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
+	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+	LD="$(LD_FOR_TARGET)"; export LD; \
+	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+	NM="$(NM_FOR_TARGET)"; export NM; \
+	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES;
+
+RAW_CXX_TARGET_EXPORTS = \
+	$(BASE_TARGET_EXPORTS) \
+	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
+
+NORMAL_TARGET_EXPORTS = \
+	$(BASE_TARGET_EXPORTS) \
+	CXX="$(CXX_FOR_TARGET)"; export CXX;
+
+# Where to find GMP
+HOST_GMPLIBS = @gmplibs@
+HOST_GMPINC = @gmpinc@
 
 # ----------------------------------------------
 # Programs producing files for the BUILD machine
@@ -145,47 +240,55 @@
 
 CXX_FOR_BUILD = $(CXX)
 
+# Path to the build directory for a Canadian cross, empty otherwise.
+BUILD_DIR_PREFIX = @BUILD_DIR_PREFIX@
+
 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
 # here so that they can be overridden by Makefile fragments.
 BUILD_PREFIX = @BUILD_PREFIX@
 BUILD_PREFIX_1 = @BUILD_PREFIX_1@
 
-BISON=@BISON@
-USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \
-	    echo $$r/bison/bison -L $$s/bison/ ; \
+CONFIGURED_BISON = @CONFIGURED_BISON@
+BISON = `if [ -f $$r/$(BUILD_DIR_PREFIX)/bison/bison ] ; then \
+	    echo $$r/$(BUILD_DIR_PREFIX)/bison/bison -L $$s/bison/ ; \
 	 else \
-	    echo bison ; \
+	    echo ${CONFIGURED_BISON} ; \
 	 fi`
 
-DEFAULT_YACC = @DEFAULT_YACC@
-YACC=@YACC@
-USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \
-	    echo $$r/bison/bison -y -L $$s/bison/ ; \
-	elif [ -f $$r/byacc/byacc ] ; then \
-	    echo $$r/byacc/byacc ; \
+CONFIGURED_YACC = @CONFIGURED_YACC@
+YACC = `if [ -f $$s/$(BUILD_DIR_PREFIX)/bison/bison ] ; then \
+	    echo $$r/$(BUILD_DIR_PREFIX)/bison/bison -y -L $$s/bison/ ; \
+	elif [ -f $$s/$(BUILD_DIR_PREFIX)/byacc/byacc ] ; then \
+	    echo $$r/$(BUILD_DIR_PREFIX)/byacc/byacc ; \
 	else \
-	    echo ${DEFAULT_YACC} ; \
+	    echo ${CONFIGURED_YACC} ; \
 	fi`
 
-DEFAULT_LEX = @DEFAULT_LEX@
-LEX=@LEX@
-USUAL_LEX = `if [ -f $$r/flex/flex ] ; \
-	then echo $$r/flex/flex ; \
-	else echo ${DEFAULT_LEX} ; fi`
+CONFIGURED_FLEX = @CONFIGURED_FLEX@
+FLEX = `if [ -f $$r/$(BUILD_DIR_PREFIX)/flex/flex ] ; \
+	then echo $$r/$(BUILD_DIR_PREFIX)/flex/flex ; \
+	else echo ${CONFIGURED_FLEX} ; fi`
 
-DEFAULT_M4 = @DEFAULT_M4@
-M4 = `if [ -f $$r/m4/m4 ] ; \
-	then echo $$r/m4/m4 ; \
-	else echo ${DEFAULT_M4} ; fi`
+CONFIGURED_LEX = @CONFIGURED_LEX@
+LEX = `if [ -f $$r/$(BUILD_DIR_PREFIX)/flex/flex ] ; \
+	then echo $$r/$(BUILD_DIR_PREFIX)/flex/flex ; \
+	else echo ${CONFIGURED_LEX} ; fi`
+
+CONFIGURED_M4 = @CONFIGURED_M4@
+M4 = `if [ -f $$r/$(BUILD_DIR_PREFIX)/m4/m4 ] ; \
+	then echo $$r/$(BUILD_DIR_PREFIX)/m4/m4 ; \
+	else echo ${CONFIGURED_M4} ; fi`
 
 # For an installed makeinfo, we require it to be from texinfo 4.2 or
-# higher, else we use the "missing" dummy.
-MAKEINFO=@MAKEINFO@
-USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
-	then echo $$r/texinfo/makeinfo/makeinfo ; \
-	else if (makeinfo --version \
+# higher, else we use the "missing" dummy.  We also pass the subdirectory
+# makeinfo even if only the Makefile is there, because Texinfo builds its
+# manual when made, and it requires its own version.
+CONFIGURED_MAKEINFO = @CONFIGURED_MAKEINFO@
+MAKEINFO = `if [ -f $$r/$(BUILD_DIR_PREFIX)/texinfo/makeinfo/Makefile ] ; \
+	then echo $$r/$(BUILD_DIR_PREFIX)/texinfo/makeinfo/makeinfo ; \
+	else if (${CONFIGURED_MAKEINFO} --version \
 	  | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \
-        then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
+        then echo ${CONFIGURED_MAKEINFO}; else echo $$s/missing makeinfo; fi; fi`
 
 # This just becomes part of the MAKEINFO definition passed down to
 # sub-makes.  It lets flags be given on the command line while still
@@ -241,11 +344,12 @@
 
 # This is the list of directories that may be needed in RPATH_ENVVAR
 # so that prorgams built for the target machine work.
-TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
+TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libmudflap/.libs
 
 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
 
 AR_FOR_TARGET=@AR_FOR_TARGET@
+CONFIGURED_AR_FOR_TARGET=@CONFIGURED_AR_FOR_TARGET@
 USUAL_AR_FOR_TARGET = ` \
   if [ -f $$r/binutils/ar ] ; then \
     echo $$r/binutils/ar ; \
@@ -253,11 +357,12 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(AR); \
     else \
-       echo ar | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_AR_FOR_TARGET) ; \
     fi; \
   fi`
 
 AS_FOR_TARGET=@AS_FOR_TARGET@
+CONFIGURED_AS_FOR_TARGET=@CONFIGURED_AS_FOR_TARGET@
 USUAL_AS_FOR_TARGET = ` \
   if [ -f $$r/gas/as-new ] ; then \
     echo $$r/gas/as-new ; \
@@ -267,7 +372,7 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(AS); \
     else \
-       echo as | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_AS_FOR_TARGET) ; \
     fi; \
   fi`
 
@@ -293,6 +398,7 @@
 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
 
 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
+CONFIGURED_DLLTOOL_FOR_TARGET=@CONFIGURED_DLLTOOL_FOR_TARGET@
 USUAL_DLLTOOL_FOR_TARGET = ` \
   if [ -f $$r/binutils/dlltool ] ; then \
     echo $$r/binutils/dlltool ; \
@@ -300,13 +406,15 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(DLLTOOL); \
     else \
-       echo dlltool | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_DLLTOOL_FOR_TARGET) ; \
     fi; \
   fi`
 
 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
+GFORTRAN_FOR_TARGET = @GFORTRAN_FOR_TARGET@
 
 LD_FOR_TARGET=@LD_FOR_TARGET@
+CONFIGURED_LD_FOR_TARGET=@CONFIGURED_LD_FOR_TARGET@
 USUAL_LD_FOR_TARGET = ` \
   if [ -f $$r/ld/ld-new ] ; then \
     echo $$r/ld/ld-new ; \
@@ -316,13 +424,14 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(LD); \
     else \
-       echo ld | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_LD_FOR_TARGET) ; \
     fi; \
   fi`
 
 LDFLAGS_FOR_TARGET = 
 
 NM_FOR_TARGET=@NM_FOR_TARGET@
+CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@
 USUAL_NM_FOR_TARGET = ` \
   if [ -f $$r/binutils/nm-new ] ; then \
     echo $$r/binutils/nm-new ; \
@@ -332,11 +441,12 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(NM); \
     else \
-       echo nm | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_NM_FOR_TARGET) ; \
     fi; \
   fi`
 
 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
+CONFIGURED_RANLIB_FOR_TARGET=@CONFIGURED_RANLIB_FOR_TARGET@
 USUAL_RANLIB_FOR_TARGET = ` \
   if [ -f $$r/binutils/ranlib ] ; then \
     echo $$r/binutils/ranlib ; \
@@ -348,11 +458,12 @@
          echo ranlib; \
       fi; \
     else \
-       echo ranlib | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_RANLIB_FOR_TARGET) ; \
     fi; \
   fi`
 
 WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
+CONFIGURED_WINDRES_FOR_TARGET=@CONFIGURED_WINDRES_FOR_TARGET@
 USUAL_WINDRES_FOR_TARGET = ` \
   if [ -f $$r/binutils/windres ] ; then \
     echo $$r/binutils/windres ; \
@@ -360,7 +471,7 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(WINDRES); \
     else \
-       echo windres | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_WINDRES_FOR_TARGET) ; \
     fi; \
   fi`
 
@@ -372,8 +483,7 @@
 
 # The first rule in the file had better be this one.  Don't put any above it.
 # This lives here to allow makefile fragments to contain dependencies.
-all: all.normal
-.PHONY: all
+@default_target@:
 
 #### host and target specific makefile fragments come in here.
 @target_makefile_frag@
@@ -414,6 +524,7 @@
 	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
 	"CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
 	"EXPECT=$(EXPECT)" \
+	"FLEX=$(FLEX)" \
 	"INSTALL=$(INSTALL)" \
 	"INSTALL_DATA=$(INSTALL_DATA)" \
 	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
@@ -439,6 +550,7 @@
 	"CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
 	"DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
 	"GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
+	"GFORTRAN_FOR_TARGET=$(GFORTRAN_FOR_TARGET)" \
 	"LD_FOR_TARGET=$(LD_FOR_TARGET)" \
 	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
 	"LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
@@ -457,6 +569,8 @@
 	CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
 	RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
 
+RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS)
+
 # Flags to pass down to most sub-makes, in which we're building with
 # the host environment.
 EXTRA_HOST_FLAGS = \
@@ -560,7 +674,9 @@
     maybe-configure-tcl \
     maybe-configure-itcl \
     maybe-configure-ld \
+    maybe-configure-libcpp \
     maybe-configure-libgui \
+    maybe-configure-libbanshee \
     maybe-configure-libiberty \
     maybe-configure-libtool \
     maybe-configure-m4 \
@@ -596,8 +712,9 @@
 .PHONY: configure-target
 configure-target:  \
     maybe-configure-target-libstdc++-v3 \
+    maybe-configure-target-libmudflap \
     maybe-configure-target-newlib \
-    maybe-configure-target-libf2c \
+    maybe-configure-target-libgfortran \
     maybe-configure-target-libobjc \
     maybe-configure-target-libtermcap \
     maybe-configure-target-winsup \
@@ -613,10 +730,19 @@
     maybe-configure-target-rda \
     maybe-configure-target-libada
 
-# The target built for a native build.
-.PHONY: all.normal
-all.normal: @all_build_modules@ all-host all-target
+# The target built for a native non-bootstrap build.
+.PHONY: all
+all: all-build all-host all-target
 
+.PHONY: all-build
+all-build:  \
+    maybe-all-build-libiberty \
+    maybe-all-build-libbanshee \
+    maybe-all-build-bison \
+    maybe-all-build-byacc \
+    maybe-all-build-flex \
+    maybe-all-build-m4 \
+    maybe-all-build-texinfo
 .PHONY: all-host
 all-host: maybe-all-gcc  \
     maybe-all-ash \
@@ -650,7 +776,9 @@
     maybe-all-tcl \
     maybe-all-itcl \
     maybe-all-ld \
+    maybe-all-libcpp \
     maybe-all-libgui \
+    maybe-all-libbanshee \
     maybe-all-libiberty \
     maybe-all-libtool \
     maybe-all-m4 \
@@ -686,8 +814,9 @@
 .PHONY: all-target
 all-target:  \
     maybe-all-target-libstdc++-v3 \
+    maybe-all-target-libmudflap \
     maybe-all-target-newlib \
-    maybe-all-target-libf2c \
+    maybe-all-target-libgfortran \
     maybe-all-target-libobjc \
     maybe-all-target-libtermcap \
     maybe-all-target-winsup \
@@ -744,7 +873,9 @@
     maybe-info-tcl \
     maybe-info-itcl \
     maybe-info-ld \
+    maybe-info-libcpp \
     maybe-info-libgui \
+    maybe-info-libbanshee \
     maybe-info-libiberty \
     maybe-info-libtool \
     maybe-info-m4 \
@@ -781,8 +912,9 @@
 .PHONY: info-target
 info-target:  \
     maybe-info-target-libstdc++-v3 \
+    maybe-info-target-libmudflap \
     maybe-info-target-newlib \
-    maybe-info-target-libf2c \
+    maybe-info-target-libgfortran \
     maybe-info-target-libobjc \
     maybe-info-target-libtermcap \
     maybe-info-target-winsup \
@@ -834,7 +966,9 @@
     maybe-dvi-tcl \
     maybe-dvi-itcl \
     maybe-dvi-ld \
+    maybe-dvi-libcpp \
     maybe-dvi-libgui \
+    maybe-dvi-libbanshee \
     maybe-dvi-libiberty \
     maybe-dvi-libtool \
     maybe-dvi-m4 \
@@ -871,8 +1005,9 @@
 .PHONY: dvi-target
 dvi-target:  \
     maybe-dvi-target-libstdc++-v3 \
+    maybe-dvi-target-libmudflap \
     maybe-dvi-target-newlib \
-    maybe-dvi-target-libf2c \
+    maybe-dvi-target-libgfortran \
     maybe-dvi-target-libobjc \
     maybe-dvi-target-libtermcap \
     maybe-dvi-target-winsup \
@@ -924,7 +1059,9 @@
     maybe-TAGS-tcl \
     maybe-TAGS-itcl \
     maybe-TAGS-ld \
+    maybe-TAGS-libcpp \
     maybe-TAGS-libgui \
+    maybe-TAGS-libbanshee \
     maybe-TAGS-libiberty \
     maybe-TAGS-libtool \
     maybe-TAGS-m4 \
@@ -961,8 +1098,9 @@
 .PHONY: TAGS-target
 TAGS-target:  \
     maybe-TAGS-target-libstdc++-v3 \
+    maybe-TAGS-target-libmudflap \
     maybe-TAGS-target-newlib \
-    maybe-TAGS-target-libf2c \
+    maybe-TAGS-target-libgfortran \
     maybe-TAGS-target-libobjc \
     maybe-TAGS-target-libtermcap \
     maybe-TAGS-target-winsup \
@@ -1014,7 +1152,9 @@
     maybe-install-info-tcl \
     maybe-install-info-itcl \
     maybe-install-info-ld \
+    maybe-install-info-libcpp \
     maybe-install-info-libgui \
+    maybe-install-info-libbanshee \
     maybe-install-info-libiberty \
     maybe-install-info-libtool \
     maybe-install-info-m4 \
@@ -1051,8 +1191,9 @@
 .PHONY: install-info-target
 install-info-target:  \
     maybe-install-info-target-libstdc++-v3 \
+    maybe-install-info-target-libmudflap \
     maybe-install-info-target-newlib \
-    maybe-install-info-target-libf2c \
+    maybe-install-info-target-libgfortran \
     maybe-install-info-target-libobjc \
     maybe-install-info-target-libtermcap \
     maybe-install-info-target-winsup \
@@ -1104,7 +1245,9 @@
     maybe-installcheck-tcl \
     maybe-installcheck-itcl \
     maybe-installcheck-ld \
+    maybe-installcheck-libcpp \
     maybe-installcheck-libgui \
+    maybe-installcheck-libbanshee \
     maybe-installcheck-libiberty \
     maybe-installcheck-libtool \
     maybe-installcheck-m4 \
@@ -1141,8 +1284,9 @@
 .PHONY: installcheck-target
 installcheck-target:  \
     maybe-installcheck-target-libstdc++-v3 \
+    maybe-installcheck-target-libmudflap \
     maybe-installcheck-target-newlib \
-    maybe-installcheck-target-libf2c \
+    maybe-installcheck-target-libgfortran \
     maybe-installcheck-target-libobjc \
     maybe-installcheck-target-libtermcap \
     maybe-installcheck-target-winsup \
@@ -1194,7 +1338,9 @@
     maybe-mostlyclean-tcl \
     maybe-mostlyclean-itcl \
     maybe-mostlyclean-ld \
+    maybe-mostlyclean-libcpp \
     maybe-mostlyclean-libgui \
+    maybe-mostlyclean-libbanshee \
     maybe-mostlyclean-libiberty \
     maybe-mostlyclean-libtool \
     maybe-mostlyclean-m4 \
@@ -1231,8 +1377,9 @@
 .PHONY: mostlyclean-target
 mostlyclean-target:  \
     maybe-mostlyclean-target-libstdc++-v3 \
+    maybe-mostlyclean-target-libmudflap \
     maybe-mostlyclean-target-newlib \
-    maybe-mostlyclean-target-libf2c \
+    maybe-mostlyclean-target-libgfortran \
     maybe-mostlyclean-target-libobjc \
     maybe-mostlyclean-target-libtermcap \
     maybe-mostlyclean-target-winsup \
@@ -1284,7 +1431,9 @@
     maybe-clean-tcl \
     maybe-clean-itcl \
     maybe-clean-ld \
+    maybe-clean-libcpp \
     maybe-clean-libgui \
+    maybe-clean-libbanshee \
     maybe-clean-libiberty \
     maybe-clean-libtool \
     maybe-clean-m4 \
@@ -1321,8 +1470,9 @@
 .PHONY: clean-target
 clean-target:  \
     maybe-clean-target-libstdc++-v3 \
+    maybe-clean-target-libmudflap \
     maybe-clean-target-newlib \
-    maybe-clean-target-libf2c \
+    maybe-clean-target-libgfortran \
     maybe-clean-target-libobjc \
     maybe-clean-target-libtermcap \
     maybe-clean-target-winsup \
@@ -1374,7 +1524,9 @@
     maybe-distclean-tcl \
     maybe-distclean-itcl \
     maybe-distclean-ld \
+    maybe-distclean-libcpp \
     maybe-distclean-libgui \
+    maybe-distclean-libbanshee \
     maybe-distclean-libiberty \
     maybe-distclean-libtool \
     maybe-distclean-m4 \
@@ -1411,8 +1563,9 @@
 .PHONY: distclean-target
 distclean-target:  \
     maybe-distclean-target-libstdc++-v3 \
+    maybe-distclean-target-libmudflap \
     maybe-distclean-target-newlib \
-    maybe-distclean-target-libf2c \
+    maybe-distclean-target-libgfortran \
     maybe-distclean-target-libobjc \
     maybe-distclean-target-libtermcap \
     maybe-distclean-target-winsup \
@@ -1464,7 +1617,9 @@
     maybe-maintainer-clean-tcl \
     maybe-maintainer-clean-itcl \
     maybe-maintainer-clean-ld \
+    maybe-maintainer-clean-libcpp \
     maybe-maintainer-clean-libgui \
+    maybe-maintainer-clean-libbanshee \
     maybe-maintainer-clean-libiberty \
     maybe-maintainer-clean-libtool \
     maybe-maintainer-clean-m4 \
@@ -1501,8 +1656,9 @@
 .PHONY: maintainer-clean-target
 maintainer-clean-target:  \
     maybe-maintainer-clean-target-libstdc++-v3 \
+    maybe-maintainer-clean-target-libmudflap \
     maybe-maintainer-clean-target-newlib \
-    maybe-maintainer-clean-target-libf2c \
+    maybe-maintainer-clean-target-libgfortran \
     maybe-maintainer-clean-target-libobjc \
     maybe-maintainer-clean-target-libtermcap \
     maybe-maintainer-clean-target-winsup \
@@ -1611,7 +1767,9 @@
     maybe-check-tcl \
     maybe-check-itcl \
     maybe-check-ld \
+    maybe-check-libcpp \
     maybe-check-libgui \
+    maybe-check-libbanshee \
     maybe-check-libiberty \
     maybe-check-libtool \
     maybe-check-m4 \
@@ -1645,8 +1803,9 @@
     maybe-check-libtermcap \
     maybe-check-utils \
     maybe-check-target-libstdc++-v3 \
+    maybe-check-target-libmudflap \
     maybe-check-target-newlib \
-    maybe-check-target-libf2c \
+    maybe-check-target-libgfortran \
     maybe-check-target-libobjc \
     maybe-check-target-libtermcap \
     maybe-check-target-winsup \
@@ -1721,7 +1880,9 @@
     maybe-install-tcl \
     maybe-install-itcl \
     maybe-install-ld \
+    maybe-install-libcpp \
     maybe-install-libgui \
+    maybe-install-libbanshee \
     maybe-install-libiberty \
     maybe-install-libtool \
     maybe-install-m4 \
@@ -1788,7 +1949,9 @@
     maybe-install-tcl \
     maybe-install-itcl \
     maybe-install-ld \
+    maybe-install-libcpp \
     maybe-install-libgui \
+    maybe-install-libbanshee \
     maybe-install-libiberty \
     maybe-install-libtool \
     maybe-install-m4 \
@@ -1825,8 +1988,9 @@
 .PHONY: install-target
 install-target:  \
     maybe-install-target-libstdc++-v3 \
+    maybe-install-target-libmudflap \
     maybe-install-target-newlib \
-    maybe-install-target-libf2c \
+    maybe-install-target-libgfortran \
     maybe-install-target-libobjc \
     maybe-install-target-libtermcap \
     maybe-install-target-winsup \
@@ -1850,6 +2014,7 @@
 	@if [ -f ./gcc/Makefile ] ; then \
 		r=`${PWD_COMMAND}` ; export r ; \
 		$(SET_LIB_PATH) \
+		$(HOST_EXPORTS) \
 		(cd ./gcc && \
 		$(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
 	else \
@@ -1898,25 +2063,14 @@
 
 .PHONY: configure-build-libiberty maybe-configure-build-libiberty
 maybe-configure-build-libiberty:
+@if build-libiberty
+maybe-configure-build-libiberty: configure-build-libiberty
 configure-build-libiberty:
 	@test ! -f $(BUILD_SUBDIR)/libiberty/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/libiberty ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	AR="$(AR_FOR_BUILD)"; export AR; \
-	AS="$(AS_FOR_BUILD)"; export AS; \
-	CC="$(CC_FOR_BUILD)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX_FOR_BUILD)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
-	LD="$(LD_FOR_BUILD)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
-	NM="$(NM_FOR_BUILD)"; export NM; \
-	RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
+	$(BUILD_EXPORTS) \
 	echo Configuring in $(BUILD_SUBDIR)/libiberty; \
 	cd "$(BUILD_SUBDIR)/libiberty" || exit 1; \
 	case $(srcdir) in \
@@ -1955,15 +2109,398 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(BUILD_CONFIGARGS) $${srcdiroption} \
-	  --with-build-subdir="$(BUILD_SUBDIR)" \
+	  --with-build-subdir="$(BUILD_SUBDIR)"  \
 	  || exit 1
+@endif build-libiberty
 
 .PHONY: all-build-libiberty maybe-all-build-libiberty
 maybe-all-build-libiberty:
+@if build-libiberty
+maybe-all-build-libiberty: all-build-libiberty
 all-build-libiberty: configure-build-libiberty
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	(cd $(BUILD_SUBDIR)/libiberty && $(MAKE) all)
+	$(BUILD_EXPORTS) \
+	(cd $(BUILD_SUBDIR)/libiberty && $(MAKE)  all)
+@endif build-libiberty
+
+.PHONY: configure-build-libbanshee maybe-configure-build-libbanshee
+maybe-configure-build-libbanshee:
+@if build-libbanshee
+maybe-configure-build-libbanshee: configure-build-libbanshee
+configure-build-libbanshee:
+	@test ! -f $(BUILD_SUBDIR)/libbanshee/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/libbanshee ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	echo Configuring in $(BUILD_SUBDIR)/libbanshee; \
+	cd "$(BUILD_SUBDIR)/libbanshee" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) \
+	    topdir=$(srcdir) ;; \
+	  *) \
+	    case "$(BUILD_SUBDIR)" in \
+	      .) topdir="../$(srcdir)" ;; \
+	      *) topdir="../../$(srcdir)" ;; \
+	    esac ;; \
+	esac; \
+	if [ "$(srcdir)" = "." ] ; then \
+	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
+	    if $(SHELL) $$s/symlink-tree $${topdir}/libbanshee "no-such-file" ; then \
+	      if [ -f Makefile ]; then \
+	        if $(MAKE) distclean; then \
+	          true; \
+	        else \
+	          exit 1; \
+	        fi; \
+	      else \
+	        true; \
+	      fi; \
+	    else \
+	      exit 1; \
+	    fi; \
+	  else \
+	    true; \
+	  fi; \
+	  srcdiroption="--srcdir=."; \
+	  libsrcdir="."; \
+	else \
+	  srcdiroption="--srcdir=$${topdir}/libbanshee"; \
+	  libsrcdir="$$s/libbanshee"; \
+	fi; \
+	rm -f no-such-file || : ; \
+	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+	  $(BUILD_CONFIGARGS) $${srcdiroption} \
+	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  || exit 1
+@endif build-libbanshee
+
+.PHONY: all-build-libbanshee maybe-all-build-libbanshee
+maybe-all-build-libbanshee:
+@if build-libbanshee
+maybe-all-build-libbanshee: all-build-libbanshee
+all-build-libbanshee: configure-build-libbanshee
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	(cd $(BUILD_SUBDIR)/libbanshee && $(MAKE)  all)
+@endif build-libbanshee
+
+.PHONY: configure-build-bison maybe-configure-build-bison
+maybe-configure-build-bison:
+@if build-bison
+maybe-configure-build-bison: configure-build-bison
+configure-build-bison:
+	@test ! -f $(BUILD_SUBDIR)/bison/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/bison ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	echo Configuring in $(BUILD_SUBDIR)/bison; \
+	cd "$(BUILD_SUBDIR)/bison" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) \
+	    topdir=$(srcdir) ;; \
+	  *) \
+	    case "$(BUILD_SUBDIR)" in \
+	      .) topdir="../$(srcdir)" ;; \
+	      *) topdir="../../$(srcdir)" ;; \
+	    esac ;; \
+	esac; \
+	if [ "$(srcdir)" = "." ] ; then \
+	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
+	    if $(SHELL) $$s/symlink-tree $${topdir}/bison "no-such-file" ; then \
+	      if [ -f Makefile ]; then \
+	        if $(MAKE) distclean; then \
+	          true; \
+	        else \
+	          exit 1; \
+	        fi; \
+	      else \
+	        true; \
+	      fi; \
+	    else \
+	      exit 1; \
+	    fi; \
+	  else \
+	    true; \
+	  fi; \
+	  srcdiroption="--srcdir=."; \
+	  libsrcdir="."; \
+	else \
+	  srcdiroption="--srcdir=$${topdir}/bison"; \
+	  libsrcdir="$$s/bison"; \
+	fi; \
+	rm -f no-such-file || : ; \
+	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+	  $(BUILD_CONFIGARGS) $${srcdiroption} \
+	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  || exit 1
+@endif build-bison
+
+.PHONY: all-build-bison maybe-all-build-bison
+maybe-all-build-bison:
+@if build-bison
+maybe-all-build-bison: all-build-bison
+all-build-bison: configure-build-bison
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	(cd $(BUILD_SUBDIR)/bison && $(MAKE)  all)
+@endif build-bison
+
+.PHONY: configure-build-byacc maybe-configure-build-byacc
+maybe-configure-build-byacc:
+@if build-byacc
+maybe-configure-build-byacc: configure-build-byacc
+configure-build-byacc:
+	@test ! -f $(BUILD_SUBDIR)/byacc/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/byacc ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	echo Configuring in $(BUILD_SUBDIR)/byacc; \
+	cd "$(BUILD_SUBDIR)/byacc" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) \
+	    topdir=$(srcdir) ;; \
+	  *) \
+	    case "$(BUILD_SUBDIR)" in \
+	      .) topdir="../$(srcdir)" ;; \
+	      *) topdir="../../$(srcdir)" ;; \
+	    esac ;; \
+	esac; \
+	if [ "$(srcdir)" = "." ] ; then \
+	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
+	    if $(SHELL) $$s/symlink-tree $${topdir}/byacc "no-such-file" ; then \
+	      if [ -f Makefile ]; then \
+	        if $(MAKE) distclean; then \
+	          true; \
+	        else \
+	          exit 1; \
+	        fi; \
+	      else \
+	        true; \
+	      fi; \
+	    else \
+	      exit 1; \
+	    fi; \
+	  else \
+	    true; \
+	  fi; \
+	  srcdiroption="--srcdir=."; \
+	  libsrcdir="."; \
+	else \
+	  srcdiroption="--srcdir=$${topdir}/byacc"; \
+	  libsrcdir="$$s/byacc"; \
+	fi; \
+	rm -f no-such-file || : ; \
+	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+	  $(BUILD_CONFIGARGS) $${srcdiroption} \
+	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  || exit 1
+@endif build-byacc
+
+.PHONY: all-build-byacc maybe-all-build-byacc
+maybe-all-build-byacc:
+@if build-byacc
+maybe-all-build-byacc: all-build-byacc
+all-build-byacc: configure-build-byacc
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	(cd $(BUILD_SUBDIR)/byacc && $(MAKE)  all)
+@endif build-byacc
+
+.PHONY: configure-build-flex maybe-configure-build-flex
+maybe-configure-build-flex:
+@if build-flex
+maybe-configure-build-flex: configure-build-flex
+configure-build-flex:
+	@test ! -f $(BUILD_SUBDIR)/flex/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/flex ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	echo Configuring in $(BUILD_SUBDIR)/flex; \
+	cd "$(BUILD_SUBDIR)/flex" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) \
+	    topdir=$(srcdir) ;; \
+	  *) \
+	    case "$(BUILD_SUBDIR)" in \
+	      .) topdir="../$(srcdir)" ;; \
+	      *) topdir="../../$(srcdir)" ;; \
+	    esac ;; \
+	esac; \
+	if [ "$(srcdir)" = "." ] ; then \
+	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
+	    if $(SHELL) $$s/symlink-tree $${topdir}/flex "no-such-file" ; then \
+	      if [ -f Makefile ]; then \
+	        if $(MAKE) distclean; then \
+	          true; \
+	        else \
+	          exit 1; \
+	        fi; \
+	      else \
+	        true; \
+	      fi; \
+	    else \
+	      exit 1; \
+	    fi; \
+	  else \
+	    true; \
+	  fi; \
+	  srcdiroption="--srcdir=."; \
+	  libsrcdir="."; \
+	else \
+	  srcdiroption="--srcdir=$${topdir}/flex"; \
+	  libsrcdir="$$s/flex"; \
+	fi; \
+	rm -f no-such-file || : ; \
+	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+	  $(BUILD_CONFIGARGS) $${srcdiroption} \
+	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  || exit 1
+@endif build-flex
+
+.PHONY: all-build-flex maybe-all-build-flex
+maybe-all-build-flex:
+@if build-flex
+maybe-all-build-flex: all-build-flex
+all-build-flex: configure-build-flex
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	(cd $(BUILD_SUBDIR)/flex && $(MAKE)  all)
+@endif build-flex
+
+.PHONY: configure-build-m4 maybe-configure-build-m4
+maybe-configure-build-m4:
+@if build-m4
+maybe-configure-build-m4: configure-build-m4
+configure-build-m4:
+	@test ! -f $(BUILD_SUBDIR)/m4/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/m4 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	echo Configuring in $(BUILD_SUBDIR)/m4; \
+	cd "$(BUILD_SUBDIR)/m4" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) \
+	    topdir=$(srcdir) ;; \
+	  *) \
+	    case "$(BUILD_SUBDIR)" in \
+	      .) topdir="../$(srcdir)" ;; \
+	      *) topdir="../../$(srcdir)" ;; \
+	    esac ;; \
+	esac; \
+	if [ "$(srcdir)" = "." ] ; then \
+	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
+	    if $(SHELL) $$s/symlink-tree $${topdir}/m4 "no-such-file" ; then \
+	      if [ -f Makefile ]; then \
+	        if $(MAKE) distclean; then \
+	          true; \
+	        else \
+	          exit 1; \
+	        fi; \
+	      else \
+	        true; \
+	      fi; \
+	    else \
+	      exit 1; \
+	    fi; \
+	  else \
+	    true; \
+	  fi; \
+	  srcdiroption="--srcdir=."; \
+	  libsrcdir="."; \
+	else \
+	  srcdiroption="--srcdir=$${topdir}/m4"; \
+	  libsrcdir="$$s/m4"; \
+	fi; \
+	rm -f no-such-file || : ; \
+	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+	  $(BUILD_CONFIGARGS) $${srcdiroption} \
+	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  || exit 1
+@endif build-m4
+
+.PHONY: all-build-m4 maybe-all-build-m4
+maybe-all-build-m4:
+@if build-m4
+maybe-all-build-m4: all-build-m4
+all-build-m4: configure-build-m4
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	(cd $(BUILD_SUBDIR)/m4 && $(MAKE)  all)
+@endif build-m4
+
+.PHONY: configure-build-texinfo maybe-configure-build-texinfo
+maybe-configure-build-texinfo:
+@if build-texinfo
+maybe-configure-build-texinfo: configure-build-texinfo
+configure-build-texinfo:
+	@test ! -f $(BUILD_SUBDIR)/texinfo/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/texinfo ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	echo Configuring in $(BUILD_SUBDIR)/texinfo; \
+	cd "$(BUILD_SUBDIR)/texinfo" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) \
+	    topdir=$(srcdir) ;; \
+	  *) \
+	    case "$(BUILD_SUBDIR)" in \
+	      .) topdir="../$(srcdir)" ;; \
+	      *) topdir="../../$(srcdir)" ;; \
+	    esac ;; \
+	esac; \
+	if [ "$(srcdir)" = "." ] ; then \
+	  if [ "$(BUILD_SUBDIR)" != "." ] ; then \
+	    if $(SHELL) $$s/symlink-tree $${topdir}/texinfo "no-such-file" ; then \
+	      if [ -f Makefile ]; then \
+	        if $(MAKE) distclean; then \
+	          true; \
+	        else \
+	          exit 1; \
+	        fi; \
+	      else \
+	        true; \
+	      fi; \
+	    else \
+	      exit 1; \
+	    fi; \
+	  else \
+	    true; \
+	  fi; \
+	  srcdiroption="--srcdir=."; \
+	  libsrcdir="."; \
+	else \
+	  srcdiroption="--srcdir=$${topdir}/texinfo"; \
+	  libsrcdir="$$s/texinfo"; \
+	fi; \
+	rm -f no-such-file || : ; \
+	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+	  $(BUILD_CONFIGARGS) $${srcdiroption} \
+	  --with-build-subdir="$(BUILD_SUBDIR)"  \
+	  || exit 1
+@endif build-texinfo
+
+.PHONY: all-build-texinfo maybe-all-build-texinfo
+maybe-all-build-texinfo:
+@if build-texinfo
+maybe-all-build-texinfo: all-build-texinfo
+all-build-texinfo: configure-build-texinfo
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(BUILD_EXPORTS) \
+	(cd $(BUILD_SUBDIR)/texinfo && $(MAKE)  all)
+@endif build-texinfo
 
 
 # --------------------------------------
@@ -1972,26 +2509,14 @@
 
 .PHONY: configure-ash maybe-configure-ash
 maybe-configure-ash:
+@if ash
+maybe-configure-ash: configure-ash
 configure-ash:
 	@test ! -f ash/Makefile || exit 0; \
 	[ -d ash ] || mkdir ash; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in ash; \
 	cd ash || exit 1; \
 	case $(srcdir) in \
@@ -2006,41 +2531,56 @@
 	    libsrcdir="$$s/ash";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif ash
 
 .PHONY: all-ash maybe-all-ash
 maybe-all-ash:
+@if ash
+maybe-all-ash: all-ash
 all-ash: configure-ash
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd ash && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd ash && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif ash
 
 .PHONY: check-ash maybe-check-ash
 maybe-check-ash:
+@if ash
+maybe-check-ash: check-ash
 
 check-ash:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd ash && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd ash && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif ash
 
 .PHONY: install-ash maybe-install-ash
 maybe-install-ash:
+@if ash
+maybe-install-ash: install-ash
 
 install-ash: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd ash && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd ash && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif ash
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-ash info-ash
 maybe-info-ash:
+@if ash
+maybe-info-ash: info-ash
 
 info-ash: \
     configure-ash 
@@ -2048,6 +2588,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2057,12 +2598,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif ash
 
 .PHONY: maybe-dvi-ash dvi-ash
 maybe-dvi-ash:
+@if ash
+maybe-dvi-ash: dvi-ash
 
 dvi-ash: \
     configure-ash 
@@ -2070,6 +2614,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2079,12 +2624,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif ash
 
 .PHONY: maybe-TAGS-ash TAGS-ash
 maybe-TAGS-ash:
+@if ash
+maybe-TAGS-ash: TAGS-ash
 
 TAGS-ash: \
     configure-ash 
@@ -2092,6 +2640,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2101,12 +2650,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif ash
 
 .PHONY: maybe-install-info-ash install-info-ash
 maybe-install-info-ash:
+@if ash
+maybe-install-info-ash: install-info-ash
 
 install-info-ash: \
     configure-ash \
@@ -2115,6 +2667,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2124,12 +2677,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif ash
 
 .PHONY: maybe-installcheck-ash installcheck-ash
 maybe-installcheck-ash:
+@if ash
+maybe-installcheck-ash: installcheck-ash
 
 installcheck-ash: \
     configure-ash 
@@ -2137,6 +2693,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2146,18 +2703,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif ash
 
 .PHONY: maybe-mostlyclean-ash mostlyclean-ash
 maybe-mostlyclean-ash:
+@if ash
+maybe-mostlyclean-ash: mostlyclean-ash
 
 mostlyclean-ash: 
 	@[ -f ./ash/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2167,18 +2728,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif ash
 
 .PHONY: maybe-clean-ash clean-ash
 maybe-clean-ash:
+@if ash
+maybe-clean-ash: clean-ash
 
 clean-ash: 
 	@[ -f ./ash/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2188,18 +2753,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif ash
 
 .PHONY: maybe-distclean-ash distclean-ash
 maybe-distclean-ash:
+@if ash
+maybe-distclean-ash: distclean-ash
 
 distclean-ash: 
 	@[ -f ./ash/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2209,18 +2778,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif ash
 
 .PHONY: maybe-maintainer-clean-ash maintainer-clean-ash
 maybe-maintainer-clean-ash:
+@if ash
+maybe-maintainer-clean-ash: maintainer-clean-ash
 
 maintainer-clean-ash: 
 	@[ -f ./ash/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2230,33 +2803,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif ash
 
 
 .PHONY: configure-autoconf maybe-configure-autoconf
 maybe-configure-autoconf:
+@if autoconf
+maybe-configure-autoconf: configure-autoconf
 configure-autoconf:
 	@test ! -f autoconf/Makefile || exit 0; \
 	[ -d autoconf ] || mkdir autoconf; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in autoconf; \
 	cd autoconf || exit 1; \
 	case $(srcdir) in \
@@ -2271,41 +2833,56 @@
 	    libsrcdir="$$s/autoconf";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif autoconf
 
 .PHONY: all-autoconf maybe-all-autoconf
 maybe-all-autoconf:
+@if autoconf
+maybe-all-autoconf: all-autoconf
 all-autoconf: configure-autoconf
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd autoconf && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd autoconf && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif autoconf
 
 .PHONY: check-autoconf maybe-check-autoconf
 maybe-check-autoconf:
+@if autoconf
+maybe-check-autoconf: check-autoconf
 
 check-autoconf:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd autoconf && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd autoconf && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif autoconf
 
 .PHONY: install-autoconf maybe-install-autoconf
 maybe-install-autoconf:
+@if autoconf
+maybe-install-autoconf: install-autoconf
 
 install-autoconf: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd autoconf && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd autoconf && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif autoconf
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-autoconf info-autoconf
 maybe-info-autoconf:
+@if autoconf
+maybe-info-autoconf: info-autoconf
 
 info-autoconf: \
     configure-autoconf 
@@ -2313,6 +2890,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2322,12 +2900,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif autoconf
 
 .PHONY: maybe-dvi-autoconf dvi-autoconf
 maybe-dvi-autoconf:
+@if autoconf
+maybe-dvi-autoconf: dvi-autoconf
 
 dvi-autoconf: \
     configure-autoconf 
@@ -2335,6 +2916,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2344,12 +2926,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif autoconf
 
 .PHONY: maybe-TAGS-autoconf TAGS-autoconf
 maybe-TAGS-autoconf:
+@if autoconf
+maybe-TAGS-autoconf: TAGS-autoconf
 
 TAGS-autoconf: \
     configure-autoconf 
@@ -2357,6 +2942,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2366,12 +2952,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif autoconf
 
 .PHONY: maybe-install-info-autoconf install-info-autoconf
 maybe-install-info-autoconf:
+@if autoconf
+maybe-install-info-autoconf: install-info-autoconf
 
 install-info-autoconf: \
     configure-autoconf \
@@ -2380,6 +2969,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2389,12 +2979,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif autoconf
 
 .PHONY: maybe-installcheck-autoconf installcheck-autoconf
 maybe-installcheck-autoconf:
+@if autoconf
+maybe-installcheck-autoconf: installcheck-autoconf
 
 installcheck-autoconf: \
     configure-autoconf 
@@ -2402,6 +2995,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2411,18 +3005,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif autoconf
 
 .PHONY: maybe-mostlyclean-autoconf mostlyclean-autoconf
 maybe-mostlyclean-autoconf:
+@if autoconf
+maybe-mostlyclean-autoconf: mostlyclean-autoconf
 
 mostlyclean-autoconf: 
 	@[ -f ./autoconf/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2432,18 +3030,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif autoconf
 
 .PHONY: maybe-clean-autoconf clean-autoconf
 maybe-clean-autoconf:
+@if autoconf
+maybe-clean-autoconf: clean-autoconf
 
 clean-autoconf: 
 	@[ -f ./autoconf/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2453,18 +3055,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif autoconf
 
 .PHONY: maybe-distclean-autoconf distclean-autoconf
 maybe-distclean-autoconf:
+@if autoconf
+maybe-distclean-autoconf: distclean-autoconf
 
 distclean-autoconf: 
 	@[ -f ./autoconf/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2474,18 +3080,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif autoconf
 
 .PHONY: maybe-maintainer-clean-autoconf maintainer-clean-autoconf
 maybe-maintainer-clean-autoconf:
+@if autoconf
+maybe-maintainer-clean-autoconf: maintainer-clean-autoconf
 
 maintainer-clean-autoconf: 
 	@[ -f ./autoconf/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2495,33 +3105,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif autoconf
 
 
 .PHONY: configure-automake maybe-configure-automake
 maybe-configure-automake:
+@if automake
+maybe-configure-automake: configure-automake
 configure-automake:
 	@test ! -f automake/Makefile || exit 0; \
 	[ -d automake ] || mkdir automake; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in automake; \
 	cd automake || exit 1; \
 	case $(srcdir) in \
@@ -2536,41 +3135,56 @@
 	    libsrcdir="$$s/automake";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif automake
 
 .PHONY: all-automake maybe-all-automake
 maybe-all-automake:
+@if automake
+maybe-all-automake: all-automake
 all-automake: configure-automake
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd automake && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd automake && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif automake
 
 .PHONY: check-automake maybe-check-automake
 maybe-check-automake:
+@if automake
+maybe-check-automake: check-automake
 
 check-automake:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd automake && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd automake && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif automake
 
 .PHONY: install-automake maybe-install-automake
 maybe-install-automake:
+@if automake
+maybe-install-automake: install-automake
 
 install-automake: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd automake && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd automake && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif automake
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-automake info-automake
 maybe-info-automake:
+@if automake
+maybe-info-automake: info-automake
 
 info-automake: \
     configure-automake 
@@ -2578,6 +3192,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2587,12 +3202,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif automake
 
 .PHONY: maybe-dvi-automake dvi-automake
 maybe-dvi-automake:
+@if automake
+maybe-dvi-automake: dvi-automake
 
 dvi-automake: \
     configure-automake 
@@ -2600,6 +3218,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2609,12 +3228,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif automake
 
 .PHONY: maybe-TAGS-automake TAGS-automake
 maybe-TAGS-automake:
+@if automake
+maybe-TAGS-automake: TAGS-automake
 
 TAGS-automake: \
     configure-automake 
@@ -2622,6 +3244,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2631,12 +3254,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif automake
 
 .PHONY: maybe-install-info-automake install-info-automake
 maybe-install-info-automake:
+@if automake
+maybe-install-info-automake: install-info-automake
 
 install-info-automake: \
     configure-automake \
@@ -2645,6 +3271,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2654,12 +3281,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif automake
 
 .PHONY: maybe-installcheck-automake installcheck-automake
 maybe-installcheck-automake:
+@if automake
+maybe-installcheck-automake: installcheck-automake
 
 installcheck-automake: \
     configure-automake 
@@ -2667,6 +3297,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2676,18 +3307,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif automake
 
 .PHONY: maybe-mostlyclean-automake mostlyclean-automake
 maybe-mostlyclean-automake:
+@if automake
+maybe-mostlyclean-automake: mostlyclean-automake
 
 mostlyclean-automake: 
 	@[ -f ./automake/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2697,18 +3332,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif automake
 
 .PHONY: maybe-clean-automake clean-automake
 maybe-clean-automake:
+@if automake
+maybe-clean-automake: clean-automake
 
 clean-automake: 
 	@[ -f ./automake/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2718,18 +3357,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif automake
 
 .PHONY: maybe-distclean-automake distclean-automake
 maybe-distclean-automake:
+@if automake
+maybe-distclean-automake: distclean-automake
 
 distclean-automake: 
 	@[ -f ./automake/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2739,18 +3382,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif automake
 
 .PHONY: maybe-maintainer-clean-automake maintainer-clean-automake
 maybe-maintainer-clean-automake:
+@if automake
+maybe-maintainer-clean-automake: maintainer-clean-automake
 
 maintainer-clean-automake: 
 	@[ -f ./automake/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2760,33 +3407,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif automake
 
 
 .PHONY: configure-bash maybe-configure-bash
 maybe-configure-bash:
+@if bash
+maybe-configure-bash: configure-bash
 configure-bash:
 	@test ! -f bash/Makefile || exit 0; \
 	[ -d bash ] || mkdir bash; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in bash; \
 	cd bash || exit 1; \
 	case $(srcdir) in \
@@ -2801,41 +3437,56 @@
 	    libsrcdir="$$s/bash";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif bash
 
 .PHONY: all-bash maybe-all-bash
 maybe-all-bash:
+@if bash
+maybe-all-bash: all-bash
 all-bash: configure-bash
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bash && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd bash && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif bash
 
 .PHONY: check-bash maybe-check-bash
 maybe-check-bash:
+@if bash
+maybe-check-bash: check-bash
 
 check-bash:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bash && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd bash && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif bash
 
 .PHONY: install-bash maybe-install-bash
 maybe-install-bash:
+@if bash
+maybe-install-bash: install-bash
 
 install-bash: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bash && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd bash && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif bash
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-bash info-bash
 maybe-info-bash:
+@if bash
+maybe-info-bash: info-bash
 
 info-bash: \
     configure-bash 
@@ -2843,6 +3494,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2852,12 +3504,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif bash
 
 .PHONY: maybe-dvi-bash dvi-bash
 maybe-dvi-bash:
+@if bash
+maybe-dvi-bash: dvi-bash
 
 dvi-bash: \
     configure-bash 
@@ -2865,6 +3520,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2874,12 +3530,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif bash
 
 .PHONY: maybe-TAGS-bash TAGS-bash
 maybe-TAGS-bash:
+@if bash
+maybe-TAGS-bash: TAGS-bash
 
 TAGS-bash: \
     configure-bash 
@@ -2887,6 +3546,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2896,12 +3556,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif bash
 
 .PHONY: maybe-install-info-bash install-info-bash
 maybe-install-info-bash:
+@if bash
+maybe-install-info-bash: install-info-bash
 
 install-info-bash: \
     configure-bash \
@@ -2910,6 +3573,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2919,12 +3583,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif bash
 
 .PHONY: maybe-installcheck-bash installcheck-bash
 maybe-installcheck-bash:
+@if bash
+maybe-installcheck-bash: installcheck-bash
 
 installcheck-bash: \
     configure-bash 
@@ -2932,6 +3599,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2941,18 +3609,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif bash
 
 .PHONY: maybe-mostlyclean-bash mostlyclean-bash
 maybe-mostlyclean-bash:
+@if bash
+maybe-mostlyclean-bash: mostlyclean-bash
 
 mostlyclean-bash: 
 	@[ -f ./bash/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2962,18 +3634,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif bash
 
 .PHONY: maybe-clean-bash clean-bash
 maybe-clean-bash:
+@if bash
+maybe-clean-bash: clean-bash
 
 clean-bash: 
 	@[ -f ./bash/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -2983,18 +3659,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif bash
 
 .PHONY: maybe-distclean-bash distclean-bash
 maybe-distclean-bash:
+@if bash
+maybe-distclean-bash: distclean-bash
 
 distclean-bash: 
 	@[ -f ./bash/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3004,18 +3684,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif bash
 
 .PHONY: maybe-maintainer-clean-bash maintainer-clean-bash
 maybe-maintainer-clean-bash:
+@if bash
+maybe-maintainer-clean-bash: maintainer-clean-bash
 
 maintainer-clean-bash: 
 	@[ -f ./bash/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3025,33 +3709,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif bash
 
 
 .PHONY: configure-bfd maybe-configure-bfd
 maybe-configure-bfd:
+@if bfd
+maybe-configure-bfd: configure-bfd
 configure-bfd:
 	@test ! -f bfd/Makefile || exit 0; \
 	[ -d bfd ] || mkdir bfd; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in bfd; \
 	cd bfd || exit 1; \
 	case $(srcdir) in \
@@ -3066,41 +3739,56 @@
 	    libsrcdir="$$s/bfd";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif bfd
 
 .PHONY: all-bfd maybe-all-bfd
 maybe-all-bfd:
+@if bfd
+maybe-all-bfd: all-bfd
 all-bfd: configure-bfd
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bfd && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd bfd && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif bfd
 
 .PHONY: check-bfd maybe-check-bfd
 maybe-check-bfd:
+@if bfd
+maybe-check-bfd: check-bfd
 
 check-bfd:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bfd && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd bfd && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif bfd
 
 .PHONY: install-bfd maybe-install-bfd
 maybe-install-bfd:
+@if bfd
+maybe-install-bfd: install-bfd
 
 install-bfd: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bfd && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd bfd && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif bfd
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-bfd info-bfd
 maybe-info-bfd:
+@if bfd
+maybe-info-bfd: info-bfd
 
 info-bfd: \
     configure-bfd 
@@ -3108,6 +3796,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3117,12 +3806,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif bfd
 
 .PHONY: maybe-dvi-bfd dvi-bfd
 maybe-dvi-bfd:
+@if bfd
+maybe-dvi-bfd: dvi-bfd
 
 dvi-bfd: \
     configure-bfd 
@@ -3130,6 +3822,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3139,12 +3832,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif bfd
 
 .PHONY: maybe-TAGS-bfd TAGS-bfd
 maybe-TAGS-bfd:
+@if bfd
+maybe-TAGS-bfd: TAGS-bfd
 
 TAGS-bfd: \
     configure-bfd 
@@ -3152,6 +3848,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3161,12 +3858,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif bfd
 
 .PHONY: maybe-install-info-bfd install-info-bfd
 maybe-install-info-bfd:
+@if bfd
+maybe-install-info-bfd: install-info-bfd
 
 install-info-bfd: \
     configure-bfd \
@@ -3175,6 +3875,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3184,12 +3885,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif bfd
 
 .PHONY: maybe-installcheck-bfd installcheck-bfd
 maybe-installcheck-bfd:
+@if bfd
+maybe-installcheck-bfd: installcheck-bfd
 
 installcheck-bfd: \
     configure-bfd 
@@ -3197,6 +3901,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3206,18 +3911,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif bfd
 
 .PHONY: maybe-mostlyclean-bfd mostlyclean-bfd
 maybe-mostlyclean-bfd:
+@if bfd
+maybe-mostlyclean-bfd: mostlyclean-bfd
 
 mostlyclean-bfd: 
 	@[ -f ./bfd/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3227,18 +3936,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif bfd
 
 .PHONY: maybe-clean-bfd clean-bfd
 maybe-clean-bfd:
+@if bfd
+maybe-clean-bfd: clean-bfd
 
 clean-bfd: 
 	@[ -f ./bfd/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3248,18 +3961,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif bfd
 
 .PHONY: maybe-distclean-bfd distclean-bfd
 maybe-distclean-bfd:
+@if bfd
+maybe-distclean-bfd: distclean-bfd
 
 distclean-bfd: 
 	@[ -f ./bfd/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3269,18 +3986,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif bfd
 
 .PHONY: maybe-maintainer-clean-bfd maintainer-clean-bfd
 maybe-maintainer-clean-bfd:
+@if bfd
+maybe-maintainer-clean-bfd: maintainer-clean-bfd
 
 maintainer-clean-bfd: 
 	@[ -f ./bfd/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3290,33 +4011,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif bfd
 
 
 .PHONY: configure-opcodes maybe-configure-opcodes
 maybe-configure-opcodes:
+@if opcodes
+maybe-configure-opcodes: configure-opcodes
 configure-opcodes:
 	@test ! -f opcodes/Makefile || exit 0; \
 	[ -d opcodes ] || mkdir opcodes; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in opcodes; \
 	cd opcodes || exit 1; \
 	case $(srcdir) in \
@@ -3331,41 +4041,56 @@
 	    libsrcdir="$$s/opcodes";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif opcodes
 
 .PHONY: all-opcodes maybe-all-opcodes
 maybe-all-opcodes:
+@if opcodes
+maybe-all-opcodes: all-opcodes
 all-opcodes: configure-opcodes
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd opcodes && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd opcodes && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif opcodes
 
 .PHONY: check-opcodes maybe-check-opcodes
 maybe-check-opcodes:
+@if opcodes
+maybe-check-opcodes: check-opcodes
 
 check-opcodes:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd opcodes && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd opcodes && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif opcodes
 
 .PHONY: install-opcodes maybe-install-opcodes
 maybe-install-opcodes:
+@if opcodes
+maybe-install-opcodes: install-opcodes
 
 install-opcodes: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd opcodes && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd opcodes && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif opcodes
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-opcodes info-opcodes
 maybe-info-opcodes:
+@if opcodes
+maybe-info-opcodes: info-opcodes
 
 info-opcodes: \
     configure-opcodes 
@@ -3373,6 +4098,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3382,12 +4108,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif opcodes
 
 .PHONY: maybe-dvi-opcodes dvi-opcodes
 maybe-dvi-opcodes:
+@if opcodes
+maybe-dvi-opcodes: dvi-opcodes
 
 dvi-opcodes: \
     configure-opcodes 
@@ -3395,6 +4124,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3404,12 +4134,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif opcodes
 
 .PHONY: maybe-TAGS-opcodes TAGS-opcodes
 maybe-TAGS-opcodes:
+@if opcodes
+maybe-TAGS-opcodes: TAGS-opcodes
 
 TAGS-opcodes: \
     configure-opcodes 
@@ -3417,6 +4150,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3426,12 +4160,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif opcodes
 
 .PHONY: maybe-install-info-opcodes install-info-opcodes
 maybe-install-info-opcodes:
+@if opcodes
+maybe-install-info-opcodes: install-info-opcodes
 
 install-info-opcodes: \
     configure-opcodes \
@@ -3440,6 +4177,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3449,12 +4187,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif opcodes
 
 .PHONY: maybe-installcheck-opcodes installcheck-opcodes
 maybe-installcheck-opcodes:
+@if opcodes
+maybe-installcheck-opcodes: installcheck-opcodes
 
 installcheck-opcodes: \
     configure-opcodes 
@@ -3462,6 +4203,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3471,18 +4213,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif opcodes
 
 .PHONY: maybe-mostlyclean-opcodes mostlyclean-opcodes
 maybe-mostlyclean-opcodes:
+@if opcodes
+maybe-mostlyclean-opcodes: mostlyclean-opcodes
 
 mostlyclean-opcodes: 
 	@[ -f ./opcodes/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3492,18 +4238,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif opcodes
 
 .PHONY: maybe-clean-opcodes clean-opcodes
 maybe-clean-opcodes:
+@if opcodes
+maybe-clean-opcodes: clean-opcodes
 
 clean-opcodes: 
 	@[ -f ./opcodes/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3513,18 +4263,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif opcodes
 
 .PHONY: maybe-distclean-opcodes distclean-opcodes
 maybe-distclean-opcodes:
+@if opcodes
+maybe-distclean-opcodes: distclean-opcodes
 
 distclean-opcodes: 
 	@[ -f ./opcodes/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3534,18 +4288,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif opcodes
 
 .PHONY: maybe-maintainer-clean-opcodes maintainer-clean-opcodes
 maybe-maintainer-clean-opcodes:
+@if opcodes
+maybe-maintainer-clean-opcodes: maintainer-clean-opcodes
 
 maintainer-clean-opcodes: 
 	@[ -f ./opcodes/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3555,33 +4313,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif opcodes
 
 
 .PHONY: configure-binutils maybe-configure-binutils
 maybe-configure-binutils:
+@if binutils
+maybe-configure-binutils: configure-binutils
 configure-binutils:
 	@test ! -f binutils/Makefile || exit 0; \
 	[ -d binutils ] || mkdir binutils; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in binutils; \
 	cd binutils || exit 1; \
 	case $(srcdir) in \
@@ -3596,41 +4343,56 @@
 	    libsrcdir="$$s/binutils";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif binutils
 
 .PHONY: all-binutils maybe-all-binutils
 maybe-all-binutils:
+@if binutils
+maybe-all-binutils: all-binutils
 all-binutils: configure-binutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd binutils && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd binutils && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif binutils
 
 .PHONY: check-binutils maybe-check-binutils
 maybe-check-binutils:
+@if binutils
+maybe-check-binutils: check-binutils
 
 check-binutils:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd binutils && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd binutils && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif binutils
 
 .PHONY: install-binutils maybe-install-binutils
 maybe-install-binutils:
+@if binutils
+maybe-install-binutils: install-binutils
 
 install-binutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd binutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd binutils && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif binutils
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-binutils info-binutils
 maybe-info-binutils:
+@if binutils
+maybe-info-binutils: info-binutils
 
 info-binutils: \
     configure-binutils 
@@ -3638,6 +4400,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3647,12 +4410,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif binutils
 
 .PHONY: maybe-dvi-binutils dvi-binutils
 maybe-dvi-binutils:
+@if binutils
+maybe-dvi-binutils: dvi-binutils
 
 dvi-binutils: \
     configure-binutils 
@@ -3660,6 +4426,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3669,12 +4436,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif binutils
 
 .PHONY: maybe-TAGS-binutils TAGS-binutils
 maybe-TAGS-binutils:
+@if binutils
+maybe-TAGS-binutils: TAGS-binutils
 
 TAGS-binutils: \
     configure-binutils 
@@ -3682,6 +4452,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3691,12 +4462,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif binutils
 
 .PHONY: maybe-install-info-binutils install-info-binutils
 maybe-install-info-binutils:
+@if binutils
+maybe-install-info-binutils: install-info-binutils
 
 install-info-binutils: \
     configure-binutils \
@@ -3705,6 +4479,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3714,12 +4489,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif binutils
 
 .PHONY: maybe-installcheck-binutils installcheck-binutils
 maybe-installcheck-binutils:
+@if binutils
+maybe-installcheck-binutils: installcheck-binutils
 
 installcheck-binutils: \
     configure-binutils 
@@ -3727,6 +4505,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3736,18 +4515,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif binutils
 
 .PHONY: maybe-mostlyclean-binutils mostlyclean-binutils
 maybe-mostlyclean-binutils:
+@if binutils
+maybe-mostlyclean-binutils: mostlyclean-binutils
 
 mostlyclean-binutils: 
 	@[ -f ./binutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3757,18 +4540,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif binutils
 
 .PHONY: maybe-clean-binutils clean-binutils
 maybe-clean-binutils:
+@if binutils
+maybe-clean-binutils: clean-binutils
 
 clean-binutils: 
 	@[ -f ./binutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3778,18 +4565,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif binutils
 
 .PHONY: maybe-distclean-binutils distclean-binutils
 maybe-distclean-binutils:
+@if binutils
+maybe-distclean-binutils: distclean-binutils
 
 distclean-binutils: 
 	@[ -f ./binutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3799,18 +4590,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif binutils
 
 .PHONY: maybe-maintainer-clean-binutils maintainer-clean-binutils
 maybe-maintainer-clean-binutils:
+@if binutils
+maybe-maintainer-clean-binutils: maintainer-clean-binutils
 
 maintainer-clean-binutils: 
 	@[ -f ./binutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3820,33 +4615,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif binutils
 
 
 .PHONY: configure-bison maybe-configure-bison
 maybe-configure-bison:
+@if bison
+maybe-configure-bison: configure-bison
 configure-bison:
 	@test ! -f bison/Makefile || exit 0; \
 	[ -d bison ] || mkdir bison; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in bison; \
 	cd bison || exit 1; \
 	case $(srcdir) in \
@@ -3861,19 +4645,26 @@
 	    libsrcdir="$$s/bison";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif bison
 
 .PHONY: all-bison maybe-all-bison
 maybe-all-bison:
+@if bison
+maybe-all-bison: all-bison
 all-bison: configure-bison
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bison && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd bison && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif bison
 
 .PHONY: check-bison maybe-check-bison
 maybe-check-bison:
+@if bison
+maybe-check-bison: check-bison
 
 # This module is only tested in a native toolchain.
 check-bison:
@@ -3881,24 +4672,32 @@
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
-	  (cd bison && $(MAKE) $(FLAGS_TO_PASS) check); \
+	  $(HOST_EXPORTS) \
+	  (cd bison && $(MAKE) $(FLAGS_TO_PASS)  check); \
 	fi
 
+@endif bison
 
 .PHONY: install-bison maybe-install-bison
 maybe-install-bison:
+@if bison
+maybe-install-bison: install-bison
 
 install-bison: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bison && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd bison && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif bison
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-bison info-bison
 maybe-info-bison:
+@if bison
+maybe-info-bison: info-bison
 
 info-bison: \
     configure-bison 
@@ -3906,6 +4705,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3915,12 +4715,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif bison
 
 .PHONY: maybe-dvi-bison dvi-bison
 maybe-dvi-bison:
+@if bison
+maybe-dvi-bison: dvi-bison
 
 dvi-bison: \
     configure-bison 
@@ -3928,6 +4731,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3937,12 +4741,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif bison
 
 .PHONY: maybe-TAGS-bison TAGS-bison
 maybe-TAGS-bison:
+@if bison
+maybe-TAGS-bison: TAGS-bison
 
 TAGS-bison: \
     configure-bison 
@@ -3950,6 +4757,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3959,12 +4767,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif bison
 
 .PHONY: maybe-install-info-bison install-info-bison
 maybe-install-info-bison:
+@if bison
+maybe-install-info-bison: install-info-bison
 
 install-info-bison: \
     configure-bison \
@@ -3973,6 +4784,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -3982,12 +4794,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif bison
 
 .PHONY: maybe-installcheck-bison installcheck-bison
 maybe-installcheck-bison:
+@if bison
+maybe-installcheck-bison: installcheck-bison
 
 installcheck-bison: \
     configure-bison 
@@ -3995,6 +4810,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4004,18 +4820,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif bison
 
 .PHONY: maybe-mostlyclean-bison mostlyclean-bison
 maybe-mostlyclean-bison:
+@if bison
+maybe-mostlyclean-bison: mostlyclean-bison
 
 mostlyclean-bison: 
 	@[ -f ./bison/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4025,18 +4845,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif bison
 
 .PHONY: maybe-clean-bison clean-bison
 maybe-clean-bison:
+@if bison
+maybe-clean-bison: clean-bison
 
 clean-bison: 
 	@[ -f ./bison/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4046,18 +4870,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif bison
 
 .PHONY: maybe-distclean-bison distclean-bison
 maybe-distclean-bison:
+@if bison
+maybe-distclean-bison: distclean-bison
 
 distclean-bison: 
 	@[ -f ./bison/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4067,18 +4895,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif bison
 
 .PHONY: maybe-maintainer-clean-bison maintainer-clean-bison
 maybe-maintainer-clean-bison:
+@if bison
+maybe-maintainer-clean-bison: maintainer-clean-bison
 
 maintainer-clean-bison: 
 	@[ -f ./bison/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4088,33 +4920,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif bison
 
 
 .PHONY: configure-byacc maybe-configure-byacc
 maybe-configure-byacc:
+@if byacc
+maybe-configure-byacc: configure-byacc
 configure-byacc:
 	@test ! -f byacc/Makefile || exit 0; \
 	[ -d byacc ] || mkdir byacc; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in byacc; \
 	cd byacc || exit 1; \
 	case $(srcdir) in \
@@ -4129,19 +4950,26 @@
 	    libsrcdir="$$s/byacc";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif byacc
 
 .PHONY: all-byacc maybe-all-byacc
 maybe-all-byacc:
+@if byacc
+maybe-all-byacc: all-byacc
 all-byacc: configure-byacc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd byacc && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd byacc && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif byacc
 
 .PHONY: check-byacc maybe-check-byacc
 maybe-check-byacc:
+@if byacc
+maybe-check-byacc: check-byacc
 
 # This module is only tested in a native toolchain.
 check-byacc:
@@ -4149,24 +4977,32 @@
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
-	  (cd byacc && $(MAKE) $(FLAGS_TO_PASS) check); \
+	  $(HOST_EXPORTS) \
+	  (cd byacc && $(MAKE) $(FLAGS_TO_PASS)  check); \
 	fi
 
+@endif byacc
 
 .PHONY: install-byacc maybe-install-byacc
 maybe-install-byacc:
+@if byacc
+maybe-install-byacc: install-byacc
 
 install-byacc: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd byacc && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd byacc && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif byacc
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-byacc info-byacc
 maybe-info-byacc:
+@if byacc
+maybe-info-byacc: info-byacc
 
 info-byacc: \
     configure-byacc 
@@ -4174,6 +5010,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4183,12 +5020,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif byacc
 
 .PHONY: maybe-dvi-byacc dvi-byacc
 maybe-dvi-byacc:
+@if byacc
+maybe-dvi-byacc: dvi-byacc
 
 dvi-byacc: \
     configure-byacc 
@@ -4196,6 +5036,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4205,12 +5046,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif byacc
 
 .PHONY: maybe-TAGS-byacc TAGS-byacc
 maybe-TAGS-byacc:
+@if byacc
+maybe-TAGS-byacc: TAGS-byacc
 
 TAGS-byacc: \
     configure-byacc 
@@ -4218,6 +5062,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4227,12 +5072,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif byacc
 
 .PHONY: maybe-install-info-byacc install-info-byacc
 maybe-install-info-byacc:
+@if byacc
+maybe-install-info-byacc: install-info-byacc
 
 install-info-byacc: \
     configure-byacc \
@@ -4241,6 +5089,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4250,12 +5099,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif byacc
 
 .PHONY: maybe-installcheck-byacc installcheck-byacc
 maybe-installcheck-byacc:
+@if byacc
+maybe-installcheck-byacc: installcheck-byacc
 
 installcheck-byacc: \
     configure-byacc 
@@ -4263,6 +5115,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4272,18 +5125,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif byacc
 
 .PHONY: maybe-mostlyclean-byacc mostlyclean-byacc
 maybe-mostlyclean-byacc:
+@if byacc
+maybe-mostlyclean-byacc: mostlyclean-byacc
 
 mostlyclean-byacc: 
 	@[ -f ./byacc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4293,18 +5150,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif byacc
 
 .PHONY: maybe-clean-byacc clean-byacc
 maybe-clean-byacc:
+@if byacc
+maybe-clean-byacc: clean-byacc
 
 clean-byacc: 
 	@[ -f ./byacc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4314,18 +5175,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif byacc
 
 .PHONY: maybe-distclean-byacc distclean-byacc
 maybe-distclean-byacc:
+@if byacc
+maybe-distclean-byacc: distclean-byacc
 
 distclean-byacc: 
 	@[ -f ./byacc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4335,18 +5200,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif byacc
 
 .PHONY: maybe-maintainer-clean-byacc maintainer-clean-byacc
 maybe-maintainer-clean-byacc:
+@if byacc
+maybe-maintainer-clean-byacc: maintainer-clean-byacc
 
 maintainer-clean-byacc: 
 	@[ -f ./byacc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4356,33 +5225,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif byacc
 
 
 .PHONY: configure-bzip2 maybe-configure-bzip2
 maybe-configure-bzip2:
+@if bzip2
+maybe-configure-bzip2: configure-bzip2
 configure-bzip2:
 	@test ! -f bzip2/Makefile || exit 0; \
 	[ -d bzip2 ] || mkdir bzip2; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in bzip2; \
 	cd bzip2 || exit 1; \
 	case $(srcdir) in \
@@ -4397,41 +5255,56 @@
 	    libsrcdir="$$s/bzip2";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif bzip2
 
 .PHONY: all-bzip2 maybe-all-bzip2
 maybe-all-bzip2:
+@if bzip2
+maybe-all-bzip2: all-bzip2
 all-bzip2: configure-bzip2
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd bzip2 && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif bzip2
 
 .PHONY: check-bzip2 maybe-check-bzip2
 maybe-check-bzip2:
+@if bzip2
+maybe-check-bzip2: check-bzip2
 
 check-bzip2:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd bzip2 && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif bzip2
 
 .PHONY: install-bzip2 maybe-install-bzip2
 maybe-install-bzip2:
+@if bzip2
+maybe-install-bzip2: install-bzip2
 
 install-bzip2: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd bzip2 && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif bzip2
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-bzip2 info-bzip2
 maybe-info-bzip2:
+@if bzip2
+maybe-info-bzip2: info-bzip2
 
 info-bzip2: \
     configure-bzip2 
@@ -4439,6 +5312,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4448,12 +5322,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif bzip2
 
 .PHONY: maybe-dvi-bzip2 dvi-bzip2
 maybe-dvi-bzip2:
+@if bzip2
+maybe-dvi-bzip2: dvi-bzip2
 
 dvi-bzip2: \
     configure-bzip2 
@@ -4461,6 +5338,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4470,12 +5348,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif bzip2
 
 .PHONY: maybe-TAGS-bzip2 TAGS-bzip2
 maybe-TAGS-bzip2:
+@if bzip2
+maybe-TAGS-bzip2: TAGS-bzip2
 
 TAGS-bzip2: \
     configure-bzip2 
@@ -4483,6 +5364,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4492,12 +5374,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif bzip2
 
 .PHONY: maybe-install-info-bzip2 install-info-bzip2
 maybe-install-info-bzip2:
+@if bzip2
+maybe-install-info-bzip2: install-info-bzip2
 
 install-info-bzip2: \
     configure-bzip2 \
@@ -4506,6 +5391,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4515,12 +5401,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif bzip2
 
 .PHONY: maybe-installcheck-bzip2 installcheck-bzip2
 maybe-installcheck-bzip2:
+@if bzip2
+maybe-installcheck-bzip2: installcheck-bzip2
 
 installcheck-bzip2: \
     configure-bzip2 
@@ -4528,6 +5417,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4537,18 +5427,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif bzip2
 
 .PHONY: maybe-mostlyclean-bzip2 mostlyclean-bzip2
 maybe-mostlyclean-bzip2:
+@if bzip2
+maybe-mostlyclean-bzip2: mostlyclean-bzip2
 
 mostlyclean-bzip2: 
 	@[ -f ./bzip2/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4558,18 +5452,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif bzip2
 
 .PHONY: maybe-clean-bzip2 clean-bzip2
 maybe-clean-bzip2:
+@if bzip2
+maybe-clean-bzip2: clean-bzip2
 
 clean-bzip2: 
 	@[ -f ./bzip2/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4579,18 +5477,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif bzip2
 
 .PHONY: maybe-distclean-bzip2 distclean-bzip2
 maybe-distclean-bzip2:
+@if bzip2
+maybe-distclean-bzip2: distclean-bzip2
 
 distclean-bzip2: 
 	@[ -f ./bzip2/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4600,18 +5502,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif bzip2
 
 .PHONY: maybe-maintainer-clean-bzip2 maintainer-clean-bzip2
 maybe-maintainer-clean-bzip2:
+@if bzip2
+maybe-maintainer-clean-bzip2: maintainer-clean-bzip2
 
 maintainer-clean-bzip2: 
 	@[ -f ./bzip2/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4621,33 +5527,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif bzip2
 
 
 .PHONY: configure-dejagnu maybe-configure-dejagnu
 maybe-configure-dejagnu:
+@if dejagnu
+maybe-configure-dejagnu: configure-dejagnu
 configure-dejagnu:
 	@test ! -f dejagnu/Makefile || exit 0; \
 	[ -d dejagnu ] || mkdir dejagnu; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in dejagnu; \
 	cd dejagnu || exit 1; \
 	case $(srcdir) in \
@@ -4662,41 +5557,56 @@
 	    libsrcdir="$$s/dejagnu";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif dejagnu
 
 .PHONY: all-dejagnu maybe-all-dejagnu
 maybe-all-dejagnu:
+@if dejagnu
+maybe-all-dejagnu: all-dejagnu
 all-dejagnu: configure-dejagnu
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd dejagnu && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif dejagnu
 
 .PHONY: check-dejagnu maybe-check-dejagnu
 maybe-check-dejagnu:
+@if dejagnu
+maybe-check-dejagnu: check-dejagnu
 
 check-dejagnu:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd dejagnu && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif dejagnu
 
 .PHONY: install-dejagnu maybe-install-dejagnu
 maybe-install-dejagnu:
+@if dejagnu
+maybe-install-dejagnu: install-dejagnu
 
 install-dejagnu: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd dejagnu && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif dejagnu
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-dejagnu info-dejagnu
 maybe-info-dejagnu:
+@if dejagnu
+maybe-info-dejagnu: info-dejagnu
 
 info-dejagnu: \
     configure-dejagnu 
@@ -4704,6 +5614,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4713,12 +5624,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif dejagnu
 
 .PHONY: maybe-dvi-dejagnu dvi-dejagnu
 maybe-dvi-dejagnu:
+@if dejagnu
+maybe-dvi-dejagnu: dvi-dejagnu
 
 dvi-dejagnu: \
     configure-dejagnu 
@@ -4726,6 +5640,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4735,12 +5650,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif dejagnu
 
 .PHONY: maybe-TAGS-dejagnu TAGS-dejagnu
 maybe-TAGS-dejagnu:
+@if dejagnu
+maybe-TAGS-dejagnu: TAGS-dejagnu
 
 TAGS-dejagnu: \
     configure-dejagnu 
@@ -4748,6 +5666,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4757,12 +5676,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif dejagnu
 
 .PHONY: maybe-install-info-dejagnu install-info-dejagnu
 maybe-install-info-dejagnu:
+@if dejagnu
+maybe-install-info-dejagnu: install-info-dejagnu
 
 install-info-dejagnu: \
     configure-dejagnu \
@@ -4771,6 +5693,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4780,12 +5703,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif dejagnu
 
 .PHONY: maybe-installcheck-dejagnu installcheck-dejagnu
 maybe-installcheck-dejagnu:
+@if dejagnu
+maybe-installcheck-dejagnu: installcheck-dejagnu
 
 installcheck-dejagnu: \
     configure-dejagnu 
@@ -4793,6 +5719,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4802,18 +5729,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif dejagnu
 
 .PHONY: maybe-mostlyclean-dejagnu mostlyclean-dejagnu
 maybe-mostlyclean-dejagnu:
+@if dejagnu
+maybe-mostlyclean-dejagnu: mostlyclean-dejagnu
 
 mostlyclean-dejagnu: 
 	@[ -f ./dejagnu/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4823,18 +5754,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif dejagnu
 
 .PHONY: maybe-clean-dejagnu clean-dejagnu
 maybe-clean-dejagnu:
+@if dejagnu
+maybe-clean-dejagnu: clean-dejagnu
 
 clean-dejagnu: 
 	@[ -f ./dejagnu/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4844,18 +5779,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif dejagnu
 
 .PHONY: maybe-distclean-dejagnu distclean-dejagnu
 maybe-distclean-dejagnu:
+@if dejagnu
+maybe-distclean-dejagnu: distclean-dejagnu
 
 distclean-dejagnu: 
 	@[ -f ./dejagnu/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4865,18 +5804,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif dejagnu
 
 .PHONY: maybe-maintainer-clean-dejagnu maintainer-clean-dejagnu
 maybe-maintainer-clean-dejagnu:
+@if dejagnu
+maybe-maintainer-clean-dejagnu: maintainer-clean-dejagnu
 
 maintainer-clean-dejagnu: 
 	@[ -f ./dejagnu/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4886,33 +5829,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif dejagnu
 
 
 .PHONY: configure-diff maybe-configure-diff
 maybe-configure-diff:
+@if diff
+maybe-configure-diff: configure-diff
 configure-diff:
 	@test ! -f diff/Makefile || exit 0; \
 	[ -d diff ] || mkdir diff; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in diff; \
 	cd diff || exit 1; \
 	case $(srcdir) in \
@@ -4927,41 +5859,56 @@
 	    libsrcdir="$$s/diff";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif diff
 
 .PHONY: all-diff maybe-all-diff
 maybe-all-diff:
+@if diff
+maybe-all-diff: all-diff
 all-diff: configure-diff
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd diff && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd diff && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif diff
 
 .PHONY: check-diff maybe-check-diff
 maybe-check-diff:
+@if diff
+maybe-check-diff: check-diff
 
 check-diff:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd diff && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd diff && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif diff
 
 .PHONY: install-diff maybe-install-diff
 maybe-install-diff:
+@if diff
+maybe-install-diff: install-diff
 
 install-diff: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd diff && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd diff && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif diff
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-diff info-diff
 maybe-info-diff:
+@if diff
+maybe-info-diff: info-diff
 
 info-diff: \
     configure-diff 
@@ -4969,6 +5916,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -4978,12 +5926,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif diff
 
 .PHONY: maybe-dvi-diff dvi-diff
 maybe-dvi-diff:
+@if diff
+maybe-dvi-diff: dvi-diff
 
 dvi-diff: \
     configure-diff 
@@ -4991,6 +5942,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5000,12 +5952,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif diff
 
 .PHONY: maybe-TAGS-diff TAGS-diff
 maybe-TAGS-diff:
+@if diff
+maybe-TAGS-diff: TAGS-diff
 
 TAGS-diff: \
     configure-diff 
@@ -5013,6 +5968,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5022,12 +5978,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif diff
 
 .PHONY: maybe-install-info-diff install-info-diff
 maybe-install-info-diff:
+@if diff
+maybe-install-info-diff: install-info-diff
 
 install-info-diff: \
     configure-diff \
@@ -5036,6 +5995,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5045,12 +6005,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif diff
 
 .PHONY: maybe-installcheck-diff installcheck-diff
 maybe-installcheck-diff:
+@if diff
+maybe-installcheck-diff: installcheck-diff
 
 installcheck-diff: \
     configure-diff 
@@ -5058,6 +6021,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5067,18 +6031,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif diff
 
 .PHONY: maybe-mostlyclean-diff mostlyclean-diff
 maybe-mostlyclean-diff:
+@if diff
+maybe-mostlyclean-diff: mostlyclean-diff
 
 mostlyclean-diff: 
 	@[ -f ./diff/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5088,18 +6056,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif diff
 
 .PHONY: maybe-clean-diff clean-diff
 maybe-clean-diff:
+@if diff
+maybe-clean-diff: clean-diff
 
 clean-diff: 
 	@[ -f ./diff/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5109,18 +6081,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif diff
 
 .PHONY: maybe-distclean-diff distclean-diff
 maybe-distclean-diff:
+@if diff
+maybe-distclean-diff: distclean-diff
 
 distclean-diff: 
 	@[ -f ./diff/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5130,18 +6106,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif diff
 
 .PHONY: maybe-maintainer-clean-diff maintainer-clean-diff
 maybe-maintainer-clean-diff:
+@if diff
+maybe-maintainer-clean-diff: maintainer-clean-diff
 
 maintainer-clean-diff: 
 	@[ -f ./diff/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5151,33 +6131,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif diff
 
 
 .PHONY: configure-dosutils maybe-configure-dosutils
 maybe-configure-dosutils:
+@if dosutils
+maybe-configure-dosutils: configure-dosutils
 configure-dosutils:
 	@test ! -f dosutils/Makefile || exit 0; \
 	[ -d dosutils ] || mkdir dosutils; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in dosutils; \
 	cd dosutils || exit 1; \
 	case $(srcdir) in \
@@ -5192,37 +6161,51 @@
 	    libsrcdir="$$s/dosutils";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif dosutils
 
 .PHONY: all-dosutils maybe-all-dosutils
 maybe-all-dosutils:
+@if dosutils
+maybe-all-dosutils: all-dosutils
 all-dosutils: configure-dosutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd dosutils && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd dosutils && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif dosutils
 
 .PHONY: check-dosutils maybe-check-dosutils
 maybe-check-dosutils:
+@if dosutils
+maybe-check-dosutils: check-dosutils
 
 check-dosutils:
 
+@endif dosutils
 
 .PHONY: install-dosutils maybe-install-dosutils
 maybe-install-dosutils:
+@if dosutils
+maybe-install-dosutils: install-dosutils
 
 install-dosutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd dosutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd dosutils && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif dosutils
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-dosutils info-dosutils
 maybe-info-dosutils:
+@if dosutils
+maybe-info-dosutils: info-dosutils
 
 info-dosutils: \
     configure-dosutils 
@@ -5230,6 +6213,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5239,12 +6223,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif dosutils
 
 .PHONY: maybe-dvi-dosutils dvi-dosutils
 maybe-dvi-dosutils:
+@if dosutils
+maybe-dvi-dosutils: dvi-dosutils
 
 dvi-dosutils: \
     configure-dosutils 
@@ -5252,6 +6239,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5261,12 +6249,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif dosutils
 
 .PHONY: maybe-TAGS-dosutils TAGS-dosutils
 maybe-TAGS-dosutils:
+@if dosutils
+maybe-TAGS-dosutils: TAGS-dosutils
 
 TAGS-dosutils: \
     configure-dosutils 
@@ -5274,6 +6265,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5283,12 +6275,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif dosutils
 
 .PHONY: maybe-install-info-dosutils install-info-dosutils
 maybe-install-info-dosutils:
+@if dosutils
+maybe-install-info-dosutils: install-info-dosutils
 
 install-info-dosutils: \
     configure-dosutils \
@@ -5297,6 +6292,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5306,12 +6302,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif dosutils
 
 .PHONY: maybe-installcheck-dosutils installcheck-dosutils
 maybe-installcheck-dosutils:
+@if dosutils
+maybe-installcheck-dosutils: installcheck-dosutils
 
 installcheck-dosutils: \
     configure-dosutils 
@@ -5319,6 +6318,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5328,18 +6328,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif dosutils
 
 .PHONY: maybe-mostlyclean-dosutils mostlyclean-dosutils
 maybe-mostlyclean-dosutils:
+@if dosutils
+maybe-mostlyclean-dosutils: mostlyclean-dosutils
 
 mostlyclean-dosutils: 
 	@[ -f ./dosutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5349,18 +6353,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif dosutils
 
 .PHONY: maybe-clean-dosutils clean-dosutils
 maybe-clean-dosutils:
+@if dosutils
+maybe-clean-dosutils: clean-dosutils
 
 clean-dosutils: 
 	@[ -f ./dosutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5370,18 +6378,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif dosutils
 
 .PHONY: maybe-distclean-dosutils distclean-dosutils
 maybe-distclean-dosutils:
+@if dosutils
+maybe-distclean-dosutils: distclean-dosutils
 
 distclean-dosutils: 
 	@[ -f ./dosutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5391,18 +6403,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif dosutils
 
 .PHONY: maybe-maintainer-clean-dosutils maintainer-clean-dosutils
 maybe-maintainer-clean-dosutils:
+@if dosutils
+maybe-maintainer-clean-dosutils: maintainer-clean-dosutils
 
 maintainer-clean-dosutils: 
 	@[ -f ./dosutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5412,33 +6428,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif dosutils
 
 
 .PHONY: configure-etc maybe-configure-etc
 maybe-configure-etc:
+@if etc
+maybe-configure-etc: configure-etc
 configure-etc:
 	@test ! -f etc/Makefile || exit 0; \
 	[ -d etc ] || mkdir etc; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in etc; \
 	cd etc || exit 1; \
 	case $(srcdir) in \
@@ -5453,41 +6458,56 @@
 	    libsrcdir="$$s/etc";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif etc
 
 .PHONY: all-etc maybe-all-etc
 maybe-all-etc:
+@if etc
+maybe-all-etc: all-etc
 all-etc: configure-etc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd etc && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd etc && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif etc
 
 .PHONY: check-etc maybe-check-etc
 maybe-check-etc:
+@if etc
+maybe-check-etc: check-etc
 
 check-etc:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd etc && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd etc && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif etc
 
 .PHONY: install-etc maybe-install-etc
 maybe-install-etc:
+@if etc
+maybe-install-etc: install-etc
 
 install-etc: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd etc && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd etc && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif etc
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-etc info-etc
 maybe-info-etc:
+@if etc
+maybe-info-etc: info-etc
 
 info-etc: \
     configure-etc 
@@ -5495,6 +6515,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5504,12 +6525,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif etc
 
 .PHONY: maybe-dvi-etc dvi-etc
 maybe-dvi-etc:
+@if etc
+maybe-dvi-etc: dvi-etc
 
 dvi-etc: \
     configure-etc 
@@ -5517,6 +6541,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5526,12 +6551,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif etc
 
 .PHONY: maybe-TAGS-etc TAGS-etc
 maybe-TAGS-etc:
+@if etc
+maybe-TAGS-etc: TAGS-etc
 
 TAGS-etc: \
     configure-etc 
@@ -5539,6 +6567,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5548,12 +6577,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif etc
 
 .PHONY: maybe-install-info-etc install-info-etc
 maybe-install-info-etc:
+@if etc
+maybe-install-info-etc: install-info-etc
 
 install-info-etc: \
     configure-etc \
@@ -5562,6 +6594,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5571,12 +6604,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif etc
 
 .PHONY: maybe-installcheck-etc installcheck-etc
 maybe-installcheck-etc:
+@if etc
+maybe-installcheck-etc: installcheck-etc
 
 installcheck-etc: \
     configure-etc 
@@ -5584,6 +6620,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5593,18 +6630,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif etc
 
 .PHONY: maybe-mostlyclean-etc mostlyclean-etc
 maybe-mostlyclean-etc:
+@if etc
+maybe-mostlyclean-etc: mostlyclean-etc
 
 mostlyclean-etc: 
 	@[ -f ./etc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5614,18 +6655,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif etc
 
 .PHONY: maybe-clean-etc clean-etc
 maybe-clean-etc:
+@if etc
+maybe-clean-etc: clean-etc
 
 clean-etc: 
 	@[ -f ./etc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5635,18 +6680,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif etc
 
 .PHONY: maybe-distclean-etc distclean-etc
 maybe-distclean-etc:
+@if etc
+maybe-distclean-etc: distclean-etc
 
 distclean-etc: 
 	@[ -f ./etc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5656,18 +6705,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif etc
 
 .PHONY: maybe-maintainer-clean-etc maintainer-clean-etc
 maybe-maintainer-clean-etc:
+@if etc
+maybe-maintainer-clean-etc: maintainer-clean-etc
 
 maintainer-clean-etc: 
 	@[ -f ./etc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5677,33 +6730,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif etc
 
 
 .PHONY: configure-fastjar maybe-configure-fastjar
 maybe-configure-fastjar:
+@if fastjar
+maybe-configure-fastjar: configure-fastjar
 configure-fastjar:
 	@test ! -f fastjar/Makefile || exit 0; \
 	[ -d fastjar ] || mkdir fastjar; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in fastjar; \
 	cd fastjar || exit 1; \
 	case $(srcdir) in \
@@ -5718,19 +6760,26 @@
 	    libsrcdir="$$s/fastjar";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif fastjar
 
 .PHONY: all-fastjar maybe-all-fastjar
 maybe-all-fastjar:
+@if fastjar
+maybe-all-fastjar: all-fastjar
 all-fastjar: configure-fastjar
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd fastjar && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd fastjar && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif fastjar
 
 .PHONY: check-fastjar maybe-check-fastjar
 maybe-check-fastjar:
+@if fastjar
+maybe-check-fastjar: check-fastjar
 
 # This module is only tested in a native toolchain.
 check-fastjar:
@@ -5738,24 +6787,32 @@
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
-	  (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) check); \
+	  $(HOST_EXPORTS) \
+	  (cd fastjar && $(MAKE) $(FLAGS_TO_PASS)  check); \
 	fi
 
+@endif fastjar
 
 .PHONY: install-fastjar maybe-install-fastjar
 maybe-install-fastjar:
+@if fastjar
+maybe-install-fastjar: install-fastjar
 
 install-fastjar: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd fastjar && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd fastjar && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif fastjar
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-fastjar info-fastjar
 maybe-info-fastjar:
+@if fastjar
+maybe-info-fastjar: info-fastjar
 
 info-fastjar: \
     configure-fastjar 
@@ -5763,6 +6820,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5772,12 +6830,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif fastjar
 
 .PHONY: maybe-dvi-fastjar dvi-fastjar
 maybe-dvi-fastjar:
+@if fastjar
+maybe-dvi-fastjar: dvi-fastjar
 
 dvi-fastjar: \
     configure-fastjar 
@@ -5785,6 +6846,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5794,12 +6856,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif fastjar
 
 .PHONY: maybe-TAGS-fastjar TAGS-fastjar
 maybe-TAGS-fastjar:
+@if fastjar
+maybe-TAGS-fastjar: TAGS-fastjar
 
 TAGS-fastjar: \
     configure-fastjar 
@@ -5807,6 +6872,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5816,12 +6882,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif fastjar
 
 .PHONY: maybe-install-info-fastjar install-info-fastjar
 maybe-install-info-fastjar:
+@if fastjar
+maybe-install-info-fastjar: install-info-fastjar
 
 install-info-fastjar: \
     configure-fastjar \
@@ -5830,6 +6899,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5839,12 +6909,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif fastjar
 
 .PHONY: maybe-installcheck-fastjar installcheck-fastjar
 maybe-installcheck-fastjar:
+@if fastjar
+maybe-installcheck-fastjar: installcheck-fastjar
 
 installcheck-fastjar: \
     configure-fastjar 
@@ -5852,6 +6925,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5861,18 +6935,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif fastjar
 
 .PHONY: maybe-mostlyclean-fastjar mostlyclean-fastjar
 maybe-mostlyclean-fastjar:
+@if fastjar
+maybe-mostlyclean-fastjar: mostlyclean-fastjar
 
 mostlyclean-fastjar: 
 	@[ -f ./fastjar/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5882,18 +6960,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif fastjar
 
 .PHONY: maybe-clean-fastjar clean-fastjar
 maybe-clean-fastjar:
+@if fastjar
+maybe-clean-fastjar: clean-fastjar
 
 clean-fastjar: 
 	@[ -f ./fastjar/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5903,18 +6985,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif fastjar
 
 .PHONY: maybe-distclean-fastjar distclean-fastjar
 maybe-distclean-fastjar:
+@if fastjar
+maybe-distclean-fastjar: distclean-fastjar
 
 distclean-fastjar: 
 	@[ -f ./fastjar/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5924,18 +7010,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif fastjar
 
 .PHONY: maybe-maintainer-clean-fastjar maintainer-clean-fastjar
 maybe-maintainer-clean-fastjar:
+@if fastjar
+maybe-maintainer-clean-fastjar: maintainer-clean-fastjar
 
 maintainer-clean-fastjar: 
 	@[ -f ./fastjar/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -5945,33 +7035,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif fastjar
 
 
 .PHONY: configure-fileutils maybe-configure-fileutils
 maybe-configure-fileutils:
+@if fileutils
+maybe-configure-fileutils: configure-fileutils
 configure-fileutils:
 	@test ! -f fileutils/Makefile || exit 0; \
 	[ -d fileutils ] || mkdir fileutils; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in fileutils; \
 	cd fileutils || exit 1; \
 	case $(srcdir) in \
@@ -5986,41 +7065,56 @@
 	    libsrcdir="$$s/fileutils";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif fileutils
 
 .PHONY: all-fileutils maybe-all-fileutils
 maybe-all-fileutils:
+@if fileutils
+maybe-all-fileutils: all-fileutils
 all-fileutils: configure-fileutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd fileutils && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd fileutils && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif fileutils
 
 .PHONY: check-fileutils maybe-check-fileutils
 maybe-check-fileutils:
+@if fileutils
+maybe-check-fileutils: check-fileutils
 
 check-fileutils:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd fileutils && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd fileutils && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif fileutils
 
 .PHONY: install-fileutils maybe-install-fileutils
 maybe-install-fileutils:
+@if fileutils
+maybe-install-fileutils: install-fileutils
 
 install-fileutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd fileutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd fileutils && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif fileutils
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-fileutils info-fileutils
 maybe-info-fileutils:
+@if fileutils
+maybe-info-fileutils: info-fileutils
 
 info-fileutils: \
     configure-fileutils 
@@ -6028,6 +7122,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6037,12 +7132,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif fileutils
 
 .PHONY: maybe-dvi-fileutils dvi-fileutils
 maybe-dvi-fileutils:
+@if fileutils
+maybe-dvi-fileutils: dvi-fileutils
 
 dvi-fileutils: \
     configure-fileutils 
@@ -6050,6 +7148,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6059,12 +7158,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif fileutils
 
 .PHONY: maybe-TAGS-fileutils TAGS-fileutils
 maybe-TAGS-fileutils:
+@if fileutils
+maybe-TAGS-fileutils: TAGS-fileutils
 
 TAGS-fileutils: \
     configure-fileutils 
@@ -6072,6 +7174,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6081,12 +7184,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif fileutils
 
 .PHONY: maybe-install-info-fileutils install-info-fileutils
 maybe-install-info-fileutils:
+@if fileutils
+maybe-install-info-fileutils: install-info-fileutils
 
 install-info-fileutils: \
     configure-fileutils \
@@ -6095,6 +7201,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6104,12 +7211,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif fileutils
 
 .PHONY: maybe-installcheck-fileutils installcheck-fileutils
 maybe-installcheck-fileutils:
+@if fileutils
+maybe-installcheck-fileutils: installcheck-fileutils
 
 installcheck-fileutils: \
     configure-fileutils 
@@ -6117,6 +7227,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6126,18 +7237,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif fileutils
 
 .PHONY: maybe-mostlyclean-fileutils mostlyclean-fileutils
 maybe-mostlyclean-fileutils:
+@if fileutils
+maybe-mostlyclean-fileutils: mostlyclean-fileutils
 
 mostlyclean-fileutils: 
 	@[ -f ./fileutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6147,18 +7262,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif fileutils
 
 .PHONY: maybe-clean-fileutils clean-fileutils
 maybe-clean-fileutils:
+@if fileutils
+maybe-clean-fileutils: clean-fileutils
 
 clean-fileutils: 
 	@[ -f ./fileutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6168,18 +7287,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif fileutils
 
 .PHONY: maybe-distclean-fileutils distclean-fileutils
 maybe-distclean-fileutils:
+@if fileutils
+maybe-distclean-fileutils: distclean-fileutils
 
 distclean-fileutils: 
 	@[ -f ./fileutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6189,18 +7312,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif fileutils
 
 .PHONY: maybe-maintainer-clean-fileutils maintainer-clean-fileutils
 maybe-maintainer-clean-fileutils:
+@if fileutils
+maybe-maintainer-clean-fileutils: maintainer-clean-fileutils
 
 maintainer-clean-fileutils: 
 	@[ -f ./fileutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6210,33 +7337,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif fileutils
 
 
 .PHONY: configure-findutils maybe-configure-findutils
 maybe-configure-findutils:
+@if findutils
+maybe-configure-findutils: configure-findutils
 configure-findutils:
 	@test ! -f findutils/Makefile || exit 0; \
 	[ -d findutils ] || mkdir findutils; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in findutils; \
 	cd findutils || exit 1; \
 	case $(srcdir) in \
@@ -6251,41 +7367,56 @@
 	    libsrcdir="$$s/findutils";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif findutils
 
 .PHONY: all-findutils maybe-all-findutils
 maybe-all-findutils:
+@if findutils
+maybe-all-findutils: all-findutils
 all-findutils: configure-findutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd findutils && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd findutils && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif findutils
 
 .PHONY: check-findutils maybe-check-findutils
 maybe-check-findutils:
+@if findutils
+maybe-check-findutils: check-findutils
 
 check-findutils:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd findutils && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd findutils && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif findutils
 
 .PHONY: install-findutils maybe-install-findutils
 maybe-install-findutils:
+@if findutils
+maybe-install-findutils: install-findutils
 
 install-findutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd findutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd findutils && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif findutils
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-findutils info-findutils
 maybe-info-findutils:
+@if findutils
+maybe-info-findutils: info-findutils
 
 info-findutils: \
     configure-findutils 
@@ -6293,6 +7424,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6302,12 +7434,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif findutils
 
 .PHONY: maybe-dvi-findutils dvi-findutils
 maybe-dvi-findutils:
+@if findutils
+maybe-dvi-findutils: dvi-findutils
 
 dvi-findutils: \
     configure-findutils 
@@ -6315,6 +7450,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6324,12 +7460,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif findutils
 
 .PHONY: maybe-TAGS-findutils TAGS-findutils
 maybe-TAGS-findutils:
+@if findutils
+maybe-TAGS-findutils: TAGS-findutils
 
 TAGS-findutils: \
     configure-findutils 
@@ -6337,6 +7476,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6346,12 +7486,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif findutils
 
 .PHONY: maybe-install-info-findutils install-info-findutils
 maybe-install-info-findutils:
+@if findutils
+maybe-install-info-findutils: install-info-findutils
 
 install-info-findutils: \
     configure-findutils \
@@ -6360,6 +7503,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6369,12 +7513,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif findutils
 
 .PHONY: maybe-installcheck-findutils installcheck-findutils
 maybe-installcheck-findutils:
+@if findutils
+maybe-installcheck-findutils: installcheck-findutils
 
 installcheck-findutils: \
     configure-findutils 
@@ -6382,6 +7529,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6391,18 +7539,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif findutils
 
 .PHONY: maybe-mostlyclean-findutils mostlyclean-findutils
 maybe-mostlyclean-findutils:
+@if findutils
+maybe-mostlyclean-findutils: mostlyclean-findutils
 
 mostlyclean-findutils: 
 	@[ -f ./findutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6412,18 +7564,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif findutils
 
 .PHONY: maybe-clean-findutils clean-findutils
 maybe-clean-findutils:
+@if findutils
+maybe-clean-findutils: clean-findutils
 
 clean-findutils: 
 	@[ -f ./findutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6433,18 +7589,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif findutils
 
 .PHONY: maybe-distclean-findutils distclean-findutils
 maybe-distclean-findutils:
+@if findutils
+maybe-distclean-findutils: distclean-findutils
 
 distclean-findutils: 
 	@[ -f ./findutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6454,18 +7614,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif findutils
 
 .PHONY: maybe-maintainer-clean-findutils maintainer-clean-findutils
 maybe-maintainer-clean-findutils:
+@if findutils
+maybe-maintainer-clean-findutils: maintainer-clean-findutils
 
 maintainer-clean-findutils: 
 	@[ -f ./findutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6475,33 +7639,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif findutils
 
 
 .PHONY: configure-find maybe-configure-find
 maybe-configure-find:
+@if find
+maybe-configure-find: configure-find
 configure-find:
 	@test ! -f find/Makefile || exit 0; \
 	[ -d find ] || mkdir find; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in find; \
 	cd find || exit 1; \
 	case $(srcdir) in \
@@ -6516,41 +7669,56 @@
 	    libsrcdir="$$s/find";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif find
 
 .PHONY: all-find maybe-all-find
 maybe-all-find:
+@if find
+maybe-all-find: all-find
 all-find: configure-find
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd find && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd find && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif find
 
 .PHONY: check-find maybe-check-find
 maybe-check-find:
+@if find
+maybe-check-find: check-find
 
 check-find:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd find && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd find && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif find
 
 .PHONY: install-find maybe-install-find
 maybe-install-find:
+@if find
+maybe-install-find: install-find
 
 install-find: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd find && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd find && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif find
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-find info-find
 maybe-info-find:
+@if find
+maybe-info-find: info-find
 
 info-find: \
     configure-find 
@@ -6558,6 +7726,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6567,12 +7736,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif find
 
 .PHONY: maybe-dvi-find dvi-find
 maybe-dvi-find:
+@if find
+maybe-dvi-find: dvi-find
 
 dvi-find: \
     configure-find 
@@ -6580,6 +7752,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6589,12 +7762,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif find
 
 .PHONY: maybe-TAGS-find TAGS-find
 maybe-TAGS-find:
+@if find
+maybe-TAGS-find: TAGS-find
 
 TAGS-find: \
     configure-find 
@@ -6602,6 +7778,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6611,12 +7788,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif find
 
 .PHONY: maybe-install-info-find install-info-find
 maybe-install-info-find:
+@if find
+maybe-install-info-find: install-info-find
 
 install-info-find: \
     configure-find \
@@ -6625,6 +7805,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6634,12 +7815,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif find
 
 .PHONY: maybe-installcheck-find installcheck-find
 maybe-installcheck-find:
+@if find
+maybe-installcheck-find: installcheck-find
 
 installcheck-find: \
     configure-find 
@@ -6647,6 +7831,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6656,18 +7841,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif find
 
 .PHONY: maybe-mostlyclean-find mostlyclean-find
 maybe-mostlyclean-find:
+@if find
+maybe-mostlyclean-find: mostlyclean-find
 
 mostlyclean-find: 
 	@[ -f ./find/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6677,18 +7866,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif find
 
 .PHONY: maybe-clean-find clean-find
 maybe-clean-find:
+@if find
+maybe-clean-find: clean-find
 
 clean-find: 
 	@[ -f ./find/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6698,18 +7891,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif find
 
 .PHONY: maybe-distclean-find distclean-find
 maybe-distclean-find:
+@if find
+maybe-distclean-find: distclean-find
 
 distclean-find: 
 	@[ -f ./find/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6719,18 +7916,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif find
 
 .PHONY: maybe-maintainer-clean-find maintainer-clean-find
 maybe-maintainer-clean-find:
+@if find
+maybe-maintainer-clean-find: maintainer-clean-find
 
 maintainer-clean-find: 
 	@[ -f ./find/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6740,33 +7941,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif find
 
 
 .PHONY: configure-flex maybe-configure-flex
 maybe-configure-flex:
+@if flex
+maybe-configure-flex: configure-flex
 configure-flex:
 	@test ! -f flex/Makefile || exit 0; \
 	[ -d flex ] || mkdir flex; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in flex; \
 	cd flex || exit 1; \
 	case $(srcdir) in \
@@ -6781,19 +7971,26 @@
 	    libsrcdir="$$s/flex";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif flex
 
 .PHONY: all-flex maybe-all-flex
 maybe-all-flex:
+@if flex
+maybe-all-flex: all-flex
 all-flex: configure-flex
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd flex && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd flex && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif flex
 
 .PHONY: check-flex maybe-check-flex
 maybe-check-flex:
+@if flex
+maybe-check-flex: check-flex
 
 # This module is only tested in a native toolchain.
 check-flex:
@@ -6801,24 +7998,32 @@
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
-	  (cd flex && $(MAKE) $(FLAGS_TO_PASS) check); \
+	  $(HOST_EXPORTS) \
+	  (cd flex && $(MAKE) $(FLAGS_TO_PASS)  check); \
 	fi
 
+@endif flex
 
 .PHONY: install-flex maybe-install-flex
 maybe-install-flex:
+@if flex
+maybe-install-flex: install-flex
 
 install-flex: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd flex && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd flex && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif flex
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-flex info-flex
 maybe-info-flex:
+@if flex
+maybe-info-flex: info-flex
 
 info-flex: \
     configure-flex 
@@ -6826,6 +8031,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6835,12 +8041,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif flex
 
 .PHONY: maybe-dvi-flex dvi-flex
 maybe-dvi-flex:
+@if flex
+maybe-dvi-flex: dvi-flex
 
 dvi-flex: \
     configure-flex 
@@ -6848,6 +8057,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6857,12 +8067,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif flex
 
 .PHONY: maybe-TAGS-flex TAGS-flex
 maybe-TAGS-flex:
+@if flex
+maybe-TAGS-flex: TAGS-flex
 
 TAGS-flex: \
     configure-flex 
@@ -6870,6 +8083,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6879,12 +8093,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif flex
 
 .PHONY: maybe-install-info-flex install-info-flex
 maybe-install-info-flex:
+@if flex
+maybe-install-info-flex: install-info-flex
 
 install-info-flex: \
     configure-flex \
@@ -6893,6 +8110,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6902,12 +8120,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif flex
 
 .PHONY: maybe-installcheck-flex installcheck-flex
 maybe-installcheck-flex:
+@if flex
+maybe-installcheck-flex: installcheck-flex
 
 installcheck-flex: \
     configure-flex 
@@ -6915,6 +8136,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6924,18 +8146,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif flex
 
 .PHONY: maybe-mostlyclean-flex mostlyclean-flex
 maybe-mostlyclean-flex:
+@if flex
+maybe-mostlyclean-flex: mostlyclean-flex
 
 mostlyclean-flex: 
 	@[ -f ./flex/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6945,18 +8171,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif flex
 
 .PHONY: maybe-clean-flex clean-flex
 maybe-clean-flex:
+@if flex
+maybe-clean-flex: clean-flex
 
 clean-flex: 
 	@[ -f ./flex/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6966,18 +8196,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif flex
 
 .PHONY: maybe-distclean-flex distclean-flex
 maybe-distclean-flex:
+@if flex
+maybe-distclean-flex: distclean-flex
 
 distclean-flex: 
 	@[ -f ./flex/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -6987,18 +8221,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif flex
 
 .PHONY: maybe-maintainer-clean-flex maintainer-clean-flex
 maybe-maintainer-clean-flex:
+@if flex
+maybe-maintainer-clean-flex: maintainer-clean-flex
 
 maintainer-clean-flex: 
 	@[ -f ./flex/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7008,33 +8246,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif flex
 
 
 .PHONY: configure-gas maybe-configure-gas
 maybe-configure-gas:
+@if gas
+maybe-configure-gas: configure-gas
 configure-gas:
 	@test ! -f gas/Makefile || exit 0; \
 	[ -d gas ] || mkdir gas; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in gas; \
 	cd gas || exit 1; \
 	case $(srcdir) in \
@@ -7049,41 +8276,56 @@
 	    libsrcdir="$$s/gas";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif gas
 
 .PHONY: all-gas maybe-all-gas
 maybe-all-gas:
+@if gas
+maybe-all-gas: all-gas
 all-gas: configure-gas
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gas && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd gas && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif gas
 
 .PHONY: check-gas maybe-check-gas
 maybe-check-gas:
+@if gas
+maybe-check-gas: check-gas
 
 check-gas:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gas && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd gas && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif gas
 
 .PHONY: install-gas maybe-install-gas
 maybe-install-gas:
+@if gas
+maybe-install-gas: install-gas
 
 install-gas: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gas && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd gas && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif gas
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-gas info-gas
 maybe-info-gas:
+@if gas
+maybe-info-gas: info-gas
 
 info-gas: \
     configure-gas 
@@ -7091,6 +8333,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7100,12 +8343,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif gas
 
 .PHONY: maybe-dvi-gas dvi-gas
 maybe-dvi-gas:
+@if gas
+maybe-dvi-gas: dvi-gas
 
 dvi-gas: \
     configure-gas 
@@ -7113,6 +8359,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7122,12 +8369,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif gas
 
 .PHONY: maybe-TAGS-gas TAGS-gas
 maybe-TAGS-gas:
+@if gas
+maybe-TAGS-gas: TAGS-gas
 
 TAGS-gas: \
     configure-gas 
@@ -7135,6 +8385,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7144,12 +8395,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif gas
 
 .PHONY: maybe-install-info-gas install-info-gas
 maybe-install-info-gas:
+@if gas
+maybe-install-info-gas: install-info-gas
 
 install-info-gas: \
     configure-gas \
@@ -7158,6 +8412,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7167,12 +8422,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif gas
 
 .PHONY: maybe-installcheck-gas installcheck-gas
 maybe-installcheck-gas:
+@if gas
+maybe-installcheck-gas: installcheck-gas
 
 installcheck-gas: \
     configure-gas 
@@ -7180,6 +8438,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7189,18 +8448,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif gas
 
 .PHONY: maybe-mostlyclean-gas mostlyclean-gas
 maybe-mostlyclean-gas:
+@if gas
+maybe-mostlyclean-gas: mostlyclean-gas
 
 mostlyclean-gas: 
 	@[ -f ./gas/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7210,18 +8473,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif gas
 
 .PHONY: maybe-clean-gas clean-gas
 maybe-clean-gas:
+@if gas
+maybe-clean-gas: clean-gas
 
 clean-gas: 
 	@[ -f ./gas/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7231,18 +8498,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif gas
 
 .PHONY: maybe-distclean-gas distclean-gas
 maybe-distclean-gas:
+@if gas
+maybe-distclean-gas: distclean-gas
 
 distclean-gas: 
 	@[ -f ./gas/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7252,18 +8523,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif gas
 
 .PHONY: maybe-maintainer-clean-gas maintainer-clean-gas
 maybe-maintainer-clean-gas:
+@if gas
+maybe-maintainer-clean-gas: maintainer-clean-gas
 
 maintainer-clean-gas: 
 	@[ -f ./gas/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7273,33 +8548,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif gas
 
 
 .PHONY: configure-gawk maybe-configure-gawk
 maybe-configure-gawk:
+@if gawk
+maybe-configure-gawk: configure-gawk
 configure-gawk:
 	@test ! -f gawk/Makefile || exit 0; \
 	[ -d gawk ] || mkdir gawk; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in gawk; \
 	cd gawk || exit 1; \
 	case $(srcdir) in \
@@ -7314,41 +8578,56 @@
 	    libsrcdir="$$s/gawk";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif gawk
 
 .PHONY: all-gawk maybe-all-gawk
 maybe-all-gawk:
+@if gawk
+maybe-all-gawk: all-gawk
 all-gawk: configure-gawk
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gawk && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd gawk && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif gawk
 
 .PHONY: check-gawk maybe-check-gawk
 maybe-check-gawk:
+@if gawk
+maybe-check-gawk: check-gawk
 
 check-gawk:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gawk && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd gawk && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif gawk
 
 .PHONY: install-gawk maybe-install-gawk
 maybe-install-gawk:
+@if gawk
+maybe-install-gawk: install-gawk
 
 install-gawk: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gawk && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd gawk && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif gawk
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-gawk info-gawk
 maybe-info-gawk:
+@if gawk
+maybe-info-gawk: info-gawk
 
 info-gawk: \
     configure-gawk 
@@ -7356,6 +8635,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7365,12 +8645,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif gawk
 
 .PHONY: maybe-dvi-gawk dvi-gawk
 maybe-dvi-gawk:
+@if gawk
+maybe-dvi-gawk: dvi-gawk
 
 dvi-gawk: \
     configure-gawk 
@@ -7378,6 +8661,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7387,12 +8671,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif gawk
 
 .PHONY: maybe-TAGS-gawk TAGS-gawk
 maybe-TAGS-gawk:
+@if gawk
+maybe-TAGS-gawk: TAGS-gawk
 
 TAGS-gawk: \
     configure-gawk 
@@ -7400,6 +8687,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7409,12 +8697,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif gawk
 
 .PHONY: maybe-install-info-gawk install-info-gawk
 maybe-install-info-gawk:
+@if gawk
+maybe-install-info-gawk: install-info-gawk
 
 install-info-gawk: \
     configure-gawk \
@@ -7423,6 +8714,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7432,12 +8724,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif gawk
 
 .PHONY: maybe-installcheck-gawk installcheck-gawk
 maybe-installcheck-gawk:
+@if gawk
+maybe-installcheck-gawk: installcheck-gawk
 
 installcheck-gawk: \
     configure-gawk 
@@ -7445,6 +8740,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7454,18 +8750,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif gawk
 
 .PHONY: maybe-mostlyclean-gawk mostlyclean-gawk
 maybe-mostlyclean-gawk:
+@if gawk
+maybe-mostlyclean-gawk: mostlyclean-gawk
 
 mostlyclean-gawk: 
 	@[ -f ./gawk/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7475,18 +8775,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif gawk
 
 .PHONY: maybe-clean-gawk clean-gawk
 maybe-clean-gawk:
+@if gawk
+maybe-clean-gawk: clean-gawk
 
 clean-gawk: 
 	@[ -f ./gawk/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7496,18 +8800,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif gawk
 
 .PHONY: maybe-distclean-gawk distclean-gawk
 maybe-distclean-gawk:
+@if gawk
+maybe-distclean-gawk: distclean-gawk
 
 distclean-gawk: 
 	@[ -f ./gawk/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7517,18 +8825,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif gawk
 
 .PHONY: maybe-maintainer-clean-gawk maintainer-clean-gawk
 maybe-maintainer-clean-gawk:
+@if gawk
+maybe-maintainer-clean-gawk: maintainer-clean-gawk
 
 maintainer-clean-gawk: 
 	@[ -f ./gawk/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7538,33 +8850,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif gawk
 
 
 .PHONY: configure-gettext maybe-configure-gettext
 maybe-configure-gettext:
+@if gettext
+maybe-configure-gettext: configure-gettext
 configure-gettext:
 	@test ! -f gettext/Makefile || exit 0; \
 	[ -d gettext ] || mkdir gettext; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in gettext; \
 	cd gettext || exit 1; \
 	case $(srcdir) in \
@@ -7579,41 +8880,56 @@
 	    libsrcdir="$$s/gettext";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif gettext
 
 .PHONY: all-gettext maybe-all-gettext
 maybe-all-gettext:
+@if gettext
+maybe-all-gettext: all-gettext
 all-gettext: configure-gettext
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gettext && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd gettext && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif gettext
 
 .PHONY: check-gettext maybe-check-gettext
 maybe-check-gettext:
+@if gettext
+maybe-check-gettext: check-gettext
 
 check-gettext:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gettext && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd gettext && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif gettext
 
 .PHONY: install-gettext maybe-install-gettext
 maybe-install-gettext:
+@if gettext
+maybe-install-gettext: install-gettext
 
 install-gettext: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gettext && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd gettext && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif gettext
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-gettext info-gettext
 maybe-info-gettext:
+@if gettext
+maybe-info-gettext: info-gettext
 
 info-gettext: \
     configure-gettext 
@@ -7621,6 +8937,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7630,12 +8947,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif gettext
 
 .PHONY: maybe-dvi-gettext dvi-gettext
 maybe-dvi-gettext:
+@if gettext
+maybe-dvi-gettext: dvi-gettext
 
 dvi-gettext: \
     configure-gettext 
@@ -7643,6 +8963,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7652,12 +8973,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif gettext
 
 .PHONY: maybe-TAGS-gettext TAGS-gettext
 maybe-TAGS-gettext:
+@if gettext
+maybe-TAGS-gettext: TAGS-gettext
 
 TAGS-gettext: \
     configure-gettext 
@@ -7665,6 +8989,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7674,12 +8999,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif gettext
 
 .PHONY: maybe-install-info-gettext install-info-gettext
 maybe-install-info-gettext:
+@if gettext
+maybe-install-info-gettext: install-info-gettext
 
 install-info-gettext: \
     configure-gettext \
@@ -7688,6 +9016,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7697,12 +9026,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif gettext
 
 .PHONY: maybe-installcheck-gettext installcheck-gettext
 maybe-installcheck-gettext:
+@if gettext
+maybe-installcheck-gettext: installcheck-gettext
 
 installcheck-gettext: \
     configure-gettext 
@@ -7710,6 +9042,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7719,18 +9052,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif gettext
 
 .PHONY: maybe-mostlyclean-gettext mostlyclean-gettext
 maybe-mostlyclean-gettext:
+@if gettext
+maybe-mostlyclean-gettext: mostlyclean-gettext
 
 mostlyclean-gettext: 
 	@[ -f ./gettext/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7740,18 +9077,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif gettext
 
 .PHONY: maybe-clean-gettext clean-gettext
 maybe-clean-gettext:
+@if gettext
+maybe-clean-gettext: clean-gettext
 
 clean-gettext: 
 	@[ -f ./gettext/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7761,18 +9102,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif gettext
 
 .PHONY: maybe-distclean-gettext distclean-gettext
 maybe-distclean-gettext:
+@if gettext
+maybe-distclean-gettext: distclean-gettext
 
 distclean-gettext: 
 	@[ -f ./gettext/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7782,18 +9127,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif gettext
 
 .PHONY: maybe-maintainer-clean-gettext maintainer-clean-gettext
 maybe-maintainer-clean-gettext:
+@if gettext
+maybe-maintainer-clean-gettext: maintainer-clean-gettext
 
 maintainer-clean-gettext: 
 	@[ -f ./gettext/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7803,33 +9152,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif gettext
 
 
 .PHONY: configure-gnuserv maybe-configure-gnuserv
 maybe-configure-gnuserv:
+@if gnuserv
+maybe-configure-gnuserv: configure-gnuserv
 configure-gnuserv:
 	@test ! -f gnuserv/Makefile || exit 0; \
 	[ -d gnuserv ] || mkdir gnuserv; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in gnuserv; \
 	cd gnuserv || exit 1; \
 	case $(srcdir) in \
@@ -7844,41 +9182,56 @@
 	    libsrcdir="$$s/gnuserv";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif gnuserv
 
 .PHONY: all-gnuserv maybe-all-gnuserv
 maybe-all-gnuserv:
+@if gnuserv
+maybe-all-gnuserv: all-gnuserv
 all-gnuserv: configure-gnuserv
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd gnuserv && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif gnuserv
 
 .PHONY: check-gnuserv maybe-check-gnuserv
 maybe-check-gnuserv:
+@if gnuserv
+maybe-check-gnuserv: check-gnuserv
 
 check-gnuserv:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd gnuserv && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif gnuserv
 
 .PHONY: install-gnuserv maybe-install-gnuserv
 maybe-install-gnuserv:
+@if gnuserv
+maybe-install-gnuserv: install-gnuserv
 
 install-gnuserv: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd gnuserv && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif gnuserv
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-gnuserv info-gnuserv
 maybe-info-gnuserv:
+@if gnuserv
+maybe-info-gnuserv: info-gnuserv
 
 info-gnuserv: \
     configure-gnuserv 
@@ -7886,6 +9239,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7895,12 +9249,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif gnuserv
 
 .PHONY: maybe-dvi-gnuserv dvi-gnuserv
 maybe-dvi-gnuserv:
+@if gnuserv
+maybe-dvi-gnuserv: dvi-gnuserv
 
 dvi-gnuserv: \
     configure-gnuserv 
@@ -7908,6 +9265,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7917,12 +9275,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif gnuserv
 
 .PHONY: maybe-TAGS-gnuserv TAGS-gnuserv
 maybe-TAGS-gnuserv:
+@if gnuserv
+maybe-TAGS-gnuserv: TAGS-gnuserv
 
 TAGS-gnuserv: \
     configure-gnuserv 
@@ -7930,6 +9291,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7939,12 +9301,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif gnuserv
 
 .PHONY: maybe-install-info-gnuserv install-info-gnuserv
 maybe-install-info-gnuserv:
+@if gnuserv
+maybe-install-info-gnuserv: install-info-gnuserv
 
 install-info-gnuserv: \
     configure-gnuserv \
@@ -7953,6 +9318,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7962,12 +9328,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif gnuserv
 
 .PHONY: maybe-installcheck-gnuserv installcheck-gnuserv
 maybe-installcheck-gnuserv:
+@if gnuserv
+maybe-installcheck-gnuserv: installcheck-gnuserv
 
 installcheck-gnuserv: \
     configure-gnuserv 
@@ -7975,6 +9344,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -7984,18 +9354,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif gnuserv
 
 .PHONY: maybe-mostlyclean-gnuserv mostlyclean-gnuserv
 maybe-mostlyclean-gnuserv:
+@if gnuserv
+maybe-mostlyclean-gnuserv: mostlyclean-gnuserv
 
 mostlyclean-gnuserv: 
 	@[ -f ./gnuserv/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8005,18 +9379,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif gnuserv
 
 .PHONY: maybe-clean-gnuserv clean-gnuserv
 maybe-clean-gnuserv:
+@if gnuserv
+maybe-clean-gnuserv: clean-gnuserv
 
 clean-gnuserv: 
 	@[ -f ./gnuserv/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8026,18 +9404,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif gnuserv
 
 .PHONY: maybe-distclean-gnuserv distclean-gnuserv
 maybe-distclean-gnuserv:
+@if gnuserv
+maybe-distclean-gnuserv: distclean-gnuserv
 
 distclean-gnuserv: 
 	@[ -f ./gnuserv/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8047,18 +9429,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif gnuserv
 
 .PHONY: maybe-maintainer-clean-gnuserv maintainer-clean-gnuserv
 maybe-maintainer-clean-gnuserv:
+@if gnuserv
+maybe-maintainer-clean-gnuserv: maintainer-clean-gnuserv
 
 maintainer-clean-gnuserv: 
 	@[ -f ./gnuserv/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8068,33 +9454,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif gnuserv
 
 
 .PHONY: configure-gprof maybe-configure-gprof
 maybe-configure-gprof:
+@if gprof
+maybe-configure-gprof: configure-gprof
 configure-gprof:
 	@test ! -f gprof/Makefile || exit 0; \
 	[ -d gprof ] || mkdir gprof; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in gprof; \
 	cd gprof || exit 1; \
 	case $(srcdir) in \
@@ -8109,41 +9484,56 @@
 	    libsrcdir="$$s/gprof";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif gprof
 
 .PHONY: all-gprof maybe-all-gprof
 maybe-all-gprof:
+@if gprof
+maybe-all-gprof: all-gprof
 all-gprof: configure-gprof
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gprof && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd gprof && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif gprof
 
 .PHONY: check-gprof maybe-check-gprof
 maybe-check-gprof:
+@if gprof
+maybe-check-gprof: check-gprof
 
 check-gprof:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gprof && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd gprof && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif gprof
 
 .PHONY: install-gprof maybe-install-gprof
 maybe-install-gprof:
+@if gprof
+maybe-install-gprof: install-gprof
 
 install-gprof: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gprof && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd gprof && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif gprof
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-gprof info-gprof
 maybe-info-gprof:
+@if gprof
+maybe-info-gprof: info-gprof
 
 info-gprof: \
     configure-gprof 
@@ -8151,6 +9541,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8160,12 +9551,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif gprof
 
 .PHONY: maybe-dvi-gprof dvi-gprof
 maybe-dvi-gprof:
+@if gprof
+maybe-dvi-gprof: dvi-gprof
 
 dvi-gprof: \
     configure-gprof 
@@ -8173,6 +9567,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8182,12 +9577,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif gprof
 
 .PHONY: maybe-TAGS-gprof TAGS-gprof
 maybe-TAGS-gprof:
+@if gprof
+maybe-TAGS-gprof: TAGS-gprof
 
 TAGS-gprof: \
     configure-gprof 
@@ -8195,6 +9593,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8204,12 +9603,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif gprof
 
 .PHONY: maybe-install-info-gprof install-info-gprof
 maybe-install-info-gprof:
+@if gprof
+maybe-install-info-gprof: install-info-gprof
 
 install-info-gprof: \
     configure-gprof \
@@ -8218,6 +9620,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8227,12 +9630,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif gprof
 
 .PHONY: maybe-installcheck-gprof installcheck-gprof
 maybe-installcheck-gprof:
+@if gprof
+maybe-installcheck-gprof: installcheck-gprof
 
 installcheck-gprof: \
     configure-gprof 
@@ -8240,6 +9646,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8249,18 +9656,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif gprof
 
 .PHONY: maybe-mostlyclean-gprof mostlyclean-gprof
 maybe-mostlyclean-gprof:
+@if gprof
+maybe-mostlyclean-gprof: mostlyclean-gprof
 
 mostlyclean-gprof: 
 	@[ -f ./gprof/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8270,18 +9681,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif gprof
 
 .PHONY: maybe-clean-gprof clean-gprof
 maybe-clean-gprof:
+@if gprof
+maybe-clean-gprof: clean-gprof
 
 clean-gprof: 
 	@[ -f ./gprof/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8291,18 +9706,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif gprof
 
 .PHONY: maybe-distclean-gprof distclean-gprof
 maybe-distclean-gprof:
+@if gprof
+maybe-distclean-gprof: distclean-gprof
 
 distclean-gprof: 
 	@[ -f ./gprof/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8312,18 +9731,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif gprof
 
 .PHONY: maybe-maintainer-clean-gprof maintainer-clean-gprof
 maybe-maintainer-clean-gprof:
+@if gprof
+maybe-maintainer-clean-gprof: maintainer-clean-gprof
 
 maintainer-clean-gprof: 
 	@[ -f ./gprof/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8333,33 +9756,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif gprof
 
 
 .PHONY: configure-gzip maybe-configure-gzip
 maybe-configure-gzip:
+@if gzip
+maybe-configure-gzip: configure-gzip
 configure-gzip:
 	@test ! -f gzip/Makefile || exit 0; \
 	[ -d gzip ] || mkdir gzip; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in gzip; \
 	cd gzip || exit 1; \
 	case $(srcdir) in \
@@ -8374,41 +9786,56 @@
 	    libsrcdir="$$s/gzip";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif gzip
 
 .PHONY: all-gzip maybe-all-gzip
 maybe-all-gzip:
+@if gzip
+maybe-all-gzip: all-gzip
 all-gzip: configure-gzip
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gzip && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd gzip && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif gzip
 
 .PHONY: check-gzip maybe-check-gzip
 maybe-check-gzip:
+@if gzip
+maybe-check-gzip: check-gzip
 
 check-gzip:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gzip && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd gzip && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif gzip
 
 .PHONY: install-gzip maybe-install-gzip
 maybe-install-gzip:
+@if gzip
+maybe-install-gzip: install-gzip
 
 install-gzip: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gzip && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd gzip && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif gzip
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-gzip info-gzip
 maybe-info-gzip:
+@if gzip
+maybe-info-gzip: info-gzip
 
 info-gzip: \
     configure-gzip 
@@ -8416,6 +9843,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8425,12 +9853,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif gzip
 
 .PHONY: maybe-dvi-gzip dvi-gzip
 maybe-dvi-gzip:
+@if gzip
+maybe-dvi-gzip: dvi-gzip
 
 dvi-gzip: \
     configure-gzip 
@@ -8438,6 +9869,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8447,12 +9879,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif gzip
 
 .PHONY: maybe-TAGS-gzip TAGS-gzip
 maybe-TAGS-gzip:
+@if gzip
+maybe-TAGS-gzip: TAGS-gzip
 
 TAGS-gzip: \
     configure-gzip 
@@ -8460,6 +9895,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8469,12 +9905,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif gzip
 
 .PHONY: maybe-install-info-gzip install-info-gzip
 maybe-install-info-gzip:
+@if gzip
+maybe-install-info-gzip: install-info-gzip
 
 install-info-gzip: \
     configure-gzip \
@@ -8483,6 +9922,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8492,12 +9932,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif gzip
 
 .PHONY: maybe-installcheck-gzip installcheck-gzip
 maybe-installcheck-gzip:
+@if gzip
+maybe-installcheck-gzip: installcheck-gzip
 
 installcheck-gzip: \
     configure-gzip 
@@ -8505,6 +9948,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8514,18 +9958,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif gzip
 
 .PHONY: maybe-mostlyclean-gzip mostlyclean-gzip
 maybe-mostlyclean-gzip:
+@if gzip
+maybe-mostlyclean-gzip: mostlyclean-gzip
 
 mostlyclean-gzip: 
 	@[ -f ./gzip/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8535,18 +9983,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif gzip
 
 .PHONY: maybe-clean-gzip clean-gzip
 maybe-clean-gzip:
+@if gzip
+maybe-clean-gzip: clean-gzip
 
 clean-gzip: 
 	@[ -f ./gzip/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8556,18 +10008,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif gzip
 
 .PHONY: maybe-distclean-gzip distclean-gzip
 maybe-distclean-gzip:
+@if gzip
+maybe-distclean-gzip: distclean-gzip
 
 distclean-gzip: 
 	@[ -f ./gzip/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8577,18 +10033,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif gzip
 
 .PHONY: maybe-maintainer-clean-gzip maintainer-clean-gzip
 maybe-maintainer-clean-gzip:
+@if gzip
+maybe-maintainer-clean-gzip: maintainer-clean-gzip
 
 maintainer-clean-gzip: 
 	@[ -f ./gzip/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8598,33 +10058,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif gzip
 
 
 .PHONY: configure-hello maybe-configure-hello
 maybe-configure-hello:
+@if hello
+maybe-configure-hello: configure-hello
 configure-hello:
 	@test ! -f hello/Makefile || exit 0; \
 	[ -d hello ] || mkdir hello; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in hello; \
 	cd hello || exit 1; \
 	case $(srcdir) in \
@@ -8639,41 +10088,56 @@
 	    libsrcdir="$$s/hello";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif hello
 
 .PHONY: all-hello maybe-all-hello
 maybe-all-hello:
+@if hello
+maybe-all-hello: all-hello
 all-hello: configure-hello
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd hello && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd hello && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif hello
 
 .PHONY: check-hello maybe-check-hello
 maybe-check-hello:
+@if hello
+maybe-check-hello: check-hello
 
 check-hello:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd hello && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd hello && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif hello
 
 .PHONY: install-hello maybe-install-hello
 maybe-install-hello:
+@if hello
+maybe-install-hello: install-hello
 
 install-hello: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd hello && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd hello && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif hello
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-hello info-hello
 maybe-info-hello:
+@if hello
+maybe-info-hello: info-hello
 
 info-hello: \
     configure-hello 
@@ -8681,6 +10145,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8690,12 +10155,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif hello
 
 .PHONY: maybe-dvi-hello dvi-hello
 maybe-dvi-hello:
+@if hello
+maybe-dvi-hello: dvi-hello
 
 dvi-hello: \
     configure-hello 
@@ -8703,6 +10171,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8712,12 +10181,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif hello
 
 .PHONY: maybe-TAGS-hello TAGS-hello
 maybe-TAGS-hello:
+@if hello
+maybe-TAGS-hello: TAGS-hello
 
 TAGS-hello: \
     configure-hello 
@@ -8725,6 +10197,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8734,12 +10207,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif hello
 
 .PHONY: maybe-install-info-hello install-info-hello
 maybe-install-info-hello:
+@if hello
+maybe-install-info-hello: install-info-hello
 
 install-info-hello: \
     configure-hello \
@@ -8748,6 +10224,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8757,12 +10234,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif hello
 
 .PHONY: maybe-installcheck-hello installcheck-hello
 maybe-installcheck-hello:
+@if hello
+maybe-installcheck-hello: installcheck-hello
 
 installcheck-hello: \
     configure-hello 
@@ -8770,6 +10250,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8779,18 +10260,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif hello
 
 .PHONY: maybe-mostlyclean-hello mostlyclean-hello
 maybe-mostlyclean-hello:
+@if hello
+maybe-mostlyclean-hello: mostlyclean-hello
 
 mostlyclean-hello: 
 	@[ -f ./hello/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8800,18 +10285,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif hello
 
 .PHONY: maybe-clean-hello clean-hello
 maybe-clean-hello:
+@if hello
+maybe-clean-hello: clean-hello
 
 clean-hello: 
 	@[ -f ./hello/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8821,18 +10310,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif hello
 
 .PHONY: maybe-distclean-hello distclean-hello
 maybe-distclean-hello:
+@if hello
+maybe-distclean-hello: distclean-hello
 
 distclean-hello: 
 	@[ -f ./hello/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8842,18 +10335,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif hello
 
 .PHONY: maybe-maintainer-clean-hello maintainer-clean-hello
 maybe-maintainer-clean-hello:
+@if hello
+maybe-maintainer-clean-hello: maintainer-clean-hello
 
 maintainer-clean-hello: 
 	@[ -f ./hello/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8863,33 +10360,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif hello
 
 
 .PHONY: configure-indent maybe-configure-indent
 maybe-configure-indent:
+@if indent
+maybe-configure-indent: configure-indent
 configure-indent:
 	@test ! -f indent/Makefile || exit 0; \
 	[ -d indent ] || mkdir indent; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in indent; \
 	cd indent || exit 1; \
 	case $(srcdir) in \
@@ -8904,41 +10390,56 @@
 	    libsrcdir="$$s/indent";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif indent
 
 .PHONY: all-indent maybe-all-indent
 maybe-all-indent:
+@if indent
+maybe-all-indent: all-indent
 all-indent: configure-indent
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd indent && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd indent && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif indent
 
 .PHONY: check-indent maybe-check-indent
 maybe-check-indent:
+@if indent
+maybe-check-indent: check-indent
 
 check-indent:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd indent && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd indent && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif indent
 
 .PHONY: install-indent maybe-install-indent
 maybe-install-indent:
+@if indent
+maybe-install-indent: install-indent
 
 install-indent: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd indent && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd indent && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif indent
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-indent info-indent
 maybe-info-indent:
+@if indent
+maybe-info-indent: info-indent
 
 info-indent: \
     configure-indent 
@@ -8946,6 +10447,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8955,12 +10457,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif indent
 
 .PHONY: maybe-dvi-indent dvi-indent
 maybe-dvi-indent:
+@if indent
+maybe-dvi-indent: dvi-indent
 
 dvi-indent: \
     configure-indent 
@@ -8968,6 +10473,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8977,12 +10483,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif indent
 
 .PHONY: maybe-TAGS-indent TAGS-indent
 maybe-TAGS-indent:
+@if indent
+maybe-TAGS-indent: TAGS-indent
 
 TAGS-indent: \
     configure-indent 
@@ -8990,6 +10499,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -8999,12 +10509,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif indent
 
 .PHONY: maybe-install-info-indent install-info-indent
 maybe-install-info-indent:
+@if indent
+maybe-install-info-indent: install-info-indent
 
 install-info-indent: \
     configure-indent \
@@ -9013,6 +10526,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9022,12 +10536,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif indent
 
 .PHONY: maybe-installcheck-indent installcheck-indent
 maybe-installcheck-indent:
+@if indent
+maybe-installcheck-indent: installcheck-indent
 
 installcheck-indent: \
     configure-indent 
@@ -9035,6 +10552,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9044,18 +10562,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif indent
 
 .PHONY: maybe-mostlyclean-indent mostlyclean-indent
 maybe-mostlyclean-indent:
+@if indent
+maybe-mostlyclean-indent: mostlyclean-indent
 
 mostlyclean-indent: 
 	@[ -f ./indent/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9065,18 +10587,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif indent
 
 .PHONY: maybe-clean-indent clean-indent
 maybe-clean-indent:
+@if indent
+maybe-clean-indent: clean-indent
 
 clean-indent: 
 	@[ -f ./indent/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9086,18 +10612,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif indent
 
 .PHONY: maybe-distclean-indent distclean-indent
 maybe-distclean-indent:
+@if indent
+maybe-distclean-indent: distclean-indent
 
 distclean-indent: 
 	@[ -f ./indent/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9107,18 +10637,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif indent
 
 .PHONY: maybe-maintainer-clean-indent maintainer-clean-indent
 maybe-maintainer-clean-indent:
+@if indent
+maybe-maintainer-clean-indent: maintainer-clean-indent
 
 maintainer-clean-indent: 
 	@[ -f ./indent/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9128,33 +10662,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif indent
 
 
 .PHONY: configure-intl maybe-configure-intl
 maybe-configure-intl:
+@if intl
+maybe-configure-intl: configure-intl
 configure-intl:
 	@test ! -f intl/Makefile || exit 0; \
 	[ -d intl ] || mkdir intl; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in intl; \
 	cd intl || exit 1; \
 	case $(srcdir) in \
@@ -9169,41 +10692,56 @@
 	    libsrcdir="$$s/intl";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif intl
 
 .PHONY: all-intl maybe-all-intl
 maybe-all-intl:
+@if intl
+maybe-all-intl: all-intl
 all-intl: configure-intl
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd intl && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd intl && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif intl
 
 .PHONY: check-intl maybe-check-intl
 maybe-check-intl:
+@if intl
+maybe-check-intl: check-intl
 
 check-intl:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd intl && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd intl && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif intl
 
 .PHONY: install-intl maybe-install-intl
 maybe-install-intl:
+@if intl
+maybe-install-intl: install-intl
 
 install-intl: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd intl && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd intl && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif intl
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-intl info-intl
 maybe-info-intl:
+@if intl
+maybe-info-intl: info-intl
 
 info-intl: \
     configure-intl 
@@ -9211,6 +10749,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9220,12 +10759,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif intl
 
 .PHONY: maybe-dvi-intl dvi-intl
 maybe-dvi-intl:
+@if intl
+maybe-dvi-intl: dvi-intl
 
 dvi-intl: \
     configure-intl 
@@ -9233,6 +10775,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9242,12 +10785,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif intl
 
 .PHONY: maybe-TAGS-intl TAGS-intl
 maybe-TAGS-intl:
+@if intl
+maybe-TAGS-intl: TAGS-intl
 
 TAGS-intl: \
     configure-intl 
@@ -9255,6 +10801,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9264,12 +10811,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif intl
 
 .PHONY: maybe-install-info-intl install-info-intl
 maybe-install-info-intl:
+@if intl
+maybe-install-info-intl: install-info-intl
 
 install-info-intl: \
     configure-intl \
@@ -9278,6 +10828,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9287,12 +10838,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif intl
 
 .PHONY: maybe-installcheck-intl installcheck-intl
 maybe-installcheck-intl:
+@if intl
+maybe-installcheck-intl: installcheck-intl
 
 installcheck-intl: \
     configure-intl 
@@ -9300,6 +10854,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9309,18 +10864,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif intl
 
 .PHONY: maybe-mostlyclean-intl mostlyclean-intl
 maybe-mostlyclean-intl:
+@if intl
+maybe-mostlyclean-intl: mostlyclean-intl
 
 mostlyclean-intl: 
 	@[ -f ./intl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9330,18 +10889,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif intl
 
 .PHONY: maybe-clean-intl clean-intl
 maybe-clean-intl:
+@if intl
+maybe-clean-intl: clean-intl
 
 clean-intl: 
 	@[ -f ./intl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9351,18 +10914,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif intl
 
 .PHONY: maybe-distclean-intl distclean-intl
 maybe-distclean-intl:
+@if intl
+maybe-distclean-intl: distclean-intl
 
 distclean-intl: 
 	@[ -f ./intl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9372,18 +10939,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif intl
 
 .PHONY: maybe-maintainer-clean-intl maintainer-clean-intl
 maybe-maintainer-clean-intl:
+@if intl
+maybe-maintainer-clean-intl: maintainer-clean-intl
 
 maintainer-clean-intl: 
 	@[ -f ./intl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9393,33 +10964,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif intl
 
 
 .PHONY: configure-tcl maybe-configure-tcl
 maybe-configure-tcl:
+@if tcl
+maybe-configure-tcl: configure-tcl
 configure-tcl:
 	@test ! -f tcl/Makefile || exit 0; \
 	[ -d tcl ] || mkdir tcl; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in tcl; \
 	cd tcl || exit 1; \
 	case $(srcdir) in \
@@ -9434,41 +10994,56 @@
 	    libsrcdir="$$s/tcl";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif tcl
 
 .PHONY: all-tcl maybe-all-tcl
 maybe-all-tcl:
+@if tcl
+maybe-all-tcl: all-tcl
 all-tcl: configure-tcl
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tcl && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd tcl && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif tcl
 
 .PHONY: check-tcl maybe-check-tcl
 maybe-check-tcl:
+@if tcl
+maybe-check-tcl: check-tcl
 
 check-tcl:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tcl && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd tcl && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif tcl
 
 .PHONY: install-tcl maybe-install-tcl
 maybe-install-tcl:
+@if tcl
+maybe-install-tcl: install-tcl
 
 install-tcl: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tcl && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd tcl && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif tcl
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-tcl info-tcl
 maybe-info-tcl:
+@if tcl
+maybe-info-tcl: info-tcl
 
 info-tcl: \
     configure-tcl 
@@ -9476,6 +11051,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9485,12 +11061,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif tcl
 
 .PHONY: maybe-dvi-tcl dvi-tcl
 maybe-dvi-tcl:
+@if tcl
+maybe-dvi-tcl: dvi-tcl
 
 dvi-tcl: \
     configure-tcl 
@@ -9498,6 +11077,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9507,12 +11087,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif tcl
 
 .PHONY: maybe-TAGS-tcl TAGS-tcl
 maybe-TAGS-tcl:
+@if tcl
+maybe-TAGS-tcl: TAGS-tcl
 
 TAGS-tcl: \
     configure-tcl 
@@ -9520,6 +11103,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9529,12 +11113,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif tcl
 
 .PHONY: maybe-install-info-tcl install-info-tcl
 maybe-install-info-tcl:
+@if tcl
+maybe-install-info-tcl: install-info-tcl
 
 install-info-tcl: \
     configure-tcl \
@@ -9543,6 +11130,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9552,12 +11140,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif tcl
 
 .PHONY: maybe-installcheck-tcl installcheck-tcl
 maybe-installcheck-tcl:
+@if tcl
+maybe-installcheck-tcl: installcheck-tcl
 
 installcheck-tcl: \
     configure-tcl 
@@ -9565,6 +11156,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9574,25 +11166,32 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif tcl
 
 .PHONY: maybe-mostlyclean-tcl mostlyclean-tcl
 maybe-mostlyclean-tcl:
+@if tcl
+maybe-mostlyclean-tcl: mostlyclean-tcl
 
 # tcl doesn't support mostlyclean.
 mostlyclean-tcl:
 
+@endif tcl
 
 .PHONY: maybe-clean-tcl clean-tcl
 maybe-clean-tcl:
+@if tcl
+maybe-clean-tcl: clean-tcl
 
 clean-tcl: 
 	@[ -f ./tcl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9602,18 +11201,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif tcl
 
 .PHONY: maybe-distclean-tcl distclean-tcl
 maybe-distclean-tcl:
+@if tcl
+maybe-distclean-tcl: distclean-tcl
 
 distclean-tcl: 
 	@[ -f ./tcl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9623,18 +11226,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif tcl
 
 .PHONY: maybe-maintainer-clean-tcl maintainer-clean-tcl
 maybe-maintainer-clean-tcl:
+@if tcl
+maybe-maintainer-clean-tcl: maintainer-clean-tcl
 
 maintainer-clean-tcl: 
 	@[ -f ./tcl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9644,33 +11251,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif tcl
 
 
 .PHONY: configure-itcl maybe-configure-itcl
 maybe-configure-itcl:
+@if itcl
+maybe-configure-itcl: configure-itcl
 configure-itcl:
 	@test ! -f itcl/Makefile || exit 0; \
 	[ -d itcl ] || mkdir itcl; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in itcl; \
 	cd itcl || exit 1; \
 	case $(srcdir) in \
@@ -9685,41 +11281,56 @@
 	    libsrcdir="$$s/itcl";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif itcl
 
 .PHONY: all-itcl maybe-all-itcl
 maybe-all-itcl:
+@if itcl
+maybe-all-itcl: all-itcl
 all-itcl: configure-itcl
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd itcl && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd itcl && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif itcl
 
 .PHONY: check-itcl maybe-check-itcl
 maybe-check-itcl:
+@if itcl
+maybe-check-itcl: check-itcl
 
 check-itcl:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd itcl && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd itcl && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif itcl
 
 .PHONY: install-itcl maybe-install-itcl
 maybe-install-itcl:
+@if itcl
+maybe-install-itcl: install-itcl
 
 install-itcl: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd itcl && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd itcl && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif itcl
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-itcl info-itcl
 maybe-info-itcl:
+@if itcl
+maybe-info-itcl: info-itcl
 
 info-itcl: \
     configure-itcl 
@@ -9727,6 +11338,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9736,12 +11348,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif itcl
 
 .PHONY: maybe-dvi-itcl dvi-itcl
 maybe-dvi-itcl:
+@if itcl
+maybe-dvi-itcl: dvi-itcl
 
 dvi-itcl: \
     configure-itcl 
@@ -9749,6 +11364,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9758,12 +11374,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif itcl
 
 .PHONY: maybe-TAGS-itcl TAGS-itcl
 maybe-TAGS-itcl:
+@if itcl
+maybe-TAGS-itcl: TAGS-itcl
 
 TAGS-itcl: \
     configure-itcl 
@@ -9771,6 +11390,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9780,12 +11400,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif itcl
 
 .PHONY: maybe-install-info-itcl install-info-itcl
 maybe-install-info-itcl:
+@if itcl
+maybe-install-info-itcl: install-info-itcl
 
 install-info-itcl: \
     configure-itcl \
@@ -9794,6 +11417,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9803,12 +11427,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif itcl
 
 .PHONY: maybe-installcheck-itcl installcheck-itcl
 maybe-installcheck-itcl:
+@if itcl
+maybe-installcheck-itcl: installcheck-itcl
 
 installcheck-itcl: \
     configure-itcl 
@@ -9816,6 +11443,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9825,18 +11453,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif itcl
 
 .PHONY: maybe-mostlyclean-itcl mostlyclean-itcl
 maybe-mostlyclean-itcl:
+@if itcl
+maybe-mostlyclean-itcl: mostlyclean-itcl
 
 mostlyclean-itcl: 
 	@[ -f ./itcl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9846,18 +11478,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif itcl
 
 .PHONY: maybe-clean-itcl clean-itcl
 maybe-clean-itcl:
+@if itcl
+maybe-clean-itcl: clean-itcl
 
 clean-itcl: 
 	@[ -f ./itcl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9867,18 +11503,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif itcl
 
 .PHONY: maybe-distclean-itcl distclean-itcl
 maybe-distclean-itcl:
+@if itcl
+maybe-distclean-itcl: distclean-itcl
 
 distclean-itcl: 
 	@[ -f ./itcl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9888,18 +11528,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif itcl
 
 .PHONY: maybe-maintainer-clean-itcl maintainer-clean-itcl
 maybe-maintainer-clean-itcl:
+@if itcl
+maybe-maintainer-clean-itcl: maintainer-clean-itcl
 
 maintainer-clean-itcl: 
 	@[ -f ./itcl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -9909,33 +11553,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif itcl
 
 
 .PHONY: configure-ld maybe-configure-ld
 maybe-configure-ld:
+@if ld
+maybe-configure-ld: configure-ld
 configure-ld:
 	@test ! -f ld/Makefile || exit 0; \
 	[ -d ld ] || mkdir ld; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in ld; \
 	cd ld || exit 1; \
 	case $(srcdir) in \
@@ -9950,41 +11583,56 @@
 	    libsrcdir="$$s/ld";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif ld
 
 .PHONY: all-ld maybe-all-ld
 maybe-all-ld:
+@if ld
+maybe-all-ld: all-ld
 all-ld: configure-ld
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd ld && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd ld && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif ld
 
 .PHONY: check-ld maybe-check-ld
 maybe-check-ld:
+@if ld
+maybe-check-ld: check-ld
 
 check-ld:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd ld && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd ld && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif ld
 
 .PHONY: install-ld maybe-install-ld
 maybe-install-ld:
+@if ld
+maybe-install-ld: install-ld
 
 install-ld: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd ld && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd ld && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif ld
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-ld info-ld
 maybe-info-ld:
+@if ld
+maybe-info-ld: info-ld
 
 info-ld: \
     configure-ld 
@@ -9992,6 +11640,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10001,12 +11650,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif ld
 
 .PHONY: maybe-dvi-ld dvi-ld
 maybe-dvi-ld:
+@if ld
+maybe-dvi-ld: dvi-ld
 
 dvi-ld: \
     configure-ld 
@@ -10014,6 +11666,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10023,12 +11676,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif ld
 
 .PHONY: maybe-TAGS-ld TAGS-ld
 maybe-TAGS-ld:
+@if ld
+maybe-TAGS-ld: TAGS-ld
 
 TAGS-ld: \
     configure-ld 
@@ -10036,6 +11692,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10045,12 +11702,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif ld
 
 .PHONY: maybe-install-info-ld install-info-ld
 maybe-install-info-ld:
+@if ld
+maybe-install-info-ld: install-info-ld
 
 install-info-ld: \
     configure-ld \
@@ -10059,6 +11719,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10068,12 +11729,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif ld
 
 .PHONY: maybe-installcheck-ld installcheck-ld
 maybe-installcheck-ld:
+@if ld
+maybe-installcheck-ld: installcheck-ld
 
 installcheck-ld: \
     configure-ld 
@@ -10081,6 +11745,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10090,18 +11755,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif ld
 
 .PHONY: maybe-mostlyclean-ld mostlyclean-ld
 maybe-mostlyclean-ld:
+@if ld
+maybe-mostlyclean-ld: mostlyclean-ld
 
 mostlyclean-ld: 
 	@[ -f ./ld/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10111,18 +11780,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif ld
 
 .PHONY: maybe-clean-ld clean-ld
 maybe-clean-ld:
+@if ld
+maybe-clean-ld: clean-ld
 
 clean-ld: 
 	@[ -f ./ld/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10132,18 +11805,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif ld
 
 .PHONY: maybe-distclean-ld distclean-ld
 maybe-distclean-ld:
+@if ld
+maybe-distclean-ld: distclean-ld
 
 distclean-ld: 
 	@[ -f ./ld/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10153,18 +11830,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif ld
 
 .PHONY: maybe-maintainer-clean-ld maintainer-clean-ld
 maybe-maintainer-clean-ld:
+@if ld
+maybe-maintainer-clean-ld: maintainer-clean-ld
 
 maintainer-clean-ld: 
 	@[ -f ./ld/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10174,33 +11855,324 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif ld
+
+
+.PHONY: configure-libcpp maybe-configure-libcpp
+maybe-configure-libcpp:
+@if libcpp
+maybe-configure-libcpp: configure-libcpp
+configure-libcpp:
+	@test ! -f libcpp/Makefile || exit 0; \
+	[ -d libcpp ] || mkdir libcpp; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	echo Configuring in libcpp; \
+	cd libcpp || exit 1; \
+	case $(srcdir) in \
+	  \.) \
+	    srcdiroption="--srcdir=."; \
+	    libsrcdir=".";; \
+	  /* | [A-Za-z]:[\\/]*) \
+	    srcdiroption="--srcdir=$(srcdir)/libcpp"; \
+	    libsrcdir="$$s/libcpp";; \
+	  *) \
+	    srcdiroption="--srcdir=../$(srcdir)/libcpp"; \
+	    libsrcdir="$$s/libcpp";; \
+	esac; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
+	  || exit 1
+@endif libcpp
+
+.PHONY: all-libcpp maybe-all-libcpp
+maybe-all-libcpp:
+@if libcpp
+maybe-all-libcpp: all-libcpp
+all-libcpp: configure-libcpp
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	(cd libcpp && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif libcpp
+
+.PHONY: check-libcpp maybe-check-libcpp
+maybe-check-libcpp:
+@if libcpp
+maybe-check-libcpp: check-libcpp
+
+check-libcpp:
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	(cd libcpp && $(MAKE) $(FLAGS_TO_PASS)  check)
+
+@endif libcpp
+
+.PHONY: install-libcpp maybe-install-libcpp
+maybe-install-libcpp:
+@if libcpp
+maybe-install-libcpp: install-libcpp
+
+install-libcpp: installdirs
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	(cd libcpp && $(MAKE) $(FLAGS_TO_PASS)  install)
+
+@endif libcpp
+
+# Other targets (info, dvi, etc.)
+
+.PHONY: maybe-info-libcpp info-libcpp
+maybe-info-libcpp:
+@if libcpp
+maybe-info-libcpp: info-libcpp
+
+info-libcpp: \
+    configure-libcpp 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing info in libcpp" ; \
+	(cd libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           info) \
+	  || exit 1
+
+@endif libcpp
+
+.PHONY: maybe-dvi-libcpp dvi-libcpp
+maybe-dvi-libcpp:
+@if libcpp
+maybe-dvi-libcpp: dvi-libcpp
+
+dvi-libcpp: \
+    configure-libcpp 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing dvi in libcpp" ; \
+	(cd libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           dvi) \
+	  || exit 1
+
+@endif libcpp
+
+.PHONY: maybe-TAGS-libcpp TAGS-libcpp
+maybe-TAGS-libcpp:
+@if libcpp
+maybe-TAGS-libcpp: TAGS-libcpp
+
+TAGS-libcpp: \
+    configure-libcpp 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing TAGS in libcpp" ; \
+	(cd libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           TAGS) \
+	  || exit 1
+
+@endif libcpp
+
+.PHONY: maybe-install-info-libcpp install-info-libcpp
+maybe-install-info-libcpp:
+@if libcpp
+maybe-install-info-libcpp: install-info-libcpp
+
+install-info-libcpp: \
+    configure-libcpp \
+    info-libcpp 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-info in libcpp" ; \
+	(cd libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-info) \
+	  || exit 1
+
+@endif libcpp
+
+.PHONY: maybe-installcheck-libcpp installcheck-libcpp
+maybe-installcheck-libcpp:
+@if libcpp
+maybe-installcheck-libcpp: installcheck-libcpp
+
+installcheck-libcpp: \
+    configure-libcpp 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing installcheck in libcpp" ; \
+	(cd libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           installcheck) \
+	  || exit 1
+
+@endif libcpp
+
+.PHONY: maybe-mostlyclean-libcpp mostlyclean-libcpp
+maybe-mostlyclean-libcpp:
+@if libcpp
+maybe-mostlyclean-libcpp: mostlyclean-libcpp
+
+mostlyclean-libcpp: 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing mostlyclean in libcpp" ; \
+	(cd libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           mostlyclean) \
+	  || exit 1
+
+@endif libcpp
+
+.PHONY: maybe-clean-libcpp clean-libcpp
+maybe-clean-libcpp:
+@if libcpp
+maybe-clean-libcpp: clean-libcpp
+
+clean-libcpp: 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing clean in libcpp" ; \
+	(cd libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           clean) \
+	  || exit 1
+
+@endif libcpp
+
+.PHONY: maybe-distclean-libcpp distclean-libcpp
+maybe-distclean-libcpp:
+@if libcpp
+maybe-distclean-libcpp: distclean-libcpp
+
+distclean-libcpp: 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing distclean in libcpp" ; \
+	(cd libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           distclean) \
+	  || exit 1
+
+@endif libcpp
+
+.PHONY: maybe-maintainer-clean-libcpp maintainer-clean-libcpp
+maybe-maintainer-clean-libcpp:
+@if libcpp
+maybe-maintainer-clean-libcpp: maintainer-clean-libcpp
+
+maintainer-clean-libcpp: 
+	@[ -f ./libcpp/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing maintainer-clean in libcpp" ; \
+	(cd libcpp && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           maintainer-clean) \
+	  || exit 1
+
+@endif libcpp
 
 
 .PHONY: configure-libgui maybe-configure-libgui
 maybe-configure-libgui:
+@if libgui
+maybe-configure-libgui: configure-libgui
 configure-libgui:
 	@test ! -f libgui/Makefile || exit 0; \
 	[ -d libgui ] || mkdir libgui; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in libgui; \
 	cd libgui || exit 1; \
 	case $(srcdir) in \
@@ -10215,41 +12187,56 @@
 	    libsrcdir="$$s/libgui";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif libgui
 
 .PHONY: all-libgui maybe-all-libgui
 maybe-all-libgui:
+@if libgui
+maybe-all-libgui: all-libgui
 all-libgui: configure-libgui
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libgui && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd libgui && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif libgui
 
 .PHONY: check-libgui maybe-check-libgui
 maybe-check-libgui:
+@if libgui
+maybe-check-libgui: check-libgui
 
 check-libgui:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libgui && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd libgui && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif libgui
 
 .PHONY: install-libgui maybe-install-libgui
 maybe-install-libgui:
+@if libgui
+maybe-install-libgui: install-libgui
 
 install-libgui: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libgui && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd libgui && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif libgui
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-libgui info-libgui
 maybe-info-libgui:
+@if libgui
+maybe-info-libgui: info-libgui
 
 info-libgui: \
     configure-libgui 
@@ -10257,6 +12244,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10266,12 +12254,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif libgui
 
 .PHONY: maybe-dvi-libgui dvi-libgui
 maybe-dvi-libgui:
+@if libgui
+maybe-dvi-libgui: dvi-libgui
 
 dvi-libgui: \
     configure-libgui 
@@ -10279,6 +12270,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10288,12 +12280,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif libgui
 
 .PHONY: maybe-TAGS-libgui TAGS-libgui
 maybe-TAGS-libgui:
+@if libgui
+maybe-TAGS-libgui: TAGS-libgui
 
 TAGS-libgui: \
     configure-libgui 
@@ -10301,6 +12296,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10310,12 +12306,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif libgui
 
 .PHONY: maybe-install-info-libgui install-info-libgui
 maybe-install-info-libgui:
+@if libgui
+maybe-install-info-libgui: install-info-libgui
 
 install-info-libgui: \
     configure-libgui \
@@ -10324,6 +12323,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10333,12 +12333,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif libgui
 
 .PHONY: maybe-installcheck-libgui installcheck-libgui
 maybe-installcheck-libgui:
+@if libgui
+maybe-installcheck-libgui: installcheck-libgui
 
 installcheck-libgui: \
     configure-libgui 
@@ -10346,6 +12349,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10355,18 +12359,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif libgui
 
 .PHONY: maybe-mostlyclean-libgui mostlyclean-libgui
 maybe-mostlyclean-libgui:
+@if libgui
+maybe-mostlyclean-libgui: mostlyclean-libgui
 
 mostlyclean-libgui: 
 	@[ -f ./libgui/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10376,18 +12384,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif libgui
 
 .PHONY: maybe-clean-libgui clean-libgui
 maybe-clean-libgui:
+@if libgui
+maybe-clean-libgui: clean-libgui
 
 clean-libgui: 
 	@[ -f ./libgui/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10397,18 +12409,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif libgui
 
 .PHONY: maybe-distclean-libgui distclean-libgui
 maybe-distclean-libgui:
+@if libgui
+maybe-distclean-libgui: distclean-libgui
 
 distclean-libgui: 
 	@[ -f ./libgui/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10418,18 +12434,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif libgui
 
 .PHONY: maybe-maintainer-clean-libgui maintainer-clean-libgui
 maybe-maintainer-clean-libgui:
+@if libgui
+maybe-maintainer-clean-libgui: maintainer-clean-libgui
 
 maintainer-clean-libgui: 
 	@[ -f ./libgui/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10439,33 +12459,319 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif libgui
+
+
+.PHONY: configure-libbanshee maybe-configure-libbanshee
+maybe-configure-libbanshee:
+@if libbanshee
+maybe-configure-libbanshee: configure-libbanshee
+configure-libbanshee:
+	@test ! -f libbanshee/Makefile || exit 0; \
+	[ -d libbanshee ] || mkdir libbanshee; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	echo Configuring in libbanshee; \
+	cd libbanshee || exit 1; \
+	case $(srcdir) in \
+	  \.) \
+	    srcdiroption="--srcdir=."; \
+	    libsrcdir=".";; \
+	  /* | [A-Za-z]:[\\/]*) \
+	    srcdiroption="--srcdir=$(srcdir)/libbanshee"; \
+	    libsrcdir="$$s/libbanshee";; \
+	  *) \
+	    srcdiroption="--srcdir=../$(srcdir)/libbanshee"; \
+	    libsrcdir="$$s/libbanshee";; \
+	esac; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
+	  || exit 1
+@endif libbanshee
+
+.PHONY: all-libbanshee maybe-all-libbanshee
+maybe-all-libbanshee:
+@if libbanshee
+maybe-all-libbanshee: all-libbanshee
+all-libbanshee: configure-libbanshee
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	(cd libbanshee && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif libbanshee
+
+.PHONY: check-libbanshee maybe-check-libbanshee
+maybe-check-libbanshee:
+@if libbanshee
+maybe-check-libbanshee: check-libbanshee
+
+check-libbanshee:
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	(cd libbanshee && $(MAKE) $(FLAGS_TO_PASS)  check)
+
+@endif libbanshee
+
+.PHONY: install-libbanshee maybe-install-libbanshee
+maybe-install-libbanshee:
+@if libbanshee
+maybe-install-libbanshee: install-libbanshee
+
+install-libbanshee:
+
+@endif libbanshee
+
+# Other targets (info, dvi, etc.)
+
+.PHONY: maybe-info-libbanshee info-libbanshee
+maybe-info-libbanshee:
+@if libbanshee
+maybe-info-libbanshee: info-libbanshee
+
+info-libbanshee: \
+    configure-libbanshee 
+	@[ -f ./libbanshee/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing info in libbanshee" ; \
+	(cd libbanshee && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           info) \
+	  || exit 1
+
+@endif libbanshee
+
+.PHONY: maybe-dvi-libbanshee dvi-libbanshee
+maybe-dvi-libbanshee:
+@if libbanshee
+maybe-dvi-libbanshee: dvi-libbanshee
+
+dvi-libbanshee: \
+    configure-libbanshee 
+	@[ -f ./libbanshee/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing dvi in libbanshee" ; \
+	(cd libbanshee && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           dvi) \
+	  || exit 1
+
+@endif libbanshee
+
+.PHONY: maybe-TAGS-libbanshee TAGS-libbanshee
+maybe-TAGS-libbanshee:
+@if libbanshee
+maybe-TAGS-libbanshee: TAGS-libbanshee
+
+TAGS-libbanshee: \
+    configure-libbanshee 
+	@[ -f ./libbanshee/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing TAGS in libbanshee" ; \
+	(cd libbanshee && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           TAGS) \
+	  || exit 1
+
+@endif libbanshee
+
+.PHONY: maybe-install-info-libbanshee install-info-libbanshee
+maybe-install-info-libbanshee:
+@if libbanshee
+maybe-install-info-libbanshee: install-info-libbanshee
+
+install-info-libbanshee: \
+    configure-libbanshee \
+    info-libbanshee 
+	@[ -f ./libbanshee/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing install-info in libbanshee" ; \
+	(cd libbanshee && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-info) \
+	  || exit 1
+
+@endif libbanshee
+
+.PHONY: maybe-installcheck-libbanshee installcheck-libbanshee
+maybe-installcheck-libbanshee:
+@if libbanshee
+maybe-installcheck-libbanshee: installcheck-libbanshee
+
+installcheck-libbanshee: \
+    configure-libbanshee 
+	@[ -f ./libbanshee/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing installcheck in libbanshee" ; \
+	(cd libbanshee && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           installcheck) \
+	  || exit 1
+
+@endif libbanshee
+
+.PHONY: maybe-mostlyclean-libbanshee mostlyclean-libbanshee
+maybe-mostlyclean-libbanshee:
+@if libbanshee
+maybe-mostlyclean-libbanshee: mostlyclean-libbanshee
+
+mostlyclean-libbanshee: 
+	@[ -f ./libbanshee/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing mostlyclean in libbanshee" ; \
+	(cd libbanshee && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           mostlyclean) \
+	  || exit 1
+
+@endif libbanshee
+
+.PHONY: maybe-clean-libbanshee clean-libbanshee
+maybe-clean-libbanshee:
+@if libbanshee
+maybe-clean-libbanshee: clean-libbanshee
+
+clean-libbanshee: 
+	@[ -f ./libbanshee/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing clean in libbanshee" ; \
+	(cd libbanshee && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           clean) \
+	  || exit 1
+
+@endif libbanshee
+
+.PHONY: maybe-distclean-libbanshee distclean-libbanshee
+maybe-distclean-libbanshee:
+@if libbanshee
+maybe-distclean-libbanshee: distclean-libbanshee
+
+distclean-libbanshee: 
+	@[ -f ./libbanshee/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing distclean in libbanshee" ; \
+	(cd libbanshee && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           distclean) \
+	  || exit 1
+
+@endif libbanshee
+
+.PHONY: maybe-maintainer-clean-libbanshee maintainer-clean-libbanshee
+maybe-maintainer-clean-libbanshee:
+@if libbanshee
+maybe-maintainer-clean-libbanshee: maintainer-clean-libbanshee
+
+maintainer-clean-libbanshee: 
+	@[ -f ./libbanshee/Makefile ] || exit 0; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	for flag in $(EXTRA_HOST_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	echo "Doing maintainer-clean in libbanshee" ; \
+	(cd libbanshee && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           maintainer-clean) \
+	  || exit 1
+
+@endif libbanshee
 
 
 .PHONY: configure-libiberty maybe-configure-libiberty
 maybe-configure-libiberty:
+@if libiberty
+maybe-configure-libiberty: configure-libiberty
 configure-libiberty:
 	@test ! -f libiberty/Makefile || exit 0; \
 	[ -d libiberty ] || mkdir libiberty; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in libiberty; \
 	cd libiberty || exit 1; \
 	case $(srcdir) in \
@@ -10480,41 +12786,56 @@
 	    libsrcdir="$$s/libiberty";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif libiberty
 
 .PHONY: all-libiberty maybe-all-libiberty
 maybe-all-libiberty:
+@if libiberty
+maybe-all-libiberty: all-libiberty
 all-libiberty: configure-libiberty
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libiberty && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd libiberty && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif libiberty
 
 .PHONY: check-libiberty maybe-check-libiberty
 maybe-check-libiberty:
+@if libiberty
+maybe-check-libiberty: check-libiberty
 
 check-libiberty:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libiberty && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd libiberty && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif libiberty
 
 .PHONY: install-libiberty maybe-install-libiberty
 maybe-install-libiberty:
+@if libiberty
+maybe-install-libiberty: install-libiberty
 
 install-libiberty: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libiberty && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd libiberty && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif libiberty
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-libiberty info-libiberty
 maybe-info-libiberty:
+@if libiberty
+maybe-info-libiberty: info-libiberty
 
 info-libiberty: \
     configure-libiberty 
@@ -10522,6 +12843,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10531,12 +12853,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif libiberty
 
 .PHONY: maybe-dvi-libiberty dvi-libiberty
 maybe-dvi-libiberty:
+@if libiberty
+maybe-dvi-libiberty: dvi-libiberty
 
 dvi-libiberty: \
     configure-libiberty 
@@ -10544,6 +12869,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10553,12 +12879,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif libiberty
 
 .PHONY: maybe-TAGS-libiberty TAGS-libiberty
 maybe-TAGS-libiberty:
+@if libiberty
+maybe-TAGS-libiberty: TAGS-libiberty
 
 TAGS-libiberty: \
     configure-libiberty 
@@ -10566,6 +12895,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10575,12 +12905,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif libiberty
 
 .PHONY: maybe-install-info-libiberty install-info-libiberty
 maybe-install-info-libiberty:
+@if libiberty
+maybe-install-info-libiberty: install-info-libiberty
 
 install-info-libiberty: \
     configure-libiberty \
@@ -10589,6 +12922,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10598,12 +12932,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif libiberty
 
 .PHONY: maybe-installcheck-libiberty installcheck-libiberty
 maybe-installcheck-libiberty:
+@if libiberty
+maybe-installcheck-libiberty: installcheck-libiberty
 
 installcheck-libiberty: \
     configure-libiberty 
@@ -10611,6 +12948,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10620,18 +12958,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif libiberty
 
 .PHONY: maybe-mostlyclean-libiberty mostlyclean-libiberty
 maybe-mostlyclean-libiberty:
+@if libiberty
+maybe-mostlyclean-libiberty: mostlyclean-libiberty
 
 mostlyclean-libiberty: 
 	@[ -f ./libiberty/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10641,18 +12983,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif libiberty
 
 .PHONY: maybe-clean-libiberty clean-libiberty
 maybe-clean-libiberty:
+@if libiberty
+maybe-clean-libiberty: clean-libiberty
 
 clean-libiberty: 
 	@[ -f ./libiberty/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10662,18 +13008,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif libiberty
 
 .PHONY: maybe-distclean-libiberty distclean-libiberty
 maybe-distclean-libiberty:
+@if libiberty
+maybe-distclean-libiberty: distclean-libiberty
 
 distclean-libiberty: 
 	@[ -f ./libiberty/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10683,18 +13033,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif libiberty
 
 .PHONY: maybe-maintainer-clean-libiberty maintainer-clean-libiberty
 maybe-maintainer-clean-libiberty:
+@if libiberty
+maybe-maintainer-clean-libiberty: maintainer-clean-libiberty
 
 maintainer-clean-libiberty: 
 	@[ -f ./libiberty/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10704,33 +13058,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif libiberty
 
 
 .PHONY: configure-libtool maybe-configure-libtool
 maybe-configure-libtool:
+@if libtool
+maybe-configure-libtool: configure-libtool
 configure-libtool:
 	@test ! -f libtool/Makefile || exit 0; \
 	[ -d libtool ] || mkdir libtool; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in libtool; \
 	cd libtool || exit 1; \
 	case $(srcdir) in \
@@ -10745,41 +13088,56 @@
 	    libsrcdir="$$s/libtool";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif libtool
 
 .PHONY: all-libtool maybe-all-libtool
 maybe-all-libtool:
+@if libtool
+maybe-all-libtool: all-libtool
 all-libtool: configure-libtool
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libtool && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd libtool && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif libtool
 
 .PHONY: check-libtool maybe-check-libtool
 maybe-check-libtool:
+@if libtool
+maybe-check-libtool: check-libtool
 
 check-libtool:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libtool && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd libtool && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif libtool
 
 .PHONY: install-libtool maybe-install-libtool
 maybe-install-libtool:
+@if libtool
+maybe-install-libtool: install-libtool
 
 install-libtool: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libtool && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd libtool && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif libtool
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-libtool info-libtool
 maybe-info-libtool:
+@if libtool
+maybe-info-libtool: info-libtool
 
 info-libtool: \
     configure-libtool 
@@ -10787,6 +13145,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10796,12 +13155,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif libtool
 
 .PHONY: maybe-dvi-libtool dvi-libtool
 maybe-dvi-libtool:
+@if libtool
+maybe-dvi-libtool: dvi-libtool
 
 dvi-libtool: \
     configure-libtool 
@@ -10809,6 +13171,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10818,12 +13181,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif libtool
 
 .PHONY: maybe-TAGS-libtool TAGS-libtool
 maybe-TAGS-libtool:
+@if libtool
+maybe-TAGS-libtool: TAGS-libtool
 
 TAGS-libtool: \
     configure-libtool 
@@ -10831,6 +13197,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10840,12 +13207,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif libtool
 
 .PHONY: maybe-install-info-libtool install-info-libtool
 maybe-install-info-libtool:
+@if libtool
+maybe-install-info-libtool: install-info-libtool
 
 install-info-libtool: \
     configure-libtool \
@@ -10854,6 +13224,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10863,12 +13234,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif libtool
 
 .PHONY: maybe-installcheck-libtool installcheck-libtool
 maybe-installcheck-libtool:
+@if libtool
+maybe-installcheck-libtool: installcheck-libtool
 
 installcheck-libtool: \
     configure-libtool 
@@ -10876,6 +13250,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10885,18 +13260,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif libtool
 
 .PHONY: maybe-mostlyclean-libtool mostlyclean-libtool
 maybe-mostlyclean-libtool:
+@if libtool
+maybe-mostlyclean-libtool: mostlyclean-libtool
 
 mostlyclean-libtool: 
 	@[ -f ./libtool/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10906,18 +13285,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif libtool
 
 .PHONY: maybe-clean-libtool clean-libtool
 maybe-clean-libtool:
+@if libtool
+maybe-clean-libtool: clean-libtool
 
 clean-libtool: 
 	@[ -f ./libtool/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10927,18 +13310,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif libtool
 
 .PHONY: maybe-distclean-libtool distclean-libtool
 maybe-distclean-libtool:
+@if libtool
+maybe-distclean-libtool: distclean-libtool
 
 distclean-libtool: 
 	@[ -f ./libtool/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10948,18 +13335,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif libtool
 
 .PHONY: maybe-maintainer-clean-libtool maintainer-clean-libtool
 maybe-maintainer-clean-libtool:
+@if libtool
+maybe-maintainer-clean-libtool: maintainer-clean-libtool
 
 maintainer-clean-libtool: 
 	@[ -f ./libtool/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -10969,33 +13360,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif libtool
 
 
 .PHONY: configure-m4 maybe-configure-m4
 maybe-configure-m4:
+@if m4
+maybe-configure-m4: configure-m4
 configure-m4:
 	@test ! -f m4/Makefile || exit 0; \
 	[ -d m4 ] || mkdir m4; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in m4; \
 	cd m4 || exit 1; \
 	case $(srcdir) in \
@@ -11010,41 +13390,56 @@
 	    libsrcdir="$$s/m4";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif m4
 
 .PHONY: all-m4 maybe-all-m4
 maybe-all-m4:
+@if m4
+maybe-all-m4: all-m4
 all-m4: configure-m4
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd m4 && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd m4 && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif m4
 
 .PHONY: check-m4 maybe-check-m4
 maybe-check-m4:
+@if m4
+maybe-check-m4: check-m4
 
 check-m4:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd m4 && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd m4 && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif m4
 
 .PHONY: install-m4 maybe-install-m4
 maybe-install-m4:
+@if m4
+maybe-install-m4: install-m4
 
 install-m4: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd m4 && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd m4 && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif m4
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-m4 info-m4
 maybe-info-m4:
+@if m4
+maybe-info-m4: info-m4
 
 info-m4: \
     configure-m4 
@@ -11052,6 +13447,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11061,12 +13457,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif m4
 
 .PHONY: maybe-dvi-m4 dvi-m4
 maybe-dvi-m4:
+@if m4
+maybe-dvi-m4: dvi-m4
 
 dvi-m4: \
     configure-m4 
@@ -11074,6 +13473,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11083,12 +13483,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif m4
 
 .PHONY: maybe-TAGS-m4 TAGS-m4
 maybe-TAGS-m4:
+@if m4
+maybe-TAGS-m4: TAGS-m4
 
 TAGS-m4: \
     configure-m4 
@@ -11096,6 +13499,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11105,12 +13509,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif m4
 
 .PHONY: maybe-install-info-m4 install-info-m4
 maybe-install-info-m4:
+@if m4
+maybe-install-info-m4: install-info-m4
 
 install-info-m4: \
     configure-m4 \
@@ -11119,6 +13526,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11128,12 +13536,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif m4
 
 .PHONY: maybe-installcheck-m4 installcheck-m4
 maybe-installcheck-m4:
+@if m4
+maybe-installcheck-m4: installcheck-m4
 
 installcheck-m4: \
     configure-m4 
@@ -11141,6 +13552,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11150,18 +13562,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif m4
 
 .PHONY: maybe-mostlyclean-m4 mostlyclean-m4
 maybe-mostlyclean-m4:
+@if m4
+maybe-mostlyclean-m4: mostlyclean-m4
 
 mostlyclean-m4: 
 	@[ -f ./m4/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11171,18 +13587,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif m4
 
 .PHONY: maybe-clean-m4 clean-m4
 maybe-clean-m4:
+@if m4
+maybe-clean-m4: clean-m4
 
 clean-m4: 
 	@[ -f ./m4/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11192,18 +13612,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif m4
 
 .PHONY: maybe-distclean-m4 distclean-m4
 maybe-distclean-m4:
+@if m4
+maybe-distclean-m4: distclean-m4
 
 distclean-m4: 
 	@[ -f ./m4/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11213,18 +13637,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif m4
 
 .PHONY: maybe-maintainer-clean-m4 maintainer-clean-m4
 maybe-maintainer-clean-m4:
+@if m4
+maybe-maintainer-clean-m4: maintainer-clean-m4
 
 maintainer-clean-m4: 
 	@[ -f ./m4/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11234,33 +13662,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif m4
 
 
 .PHONY: configure-make maybe-configure-make
 maybe-configure-make:
+@if make
+maybe-configure-make: configure-make
 configure-make:
 	@test ! -f make/Makefile || exit 0; \
 	[ -d make ] || mkdir make; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in make; \
 	cd make || exit 1; \
 	case $(srcdir) in \
@@ -11275,41 +13692,56 @@
 	    libsrcdir="$$s/make";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif make
 
 .PHONY: all-make maybe-all-make
 maybe-all-make:
+@if make
+maybe-all-make: all-make
 all-make: configure-make
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd make && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd make && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif make
 
 .PHONY: check-make maybe-check-make
 maybe-check-make:
+@if make
+maybe-check-make: check-make
 
 check-make:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd make && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd make && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif make
 
 .PHONY: install-make maybe-install-make
 maybe-install-make:
+@if make
+maybe-install-make: install-make
 
 install-make: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd make && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd make && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif make
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-make info-make
 maybe-info-make:
+@if make
+maybe-info-make: info-make
 
 info-make: \
     configure-make 
@@ -11317,6 +13749,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11326,12 +13759,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif make
 
 .PHONY: maybe-dvi-make dvi-make
 maybe-dvi-make:
+@if make
+maybe-dvi-make: dvi-make
 
 dvi-make: \
     configure-make 
@@ -11339,6 +13775,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11348,12 +13785,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif make
 
 .PHONY: maybe-TAGS-make TAGS-make
 maybe-TAGS-make:
+@if make
+maybe-TAGS-make: TAGS-make
 
 TAGS-make: \
     configure-make 
@@ -11361,6 +13801,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11370,12 +13811,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif make
 
 .PHONY: maybe-install-info-make install-info-make
 maybe-install-info-make:
+@if make
+maybe-install-info-make: install-info-make
 
 install-info-make: \
     configure-make \
@@ -11384,6 +13828,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11393,12 +13838,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif make
 
 .PHONY: maybe-installcheck-make installcheck-make
 maybe-installcheck-make:
+@if make
+maybe-installcheck-make: installcheck-make
 
 installcheck-make: \
     configure-make 
@@ -11406,6 +13854,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11415,18 +13864,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif make
 
 .PHONY: maybe-mostlyclean-make mostlyclean-make
 maybe-mostlyclean-make:
+@if make
+maybe-mostlyclean-make: mostlyclean-make
 
 mostlyclean-make: 
 	@[ -f ./make/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11436,18 +13889,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif make
 
 .PHONY: maybe-clean-make clean-make
 maybe-clean-make:
+@if make
+maybe-clean-make: clean-make
 
 clean-make: 
 	@[ -f ./make/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11457,18 +13914,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif make
 
 .PHONY: maybe-distclean-make distclean-make
 maybe-distclean-make:
+@if make
+maybe-distclean-make: distclean-make
 
 distclean-make: 
 	@[ -f ./make/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11478,18 +13939,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif make
 
 .PHONY: maybe-maintainer-clean-make maintainer-clean-make
 maybe-maintainer-clean-make:
+@if make
+maybe-maintainer-clean-make: maintainer-clean-make
 
 maintainer-clean-make: 
 	@[ -f ./make/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11499,33 +13964,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif make
 
 
 .PHONY: configure-mmalloc maybe-configure-mmalloc
 maybe-configure-mmalloc:
+@if mmalloc
+maybe-configure-mmalloc: configure-mmalloc
 configure-mmalloc:
 	@test ! -f mmalloc/Makefile || exit 0; \
 	[ -d mmalloc ] || mkdir mmalloc; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in mmalloc; \
 	cd mmalloc || exit 1; \
 	case $(srcdir) in \
@@ -11540,37 +13994,51 @@
 	    libsrcdir="$$s/mmalloc";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif mmalloc
 
 .PHONY: all-mmalloc maybe-all-mmalloc
 maybe-all-mmalloc:
+@if mmalloc
+maybe-all-mmalloc: all-mmalloc
 all-mmalloc: configure-mmalloc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd mmalloc && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif mmalloc
 
 .PHONY: check-mmalloc maybe-check-mmalloc
 maybe-check-mmalloc:
+@if mmalloc
+maybe-check-mmalloc: check-mmalloc
 
 check-mmalloc:
 
+@endif mmalloc
 
 .PHONY: install-mmalloc maybe-install-mmalloc
 maybe-install-mmalloc:
+@if mmalloc
+maybe-install-mmalloc: install-mmalloc
 
 install-mmalloc: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd mmalloc && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif mmalloc
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-mmalloc info-mmalloc
 maybe-info-mmalloc:
+@if mmalloc
+maybe-info-mmalloc: info-mmalloc
 
 info-mmalloc: \
     configure-mmalloc 
@@ -11578,6 +14046,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11587,12 +14056,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif mmalloc
 
 .PHONY: maybe-dvi-mmalloc dvi-mmalloc
 maybe-dvi-mmalloc:
+@if mmalloc
+maybe-dvi-mmalloc: dvi-mmalloc
 
 dvi-mmalloc: \
     configure-mmalloc 
@@ -11600,6 +14072,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11609,12 +14082,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif mmalloc
 
 .PHONY: maybe-TAGS-mmalloc TAGS-mmalloc
 maybe-TAGS-mmalloc:
+@if mmalloc
+maybe-TAGS-mmalloc: TAGS-mmalloc
 
 TAGS-mmalloc: \
     configure-mmalloc 
@@ -11622,6 +14098,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11631,12 +14108,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif mmalloc
 
 .PHONY: maybe-install-info-mmalloc install-info-mmalloc
 maybe-install-info-mmalloc:
+@if mmalloc
+maybe-install-info-mmalloc: install-info-mmalloc
 
 install-info-mmalloc: \
     configure-mmalloc \
@@ -11645,6 +14125,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11654,12 +14135,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif mmalloc
 
 .PHONY: maybe-installcheck-mmalloc installcheck-mmalloc
 maybe-installcheck-mmalloc:
+@if mmalloc
+maybe-installcheck-mmalloc: installcheck-mmalloc
 
 installcheck-mmalloc: \
     configure-mmalloc 
@@ -11667,6 +14151,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11676,18 +14161,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif mmalloc
 
 .PHONY: maybe-mostlyclean-mmalloc mostlyclean-mmalloc
 maybe-mostlyclean-mmalloc:
+@if mmalloc
+maybe-mostlyclean-mmalloc: mostlyclean-mmalloc
 
 mostlyclean-mmalloc: 
 	@[ -f ./mmalloc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11697,18 +14186,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif mmalloc
 
 .PHONY: maybe-clean-mmalloc clean-mmalloc
 maybe-clean-mmalloc:
+@if mmalloc
+maybe-clean-mmalloc: clean-mmalloc
 
 clean-mmalloc: 
 	@[ -f ./mmalloc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11718,18 +14211,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif mmalloc
 
 .PHONY: maybe-distclean-mmalloc distclean-mmalloc
 maybe-distclean-mmalloc:
+@if mmalloc
+maybe-distclean-mmalloc: distclean-mmalloc
 
 distclean-mmalloc: 
 	@[ -f ./mmalloc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11739,18 +14236,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif mmalloc
 
 .PHONY: maybe-maintainer-clean-mmalloc maintainer-clean-mmalloc
 maybe-maintainer-clean-mmalloc:
+@if mmalloc
+maybe-maintainer-clean-mmalloc: maintainer-clean-mmalloc
 
 maintainer-clean-mmalloc: 
 	@[ -f ./mmalloc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11760,33 +14261,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif mmalloc
 
 
 .PHONY: configure-patch maybe-configure-patch
 maybe-configure-patch:
+@if patch
+maybe-configure-patch: configure-patch
 configure-patch:
 	@test ! -f patch/Makefile || exit 0; \
 	[ -d patch ] || mkdir patch; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in patch; \
 	cd patch || exit 1; \
 	case $(srcdir) in \
@@ -11801,41 +14291,56 @@
 	    libsrcdir="$$s/patch";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif patch
 
 .PHONY: all-patch maybe-all-patch
 maybe-all-patch:
+@if patch
+maybe-all-patch: all-patch
 all-patch: configure-patch
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd patch && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd patch && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif patch
 
 .PHONY: check-patch maybe-check-patch
 maybe-check-patch:
+@if patch
+maybe-check-patch: check-patch
 
 check-patch:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd patch && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd patch && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif patch
 
 .PHONY: install-patch maybe-install-patch
 maybe-install-patch:
+@if patch
+maybe-install-patch: install-patch
 
 install-patch: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd patch && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd patch && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif patch
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-patch info-patch
 maybe-info-patch:
+@if patch
+maybe-info-patch: info-patch
 
 info-patch: \
     configure-patch 
@@ -11843,6 +14348,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11852,12 +14358,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif patch
 
 .PHONY: maybe-dvi-patch dvi-patch
 maybe-dvi-patch:
+@if patch
+maybe-dvi-patch: dvi-patch
 
 dvi-patch: \
     configure-patch 
@@ -11865,6 +14374,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11874,12 +14384,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif patch
 
 .PHONY: maybe-TAGS-patch TAGS-patch
 maybe-TAGS-patch:
+@if patch
+maybe-TAGS-patch: TAGS-patch
 
 TAGS-patch: \
     configure-patch 
@@ -11887,6 +14400,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11896,12 +14410,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif patch
 
 .PHONY: maybe-install-info-patch install-info-patch
 maybe-install-info-patch:
+@if patch
+maybe-install-info-patch: install-info-patch
 
 install-info-patch: \
     configure-patch \
@@ -11910,6 +14427,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11919,12 +14437,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif patch
 
 .PHONY: maybe-installcheck-patch installcheck-patch
 maybe-installcheck-patch:
+@if patch
+maybe-installcheck-patch: installcheck-patch
 
 installcheck-patch: \
     configure-patch 
@@ -11932,6 +14453,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11941,18 +14463,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif patch
 
 .PHONY: maybe-mostlyclean-patch mostlyclean-patch
 maybe-mostlyclean-patch:
+@if patch
+maybe-mostlyclean-patch: mostlyclean-patch
 
 mostlyclean-patch: 
 	@[ -f ./patch/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11962,18 +14488,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif patch
 
 .PHONY: maybe-clean-patch clean-patch
 maybe-clean-patch:
+@if patch
+maybe-clean-patch: clean-patch
 
 clean-patch: 
 	@[ -f ./patch/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -11983,18 +14513,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif patch
 
 .PHONY: maybe-distclean-patch distclean-patch
 maybe-distclean-patch:
+@if patch
+maybe-distclean-patch: distclean-patch
 
 distclean-patch: 
 	@[ -f ./patch/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12004,18 +14538,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif patch
 
 .PHONY: maybe-maintainer-clean-patch maintainer-clean-patch
 maybe-maintainer-clean-patch:
+@if patch
+maybe-maintainer-clean-patch: maintainer-clean-patch
 
 maintainer-clean-patch: 
 	@[ -f ./patch/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12025,33 +14563,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif patch
 
 
 .PHONY: configure-perl maybe-configure-perl
 maybe-configure-perl:
+@if perl
+maybe-configure-perl: configure-perl
 configure-perl:
 	@test ! -f perl/Makefile || exit 0; \
 	[ -d perl ] || mkdir perl; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in perl; \
 	cd perl || exit 1; \
 	case $(srcdir) in \
@@ -12066,41 +14593,56 @@
 	    libsrcdir="$$s/perl";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif perl
 
 .PHONY: all-perl maybe-all-perl
 maybe-all-perl:
+@if perl
+maybe-all-perl: all-perl
 all-perl: configure-perl
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd perl && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd perl && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif perl
 
 .PHONY: check-perl maybe-check-perl
 maybe-check-perl:
+@if perl
+maybe-check-perl: check-perl
 
 check-perl:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd perl && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd perl && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif perl
 
 .PHONY: install-perl maybe-install-perl
 maybe-install-perl:
+@if perl
+maybe-install-perl: install-perl
 
 install-perl: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd perl && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd perl && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif perl
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-perl info-perl
 maybe-info-perl:
+@if perl
+maybe-info-perl: info-perl
 
 info-perl: \
     configure-perl 
@@ -12108,6 +14650,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12117,12 +14660,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif perl
 
 .PHONY: maybe-dvi-perl dvi-perl
 maybe-dvi-perl:
+@if perl
+maybe-dvi-perl: dvi-perl
 
 dvi-perl: \
     configure-perl 
@@ -12130,6 +14676,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12139,12 +14686,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif perl
 
 .PHONY: maybe-TAGS-perl TAGS-perl
 maybe-TAGS-perl:
+@if perl
+maybe-TAGS-perl: TAGS-perl
 
 TAGS-perl: \
     configure-perl 
@@ -12152,6 +14702,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12161,12 +14712,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif perl
 
 .PHONY: maybe-install-info-perl install-info-perl
 maybe-install-info-perl:
+@if perl
+maybe-install-info-perl: install-info-perl
 
 install-info-perl: \
     configure-perl \
@@ -12175,6 +14729,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12184,12 +14739,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif perl
 
 .PHONY: maybe-installcheck-perl installcheck-perl
 maybe-installcheck-perl:
+@if perl
+maybe-installcheck-perl: installcheck-perl
 
 installcheck-perl: \
     configure-perl 
@@ -12197,6 +14755,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12206,18 +14765,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif perl
 
 .PHONY: maybe-mostlyclean-perl mostlyclean-perl
 maybe-mostlyclean-perl:
+@if perl
+maybe-mostlyclean-perl: mostlyclean-perl
 
 mostlyclean-perl: 
 	@[ -f ./perl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12227,18 +14790,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif perl
 
 .PHONY: maybe-clean-perl clean-perl
 maybe-clean-perl:
+@if perl
+maybe-clean-perl: clean-perl
 
 clean-perl: 
 	@[ -f ./perl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12248,18 +14815,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif perl
 
 .PHONY: maybe-distclean-perl distclean-perl
 maybe-distclean-perl:
+@if perl
+maybe-distclean-perl: distclean-perl
 
 distclean-perl: 
 	@[ -f ./perl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12269,18 +14840,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif perl
 
 .PHONY: maybe-maintainer-clean-perl maintainer-clean-perl
 maybe-maintainer-clean-perl:
+@if perl
+maybe-maintainer-clean-perl: maintainer-clean-perl
 
 maintainer-clean-perl: 
 	@[ -f ./perl/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12290,33 +14865,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif perl
 
 
 .PHONY: configure-prms maybe-configure-prms
 maybe-configure-prms:
+@if prms
+maybe-configure-prms: configure-prms
 configure-prms:
 	@test ! -f prms/Makefile || exit 0; \
 	[ -d prms ] || mkdir prms; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in prms; \
 	cd prms || exit 1; \
 	case $(srcdir) in \
@@ -12331,41 +14895,56 @@
 	    libsrcdir="$$s/prms";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif prms
 
 .PHONY: all-prms maybe-all-prms
 maybe-all-prms:
+@if prms
+maybe-all-prms: all-prms
 all-prms: configure-prms
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd prms && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd prms && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif prms
 
 .PHONY: check-prms maybe-check-prms
 maybe-check-prms:
+@if prms
+maybe-check-prms: check-prms
 
 check-prms:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd prms && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd prms && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif prms
 
 .PHONY: install-prms maybe-install-prms
 maybe-install-prms:
+@if prms
+maybe-install-prms: install-prms
 
 install-prms: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd prms && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd prms && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif prms
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-prms info-prms
 maybe-info-prms:
+@if prms
+maybe-info-prms: info-prms
 
 info-prms: \
     configure-prms 
@@ -12373,6 +14952,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12382,12 +14962,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif prms
 
 .PHONY: maybe-dvi-prms dvi-prms
 maybe-dvi-prms:
+@if prms
+maybe-dvi-prms: dvi-prms
 
 dvi-prms: \
     configure-prms 
@@ -12395,6 +14978,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12404,12 +14988,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif prms
 
 .PHONY: maybe-TAGS-prms TAGS-prms
 maybe-TAGS-prms:
+@if prms
+maybe-TAGS-prms: TAGS-prms
 
 TAGS-prms: \
     configure-prms 
@@ -12417,6 +15004,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12426,12 +15014,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif prms
 
 .PHONY: maybe-install-info-prms install-info-prms
 maybe-install-info-prms:
+@if prms
+maybe-install-info-prms: install-info-prms
 
 install-info-prms: \
     configure-prms \
@@ -12440,6 +15031,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12449,12 +15041,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif prms
 
 .PHONY: maybe-installcheck-prms installcheck-prms
 maybe-installcheck-prms:
+@if prms
+maybe-installcheck-prms: installcheck-prms
 
 installcheck-prms: \
     configure-prms 
@@ -12462,6 +15057,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12471,18 +15067,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif prms
 
 .PHONY: maybe-mostlyclean-prms mostlyclean-prms
 maybe-mostlyclean-prms:
+@if prms
+maybe-mostlyclean-prms: mostlyclean-prms
 
 mostlyclean-prms: 
 	@[ -f ./prms/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12492,18 +15092,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif prms
 
 .PHONY: maybe-clean-prms clean-prms
 maybe-clean-prms:
+@if prms
+maybe-clean-prms: clean-prms
 
 clean-prms: 
 	@[ -f ./prms/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12513,18 +15117,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif prms
 
 .PHONY: maybe-distclean-prms distclean-prms
 maybe-distclean-prms:
+@if prms
+maybe-distclean-prms: distclean-prms
 
 distclean-prms: 
 	@[ -f ./prms/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12534,18 +15142,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif prms
 
 .PHONY: maybe-maintainer-clean-prms maintainer-clean-prms
 maybe-maintainer-clean-prms:
+@if prms
+maybe-maintainer-clean-prms: maintainer-clean-prms
 
 maintainer-clean-prms: 
 	@[ -f ./prms/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12555,33 +15167,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif prms
 
 
 .PHONY: configure-rcs maybe-configure-rcs
 maybe-configure-rcs:
+@if rcs
+maybe-configure-rcs: configure-rcs
 configure-rcs:
 	@test ! -f rcs/Makefile || exit 0; \
 	[ -d rcs ] || mkdir rcs; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in rcs; \
 	cd rcs || exit 1; \
 	case $(srcdir) in \
@@ -12596,41 +15197,56 @@
 	    libsrcdir="$$s/rcs";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif rcs
 
 .PHONY: all-rcs maybe-all-rcs
 maybe-all-rcs:
+@if rcs
+maybe-all-rcs: all-rcs
 all-rcs: configure-rcs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd rcs && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd rcs && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif rcs
 
 .PHONY: check-rcs maybe-check-rcs
 maybe-check-rcs:
+@if rcs
+maybe-check-rcs: check-rcs
 
 check-rcs:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd rcs && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd rcs && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif rcs
 
 .PHONY: install-rcs maybe-install-rcs
 maybe-install-rcs:
+@if rcs
+maybe-install-rcs: install-rcs
 
 install-rcs: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd rcs && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd rcs && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif rcs
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-rcs info-rcs
 maybe-info-rcs:
+@if rcs
+maybe-info-rcs: info-rcs
 
 info-rcs: \
     configure-rcs 
@@ -12638,6 +15254,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12647,12 +15264,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif rcs
 
 .PHONY: maybe-dvi-rcs dvi-rcs
 maybe-dvi-rcs:
+@if rcs
+maybe-dvi-rcs: dvi-rcs
 
 dvi-rcs: \
     configure-rcs 
@@ -12660,6 +15280,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12669,12 +15290,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif rcs
 
 .PHONY: maybe-TAGS-rcs TAGS-rcs
 maybe-TAGS-rcs:
+@if rcs
+maybe-TAGS-rcs: TAGS-rcs
 
 TAGS-rcs: \
     configure-rcs 
@@ -12682,6 +15306,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12691,12 +15316,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif rcs
 
 .PHONY: maybe-install-info-rcs install-info-rcs
 maybe-install-info-rcs:
+@if rcs
+maybe-install-info-rcs: install-info-rcs
 
 install-info-rcs: \
     configure-rcs \
@@ -12705,6 +15333,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12714,12 +15343,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif rcs
 
 .PHONY: maybe-installcheck-rcs installcheck-rcs
 maybe-installcheck-rcs:
+@if rcs
+maybe-installcheck-rcs: installcheck-rcs
 
 installcheck-rcs: \
     configure-rcs 
@@ -12727,6 +15359,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12736,18 +15369,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif rcs
 
 .PHONY: maybe-mostlyclean-rcs mostlyclean-rcs
 maybe-mostlyclean-rcs:
+@if rcs
+maybe-mostlyclean-rcs: mostlyclean-rcs
 
 mostlyclean-rcs: 
 	@[ -f ./rcs/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12757,18 +15394,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif rcs
 
 .PHONY: maybe-clean-rcs clean-rcs
 maybe-clean-rcs:
+@if rcs
+maybe-clean-rcs: clean-rcs
 
 clean-rcs: 
 	@[ -f ./rcs/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12778,18 +15419,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif rcs
 
 .PHONY: maybe-distclean-rcs distclean-rcs
 maybe-distclean-rcs:
+@if rcs
+maybe-distclean-rcs: distclean-rcs
 
 distclean-rcs: 
 	@[ -f ./rcs/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12799,18 +15444,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif rcs
 
 .PHONY: maybe-maintainer-clean-rcs maintainer-clean-rcs
 maybe-maintainer-clean-rcs:
+@if rcs
+maybe-maintainer-clean-rcs: maintainer-clean-rcs
 
 maintainer-clean-rcs: 
 	@[ -f ./rcs/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12820,33 +15469,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif rcs
 
 
 .PHONY: configure-readline maybe-configure-readline
 maybe-configure-readline:
+@if readline
+maybe-configure-readline: configure-readline
 configure-readline:
 	@test ! -f readline/Makefile || exit 0; \
 	[ -d readline ] || mkdir readline; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in readline; \
 	cd readline || exit 1; \
 	case $(srcdir) in \
@@ -12861,41 +15499,56 @@
 	    libsrcdir="$$s/readline";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif readline
 
 .PHONY: all-readline maybe-all-readline
 maybe-all-readline:
+@if readline
+maybe-all-readline: all-readline
 all-readline: configure-readline
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd readline && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd readline && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif readline
 
 .PHONY: check-readline maybe-check-readline
 maybe-check-readline:
+@if readline
+maybe-check-readline: check-readline
 
 check-readline:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd readline && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd readline && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif readline
 
 .PHONY: install-readline maybe-install-readline
 maybe-install-readline:
+@if readline
+maybe-install-readline: install-readline
 
 install-readline: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd readline && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd readline && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif readline
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-readline info-readline
 maybe-info-readline:
+@if readline
+maybe-info-readline: info-readline
 
 info-readline: \
     configure-readline 
@@ -12903,6 +15556,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12912,12 +15566,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif readline
 
 .PHONY: maybe-dvi-readline dvi-readline
 maybe-dvi-readline:
+@if readline
+maybe-dvi-readline: dvi-readline
 
 dvi-readline: \
     configure-readline 
@@ -12925,6 +15582,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12934,12 +15592,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif readline
 
 .PHONY: maybe-TAGS-readline TAGS-readline
 maybe-TAGS-readline:
+@if readline
+maybe-TAGS-readline: TAGS-readline
 
 TAGS-readline: \
     configure-readline 
@@ -12947,6 +15608,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12956,12 +15618,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif readline
 
 .PHONY: maybe-install-info-readline install-info-readline
 maybe-install-info-readline:
+@if readline
+maybe-install-info-readline: install-info-readline
 
 install-info-readline: \
     configure-readline \
@@ -12970,6 +15635,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -12979,12 +15645,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif readline
 
 .PHONY: maybe-installcheck-readline installcheck-readline
 maybe-installcheck-readline:
+@if readline
+maybe-installcheck-readline: installcheck-readline
 
 installcheck-readline: \
     configure-readline 
@@ -12992,6 +15661,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13001,18 +15671,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif readline
 
 .PHONY: maybe-mostlyclean-readline mostlyclean-readline
 maybe-mostlyclean-readline:
+@if readline
+maybe-mostlyclean-readline: mostlyclean-readline
 
 mostlyclean-readline: 
 	@[ -f ./readline/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13022,18 +15696,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif readline
 
 .PHONY: maybe-clean-readline clean-readline
 maybe-clean-readline:
+@if readline
+maybe-clean-readline: clean-readline
 
 clean-readline: 
 	@[ -f ./readline/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13043,18 +15721,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif readline
 
 .PHONY: maybe-distclean-readline distclean-readline
 maybe-distclean-readline:
+@if readline
+maybe-distclean-readline: distclean-readline
 
 distclean-readline: 
 	@[ -f ./readline/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13064,18 +15746,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif readline
 
 .PHONY: maybe-maintainer-clean-readline maintainer-clean-readline
 maybe-maintainer-clean-readline:
+@if readline
+maybe-maintainer-clean-readline: maintainer-clean-readline
 
 maintainer-clean-readline: 
 	@[ -f ./readline/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13085,33 +15771,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif readline
 
 
 .PHONY: configure-release maybe-configure-release
 maybe-configure-release:
+@if release
+maybe-configure-release: configure-release
 configure-release:
 	@test ! -f release/Makefile || exit 0; \
 	[ -d release ] || mkdir release; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in release; \
 	cd release || exit 1; \
 	case $(srcdir) in \
@@ -13126,33 +15801,46 @@
 	    libsrcdir="$$s/release";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif release
 
 .PHONY: all-release maybe-all-release
 maybe-all-release:
+@if release
+maybe-all-release: all-release
 all-release: configure-release
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd release && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd release && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif release
 
 .PHONY: check-release maybe-check-release
 maybe-check-release:
+@if release
+maybe-check-release: check-release
 
 check-release:
 
+@endif release
 
 .PHONY: install-release maybe-install-release
 maybe-install-release:
+@if release
+maybe-install-release: install-release
 
 install-release:
 
+@endif release
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-release info-release
 maybe-info-release:
+@if release
+maybe-info-release: info-release
 
 info-release: \
     configure-release 
@@ -13160,6 +15848,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13169,12 +15858,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif release
 
 .PHONY: maybe-dvi-release dvi-release
 maybe-dvi-release:
+@if release
+maybe-dvi-release: dvi-release
 
 dvi-release: \
     configure-release 
@@ -13182,6 +15874,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13191,12 +15884,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif release
 
 .PHONY: maybe-TAGS-release TAGS-release
 maybe-TAGS-release:
+@if release
+maybe-TAGS-release: TAGS-release
 
 TAGS-release: \
     configure-release 
@@ -13204,6 +15900,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13213,12 +15910,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif release
 
 .PHONY: maybe-install-info-release install-info-release
 maybe-install-info-release:
+@if release
+maybe-install-info-release: install-info-release
 
 install-info-release: \
     configure-release \
@@ -13227,6 +15927,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13236,12 +15937,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif release
 
 .PHONY: maybe-installcheck-release installcheck-release
 maybe-installcheck-release:
+@if release
+maybe-installcheck-release: installcheck-release
 
 installcheck-release: \
     configure-release 
@@ -13249,6 +15953,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13258,18 +15963,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif release
 
 .PHONY: maybe-mostlyclean-release mostlyclean-release
 maybe-mostlyclean-release:
+@if release
+maybe-mostlyclean-release: mostlyclean-release
 
 mostlyclean-release: 
 	@[ -f ./release/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13279,18 +15988,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif release
 
 .PHONY: maybe-clean-release clean-release
 maybe-clean-release:
+@if release
+maybe-clean-release: clean-release
 
 clean-release: 
 	@[ -f ./release/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13300,18 +16013,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif release
 
 .PHONY: maybe-distclean-release distclean-release
 maybe-distclean-release:
+@if release
+maybe-distclean-release: distclean-release
 
 distclean-release: 
 	@[ -f ./release/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13321,18 +16038,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif release
 
 .PHONY: maybe-maintainer-clean-release maintainer-clean-release
 maybe-maintainer-clean-release:
+@if release
+maybe-maintainer-clean-release: maintainer-clean-release
 
 maintainer-clean-release: 
 	@[ -f ./release/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13342,33 +16063,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif release
 
 
 .PHONY: configure-recode maybe-configure-recode
 maybe-configure-recode:
+@if recode
+maybe-configure-recode: configure-recode
 configure-recode:
 	@test ! -f recode/Makefile || exit 0; \
 	[ -d recode ] || mkdir recode; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in recode; \
 	cd recode || exit 1; \
 	case $(srcdir) in \
@@ -13383,41 +16093,56 @@
 	    libsrcdir="$$s/recode";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif recode
 
 .PHONY: all-recode maybe-all-recode
 maybe-all-recode:
+@if recode
+maybe-all-recode: all-recode
 all-recode: configure-recode
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd recode && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd recode && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif recode
 
 .PHONY: check-recode maybe-check-recode
 maybe-check-recode:
+@if recode
+maybe-check-recode: check-recode
 
 check-recode:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd recode && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd recode && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif recode
 
 .PHONY: install-recode maybe-install-recode
 maybe-install-recode:
+@if recode
+maybe-install-recode: install-recode
 
 install-recode: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd recode && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd recode && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif recode
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-recode info-recode
 maybe-info-recode:
+@if recode
+maybe-info-recode: info-recode
 
 info-recode: \
     configure-recode 
@@ -13425,6 +16150,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13434,12 +16160,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif recode
 
 .PHONY: maybe-dvi-recode dvi-recode
 maybe-dvi-recode:
+@if recode
+maybe-dvi-recode: dvi-recode
 
 dvi-recode: \
     configure-recode 
@@ -13447,6 +16176,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13456,12 +16186,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif recode
 
 .PHONY: maybe-TAGS-recode TAGS-recode
 maybe-TAGS-recode:
+@if recode
+maybe-TAGS-recode: TAGS-recode
 
 TAGS-recode: \
     configure-recode 
@@ -13469,6 +16202,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13478,12 +16212,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif recode
 
 .PHONY: maybe-install-info-recode install-info-recode
 maybe-install-info-recode:
+@if recode
+maybe-install-info-recode: install-info-recode
 
 install-info-recode: \
     configure-recode \
@@ -13492,6 +16229,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13501,12 +16239,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif recode
 
 .PHONY: maybe-installcheck-recode installcheck-recode
 maybe-installcheck-recode:
+@if recode
+maybe-installcheck-recode: installcheck-recode
 
 installcheck-recode: \
     configure-recode 
@@ -13514,6 +16255,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13523,18 +16265,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif recode
 
 .PHONY: maybe-mostlyclean-recode mostlyclean-recode
 maybe-mostlyclean-recode:
+@if recode
+maybe-mostlyclean-recode: mostlyclean-recode
 
 mostlyclean-recode: 
 	@[ -f ./recode/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13544,18 +16290,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif recode
 
 .PHONY: maybe-clean-recode clean-recode
 maybe-clean-recode:
+@if recode
+maybe-clean-recode: clean-recode
 
 clean-recode: 
 	@[ -f ./recode/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13565,18 +16315,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif recode
 
 .PHONY: maybe-distclean-recode distclean-recode
 maybe-distclean-recode:
+@if recode
+maybe-distclean-recode: distclean-recode
 
 distclean-recode: 
 	@[ -f ./recode/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13586,18 +16340,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif recode
 
 .PHONY: maybe-maintainer-clean-recode maintainer-clean-recode
 maybe-maintainer-clean-recode:
+@if recode
+maybe-maintainer-clean-recode: maintainer-clean-recode
 
 maintainer-clean-recode: 
 	@[ -f ./recode/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13607,33 +16365,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif recode
 
 
 .PHONY: configure-sed maybe-configure-sed
 maybe-configure-sed:
+@if sed
+maybe-configure-sed: configure-sed
 configure-sed:
 	@test ! -f sed/Makefile || exit 0; \
 	[ -d sed ] || mkdir sed; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in sed; \
 	cd sed || exit 1; \
 	case $(srcdir) in \
@@ -13648,41 +16395,56 @@
 	    libsrcdir="$$s/sed";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif sed
 
 .PHONY: all-sed maybe-all-sed
 maybe-all-sed:
+@if sed
+maybe-all-sed: all-sed
 all-sed: configure-sed
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd sed && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd sed && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif sed
 
 .PHONY: check-sed maybe-check-sed
 maybe-check-sed:
+@if sed
+maybe-check-sed: check-sed
 
 check-sed:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd sed && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd sed && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif sed
 
 .PHONY: install-sed maybe-install-sed
 maybe-install-sed:
+@if sed
+maybe-install-sed: install-sed
 
 install-sed: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd sed && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd sed && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif sed
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-sed info-sed
 maybe-info-sed:
+@if sed
+maybe-info-sed: info-sed
 
 info-sed: \
     configure-sed 
@@ -13690,6 +16452,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13699,12 +16462,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif sed
 
 .PHONY: maybe-dvi-sed dvi-sed
 maybe-dvi-sed:
+@if sed
+maybe-dvi-sed: dvi-sed
 
 dvi-sed: \
     configure-sed 
@@ -13712,6 +16478,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13721,12 +16488,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif sed
 
 .PHONY: maybe-TAGS-sed TAGS-sed
 maybe-TAGS-sed:
+@if sed
+maybe-TAGS-sed: TAGS-sed
 
 TAGS-sed: \
     configure-sed 
@@ -13734,6 +16504,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13743,12 +16514,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif sed
 
 .PHONY: maybe-install-info-sed install-info-sed
 maybe-install-info-sed:
+@if sed
+maybe-install-info-sed: install-info-sed
 
 install-info-sed: \
     configure-sed \
@@ -13757,6 +16531,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13766,12 +16541,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif sed
 
 .PHONY: maybe-installcheck-sed installcheck-sed
 maybe-installcheck-sed:
+@if sed
+maybe-installcheck-sed: installcheck-sed
 
 installcheck-sed: \
     configure-sed 
@@ -13779,6 +16557,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13788,18 +16567,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif sed
 
 .PHONY: maybe-mostlyclean-sed mostlyclean-sed
 maybe-mostlyclean-sed:
+@if sed
+maybe-mostlyclean-sed: mostlyclean-sed
 
 mostlyclean-sed: 
 	@[ -f ./sed/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13809,18 +16592,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif sed
 
 .PHONY: maybe-clean-sed clean-sed
 maybe-clean-sed:
+@if sed
+maybe-clean-sed: clean-sed
 
 clean-sed: 
 	@[ -f ./sed/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13830,18 +16617,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif sed
 
 .PHONY: maybe-distclean-sed distclean-sed
 maybe-distclean-sed:
+@if sed
+maybe-distclean-sed: distclean-sed
 
 distclean-sed: 
 	@[ -f ./sed/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13851,18 +16642,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif sed
 
 .PHONY: maybe-maintainer-clean-sed maintainer-clean-sed
 maybe-maintainer-clean-sed:
+@if sed
+maybe-maintainer-clean-sed: maintainer-clean-sed
 
 maintainer-clean-sed: 
 	@[ -f ./sed/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13872,33 +16667,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif sed
 
 
 .PHONY: configure-send-pr maybe-configure-send-pr
 maybe-configure-send-pr:
+@if send-pr
+maybe-configure-send-pr: configure-send-pr
 configure-send-pr:
 	@test ! -f send-pr/Makefile || exit 0; \
 	[ -d send-pr ] || mkdir send-pr; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in send-pr; \
 	cd send-pr || exit 1; \
 	case $(srcdir) in \
@@ -13913,41 +16697,56 @@
 	    libsrcdir="$$s/send-pr";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif send-pr
 
 .PHONY: all-send-pr maybe-all-send-pr
 maybe-all-send-pr:
+@if send-pr
+maybe-all-send-pr: all-send-pr
 all-send-pr: configure-send-pr
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd send-pr && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd send-pr && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif send-pr
 
 .PHONY: check-send-pr maybe-check-send-pr
 maybe-check-send-pr:
+@if send-pr
+maybe-check-send-pr: check-send-pr
 
 check-send-pr:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd send-pr && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd send-pr && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif send-pr
 
 .PHONY: install-send-pr maybe-install-send-pr
 maybe-install-send-pr:
+@if send-pr
+maybe-install-send-pr: install-send-pr
 
 install-send-pr: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd send-pr && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd send-pr && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif send-pr
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-send-pr info-send-pr
 maybe-info-send-pr:
+@if send-pr
+maybe-info-send-pr: info-send-pr
 
 info-send-pr: \
     configure-send-pr 
@@ -13955,6 +16754,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13964,12 +16764,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif send-pr
 
 .PHONY: maybe-dvi-send-pr dvi-send-pr
 maybe-dvi-send-pr:
+@if send-pr
+maybe-dvi-send-pr: dvi-send-pr
 
 dvi-send-pr: \
     configure-send-pr 
@@ -13977,6 +16780,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -13986,12 +16790,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif send-pr
 
 .PHONY: maybe-TAGS-send-pr TAGS-send-pr
 maybe-TAGS-send-pr:
+@if send-pr
+maybe-TAGS-send-pr: TAGS-send-pr
 
 TAGS-send-pr: \
     configure-send-pr 
@@ -13999,6 +16806,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14008,12 +16816,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif send-pr
 
 .PHONY: maybe-install-info-send-pr install-info-send-pr
 maybe-install-info-send-pr:
+@if send-pr
+maybe-install-info-send-pr: install-info-send-pr
 
 install-info-send-pr: \
     configure-send-pr \
@@ -14022,6 +16833,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14031,12 +16843,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif send-pr
 
 .PHONY: maybe-installcheck-send-pr installcheck-send-pr
 maybe-installcheck-send-pr:
+@if send-pr
+maybe-installcheck-send-pr: installcheck-send-pr
 
 installcheck-send-pr: \
     configure-send-pr 
@@ -14044,6 +16859,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14053,18 +16869,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif send-pr
 
 .PHONY: maybe-mostlyclean-send-pr mostlyclean-send-pr
 maybe-mostlyclean-send-pr:
+@if send-pr
+maybe-mostlyclean-send-pr: mostlyclean-send-pr
 
 mostlyclean-send-pr: 
 	@[ -f ./send-pr/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14074,18 +16894,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif send-pr
 
 .PHONY: maybe-clean-send-pr clean-send-pr
 maybe-clean-send-pr:
+@if send-pr
+maybe-clean-send-pr: clean-send-pr
 
 clean-send-pr: 
 	@[ -f ./send-pr/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14095,18 +16919,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif send-pr
 
 .PHONY: maybe-distclean-send-pr distclean-send-pr
 maybe-distclean-send-pr:
+@if send-pr
+maybe-distclean-send-pr: distclean-send-pr
 
 distclean-send-pr: 
 	@[ -f ./send-pr/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14116,18 +16944,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif send-pr
 
 .PHONY: maybe-maintainer-clean-send-pr maintainer-clean-send-pr
 maybe-maintainer-clean-send-pr:
+@if send-pr
+maybe-maintainer-clean-send-pr: maintainer-clean-send-pr
 
 maintainer-clean-send-pr: 
 	@[ -f ./send-pr/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14137,33 +16969,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif send-pr
 
 
 .PHONY: configure-shellutils maybe-configure-shellutils
 maybe-configure-shellutils:
+@if shellutils
+maybe-configure-shellutils: configure-shellutils
 configure-shellutils:
 	@test ! -f shellutils/Makefile || exit 0; \
 	[ -d shellutils ] || mkdir shellutils; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in shellutils; \
 	cd shellutils || exit 1; \
 	case $(srcdir) in \
@@ -14178,41 +16999,56 @@
 	    libsrcdir="$$s/shellutils";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif shellutils
 
 .PHONY: all-shellutils maybe-all-shellutils
 maybe-all-shellutils:
+@if shellutils
+maybe-all-shellutils: all-shellutils
 all-shellutils: configure-shellutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd shellutils && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd shellutils && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif shellutils
 
 .PHONY: check-shellutils maybe-check-shellutils
 maybe-check-shellutils:
+@if shellutils
+maybe-check-shellutils: check-shellutils
 
 check-shellutils:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd shellutils && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd shellutils && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif shellutils
 
 .PHONY: install-shellutils maybe-install-shellutils
 maybe-install-shellutils:
+@if shellutils
+maybe-install-shellutils: install-shellutils
 
 install-shellutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd shellutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd shellutils && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif shellutils
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-shellutils info-shellutils
 maybe-info-shellutils:
+@if shellutils
+maybe-info-shellutils: info-shellutils
 
 info-shellutils: \
     configure-shellutils 
@@ -14220,6 +17056,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14229,12 +17066,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif shellutils
 
 .PHONY: maybe-dvi-shellutils dvi-shellutils
 maybe-dvi-shellutils:
+@if shellutils
+maybe-dvi-shellutils: dvi-shellutils
 
 dvi-shellutils: \
     configure-shellutils 
@@ -14242,6 +17082,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14251,12 +17092,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif shellutils
 
 .PHONY: maybe-TAGS-shellutils TAGS-shellutils
 maybe-TAGS-shellutils:
+@if shellutils
+maybe-TAGS-shellutils: TAGS-shellutils
 
 TAGS-shellutils: \
     configure-shellutils 
@@ -14264,6 +17108,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14273,12 +17118,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif shellutils
 
 .PHONY: maybe-install-info-shellutils install-info-shellutils
 maybe-install-info-shellutils:
+@if shellutils
+maybe-install-info-shellutils: install-info-shellutils
 
 install-info-shellutils: \
     configure-shellutils \
@@ -14287,6 +17135,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14296,12 +17145,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif shellutils
 
 .PHONY: maybe-installcheck-shellutils installcheck-shellutils
 maybe-installcheck-shellutils:
+@if shellutils
+maybe-installcheck-shellutils: installcheck-shellutils
 
 installcheck-shellutils: \
     configure-shellutils 
@@ -14309,6 +17161,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14318,18 +17171,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif shellutils
 
 .PHONY: maybe-mostlyclean-shellutils mostlyclean-shellutils
 maybe-mostlyclean-shellutils:
+@if shellutils
+maybe-mostlyclean-shellutils: mostlyclean-shellutils
 
 mostlyclean-shellutils: 
 	@[ -f ./shellutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14339,18 +17196,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif shellutils
 
 .PHONY: maybe-clean-shellutils clean-shellutils
 maybe-clean-shellutils:
+@if shellutils
+maybe-clean-shellutils: clean-shellutils
 
 clean-shellutils: 
 	@[ -f ./shellutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14360,18 +17221,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif shellutils
 
 .PHONY: maybe-distclean-shellutils distclean-shellutils
 maybe-distclean-shellutils:
+@if shellutils
+maybe-distclean-shellutils: distclean-shellutils
 
 distclean-shellutils: 
 	@[ -f ./shellutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14381,18 +17246,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif shellutils
 
 .PHONY: maybe-maintainer-clean-shellutils maintainer-clean-shellutils
 maybe-maintainer-clean-shellutils:
+@if shellutils
+maybe-maintainer-clean-shellutils: maintainer-clean-shellutils
 
 maintainer-clean-shellutils: 
 	@[ -f ./shellutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14402,33 +17271,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif shellutils
 
 
 .PHONY: configure-sid maybe-configure-sid
 maybe-configure-sid:
+@if sid
+maybe-configure-sid: configure-sid
 configure-sid:
 	@test ! -f sid/Makefile || exit 0; \
 	[ -d sid ] || mkdir sid; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in sid; \
 	cd sid || exit 1; \
 	case $(srcdir) in \
@@ -14443,41 +17301,56 @@
 	    libsrcdir="$$s/sid";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif sid
 
 .PHONY: all-sid maybe-all-sid
 maybe-all-sid:
+@if sid
+maybe-all-sid: all-sid
 all-sid: configure-sid
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd sid && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd sid && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif sid
 
 .PHONY: check-sid maybe-check-sid
 maybe-check-sid:
+@if sid
+maybe-check-sid: check-sid
 
 check-sid:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd sid && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd sid && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif sid
 
 .PHONY: install-sid maybe-install-sid
 maybe-install-sid:
+@if sid
+maybe-install-sid: install-sid
 
 install-sid: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd sid && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd sid && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif sid
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-sid info-sid
 maybe-info-sid:
+@if sid
+maybe-info-sid: info-sid
 
 info-sid: \
     configure-sid 
@@ -14485,6 +17358,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14494,12 +17368,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif sid
 
 .PHONY: maybe-dvi-sid dvi-sid
 maybe-dvi-sid:
+@if sid
+maybe-dvi-sid: dvi-sid
 
 dvi-sid: \
     configure-sid 
@@ -14507,6 +17384,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14516,12 +17394,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif sid
 
 .PHONY: maybe-TAGS-sid TAGS-sid
 maybe-TAGS-sid:
+@if sid
+maybe-TAGS-sid: TAGS-sid
 
 TAGS-sid: \
     configure-sid 
@@ -14529,6 +17410,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14538,12 +17420,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif sid
 
 .PHONY: maybe-install-info-sid install-info-sid
 maybe-install-info-sid:
+@if sid
+maybe-install-info-sid: install-info-sid
 
 install-info-sid: \
     configure-sid \
@@ -14552,6 +17437,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14561,12 +17447,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif sid
 
 .PHONY: maybe-installcheck-sid installcheck-sid
 maybe-installcheck-sid:
+@if sid
+maybe-installcheck-sid: installcheck-sid
 
 installcheck-sid: \
     configure-sid 
@@ -14574,6 +17463,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14583,18 +17473,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif sid
 
 .PHONY: maybe-mostlyclean-sid mostlyclean-sid
 maybe-mostlyclean-sid:
+@if sid
+maybe-mostlyclean-sid: mostlyclean-sid
 
 mostlyclean-sid: 
 	@[ -f ./sid/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14604,18 +17498,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif sid
 
 .PHONY: maybe-clean-sid clean-sid
 maybe-clean-sid:
+@if sid
+maybe-clean-sid: clean-sid
 
 clean-sid: 
 	@[ -f ./sid/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14625,18 +17523,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif sid
 
 .PHONY: maybe-distclean-sid distclean-sid
 maybe-distclean-sid:
+@if sid
+maybe-distclean-sid: distclean-sid
 
 distclean-sid: 
 	@[ -f ./sid/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14646,18 +17548,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif sid
 
 .PHONY: maybe-maintainer-clean-sid maintainer-clean-sid
 maybe-maintainer-clean-sid:
+@if sid
+maybe-maintainer-clean-sid: maintainer-clean-sid
 
 maintainer-clean-sid: 
 	@[ -f ./sid/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14667,33 +17573,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif sid
 
 
 .PHONY: configure-sim maybe-configure-sim
 maybe-configure-sim:
+@if sim
+maybe-configure-sim: configure-sim
 configure-sim:
 	@test ! -f sim/Makefile || exit 0; \
 	[ -d sim ] || mkdir sim; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in sim; \
 	cd sim || exit 1; \
 	case $(srcdir) in \
@@ -14708,41 +17603,56 @@
 	    libsrcdir="$$s/sim";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif sim
 
 .PHONY: all-sim maybe-all-sim
 maybe-all-sim:
+@if sim
+maybe-all-sim: all-sim
 all-sim: configure-sim
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd sim && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd sim && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif sim
 
 .PHONY: check-sim maybe-check-sim
 maybe-check-sim:
+@if sim
+maybe-check-sim: check-sim
 
 check-sim:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd sim && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd sim && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif sim
 
 .PHONY: install-sim maybe-install-sim
 maybe-install-sim:
+@if sim
+maybe-install-sim: install-sim
 
 install-sim: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd sim && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd sim && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif sim
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-sim info-sim
 maybe-info-sim:
+@if sim
+maybe-info-sim: info-sim
 
 info-sim: \
     configure-sim 
@@ -14750,6 +17660,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14759,12 +17670,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif sim
 
 .PHONY: maybe-dvi-sim dvi-sim
 maybe-dvi-sim:
+@if sim
+maybe-dvi-sim: dvi-sim
 
 dvi-sim: \
     configure-sim 
@@ -14772,6 +17686,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14781,12 +17696,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif sim
 
 .PHONY: maybe-TAGS-sim TAGS-sim
 maybe-TAGS-sim:
+@if sim
+maybe-TAGS-sim: TAGS-sim
 
 TAGS-sim: \
     configure-sim 
@@ -14794,6 +17712,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14803,12 +17722,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif sim
 
 .PHONY: maybe-install-info-sim install-info-sim
 maybe-install-info-sim:
+@if sim
+maybe-install-info-sim: install-info-sim
 
 install-info-sim: \
     configure-sim \
@@ -14817,6 +17739,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14826,12 +17749,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif sim
 
 .PHONY: maybe-installcheck-sim installcheck-sim
 maybe-installcheck-sim:
+@if sim
+maybe-installcheck-sim: installcheck-sim
 
 installcheck-sim: \
     configure-sim 
@@ -14839,6 +17765,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14848,18 +17775,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif sim
 
 .PHONY: maybe-mostlyclean-sim mostlyclean-sim
 maybe-mostlyclean-sim:
+@if sim
+maybe-mostlyclean-sim: mostlyclean-sim
 
 mostlyclean-sim: 
 	@[ -f ./sim/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14869,18 +17800,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif sim
 
 .PHONY: maybe-clean-sim clean-sim
 maybe-clean-sim:
+@if sim
+maybe-clean-sim: clean-sim
 
 clean-sim: 
 	@[ -f ./sim/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14890,18 +17825,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif sim
 
 .PHONY: maybe-distclean-sim distclean-sim
 maybe-distclean-sim:
+@if sim
+maybe-distclean-sim: distclean-sim
 
 distclean-sim: 
 	@[ -f ./sim/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14911,18 +17850,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif sim
 
 .PHONY: maybe-maintainer-clean-sim maintainer-clean-sim
 maybe-maintainer-clean-sim:
+@if sim
+maybe-maintainer-clean-sim: maintainer-clean-sim
 
 maintainer-clean-sim: 
 	@[ -f ./sim/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -14932,33 +17875,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif sim
 
 
 .PHONY: configure-tar maybe-configure-tar
 maybe-configure-tar:
+@if tar
+maybe-configure-tar: configure-tar
 configure-tar:
 	@test ! -f tar/Makefile || exit 0; \
 	[ -d tar ] || mkdir tar; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in tar; \
 	cd tar || exit 1; \
 	case $(srcdir) in \
@@ -14973,41 +17905,56 @@
 	    libsrcdir="$$s/tar";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif tar
 
 .PHONY: all-tar maybe-all-tar
 maybe-all-tar:
+@if tar
+maybe-all-tar: all-tar
 all-tar: configure-tar
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tar && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd tar && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif tar
 
 .PHONY: check-tar maybe-check-tar
 maybe-check-tar:
+@if tar
+maybe-check-tar: check-tar
 
 check-tar:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tar && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd tar && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif tar
 
 .PHONY: install-tar maybe-install-tar
 maybe-install-tar:
+@if tar
+maybe-install-tar: install-tar
 
 install-tar: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tar && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd tar && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif tar
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-tar info-tar
 maybe-info-tar:
+@if tar
+maybe-info-tar: info-tar
 
 info-tar: \
     configure-tar 
@@ -15015,6 +17962,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15024,12 +17972,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif tar
 
 .PHONY: maybe-dvi-tar dvi-tar
 maybe-dvi-tar:
+@if tar
+maybe-dvi-tar: dvi-tar
 
 dvi-tar: \
     configure-tar 
@@ -15037,6 +17988,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15046,12 +17998,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif tar
 
 .PHONY: maybe-TAGS-tar TAGS-tar
 maybe-TAGS-tar:
+@if tar
+maybe-TAGS-tar: TAGS-tar
 
 TAGS-tar: \
     configure-tar 
@@ -15059,6 +18014,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15068,12 +18024,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif tar
 
 .PHONY: maybe-install-info-tar install-info-tar
 maybe-install-info-tar:
+@if tar
+maybe-install-info-tar: install-info-tar
 
 install-info-tar: \
     configure-tar \
@@ -15082,6 +18041,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15091,12 +18051,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif tar
 
 .PHONY: maybe-installcheck-tar installcheck-tar
 maybe-installcheck-tar:
+@if tar
+maybe-installcheck-tar: installcheck-tar
 
 installcheck-tar: \
     configure-tar 
@@ -15104,6 +18067,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15113,18 +18077,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif tar
 
 .PHONY: maybe-mostlyclean-tar mostlyclean-tar
 maybe-mostlyclean-tar:
+@if tar
+maybe-mostlyclean-tar: mostlyclean-tar
 
 mostlyclean-tar: 
 	@[ -f ./tar/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15134,18 +18102,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif tar
 
 .PHONY: maybe-clean-tar clean-tar
 maybe-clean-tar:
+@if tar
+maybe-clean-tar: clean-tar
 
 clean-tar: 
 	@[ -f ./tar/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15155,18 +18127,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif tar
 
 .PHONY: maybe-distclean-tar distclean-tar
 maybe-distclean-tar:
+@if tar
+maybe-distclean-tar: distclean-tar
 
 distclean-tar: 
 	@[ -f ./tar/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15176,18 +18152,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif tar
 
 .PHONY: maybe-maintainer-clean-tar maintainer-clean-tar
 maybe-maintainer-clean-tar:
+@if tar
+maybe-maintainer-clean-tar: maintainer-clean-tar
 
 maintainer-clean-tar: 
 	@[ -f ./tar/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15197,33 +18177,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif tar
 
 
 .PHONY: configure-texinfo maybe-configure-texinfo
 maybe-configure-texinfo:
+@if texinfo
+maybe-configure-texinfo: configure-texinfo
 configure-texinfo:
 	@test ! -f texinfo/Makefile || exit 0; \
 	[ -d texinfo ] || mkdir texinfo; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in texinfo; \
 	cd texinfo || exit 1; \
 	case $(srcdir) in \
@@ -15238,37 +18207,51 @@
 	    libsrcdir="$$s/texinfo";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif texinfo
 
 .PHONY: all-texinfo maybe-all-texinfo
 maybe-all-texinfo:
+@if texinfo
+maybe-all-texinfo: all-texinfo
 all-texinfo: configure-texinfo
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd texinfo && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd texinfo && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif texinfo
 
 .PHONY: check-texinfo maybe-check-texinfo
 maybe-check-texinfo:
+@if texinfo
+maybe-check-texinfo: check-texinfo
 
 check-texinfo:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd texinfo && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd texinfo && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif texinfo
 
 .PHONY: install-texinfo maybe-install-texinfo
 maybe-install-texinfo:
+@if texinfo
+maybe-install-texinfo: install-texinfo
 
 install-texinfo:
 
+@endif texinfo
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-texinfo info-texinfo
 maybe-info-texinfo:
+@if texinfo
+maybe-info-texinfo: info-texinfo
 
 info-texinfo: \
     configure-texinfo 
@@ -15276,6 +18259,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15285,12 +18269,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif texinfo
 
 .PHONY: maybe-dvi-texinfo dvi-texinfo
 maybe-dvi-texinfo:
+@if texinfo
+maybe-dvi-texinfo: dvi-texinfo
 
 dvi-texinfo: \
     configure-texinfo 
@@ -15298,6 +18285,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15307,12 +18295,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif texinfo
 
 .PHONY: maybe-TAGS-texinfo TAGS-texinfo
 maybe-TAGS-texinfo:
+@if texinfo
+maybe-TAGS-texinfo: TAGS-texinfo
 
 TAGS-texinfo: \
     configure-texinfo 
@@ -15320,6 +18311,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15329,12 +18321,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif texinfo
 
 .PHONY: maybe-install-info-texinfo install-info-texinfo
 maybe-install-info-texinfo:
+@if texinfo
+maybe-install-info-texinfo: install-info-texinfo
 
 install-info-texinfo: \
     configure-texinfo \
@@ -15343,6 +18338,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15352,12 +18348,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif texinfo
 
 .PHONY: maybe-installcheck-texinfo installcheck-texinfo
 maybe-installcheck-texinfo:
+@if texinfo
+maybe-installcheck-texinfo: installcheck-texinfo
 
 installcheck-texinfo: \
     configure-texinfo 
@@ -15365,6 +18364,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15374,18 +18374,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif texinfo
 
 .PHONY: maybe-mostlyclean-texinfo mostlyclean-texinfo
 maybe-mostlyclean-texinfo:
+@if texinfo
+maybe-mostlyclean-texinfo: mostlyclean-texinfo
 
 mostlyclean-texinfo: 
 	@[ -f ./texinfo/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15395,18 +18399,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif texinfo
 
 .PHONY: maybe-clean-texinfo clean-texinfo
 maybe-clean-texinfo:
+@if texinfo
+maybe-clean-texinfo: clean-texinfo
 
 clean-texinfo: 
 	@[ -f ./texinfo/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15416,18 +18424,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif texinfo
 
 .PHONY: maybe-distclean-texinfo distclean-texinfo
 maybe-distclean-texinfo:
+@if texinfo
+maybe-distclean-texinfo: distclean-texinfo
 
 distclean-texinfo: 
 	@[ -f ./texinfo/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15437,18 +18449,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif texinfo
 
 .PHONY: maybe-maintainer-clean-texinfo maintainer-clean-texinfo
 maybe-maintainer-clean-texinfo:
+@if texinfo
+maybe-maintainer-clean-texinfo: maintainer-clean-texinfo
 
 maintainer-clean-texinfo: 
 	@[ -f ./texinfo/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15458,33 +18474,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif texinfo
 
 
 .PHONY: configure-textutils maybe-configure-textutils
 maybe-configure-textutils:
+@if textutils
+maybe-configure-textutils: configure-textutils
 configure-textutils:
 	@test ! -f textutils/Makefile || exit 0; \
 	[ -d textutils ] || mkdir textutils; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in textutils; \
 	cd textutils || exit 1; \
 	case $(srcdir) in \
@@ -15499,41 +18504,56 @@
 	    libsrcdir="$$s/textutils";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif textutils
 
 .PHONY: all-textutils maybe-all-textutils
 maybe-all-textutils:
+@if textutils
+maybe-all-textutils: all-textutils
 all-textutils: configure-textutils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd textutils && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd textutils && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif textutils
 
 .PHONY: check-textutils maybe-check-textutils
 maybe-check-textutils:
+@if textutils
+maybe-check-textutils: check-textutils
 
 check-textutils:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd textutils && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd textutils && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif textutils
 
 .PHONY: install-textutils maybe-install-textutils
 maybe-install-textutils:
+@if textutils
+maybe-install-textutils: install-textutils
 
 install-textutils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd textutils && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd textutils && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif textutils
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-textutils info-textutils
 maybe-info-textutils:
+@if textutils
+maybe-info-textutils: info-textutils
 
 info-textutils: \
     configure-textutils 
@@ -15541,6 +18561,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15550,12 +18571,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif textutils
 
 .PHONY: maybe-dvi-textutils dvi-textutils
 maybe-dvi-textutils:
+@if textutils
+maybe-dvi-textutils: dvi-textutils
 
 dvi-textutils: \
     configure-textutils 
@@ -15563,6 +18587,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15572,12 +18597,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif textutils
 
 .PHONY: maybe-TAGS-textutils TAGS-textutils
 maybe-TAGS-textutils:
+@if textutils
+maybe-TAGS-textutils: TAGS-textutils
 
 TAGS-textutils: \
     configure-textutils 
@@ -15585,6 +18613,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15594,12 +18623,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif textutils
 
 .PHONY: maybe-install-info-textutils install-info-textutils
 maybe-install-info-textutils:
+@if textutils
+maybe-install-info-textutils: install-info-textutils
 
 install-info-textutils: \
     configure-textutils \
@@ -15608,6 +18640,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15617,12 +18650,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif textutils
 
 .PHONY: maybe-installcheck-textutils installcheck-textutils
 maybe-installcheck-textutils:
+@if textutils
+maybe-installcheck-textutils: installcheck-textutils
 
 installcheck-textutils: \
     configure-textutils 
@@ -15630,6 +18666,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15639,18 +18676,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif textutils
 
 .PHONY: maybe-mostlyclean-textutils mostlyclean-textutils
 maybe-mostlyclean-textutils:
+@if textutils
+maybe-mostlyclean-textutils: mostlyclean-textutils
 
 mostlyclean-textutils: 
 	@[ -f ./textutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15660,18 +18701,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif textutils
 
 .PHONY: maybe-clean-textutils clean-textutils
 maybe-clean-textutils:
+@if textutils
+maybe-clean-textutils: clean-textutils
 
 clean-textutils: 
 	@[ -f ./textutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15681,18 +18726,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif textutils
 
 .PHONY: maybe-distclean-textutils distclean-textutils
 maybe-distclean-textutils:
+@if textutils
+maybe-distclean-textutils: distclean-textutils
 
 distclean-textutils: 
 	@[ -f ./textutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15702,18 +18751,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif textutils
 
 .PHONY: maybe-maintainer-clean-textutils maintainer-clean-textutils
 maybe-maintainer-clean-textutils:
+@if textutils
+maybe-maintainer-clean-textutils: maintainer-clean-textutils
 
 maintainer-clean-textutils: 
 	@[ -f ./textutils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15723,33 +18776,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif textutils
 
 
 .PHONY: configure-time maybe-configure-time
 maybe-configure-time:
+@if time
+maybe-configure-time: configure-time
 configure-time:
 	@test ! -f time/Makefile || exit 0; \
 	[ -d time ] || mkdir time; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in time; \
 	cd time || exit 1; \
 	case $(srcdir) in \
@@ -15764,41 +18806,56 @@
 	    libsrcdir="$$s/time";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif time
 
 .PHONY: all-time maybe-all-time
 maybe-all-time:
+@if time
+maybe-all-time: all-time
 all-time: configure-time
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd time && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd time && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif time
 
 .PHONY: check-time maybe-check-time
 maybe-check-time:
+@if time
+maybe-check-time: check-time
 
 check-time:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd time && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd time && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif time
 
 .PHONY: install-time maybe-install-time
 maybe-install-time:
+@if time
+maybe-install-time: install-time
 
 install-time: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd time && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd time && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif time
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-time info-time
 maybe-info-time:
+@if time
+maybe-info-time: info-time
 
 info-time: \
     configure-time 
@@ -15806,6 +18863,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15815,12 +18873,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif time
 
 .PHONY: maybe-dvi-time dvi-time
 maybe-dvi-time:
+@if time
+maybe-dvi-time: dvi-time
 
 dvi-time: \
     configure-time 
@@ -15828,6 +18889,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15837,12 +18899,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif time
 
 .PHONY: maybe-TAGS-time TAGS-time
 maybe-TAGS-time:
+@if time
+maybe-TAGS-time: TAGS-time
 
 TAGS-time: \
     configure-time 
@@ -15850,6 +18915,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15859,12 +18925,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif time
 
 .PHONY: maybe-install-info-time install-info-time
 maybe-install-info-time:
+@if time
+maybe-install-info-time: install-info-time
 
 install-info-time: \
     configure-time \
@@ -15873,6 +18942,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15882,12 +18952,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif time
 
 .PHONY: maybe-installcheck-time installcheck-time
 maybe-installcheck-time:
+@if time
+maybe-installcheck-time: installcheck-time
 
 installcheck-time: \
     configure-time 
@@ -15895,6 +18968,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15904,18 +18978,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif time
 
 .PHONY: maybe-mostlyclean-time mostlyclean-time
 maybe-mostlyclean-time:
+@if time
+maybe-mostlyclean-time: mostlyclean-time
 
 mostlyclean-time: 
 	@[ -f ./time/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15925,18 +19003,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif time
 
 .PHONY: maybe-clean-time clean-time
 maybe-clean-time:
+@if time
+maybe-clean-time: clean-time
 
 clean-time: 
 	@[ -f ./time/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15946,18 +19028,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif time
 
 .PHONY: maybe-distclean-time distclean-time
 maybe-distclean-time:
+@if time
+maybe-distclean-time: distclean-time
 
 distclean-time: 
 	@[ -f ./time/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15967,18 +19053,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif time
 
 .PHONY: maybe-maintainer-clean-time maintainer-clean-time
 maybe-maintainer-clean-time:
+@if time
+maybe-maintainer-clean-time: maintainer-clean-time
 
 maintainer-clean-time: 
 	@[ -f ./time/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -15988,33 +19078,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif time
 
 
 .PHONY: configure-uudecode maybe-configure-uudecode
 maybe-configure-uudecode:
+@if uudecode
+maybe-configure-uudecode: configure-uudecode
 configure-uudecode:
 	@test ! -f uudecode/Makefile || exit 0; \
 	[ -d uudecode ] || mkdir uudecode; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in uudecode; \
 	cd uudecode || exit 1; \
 	case $(srcdir) in \
@@ -16029,41 +19108,56 @@
 	    libsrcdir="$$s/uudecode";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif uudecode
 
 .PHONY: all-uudecode maybe-all-uudecode
 maybe-all-uudecode:
+@if uudecode
+maybe-all-uudecode: all-uudecode
 all-uudecode: configure-uudecode
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd uudecode && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd uudecode && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif uudecode
 
 .PHONY: check-uudecode maybe-check-uudecode
 maybe-check-uudecode:
+@if uudecode
+maybe-check-uudecode: check-uudecode
 
 check-uudecode:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd uudecode && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd uudecode && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif uudecode
 
 .PHONY: install-uudecode maybe-install-uudecode
 maybe-install-uudecode:
+@if uudecode
+maybe-install-uudecode: install-uudecode
 
 install-uudecode: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd uudecode && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd uudecode && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif uudecode
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-uudecode info-uudecode
 maybe-info-uudecode:
+@if uudecode
+maybe-info-uudecode: info-uudecode
 
 info-uudecode: \
     configure-uudecode 
@@ -16071,6 +19165,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16080,12 +19175,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif uudecode
 
 .PHONY: maybe-dvi-uudecode dvi-uudecode
 maybe-dvi-uudecode:
+@if uudecode
+maybe-dvi-uudecode: dvi-uudecode
 
 dvi-uudecode: \
     configure-uudecode 
@@ -16093,6 +19191,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16102,12 +19201,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif uudecode
 
 .PHONY: maybe-TAGS-uudecode TAGS-uudecode
 maybe-TAGS-uudecode:
+@if uudecode
+maybe-TAGS-uudecode: TAGS-uudecode
 
 TAGS-uudecode: \
     configure-uudecode 
@@ -16115,6 +19217,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16124,12 +19227,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif uudecode
 
 .PHONY: maybe-install-info-uudecode install-info-uudecode
 maybe-install-info-uudecode:
+@if uudecode
+maybe-install-info-uudecode: install-info-uudecode
 
 install-info-uudecode: \
     configure-uudecode \
@@ -16138,6 +19244,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16147,12 +19254,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif uudecode
 
 .PHONY: maybe-installcheck-uudecode installcheck-uudecode
 maybe-installcheck-uudecode:
+@if uudecode
+maybe-installcheck-uudecode: installcheck-uudecode
 
 installcheck-uudecode: \
     configure-uudecode 
@@ -16160,6 +19270,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16169,18 +19280,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif uudecode
 
 .PHONY: maybe-mostlyclean-uudecode mostlyclean-uudecode
 maybe-mostlyclean-uudecode:
+@if uudecode
+maybe-mostlyclean-uudecode: mostlyclean-uudecode
 
 mostlyclean-uudecode: 
 	@[ -f ./uudecode/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16190,18 +19305,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif uudecode
 
 .PHONY: maybe-clean-uudecode clean-uudecode
 maybe-clean-uudecode:
+@if uudecode
+maybe-clean-uudecode: clean-uudecode
 
 clean-uudecode: 
 	@[ -f ./uudecode/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16211,18 +19330,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif uudecode
 
 .PHONY: maybe-distclean-uudecode distclean-uudecode
 maybe-distclean-uudecode:
+@if uudecode
+maybe-distclean-uudecode: distclean-uudecode
 
 distclean-uudecode: 
 	@[ -f ./uudecode/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16232,18 +19355,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif uudecode
 
 .PHONY: maybe-maintainer-clean-uudecode maintainer-clean-uudecode
 maybe-maintainer-clean-uudecode:
+@if uudecode
+maybe-maintainer-clean-uudecode: maintainer-clean-uudecode
 
 maintainer-clean-uudecode: 
 	@[ -f ./uudecode/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16253,33 +19380,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif uudecode
 
 
 .PHONY: configure-wdiff maybe-configure-wdiff
 maybe-configure-wdiff:
+@if wdiff
+maybe-configure-wdiff: configure-wdiff
 configure-wdiff:
 	@test ! -f wdiff/Makefile || exit 0; \
 	[ -d wdiff ] || mkdir wdiff; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in wdiff; \
 	cd wdiff || exit 1; \
 	case $(srcdir) in \
@@ -16294,41 +19410,56 @@
 	    libsrcdir="$$s/wdiff";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif wdiff
 
 .PHONY: all-wdiff maybe-all-wdiff
 maybe-all-wdiff:
+@if wdiff
+maybe-all-wdiff: all-wdiff
 all-wdiff: configure-wdiff
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd wdiff && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd wdiff && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif wdiff
 
 .PHONY: check-wdiff maybe-check-wdiff
 maybe-check-wdiff:
+@if wdiff
+maybe-check-wdiff: check-wdiff
 
 check-wdiff:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd wdiff && $(MAKE) $(FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd wdiff && $(MAKE) $(FLAGS_TO_PASS)  check)
 
+@endif wdiff
 
 .PHONY: install-wdiff maybe-install-wdiff
 maybe-install-wdiff:
+@if wdiff
+maybe-install-wdiff: install-wdiff
 
 install-wdiff: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd wdiff && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd wdiff && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif wdiff
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-wdiff info-wdiff
 maybe-info-wdiff:
+@if wdiff
+maybe-info-wdiff: info-wdiff
 
 info-wdiff: \
     configure-wdiff 
@@ -16336,6 +19467,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16345,12 +19477,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif wdiff
 
 .PHONY: maybe-dvi-wdiff dvi-wdiff
 maybe-dvi-wdiff:
+@if wdiff
+maybe-dvi-wdiff: dvi-wdiff
 
 dvi-wdiff: \
     configure-wdiff 
@@ -16358,6 +19493,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16367,12 +19503,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif wdiff
 
 .PHONY: maybe-TAGS-wdiff TAGS-wdiff
 maybe-TAGS-wdiff:
+@if wdiff
+maybe-TAGS-wdiff: TAGS-wdiff
 
 TAGS-wdiff: \
     configure-wdiff 
@@ -16380,6 +19519,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16389,12 +19529,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif wdiff
 
 .PHONY: maybe-install-info-wdiff install-info-wdiff
 maybe-install-info-wdiff:
+@if wdiff
+maybe-install-info-wdiff: install-info-wdiff
 
 install-info-wdiff: \
     configure-wdiff \
@@ -16403,6 +19546,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16412,12 +19556,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif wdiff
 
 .PHONY: maybe-installcheck-wdiff installcheck-wdiff
 maybe-installcheck-wdiff:
+@if wdiff
+maybe-installcheck-wdiff: installcheck-wdiff
 
 installcheck-wdiff: \
     configure-wdiff 
@@ -16425,6 +19572,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16434,18 +19582,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif wdiff
 
 .PHONY: maybe-mostlyclean-wdiff mostlyclean-wdiff
 maybe-mostlyclean-wdiff:
+@if wdiff
+maybe-mostlyclean-wdiff: mostlyclean-wdiff
 
 mostlyclean-wdiff: 
 	@[ -f ./wdiff/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16455,18 +19607,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif wdiff
 
 .PHONY: maybe-clean-wdiff clean-wdiff
 maybe-clean-wdiff:
+@if wdiff
+maybe-clean-wdiff: clean-wdiff
 
 clean-wdiff: 
 	@[ -f ./wdiff/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16476,18 +19632,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif wdiff
 
 .PHONY: maybe-distclean-wdiff distclean-wdiff
 maybe-distclean-wdiff:
+@if wdiff
+maybe-distclean-wdiff: distclean-wdiff
 
 distclean-wdiff: 
 	@[ -f ./wdiff/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16497,18 +19657,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif wdiff
 
 .PHONY: maybe-maintainer-clean-wdiff maintainer-clean-wdiff
 maybe-maintainer-clean-wdiff:
+@if wdiff
+maybe-maintainer-clean-wdiff: maintainer-clean-wdiff
 
 maintainer-clean-wdiff: 
 	@[ -f ./wdiff/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16518,33 +19682,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif wdiff
 
 
 .PHONY: configure-zip maybe-configure-zip
 maybe-configure-zip:
+@if zip
+maybe-configure-zip: configure-zip
 configure-zip:
 	@test ! -f zip/Makefile || exit 0; \
 	[ -d zip ] || mkdir zip; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in zip; \
 	cd zip || exit 1; \
 	case $(srcdir) in \
@@ -16559,19 +19712,26 @@
 	    libsrcdir="$$s/zip";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif zip
 
 .PHONY: all-zip maybe-all-zip
 maybe-all-zip:
+@if zip
+maybe-all-zip: all-zip
 all-zip: configure-zip
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd zip && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd zip && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif zip
 
 .PHONY: check-zip maybe-check-zip
 maybe-check-zip:
+@if zip
+maybe-check-zip: check-zip
 
 # This module is only tested in a native toolchain.
 check-zip:
@@ -16579,24 +19739,32 @@
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
-	  (cd zip && $(MAKE) $(FLAGS_TO_PASS) check); \
+	  $(HOST_EXPORTS) \
+	  (cd zip && $(MAKE) $(FLAGS_TO_PASS)  check); \
 	fi
 
+@endif zip
 
 .PHONY: install-zip maybe-install-zip
 maybe-install-zip:
+@if zip
+maybe-install-zip: install-zip
 
 install-zip: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd zip && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd zip && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif zip
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-zip info-zip
 maybe-info-zip:
+@if zip
+maybe-info-zip: info-zip
 
 info-zip: \
     configure-zip 
@@ -16604,6 +19772,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16613,12 +19782,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif zip
 
 .PHONY: maybe-dvi-zip dvi-zip
 maybe-dvi-zip:
+@if zip
+maybe-dvi-zip: dvi-zip
 
 dvi-zip: \
     configure-zip 
@@ -16626,6 +19798,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16635,12 +19808,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif zip
 
 .PHONY: maybe-TAGS-zip TAGS-zip
 maybe-TAGS-zip:
+@if zip
+maybe-TAGS-zip: TAGS-zip
 
 TAGS-zip: \
     configure-zip 
@@ -16648,6 +19824,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16657,12 +19834,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif zip
 
 .PHONY: maybe-install-info-zip install-info-zip
 maybe-install-info-zip:
+@if zip
+maybe-install-info-zip: install-info-zip
 
 install-info-zip: \
     configure-zip \
@@ -16671,6 +19851,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16680,12 +19861,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif zip
 
 .PHONY: maybe-installcheck-zip installcheck-zip
 maybe-installcheck-zip:
+@if zip
+maybe-installcheck-zip: installcheck-zip
 
 installcheck-zip: \
     configure-zip 
@@ -16693,6 +19877,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16702,18 +19887,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif zip
 
 .PHONY: maybe-mostlyclean-zip mostlyclean-zip
 maybe-mostlyclean-zip:
+@if zip
+maybe-mostlyclean-zip: mostlyclean-zip
 
 mostlyclean-zip: 
 	@[ -f ./zip/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16723,18 +19912,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif zip
 
 .PHONY: maybe-clean-zip clean-zip
 maybe-clean-zip:
+@if zip
+maybe-clean-zip: clean-zip
 
 clean-zip: 
 	@[ -f ./zip/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16744,18 +19937,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif zip
 
 .PHONY: maybe-distclean-zip distclean-zip
 maybe-distclean-zip:
+@if zip
+maybe-distclean-zip: distclean-zip
 
 distclean-zip: 
 	@[ -f ./zip/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16765,18 +19962,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif zip
 
 .PHONY: maybe-maintainer-clean-zip maintainer-clean-zip
 maybe-maintainer-clean-zip:
+@if zip
+maybe-maintainer-clean-zip: maintainer-clean-zip
 
 maintainer-clean-zip: 
 	@[ -f ./zip/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16786,33 +19987,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif zip
 
 
 .PHONY: configure-zlib maybe-configure-zlib
 maybe-configure-zlib:
+@if zlib
+maybe-configure-zlib: configure-zlib
 configure-zlib:
 	@test ! -f zlib/Makefile || exit 0; \
 	[ -d zlib ] || mkdir zlib; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in zlib; \
 	cd zlib || exit 1; \
 	case $(srcdir) in \
@@ -16827,33 +20017,46 @@
 	    libsrcdir="$$s/zlib";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif zlib
 
 .PHONY: all-zlib maybe-all-zlib
 maybe-all-zlib:
+@if zlib
+maybe-all-zlib: all-zlib
 all-zlib: configure-zlib
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd zlib && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd zlib && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif zlib
 
 .PHONY: check-zlib maybe-check-zlib
 maybe-check-zlib:
+@if zlib
+maybe-check-zlib: check-zlib
 
 check-zlib:
 
+@endif zlib
 
 .PHONY: install-zlib maybe-install-zlib
 maybe-install-zlib:
+@if zlib
+maybe-install-zlib: install-zlib
 
 install-zlib:
 
+@endif zlib
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-zlib info-zlib
 maybe-info-zlib:
+@if zlib
+maybe-info-zlib: info-zlib
 
 info-zlib: \
     configure-zlib 
@@ -16861,6 +20064,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16870,12 +20074,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif zlib
 
 .PHONY: maybe-dvi-zlib dvi-zlib
 maybe-dvi-zlib:
+@if zlib
+maybe-dvi-zlib: dvi-zlib
 
 dvi-zlib: \
     configure-zlib 
@@ -16883,6 +20090,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16892,12 +20100,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif zlib
 
 .PHONY: maybe-TAGS-zlib TAGS-zlib
 maybe-TAGS-zlib:
+@if zlib
+maybe-TAGS-zlib: TAGS-zlib
 
 TAGS-zlib: \
     configure-zlib 
@@ -16905,6 +20116,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16914,12 +20126,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif zlib
 
 .PHONY: maybe-install-info-zlib install-info-zlib
 maybe-install-info-zlib:
+@if zlib
+maybe-install-info-zlib: install-info-zlib
 
 install-info-zlib: \
     configure-zlib \
@@ -16928,6 +20143,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16937,12 +20153,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif zlib
 
 .PHONY: maybe-installcheck-zlib installcheck-zlib
 maybe-installcheck-zlib:
+@if zlib
+maybe-installcheck-zlib: installcheck-zlib
 
 installcheck-zlib: \
     configure-zlib 
@@ -16950,6 +20169,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16959,18 +20179,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif zlib
 
 .PHONY: maybe-mostlyclean-zlib mostlyclean-zlib
 maybe-mostlyclean-zlib:
+@if zlib
+maybe-mostlyclean-zlib: mostlyclean-zlib
 
 mostlyclean-zlib: 
 	@[ -f ./zlib/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -16980,18 +20204,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif zlib
 
 .PHONY: maybe-clean-zlib clean-zlib
 maybe-clean-zlib:
+@if zlib
+maybe-clean-zlib: clean-zlib
 
 clean-zlib: 
 	@[ -f ./zlib/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17001,18 +20229,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif zlib
 
 .PHONY: maybe-distclean-zlib distclean-zlib
 maybe-distclean-zlib:
+@if zlib
+maybe-distclean-zlib: distclean-zlib
 
 distclean-zlib: 
 	@[ -f ./zlib/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17022,18 +20254,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif zlib
 
 .PHONY: maybe-maintainer-clean-zlib maintainer-clean-zlib
 maybe-maintainer-clean-zlib:
+@if zlib
+maybe-maintainer-clean-zlib: maintainer-clean-zlib
 
 maintainer-clean-zlib: 
 	@[ -f ./zlib/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17043,33 +20279,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif zlib
 
 
 .PHONY: configure-gdb maybe-configure-gdb
 maybe-configure-gdb:
+@if gdb
+maybe-configure-gdb: configure-gdb
 configure-gdb:
 	@test ! -f gdb/Makefile || exit 0; \
 	[ -d gdb ] || mkdir gdb; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in gdb; \
 	cd gdb || exit 1; \
 	case $(srcdir) in \
@@ -17084,41 +20309,56 @@
 	    libsrcdir="$$s/gdb";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif gdb
 
 .PHONY: all-gdb maybe-all-gdb
 maybe-all-gdb:
+@if gdb
+maybe-all-gdb: all-gdb
 all-gdb: configure-gdb
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  all)
+@endif gdb
 
 .PHONY: check-gdb maybe-check-gdb
 maybe-check-gdb:
+@if gdb
+maybe-check-gdb: check-gdb
 
 check-gdb:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  check)
 
+@endif gdb
 
 .PHONY: install-gdb maybe-install-gdb
 maybe-install-gdb:
+@if gdb
+maybe-install-gdb: install-gdb
 
 install-gdb: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  install)
 
+@endif gdb
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-gdb info-gdb
 maybe-info-gdb:
+@if gdb
+maybe-info-gdb: info-gdb
 
 info-gdb: \
     configure-gdb 
@@ -17126,6 +20366,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17135,12 +20376,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif gdb
 
 .PHONY: maybe-dvi-gdb dvi-gdb
 maybe-dvi-gdb:
+@if gdb
+maybe-dvi-gdb: dvi-gdb
 
 dvi-gdb: \
     configure-gdb 
@@ -17148,6 +20392,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17157,12 +20402,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif gdb
 
 .PHONY: maybe-TAGS-gdb TAGS-gdb
 maybe-TAGS-gdb:
+@if gdb
+maybe-TAGS-gdb: TAGS-gdb
 
 TAGS-gdb: \
     configure-gdb 
@@ -17170,6 +20418,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17179,12 +20428,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif gdb
 
 .PHONY: maybe-install-info-gdb install-info-gdb
 maybe-install-info-gdb:
+@if gdb
+maybe-install-info-gdb: install-info-gdb
 
 install-info-gdb: \
     configure-gdb \
@@ -17193,6 +20445,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17202,12 +20455,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif gdb
 
 .PHONY: maybe-installcheck-gdb installcheck-gdb
 maybe-installcheck-gdb:
+@if gdb
+maybe-installcheck-gdb: installcheck-gdb
 
 installcheck-gdb: \
     configure-gdb 
@@ -17215,6 +20471,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17224,18 +20481,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif gdb
 
 .PHONY: maybe-mostlyclean-gdb mostlyclean-gdb
 maybe-mostlyclean-gdb:
+@if gdb
+maybe-mostlyclean-gdb: mostlyclean-gdb
 
 mostlyclean-gdb: 
 	@[ -f ./gdb/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17245,18 +20506,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif gdb
 
 .PHONY: maybe-clean-gdb clean-gdb
 maybe-clean-gdb:
+@if gdb
+maybe-clean-gdb: clean-gdb
 
 clean-gdb: 
 	@[ -f ./gdb/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17266,18 +20531,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif gdb
 
 .PHONY: maybe-distclean-gdb distclean-gdb
 maybe-distclean-gdb:
+@if gdb
+maybe-distclean-gdb: distclean-gdb
 
 distclean-gdb: 
 	@[ -f ./gdb/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17287,18 +20556,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif gdb
 
 .PHONY: maybe-maintainer-clean-gdb maintainer-clean-gdb
 maybe-maintainer-clean-gdb:
+@if gdb
+maybe-maintainer-clean-gdb: maintainer-clean-gdb
 
 maintainer-clean-gdb: 
 	@[ -f ./gdb/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17308,33 +20581,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif gdb
 
 
 .PHONY: configure-expect maybe-configure-expect
 maybe-configure-expect:
+@if expect
+maybe-configure-expect: configure-expect
 configure-expect:
 	@test ! -f expect/Makefile || exit 0; \
 	[ -d expect ] || mkdir expect; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in expect; \
 	cd expect || exit 1; \
 	case $(srcdir) in \
@@ -17349,41 +20611,56 @@
 	    libsrcdir="$$s/expect";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif expect
 
 .PHONY: all-expect maybe-all-expect
 maybe-all-expect:
+@if expect
+maybe-all-expect: all-expect
 all-expect: configure-expect
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  all)
+@endif expect
 
 .PHONY: check-expect maybe-check-expect
 maybe-check-expect:
+@if expect
+maybe-check-expect: check-expect
 
 check-expect:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  check)
 
+@endif expect
 
 .PHONY: install-expect maybe-install-expect
 maybe-install-expect:
+@if expect
+maybe-install-expect: install-expect
 
 install-expect: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  install)
 
+@endif expect
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-expect info-expect
 maybe-info-expect:
+@if expect
+maybe-info-expect: info-expect
 
 info-expect: \
     configure-expect 
@@ -17391,6 +20668,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17400,12 +20678,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif expect
 
 .PHONY: maybe-dvi-expect dvi-expect
 maybe-dvi-expect:
+@if expect
+maybe-dvi-expect: dvi-expect
 
 dvi-expect: \
     configure-expect 
@@ -17413,6 +20694,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17422,12 +20704,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif expect
 
 .PHONY: maybe-TAGS-expect TAGS-expect
 maybe-TAGS-expect:
+@if expect
+maybe-TAGS-expect: TAGS-expect
 
 TAGS-expect: \
     configure-expect 
@@ -17435,6 +20720,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17444,12 +20730,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif expect
 
 .PHONY: maybe-install-info-expect install-info-expect
 maybe-install-info-expect:
+@if expect
+maybe-install-info-expect: install-info-expect
 
 install-info-expect: \
     configure-expect \
@@ -17458,6 +20747,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17467,12 +20757,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif expect
 
 .PHONY: maybe-installcheck-expect installcheck-expect
 maybe-installcheck-expect:
+@if expect
+maybe-installcheck-expect: installcheck-expect
 
 installcheck-expect: \
     configure-expect 
@@ -17480,6 +20773,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17489,18 +20783,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif expect
 
 .PHONY: maybe-mostlyclean-expect mostlyclean-expect
 maybe-mostlyclean-expect:
+@if expect
+maybe-mostlyclean-expect: mostlyclean-expect
 
 mostlyclean-expect: 
 	@[ -f ./expect/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17510,18 +20808,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif expect
 
 .PHONY: maybe-clean-expect clean-expect
 maybe-clean-expect:
+@if expect
+maybe-clean-expect: clean-expect
 
 clean-expect: 
 	@[ -f ./expect/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17531,18 +20833,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif expect
 
 .PHONY: maybe-distclean-expect distclean-expect
 maybe-distclean-expect:
+@if expect
+maybe-distclean-expect: distclean-expect
 
 distclean-expect: 
 	@[ -f ./expect/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17552,18 +20858,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif expect
 
 .PHONY: maybe-maintainer-clean-expect maintainer-clean-expect
 maybe-maintainer-clean-expect:
+@if expect
+maybe-maintainer-clean-expect: maintainer-clean-expect
 
 maintainer-clean-expect: 
 	@[ -f ./expect/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17573,33 +20883,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif expect
 
 
 .PHONY: configure-guile maybe-configure-guile
 maybe-configure-guile:
+@if guile
+maybe-configure-guile: configure-guile
 configure-guile:
 	@test ! -f guile/Makefile || exit 0; \
 	[ -d guile ] || mkdir guile; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in guile; \
 	cd guile || exit 1; \
 	case $(srcdir) in \
@@ -17614,41 +20913,56 @@
 	    libsrcdir="$$s/guile";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif guile
 
 .PHONY: all-guile maybe-all-guile
 maybe-all-guile:
+@if guile
+maybe-all-guile: all-guile
 all-guile: configure-guile
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  all)
+@endif guile
 
 .PHONY: check-guile maybe-check-guile
 maybe-check-guile:
+@if guile
+maybe-check-guile: check-guile
 
 check-guile:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  check)
 
+@endif guile
 
 .PHONY: install-guile maybe-install-guile
 maybe-install-guile:
+@if guile
+maybe-install-guile: install-guile
 
 install-guile: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  install)
 
+@endif guile
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-guile info-guile
 maybe-info-guile:
+@if guile
+maybe-info-guile: info-guile
 
 info-guile: \
     configure-guile 
@@ -17656,6 +20970,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17665,12 +20980,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif guile
 
 .PHONY: maybe-dvi-guile dvi-guile
 maybe-dvi-guile:
+@if guile
+maybe-dvi-guile: dvi-guile
 
 dvi-guile: \
     configure-guile 
@@ -17678,6 +20996,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17687,12 +21006,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif guile
 
 .PHONY: maybe-TAGS-guile TAGS-guile
 maybe-TAGS-guile:
+@if guile
+maybe-TAGS-guile: TAGS-guile
 
 TAGS-guile: \
     configure-guile 
@@ -17700,6 +21022,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17709,12 +21032,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif guile
 
 .PHONY: maybe-install-info-guile install-info-guile
 maybe-install-info-guile:
+@if guile
+maybe-install-info-guile: install-info-guile
 
 install-info-guile: \
     configure-guile \
@@ -17723,6 +21049,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17732,12 +21059,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif guile
 
 .PHONY: maybe-installcheck-guile installcheck-guile
 maybe-installcheck-guile:
+@if guile
+maybe-installcheck-guile: installcheck-guile
 
 installcheck-guile: \
     configure-guile 
@@ -17745,6 +21075,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17754,18 +21085,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif guile
 
 .PHONY: maybe-mostlyclean-guile mostlyclean-guile
 maybe-mostlyclean-guile:
+@if guile
+maybe-mostlyclean-guile: mostlyclean-guile
 
 mostlyclean-guile: 
 	@[ -f ./guile/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17775,18 +21110,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif guile
 
 .PHONY: maybe-clean-guile clean-guile
 maybe-clean-guile:
+@if guile
+maybe-clean-guile: clean-guile
 
 clean-guile: 
 	@[ -f ./guile/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17796,18 +21135,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif guile
 
 .PHONY: maybe-distclean-guile distclean-guile
 maybe-distclean-guile:
+@if guile
+maybe-distclean-guile: distclean-guile
 
 distclean-guile: 
 	@[ -f ./guile/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17817,18 +21160,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif guile
 
 .PHONY: maybe-maintainer-clean-guile maintainer-clean-guile
 maybe-maintainer-clean-guile:
+@if guile
+maybe-maintainer-clean-guile: maintainer-clean-guile
 
 maintainer-clean-guile: 
 	@[ -f ./guile/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17838,33 +21185,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif guile
 
 
 .PHONY: configure-tk maybe-configure-tk
 maybe-configure-tk:
+@if tk
+maybe-configure-tk: configure-tk
 configure-tk:
 	@test ! -f tk/Makefile || exit 0; \
 	[ -d tk ] || mkdir tk; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in tk; \
 	cd tk || exit 1; \
 	case $(srcdir) in \
@@ -17879,41 +21215,56 @@
 	    libsrcdir="$$s/tk";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif tk
 
 .PHONY: all-tk maybe-all-tk
 maybe-all-tk:
+@if tk
+maybe-all-tk: all-tk
 all-tk: configure-tk
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  all)
+@endif tk
 
 .PHONY: check-tk maybe-check-tk
 maybe-check-tk:
+@if tk
+maybe-check-tk: check-tk
 
 check-tk:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  check)
 
+@endif tk
 
 .PHONY: install-tk maybe-install-tk
 maybe-install-tk:
+@if tk
+maybe-install-tk: install-tk
 
 install-tk: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  install)
 
+@endif tk
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-tk info-tk
 maybe-info-tk:
+@if tk
+maybe-info-tk: info-tk
 
 info-tk: \
     configure-tk 
@@ -17921,6 +21272,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17930,12 +21282,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif tk
 
 .PHONY: maybe-dvi-tk dvi-tk
 maybe-dvi-tk:
+@if tk
+maybe-dvi-tk: dvi-tk
 
 dvi-tk: \
     configure-tk 
@@ -17943,6 +21298,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17952,12 +21308,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif tk
 
 .PHONY: maybe-TAGS-tk TAGS-tk
 maybe-TAGS-tk:
+@if tk
+maybe-TAGS-tk: TAGS-tk
 
 TAGS-tk: \
     configure-tk 
@@ -17965,6 +21324,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17974,12 +21334,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif tk
 
 .PHONY: maybe-install-info-tk install-info-tk
 maybe-install-info-tk:
+@if tk
+maybe-install-info-tk: install-info-tk
 
 install-info-tk: \
     configure-tk \
@@ -17988,6 +21351,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -17997,12 +21361,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif tk
 
 .PHONY: maybe-installcheck-tk installcheck-tk
 maybe-installcheck-tk:
+@if tk
+maybe-installcheck-tk: installcheck-tk
 
 installcheck-tk: \
     configure-tk 
@@ -18010,6 +21377,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18019,18 +21387,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif tk
 
 .PHONY: maybe-mostlyclean-tk mostlyclean-tk
 maybe-mostlyclean-tk:
+@if tk
+maybe-mostlyclean-tk: mostlyclean-tk
 
 mostlyclean-tk: 
 	@[ -f ./tk/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18040,18 +21412,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif tk
 
 .PHONY: maybe-clean-tk clean-tk
 maybe-clean-tk:
+@if tk
+maybe-clean-tk: clean-tk
 
 clean-tk: 
 	@[ -f ./tk/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18061,18 +21437,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif tk
 
 .PHONY: maybe-distclean-tk distclean-tk
 maybe-distclean-tk:
+@if tk
+maybe-distclean-tk: distclean-tk
 
 distclean-tk: 
 	@[ -f ./tk/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18082,18 +21462,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif tk
 
 .PHONY: maybe-maintainer-clean-tk maintainer-clean-tk
 maybe-maintainer-clean-tk:
+@if tk
+maybe-maintainer-clean-tk: maintainer-clean-tk
 
 maintainer-clean-tk: 
 	@[ -f ./tk/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18103,33 +21487,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif tk
 
 
 .PHONY: configure-tix maybe-configure-tix
 maybe-configure-tix:
+@if tix
+maybe-configure-tix: configure-tix
 configure-tix:
 	@test ! -f tix/Makefile || exit 0; \
 	[ -d tix ] || mkdir tix; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in tix; \
 	cd tix || exit 1; \
 	case $(srcdir) in \
@@ -18144,41 +21517,56 @@
 	    libsrcdir="$$s/tix";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif tix
 
 .PHONY: all-tix maybe-all-tix
 maybe-all-tix:
+@if tix
+maybe-all-tix: all-tix
 all-tix: configure-tix
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  all)
+@endif tix
 
 .PHONY: check-tix maybe-check-tix
 maybe-check-tix:
+@if tix
+maybe-check-tix: check-tix
 
 check-tix:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check)
+	$(HOST_EXPORTS) \
+	(cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  check)
 
+@endif tix
 
 .PHONY: install-tix maybe-install-tix
 maybe-install-tix:
+@if tix
+maybe-install-tix: install-tix
 
 install-tix: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS)  install)
 
+@endif tix
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-tix info-tix
 maybe-info-tix:
+@if tix
+maybe-info-tix: info-tix
 
 info-tix: \
     configure-tix 
@@ -18186,6 +21574,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18195,12 +21584,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif tix
 
 .PHONY: maybe-dvi-tix dvi-tix
 maybe-dvi-tix:
+@if tix
+maybe-dvi-tix: dvi-tix
 
 dvi-tix: \
     configure-tix 
@@ -18208,6 +21600,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18217,12 +21610,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif tix
 
 .PHONY: maybe-TAGS-tix TAGS-tix
 maybe-TAGS-tix:
+@if tix
+maybe-TAGS-tix: TAGS-tix
 
 TAGS-tix: \
     configure-tix 
@@ -18230,6 +21626,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18239,12 +21636,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif tix
 
 .PHONY: maybe-install-info-tix install-info-tix
 maybe-install-info-tix:
+@if tix
+maybe-install-info-tix: install-info-tix
 
 install-info-tix: \
     configure-tix \
@@ -18253,6 +21653,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18262,12 +21663,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif tix
 
 .PHONY: maybe-installcheck-tix installcheck-tix
 maybe-installcheck-tix:
+@if tix
+maybe-installcheck-tix: installcheck-tix
 
 installcheck-tix: \
     configure-tix 
@@ -18275,6 +21679,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18284,18 +21689,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif tix
 
 .PHONY: maybe-mostlyclean-tix mostlyclean-tix
 maybe-mostlyclean-tix:
+@if tix
+maybe-mostlyclean-tix: mostlyclean-tix
 
 mostlyclean-tix: 
 	@[ -f ./tix/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18305,18 +21714,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif tix
 
 .PHONY: maybe-clean-tix clean-tix
 maybe-clean-tix:
+@if tix
+maybe-clean-tix: clean-tix
 
 clean-tix: 
 	@[ -f ./tix/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18326,18 +21739,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif tix
 
 .PHONY: maybe-distclean-tix distclean-tix
 maybe-distclean-tix:
+@if tix
+maybe-distclean-tix: distclean-tix
 
 distclean-tix: 
 	@[ -f ./tix/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18347,18 +21764,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif tix
 
 .PHONY: maybe-maintainer-clean-tix maintainer-clean-tix
 maybe-maintainer-clean-tix:
+@if tix
+maybe-maintainer-clean-tix: maintainer-clean-tix
 
 maintainer-clean-tix: 
 	@[ -f ./tix/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18368,33 +21789,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif tix
 
 
 .PHONY: configure-libtermcap maybe-configure-libtermcap
 maybe-configure-libtermcap:
+@if libtermcap
+maybe-configure-libtermcap: configure-libtermcap
 configure-libtermcap:
 	@test ! -f libtermcap/Makefile || exit 0; \
 	[ -d libtermcap ] || mkdir libtermcap; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in libtermcap; \
 	cd libtermcap || exit 1; \
 	case $(srcdir) in \
@@ -18409,37 +21819,51 @@
 	    libsrcdir="$$s/libtermcap";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif libtermcap
 
 .PHONY: all-libtermcap maybe-all-libtermcap
 maybe-all-libtermcap:
+@if libtermcap
+maybe-all-libtermcap: all-libtermcap
 all-libtermcap: configure-libtermcap
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd libtermcap && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif libtermcap
 
 .PHONY: check-libtermcap maybe-check-libtermcap
 maybe-check-libtermcap:
+@if libtermcap
+maybe-check-libtermcap: check-libtermcap
 
 check-libtermcap:
 
+@endif libtermcap
 
 .PHONY: install-libtermcap maybe-install-libtermcap
 maybe-install-libtermcap:
+@if libtermcap
+maybe-install-libtermcap: install-libtermcap
 
 install-libtermcap: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd libtermcap && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif libtermcap
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-libtermcap info-libtermcap
 maybe-info-libtermcap:
+@if libtermcap
+maybe-info-libtermcap: info-libtermcap
 
 info-libtermcap: \
     configure-libtermcap 
@@ -18447,6 +21871,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18456,12 +21881,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif libtermcap
 
 .PHONY: maybe-dvi-libtermcap dvi-libtermcap
 maybe-dvi-libtermcap:
+@if libtermcap
+maybe-dvi-libtermcap: dvi-libtermcap
 
 dvi-libtermcap: \
     configure-libtermcap 
@@ -18469,6 +21897,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18478,12 +21907,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif libtermcap
 
 .PHONY: maybe-TAGS-libtermcap TAGS-libtermcap
 maybe-TAGS-libtermcap:
+@if libtermcap
+maybe-TAGS-libtermcap: TAGS-libtermcap
 
 TAGS-libtermcap: \
     configure-libtermcap 
@@ -18491,6 +21923,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18500,12 +21933,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif libtermcap
 
 .PHONY: maybe-install-info-libtermcap install-info-libtermcap
 maybe-install-info-libtermcap:
+@if libtermcap
+maybe-install-info-libtermcap: install-info-libtermcap
 
 install-info-libtermcap: \
     configure-libtermcap \
@@ -18514,6 +21950,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18523,12 +21960,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif libtermcap
 
 .PHONY: maybe-installcheck-libtermcap installcheck-libtermcap
 maybe-installcheck-libtermcap:
+@if libtermcap
+maybe-installcheck-libtermcap: installcheck-libtermcap
 
 installcheck-libtermcap: \
     configure-libtermcap 
@@ -18536,6 +21976,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18545,61 +21986,62 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif libtermcap
 
 .PHONY: maybe-mostlyclean-libtermcap mostlyclean-libtermcap
 maybe-mostlyclean-libtermcap:
+@if libtermcap
+maybe-mostlyclean-libtermcap: mostlyclean-libtermcap
 
 # libtermcap doesn't support mostlyclean.
 mostlyclean-libtermcap:
 
+@endif libtermcap
 
 .PHONY: maybe-clean-libtermcap clean-libtermcap
 maybe-clean-libtermcap:
+@if libtermcap
+maybe-clean-libtermcap: clean-libtermcap
 
 # libtermcap doesn't support clean.
 clean-libtermcap:
 
+@endif libtermcap
 
 .PHONY: maybe-distclean-libtermcap distclean-libtermcap
 maybe-distclean-libtermcap:
+@if libtermcap
+maybe-distclean-libtermcap: distclean-libtermcap
 
 # libtermcap doesn't support distclean.
 distclean-libtermcap:
 
+@endif libtermcap
 
 .PHONY: maybe-maintainer-clean-libtermcap maintainer-clean-libtermcap
 maybe-maintainer-clean-libtermcap:
+@if libtermcap
+maybe-maintainer-clean-libtermcap: maintainer-clean-libtermcap
 
 # libtermcap doesn't support maintainer-clean.
 maintainer-clean-libtermcap:
 
+@endif libtermcap
 
 
 .PHONY: configure-utils maybe-configure-utils
 maybe-configure-utils:
+@if utils
+maybe-configure-utils: configure-utils
 configure-utils:
 	@test ! -f utils/Makefile || exit 0; \
 	[ -d utils ] || mkdir utils; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in utils; \
 	cd utils || exit 1; \
 	case $(srcdir) in \
@@ -18614,37 +22056,51 @@
 	    libsrcdir="$$s/utils";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption}  \
 	  || exit 1
+@endif utils
 
 .PHONY: all-utils maybe-all-utils
 maybe-all-utils:
+@if utils
+maybe-all-utils: all-utils
 all-utils: configure-utils
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd utils && $(MAKE) $(FLAGS_TO_PASS) all)
+	$(HOST_EXPORTS) \
+	(cd utils && $(MAKE) $(FLAGS_TO_PASS)  all)
+@endif utils
 
 .PHONY: check-utils maybe-check-utils
 maybe-check-utils:
+@if utils
+maybe-check-utils: check-utils
 
 check-utils:
 
+@endif utils
 
 .PHONY: install-utils maybe-install-utils
 maybe-install-utils:
+@if utils
+maybe-install-utils: install-utils
 
 install-utils: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd utils && $(MAKE) $(FLAGS_TO_PASS) install)
+	$(HOST_EXPORTS) \
+	(cd utils && $(MAKE) $(FLAGS_TO_PASS)  install)
 
+@endif utils
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-utils info-utils
 maybe-info-utils:
+@if utils
+maybe-info-utils: info-utils
 
 info-utils: \
     configure-utils 
@@ -18652,6 +22108,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18661,12 +22118,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif utils
 
 .PHONY: maybe-dvi-utils dvi-utils
 maybe-dvi-utils:
+@if utils
+maybe-dvi-utils: dvi-utils
 
 dvi-utils: \
     configure-utils 
@@ -18674,6 +22134,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18683,12 +22144,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif utils
 
 .PHONY: maybe-TAGS-utils TAGS-utils
 maybe-TAGS-utils:
+@if utils
+maybe-TAGS-utils: TAGS-utils
 
 TAGS-utils: \
     configure-utils 
@@ -18696,6 +22160,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18705,12 +22170,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif utils
 
 .PHONY: maybe-install-info-utils install-info-utils
 maybe-install-info-utils:
+@if utils
+maybe-install-info-utils: install-info-utils
 
 install-info-utils: \
     configure-utils \
@@ -18719,6 +22187,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18728,12 +22197,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif utils
 
 .PHONY: maybe-installcheck-utils installcheck-utils
 maybe-installcheck-utils:
+@if utils
+maybe-installcheck-utils: installcheck-utils
 
 installcheck-utils: \
     configure-utils 
@@ -18741,6 +22213,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18750,18 +22223,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif utils
 
 .PHONY: maybe-mostlyclean-utils mostlyclean-utils
 maybe-mostlyclean-utils:
+@if utils
+maybe-mostlyclean-utils: mostlyclean-utils
 
 mostlyclean-utils: 
 	@[ -f ./utils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18771,18 +22248,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif utils
 
 .PHONY: maybe-clean-utils clean-utils
 maybe-clean-utils:
+@if utils
+maybe-clean-utils: clean-utils
 
 clean-utils: 
 	@[ -f ./utils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18792,18 +22273,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif utils
 
 .PHONY: maybe-distclean-utils distclean-utils
 maybe-distclean-utils:
+@if utils
+maybe-distclean-utils: distclean-utils
 
 distclean-utils: 
 	@[ -f ./utils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18813,18 +22298,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif utils
 
 .PHONY: maybe-maintainer-clean-utils maintainer-clean-utils
 maybe-maintainer-clean-utils:
+@if utils
+maybe-maintainer-clean-utils: maintainer-clean-utils
 
 maintainer-clean-utils: 
 	@[ -f ./utils/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -18834,9 +22323,10 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif utils
 
 
 
@@ -18846,6 +22336,8 @@
 
 .PHONY: configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3
 maybe-configure-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-configure-target-libstdc++-v3: configure-target-libstdc++-v3
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/libstdc++-v3/multilib.out: multilib.out
@@ -18859,22 +22351,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libstdc++-v3; \
 	cd "$(TARGET_SUBDIR)/libstdc++-v3" || exit 1; \
 	case $(srcdir) in \
@@ -18891,44 +22368,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-libstdc++-v3
 
 .PHONY: all-target-libstdc++-v3 maybe-all-target-libstdc++-v3
 maybe-all-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-all-target-libstdc++-v3: all-target-libstdc++-v3
 all-target-libstdc++-v3: configure-target-libstdc++-v3
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libstdc++-v3 && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   all)
+@endif target-libstdc++-v3
 
 .PHONY: check-target-libstdc++-v3 maybe-check-target-libstdc++-v3
 maybe-check-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-check-target-libstdc++-v3: check-target-libstdc++-v3
 
 check-target-libstdc++-v3:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libstdc++-v3 && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   check)
 
+@endif target-libstdc++-v3
 
 .PHONY: install-target-libstdc++-v3 maybe-install-target-libstdc++-v3
 maybe-install-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-install-target-libstdc++-v3: install-target-libstdc++-v3
 
 install-target-libstdc++-v3: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libstdc++-v3 && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-libstdc++-v3
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-libstdc++-v3 info-target-libstdc++-v3
 maybe-info-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-info-target-libstdc++-v3: info-target-libstdc++-v3
 
 info-target-libstdc++-v3: \
     configure-target-libstdc++-v3 
@@ -18936,6 +22428,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -18945,12 +22438,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-libstdc++-v3
 
 .PHONY: maybe-dvi-target-libstdc++-v3 dvi-target-libstdc++-v3
 maybe-dvi-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-dvi-target-libstdc++-v3: dvi-target-libstdc++-v3
 
 dvi-target-libstdc++-v3: \
     configure-target-libstdc++-v3 
@@ -18958,6 +22454,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -18967,12 +22464,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-libstdc++-v3
 
 .PHONY: maybe-TAGS-target-libstdc++-v3 TAGS-target-libstdc++-v3
 maybe-TAGS-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-TAGS-target-libstdc++-v3: TAGS-target-libstdc++-v3
 
 TAGS-target-libstdc++-v3: \
     configure-target-libstdc++-v3 
@@ -18980,6 +22480,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -18989,12 +22490,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-libstdc++-v3
 
 .PHONY: maybe-install-info-target-libstdc++-v3 install-info-target-libstdc++-v3
 maybe-install-info-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-install-info-target-libstdc++-v3: install-info-target-libstdc++-v3
 
 install-info-target-libstdc++-v3: \
     configure-target-libstdc++-v3 \
@@ -19003,6 +22507,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19012,12 +22517,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-libstdc++-v3
 
 .PHONY: maybe-installcheck-target-libstdc++-v3 installcheck-target-libstdc++-v3
 maybe-installcheck-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-installcheck-target-libstdc++-v3: installcheck-target-libstdc++-v3
 
 installcheck-target-libstdc++-v3: \
     configure-target-libstdc++-v3 
@@ -19025,6 +22533,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19034,18 +22543,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-libstdc++-v3
 
 .PHONY: maybe-mostlyclean-target-libstdc++-v3 mostlyclean-target-libstdc++-v3
 maybe-mostlyclean-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-mostlyclean-target-libstdc++-v3: mostlyclean-target-libstdc++-v3
 
 mostlyclean-target-libstdc++-v3: 
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19055,18 +22568,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-libstdc++-v3
 
 .PHONY: maybe-clean-target-libstdc++-v3 clean-target-libstdc++-v3
 maybe-clean-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-clean-target-libstdc++-v3: clean-target-libstdc++-v3
 
 clean-target-libstdc++-v3: 
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19076,18 +22593,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-libstdc++-v3
 
 .PHONY: maybe-distclean-target-libstdc++-v3 distclean-target-libstdc++-v3
 maybe-distclean-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-distclean-target-libstdc++-v3: distclean-target-libstdc++-v3
 
 distclean-target-libstdc++-v3: 
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19097,18 +22618,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-libstdc++-v3
 
 .PHONY: maybe-maintainer-clean-target-libstdc++-v3 maintainer-clean-target-libstdc++-v3
 maybe-maintainer-clean-target-libstdc++-v3:
+@if target-libstdc++-v3
+maybe-maintainer-clean-target-libstdc++-v3: maintainer-clean-target-libstdc++-v3
 
 maintainer-clean-target-libstdc++-v3: 
 	@[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19118,13 +22643,331 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-libstdc++-v3
+
+
+.PHONY: configure-target-libmudflap maybe-configure-target-libmudflap
+maybe-configure-target-libmudflap:
+@if target-libmudflap
+maybe-configure-target-libmudflap: configure-target-libmudflap
+
+# There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
+$(TARGET_SUBDIR)/libmudflap/multilib.out: multilib.out
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libmudflap ; \
+	rm -f $(TARGET_SUBDIR)/libmudflap/Makefile || : ; \
+	cp multilib.out $(TARGET_SUBDIR)/libmudflap/multilib.out
+
+configure-target-libmudflap: $(TARGET_SUBDIR)/libmudflap/multilib.out
+	@test ! -f $(TARGET_SUBDIR)/libmudflap/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libmudflap ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo Configuring in $(TARGET_SUBDIR)/libmudflap; \
+	cd "$(TARGET_SUBDIR)/libmudflap" || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) \
+	    topdir=$(srcdir) ;; \
+	  *) \
+	    case "$(TARGET_SUBDIR)" in \
+	      .) topdir="../$(srcdir)" ;; \
+	      *) topdir="../../$(srcdir)" ;; \
+	    esac ;; \
+	esac; \
+	  srcdiroption="--srcdir=$${topdir}/libmudflap"; \
+	  libsrcdir="$$s/libmudflap"; \
+	rm -f no-such-file || : ; \
+	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
+	  $(TARGET_CONFIGARGS) $${srcdiroption} \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
+	  || exit 1
+@endif target-libmudflap
+
+.PHONY: all-target-libmudflap maybe-all-target-libmudflap
+maybe-all-target-libmudflap:
+@if target-libmudflap
+maybe-all-target-libmudflap: all-target-libmudflap
+all-target-libmudflap: configure-target-libmudflap
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-libmudflap
+
+.PHONY: check-target-libmudflap maybe-check-target-libmudflap
+maybe-check-target-libmudflap:
+@if target-libmudflap
+maybe-check-target-libmudflap: check-target-libmudflap
+
+check-target-libmudflap:
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
+
+@endif target-libmudflap
+
+.PHONY: install-target-libmudflap maybe-install-target-libmudflap
+maybe-install-target-libmudflap:
+@if target-libmudflap
+maybe-install-target-libmudflap: install-target-libmudflap
+
+install-target-libmudflap: installdirs
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
+
+@endif target-libmudflap
+
+# Other targets (info, dvi, etc.)
+
+.PHONY: maybe-info-target-libmudflap info-target-libmudflap
+maybe-info-target-libmudflap:
+@if target-libmudflap
+maybe-info-target-libmudflap: info-target-libmudflap
+
+info-target-libmudflap: \
+    configure-target-libmudflap 
+	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing info in $(TARGET_SUBDIR)/libmudflap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           info) \
+	  || exit 1
+
+@endif target-libmudflap
+
+.PHONY: maybe-dvi-target-libmudflap dvi-target-libmudflap
+maybe-dvi-target-libmudflap:
+@if target-libmudflap
+maybe-dvi-target-libmudflap: dvi-target-libmudflap
+
+dvi-target-libmudflap: \
+    configure-target-libmudflap 
+	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing dvi in $(TARGET_SUBDIR)/libmudflap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           dvi) \
+	  || exit 1
+
+@endif target-libmudflap
+
+.PHONY: maybe-TAGS-target-libmudflap TAGS-target-libmudflap
+maybe-TAGS-target-libmudflap:
+@if target-libmudflap
+maybe-TAGS-target-libmudflap: TAGS-target-libmudflap
+
+TAGS-target-libmudflap: \
+    configure-target-libmudflap 
+	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing TAGS in $(TARGET_SUBDIR)/libmudflap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           TAGS) \
+	  || exit 1
+
+@endif target-libmudflap
+
+.PHONY: maybe-install-info-target-libmudflap install-info-target-libmudflap
+maybe-install-info-target-libmudflap:
+@if target-libmudflap
+maybe-install-info-target-libmudflap: install-info-target-libmudflap
+
+install-info-target-libmudflap: \
+    configure-target-libmudflap \
+    info-target-libmudflap 
+	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-info in $(TARGET_SUBDIR)/libmudflap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           install-info) \
+	  || exit 1
+
+@endif target-libmudflap
+
+.PHONY: maybe-installcheck-target-libmudflap installcheck-target-libmudflap
+maybe-installcheck-target-libmudflap:
+@if target-libmudflap
+maybe-installcheck-target-libmudflap: installcheck-target-libmudflap
+
+installcheck-target-libmudflap: \
+    configure-target-libmudflap 
+	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing installcheck in $(TARGET_SUBDIR)/libmudflap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           installcheck) \
+	  || exit 1
+
+@endif target-libmudflap
+
+.PHONY: maybe-mostlyclean-target-libmudflap mostlyclean-target-libmudflap
+maybe-mostlyclean-target-libmudflap:
+@if target-libmudflap
+maybe-mostlyclean-target-libmudflap: mostlyclean-target-libmudflap
+
+mostlyclean-target-libmudflap: 
+	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libmudflap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           mostlyclean) \
+	  || exit 1
+
+@endif target-libmudflap
+
+.PHONY: maybe-clean-target-libmudflap clean-target-libmudflap
+maybe-clean-target-libmudflap:
+@if target-libmudflap
+maybe-clean-target-libmudflap: clean-target-libmudflap
+
+clean-target-libmudflap: 
+	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing clean in $(TARGET_SUBDIR)/libmudflap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           clean) \
+	  || exit 1
+
+@endif target-libmudflap
+
+.PHONY: maybe-distclean-target-libmudflap distclean-target-libmudflap
+maybe-distclean-target-libmudflap:
+@if target-libmudflap
+maybe-distclean-target-libmudflap: distclean-target-libmudflap
+
+distclean-target-libmudflap: 
+	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing distclean in $(TARGET_SUBDIR)/libmudflap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           distclean) \
+	  || exit 1
+
+@endif target-libmudflap
+
+.PHONY: maybe-maintainer-clean-target-libmudflap maintainer-clean-target-libmudflap
+maybe-maintainer-clean-target-libmudflap:
+@if target-libmudflap
+maybe-maintainer-clean-target-libmudflap: maintainer-clean-target-libmudflap
+
+maintainer-clean-target-libmudflap: 
+	@[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libmudflap" ; \
+	for flag in $(EXTRA_TARGET_FLAGS); do \
+	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
+	done; \
+	(cd $(TARGET_SUBDIR)/libmudflap && \
+	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
+	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
+	          "RANLIB=$${RANLIB}" \
+	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
+	           maintainer-clean) \
+	  || exit 1
+
+@endif target-libmudflap
 
 
 .PHONY: configure-target-newlib maybe-configure-target-newlib
 maybe-configure-target-newlib:
+@if target-newlib
+maybe-configure-target-newlib: configure-target-newlib
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/newlib/multilib.out: multilib.out
@@ -19138,21 +22981,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/newlib; \
 	cd "$(TARGET_SUBDIR)/newlib" || exit 1; \
 	case $(srcdir) in \
@@ -19169,44 +22998,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-newlib
 
 .PHONY: all-target-newlib maybe-all-target-newlib
 maybe-all-target-newlib:
+@if target-newlib
+maybe-all-target-newlib: all-target-newlib
 all-target-newlib: configure-target-newlib
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/newlib && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-newlib
 
 .PHONY: check-target-newlib maybe-check-target-newlib
 maybe-check-target-newlib:
+@if target-newlib
+maybe-check-target-newlib: check-target-newlib
 
 check-target-newlib:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/newlib && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-newlib
 
 .PHONY: install-target-newlib maybe-install-target-newlib
 maybe-install-target-newlib:
+@if target-newlib
+maybe-install-target-newlib: install-target-newlib
 
 install-target-newlib: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/newlib && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-newlib
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-newlib info-target-newlib
 maybe-info-target-newlib:
+@if target-newlib
+maybe-info-target-newlib: info-target-newlib
 
 info-target-newlib: \
     configure-target-newlib 
@@ -19214,6 +23058,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19223,12 +23068,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-newlib
 
 .PHONY: maybe-dvi-target-newlib dvi-target-newlib
 maybe-dvi-target-newlib:
+@if target-newlib
+maybe-dvi-target-newlib: dvi-target-newlib
 
 dvi-target-newlib: \
     configure-target-newlib 
@@ -19236,6 +23084,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19245,12 +23094,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-newlib
 
 .PHONY: maybe-TAGS-target-newlib TAGS-target-newlib
 maybe-TAGS-target-newlib:
+@if target-newlib
+maybe-TAGS-target-newlib: TAGS-target-newlib
 
 TAGS-target-newlib: \
     configure-target-newlib 
@@ -19258,6 +23110,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19267,12 +23120,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-newlib
 
 .PHONY: maybe-install-info-target-newlib install-info-target-newlib
 maybe-install-info-target-newlib:
+@if target-newlib
+maybe-install-info-target-newlib: install-info-target-newlib
 
 install-info-target-newlib: \
     configure-target-newlib \
@@ -19281,6 +23137,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19290,12 +23147,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-newlib
 
 .PHONY: maybe-installcheck-target-newlib installcheck-target-newlib
 maybe-installcheck-target-newlib:
+@if target-newlib
+maybe-installcheck-target-newlib: installcheck-target-newlib
 
 installcheck-target-newlib: \
     configure-target-newlib 
@@ -19303,6 +23163,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19312,18 +23173,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-newlib
 
 .PHONY: maybe-mostlyclean-target-newlib mostlyclean-target-newlib
 maybe-mostlyclean-target-newlib:
+@if target-newlib
+maybe-mostlyclean-target-newlib: mostlyclean-target-newlib
 
 mostlyclean-target-newlib: 
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19333,18 +23198,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-newlib
 
 .PHONY: maybe-clean-target-newlib clean-target-newlib
 maybe-clean-target-newlib:
+@if target-newlib
+maybe-clean-target-newlib: clean-target-newlib
 
 clean-target-newlib: 
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19354,18 +23223,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-newlib
 
 .PHONY: maybe-distclean-target-newlib distclean-target-newlib
 maybe-distclean-target-newlib:
+@if target-newlib
+maybe-distclean-target-newlib: distclean-target-newlib
 
 distclean-target-newlib: 
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19375,18 +23248,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-newlib
 
 .PHONY: maybe-maintainer-clean-target-newlib maintainer-clean-target-newlib
 maybe-maintainer-clean-target-newlib:
+@if target-newlib
+maybe-maintainer-clean-target-newlib: maintainer-clean-target-newlib
 
 maintainer-clean-target-newlib: 
 	@[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/newlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19396,43 +23273,32 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-newlib
 
 
-.PHONY: configure-target-libf2c maybe-configure-target-libf2c
-maybe-configure-target-libf2c:
+.PHONY: configure-target-libgfortran maybe-configure-target-libgfortran
+maybe-configure-target-libgfortran:
+@if target-libgfortran
+maybe-configure-target-libgfortran: configure-target-libgfortran
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
-$(TARGET_SUBDIR)/libf2c/multilib.out: multilib.out
-	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libf2c ; \
-	rm -f $(TARGET_SUBDIR)/libf2c/Makefile || : ; \
-	cp multilib.out $(TARGET_SUBDIR)/libf2c/multilib.out
+$(TARGET_SUBDIR)/libgfortran/multilib.out: multilib.out
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgfortran ; \
+	rm -f $(TARGET_SUBDIR)/libgfortran/Makefile || : ; \
+	cp multilib.out $(TARGET_SUBDIR)/libgfortran/multilib.out
 
-configure-target-libf2c: $(TARGET_SUBDIR)/libf2c/multilib.out
-	@test ! -f $(TARGET_SUBDIR)/libf2c/Makefile || exit 0; \
-	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libf2c ; \
+configure-target-libgfortran: $(TARGET_SUBDIR)/libgfortran/multilib.out
+	@test ! -f $(TARGET_SUBDIR)/libgfortran/Makefile || exit 0; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgfortran ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
-	echo Configuring in $(TARGET_SUBDIR)/libf2c; \
-	cd "$(TARGET_SUBDIR)/libf2c" || exit 1; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo Configuring in $(TARGET_SUBDIR)/libgfortran; \
+	cd "$(TARGET_SUBDIR)/libgfortran" || exit 1; \
 	case $(srcdir) in \
 	  /* | [A-Za-z]:[\\/]*) \
 	    topdir=$(srcdir) ;; \
@@ -19442,245 +23308,296 @@
 	      *) topdir="../../$(srcdir)" ;; \
 	    esac ;; \
 	esac; \
-	  srcdiroption="--srcdir=$${topdir}/libf2c"; \
-	  libsrcdir="$$s/libf2c"; \
+	  srcdiroption="--srcdir=$${topdir}/libgfortran"; \
+	  libsrcdir="$$s/libgfortran"; \
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-libgfortran
 
-.PHONY: all-target-libf2c maybe-all-target-libf2c
-maybe-all-target-libf2c:
-all-target-libf2c: configure-target-libf2c
+.PHONY: all-target-libgfortran maybe-all-target-libgfortran
+maybe-all-target-libgfortran:
+@if target-libgfortran
+maybe-all-target-libgfortran: all-target-libgfortran
+all-target-libgfortran: configure-target-libgfortran
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd $(TARGET_SUBDIR)/libf2c && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	$(NORMAL_TARGET_EXPORTS) \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-libgfortran
 
-.PHONY: check-target-libf2c maybe-check-target-libf2c
-maybe-check-target-libf2c:
+.PHONY: check-target-libgfortran maybe-check-target-libgfortran
+maybe-check-target-libgfortran:
+@if target-libgfortran
+maybe-check-target-libgfortran: check-target-libgfortran
 
-check-target-libf2c:
+check-target-libgfortran:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd $(TARGET_SUBDIR)/libf2c && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	$(NORMAL_TARGET_EXPORTS) \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-libgfortran
 
-.PHONY: install-target-libf2c maybe-install-target-libf2c
-maybe-install-target-libf2c:
+.PHONY: install-target-libgfortran maybe-install-target-libgfortran
+maybe-install-target-libgfortran:
+@if target-libgfortran
+maybe-install-target-libgfortran: install-target-libgfortran
 
-install-target-libf2c: installdirs
+install-target-libgfortran: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	(cd $(TARGET_SUBDIR)/libf2c && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	$(NORMAL_TARGET_EXPORTS) \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-libgfortran
 
 # Other targets (info, dvi, etc.)
 
-.PHONY: maybe-info-target-libf2c info-target-libf2c
-maybe-info-target-libf2c:
+.PHONY: maybe-info-target-libgfortran info-target-libgfortran
+maybe-info-target-libgfortran:
+@if target-libgfortran
+maybe-info-target-libgfortran: info-target-libgfortran
 
-info-target-libf2c: \
-    configure-target-libf2c 
-	@[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \
+info-target-libgfortran: \
+    configure-target-libgfortran 
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	echo "Doing info in $(TARGET_SUBDIR)/libf2c" ; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing info in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
-	(cd $(TARGET_SUBDIR)/libf2c && \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-libgfortran
 
-.PHONY: maybe-dvi-target-libf2c dvi-target-libf2c
-maybe-dvi-target-libf2c:
+.PHONY: maybe-dvi-target-libgfortran dvi-target-libgfortran
+maybe-dvi-target-libgfortran:
+@if target-libgfortran
+maybe-dvi-target-libgfortran: dvi-target-libgfortran
 
-dvi-target-libf2c: \
-    configure-target-libf2c 
-	@[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \
+dvi-target-libgfortran: \
+    configure-target-libgfortran 
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	echo "Doing dvi in $(TARGET_SUBDIR)/libf2c" ; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing dvi in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
-	(cd $(TARGET_SUBDIR)/libf2c && \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-libgfortran
 
-.PHONY: maybe-TAGS-target-libf2c TAGS-target-libf2c
-maybe-TAGS-target-libf2c:
+.PHONY: maybe-TAGS-target-libgfortran TAGS-target-libgfortran
+maybe-TAGS-target-libgfortran:
+@if target-libgfortran
+maybe-TAGS-target-libgfortran: TAGS-target-libgfortran
 
-TAGS-target-libf2c: \
-    configure-target-libf2c 
-	@[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \
+TAGS-target-libgfortran: \
+    configure-target-libgfortran 
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	echo "Doing TAGS in $(TARGET_SUBDIR)/libf2c" ; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing TAGS in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
-	(cd $(TARGET_SUBDIR)/libf2c && \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-libgfortran
 
-.PHONY: maybe-install-info-target-libf2c install-info-target-libf2c
-maybe-install-info-target-libf2c:
+.PHONY: maybe-install-info-target-libgfortran install-info-target-libgfortran
+maybe-install-info-target-libgfortran:
+@if target-libgfortran
+maybe-install-info-target-libgfortran: install-info-target-libgfortran
 
-install-info-target-libf2c: \
-    configure-target-libf2c \
-    info-target-libf2c 
-	@[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \
+install-info-target-libgfortran: \
+    configure-target-libgfortran \
+    info-target-libgfortran 
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	echo "Doing install-info in $(TARGET_SUBDIR)/libf2c" ; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing install-info in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
-	(cd $(TARGET_SUBDIR)/libf2c && \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-libgfortran
 
-.PHONY: maybe-installcheck-target-libf2c installcheck-target-libf2c
-maybe-installcheck-target-libf2c:
+.PHONY: maybe-installcheck-target-libgfortran installcheck-target-libgfortran
+maybe-installcheck-target-libgfortran:
+@if target-libgfortran
+maybe-installcheck-target-libgfortran: installcheck-target-libgfortran
 
-installcheck-target-libf2c: \
-    configure-target-libf2c 
-	@[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \
+installcheck-target-libgfortran: \
+    configure-target-libgfortran 
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	echo "Doing installcheck in $(TARGET_SUBDIR)/libf2c" ; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing installcheck in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
-	(cd $(TARGET_SUBDIR)/libf2c && \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-libgfortran
 
-.PHONY: maybe-mostlyclean-target-libf2c mostlyclean-target-libf2c
-maybe-mostlyclean-target-libf2c:
+.PHONY: maybe-mostlyclean-target-libgfortran mostlyclean-target-libgfortran
+maybe-mostlyclean-target-libgfortran:
+@if target-libgfortran
+maybe-mostlyclean-target-libgfortran: mostlyclean-target-libgfortran
 
-mostlyclean-target-libf2c: 
-	@[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \
+mostlyclean-target-libgfortran: 
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libf2c" ; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
-	(cd $(TARGET_SUBDIR)/libf2c && \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-libgfortran
 
-.PHONY: maybe-clean-target-libf2c clean-target-libf2c
-maybe-clean-target-libf2c:
+.PHONY: maybe-clean-target-libgfortran clean-target-libgfortran
+maybe-clean-target-libgfortran:
+@if target-libgfortran
+maybe-clean-target-libgfortran: clean-target-libgfortran
 
-clean-target-libf2c: 
-	@[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \
+clean-target-libgfortran: 
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	echo "Doing clean in $(TARGET_SUBDIR)/libf2c" ; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing clean in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
-	(cd $(TARGET_SUBDIR)/libf2c && \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-libgfortran
 
-.PHONY: maybe-distclean-target-libf2c distclean-target-libf2c
-maybe-distclean-target-libf2c:
+.PHONY: maybe-distclean-target-libgfortran distclean-target-libgfortran
+maybe-distclean-target-libgfortran:
+@if target-libgfortran
+maybe-distclean-target-libgfortran: distclean-target-libgfortran
 
-distclean-target-libf2c: 
-	@[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \
+distclean-target-libgfortran: 
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	echo "Doing distclean in $(TARGET_SUBDIR)/libf2c" ; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing distclean in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
-	(cd $(TARGET_SUBDIR)/libf2c && \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-libgfortran
 
-.PHONY: maybe-maintainer-clean-target-libf2c maintainer-clean-target-libf2c
-maybe-maintainer-clean-target-libf2c:
+.PHONY: maybe-maintainer-clean-target-libgfortran maintainer-clean-target-libgfortran
+maybe-maintainer-clean-target-libgfortran:
+@if target-libgfortran
+maybe-maintainer-clean-target-libgfortran: maintainer-clean-target-libgfortran
 
-maintainer-clean-target-libf2c: 
-	@[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \
+maintainer-clean-target-libgfortran: 
+	@[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libf2c" ; \
+	$(NORMAL_TARGET_EXPORTS) \
+	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgfortran" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
-	(cd $(TARGET_SUBDIR)/libf2c && \
+	(cd $(TARGET_SUBDIR)/libgfortran && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-libgfortran
 
 
 .PHONY: configure-target-libobjc maybe-configure-target-libobjc
 maybe-configure-target-libobjc:
+@if target-libobjc
+maybe-configure-target-libobjc: configure-target-libobjc
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/libobjc/multilib.out: multilib.out
@@ -19694,21 +23611,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libobjc; \
 	cd "$(TARGET_SUBDIR)/libobjc" || exit 1; \
 	case $(srcdir) in \
@@ -19725,44 +23628,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-libobjc
 
 .PHONY: all-target-libobjc maybe-all-target-libobjc
 maybe-all-target-libobjc:
+@if target-libobjc
+maybe-all-target-libobjc: all-target-libobjc
 all-target-libobjc: configure-target-libobjc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libobjc && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-libobjc
 
 .PHONY: check-target-libobjc maybe-check-target-libobjc
 maybe-check-target-libobjc:
+@if target-libobjc
+maybe-check-target-libobjc: check-target-libobjc
 
 check-target-libobjc:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libobjc && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-libobjc
 
 .PHONY: install-target-libobjc maybe-install-target-libobjc
 maybe-install-target-libobjc:
+@if target-libobjc
+maybe-install-target-libobjc: install-target-libobjc
 
 install-target-libobjc: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libobjc && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-libobjc
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-libobjc info-target-libobjc
 maybe-info-target-libobjc:
+@if target-libobjc
+maybe-info-target-libobjc: info-target-libobjc
 
 info-target-libobjc: \
     configure-target-libobjc 
@@ -19770,6 +23688,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19779,12 +23698,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-libobjc
 
 .PHONY: maybe-dvi-target-libobjc dvi-target-libobjc
 maybe-dvi-target-libobjc:
+@if target-libobjc
+maybe-dvi-target-libobjc: dvi-target-libobjc
 
 dvi-target-libobjc: \
     configure-target-libobjc 
@@ -19792,6 +23714,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19801,12 +23724,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-libobjc
 
 .PHONY: maybe-TAGS-target-libobjc TAGS-target-libobjc
 maybe-TAGS-target-libobjc:
+@if target-libobjc
+maybe-TAGS-target-libobjc: TAGS-target-libobjc
 
 TAGS-target-libobjc: \
     configure-target-libobjc 
@@ -19814,6 +23740,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19823,12 +23750,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-libobjc
 
 .PHONY: maybe-install-info-target-libobjc install-info-target-libobjc
 maybe-install-info-target-libobjc:
+@if target-libobjc
+maybe-install-info-target-libobjc: install-info-target-libobjc
 
 install-info-target-libobjc: \
     configure-target-libobjc \
@@ -19837,6 +23767,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19846,12 +23777,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-libobjc
 
 .PHONY: maybe-installcheck-target-libobjc installcheck-target-libobjc
 maybe-installcheck-target-libobjc:
+@if target-libobjc
+maybe-installcheck-target-libobjc: installcheck-target-libobjc
 
 installcheck-target-libobjc: \
     configure-target-libobjc 
@@ -19859,6 +23793,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19868,18 +23803,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-libobjc
 
 .PHONY: maybe-mostlyclean-target-libobjc mostlyclean-target-libobjc
 maybe-mostlyclean-target-libobjc:
+@if target-libobjc
+maybe-mostlyclean-target-libobjc: mostlyclean-target-libobjc
 
 mostlyclean-target-libobjc: 
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19889,18 +23828,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-libobjc
 
 .PHONY: maybe-clean-target-libobjc clean-target-libobjc
 maybe-clean-target-libobjc:
+@if target-libobjc
+maybe-clean-target-libobjc: clean-target-libobjc
 
 clean-target-libobjc: 
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19910,18 +23853,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-libobjc
 
 .PHONY: maybe-distclean-target-libobjc distclean-target-libobjc
 maybe-distclean-target-libobjc:
+@if target-libobjc
+maybe-distclean-target-libobjc: distclean-target-libobjc
 
 distclean-target-libobjc: 
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19931,18 +23878,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-libobjc
 
 .PHONY: maybe-maintainer-clean-target-libobjc maintainer-clean-target-libobjc
 maybe-maintainer-clean-target-libobjc:
+@if target-libobjc
+maybe-maintainer-clean-target-libobjc: maintainer-clean-target-libobjc
 
 maintainer-clean-target-libobjc: 
 	@[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libobjc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -19952,13 +23903,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-libobjc
 
 
 .PHONY: configure-target-libtermcap maybe-configure-target-libtermcap
 maybe-configure-target-libtermcap:
+@if target-libtermcap
+maybe-configure-target-libtermcap: configure-target-libtermcap
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/libtermcap/multilib.out: multilib.out
@@ -19972,21 +23926,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libtermcap; \
 	cd "$(TARGET_SUBDIR)/libtermcap" || exit 1; \
 	case $(srcdir) in \
@@ -20025,40 +23965,54 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-libtermcap
 
 .PHONY: all-target-libtermcap maybe-all-target-libtermcap
 maybe-all-target-libtermcap:
+@if target-libtermcap
+maybe-all-target-libtermcap: all-target-libtermcap
 all-target-libtermcap: configure-target-libtermcap
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libtermcap && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-libtermcap
 
 .PHONY: check-target-libtermcap maybe-check-target-libtermcap
 maybe-check-target-libtermcap:
+@if target-libtermcap
+maybe-check-target-libtermcap: check-target-libtermcap
 
 # Dummy target for uncheckable module.
 check-target-libtermcap:
 
+@endif target-libtermcap
 
 .PHONY: install-target-libtermcap maybe-install-target-libtermcap
 maybe-install-target-libtermcap:
+@if target-libtermcap
+maybe-install-target-libtermcap: install-target-libtermcap
 
 install-target-libtermcap: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libtermcap && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-libtermcap
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-libtermcap info-target-libtermcap
 maybe-info-target-libtermcap:
+@if target-libtermcap
+maybe-info-target-libtermcap: info-target-libtermcap
 
 info-target-libtermcap: \
     configure-target-libtermcap 
@@ -20066,6 +24020,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20075,12 +24030,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-libtermcap
 
 .PHONY: maybe-dvi-target-libtermcap dvi-target-libtermcap
 maybe-dvi-target-libtermcap:
+@if target-libtermcap
+maybe-dvi-target-libtermcap: dvi-target-libtermcap
 
 dvi-target-libtermcap: \
     configure-target-libtermcap 
@@ -20088,6 +24046,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20097,12 +24056,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-libtermcap
 
 .PHONY: maybe-TAGS-target-libtermcap TAGS-target-libtermcap
 maybe-TAGS-target-libtermcap:
+@if target-libtermcap
+maybe-TAGS-target-libtermcap: TAGS-target-libtermcap
 
 TAGS-target-libtermcap: \
     configure-target-libtermcap 
@@ -20110,6 +24072,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20119,12 +24082,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-libtermcap
 
 .PHONY: maybe-install-info-target-libtermcap install-info-target-libtermcap
 maybe-install-info-target-libtermcap:
+@if target-libtermcap
+maybe-install-info-target-libtermcap: install-info-target-libtermcap
 
 install-info-target-libtermcap: \
     configure-target-libtermcap \
@@ -20133,6 +24099,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20142,12 +24109,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-libtermcap
 
 .PHONY: maybe-installcheck-target-libtermcap installcheck-target-libtermcap
 maybe-installcheck-target-libtermcap:
+@if target-libtermcap
+maybe-installcheck-target-libtermcap: installcheck-target-libtermcap
 
 installcheck-target-libtermcap: \
     configure-target-libtermcap 
@@ -20155,6 +24125,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libtermcap" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20164,41 +24135,56 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-libtermcap
 
 .PHONY: maybe-mostlyclean-target-libtermcap mostlyclean-target-libtermcap
 maybe-mostlyclean-target-libtermcap:
+@if target-libtermcap
+maybe-mostlyclean-target-libtermcap: mostlyclean-target-libtermcap
 
 # libtermcap doesn't support mostlyclean.
 mostlyclean-target-libtermcap:
 
+@endif target-libtermcap
 
 .PHONY: maybe-clean-target-libtermcap clean-target-libtermcap
 maybe-clean-target-libtermcap:
+@if target-libtermcap
+maybe-clean-target-libtermcap: clean-target-libtermcap
 
 # libtermcap doesn't support clean.
 clean-target-libtermcap:
 
+@endif target-libtermcap
 
 .PHONY: maybe-distclean-target-libtermcap distclean-target-libtermcap
 maybe-distclean-target-libtermcap:
+@if target-libtermcap
+maybe-distclean-target-libtermcap: distclean-target-libtermcap
 
 # libtermcap doesn't support distclean.
 distclean-target-libtermcap:
 
+@endif target-libtermcap
 
 .PHONY: maybe-maintainer-clean-target-libtermcap maintainer-clean-target-libtermcap
 maybe-maintainer-clean-target-libtermcap:
+@if target-libtermcap
+maybe-maintainer-clean-target-libtermcap: maintainer-clean-target-libtermcap
 
 # libtermcap doesn't support maintainer-clean.
 maintainer-clean-target-libtermcap:
 
+@endif target-libtermcap
 
 
 .PHONY: configure-target-winsup maybe-configure-target-winsup
 maybe-configure-target-winsup:
+@if target-winsup
+maybe-configure-target-winsup: configure-target-winsup
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/winsup/multilib.out: multilib.out
@@ -20212,21 +24198,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/winsup; \
 	cd "$(TARGET_SUBDIR)/winsup" || exit 1; \
 	case $(srcdir) in \
@@ -20243,44 +24215,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-winsup
 
 .PHONY: all-target-winsup maybe-all-target-winsup
 maybe-all-target-winsup:
+@if target-winsup
+maybe-all-target-winsup: all-target-winsup
 all-target-winsup: configure-target-winsup
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/winsup && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-winsup
 
 .PHONY: check-target-winsup maybe-check-target-winsup
 maybe-check-target-winsup:
+@if target-winsup
+maybe-check-target-winsup: check-target-winsup
 
 check-target-winsup:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/winsup && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-winsup
 
 .PHONY: install-target-winsup maybe-install-target-winsup
 maybe-install-target-winsup:
+@if target-winsup
+maybe-install-target-winsup: install-target-winsup
 
 install-target-winsup: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/winsup && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-winsup
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-winsup info-target-winsup
 maybe-info-target-winsup:
+@if target-winsup
+maybe-info-target-winsup: info-target-winsup
 
 info-target-winsup: \
     configure-target-winsup 
@@ -20288,6 +24275,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20297,12 +24285,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-winsup
 
 .PHONY: maybe-dvi-target-winsup dvi-target-winsup
 maybe-dvi-target-winsup:
+@if target-winsup
+maybe-dvi-target-winsup: dvi-target-winsup
 
 dvi-target-winsup: \
     configure-target-winsup 
@@ -20310,6 +24301,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20319,12 +24311,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-winsup
 
 .PHONY: maybe-TAGS-target-winsup TAGS-target-winsup
 maybe-TAGS-target-winsup:
+@if target-winsup
+maybe-TAGS-target-winsup: TAGS-target-winsup
 
 TAGS-target-winsup: \
     configure-target-winsup 
@@ -20332,6 +24327,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20341,12 +24337,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-winsup
 
 .PHONY: maybe-install-info-target-winsup install-info-target-winsup
 maybe-install-info-target-winsup:
+@if target-winsup
+maybe-install-info-target-winsup: install-info-target-winsup
 
 install-info-target-winsup: \
     configure-target-winsup \
@@ -20355,6 +24354,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20364,12 +24364,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-winsup
 
 .PHONY: maybe-installcheck-target-winsup installcheck-target-winsup
 maybe-installcheck-target-winsup:
+@if target-winsup
+maybe-installcheck-target-winsup: installcheck-target-winsup
 
 installcheck-target-winsup: \
     configure-target-winsup 
@@ -20377,6 +24380,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20386,18 +24390,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-winsup
 
 .PHONY: maybe-mostlyclean-target-winsup mostlyclean-target-winsup
 maybe-mostlyclean-target-winsup:
+@if target-winsup
+maybe-mostlyclean-target-winsup: mostlyclean-target-winsup
 
 mostlyclean-target-winsup: 
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20407,18 +24415,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-winsup
 
 .PHONY: maybe-clean-target-winsup clean-target-winsup
 maybe-clean-target-winsup:
+@if target-winsup
+maybe-clean-target-winsup: clean-target-winsup
 
 clean-target-winsup: 
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20428,18 +24440,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-winsup
 
 .PHONY: maybe-distclean-target-winsup distclean-target-winsup
 maybe-distclean-target-winsup:
+@if target-winsup
+maybe-distclean-target-winsup: distclean-target-winsup
 
 distclean-target-winsup: 
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20449,18 +24465,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-winsup
 
 .PHONY: maybe-maintainer-clean-target-winsup maintainer-clean-target-winsup
 maybe-maintainer-clean-target-winsup:
+@if target-winsup
+maybe-maintainer-clean-target-winsup: maintainer-clean-target-winsup
 
 maintainer-clean-target-winsup: 
 	@[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/winsup" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20470,13 +24490,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-winsup
 
 
 .PHONY: configure-target-libgloss maybe-configure-target-libgloss
 maybe-configure-target-libgloss:
+@if target-libgloss
+maybe-configure-target-libgloss: configure-target-libgloss
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/libgloss/multilib.out: multilib.out
@@ -20490,21 +24513,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libgloss; \
 	cd "$(TARGET_SUBDIR)/libgloss" || exit 1; \
 	case $(srcdir) in \
@@ -20521,40 +24530,54 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-libgloss
 
 .PHONY: all-target-libgloss maybe-all-target-libgloss
 maybe-all-target-libgloss:
+@if target-libgloss
+maybe-all-target-libgloss: all-target-libgloss
 all-target-libgloss: configure-target-libgloss
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libgloss && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-libgloss
 
 .PHONY: check-target-libgloss maybe-check-target-libgloss
 maybe-check-target-libgloss:
+@if target-libgloss
+maybe-check-target-libgloss: check-target-libgloss
 
 # Dummy target for uncheckable module.
 check-target-libgloss:
 
+@endif target-libgloss
 
 .PHONY: install-target-libgloss maybe-install-target-libgloss
 maybe-install-target-libgloss:
+@if target-libgloss
+maybe-install-target-libgloss: install-target-libgloss
 
 install-target-libgloss: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libgloss && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-libgloss
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-libgloss info-target-libgloss
 maybe-info-target-libgloss:
+@if target-libgloss
+maybe-info-target-libgloss: info-target-libgloss
 
 info-target-libgloss: \
     configure-target-libgloss 
@@ -20562,6 +24585,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20571,12 +24595,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-libgloss
 
 .PHONY: maybe-dvi-target-libgloss dvi-target-libgloss
 maybe-dvi-target-libgloss:
+@if target-libgloss
+maybe-dvi-target-libgloss: dvi-target-libgloss
 
 dvi-target-libgloss: \
     configure-target-libgloss 
@@ -20584,6 +24611,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20593,12 +24621,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-libgloss
 
 .PHONY: maybe-TAGS-target-libgloss TAGS-target-libgloss
 maybe-TAGS-target-libgloss:
+@if target-libgloss
+maybe-TAGS-target-libgloss: TAGS-target-libgloss
 
 TAGS-target-libgloss: \
     configure-target-libgloss 
@@ -20606,6 +24637,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20615,12 +24647,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-libgloss
 
 .PHONY: maybe-install-info-target-libgloss install-info-target-libgloss
 maybe-install-info-target-libgloss:
+@if target-libgloss
+maybe-install-info-target-libgloss: install-info-target-libgloss
 
 install-info-target-libgloss: \
     configure-target-libgloss \
@@ -20629,6 +24664,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20638,12 +24674,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-libgloss
 
 .PHONY: maybe-installcheck-target-libgloss installcheck-target-libgloss
 maybe-installcheck-target-libgloss:
+@if target-libgloss
+maybe-installcheck-target-libgloss: installcheck-target-libgloss
 
 installcheck-target-libgloss: \
     configure-target-libgloss 
@@ -20651,6 +24690,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20660,18 +24700,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-libgloss
 
 .PHONY: maybe-mostlyclean-target-libgloss mostlyclean-target-libgloss
 maybe-mostlyclean-target-libgloss:
+@if target-libgloss
+maybe-mostlyclean-target-libgloss: mostlyclean-target-libgloss
 
 mostlyclean-target-libgloss: 
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20681,18 +24725,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-libgloss
 
 .PHONY: maybe-clean-target-libgloss clean-target-libgloss
 maybe-clean-target-libgloss:
+@if target-libgloss
+maybe-clean-target-libgloss: clean-target-libgloss
 
 clean-target-libgloss: 
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20702,18 +24750,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-libgloss
 
 .PHONY: maybe-distclean-target-libgloss distclean-target-libgloss
 maybe-distclean-target-libgloss:
+@if target-libgloss
+maybe-distclean-target-libgloss: distclean-target-libgloss
 
 distclean-target-libgloss: 
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20723,18 +24775,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-libgloss
 
 .PHONY: maybe-maintainer-clean-target-libgloss maintainer-clean-target-libgloss
 maybe-maintainer-clean-target-libgloss:
+@if target-libgloss
+maybe-maintainer-clean-target-libgloss: maintainer-clean-target-libgloss
 
 maintainer-clean-target-libgloss: 
 	@[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgloss" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20744,13 +24800,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-libgloss
 
 
 .PHONY: configure-target-libiberty maybe-configure-target-libiberty
 maybe-configure-target-libiberty:
+@if target-libiberty
+maybe-configure-target-libiberty: configure-target-libiberty
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/libiberty/multilib.out: multilib.out
@@ -20764,21 +24823,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libiberty; \
 	cd "$(TARGET_SUBDIR)/libiberty" || exit 1; \
 	case $(srcdir) in \
@@ -20795,44 +24840,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-libiberty
 
 .PHONY: all-target-libiberty maybe-all-target-libiberty
 maybe-all-target-libiberty:
+@if target-libiberty
+maybe-all-target-libiberty: all-target-libiberty
 all-target-libiberty: configure-target-libiberty
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libiberty && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-libiberty
 
 .PHONY: check-target-libiberty maybe-check-target-libiberty
 maybe-check-target-libiberty:
+@if target-libiberty
+maybe-check-target-libiberty: check-target-libiberty
 
 check-target-libiberty:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libiberty && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-libiberty
 
 .PHONY: install-target-libiberty maybe-install-target-libiberty
 maybe-install-target-libiberty:
+@if target-libiberty
+maybe-install-target-libiberty: install-target-libiberty
 
 install-target-libiberty: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libiberty && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-libiberty
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-libiberty info-target-libiberty
 maybe-info-target-libiberty:
+@if target-libiberty
+maybe-info-target-libiberty: info-target-libiberty
 
 info-target-libiberty: \
     configure-target-libiberty 
@@ -20840,6 +24900,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20849,12 +24910,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-libiberty
 
 .PHONY: maybe-dvi-target-libiberty dvi-target-libiberty
 maybe-dvi-target-libiberty:
+@if target-libiberty
+maybe-dvi-target-libiberty: dvi-target-libiberty
 
 dvi-target-libiberty: \
     configure-target-libiberty 
@@ -20862,6 +24926,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20871,12 +24936,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-libiberty
 
 .PHONY: maybe-TAGS-target-libiberty TAGS-target-libiberty
 maybe-TAGS-target-libiberty:
+@if target-libiberty
+maybe-TAGS-target-libiberty: TAGS-target-libiberty
 
 TAGS-target-libiberty: \
     configure-target-libiberty 
@@ -20884,6 +24952,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20893,12 +24962,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-libiberty
 
 .PHONY: maybe-install-info-target-libiberty install-info-target-libiberty
 maybe-install-info-target-libiberty:
+@if target-libiberty
+maybe-install-info-target-libiberty: install-info-target-libiberty
 
 install-info-target-libiberty: \
     configure-target-libiberty \
@@ -20907,6 +24979,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20916,12 +24989,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-libiberty
 
 .PHONY: maybe-installcheck-target-libiberty installcheck-target-libiberty
 maybe-installcheck-target-libiberty:
+@if target-libiberty
+maybe-installcheck-target-libiberty: installcheck-target-libiberty
 
 installcheck-target-libiberty: \
     configure-target-libiberty 
@@ -20929,6 +25005,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20938,18 +25015,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-libiberty
 
 .PHONY: maybe-mostlyclean-target-libiberty mostlyclean-target-libiberty
 maybe-mostlyclean-target-libiberty:
+@if target-libiberty
+maybe-mostlyclean-target-libiberty: mostlyclean-target-libiberty
 
 mostlyclean-target-libiberty: 
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20959,18 +25040,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-libiberty
 
 .PHONY: maybe-clean-target-libiberty clean-target-libiberty
 maybe-clean-target-libiberty:
+@if target-libiberty
+maybe-clean-target-libiberty: clean-target-libiberty
 
 clean-target-libiberty: 
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -20980,18 +25065,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-libiberty
 
 .PHONY: maybe-distclean-target-libiberty distclean-target-libiberty
 maybe-distclean-target-libiberty:
+@if target-libiberty
+maybe-distclean-target-libiberty: distclean-target-libiberty
 
 distclean-target-libiberty: 
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21001,18 +25090,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-libiberty
 
 .PHONY: maybe-maintainer-clean-target-libiberty maintainer-clean-target-libiberty
 maybe-maintainer-clean-target-libiberty:
+@if target-libiberty
+maybe-maintainer-clean-target-libiberty: maintainer-clean-target-libiberty
 
 maintainer-clean-target-libiberty: 
 	@[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libiberty" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21022,13 +25115,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-libiberty
 
 
 .PHONY: configure-target-gperf maybe-configure-target-gperf
 maybe-configure-target-gperf:
+@if target-gperf
+maybe-configure-target-gperf: configure-target-gperf
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/gperf/multilib.out: multilib.out
@@ -21042,21 +25138,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/gperf; \
 	cd "$(TARGET_SUBDIR)/gperf" || exit 1; \
 	case $(srcdir) in \
@@ -21073,44 +25155,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-gperf
 
 .PHONY: all-target-gperf maybe-all-target-gperf
 maybe-all-target-gperf:
+@if target-gperf
+maybe-all-target-gperf: all-target-gperf
 all-target-gperf: configure-target-gperf
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/gperf && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-gperf
 
 .PHONY: check-target-gperf maybe-check-target-gperf
 maybe-check-target-gperf:
+@if target-gperf
+maybe-check-target-gperf: check-target-gperf
 
 check-target-gperf:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/gperf && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-gperf
 
 .PHONY: install-target-gperf maybe-install-target-gperf
 maybe-install-target-gperf:
+@if target-gperf
+maybe-install-target-gperf: install-target-gperf
 
 install-target-gperf: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/gperf && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-gperf
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-gperf info-target-gperf
 maybe-info-target-gperf:
+@if target-gperf
+maybe-info-target-gperf: info-target-gperf
 
 info-target-gperf: \
     configure-target-gperf 
@@ -21118,6 +25215,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21127,12 +25225,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-gperf
 
 .PHONY: maybe-dvi-target-gperf dvi-target-gperf
 maybe-dvi-target-gperf:
+@if target-gperf
+maybe-dvi-target-gperf: dvi-target-gperf
 
 dvi-target-gperf: \
     configure-target-gperf 
@@ -21140,6 +25241,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21149,12 +25251,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-gperf
 
 .PHONY: maybe-TAGS-target-gperf TAGS-target-gperf
 maybe-TAGS-target-gperf:
+@if target-gperf
+maybe-TAGS-target-gperf: TAGS-target-gperf
 
 TAGS-target-gperf: \
     configure-target-gperf 
@@ -21162,6 +25267,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21171,12 +25277,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-gperf
 
 .PHONY: maybe-install-info-target-gperf install-info-target-gperf
 maybe-install-info-target-gperf:
+@if target-gperf
+maybe-install-info-target-gperf: install-info-target-gperf
 
 install-info-target-gperf: \
     configure-target-gperf \
@@ -21185,6 +25294,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21194,12 +25304,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-gperf
 
 .PHONY: maybe-installcheck-target-gperf installcheck-target-gperf
 maybe-installcheck-target-gperf:
+@if target-gperf
+maybe-installcheck-target-gperf: installcheck-target-gperf
 
 installcheck-target-gperf: \
     configure-target-gperf 
@@ -21207,6 +25320,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21216,18 +25330,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-gperf
 
 .PHONY: maybe-mostlyclean-target-gperf mostlyclean-target-gperf
 maybe-mostlyclean-target-gperf:
+@if target-gperf
+maybe-mostlyclean-target-gperf: mostlyclean-target-gperf
 
 mostlyclean-target-gperf: 
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21237,18 +25355,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-gperf
 
 .PHONY: maybe-clean-target-gperf clean-target-gperf
 maybe-clean-target-gperf:
+@if target-gperf
+maybe-clean-target-gperf: clean-target-gperf
 
 clean-target-gperf: 
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21258,18 +25380,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-gperf
 
 .PHONY: maybe-distclean-target-gperf distclean-target-gperf
 maybe-distclean-target-gperf:
+@if target-gperf
+maybe-distclean-target-gperf: distclean-target-gperf
 
 distclean-target-gperf: 
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21279,18 +25405,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-gperf
 
 .PHONY: maybe-maintainer-clean-target-gperf maintainer-clean-target-gperf
 maybe-maintainer-clean-target-gperf:
+@if target-gperf
+maybe-maintainer-clean-target-gperf: maintainer-clean-target-gperf
 
 maintainer-clean-target-gperf: 
 	@[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/gperf" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21300,13 +25430,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-gperf
 
 
 .PHONY: configure-target-examples maybe-configure-target-examples
 maybe-configure-target-examples:
+@if target-examples
+maybe-configure-target-examples: configure-target-examples
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/examples/multilib.out: multilib.out
@@ -21320,21 +25453,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/examples; \
 	cd "$(TARGET_SUBDIR)/examples" || exit 1; \
 	case $(srcdir) in \
@@ -21351,36 +25470,49 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-examples
 
 .PHONY: all-target-examples maybe-all-target-examples
 maybe-all-target-examples:
+@if target-examples
+maybe-all-target-examples: all-target-examples
 all-target-examples: configure-target-examples
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/examples && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-examples
 
 .PHONY: check-target-examples maybe-check-target-examples
 maybe-check-target-examples:
+@if target-examples
+maybe-check-target-examples: check-target-examples
 
 # Dummy target for uncheckable module.
 check-target-examples:
 
+@endif target-examples
 
 .PHONY: install-target-examples maybe-install-target-examples
 maybe-install-target-examples:
+@if target-examples
+maybe-install-target-examples: install-target-examples
 
 # Dummy target for uninstallable.
 install-target-examples:
 
+@endif target-examples
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-examples info-target-examples
 maybe-info-target-examples:
+@if target-examples
+maybe-info-target-examples: info-target-examples
 
 info-target-examples: \
     configure-target-examples 
@@ -21388,6 +25520,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21397,12 +25530,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-examples
 
 .PHONY: maybe-dvi-target-examples dvi-target-examples
 maybe-dvi-target-examples:
+@if target-examples
+maybe-dvi-target-examples: dvi-target-examples
 
 dvi-target-examples: \
     configure-target-examples 
@@ -21410,6 +25546,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21419,12 +25556,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-examples
 
 .PHONY: maybe-TAGS-target-examples TAGS-target-examples
 maybe-TAGS-target-examples:
+@if target-examples
+maybe-TAGS-target-examples: TAGS-target-examples
 
 TAGS-target-examples: \
     configure-target-examples 
@@ -21432,6 +25572,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21441,12 +25582,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-examples
 
 .PHONY: maybe-install-info-target-examples install-info-target-examples
 maybe-install-info-target-examples:
+@if target-examples
+maybe-install-info-target-examples: install-info-target-examples
 
 install-info-target-examples: \
     configure-target-examples \
@@ -21455,6 +25599,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21464,12 +25609,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-examples
 
 .PHONY: maybe-installcheck-target-examples installcheck-target-examples
 maybe-installcheck-target-examples:
+@if target-examples
+maybe-installcheck-target-examples: installcheck-target-examples
 
 installcheck-target-examples: \
     configure-target-examples 
@@ -21477,6 +25625,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21486,18 +25635,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-examples
 
 .PHONY: maybe-mostlyclean-target-examples mostlyclean-target-examples
 maybe-mostlyclean-target-examples:
+@if target-examples
+maybe-mostlyclean-target-examples: mostlyclean-target-examples
 
 mostlyclean-target-examples: 
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21507,18 +25660,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-examples
 
 .PHONY: maybe-clean-target-examples clean-target-examples
 maybe-clean-target-examples:
+@if target-examples
+maybe-clean-target-examples: clean-target-examples
 
 clean-target-examples: 
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21528,18 +25685,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-examples
 
 .PHONY: maybe-distclean-target-examples distclean-target-examples
 maybe-distclean-target-examples:
+@if target-examples
+maybe-distclean-target-examples: distclean-target-examples
 
 distclean-target-examples: 
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21549,18 +25710,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-examples
 
 .PHONY: maybe-maintainer-clean-target-examples maintainer-clean-target-examples
 maybe-maintainer-clean-target-examples:
+@if target-examples
+maybe-maintainer-clean-target-examples: maintainer-clean-target-examples
 
 maintainer-clean-target-examples: 
 	@[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/examples" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21570,13 +25735,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-examples
 
 
 .PHONY: configure-target-libffi maybe-configure-target-libffi
 maybe-configure-target-libffi:
+@if target-libffi
+maybe-configure-target-libffi: configure-target-libffi
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/libffi/multilib.out: multilib.out
@@ -21590,21 +25758,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libffi; \
 	cd "$(TARGET_SUBDIR)/libffi" || exit 1; \
 	case $(srcdir) in \
@@ -21621,44 +25775,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-libffi
 
 .PHONY: all-target-libffi maybe-all-target-libffi
 maybe-all-target-libffi:
+@if target-libffi
+maybe-all-target-libffi: all-target-libffi
 all-target-libffi: configure-target-libffi
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libffi && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-libffi
 
 .PHONY: check-target-libffi maybe-check-target-libffi
 maybe-check-target-libffi:
+@if target-libffi
+maybe-check-target-libffi: check-target-libffi
 
 check-target-libffi:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libffi && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-libffi
 
 .PHONY: install-target-libffi maybe-install-target-libffi
 maybe-install-target-libffi:
+@if target-libffi
+maybe-install-target-libffi: install-target-libffi
 
 install-target-libffi: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libffi && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-libffi
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-libffi info-target-libffi
 maybe-info-target-libffi:
+@if target-libffi
+maybe-info-target-libffi: info-target-libffi
 
 info-target-libffi: \
     configure-target-libffi 
@@ -21666,6 +25835,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21675,12 +25845,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-libffi
 
 .PHONY: maybe-dvi-target-libffi dvi-target-libffi
 maybe-dvi-target-libffi:
+@if target-libffi
+maybe-dvi-target-libffi: dvi-target-libffi
 
 dvi-target-libffi: \
     configure-target-libffi 
@@ -21688,6 +25861,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21697,12 +25871,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-libffi
 
 .PHONY: maybe-TAGS-target-libffi TAGS-target-libffi
 maybe-TAGS-target-libffi:
+@if target-libffi
+maybe-TAGS-target-libffi: TAGS-target-libffi
 
 TAGS-target-libffi: \
     configure-target-libffi 
@@ -21710,6 +25887,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21719,12 +25897,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-libffi
 
 .PHONY: maybe-install-info-target-libffi install-info-target-libffi
 maybe-install-info-target-libffi:
+@if target-libffi
+maybe-install-info-target-libffi: install-info-target-libffi
 
 install-info-target-libffi: \
     configure-target-libffi \
@@ -21733,6 +25914,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21742,12 +25924,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-libffi
 
 .PHONY: maybe-installcheck-target-libffi installcheck-target-libffi
 maybe-installcheck-target-libffi:
+@if target-libffi
+maybe-installcheck-target-libffi: installcheck-target-libffi
 
 installcheck-target-libffi: \
     configure-target-libffi 
@@ -21755,6 +25940,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21764,18 +25950,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-libffi
 
 .PHONY: maybe-mostlyclean-target-libffi mostlyclean-target-libffi
 maybe-mostlyclean-target-libffi:
+@if target-libffi
+maybe-mostlyclean-target-libffi: mostlyclean-target-libffi
 
 mostlyclean-target-libffi: 
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21785,18 +25975,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-libffi
 
 .PHONY: maybe-clean-target-libffi clean-target-libffi
 maybe-clean-target-libffi:
+@if target-libffi
+maybe-clean-target-libffi: clean-target-libffi
 
 clean-target-libffi: 
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21806,18 +26000,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-libffi
 
 .PHONY: maybe-distclean-target-libffi distclean-target-libffi
 maybe-distclean-target-libffi:
+@if target-libffi
+maybe-distclean-target-libffi: distclean-target-libffi
 
 distclean-target-libffi: 
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21827,18 +26025,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-libffi
 
 .PHONY: maybe-maintainer-clean-target-libffi maintainer-clean-target-libffi
 maybe-maintainer-clean-target-libffi:
+@if target-libffi
+maybe-maintainer-clean-target-libffi: maintainer-clean-target-libffi
 
 maintainer-clean-target-libffi: 
 	@[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libffi" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21848,13 +26050,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-libffi
 
 
 .PHONY: configure-target-libjava maybe-configure-target-libjava
 maybe-configure-target-libjava:
+@if target-libjava
+maybe-configure-target-libjava: configure-target-libjava
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/libjava/multilib.out: multilib.out
@@ -21868,22 +26073,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libjava; \
 	cd "$(TARGET_SUBDIR)/libjava" || exit 1; \
 	case $(srcdir) in \
@@ -21900,44 +26090,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-libjava
 
 .PHONY: all-target-libjava maybe-all-target-libjava
 maybe-all-target-libjava:
+@if target-libjava
+maybe-all-target-libjava: all-target-libjava
 all-target-libjava: configure-target-libjava
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libjava && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   all)
+@endif target-libjava
 
 .PHONY: check-target-libjava maybe-check-target-libjava
 maybe-check-target-libjava:
+@if target-libjava
+maybe-check-target-libjava: check-target-libjava
 
 check-target-libjava:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libjava && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   check)
 
+@endif target-libjava
 
 .PHONY: install-target-libjava maybe-install-target-libjava
 maybe-install-target-libjava:
+@if target-libjava
+maybe-install-target-libjava: install-target-libjava
 
 install-target-libjava: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libjava && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-libjava
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-libjava info-target-libjava
 maybe-info-target-libjava:
+@if target-libjava
+maybe-info-target-libjava: info-target-libjava
 
 info-target-libjava: \
     configure-target-libjava 
@@ -21945,6 +26150,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21954,12 +26160,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-libjava
 
 .PHONY: maybe-dvi-target-libjava dvi-target-libjava
 maybe-dvi-target-libjava:
+@if target-libjava
+maybe-dvi-target-libjava: dvi-target-libjava
 
 dvi-target-libjava: \
     configure-target-libjava 
@@ -21967,6 +26176,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21976,12 +26186,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-libjava
 
 .PHONY: maybe-TAGS-target-libjava TAGS-target-libjava
 maybe-TAGS-target-libjava:
+@if target-libjava
+maybe-TAGS-target-libjava: TAGS-target-libjava
 
 TAGS-target-libjava: \
     configure-target-libjava 
@@ -21989,6 +26202,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -21998,12 +26212,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-libjava
 
 .PHONY: maybe-install-info-target-libjava install-info-target-libjava
 maybe-install-info-target-libjava:
+@if target-libjava
+maybe-install-info-target-libjava: install-info-target-libjava
 
 install-info-target-libjava: \
     configure-target-libjava \
@@ -22012,6 +26229,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22021,12 +26239,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-libjava
 
 .PHONY: maybe-installcheck-target-libjava installcheck-target-libjava
 maybe-installcheck-target-libjava:
+@if target-libjava
+maybe-installcheck-target-libjava: installcheck-target-libjava
 
 installcheck-target-libjava: \
     configure-target-libjava 
@@ -22034,6 +26255,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22043,18 +26265,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-libjava
 
 .PHONY: maybe-mostlyclean-target-libjava mostlyclean-target-libjava
 maybe-mostlyclean-target-libjava:
+@if target-libjava
+maybe-mostlyclean-target-libjava: mostlyclean-target-libjava
 
 mostlyclean-target-libjava: 
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22064,18 +26290,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-libjava
 
 .PHONY: maybe-clean-target-libjava clean-target-libjava
 maybe-clean-target-libjava:
+@if target-libjava
+maybe-clean-target-libjava: clean-target-libjava
 
 clean-target-libjava: 
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22085,18 +26315,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-libjava
 
 .PHONY: maybe-distclean-target-libjava distclean-target-libjava
 maybe-distclean-target-libjava:
+@if target-libjava
+maybe-distclean-target-libjava: distclean-target-libjava
 
 distclean-target-libjava: 
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22106,18 +26340,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-libjava
 
 .PHONY: maybe-maintainer-clean-target-libjava maintainer-clean-target-libjava
 maybe-maintainer-clean-target-libjava:
+@if target-libjava
+maybe-maintainer-clean-target-libjava: maintainer-clean-target-libjava
 
 maintainer-clean-target-libjava: 
 	@[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(RAW_CXX_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libjava" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22127,13 +26365,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-libjava
 
 
 .PHONY: configure-target-zlib maybe-configure-target-zlib
 maybe-configure-target-zlib:
+@if target-zlib
+maybe-configure-target-zlib: configure-target-zlib
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/zlib/multilib.out: multilib.out
@@ -22147,21 +26388,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/zlib; \
 	cd "$(TARGET_SUBDIR)/zlib" || exit 1; \
 	case $(srcdir) in \
@@ -22200,44 +26427,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-zlib
 
 .PHONY: all-target-zlib maybe-all-target-zlib
 maybe-all-target-zlib:
+@if target-zlib
+maybe-all-target-zlib: all-target-zlib
 all-target-zlib: configure-target-zlib
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/zlib && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-zlib
 
 .PHONY: check-target-zlib maybe-check-target-zlib
 maybe-check-target-zlib:
+@if target-zlib
+maybe-check-target-zlib: check-target-zlib
 
 check-target-zlib:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/zlib && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-zlib
 
 .PHONY: install-target-zlib maybe-install-target-zlib
 maybe-install-target-zlib:
+@if target-zlib
+maybe-install-target-zlib: install-target-zlib
 
 install-target-zlib: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/zlib && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-zlib
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-zlib info-target-zlib
 maybe-info-target-zlib:
+@if target-zlib
+maybe-info-target-zlib: info-target-zlib
 
 info-target-zlib: \
     configure-target-zlib 
@@ -22245,6 +26487,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22254,12 +26497,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-zlib
 
 .PHONY: maybe-dvi-target-zlib dvi-target-zlib
 maybe-dvi-target-zlib:
+@if target-zlib
+maybe-dvi-target-zlib: dvi-target-zlib
 
 dvi-target-zlib: \
     configure-target-zlib 
@@ -22267,6 +26513,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22276,12 +26523,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-zlib
 
 .PHONY: maybe-TAGS-target-zlib TAGS-target-zlib
 maybe-TAGS-target-zlib:
+@if target-zlib
+maybe-TAGS-target-zlib: TAGS-target-zlib
 
 TAGS-target-zlib: \
     configure-target-zlib 
@@ -22289,6 +26539,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22298,12 +26549,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-zlib
 
 .PHONY: maybe-install-info-target-zlib install-info-target-zlib
 maybe-install-info-target-zlib:
+@if target-zlib
+maybe-install-info-target-zlib: install-info-target-zlib
 
 install-info-target-zlib: \
     configure-target-zlib \
@@ -22312,6 +26566,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22321,12 +26576,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-zlib
 
 .PHONY: maybe-installcheck-target-zlib installcheck-target-zlib
 maybe-installcheck-target-zlib:
+@if target-zlib
+maybe-installcheck-target-zlib: installcheck-target-zlib
 
 installcheck-target-zlib: \
     configure-target-zlib 
@@ -22334,6 +26592,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22343,18 +26602,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-zlib
 
 .PHONY: maybe-mostlyclean-target-zlib mostlyclean-target-zlib
 maybe-mostlyclean-target-zlib:
+@if target-zlib
+maybe-mostlyclean-target-zlib: mostlyclean-target-zlib
 
 mostlyclean-target-zlib: 
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22364,18 +26627,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-zlib
 
 .PHONY: maybe-clean-target-zlib clean-target-zlib
 maybe-clean-target-zlib:
+@if target-zlib
+maybe-clean-target-zlib: clean-target-zlib
 
 clean-target-zlib: 
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22385,18 +26652,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-zlib
 
 .PHONY: maybe-distclean-target-zlib distclean-target-zlib
 maybe-distclean-target-zlib:
+@if target-zlib
+maybe-distclean-target-zlib: distclean-target-zlib
 
 distclean-target-zlib: 
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22406,18 +26677,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-zlib
 
 .PHONY: maybe-maintainer-clean-target-zlib maintainer-clean-target-zlib
 maybe-maintainer-clean-target-zlib:
+@if target-zlib
+maybe-maintainer-clean-target-zlib: maintainer-clean-target-zlib
 
 maintainer-clean-target-zlib: 
 	@[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/zlib" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22427,13 +26702,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-zlib
 
 
 .PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc
 maybe-configure-target-boehm-gc:
+@if target-boehm-gc
+maybe-configure-target-boehm-gc: configure-target-boehm-gc
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/boehm-gc/multilib.out: multilib.out
@@ -22447,21 +26725,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/boehm-gc; \
 	cd "$(TARGET_SUBDIR)/boehm-gc" || exit 1; \
 	case $(srcdir) in \
@@ -22478,44 +26742,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-boehm-gc
 
 .PHONY: all-target-boehm-gc maybe-all-target-boehm-gc
 maybe-all-target-boehm-gc:
+@if target-boehm-gc
+maybe-all-target-boehm-gc: all-target-boehm-gc
 all-target-boehm-gc: configure-target-boehm-gc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/boehm-gc && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-boehm-gc
 
 .PHONY: check-target-boehm-gc maybe-check-target-boehm-gc
 maybe-check-target-boehm-gc:
+@if target-boehm-gc
+maybe-check-target-boehm-gc: check-target-boehm-gc
 
 check-target-boehm-gc:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/boehm-gc && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-boehm-gc
 
 .PHONY: install-target-boehm-gc maybe-install-target-boehm-gc
 maybe-install-target-boehm-gc:
+@if target-boehm-gc
+maybe-install-target-boehm-gc: install-target-boehm-gc
 
 install-target-boehm-gc: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/boehm-gc && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-boehm-gc
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-boehm-gc info-target-boehm-gc
 maybe-info-target-boehm-gc:
+@if target-boehm-gc
+maybe-info-target-boehm-gc: info-target-boehm-gc
 
 info-target-boehm-gc: \
     configure-target-boehm-gc 
@@ -22523,6 +26802,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22532,12 +26812,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-boehm-gc
 
 .PHONY: maybe-dvi-target-boehm-gc dvi-target-boehm-gc
 maybe-dvi-target-boehm-gc:
+@if target-boehm-gc
+maybe-dvi-target-boehm-gc: dvi-target-boehm-gc
 
 dvi-target-boehm-gc: \
     configure-target-boehm-gc 
@@ -22545,6 +26828,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22554,12 +26838,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-boehm-gc
 
 .PHONY: maybe-TAGS-target-boehm-gc TAGS-target-boehm-gc
 maybe-TAGS-target-boehm-gc:
+@if target-boehm-gc
+maybe-TAGS-target-boehm-gc: TAGS-target-boehm-gc
 
 TAGS-target-boehm-gc: \
     configure-target-boehm-gc 
@@ -22567,6 +26854,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22576,12 +26864,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-boehm-gc
 
 .PHONY: maybe-install-info-target-boehm-gc install-info-target-boehm-gc
 maybe-install-info-target-boehm-gc:
+@if target-boehm-gc
+maybe-install-info-target-boehm-gc: install-info-target-boehm-gc
 
 install-info-target-boehm-gc: \
     configure-target-boehm-gc \
@@ -22590,6 +26881,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22599,12 +26891,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-boehm-gc
 
 .PHONY: maybe-installcheck-target-boehm-gc installcheck-target-boehm-gc
 maybe-installcheck-target-boehm-gc:
+@if target-boehm-gc
+maybe-installcheck-target-boehm-gc: installcheck-target-boehm-gc
 
 installcheck-target-boehm-gc: \
     configure-target-boehm-gc 
@@ -22612,6 +26907,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22621,18 +26917,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-boehm-gc
 
 .PHONY: maybe-mostlyclean-target-boehm-gc mostlyclean-target-boehm-gc
 maybe-mostlyclean-target-boehm-gc:
+@if target-boehm-gc
+maybe-mostlyclean-target-boehm-gc: mostlyclean-target-boehm-gc
 
 mostlyclean-target-boehm-gc: 
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22642,18 +26942,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-boehm-gc
 
 .PHONY: maybe-clean-target-boehm-gc clean-target-boehm-gc
 maybe-clean-target-boehm-gc:
+@if target-boehm-gc
+maybe-clean-target-boehm-gc: clean-target-boehm-gc
 
 clean-target-boehm-gc: 
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22663,18 +26967,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-boehm-gc
 
 .PHONY: maybe-distclean-target-boehm-gc distclean-target-boehm-gc
 maybe-distclean-target-boehm-gc:
+@if target-boehm-gc
+maybe-distclean-target-boehm-gc: distclean-target-boehm-gc
 
 distclean-target-boehm-gc: 
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22684,18 +26992,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-boehm-gc
 
 .PHONY: maybe-maintainer-clean-target-boehm-gc maintainer-clean-target-boehm-gc
 maybe-maintainer-clean-target-boehm-gc:
+@if target-boehm-gc
+maybe-maintainer-clean-target-boehm-gc: maintainer-clean-target-boehm-gc
 
 maintainer-clean-target-boehm-gc: 
 	@[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/boehm-gc" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22705,13 +27017,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-boehm-gc
 
 
 .PHONY: configure-target-qthreads maybe-configure-target-qthreads
 maybe-configure-target-qthreads:
+@if target-qthreads
+maybe-configure-target-qthreads: configure-target-qthreads
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/qthreads/multilib.out: multilib.out
@@ -22725,21 +27040,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/qthreads; \
 	cd "$(TARGET_SUBDIR)/qthreads" || exit 1; \
 	case $(srcdir) in \
@@ -22756,44 +27057,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-qthreads
 
 .PHONY: all-target-qthreads maybe-all-target-qthreads
 maybe-all-target-qthreads:
+@if target-qthreads
+maybe-all-target-qthreads: all-target-qthreads
 all-target-qthreads: configure-target-qthreads
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/qthreads && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-qthreads
 
 .PHONY: check-target-qthreads maybe-check-target-qthreads
 maybe-check-target-qthreads:
+@if target-qthreads
+maybe-check-target-qthreads: check-target-qthreads
 
 check-target-qthreads:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/qthreads && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-qthreads
 
 .PHONY: install-target-qthreads maybe-install-target-qthreads
 maybe-install-target-qthreads:
+@if target-qthreads
+maybe-install-target-qthreads: install-target-qthreads
 
 install-target-qthreads: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/qthreads && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-qthreads
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-qthreads info-target-qthreads
 maybe-info-target-qthreads:
+@if target-qthreads
+maybe-info-target-qthreads: info-target-qthreads
 
 info-target-qthreads: \
     configure-target-qthreads 
@@ -22801,6 +27117,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22810,12 +27127,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-qthreads
 
 .PHONY: maybe-dvi-target-qthreads dvi-target-qthreads
 maybe-dvi-target-qthreads:
+@if target-qthreads
+maybe-dvi-target-qthreads: dvi-target-qthreads
 
 dvi-target-qthreads: \
     configure-target-qthreads 
@@ -22823,6 +27143,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22832,12 +27153,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-qthreads
 
 .PHONY: maybe-TAGS-target-qthreads TAGS-target-qthreads
 maybe-TAGS-target-qthreads:
+@if target-qthreads
+maybe-TAGS-target-qthreads: TAGS-target-qthreads
 
 TAGS-target-qthreads: \
     configure-target-qthreads 
@@ -22845,6 +27169,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22854,12 +27179,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-qthreads
 
 .PHONY: maybe-install-info-target-qthreads install-info-target-qthreads
 maybe-install-info-target-qthreads:
+@if target-qthreads
+maybe-install-info-target-qthreads: install-info-target-qthreads
 
 install-info-target-qthreads: \
     configure-target-qthreads \
@@ -22868,6 +27196,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22877,12 +27206,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-qthreads
 
 .PHONY: maybe-installcheck-target-qthreads installcheck-target-qthreads
 maybe-installcheck-target-qthreads:
+@if target-qthreads
+maybe-installcheck-target-qthreads: installcheck-target-qthreads
 
 installcheck-target-qthreads: \
     configure-target-qthreads 
@@ -22890,6 +27222,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22899,18 +27232,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-qthreads
 
 .PHONY: maybe-mostlyclean-target-qthreads mostlyclean-target-qthreads
 maybe-mostlyclean-target-qthreads:
+@if target-qthreads
+maybe-mostlyclean-target-qthreads: mostlyclean-target-qthreads
 
 mostlyclean-target-qthreads: 
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22920,18 +27257,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-qthreads
 
 .PHONY: maybe-clean-target-qthreads clean-target-qthreads
 maybe-clean-target-qthreads:
+@if target-qthreads
+maybe-clean-target-qthreads: clean-target-qthreads
 
 clean-target-qthreads: 
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22941,18 +27282,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-qthreads
 
 .PHONY: maybe-distclean-target-qthreads distclean-target-qthreads
 maybe-distclean-target-qthreads:
+@if target-qthreads
+maybe-distclean-target-qthreads: distclean-target-qthreads
 
 distclean-target-qthreads: 
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22962,18 +27307,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-qthreads
 
 .PHONY: maybe-maintainer-clean-target-qthreads maintainer-clean-target-qthreads
 maybe-maintainer-clean-target-qthreads:
+@if target-qthreads
+maybe-maintainer-clean-target-qthreads: maintainer-clean-target-qthreads
 
 maintainer-clean-target-qthreads: 
 	@[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/qthreads" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -22983,13 +27332,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-qthreads
 
 
 .PHONY: configure-target-rda maybe-configure-target-rda
 maybe-configure-target-rda:
+@if target-rda
+maybe-configure-target-rda: configure-target-rda
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/rda/multilib.out: multilib.out
@@ -23003,21 +27355,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/rda; \
 	cd "$(TARGET_SUBDIR)/rda" || exit 1; \
 	case $(srcdir) in \
@@ -23034,44 +27372,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-rda
 
 .PHONY: all-target-rda maybe-all-target-rda
 maybe-all-target-rda:
+@if target-rda
+maybe-all-target-rda: all-target-rda
 all-target-rda: configure-target-rda
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/rda && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-rda
 
 .PHONY: check-target-rda maybe-check-target-rda
 maybe-check-target-rda:
+@if target-rda
+maybe-check-target-rda: check-target-rda
 
 check-target-rda:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/rda && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-rda
 
 .PHONY: install-target-rda maybe-install-target-rda
 maybe-install-target-rda:
+@if target-rda
+maybe-install-target-rda: install-target-rda
 
 install-target-rda: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/rda && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-rda
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-rda info-target-rda
 maybe-info-target-rda:
+@if target-rda
+maybe-info-target-rda: info-target-rda
 
 info-target-rda: \
     configure-target-rda 
@@ -23079,6 +27432,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23088,12 +27442,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-rda
 
 .PHONY: maybe-dvi-target-rda dvi-target-rda
 maybe-dvi-target-rda:
+@if target-rda
+maybe-dvi-target-rda: dvi-target-rda
 
 dvi-target-rda: \
     configure-target-rda 
@@ -23101,6 +27458,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23110,12 +27468,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-rda
 
 .PHONY: maybe-TAGS-target-rda TAGS-target-rda
 maybe-TAGS-target-rda:
+@if target-rda
+maybe-TAGS-target-rda: TAGS-target-rda
 
 TAGS-target-rda: \
     configure-target-rda 
@@ -23123,6 +27484,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23132,12 +27494,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-rda
 
 .PHONY: maybe-install-info-target-rda install-info-target-rda
 maybe-install-info-target-rda:
+@if target-rda
+maybe-install-info-target-rda: install-info-target-rda
 
 install-info-target-rda: \
     configure-target-rda \
@@ -23146,6 +27511,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23155,12 +27521,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-rda
 
 .PHONY: maybe-installcheck-target-rda installcheck-target-rda
 maybe-installcheck-target-rda:
+@if target-rda
+maybe-installcheck-target-rda: installcheck-target-rda
 
 installcheck-target-rda: \
     configure-target-rda 
@@ -23168,6 +27537,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23177,18 +27547,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-rda
 
 .PHONY: maybe-mostlyclean-target-rda mostlyclean-target-rda
 maybe-mostlyclean-target-rda:
+@if target-rda
+maybe-mostlyclean-target-rda: mostlyclean-target-rda
 
 mostlyclean-target-rda: 
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23198,18 +27572,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-rda
 
 .PHONY: maybe-clean-target-rda clean-target-rda
 maybe-clean-target-rda:
+@if target-rda
+maybe-clean-target-rda: clean-target-rda
 
 clean-target-rda: 
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23219,18 +27597,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-rda
 
 .PHONY: maybe-distclean-target-rda distclean-target-rda
 maybe-distclean-target-rda:
+@if target-rda
+maybe-distclean-target-rda: distclean-target-rda
 
 distclean-target-rda: 
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23240,18 +27622,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-rda
 
 .PHONY: maybe-maintainer-clean-target-rda maintainer-clean-target-rda
 maybe-maintainer-clean-target-rda:
+@if target-rda
+maybe-maintainer-clean-target-rda: maintainer-clean-target-rda
 
 maintainer-clean-target-rda: 
 	@[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/rda" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23261,13 +27647,16 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-rda
 
 
 .PHONY: configure-target-libada maybe-configure-target-libada
 maybe-configure-target-libada:
+@if target-libada
+maybe-configure-target-libada: configure-target-libada
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/libada/multilib.out: multilib.out
@@ -23281,21 +27670,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo Configuring in $(TARGET_SUBDIR)/libada; \
 	cd "$(TARGET_SUBDIR)/libada" || exit 1; \
 	case $(srcdir) in \
@@ -23312,44 +27687,59 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)"  \
 	  || exit 1
+@endif target-libada
 
 .PHONY: all-target-libada maybe-all-target-libada
 maybe-all-target-libada:
+@if target-libada
+maybe-all-target-libada: all-target-libada
 all-target-libada: configure-target-libada
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libada && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  all)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   all)
+@endif target-libada
 
 .PHONY: check-target-libada maybe-check-target-libada
 maybe-check-target-libada:
+@if target-libada
+maybe-check-target-libada: check-target-libada
 
 check-target-libada:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libada && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  check)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)   check)
 
+@endif target-libada
 
 .PHONY: install-target-libada maybe-install-target-libada
 maybe-install-target-libada:
+@if target-libada
+maybe-install-target-libada: install-target-libada
 
 install-target-libada: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	(cd $(TARGET_SUBDIR)/libada && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS)  install)
 
+@endif target-libada
 
 # Other targets (info, dvi, etc.)
 
 .PHONY: maybe-info-target-libada info-target-libada
 maybe-info-target-libada:
+@if target-libada
+maybe-info-target-libada: info-target-libada
 
 info-target-libada: \
     configure-target-libada 
@@ -23357,6 +27747,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing info in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23366,12 +27757,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          info) \
+	           info) \
 	  || exit 1
 
+@endif target-libada
 
 .PHONY: maybe-dvi-target-libada dvi-target-libada
 maybe-dvi-target-libada:
+@if target-libada
+maybe-dvi-target-libada: dvi-target-libada
 
 dvi-target-libada: \
     configure-target-libada 
@@ -23379,6 +27773,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing dvi in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23388,12 +27783,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          dvi) \
+	           dvi) \
 	  || exit 1
 
+@endif target-libada
 
 .PHONY: maybe-TAGS-target-libada TAGS-target-libada
 maybe-TAGS-target-libada:
+@if target-libada
+maybe-TAGS-target-libada: TAGS-target-libada
 
 TAGS-target-libada: \
     configure-target-libada 
@@ -23401,6 +27799,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing TAGS in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23410,12 +27809,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          TAGS) \
+	           TAGS) \
 	  || exit 1
 
+@endif target-libada
 
 .PHONY: maybe-install-info-target-libada install-info-target-libada
 maybe-install-info-target-libada:
+@if target-libada
+maybe-install-info-target-libada: install-info-target-libada
 
 install-info-target-libada: \
     configure-target-libada \
@@ -23424,6 +27826,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing install-info in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23433,12 +27836,15 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          install-info) \
+	           install-info) \
 	  || exit 1
 
+@endif target-libada
 
 .PHONY: maybe-installcheck-target-libada installcheck-target-libada
 maybe-installcheck-target-libada:
+@if target-libada
+maybe-installcheck-target-libada: installcheck-target-libada
 
 installcheck-target-libada: \
     configure-target-libada 
@@ -23446,6 +27852,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing installcheck in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23455,18 +27862,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          installcheck) \
+	           installcheck) \
 	  || exit 1
 
+@endif target-libada
 
 .PHONY: maybe-mostlyclean-target-libada mostlyclean-target-libada
 maybe-mostlyclean-target-libada:
+@if target-libada
+maybe-mostlyclean-target-libada: mostlyclean-target-libada
 
 mostlyclean-target-libada: 
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing mostlyclean in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23476,18 +27887,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          mostlyclean) \
+	           mostlyclean) \
 	  || exit 1
 
+@endif target-libada
 
 .PHONY: maybe-clean-target-libada clean-target-libada
 maybe-clean-target-libada:
+@if target-libada
+maybe-clean-target-libada: clean-target-libada
 
 clean-target-libada: 
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing clean in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23497,18 +27912,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          clean) \
+	           clean) \
 	  || exit 1
 
+@endif target-libada
 
 .PHONY: maybe-distclean-target-libada distclean-target-libada
 maybe-distclean-target-libada:
+@if target-libada
+maybe-distclean-target-libada: distclean-target-libada
 
 distclean-target-libada: 
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing distclean in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23518,18 +27937,22 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          distclean) \
+	           distclean) \
 	  || exit 1
 
+@endif target-libada
 
 .PHONY: maybe-maintainer-clean-target-libada maintainer-clean-target-libada
 maybe-maintainer-clean-target-libada:
+@if target-libada
+maybe-maintainer-clean-target-libada: maintainer-clean-target-libada
 
 maintainer-clean-target-libada: 
 	@[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(NORMAL_TARGET_EXPORTS) \
 	echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libada" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -23539,9 +27962,10 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          maintainer-clean) \
+	           maintainer-clean) \
 	  || exit 1
 
+@endif target-libada
 
 
 
@@ -23561,28 +27985,16 @@
 # We must skip configuring if toplevel bootstrap is going.
 .PHONY: configure-gcc maybe-configure-gcc
 maybe-configure-gcc:
+@if gcc
+maybe-configure-gcc: configure-gcc
 configure-gcc:
+@endif gcc
+@if gcc-no-bootstrap
 	@test ! -f gcc/Makefile || exit 0; \
-	[ -f stage_last ] && exit 0; \
 	[ -d gcc ] || mkdir gcc; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in gcc; \
 	cd gcc || exit 1; \
 	case $(srcdir) in \
@@ -23599,22 +28011,25 @@
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption} \
 	  || exit 1
+@endif gcc-no-bootstrap
 
 # Don't 'make all' in gcc if it's already been made by 'bootstrap'; that
 # causes trouble.  This wart will be fixed eventually by moving
 # the bootstrap behavior to this file.
 .PHONY: all-gcc maybe-all-gcc
 maybe-all-gcc:
+@if gcc
+maybe-all-gcc: all-gcc
 all-gcc: configure-gcc
+@endif gcc
+@if gcc-no-bootstrap
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	if [ -f stage_last ] ; then \
-	  true ; \
-	elif [ -f gcc/stage_last ] ; then \
-	  $(SET_LIB_PATH) \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	if [ -f gcc/stage_last ] ; then \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
 	else \
-	  $(SET_LIB_PATH) \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
 	fi
 
@@ -23634,6 +28049,7 @@
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	echo "Bootstrapping the compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
 	@r=`${PWD_COMMAND}`; export r; \
@@ -23653,28 +28069,31 @@
 	    compare=compare ;; \
 	esac; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	echo "$$msg"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
 	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
-	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
 
 profiledbootstrap: all-bootstrap configure-gcc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	echo "Bootstrapping the compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
 	$(SET_LIB_PATH) \
 	echo "Building runtime libraries and training compiler"; \
-	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	echo "Building feedback based compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build
 
@@ -23683,22 +28102,26 @@
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	echo "Building the C and C++ compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
 	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
-	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
-	  LANGUAGES="c c++" all
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
+@endif gcc-no-bootstrap
 
 .PHONY: check-gcc maybe-check-gcc
 maybe-check-gcc:
+@if gcc
+maybe-check-gcc: check-gcc
 check-gcc:
 	@if [ -f ./gcc/Makefile ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
+	  $(HOST_EXPORTS) \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
 	else \
 	  true; \
@@ -23710,6 +28133,7 @@
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
+	  $(HOST_EXPORTS) \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
 	else \
 	  true; \
@@ -23717,18 +28141,23 @@
 
 .PHONY: check-c++
 check-c++: check-target-libstdc++-v3 check-gcc-c++
+@endif gcc
 
 .PHONY: install-gcc maybe-install-gcc
 maybe-install-gcc:
+@if gcc
+maybe-install-gcc: install-gcc
 install-gcc:
 	@if [ -f ./gcc/Makefile ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
+	  $(HOST_EXPORTS) \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
 	else \
 	  true; \
 	fi
+@endif gcc
 
 # Install the gcc headers files, but not the fixed include files,
 # which Cygnus is not allowed to distribute.  This rule is very
@@ -23745,6 +28174,7 @@
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
 	  $(SET_LIB_PATH) \
+	  $(HOST_EXPORTS) \
 	  (cd ./gcc && \
 	   $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
 	  rm -rf gcc/include; \
@@ -23755,6 +28185,8 @@
 
 .PHONY: maybe-info-gcc info-gcc
 maybe-info-gcc:
+@if gcc
+maybe-info-gcc: info-gcc
 info-gcc: \
     configure-gcc 
 	@[ -f ./gcc/Makefile ] || exit 0; \
@@ -23764,6 +28196,7 @@
 	for flag in $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
+	$(HOST_EXPORTS) \
 	echo "Doing info in gcc" ; \
 	(cd gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -23772,10 +28205,13 @@
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
 	          info) \
 	  || exit 1
+@endif gcc
 
 
 .PHONY: maybe-dvi-gcc dvi-gcc
 maybe-dvi-gcc:
+@if gcc
+maybe-dvi-gcc: dvi-gcc
 dvi-gcc: \
     configure-gcc 
 	@[ -f ./gcc/Makefile ] || exit 0; \
@@ -23785,6 +28221,7 @@
 	for flag in $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
+	$(HOST_EXPORTS) \
 	echo "Doing dvi in gcc" ; \
 	(cd gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -23793,10 +28230,13 @@
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
 	          dvi) \
 	  || exit 1
+@endif gcc
 
 
 .PHONY: maybe-TAGS-gcc TAGS-gcc
 maybe-TAGS-gcc:
+@if gcc
+maybe-TAGS-gcc: TAGS-gcc
 TAGS-gcc: \
     configure-gcc 
 	@[ -f ./gcc/Makefile ] || exit 0; \
@@ -23806,6 +28246,7 @@
 	for flag in $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
+	$(HOST_EXPORTS) \
 	echo "Doing TAGS in gcc" ; \
 	(cd gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -23814,10 +28255,13 @@
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
 	          TAGS) \
 	  || exit 1
+@endif gcc
 
 
 .PHONY: maybe-install-info-gcc install-info-gcc
 maybe-install-info-gcc:
+@if gcc
+maybe-install-info-gcc: install-info-gcc
 install-info-gcc: \
     configure-gcc \
     info-gcc 
@@ -23828,6 +28272,7 @@
 	for flag in $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
+	$(HOST_EXPORTS) \
 	echo "Doing install-info in gcc" ; \
 	(cd gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -23836,10 +28281,13 @@
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
 	          install-info) \
 	  || exit 1
+@endif gcc
 
 
 .PHONY: maybe-installcheck-gcc installcheck-gcc
 maybe-installcheck-gcc:
+@if gcc
+maybe-installcheck-gcc: installcheck-gcc
 installcheck-gcc: \
     configure-gcc 
 	@[ -f ./gcc/Makefile ] || exit 0; \
@@ -23849,6 +28297,7 @@
 	for flag in $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
+	$(HOST_EXPORTS) \
 	echo "Doing installcheck in gcc" ; \
 	(cd gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -23857,10 +28306,13 @@
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
 	          installcheck) \
 	  || exit 1
+@endif gcc
 
 
 .PHONY: maybe-mostlyclean-gcc mostlyclean-gcc
 maybe-mostlyclean-gcc:
+@if gcc
+maybe-mostlyclean-gcc: mostlyclean-gcc
 mostlyclean-gcc: 
 	@[ -f ./gcc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -23869,6 +28321,7 @@
 	for flag in $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
+	$(HOST_EXPORTS) \
 	echo "Doing mostlyclean in gcc" ; \
 	(cd gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -23877,10 +28330,13 @@
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
 	          mostlyclean) \
 	  || exit 1
+@endif gcc
 
 
 .PHONY: maybe-clean-gcc clean-gcc
 maybe-clean-gcc:
+@if gcc
+maybe-clean-gcc: clean-gcc
 clean-gcc: 
 	@[ -f ./gcc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -23889,6 +28345,7 @@
 	for flag in $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
+	$(HOST_EXPORTS) \
 	echo "Doing clean in gcc" ; \
 	(cd gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -23897,10 +28354,13 @@
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
 	          clean) \
 	  || exit 1
+@endif gcc
 
 
 .PHONY: maybe-distclean-gcc distclean-gcc
 maybe-distclean-gcc:
+@if gcc
+maybe-distclean-gcc: distclean-gcc
 distclean-gcc: 
 	@[ -f ./gcc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -23909,6 +28369,7 @@
 	for flag in $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
+	$(HOST_EXPORTS) \
 	echo "Doing distclean in gcc" ; \
 	(cd gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -23917,10 +28378,13 @@
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
 	          distclean) \
 	  || exit 1
+@endif gcc
 
 
 .PHONY: maybe-maintainer-clean-gcc maintainer-clean-gcc
 maybe-maintainer-clean-gcc:
+@if gcc
+maybe-maintainer-clean-gcc: maintainer-clean-gcc
 maintainer-clean-gcc: 
 	@[ -f ./gcc/Makefile ] || exit 0; \
 	r=`${PWD_COMMAND}`; export r; \
@@ -23929,6 +28393,7 @@
 	for flag in $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
+	$(HOST_EXPORTS) \
 	echo "Doing maintainer-clean in gcc" ; \
 	(cd gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -23937,23 +28402,35 @@
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
 	          maintainer-clean) \
 	  || exit 1
+@endif gcc
 
 
 
+@if gcc-bootstrap
 # ---------------------
 # GCC bootstrap support
 # ---------------------
 
-# We name the directories for the various stages "stage1-gcc",
-# "stage2-gcc","stage3-gcc", etc.  
-# Unfortunately, the 'compare' process will fail (on debugging information)
-# if any directory names are different!
-# So in the building rule for each stage, we relocate them before and after.
-# The current one is 'gcc', while the previous one is 'prev-gcc'.  (The
-# current one must be 'gcc' for now because the scripts in that directory
-# assume it.)
-# At the end of the bootstrap, 'stage3-gcc' must be moved to 'gcc' so that
-# libraries can find it.  Ick!
+# We track the current stage (the one in 'gcc') in the stage_last file.
+# We name the build directories for the various stages "stage1-gcc",
+# "stage2-gcc","stage3-gcc", etc.
+
+# Since the 'compare' process will fail (on debugging information) if any
+# directory names are different, we need to link the gcc directory for
+# the previous stage to a constant name ('gcc-prev'), and to make the name of
+# the build directories constant as well. For the latter, we use naked names
+# like 'gcc', because the scripts in that directory assume it.  We use
+# mv on platforms where symlinks to directories do not work or are not
+# reliable.
+
+# At the end of the bootstrap, a symlink to 'stage3-gcc' named 'gcc' must
+# be kept, so that libraries can find it.  Ick!
+
+# It would be best to preinstall gcc into a staging area (and in the
+# future, gather there all prebootstrap packages).  This would allow
+# assemblers and linkers can be bootstrapped as well as the compiler
+# (both in a combined tree, or separately).  This however requires some
+# change to the gcc driver, again in order to avoid comparison failures.
 
 # Bugs: This is almost certainly not parallel-make safe.
 
@@ -23969,6 +28446,23 @@
 STAGE1_CFLAGS=@stage1_cflags@
 STAGE1_LANGUAGES=@stage1_languages@
 
+# We only want to compare .o files, so set this!
+objext = .o
+
+# Real targets act phony if they depend on phony targets; this hack
+# prevents gratuitous rebuilding of stage 1.
+prebootstrap:
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-bootstrap
+	$(STAMP) prebootstrap
+
+# Flags to pass to stage2 and later makes.
+BOOT_CFLAGS= -g -O2
+POSTSTAGE1_FLAGS_TO_PASS = \
+	CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
+	STAGE_PREFIX=$$r/stage-gcc/ \
+	CFLAGS="$(BOOT_CFLAGS)" \
+	ADAC="\$$(CC)"
+
 # For stage 1:
 # * We force-disable intermodule optimizations, even if
 #   --enable-intermodule was passed, since the installed compiler probably
@@ -23977,35 +28471,45 @@
 # * Likewise, we force-disable coverage flags, since the installed compiler
 #   probably has never heard of them.
 # * We build only C (and possibly Ada).
-configure-stage1-gcc:
-	echo configure-stage1-gcc > stage_last ; \
-	if [ -f stage1-gcc/Makefile ] ; then \
+
+
+.PHONY: stage1-start stage1-end
+
+stage1-start::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	echo stage1 > stage_last ; \
+	[ -d stage1-gcc ] || mkdir stage1-gcc; \
+	set stage1-gcc gcc ; @CREATE_LINK_TO_DIR@ 
+
+stage1-end::
+	rm -f stage_last ; \
+	set gcc stage1-gcc ; @UNDO_LINK_TO_DIR@ 
+
+# Bubble a bugfix through all the stages up to stage 1.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stage1-bubble
+stage1-bubble:: 
+	@if [ -f all-stage1-gcc ] ; then \
+	  echo Remaking stage 1 ; \
+	  rm -f all-stage1-gcc ; \
+	fi ; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage1-gcc
+
+
+
+configure-stage1-gcc:  prebootstrap 
+	$(MAKE) stage1-start
+	@if [ -f stage1-gcc/Makefile ] ; then \
 	  $(STAMP) configure-stage1-gcc ; \
 	  exit 0; \
 	else \
 	  true ; \
 	fi ; \
-	[ -d stage1-gcc ] || mkdir stage1-gcc; \
-	mv stage1-gcc gcc ; \
 	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-	echo Configuring stage 1 in gcc; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(HOST_EXPORTS)  \
+	echo Configuring stage 1 in gcc ; \
 	cd gcc || exit 1; \
 	case $(srcdir) in \
 	  \.) \
@@ -24020,62 +28524,94 @@
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule --disable-coverage \
-	  --enable-languages="$(STAGE1_LANGUAGES)"; \
-	cd .. ; \
-	mv gcc stage1-gcc ; \
-	$(STAMP) configure-stage1-gcc
+	  --disable-intermodule 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" && \
+	  $(STAMP) ../configure-stage1-gcc
 
-# Real targets act phony if they depend on phony targets; this hack
-# prevents gratuitous rebuilding of stage 1.
-prebootstrap:
-	$(MAKE) all-bootstrap
-	$(STAMP) prebootstrap
-
-all-stage1-gcc: configure-stage1-gcc prebootstrap
-	echo all-stage1-gcc > stage_last ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	mv stage1-gcc gcc ; \
+all-stage1-gcc: configure-stage1-gcc
+	$(MAKE) stage1-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(HOST_EXPORTS)  \
 	cd gcc && \
-	$(MAKE) $(GCC_FLAGS_TO_PASS) \
-		CFLAGS="$(STAGE1_CFLAGS)" \
-		|| exit 1 ; \
-	cd .. ; \
-	mv gcc stage1-gcc ; \
-	$(STAMP) all-stage1-gcc
+	$(MAKE) $(GCC_FLAGS_TO_PASS)  \
+		CFLAGS="$(STAGE1_CFLAGS)" && $(STAMP) ../all-stage1-gcc
 
-# TODO: Deal with STAGE_PREFIX (which is only for ada, incidentally)
-configure-stage2-gcc: all-stage1-gcc
-	echo configure-stage2-gcc > stage_last ; \
-	if [ -f stage2-gcc/Makefile ] ; then \
+
+
+
+
+.PHONY: restage1 touch-stage1 distclean-stage1
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+
+distclean-stage1::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	rm -rf configure-stage1-gcc all-stage1-gcc stage1-gcc 
+
+# Rules to renew the timestamp on a stage and all the following ones
+
+touch-stage1::
+	@[ -f configure-stage1-gcc ] && \
+	  echo '$(STAMP) configure-stage1-gcc' && \
+	  $(STAMP) configure-stage1-gcc; \
+	[ -f all-stage1-gcc ] && \
+	  echo '$(STAMP) all-stage1-gcc' && \
+	  $(STAMP) all-stage1-gcc; \
+	:
+
+# After building a stage, touch the following ones
+
+restage1::
+	rm -rf all-stage1-gcc 
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS)  all-stage1-gcc 
+
+
+
+
+.PHONY: stage2-start stage2-end
+
+stage2-start::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	echo stage2 > stage_last ; \
+	[ -d stage2-gcc ] || mkdir stage2-gcc; \
+	set stage2-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
+	set stage1-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
+
+stage2-end::
+	rm -f stage_last ; \
+	set gcc stage2-gcc ; @UNDO_LINK_TO_DIR@  ; \
+	set prev-gcc stage1-gcc ; @UNDO_LINK_TO_DIR@ 
+
+# Bubble a bugfix through all the stages up to stage 2.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stage2-bubble
+stage2-bubble:: stage1-bubble
+	@if [ -f all-stage2-gcc ] ; then \
+	  echo Remaking stage 2 ; \
+	  rm -f all-stage2-gcc ; \
+	fi ; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage2-gcc
+
+
+stage1-bubble::
+	@if [ -f configure-stage2-gcc ] ; then \
+	  $(STAMP) configure-stage2-gcc ; \
+	fi
+
+
+configure-stage2-gcc:  all-stage1-gcc 
+	$(MAKE) stage2-start
+	@if [ -f stage2-gcc/Makefile ] ; then \
 	  $(STAMP) configure-stage2-gcc ; \
 	  exit 0; \
 	else \
 	  true ; \
 	fi ; \
-	[ -d stage2-gcc ] || mkdir stage2-gcc; \
-	mv stage2-gcc gcc ; \
-	mv stage1-gcc prev-gcc ; \
 	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-	echo Configuring stage 2 in gcc; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(STAGE_HOST_EXPORTS)  \
+	echo Configuring stage 2 in gcc ; \
 	cd gcc || exit 1; \
 	case $(srcdir) in \
 	  \.) \
@@ -24089,68 +28625,101 @@
 	    libsrcdir="$$s/gcc";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} ; \
-	cd .. ; \
-	mv gcc stage2-gcc ; \
-	mv prev-gcc stage1-gcc ; \
-	$(STAMP) configure-stage2-gcc
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ && \
+	  $(STAMP) ../configure-stage2-gcc
 
-# Flags to pass to stage2 and later makes.
-BOOT_CFLAGS= -g -O2
-POSTSTAGE1_FLAGS_TO_PASS = \
-	CFLAGS="$(BOOT_CFLAGS)" \
-	ADAC="\$$(CC)" \
-	WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
-	STRICT_WARN="\$$(STRICT2_WARN)" \
-	OUTPUT_OPTION="-o \$$@"
-
-all-stage2-gcc: all-stage1-gcc configure-stage2-gcc
-	echo all-stage2-gcc > stage_last ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	mv stage2-gcc gcc ; \
-	mv stage1-gcc prev-gcc ; \
+all-stage2-gcc: configure-stage2-gcc
+	$(MAKE) stage2-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(STAGE_HOST_EXPORTS)  \
 	cd gcc && \
-	$(MAKE) $(GCC_FLAGS_TO_PASS) \
-		CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-		CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-		STAGE_PREFIX=$$r/prev-gcc/ \
-		$(POSTSTAGE1_FLAGS_TO_PASS) || exit 1 ; \
-	cd .. ; \
-	mv prev-gcc stage1-gcc ; \
-	mv gcc stage2-gcc ; \
-	$(STAMP) all-stage2-gcc
+	$(MAKE) $(GCC_FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 && $(STAMP) ../all-stage2-gcc
 
-configure-stage3-gcc: all-stage2-gcc
-	echo configure-stage3-gcc > stage_last ; \
-	if [ -f stage3-gcc/Makefile ] ; then \
+
+
+
+.PHONY: bootstrap2
+bootstrap2:
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) stage2-bubble  \
+	  stage2-start all stage2-end 
+
+
+.PHONY: restage2 touch-stage2 distclean-stage2
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+distclean-stage1:: distclean-stage2 
+distclean-stage2::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	rm -rf configure-stage2-gcc all-stage2-gcc stage2-gcc 
+
+# Rules to renew the timestamp on a stage and all the following ones
+touch-stage1:: touch-stage2 
+touch-stage2::
+	@[ -f configure-stage2-gcc ] && \
+	  echo '$(STAMP) configure-stage2-gcc' && \
+	  $(STAMP) configure-stage2-gcc; \
+	[ -f all-stage2-gcc ] && \
+	  echo '$(STAMP) all-stage2-gcc' && \
+	  $(STAMP) all-stage2-gcc; \
+	:
+
+# After building a stage, touch the following ones
+restage1:: touch-stage2 
+restage2::
+	rm -rf all-stage2-gcc 
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS)  all-stage2-gcc 
+
+
+
+
+.PHONY: stage3-start stage3-end
+
+stage3-start::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	echo stage3 > stage_last ; \
+	[ -d stage3-gcc ] || mkdir stage3-gcc; \
+	set stage3-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
+	set stage2-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
+
+stage3-end::
+	rm -f stage_last ; \
+	set gcc stage3-gcc ; @UNDO_LINK_TO_DIR@  ; \
+	set prev-gcc stage2-gcc ; @UNDO_LINK_TO_DIR@ 
+
+# Bubble a bugfix through all the stages up to stage 3.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stage3-bubble
+stage3-bubble:: stage2-bubble
+	@if [ -f all-stage3-gcc ] ; then \
+	  echo Remaking stage 3 ; \
+	  rm -f all-stage3-gcc ; \
+	fi ; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage3-gcc
+
+
+stage2-bubble::
+	@if [ -f configure-stage3-gcc ] ; then \
+	  $(STAMP) configure-stage3-gcc ; \
+	fi
+
+
+configure-stage3-gcc:  all-stage2-gcc 
+	$(MAKE) stage3-start
+	@if [ -f stage3-gcc/Makefile ] ; then \
 	  $(STAMP) configure-stage3-gcc ; \
 	  exit 0; \
 	else \
 	  true ; \
 	fi ; \
-	[ -d stage3-gcc ] || mkdir stage3-gcc; \
-	mv stage3-gcc gcc ; \
-	mv stage1-gcc prev-gcc ; \
 	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-	echo Configuring stage 3 in gcc; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(STAGE_HOST_EXPORTS)  \
+	echo Configuring stage 3 in gcc ; \
 	cd gcc || exit 1; \
 	case $(srcdir) in \
 	  \.) \
@@ -24164,42 +28733,32 @@
 	    libsrcdir="$$s/gcc";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} ; \
-	cd .. ; \
-	mv gcc stage3-gcc ; \
-	mv prev-gcc stage2-gcc ; \
-	$(STAMP) configure-stage3-gcc
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ && \
+	  $(STAMP) ../configure-stage3-gcc
 
-all-stage3-gcc: all-stage2-gcc configure-stage3-gcc
-	echo all-stage3-gcc > stage_last ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	mv stage2-gcc prev-gcc ; \
-	mv stage3-gcc gcc ; \
+all-stage3-gcc: configure-stage3-gcc
+	$(MAKE) stage3-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(STAGE_HOST_EXPORTS)  \
 	cd gcc && \
-	$(MAKE) $(GCC_FLAGS_TO_PASS) \
-		CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-		CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-		STAGE_PREFIX=$$r/prev-gcc/ \
-		$(POSTSTAGE1_FLAGS_TO_PASS) || exit 1 ; \
-	cd .. ; \
-	mv prev-gcc stage2-gcc ; \
-	mv gcc stage3-gcc ; \
-	$(STAMP) all-stage3-gcc
+	$(MAKE) $(GCC_FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 && $(STAMP) ../all-stage3-gcc
 
-# We only want to compare .o files, so set this!
-objext = .o
 
 compare: all-stage3-gcc
-	r=`${PWD_COMMAND}`; export r; \
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	rm -f .bad_compare ; \
 	cd stage3-gcc; \
 	files=`find . -name "*$(objext)" -print` ; \
 	cd .. ; \
 	for file in $${files} ; do \
-	  cmp --ignore-initial=16 $$r/stage2-gcc/$$file $$r/stage3-gcc/$$file \
-	      > /dev/null 2>&1; \
+	  f1=$$r/stage2-gcc/$$file; f2=$$r/stage3-gcc/$$file; \
+	  @do_compare@ > /dev/null 2>&1; \
 	  test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
 	done ; \
 	if [ -f .bad_compare ]; then \
@@ -24209,16 +28768,411 @@
 	else \
 	  true; \
 	fi ; \
-        $(STAMP) compare
+	$(STAMP) compare
 
-.PHONY: new-bootstrap
-# This target exists so that everything can be made in one pass.
-# 'all-gcc' has to avoid stomping on the bootstrap-generated gcc for
-# this to work.
-new-bootstrap: compare
-	mv stage3-gcc gcc ; \
-	$(MAKE) all ; \
-	mv gcc stage3-gcc
+
+
+.PHONY: bootstrap
+bootstrap:
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) stage3-bubble  compare  \
+	  stage3-start all stage3-end 
+
+
+.PHONY: restage3 touch-stage3 distclean-stage3
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+distclean-stage2:: distclean-stage3 
+distclean-stage3::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	rm -rf configure-stage3-gcc all-stage3-gcc stage3-gcc compare 
+
+# Rules to renew the timestamp on a stage and all the following ones
+touch-stage2:: touch-stage3 
+touch-stage3::
+	@[ -f configure-stage3-gcc ] && \
+	  echo '$(STAMP) configure-stage3-gcc' && \
+	  $(STAMP) configure-stage3-gcc; \
+	[ -f all-stage3-gcc ] && \
+	  echo '$(STAMP) all-stage3-gcc' && \
+	  $(STAMP) all-stage3-gcc; \
+	:
+
+# After building a stage, touch the following ones
+restage2:: touch-stage3 
+restage3::
+	rm -rf all-stage3-gcc compare 
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) compare 
+
+
+.PHONY: cleanstrap
+cleanstrap: distclean-stage1 bootstrap
+
+
+
+.PHONY: stage4-start stage4-end
+
+stage4-start::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	echo stage4 > stage_last ; \
+	[ -d stage4-gcc ] || mkdir stage4-gcc; \
+	set stage4-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
+	set stage3-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
+
+stage4-end::
+	rm -f stage_last ; \
+	set gcc stage4-gcc ; @UNDO_LINK_TO_DIR@  ; \
+	set prev-gcc stage3-gcc ; @UNDO_LINK_TO_DIR@ 
+
+# Bubble a bugfix through all the stages up to stage 4.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stage4-bubble
+stage4-bubble:: stage3-bubble
+	@if [ -f all-stage4-gcc ] ; then \
+	  echo Remaking stage 4 ; \
+	  rm -f all-stage4-gcc ; \
+	fi ; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage4-gcc
+
+
+stage3-bubble::
+	@if [ -f configure-stage4-gcc ] ; then \
+	  $(STAMP) configure-stage4-gcc ; \
+	fi
+
+
+configure-stage4-gcc:  all-stage3-gcc 
+	$(MAKE) stage4-start
+	@if [ -f stage4-gcc/Makefile ] ; then \
+	  $(STAMP) configure-stage4-gcc ; \
+	  exit 0; \
+	else \
+	  true ; \
+	fi ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(STAGE_HOST_EXPORTS)  \
+	echo Configuring stage 4 in gcc ; \
+	cd gcc || exit 1; \
+	case $(srcdir) in \
+	  \.) \
+	    srcdiroption="--srcdir=."; \
+	    libsrcdir=".";; \
+	  /* | [A-Za-z]:[\\/]*) \
+	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
+	    libsrcdir="$$s/gcc";; \
+	  *) \
+	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
+	    libsrcdir="$$s/gcc";; \
+	esac; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ && \
+	  $(STAMP) ../configure-stage4-gcc
+
+all-stage4-gcc: configure-stage4-gcc
+	$(MAKE) stage4-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(STAGE_HOST_EXPORTS)  \
+	cd gcc && \
+	$(MAKE) $(GCC_FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		 && $(STAMP) ../all-stage4-gcc
+
+
+compare3: all-stage4-gcc
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	rm -f .bad_compare ; \
+	cd stage4-gcc; \
+	files=`find . -name "*$(objext)" -print` ; \
+	cd .. ; \
+	for file in $${files} ; do \
+	  f1=$$r/stage3-gcc/$$file; f2=$$r/stage4-gcc/$$file; \
+	  @do_compare@ > /dev/null 2>&1; \
+	  test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
+	done ; \
+	if [ -f .bad_compare ]; then \
+	  echo "Bootstrap comparison failure!"; \
+	  cat .bad_compare; \
+	  exit 1; \
+	else \
+	  true; \
+	fi ; \
+	$(STAMP) compare3
+
+
+
+.PHONY: bootstrap4
+bootstrap4:
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) stage4-bubble  compare3  \
+	  stage4-start all stage4-end 
+
+
+.PHONY: restage4 touch-stage4 distclean-stage4
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+distclean-stage3:: distclean-stage4 
+distclean-stage4::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	rm -rf configure-stage4-gcc all-stage4-gcc stage4-gcc compare3 
+
+# Rules to renew the timestamp on a stage and all the following ones
+touch-stage3:: touch-stage4 
+touch-stage4::
+	@[ -f configure-stage4-gcc ] && \
+	  echo '$(STAMP) configure-stage4-gcc' && \
+	  $(STAMP) configure-stage4-gcc; \
+	[ -f all-stage4-gcc ] && \
+	  echo '$(STAMP) all-stage4-gcc' && \
+	  $(STAMP) all-stage4-gcc; \
+	:
+
+# After building a stage, touch the following ones
+restage3:: touch-stage4 
+restage4::
+	rm -rf all-stage4-gcc compare3 
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) compare3 
+
+
+
+
+.PHONY: stageprofile-start stageprofile-end
+
+stageprofile-start::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	echo stageprofile > stage_last ; \
+	[ -d stageprofile-gcc ] || mkdir stageprofile-gcc; \
+	set stageprofile-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
+	set stage1-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
+
+stageprofile-end::
+	rm -f stage_last ; \
+	set gcc stageprofile-gcc ; @UNDO_LINK_TO_DIR@  ; \
+	set prev-gcc stage1-gcc ; @UNDO_LINK_TO_DIR@ 
+
+# Bubble a bugfix through all the stages up to stage profile.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stageprofile-bubble
+stageprofile-bubble:: stage1-bubble
+	@if [ -f all-stageprofile-gcc ] ; then \
+	  echo Remaking stage profile ; \
+	  rm -f all-stageprofile-gcc ; \
+	fi ; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stageprofile-gcc
+
+
+stage1-bubble::
+	@if [ -f configure-stageprofile-gcc ] ; then \
+	  $(STAMP) configure-stageprofile-gcc ; \
+	fi
+
+
+configure-stageprofile-gcc:  all-stage1-gcc 
+	$(MAKE) stageprofile-start
+	@if [ -f stageprofile-gcc/Makefile ] ; then \
+	  $(STAMP) configure-stageprofile-gcc ; \
+	  exit 0; \
+	else \
+	  true ; \
+	fi ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(STAGE_HOST_EXPORTS)  \
+	echo Configuring stage profile in gcc ; \
+	cd gcc || exit 1; \
+	case $(srcdir) in \
+	  \.) \
+	    srcdiroption="--srcdir=."; \
+	    libsrcdir=".";; \
+	  /* | [A-Za-z]:[\\/]*) \
+	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
+	    libsrcdir="$$s/gcc";; \
+	  *) \
+	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
+	    libsrcdir="$$s/gcc";; \
+	esac; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ && \
+	  $(STAMP) ../configure-stageprofile-gcc
+
+all-stageprofile-gcc: configure-stageprofile-gcc
+	$(MAKE) stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(STAGE_HOST_EXPORTS)  \
+	cd gcc && \
+	$(MAKE) $(GCC_FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" && $(STAMP) ../all-stageprofile-gcc
+
+
+
+
+
+.PHONY: restageprofile touch-stageprofile distclean-stageprofile
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+distclean-stage1:: distclean-stageprofile 
+distclean-stageprofile::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	rm -rf configure-stageprofile-gcc all-stageprofile-gcc stageprofile-gcc 
+
+# Rules to renew the timestamp on a stage and all the following ones
+touch-stage1:: touch-stageprofile 
+touch-stageprofile::
+	@[ -f configure-stageprofile-gcc ] && \
+	  echo '$(STAMP) configure-stageprofile-gcc' && \
+	  $(STAMP) configure-stageprofile-gcc; \
+	[ -f all-stageprofile-gcc ] && \
+	  echo '$(STAMP) all-stageprofile-gcc' && \
+	  $(STAMP) all-stageprofile-gcc; \
+	:
+
+# After building a stage, touch the following ones
+restage1:: touch-stageprofile 
+restageprofile::
+	rm -rf all-stageprofile-gcc 
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS)  all-stageprofile-gcc 
+
+
+
+
+.PHONY: stagefeedback-start stagefeedback-end
+
+stagefeedback-start::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	echo stagefeedback > stage_last ; \
+	[ -d stagefeedback-gcc ] || mkdir stagefeedback-gcc; \
+	set stagefeedback-gcc gcc ; @CREATE_LINK_TO_DIR@  ; \
+	set stage1-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ 
+
+stagefeedback-end::
+	rm -f stage_last ; \
+	set gcc stagefeedback-gcc ; @UNDO_LINK_TO_DIR@  ; \
+	set prev-gcc stage1-gcc ; @UNDO_LINK_TO_DIR@ 
+
+# Bubble a bugfix through all the stages up to stage feedback.  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stagefeedback-bubble
+stagefeedback-bubble:: stage1-bubble
+	@if [ -f all-stagefeedback-gcc ] ; then \
+	  echo Remaking stage feedback ; \
+	  rm -f all-stagefeedback-gcc ; \
+	fi ; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stagefeedback-gcc
+
+
+stage1-bubble::
+	@if [ -f configure-stagefeedback-gcc ] ; then \
+	  $(STAMP) configure-stagefeedback-gcc ; \
+	fi
+
+
+configure-stagefeedback-gcc:  all-stage1-gcc 
+	$(MAKE) stagefeedback-start
+	@if [ -f stagefeedback-gcc/Makefile ] ; then \
+	  $(STAMP) configure-stagefeedback-gcc ; \
+	  exit 0; \
+	else \
+	  true ; \
+	fi ; \
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(STAGE_HOST_EXPORTS)  \
+	echo Configuring stage feedback in gcc ; \
+	cd gcc || exit 1; \
+	case $(srcdir) in \
+	  \.) \
+	    srcdiroption="--srcdir=."; \
+	    libsrcdir=".";; \
+	  /* | [A-Za-z]:[\\/]*) \
+	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
+	    libsrcdir="$$s/gcc";; \
+	  *) \
+	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
+	    libsrcdir="$$s/gcc";; \
+	esac; \
+	$(SHELL) $${libsrcdir}/configure \
+	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  @stage2_werror_flag@ && \
+	  $(STAMP) ../configure-stagefeedback-gcc
+
+all-stagefeedback-gcc: configure-stagefeedback-gcc
+	$(MAKE) stagefeedback-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s;  \
+	$(STAGE_HOST_EXPORTS)  \
+	cd gcc && \
+	$(MAKE) $(GCC_FLAGS_TO_PASS)  \
+		$(POSTSTAGE1_FLAGS_TO_PASS)  \
+		CFLAGS="$(BOOT_CFLAGS) -fprofile-use" && $(STAMP) ../all-stagefeedback-gcc
+
+
+
+
+
+.PHONY: restagefeedback touch-stagefeedback distclean-stagefeedback
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+distclean-stage1:: distclean-stagefeedback 
+distclean-stagefeedback::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	rm -rf configure-stagefeedback-gcc all-stagefeedback-gcc stagefeedback-gcc 
+
+# Rules to renew the timestamp on a stage and all the following ones
+touch-stage1:: touch-stagefeedback 
+touch-stagefeedback::
+	@[ -f configure-stagefeedback-gcc ] && \
+	  echo '$(STAMP) configure-stagefeedback-gcc' && \
+	  $(STAMP) configure-stagefeedback-gcc; \
+	[ -f all-stagefeedback-gcc ] && \
+	  echo '$(STAMP) all-stagefeedback-gcc' && \
+	  $(STAMP) all-stagefeedback-gcc; \
+	:
+
+# After building a stage, touch the following ones
+restage1:: touch-stagefeedback 
+restagefeedback::
+	rm -rf all-stagefeedback-gcc 
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS)  all-stagefeedback-gcc 
+
+
+
+
+
+stagefeedback-start::
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	cd stageprofile-gcc && \
+	  { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../gcc/&",' | $(SHELL); } && \
+	  { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../gcc/&",' | $(SHELL); }
+
+profiledbootstrap: all-bootstrap configure-gcc
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	echo "Bootstrapping the compiler"; \
+	$(MAKE) stageprofile-bubble distclean-stagefeedback stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
+	$(SET_LIB_PATH) \
+	echo "Building runtime libraries and training compiler"; \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	echo "Building feedback based compiler"; \
+	$(MAKE) stagefeedback-bubble stagefeedback-end
+
+@endif gcc-bootstrap
 
 # --------------------------------------
 # Dependencies between different modules
@@ -24231,15 +29185,23 @@
 # are specified by depending on a 'maybe-' target.  If you're not sure,
 # it's safer to use a soft dependency.
 
+# Build modules
+all-build-bison: maybe-all-build-texinfo
+all-build-flex: maybe-all-build-texinfo
+all-build-libiberty: maybe-all-build-texinfo
+all-build-m4: maybe-all-build-libiberty maybe-all-build-texinfo
+
 # Host modules specific to gcc.
 # GCC needs to identify certain tools.
 # GCC also needs the information exported by the intl configure script.
 configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
-all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
+all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib maybe-all-libbanshee maybe-all-libcpp
+configure-libcpp: maybe-configure-libiberty maybe-configure-intl
+all-libcpp: maybe-all-libiberty maybe-all-intl
 # This is a slightly kludgy method of getting dependencies on 
 # all-build-libiberty correct; it would be better to build it every time.
 all-gcc: maybe-all-build-libiberty
-all-bootstrap: maybe-all-libiberty maybe-all-intl maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
+all-bootstrap: maybe-all-binutils maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-gas maybe-all-intl maybe-all-ld maybe-all-libcpp maybe-all-libbanshee maybe-all-libiberty maybe-all-texinfo maybe-all-zlib 
 
 # Host modules specific to gdb.
 # GDB needs to know that the simulator is being built.
@@ -24312,8 +29274,7 @@
 configure-target-fastjar: maybe-configure-target-zlib
 all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty
 configure-target-libada: $(ALL_GCC_C)
-configure-target-libf2c: $(ALL_GCC_C)
-all-target-libf2c: maybe-all-target-libiberty
+configure-target-libgfortran: $(ALL_GCC_C)
 configure-target-libffi: $(ALL_GCC_C) 
 configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi
 all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi
@@ -24339,10 +29300,6 @@
 all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3
 configure-target-qthreads: $(ALL_GCC_C)
 
-# Dependencies of maybe-foo on foo.  These are used because, for example,
-# all-gcc only depends on all-gas if gas is present and being configured.
-@maybe_dependencies@
-
 # Serialization dependencies.  Host configures don't work well in parallel to
 # each other, due to contention over config.cache.  Target configures and 
 # build configures are similar.
diff --git a/Makefile.tpl b/Makefile.tpl
index 91fdae2..38ff3db 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -6,7 +6,7 @@
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002, 2003 Free Software Foundation
+#   1999, 2000, 2001, 2002, 2003, 2004 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
@@ -68,6 +68,8 @@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_DATA = @INSTALL_DATA@
+LN = @LN@
+LN_S = @LN_S@
 
 # -------------------------------------------------
 # Miscellaneous non-standard autoconf-set variables
@@ -105,18 +107,79 @@
   $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
 
 # This is the list of directories to be built for the build system.
-BUILD_CONFIGDIRS = libiberty
+BUILD_CONFIGDIRS = libiberty libbanshee
 # Build programs are put under this directory.
 BUILD_SUBDIR = @build_subdir@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the build system.
 BUILD_CONFIGARGS = @build_configargs@
 
+# This is the list of variables to export in the environment when
+# configuring any subdirectory.  It must also be exported whenever
+# recursing into a build directory in case that directory's Makefile
+# re-runs configure.
+BASE_EXPORTS = \
+	FLEX="$(FLEX)"; export FLEX; \
+	LEX="$(LEX)"; export LEX; \
+	BISON="$(BISON)"; export BISON; \
+	YACC="$(YACC)"; export YACC; \
+	M4="$(M4)"; export M4; \
+	MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
+
+# This is the list of variables to export in the environment when
+# configuring subdirectories for the build system.
+BUILD_EXPORTS = \
+	$(BASE_EXPORTS) \
+	AR="$(AR_FOR_BUILD)"; export AR; \
+	AS="$(AS_FOR_BUILD)"; export AS; \
+	CC="$(CC_FOR_BUILD)"; export CC; \
+	CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+	CXX="$(CXX_FOR_BUILD)"; export CXX; \
+	CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
+	GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
+	GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
+	DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
+	LD="$(LD_FOR_BUILD)"; export LD; \
+	LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
+	NM="$(NM_FOR_BUILD)"; export NM; \
+	RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
+	WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES;
+
 # This is the list of directories to built for the host system.
 SUBDIRS = @configdirs@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the host system.
 HOST_CONFIGARGS = @host_configargs@
+# This is the list of variables to export in the environment when
+# configuring subdirectories for the host system.
+HOST_EXPORTS = \
+	$(BASE_EXPORTS) \
+	CC="$(CC)"; export CC; \
+	CFLAGS="$(CFLAGS)"; export CFLAGS; \
+	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+	CXX="$(CXX)"; export CXX; \
+	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
+	AR="$(AR)"; export AR; \
+	AS="$(AS)"; export AS; \
+	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
+	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
+	LD="$(LD)"; export LD; \
+	LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
+	NM="$(NM)"; export NM; \
+	RANLIB="$(RANLIB)"; export RANLIB; \
+	WINDRES="$(WINDRES)"; export WINDRES; \
+	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
+	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
+	GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
+	GMPINC="$(HOST_GMPINC)"; export GMPINC;
+
+# Similar, for later GCC stages.
+STAGE_HOST_EXPORTS = \
+	$(HOST_EXPORTS) \
+	CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
+	CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/"; export CC_FOR_BUILD;
 
 # This is set by the configure script to the list of directories which
 # should be built using the target tools.
@@ -126,6 +189,38 @@
 # This is set by the configure script to the arguments to use when configuring
 # directories built for the target.
 TARGET_CONFIGARGS = @target_configargs@
+# This is the list of variables to export in the environment when
+# configuring subdirectories for the host system.
+BASE_TARGET_EXPORTS = \
+	$(BASE_EXPORTS) \
+	AR="$(AR_FOR_TARGET)"; export AR; \
+	AS="$(AS_FOR_TARGET)"; export AS; \
+	CC="$(CC_FOR_TARGET)"; export CC; \
+	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
+	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
+	GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
+	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
+	LD="$(LD_FOR_TARGET)"; export LD; \
+	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
+	NM="$(NM_FOR_TARGET)"; export NM; \
+	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES;
+
+RAW_CXX_TARGET_EXPORTS = \
+	$(BASE_TARGET_EXPORTS) \
+	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
+	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
+
+NORMAL_TARGET_EXPORTS = \
+	$(BASE_TARGET_EXPORTS) \
+	CXX="$(CXX_FOR_TARGET)"; export CXX;
+
+# Where to find GMP
+HOST_GMPLIBS = @gmplibs@
+HOST_GMPINC = @gmpinc@
 
 # ----------------------------------------------
 # Programs producing files for the BUILD machine
@@ -148,47 +243,55 @@
 
 CXX_FOR_BUILD = $(CXX)
 
+# Path to the build directory for a Canadian cross, empty otherwise.
+BUILD_DIR_PREFIX = @BUILD_DIR_PREFIX@
+
 # Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
 # here so that they can be overridden by Makefile fragments.
 BUILD_PREFIX = @BUILD_PREFIX@
 BUILD_PREFIX_1 = @BUILD_PREFIX_1@
 
-BISON=@BISON@
-USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \
-	    echo $$r/bison/bison -L $$s/bison/ ; \
+CONFIGURED_BISON = @CONFIGURED_BISON@
+BISON = `if [ -f $$r/$(BUILD_DIR_PREFIX)/bison/bison ] ; then \
+	    echo $$r/$(BUILD_DIR_PREFIX)/bison/bison -L $$s/bison/ ; \
 	 else \
-	    echo bison ; \
+	    echo ${CONFIGURED_BISON} ; \
 	 fi`
 
-DEFAULT_YACC = @DEFAULT_YACC@
-YACC=@YACC@
-USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \
-	    echo $$r/bison/bison -y -L $$s/bison/ ; \
-	elif [ -f $$r/byacc/byacc ] ; then \
-	    echo $$r/byacc/byacc ; \
+CONFIGURED_YACC = @CONFIGURED_YACC@
+YACC = `if [ -f $$s/$(BUILD_DIR_PREFIX)/bison/bison ] ; then \
+	    echo $$r/$(BUILD_DIR_PREFIX)/bison/bison -y -L $$s/bison/ ; \
+	elif [ -f $$s/$(BUILD_DIR_PREFIX)/byacc/byacc ] ; then \
+	    echo $$r/$(BUILD_DIR_PREFIX)/byacc/byacc ; \
 	else \
-	    echo ${DEFAULT_YACC} ; \
+	    echo ${CONFIGURED_YACC} ; \
 	fi`
 
-DEFAULT_LEX = @DEFAULT_LEX@
-LEX=@LEX@
-USUAL_LEX = `if [ -f $$r/flex/flex ] ; \
-	then echo $$r/flex/flex ; \
-	else echo ${DEFAULT_LEX} ; fi`
+CONFIGURED_FLEX = @CONFIGURED_FLEX@
+FLEX = `if [ -f $$r/$(BUILD_DIR_PREFIX)/flex/flex ] ; \
+	then echo $$r/$(BUILD_DIR_PREFIX)/flex/flex ; \
+	else echo ${CONFIGURED_FLEX} ; fi`
 
-DEFAULT_M4 = @DEFAULT_M4@
-M4 = `if [ -f $$r/m4/m4 ] ; \
-	then echo $$r/m4/m4 ; \
-	else echo ${DEFAULT_M4} ; fi`
+CONFIGURED_LEX = @CONFIGURED_LEX@
+LEX = `if [ -f $$r/$(BUILD_DIR_PREFIX)/flex/flex ] ; \
+	then echo $$r/$(BUILD_DIR_PREFIX)/flex/flex ; \
+	else echo ${CONFIGURED_LEX} ; fi`
+
+CONFIGURED_M4 = @CONFIGURED_M4@
+M4 = `if [ -f $$r/$(BUILD_DIR_PREFIX)/m4/m4 ] ; \
+	then echo $$r/$(BUILD_DIR_PREFIX)/m4/m4 ; \
+	else echo ${CONFIGURED_M4} ; fi`
 
 # For an installed makeinfo, we require it to be from texinfo 4.2 or
-# higher, else we use the "missing" dummy.
-MAKEINFO=@MAKEINFO@
-USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \
-	then echo $$r/texinfo/makeinfo/makeinfo ; \
-	else if (makeinfo --version \
+# higher, else we use the "missing" dummy.  We also pass the subdirectory
+# makeinfo even if only the Makefile is there, because Texinfo builds its
+# manual when made, and it requires its own version.
+CONFIGURED_MAKEINFO = @CONFIGURED_MAKEINFO@
+MAKEINFO = `if [ -f $$r/$(BUILD_DIR_PREFIX)/texinfo/makeinfo/Makefile ] ; \
+	then echo $$r/$(BUILD_DIR_PREFIX)/texinfo/makeinfo/makeinfo ; \
+	else if (${CONFIGURED_MAKEINFO} --version \
 	  | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \
-        then echo makeinfo; else echo $$s/missing makeinfo; fi; fi`
+        then echo ${CONFIGURED_MAKEINFO}; else echo $$s/missing makeinfo; fi; fi`
 
 # This just becomes part of the MAKEINFO definition passed down to
 # sub-makes.  It lets flags be given on the command line while still
@@ -244,11 +347,12 @@
 
 # This is the list of directories that may be needed in RPATH_ENVVAR
 # so that prorgams built for the target machine work.
-TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:
+TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libmudflap/.libs
 
 FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
 
 AR_FOR_TARGET=@AR_FOR_TARGET@
+CONFIGURED_AR_FOR_TARGET=@CONFIGURED_AR_FOR_TARGET@
 USUAL_AR_FOR_TARGET = ` \
   if [ -f $$r/binutils/ar ] ; then \
     echo $$r/binutils/ar ; \
@@ -256,11 +360,12 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(AR); \
     else \
-       echo ar | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_AR_FOR_TARGET) ; \
     fi; \
   fi`
 
 AS_FOR_TARGET=@AS_FOR_TARGET@
+CONFIGURED_AS_FOR_TARGET=@CONFIGURED_AS_FOR_TARGET@
 USUAL_AS_FOR_TARGET = ` \
   if [ -f $$r/gas/as-new ] ; then \
     echo $$r/gas/as-new ; \
@@ -270,7 +375,7 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(AS); \
     else \
-       echo as | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_AS_FOR_TARGET) ; \
     fi; \
   fi`
 
@@ -296,6 +401,7 @@
 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
 
 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
+CONFIGURED_DLLTOOL_FOR_TARGET=@CONFIGURED_DLLTOOL_FOR_TARGET@
 USUAL_DLLTOOL_FOR_TARGET = ` \
   if [ -f $$r/binutils/dlltool ] ; then \
     echo $$r/binutils/dlltool ; \
@@ -303,13 +409,15 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(DLLTOOL); \
     else \
-       echo dlltool | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_DLLTOOL_FOR_TARGET) ; \
     fi; \
   fi`
 
 GCJ_FOR_TARGET = @GCJ_FOR_TARGET@
+GFORTRAN_FOR_TARGET = @GFORTRAN_FOR_TARGET@
 
 LD_FOR_TARGET=@LD_FOR_TARGET@
+CONFIGURED_LD_FOR_TARGET=@CONFIGURED_LD_FOR_TARGET@
 USUAL_LD_FOR_TARGET = ` \
   if [ -f $$r/ld/ld-new ] ; then \
     echo $$r/ld/ld-new ; \
@@ -319,13 +427,14 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(LD); \
     else \
-       echo ld | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_LD_FOR_TARGET) ; \
     fi; \
   fi`
 
 LDFLAGS_FOR_TARGET = 
 
 NM_FOR_TARGET=@NM_FOR_TARGET@
+CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@
 USUAL_NM_FOR_TARGET = ` \
   if [ -f $$r/binutils/nm-new ] ; then \
     echo $$r/binutils/nm-new ; \
@@ -335,11 +444,12 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(NM); \
     else \
-       echo nm | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_NM_FOR_TARGET) ; \
     fi; \
   fi`
 
 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
+CONFIGURED_RANLIB_FOR_TARGET=@CONFIGURED_RANLIB_FOR_TARGET@
 USUAL_RANLIB_FOR_TARGET = ` \
   if [ -f $$r/binutils/ranlib ] ; then \
     echo $$r/binutils/ranlib ; \
@@ -351,11 +461,12 @@
          echo ranlib; \
       fi; \
     else \
-       echo ranlib | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_RANLIB_FOR_TARGET) ; \
     fi; \
   fi`
 
 WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
+CONFIGURED_WINDRES_FOR_TARGET=@CONFIGURED_WINDRES_FOR_TARGET@
 USUAL_WINDRES_FOR_TARGET = ` \
   if [ -f $$r/binutils/windres ] ; then \
     echo $$r/binutils/windres ; \
@@ -363,7 +474,7 @@
     if [ '$(host)' = '$(target)' ] ; then \
       echo $(WINDRES); \
     else \
-       echo windres | sed '$(program_transform_name)' ; \
+      echo $(CONFIGURED_WINDRES_FOR_TARGET) ; \
     fi; \
   fi`
 
@@ -375,8 +486,7 @@
 
 # The first rule in the file had better be this one.  Don't put any above it.
 # This lives here to allow makefile fragments to contain dependencies.
-all: all.normal
-.PHONY: all
+@default_target@:
 
 #### host and target specific makefile fragments come in here.
 @target_makefile_frag@
@@ -400,6 +510,8 @@
 	CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
 	RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \
 
+RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS)
+
 # Flags to pass down to most sub-makes, in which we're building with
 # the host environment.
 EXTRA_HOST_FLAGS = \
@@ -481,10 +593,15 @@
     maybe-configure-target-[+module+][+
   ENDFOR target_modules +]
 
-# The target built for a native build.
-.PHONY: all.normal
-all.normal: @all_build_modules@ all-host all-target
+# The target built for a native non-bootstrap build.
+.PHONY: all
+all: all-build all-host all-target
 
+.PHONY: all-build
+all-build: [+
+  FOR build_modules +] \
+    maybe-all-build-[+module+][+
+  ENDFOR build_modules +]
 .PHONY: all-host
 all-host: maybe-all-gcc [+
   FOR host_modules +] \
@@ -637,6 +754,7 @@
 	@if [ -f ./gcc/Makefile ] ; then \
 		r=`${PWD_COMMAND}` ; export r ; \
 		$(SET_LIB_PATH) \
+		$(HOST_EXPORTS) \
 		(cd ./gcc && \
 		$(MAKE) $(FLAGS_TO_PASS) install-headers) ; \
 	else \
@@ -685,25 +803,14 @@
 [+ FOR build_modules +]
 .PHONY: configure-build-[+module+] maybe-configure-build-[+module+]
 maybe-configure-build-[+module+]:
+@if build-[+module+]
+maybe-configure-build-[+module+]: configure-build-[+module+]
 configure-build-[+module+]:
 	@test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \
 	$(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	AR="$(AR_FOR_BUILD)"; export AR; \
-	AS="$(AS_FOR_BUILD)"; export AS; \
-	CC="$(CC_FOR_BUILD)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX_FOR_BUILD)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
-	LD="$(LD_FOR_BUILD)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
-	NM="$(NM_FOR_BUILD)"; export NM; \
-	RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
+	$(BUILD_EXPORTS) \
 	echo Configuring in $(BUILD_SUBDIR)/[+module+]; \
 	cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \
 	case $(srcdir) in \
@@ -742,15 +849,20 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(BUILD_CONFIGARGS) $${srcdiroption} \
-	  --with-build-subdir="$(BUILD_SUBDIR)" \
+	  --with-build-subdir="$(BUILD_SUBDIR)" [+extra_configure_flags+] \
 	  || exit 1
+@endif build-[+module+]
 
 .PHONY: all-build-[+module+] maybe-all-build-[+module+]
 maybe-all-build-[+module+]:
+@if build-[+module+]
+maybe-all-build-[+module+]: all-build-[+module+]
 all-build-[+module+]: configure-build-[+module+]
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	(cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all)
+	$(BUILD_EXPORTS) \
+	(cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) [+extra_make_flags+] all)
+@endif build-[+module+]
 [+ ENDFOR build_modules +]
 
 # --------------------------------------
@@ -759,26 +871,14 @@
 [+ FOR host_modules +]
 .PHONY: configure-[+module+] maybe-configure-[+module+]
 maybe-configure-[+module+]:
+@if [+module+]
+maybe-configure-[+module+]: configure-[+module+]
 configure-[+module+]:
 	@test ! -f [+module+]/Makefile || exit 0; \
 	[ -d [+module+] ] || mkdir [+module+]; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in [+module+]; \
 	cd [+module+] || exit 1; \
 	case $(srcdir) in \
@@ -793,22 +893,29 @@
 	    libsrcdir="$$s/[+module+]";; \
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} \
+	  $(HOST_CONFIGARGS) $${srcdiroption} [+extra_configure_flags+] \
 	  || exit 1
+@endif [+module+]
 
 .PHONY: all-[+module+] maybe-all-[+module+]
 maybe-all-[+module+]:
+@if [+module+]
+maybe-all-[+module+]: all-[+module+]
 all-[+module+]: configure-[+module+]
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	(cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
 	  IF with_x 
 	    +] $(X11_FLAGS_TO_PASS)[+ 
-	  ENDIF with_x +] all)
+	  ENDIF with_x +] [+extra_make_flags+] all)
+@endif [+module+]
 
 .PHONY: check-[+module+] maybe-check-[+module+]
 maybe-check-[+module+]:
+@if [+module+]
+maybe-check-[+module+]: check-[+module+]
 [+ IF no_check +]
 check-[+module+]:
 [+ ELIF no_check_cross +]
@@ -818,24 +925,29 @@
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
+	  $(HOST_EXPORTS) \
 	  (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
 	    IF with_x 
 	      +] $(X11_FLAGS_TO_PASS)[+ 
-	    ENDIF with_x +] check); \
+	    ENDIF with_x +] [+extra_make_flags+] check); \
 	fi
 [+ ELSE check +]
 check-[+module+]:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	(cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
 	  IF with_x 
 	    +] $(X11_FLAGS_TO_PASS)[+ 
-	  ENDIF with_x +] check)
+	  ENDIF with_x +] [+extra_make_flags+] check)
 [+ ENDIF no_check +]
+@endif [+module+]
 
 .PHONY: install-[+module+] maybe-install-[+module+]
 maybe-install-[+module+]:
+@if [+module+]
+maybe-install-[+module+]: install-[+module+]
 [+ IF no_install +]
 install-[+module+]:
 [+ ELSE install +]
@@ -843,16 +955,20 @@
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	(cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ 
 	  IF with_x 
 	    +] $(X11_FLAGS_TO_PASS)[+ 
-	  ENDIF with_x +] install)
+	  ENDIF with_x +] [+extra_make_flags+] install)
 [+ ENDIF no_install +]
+@endif [+module+]
 
 # Other targets (info, dvi, etc.)
 [+ FOR recursive_targets +]
 .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
 maybe-[+make_target+]-[+module+]:
+@if [+module+]
+maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
 [+ IF (match-value? = "missing" (get "make_target") ) +]
 # [+module+] doesn't support [+make_target+].
 [+make_target+]-[+module+]:
@@ -865,6 +981,7 @@
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	for flag in $(EXTRA_HOST_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
@@ -874,9 +991,10 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          [+make_target+]) \
+	          [+extra_make_flags+] [+make_target+]) \
 	  || exit 1
 [+ ENDIF +]
+@endif [+module+]
 [+ ENDFOR recursive_targets +]
 [+ ENDFOR host_modules +]
 
@@ -886,6 +1004,8 @@
 [+ FOR target_modules +]
 .PHONY: configure-target-[+module+] maybe-configure-target-[+module+]
 maybe-configure-target-[+module+]:
+@if target-[+module+]
+maybe-configure-target-[+module+]: configure-target-[+module+]
 
 # There's only one multilib.out.  Cleverer subdirs shouldn't need it copied.
 $(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out
@@ -898,27 +1018,12 @@
 	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
-	AR="$(AR_FOR_TARGET)"; export AR; \
-	AS="$(AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+ 
+	$(SET_LIB_PATH) \[+
 IF raw_cxx +]
-	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+ 
+	$(RAW_CXX_TARGET_EXPORTS) \[+
 ELSE normal_cxx +]
-	CXX="$(CXX_FOR_TARGET)"; export CXX; \[+ 
+	$(NORMAL_TARGET_EXPORTS) \[+
 ENDIF raw_cxx +]
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
-	LD="$(LD_FOR_TARGET)"; export LD; \
-	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
-	NM="$(NM_FOR_TARGET)"; export NM; \
-	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
-	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
 	echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
 	cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
 	case $(srcdir) in \
@@ -957,24 +1062,35 @@
 	rm -f no-such-file || : ; \
 	CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \
 	  $(TARGET_CONFIGARGS) $${srcdiroption} \
-	  --with-target-subdir="$(TARGET_SUBDIR)" \
+	  --with-target-subdir="$(TARGET_SUBDIR)" [+extra_configure_flags+] \
 	  || exit 1
+@endif target-[+module+]
 
 .PHONY: all-target-[+module+] maybe-all-target-[+module+]
 maybe-all-target-[+module+]:
+@if target-[+module+]
+maybe-all-target-[+module+]: all-target-[+module+]
 all-target-[+module+]: configure-target-[+module+]
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
+	$(SET_LIB_PATH) \[+
+IF raw_cxx +]
+	$(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+	$(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
 	(cd $(TARGET_SUBDIR)/[+module+] && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
 	    IF raw_cxx 
 	  +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
 	    ENDIF raw_cxx 
-	  +] all)
+	  +] [+extra_make_flags+] all)
+@endif target-[+module+]
 
 .PHONY: check-target-[+module+] maybe-check-target-[+module+]
 maybe-check-target-[+module+]:
+@if target-[+module+]
+maybe-check-target-[+module+]: check-target-[+module+]
 [+ IF no_check +]
 # Dummy target for uncheckable module.
 check-target-[+module+]:
@@ -982,17 +1098,25 @@
 check-target-[+module+]:
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
+	$(SET_LIB_PATH) \[+
+IF raw_cxx +]
+	$(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+	$(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
 	(cd $(TARGET_SUBDIR)/[+module+] && \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
 	    IF raw_cxx 
 	      +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ 
 	    ENDIF raw_cxx 
-	  +] check)
+	  +] [+extra_make_flags+] check)
 [+ ENDIF no_check +]
+@endif target-[+module+]
 
 .PHONY: install-target-[+module+] maybe-install-target-[+module+]
 maybe-install-target-[+module+]:
+@if target-[+module+]
+maybe-install-target-[+module+]: install-target-[+module+]
 [+ IF no_install +]
 # Dummy target for uninstallable.
 install-target-[+module+]:
@@ -1000,15 +1124,23 @@
 install-target-[+module+]: installdirs
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
+	$(SET_LIB_PATH) \[+
+IF raw_cxx +]
+	$(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+	$(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
 	(cd $(TARGET_SUBDIR)/[+module+] && \
-	  $(MAKE) $(TARGET_FLAGS_TO_PASS) install)
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install)
 [+ ENDIF no_install +]
+@endif target-[+module+]
 
 # Other targets (info, dvi, etc.)
 [+ FOR recursive_targets +]
 .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
 maybe-[+make_target+]-target-[+module+]:
+@if target-[+module+]
+maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
 [+ IF (match-value? = "missing" (get "make_target") ) +]
 # [+module+] doesn't support [+make_target+].
 [+make_target+]-target-[+module+]:
@@ -1020,7 +1152,12 @@
 	@[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	$(SET_LIB_PATH) \
+	$(SET_LIB_PATH) \[+
+IF raw_cxx +]
+	$(RAW_CXX_TARGET_EXPORTS) \[+
+ELSE normal_cxx +]
+	$(NORMAL_TARGET_EXPORTS) \[+
+ENDIF raw_cxx +]
 	echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \
 	for flag in $(EXTRA_TARGET_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
@@ -1030,9 +1167,10 @@
 	          "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
 	          "RANLIB=$${RANLIB}" \
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
-	          [+make_target+]) \
+	          [+extra_make_flags+] [+make_target+]) \
 	  || exit 1
 [+ ENDIF +]
+@endif target-[+module+]
 [+ ENDFOR recursive_targets +]
 [+ ENDFOR target_modules +]
 
@@ -1052,28 +1190,16 @@
 # We must skip configuring if toplevel bootstrap is going.
 .PHONY: configure-gcc maybe-configure-gcc
 maybe-configure-gcc:
+@if gcc
+maybe-configure-gcc: configure-gcc
 configure-gcc:
+@endif gcc
+@if gcc-no-bootstrap
 	@test ! -f gcc/Makefile || exit 0; \
-	[ -f stage_last ] && exit 0; \
 	[ -d gcc ] || mkdir gcc; \
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
+	$(HOST_EXPORTS) \
 	echo Configuring in gcc; \
 	cd gcc || exit 1; \
 	case $(srcdir) in \
@@ -1090,22 +1216,25 @@
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption} \
 	  || exit 1
+@endif gcc-no-bootstrap
 
 # Don't 'make all' in gcc if it's already been made by 'bootstrap'; that
 # causes trouble.  This wart will be fixed eventually by moving
 # the bootstrap behavior to this file.
 .PHONY: all-gcc maybe-all-gcc
 maybe-all-gcc:
+@if gcc
+maybe-all-gcc: all-gcc
 all-gcc: configure-gcc
+@endif gcc
+@if gcc-no-bootstrap
 	r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	if [ -f stage_last ] ; then \
-	  true ; \
-	elif [ -f gcc/stage_last ] ; then \
-	  $(SET_LIB_PATH) \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	if [ -f gcc/stage_last ] ; then \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \
 	else \
-	  $(SET_LIB_PATH) \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \
 	fi
 
@@ -1125,6 +1254,7 @@
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	echo "Bootstrapping the compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@
 	@r=`${PWD_COMMAND}`; export r; \
@@ -1144,28 +1274,31 @@
 	    compare=compare ;; \
 	esac; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	echo "$$msg"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
 	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
-	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
 
 profiledbootstrap: all-bootstrap configure-gcc
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	echo "Bootstrapping the compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
 	$(SET_LIB_PATH) \
 	echo "Building runtime libraries and training compiler"; \
-	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	echo "Building feedback based compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build
 
@@ -1174,22 +1307,26 @@
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
 	echo "Building the C and C++ compiler"; \
 	cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
 	$(SET_LIB_PATH) \
 	echo "Building runtime libraries"; \
-	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \
-	  LANGUAGES="c c++" all
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
+@endif gcc-no-bootstrap
 
 .PHONY: check-gcc maybe-check-gcc
 maybe-check-gcc:
+@if gcc
+maybe-check-gcc: check-gcc
 check-gcc:
 	@if [ -f ./gcc/Makefile ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
+	  $(HOST_EXPORTS) \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \
 	else \
 	  true; \
@@ -1201,6 +1338,7 @@
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
+	  $(HOST_EXPORTS) \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
 	else \
 	  true; \
@@ -1208,18 +1346,23 @@
 
 .PHONY: check-c++
 check-c++: check-target-libstdc++-v3 check-gcc-c++
+@endif gcc
 
 .PHONY: install-gcc maybe-install-gcc
 maybe-install-gcc:
+@if gcc
+maybe-install-gcc: install-gcc
 install-gcc:
 	@if [ -f ./gcc/Makefile ] ; then \
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	  $(SET_LIB_PATH) \
+	  $(HOST_EXPORTS) \
 	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
 	else \
 	  true; \
 	fi
+@endif gcc
 
 # Install the gcc headers files, but not the fixed include files,
 # which Cygnus is not allowed to distribute.  This rule is very
@@ -1236,6 +1379,7 @@
 	  r=`${PWD_COMMAND}`; export r; \
 	  s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
 	  $(SET_LIB_PATH) \
+	  $(HOST_EXPORTS) \
 	  (cd ./gcc && \
 	   $(MAKE) $(GCC_FLAGS_TO_PASS) install); \
 	  rm -rf gcc/include; \
@@ -1246,6 +1390,8 @@
 [+ FOR recursive_targets +]
 .PHONY: maybe-[+make_target+]-gcc [+make_target+]-gcc
 maybe-[+make_target+]-gcc:
+@if gcc
+maybe-[+make_target+]-gcc: [+make_target+]-gcc
 [+make_target+]-gcc: [+
   FOR depend +]\
     [+depend+]-gcc [+
@@ -1257,6 +1403,7 @@
 	for flag in $(EXTRA_GCC_FLAGS); do \
 	  eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
 	done; \
+	$(HOST_EXPORTS) \
 	echo "Doing [+make_target+] in gcc" ; \
 	(cd gcc && \
 	  $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
@@ -1265,23 +1412,35 @@
 	          "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
 	          [+make_target+]) \
 	  || exit 1
+@endif gcc
 
 [+ ENDFOR recursive_targets +]
 
+@if gcc-bootstrap
 # ---------------------
 # GCC bootstrap support
 # ---------------------
 
-# We name the directories for the various stages "stage1-gcc",
-# "stage2-gcc","stage3-gcc", etc.  
-# Unfortunately, the 'compare' process will fail (on debugging information)
-# if any directory names are different!
-# So in the building rule for each stage, we relocate them before and after.
-# The current one is 'gcc', while the previous one is 'prev-gcc'.  (The
-# current one must be 'gcc' for now because the scripts in that directory
-# assume it.)
-# At the end of the bootstrap, 'stage3-gcc' must be moved to 'gcc' so that
-# libraries can find it.  Ick!
+# We track the current stage (the one in 'gcc') in the stage_last file.
+# We name the build directories for the various stages "stage1-gcc",
+# "stage2-gcc","stage3-gcc", etc.
+
+# Since the 'compare' process will fail (on debugging information) if any
+# directory names are different, we need to link the gcc directory for
+# the previous stage to a constant name ('gcc-prev'), and to make the name of
+# the build directories constant as well. For the latter, we use naked names
+# like 'gcc', because the scripts in that directory assume it.  We use
+# mv on platforms where symlinks to directories do not work or are not
+# reliable.
+
+# At the end of the bootstrap, a symlink to 'stage3-gcc' named 'gcc' must
+# be kept, so that libraries can find it.  Ick!
+
+# It would be best to preinstall gcc into a staging area (and in the
+# future, gather there all prebootstrap packages).  This would allow
+# assemblers and linkers can be bootstrapped as well as the compiler
+# (both in a combined tree, or separately).  This however requires some
+# change to the gcc driver, again in order to avoid comparison failures.
 
 # Bugs: This is almost certainly not parallel-make safe.
 
@@ -1297,6 +1456,23 @@
 STAGE1_CFLAGS=@stage1_cflags@
 STAGE1_LANGUAGES=@stage1_languages@
 
+# We only want to compare .o files, so set this!
+objext = .o
+
+# Real targets act phony if they depend on phony targets; this hack
+# prevents gratuitous rebuilding of stage 1.
+prebootstrap:
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-bootstrap
+	$(STAMP) prebootstrap
+
+# Flags to pass to stage2 and later makes.
+BOOT_CFLAGS= -g -O2
+POSTSTAGE1_FLAGS_TO_PASS = \
+	CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
+	STAGE_PREFIX=$$r/stage[+prev+]-gcc/ \
+	CFLAGS="$(BOOT_CFLAGS)" \
+	ADAC="\$$(CC)"
+
 # For stage 1:
 # * We force-disable intermodule optimizations, even if
 #   --enable-intermodule was passed, since the installed compiler probably
@@ -1305,35 +1481,54 @@
 # * Likewise, we force-disable coverage flags, since the installed compiler
 #   probably has never heard of them.
 # * We build only C (and possibly Ada).
-configure-stage1-gcc:
-	echo configure-stage1-gcc > stage_last ; \
-	if [ -f stage1-gcc/Makefile ] ; then \
-	  $(STAMP) configure-stage1-gcc ; \
+
+[+ FOR bootstrap-stage +]
+.PHONY: stage[+id+]-start stage[+id+]-end
+
+stage[+id+]-start::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	echo stage[+id+] > stage_last ; \
+	[ -d stage[+id+]-gcc ] || mkdir stage[+id+]-gcc; \
+	set stage[+id+]-gcc gcc ; @CREATE_LINK_TO_DIR@ [+ IF prev +] ; \
+	set stage[+prev+]-gcc prev-gcc ; @CREATE_LINK_TO_DIR@ [+ ENDIF prev +]
+
+stage[+id+]-end::
+	rm -f stage_last ; \
+	set gcc stage[+id+]-gcc ; @UNDO_LINK_TO_DIR@ [+ IF prev +] ; \
+	set prev-gcc stage[+prev+]-gcc ; @UNDO_LINK_TO_DIR@ [+ ENDIF prev +]
+
+# Bubble a bugfix through all the stages up to stage [+id+].  They
+# are remade, but not reconfigured.  The next stage (if any) will not
+# be reconfigured as well.
+.PHONY: stage[+id+]-bubble
+stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
+	@if [ -f all-stage[+id+]-gcc ] ; then \
+	  echo Remaking stage [+id+] ; \
+	  rm -f all-stage[+id+]-gcc ; \
+	fi ; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]-gcc
+
+[+ IF prev +]
+stage[+prev+]-bubble::
+	@if [ -f configure-stage[+id+]-gcc ] ; then \
+	  $(STAMP) configure-stage[+id+]-gcc ; \
+	fi
+[+ ENDIF prev +]
+
+configure-stage[+id+]-gcc: [+ IF prev +] all-stage[+prev+]-gcc [+
+	  ELSE +] prebootstrap [+ ENDIF prev +]
+	$(MAKE) stage[+id+]-start
+	@if [ -f stage[+id+]-gcc/Makefile ] ; then \
+	  $(STAMP) configure-stage[+id+]-gcc ; \
 	  exit 0; \
 	else \
 	  true ; \
 	fi ; \
-	[ -d stage1-gcc ] || mkdir stage1-gcc; \
-	mv stage1-gcc gcc ; \
 	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-	echo Configuring stage 1 in gcc; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
+	$(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
+	$(HOST_EXPORTS) [+ ENDIF prev +] \
+	echo Configuring stage [+id+] in gcc ; \
 	cd gcc || exit 1; \
 	case $(srcdir) in \
 	  \.) \
@@ -1348,186 +1543,32 @@
 	esac; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) $${srcdiroption} \
-	  --disable-intermodule --disable-coverage \
-	  --enable-languages="$(STAGE1_LANGUAGES)"; \
-	cd .. ; \
-	mv gcc stage1-gcc ; \
-	$(STAMP) configure-stage1-gcc
+	  [+extra_configure_flags+] && \
+	  $(STAMP) ../configure-stage[+id+]-gcc
 
-# Real targets act phony if they depend on phony targets; this hack
-# prevents gratuitous rebuilding of stage 1.
-prebootstrap:
-	$(MAKE) all-bootstrap
-	$(STAMP) prebootstrap
-
-all-stage1-gcc: configure-stage1-gcc prebootstrap
-	echo all-stage1-gcc > stage_last ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	mv stage1-gcc gcc ; \
+all-stage[+id+]-gcc: configure-stage[+id+]-gcc
+	$(MAKE) stage[+id+]-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \
+	$(STAGE_HOST_EXPORTS) [+ ELSE prev +] \
+	$(HOST_EXPORTS) [+ ENDIF prev +] \
 	cd gcc && \
-	$(MAKE) $(GCC_FLAGS_TO_PASS) \
-		CFLAGS="$(STAGE1_CFLAGS)" \
-		|| exit 1 ; \
-	cd .. ; \
-	mv gcc stage1-gcc ; \
-	$(STAMP) all-stage1-gcc
+	$(MAKE) $(GCC_FLAGS_TO_PASS) [+ IF prev +] \
+		$(POSTSTAGE1_FLAGS_TO_PASS) [+ ENDIF prev +] \
+		[+extra_make_flags+] && $(STAMP) ../all-stage[+id+]-gcc
 
-# TODO: Deal with STAGE_PREFIX (which is only for ada, incidentally)
-configure-stage2-gcc: all-stage1-gcc
-	echo configure-stage2-gcc > stage_last ; \
-	if [ -f stage2-gcc/Makefile ] ; then \
-	  $(STAMP) configure-stage2-gcc ; \
-	  exit 0; \
-	else \
-	  true ; \
-	fi ; \
-	[ -d stage2-gcc ] || mkdir stage2-gcc; \
-	mv stage2-gcc gcc ; \
-	mv stage1-gcc prev-gcc ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-	echo Configuring stage 2 in gcc; \
-	cd gcc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} ; \
-	cd .. ; \
-	mv gcc stage2-gcc ; \
-	mv prev-gcc stage1-gcc ; \
-	$(STAMP) configure-stage2-gcc
-
-# Flags to pass to stage2 and later makes.
-BOOT_CFLAGS= -g -O2
-POSTSTAGE1_FLAGS_TO_PASS = \
-	CFLAGS="$(BOOT_CFLAGS)" \
-	ADAC="\$$(CC)" \
-	WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
-	STRICT_WARN="\$$(STRICT2_WARN)" \
-	OUTPUT_OPTION="-o \$$@"
-
-all-stage2-gcc: all-stage1-gcc configure-stage2-gcc
-	echo all-stage2-gcc > stage_last ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	mv stage2-gcc gcc ; \
-	mv stage1-gcc prev-gcc ; \
-	cd gcc && \
-	$(MAKE) $(GCC_FLAGS_TO_PASS) \
-		CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-		CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-		STAGE_PREFIX=$$r/prev-gcc/ \
-		$(POSTSTAGE1_FLAGS_TO_PASS) || exit 1 ; \
-	cd .. ; \
-	mv prev-gcc stage1-gcc ; \
-	mv gcc stage2-gcc ; \
-	$(STAMP) all-stage2-gcc
-
-configure-stage3-gcc: all-stage2-gcc
-	echo configure-stage3-gcc > stage_last ; \
-	if [ -f stage3-gcc/Makefile ] ; then \
-	  $(STAMP) configure-stage3-gcc ; \
-	  exit 0; \
-	else \
-	  true ; \
-	fi ; \
-	[ -d stage3-gcc ] || mkdir stage3-gcc; \
-	mv stage3-gcc gcc ; \
-	mv stage1-gcc prev-gcc ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
-	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
-	CC="$(CC)"; export CC; \
-	CFLAGS="$(CFLAGS)"; export CFLAGS; \
-	CXX="$(CXX)"; export CXX; \
-	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
-	AR="$(AR)"; export AR; \
-	AS="$(AS)"; export AS; \
-	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
-	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
-	LD="$(LD)"; export LD; \
-	NM="$(NM)"; export NM; \
-	RANLIB="$(RANLIB)"; export RANLIB; \
-	WINDRES="$(WINDRES)"; export WINDRES; \
-	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
-	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
-	echo Configuring stage 3 in gcc; \
-	cd gcc || exit 1; \
-	case $(srcdir) in \
-	  \.) \
-	    srcdiroption="--srcdir=."; \
-	    libsrcdir=".";; \
-	  /* | [A-Za-z]:[\\/]*) \
-	    srcdiroption="--srcdir=$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	  *) \
-	    srcdiroption="--srcdir=../$(srcdir)/gcc"; \
-	    libsrcdir="$$s/gcc";; \
-	esac; \
-	$(SHELL) $${libsrcdir}/configure \
-	  $(HOST_CONFIGARGS) $${srcdiroption} ; \
-	cd .. ; \
-	mv gcc stage3-gcc ; \
-	mv prev-gcc stage2-gcc ; \
-	$(STAMP) configure-stage3-gcc
-
-all-stage3-gcc: all-stage2-gcc configure-stage3-gcc
-	echo all-stage3-gcc > stage_last ; \
-	r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	mv stage2-gcc prev-gcc ; \
-	mv stage3-gcc gcc ; \
-	cd gcc && \
-	$(MAKE) $(GCC_FLAGS_TO_PASS) \
-		CC="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-		CC_FOR_BUILD="$(STAGE_CC_WRAPPER) $$r/prev-gcc/xgcc$(exeext) -B$$r/prev-gcc/ -B$(build_tooldir)/bin/" \
-		STAGE_PREFIX=$$r/prev-gcc/ \
-		$(POSTSTAGE1_FLAGS_TO_PASS) || exit 1 ; \
-	cd .. ; \
-	mv prev-gcc stage2-gcc ; \
-	mv gcc stage3-gcc ; \
-	$(STAMP) all-stage3-gcc
-
-# We only want to compare .o files, so set this!
-objext = .o
-
-compare: all-stage3-gcc
-	r=`${PWD_COMMAND}`; export r; \
+[+ IF compare-target +]
+[+compare-target+]: all-stage[+id+]-gcc
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
 	rm -f .bad_compare ; \
-	cd stage3-gcc; \
+	cd stage[+id+]-gcc; \
 	files=`find . -name "*$(objext)" -print` ; \
 	cd .. ; \
 	for file in $${files} ; do \
-	  cmp --ignore-initial=16 $$r/stage2-gcc/$$file $$r/stage3-gcc/$$file \
-	      > /dev/null 2>&1; \
+	  f1=$$r/stage[+prev+]-gcc/$$file; f2=$$r/stage[+id+]-gcc/$$file; \
+	  @do_compare@ > /dev/null 2>&1; \
 	  test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
 	done ; \
 	if [ -f .bad_compare ]; then \
@@ -1537,16 +1578,81 @@
 	else \
 	  true; \
 	fi ; \
-        $(STAMP) compare
+	$(STAMP) [+compare-target+]
+[+ ENDIF compare-target +]
 
-.PHONY: new-bootstrap
-# This target exists so that everything can be made in one pass.
-# 'all-gcc' has to avoid stomping on the bootstrap-generated gcc for
-# this to work.
-new-bootstrap: compare
-	mv stage3-gcc gcc ; \
-	$(MAKE) all ; \
-	mv gcc stage3-gcc
+[+ IF bootstrap-target +]
+.PHONY: [+bootstrap-target+]
+[+bootstrap-target+]:
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble [+
+	  IF compare-target +] [+compare-target+] [+
+	  ENDIF compare-target +] \
+	  stage[+id+]-start all stage[+id+]-end 
+[+ ENDIF bootstrap-target +]
+
+.PHONY: restage[+id+] touch-stage[+id+] distclean-stage[+id+]
+
+# Rules to wipe a stage and all the following ones, used for cleanstrap
+[+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +]
+distclean-stage[+id+]::
+	[ -f stage_last ] && $(MAKE) `cat stage_last`-end || :
+	rm -rf configure-stage[+id+]-gcc all-stage[+id+]-gcc stage[+id+]-gcc [+
+	  IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
+
+# Rules to renew the timestamp on a stage and all the following ones
+[+ IF prev +]touch-stage[+prev+]:: touch-stage[+id+] [+ ENDIF prev +]
+touch-stage[+id+]::
+	@[ -f configure-stage[+id+]-gcc ] && \
+	  echo '$(STAMP) configure-stage[+id+]-gcc' && \
+	  $(STAMP) configure-stage[+id+]-gcc; \
+	[ -f all-stage[+id+]-gcc ] && \
+	  echo '$(STAMP) all-stage[+id+]-gcc' && \
+	  $(STAMP) all-stage[+id+]-gcc; \
+	:
+
+# After building a stage, touch the following ones
+[+ IF prev +]restage[+prev+]:: touch-stage[+id+] [+ ENDIF prev +]
+restage[+id+]::
+	rm -rf all-stage[+id+]-gcc [+
+	  IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) [+
+	  IF compare-target +][+compare-target+] [+
+	  ELSE +] all-stage[+id+]-gcc [+ ENDIF compare-target +]
+
+[+ IF cleanstrap-target +]
+.PHONY: [+cleanstrap-target+]
+[+cleanstrap-target+]: distclean-stage1 [+bootstrap-target+]
+[+ ENDIF cleanstrap-target +]
+
+[+ ENDFOR bootstrap-stage +]
+
+stagefeedback-start::
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	cd stageprofile-gcc && \
+	  { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../gcc/&",' | $(SHELL); } && \
+	  { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../gcc/&",' | $(SHELL); }
+
+profiledbootstrap: all-bootstrap configure-gcc
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	echo "Bootstrapping the compiler"; \
+	$(MAKE) stageprofile-bubble distclean-stagefeedback stageprofile-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \
+	$(SET_LIB_PATH) \
+	echo "Building runtime libraries and training compiler"; \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(SET_LIB_PATH) \
+	$(HOST_EXPORTS) \
+	echo "Building feedback based compiler"; \
+	$(MAKE) stagefeedback-bubble stagefeedback-end
+
+@endif gcc-bootstrap
 
 # --------------------------------------
 # Dependencies between different modules
@@ -1559,15 +1665,23 @@
 # are specified by depending on a 'maybe-' target.  If you're not sure,
 # it's safer to use a soft dependency.
 
+# Build modules
+all-build-bison: maybe-all-build-texinfo
+all-build-flex: maybe-all-build-texinfo
+all-build-libiberty: maybe-all-build-texinfo
+all-build-m4: maybe-all-build-libiberty maybe-all-build-texinfo
+
 # Host modules specific to gcc.
 # GCC needs to identify certain tools.
 # GCC also needs the information exported by the intl configure script.
 configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
-all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
+all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib maybe-all-libbanshee maybe-all-libcpp
+configure-libcpp: maybe-configure-libiberty maybe-configure-intl
+all-libcpp: maybe-all-libiberty maybe-all-intl
 # This is a slightly kludgy method of getting dependencies on 
 # all-build-libiberty correct; it would be better to build it every time.
 all-gcc: maybe-all-build-libiberty
-all-bootstrap: maybe-all-libiberty maybe-all-intl maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib
+all-bootstrap: [+ FOR host_modules +][+ IF bootstrap +]maybe-all-[+module+] [+ ENDIF bootstrap +][+ ENDFOR host_modules +]
 
 # Host modules specific to gdb.
 # GDB needs to know that the simulator is being built.
@@ -1640,8 +1754,7 @@
 configure-target-fastjar: maybe-configure-target-zlib
 all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty
 configure-target-libada: $(ALL_GCC_C)
-configure-target-libf2c: $(ALL_GCC_C)
-all-target-libf2c: maybe-all-target-libiberty
+configure-target-libgfortran: $(ALL_GCC_C)
 configure-target-libffi: $(ALL_GCC_C) 
 configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi
 all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi
@@ -1667,10 +1780,6 @@
 all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3
 configure-target-qthreads: $(ALL_GCC_C)
 
-# Dependencies of maybe-foo on foo.  These are used because, for example,
-# all-gcc only depends on all-gas if gas is present and being configured.
-@maybe_dependencies@
-
 # Serialization dependencies.  Host configures don't work well in parallel to
 # each other, due to contention over config.cache.  Target configures and 
 # build configures are similar.
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6560ebc..b300f86 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,1877 @@
+2004-07-09  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR 240
+	* elfxx-ia64.c (elfNN_ia64_relax_section): Only warn br in
+	.init/.fini sections when trying to relax it.
+
+2004-07-09  Jie Zhang  <zhangjie@magima.com.cn>
+
+	* elf.c (assign_file_positions_for_segments): Make sure the
+	.dynamic section is the first section in the PT_DYNAMIC segment.
+
+2004-07-09  Nick Clifton  <nickc@redhat.com>
+
+	* config.bfd: Change sh-sybmian-elf to sh-*-symbianelf.
+	* elf32-sh-symbian.c: Rename the sh_find_elf_flags and
+	sh_elf_get_flags_from_mach functions so that they do not conflict
+	when this target is built with other sh-elf targets.
+	* elf32-sh.c (sh_elf_get_flags_from_mach): Remove bogus
+	suppression of this function.
+	(sh_elf_find_flags): Likewise.
+
+2004-07-07  Tomer Levi  <Tomer.Levi@nsc.com>
+
+	* Makefile.am (ALL_MACHINES): Add cpu-crx.lo.
+	(ALL_MACHINES_CFILES): Add cpu-crx.c.
+	(BFD32_BACKENDS): Add elf32-crx.lo.
+	(BFD32_BACKENDS_CFILES): Add elf32-crx.c.
+	(cpu-crx.lo): New target.
+	(elf32-crx.lo): New target.
+	* Makefile.in: Regenerate.
+	* archures.c (bfd_architecture): Add bfd_{arch,mach}_crx.
+	(bfd_archures_list): Add bfd_crx_arch.
+	* bfd-in2.h: Regenerate.
+	* config.bfd: Handle crx-*-elf*, crx*.
+	* configure.in: Handle bfd_elf32_crx_vec.
+	* configure: Regenerate.
+	* cpu-crx.c: New file.
+	* elf32-crx.c: Likewise.
+	* libbfd.h: Regenerate.
+	* reloc.c: Add BFD_RELOC_CRX_REL4, BFD_RELOC_CRX_REL8,
+	BFD_RELOC_CRX_REL8_CMP, BFD_RELOC_CRX_REL16, BFD_RELOC_CRX_REL24,
+	BFD_RELOC_CRX_REL32, BFD_RELOC_CRX_REGREL12, BFD_RELOC_CRX_REGREL22,
+	BFD_RELOC_CRX_REGREL28, BFD_RELOC_CRX_REGREL32, BFD_RELOC_CRX_ABS16,
+	BFD_RELOC_CRX_ABS32, BFD_RELOC_CRX_NUM8, BFD_RELOC_CRX_NUM16,
+	BFD_RELOC_CRX_NUM32, BFD_RELOC_CRX_IMM16 and BFD_RELOC_CRX_IMM32
+	* targets.c (bfd_elf32_crx_vec): Declare.
+	(bfd_target_vector): Add bfd_elf32_crx_vec.
+
+2004-07-06  Nick Clifton  <nickc@redhat.com>
+
+	* config.bfd: Add sh-symbian-elf target.
+	* configure.in: Add bfd_elf32_shl_symbian_vec.
+	* configure: Regenerate.
+	* elf-bfd.h (struct elf_backend_data): Add new field
+	'check_directives'.
+	* elflink.c (elf_link_add_object_symbols): Invoke the
+	check_directives function, if defined.
+	* elfxx-target.h: Provide a default, NULL definition for
+	check_directives.
+	* targets.c: Add bfd_elf32_shl_symbian_vec.
+	* elf32-sh.c (sh_elf_swap_insns): Protect against unnecessary
+	definition.
+	(elf32_shlin_grok_prstatus, elf32_shlib_grok_psinfo,
+	* sh_elf_get_flags_from_mach, sh_elf_find_flags): Likewise.
+	(TARGET_BIG_SYM, TARGET_LITTLE_SYM): Only define if they have
+	not already been defined.
+	* elf32-sh64.c: Use SH_TARGET_ALREADY_DEFINED.
+	* sh-symbian.c: New file.  Provide functions to support the
+	* sh-symbian-elf target.
+	* Makefile.am: Add elf32-sh-symbian.c
+	* Makefile.in: Regenerate.
+
+2004-07-05  Andrew Stubbs <andrew.stubbs@superh.com>
+
+	* elf32-sh.c: Include ../opcodes/sh-opc.h.
+	* Makefile.am: Ran make dep-am.
+	* Makefile.in: Ran make dep-in.
+
+2004-07-03  Aaron W. LaFramboise  <aaron98wiridge9@aaronwl.com>
+
+	* cofflink.c (_bfd_coff_generic_relocate_section): Resolve PE weak
+	externals properly.
+
+2004-07-02  Martin Schwidefsky  <schwidefsky@de.ibm.com>
+
+	* config.bfd: Add want64 to configuration target s390-*-linux*.
+
+2004-07-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* bfd.c (bfd_get_section_ident): New.
+
+	* elflink.c (elf_link_read_relocs_from_section): Call
+	bfd_get_section_ident to identify the section when reporting
+	error.
+	(_bfd_elf_link_output_relocs): Likewise.
+	(elf_link_output_extsym): Likewise.
+	(elf_link_input_bfd): Likewise.
+	(bfd_elf_gc_record_vtinherit): Likewise.
+
+	* bfd-in2.h: Regenerated.
+
+2004-07-01  Jie Zhang  <zhangjie@magima.com.cn>
+	    Nick Clifton  <nickc@redhat.com>
+
+	PR 204
+	* elfxx-mips.c (_bfd_mips_elf_final_link): Pass the correct number
+	of section symbols to mips_elf_sort_hash_table ().
+
+2004-07-01  Alan Modra  <amodra@bigpond.net.au>
+
+	* elflink.c (elf_section_ignore_discarded_relocs): Revert last
+	change.  Comment.
+	(elf_section_complain_discarded): New function.  Handle
+	.gcc_except_table too.
+	(elf_link_input_bfd): Rewrite handling of relocs against symbols
+	in discarded sections.
+	* elf-bfd.h (elf_discarded_section): Protect macro arg.
+
+2004-06-30  James E Wilson  <wilson@specifixinc.com>
+
+	* elfxx-ia64.c (elfNN_ia64_check_relocs): New local pltoff.  Initialize
+	to NULL.  Call get_pltoff if NULL and NEED_PLTOFF is true.
+
+2004-06-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR 233
+	* elflink.c (elf_link_input_bfd): Issue an error for non-debug
+	local references to discarded sections and report their
+	locations.
+
+2004-06-30  Alan Modra  <amodra@bigpond.net.au>
+
+	* elflink.c (elf_section_ignore_discarded_relocs): Don't test
+	sec_info_type, test section name instead.
+
+2004-06-29  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR 240
+	* elfxx-ia64.c (elfNN_ia64_relax_section): Don't relax branch
+	in .init/.fini sections.
+
+2004-06-29  Bob Wilson  <bob.wilson@acm.org>
+
+	* elf32-xtensa.c (elf_xtensa_relocate_section): Use
+	bfd_get_section_limit.
+
+2004-06-29  Bob Wilson  <bob.wilson@acm.org>
+
+	* elf32-xtensa.c (elf_xtensa_combine_prop_entries): Don't change the
+	output section size.
+
+2004-06-29  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf64-mmix.c (mmix_set_relaxable_size): Save original size in
+	rawsize.
+	(mmix_elf_perform_relocation): Adjust for above change.
+	(mmix_elf_relocate_section): Likewise.
+	(mmix_elf_relax_section): Likewise.  Use output_section->rawsize.
+	(mmix_elf_get_section_contents): Delete.
+	(bfd_elf64_get_section_contents): Delete.
+	(mmix_elf_relocate_section): Zero stub area.
+	* linker.c (default_indirect_link_order): Alloc max of section size
+	and rawsize.
+	* simple.c (bfd_simple_get_relocated_section_contents): Likewise.
+	* section.c (bfd_malloc_and_get_section): Likewise.
+	(struct bfd_section): Update rawsize comment.
+	* bfd-in2.h: Regenerate.
+
+	* reloc16.c (bfd_coff_reloc16_relax_section): Set rawsize.
+
+2004-06-29  Alan Modra  <amodra@bigpond.net.au>
+
+	* bfd-in.h (bfd_get_section_limit): Define.
+	* reloc.c (bfd_perform_relocation, bfd_install_relocation)
+	(_bfd_final_link_relocate): Use bfd_get_section_limit.
+	* aout-tic30.c (tic30_aout_final_link_relocate): Likewise.
+	* coff-arm.c (coff_arm_relocate_section): Likewise.
+	* coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): Likewise.
+	* cpu-ns32k.c (do_ns32k_reloc): Likewise.
+	(bfd_ns32k_final_link_relocate): Likewise.
+	* elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): Likwise.
+	* elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): Likewise.
+	* elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc)
+	(i860_howto_highadj_reloc, i860_howto_splitn_reloc): Likewise.
+	* elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc)
+	(m32r_elf_generic_reloc, m32r_elf_relocate_section): Likewise.
+	* elf32-m68hc1x.c (m68hc11_elf_special_reloc): Likewise.
+	* elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
+	* elf32-or32.c (or32_elf_consth_reloc): Likewise.
+	* elf32-ppc.c (ppc_elf_addr16_ha_reloc): Likewise.
+	* elf32-s390.c (s390_elf_ldisp_reloc): Likewise.
+	* elf32-sh.c (sh_elf_reloc_loop): Likewise.
+	* elf32-sparc.c (sparc_elf_wdisp16_reloc): Likewise.
+	(sparc_elf_hix22_reloc, sparc_elf_lox10_reloc): Likwise.
+	* elf32-v850.c (v850_elf_reloc): Likewise.
+	* elf32-xstormy16.c (xstormy16_elf_24_reloc): Likewise.
+	* elf32-xtensa.c (bfd_elf_xtensa_reloc): Likewise.
+	* elf64-alpha.c (elf64_alpha_reloc_gpdisp): Likewise.
+	* elf64-mips.c (mips_elf64_gprel32_reloc)
+	(mips16_gprel_reloc): Likewise.
+	* elf64-mmix.c (mmix_elf_reloc): Likewise.
+	* elf64-s390.c (s390_elf_ldisp_reloc): Likewise.
+	* elf64-sparc.c (init_insn_reloc): Likewise.
+	* elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc): Likewise.
+	* elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp)
+	(_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_lo16_reloc)
+	(_bfd_mips_elf_generic_reloc): Likewise.
+	* bfd-in2.h: Regenerate.
+
+2004-06-28  Alan Modra  <amodra@bigpond.net.au>
+
+	* bfd-in.h (struct stab_info): Move from stabs.c.
+	* stabs.c (struct stab_link_includes_table): Delete.
+	(stab_link_includes_lookup): Delete.
+	(_bfd_write_section_stabs, _bfd_write_stab_strings): Remove one
+	level of indirection from sinfo parm.
+	(_bfd_link_section_stabs): Likewise.  Set SEC_LINKER_CREATED on
+	stabstr section.  Adjust hash table accesses.
+	* coff-ppc.c (ppc_bfd_coff_final_link): Do include rawsize in contents
+	alloc.  Adjust stab_info test.
+	* cofflink.c (_bfd_coff_link_hash_table_init): Clear stab_info.
+	(_bfd_coff_final_link): Adjust stab_info test.
+	(_bfd_coff_link_input_bfd): Ignore SEC_LINKER_CREATED sections.
+	* elf-bfd.h (struct elf_link_hash_table): Include struct stab_info
+	in place.
+	* libcoff-in.h (struct coff_link_hash_table): Likewise.
+	* elf.c (_bfd_elf_link_hash_table_init): Clear stab_info.
+	* elflink.c (bfd_elf_final_link): Don't attempt to link linker created
+	stabstr section.  Adjust stab_info test.
+	* libbfd-in.h (_bfd_link_section_stabs, _bfd_write_section_stabs)
+	(_bfd_write_stab_strings): Adjust prototypes.
+	* libbfd.h: Regenerate.
+	* libcoff.h: Regenerate.
+	* bfd-in2.h: Regenerate.
+
+2004-06-27  Mark Kettenis  <kettenis@gnu.org>
+
+	From Miod Vallat <miod@online.fr>:
+	* aoutx.h (NAME(aout,machine_type)): Handle bfd_arch_m88k.
+
+2004-06-26  Alexandre Oliva  <aoliva@redhat.com>
+
+	* elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): Delete.
+	(struct elf32_mn10300_link_hash_entry): Remove
+	pcrel_relocs_copied.
+	(mn10300_elf_check_relocs): Only reserve dynamic relocations for
+	R_MN10300_32.  Don't adjust pcrel_relocs_copied.
+	(mn10300_elf_final_link_relocate): Fail for direct, pc-relative
+	and gotoff relocations if the symbol doesn't bind locally.  Use
+	_bfd_elf_symbol_refs_local_p to test.  Don't create dynamic
+	relocation for PCREL32.
+	(mn10300_elf_relocate_section): Use _bfd_elf_symbol_refs_local_p
+	to test whether a symbol binds locally.
+	(elf32_mn10300_link_hash_newfunc): Don't initialize
+	pcrel_relocs_copied.
+	(_bfd_mn10300_elf_discard_copies): Delete.
+	(_bfd_mn10300_elf_size_dynamic_sections): Don't call it.
+
+2004-06-26  Mark Kettenis  <kettenis@gnu.org>
+
+	* config.bfd: Replace m88k-*-openbsd* with m88*-*-openbsd*.
+
+2004-06-25  Joel Brobecker  <brobecker@gnat.com>
+
+	* som.c (som_set_reloc_info): Correct small typo.
+
+2004-06-25  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
+
+	* elf32-m32r.c (m32r_elf_howto_table): Support R_M32R_GOTOFF.
+	(m32r_elf_relocate_section): Changed for R_M32R_GOTOFF.
+	(m32r_elf_gcsweep_hook): Likewise.
+	(m32r_elf_check_relocs): Likewise.
+	(m32r_elf_howto_table): Added R_M32R_GOTOFF_HI_ULO,
+	R_M32R_GOTOFF_HI_SLO and R_M32R_GOTOFF_LO.
+	* reloc.c: Added BFD_RELOC_M32R_GOTOFF_HI_ULO,
+	BFD_RELOC_M32R_GOTOFF_HI_SLO and BFD_RELOC_M32R_GOTOFF_LO.
+	* bfd-in2.h: Regenerated.
+	* libbfd.h: Regenerated.
+
+2004-06-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf64-x86-64.c (elf64_x86_64_check_relocs): Warn overflow
+	relocation symbol.
+	(elf64_x86_64_relocate_section): Issue an error for
+	R_X86_64_PC8, R_X86_64_PC16 and R_X86_64_PC32 relocations
+	against global symbols when building shared library.
+
+2004-06-24  Alan Modra  <amodra@bigpond.net.au>
+
+	* section.c (struct sec): Rename "_cooked_size" to "size".
+	Rename "_raw_size" to "rawsize".
+	(STD_SECTION): Adjust comments.
+	(bfd_set_section_size, bfd_get_section_contents): Use size.
+	(bfd_malloc_and_get_section): New function.
+	* bfd-in.h (bfd_section_size, bfd_get_section_size): Use size.
+	* coff-sh.c (sh_relax_section): Alloc coff_section_data struct early.
+	Correctly free reloc and contents memory.
+	* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Delete FIXME
+	and fake CIE now that we can shink section size to zero.
+	(_bfd_elf_write_section_eh_frame): Likewise..
+	* elf32-ppc.c (ppc_elf_relax_section): Delay reading section contents.
+	* elf-m10300.c (mn10300_elf_final_link_relocate): Don't use
+	_bfd_stab_section_offset.  Use _bfd_elf_section_offset.
+	* stabs.c (_bfd_stab_section_offset_): Remove unused args and
+	unneeded indirection.
+	* elf.c (_bfd_elf_section_offset): .. and update call.
+	* libbfd-in.h (_bfd_stab_section_offset): Update prototype.
+	* libbfd.h: Regenerate.
+	* bfd-in2.h: Regenerate.
+
+	Replace occurrences of "_raw_size" and "_cooked_size" in most places
+	with "size".  Set new "rawsize" for stabs, eh_frame, and SEC_MERGE
+	sections.  Use "rawsize", if non-zero, for bfd_get_section_contents
+	calls if the section might be a stabs, eh_frame, or SEC_MERGE section.
+	Similarly use "rawsize", if non-zero, in reloc functions to validate
+	reloc addresses.  Use new bfd_malloc_and_get_section in most places
+	where bfd_get_section_contents was called.  Expand all occurrences of
+	bfd_section_size and bfd_get_section_size.  Rename "raw_size" var in
+	grok_prstatus and similar functions to "size".
+	* aix386-core.c (aix386_core_file_p): ..
+	* aix5ppc-core.c (xcoff64_core_p): ..
+	* aout-adobe.c (aout_adobe_callback, aout_adobe_write_object_contents,
+	aout_adobe_set_section_contents): ..
+	* aout-target.h (callback): ..
+	* aout-tic30.c (tic30_aout_callback, tic30_aout_final_link_relocate,
+	MY_bfd_final_link): ..
+	* aoutf1.h (sunos4_core_file_p): ..
+	* aoutx.h (some_aout_object_p, adjust_o_magic, adjust_z_magic,
+	adjust_n_magic, adjust_sizes_and_vmas, translate_from_native_sym_flags,
+	final_link, aout_link_input_section): ..
+	* binary.c (binary_object_p, binary_canonicalize_symtab,
+	binary_set_section_contents): ..
+	* bout.c (b_out_callback, b_out_write_object_contents,
+	b_out_set_section_contents, b_out_bfd_relax_section,
+	b_out_bfd_get_relocated_section_contents): ..
+	* cisco-core.c (cisco_core_file_validate): ..
+	* coff-alpha.c (alpha_ecoff_object_p,
+	alpha_ecoff_get_relocated_section_conten, alpha_relocate_section): ..
+	* coff-arm.c (coff_arm_relocate_section,
+	bfd_arm_allocate_interworking_sections): ..
+	* coff-h8300.c (h8300_reloc16_extra_cases,
+	h8300_bfd_link_add_symbols): ..
+	* coff-mips.c (mips_refhi_reloc, mips_gprel_reloc): ..
+	* coff-ppc.c (coff_ppc_relocate_section, ppc_allocate_toc_section,
+	ppc_bfd_coff_final_link): ..
+	* coff-rs6000.c (xcoff_reloc_type_br, xcoff_ppc_relocate_section): ..
+	* coff-sh.c (sh_relax_section, sh_relax_delete_bytes,
+	sh_align_loads, sh_coff_get_relocated_section_contents): ..
+	* coff64-rs6000.c (xcoff64_write_object_contents,
+	xcoff64_reloc_type_br, xcoff64_ppc_relocate_section): ..
+	* coffcode.h (coff_compute_section_file_positions,
+	coff_write_object_contents): ..
+	* coffgen.c (make_a_section_from_file, coff_write_symbols,
+	coff_section_symbol, build_debug_section): ..
+	* cofflink.c (coff_link_add_symbols, _bfd_coff_final_link,
+	process_embedded_commands, _bfd_coff_link_input_bfd,
+	_bfd_coff_write_global_sym): ..
+	* cpu-arm.c (bfd_arm_update_notes, bfd_arm_get_mach_from_notes): ..
+	* cpu-ns32k.c (do_ns32k_reloc, _bfd_ns32k_final_link_relocate): ..
+	* dwarf1.c (parse_line_table, _bfd_dwarf1_find_nearest_line): ..
+	* dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info,
+	_bfd_dwarf2_find_nearest_line): ..
+	* ecoff.c (bfd_debug_section, ecoff_set_symbol_info,
+	ecoff_compute_section_file_positions,
+	_bfd_ecoff_write_object_contents, ecoff_indirect_link_order): ..
+	* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame,
+	_bfd_elf_discard_section_eh_frame_hdr,
+	_bfd_elf_maybe_strip_eh_frame_hdr, _bfd_elf_eh_frame_section_offset,
+	_bfd_elf_write_section_eh_frame,
+	_bfd_elf_write_section_eh_frame_hdr): ..
+	* elf-hppa.h (elf_hppa_sort_unwind): ..
+	* elf-m10200.c (mn10200_elf_relax_section,
+	mn10200_elf_relax_delete_bytes,
+	mn10200_elf_get_relocated_section_contents): ..
+	* elf-m10300.c (_bfd_mn10300_elf_create_got_section,
+	mn10300_elf_check_relocs, mn10300_elf_relax_section,
+	mn10300_elf_relax_delete_bytes,
+	mn10300_elf_get_relocated_section_contents,
+	_bfd_mn10300_elf_adjust_dynamic_symbol,
+	_bfd_mn10300_elf_discard_copies,
+	_bfd_mn10300_elf_size_dynamic_sections,
+	_bfd_mn10300_elf_finish_dynamic_sections): ..
+	* elf.c (_bfd_elf_print_private_bfd_data, bfd_elf_get_bfd_needed_list,
+	_bfd_elf_make_section_from_phdr, elf_fake_sections,
+	bfd_elf_set_group_contents, map_sections_to_segments,
+	elf_sort_sections, assign_file_positions_for_segments,
+	SECTION_SIZE, copy_private_bfd_data,
+	_bfd_elf_get_dynamic_reloc_upper_bound,
+	_bfd_elf_canonicalize_dynamic_reloc, elfcore_maybe_make_sect,
+	_bfd_elfcore_make_pseudosection, elfcore_grok_prstatus,
+	elfcore_grok_lwpstatus, elfcore_grok_win32pstatus,
+	elfcore_grok_note, elfcore_grok_nto_status, elfcore_grok_nto_gregs,
+	_bfd_elf_rel_local_sym, _bfd_elf_get_synthetic_symtab): ..
+	* elf32-arm.h (bfd_elf32_arm_allocate_interworking_sect,
+	bfd_elf32_arm_process_before_allocation,
+	elf32_arm_adjust_dynamic_symbol, allocate_dynrelocs,
+	elf32_arm_size_dynamic_sections, elf32_arm_finish_dynamic_sections,
+	elf32_arm_write_section): ..
+	* elf32-cris.c (cris_elf_grok_prstatus,
+	elf_cris_finish_dynamic_sections, cris_elf_gc_sweep_hook,
+	elf_cris_adjust_gotplt_to_got, elf_cris_adjust_dynamic_symbol,
+	cris_elf_check_relocs, elf_cris_size_dynamic_sections,
+	elf_cris_discard_excess_dso_dynamics,
+	elf_cris_discard_excess_program_dynamics): ..
+	* elf32-d30v.c (bfd_elf_d30v_reloc, bfd_elf_d30v_reloc_21): ..
+	* elf32-dlx.c (_bfd_dlx_elf_hi16_reloc): ..
+	* elf32-frv.c (_frvfdpic_add_dyn_reloc, _frvfdpic_add_rofixup,
+	_frv_create_got_section, _frvfdpic_assign_plt_entries,
+	elf32_frvfdpic_size_dynamic_sections,
+	elf32_frvfdpic_modify_segment_map,
+	elf32_frvfdpic_finish_dynamic_sections): ..
+	* elf32-h8300.c (elf32_h8_relax_section, elf32_h8_relax_delete_bytes,
+	elf32_h8_get_relocated_section_contents): ..
+	* elf32-hppa.c (hppa_build_one_stub, hppa_size_one_stub,
+	elf32_hppa_adjust_dynamic_symbol, allocate_plt_static,
+	allocate_dynrelocs, elf32_hppa_size_dynamic_sections, group_sections,
+	elf32_hppa_size_stubs, elf32_hppa_set_gp, elf32_hppa_build_stubs,
+	elf32_hppa_finish_dynamic_sections): ..
+	* elf32-i370.c (i370_elf_adjust_dynamic_symbol,
+	i370_elf_size_dynamic_sections, i370_elf_check_relocs,
+	i370_elf_finish_dynamic_sections): ..
+	* elf32-i386.c (elf_i386_grok_prstatus, elf_i386_adjust_dynamic_symbol,
+	allocate_dynrelocs, elf_i386_size_dynamic_sections,
+	elf_i386_relocate_section, elf_i386_finish_dynamic_sections): ..
+	* elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc,
+	i860_howto_highadj_reloc, i860_howto_splitn_reloc): ..
+	* elf32-ip2k.c (ip2k_is_switch_table_128,
+	ip2k_relax_switch_table_128, ip2k_is_switch_table_256,
+	ip2k_relax_switch_table_256, ip2k_elf_relax_section,
+	adjust_all_relocations, ip2k_elf_relax_delete_bytes): ..
+	* elf32-m32r.c (m32r_elf_do_10_pcrel_reloc, m32r_elf_hi16_reloc,
+	m32r_elf_generic_reloc, m32r_elf_adjust_dynamic_symbol,
+	allocate_dynrelocs, m32r_elf_size_dynamic_sections,
+	m32r_elf_relocate_section, m32r_elf_finish_dynamic_sections,
+	m32r_elf_relax_section, m32r_elf_relax_delete_bytes,
+	m32r_elf_get_relocated_section_contents): ..
+	* elf32-m68hc11.c (m68hc11_elf_build_one_stub,
+	m68hc11_elf_size_one_stub, m68hc11_elf_relax_section,
+	m68hc11_elf_relax_delete_bytes): ..
+	* elf32-m68hc12.c (m68hc12_elf_build_one_stub,
+	m68hc12_elf_size_one_stub): ..
+	* elf32-m68hc1x.c (elf32_m68hc11_size_stubs,
+	elf32_m68hc11_build_stubs, m68hc11_elf_special_reloc): ..
+	* elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_gc_sweep_hook,
+	elf_m68k_adjust_dynamic_symbol, elf_m68k_size_dynamic_sections,
+	elf_m68k_discard_copies, elf_m68k_finish_dynamic_sections): ..
+	* elf32-mips.c (gprel32_with_gp, mips16_gprel_reloc,
+	elf32_mips_grok_prstatus): ..
+	* elf32-or32.c (or32_elf_consth_reloc): ..
+	* elf32-ppc.c (ppc_elf_relax_section, ppc_elf_addr16_ha_reloc,
+	elf_create_pointer_linker_section, ppc_elf_create_linker_section,
+	ppc_elf_additional_program_headers, ppc_elf_adjust_dynamic_symbol,
+	allocate_dynrelocs, ppc_elf_size_dynamic_sections,
+	ppc_elf_finish_dynamic_sections, ppc_elf_grok_prstatus,
+	ppc_elf_final_write_processing): ..
+	* elf32-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol,
+	allocate_dynrelocs, elf_s390_size_dynamic_sections,
+	elf_s390_finish_dynamic_sections, elf_s390_grok_prstatus): ..
+	* elf32-sh.c (sh_elf_reloc_loop, sh_elf_relax_section,
+	sh_elf_relax_delete_bytes, sh_elf_align_loads,
+	sh_elf_adjust_dynamic_symbol, allocate_dynrelocs,
+	sh_elf_size_dynamic_sections, sh_elf_get_relocated_section_contents,
+	sh_elf_finish_dynamic_sections, elf32_shlin_grok_prstatus): ..
+	* elf32-sh64-com.c (sh64_address_in_cranges,
+	sh64_get_contents_type): ..
+	* elf32-sh64.c (sh64_find_section_for_address,
+	sh64_elf_final_write_processing): ..
+	* elf32-sparc.c (sparc_elf_wdisp16_reloc, sparc_elf_hix22_reloc,
+	sparc_elf_lox10_reloc, elf32_sparc_adjust_dynamic_symbol,
+	allocate_dynrelocs, elf32_sparc_size_dynamic_sections,
+	elf32_sparc_relocate_section, elf32_sparc_finish_dynamic_sections): ..
+	* elf32-v850.c (v850_elf_reloc, v850_elf_relax_section): ..
+	* elf32-vax.c (elf_vax_check_relocs, elf_vax_adjust_dynamic_symbol,
+	elf_vax_size_dynamic_sections, elf_vax_discard_copies,
+	elf_vax_instantiate_got_entries, elf_vax_relocate_section,
+	elf_vax_finish_dynamic_sections): ..
+	* elf32-xstormy16.c (xstormy16_elf_24_reloc,
+	xstormy16_elf_check_relocs, xstormy16_relax_plt_check,
+	xstormy16_elf_relax_section, xstormy16_elf_always_size_sections,
+	xstormy16_elf_finish_dynamic_sections): ..
+	* elf32-xtensa.c (xtensa_read_table_entries,
+	elf_xtensa_allocate_got_size, elf_xtensa_allocate_local_got_size,
+	elf_xtensa_size_dynamic_sections, elf_xtensa_do_reloc,
+	bfd_elf_xtensa_reloc, elf_xtensa_relocate_section,
+	elf_xtensa_combine_prop_entries, elf_xtensa_finish_dynamic_sections,
+	elf_xtensa_discard_info_for_section, elf_xtensa_grok_prstatus,
+	get_relocation_opcode, retrieve_contents, find_relaxable_sections,
+	collect_source_relocs, is_resolvable_asm_expansion, remove_literals,
+	relax_section, shrink_dynamic_reloc_sections, relax_property_section,
+	xtensa_callback_required_dependence): ..
+	* elf64-alpha.c (elf64_alpha_reloc_gpdisp, elf64_alpha_relax_section,
+	elf64_alpha_check_relocs, elf64_alpha_adjust_dynamic_symbol,
+	elf64_alpha_calc_got_offsets_for_symbol, elf64_alpha_calc_got_offsets,
+	elf64_alpha_size_plt_section, elf64_alpha_size_plt_section_1,
+	elf64_alpha_always_size_sections, elf64_alpha_calc_dynrel_sizes,
+	elf64_alpha_size_rela_got_section, elf64_alpha_size_rela_got_1,
+	elf64_alpha_size_dynamic_sections, elf64_alpha_emit_dynrel,
+	elf64_alpha_finish_dynamic_sections, elf64_alpha_final_link): ..
+	* elf64-hppa.c (allocate_dynrel_entries,
+	elf64_hppa_size_dynamic_sections,
+	elf64_hppa_finish_dynamic_sections): ..
+	* elf64-mips.c (mips_elf64_gprel32_reloc, mips16_gprel_reloc,
+	mips_elf64_canonicalize_dynamic_reloc, mips_elf64_slurp_reloc_table,
+	elf64_mips_grok_prstatus): ..
+	* elf64-mmix.c (mmix_elf_perform_relocation, mmix_elf_reloc,
+	mmix_elf_relocate_section, mmix_elf_final_link,
+	mmix_set_relaxable_size, _bfd_mmix_after_linker_allocation,
+	mmix_elf_relax_section, mmix_elf_get_section_contents): ..
+	* elf64-ppc.c (ppc64_elf_object_p, ppc64_elf_grok_prstatus,
+	ppc64_elf_check_relocs, ppc64_elf_func_desc_adjust,
+	ppc64_elf_adjust_dynamic_symbol, ppc64_elf_edit_opd,
+	allocate_dynrelocs, ppc64_elf_size_dynamic_sections,
+	ppc_build_one_stub, ppc_size_one_stub, ppc64_elf_next_toc_section,
+	toc_adjusting_stub_needed, group_sections, ppc64_elf_size_stubs,
+	ppc64_elf_build_stubs, ppc64_elf_relocate_section,
+	ppc64_elf_finish_dynamic_sections): ..
+	* elf64-s390.c (s390_elf_ldisp_reloc, elf_s390_adjust_dynamic_symbol,
+	allocate_dynrelocs, elf_s390_size_dynamic_sections,
+	elf_s390_finish_dynamic_sections): ..
+	* elf64-sh64.c (sh_elf64_get_relocated_section_contents,
+	sh_elf64_check_relocs, sh64_elf64_adjust_dynamic_symbol,
+	sh64_elf64_discard_copies, sh64_elf64_size_dynamic_sections,
+	sh64_elf64_finish_dynamic_sections): ..
+	* elf64-sparc.c (sparc64_elf_slurp_reloc_table, init_insn_reloc,
+	sparc64_elf_check_relocs, sparc64_elf_adjust_dynamic_symbol,
+	sparc64_elf_size_dynamic_sections, sparc64_elf_relocate_section,
+	sparc64_elf_finish_dynamic_symbol,
+	sparc64_elf_finish_dynamic_sections): ..
+	* elf64-x86-64.c (elf64_x86_64_grok_prstatus,
+	elf64_x86_64_adjust_dynamic_symbol, allocate_dynrelocs,
+	elf64_x86_64_size_dynamic_sections, elf64_x86_64_relocate_section,
+	elf64_x86_64_finish_dynamic_sections): ..
+	* elfarm-nabi.c (elf32_arm_nabi_grok_prstatus): ..
+	* elfcode.h (elf_slurp_reloc_table): ..
+	* elflink.c (_bfd_elf_create_got_section, elf_add_dt_needed_tag,
+	elf_finalize_dynstr, elf_link_add_object_symbols,
+	bfd_elf_size_dynamic_sections, elf_link_sort_relocs,
+	elf_link_input_bfd, bfd_elf_final_link, bfd_elf_discard_info): ..
+	* elfn32-mips.c (gprel32_with_gp, mips16_gprel_reloc,
+	elf32_mips_grok_prstatus): ..
+	* elfxx-ia64.c (elfNN_ia64_relax_section, allocate_dynrel_entries,
+	elfNN_ia64_size_dynamic_sections, elfNN_ia64_install_dyn_reloc,
+	elfNN_ia64_choose_gp, elfNN_ia64_final_link,
+	elfNN_ia64_finish_dynamic_sections): ..
+	* elfxx-mips.c (mips_elf_create_procedure_table,
+	mips_elf_check_mips16_stubs, _bfd_mips_elf_gprel16_with_gp,
+	_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_generic_reloc,
+	mips_elf_global_got_index, mips_elf_multi_got,
+	mips_elf_create_compact_rel_section, mips_elf_calculate_relocation,
+	mips_elf_allocate_dynamic_relocations,
+	mips_elf_create_dynamic_relocation, _bfd_mips_elf_fake_sections,
+	_bfd_mips_relax_section, _bfd_mips_elf_adjust_dynamic_symbol,
+	_bfd_mips_elf_always_size_sections,
+	_bfd_mips_elf_size_dynamic_sections,
+	_bfd_mips_elf_finish_dynamic_symbol,
+	_bfd_mips_elf_finish_dynamic_sections,
+	_bfd_mips_elf_modify_segment_map, _bfd_mips_elf_discard_info,
+	_bfd_mips_elf_write_section, _bfd_mips_elf_set_section_contents,
+	_bfd_elf_mips_get_relocated_section_contents,
+	_bfd_mips_elf_final_link, _bfd_mips_elf_merge_private_bfd_data): ..
+	* hp300hpux.c (callback): ..
+	* hppabsd-core.c (make_bfd_asection): ..
+	* hpux-core.c (make_bfd_asection): ..
+	* i386linux.c (linux_link_create_dynamic_sections,
+	bfd_i386linux_size_dynamic_sections, linux_finish_dynamic_link): ..
+	* i386msdos.c (msdos_write_object_contents): ..
+	* i386os9k.c (os9k_callback, os9k_write_object_contents,
+	os9k_set_section_contents): ..
+	* ieee.c (parse_expression, ieee_slurp_external_symbols,
+	ieee_slurp_sections, ieee_slurp_debug, ieee_slurp_section_data,
+	ieee_write_section_part, do_with_relocs, do_as_repeat,
+	do_without_relocs, ieee_write_debug_part, init_for_output,
+	ieee_set_section_contents): ..
+	* ihex.c (ihex_scan, ihex_read_section, ihex_get_section_contents): ..
+	* irix-core.c (do_sections, make_bfd_asection): ..
+	* libaout.h (aout_section_merge_with_text_p): ..
+	* libbfd.c (_bfd_generic_get_section_contents,
+	_bfd_generic_get_section_contents_in_window): ..
+	* linker.c (default_indirect_link_order): ..
+	* lynx-core.c (make_bfd_asection): ..
+	* m68klinux.c (linux_link_create_dynamic_sections,
+	bfd_m68klinux_size_dynamic_sections, linux_finish_dynamic_link): ..
+	* mach-o.c (bfd_mach_o_make_bfd_section,
+	bfd_mach_o_scan_read_dylinker, bfd_mach_o_scan_read_dylib,
+	bfd_mach_o_scan_read_thread, bfd_mach_o_scan_read_symtab,
+	bfd_mach_o_scan_read_segment): ..
+	* merge.c (_bfd_add_merge_section, record_section, merge_strings,
+	_bfd_merge_sections): ..
+	* mmo.c (mmo_find_sec_w_addr, mmo_get_spec_section, mmo_get_loc,
+	mmo_map_set_sizes, mmo_canonicalize_symtab,
+	mmo_internal_write_section, mmo_write_object_contents): ..
+	* netbsd-core.c (netbsd_core_file_p): ..
+	* nlm32-alpha.c (nlm_alpha_read_reloc, nlm_alpha_write_import,
+	nlm_alpha_set_public_section): ..
+	* nlm32-ppc.c (nlm_powerpc_read_reloc, nlm_powerpc_write_reloc): ..
+	* nlm32-sparc.c (nlm_sparc_write_import): ..
+	* nlmcode.h (add_bfd_section, nlm_swap_auxiliary_headers_in,
+	nlm_compute_section_file_positions): ..
+	* oasys.c (oasys_object_p, oasys_slurp_section_data,
+	oasys_write_sections, oasys_write_data, oasys_set_section_contents): ..
+	* opncls.c (get_debug_link_info): ..
+	* osf-core.c (make_bfd_asection): ..
+	* pdp11.c (some_aout_object_p, adjust_o_magic, adjust_z_magic,
+	adjust_n_magic, adjust_sizes_and_vmas, squirt_out_relocs,
+	final_link, aout_link_input_section): ..
+	* peXXigen.c (_bfd_XXi_swap_sym_in, _bfd_XXi_swap_aouthdr_out,
+	pe_print_idata, pe_print_edata, pe_print_pdata, pe_print_reloc): ..
+	* pef.c (bfd_pef_make_bfd_section, bfd_pef_print_loader_section,
+	bfd_pef_scan_start_address, bfd_pef_parse_symbols): ..
+	* ppcboot.c (ppcboot_object_p, ppcboot_canonicalize_symtab): ..
+	* ptrace-core.c (ptrace_unix_core_file_p): ..
+	* reloc.c (bfd_perform_relocation, bfd_install_relocation,
+	_bfd_final_link_relocate, bfd_generic_relax_section,
+	bfd_generic_get_relocated_section_contents): ..
+	* reloc16.c (bfd_coff_reloc16_relax_section,
+	bfd_coff_reloc16_get_relocated_section_c): ..
+	* riscix.c (riscix_some_aout_object_p): ..
+	* rs6000-core.c (read_hdr, make_bfd_asection): ..
+	* sco5-core.c (make_bfd_asection): ..
+	* simple.c (bfd_simple_get_relocated_section_contents): ..
+	* som.c (som_object_setup, setup_sections, som_prep_headers,
+	som_write_fixups, som_begin_writing, bfd_section_from_som_symbol,
+	som_set_reloc_info, som_get_section_contents,
+	som_bfd_link_split_section): ..
+	* sparclinux.c (linux_link_create_dynamic_sections,
+	bfd_sparclinux_size_dynamic_sections, linux_finish_dynamic_link): ..
+	* srec.c (srec_scan, srec_read_section, srec_get_section_contents): ..
+	* stabs.c (_bfd_link_section_stabs, _bfd_discard_section_stabs,
+	_bfd_write_stab_strings, _bfd_stab_section_offset): ..
+	* sunos.c (sunos_read_dynamic_info, sunos_create_dynamic_sections,
+	bfd_sunos_size_dynamic_sections, sunos_scan_std_relocs,
+	sunos_scan_ext_relocs, sunos_scan_dynamic_symbol,
+	sunos_write_dynamic_symbol, sunos_check_dynamic_reloc,
+	sunos_finish_dynamic_link): ..
+	* syms.c (_bfd_stab_section_find_nearest_line): ..
+	* tekhex.c (first_phase, tekhex_set_section_contents,
+	tekhex_write_object_contents): ..
+	* trad-core.c (trad_unix_core_file_p): ..
+	* versados.c (process_esd, process_otr, process_otr): ..
+	* vms-gsd.c (_bfd_vms_slurp_gsd, _bfd_vms_write_gsd): ..
+	* vms-misc.c (add_new_contents): ..
+	* vms-tir.c (check_section, new_section, _bfd_vms_write_tir): ..
+	* vms.c (vms_set_section_contents): ..
+	* xcofflink.c (xcoff_get_section_contents, xcoff_link_add_symbols,
+	xcoff_sweep, bfd_xcoff_size_dynamic_sections, xcoff_build_ldsyms,
+	_bfd_xcoff_bfd_final_link, xcoff_link_input_bfd): ..
+	* xsym.c (bfd_sym_scan): .. See above.
+
+2004-06-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elfxx-ia64.c (elfNN_ia64_relax_section): Add addend when
+	calling _bfd_merged_section_offset only for section symbols.
+
+2004-06-22  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf32-ppc.c (ppc_elf_relax_section): Implement reference code
+	for handling SEC_MERGE symbols in relax_section.
+
+2004-06-21  Alexandre Oliva  <aoliva@redhat.com>
+
+	2003-05-15  Richard Sandiford  <rsandifo@redhat.com>
+	* cpu-h8300.c (compatible): Allow h8300s and h8300sx code to be
+	linked together. Mark the result as h8300sx code.
+
+2004-06-21  Alexandre Oliva  <aoliva@redhat.com>
+
+	* elf-bfd.h (struct elf_backend_data): Added
+	elf_backend_omit_section_dynsym.
+	(_bfd_elf_link_omit_section_dynsym): Declare.
+	* elf32-frv.c (_frvfdpic_link_omit_section_dynsym): New.
+	(elf_backend_omit_section_dynsym): Use it for frvfdpic.
+	* elflink.c (_bfd_elf_link_omit_section_dynsym): Split out of...
+	(_bfd_elf_link_renumber_dynsyms): ... this function.
+	* elfxx-target.h (elf_backend_omit_section_dynsym): Default to
+	_bfd_elf_link_omit_section_dynsym).
+	(elfNN_bed): Added elf_backend_omit_section_dynsym.
+
+2004-06-21  Nick Clifton  <nickc@redhat.com>
+
+	* coffcode.h (styp_to_sec_flags): Ignore IMAGE_SCN_MEM_NOT_PAGED
+	flags.
+
+2004-06-17  Jerome Guitton  <guitton@gnat.com>
+
+	* bfd-in.h (bfd_cache_close_all): New function declaration.
+	* bfd-in2.h: Regenerate.
+	* cache.c (bfd_cache_close_all): New function definition.
+
+2004-06-16  Mark Kettenis  <kettenis@gnu.org>
+
+	* configure.in: Don't set COREFILE to trad-core.lo for FreeBSD
+	4.10 and beyond.
+	* configure: Regenerate.
+
+2004-06-16  Daniel Jacobowitz  <dan@debian.org>
+
+	* elf32-ppc.c (ppc_elf_create_linker_section): Create symbols in
+	the pre-existing section.
+
+2004-06-15  Alan Modra  <amodra@bigpond.net.au>
+
+	* section.c (struct sec): Remove usused flags.  Reorganize a little.
+	(bfd_get_section_size_before_reloc): Delete.
+	(bfd_get_section_size_after_reloc): Delete.
+	(STD_SECTION): Update.
+	(bfd_get_section_size_now): Delete.
+	(bfd_set_section_contents): Don't referece reloc_done.
+	(bfd_get_section_contents): Remove reloc_done comment.
+	* bout.c (b_out_bfd_get_relocated_section_contents): Don't set
+	reloc_done.
+	* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise.
+	* ecoff.c (bfd_debug_section): Update initializer.
+	* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Ditto.
+	* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
+	* bfd-in.h (bfd_section_size): Expand.
+	(bfd_get_section_size): New macro.
+	* bfd-in2.h: Regenerate.
+	* coff64-rs6000.c (xcoff64_write_object_contents): Replace
+	bfd_get_section_size_before_reloc with bfd_get_section_size.
+	* coffcode.h (coff_write_object_contents): Likewise.
+	* coffgen.c (build_debug_section): Likewise.
+	* dwarf1.c (parse_line_table): Likewise.
+	(_bfd_dwarf1_find_nearest_line): Likewise.
+	* ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
+	* i386msdos.c (msdos_write_object_contents): Likewise.
+	* pdp11.c (squirt_out_relocs): Likewise.
+	* elf32-sh64.c (sh64_find_section_for_address): Remove comment.
+	* elf64-mmix.c (mmix_elf_final_link): Update comment.
+
+2004-06-14  Chris Demetriou  <cgd@broadcom.com>
+
+	* elf32-mips.c (elf_mips_gnu_pcrel32): Add (undoing 2004-04-24
+	removal) with updated comment.
+	(bfd_elf32_bfd_reloc_type_lookup): Add back case for
+	BFD_RELOC_32_PCREL.
+	(mips_elf32_rtype_to_howto): Add back case for R_MIPS_PC32.
+	* elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
+
+2004-06-12  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf64-x86-64.c (elf64_x86_64_relocate_section): Ignore reloc
+	overflow on branches to undefweaks.
+
+2004-06-11  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
+
+	* coff-alpha.c (alpha_relocate_section): Set used_by_bfd directly
+	as ecoff_section_data() does not return a valid lvalue.
+
+2004-06-09  Alexandre Oliva  <aoliva@redhat.com>
+
+	* elflink.c (elf_sort_symbol): Compare section id, not pointers.
+	(elf_link_add_object_symbols): Likewise.
+
+	* elf-m10300.c (_bfd_mn10300_elf_reloc_type_class): New.
+	(elf_backend_reloc_type_class): New.
+
+2004-06-08  Mark Kettenis  <kettenis@gnu.org>
+
+	* configure.in (hppa*-*-netbsd*, hppa*-*-openbsd): Set COREFILE to
+	netbsd-core.lo.
+	* configure: Regenerate.
+
+2004-06-07  Daniel Jacobowitz  <dan@debian.org>
+
+	From:  Albert Chin-A-Young  <china@thewrittenword.com>
+	* bfd/elf-bfd.h (struct eh_cie_fde): Convert unsigned char bitfields
+	to unsigned int.
+
+2004-05-29  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elfxx-ia64.c (elfNN_ia64_relax_section): Undo the last
+	change.
+
+2004-05-28  DJ Delorie  <dj@redhat.com>
+
+	* elf-m10300.c (mn10300_elf_relax_section): Preserve reloc addend
+	for linking, but otherwise adjust reloc for merged sections.
+
+2004-05-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elfxx-ia64.c (elfNN_ia64_relax_section): Properly call
+	_bfd_merged_section_offset for local symbols.
+
+2004-05-28  Andrew Stubbs <andrew.stubbs@superh.com>
+
+	* Makefile.am: Regenerate dependencies.
+	* Makefile.in: Regenerate.
+	* archures.c: Add bfd_mach_sh3_nommu .
+	* bfd-in2.h: Regenerate.
+	* cpu-sh.c: Add sh3-nommu architecture.
+	(bfd_to_arch_table): Create new table.
+	(sh_get_arch_from_bfd_mach): Create new function.
+	(sh_get_arch_up_from_bfd_mach): Create new function.
+	(sh_merge_bfd_arch): Create new function.
+	* elf32-sh.c (sh_ef_bfd_table): Add table.
+	(sh_elf_check_relocs): Replace switch statement with
+	use of sh_ef_bfd_table .
+	(sh_elf_get_flags_from_mach): Add new function.
+	(sh_find_elf_flags): Likewise.
+	(sh_elf_copy_private_data): Replace most of non-elf contents
+	with a call to sh_merge_bfd_arch() .
+
+2004-05-27  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* Makefile.am (bfdver.h): Use explicit filename, not $< .
+	* Makefile.in: Regenerate.
+
+2004-05-27  Alexandre Oliva  <aoliva@redhat.com>
+
+	* elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Avoid
+	custom calling conventions for dynamic symbols.
+	(mn10300_elf_relax_section): Avoid relaxing a function as a local
+	symbol if it's an alias to a global one.
+
+2004-05-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf.c (_bfd_elf_make_section_from_shdr): Undo the last
+	change.
+
+2004-05-27  Alexandre Oliva  <aoliva@redhat.com>
+
+	* elf-m10300.c (mn10300_elf_relax_section): Don't test isym within
+	loop over hashes.
+
+2004-05-26  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf.c (_bfd_elf_make_section_from_shdr): Don't set SEC_EXCLUDE
+	for SHT_GROUP sections.
+
+2004-05-25  Alan Modra  <amodra@bigpond.net.au>
+
+	* elflink.c (elf_link_add_object_symbols): Don't set up merge
+	section data here..
+	* elf.c (_bfd_elf_merge_sections): .. Do it here instead.
+	* merge.c: Formatting.  Remove unnecessary casts.  Expand
+	bfd_get_section_alignment macro.
+	(struct sec_merge_sec_info): Rename "first" to "first_str".  Update
+	use throughout file.
+	(_bfd_add_merge_section): Rename from _bfd_merge_section.  Update
+	comment.  Abort on dynamic or non-SEC_MERGE input.  Don't test
+	section name to determine sinfo group, instead test output section
+	and alignment.
+	(_bfd_merge_sections): Add struct bfd_link_info param.  Call
+	_bfd_strip_section_from_output rather than just twiddling flags.
+	* libbfd-in.h (_bfd_add_merge_section): Rename, update comment.
+	(_bfd_merge_sections): Update prototype.
+	* libbfd.h: Regenerate.
+
+2004-05-24  Mark Kettenis  <kettenis@gnu.org>
+
+	* netbsd-core.c: Correctly indent section that sets architecture
+	from machine ID.
+
+	From Miod Vallat <miod@online.fr>:
+	* m88kopenbsd.c: New file.
+	* targets.c (m88k_openbsd_vec): New.
+	* config.bfd: Add m88k-*-openbsd*.
+	* configure.in (m88k-*-openbsd*): Set COREFILE to netbsd-core.lo.
+	(m88kopenbsd_vec): New.
+	* configure: Regenerate.
+	* Makefile.am (BFD32_BACKENDS): Add m88kopenbsd.lo.
+	(BFD32_BACKENDS_CFILES): Add m88kopenbsd.c.
+	Run "make dep-am".
+	* Makefile.in: Regenerate.
+	* po/SRC-POTFILES.in: Regenerate.
+
+2004-05-24  Nick Clifton  <nickc@redhat.com>
+
+	* hash.c: Remove bogus node "Changing the default Hash Table Size"
+	introduced by hash table size patch.
+
+2004-05-22  Ben Elliston  <bje@au.ibm.com>
+
+	* configure.in (is_release): Remove.
+	(bfd_version_date, bfd_version, bfd_version_string): Likewise.
+	(AC_OUTPUT): Don't output bfdver.h from version.h.
+	* configure: Regenerate.
+	* Makefile.am (RELEASE): New variable.
+	(bfdver.h): New target.
+	* Makefile.in: Regenerate.
+	* doc/Makefile.in: Likewise.
+
+2004-05-22  Ben Elliston  <bje@au.ibm.com>
+
+	* Makefile.am (config.status): Don't depend on version.h.
+	* Makefile.in: Regenerate.
+
+2004-05-22  Alan Modra  <amodra@bigpond.net.au>
+
+	* merge.c (_bfd_merged_section_offset): Remove "addend" param.
+	* libbfd-in.h (_bfd_merged_section_offset): Adjust prototype.
+	* libbfd.h: Regenerate.
+	* elf.c (_bfd_elf_rela_local_sym): Adjust call.
+	(_bfd_elf_rel_local_sym): Likewise.
+	* elflink.c (_bfd_elf_link_sec_merge_syms): Likewise.
+	(elf_link_input_bfd): Likewise.
+	* elf32-ppc.c (ppc_elf_relax_section): Likewise.
+	* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+	* elfxx-ia64.c (elfNN_ia64_relax_section): Likewise.
+	(elfNN_ia64_relocate_section): Likewise.
+
+2004-05-21  Andy Chittenden  <achittenden@bluearc.com>
+
+	* hash.c (bfd_default_hash_table_size): New variable.
+	(bfd_hash_table_init): Use new variable instead of DEFAULT_SIZE.
+	(bfd_hash_set_default_size): New function.  Set the default size
+	to a selected prime number close to the argument.  Document new
+	function.
+	* bfd-in.h: Add prototype for  bfd_hash_set_default_size.
+	* bfd-in2.h: Regenerate.
+	* Makefile.am (hash.lo): Add dependency upon libiberty.h.
+	* Makefile.in: Regenerate.
+
+2004-05-21  Mark Kettenis  <kettenis@gnu.org>
+
+	* libaout.h (machine_type): Add M_88K_OPENBSD and M_HPPA_OPENBSD.
+	* netbsd-core.c (netbsd_core_file_p): Set architecture for alpha,
+	arm, m68k, m88k and hppa core files.
+
+2004-05-21  Nick Clifton  <nickc@redhat.com>
+
+	* bfdio.c (bfd_bread): Do not use iovec if it is NULL.
+	(bfd_bwrite): Likewise.
+	(bfd_tell): Likewise.
+	(bfd_flush): Likewise.
+	(bfd_stat): Likewise.
+	(bfd_seek): Likewise.
+	(bfd_get_mtime): Likewise.
+	(bfd_get_size): Likewise.
+
+2004-05-19  Ben Elliston  <bje@au.ibm.com>
+
+	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Comment correction.
+
+2004-05-19  Mikulas Patocka  <mikulas@artax.karlin.mff.cuni.cz>
+
+	* archive.c (_bfd_get_elt_at_filepos): Cope with a nested archives.
+	(bfd_generic_openr_next_archived_file): Likewise.
+
+2004-05-17  Bob Wilson  <bob.wilson@acm.org>
+
+	* elf32-xtensa.c (xtensa_get_property_section_name): Determine linkonce
+	section names by inserting a new substring after .gnu.linkonce, except
+	for .gnu.linkonce.t.* where the "t." is replaced.
+
+2004-05-17  Adam Nemet  <anemet@lnxw.com>
+
+	* config.bfd (sparc-*-lynxos* case): Add to obsolete list.
+	(m68-*-lynxos* case): Likewise.
+	(powerpc-*-lyxnos* case): New case.
+	(i[3-7]86-*-lynxos* case): Update to LynxOS 4.0 ELF.
+
+2004-05-17  David Heine  <dlheine@tensilica.com>
+
+	* aout-target.h (MY_bfd_copy_private_header_data): Define.
+	* aout-tic30.c (MY_bfd_copy_private_header_data): Define.
+	* bfd.c (bfd_copy_private_header_data): Define.
+	* coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Add entries for new
+	interface.
+	* coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
+	* coffcode.h (coff_bfd_copy_private_header_data): Define.
+	* elf-bfd.h (_bfd_elf_copy_private_header_data): Declare.
+	* elf.c (_bfd_elf_copy_private_section_data): Remove code to set up
+	segments by calling copy_private_bfd_data.
+	(_bfd_elf_copy_private_header_data): Define.
+	* elfxx-target.h (bfd_elfNN_bfd_copy_private_header_data): Define.
+	* libbfd-in.h (_bfd_generic_bfd_copy_private_header_data): Define.
+	* libecoff.h (_bfd_ecoff_bfd_copy_private_header_data): Define.
+	* mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Define.
+	* mmo.c (mmo_bfd_copy_private_header_data): Define.
+	* ppcboot.c (ppcboot_bfd_copy_private_header_data): Define.
+	* som.c (som_bfd_copy_private_header_data): Define.
+	* targets.c (BFD_JUMP_TABLE_COPY): Add _bfd_copy_private_header_data.
+	* vms.c (vms_bfd_copy_private_header_data): Define.
+	* bfd-in2.h: Regenerate.
+	* libbfd.h: Regenerate.
+
+2004-05-15  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
+
+	* elfxx-mips.c (MINUS_TWO): Define.
+	(mips_elf_higher, mips_elf_highest,
+	mips_elf_create_dynamic_relocation): Use MINUS_ONE and MINUS_TWO for
+	some bfd_vma values.
+	(_bfd_mips_elf_finish_dynamic_symbol): Likewise. Code cleanup.
+
+2004-05-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* som.c (log2): Rename to exact_log2.  Adjust all callers.
+
+2004-05-13  Paul Brook  <paul@codesourcery.com>
+
+	* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle
+	dwarf3 format CIE entries.  Remove comment about the size of the
+	ra_column field.  It is now correctly deduced.
+
+2004-05-13  Joel Sherrill <joel@oarcorp.com>
+
+	* config.bfd (or32-*-rtems*): Switch to elf.
+
+2004-05-13  Nick Clifton  <nickc@redhat.com>
+
+	* po/fr.po: Updated French translation.
+
+2004-05-11  Jakub Jelinek  <jakub@redhat.com>
+
+	* elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol
+	into .dynsym if elf_section_data (sec)->dynindx <= 0.
+	Adjust counting of last_local.
+	(_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections
+	other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt
+	created by the linker nor !SHF_ALLOC.
+
+	* elf32-i386.c (elf_i386_finish_dynamic_sections): Point
+	DT_PLTGOT to the start of the .got.plt section instead of the
+	.got output section.  Set sh_entsize for .got section in addition
+	to .got.plt.
+	(elf_i386_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_
+	is at sgot->output_section->vma.
+	* elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Point
+	DT_PLTGOT to the start of the .got.plt section instead of the
+	.got output section.
+	(elf64_x86_64_relocate_section): Don't assume _GLOBAL_OFFSET_TABLE_
+	is at sgot->output_section->vma.  Set sh_entsize for .got section
+	in addition to .got.plt.
+	* elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_RELRO.
+	(bfd_section_from_phdr): Likewise.
+	(map_sections_to_segments): Likewise.
+	(assign_file_positions_for_segments): Likewise.
+	(get_program_header_size): Likewise.
+	* elflink.c (bfd_elf_size_dynamic_sections): Set
+	elf_tdata (output_bfd)->relro from info->relro.
+	* elf-bfd.h (struct elf_obj_tdata): Add relro field.
+
+2004-05-08  Alexandre Oliva  <aoliva@redhat.com>
+
+	* elf32-frv.c (_frvfdpic_add_dyn_reloc): Don't warn when we get
+	a zero symndx for which we hadn't accounted a dynamic relocation.
+	(_frvfdpic_add_rofixup): Likewise.
+
+2004-05-07  Brian Ford  <ford@vss.fsi.com>
+	    DJ Delorie  <dj@redhat.com>
+
+	* coffcode.h (coff_write_object_contents) [COFF_IMAGE_WITH_PE]:
+	Propagate IMAGE_FILE_LARGE_ADDRESS_AWARE.
+	* peXXigen.c (_bfd_XX_print_private_bfd_data_common): Recognize
+	IMAGE_FILE_LARGE_ADDRESS_AWARE.  Use PE defines.
+
+2004-05-07  Alexandre Oliva  <aoliva@redhat.com>
+
+	* elf32-frv.c (elf32_frvfdpic_modify_segment_map): Return
+	immediately if there's no link info.
+	(elf32_frvfdpic_copy_private_bfd_data): New.
+	(bfd_elf32_bfd_copy_private_bfd_data): Use it for frvfdpic.
+
+2004-05-06  Zack Weinberg  <zack@codesourcery.com>
+
+	* dwarf2.c (add_line_info): Also set info->filename to NULL if
+	filename argument is null; do not call strlen on a null pointer.
+
+2004-05-06  Daniel Jacobowitz  <drow@mvista.com>
+
+	* elf32-arm.h (elf32_arm_relocate_section): Remove R_ARM_PLT32
+	special case.
+
+2004-05-05  Alexandre Oliva  <aoliva@redhat.com>
+
+	* configure.in (bfd_elf32_frvfdpic_vec): New.
+	* configure: Rebuilt.
+	* targets.c (bfd_elf32_frvfdpic_vec): New.
+	* config.bfd: Enable it on frv-*-elf and frv-*-*linux*, as default
+	on the latter.
+	* elf32-frv.c: Prefix all identifiers added for FDPIC support with
+	frvfdpic instead of frv.  Rearrange elf-target macros such that
+	the FDPIC-specific ones are only defined for this new target
+	vector.
+	(bfd_elf32_frvfdpic_vec): Declare.
+	(IS_FDPIC): New.
+	(elf32_frv_relocate_section): Use it to enable segment checking
+	and to control rofixup emission.  Add output section vma to
+	applied relocation in non-LOAD non-ALLOC sections.  Use
+	_bfd_error_handler for errors.
+	(_frv_create_got_section): Create .rel.got and .rofixup only in
+	FDPIC.  Create non-dynamic _gp at .got+2048 in non-FDPIC, like the
+	linker script.
+	(elf32_frvfdpic_size_dynamic_sections): Assume FDPIC.
+	(elf32_frvfdpic_modify_segment_map): Likewise.
+	(elf32_frv_finish_dynamic_sections): New, do-nothing.
+	(elf32_frvfdpic_finish_dynamic_sections): Assume FDPIC.  Improve
+	error message if we miscompute the rofixup size.
+	(frvfdpic_elf_use_relative_eh_frame): Assume FDPIC.
+	(frvfdpic_elf_encode_eh_address): Likewise.
+	(elf32_frv_check_relocs): Reject FDPIC-only relocs in non-FDPIC.
+	Record relocs only in FDPIC.  Make sure _gp is defined for GPREL
+	relocs.  Reject unknown relocation types.
+	(elf32_frv_object_p): Make sure target vector matches FDPIC bits.
+	(frv_elf_merge_private_bfd_data): Likewise.
+	(ELF_MAXPAGESIZE): Revert to 0x1000 for elf32-frv; keep it as
+	0x4000 for newly-added elf32-frvfdpic.
+
+2004-05-05  Nick Clifton  <nickc@redhat.com>
+
+	PR/136
+	* cache.c (bfd_cache_lookup_worker): Call abort() rather than
+	returning NULL as most users of this function do not check its
+	return value.
+	* hppabsd-core.c (hppabsd_core_core_file_p): Do not check result
+	of bfd_cache_lookup().
+	* sco5-core.c (sco5_core_file_p): Likewise.
+	* trad-core.c (trad_unix_core_file_p): Likewise.
+
+2004-05-05  Nick Clifton  <nickc@redhat.com>
+
+	* cache.c (bfd_cache_lookup): Improve formatting.
+	* archive.c: Fix formatting.
+
+2004-05-05  Peter Barada  <peter@the-baradas.com>
+
+	* bfd_archures.c(bfd_architecture): Add 521x,5249,547x,548x.
+	* cpu-m68k.c(bfd_m68k_arch): Likewise.
+	* bfd-in2.h(bfd_architecture): Regenerate.
+
+2004-05-03  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf.c (_bfd_elf_rela_local_sym): Set kept_section for excluded
+	SEC_MERGE sections.
+	* elflink.c (elf_link_input_bfd): Adjust output reloc index for
+	those against discarded link-once and SEC_MERGE section symbols.
+
+2004-05-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* section.c (bfd_get_section_by_name_if): New.
+	* bfd-in2.h: Regenerated.
+
+2004-05-02  Alan Modra  <amodra@bigpond.net.au>
+
+	* som.c (som_bfd_is_group_section): Define.
+
+2004-05-01  Alan Modra  <amodra@bigpond.net.au>
+
+	* section.c (bfd_make_section_anyway): Copy the whole
+	bfd_hash_entry, not just "next" from existing entry.
+
+2004-04-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf.c (bfd_section_from_shdr): Maintain the section order in
+	a section group.
+	(special_sections): Add ".note.GNU-stack".
+	(elf_fake_sections): Handle section group for relocatable
+	link..
+
+2004-04-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* section.c (bfd_sections_find_if): New.
+	* bfd-in2.h: Regenerated.
+
+2004-04-30  Alan Modra  <amodra@bigpond.net.au>
+
+	* section.c (bfd_make_section_anyway): Add all sections to hash tab.
+
+	* elf-bfd.h (bfd_elf_is_group_section): Declare.
+	* elf.c (bfd_elf_is_group_section): New function.
+	* elfxx-target.h (bfd_elfNN_bfd_is_group_section
+	* section.c (bfd_generic_is_group_section): New function.
+	* targets.c (struct bfd_target): Add _bfd_is_group_section field.
+	(BFD_JUMP_TABLE_LINK): Adjust.
+	* aout-adobe.c (aout_32_bfd_is_group_section): Define.
+	* aout-target.h (MY_bfd_is_group_section): Define.
+	* aout-tic30.c (MY_bfd_is_group_section): Define.
+	* bfd.c (bfd_is_group_section): Define.
+	* binary.c (binary_bfd_is_group_section): Define.
+	* bout.c (b_out_bfd_is_group_section): Define.
+	* coff-alpha.c (_bfd_ecoff_bfd_is_group_section): Define.
+	* coff-mips.c (_bfd_ecoff_bfd_is_group_section): Define.
+	* coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Adjust.
+	* coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Adjust.
+	* coffcode.h (coff_bfd_is_group_section): Define.
+	* i386msdos.c (msdos_bfd_is_group_section): Define.
+	* i386os9k.c (os9k_bfd_is_group_section): Define.
+	* ieee.c (ieee_bfd_is_group_section): Define.
+	* ihex.c (ihex_bfd_is_group_section): Define.
+	* libbfd-in.h (_bfd_nolink_bfd_is_group_section): Define.
+	* mach-o.c (bfd_mach_o_bfd_is_group_section): Define.
+	* mmo.c (mmo_bfd_is_group_section): Define.
+	* nlm-target.h (nlm_bfd_is_group_section): Define.
+	* oasys.c (oasys_bfd_is_group_section): Define.
+	* pef.c (bfd_pef_bfd_is_group_section): Define.
+	* ppcboot.c (ppcboot_bfd_is_group_section): Define.
+	* srec.c (srec_bfd_is_group_section): Define.
+	* tekhex.c (tekhex_bfd_is_group_section): Define.
+	* versados.c (versados_bfd_is_group_section): Define.
+	* vms.c (vms_bfd_is_group_section): Define.
+	* xsym.c (bfd_sym_bfd_is_group_section): Define.
+	* bfd-in2.h: Regenerate.
+	* libbfd.h: Regenerate.
+
+2004-04-30  Alan Modra  <amodra@bigpond.net.au>
+
+	* elflink.c (elf_gc_mark): Follow indirect and warning syms.
+
+2004-04-30  Hans-Peter Nilsson  <hp@axis.com>
+
+	* configure.in: Update version to 2.15.91.
+	* configure: Regenerate.
+
+2004-04-29  Brian Ford  <ford@vss.fsi.com>
+
+	* bfd.c (bfd_get_sign_extend_vma): Add pe[i]-i386 case to DJGPP hack.
+	* coffcode.h (DOT_DEBUG, GNU_LINKONCE_WI): Define.
+	[!COFF_WITH_PE] (sec_to_styp_flags, styp_to_sec_flags): Use them.
+	(coff_compute_section_file_positions) [RS6000COFF_C]: Likewise.
+	[COFF_WITH_PE] (sec_to_styp_flags): Handle DWARF 2/3 .debug* and
+	.gnu.linkonce.wi. sections.
+	* pe-i386.c (COFF_SUPPORT_GNU_LINKONCE): Define.
+	(COFF_SECTION_ALIGNMENT_ENTRIES): Add entries for .debug and
+	.gnu.linkonce.wi..
+	* pei-i386.c (COFF_SUPPORT_GNU_LINKONCE): Likewise.
+	(COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
+
+2004-04-28  Chris Demetriou  <cgd@broadcom.com>
+
+	* reloc.c: Remove BFD_RELOC_PCREL_HI16_S and BFD_RELOC_PCREL_LO16.
+	* bfd-in2.h: Regenerate.
+	* libbfd.h: Likewise.
+
+2004-04-28  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* som.c (struct som_misc_symbol_info): Add is_comdat, is_common and
+	dup_common fields.
+	(setup_sections): Use som_subspace_dictionary_record struct instead
+	subspace_dictionary_record.  Set SEC_LINK_ONCE if subspace is
+	is_comdat, is_common or dup_common.
+	(som_prep_headers): Use som_subspace_dictionary_record struct.  Set
+	is_comdat, is_common and dup_common in section subspace_dict from
+	copy_data.
+	(som_begin_writing): Use som_subspace_dictionary_record struct.
+	(som_finish_writing): Likewise.
+	(som_bfd_derive_misc_symbol_info): Add support to set is_comdat,
+	is_common and dup_common flags in info for symbol.  Add comment
+	regarding linker support for these fields.  Slightly reorganize
+	function.
+	(som_build_and_write_symbol_table): Set is_comdat, is_common and
+	dup_common fields in symbol table from symbol info.
+	(bfd_som_set_subsection_attributes): Add comdat, common and dup_common
+	arguments.  Set corresponding fields in copy_data.  Change all callers.
+	(som_bfd_ar_write_symbol_stuff): Set dup_common flag in library
+	symbol table.
+	(som_vec): Add SEC_LINK_ONCE to applicable section flags.
+	* som.h (som_subspace_dictionary_record): Define.
+	(som_copyable_section_data_struct): Add is_comdat, is_common and
+	dup_common fields.
+	(som_section_data_struct): Use som_subspace_dictionary_record struct
+	instead of subspace_dictionary_record.
+	(bfd_boolean bfd_som_set_subsection_attributes): Adjust prototype.
+
+2004-04-27  Bob Wilson  <bob.wilson@acm.org>
+
+	* elf32-xtensa.c (xtensa_read_table_entries): Use section _cooked_size
+	if set.  Check reloc_done flag before applying relocations.  Use
+	output addresses, both when applying relocations and when comparing
+	against the specified section.
+	(elf_xtensa_relocate_section): Use output address to check if dynamic
+	reloc is in a literal pool.  Set section's reloc_done flag.
+
+2004-04-27  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-sh64.c (elf_backend_section_flags): New. Defined.
+	(sh64_elf_set_mach_from_flags): Remove the kludge for .cranges
+	section.
+	(sh64_elf_section_flags): New. Set SEC_DEBUGGING for .cranges
+	section.
+
+2004-04-27  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf64-alpha.c (elf64_alpha_read_ecoff_info): Don't assign
+	structure field removed in 2004-04-24 patch.
+	* elf64-sparc.c (sparc64_elf_plt_sym_val): Warning fix.
+
+	* elf-bfd.h (struct elf_backend_data <elf_backend_section_flags>):
+	Constify hdr arg.
+	* elf32-arm.h (elf32_arm_section_flags): Likewise.
+	* elf64-alpha.c (elf64_alpha_section_flags): Likewise.
+	* elfxx-ia64.c (elfNN_ia64_section_flags): Likewise.
+	* elf.c (_bfd_elf_make_section_from_shdr): Set the bfd_section
+	field before calling elf_backend_section_flags.
+
+2004-04-24  Chris Demetriou  <cgd@broadcom.com>
+
+	* elf32-mips.c (elf_mips_gnu_rel_hi16, elf_mips_gnu_rel_lo16)
+	(elf_mips_gnu_pcrel64, elf_mips_gnu_pcrel32): Remove.
+	(bfd_elf32_bfd_reloc_type_lookup): Remove cases for
+	BFD_RELOC_PCREL_HI16_S, BFD_RELOC_PCREL_LO16, BFD_RELOC_64_PCREL,
+	and BFD_RELOC_32_PCREL.
+	(mips_elf32_rtype_to_howto): Remove cases for R_MIPS_GNU_REL_HI16,
+	R_MIPS_GNU_REL_LO16, R_MIPS_PC64, R_MIPS_PC32.
+	* elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
+	(_bfd_mips_elf_lo16_reloc): Remove handling for R_MIPS_GNU_REL_HI16.
+	(mips_elf_next_relocation): Move comment about matching HI/LO
+	relocations to...
+	(_bfd_mips_elf_relocate_section): Here.  Remove handling for
+	R_MIPS_GNU_REL_HI16.
+
+2004-04-23  Chris Demetriou  <cgd@broadcom.com>
+
+	* coff-mips.c (mips_relhi_reloc, mips_rello_reloc)
+	(mips_switch_reloc, mips_read_relocs, mips_relax_section)
+	(mips_relax_pcrel16, PCREL16_EXPANSION_ADJUSTMENT): Remove.
+	(mips_relocate_hi): Remove now-unused 'adjust' and 'pcrel' arguments,
+	and update comments to reflect current usage.
+	(mips_howto_table): Remove entries for MIPS_R_RELHI, MIPS_R_RELLO,
+	and MIPS_R_SWITCH, as well as several empty entries.  Update comment
+	for MIPS_R_PCREL16.
+	(mips_ecoff_swap_reloc_in, mips_ecoff_swap_reloc_out)
+	(mips_adjust_reloc_out, mips_bfd_reloc_type_lookup): Remove support
+	for MIPS_R_SWITCH, MIPS_R_RELLO, and MIPS_R_RELHI relocations.
+	(mips_adjust_reloc_in): Likewise, adjust maximum accepted relocation
+	type number to be MIPS_R_PCREL16.
+	(mips_relocate_section): Remove support for link-time relaxation
+	of branches used by embedded-PIC.  Remove support for MIPS_R_SWITCH,
+	MIPS_R_RELLO, and MIPS_R_RELHI relocations.
+	(_bfd_ecoff_bfd_relax_section): Redefine to bfd_generic_relax_section.
+	* ecoff.c (ecoff_indirect_link_order): Remove support for link-time
+	relaxation of branches used by embedded-PIC.
+	* ecofflink.c (bfd_ecoff_debug_accumulate): Likewise.
+	* libecoff.h (struct ecoff_section_tdata): Remove embedded-PIC
+	related members, update comment.
+	* pe-mips.c: Remove disabled (commented-out and #if 0'd)
+	code related to embedded-PIC.
+	* elfxx-mips.c (_bfd_mips_elf_read_ecoff_info): Remove
+	initialization of now-removed 'adjust' member of
+	'struct ecoff_debug_info'.
+
+2004-04-23  Chris Demetriou  <cgd@broadcom.com>
+
+	* elfxx-mips.c (mips_elf_get_global_gotsym_index): Remove.
+
+2004-04-21  Philip Blundell  <pb@nexus.co.uk>
+
+	* elf32-arm.h (elf32_arm_check_relocs): Don't output REL32
+	relocs for locally defined symbols during -shared final link.
+	(elf32_arm_final_link_relocate): Likewise.
+
+2004-04-22  Jakub Jelinek  <jakub@redhat.com>
+
+	* elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Copy also
+	ELF_LINK_POINTER_EQUALITY_NEEDED.
+	(elf64_x86_64_check_relocs): Set ELF_LINK_POINTER_EQUALITY_NEEDED
+	if r_type is not R_X86_64_PC32.
+	(elf64_x86_64_finish_dynamic_symbol): If
+	ELF_LINK_POINTER_EQUALITY_NEEDED is not set, clear st_value of
+	SHN_UNDEF symbols.
+
+2004-04-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+	* elf32-sh.c (sh_elf_plt_sym_val): New function.
+	(elf_backend_plt_sym_val): Define.
+
+2004-04-22  Andrew Cagney  <cagney@redhat.com>
+
+	* opncls.c (bfd_alloc): Fix type of "wanted" in doco.
+
+2004-04-22  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
+
+	* hpux-core.c (hpux_core_core_file_p): Add cast in call to
+	make_bfd_asection.
+	* som.c (som_set_section_contents): Constantify second argument.
+	(hppa_som_gen_reloc_type): Abort for unsupported selectors.
+	(som_object_setup): Rework to avoid warning.
+	(setup_sections, som_write_fixups, bfd_section_from_som_symbol):
+	Likewise.
+
+2004-04-22  Andrew Cagney  <cagney@redhat.com>
+
+	* cache.c (bfd_cache_close): Check for a previously closed file.
+
+2004-04-22  Jakub Jelinek  <jakub@redhat.com>
+
+	* bfd.c (bfd_get_synthetic_symtab): Define.
+	* targets.c (BFD_JUMP_TABLE_DYNAMIC): Add
+	NAME##_get_synthetic_symtab.
+	(struct bfd_target): Add _bfd_get_synthetic_symtab.
+	* libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Define.
+	* elf-bfd.h (struct elf_backend_data): Add plt_sym_val and
+	relplt_name fields.
+	(_bfd_elf_get_synthetic_symtab): New prototype.
+	* elfcode.h (elf_get_synthetic_symtab): Define.
+	* elf.c (_bfd_elf_get_synthetic_symtab): New function.
+	* elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Define.
+	(elf_backend_plt_sym_val, elf_backend_relplt_name): Define.
+	(elfNN_bed): Add elf_backend_plt_sym_val and elf_backend_relplt_name.
+	* bfd-in2.h: Rebuilt.
+	* libbfd.h: Rebuilt.
+	* elf32-i386.c (elf_i386_plt_sym_val): New function.
+	(elf_backend_plt_sym_val): Define.
+	* elf64-x86-64.c (elf64_x86_64_plt_sym_val): New function.
+	(elf_backend_plt_sym_val): Define.
+	* elf32-s390.c (elf_s390_plt_sym_val): New function.
+	(elf_backend_plt_sym_val): Define.
+	* elf64-s390.c (elf_s390_plt_sym_val): New function.
+	(elf_backend_plt_sym_val): Define.
+	* elf32-sparc (elf32_sparc_plt_sym_val): New function.
+	(elf_backend_plt_sym_val): Define.
+	* elf64-sparc.c (sparc64_elf_plt_sym_val): New function.
+	(elf_backend_plt_sym_val): Define.
+	* elf32-ppc.c (ppc_elf_plt_sym_val): New function.
+	(elf_backend_plt_sym_val): Define.
+	* aout-target.h (MY_get_synthetic_symtab): Define.
+	* aout-tic30.c (MY_get_synthetic_symtab): Define.
+	* coff-rs6000.c (rs6000coff_vec): Add
+	_bfd_nodynamic_get_synthetic_symtab.
+	(pmac_xcoff_vec): Likewise.
+	* coff64-rs6000.c (rs6000coff64_vec): Add
+	_bfd_nodynamic_get_synthetic_symtab.
+	(aix5coff64_vec): Likewise.
+	* sunos.c (MY_get_synthetic_symtab): Define.
+	* vms.c (vms_get_synthetic_symtab): Define.
+
+2004-04-22  Nick Clifton  <nickc@redhat.com>
+
+	* bfd.c (bfd_archive_filename): Return NULL on NULL input.
+
+2004-04-22  Peter Barada <peter@the-baradas.com>
+
+	* archures.c: Add bfd_mach_mcfv4e to bfd_architecture.
+	* bfd2-in.h: Regenerate.
+	* cpu-m68k.c: Add 'm68k:mcfv4e' to arch_info_struct[].
+
+2004-04-21  Chris Demetriou  <cgd@broadcom.com>
+
+	* coff-mips.c (bfd_mips_ecoff_create_embedded_relocs): Remove.
+	* elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Remove.
+	* bfd-in.h (bfd_mips_ecoff_create_embedded_relocs)
+	(bfd_mips_elf32_create_embedded_relocs): Remove prototypes
+	* bfd-in2.h: Regenerate.
+
+2004-04-21  Bob Wilson  <bob.wilson@acm.org>
+
+	* elf32-xtensa.c (is_same_value): Add final_static_link argument and
+	require relocations against a weak symbol to reference the same
+	symbol hash entry if not a final, static link.
+	(get_cached_value, add_value_map): Add final_static_link argument.
+	(remove_literals): Pass final_static_link argument as needed.
+
+2004-04-21  Andrew Cagney  <cagney@redhat.com>
+
+	* opncls.c (_bfd_new_bfd_contained_in): Copy "iovec".
+	(struct opncls, opncls_btell, opncls_bseek, opncls_bread)
+	(opncls_bwrite, opncls_bclose, opncls_bflush)
+	(opncls_bstat, opncls_iovec, bfd_openr_iovec): Implement a
+	bfd iovec that uses function callbacks.
+	(bfd_close): Use the iovec's bclose.
+	* cache.c (cache_btell, cache_bseek, cache_bread, cache_bwrite)
+	(cache_bclose, cache_bflush, cache_bstat)
+	(cache_iovec): New functions and global variable, implement a
+	cache "iovec", where applicable set bfd_error.
+	(bfd_cache_init, bfd_cache_close): Set/test the bfd's iovec.
+	* bfdio.c (struct bfd_iovec): Define.
+	(real_read): Delete function.
+	(bfd_bread, bfd_bread, bfd_bwrite, bfd_tell, bfd_flush, bfd_stat)
+	(bfd_seek, bfd_get_mtime, bfd_get_size): Use the bfd's "iovec",
+	assume that bread and bwrite set bfd_error.
+	* bfd.c (struct bfd): Add "iovec", update comments.
+	* bfd-in2.h, libbfd.h: Re-generate.
+
+2004-04-21  Andrew Cagney  <cagney@redhat.com>
+
+	* libaout.h (enum machine_type): Add M_POWERPC_NETBSD.
+
+2004-04-21  Eric Botcazou  <ebotcazou@act-europe.fr>
+
+	* elflink.c (elf_gc_mark_dynamic_ref_symbol): New function.
+	(bfd_elf_gc_sections): Fail if a shared object is being created.
+	Do not fail if dynamic sections have been created.  Instead call
+	elf_gc_mark_dynamic_ref_symbol to mark sections that contain
+	dynamically referenced symbols.  Do not mark the whole graph
+	rooted at .eh_frame, only the section proper.
+
+2004-04-20  DJ Delorie  <dj@redhat.com>
+
+	* reloc.c: Add BFD_RELOC_32_SECREL.
+	* bfd-in2.h: Regenerate.
+	* libbfd.h: Likewise.
+	* coff-i386.c (howto_table) [COFF_WITH_PE]: Add R_SECREL32.
+	(coff_i386_rtype_to_howto) [COFF_WITH_PE]: Handle it.
+	(coff_i386_reloc_type_lookup) [COFF_WITH_PE]: Likewise.
+
+2004-04-19  Jakub Jelinek  <jakub@redhat.com>
+
+	* elf32-sparc.c (elf32_sparc_relocate_section): Handle
+	relocs against hidden/protected undefweak symbols properly.
+	* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+
+2004-04-18  Mark Kettenis  <kettenis@gnu.org>
+
+	* libaout.h (enum machine_type): Add M_POWERPC_NETBSD.
+	* netbsd-core.c (netbsd_core_file_p): Set architecture for PowerPC
+	core files.
+
+2004-04-17  Brian Ford  <ford@vss.fsi.com>
+
+	* peXXigen.c (_bfd_XXi_swap_aouthdr_out): Use the first non-zero
+	filepos for the SizeOfHeaders field.
+	(_bfd_XXi_swap_scnhdr_out): Correct section flags lossage on reloc
+	overflow.
+	(_bfd_XXi_swap_sym_in): Remove redundant section flags assignment.
+
+2004-04-16  Alan Modra  <amodra@bigpond.net.au>
+
+	* simple.c (bfd_simple_get_relocated_section_contents): Don't
+	change reloc_done.  Set and restore _cooked_size.
+	(RETURN): Delete.
+
+2004-04-15  Mark Kettenis  <kettenis@gnu.org>
+
+	* netbsd-core.c (netbsd_core_file_p): Set architecture for VAX
+	core files.
+
+2004-04-15  Nick Clifton  <nickc@redhat.com>
+
+	* bfd.c (bfd_archive_filename): Catch NULL bfd pointers.
+
+2004-04-15  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf64-sparc.c (sparc64_elf_check_relocs): Fix thinko last change.
+
+2004-04-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elflink.c (_bfd_elf_merge_symbol): Treat weak as strong only
+	when it is a definition.
+
+2004-04-14  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf32-sparc.c (elf32_sparc_relocate_section): Don't abort
+	when statically linking PIC code.
+	* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+
+2004-04-11  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
+
+	* config.bfd: Remove mips*-*-mach3* and mips*-dec-mach3* targets.
+	* configure.in: Remove mips-dec-bsd*, mips-dec-mach3*, mips-*-mach3*
+	targets amd aout_mips_big_vec, aout_mips_little_vec target vectors.
+	* configure: Regenerate.
+
+2004-04-08  Richard Sandiford  <rsandifo@redhat.com>
+
+	* elflink.c: Include libiberty.h.
+	* Makefile.am (elflink.lo): Depend on libiberty.h.
+	* Makefile.in: Regenerate.
+
+2004-04-06  Daniel Jacobowitz  <drow@mvista.com>
+
+	* elfxx-mips.c (MIPS_ELF_STUB_SECTION_NAME): Always use
+	".MIPS.stubs".
+
+2004-04-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Always
+	reserve the memory for dynamic linker
+
+2004-04-05  Mark Kettenis  <kettenis@gnu.org>
+
+	* netbsd-core.c (CORE_WCOOKIE_OFFSET): New define.
+	(netbsd_core_file_p): Create a .wcookie section for OpenBSD/sparc.
+
+2004-04-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-cr16c.c (elf32_cr16c_relocate_section): Use
+	RELOC_FOR_GLOBAL_SYMBOL.
+	(elf32_cr16c_add_symbol_hook): Remove const from Elf_Internal_Sym.
+
+2004-04-02  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-arm.h (elf32_arm_final_link_relocate): Handle
+	R_ARM_ALU* only if OLD_ARM_ABI is not defined.
+
+2004-04-01  Paul Brook  <paul@codesourcery.com>
+
+	* bfd-in.h (bfd_elf32_arm_process_before_allocation): Update.
+	* elf32-arm.h (struct elf32_elf_section_map): New.
+	(struct _arm_elf_section_data): New.
+	(elf32_arm_section_data): Define.
+	(struct elf32_arm_link_hash_table): Add byteswap_code.
+	(elf32_arm_link_hash_table_create): Initialize byteswap_code.
+	(bfd_elf32_arm_process_before_allocation): Add byteswap_code.
+	(elf32_arm_post_process_headers): Set EF_ARM_BE8.
+	(elf32_arm_output_symbol_hook, elf32_arm_new_section_hook,
+	elf32_arm_compare_mapping, elf32_arm_write_section): New functions.
+	(bfd_elf32_new_section_hook, elf_backend_write_section,
+	elf_backend_link_output_symbol_hook): Define.
+
+2004-04-01  Andy Chittenden  <achittenden@bluearc.com>
+
+	* stabs.c (struct stab_link_includes_totals): Add field 'symb'
+	that keeps the characters in a B_INCL..B_EINCL range.
+	(_bfd_link_section_stabs): When computing the sum of the
+	characters in a B_INCL..B_EINCL range also keep a copy of those
+	characters.  Use this information to distinguish between
+	include sections that have the same sum and the same length
+	but which are nevertheless unique.
+
+2004-03-31  Paul Brook  <paul@codesourcery.com>
+
+	* elf32-arm.h (elf32_arm_final_link_relocate): Add R_ARM_ALU*.
+	* elfarm-nabi.c (elf32_arm_howto_table): Ditto.
+
+2004-03-31  Andy Chittenden <achittenden@bluearc.com>
+
+	* stabs.c (struct stab_link_includes_totals): Rename field 'total'
+	to 'sum_chars' and add field 'num_chars'.
+	(_bfd_link_section_stabs): When computing the sum of the
+	characters in a B_INCL..B_EINCL range also keep a count of the
+	number of characters.  Use this information to help distinguish
+	between include sections when have the same sum but which
+	nevertheless are still unique.
+
+2004-03-31  Mattias Engdegård  <mattias@virtutech.se>
+
+	* stabs.c (_bfd_link_section_stabs): Do not skip N_EXCL stabs.
+
+2004-03-30  Galit Heller  <Galit.Heller@nsc.com>
+	    Tomer Levi    <Tomer.Levi@nsc.com>
+
+	* Makefile.am (ALL_MACHINES): Add cpu-cr16c.lo.
+	(ALL_MACHINES_CFILES): Add cpu-cr16c.c.
+	(BFD32_BACKENDS): Add elf32-cr16c.lo.
+	(BFD32_BACKENDS_CFILES): Add elf32-cr16c.c.
+	(cpu-cr16c.lo): New target.
+	(elf32-cr16c.lo): Likewise.
+	* Makefile.in: Regenerate.
+	* archures.c (bfd_architecture): Add bfd_{arch,mach}_cr16c.
+	(bfd_archures_list): Add bfd_cr16c_arch.
+	* config.bfd: Handle cr16c-*-elf*.
+	* configure.in: Handle bfd_elf32_cr16c_vec.
+	* configure: Regenerate.
+	* reloc.c: Add BFD_RELOC_16C_NUM08, BFD_RELOC_16C_NUM08_C,
+	BFD_RELOC_16C_NUM16, BFD_RELOC_16C_NUM16_C,
+	BFD_RELOC_16C_NUM32, BFD_RELOC_16C_NUM32_C,
+	BFD_RELOC_16C_DISP04, BFD_RELOC_16C_DISP04_C,
+	BFD_RELOC_16C_DISP08, BFD_RELOC_16C_DISP08_C,
+	BFD_RELOC_16C_DISP16, BFD_RELOC_16C_DISP16_C,
+	BFD_RELOC_16C_DISP24, BFD_RELOC_16C_DISP24_C,
+	BFD_RELOC_16C_DISP24a, BFD_RELOC_16C_DISP24a_C,
+	BFD_RELOC_16C_REG04, BFD_RELOC_16C_REG04_C,
+	BFD_RELOC_16C_REG04a, BFD_RELOC_16C_REG04a_C,
+	BFD_RELOC_16C_REG14, BFD_RELOC_16C_REG14_C,
+	BFD_RELOC_16C_REG16, BFD_RELOC_16C_REG16_C,
+	BFD_RELOC_16C_REG20, BFD_RELOC_16C_REG20_C,
+	BFD_RELOC_16C_ABS20, BFD_RELOC_16C_ABS20_C,
+	BFD_RELOC_16C_ABS24, BFD_RELOC_16C_ABS24_C,
+	BFD_RELOC_16C_IMM04, BFD_RELOC_16C_IMM04_C,
+	BFD_RELOC_16C_IMM16, BFD_RELOC_16C_IMM16_C,
+	BFD_RELOC_16C_IMM20, BFD_RELOC_16C_IMM20_C,
+	BFD_RELOC_16C_IMM24, BFD_RELOC_16C_IMM24_C,
+	BFD_RELOC_16C_IMM32, BFD_RELOC_16C_IMM32_C.
+	* targets.c (bfd_elf32_cr16c_vec): Declare.
+	(bfd_target_vector): Add bfd_elf32_cr16c_vec.
+	* cpu-cr16c.c: New file.
+	* elf32-cr16c.c: Likewise.
+	* libbfd.h: Regenerate.
+	* bfd-in2.h: Likewise.
+
+2004-03-30  Jakub Jelinek  <jakub@redhat.com>
+
+	* elf.c (map_sections_to_segments): Fix handling of .tbss.
+
+2004-03-27  Alan Modra  <amodra@bigpond.net.au>
+
+	* Makefile.am: Remove all mention of elflink.h.
+	* Makefile.in: Regenerate.
+	* bfd-in.h (bfd_elf_discard_info): Declare.
+	(bfd_elf32_discard_info, bfd_elf64_discard_info): Delete.
+	* bfd-in2.h: Regenerate.
+	* elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol,
+	bfd_elf32_link_record_dynamic_symbol,
+	bfd_elf64_link_record_dynamic_symbol,
+	_bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link,
+	bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol,
+	_bfd_elf32_link_record_local_dynamic_symbol,
+	_bfd_elf64_link_record_local_dynamic_symbol,
+	_bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets,
+	_bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link,
+	_bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry,
+	_bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets,
+	_bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry,
+	_bfd_elf32_reloc_symbol_deleted_p,
+	_bfd_elf64_reloc_symbol_deleted_p): Delete.
+	(bfd_elf_link_record_dynamic_symbol,
+	bfd_elf_link_record_local_dynamic_symbol,
+	bfd_elf_final_link, bfd_elf_gc_sections,
+	bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry,
+	bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link,
+	bfd_elf_reloc_symbol_deleted_p): Declare.
+	(WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define.
+	* elf32-arm.h: Update for changed function names.  Remove local
+	WILL_CALL_FINISH_DYNAMIC_SECTION define.
+	* elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c,
+	* elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c,
+	* elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c,
+	* elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c,
+	* elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c,
+	* elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c,
+	* elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c,
+	* elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise.
+	* elfxx-target.h (bfd_elfNN_bfd_final_link): Define.
+	(bfd_elfNN_print_symbol): Define.
+	* elfcode.h: Don't include elflink.h.
+	(elf_bfd_discard_info, elf_reloc_symbol_deleted_p,
+	elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections,
+	elf_gc_common_finalize_got_offsets, elf_gc_common_final_link,
+	elf_gc_record_vtinherit, elf_gc_record_vtentry,
+	elf_link_record_local_dynamic_symbol): Don't define.
+	* elflink.c: Update for changed function names.  Move elflink.h
+	code here.
+	* elflink.h: Delete file.
+	* po/SRC-POTFILES.in: Regenerate.
+	* po/bfd.pot: Regenerate.
+
+2004-03-27  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf64-mmix.c (mmix_elf_relocate_section): Restore code setting
+	"name" for global syms accidentally removed in 2004-03-20 change.
+
+2004-03-27  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf-bfd.h (struct elf_reloc_cookie): Add r_sym_shift field.
+	* elflink.h: Replace all occurrences of sizeof (Elf_External_*)
+	where Elf_External_* is different for 64 and 32 bit, with
+	corresponding elf_size_info field.
+	(struct elf_final_link_info): Use "bfd_byte *" instead
+	of "Elf_External_Sym *" for external_syms and symbuf.
+	(elf_link_adjust_relocs): Set up r_type_mask and r_sym_shift local
+	vars and use instead of ELF_R_INFO and ELF_R_TYPE macros.
+	(struct elf_link_sort_rela): Add "sym_mask" alias for "offset".
+	(elf_link_sort_cmp1): Use sym_mask field instead of ELF_R_SYM.
+	(elf_link_sort_cmp2): Adjust.
+	(elf_link_sort_relocs): Set up r_sym_mask local var instead of
+	using ELF_R_SYM macro.  Set u.sym_mask.
+	(elf_bfd_final_link): Call _bfd_elf_stringtab_init instead of macro
+	version, elf_stringtab_init.  Ditto for bfd_section_from_elf_index
+	vs. section_from_elf_index.  Adjust Elf_External_Sym pointer
+	arithmetic.  Pass bed to elf_link_flush_output_syms.  Adjust
+	Elf_External_Dyn pointer arithmentic.  Use bed swap_dyn_in and
+	swap_syn_out functions.  Rearrange dyn swap in/out switch.
+	(elf_link_output_sym): Adjust Elf_External_Sym pointer arithmentic.
+	Pass bed to elf_link_flush_output_syms.  Use bed swap_symbol_out.
+	(elf_link_flush_output_syms): Add elf_backend_data arg.
+	(elf_link_check_versioned_symbol): Likewise.
+	(elf_link_output_extsym): Pass bed to elf_link_check_versioned_symbol.
+	Adjust Elf_External_Sym pointer arithmetic.  Use bed swap_symbol_out.
+	(elf_link_input_bfd): Use bfd_section_from_elf_index.  Set up
+	r_type_mask and r_sym_shift local vars and use instead of ELF_R_SYM,
+	ELF_R_TYPE and ELF_R_INFO macros.
+	(elf_reloc_link_order): Select ELF32_R_INFO or ELF64_R_INFO invocation
+	based on size rather than using ELF_R_INFO.
+	(elf_gc_mark): Set up r_sym_shift local var and use instead of
+	ELF_R_SYM macro.
+	(struct alloc_got_off_arg): New.
+	(elf_gc_common_finalize_got_offsets): Use elf_size_info instead of
+	ARCH_SIZE.  Pass get entry size down to elf_gc_allocate_got_offsets.
+	(elf_gc_allocate_got_offsets): Adjust.
+	(elf_reloc_symbol_deleted_p): Usee cookie.r_sym_shift instead of
+	ELF_R_SYM.  Use bfd_section_from_elf_index.
+	(elf_bfd_discard_info): Set cookie.r_sym_shift.
+	* elfcode.h (elf_stringtab_init, section_from_elf_index): Delete.
+	(elf_slurp_symbol_table): Use bfd_section_from_elf_index.
+
+2004-03-26  Stan Shebs  <shebs@apple.com>
+
+	Remove MPW support, no longer used.
+	* config.bfd (powerpc-*-mpw*): Remove configuration.
+	* mpw-config.in, mpw-make.sed: Remove files.
+	* ecoffswap.h [MPW_C]: Remove MPW-C-friendly version of code.
+
+2004-03-26  Alan Modra  <amodra@bigpond.net.au>
+
+	* elf64-ppc.c (elf_backend_add_symbol_hook): Define.
+	(ppc64_elf_add_symbol_hook): New function.
+	* elf-bfd.h (struct elf_backend_data <elf_add_symbol_hook>): Remove
+	const from Elf_Internal_Sym param.
+	* elflink.c (elf_link_add_object_symbols): Adjust.
+	* elf-hppa.h (elf_hppa_add_symbol_hook): Adjust.
+	* elf32-frv.c (elf32_frv_add_symbol_hook): Adjust.
+	* elf32-i370.c (elf_backend_add_symbol_hook): Adjust.
+	* elf32-m32r.c (m32r_elf_add_symbol_hook): Adjust.
+	* elf32-m68hc1x.c (elf32_m68hc11_add_symbol_hook): Adjust.
+	* elf32-m68hc1x.h (elf32_m68hc11_add_symbol_hook): Adjust.
+	* elf32-ppc.c (ppc_elf_add_symbol_hook): Adjust.
+	* elf32-sh64.c (sh64_elf_add_symbol_hook): Adjust.
+	* elf32-v850.c (v850_elf_add_symbol_hook): Adjust.
+	* elf64-alpha.c (elf64_alpha_add_symbol_hook): Adjust.
+	* elf64-mmix.c (mmix_elf_add_symbol_hook): Adjust.
+	* elf64-sh64.c (sh64_elf64_add_symbol_hook): Adjust.
+	* elf64-sparc.c (sparc64_elf_add_symbol_hook): Adjust.
+	* elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Adjust.
+	* elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Adjust.
+	* elfxx-mips.h (_bfd_mips_elf_add_symbol_hook): Adjust.
+
+2004-03-26  Alan Modra  <amodra@bigpond.net.au>
+
+	* elfxx-target.h (bfd_elfNN_bfd_link_add_symbols): Define.
+	* elf-bfd.h (_bfd_elf_link_add_archive_symbols): Delete.
+	(_bfd_elf_sort_symbol, _bfd_elf_add_dt_needed_tag): Delete.
+	(_bfd_elf_finalize_dynstr, bfd_elf32_bfd_link_add_symbols): Delete.
+	(bfd_elf64_bfd_link_add_symbols): Delete.
+	(bfd_elf_link_add_symbols): Declare.
+	* elfcode.h (elf_bfd_link_add_symbols): Delete.
+	* elflink.c: Include safe-ctype.h.
+	(elf_add_dt_needed_tag): Rename from _bfd_elf_add_dt_needed_tag,
+	make static.
+	(elf_sort_symbol): Rename from _bfd_elf_sort_symbol, make static.
+	(elf_finalize_dynstr): Rename from _bfd_elf_finalize_dynstr, make
+	static.
+	(elf_link_add_archive_symbols): Rename from
+	_bfd_elf_link_add_archive_symbols, make static.
+	(elf_link_add_object_symbols): New function.  Corresponding
+	elflink.h function converted to use elf_size_info.
+	(bfd_elf_link_add_symbols): Likewise.
+	(bfd_elf_size_dynamic_sections): Adjust.
+	* elflink.h (elf_bfd_link_add_symbols): Delete.
+	(elf_link_add_object_symbols): Delete.
+	* elf32-gen.c (elf32_generic_link_add_symbols): Call
+	bfd_elf_link_add_symbols.
+	* elf64-gen.c (elf64_generic_link_add_symbols): Likewise.
+
+2004-03-25  Alan Modra  <amodra@bigpond.net.au>
+
+	* elflink.h (elf_link_add_object_symbols): Add DT_NEEDED for as-needed
+	and chained shared libs only if dynsym.  Clear dynsym on forced-local.
+
+	* elf-bfd.h (_bfd_elf_add_dynamic_entry): Declare.
+	(bfd_elf32_add_dynamic_entry, bfd_elf64_add_dynamic_entry): Delete.
+	(_bfd_elf_add_dt_needed_tag): Declare.
+	(_bfd_elf_sort_symbol): Declare.
+	(_bfd_elf_finalize_dynstr): Declare.
+	(RELOC_FOR_GLOBAL_SYM): Formatting.
+	* elfcode.h (elf_add_dynamic_entry): Delete.
+	* elflink.c (_bfd_elf_add_dynamic_entry): New function.  Corresponding
+	elflink.h function converted to use elf_size_info.
+	(_bfd_elf_add_dt_needed_tag): Likewise.
+	(_bfd_elf_sort_symbol): Likewise.
+	(_bfd_elf_finalize_dynstr): Likewise.
+	(compute_bucket_count): Likewise.
+	(bfd_elf_size_dynamic_sections): Likewise.  Check result of
+	_bfd_elf_strtab_add before calling _bfd_elf_strtab_addref.
+	(elf_adjust_dynstr_offsets, elf_collect_hash_codes): Moved from..
+	* elflink.h: ..here.
+	(sort_symbol, add_dt_needed_tag): Delete.
+	(elf_add_dynamic_entry, elf_finalize_dynstr): Delete.
+	(compute_bucket_count, NAME(bfd_elf,size_dynamic_sections)): Delete.
+	Update all users.
+	* elf32-arm.h (add_dynamic_entry): Update.  Remove casts.
+	* elf32-cris.c (add_dynamic_entry): Likewise.
+	* elf32-hppa.c (add_dynamic_entry): Likewise.
+	* elf32-i370.c (add_dynamic_entry): Likewise.
+	* elf32-i386.c (add_dynamic_entry): Likewise.
+	* elf32-m32r.c (add_dynamic_entry): Likewise.
+	* elf32-m68k.c (add_dynamic_entry): Likewise.
+	* elf32-ppc.c (add_dynamic_entry): Likewise.
+	* elf32-s390.c (add_dynamic_entry): Likewise.
+	* elf32-sh.c (add_dynamic_entry): Likewise.
+	* elf32-sparc.c (add_dynamic_entry): Likewise.
+	* elf32-vax.c (add_dynamic_entry): Likewise.
+	* elf32-xtensa.c (add_dynamic_entry): Likewise.
+	* elf64-alpha.c (add_dynamic_entry): Likewise.
+	* elf64-hppa.c (add_dynamic_entry): Likewise.
+	* elf64-ppc.c (add_dynamic_entry): Likewise.
+	* elf64-s390.c (add_dynamic_entry): Likewise.
+	* elf64-sparc.c (add_dynamic_entry): Likewise.
+	* elf64-x86-64.c (add_dynamic_entry): Likewise.
+	* elfxx-ia64.c (add_dynamic_entry): Likewise.
+	* elfxx-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise.
+	* elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise.
+	* elf32-frv.c (elf32_frv_size_dynamic_sections): Likewise.
+	* elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise.
+
 2004-03-23  Paul Brook  <paul@codesourcery.com>
 
 	* elf32-arm.h (arm_print_private_bfd_data): Add EABI v3.
@@ -12,7 +1886,7 @@
 	(elf_xtensa_size_dynamic_sections): Don't add DT_TEXTREL entry.
 	(elf_xtensa_relocate_section): Read literal tables and check for
 	dynamic relocations in read-only sections and not in literal pools.
-	
+
 2004-03-23  Alan Modra  <amodra@bigpond.net.au>
 
 	PR 51.
diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 315ede0..a937cc0 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -2,6 +2,9 @@
 
 AUTOMAKE_OPTIONS = cygnus
 
+# Uncomment the following line when doing a release.
+# RELEASE=y
+
 INCDIR = $(srcdir)/../include
 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
 MKDEP = gcc -MM
@@ -55,7 +58,9 @@
 	cpu-arc.lo \
 	cpu-arm.lo \
 	cpu-avr.lo \
+	cpu-cr16c.lo \
 	cpu-cris.lo \
+	cpu-crx.lo \
 	cpu-d10v.lo \
 	cpu-d30v.lo \
 	cpu-dlx.lo \
@@ -111,6 +116,8 @@
 	cpu-arm.c \
 	cpu-avr.c \
 	cpu-cris.c \
+	cpu-cr16c.c \
+	cpu-crx.c \
 	cpu-d10v.c \
 	cpu-d30v.c \
 	cpu-dlx.c \
@@ -213,7 +220,9 @@
 	elfarm-oabi.lo \
 	elfarm-nabi.lo \
 	elf32-avr.lo \
+	elf32-cr16c.lo \
 	elf32-cris.lo \
+	elf32-crx.lo \
 	elf32-d10v.lo \
 	elf32-d30v.lo \
 	elf32-dlx.lo \
@@ -247,6 +256,7 @@
 	elf32-ppc.lo \
 	elf32-s390.lo \
 	elf32-sh.lo \
+	elf32-sh-symbian.lo \
 	elf32-sh64.lo \
 	elf32-sh64-com.lo \
 	elf32-sparc.lo \
@@ -279,6 +289,7 @@
 	m68klynx.lo \
 	m68knetbsd.lo \
 	m88kmach3.lo \
+	m88kopenbsd.lo \
 	mach-o.lo \
 	mipsbsd.lo \
 	newsos3.lo \
@@ -378,7 +389,9 @@
 	elfarm-oabi.c \
 	elfarm-nabi.c \
 	elf32-avr.c \
+	elf32-cr16c.c \
 	elf32-cris.c \
+	elf32-crx.c \
 	elf32-d10v.c \
 	elf32-d30v.c \
 	elf32-dlx.c \
@@ -413,6 +426,7 @@
 	elf32-sh64-com.c \
 	elf32-s390.c \
 	elf32-sh.c \
+	elf32-sh-symbian.c \
 	elf32-sparc.c \
 	elf32-v850.c \
 	elf32-vax.c \
@@ -443,6 +457,7 @@
 	m68klynx.c \
 	m68knetbsd.c \
 	m88kmach3.c \
+	m88kopenbsd.c \
 	mach-o.c \
 	mipsbsd.c \
 	newsos3.c \
@@ -588,7 +603,7 @@
 SOURCE_HFILES = \
 	aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
 	elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h \
-	elf64-hppa.h elfcode.h elfcore.h elflink.h \
+	elf64-hppa.h elfcode.h elfcore.h \
 	freebsd.h genlink.h go32stub.h \
 	libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
 	libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \
@@ -856,11 +871,20 @@
 
 DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES)
 
-# We want to rerun configure if config.bfd, configure.host or version.h change.
-config.status: $(srcdir)/configure $(srcdir)/config.bfd \
-		$(srcdir)/configure.host $(srcdir)/version.h
+# We want to rerun configure if configure, config.bfd or configure.host change.
+config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
 	$(SHELL) ./config.status --recheck
 
+bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
+	@echo "creating $@"
+	@bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
+	bfd_version_string="\"$(VERSION)\"" ;\
+	if test "x$(RELEASE)" = x ; then \
+	  bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
+	  bfd_version_string="\"$(VERSION) $${bfd_version_date}\"" ;\
+	fi ;\
+	sed -e "s/@bfd_version@/$$bfd_version/" -e "s/@bfd_version_string@/$$bfd_version_string/" < $(srcdir)/version.h > $@
+
 # What appears below is generated by a hacked mkdep using gcc -MM.
 
 # DO NOT DELETE THIS LINE -- mkdep uses it.
@@ -890,7 +914,8 @@
   $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
 targets.lo: targets.c $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h \
   targmatch.h
-hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h
+hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h \
+  $(INCDIR)/libiberty.h
 linker.lo: linker.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   genlink.h
 srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
@@ -916,6 +941,8 @@
 cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
 cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h
 cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h
+cpu-cr16c.lo: cpu-cr16c.c $(INCDIR)/filenames.h
+cpu-crx.lo: cpu-crx.c $(INCDIR)/filenames.h
 cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h
 cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h
 cpu-dlx.lo: cpu-dlx.c $(INCDIR)/filenames.h
@@ -951,7 +978,7 @@
 cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h
 cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h
 cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h
-cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h
+cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h $(srcdir)/../opcodes/sh-opc.h
 cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h
 cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h
 cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h
@@ -1137,10 +1164,18 @@
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \
   elf32-target.h
+elf32-cr16c.lo: elf32-cr16c.c $(INCDIR)/filenames.h \
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/cr16c.h $(INCDIR)/elf/reloc-macros.h \
+  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+  $(INCDIR)/elf/external.h elf32-target.h
 elf32-cris.lo: elf32-cris.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/cris.h $(INCDIR)/elf/reloc-macros.h \
   elf32-target.h
+elf32-crx.lo: elf32-crx.c $(INCDIR)/filenames.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/crx.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-d10v.lo: elf32-d10v.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/d10v.h $(INCDIR)/elf/reloc-macros.h \
@@ -1271,6 +1306,7 @@
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
   elf32-sh64.h elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+  $(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \
   elf32-target.h
 elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
@@ -1283,7 +1319,13 @@
 elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+  $(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \
   elf32-target.h
+elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c $(INCDIR)/filenames.h \
+  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
+  $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
+  $(srcdir)/../opcodes/sh-opc.h elf32-target.h
 elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
@@ -1309,11 +1351,10 @@
   $(INCDIR)/xtensa-config.h elf32-target.h
 elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \
-  elflink.h $(INCDIR)/safe-ctype.h
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h
 elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h
+  $(INCDIR)/elf/external.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h
 elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h
@@ -1383,6 +1424,9 @@
 m88kmach3.lo: m88kmach3.c $(INCDIR)/filenames.h 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
+m88kopenbsd.lo: m88kopenbsd.c netbsd.h $(INCDIR)/filenames.h \
+  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
 mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \
   $(INCDIR)/libiberty.h mach-o-target.c
 mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h libaout.h \
@@ -1513,8 +1557,7 @@
 xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h
 xtensa-isa.lo: xtensa-isa.c $(INCDIR)/xtensa-isa.h \
   $(INCDIR)/xtensa-isa-internal.h
-xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.h \
-  $(INCDIR)/xtensa-isa-internal.h
+xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa-internal.h
 aix5ppc-core.lo: aix5ppc-core.c
 aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
   $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
@@ -1591,8 +1634,7 @@
   elf64-target.h
 elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \
-  elflink.h $(INCDIR)/safe-ctype.h
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h
 mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h
 nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 2aef7e4..b674ded 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
 
 # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -120,14 +120,15 @@
 bfd_libs = @bfd_libs@
 bfd_machines = @bfd_machines@
 bfd_ufile_ptr = @bfd_ufile_ptr@
-bfd_version = @bfd_version@
-bfd_version_string = @bfd_version_string@
 l = @l@
 tdefaults = @tdefaults@
 wordsize = @wordsize@
 
 AUTOMAKE_OPTIONS = cygnus
 
+# Uncomment the following line when doing a release.
+# RELEASE=y
+
 INCDIR = $(srcdir)/../include
 CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
 MKDEP = gcc -MM
@@ -183,7 +184,9 @@
 	cpu-arc.lo \
 	cpu-arm.lo \
 	cpu-avr.lo \
+	cpu-cr16c.lo \
 	cpu-cris.lo \
+	cpu-crx.lo \
 	cpu-d10v.lo \
 	cpu-d30v.lo \
 	cpu-dlx.lo \
@@ -240,6 +243,8 @@
 	cpu-arm.c \
 	cpu-avr.c \
 	cpu-cris.c \
+	cpu-cr16c.c \
+	cpu-crx.c \
 	cpu-d10v.c \
 	cpu-d30v.c \
 	cpu-dlx.c \
@@ -343,7 +348,9 @@
 	elfarm-oabi.lo \
 	elfarm-nabi.lo \
 	elf32-avr.lo \
+	elf32-cr16c.lo \
 	elf32-cris.lo \
+	elf32-crx.lo \
 	elf32-d10v.lo \
 	elf32-d30v.lo \
 	elf32-dlx.lo \
@@ -377,6 +384,7 @@
 	elf32-ppc.lo \
 	elf32-s390.lo \
 	elf32-sh.lo \
+	elf32-sh-symbian.lo \
 	elf32-sh64.lo \
 	elf32-sh64-com.lo \
 	elf32-sparc.lo \
@@ -409,6 +417,7 @@
 	m68klynx.lo \
 	m68knetbsd.lo \
 	m88kmach3.lo \
+	m88kopenbsd.lo \
 	mach-o.lo \
 	mipsbsd.lo \
 	newsos3.lo \
@@ -509,7 +518,9 @@
 	elfarm-oabi.c \
 	elfarm-nabi.c \
 	elf32-avr.c \
+	elf32-cr16c.c \
 	elf32-cris.c \
+	elf32-crx.c \
 	elf32-d10v.c \
 	elf32-d30v.c \
 	elf32-dlx.c \
@@ -544,6 +555,7 @@
 	elf32-sh64-com.c \
 	elf32-s390.c \
 	elf32-sh.c \
+	elf32-sh-symbian.c \
 	elf32-sparc.c \
 	elf32-v850.c \
 	elf32-vax.c \
@@ -574,6 +586,7 @@
 	m68klynx.c \
 	m68knetbsd.c \
 	m88kmach3.c \
+	m88kopenbsd.c \
 	mach-o.c \
 	mipsbsd.c \
 	newsos3.c \
@@ -725,7 +738,7 @@
 SOURCE_HFILES = \
 	aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \
 	elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h \
-	elf64-hppa.h elfcode.h elfcore.h elflink.h \
+	elf64-hppa.h elfcode.h elfcore.h \
 	freebsd.h genlink.h go32stub.h \
 	libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \
 	libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \
@@ -785,7 +798,7 @@
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
 CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =  bfd-in3.h bfdver.h
+CONFIG_CLEAN_FILES =  bfd-in3.h
 LIBRARIES =  $(noinst_LIBRARIES)
 
 
@@ -809,12 +822,12 @@
 LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
 DIST_COMMON =  README ./stamp-h.in COPYING ChangeLog Makefile.am \
 Makefile.in TODO acinclude.m4 aclocal.m4 bfd-in2.h config.in configure \
-configure.in version.h
+configure.in
 
 
 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)
@@ -863,8 +876,6 @@
 maintainer-clean-hdr:
 bfd-in3.h: $(top_builddir)/config.status bfd-in2.h
 	cd $(top_builddir) && CONFIG_FILES=$@:bfd-in2.h CONFIG_HEADERS= $(SHELL) ./config.status
-bfdver.h: $(top_builddir)/config.status version.h
-	cd $(top_builddir) && CONFIG_FILES=$@:version.h CONFIG_HEADERS= $(SHELL) ./config.status
 
 mostlyclean-noinstLIBRARIES:
 
@@ -1393,11 +1404,20 @@
 	$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
 	touch stmp-lcoff-h
 
-# We want to rerun configure if config.bfd, configure.host or version.h change.
-config.status: $(srcdir)/configure $(srcdir)/config.bfd \
-		$(srcdir)/configure.host $(srcdir)/version.h
+# We want to rerun configure if configure, config.bfd or configure.host change.
+config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
 	$(SHELL) ./config.status --recheck
 
+bfdver.h: $(srcdir)/version.h $(srcdir)/Makefile.in
+	@echo "creating $@"
+	@bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
+	bfd_version_string="\"$(VERSION)\"" ;\
+	if test "x$(RELEASE)" = x ; then \
+	  bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\
+	  bfd_version_string="\"$(VERSION) $${bfd_version_date}\"" ;\
+	fi ;\
+	sed -e "s/@bfd_version@/$$bfd_version/" -e "s/@bfd_version_string@/$$bfd_version_string/" < $(srcdir)/version.h > $@
+
 # What appears below is generated by a hacked mkdep using gcc -MM.
 
 # DO NOT DELETE THIS LINE -- mkdep uses it.
@@ -1427,7 +1447,8 @@
   $(INCDIR)/bfdlink.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
 targets.lo: targets.c $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h \
   targmatch.h
-hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h
+hash.lo: hash.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h \
+  $(INCDIR)/libiberty.h
 linker.lo: linker.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   genlink.h
 srec.lo: srec.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
@@ -1453,6 +1474,8 @@
 cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h
 cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h
 cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h
+cpu-cr16c.lo: cpu-cr16c.c $(INCDIR)/filenames.h
+cpu-crx.lo: cpu-crx.c $(INCDIR)/filenames.h
 cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h
 cpu-d30v.lo: cpu-d30v.c $(INCDIR)/filenames.h
 cpu-dlx.lo: cpu-dlx.c $(INCDIR)/filenames.h
@@ -1488,7 +1511,7 @@
 cpu-powerpc.lo: cpu-powerpc.c $(INCDIR)/filenames.h
 cpu-rs6000.lo: cpu-rs6000.c $(INCDIR)/filenames.h
 cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h
-cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h
+cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h $(srcdir)/../opcodes/sh-opc.h
 cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h
 cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h
 cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h
@@ -1674,10 +1697,18 @@
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/reloc-macros.h \
   elf32-target.h
+elf32-cr16c.lo: elf32-cr16c.c $(INCDIR)/filenames.h \
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/cr16c.h $(INCDIR)/elf/reloc-macros.h \
+  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+  $(INCDIR)/elf/external.h elf32-target.h
 elf32-cris.lo: elf32-cris.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/cris.h $(INCDIR)/elf/reloc-macros.h \
   elf32-target.h
+elf32-crx.lo: elf32-crx.c $(INCDIR)/filenames.h elf-bfd.h \
+  $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
+  $(INCDIR)/bfdlink.h $(INCDIR)/elf/crx.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-d10v.lo: elf32-d10v.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/elf/d10v.h $(INCDIR)/elf/reloc-macros.h \
@@ -1808,6 +1839,7 @@
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
   elf32-sh64.h elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+  $(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \
   elf32-target.h
 elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
@@ -1820,7 +1852,13 @@
 elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+  $(INCDIR)/libiberty.h $(srcdir)/../opcodes/sh-opc.h \
   elf32-target.h
+elf32-sh-symbian.lo: elf32-sh-symbian.c elf32-sh.c $(INCDIR)/filenames.h \
+  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
+  $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \
+  $(srcdir)/../opcodes/sh-opc.h elf32-target.h
 elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \
   $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
   $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \
@@ -1846,11 +1884,10 @@
   $(INCDIR)/xtensa-config.h elf32-target.h
 elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \
-  elflink.h $(INCDIR)/safe-ctype.h
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h
 elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
-  $(INCDIR)/elf/external.h
+  $(INCDIR)/elf/external.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h
 elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
   $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h
@@ -1920,6 +1957,9 @@
 m88kmach3.lo: m88kmach3.c $(INCDIR)/filenames.h 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
+m88kopenbsd.lo: m88kopenbsd.c netbsd.h $(INCDIR)/filenames.h \
+  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
 mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \
   $(INCDIR)/libiberty.h mach-o-target.c
 mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h libaout.h \
@@ -2050,8 +2090,7 @@
 xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h
 xtensa-isa.lo: xtensa-isa.c $(INCDIR)/xtensa-isa.h \
   $(INCDIR)/xtensa-isa-internal.h
-xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.h \
-  $(INCDIR)/xtensa-isa-internal.h
+xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa-internal.h
 aix5ppc-core.lo: aix5ppc-core.c
 aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \
   $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \
@@ -2128,8 +2167,7 @@
   elf64-target.h
 elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
-  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \
-  elflink.h $(INCDIR)/safe-ctype.h
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h
 mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h
 nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \
diff --git a/bfd/aix386-core.c b/bfd/aix386-core.c
index 22d045a..38be161 100644
--- a/bfd/aix386-core.c
+++ b/bfd/aix386-core.c
@@ -122,7 +122,7 @@
     goto loser;
 
   core_regsec (abfd)->flags = SEC_HAS_CONTENTS;
-  core_regsec (abfd)->_raw_size = sizeof (core->cd_regs);
+  core_regsec (abfd)->size = sizeof (core->cd_regs);
   core_regsec (abfd)->vma = (bfd_vma) -1;
 
   /* We'll access the regs afresh in the core file, like any section.  */
@@ -135,7 +135,7 @@
     goto loser;
 
   core_reg2sec (abfd)->flags = SEC_HAS_CONTENTS;
-  core_reg2sec (abfd)->_raw_size = sizeof (core->cd_fpregs);
+  core_reg2sec (abfd)->size = sizeof (core->cd_fpregs);
   core_reg2sec (abfd)->vma = (bfd_vma) -1;
   core_reg2sec (abfd)->filepos =
     (file_ptr) offsetof (struct corehdr, cd_fpregs);
@@ -180,7 +180,7 @@
 	goto loser;
 
       core_section (abfd, n)->flags = flags;
-      core_section (abfd, n)->_raw_size = core->cd_segs[i].cs_len;
+      core_section (abfd, n)->size = core->cd_segs[i].cs_len;
       core_section (abfd, n)->vma       = core->cd_segs[i].cs_address;
       core_section (abfd, n)->filepos   = core->cd_segs[i].cs_offset;
       core_section (abfd, n)->alignment_power = 2;
diff --git a/bfd/aix5ppc-core.c b/bfd/aix5ppc-core.c
index 0351076..fa066ec 100644
--- a/bfd/aix5ppc-core.c
+++ b/bfd/aix5ppc-core.c
@@ -1,5 +1,5 @@
 /* IBM RS/6000 "XCOFF" back-end for BFD.
-   Copyright 2001, 2002
+   Copyright 2001, 2002, 2004
    Free Software Foundation, Inc.
    Written by Tom Rix
    Contributed by Redhat.
@@ -125,7 +125,7 @@
     return return_value;
 
   sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
-  sec->_raw_size = core.c_size;
+  sec->size = core.c_size;
   sec->vma = core.c_stackorg;
   sec->filepos = core.c_stack;
 
@@ -135,7 +135,7 @@
     return return_value;
 
   sec->flags = SEC_HAS_CONTENTS | SEC_IN_MEMORY;
-  sec->_raw_size = sizeof (struct __context64);
+  sec->size = sizeof (struct __context64);
   sec->vma = 0;
   sec->filepos = 0;
   sec->contents = (bfd_byte *)&new_core_hdr->c_flt.r64;
@@ -149,7 +149,7 @@
     return return_value;
 
   sec->flags = SEC_HAS_CONTENTS;
-  sec->_raw_size = core.c_lsize;
+  sec->size = core.c_lsize;
   sec->vma = 0;
   sec->filepos = core.c_loader;
 
@@ -163,7 +163,7 @@
     return return_value;
 
   sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
-  sec->_raw_size = core.c_datasize;
+  sec->size = core.c_datasize;
   sec->vma = core.c_dataorg;
   sec->filepos = core.c_data;
 
@@ -186,7 +186,7 @@
 	    return return_value;
 
 	  sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
-	  sec->_raw_size = ldinfo.ldinfo_datasize;
+	  sec->size = ldinfo.ldinfo_datasize;
 	  sec->vma = ldinfo.ldinfo_dataorg;
 	  sec->filepos = ldinfo.ldinfo_core;
 	}
@@ -214,7 +214,7 @@
 	    return return_value;
 
 	  sec->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
-	  sec->_raw_size = vminfo.vminfo_size;
+	  sec->size = vminfo.vminfo_size;
 	  sec->vma = vminfo.vminfo_addr;
 	  sec->filepos = vminfo.vminfo_offset;
 	}
diff --git a/bfd/aout-adobe.c b/bfd/aout-adobe.c
index 052e938..2e3a65f 100644
--- a/bfd/aout-adobe.c
+++ b/bfd/aout-adobe.c
@@ -1,6 +1,6 @@
 /* BFD back-end for a.out.adobe binaries.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-   2002, 2003
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000,
+   2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.  Based on bout.c.
 
@@ -235,10 +235,9 @@
       /* Now set the section's attributes.  */
       bfd_set_section_flags (abfd, sect, flags);
       /* Assumed big-endian.  */
-      sect->_raw_size = ((ext->e_size[0] << 8)
-			 | ext->e_size[1] << 8
-			 | ext->e_size[2]);
-      sect->_cooked_size = sect->_raw_size;
+      sect->size = ((ext->e_size[0] << 8)
+		    | ext->e_size[1] << 8
+		    | ext->e_size[2]);
       sect->vma = H_GET_32 (abfd, ext->e_virtbase);
       sect->filepos = H_GET_32 (abfd, ext->e_filebase);
       /* FIXME XXX alignment?  */
@@ -324,19 +323,19 @@
     {
       if (sect->flags & SEC_CODE)
 	{
-	  exec_hdr (abfd)->a_text += sect->_raw_size;
+	  exec_hdr (abfd)->a_text += sect->size;
 	  exec_hdr (abfd)->a_trsize += sect->reloc_count *
 	    sizeof (struct reloc_std_external);
 	}
       else if (sect->flags & SEC_DATA)
 	{
-	  exec_hdr (abfd)->a_data += sect->_raw_size;
+	  exec_hdr (abfd)->a_data += sect->size;
 	  exec_hdr (abfd)->a_drsize += sect->reloc_count *
 	    sizeof (struct reloc_std_external);
 	}
       else if (sect->flags & SEC_ALLOC && !(sect->flags & SEC_LOAD))
 	{
-	  exec_hdr (abfd)->a_bss += sect->_raw_size;
+	  exec_hdr (abfd)->a_bss += sect->size;
 	}
     }
 
@@ -435,7 +434,7 @@
 	    {
 	      sect->filepos = section_start;
 	      /* FIXME:  Round to alignment.  */
-	      section_start += sect->_raw_size;
+	      section_start += sect->size;
 	    }
 	}
 
@@ -445,7 +444,7 @@
 	    {
 	      sect->filepos = section_start;
 	      /* FIXME:  Round to alignment.  */
-	      section_start += sect->_raw_size;
+	      section_start += sect->size;
 	    }
 	}
 
@@ -456,7 +455,7 @@
 	    {
 	      sect->filepos = section_start;
 	      /* FIXME:  Round to alignment.  */
-	      section_start += sect->_raw_size;
+	      section_start += sect->size;
 	    }
 	}
     }
@@ -517,6 +516,7 @@
 #define aout_32_bfd_relax_section       bfd_generic_relax_section
 #define aout_32_bfd_gc_sections         bfd_generic_gc_sections
 #define aout_32_bfd_merge_sections	bfd_generic_merge_sections
+#define aout_32_bfd_is_group_section	bfd_generic_is_group_section
 #define aout_32_bfd_discard_group	bfd_generic_discard_group
 #define aout_32_bfd_link_hash_table_create \
   _bfd_generic_link_hash_table_create
diff --git a/bfd/aout-target.h b/bfd/aout-target.h
index d8cad54..5fb58d0 100644
--- a/bfd/aout-target.h
+++ b/bfd/aout-target.h
@@ -1,6 +1,6 @@
 /* Define a target vector and some small routines for a variant of a.out.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -46,7 +46,7 @@
   unsigned long arch_align;
 
   /* Calculate the file positions of the parts of a newly read aout header */
-  obj_textsec (abfd)->_raw_size = N_TXTSIZE(*execp);
+  obj_textsec (abfd)->size = N_TXTSIZE(*execp);
 
   /* The virtual memory addresses of the sections */
   obj_textsec (abfd)->vma = N_TXTADDR(*execp);
@@ -110,12 +110,12 @@
      of the section.  */
   arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
   arch_align = 1 << arch_align_power;
-  if ((BFD_ALIGN (obj_textsec (abfd)->_raw_size, arch_align)
-       == obj_textsec (abfd)->_raw_size)
-      && (BFD_ALIGN (obj_datasec (abfd)->_raw_size, arch_align)
-	  == obj_datasec (abfd)->_raw_size)
-      && (BFD_ALIGN (obj_bsssec (abfd)->_raw_size, arch_align)
-	  == obj_bsssec (abfd)->_raw_size))
+  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
+       == obj_textsec (abfd)->size)
+      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
+	  == obj_datasec (abfd)->size)
+      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
+	  == obj_bsssec (abfd)->size))
     {
       obj_textsec (abfd)->alignment_power = arch_align_power;
       obj_datasec (abfd)->alignment_power = arch_align_power;
@@ -513,6 +513,9 @@
 #ifndef MY_bfd_merge_sections
 #define MY_bfd_merge_sections bfd_generic_merge_sections
 #endif
+#ifndef MY_bfd_is_group_section
+#define MY_bfd_is_group_section bfd_generic_is_group_section
+#endif
 #ifndef MY_bfd_discard_group
 #define MY_bfd_discard_group bfd_generic_discard_group
 #endif
@@ -556,6 +559,10 @@
 #define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
 #endif
 
+#ifndef MY_bfd_copy_private_header_data
+#define MY_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
+#endif
+
 #ifndef MY_bfd_print_private_bfd_data
 #define MY_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
 #endif
@@ -584,6 +591,10 @@
 #define MY_canonicalize_dynamic_symtab \
   _bfd_nodynamic_canonicalize_dynamic_symtab
 #endif
+#ifndef MY_get_synthetic_symtab
+#define MY_get_synthetic_symtab \
+  _bfd_nodynamic_get_synthetic_symtab
+#endif
 #ifndef MY_get_dynamic_reloc_upper_bound
 #define MY_get_dynamic_reloc_upper_bound \
   _bfd_nodynamic_get_dynamic_reloc_upper_bound
diff --git a/bfd/aout-tic30.c b/bfd/aout-tic30.c
index 1f37b99..cf574ff 100644
--- a/bfd/aout-tic30.c
+++ b/bfd/aout-tic30.c
@@ -1,5 +1,6 @@
 /* BFD back-end for TMS320C30 a.out binaries.
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   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.
@@ -337,7 +338,7 @@
   unsigned long arch_align;
 
   /* Calculate the file positions of the parts of a newly read aout header.  */
-  obj_textsec (abfd)->_raw_size = N_TXTSIZE (*execp);
+  obj_textsec (abfd)->size = N_TXTSIZE (*execp);
 
   /* The virtual memory addresses of the sections.  */
   obj_textsec (abfd)->vma = N_TXTADDR (*execp);
@@ -375,12 +376,12 @@
      of the section.  */
   arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
   arch_align = 1 << arch_align_power;
-  if ((BFD_ALIGN (obj_textsec (abfd)->_raw_size, arch_align)
-       == obj_textsec (abfd)->_raw_size)
-      && (BFD_ALIGN (obj_datasec (abfd)->_raw_size, arch_align)
-	  == obj_datasec (abfd)->_raw_size)
-      && (BFD_ALIGN (obj_bsssec (abfd)->_raw_size, arch_align)
-	  == obj_bsssec (abfd)->_raw_size))
+  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
+       == obj_textsec (abfd)->size)
+      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
+	  == obj_datasec (abfd)->size)
+      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
+	  == obj_bsssec (abfd)->size))
     {
       obj_textsec (abfd)->alignment_power = arch_align_power;
       obj_datasec (abfd)->alignment_power = arch_align_power;
@@ -402,7 +403,7 @@
 {
   bfd_vma relocation;
 
-  if (address > input_section->_raw_size)
+  if (address > bfd_get_section_limit (input_bfd, input_section))
     return bfd_reloc_outofrange;
 
   relocation = value + addend;
@@ -756,8 +757,8 @@
   obj_textsec (abfd)->filepos = pos;
   obj_textsec (abfd)->vma = vma;
   obj_textsec (abfd)->user_set_vma = 1;
-  pos += obj_textsec (abfd)->_raw_size;
-  vma += obj_textsec (abfd)->_raw_size;
+  pos += obj_textsec (abfd)->size;
+  vma += obj_textsec (abfd)->size;
 
   /* Data.  */
   if (abfd->flags & D_PAGED)
@@ -779,14 +780,14 @@
   vma = obj_datasec (abfd)->vma;
   obj_datasec (abfd)->filepos = vma + adata (abfd).exec_bytes_size;
   execp->a_text = vma - obj_textsec (abfd)->vma;
-  obj_textsec (abfd)->_raw_size = execp->a_text;
+  obj_textsec (abfd)->size = execp->a_text;
 
   /* Since BSS follows data immediately, see if it needs alignment.  */
-  vma += obj_datasec (abfd)->_raw_size;
+  vma += obj_datasec (abfd)->size;
   pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
-  obj_datasec (abfd)->_raw_size += pad;
-  pos += obj_datasec (abfd)->_raw_size;
-  execp->a_data = obj_datasec (abfd)->_raw_size;
+  obj_datasec (abfd)->size += pad;
+  pos += obj_datasec (abfd)->size;
+  execp->a_data = obj_datasec (abfd)->size;
 
   /* BSS.  */
   obj_bsssec (abfd)->vma = vma;
@@ -969,6 +970,9 @@
 #ifndef MY_bfd_merge_sections
 #define MY_bfd_merge_sections bfd_generic_merge_sections
 #endif
+#ifndef MY_bfd_is_group_section
+#define MY_bfd_is_group_section bfd_generic_is_group_section
+#endif
 #ifndef MY_bfd_discard_group
 #define MY_bfd_discard_group bfd_generic_discard_group
 #endif
@@ -1012,6 +1016,10 @@
 #define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
 #endif
 
+#ifndef MY_bfd_copy_private_header_data
+#define MY_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
+#endif
+
 #ifndef MY_bfd_print_private_bfd_data
 #define MY_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
 #endif
@@ -1040,6 +1048,10 @@
 #define MY_canonicalize_dynamic_symtab \
   _bfd_nodynamic_canonicalize_dynamic_symtab
 #endif
+#ifndef MY_get_synthetic_symtab
+#define MY_get_synthetic_symtab \
+  _bfd_nodynamic_get_synthetic_symtab
+#endif
 #ifndef MY_get_dynamic_reloc_upper_bound
 #define MY_get_dynamic_reloc_upper_bound \
   _bfd_nodynamic_get_dynamic_reloc_upper_bound
diff --git a/bfd/aoutf1.h b/bfd/aoutf1.h
index 352dadf..eb5b2f9 100644
--- a/bfd/aoutf1.h
+++ b/bfd/aoutf1.h
@@ -1,6 +1,6 @@
 /* A.out "format 1" file handling code for BFD.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
-   2001, 2002, 2003
+   2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -701,10 +701,10 @@
   core_regsec (abfd)->flags = SEC_HAS_CONTENTS;
   core_reg2sec (abfd)->flags = SEC_HAS_CONTENTS;
 
-  core_stacksec (abfd)->_raw_size = core->c_ssize;
-  core_datasec (abfd)->_raw_size = core->c_dsize;
-  core_regsec (abfd)->_raw_size = core->c_regs_size;
-  core_reg2sec (abfd)->_raw_size = core->fp_stuff_size;
+  core_stacksec (abfd)->size = core->c_ssize;
+  core_datasec (abfd)->size = core->c_dsize;
+  core_regsec (abfd)->size = core->c_regs_size;
+  core_reg2sec (abfd)->size = core->fp_stuff_size;
 
   core_stacksec (abfd)->vma = (core->c_stacktop - core->c_ssize);
   core_datasec (abfd)->vma = core->c_data_addr;
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 3282f87..4fa529c 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -1,6 +1,6 @@
 /* BFD semi-generic back-end for a.out binaries.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
-   2001, 2002, 2003
+   2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -541,8 +541,8 @@
   if (! NAME(aout,make_sections) (abfd))
     goto error_ret;
 
-  obj_datasec (abfd)->_raw_size = execp->a_data;
-  obj_bsssec (abfd)->_raw_size = execp->a_bss;
+  obj_datasec (abfd)->size = execp->a_data;
+  obj_bsssec (abfd)->size = execp->a_bss;
 
   obj_textsec (abfd)->flags =
     (execp->a_trsize != 0
@@ -568,7 +568,6 @@
   struct exec *execp = exec_hdr (abfd);
 
   obj_textsec (abfd)->size = N_TXTSIZE (*execp);
-  obj_textsec (abfd)->raw_size = N_TXTSIZE (*execp);
   /* Data and bss are already filled in since they're so standard.  */
 
   /* The virtual memory addresses of the sections.  */
@@ -632,7 +631,7 @@
   if (execp->a_entry != 0
       || (execp->a_entry >= obj_textsec (abfd)->vma
 	  && execp->a_entry < (obj_textsec (abfd)->vma
-			       + obj_textsec (abfd)->_raw_size)))
+			       + obj_textsec (abfd)->size)))
     abfd->flags |= EXEC_P;
 #ifdef STAT_FOR_EXEC
   else
@@ -831,6 +830,10 @@
 	arch_flags = M_CRIS;
       break;
 
+    case bfd_arch_m88k:
+      *unknown = FALSE;
+      break;
+
     default:
       arch_flags = M_UNKNOWN;
     }
@@ -907,8 +910,8 @@
   else
     vma = obj_textsec (abfd)->vma;
 
-  pos += obj_textsec (abfd)->_raw_size;
-  vma += obj_textsec (abfd)->_raw_size;
+  pos += obj_textsec (abfd)->size;
+  vma += obj_textsec (abfd)->size;
 
   /* Data.  */
   if (!obj_datasec (abfd)->user_set_vma)
@@ -916,7 +919,7 @@
 #if 0	    /* ?? Does alignment in the file image really matter?  */
       pad = align_power (vma, obj_datasec (abfd)->alignment_power) - vma;
 #endif
-      obj_textsec (abfd)->_raw_size += pad;
+      obj_textsec (abfd)->size += pad;
       pos += pad;
       vma += pad;
       obj_datasec (abfd)->vma = vma;
@@ -924,8 +927,8 @@
   else
     vma = obj_datasec (abfd)->vma;
   obj_datasec (abfd)->filepos = pos;
-  pos += obj_datasec (abfd)->_raw_size;
-  vma += obj_datasec (abfd)->_raw_size;
+  pos += obj_datasec (abfd)->size;
+  vma += obj_datasec (abfd)->size;
 
   /* BSS.  */
   if (!obj_bsssec (abfd)->user_set_vma)
@@ -933,7 +936,7 @@
 #if 0
       pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
 #endif
-      obj_datasec (abfd)->_raw_size += pad;
+      obj_datasec (abfd)->size += pad;
       pos += pad;
       vma += pad;
       obj_bsssec (abfd)->vma = vma;
@@ -946,16 +949,16 @@
       pad = obj_bsssec (abfd)->vma - vma;
       if (pad > 0)
 	{
-	  obj_datasec (abfd)->_raw_size += pad;
+	  obj_datasec (abfd)->size += pad;
 	  pos += pad;
 	}
     }
   obj_bsssec (abfd)->filepos = pos;
 
   /* Fix up the exec header.  */
-  execp->a_text = obj_textsec (abfd)->_raw_size;
-  execp->a_data = obj_datasec (abfd)->_raw_size;
-  execp->a_bss = obj_bsssec (abfd)->_raw_size;
+  execp->a_text = obj_textsec (abfd)->size;
+  execp->a_data = obj_datasec (abfd)->size;
+  execp->a_bss = obj_bsssec (abfd)->size;
   N_SET_MAGIC (*execp, OMAGIC);
 }
 
@@ -1005,7 +1008,7 @@
   /* Find start of data.  */
   if (ztih)
     {
-      text_end = obj_textsec (abfd)->filepos + obj_textsec (abfd)->_raw_size;
+      text_end = obj_textsec (abfd)->filepos + obj_textsec (abfd)->size;
       text_pad += BFD_ALIGN (text_end, adata (abfd).page_size) - text_end;
     }
   else
@@ -1013,18 +1016,18 @@
       /* Note that if page_size == zmagic_disk_block_size, then
 	 filepos == page_size, and this case is the same as the ztih
 	 case.  */
-      text_end = obj_textsec (abfd)->_raw_size;
+      text_end = obj_textsec (abfd)->size;
       text_pad += BFD_ALIGN (text_end, adata (abfd).page_size) - text_end;
       text_end += obj_textsec (abfd)->filepos;
     }
-  obj_textsec (abfd)->_raw_size += text_pad;
+  obj_textsec (abfd)->size += text_pad;
   text_end += text_pad;
 
   /* Data.  */
   if (!obj_datasec (abfd)->user_set_vma)
     {
       bfd_vma vma;
-      vma = obj_textsec (abfd)->vma + obj_textsec (abfd)->_raw_size;
+      vma = obj_textsec (abfd)->vma + obj_textsec (abfd)->size;
       obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size);
     }
   if (abdp && abdp->zmagic_mapped_contiguous)
@@ -1032,17 +1035,17 @@
       asection * text = obj_textsec (abfd);
       asection * data = obj_datasec (abfd);
 
-      text_pad = data->vma - (text->vma + text->_raw_size);
+      text_pad = data->vma - (text->vma + text->size);
       /* Only pad the text section if the data
 	 section is going to be placed after it.  */
       if (text_pad > 0)
-	text->_raw_size += text_pad;
+	text->size += text_pad;
     }
   obj_datasec (abfd)->filepos = (obj_textsec (abfd)->filepos
-				 + obj_textsec (abfd)->_raw_size);
+				 + obj_textsec (abfd)->size);
 
   /* Fix up exec header while we're at it.  */
-  execp->a_text = obj_textsec (abfd)->_raw_size;
+  execp->a_text = obj_textsec (abfd)->size;
   if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
     execp->a_text += adata (abfd).exec_bytes_size;
   if (obj_aout_subformat (abfd) == q_magic_format)
@@ -1051,17 +1054,17 @@
     N_SET_MAGIC (*execp, ZMAGIC);
 
   /* Spec says data section should be rounded up to page boundary.  */
-  obj_datasec (abfd)->_raw_size
-    = align_power (obj_datasec (abfd)->_raw_size,
+  obj_datasec (abfd)->size
+    = align_power (obj_datasec (abfd)->size,
 		   obj_bsssec (abfd)->alignment_power);
-  execp->a_data = BFD_ALIGN (obj_datasec (abfd)->_raw_size,
+  execp->a_data = BFD_ALIGN (obj_datasec (abfd)->size,
 			     adata (abfd).page_size);
-  data_pad = execp->a_data - obj_datasec (abfd)->_raw_size;
+  data_pad = execp->a_data - obj_datasec (abfd)->size;
 
   /* BSS.  */
   if (!obj_bsssec (abfd)->user_set_vma)
     obj_bsssec (abfd)->vma = (obj_datasec (abfd)->vma
-			      + obj_datasec (abfd)->_raw_size);
+			      + obj_datasec (abfd)->size);
   /* If the BSS immediately follows the data section and extra space
      in the page is left after the data section, fudge data
      in the header so that the bss section looks smaller by that
@@ -1070,11 +1073,11 @@
      could have explicitly set the BSS vma to immediately follow
      the data section.)  */
   if (align_power (obj_bsssec (abfd)->vma, obj_bsssec (abfd)->alignment_power)
-      == obj_datasec (abfd)->vma + obj_datasec (abfd)->_raw_size)
-    execp->a_bss = (data_pad > obj_bsssec (abfd)->_raw_size
-		    ? 0 : obj_bsssec (abfd)->_raw_size - data_pad);
+      == obj_datasec (abfd)->vma + obj_datasec (abfd)->size)
+    execp->a_bss = (data_pad > obj_bsssec (abfd)->size
+		    ? 0 : obj_bsssec (abfd)->size - data_pad);
   else
-    execp->a_bss = obj_bsssec (abfd)->_raw_size;
+    execp->a_bss = obj_bsssec (abfd)->size;
 }
 
 static void
@@ -1092,8 +1095,8 @@
     obj_textsec (abfd)->vma = vma;
   else
     vma = obj_textsec (abfd)->vma;
-  pos += obj_textsec (abfd)->_raw_size;
-  vma += obj_textsec (abfd)->_raw_size;
+  pos += obj_textsec (abfd)->size;
+  vma += obj_textsec (abfd)->size;
 
   /* Data.  */
   obj_datasec (abfd)->filepos = pos;
@@ -1102,10 +1105,10 @@
   vma = obj_datasec (abfd)->vma;
 
   /* Since BSS follows data immediately, see if it needs alignment.  */
-  vma += obj_datasec (abfd)->_raw_size;
+  vma += obj_datasec (abfd)->size;
   pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
-  obj_datasec (abfd)->_raw_size += pad;
-  pos += obj_datasec (abfd)->_raw_size;
+  obj_datasec (abfd)->size += pad;
+  pos += obj_datasec (abfd)->size;
 
   /* BSS.  */
   if (!obj_bsssec (abfd)->user_set_vma)
@@ -1114,9 +1117,9 @@
     vma = obj_bsssec (abfd)->vma;
 
   /* Fix up exec header.  */
-  execp->a_text = obj_textsec (abfd)->_raw_size;
-  execp->a_data = obj_datasec (abfd)->_raw_size;
-  execp->a_bss = obj_bsssec (abfd)->_raw_size;
+  execp->a_text = obj_textsec (abfd)->size;
+  execp->a_data = obj_datasec (abfd)->size;
+  execp->a_bss = obj_bsssec (abfd)->size;
   N_SET_MAGIC (*execp, NMAGIC);
 }
 
@@ -1134,11 +1137,11 @@
   if (adata (abfd).magic != undecided_magic)
     return TRUE;
 
-  obj_textsec (abfd)->_raw_size =
-    align_power (obj_textsec (abfd)->_raw_size,
+  obj_textsec (abfd)->size =
+    align_power (obj_textsec (abfd)->size,
 		 obj_textsec (abfd)->alignment_power);
 
-  *text_size = obj_textsec (abfd)->_raw_size;
+  *text_size = obj_textsec (abfd)->size;
   /* Rule (heuristic) for when to pad to a new page.  Note that there
      are (at least) two ways demand-paged (ZMAGIC) files have been
      handled.  Most Berkeley-based systems start the text segment at
@@ -1176,11 +1179,11 @@
 		}
 	      str;
 	    }),
-	   obj_textsec (abfd)->vma, obj_textsec (abfd)->_raw_size,
+	   obj_textsec (abfd)->vma, obj_textsec (abfd)->size,
 	   	obj_textsec (abfd)->alignment_power,
-	   obj_datasec (abfd)->vma, obj_datasec (abfd)->_raw_size,
+	   obj_datasec (abfd)->vma, obj_datasec (abfd)->size,
 	   	obj_datasec (abfd)->alignment_power,
-	   obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size,
+	   obj_bsssec (abfd)->vma, obj_bsssec (abfd)->size,
 	   	obj_bsssec (abfd)->alignment_power);
 #endif
 #endif
@@ -1202,11 +1205,11 @@
 
 #ifdef BFD_AOUT_DEBUG
   fprintf (stderr, "       text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x>\n",
-	   obj_textsec (abfd)->vma, obj_textsec (abfd)->_raw_size,
+	   obj_textsec (abfd)->vma, obj_textsec (abfd)->size,
 	   	obj_textsec (abfd)->filepos,
-	   obj_datasec (abfd)->vma, obj_datasec (abfd)->_raw_size,
+	   obj_datasec (abfd)->vma, obj_datasec (abfd)->size,
 	   	obj_datasec (abfd)->filepos,
-	   obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size);
+	   obj_bsssec (abfd)->vma, obj_bsssec (abfd)->size);
 #endif
 
   return TRUE;
@@ -1580,8 +1583,8 @@
 
 	reloc->next = section->constructor_chain;
 	section->constructor_chain = reloc;
-	reloc->relent.address = section->_raw_size;
-	section->_raw_size += BYTES_IN_WORD;
+	reloc->relent.address = section->size;
+	section->size += BYTES_IN_WORD;
 
 	reloc->relent.howto = CTOR_TABLE_RELOC_HOWTO (abfd);
 
@@ -3784,10 +3787,10 @@
 
       if (bfd_get_flavour (sub) == bfd_target_aout_flavour)
 	{
-	  sz = bfd_section_size (sub, obj_textsec (sub));
+	  sz = obj_textsec (sub)->size;
 	  if (sz > max_contents_size)
 	    max_contents_size = sz;
-	  sz = bfd_section_size (sub, obj_datasec (sub));
+	  sz = obj_datasec (sub)->size;
 	  if (sz > max_contents_size)
 	    max_contents_size = sz;
 
@@ -4742,7 +4745,7 @@
   PTR relocs;
 
   /* Get the section contents.  */
-  input_size = bfd_section_size (input_bfd, input_section);
+  input_size = input_section->size;
   if (! bfd_get_section_contents (input_bfd, input_section,
 				  (PTR) finfo->contents,
 				  (file_ptr) 0, input_size))
diff --git a/bfd/archive.c b/bfd/archive.c
index ba6e684..ec8a086d 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -1,24 +1,24 @@
 /* BFD back-end for archive files (libraries).
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.  Mostly Gumby Henkel-Wallace's fault.
 
-This file is part of BFD, the Binary File Descriptor library.
+   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 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.
+   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.  */
+   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.  */
 
 /*
 @setfilename archive-info
@@ -221,7 +221,7 @@
   return prev;
 }
 
-/* To be called by backends only */
+/* To be called by backends only.  */
 
 bfd *
 _bfd_create_empty_archive_element_shell (bfd *obfd)
@@ -261,7 +261,8 @@
   return NULL;
 }
 
-/* Kind of stupid to call cons for each one, but we don't do too many */
+/* Kind of stupid to call cons for each one, but we don't do too many.  */
+
 bfd_boolean
 _bfd_add_bfd_to_archive_cache (bfd *arch_bfd, file_ptr filepos, bfd *new_elt)
 {
@@ -316,8 +317,7 @@
    Presumes the file pointer is already in the right place (ie pointing
    to the ar_hdr in the file).   Moves the file pointer; on success it
    should be pointing to the front of the file contents; on failure it
-   could have been moved arbitrarily.
-*/
+   could have been moved arbitrarily.  */
 
 void *
 _bfd_generic_read_ar_hdr (bfd *abfd)
@@ -467,6 +467,12 @@
   struct areltdata *new_areldata;
   bfd *n_nfd;
 
+  if (archive->my_archive)
+    {
+      filepos += archive->origin;
+      archive = archive->my_archive;
+    }
+
   n_nfd = _bfd_look_for_bfd_in_cache (archive, filepos);
   if (n_nfd)
     return n_nfd;
@@ -549,10 +555,12 @@
   else
     {
       unsigned int size = arelt_size (last_file);
+      filestart = last_file->origin + size;
+      if (archive->my_archive)
+	filestart -= archive->origin;
       /* Pad to an even boundary...
 	 Note that last_file->origin can be odd in the case of
 	 BSD-4.4-style element with a long odd size.  */
-      filestart = last_file->origin + size;
       filestart += filestart % 2;
     }
 
@@ -670,7 +678,7 @@
 /* The size of the string count.  */
 #define BSD_STRING_COUNT_SIZE 4
 
-/* Returns FALSE on error, TRUE otherwise */
+/* Returns FALSE on error, TRUE otherwise.  */
 
 static bfd_boolean
 do_slurp_bsd_armap (bfd *abfd)
@@ -901,8 +909,8 @@
   return TRUE;
 }
 
-/* Returns FALSE on error, TRUE otherwise */
-/* flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the
+/* Returns FALSE on error, TRUE otherwise.  */
+/* Flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the
    header is in a slightly different order and the map name is '/'.
    This flavour is used by hp300hpux.  */
 
@@ -932,7 +940,7 @@
     return FALSE;
 
   if (!strncmp (nextname, "__.SYMDEF       ", 16)
-      || !strncmp (nextname, "__.SYMDEF/      ", 16)) /* old Linux archives */
+      || !strncmp (nextname, "__.SYMDEF/      ", 16)) /* Old Linux archives.  */
     return do_slurp_bsd_armap (abfd);
 
   if (strncmp (nextname, "/               ", 16))
@@ -1296,7 +1304,7 @@
   return TRUE;
 }
 
-/** A couple of functions for creating ar_hdrs */
+/* A couple of functions for creating ar_hdrs.  */
 
 #ifdef HPUX_LARGE_AR_IDS
 /* Function to encode large UID/GID values according to HP.  */
@@ -1765,9 +1773,9 @@
   bfd *current;
   file_ptr elt_no = 0;
   struct orl *map = NULL;
-  unsigned int orl_max = 1024;		/* fine initial default */
+  unsigned int orl_max = 1024;		/* Fine initial default.  */
   unsigned int orl_count = 0;
-  int stridx = 0;		/* string index */
+  int stridx = 0;
   asymbol **syms = NULL;
   long syms_max = 0;
   bfd_boolean ret;
@@ -1916,7 +1924,7 @@
   unsigned int mapsize = ranlibsize + stringsize + 8;
   file_ptr firstreal;
   bfd *current = arch->archive_head;
-  bfd *last_elt = current;	/* last element arch seen */
+  bfd *last_elt = current;	/* Last element arch seen.  */
   bfd_byte temp[4];
   unsigned int count;
   struct ar_hdr hdr;
@@ -1960,7 +1968,7 @@
 	      current = current->next;
 	    }
 	  while (current != map[count].u.abfd);
-	}			/* if new archive element */
+	}
 
       last_elt = current;
       H_PUT_32 (arch, map[count].namidx, buf);
@@ -2058,8 +2066,7 @@
    symbol name 0
    symbol name 1
 
-   symbol name n-1
-*/
+   symbol name n-1  */
 
 bfd_boolean
 coff_write_armap (bfd *arch,
@@ -2104,7 +2111,6 @@
       (((char *) (&hdr))[i]) = ' ';
 
   /* Write the ar header for this item and the number of symbols.  */
-
   if (bfd_bwrite (&hdr, sizeof (struct ar_hdr), arch)
       != sizeof (struct ar_hdr))
     return FALSE;
diff --git a/bfd/archures.c b/bfd/archures.c
index 0e2a08b..db206a1 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -85,6 +85,11 @@
 .#define bfd_mach_mcf5307  11
 .#define bfd_mach_mcf5407  12
 .#define bfd_mach_mcf528x  13
+.#define bfd_mach_mcfv4e   14
+.#define bfd_mach_mcf521x   15
+.#define bfd_mach_mcf5249   16
+.#define bfd_mach_mcf547x   17
+.#define bfd_mach_mcf548x   18
 .  bfd_arch_vax,       {* DEC Vax *}
 .  bfd_arch_i960,      {* Intel 960 *}
 .    {* The order of the following is important.
@@ -226,6 +231,7 @@
 .#define bfd_mach_sh_dsp     0x2d
 .#define bfd_mach_sh2e       0x2e
 .#define bfd_mach_sh3        0x30
+.#define bfd_mach_sh3_nommu  0x31
 .#define bfd_mach_sh3_dsp    0x3d
 .#define bfd_mach_sh3e       0x3e
 .#define bfd_mach_sh4        0x40
@@ -307,6 +313,10 @@
 .#define bfd_mach_avr3		3
 .#define bfd_mach_avr4		4
 .#define bfd_mach_avr5		5
+.  bfd_arch_cr16c,       {* National Semiconductor CompactRISC. *}
+.#define bfd_mach_cr16c		1
+.  bfd_arch_crx,       {*  National Semiconductor CRX.  *}
+.#define bfd_mach_crx		1
 .  bfd_arch_cris,      {* Axis CRIS *}
 .  bfd_arch_s390,      {* IBM s390 *}
 .#define bfd_mach_s390_31       31
@@ -375,7 +385,9 @@
 extern const bfd_arch_info_type bfd_arc_arch;
 extern const bfd_arch_info_type bfd_arm_arch;
 extern const bfd_arch_info_type bfd_avr_arch;
+extern const bfd_arch_info_type bfd_cr16c_arch;
 extern const bfd_arch_info_type bfd_cris_arch;
+extern const bfd_arch_info_type bfd_crx_arch;
 extern const bfd_arch_info_type bfd_d10v_arch;
 extern const bfd_arch_info_type bfd_d30v_arch;
 extern const bfd_arch_info_type bfd_dlx_arch;
@@ -435,7 +447,9 @@
     &bfd_arc_arch,
     &bfd_arm_arch,
     &bfd_avr_arch,
+    &bfd_cr16c_arch,
     &bfd_cris_arch,
+    &bfd_crx_arch,
     &bfd_d10v_arch,
     &bfd_d30v_arch,
     &bfd_dlx_arch,
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index fedcb37..97296c8 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -308,7 +308,8 @@
 #define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
 #define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
 #define bfd_section_name(bfd, ptr) ((ptr)->name)
-#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
+#define bfd_section_size(bfd, ptr) ((ptr)->size)
+#define bfd_get_section_size(ptr) ((ptr)->size)
 #define bfd_section_vma(bfd, ptr) ((ptr)->vma)
 #define bfd_section_lma(bfd, ptr) ((ptr)->lma)
 #define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
@@ -320,6 +321,10 @@
 #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+/* Find the address one past the end of SEC.  */
+#define bfd_get_section_limit(bfd, sec) \
+  (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
+   / bfd_octets_per_byte (bfd))
 
 typedef struct stat stat_type;
 
@@ -433,6 +438,24 @@
    bfd_boolean (*) (struct bfd_hash_entry *, void *),
    void *info);
 
+/* Allows the default size of a hash table to be configured. New hash
+   tables allocated using bfd_hash_table_init will be created with
+   this size.  */
+extern void bfd_hash_set_default_size (bfd_size_type);
+
+/* This structure is used to keep track of stabs in sections
+   information while linking.  */
+
+struct stab_info
+{
+  /* A hash table used to hold stabs strings.  */
+  struct bfd_strtab_hash *strings;
+  /* The header file hash table.  */
+  struct bfd_hash_table includes;
+  /* The first .stabstr section.  */
+  struct bfd_section *stabstr;
+};
+
 #define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
 
 /* User program access to BFD facilities.  */
@@ -505,6 +528,8 @@
   (bfd *abfd);
 /* NB: This declaration should match the autogenerated one in libbfd.h.  */
 
+extern bfd_boolean bfd_cache_close_all (void);
+
 extern bfd_boolean bfd_record_phdr
   (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
    bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
@@ -587,8 +612,6 @@
   (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
    const struct ecoff_debug_swap *swap,
    struct bfd_link_info *info, file_ptr where);
-extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs
-  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
 
 /* Externally visible ELF routines.  */
 
@@ -611,10 +634,7 @@
   (bfd *, struct bfd_link_info *);
 extern bfd_boolean bfd_elf_get_bfd_needed_list
   (bfd *, struct bfd_link_needed_list **);
-extern bfd_boolean bfd_elf32_size_dynamic_sections
-  (bfd *, const char *, const char *, const char *, const char * const *,
-   struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *);
-extern bfd_boolean bfd_elf64_size_dynamic_sections
+extern bfd_boolean bfd_elf_size_dynamic_sections
   (bfd *, const char *, const char *, const char *, const char * const *,
    struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *);
 extern void bfd_elf_set_dt_needed_name
@@ -625,9 +645,7 @@
   (bfd *, int);
 extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
   (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf32_discard_info
-  (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf64_discard_info
+extern bfd_boolean bfd_elf_discard_info
   (bfd *, struct bfd_link_info *);
 
 /* Return an upper bound on the number of bytes required to store a
@@ -675,8 +693,6 @@
 
 extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
   (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
-extern bfd_boolean bfd_mips_elf32_create_embedded_relocs
-  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
 
 /* SunOS shared library support routines for the linker.  */
 
@@ -791,7 +807,7 @@
   (struct bfd_link_info *);
 
 extern bfd_boolean bfd_elf32_arm_process_before_allocation
-  (bfd *, struct bfd_link_info *, int);
+  (bfd *, struct bfd_link_info *, int, int);
 
 extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
   (bfd *, struct bfd_link_info *);
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 5e53956..f3b1761 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -315,7 +315,8 @@
 #define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
 #define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
 #define bfd_section_name(bfd, ptr) ((ptr)->name)
-#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
+#define bfd_section_size(bfd, ptr) ((ptr)->size)
+#define bfd_get_section_size(ptr) ((ptr)->size)
 #define bfd_section_vma(bfd, ptr) ((ptr)->vma)
 #define bfd_section_lma(bfd, ptr) ((ptr)->lma)
 #define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
@@ -327,6 +328,10 @@
 #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
 #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
 #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+/* Find the address one past the end of SEC.  */
+#define bfd_get_section_limit(bfd, sec) \
+  (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
+   / bfd_octets_per_byte (bfd))
 
 typedef struct stat stat_type;
 
@@ -440,6 +445,24 @@
    bfd_boolean (*) (struct bfd_hash_entry *, void *),
    void *info);
 
+/* Allows the default size of a hash table to be configured. New hash
+   tables allocated using bfd_hash_table_init will be created with
+   this size.  */
+extern void bfd_hash_set_default_size (bfd_size_type);
+
+/* This structure is used to keep track of stabs in sections
+   information while linking.  */
+
+struct stab_info
+{
+  /* A hash table used to hold stabs strings.  */
+  struct bfd_strtab_hash *strings;
+  /* The header file hash table.  */
+  struct bfd_hash_table includes;
+  /* The first .stabstr section.  */
+  struct bfd_section *stabstr;
+};
+
 #define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
 
 /* User program access to BFD facilities.  */
@@ -512,6 +535,8 @@
   (bfd *abfd);
 /* NB: This declaration should match the autogenerated one in libbfd.h.  */
 
+extern bfd_boolean bfd_cache_close_all (void);
+
 extern bfd_boolean bfd_record_phdr
   (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
    bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
@@ -594,8 +619,6 @@
   (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
    const struct ecoff_debug_swap *swap,
    struct bfd_link_info *info, file_ptr where);
-extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs
-  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
 
 /* Externally visible ELF routines.  */
 
@@ -618,10 +641,7 @@
   (bfd *, struct bfd_link_info *);
 extern bfd_boolean bfd_elf_get_bfd_needed_list
   (bfd *, struct bfd_link_needed_list **);
-extern bfd_boolean bfd_elf32_size_dynamic_sections
-  (bfd *, const char *, const char *, const char *, const char * const *,
-   struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *);
-extern bfd_boolean bfd_elf64_size_dynamic_sections
+extern bfd_boolean bfd_elf_size_dynamic_sections
   (bfd *, const char *, const char *, const char *, const char * const *,
    struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *);
 extern void bfd_elf_set_dt_needed_name
@@ -632,9 +652,7 @@
   (bfd *, int);
 extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
   (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf32_discard_info
-  (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf64_discard_info
+extern bfd_boolean bfd_elf_discard_info
   (bfd *, struct bfd_link_info *);
 
 /* Return an upper bound on the number of bytes required to store a
@@ -682,8 +700,6 @@
 
 extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
   (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
-extern bfd_boolean bfd_mips_elf32_create_embedded_relocs
-  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
 
 /* SunOS shared library support routines for the linker.  */
 
@@ -798,7 +814,7 @@
   (struct bfd_link_info *);
 
 extern bfd_boolean bfd_elf32_arm_process_before_allocation
-  (bfd *, struct bfd_link_info *, int);
+  (bfd *, struct bfd_link_info *, int, int);
 
 extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
   (bfd *, struct bfd_link_info *);
@@ -844,6 +860,18 @@
 
 bfd *bfd_openstreamr (const char *, const char *, void *);
 
+bfd *bfd_openr_iovec (const char *filename, const char *target,
+    void *(*open) (struct bfd *nbfd,
+    void *open_closure),
+    void *open_closure,
+    file_ptr (*pread) (struct bfd *nbfd,
+    void *stream,
+    void *buf,
+    file_ptr nbytes,
+    file_ptr offset),
+    int (*close) (struct bfd *nbfd,
+    void *stream));
+
 bfd *bfd_openw (const char *filename, const char *target);
 
 bfd_boolean bfd_close (bfd *abfd);
@@ -1202,9 +1230,6 @@
   /* See the vma field.  */
   unsigned int user_set_vma : 1;
 
-  /* Whether relocations have been processed.  */
-  unsigned int reloc_done : 1;
-
   /* A mark flag used by some of the linker backends.  */
   unsigned int linker_mark : 1;
 
@@ -1232,21 +1257,18 @@
   unsigned int use_rela_p:1;
 
   /* Bits used by various backends.  */
-  unsigned int has_tls_reloc:1;
 
-  /* Nonzero if this section needs the relax finalize pass.  */
-  unsigned int need_finalize_relax:1;
+  /* Nonzero if this section has TLS related relocations.  */
+  unsigned int has_tls_reloc:1;
 
   /* Nonzero if this section has a gp reloc.  */
   unsigned int has_gp_reloc:1;
 
-  /* Unused bits.  */
-  unsigned int flag13:1;
-  unsigned int flag14:1;
-  unsigned int flag15:1;
-  unsigned int flag16:4;
-  unsigned int flag20:4;
-  unsigned int flag24:8;
+  /* Nonzero if this section needs the relax finalize pass.  */
+  unsigned int need_finalize_relax:1;
+
+  /* Whether relocations have been processed.  */
+  unsigned int reloc_done : 1;
 
   /* End of internal packed boolean fields.  */
 
@@ -1265,13 +1287,18 @@
 
   /* The size of the section in octets, as it will be output.
      Contains a value even if the section has no contents (e.g., the
-     size of <<.bss>>).  This will be filled in after relocation.  */
-  bfd_size_type _cooked_size;
+     size of <<.bss>>).  */
+  bfd_size_type size;
 
-  /* The original size on disk of the section, in octets.  Normally this
-     value is the same as the size, but if some relaxing has
-     been done, then this value will be bigger.  */
-  bfd_size_type _raw_size;
+  /* For input sections, the original size on disk of the section, in
+     octets.  This field is used by the linker relaxation code.  It is
+     currently only set for sections where the linker relaxation scheme
+     doesn't cache altered section and reloc contents (stabs, eh_frame,
+     SEC_MERGE, some coff relaxing targets), and thus the original size
+     needs to be kept to read the section multiple times.
+     For output sections, rawsize holds the section size calculated on
+     a previous linker relaxation pass.  */
+  bfd_size_type rawsize;
 
   /* If this section is going to be output, then this value is the
      offset in *bytes* into the output section of the first byte in the
@@ -1395,11 +1422,6 @@
 extern const struct bfd_symbol * const bfd_com_symbol;
 extern const struct bfd_symbol * const bfd_und_symbol;
 extern const struct bfd_symbol * const bfd_ind_symbol;
-#define bfd_get_section_size_before_reloc(section) \
-     ((section)->_raw_size)
-#define bfd_get_section_size_after_reloc(section) \
-     ((section)->reloc_done ? (section)->_cooked_size \
-                            : (abort (), (bfd_size_type) 1))
 
 /* Macros to handle insertion and deletion of a bfd's sections.  These
    only handle the list pointers, ie. do not adjust section_count,
@@ -1430,6 +1452,12 @@
 
 asection *bfd_get_section_by_name (bfd *abfd, const char *name);
 
+asection *bfd_get_section_by_name_if
+   (bfd *abfd,
+    const char *name,
+    bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
+    void *obj);
+
 char *bfd_get_unique_section_name
    (bfd *abfd, const char *templat, int *count);
 
@@ -1447,6 +1475,11 @@
     void (*func) (bfd *abfd, asection *sect, void *obj),
     void *obj);
 
+asection *bfd_sections_find_if
+   (bfd *abfd,
+    bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
+    void *obj);
+
 bfd_boolean bfd_set_section_size
    (bfd *abfd, asection *sec, bfd_size_type val);
 
@@ -1458,6 +1491,9 @@
    (bfd *abfd, asection *section, void *location, file_ptr offset,
     bfd_size_type count);
 
+bfd_boolean bfd_malloc_and_get_section
+   (bfd *abfd, asection *section, bfd_byte **buf);
+
 bfd_boolean bfd_copy_private_section_data
    (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
 
@@ -1467,6 +1503,8 @@
 void _bfd_strip_section_from_output
    (struct bfd_link_info *info, asection *section);
 
+bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
+
 bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
 
 /* Extracted from archures.c.  */
@@ -1488,6 +1526,11 @@
 #define bfd_mach_mcf5307  11
 #define bfd_mach_mcf5407  12
 #define bfd_mach_mcf528x  13
+#define bfd_mach_mcfv4e   14
+#define bfd_mach_mcf521x   15
+#define bfd_mach_mcf5249   16
+#define bfd_mach_mcf547x   17
+#define bfd_mach_mcf548x   18
   bfd_arch_vax,       /* DEC Vax */
   bfd_arch_i960,      /* Intel 960 */
     /* The order of the following is important.
@@ -1629,6 +1672,7 @@
 #define bfd_mach_sh_dsp     0x2d
 #define bfd_mach_sh2e       0x2e
 #define bfd_mach_sh3        0x30
+#define bfd_mach_sh3_nommu  0x31
 #define bfd_mach_sh3_dsp    0x3d
 #define bfd_mach_sh3e       0x3e
 #define bfd_mach_sh4        0x40
@@ -1710,6 +1754,10 @@
 #define bfd_mach_avr3          3
 #define bfd_mach_avr4          4
 #define bfd_mach_avr5          5
+  bfd_arch_cr16c,       /* National Semiconductor CompactRISC. */
+#define bfd_mach_cr16c         1
+  bfd_arch_crx,       /*  National Semiconductor CRX. */
+#define bfd_mach_crx           1
   bfd_arch_cris,      /* Axis CRIS */
   bfd_arch_s390,      /* IBM s390 */
 #define bfd_mach_s390_31       31
@@ -2030,6 +2078,9 @@
   BFD_RELOC_12_PCREL,
   BFD_RELOC_8_PCREL,
 
+/* Section relative relocations.  Some targets need this for DWARF2.  */
+  BFD_RELOC_32_SECREL,
+
 /* For ELF.  */
   BFD_RELOC_32_GOT_PCREL,
   BFD_RELOC_16_GOT_PCREL,
@@ -2280,12 +2331,6 @@
 /* Low 16 bits.  */
   BFD_RELOC_LO16,
 
-/* Like BFD_RELOC_HI16_S, but PC relative.  */
-  BFD_RELOC_PCREL_HI16_S,
-
-/* Like BFD_RELOC_LO16, but PC relative.  */
-  BFD_RELOC_PCREL_LO16,
-
 /* Relocation against a MIPS literal section.  */
   BFD_RELOC_MIPS_LITERAL,
 
@@ -2796,6 +2841,9 @@
   BFD_RELOC_M32R_JMP_SLOT,
   BFD_RELOC_M32R_RELATIVE,
   BFD_RELOC_M32R_GOTOFF,
+  BFD_RELOC_M32R_GOTOFF_HI_ULO,
+  BFD_RELOC_M32R_GOTOFF_HI_SLO,
+  BFD_RELOC_M32R_GOTOFF_LO,
   BFD_RELOC_M32R_GOTPC24,
   BFD_RELOC_M32R_GOT16_HI_ULO,
   BFD_RELOC_M32R_GOT16_HI_SLO,
@@ -3348,6 +3396,67 @@
 This is the 5 bits of a value.  */
   BFD_RELOC_M68HC12_5B,
 
+/* NS CR16C Relocations.  */
+  BFD_RELOC_16C_NUM08,
+  BFD_RELOC_16C_NUM08_C,
+  BFD_RELOC_16C_NUM16,
+  BFD_RELOC_16C_NUM16_C,
+  BFD_RELOC_16C_NUM32,
+  BFD_RELOC_16C_NUM32_C,
+  BFD_RELOC_16C_DISP04,
+  BFD_RELOC_16C_DISP04_C,
+  BFD_RELOC_16C_DISP08,
+  BFD_RELOC_16C_DISP08_C,
+  BFD_RELOC_16C_DISP16,
+  BFD_RELOC_16C_DISP16_C,
+  BFD_RELOC_16C_DISP24,
+  BFD_RELOC_16C_DISP24_C,
+  BFD_RELOC_16C_DISP24a,
+  BFD_RELOC_16C_DISP24a_C,
+  BFD_RELOC_16C_REG04,
+  BFD_RELOC_16C_REG04_C,
+  BFD_RELOC_16C_REG04a,
+  BFD_RELOC_16C_REG04a_C,
+  BFD_RELOC_16C_REG14,
+  BFD_RELOC_16C_REG14_C,
+  BFD_RELOC_16C_REG16,
+  BFD_RELOC_16C_REG16_C,
+  BFD_RELOC_16C_REG20,
+  BFD_RELOC_16C_REG20_C,
+  BFD_RELOC_16C_ABS20,
+  BFD_RELOC_16C_ABS20_C,
+  BFD_RELOC_16C_ABS24,
+  BFD_RELOC_16C_ABS24_C,
+  BFD_RELOC_16C_IMM04,
+  BFD_RELOC_16C_IMM04_C,
+  BFD_RELOC_16C_IMM16,
+  BFD_RELOC_16C_IMM16_C,
+  BFD_RELOC_16C_IMM20,
+  BFD_RELOC_16C_IMM20_C,
+  BFD_RELOC_16C_IMM24,
+  BFD_RELOC_16C_IMM24_C,
+  BFD_RELOC_16C_IMM32,
+  BFD_RELOC_16C_IMM32_C,
+
+/* NS CRX Relocations.  */
+  BFD_RELOC_CRX_REL4,
+  BFD_RELOC_CRX_REL8,
+  BFD_RELOC_CRX_REL8_CMP,
+  BFD_RELOC_CRX_REL16,
+  BFD_RELOC_CRX_REL24,
+  BFD_RELOC_CRX_REL32,
+  BFD_RELOC_CRX_REGREL12,
+  BFD_RELOC_CRX_REGREL22,
+  BFD_RELOC_CRX_REGREL28,
+  BFD_RELOC_CRX_REGREL32,
+  BFD_RELOC_CRX_ABS16,
+  BFD_RELOC_CRX_ABS32,
+  BFD_RELOC_CRX_NUM8,
+  BFD_RELOC_CRX_NUM16,
+  BFD_RELOC_CRX_NUM32,
+  BFD_RELOC_CRX_IMM16,
+  BFD_RELOC_CRX_IMM32,
+
 /* These relocs are only used within the CRIS assembler.  They are not
 (at present) written to any object files.  */
   BFD_RELOC_CRIS_BDISP8,
@@ -3666,14 +3775,10 @@
   /* A pointer to the target jump table.  */
   const struct bfd_target *xvec;
 
-  /* To avoid dragging too many header files into every file that
-     includes `<<bfd.h>>', IOSTREAM has been declared as a "char *",
-     and MTIME as a "long".  Their correct types, to which they
-     are cast when used, are "FILE *" and "time_t".    The iostream
-     is the result of an fopen on the filename.  However, if the
-     BFD_IN_MEMORY flag is set, then iostream is actually a pointer
-     to a bfd_in_memory struct.  */
+  /* The IOSTREAM, and corresponding IO vector that provide access
+     to the file backing the BFD.  */
   void *iostream;
+  const struct bfd_iovec *iovec;
 
   /* Is the file descriptor being cached?  That is, can it be closed as
      needed, and re-opened when accessed later?  */
@@ -3887,6 +3992,11 @@
 
 bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
 
+bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
+
+#define bfd_copy_private_header_data(ibfd, obfd) \
+     BFD_SEND (obfd, _bfd_copy_private_header_data, \
+               (ibfd, obfd))
 bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
 
 #define bfd_copy_private_bfd_data(ibfd, obfd) \
@@ -3935,6 +4045,9 @@
 #define bfd_merge_sections(abfd, link_info) \
        BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
 
+#define bfd_is_group_section(abfd, sec) \
+       BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
+
 #define bfd_discard_group(abfd, sec) \
        BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
 
@@ -3965,6 +4078,9 @@
 #define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
        BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
 
+#define bfd_get_synthetic_symtab(abfd, dynsyms, ret) \
+       BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, dynsyms, ret))
+
 #define bfd_get_dynamic_reloc_upper_bound(abfd) \
        BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
 
@@ -3995,6 +4111,8 @@
 
 void bfd_preserve_finish (bfd *, struct bfd_preserve *);
 
+char *bfd_get_section_ident (asection *sec);
+
 /* Extracted from archive.c.  */
 symindex bfd_get_next_mapent
    (bfd *abfd, symindex previous, carsym **sym);
@@ -4161,6 +4279,7 @@
   NAME##_bfd_merge_private_bfd_data, \
   NAME##_bfd_copy_private_section_data, \
   NAME##_bfd_copy_private_symbol_data, \
+  NAME##_bfd_copy_private_header_data, \
   NAME##_bfd_set_private_flags, \
   NAME##_bfd_print_private_bfd_data
 
@@ -4178,6 +4297,10 @@
      to another.  */
   bfd_boolean (*_bfd_copy_private_symbol_data)
     (bfd *, asymbol *, bfd *, asymbol *);
+  /* Called to copy BFD private header data from one object file
+     to another.  */
+  bfd_boolean (*_bfd_copy_private_header_data)
+    (bfd *, bfd *);
   /* Called to set private backend flags.  */
   bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
 
@@ -4302,6 +4425,7 @@
   NAME##_bfd_link_split_section, \
   NAME##_bfd_gc_sections, \
   NAME##_bfd_merge_sections, \
+  NAME##_bfd_is_group_section, \
   NAME##_bfd_discard_group
 
   int         (*_bfd_sizeof_headers) (bfd *, bfd_boolean);
@@ -4339,6 +4463,9 @@
   /* Attempt to merge SEC_MERGE sections.  */
   bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
 
+  /* Is this section a member of a group?  */
+  bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
+
   /* Discard members of a group.  */
   bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
 
@@ -4346,6 +4473,7 @@
 #define BFD_JUMP_TABLE_DYNAMIC(NAME) \
   NAME##_get_dynamic_symtab_upper_bound, \
   NAME##_canonicalize_dynamic_symtab, \
+  NAME##_get_synthetic_symtab, \
   NAME##_get_dynamic_reloc_upper_bound, \
   NAME##_canonicalize_dynamic_reloc
 
@@ -4354,6 +4482,9 @@
   /* Read in the dynamic symbols.  */
   long        (*_bfd_canonicalize_dynamic_symtab)
     (bfd *, struct bfd_symbol **);
+  /* Create synthetized symbols.  */
+  long        (*_bfd_get_synthetic_symtab)
+    (bfd *, struct bfd_symbol **, struct bfd_symbol **);
   /* Get the amount of memory required to hold the dynamic relocs.  */
   long        (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
   /* Read in the dynamic relocs.  */
diff --git a/bfd/bfd.c b/bfd/bfd.c
index d37a48b..209b1b6 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1,6 +1,6 @@
 /* Generic BFD library interface and support routines.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -45,14 +45,10 @@
 .  {* A pointer to the target jump table.  *}
 .  const struct bfd_target *xvec;
 .
-.  {* To avoid dragging too many header files into every file that
-.     includes `<<bfd.h>>', IOSTREAM has been declared as a "char *",
-.     and MTIME as a "long".  Their correct types, to which they
-.     are cast when used, are "FILE *" and "time_t".    The iostream
-.     is the result of an fopen on the filename.  However, if the
-.     BFD_IN_MEMORY flag is set, then iostream is actually a pointer
-.     to a bfd_in_memory struct.  *}
+.  {* The IOSTREAM, and corresponding IO vector that provide access
+.     to the file backing the BFD.  *}
 .  void *iostream;
+.  const struct bfd_iovec *iovec;
 .
 .  {* Is the file descriptor being cached?  That is, can it be closed as
 .     needed, and re-opened when accessed later?  *}
@@ -512,6 +508,9 @@
 const char *
 bfd_archive_filename (bfd *abfd)
 {
+  if (abfd == NULL)
+    return NULL;
+  
   if (abfd->my_archive)
     {
       static size_t curr = 0;
@@ -766,12 +765,14 @@
 
   name = bfd_get_target (abfd);
 
-  /* Return a proper value for DJGPP COFF (an x86 COFF variant).
+  /* Return a proper value for DJGPP & PE COFF (x86 COFF variants).
      This function is required for DWARF2 support, but there is
      no place to store this information in the COFF back end.
      Should enough other COFF targets add support for DWARF2,
      a place will have to be found.  Until then, this hack will do.  */
-  if (strncmp (name, "coff-go32", sizeof ("coff-go32") - 1) == 0)
+  if (strncmp (name, "coff-go32", sizeof ("coff-go32") - 1) == 0
+      || strcmp (name, "pe-i386") == 0
+      || strcmp (name, "pei-i386") == 0)
     return 1;
 
   bfd_set_error (bfd_error_wrong_format);
@@ -981,6 +982,29 @@
 
 /*
 FUNCTION
+	bfd_copy_private_header_data
+
+SYNOPSIS
+	bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
+
+DESCRIPTION
+	Copy private BFD header information from the BFD @var{ibfd} to the
+	the BFD @var{obfd}.  This copies information that may require
+	sections to exist, but does not require symbol tables.  Return
+	<<true>> on success, <<false>> on error.
+	Possible error returns are:
+
+	o <<bfd_error_no_memory>> -
+	Not enough memory exists to create private data for @var{obfd}.
+
+.#define bfd_copy_private_header_data(ibfd, obfd) \
+.     BFD_SEND (obfd, _bfd_copy_private_header_data, \
+.		(ibfd, obfd))
+
+*/
+
+/*
+FUNCTION
 	bfd_copy_private_bfd_data
 
 SYNOPSIS
@@ -1082,6 +1106,9 @@
 .#define bfd_merge_sections(abfd, link_info) \
 .	BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
 .
+.#define bfd_is_group_section(abfd, sec) \
+.	BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
+.
 .#define bfd_discard_group(abfd, sec) \
 .	BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
 .
@@ -1112,6 +1139,9 @@
 .#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
 .	BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
 .
+.#define bfd_get_synthetic_symtab(abfd, dynsyms, ret) \
+.	BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, dynsyms, ret))
+.
 .#define bfd_get_dynamic_reloc_upper_bound(abfd) \
 .	BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
 .
@@ -1387,3 +1417,46 @@
      objalloc.  */
   bfd_hash_table_free (&preserve->section_htab);
 }
+
+/*
+FUNCTION
+	bfd_get_section_ident
+
+SYNOPSIS
+	char *bfd_get_section_ident (asection *sec);
+
+DESCRIPTION
+	This function returns "section name[group name]" in a malloced
+	buffer if @var{sec} is a member of an ELF section group and
+	returns NULL otherwise. The caller should free the non-NULL
+	return after use.
+
+*/
+
+char *
+bfd_get_section_ident (asection *sec)
+{
+  char *buf;
+  bfd_size_type nlen;
+  bfd_size_type glen;
+
+  if (sec->owner == NULL
+      || bfd_get_flavour (sec->owner) != bfd_target_elf_flavour
+      || elf_next_in_group (sec) == NULL
+      || (sec->flags & SEC_GROUP) != 0)
+    return NULL;
+
+  nlen = strlen (sec->name);
+  glen = strlen (elf_group_name (sec));
+  buf = bfd_malloc (nlen + glen + 2 + 1);
+  if (buf != NULL)
+    {
+      strcpy (buf, sec->name);
+      buf [nlen] = '[';
+      strcpy (&buf [nlen + 1], elf_group_name (sec));
+      buf [nlen + 1 + glen] = ']';
+      buf [nlen + 1 + glen + 1] = '\0';
+    }
+
+  return buf;
+}
diff --git a/bfd/bfdio.c b/bfd/bfdio.c
index a90cb33..a750527 100644
--- a/bfd/bfdio.c
+++ b/bfd/bfdio.c
@@ -62,37 +62,41 @@
 #endif
 }
 
-/* Note that archive entries don't have streams; they share their parent's.
-   This allows someone to play with the iostream behind BFD's back.
+/*
+INTERNAL_DEFINITION
+	struct bfd_iovec
 
-   Also, note that the origin pointer points to the beginning of a file's
-   contents (0 for non-archive elements).  For archive entries this is the
-   first octet in the file, NOT the beginning of the archive header.  */
+DESCRIPTION
 
-static size_t
-real_read (void *where, size_t a, size_t b, FILE *file)
-{
-  /* FIXME - this looks like an optimization, but it's really to cover
-     up for a feature of some OSs (not solaris - sigh) that
-     ld/pe-dll.c takes advantage of (apparently) when it creates BFDs
-     internally and tries to link against them.  BFD seems to be smart
-     enough to realize there are no symbol records in the "file" that
-     doesn't exist but attempts to read them anyway.  On Solaris,
-     attempting to read zero bytes from a NULL file results in a core
-     dump, but on other platforms it just returns zero bytes read.
-     This makes it to something reasonable. - DJ */
-  if (a == 0 || b == 0)
-    return 0;
+	The <<struct bfd_iovec>> contains the internal file I/O class.
+	Each <<BFD>> has an instance of this class and all file I/O is
+	routed through it (it is assumed that the instance implements
+	all methods listed below).
 
+.struct bfd_iovec
+.{
+.  {* To avoid problems with macros, a "b" rather than "f"
+.     prefix is prepended to each method name.  *}
+.  {* Attempt to read/write NBYTES on ABFD's IOSTREAM storing/fetching
+.     bytes starting at PTR.  Return the number of bytes actually
+.     transfered (a read past end-of-file returns less than NBYTES),
+.     or -1 (setting <<bfd_error>>) if an error occurs.  *}
+.  file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes);
+.  file_ptr (*bwrite) (struct bfd *abfd, const void *ptr,
+.                      file_ptr nbytes);
+.  {* Return the current IOSTREAM file offset, or -1 (setting <<bfd_error>>
+.     if an error occurs.  *}
+.  file_ptr (*btell) (struct bfd *abfd);
+.  {* For the following, on successful completion a value of 0 is returned.
+.     Otherwise, a value of -1 is returned (and  <<bfd_error>> is set).  *}
+.  int (*bseek) (struct bfd *abfd, file_ptr offset, int whence);
+.  int (*bclose) (struct bfd *abfd);
+.  int (*bflush) (struct bfd *abfd);
+.  int (*bstat) (struct bfd *abfd, struct stat *sb);
+.};
 
-#if defined (__VAX) && defined (VMS)
-  /* Apparently fread on Vax VMS does not keep the record length
-     information.  */
-  return read (fileno (file), where, a * b);
-#else
-  return fread (where, a, b, file);
-#endif
-}
+*/
+
 
 /* Return value is amount read.  */
 
@@ -121,25 +125,13 @@
       return get;
     }
 
-  nread = real_read (ptr, 1, (size_t) size, bfd_cache_lookup (abfd));
+  if (abfd->iovec)
+    nread = abfd->iovec->bread (abfd, ptr, size);
+  else
+    nread = 0;
   if (nread != (size_t) -1)
     abfd->where += nread;
 
-  /* Set bfd_error if we did not read as much data as we expected.
-
-     If the read failed due to an error set the bfd_error_system_call,
-     else set bfd_error_file_truncated.
-
-     A BFD backend may wish to override bfd_error_file_truncated to
-     provide something more useful (eg. no_symbols or wrong_format).  */
-  if (nread != size)
-    {
-      if (ferror (bfd_cache_lookup (abfd)))
-	bfd_set_error (bfd_error_system_call);
-      else
-	bfd_set_error (bfd_error_file_truncated);
-    }
-
   return nread;
 }
 
@@ -151,6 +143,7 @@
   if ((abfd->flags & BFD_IN_MEMORY) != 0)
     {
       struct bfd_in_memory *bim = abfd->iostream;
+
       size = (size_t) size;
       if (abfd->where + size > bim->size)
 	{
@@ -175,7 +168,11 @@
       return size;
     }
 
-  nwrote = fwrite (ptr, 1, (size_t) size, bfd_cache_lookup (abfd));
+  if (abfd->iovec)
+    nwrote = abfd->iovec->bwrite (abfd, ptr, size);
+  else
+    nwrote = 0;
+
   if (nwrote != (size_t) -1)
     abfd->where += nwrote;
   if (nwrote != size)
@@ -196,10 +193,16 @@
   if ((abfd->flags & BFD_IN_MEMORY) != 0)
     return abfd->where;
 
-  ptr = real_ftell (bfd_cache_lookup (abfd));
+  if (abfd->iovec)
+    {
+      ptr = abfd->iovec->btell (abfd);
 
-  if (abfd->my_archive)
-    ptr -= abfd->origin;
+      if (abfd->my_archive)
+	ptr -= abfd->origin;
+    }
+  else
+    ptr = 0;
+
   abfd->where = ptr;
   return ptr;
 }
@@ -209,7 +212,10 @@
 {
   if ((abfd->flags & BFD_IN_MEMORY) != 0)
     return 0;
-  return fflush (bfd_cache_lookup(abfd));
+
+  if (abfd->iovec)
+    return abfd->iovec->bflush (abfd);
+  return 0;
 }
 
 /* Returns 0 for success, negative value for failure (in which case
@@ -217,19 +223,16 @@
 int
 bfd_stat (bfd *abfd, struct stat *statbuf)
 {
-  FILE *f;
   int result;
 
   if ((abfd->flags & BFD_IN_MEMORY) != 0)
     abort ();
 
-  f = bfd_cache_lookup (abfd);
-  if (f == NULL)
-    {
-      bfd_set_error (bfd_error_system_call);
-      return -1;
-    }
-  result = fstat (fileno (f), statbuf);
+  if (abfd->iovec)
+    result = abfd->iovec->bstat (abfd, statbuf);
+  else
+    result = -1;
+
   if (result < 0)
     bfd_set_error (bfd_error_system_call);
   return result;
@@ -242,7 +245,6 @@
 bfd_seek (bfd *abfd, file_ptr position, int direction)
 {
   int result;
-  FILE *f;
   file_ptr file_position;
   /* For the time being, a BFD may not seek to it's end.  The problem
      is that we don't easily have a way to recognize the end of an
@@ -270,6 +272,7 @@
 	      (abfd->direction == both_direction))
 	    {
 	      bfd_size_type newsize, oldsize;
+
 	      oldsize = (bim->size + 127) & ~(bfd_size_type) 127;
 	      bim->size = abfd->where;
 	      /* Round up to cut down on memory fragmentation */
@@ -328,12 +331,15 @@
 	 In the meantime, no optimization for archives.  */
     }
 
-  f = bfd_cache_lookup (abfd);
   file_position = position;
   if (direction == SEEK_SET && abfd->my_archive != NULL)
     file_position += abfd->origin;
 
-  result = real_fseek (f, file_position, direction);
+  if (abfd->iovec)
+    result = abfd->iovec->bseek (abfd, file_position, direction);
+  else
+    result = -1;
+
   if (result != 0)
     {
       int hold_errno = errno;
@@ -378,14 +384,15 @@
 long
 bfd_get_mtime (bfd *abfd)
 {
-  FILE *fp;
   struct stat buf;
 
   if (abfd->mtime_set)
     return abfd->mtime;
 
-  fp = bfd_cache_lookup (abfd);
-  if (0 != fstat (fileno (fp), &buf))
+  if (abfd->iovec == NULL)
+    return 0;
+
+  if (abfd->iovec->bstat (abfd, &buf) != 0)
     return 0;
 
   abfd->mtime = buf.st_mtime;		/* Save value in case anyone wants it */
@@ -428,14 +435,15 @@
 long
 bfd_get_size (bfd *abfd)
 {
-  FILE *fp;
   struct stat buf;
 
   if ((abfd->flags & BFD_IN_MEMORY) != 0)
     return ((struct bfd_in_memory *) abfd->iostream)->size;
 
-  fp = bfd_cache_lookup (abfd);
-  if (0 != fstat (fileno (fp), & buf))
+  if (abfd->iovec == NULL)
+    return 0;
+
+  if (abfd->iovec->bstat (abfd, &buf) != 0)
     return 0;
 
   return buf.st_size;
diff --git a/bfd/binary.c b/bfd/binary.c
index 65f46af..2669ed3 100644
--- a/bfd/binary.c
+++ b/bfd/binary.c
@@ -1,6 +1,6 @@
 /* BFD back-end for binary objects.
-   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+   2004 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.
@@ -99,7 +99,7 @@
     return NULL;
   sec->flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS;
   sec->vma = 0;
-  sec->_raw_size = statbuf.st_size;
+  sec->size = statbuf.st_size;
   sec->filepos = 0;
 
   abfd->tdata.any = (PTR) sec;
@@ -200,7 +200,7 @@
   /* End symbol.  */
   syms[1].the_bfd = abfd;
   syms[1].name = mangle_name (abfd, "end");
-  syms[1].value = sec->_raw_size;
+  syms[1].value = sec->size;
   syms[1].flags = BSF_GLOBAL;
   syms[1].section = sec;
   syms[1].udata.p = NULL;
@@ -208,7 +208,7 @@
   /* Size symbol.  */
   syms[2].the_bfd = abfd;
   syms[2].name = mangle_name (abfd, "size");
-  syms[2].value = sec->_raw_size;
+  syms[2].value = sec->size;
   syms[2].flags = BSF_GLOBAL;
   syms[2].section = bfd_abs_section_ptr;
   syms[2].udata.p = NULL;
@@ -278,7 +278,7 @@
 	if (((s->flags
 	      & (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_NEVER_LOAD))
 	     == (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC))
-	    && (s->_raw_size > 0)
+	    && (s->size > 0)
 	    && (! found_low || s->lma < low))
 	  {
 	    low = s->lma;
@@ -294,7 +294,7 @@
 	  if ((s->flags
 	       & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_NEVER_LOAD))
 	      != (SEC_HAS_CONTENTS | SEC_ALLOC)
-	      || (s->_raw_size == 0))
+	      || (s->size == 0))
 	    continue;
 
 	  /* If attempting to generate a binary file from a bfd with
@@ -339,6 +339,7 @@
 #define binary_bfd_relax_section bfd_generic_relax_section
 #define binary_bfd_gc_sections bfd_generic_gc_sections
 #define binary_bfd_merge_sections bfd_generic_merge_sections
+#define binary_bfd_is_group_section bfd_generic_is_group_section
 #define binary_bfd_discard_group bfd_generic_discard_group
 #define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define binary_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
diff --git a/bfd/bout.c b/bfd/bout.c
index a39a9a3..63c3084 100644
--- a/bfd/bout.c
+++ b/bfd/bout.c
@@ -1,6 +1,6 @@
 /* BFD back-end for Intel 960 b.out binaries.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -200,7 +200,7 @@
   obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
 
   /* And reload the sizes, since the aout module zaps them.  */
-  obj_textsec (abfd)->_raw_size = execp->a_text;
+  obj_textsec (abfd)->size = execp->a_text;
 
   bss_start = execp->a_dload + execp->a_data; /* BSS = end of data section */
   obj_bsssec (abfd)->vma = align_power (bss_start, execp->a_balign);
@@ -294,9 +294,9 @@
 
   exec_hdr (abfd)->a_info = BMAGIC;
 
-  exec_hdr (abfd)->a_text = obj_textsec (abfd)->_raw_size;
-  exec_hdr (abfd)->a_data = obj_datasec (abfd)->_raw_size;
-  exec_hdr (abfd)->a_bss = obj_bsssec (abfd)->_raw_size;
+  exec_hdr (abfd)->a_text = obj_textsec (abfd)->size;
+  exec_hdr (abfd)->a_data = obj_datasec (abfd)->size;
+  exec_hdr (abfd)->a_bss = obj_bsssec (abfd)->size;
   exec_hdr (abfd)->a_syms = bfd_get_symcount (abfd) * sizeof (struct nlist);
   exec_hdr (abfd)->a_entry = bfd_get_start_address (abfd);
   exec_hdr (abfd)->a_trsize = ((obj_textsec (abfd)->reloc_count) *
@@ -995,7 +995,7 @@
 
       obj_textsec (abfd)->filepos = sizeof (struct internal_exec);
       obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos
-	+  obj_textsec (abfd)->_raw_size;
+	+  obj_textsec (abfd)->size;
     }
 
   /* Regardless, once we know what we're doing, we might as well get going.  */
@@ -1285,7 +1285,7 @@
 	    }
 	}
     }
-  input_section->_cooked_size = input_section->_raw_size - shrink;
+  input_section->size -= shrink;
 
   if (reloc_vector != NULL)
     free (reloc_vector);
@@ -1328,14 +1328,12 @@
   if (reloc_vector == NULL && reloc_size != 0)
     goto error_return;
 
-  input_section->reloc_done = 1;
-
   /* Read in the section.  */
   BFD_ASSERT (bfd_get_section_contents (input_bfd,
 					input_section,
 					data,
 					(bfd_vma) 0,
-					input_section->_raw_size));
+					input_section->size));
 
   reloc_count = bfd_canonicalize_reloc (input_bfd,
 					input_section,
@@ -1404,7 +1402,7 @@
 		case ALIGNDONE:
 		  BFD_ASSERT (reloc->addend >= src_address);
 		  BFD_ASSERT ((bfd_vma) reloc->addend
-			      <= input_section->_raw_size);
+			      <= input_section->size);
 		  src_address = reloc->addend;
 		  dst_address = ((dst_address + reloc->howto->size)
 				 & ~reloc->howto->size);
@@ -1487,6 +1485,7 @@
 #define b_out_bfd_link_split_section  _bfd_generic_link_split_section
 #define b_out_bfd_gc_sections  bfd_generic_gc_sections
 #define b_out_bfd_merge_sections  bfd_generic_merge_sections
+#define b_out_bfd_is_group_section bfd_generic_is_group_section
 #define b_out_bfd_discard_group bfd_generic_discard_group
 
 #define aout_32_get_section_contents_in_window \
diff --git a/bfd/cache.c b/bfd/cache.c
index 7d056ea..0d6529b 100644
--- a/bfd/cache.c
+++ b/bfd/cache.c
@@ -44,6 +44,109 @@
 
 static bfd_boolean bfd_cache_delete (bfd *);
 
+
+static file_ptr
+cache_btell (struct bfd *abfd)
+{
+  return real_ftell (bfd_cache_lookup (abfd));
+}
+
+static int
+cache_bseek (struct bfd *abfd, file_ptr offset, int whence)
+{
+  return real_fseek (bfd_cache_lookup (abfd), offset, whence);
+}
+
+/* Note that archive entries don't have streams; they share their parent's.
+   This allows someone to play with the iostream behind BFD's back.
+
+   Also, note that the origin pointer points to the beginning of a file's
+   contents (0 for non-archive elements).  For archive entries this is the
+   first octet in the file, NOT the beginning of the archive header.  */
+
+static file_ptr
+cache_bread (struct bfd *abfd, void *buf, file_ptr nbytes)
+{
+  file_ptr nread;
+  /* FIXME - this looks like an optimization, but it's really to cover
+     up for a feature of some OSs (not solaris - sigh) that
+     ld/pe-dll.c takes advantage of (apparently) when it creates BFDs
+     internally and tries to link against them.  BFD seems to be smart
+     enough to realize there are no symbol records in the "file" that
+     doesn't exist but attempts to read them anyway.  On Solaris,
+     attempting to read zero bytes from a NULL file results in a core
+     dump, but on other platforms it just returns zero bytes read.
+     This makes it to something reasonable. - DJ */
+  if (nbytes == 0)
+    return 0;
+
+#if defined (__VAX) && defined (VMS)
+  /* Apparently fread on Vax VMS does not keep the record length
+     information.  */
+  nread = read (fileno (bfd_cache_lookup (abfd)), buf, nbytes);
+  /* Set bfd_error if we did not read as much data as we expected.  If
+     the read failed due to an error set the bfd_error_system_call,
+     else set bfd_error_file_truncated.  */
+  if (nread == (file_ptr)-1)
+    {
+      bfd_set_error (bfd_error_system_call);
+      return -1;
+    }
+#else
+  nread = fread (buf, 1, nbytes, bfd_cache_lookup (abfd));
+  /* Set bfd_error if we did not read as much data as we expected.  If
+     the read failed due to an error set the bfd_error_system_call,
+     else set bfd_error_file_truncated.  */
+  if (nread < nbytes && ferror (bfd_cache_lookup (abfd)))
+    {
+      bfd_set_error (bfd_error_system_call);
+      return -1;
+    }
+#endif
+  return nread;
+}
+
+static file_ptr
+cache_bwrite (struct bfd *abfd, const void *where, file_ptr nbytes)
+{
+  file_ptr nwrite = fwrite (where, 1, nbytes, bfd_cache_lookup (abfd));
+  if (nwrite < nbytes && ferror (bfd_cache_lookup (abfd)))
+    {
+      bfd_set_error (bfd_error_system_call);
+      return -1;
+    }
+  return nwrite;
+}
+
+static int
+cache_bclose (struct bfd *abfd)
+{
+  return bfd_cache_close (abfd);
+}
+
+static int
+cache_bflush (struct bfd *abfd)
+{
+  int sts = fflush (bfd_cache_lookup (abfd));
+  if (sts < 0)
+    bfd_set_error (bfd_error_system_call);
+  return sts;
+}
+
+static int
+cache_bstat (struct bfd *abfd, struct stat *sb)
+{
+  int sts = fstat (fileno (bfd_cache_lookup (abfd)), sb);
+  if (sts < 0)
+    bfd_set_error (bfd_error_system_call);
+  return sts;
+}
+
+static const struct bfd_iovec cache_iovec = {
+  &cache_bread, &cache_bwrite, &cache_btell, &cache_bseek,
+  &cache_bclose, &cache_bflush, &cache_bstat
+};
+
 /*
 INTERNAL_FUNCTION
 	BFD_CACHE_MAX_OPEN macro
@@ -86,9 +189,9 @@
  	otherwise, it has to perform the complicated lookup function.
 
   .#define bfd_cache_lookup(x) \
-  .    ((x)==bfd_last_cache? \
-  .      (FILE*) (bfd_last_cache->iostream): \
-  .       bfd_cache_lookup_worker(x))
+  .    ((x) == bfd_last_cache ? \
+  .      (FILE *) (bfd_last_cache->iostream): \
+  .       bfd_cache_lookup_worker (x))
 
  */
 
@@ -205,6 +308,7 @@
       if (! close_one ())
 	return FALSE;
     }
+  abfd->iovec = &cache_iovec;
   insert (abfd);
   ++open_files;
   return TRUE;
@@ -229,14 +333,44 @@
 bfd_boolean
 bfd_cache_close (bfd *abfd)
 {
-  if (abfd->iostream == NULL
-      || (abfd->flags & BFD_IN_MEMORY) != 0)
+  if (abfd->iovec != &cache_iovec)
+    return TRUE;
+
+  if (abfd->iostream == NULL)
+    /* Previously closed.  */
     return TRUE;
 
   return bfd_cache_delete (abfd);
 }
 
 /*
+FUNCTION
+	bfd_cache_close_all
+
+SYNOPSIS
+	bfd_boolean bfd_cache_close_all (void);
+
+DESCRIPTION
+	Remove all BFDs from the cache. If the attached file is open,
+	then close it too.
+
+RETURNS
+	<<FALSE>> is returned if closing one of the file fails, <<TRUE>> is
+	returned if all is well.
+*/
+
+bfd_boolean
+bfd_cache_close_all ()
+{
+  bfd_boolean ret = TRUE;
+
+  while (bfd_last_cache != NULL)
+    ret &= bfd_cache_close (bfd_last_cache);
+
+  return ret;
+}
+
+/*
 INTERNAL_FUNCTION
 	bfd_open_file
 
@@ -331,7 +465,8 @@
 	quick answer.  Find a file descriptor for @var{abfd}.  If
 	necessary, it open it.  If there are already more than
 	<<BFD_CACHE_MAX_OPEN>> files open, it tries to close one first, to
-	avoid running out of file descriptors.
+	avoid running out of file descriptors.  It will abort rather than
+	returning NULL if it is unable to (re)open the @var{abfd}.
 */
 
 FILE *
@@ -354,12 +489,10 @@
     }
   else
     {
-      if (bfd_open_file (abfd) == NULL)
-	return NULL;
-      if (abfd->where != (unsigned long) abfd->where)
-	return NULL;
-      if (real_fseek ((FILE *) abfd->iostream, abfd->where, SEEK_SET) != 0)
-	return NULL;
+      if (bfd_open_file (abfd) == NULL
+	  || abfd->where != (unsigned long) abfd->where
+	  || real_fseek ((FILE *) abfd->iostream, abfd->where, SEEK_SET) != 0)
+	abort ();
     }
 
   return (FILE *) abfd->iostream;
diff --git a/bfd/cisco-core.c b/bfd/cisco-core.c
index 6b3a71b..70ea03b 100644
--- a/bfd/cisco-core.c
+++ b/bfd/cisco-core.c
@@ -1,5 +1,5 @@
 /* BFD back-end for CISCO crash dumps.
-   Copyright 1994, 1997, 1999, 2000, 2001, 2002
+   Copyright 1994, 1997, 1999, 2000, 2001, 2002, 2004
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -246,7 +246,7 @@
     goto error_return;
   asect->flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
   /* The size of memory is the size of the core file itself.  */
-  asect->_raw_size = statbuf.st_size;
+  asect->size = statbuf.st_size;
   asect->vma = rambase;
   asect->filepos = 0;
 
@@ -259,7 +259,7 @@
   asect->flags = SEC_HAS_CONTENTS;
   asect->vma = 0;
   asect->filepos = crashinfo_offset;
-  asect->_raw_size = sizeof (crashinfo);
+  asect->size = sizeof (crashinfo);
 
   /* Create a ".reg" section to allow access to the saved
      registers.  */
@@ -274,7 +274,7 @@
      choose a register section size that is either the remaining part
      of the file, or 1024, whichever is smaller.  */
   nread = statbuf.st_size - asect->filepos;
-  asect->_raw_size = (nread < 1024) ? nread : 1024;
+  asect->size = (nread < 1024) ? nread : 1024;
 
   return abfd->xvec;
 
diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c
index e9dd416..7f3f831 100644
--- a/bfd/coff-alpha.c
+++ b/bfd/coff-alpha.c
@@ -1,6 +1,6 @@
 /* BFD back-end for ALPHA Extended-Coff files.
-   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+   2003, 2004 Free Software Foundation, Inc.
    Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
    Ian Lance Taylor <ian@cygnus.com>.
 
@@ -462,8 +462,8 @@
 	  bfd_size_type size;
 
 	  size = sec->line_filepos * 8;
-	  BFD_ASSERT (size == bfd_section_size (abfd, sec)
-		      || size + 8 == bfd_section_size (abfd, sec));
+	  BFD_ASSERT (size == sec->size
+		      || size + 8 == sec->size);
 	  if (! bfd_set_section_size (abfd, sec, size))
 	    return NULL;
 	}
@@ -768,6 +768,7 @@
   long reloc_count;
   bfd *output_bfd = relocatable ? abfd : (bfd *) NULL;
   bfd_vma gp;
+  bfd_size_type sz;
   bfd_boolean gp_undefined;
   bfd_vma stack[RELOC_STACKSIZE];
   int tos = 0;
@@ -778,14 +779,10 @@
   if (reloc_vector == NULL && reloc_size != 0)
     goto error_return;
 
-  if (! bfd_get_section_contents (input_bfd, input_section, data,
-				  (file_ptr) 0, input_section->_raw_size))
+  sz = input_section->rawsize ? input_section->rawsize : input_section->size;
+  if (! bfd_get_section_contents (input_bfd, input_section, data, 0, sz))
     goto error_return;
 
-  /* The section size is not going to change.  */
-  input_section->_cooked_size = input_section->_raw_size;
-  input_section->reloc_done = TRUE;
-
   reloc_count = bfd_canonicalize_reloc (input_bfd, input_section,
 					reloc_vector, symbols);
   if (reloc_count < 0)
@@ -1455,7 +1452,7 @@
 	  amt = sizeof (struct ecoff_section_tdata);
 	  lita_sec_data = ((struct ecoff_section_tdata *)
 			   bfd_zalloc (input_bfd, amt));
-	  ecoff_section_data (input_bfd, lita_sec) = lita_sec_data;
+	  lita_sec->used_by_bfd = lita_sec_data;
 	}
 
       if (lita_sec_data->gp != 0)
@@ -1470,9 +1467,7 @@
 	  bfd_size_type lita_size;
 
 	  lita_vma = lita_sec->output_offset + lita_sec->output_section->vma;
-	  lita_size = lita_sec->_cooked_size;
-	  if (lita_size == 0)
-	    lita_size = lita_sec->_raw_size;
+	  lita_size = lita_sec->size;
 
 	  if (gp == 0
 	      || lita_vma <  gp - 0x8000
@@ -2359,6 +2354,7 @@
 #define _bfd_ecoff_bfd_relax_section bfd_generic_relax_section
 #define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections
 #define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections
+#define _bfd_ecoff_bfd_is_group_section bfd_generic_is_group_section
 #define _bfd_ecoff_bfd_discard_group bfd_generic_discard_group
 
 const bfd_target ecoffalpha_little_vec =
diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c
index e51d07d..3f3ab44 100644
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -1,6 +1,6 @@
 /* BFD back-end for ARM COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -1202,6 +1202,7 @@
 {
   struct internal_reloc * rel;
   struct internal_reloc * relend;
+  bfd_vma high_address = bfd_get_section_limit (input_bfd, input_section);
 
   rel = relocs;
   relend = rel + input_section->reloc_count;
@@ -1636,7 +1637,7 @@
 
           bfd_vma address = rel->r_vaddr - input_section->vma;
 
-          if (address > input_section->_raw_size)
+	  if (address > high_address)
 	    rstat = bfd_reloc_outofrange;
           else
             {
@@ -1858,7 +1859,7 @@
       memset (foo, test_char, (size_t) globals->arm_glue_size);
 #endif
 
-      s->_raw_size = s->_cooked_size = globals->arm_glue_size;
+      s->size = globals->arm_glue_size;
       s->contents = foo;
     }
 
@@ -1877,7 +1878,7 @@
       memset (foo, test_char, (size_t) globals->thumb_glue_size);
 #endif
 
-      s->_raw_size = s->_cooked_size = globals->thumb_glue_size;
+      s->size = globals->thumb_glue_size;
       s->contents = foo;
     }
 
diff --git a/bfd/coff-h8300.c b/bfd/coff-h8300.c
index e4d1399..4cd8829 100644
--- a/bfd/coff-h8300.c
+++ b/bfd/coff-h8300.c
@@ -1231,7 +1231,7 @@
 				  vectors_sec->output_section,
 				  vectors_sec->contents,
 				  (file_ptr) vectors_sec->output_offset,
-				  vectors_sec->_raw_size);
+				  vectors_sec->size);
 	break;
       }
 
@@ -1394,11 +1394,11 @@
 		    case bfd_mach_h8300:
 		    case bfd_mach_h8300hn:
 		    case bfd_mach_h8300sn:
-		      htab->vectors_sec->_raw_size += 2;
+		      htab->vectors_sec->size += 2;
 		      break;
 		    case bfd_mach_h8300h:
 		    case bfd_mach_h8300s:
-		      htab->vectors_sec->_raw_size += 4;
+		      htab->vectors_sec->size += 4;
 		      break;
 		    default:
 		      abort ();
@@ -1414,14 +1414,14 @@
   /* Now actually allocate some space for the function vector.  It's
      wasteful to do this more than once, but this is easier.  */
   sec = htab->vectors_sec;
-  if (sec->_raw_size != 0)
+  if (sec->size != 0)
     {
       /* Free the old contents.  */
       if (sec->contents)
 	free (sec->contents);
 
       /* Allocate new contents.  */
-      sec->contents = bfd_malloc (sec->_raw_size);
+      sec->contents = bfd_malloc (sec->size);
     }
 
   return TRUE;
diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c
index a24344a..65700b6 100644
--- a/bfd/coff-i386.c
+++ b/bfd/coff-i386.c
@@ -1,6 +1,6 @@
 /* BFD back-end for Intel 386 COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -234,7 +234,24 @@
   EMPTY_HOWTO (010),
   EMPTY_HOWTO (011),
   EMPTY_HOWTO (012),
+#ifdef COFF_WITH_PE
+  /* 32-bit longword section relative relocation (013).  */
+  HOWTO (R_SECREL32,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield, /* complain_on_overflow */
+	 coff_i386_reloc,	/* special_function */
+	 "secrel32",		/* name */
+	 TRUE,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 TRUE),			/* pcrel_offset */
+#else
   EMPTY_HOWTO (013),
+#endif
   EMPTY_HOWTO (014),
   EMPTY_HOWTO (015),
   EMPTY_HOWTO (016),
@@ -497,6 +514,30 @@
     {
       *addendp -= pe_data(sec->output_section->owner)->pe_opthdr.ImageBase;
     }
+
+  if (rel->r_type == R_SECREL32)
+    {
+      bfd_vma osect_vma;
+
+      if (h && (h->type == bfd_link_hash_defined
+		|| h->type == bfd_link_hash_defweak))
+	osect_vma = h->root.u.def.section->output_section->vma;
+      else
+	{
+	  asection *sec;
+	  int i;
+
+	  /* Sigh, the only way to get the section to offset against
+	     is to find it the hard way.  */
+
+	  for (sec = abfd->sections, i = 1; i < sym->n_scnum; i++)
+	    sec = sec->next;
+
+	  osect_vma = sec->output_section->vma;
+	}
+
+      *addendp -= osect_vma;
+    }
 #endif
 
   return howto;
@@ -525,6 +566,10 @@
       return howto_table + R_RELBYTE;
     case BFD_RELOC_8_PCREL:
       return howto_table + R_PCRBYTE;
+#ifdef COFF_WITH_PE
+    case BFD_RELOC_32_SECREL:
+      return howto_table + R_SECREL32;
+#endif
     default:
       BFD_FAIL ();
       return 0;
diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c
index d6d8218..f351eb1 100644
--- a/bfd/coff-mips.c
+++ b/bfd/coff-mips.c
@@ -1,6 +1,6 @@
 /* BFD back-end for MIPS Extended-Coff files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Original version by Per Bothner.
    Full support added by Ian Lance Taylor, ian@cygnus.com.
@@ -57,28 +57,12 @@
 static bfd_reloc_status_type mips_gprel_reloc
   PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
 	   asection *section, bfd *output_bfd, char **error));
-static bfd_reloc_status_type mips_relhi_reloc
-  PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
-	   asection *section, bfd *output_bfd, char **error));
-static bfd_reloc_status_type mips_rello_reloc
-  PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
-	   asection *section, bfd *output_bfd, char **error));
-static bfd_reloc_status_type mips_switch_reloc
-  PARAMS ((bfd *abfd, arelent *reloc, asymbol *symbol, PTR data,
-	   asection *section, bfd *output_bfd, char **error));
 static void mips_relocate_hi
   PARAMS ((struct internal_reloc *refhi, struct internal_reloc *reflo,
 	   bfd *input_bfd, asection *input_section, bfd_byte *contents,
-	   size_t adjust, bfd_vma relocation, bfd_boolean pcrel));
+	   bfd_vma relocation));
 static bfd_boolean mips_relocate_section
   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PTR));
-static bfd_boolean mips_read_relocs
-  PARAMS ((bfd *, asection *));
-static bfd_boolean mips_relax_section
-  PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *));
-static bfd_boolean mips_relax_pcrel16
-  PARAMS ((struct bfd_link_info *, bfd *, asection *,
-	   struct ecoff_link_hash_entry *, bfd_byte *, bfd_vma));
 static reloc_howto_type *mips_bfd_reloc_type_lookup
   PARAMS ((bfd *, bfd_reloc_code_real_type));
 
@@ -243,10 +227,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
-     relative reloc rightshifted twice as used in the MIPS branch
-     instructions.  */
+  /* FIXME: This relocation is used (internally only) to represent branches
+     when assembling.  It should never appear in output files, and
+     be removed.  (It used to be used for embedded-PIC support.)  */
   HOWTO (MIPS_R_PCREL16,	/* type */
 	 2,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -260,92 +243,10 @@
 	 0xffff,		/* src_mask */
 	 0xffff,		/* dst_mask */
 	 TRUE),			/* pcrel_offset */
-
-  /* This reloc is a Cygnus extension used when generating position
-     independent code for embedded systems.  It represents the high 16
-     bits of a PC relative reloc.  The next reloc must be
-     MIPS_R_RELLO, and the addend is formed from the addends of the
-     two instructions, just as in MIPS_R_REFHI and MIPS_R_REFLO.  The
-     final value is actually PC relative to the location of the
-     MIPS_R_RELLO reloc, not the MIPS_R_RELHI reloc.  */
-  HOWTO (MIPS_R_RELHI,		/* type */
-	 16,			/* rightshift */
-	 2,			/* size (0 = byte, 1 = short, 2 = long) */
-	 16,			/* bitsize */
-	 TRUE,			/* pc_relative */
-	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
-	 mips_relhi_reloc,	/* special_function */
-	 "RELHI",		/* name */
-	 TRUE,			/* partial_inplace */
-	 0xffff,		/* src_mask */
-	 0xffff,		/* dst_mask */
-	 TRUE),			/* pcrel_offset */
-
-  /* This reloc is a Cygnus extension used when generating position
-     independent code for embedded systems.  It represents the low 16
-     bits of a PC relative reloc.  */
-  HOWTO (MIPS_R_RELLO,		/* type */
-	 0,			/* rightshift */
-	 2,			/* size (0 = byte, 1 = short, 2 = long) */
-	 16,			/* bitsize */
-	 TRUE,			/* pc_relative */
-	 0,			/* bitpos */
-	 complain_overflow_dont, /* complain_on_overflow */
-	 mips_rello_reloc,	/* special_function */
-	 "RELLO",		/* name */
-	 TRUE,			/* partial_inplace */
-	 0xffff,		/* src_mask */
-	 0xffff,		/* dst_mask */
-	 TRUE),			/* pcrel_offset */
-
-  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
-     a switch table, which is the difference between two symbols in
-     the .text section.  The symndx is actually the offset from the
-     reloc address to the subtrahend.  See include/coff/mips.h for
-     more details.  */
-  HOWTO (MIPS_R_SWITCH,		/* type */
-	 0,			/* rightshift */
-	 2,			/* size (0 = byte, 1 = short, 2 = long) */
-	 32,			/* bitsize */
-	 TRUE,			/* pc_relative */
-	 0,			/* bitpos */
-	 complain_overflow_dont, /* complain_on_overflow */
-	 mips_switch_reloc,	/* special_function */
-	 "SWITCH",		/* name */
-	 TRUE,			/* partial_inplace */
-	 0xffffffff,		/* src_mask */
-	 0xffffffff,		/* dst_mask */
-	 TRUE)			/* pcrel_offset */
 };
 
 #define MIPS_HOWTO_COUNT \
   (sizeof mips_howto_table / sizeof mips_howto_table[0])
-
-/* When the linker is doing relaxing, it may change an external PCREL16
-   reloc.  This typically represents an instruction like
-       bal foo
-   We change it to
-       .set  noreorder
-       bal   $L1
-       lui   $at,%hi(foo - $L1)
-     $L1:
-       addiu $at,%lo(foo - $L1)
-       addu  $at,$at,$31
-       jalr  $at
-   PCREL16_EXPANSION_ADJUSTMENT is the number of bytes this changes the
-   instruction by.  */
-
-#define PCREL16_EXPANSION_ADJUSTMENT (4 * 4)
 
 /* See whether the magic number matches.  */
 
@@ -418,25 +319,6 @@
 			   << RELOC_BITS3_TYPEHI_SH_LITTLE));
       intern->r_extern = (ext->r_bits[3] & RELOC_BITS3_EXTERN_LITTLE) != 0;
     }
-
-  /* If this is a MIPS_R_SWITCH reloc, or an internal MIPS_R_RELHI or
-     MIPS_R_RELLO reloc, r_symndx is actually the offset from the
-     reloc address to the base of the difference (see
-     include/coff/mips.h for more details).  We copy symndx into the
-     r_offset field so as not to confuse ecoff_slurp_reloc_table in
-     ecoff.c.  In adjust_reloc_in we then copy r_offset into the reloc
-     addend.  */
-  if (intern->r_type == MIPS_R_SWITCH
-      || (! intern->r_extern
-	  && (intern->r_type == MIPS_R_RELLO
-	      || intern->r_type == MIPS_R_RELHI)))
-    {
-      BFD_ASSERT (! intern->r_extern);
-      intern->r_offset = intern->r_symndx;
-      if (intern->r_offset & 0x800000)
-	intern->r_offset -= 0x1000000;
-      intern->r_symndx = RELOC_SECTION_TEXT;
-    }
 }
 
 /* Swap a reloc out.  */
@@ -453,20 +335,7 @@
   BFD_ASSERT (intern->r_extern
 	      || (intern->r_symndx >= 0 && intern->r_symndx <= 12));
 
-  /* If this is a MIPS_R_SWITCH reloc, or an internal MIPS_R_RELLO or
-     MIPS_R_RELHI reloc, we actually want to write the contents of
-     r_offset out as the symbol index.  This undoes the change made by
-     mips_ecoff_swap_reloc_in.  */
-  if (intern->r_type != MIPS_R_SWITCH
-      && (intern->r_extern
-	  || (intern->r_type != MIPS_R_RELHI
-	      && intern->r_type != MIPS_R_RELLO)))
-    r_symndx = intern->r_symndx;
-  else
-    {
-      BFD_ASSERT (intern->r_symndx == RELOC_SECTION_TEXT);
-      r_symndx = intern->r_offset & 0xffffff;
-    }
+  r_symndx = intern->r_symndx;
 
   H_PUT_32 (abfd, intern->r_vaddr, ext->r_vaddr);
   if (bfd_header_big_endian (abfd))
@@ -501,7 +370,7 @@
      const struct internal_reloc *intern;
      arelent *rptr;
 {
-  if (intern->r_type > MIPS_R_SWITCH)
+  if (intern->r_type > MIPS_R_PCREL16)
     abort ();
 
   if (! intern->r_extern
@@ -514,18 +383,6 @@
   if (intern->r_type == MIPS_R_IGNORE)
     rptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
 
-  /* If this is a MIPS_R_SWITCH reloc, or an internal MIPS_R_RELHI or
-     MIPS_R_RELLO reloc, we want the addend field of the BFD relocto
-     hold the value which was originally in the symndx field of the
-     internal MIPS ECOFF reloc.  This value was copied into
-     intern->r_offset by mips_swap_reloc_in, and here we copy it into
-     the addend field.  */
-  if (intern->r_type == MIPS_R_SWITCH
-      || (! intern->r_extern
-	  && (intern->r_type == MIPS_R_RELHI
-	      || intern->r_type == MIPS_R_RELLO)))
-    rptr->addend = intern->r_offset;
-
   rptr->howto = &mips_howto_table[intern->r_type];
 }
 
@@ -535,19 +392,9 @@
 static void
 mips_adjust_reloc_out (abfd, rel, intern)
      bfd *abfd ATTRIBUTE_UNUSED;
-     const arelent *rel;
-     struct internal_reloc *intern;
+     const arelent *rel ATTRIBUTE_UNUSED;
+     struct internal_reloc *intern ATTRIBUTE_UNUSED;
 {
-  /* For a MIPS_R_SWITCH reloc, or an internal MIPS_R_RELHI or
-     MIPS_R_RELLO reloc, we must copy rel->addend into
-     intern->r_offset.  This will then be written out as the symbol
-     index by mips_ecoff_swap_reloc_out.  This operation parallels the
-     action of mips_adjust_reloc_in.  */
-  if (intern->r_type == MIPS_R_SWITCH
-      || (! intern->r_extern
-	  && (intern->r_type == MIPS_R_RELHI
-	      || intern->r_type == MIPS_R_RELLO)))
-    intern->r_offset = rel->addend;
 }
 
 /* ECOFF relocs are either against external symbols, or against
@@ -652,7 +499,7 @@
   relocation += symbol->section->output_offset;
   relocation += reloc_entry->addend;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Save the information, and let REFLO do the actual relocation.  */
@@ -850,7 +697,7 @@
   relocation += symbol->section->output_section->vma;
   relocation += symbol->section->output_offset;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);
@@ -880,209 +727,6 @@
   return bfd_reloc_ok;
 }
 
-/* Do a RELHI relocation.  We do this in conjunction with a RELLO
-   reloc, just as REFHI and REFLO are done together.  RELHI and RELLO
-   are Cygnus extensions used when generating position independent
-   code for embedded systems.  */
-
-/* FIXME: This should not be a static variable.  */
-
-static struct mips_hi *mips_relhi_list;
-
-static bfd_reloc_status_type
-mips_relhi_reloc (abfd,
-		  reloc_entry,
-		  symbol,
-		  data,
-		  input_section,
-		  output_bfd,
-		  error_message)
-     bfd *abfd ATTRIBUTE_UNUSED;
-     arelent *reloc_entry;
-     asymbol *symbol;
-     PTR data;
-     asection *input_section;
-     bfd *output_bfd;
-     char **error_message ATTRIBUTE_UNUSED;
-{
-  bfd_reloc_status_type ret;
-  bfd_vma relocation;
-  struct mips_hi *n;
-
-  /* If this is a reloc against a section symbol, then it is correct
-     in the object file.  The only time we want to change this case is
-     when we are relaxing, and that is handled entirely by
-     mips_relocate_section and never calls this function.  */
-  if ((symbol->flags & BSF_SECTION_SYM) != 0)
-    {
-      if (output_bfd != (bfd *) NULL)
-	reloc_entry->address += input_section->output_offset;
-      return bfd_reloc_ok;
-    }
-
-  /* This is an external symbol.  If we're relocating, we don't want
-     to change anything.  */
-  if (output_bfd != (bfd *) NULL)
-    {
-      reloc_entry->address += input_section->output_offset;
-      return bfd_reloc_ok;
-    }
-
-  ret = bfd_reloc_ok;
-  if (bfd_is_und_section (symbol->section)
-      && output_bfd == (bfd *) NULL)
-    ret = bfd_reloc_undefined;
-
-  if (bfd_is_com_section (symbol->section))
-    relocation = 0;
-  else
-    relocation = symbol->value;
-
-  relocation += symbol->section->output_section->vma;
-  relocation += symbol->section->output_offset;
-  relocation += reloc_entry->addend;
-
-  if (reloc_entry->address > input_section->_cooked_size)
-    return bfd_reloc_outofrange;
-
-  /* Save the information, and let RELLO do the actual relocation.  */
-  n = (struct mips_hi *) bfd_malloc ((bfd_size_type) sizeof *n);
-  if (n == NULL)
-    return bfd_reloc_outofrange;
-  n->addr = (bfd_byte *) data + reloc_entry->address;
-  n->addend = relocation;
-  n->next = mips_relhi_list;
-  mips_relhi_list = n;
-
-  if (output_bfd != (bfd *) NULL)
-    reloc_entry->address += input_section->output_offset;
-
-  return ret;
-}
-
-/* Do a RELLO relocation.  This is a straightforward 16 bit PC
-   relative relocation; this function exists in order to do the RELHI
-   relocation described above.  */
-
-static bfd_reloc_status_type
-mips_rello_reloc (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;
-{
-  if (mips_relhi_list != NULL)
-    {
-      struct mips_hi *l;
-
-      l = mips_relhi_list;
-      while (l != NULL)
-	{
-	  unsigned long insn;
-	  unsigned long val;
-	  unsigned long vallo;
-	  struct mips_hi *next;
-
-	  /* Do the RELHI relocation.  Note that we actually don't
-	     need to know anything about the RELLO itself, except
-	     where to find the low 16 bits of the addend needed by the
-	     RELHI.  */
-	  insn = bfd_get_32 (abfd, l->addr);
-	  vallo = (bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address)
-		   & 0xffff);
-	  val = ((insn & 0xffff) << 16) + vallo;
-	  val += l->addend;
-
-	  /* If the symbol is defined, make val PC relative.  If the
-	     symbol is not defined we don't want to do this, because
-	     we don't want the value in the object file to incorporate
-	     the address of the reloc.  */
-	  if (! bfd_is_und_section (bfd_get_section (symbol))
-	      && ! bfd_is_com_section (bfd_get_section (symbol)))
-	    val -= (input_section->output_section->vma
-		    + input_section->output_offset
-		    + reloc_entry->address);
-
-	  /* The low order 16 bits are always treated as a signed
-	     value.  Therefore, a negative value in the low order bits
-	     requires an adjustment in the high order bits.  We need
-	     to make this adjustment in two ways: once for the bits we
-	     took from the data, and once for the bits we are putting
-	     back in to the data.  */
-	  if ((vallo & 0x8000) != 0)
-	    val -= 0x10000;
-	  if ((val & 0x8000) != 0)
-	    val += 0x10000;
-
-	  insn = (insn &~ (unsigned) 0xffff) | ((val >> 16) & 0xffff);
-	  bfd_put_32 (abfd, (bfd_vma) insn, l->addr);
-
-	  next = l->next;
-	  free (l);
-	  l = next;
-	}
-
-      mips_relhi_list = NULL;
-    }
-
-  /* If this is a reloc against a section symbol, then it is correct
-     in the object file.  The only time we want to change this case is
-     when we are relaxing, and that is handled entirely by
-     mips_relocate_section and never calls this function.  */
-  if ((symbol->flags & BSF_SECTION_SYM) != 0)
-    {
-      if (output_bfd != (bfd *) NULL)
-	reloc_entry->address += input_section->output_offset;
-      return bfd_reloc_ok;
-    }
-
-  /* bfd_perform_relocation does not handle pcrel_offset relocations
-     correctly when generating a relocatable file, so handle them
-     directly here.  */
-  if (output_bfd != (bfd *) NULL)
-    {
-      reloc_entry->address += input_section->output_offset;
-      return bfd_reloc_ok;
-    }
-
-  /* Now do the RELLO reloc in the usual way.  */
-  return mips_generic_reloc (abfd, reloc_entry, symbol, data,
-			      input_section, output_bfd, error_message);
-}
-
-/* This is the special function for the MIPS_R_SWITCH reloc.  This
-   special reloc is normally correct in the object file, and only
-   requires special handling when relaxing.  We don't want
-   bfd_perform_relocation to tamper with it at all.  */
-
-static bfd_reloc_status_type
-mips_switch_reloc (abfd,
-		   reloc_entry,
-		   symbol,
-		   data,
-		   input_section,
-		   output_bfd,
-		   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;
-}
-
 /* Get the howto structure for a generic reloc type.  */
 
 static reloc_howto_type *
@@ -1119,15 +763,6 @@
     case BFD_RELOC_16_PCREL_S2:
       mips_type = MIPS_R_PCREL16;
       break;
-    case BFD_RELOC_PCREL_HI16_S:
-      mips_type = MIPS_R_RELHI;
-      break;
-    case BFD_RELOC_PCREL_LO16:
-      mips_type = MIPS_R_RELLO;
-      break;
-    case BFD_RELOC_GPREL32:
-      mips_type = MIPS_R_SWITCH;
-      break;
     default:
       return (reloc_howto_type *) NULL;
     }
@@ -1136,21 +771,19 @@
 }
 
 /* A helper routine for mips_relocate_section which handles the REFHI
-   and RELHI relocations.  The REFHI relocation must be followed by a
-   REFLO relocation (and RELHI by a RELLO), and the addend used is
-   formed from the addends of both instructions.  */
+   relocations.  The REFHI relocation must be followed by a REFLO
+   relocation, and the addend used is formed from the addends of both
+   instructions.  */
 
 static void
-mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents, adjust,
-		  relocation, pcrel)
+mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents,
+		  relocation)
      struct internal_reloc *refhi;
      struct internal_reloc *reflo;
      bfd *input_bfd;
      asection *input_section;
      bfd_byte *contents;
-     size_t adjust;
      bfd_vma relocation;
-     bfd_boolean pcrel;
 {
   unsigned long insn;
   unsigned long val;
@@ -1160,12 +793,12 @@
     return;
 
   insn = bfd_get_32 (input_bfd,
-		     contents + adjust + refhi->r_vaddr - input_section->vma);
+		     contents + refhi->r_vaddr - input_section->vma);
   if (reflo == NULL)
     vallo = 0;
   else
     vallo = (bfd_get_32 (input_bfd,
-			 contents + adjust + reflo->r_vaddr - input_section->vma)
+			 contents + reflo->r_vaddr - input_section->vma)
 	     & 0xffff);
 
   val = ((insn & 0xffff) << 16) + vallo;
@@ -1179,17 +812,12 @@
   if ((vallo & 0x8000) != 0)
     val -= 0x10000;
 
-  if (pcrel)
-    val -= (input_section->output_section->vma
-	    + input_section->output_offset
-	    + (reflo->r_vaddr - input_section->vma + adjust));
-
   if ((val & 0x8000) != 0)
     val += 0x10000;
 
   insn = (insn &~ (unsigned) 0xffff) | ((val >> 16) & 0xffff);
   bfd_put_32 (input_bfd, (bfd_vma) insn,
-	      contents + adjust + refhi->r_vaddr - input_section->vma);
+	      contents + refhi->r_vaddr - input_section->vma);
 }
 
 /* Relocate a section while linking a MIPS ECOFF file.  */
@@ -1208,8 +836,6 @@
   struct ecoff_link_hash_entry **sym_hashes;
   bfd_vma gp;
   bfd_boolean gp_undefined;
-  size_t adjust;
-  long *offsets;
   struct external_reloc *ext_rel;
   struct external_reloc *ext_rel_end;
   unsigned int i;
@@ -1270,13 +896,6 @@
 
   got_lo = FALSE;
 
-  adjust = 0;
-
-  if (ecoff_section_data (input_bfd, input_section) == NULL)
-    offsets = NULL;
-  else
-    offsets = ecoff_section_data (input_bfd, input_section)->offsets;
-
   ext_rel = (struct external_reloc *) external_relocs;
   ext_rel_end = ext_rel + input_section->reloc_count;
   for (i = 0; ext_rel < ext_rel_end; ext_rel++, i++)
@@ -1301,17 +920,15 @@
       BFD_ASSERT (int_rel.r_type
 		  < sizeof mips_howto_table / sizeof mips_howto_table[0]);
 
-      /* The REFHI and RELHI relocs requires special handling.  they
-	 must be followed by a REFLO or RELLO reloc, respectively, and
-	 the addend is formed from both relocs.  */
-      if (int_rel.r_type == MIPS_R_REFHI
-	  || int_rel.r_type == MIPS_R_RELHI)
+      /* The REFHI reloc requires special handling.  It must be followed
+	 by a REFLO reloc, and the addend is formed from both relocs.  */
+      if (int_rel.r_type == MIPS_R_REFHI)
 	{
 	  struct external_reloc *lo_ext_rel;
 
 	  /* As a GNU extension, permit an arbitrary number of REFHI
-             or RELHI relocs before the REFLO or RELLO reloc.  This
-             permits gcc to emit the HI and LO relocs itself.  */
+             relocs before the REFLO reloc.  This permits gcc to emit
+	     the HI and LO relocs itself.  */
 	  for (lo_ext_rel = ext_rel + 1;
 	       lo_ext_rel < ext_rel_end;
 	       lo_ext_rel++)
@@ -1323,10 +940,7 @@
 	    }
 
 	  if (lo_ext_rel < ext_rel_end
-	      && (lo_int_rel.r_type
-		  == (int_rel.r_type == MIPS_R_REFHI
-		      ? MIPS_R_REFLO
-		      : MIPS_R_RELLO))
+	      && lo_int_rel.r_type == MIPS_R_REFLO
 	      && int_rel.r_extern == lo_int_rel.r_extern
 	      && int_rel.r_symndx == lo_int_rel.r_symndx)
 	    {
@@ -1338,32 +952,6 @@
 
       howto = &mips_howto_table[int_rel.r_type];
 
-      /* The SWITCH reloc must be handled specially.  This reloc is
-	 marks the location of a difference between two portions of an
-	 object file.  The symbol index does not reference a symbol,
-	 but is actually the offset from the reloc to the subtrahend
-	 of the difference.  This reloc is correct in the object file,
-	 and needs no further adjustment, unless we are relaxing.  If
-	 we are relaxing, we may have to add in an offset.  Since no
-	 symbols are involved in this reloc, we handle it completely
-	 here.  */
-      if (int_rel.r_type == MIPS_R_SWITCH)
-	{
-	  if (offsets != NULL
-	      && offsets[i] != 0)
-	    {
-	      r = _bfd_relocate_contents (howto, input_bfd,
-					  (bfd_vma) offsets[i],
-					  (contents
-					   + adjust
-					   + int_rel.r_vaddr
-					   - input_section->vma));
-	      BFD_ASSERT (r == bfd_reloc_ok);
-	    }
-
-	  continue;
-	}
-
       if (int_rel.r_extern)
 	{
 	  h = sym_hashes[int_rel.r_symndx];
@@ -1439,91 +1027,6 @@
 	    }
 	}
 
-      /* If we are relaxing, mips_relax_section may have set
-	 offsets[i] to some value.  A value of 1 means we must expand
-	 a PC relative branch into a multi-instruction of sequence,
-	 and any other value is an addend.  */
-      if (offsets != NULL
-	  && offsets[i] != 0)
-	{
-	  BFD_ASSERT (! info->relocatable);
-	  BFD_ASSERT (int_rel.r_type == MIPS_R_PCREL16
-		      || int_rel.r_type == MIPS_R_RELHI
-		      || int_rel.r_type == MIPS_R_RELLO);
-	  if (offsets[i] != 1)
-	    addend += offsets[i];
-	  else
-	    {
-	      bfd_byte *here;
-
-	      BFD_ASSERT (int_rel.r_extern
-			  && int_rel.r_type == MIPS_R_PCREL16);
-
-	      /* Move the rest of the instructions up.  */
-	      here = (contents
-		      + adjust
-		      + int_rel.r_vaddr
-		      - input_section->vma);
-	      memmove (here + PCREL16_EXPANSION_ADJUSTMENT, here,
-		       (size_t) (input_section->_raw_size
-				 - (int_rel.r_vaddr - input_section->vma)));
-
-	      /* Generate the new instructions.  */
-	      if (! mips_relax_pcrel16 (info, input_bfd, input_section,
-					h, here,
-					(input_section->output_section->vma
-					 + input_section->output_offset
-					 + (int_rel.r_vaddr
-					    - input_section->vma)
-					 + adjust)))
-		return FALSE;
-
-	      /* We must adjust everything else up a notch.  */
-	      adjust += PCREL16_EXPANSION_ADJUSTMENT;
-
-	      /* mips_relax_pcrel16 handles all the details of this
-		 relocation.  */
-	      continue;
-	    }
-	}
-
-      /* If we are relaxing, and this is a reloc against the .text
-	 segment, we may need to adjust it if some branches have been
-	 expanded.  The reloc types which are likely to occur in the
-	 .text section are handled efficiently by mips_relax_section,
-	 and thus do not need to be handled here.  */
-      if (ecoff_data (input_bfd)->debug_info.adjust != NULL
-	  && ! int_rel.r_extern
-	  && int_rel.r_symndx == RELOC_SECTION_TEXT
-	  && (strcmp (bfd_get_section_name (input_bfd, input_section),
-		      ".text") != 0
-	      || (int_rel.r_type != MIPS_R_PCREL16
-		  && int_rel.r_type != MIPS_R_SWITCH
-		  && int_rel.r_type != MIPS_R_RELHI
-		  && int_rel.r_type != MIPS_R_RELLO)))
-	{
-	  bfd_vma adr;
-	  struct ecoff_value_adjust *a;
-
-	  /* We need to get the addend so that we know whether we need
-	     to adjust the address.  */
-	  BFD_ASSERT (int_rel.r_type == MIPS_R_REFWORD);
-
-	  adr = bfd_get_32 (input_bfd,
-			    (contents
-			     + adjust
-			     + int_rel.r_vaddr
-			     - input_section->vma));
-
-	  for (a = ecoff_data (input_bfd)->debug_info.adjust;
-	       a != (struct ecoff_value_adjust *) NULL;
-	       a = a->next)
-	    {
-	      if (adr >= a->start && adr < a->end)
-		addend += a->adjust;
-	    }
-	}
-
       if (info->relocatable)
 	{
 	  /* We are generating relocatable output, and must convert
@@ -1601,49 +1104,7 @@
 		     currently holds just the addend.  We must adjust
 		     by the address to get the right value.  */
 		  if (howto->pc_relative)
-		    {
-		      relocation -= int_rel.r_vaddr - input_section->vma;
-
-		      /* If we are converting a RELHI or RELLO reloc
-			 from being against an external symbol to
-			 being against a section, we must put a
-			 special value into the r_offset field.  This
-			 value is the old addend.  The r_offset for
-			 both the RELHI and RELLO relocs are the same,
-			 and we set both when we see RELHI.  */
-		      if (int_rel.r_type == MIPS_R_RELHI)
-			{
-			  long addhi, addlo;
-
-			  addhi = bfd_get_32 (input_bfd,
-					      (contents
-					       + adjust
-					       + int_rel.r_vaddr
-					       - input_section->vma));
-			  addhi &= 0xffff;
-			  if (addhi & 0x8000)
-			    addhi -= 0x10000;
-			  addhi <<= 16;
-
-			  if (! use_lo)
-			    addlo = 0;
-			  else
-			    {
-			      addlo = bfd_get_32 (input_bfd,
-						  (contents
-						   + adjust
-						   + lo_int_rel.r_vaddr
-						   - input_section->vma));
-			      addlo &= 0xffff;
-			      if (addlo & 0x8000)
-				addlo -= 0x10000;
-
-			      lo_int_rel.r_offset = addhi + addlo;
-			    }
-
-			  int_rel.r_offset = addhi + addlo;
-			}
-		    }
+		    relocation -= int_rel.r_vaddr - input_section->vma;
 
 		  h = NULL;
 		}
@@ -1679,14 +1140,8 @@
 
 	  /* Adjust a PC relative relocation by removing the reference
 	     to the original address in the section and including the
-	     reference to the new address.  However, external RELHI
-	     and RELLO relocs are PC relative, but don't include any
-	     reference to the address.  The addend is merely an
-	     addend.  */
-	  if (howto->pc_relative
-	      && (! int_rel.r_extern
-		  || (int_rel.r_type != MIPS_R_RELHI
-		      && int_rel.r_type != MIPS_R_RELLO)))
+	     reference to the new address.  */
+	  if (howto->pc_relative)
 	    relocation -= (input_section->output_section->vma
 			   + input_section->output_offset
 			   - input_section->vma);
@@ -1696,11 +1151,9 @@
 	    r = bfd_reloc_ok;
 	  else
 	    {
-	      if (int_rel.r_type != MIPS_R_REFHI
-		  && int_rel.r_type != MIPS_R_RELHI)
+	      if (int_rel.r_type != MIPS_R_REFHI)
 		r = _bfd_relocate_contents (howto, input_bfd, relocation,
 					    (contents
-					     + adjust
 					     + int_rel.r_vaddr
 					     - input_section->vma));
 	      else
@@ -1708,8 +1161,7 @@
 		  mips_relocate_hi (&int_rel,
 				    use_lo ? &lo_int_rel : NULL,
 				    input_bfd, input_section, contents,
-				    adjust, relocation,
-				    int_rel.r_type == MIPS_R_RELHI);
+				    relocation);
 		  r = bfd_reloc_ok;
 		}
 	    }
@@ -1759,32 +1211,24 @@
 		 file.  Make it look like a pcrel_offset relocation by
 		 adding in the start address.  */
 	      if (howto->pc_relative)
-		{
-		  if (int_rel.r_type != MIPS_R_RELHI || ! use_lo)
-		    relocation += int_rel.r_vaddr + adjust;
-		  else
-		    relocation += lo_int_rel.r_vaddr + adjust;
-		}
+		relocation += int_rel.r_vaddr;
 	    }
 
-	  if (int_rel.r_type != MIPS_R_REFHI
-	      && int_rel.r_type != MIPS_R_RELHI)
+	  if (int_rel.r_type != MIPS_R_REFHI)
 	    r = _bfd_final_link_relocate (howto,
 					  input_bfd,
 					  input_section,
 					  contents,
 					  (int_rel.r_vaddr
-					   - input_section->vma
-					   + adjust),
+					   - input_section->vma),
 					  relocation,
 					  addend);
 	  else
 	    {
 	      mips_relocate_hi (&int_rel,
 				use_lo ? &lo_int_rel : NULL,
-				input_bfd, input_section, contents, adjust,
-				relocation,
-				int_rel.r_type == MIPS_R_RELHI);
+				input_bfd, input_section, contents,
+				relocation);
 	      r = bfd_reloc_ok;
 	    }
 	}
@@ -1801,8 +1245,7 @@
 	       & 0xf0000000)
 	      != ((input_section->output_section->vma
 		   + input_section->output_offset
-		   + (int_rel.r_vaddr - input_section->vma)
-		   + adjust)
+		   + (int_rel.r_vaddr - input_section->vma))
 		  & 0xf0000000)))
 	r = bfd_reloc_overflow;
 
@@ -1835,621 +1278,6 @@
   return TRUE;
 }
 
-/* Read in the relocs for a section.  */
-
-static bfd_boolean
-mips_read_relocs (abfd, sec)
-     bfd *abfd;
-     asection *sec;
-{
-  struct ecoff_section_tdata *section_tdata;
-  bfd_size_type amt;
-
-  section_tdata = ecoff_section_data (abfd, sec);
-  if (section_tdata == (struct ecoff_section_tdata *) NULL)
-    {
-      amt = sizeof (struct ecoff_section_tdata);
-      sec->used_by_bfd = (PTR) bfd_alloc (abfd, amt);
-      if (sec->used_by_bfd == NULL)
-	return FALSE;
-
-      section_tdata = ecoff_section_data (abfd, sec);
-      section_tdata->external_relocs = NULL;
-      section_tdata->contents = NULL;
-      section_tdata->offsets = NULL;
-    }
-
-  if (section_tdata->external_relocs == NULL)
-    {
-      amt = ecoff_backend (abfd)->external_reloc_size;
-      amt *= sec->reloc_count;
-      section_tdata->external_relocs = (PTR) bfd_alloc (abfd, amt);
-      if (section_tdata->external_relocs == NULL && amt != 0)
-	return FALSE;
-
-      if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0
-	  || bfd_bread (section_tdata->external_relocs, amt, abfd) != amt)
-	return FALSE;
-    }
-
-  return TRUE;
-}
-
-/* Relax a section when linking a MIPS ECOFF file.  This is used for
-   embedded PIC code, which always uses PC relative branches which
-   only have an 18 bit range on MIPS.  If a branch is not in range, we
-   generate a long instruction sequence to compensate.  Each time we
-   find a branch to expand, we have to check all the others again to
-   make sure they are still in range.  This is slow, but it only has
-   to be done when -relax is passed to the linker.
-
-   This routine figures out which branches need to expand; the actual
-   expansion is done in mips_relocate_section when the section
-   contents are relocated.  The information is stored in the offsets
-   field of the ecoff_section_tdata structure.  An offset of 1 means
-   that the branch must be expanded into a multi-instruction PC
-   relative branch (such an offset will only occur for a PC relative
-   branch to an external symbol).  Any other offset must be a multiple
-   of four, and is the amount to change the branch by (such an offset
-   will only occur for a PC relative branch within the same section).
-
-   We do not modify the section relocs or contents themselves so that
-   if memory usage becomes an issue we can discard them and read them
-   again.  The only information we must save in memory between this
-   routine and the mips_relocate_section routine is the table of
-   offsets.  */
-
-static bfd_boolean
-mips_relax_section (abfd, sec, info, again)
-     bfd *abfd;
-     asection *sec;
-     struct bfd_link_info *info;
-     bfd_boolean *again;
-{
-  struct ecoff_section_tdata *section_tdata;
-  bfd_byte *contents = NULL;
-  long *offsets;
-  struct external_reloc *ext_rel;
-  struct external_reloc *ext_rel_end;
-  unsigned int i;
-
-  /* Assume we are not going to need another pass.  */
-  *again = FALSE;
-
-  /* If we are not generating an ECOFF file, this is much too
-     confusing to deal with.  */
-  if (info->hash->creator->flavour != bfd_get_flavour (abfd))
-    return TRUE;
-
-  /* If there are no relocs, there is nothing to do.  */
-  if (sec->reloc_count == 0)
-    return TRUE;
-
-  /* We are only interested in PC relative relocs, and why would there
-     ever be one from anything but the .text section?  */
-  if (strcmp (bfd_get_section_name (abfd, sec), ".text") != 0)
-    return TRUE;
-
-  /* Read in the relocs, if we haven't already got them.  */
-  section_tdata = ecoff_section_data (abfd, sec);
-  if (section_tdata == (struct ecoff_section_tdata *) NULL
-      || section_tdata->external_relocs == NULL)
-    {
-      if (! mips_read_relocs (abfd, sec))
-	goto error_return;
-      section_tdata = ecoff_section_data (abfd, sec);
-    }
-
-  if (sec->_cooked_size == 0)
-    {
-      /* We must initialize _cooked_size only the first time we are
-	 called.  */
-      sec->_cooked_size = sec->_raw_size;
-    }
-
-  contents = section_tdata->contents;
-  offsets = section_tdata->offsets;
-
-  /* Look for any external PC relative relocs.  Internal PC relative
-     relocs are already correct in the object file, so they certainly
-     can not overflow.  */
-  ext_rel = (struct external_reloc *) section_tdata->external_relocs;
-  ext_rel_end = ext_rel + sec->reloc_count;
-  for (i = 0; ext_rel < ext_rel_end; ext_rel++, i++)
-    {
-      struct internal_reloc int_rel;
-      struct ecoff_link_hash_entry *h;
-      asection *hsec;
-      bfd_signed_vma relocation;
-      struct external_reloc *adj_ext_rel;
-      unsigned int adj_i;
-      unsigned long ext_count;
-      struct ecoff_link_hash_entry **adj_h_ptr;
-      struct ecoff_link_hash_entry **adj_h_ptr_end;
-      struct ecoff_value_adjust *adjust;
-      bfd_size_type amt;
-
-      /* If we have already expanded this reloc, we certainly don't
-	 need to do it again.  */
-      if (offsets != (long *) NULL && offsets[i] == 1)
-	continue;
-
-      /* Quickly check that this reloc is external PCREL16.  */
-      if (bfd_header_big_endian (abfd))
-	{
-	  if ((ext_rel->r_bits[3] & RELOC_BITS3_EXTERN_BIG) == 0
-	      || (((ext_rel->r_bits[3] & RELOC_BITS3_TYPE_BIG)
-		   >> RELOC_BITS3_TYPE_SH_BIG)
-		  != MIPS_R_PCREL16))
-	    continue;
-	}
-      else
-	{
-	  if ((ext_rel->r_bits[3] & RELOC_BITS3_EXTERN_LITTLE) == 0
-	      || (((ext_rel->r_bits[3] & RELOC_BITS3_TYPE_LITTLE)
-		   >> RELOC_BITS3_TYPE_SH_LITTLE)
-		  != MIPS_R_PCREL16))
-	    continue;
-	}
-
-      mips_ecoff_swap_reloc_in (abfd, (PTR) ext_rel, &int_rel);
-
-      h = ecoff_data (abfd)->sym_hashes[int_rel.r_symndx];
-      if (h == (struct ecoff_link_hash_entry *) NULL)
-	abort ();
-
-      if (h->root.type != bfd_link_hash_defined
-	  && h->root.type != bfd_link_hash_defweak)
-	{
-	  /* Just ignore undefined symbols.  These will presumably
-	     generate an error later in the link.  */
-	  continue;
-	}
-
-      /* Get the value of the symbol.  */
-      hsec = h->root.u.def.section;
-      relocation = (h->root.u.def.value
-		    + hsec->output_section->vma
-		    + hsec->output_offset);
-
-      /* Subtract out the current address.  */
-      relocation -= (sec->output_section->vma
-		     + sec->output_offset
-		     + (int_rel.r_vaddr - sec->vma));
-
-      /* The addend is stored in the object file.  In the normal case
-	 of ``bal symbol'', the addend will be -4.  It will only be
-	 different in the case of ``bal symbol+constant''.  To avoid
-	 always reading in the section contents, we don't check the
-	 addend in the object file (we could easily check the contents
-	 if we happen to have already read them in, but I fear that
-	 this could be confusing).  This means we will screw up if
-	 there is a branch to a symbol that is in range, but added to
-	 a constant which puts it out of range; in such a case the
-	 link will fail with a reloc overflow error.  Since the
-	 compiler will never generate such code, it should be easy
-	 enough to work around it by changing the assembly code in the
-	 source file.  */
-      relocation -= 4;
-
-      /* Now RELOCATION is the number we want to put in the object
-	 file.  See whether it fits.  */
-      if (relocation >= -0x20000 && relocation < 0x20000)
-	continue;
-
-      /* Now that we know this reloc needs work, which will rarely
-	 happen, go ahead and grab the section contents.  */
-      if (contents == (bfd_byte *) NULL)
-	{
-	  if (info->keep_memory)
-	    contents = (bfd_byte *) bfd_alloc (abfd, sec->_raw_size);
-	  else
-	    contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	  if (contents == (bfd_byte *) NULL)
-	    goto error_return;
-	  if (! bfd_get_section_contents (abfd, sec, (PTR) contents,
-					  (file_ptr) 0, sec->_raw_size))
-	    goto error_return;
-	  if (info->keep_memory)
-	    section_tdata->contents = contents;
-	}
-
-      /* We only support changing the bal instruction.  It would be
-	 possible to handle other PC relative branches, but some of
-	 them (the conditional branches) would require a different
-	 length instruction sequence which would complicate both this
-	 routine and mips_relax_pcrel16.  It could be written if
-	 somebody felt it were important.  Ignoring this reloc will
-	 presumably cause a reloc overflow error later on.  */
-      if (bfd_get_32 (abfd, contents + int_rel.r_vaddr - sec->vma)
-	  != 0x0411ffff) /* bgezal $0,. == bal .  */
-	continue;
-
-      /* Bother.  We need to expand this reloc, and we will need to
-	 make another relaxation pass since this change may put other
-	 relocs out of range.  We need to examine the local branches
-	 and we need to allocate memory to hold the offsets we must
-	 add to them.  We also need to adjust the values of all
-	 symbols in the object file following this location.  */
-
-      sec->_cooked_size += PCREL16_EXPANSION_ADJUSTMENT;
-      *again = TRUE;
-
-      if (offsets == (long *) NULL)
-	{
-	  bfd_size_type size;
-
-	  size = (bfd_size_type) sec->reloc_count * sizeof (long);
-	  offsets = (long *) bfd_zalloc (abfd, size);
-	  if (offsets == (long *) NULL)
-	    goto error_return;
-	  section_tdata->offsets = offsets;
-	}
-
-      offsets[i] = 1;
-
-      /* Now look for all PC relative references that cross this reloc
-	 and adjust their offsets.  */
-      adj_ext_rel = (struct external_reloc *) section_tdata->external_relocs;
-      for (adj_i = 0; adj_ext_rel < ext_rel_end; adj_ext_rel++, adj_i++)
-	{
-	  struct internal_reloc adj_int_rel;
-	  bfd_vma start, stop;
-	  int change;
-
-	  mips_ecoff_swap_reloc_in (abfd, (PTR) adj_ext_rel, &adj_int_rel);
-
-	  if (adj_int_rel.r_type == MIPS_R_PCREL16)
-	    {
-	      unsigned long insn;
-
-	      /* We only care about local references.  External ones
-		 will be relocated correctly anyhow.  */
-	      if (adj_int_rel.r_extern)
-		continue;
-
-	      /* We are only interested in a PC relative reloc within
-		 this section.  FIXME: Cross section PC relative
-		 relocs may not be handled correctly; does anybody
-		 care?  */
-	      if (adj_int_rel.r_symndx != RELOC_SECTION_TEXT)
-		continue;
-
-	      start = adj_int_rel.r_vaddr;
-
-	      insn = bfd_get_32 (abfd,
-				 contents + adj_int_rel.r_vaddr - sec->vma);
-
-	      stop = (insn & 0xffff) << 2;
-	      if ((stop & 0x20000) != 0)
-		stop -= 0x40000;
-	      stop += adj_int_rel.r_vaddr + 4;
-	    }
-	  else if (adj_int_rel.r_type == MIPS_R_RELHI)
-	    {
-	      struct internal_reloc rello;
-	      long addhi, addlo;
-
-	      /* The next reloc must be MIPS_R_RELLO, and we handle
-		 them together.  */
-	      BFD_ASSERT (adj_ext_rel + 1 < ext_rel_end);
-
-	      mips_ecoff_swap_reloc_in (abfd, (PTR) (adj_ext_rel + 1), &rello);
-
-	      BFD_ASSERT (rello.r_type == MIPS_R_RELLO);
-
-	      addhi = bfd_get_32 (abfd,
-				   contents + adj_int_rel.r_vaddr - sec->vma);
-	      addhi &= 0xffff;
-	      if (addhi & 0x8000)
-		addhi -= 0x10000;
-	      addhi <<= 16;
-
-	      addlo = bfd_get_32 (abfd, contents + rello.r_vaddr - sec->vma);
-	      addlo &= 0xffff;
-	      if (addlo & 0x8000)
-		addlo -= 0x10000;
-
-	      if (adj_int_rel.r_extern)
-		{
-		  /* The value we want here is
-		       sym - RELLOaddr + addend
-		     which we can express as
-		       sym - (RELLOaddr - addend)
-		     Therefore if we are expanding the area between
-		     RELLOaddr and RELLOaddr - addend we must adjust
-		     the addend.  This is admittedly ambiguous, since
-		     we might mean (sym + addend) - RELLOaddr, but in
-		     practice we don't, and there is no way to handle
-		     that case correctly since at this point we have
-		     no idea whether any reloc is being expanded
-		     between sym and sym + addend.  */
-		  start = rello.r_vaddr - (addhi + addlo);
-		  stop = rello.r_vaddr;
-		}
-	      else
-		{
-		  /* An internal RELHI/RELLO pair represents the
-		     difference between two addresses, $LC0 - foo.
-		     The symndx value is actually the difference
-		     between the reloc address and $LC0.  This lets us
-		     compute $LC0, and, by considering the addend,
-		     foo.  If the reloc we are expanding falls between
-		     those two relocs, we must adjust the addend.  At
-		     this point, the symndx value is actually in the
-		     r_offset field, where it was put by
-		     mips_ecoff_swap_reloc_in.  */
-		  start = rello.r_vaddr - adj_int_rel.r_offset;
-		  stop = start + addhi + addlo;
-		}
-	    }
-	  else if (adj_int_rel.r_type == MIPS_R_SWITCH)
-	    {
-	      /* A MIPS_R_SWITCH reloc represents a word of the form
-		   .word $L3-$LS12
-		 The value in the object file is correct, assuming the
-		 original value of $L3.  The symndx value is actually
-		 the difference between the reloc address and $LS12.
-		 This lets us compute the original value of $LS12 as
-		   vaddr - symndx
-		 and the original value of $L3 as
-		   vaddr - symndx + addend
-		 where addend is the value from the object file.  At
-		 this point, the symndx value is actually found in the
-		 r_offset field, since it was moved by
-		 mips_ecoff_swap_reloc_in.  */
-	      start = adj_int_rel.r_vaddr - adj_int_rel.r_offset;
-	      stop = start + bfd_get_32 (abfd,
-					 (contents
-					  + adj_int_rel.r_vaddr
-					  - sec->vma));
-	    }
-	  else
-	    continue;
-
-	  /* If the range expressed by this reloc, which is the
-	     distance between START and STOP crosses the reloc we are
-	     expanding, we must adjust the offset.  The sign of the
-	     adjustment depends upon the direction in which the range
-	     crosses the reloc being expanded.  */
-	  if (start <= int_rel.r_vaddr && stop > int_rel.r_vaddr)
-	    change = PCREL16_EXPANSION_ADJUSTMENT;
-	  else if (start > int_rel.r_vaddr && stop <= int_rel.r_vaddr)
-	    change = - PCREL16_EXPANSION_ADJUSTMENT;
-	  else
-	    change = 0;
-
-	  offsets[adj_i] += change;
-
-	  if (adj_int_rel.r_type == MIPS_R_RELHI)
-	    {
-	      adj_ext_rel++;
-	      adj_i++;
-	      offsets[adj_i] += change;
-	    }
-	}
-
-      /* Find all symbols in this section defined by this object file
-	 and adjust their values.  Note that we decide whether to
-	 adjust the value based on the value stored in the ECOFF EXTR
-	 structure, because the value stored in the hash table may
-	 have been changed by an earlier expanded reloc and thus may
-	 no longer correctly indicate whether the symbol is before or
-	 after the expanded reloc.  */
-      ext_count = ecoff_data (abfd)->debug_info.symbolic_header.iextMax;
-      adj_h_ptr = ecoff_data (abfd)->sym_hashes;
-      adj_h_ptr_end = adj_h_ptr + ext_count;
-      for (; adj_h_ptr < adj_h_ptr_end; adj_h_ptr++)
-	{
-	  struct ecoff_link_hash_entry *adj_h;
-
-	  adj_h = *adj_h_ptr;
-	  if (adj_h != (struct ecoff_link_hash_entry *) NULL
-	      && (adj_h->root.type == bfd_link_hash_defined
-		  || adj_h->root.type == bfd_link_hash_defweak)
-	      && adj_h->root.u.def.section == sec
-	      && adj_h->esym.asym.value > int_rel.r_vaddr)
-	    adj_h->root.u.def.value += PCREL16_EXPANSION_ADJUSTMENT;
-	}
-
-      /* Add an entry to the symbol value adjust list.  This is used
-	 by bfd_ecoff_debug_accumulate to adjust the values of
-	 internal symbols and FDR's.  */
-      amt = sizeof (struct ecoff_value_adjust);
-      adjust = (struct ecoff_value_adjust *) bfd_alloc (abfd, amt);
-      if (adjust == (struct ecoff_value_adjust *) NULL)
-	goto error_return;
-
-      adjust->start = int_rel.r_vaddr;
-      adjust->end = sec->vma + sec->_raw_size;
-      adjust->adjust = PCREL16_EXPANSION_ADJUSTMENT;
-
-      adjust->next = ecoff_data (abfd)->debug_info.adjust;
-      ecoff_data (abfd)->debug_info.adjust = adjust;
-    }
-
-  if (contents != (bfd_byte *) NULL && ! info->keep_memory)
-    free (contents);
-
-  return TRUE;
-
- error_return:
-  if (contents != (bfd_byte *) NULL && ! info->keep_memory)
-    free (contents);
-  return FALSE;
-}
-
-/* This routine is called from mips_relocate_section when a PC
-   relative reloc must be expanded into the five instruction sequence.
-   It handles all the details of the expansion, including resolving
-   the reloc.  */
-
-static bfd_boolean
-mips_relax_pcrel16 (info, input_bfd, input_section, h, location, address)
-     struct bfd_link_info *info ATTRIBUTE_UNUSED;
-     bfd *input_bfd;
-     asection *input_section ATTRIBUTE_UNUSED;
-     struct ecoff_link_hash_entry *h;
-     bfd_byte *location;
-     bfd_vma address;
-{
-  bfd_vma relocation;
-
-  /* 0x0411ffff is bgezal $0,. == bal .  */
-  BFD_ASSERT (bfd_get_32 (input_bfd, location) == 0x0411ffff);
-
-  /* We need to compute the distance between the symbol and the
-     current address plus eight.  */
-  relocation = (h->root.u.def.value
-		+ h->root.u.def.section->output_section->vma
-		+ h->root.u.def.section->output_offset);
-  relocation -= address + 8;
-
-  /* If the lower half is negative, increment the upper 16 half.  */
-  if ((relocation & 0x8000) != 0)
-    relocation += 0x10000;
-
-  bfd_put_32 (input_bfd, (bfd_vma) 0x04110001, location); /* bal .+8 */
-  bfd_put_32 (input_bfd,
-	      0x3c010000 | ((relocation >> 16) & 0xffff), /* lui $at,XX */
-	      location + 4);
-  bfd_put_32 (input_bfd,
-	      0x24210000 | (relocation & 0xffff), /* addiu $at,$at,XX */
-	      location + 8);
-  bfd_put_32 (input_bfd,
-	      (bfd_vma) 0x003f0821, location + 12); /* addu $at,$at,$ra */
-  bfd_put_32 (input_bfd,
-	      (bfd_vma) 0x0020f809, location + 16); /* jalr $at */
-
-  return TRUE;
-}
-
-/* Given a .sdata section and a .rel.sdata in-memory section, store
-   relocation information into the .rel.sdata section which can be
-   used at runtime to relocate the section.  This is called by the
-   linker when the --embedded-relocs switch is used.  This is called
-   after the add_symbols entry point has been called for all the
-   objects, and before the final_link entry point is called.  This
-   function presumes that the object was compiled using
-   -membedded-pic.  */
-
-bfd_boolean
-bfd_mips_ecoff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
-     bfd *abfd;
-     struct bfd_link_info *info;
-     asection *datasec;
-     asection *relsec;
-     char **errmsg;
-{
-  struct ecoff_link_hash_entry **sym_hashes;
-  struct ecoff_section_tdata *section_tdata;
-  struct external_reloc *ext_rel;
-  struct external_reloc *ext_rel_end;
-  bfd_byte *p;
-  bfd_size_type amt;
-
-  BFD_ASSERT (! info->relocatable);
-
-  *errmsg = NULL;
-
-  if (datasec->reloc_count == 0)
-    return TRUE;
-
-  sym_hashes = ecoff_data (abfd)->sym_hashes;
-
-  if (! mips_read_relocs (abfd, datasec))
-    return FALSE;
-
-  amt = (bfd_size_type) datasec->reloc_count * 4;
-  relsec->contents = (bfd_byte *) bfd_alloc (abfd, amt);
-  if (relsec->contents == NULL)
-    return FALSE;
-
-  p = relsec->contents;
-
-  section_tdata = ecoff_section_data (abfd, datasec);
-  ext_rel = (struct external_reloc *) section_tdata->external_relocs;
-  ext_rel_end = ext_rel + datasec->reloc_count;
-  for (; ext_rel < ext_rel_end; ext_rel++, p += 4)
-    {
-      struct internal_reloc int_rel;
-      bfd_boolean text_relative;
-
-      mips_ecoff_swap_reloc_in (abfd, (PTR) ext_rel, &int_rel);
-
-      /* We are going to write a four byte word into the runtime reloc
-	 section.  The word will be the address in the data section
-	 which must be relocated.  This must be on a word boundary,
-	 which means the lower two bits must be zero.  We use the
-	 least significant bit to indicate how the value in the data
-	 section must be relocated.  A 0 means that the value is
-	 relative to the text section, while a 1 indicates that the
-	 value is relative to the data section.  Given that we are
-	 assuming the code was compiled using -membedded-pic, there
-	 should not be any other possibilities.  */
-
-      /* We can only relocate REFWORD relocs at run time.  */
-      if (int_rel.r_type != MIPS_R_REFWORD)
-	{
-	  *errmsg = _("unsupported reloc type");
-	  bfd_set_error (bfd_error_bad_value);
-	  return FALSE;
-	}
-
-      if (int_rel.r_extern)
-	{
-	  struct ecoff_link_hash_entry *h;
-
-	  h = sym_hashes[int_rel.r_symndx];
-	  /* If h is NULL, that means that there is a reloc against an
-	     external symbol which we thought was just a debugging
-	     symbol.  This should not happen.  */
-	  if (h == (struct ecoff_link_hash_entry *) NULL)
-	    abort ();
-	  if ((h->root.type == bfd_link_hash_defined
-	       || h->root.type == bfd_link_hash_defweak)
-	      && (h->root.u.def.section->flags & SEC_CODE) != 0)
-	    text_relative = TRUE;
-	  else
-	    text_relative = FALSE;
-	}
-      else
-	{
-	  switch (int_rel.r_symndx)
-	    {
-	    case RELOC_SECTION_TEXT:
-	      text_relative = TRUE;
-	      break;
-	    case RELOC_SECTION_SDATA:
-	    case RELOC_SECTION_SBSS:
-	    case RELOC_SECTION_LIT8:
-	      text_relative = FALSE;
-	      break;
-	    default:
-	      /* No other sections should appear in -membedded-pic
-                 code.  */
-	      *errmsg = _("reloc against unsupported section");
-	      bfd_set_error (bfd_error_bad_value);
-	      return FALSE;
-	    }
-	}
-
-      if ((int_rel.r_offset & 3) != 0)
-	{
-	  *errmsg = _("reloc not properly aligned");
-	  bfd_set_error (bfd_error_bad_value);
-	  return FALSE;
-	}
-
-      bfd_put_32 (abfd,
-		  (int_rel.r_vaddr - datasec->vma + datasec->output_offset
-		   + (text_relative ? 0 : 1)),
-		  p);
-    }
-
-  return TRUE;
-}
-
 /* This is the ECOFF backend structure.  The backend field of the
    target vector points to this.  */
 
@@ -2557,7 +1385,7 @@
   _bfd_generic_get_section_contents_in_window
 
 /* Relaxing sections is MIPS specific.  */
-#define _bfd_ecoff_bfd_relax_section mips_relax_section
+#define _bfd_ecoff_bfd_relax_section bfd_generic_relax_section
 
 /* GC of sections is not done.  */
 #define _bfd_ecoff_bfd_gc_sections bfd_generic_gc_sections
@@ -2565,6 +1393,7 @@
 /* Merging of sections is not done.  */
 #define _bfd_ecoff_bfd_merge_sections bfd_generic_merge_sections
 
+#define _bfd_ecoff_bfd_is_group_section bfd_generic_is_group_section
 #define _bfd_ecoff_bfd_discard_group bfd_generic_discard_group
 
 extern const bfd_target ecoff_big_vec;
diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c
index c1c2c32..c1eca47 100644
--- a/bfd/coff-ppc.c
+++ b/bfd/coff-ppc.c
@@ -1,6 +1,6 @@
 /* BFD back-end for PowerPC Microsoft Portable Executable files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    Original version pieced together by Kim Knuttila (krk@cygnus.com)
@@ -1330,12 +1330,12 @@
 
 	    /* FIXME: this test is conservative.  */
 	    if ((r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN
-		&& (bfd_vma) our_toc_offset > toc_section->_raw_size)
+		&& (bfd_vma) our_toc_offset > toc_section->size)
 	      {
 		(*_bfd_error_handler)
 		  (_("%s: Relocation exceeds allocated TOC (%lx)"),
 		   bfd_archive_filename (input_bfd),
-		   (unsigned long) toc_section->_raw_size);
+		   (unsigned long) toc_section->size);
 		bfd_set_error (bfd_error_bad_value);
 		return FALSE;
 	      }
@@ -1690,7 +1690,7 @@
   foo = (bfd_byte *) bfd_alloc (bfd_of_toc_owner, amt);
   memset(foo, test_char, (size_t) global_toc_size);
 
-  s->_raw_size = s->_cooked_size = global_toc_size;
+  s->size = global_toc_size;
   s->contents = foo;
 
   return TRUE;
@@ -2328,8 +2328,10 @@
 	      if (info->relocatable)
 		o->reloc_count += sec->reloc_count;
 
-	      if (sec->_raw_size > max_contents_size)
-		max_contents_size = sec->_raw_size;
+	      if (sec->rawsize > max_contents_size)
+		max_contents_size = sec->rawsize;
+	      if (sec->size > max_contents_size)
+		max_contents_size = sec->size;
 	      if (sec->lineno_count > max_lineno_count)
 		max_lineno_count = sec->lineno_count;
 	      if (sec->reloc_count > max_reloc_count)
@@ -2663,7 +2665,7 @@
     }
 
   /* If we have optimized stabs strings, output them.  */
-  if (coff_hash_table (info)->stab_info != NULL)
+  if (coff_hash_table (info)->stab_info.stabstr != NULL)
     {
       if (! _bfd_write_stab_strings (abfd, &coff_hash_table (info)->stab_info))
 	return FALSE;
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index 56e34e2..79c5ae1 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -1,5 +1,5 @@
 /* BFD back-end for IBM RS/6000 "XCOFF" files.
-   Copyright 1990-1999, 2000, 2001, 2002, 2003
+   Copyright 1990-1999, 2000, 2001, 2002, 2003, 2004
    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
@@ -2948,8 +2948,7 @@
      cror.  */
   if (NULL != h
       && bfd_link_hash_defined == h->root.type
-      && (rel->r_vaddr - input_section->vma + 8
-	  <= input_section->_cooked_size))
+      && rel->r_vaddr - input_section->vma + 8 <= input_section->size)
     {
       bfd_byte *pnext;
       unsigned long next;
@@ -3449,7 +3448,7 @@
       address = rel->r_vaddr - input_section->vma;
       location = contents + address;
 
-      if (address > input_section->_raw_size)
+      if (address > input_section->size)
 	abort ();
 
       /* Get the value we are going to relocate.  */
@@ -4142,6 +4141,7 @@
     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
     ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true),
     ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true),
+    ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
     ((bfd_boolean (*) (bfd *, flagword)) bfd_true),
     ((bfd_boolean (*) (bfd *, void * )) bfd_true),
 
@@ -4196,11 +4196,13 @@
     _bfd_generic_link_split_section,
     bfd_generic_gc_sections,
     bfd_generic_merge_sections,
+    bfd_generic_is_group_section,
     bfd_generic_discard_group,
 
     /* Dynamic */
     _bfd_xcoff_get_dynamic_symtab_upper_bound,
     _bfd_xcoff_canonicalize_dynamic_symtab,
+    _bfd_nodynamic_get_synthetic_symtab,
     _bfd_xcoff_get_dynamic_reloc_upper_bound,
     _bfd_xcoff_canonicalize_dynamic_reloc,
 
@@ -4384,6 +4386,7 @@
     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
     ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true),
     ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true),
+    ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
     ((bfd_boolean (*) (bfd *, flagword)) bfd_true),
     ((bfd_boolean (*) (bfd *, void * )) bfd_true),
 
@@ -4438,11 +4441,13 @@
     _bfd_generic_link_split_section,
     bfd_generic_gc_sections,
     bfd_generic_merge_sections,
+    bfd_generic_is_group_section,
     bfd_generic_discard_group,
 
     /* Dynamic */
     _bfd_xcoff_get_dynamic_symtab_upper_bound,
     _bfd_xcoff_canonicalize_dynamic_symtab,
+    _bfd_nodynamic_get_synthetic_symtab,
     _bfd_xcoff_get_dynamic_reloc_upper_bound,
     _bfd_xcoff_canonicalize_dynamic_reloc,
 
diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c
index d78cc16..ade10fc 100644
--- a/bfd/coff-sh.c
+++ b/bfd/coff-sh.c
@@ -1,6 +1,6 @@
 /* BFD back-end for Renesas Super-H COFF binaries.
-   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+   2003, 2004 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>.
@@ -698,11 +698,9 @@
      bfd_boolean *again;
 {
   struct internal_reloc *internal_relocs;
-  struct internal_reloc *free_relocs = NULL;
   bfd_boolean have_code;
   struct internal_reloc *irel, *irelend;
   bfd_byte *contents = NULL;
-  bfd_byte *free_contents = NULL;
 
   *again = FALSE;
 
@@ -711,10 +709,13 @@
       || sec->reloc_count == 0)
     return TRUE;
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
+  if (coff_section_data (abfd, sec) == NULL)
+    {
+      bfd_size_type amt = sizeof (struct coff_section_tdata);
+      sec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
+      if (sec->used_by_bfd == NULL)
+	return FALSE;
+    }
 
   internal_relocs = (_bfd_coff_read_internal_relocs
 		     (abfd, sec, link_info->keep_memory,
@@ -722,8 +723,6 @@
 		      (struct internal_reloc *) NULL));
   if (internal_relocs == NULL)
     goto error_return;
-  if (! link_info->keep_memory)
-    free_relocs = internal_relocs;
 
   have_code = FALSE;
 
@@ -745,18 +744,11 @@
       /* Get the section contents.  */
       if (contents == NULL)
 	{
-	  if (coff_section_data (abfd, sec) != NULL
-	      && coff_section_data (abfd, sec)->contents != NULL)
+	  if (coff_section_data (abfd, sec)->contents != NULL)
 	    contents = coff_section_data (abfd, sec)->contents;
 	  else
 	    {
-	      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	      if (contents == NULL)
-		goto error_return;
-	      free_contents = contents;
-
-	      if (! bfd_get_section_contents (abfd, sec, contents,
-					      (file_ptr) 0, sec->_raw_size))
+	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		goto error_return;
 	    }
 	}
@@ -768,7 +760,7 @@
       laddr = irel->r_vaddr - sec->vma + 4;
       /* Careful to sign extend the 32-bit offset.  */
       laddr += ((irel->r_offset & 0xffffffff) ^ 0x80000000) - 0x80000000;
-      if (laddr >= sec->_raw_size)
+      if (laddr >= sec->size)
 	{
 	  (*_bfd_error_handler) ("%s: 0x%lx: warning: bad R_SH_USES offset",
 				 bfd_archive_filename (abfd),
@@ -795,7 +787,7 @@
       paddr = insn & 0xff;
       paddr *= 4;
       paddr += (laddr + 4) &~ (bfd_vma) 3;
-      if (paddr >= sec->_raw_size)
+      if (paddr >= sec->size)
 	{
 	  ((*_bfd_error_handler)
 	   ("%s: 0x%lx: warning: bad R_SH_USES load offset",
@@ -812,11 +804,12 @@
 #ifdef COFF_WITH_PE
 	    && (irelfn->r_type == R_SH_IMM32
 		|| irelfn->r_type == R_SH_IMM32CE
-		|| irelfn->r_type == R_SH_IMAGEBASE))
+		|| irelfn->r_type == R_SH_IMAGEBASE)
 
 #else
-	    && irelfn->r_type == R_SH_IMM32)
+	    && irelfn->r_type == R_SH_IMM32
 #endif
+	    )
 	  break;
       if (irelfn >= irelend)
 	{
@@ -894,21 +887,11 @@
 	 that would be more work, but would require less memory when
 	 the linker is run.  */
 
-      if (coff_section_data (abfd, sec) == NULL)
-	{
-	  bfd_size_type amt = sizeof (struct coff_section_tdata);
-	  sec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
-	  if (sec->used_by_bfd == NULL)
-	    goto error_return;
-	}
-
       coff_section_data (abfd, sec)->relocs = internal_relocs;
       coff_section_data (abfd, sec)->keep_relocs = TRUE;
-      free_relocs = NULL;
 
       coff_section_data (abfd, sec)->contents = contents;
       coff_section_data (abfd, sec)->keep_contents = TRUE;
-      free_contents = NULL;
 
       obj_coff_keep_syms (abfd) = TRUE;
 
@@ -1011,18 +994,11 @@
       /* Get the section contents.  */
       if (contents == NULL)
 	{
-	  if (coff_section_data (abfd, sec) != NULL
-	      && coff_section_data (abfd, sec)->contents != NULL)
+	  if (coff_section_data (abfd, sec)->contents != NULL)
 	    contents = coff_section_data (abfd, sec)->contents;
 	  else
 	    {
-	      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	      if (contents == NULL)
-		goto error_return;
-	      free_contents = contents;
-
-	      if (! bfd_get_section_contents (abfd, sec, contents,
-					      (file_ptr) 0, sec->_raw_size))
+	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		goto error_return;
 	    }
 	}
@@ -1032,58 +1008,42 @@
 
       if (swapped)
 	{
-	  if (coff_section_data (abfd, sec) == NULL)
-	    {
-	      bfd_size_type amt = sizeof (struct coff_section_tdata);
-	      sec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
-	      if (sec->used_by_bfd == NULL)
-		goto error_return;
-	    }
-
 	  coff_section_data (abfd, sec)->relocs = internal_relocs;
 	  coff_section_data (abfd, sec)->keep_relocs = TRUE;
-	  free_relocs = NULL;
 
 	  coff_section_data (abfd, sec)->contents = contents;
 	  coff_section_data (abfd, sec)->keep_contents = TRUE;
-	  free_contents = NULL;
 
 	  obj_coff_keep_syms (abfd) = TRUE;
 	}
     }
 
-  if (free_relocs != NULL)
-    {
-      free (free_relocs);
-      free_relocs = NULL;
-    }
-
-  if (free_contents != NULL)
+  if (internal_relocs != NULL
+      && internal_relocs != coff_section_data (abfd, sec)->relocs)
     {
       if (! link_info->keep_memory)
-	free (free_contents);
+	free (internal_relocs);
       else
-	{
-	  /* Cache the section contents for coff_link_input_bfd.  */
-	  if (coff_section_data (abfd, sec) == NULL)
-	    {
-	      bfd_size_type amt = sizeof (struct coff_section_tdata);
-	      sec->used_by_bfd = (PTR) bfd_zalloc (abfd, amt);
-	      if (sec->used_by_bfd == NULL)
-		goto error_return;
-	      coff_section_data (abfd, sec)->relocs = NULL;
-	    }
-	  coff_section_data (abfd, sec)->contents = contents;
-	}
+	coff_section_data (abfd, sec)->relocs = internal_relocs;
+    }
+
+  if (contents != NULL && contents != coff_section_data (abfd, sec)->contents)
+    {
+      if (! link_info->keep_memory)
+	free (contents);
+      else
+	/* Cache the section contents for coff_link_input_bfd.  */
+	coff_section_data (abfd, sec)->contents = contents;
     }
 
   return TRUE;
 
  error_return:
-  if (free_relocs != NULL)
-    free (free_relocs);
-  if (free_contents != NULL)
-    free (free_contents);
+  if (internal_relocs != NULL
+      && internal_relocs != coff_section_data (abfd, sec)->relocs)
+    free (internal_relocs);
+  if (contents != NULL && contents != coff_section_data (abfd, sec)->contents)
+    free (contents);
   return FALSE;
 }
 
@@ -1111,7 +1071,7 @@
      power larger than the number of bytes we are deleting.  */
 
   irelalign = NULL;
-  toaddr = sec->_cooked_size;
+  toaddr = sec->size;
 
   irel = coff_section_data (abfd, sec)->relocs;
   irelend = irel + sec->reloc_count;
@@ -1131,7 +1091,7 @@
   memmove (contents + addr, contents + addr + count,
 	   (size_t) (toaddr - addr - count));
   if (irelalign == NULL)
-    sec->_cooked_size -= count;
+    sec->size -= count;
   else
     {
       int i;
@@ -1443,17 +1403,12 @@
 		    ocontents = coff_section_data (abfd, o)->contents;
 		  else
 		    {
+		      if (!bfd_malloc_and_get_section (abfd, o, &ocontents))
+			return FALSE;
 		      /* 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;
 		      coff_section_data (abfd, o)->contents = ocontents;
 		    }
 		}
@@ -2694,7 +2649,7 @@
       if (irel < irelend)
 	stop = irel->r_vaddr - sec->vma;
       else
-	stop = sec->_cooked_size;
+	stop = sec->size;
 
       if (! _bfd_sh_align_load_span (abfd, sec, contents, sh_swap_insns,
 				     (PTR) internal_relocs, &label,
@@ -3046,7 +3001,7 @@
 						       symbols);
 
   memcpy (data, coff_section_data (input_bfd, input_section)->contents,
-	  (size_t) input_section->_raw_size);
+	  (size_t) input_section->size);
 
   if ((input_section->flags & SEC_RELOC) != 0
       && input_section->reloc_count > 0)
diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c
index ec9c695..098ea42 100644
--- a/bfd/coff64-rs6000.c
+++ b/bfd/coff64-rs6000.c
@@ -1,5 +1,5 @@
 /* BFD back-end for IBM RS/6000 "XCOFF64" files.
-   Copyright 2000, 2001, 2002, 2003
+   Copyright 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written Clinton Popetz.
    Contributed by Cygnus Support.
@@ -845,11 +845,11 @@
 
       section.s_vaddr = current->vma;
       section.s_paddr = current->lma;
-      section.s_size =  current->_raw_size;
+      section.s_size =  current->size;
 
       /* If this section has no size or is unloadable then the scnptr
 	 will be 0 too.  */
-      if (current->_raw_size == 0
+      if (current->size == 0
 	  || (current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
 	{
 	  section.s_scnptr = 0;
@@ -965,19 +965,19 @@
 
   if (text_sec)
     {
-      internal_a.tsize = bfd_get_section_size_before_reloc (text_sec);
+      internal_a.tsize = text_sec->size;
       internal_a.text_start = internal_a.tsize ? text_sec->vma : 0;
     }
 
   if (data_sec)
     {
-      internal_a.dsize = bfd_get_section_size_before_reloc (data_sec);
+      internal_a.dsize = data_sec->size;
       internal_a.data_start = internal_a.dsize ? data_sec->vma : 0;
     }
 
   if (bss_sec)
     {
-      internal_a.bsize = bfd_get_section_size_before_reloc (bss_sec);
+      internal_a.bsize = bss_sec->size;
       if (internal_a.bsize && bss_sec->vma < internal_a.data_start)
 	internal_a.data_start = bss_sec->vma;
     }
@@ -1127,8 +1127,7 @@
      cror.  */
   if (NULL != h
       && bfd_link_hash_defined == h->root.type
-      && (rel->r_vaddr - input_section->vma + 8
-	  <= input_section->_cooked_size))
+      && rel->r_vaddr - input_section->vma + 8 <= input_section->size)
     {
       bfd_byte *pnext;
       unsigned long next;
@@ -1301,7 +1300,7 @@
       address = rel->r_vaddr - input_section->vma;
       location = contents + address;
 
-      if (address > input_section->_raw_size)
+      if (address > input_section->size)
 	abort ();
 
       /* Get the value we are going to relocate.  */
@@ -2683,6 +2682,7 @@
     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
     ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true),
     ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true),
+    ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
     ((bfd_boolean (*) (bfd *, flagword)) bfd_true),
     ((bfd_boolean (*) (bfd *, void * )) bfd_true),
 
@@ -2737,11 +2737,13 @@
     _bfd_generic_link_split_section,
     bfd_generic_gc_sections,
     bfd_generic_merge_sections,
+    bfd_generic_is_group_section,
     bfd_generic_discard_group,
 
     /* Dynamic */
     _bfd_xcoff_get_dynamic_symtab_upper_bound,
     _bfd_xcoff_canonicalize_dynamic_symtab,
+    _bfd_nodynamic_get_synthetic_symtab,
     _bfd_xcoff_get_dynamic_reloc_upper_bound,
     _bfd_xcoff_canonicalize_dynamic_reloc,
 
@@ -2926,6 +2928,7 @@
     ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
     ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true),
     ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true),
+    ((bfd_boolean (*) (bfd *, bfd *)) bfd_true),
     ((bfd_boolean (*) (bfd *, flagword)) bfd_true),
     ((bfd_boolean (*) (bfd *, void * )) bfd_true),
 
@@ -2980,11 +2983,13 @@
     _bfd_generic_link_split_section,
     bfd_generic_gc_sections,
     bfd_generic_merge_sections,
+    bfd_generic_is_group_section,
     bfd_generic_discard_group,
 
     /* Dynamic */
     _bfd_xcoff_get_dynamic_symtab_upper_bound,
     _bfd_xcoff_canonicalize_dynamic_symtab,
+    _bfd_nodynamic_get_synthetic_symtab,
     _bfd_xcoff_get_dynamic_reloc_upper_bound,
     _bfd_xcoff_canonicalize_dynamic_reloc,
 
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 15d9709..d40cc80 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1,6 +1,6 @@
 /* Support for the generic parts of most COFF variants, for BFD.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -309,6 +309,9 @@
 
 #define STRING_SIZE_SIZE (4)
 
+#define DOT_DEBUG	".debug"
+#define GNU_LINKONCE_WI ".gnu.linkonce.wi."
+
 static long sec_to_styp_flags
   PARAMS ((const char *, flagword));
 static bfd_boolean styp_to_sec_flags
@@ -428,7 +431,7 @@
       styp_flags = STYP_LIT;
 #endif /* _LIT */
     }
-  else if (!strncmp (sec_name, ".debug", 6))
+  else if (!strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1))
     {
       /* Handle the XCOFF debug section and DWARF2 debug sections.  */
       if (!sec_name[6])
@@ -441,7 +444,7 @@
       styp_flags = STYP_DEBUG_INFO;
     }
 #ifdef COFF_LONG_SECTION_NAMES
-  else if (!strncmp (sec_name, ".gnu.linkonce.wi.", 17))
+  else if (!strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1))
     {
       styp_flags = STYP_DEBUG_INFO;
     }
@@ -518,7 +521,7 @@
 
 static long
 sec_to_styp_flags (sec_name, sec_flags)
-     const char *sec_name ATTRIBUTE_UNUSED;
+     const char *sec_name;
      flagword sec_flags;
 {
   long styp_flags = 0;
@@ -531,6 +534,11 @@
      PE files.  The STYP_* flags and the IMAGE_SCN_* flags overlap,
      but there are more IMAGE_SCN_* flags.  */
 
+  /* FIXME: There is no gas syntax to specify the debug section flag.  */
+  if (strncmp (sec_name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0
+      || strncmp (sec_name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0)
+    sec_flags = SEC_READONLY | SEC_DEBUGGING;
+
   /* skip LOAD */
   /* READONLY later */
   /* skip RELOC */
@@ -675,12 +683,12 @@
 #endif
 	sec_flags |= SEC_ALLOC;
     }
-  else if (strncmp (name, ".debug", 6) == 0
+  else if (strncmp (name, DOT_DEBUG, sizeof (DOT_DEBUG) - 1) == 0
 #ifdef _COMMENT
 	   || strcmp (name, _COMMENT) == 0
 #endif
 #ifdef COFF_LONG_SECTION_NAMES
-	   || strncmp (name, ".gnu.linkonce.wi.", 17) == 0
+	   || strncmp (name, GNU_LINKONCE_WI, sizeof (GNU_LINKONCE_WI) - 1) == 0
 #endif
 	   || strncmp (name, ".stab", 5) == 0)
     {
@@ -1055,7 +1063,15 @@
 	  unhandled = "IMAGE_SCN_MEM_NOT_CACHED";
 	  break;
 	case IMAGE_SCN_MEM_NOT_PAGED:
+#if 0
 	  unhandled = "IMAGE_SCN_MEM_NOT_PAGED";
+#else
+	  /* Generate a warning message rather using the 'unhandled'
+	     variable as this will allow some .sys files generate by
+	     other toolchains to be processed.  See bugzilla issue 196.  */
+	  _bfd_error_handler (_("%s: Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section %s"),
+	     bfd_archive_filename (abfd), name);
+#endif
 	  break;
 	case IMAGE_SCN_MEM_EXECUTE:
 	  sec_flags |= SEC_CODE;
@@ -3004,10 +3020,10 @@
 	{
 	  asection *dsec;
 
-	  dsec = bfd_make_section_old_way (abfd, ".debug");
+	  dsec = bfd_make_section_old_way (abfd, DOT_DEBUG);
 	  if (dsec == NULL)
 	    abort ();
-	  dsec->_raw_size = sz;
+	  dsec->size = sz;
 	  dsec->flags |= SEC_HAS_CONTENTS;
 	}
     }
@@ -3106,7 +3122,7 @@
 	   a zero size and having real contents are different
 	   concepts: .bss has no contents, but (usually) non-zero
 	   size.  */
-	if (current->_raw_size == 0)
+	if (current->size == 0)
 	  {
 	    /* Discard.  However, it still might have (valid) symbols
 	       in it, so arbitrarily set it to section 1 (indexing is
@@ -3157,7 +3173,7 @@
 	    return FALSE;
 	}
       if (pei_section_data (abfd, current)->virt_size == 0)
-	pei_section_data (abfd, current)->virt_size = current->_raw_size;
+	pei_section_data (abfd, current)->virt_size = current->size;
 #endif
 
       /* Only deal with sections which have contents.  */
@@ -3166,7 +3182,7 @@
 
 #ifdef COFF_IMAGE_WITH_PE
       /* Make sure we skip empty sections in a PE image.  */
-      if (current->_raw_size == 0)
+      if (current->size == 0)
 	continue;
 #endif
 
@@ -3214,7 +3230,7 @@
 	    }
 #endif
 	  if (previous != (asection *) NULL)
-	    previous->_raw_size += sofar - old_sofar;
+	    previous->size += sofar - old_sofar;
 	}
 
 #endif
@@ -3230,10 +3246,10 @@
 
 #ifdef COFF_IMAGE_WITH_PE
       /* Set the padded size.  */
-      current->_raw_size = (current->_raw_size + page_size -1) & -page_size;
+      current->size = (current->size + page_size -1) & -page_size;
 #endif
 
-      sofar += current->_raw_size;
+      sofar += current->size;
 
 #ifdef ALIGN_SECTIONS_IN_FILE
       /* Make sure that this section is of the right size too.  */
@@ -3241,26 +3257,26 @@
 	{
 	  bfd_size_type old_size;
 
-	  old_size = current->_raw_size;
-	  current->_raw_size = BFD_ALIGN (current->_raw_size,
-					  1 << current->alignment_power);
-	  align_adjust = current->_raw_size != old_size;
-	  sofar += current->_raw_size - old_size;
+	  old_size = current->size;
+	  current->size = BFD_ALIGN (current->size,
+				     1 << current->alignment_power);
+	  align_adjust = current->size != old_size;
+	  sofar += current->size - old_size;
 	}
       else
 	{
 	  old_sofar = sofar;
 	  sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
 	  align_adjust = sofar != old_sofar;
-	  current->_raw_size += sofar - old_sofar;
+	  current->size += sofar - old_sofar;
 	}
 #endif
 
 #ifdef COFF_IMAGE_WITH_PE
       /* For PE we need to make sure we pad out to the aligned
-         _raw_size, in case the caller only writes out data to the
-         unaligned _raw_size.  */
-      if (pei_section_data (abfd, current)->virt_size < current->_raw_size)
+         size, in case the caller only writes out data to the
+         unaligned size.  */
+      if (pei_section_data (abfd, current)->virt_size < current->size)
 	align_adjust = TRUE;
 #endif
 
@@ -3632,7 +3648,7 @@
 #endif
       section.s_vaddr = current->vma;
       section.s_paddr = current->lma;
-      section.s_size =  current->_raw_size;
+      section.s_size =  current->size;
 #ifdef coff_get_section_load_page
       section.s_page = coff_get_section_load_page (current);
 #endif
@@ -3651,8 +3667,8 @@
 
       /* If this section has no size or is unloadable then the scnptr
 	 will be 0 too.  */
-      if (current->_raw_size == 0 ||
-	  (current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
+      if (current->size == 0
+	  || (current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
 	section.s_scnptr = 0;
       else
 	section.s_scnptr = current->filepos;
@@ -3886,6 +3902,8 @@
 #ifdef COFF_IMAGE_WITH_PE
   if (! hasdebug)
     internal_f.f_flags |= IMAGE_FILE_DEBUG_STRIPPED;
+  if (pe_data (abfd)->real_flags & IMAGE_FILE_LARGE_ADDRESS_AWARE)
+    internal_f.f_flags |= IMAGE_FILE_LARGE_ADDRESS_AWARE;
 #endif
 
 #ifdef COFF_WITH_PE
@@ -4122,17 +4140,17 @@
 
   if (text_sec)
     {
-      internal_a.tsize = bfd_get_section_size_before_reloc (text_sec);
+      internal_a.tsize = text_sec->size;
       internal_a.text_start = internal_a.tsize ? text_sec->vma : 0;
     }
   if (data_sec)
     {
-      internal_a.dsize = bfd_get_section_size_before_reloc (data_sec);
+      internal_a.dsize = data_sec->size;
       internal_a.data_start = internal_a.dsize ? data_sec->vma : 0;
     }
   if (bss_sec)
     {
-      internal_a.bsize = bfd_get_section_size_before_reloc (bss_sec);
+      internal_a.bsize = bss_sec->size;
       if (internal_a.bsize && bss_sec->vma < internal_a.data_start)
 	internal_a.data_start = bss_sec->vma;
     }
@@ -5501,6 +5519,10 @@
 #define coff_bfd_copy_private_symbol_data   _bfd_generic_bfd_copy_private_symbol_data
 #endif
 
+#ifndef coff_bfd_copy_private_header_data
+#define coff_bfd_copy_private_header_data   _bfd_generic_bfd_copy_private_header_data
+#endif
+
 #ifndef coff_bfd_copy_private_section_data
 #define coff_bfd_copy_private_section_data  _bfd_generic_bfd_copy_private_section_data
 #endif
@@ -5556,6 +5578,10 @@
 #define coff_bfd_merge_sections		    bfd_generic_merge_sections
 #endif
 
+#ifndef coff_bfd_is_group_section
+#define coff_bfd_is_group_section	    bfd_generic_is_group_section
+#endif
+
 #ifndef coff_bfd_discard_group
 #define coff_bfd_discard_group		    bfd_generic_discard_group
 #endif
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index a712b4b..22a85b3 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -1,6 +1,6 @@
 /* Support for the generic parts of COFF, for BFD.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -131,7 +131,7 @@
 
   return_section->vma = hdr->s_vaddr;
   return_section->lma = hdr->s_paddr;
-  return_section->_raw_size = hdr->s_size;
+  return_section->size = hdr->s_size;
   return_section->filepos = hdr->s_scnptr;
   return_section->rel_filepos = hdr->s_relptr;
   return_section->reloc_count = hdr->s_nreloc;
@@ -1344,7 +1344,7 @@
 	      || (debug_string_section != (asection *) NULL
 		  && (BFD_ALIGN (debug_string_size,
 				 1 << debug_string_section->alignment_power)
-		      == bfd_section_size (abfd, debug_string_section))));
+		      == debug_string_section->size)));
 
   return TRUE;
 }
@@ -1455,7 +1455,7 @@
   csym[0].u.syment.n_sclass = C_STAT;
   csym[0].u.syment.n_numaux = 1;
 /*  SF_SET_STATICS (sym);       @@ ??? */
-  csym[1].u.auxent.x_scn.x_scnlen = sec->_raw_size;
+  csym[1].u.auxent.x_scn.x_scnlen = sec->size;
   csym[1].u.auxent.x_scn.x_nreloc = sec->reloc_count;
   csym[1].u.auxent.x_scn.x_nlinno = sec->lineno_count;
 
@@ -1537,7 +1537,7 @@
       return NULL;
     }
 
-  sec_size = bfd_get_section_size_before_reloc (sect);
+  sec_size = sect->size;
   debug_section = (PTR) bfd_alloc (abfd, sec_size);
   if (debug_section == NULL)
     return NULL;
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 4ad566c..af6dd3d 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -1,6 +1,6 @@
 /* COFF specific linker code.
-   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+   2004 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -96,7 +96,7 @@
 								   struct bfd_hash_table *,
 								   const char *))
 {
-  table->stab_info = NULL;
+  memset (&table->stab_info, 0, sizeof (table->stab_info));
   return _bfd_link_hash_table_init (&table->root, abfd, newfunc);
 }
 
@@ -551,8 +551,8 @@
 		 For example, it won't help objdump.  This needs to be
 		 done when we swap in the section header.  */
 	      BFD_ASSERT ((*sym_hash)->numaux == 1);
-	      if (section->_raw_size == 0)
-		section->_raw_size = (*sym_hash)->aux[0].x_scn.x_scnlen;
+	      if (section->size == 0)
+		section->size = (*sym_hash)->aux[0].x_scn.x_scnlen;
 
 	      /* FIXME: We could test whether the section sizes
                  matches the size in the aux entry, but apparently
@@ -714,8 +714,10 @@
 	      if (info->relocatable)
 		o->reloc_count += sec->reloc_count;
 
-	      if (sec->_raw_size > max_contents_size)
-		max_contents_size = sec->_raw_size;
+	      if (sec->rawsize > max_contents_size)
+		max_contents_size = sec->rawsize;
+	      if (sec->size > max_contents_size)
+		max_contents_size = sec->size;
 	      if (sec->lineno_count > max_lineno_count)
 		max_lineno_count = sec->lineno_count;
 	      if (sec->reloc_count > max_reloc_count)
@@ -1080,7 +1082,7 @@
     }
 
   /* If we have optimized stabs strings, output them.  */
-  if (coff_hash_table (info)->stab_info != NULL)
+  if (coff_hash_table (info)->stab_info.stabstr != NULL)
     {
       if (! _bfd_write_stab_strings (abfd, &coff_hash_table (info)->stab_info))
 	return FALSE;
@@ -1208,21 +1210,18 @@
   asection *sec = bfd_get_section_by_name (abfd, ".drectve");
   char *s;
   char *e;
-  char *copy;
+  bfd_byte *copy;
 
   if (!sec)
     return 1;
 
-  copy = bfd_malloc (sec->_raw_size);
-  if (!copy)
-    return 0;
-
-  if (! bfd_get_section_contents (abfd, sec, copy, (bfd_vma) 0, sec->_raw_size))
+  if (!bfd_malloc_and_get_section (abfd, sec, &copy))
     {
-      free (copy);
+      if (copy != NULL)
+	free (copy);
       return 0;
     }
-  e = copy + sec->_raw_size;
+  e = copy + sec->size;
 
   for (s = copy;  s < e ; )
     {
@@ -2283,8 +2282,11 @@
 	/* This section was omitted from the link.  */
 	continue;
 
+      if ((o->flags & SEC_LINKER_CREATED) != 0)
+	continue;
+
       if ((o->flags & SEC_HAS_CONTENTS) == 0
-	  || (o->_raw_size == 0 && (o->flags & SEC_RELOC) == 0))
+	  || (o->size == 0 && (o->flags & SEC_RELOC) == 0))
 	{
 	  if ((o->flags & SEC_RELOC) != 0
 	      && o->reloc_count != 0)
@@ -2305,8 +2307,8 @@
 	contents = secdata->contents;
       else
 	{
-	  if (! bfd_get_section_contents (input_bfd, o, finfo->contents,
-					  (file_ptr) 0, o->_raw_size))
+	  bfd_size_type x = o->rawsize ? o->rawsize : o->size;
+	  if (! bfd_get_section_contents (input_bfd, o, finfo->contents, 0, x))
 	    return FALSE;
 	  contents = finfo->contents;
 	}
@@ -2431,10 +2433,8 @@
       if (secdata == NULL || secdata->stab_info == NULL)
 	{
 	  file_ptr loc = o->output_offset * bfd_octets_per_byte (output_bfd);
-	  bfd_size_type amt = (o->_cooked_size != 0
-			       ? o->_cooked_size : o->_raw_size);
 	  if (! bfd_set_section_contents (output_bfd, o->output_section,
-					  contents, loc, amt))
+					  contents, loc, o->size))
 	    return FALSE;
 	}
       else
@@ -2616,9 +2616,7 @@
 	  sec = h->root.u.def.section->output_section;
 	  if (sec != NULL)
 	    {
-	      auxp->x_scn.x_scnlen = (sec->_cooked_size != 0
-				      ? sec->_cooked_size
-				      : sec->_raw_size);
+	      auxp->x_scn.x_scnlen = sec->size;
 
 	      /* For PE, an overflow on the final link reportedly does
                  not matter.  FIXME: Why not?  */
@@ -2925,16 +2923,41 @@
 	  if (h->root.type == bfd_link_hash_defined
 	      || h->root.type == bfd_link_hash_defweak)
 	    {
+	      /* Defined weak symbols are a GNU extension. */
 	      asection *sec;
 
 	      sec = h->root.u.def.section;
 	      val = (h->root.u.def.value
 		     + sec->output_section->vma
 		     + sec->output_offset);
-	      }
+	    }
 
 	  else if (h->root.type == bfd_link_hash_undefweak)
-	    val = 0;
+	    {
+              if (h->class == C_NT_WEAK && h->numaux == 1)
+		{
+		  /* See _Microsoft Portable Executable and Common Object
+                   * File Format Specification_, section 5.5.3.
+		   * Note that weak symbols without aux records are a GNU
+		   * extension.
+		   * FIXME: All weak externals are treated as having
+		   * characteristics IMAGE_WEAK_EXTERN_SEARCH_LIBRARY (2).
+		   * There are no known uses of the other two types of
+		   * weak externals.
+		   */
+		  asection *sec;
+		  struct coff_link_hash_entry *h2 =
+		    input_bfd->tdata.coff_obj_data->sym_hashes[
+		    h->aux->x_sym.x_tagndx.l];
+
+		  sec = h2->root.u.def.section;
+		  val = h2->root.u.def.value + sec->output_section->vma
+		    + sec->output_offset;
+		}
+	      else
+                /* This is a GNU extension. */
+		val = 0;
+	    }
 
 	  else if (! info->relocatable)
 	    {
diff --git a/bfd/config.bfd b/bfd/config.bfd
index 2f9c197..c8c08ed 100644
--- a/bfd/config.bfd
+++ b/bfd/config.bfd
@@ -31,8 +31,10 @@
 
 # Catch obsolete configurations.
 case $targ in
- vax-*-vms*			\
- )
+ m68*-*-lynxos* | \
+ sparc-*-lynxos* | \
+ vax-*-vms* | \
+ null)
     if test "x$enable_obsolete" != xyes; then
       echo "*** Configuration $targ is obsolete." >&2
       echo "*** Specify --enable-obsolete to build it anyway." >&2
@@ -50,6 +52,7 @@
 c30*)	         targ_archs=bfd_tic30_arch ;;
 c4x*)            targ_archs=bfd_tic4x_arch ;;
 c54x*)	         targ_archs=bfd_tic54x_arch ;;
+crx*)            targ_archs=bfd_crx_arch ;;
 dlx*)		 targ_archs=bfd_dlx_arch ;;
 hppa*)	         targ_archs=bfd_hppa_arch ;;
 i[3-7]86)       targ_archs=bfd_i386_arch ;;
@@ -89,12 +92,17 @@
 
 case "${targ}" in
   mips*-dec-bsd*)
-    echo "This target is obsolete and has been removed." 
+    echo "This target is obsolete and has been removed."
+    exit 1
+    ;;
+
+  mips*-*-mach3*)
+    echo "This target is obsolete and has been removed."
     exit 1
     ;;
 
   mips*-*-pe*)
-    echo "This target is obsolete and has been removed." 
+    echo "This target is obsolete and has been removed."
     exit 1
     ;;
 
@@ -306,12 +314,22 @@
     targ_underscore=yes
     ;;
 
+  cr16c-*-elf*)
+    targ_defvec=bfd_elf32_cr16c_vec
+    targ_underscore=yes
+    ;;
+
   cris-*-*)
     targ_defvec=cris_aout_vec
     targ_selvecs="bfd_elf32_us_cris_vec bfd_elf32_cris_vec ieee_vec"
     targ_underscore=yes # Note: not true for bfd_elf32_cris_vec.
     ;;
 
+  crx-*-elf*)
+    targ_defvec=bfd_elf32_crx_vec
+    targ_underscore=yes
+    ;;
+
   d10v-*-*)
     targ_defvec=bfd_elf32_d10v_vec
     ;;
@@ -329,10 +347,15 @@
     targ_defvec=bfd_elf32_fr30_vec
     ;;
 
-  frv-*-elf | frv-*-*linux*)
+  frv-*-elf)
     targ_defvec=bfd_elf32_frv_vec
+    targ_selvecs=bfd_elf32_frvfdpic_vec
     ;;
 
+  frv-*-*linux*)
+    targ_defvec=bfd_elf32_frvfdpic_vec
+    targ_selvecs=bfd_elf32_frv_vec
+    ;;
 
   h8300*-*-elf)
     targ_defvec=bfd_elf32_h8300_vec
@@ -504,8 +527,8 @@
     ;;
 #endif
   i[3-7]86-*-lynxos*)
-    targ_defvec=i386lynx_coff_vec
-    targ_selvecs=i386lynx_aout_vec
+    targ_defvec=bfd_elf32_i386_vec
+    targ_selvecs="i386lynx_coff_vec i386lynx_aout_vec"
     ;;
   i[3-7]86-*-gnu*)
     targ_defvec=bfd_elf32_i386_vec
@@ -736,6 +759,10 @@
     targ_defvec=m88kmach3_vec
     targ_cflags=-DSTAT_FOR_EXEC
     ;;
+  m88*-*-openbsd*)
+   targ_defvec=m88kopenbsd_vec
+   targ_underscore=yes
+   ;;
   m88*-*-*)
     targ_defvec=m88kbcs_vec
     targ_underscore=yes
@@ -762,10 +789,6 @@
     targ_defvec=bfd_elf32_bigmips_vec
     targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec"
     ;;
-  mips*-dec-mach3*)
-    targ_defvec=aout_mips_little_vec
-    targ_cflags=-DSTAT_FOR_EXEC
-    ;;
   mips*-dec-* | mips*el-*-ecoff*)
     targ_defvec=ecoff_little_vec
     targ_selvecs=ecoff_big_vec
@@ -792,10 +815,6 @@
     targ_defvec=ecoff_biglittle_vec
     targ_selvecs="ecoff_little_vec ecoff_big_vec"
     ;;
-  mips*-*-mach3*)
-    targ_defvec=aout_mips_little_vec
-    targ_cflags=-DSTAT_FOR_EXEC
-    ;;
   mips*-*-sysv4*)
     targ_defvec=bfd_elf32_tradbigmips_vec
     targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec"
@@ -876,12 +895,12 @@
     targ_defvec=bfd_elf32_openrisc_vec
     ;;
 
-  or32-*-coff | or32-*-rtems*)
+  or32-*-coff)
     targ_defvec=or32coff_big_vec
     targ_underscore=yes
     ;;
 
-  or32-*-elf)
+  or32-*-elf | or32-*-rtems*)
     targ_defvec=bfd_elf32_or32_big_vec
     ;;
 
@@ -969,9 +988,14 @@
     targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
     targ_archs="bfd_powerpc_arch bfd_rs6000_arch bfd_i386_arch"
     ;;
-  powerpc-*-macos* | powerpc-*-mpw*)
+  powerpc-*-macos*)
     targ_defvec=pmac_xcoff_vec
     ;;
+  powerpc-*-lynxos*)
+    targ_defvec=bfd_elf32_powerpc_vec
+    targ_selvecs="rs6000coff_vec"
+    targ_cflags=-DSMALL_ARCHIVE
+    ;;    
   powerpc-*-netware*)
     targ_defvec=bfd_elf32_powerpc_vec
     targ_selvecs="nlm32_powerpc_vec rs6000coff_vec"
@@ -999,6 +1023,7 @@
   s390-*-linux*)
     targ_defvec=bfd_elf32_s390_vec
     targ64_selvecs=bfd_elf64_s390_vec
+    want64=true
     ;;
 #ifdef BFD64
   s390x-*-linux*)
@@ -1082,6 +1107,11 @@
     targ_defvec=bfd_elf32_shnbsd_vec
     targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec"
     ;;
+  sh*-*-symbianelf*)
+    targ_defvec=bfd_elf32_shl_symbian_vec
+    targ_selvecs="shlcoff_vec shlcoff_small_vec"
+    targ_underscore=yes
+    ;;    
   shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*)
     targ_defvec=bfd_elf32_shl_vec
     targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec"
diff --git a/bfd/configure b/bfd/configure
index ab9049b..2986607 100755
--- a/bfd/configure
+++ b/bfd/configure
@@ -59,6 +59,7 @@
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -173,6 +174,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
@@ -343,6 +345,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=*)
@@ -508,12 +515,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
@@ -552,12 +563,12 @@
 fi
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:556: checking for Cygwin environment" >&5
+echo "configure:567: 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 561 "configure"
+#line 572 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -568,7 +579,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -585,19 +596,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:589: checking for mingw32 environment" >&5
+echo "configure:600: 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 594 "configure"
+#line 605 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -662,7 +673,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:666: checking host system type" >&5
+echo "configure:677: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -683,7 +694,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:687: checking target system type" >&5
+echo "configure:698: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -701,7 +712,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:705: checking build system type" >&5
+echo "configure:716: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -725,7 +736,7 @@
 
 
         echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:729: checking for strerror in -lcposix" >&5
+echo "configure:740: checking for strerror in -lcposix" >&5
 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -733,7 +744,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lcposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 737 "configure"
+#line 748 "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
@@ -744,7 +755,7 @@
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:759: \"$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
@@ -780,7 +791,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:784: checking for a BSD compatible install" >&5
+echo "configure:795: 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
@@ -833,7 +844,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:837: checking whether build environment is sane" >&5
+echo "configure:848: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -890,7 +901,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:894: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:905: 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
@@ -919,7 +930,7 @@
 
 PACKAGE=bfd
 
-VERSION=2.15.90
+VERSION=2.15.91
 
 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; }
@@ -936,7 +947,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal-${am__api_version}""... $ac_c" 1>&6
-echo "configure:940: checking for working aclocal-${am__api_version}" >&5
+echo "configure:951: checking for working aclocal-${am__api_version}" >&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.
@@ -949,7 +960,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:953: checking for working autoconf" >&5
+echo "configure:964: 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.
@@ -962,7 +973,7 @@
 fi
 
 echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6
-echo "configure:966: checking for working automake-${am__api_version}" >&5
+echo "configure:977: checking for working automake-${am__api_version}" >&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.
@@ -975,7 +986,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:979: checking for working autoheader" >&5
+echo "configure:990: 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.
@@ -988,7 +999,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:992: checking for working makeinfo" >&5
+echo "configure:1003: 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.
@@ -1001,18 +1012,6 @@
 fi
 
 
-# Uncomment the next line to remove the date from the reported bfd version
-#is_release=y
-
-bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'`
-
-bfd_version_string="\"${VERSION}\""
-if test x${is_release} = x; then
-  bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h`
-  bfd_version_string="\"${VERSION} ${bfd_version_date}\""
-fi
-
-
 
 if test $host != $build; then
   ac_tool_prefix=${host_alias}-
@@ -1023,7 +1022,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:1027: checking for $ac_word" >&5
+echo "configure:1026: 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
@@ -1055,7 +1054,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:1059: checking for $ac_word" >&5
+echo "configure:1058: 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
@@ -1087,7 +1086,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:1091: checking for $ac_word" >&5
+echo "configure:1090: 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
@@ -1193,7 +1192,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:1197: checking for $ac_word" >&5
+echo "configure:1196: 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
@@ -1223,7 +1222,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:1227: checking for $ac_word" >&5
+echo "configure:1226: 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
@@ -1274,7 +1273,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:1278: checking for $ac_word" >&5
+echo "configure:1277: 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
@@ -1306,7 +1305,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1310: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1309: 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.
@@ -1317,12 +1316,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1321 "configure"
+#line 1320 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1325: \"$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
@@ -1348,12 +1347,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:1352: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1351: 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:1357: checking whether we are using GNU C" >&5
+echo "configure:1356: 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
@@ -1362,7 +1361,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1366: \"$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:1365: \"$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
@@ -1381,7 +1380,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1385: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1384: 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
@@ -1424,7 +1423,7 @@
 if test "$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:1428: checking for ld used by GCC" >&5
+echo "configure:1427: checking for ld used by GCC" >&5
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -1454,10 +1453,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1458: checking for GNU ld" >&5
+echo "configure:1457: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1461: checking for non-GNU ld" >&5
+echo "configure:1460: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1492,7 +1491,7 @@
 fi
 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:1496: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1495: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1509,7 +1508,7 @@
 
 
 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1513: checking for $LD option to reload object files" >&5
+echo "configure:1512: checking for $LD option to reload object files" >&5
 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1521,7 +1520,7 @@
 test -n "$reload_flag" && reload_flag=" $reload_flag"
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1525: checking for BSD-compatible nm" >&5
+echo "configure:1524: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1559,7 +1558,7 @@
 echo "$ac_t""$NM" 1>&6
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1563: checking whether ln -s works" >&5
+echo "configure:1562: 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
@@ -1580,7 +1579,7 @@
 fi
 
 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1584: checking how to recognise dependant libraries" >&5
+echo "configure:1583: checking how to recognise dependant libraries" >&5
 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1753,13 +1752,13 @@
 deplibs_check_method=$lt_cv_deplibs_check_method
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1757: checking for object suffix" >&5
+echo "configure:1756: checking for object suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -1779,7 +1778,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1783: checking for executable suffix" >&5
+echo "configure:1782: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1789,10 +1788,10 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:1793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:1792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
-      *.c | *.o | *.obj) ;;
+      *.c | *.o | *.obj | *.ilk | *.pdb) ;;
       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
       esac
     done
@@ -1816,7 +1815,7 @@
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:1820: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1819: checking for ${ac_tool_prefix}file" >&5
 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1878,7 +1877,7 @@
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
     echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:1882: checking for file" >&5
+echo "configure:1881: checking for file" >&5
 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1949,7 +1948,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:1953: checking for $ac_word" >&5
+echo "configure:1952: 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
@@ -1981,7 +1980,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:1985: checking for $ac_word" >&5
+echo "configure:1984: 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
@@ -2016,7 +2015,7 @@
 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2020: checking for $ac_word" >&5
+echo "configure:2019: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2048,7 +2047,7 @@
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2052: checking for $ac_word" >&5
+echo "configure:2051: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2115,8 +2114,8 @@
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 2119 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 2118 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    if test "$lt_cv_prog_gnu_ld" = yes; then
     case `/usr/bin/file conftest.$ac_objext` in
     *32-bit*)
@@ -2149,7 +2148,7 @@
 ia64-*-hpux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
-  if { (eval echo configure:2153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:2152: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *ELF-32*)
       HPUX_IA64_MODE="32"
@@ -2167,7 +2166,7 @@
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2171: checking whether the C compiler needs -belf" >&5
+echo "configure:2170: 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
@@ -2180,14 +2179,14 @@
 cross_compiling=$ac_cv_prog_cc_cross
 
      cat > conftest.$ac_ext <<EOF
-#line 2184 "configure"
+#line 2183 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2190: \"$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
@@ -2377,7 +2376,7 @@
 fi
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:2381: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2380: 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"
@@ -2400,7 +2399,7 @@
   
 
 echo $ac_n "checking whether to install libbfd""... $ac_c" 1>&6
-echo "configure:2404: checking whether to install libbfd" >&5
+echo "configure:2403: checking whether to install libbfd" >&5
   # Check whether --enable-install-libbfd or --disable-install-libbfd was given.
 if test "${enable_install_libbfd+set}" = set; then
   enableval="$enable_install_libbfd"
@@ -2437,7 +2436,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2441: checking for executable suffix" >&5
+echo "configure:2440: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2447,10 +2446,10 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:2450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
-      *.c | *.o | *.obj) ;;
+      *.c | *.o | *.obj | *.ilk | *.pdb) ;;
       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
       esac
     done
@@ -2477,7 +2476,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:2481: checking for $ac_word" >&5
+echo "configure:2480: 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
@@ -2507,7 +2506,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:2511: checking for $ac_word" >&5
+echo "configure:2510: 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
@@ -2558,7 +2557,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:2562: checking for $ac_word" >&5
+echo "configure:2561: 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
@@ -2590,7 +2589,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2594: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2593: 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.
@@ -2601,12 +2600,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 2605 "configure"
+#line 2604 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2609: \"$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
@@ -2632,12 +2631,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:2636: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2635: 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:2641: checking whether we are using GNU C" >&5
+echo "configure:2640: 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
@@ -2646,7 +2645,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2650: \"$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:2649: \"$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
@@ -2665,7 +2664,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2669: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2668: 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
@@ -2699,7 +2698,7 @@
 
 ALL_LINGUAS="fr tr ja es sv da zh_CN ro"
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2703: checking how to run the C preprocessor" >&5
+echo "configure:2702: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2714,13 +2713,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2718 "configure"
+#line 2717 "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:2724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2723: \"$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
   :
@@ -2731,13 +2730,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2735 "configure"
+#line 2734 "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:2741: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2740: \"$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
   :
@@ -2748,13 +2747,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2752 "configure"
+#line 2751 "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:2758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2757: \"$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
   :
@@ -2781,7 +2780,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:2785: checking for $ac_word" >&5
+echo "configure:2784: 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
@@ -2809,12 +2808,12 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2813: checking for ANSI C header files" >&5
+echo "configure:2812: 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 2818 "configure"
+#line 2817 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2822,7 +2821,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2825: \"$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*
@@ -2839,7 +2838,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 2843 "configure"
+#line 2842 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2857,7 +2856,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 2861 "configure"
+#line 2860 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2878,7 +2877,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2882 "configure"
+#line 2881 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2889,7 +2888,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2913,12 +2912,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2917: checking for working const" >&5
+echo "configure:2916: 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 2922 "configure"
+#line 2921 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2967,7 +2966,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2988,21 +2987,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2992: checking for inline" >&5
+echo "configure:2991: 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 2999 "configure"
+#line 2998 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:3006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -3028,12 +3027,12 @@
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3032: checking for off_t" >&5
+echo "configure:3031: 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 3037 "configure"
+#line 3036 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3061,12 +3060,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3065: checking for size_t" >&5
+echo "configure:3064: 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 3070 "configure"
+#line 3069 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3096,19 +3095,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:3100: checking for working alloca.h" >&5
+echo "configure:3099: 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 3105 "configure"
+#line 3104 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:3112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3111: \"$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
@@ -3129,12 +3128,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3133: checking for alloca" >&5
+echo "configure:3132: 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 3138 "configure"
+#line 3137 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -3162,7 +3161,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3165: \"$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
@@ -3194,12 +3193,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3198: checking whether alloca needs Cray hooks" >&5
+echo "configure:3197: 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 3203 "configure"
+#line 3202 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -3224,12 +3223,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:3228: checking for $ac_func" >&5
+echo "configure:3227: 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 3233 "configure"
+#line 3232 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3252,7 +3251,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3255: \"$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
@@ -3279,7 +3278,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3283: checking stack direction for C alloca" >&5
+echo "configure:3282: 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
@@ -3287,7 +3286,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 3291 "configure"
+#line 3290 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -3306,7 +3305,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:3310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3309: \"$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
@@ -3327,21 +3326,21 @@
 
 fi
 
-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3335: checking for $ac_hdr" >&5
+echo "configure:3334: 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 3340 "configure"
+#line 3339 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3344: \"$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*
@@ -3370,12 +3369,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3374: checking for $ac_func" >&5
+echo "configure:3373: 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 3379 "configure"
+#line 3378 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3398,7 +3397,7 @@
 
 ; 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:3401: \"$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
@@ -3423,7 +3422,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3427: checking for working mmap" >&5
+echo "configure:3426: 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
@@ -3431,7 +3430,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3435 "configure"
+#line 3434 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3459,24 +3458,11 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+# endif
 
 /* Assume that all systems that can run configure have sys/param.h.  */
 # ifndef HAVE_SYS_PARAM_H
@@ -3584,7 +3570,7 @@
 }
 
 EOF
-if { (eval echo configure:3588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3574: \"$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
@@ -3612,17 +3598,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3616: checking for $ac_hdr" >&5
+echo "configure:3602: 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 3621 "configure"
+#line 3607 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3612: \"$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*
@@ -3652,12 +3638,12 @@
 __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3656: checking for $ac_func" >&5
+echo "configure:3642: 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 3661 "configure"
+#line 3647 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3680,7 +3666,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3670: \"$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
@@ -3709,12 +3695,12 @@
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3713: checking for $ac_func" >&5
+echo "configure:3699: 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 3718 "configure"
+#line 3704 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3737,7 +3723,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3727: \"$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
@@ -3771,19 +3757,19 @@
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3775: checking for LC_MESSAGES" >&5
+echo "configure:3761: 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 3780 "configure"
+#line 3766 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:3787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3773: \"$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
@@ -3804,7 +3790,7 @@
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3808: checking whether NLS is requested" >&5
+echo "configure:3794: 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"
@@ -3824,7 +3810,7 @@
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3828: checking whether included gettext is requested" >&5
+echo "configure:3814: 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"
@@ -3843,17 +3829,17 @@
 
 	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3847: checking for libintl.h" >&5
+echo "configure:3833: 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 3852 "configure"
+#line 3838 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3843: \"$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*
@@ -3870,19 +3856,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:3874: checking for gettext in libc" >&5
+echo "configure:3860: 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 3879 "configure"
+#line 3865 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3872: \"$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
@@ -3898,7 +3884,7 @@
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 	     echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3902: checking for bindtextdomain in -lintl" >&5
+echo "configure:3888: 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
@@ -3906,7 +3892,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3910 "configure"
+#line 3896 "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
@@ -3917,7 +3903,7 @@
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3907: \"$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
@@ -3933,19 +3919,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:3937: checking for gettext in libintl" >&5
+echo "configure:3923: 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 3942 "configure"
+#line 3928 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3935: \"$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
@@ -3973,7 +3959,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:3977: checking for $ac_word" >&5
+echo "configure:3963: 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
@@ -4007,12 +3993,12 @@
 		for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4011: checking for $ac_func" >&5
+echo "configure:3997: 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 4016 "configure"
+#line 4002 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4035,7 +4021,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4025: \"$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
@@ -4062,7 +4048,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:4066: checking for $ac_word" >&5
+echo "configure:4052: 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
@@ -4098,7 +4084,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:4102: checking for $ac_word" >&5
+echo "configure:4088: 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
@@ -4130,7 +4116,7 @@
 fi
 
 		cat > conftest.$ac_ext <<EOF
-#line 4134 "configure"
+#line 4120 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4138,7 +4124,7 @@
 			       return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:4142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
 		   DATADIRNAME=share
@@ -4170,7 +4156,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:4174: checking for $ac_word" >&5
+echo "configure:4160: 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
@@ -4204,7 +4190,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:4208: checking for $ac_word" >&5
+echo "configure:4194: 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
@@ -4240,7 +4226,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:4244: checking for $ac_word" >&5
+echo "configure:4230: 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
@@ -4330,7 +4316,7 @@
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:4334: checking for catalogs to be installed" >&5
+echo "configure:4320: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -4358,17 +4344,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:4362: checking for linux/version.h" >&5
+echo "configure:4348: 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 4367 "configure"
+#line 4353 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4358: \"$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*
@@ -4446,7 +4432,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:4450: checking for a BSD compatible install" >&5
+echo "configure:4436: 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
@@ -4506,19 +4492,19 @@
 BFD_HOST_U_64_BIT=
 
 echo $ac_n "checking for long long""... $ac_c" 1>&6
-echo "configure:4510: checking for long long" >&5
+echo "configure:4496: checking for long long" >&5
 if eval "test \"`echo '$''{'bfd_cv_has_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4515 "configure"
+#line 4501 "configure"
 #include "confdefs.h"
 
 int main() {
 unsigned long long ll = 18446744073709551615ULL;
 ; return 0; }
 EOF
-if { (eval echo configure:4522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4508: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_has_long_long=yes
 else
@@ -4534,13 +4520,13 @@
 if test $bfd_cv_has_long_long = yes; then
   BFD_HOST_LONG_LONG=1
   echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:4538: checking size of long long" >&5
+echo "configure:4524: checking size of long long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
   cat > conftest.$ac_ext <<EOF
-#line 4544 "configure"
+#line 4530 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
 #include <sys/types.h>
@@ -4550,7 +4536,7 @@
 switch (0) case 0: case (sizeof (long long) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:4554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4540: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_long_long=$ac_size
 else
@@ -4575,13 +4561,13 @@
 fi
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:4579: checking size of long" >&5
+echo "configure:4565: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
   cat > conftest.$ac_ext <<EOF
-#line 4585 "configure"
+#line 4571 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
 #include <sys/types.h>
@@ -4591,7 +4577,7 @@
 switch (0) case 0: case (sizeof (long) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:4595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_long=$ac_size
 else
@@ -4649,7 +4635,7 @@
   EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
   echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:4653: checking for build system executable suffix" >&5
+echo "configure:4639: 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
@@ -4677,17 +4663,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4681: checking for $ac_hdr" >&5
+echo "configure:4667: 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 4686 "configure"
+#line 4672 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4691: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4677: \"$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*
@@ -4717,17 +4703,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4721: checking for $ac_hdr" >&5
+echo "configure:4707: 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 4726 "configure"
+#line 4712 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4717: \"$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*
@@ -4754,12 +4740,12 @@
 done
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4758: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4744: 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 4763 "configure"
+#line 4749 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -4768,7 +4754,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:4772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -4793,12 +4779,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:4797: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4783: 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 4802 "configure"
+#line 4788 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4806,7 +4792,7 @@
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4831,7 +4817,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:4835: checking for opendir in -ldir" >&5
+echo "configure:4821: 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
@@ -4839,7 +4825,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4843 "configure"
+#line 4829 "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
@@ -4850,7 +4836,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4840: \"$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
@@ -4872,7 +4858,7 @@
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4876: checking for opendir in -lx" >&5
+echo "configure:4862: 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
@@ -4880,7 +4866,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4884 "configure"
+#line 4870 "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
@@ -4891,7 +4877,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4881: \"$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
@@ -4916,12 +4902,12 @@
 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:4920: checking for $ac_func" >&5
+echo "configure:4906: 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 4911 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4944,7 +4930,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:4934: \"$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
@@ -4971,12 +4957,12 @@
 for ac_func in strtoull
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4975: checking for $ac_func" >&5
+echo "configure:4961: 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 4980 "configure"
+#line 4966 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4999,7 +4985,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4989: \"$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
@@ -5034,12 +5020,12 @@
 esac
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:5038: checking whether strstr must be declared" >&5
+echo "configure:5024: 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 5043 "configure"
+#line 5029 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -5060,7 +5046,7 @@
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:5064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5050: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -5081,12 +5067,12 @@
 fi
 
 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:5085: checking whether malloc must be declared" >&5
+echo "configure:5071: 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 5090 "configure"
+#line 5076 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -5107,7 +5093,7 @@
 char *(*pfn) = (char *(*)) malloc
 ; return 0; }
 EOF
-if { (eval echo configure:5111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_malloc=no
 else
@@ -5128,12 +5114,12 @@
 fi
 
 echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:5132: checking whether realloc must be declared" >&5
+echo "configure:5118: 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 5137 "configure"
+#line 5123 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -5154,7 +5140,7 @@
 char *(*pfn) = (char *(*)) realloc
 ; return 0; }
 EOF
-if { (eval echo configure:5158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_realloc=no
 else
@@ -5175,12 +5161,12 @@
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:5179: checking whether free must be declared" >&5
+echo "configure:5165: 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 5184 "configure"
+#line 5170 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -5201,7 +5187,7 @@
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:5205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -5222,12 +5208,12 @@
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:5226: checking whether getenv must be declared" >&5
+echo "configure:5212: 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 5231 "configure"
+#line 5217 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -5248,7 +5234,7 @@
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:5252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -5295,6 +5281,10 @@
   hppa*-*-mpeix*)	COREFILE=hpux-core.lo ;;
   hppa*-*-bsd*)		COREFILE="hpux-core.lo hppabsd-core.lo"
 			COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
+  hppa*-*-netbsd* | hppa*-*-openbsd*)
+	COREFILE=netbsd-core.lo
+	;;
+
   i370-*-*)
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/i370linux.h"'
@@ -5312,7 +5302,7 @@
   i[3-7]86-*-bsdi)
 	COREFILE=
 	;;
-  i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234]* | i[3-7]86-*-freebsd*aout*)
+  i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234] | i[3-7]86-*-freebsd4\.[01234]\.* | i[3-7]86-*-freebsd*aout*)
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/i386bsd.h"'
 	;;
@@ -5348,14 +5338,6 @@
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/i860mach3.h"'
 	;;
-  mips-dec-bsd*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/mipsbsd.h"'
-	;;
-  mips-dec-mach3*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/mipsmach3.h"'
-	;;
   mips-*-netbsd* | mips*-*-openbsd*)
 	COREFILE=netbsd-core.lo
 	;;
@@ -5366,10 +5348,6 @@
   mips-sgi-irix4*)	COREFILE=irix-core.lo ;;
   mips-sgi-irix5*)	COREFILE=irix-core.lo ;;
   mips-sgi-irix6*)	COREFILE=irix-core.lo ;;
-  mips-*-mach3*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/mipsmach3.h"'
-	;;
   mips-*-sysv4*)	;;
   mips-*-sysv* | mips-*-riscos*)
 	COREFILE=trad-core.lo
@@ -5416,6 +5394,9 @@
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/m88kmach3.h"'
 	;;
+  m88*-*-openbsd*)
+	COREFILE=netbsd-core.lo
+	;;
   ns32k-pc532-mach)
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/pc532mach.h"'
@@ -5436,16 +5417,16 @@
 	# Not all versions of AIX with -DAIX_CORE_DUMPX_CORE
 	# have c_impl as a member of struct core_dumpx
 	echo $ac_n "checking for c_impl in struct core_dumpx""... $ac_c" 1>&6
-echo "configure:5440: checking for c_impl in struct core_dumpx" >&5
+echo "configure:5421: checking for c_impl in struct core_dumpx" >&5
 	cat > conftest.$ac_ext <<EOF
-#line 5442 "configure"
+#line 5423 "configure"
 #include "confdefs.h"
 #include <core.h>
 int main() {
 struct core_dumpx c; c.c_impl = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5449: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_ST_C_IMPL 1
@@ -5522,17 +5503,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5526: checking for $ac_hdr" >&5
+echo "configure:5507: 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 5531 "configure"
+#line 5512 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5517: \"$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*
@@ -5560,12 +5541,12 @@
 
   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:5564: checking for prstatus_t in sys/procfs.h" >&5
+echo "configure:5545: 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 5569 "configure"
+#line 5550 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5574,7 +5555,7 @@
 prstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5559: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prstatus_t=yes
 else
@@ -5596,12 +5577,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6
 
     echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5600: checking for prstatus32_t in sys/procfs.h" >&5
+echo "configure:5581: checking for prstatus32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5605 "configure"
+#line 5586 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5610,7 +5591,7 @@
 prstatus32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prstatus32_t=yes
 else
@@ -5632,12 +5613,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6
 
     echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5636: checking for prstatus_t.pr_who in sys/procfs.h" >&5
+echo "configure:5617: 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 5641 "configure"
+#line 5622 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5646,7 +5627,7 @@
 prstatus_t avar; void* aref = (void*) &avar.pr_who
 ; return 0; }
 EOF
-if { (eval echo configure:5650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5631: \"$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
@@ -5668,12 +5649,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6
 
     echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5672: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
+echo "configure:5653: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5677 "configure"
+#line 5658 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5682,7 +5663,7 @@
 prstatus32_t avar; void* aref = (void*) &avar.pr_who
 ; return 0; }
 EOF
-if { (eval echo configure:5686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes
 else
@@ -5704,12 +5685,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6
 
     echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5708: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:5689: 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 5713 "configure"
+#line 5694 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5718,7 +5699,7 @@
 pstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pstatus_t=yes
 else
@@ -5740,12 +5721,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
 
     echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5744: checking for pxstatus_t in sys/procfs.h" >&5
+echo "configure:5725: checking for pxstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5749 "configure"
+#line 5730 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5754,7 +5735,7 @@
 pxstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pxstatus_t=yes
 else
@@ -5776,12 +5757,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6
 
     echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5780: checking for pstatus32_t in sys/procfs.h" >&5
+echo "configure:5761: checking for pstatus32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5785 "configure"
+#line 5766 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5790,7 +5771,7 @@
 pstatus32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pstatus32_t=yes
 else
@@ -5812,12 +5793,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6
 
     echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5816: checking for prpsinfo_t in sys/procfs.h" >&5
+echo "configure:5797: 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 5821 "configure"
+#line 5802 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5826,7 +5807,7 @@
 prpsinfo_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prpsinfo_t=yes
 else
@@ -5848,12 +5829,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6
 
     echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5852: checking for prpsinfo32_t in sys/procfs.h" >&5
+echo "configure:5833: checking for prpsinfo32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5857 "configure"
+#line 5838 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5862,7 +5843,7 @@
 prpsinfo32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5866: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes
 else
@@ -5884,12 +5865,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6
 
     echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5888: checking for psinfo_t in sys/procfs.h" >&5
+echo "configure:5869: 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 5893 "configure"
+#line 5874 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5898,7 +5879,7 @@
 psinfo_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5902: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_psinfo_t=yes
 else
@@ -5920,12 +5901,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6
 
     echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5924: checking for psinfo32_t in sys/procfs.h" >&5
+echo "configure:5905: checking for psinfo32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5929 "configure"
+#line 5910 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5934,7 +5915,7 @@
 psinfo32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_psinfo32_t=yes
 else
@@ -5956,12 +5937,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6
 
     echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5960: checking for lwpstatus_t in sys/procfs.h" >&5
+echo "configure:5941: 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 5965 "configure"
+#line 5946 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5970,7 +5951,7 @@
 lwpstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_lwpstatus_t=yes
 else
@@ -5992,12 +5973,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6
 
     echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5996: checking for lwpxstatus_t in sys/procfs.h" >&5
+echo "configure:5977: checking for lwpxstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6001 "configure"
+#line 5982 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -6006,7 +5987,7 @@
 lwpxstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:6010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes
 else
@@ -6028,12 +6009,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6
 
     echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:6032: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
+echo "configure:6013: 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 6037 "configure"
+#line 6018 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -6042,7 +6023,7 @@
 lwpstatus_t avar; void* aref = (void*) &avar.pr_context
 ; return 0; }
 EOF
-if { (eval echo configure:6046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6027: \"$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
@@ -6064,12 +6045,12 @@
  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:6068: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
+echo "configure:6049: 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 6073 "configure"
+#line 6054 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -6078,7 +6059,7 @@
 lwpstatus_t avar; void* aref = (void*) &avar.pr_reg
 ; return 0; }
 EOF
-if { (eval echo configure:6082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6063: \"$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
@@ -6100,12 +6081,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6
 
     echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:6104: checking for win32_pstatus_t in sys/procfs.h" >&5
+echo "configure:6085: checking for win32_pstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6109 "configure"
+#line 6090 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -6114,7 +6095,7 @@
 win32_pstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:6118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes
 else
@@ -6274,8 +6255,6 @@
     aout0_big_vec)		tb="$tb aout0.lo aout32.lo" ;;
     aout_arm_big_vec)		tb="$tb aout-arm.lo aout32.lo" ;;
     aout_arm_little_vec)	tb="$tb aout-arm.lo aout32.lo" ;;
-    aout_mips_big_vec)		tb="$tb mipsbsd.lo aout32.lo" ;;
-    aout_mips_little_vec)	tb="$tb mipsbsd.lo aout32.lo" ;;
     apollocoff_vec)		tb="$tb coff-apollo.lo" ;;
     arm_epoc_pe_big_vec)	tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
     arm_epoc_pe_little_vec)	tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
@@ -6299,12 +6278,15 @@
     bfd_elf32_bigarm_oabi_vec)	tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
     bfd_elf32_bigarm_vec)	tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
     bfd_elf32_bigmips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_cr16c_vec)	tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
     bfd_elf32_cris_vec)		tb="$tb elf32-cris.lo elf32.lo $elf" ;;
+    bfd_elf32_crx_vec)          tb="$tb elf32-crx.lo elf32.lo $elf" ;;    
     bfd_elf32_d10v_vec)		tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
     bfd_elf32_d30v_vec)		tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
     bfd_elf32_dlx_big_vec)	tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
     bfd_elf32_fr30_vec)		tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
     bfd_elf32_frv_vec)		tb="$tb elf32-frv.lo elf32.lo $elf" ;;
+    bfd_elf32_frvfdpic_vec)	tb="$tb elf32-frv.lo elf32.lo $elf" ;;
     bfd_elf32_h8300_vec)	tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_linux_vec)	tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
@@ -6359,6 +6341,7 @@
     bfd_elf32_sh_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_shblin_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shl_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shl_symbian_vec)	tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_shlin_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shlnbsd_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shnbsd_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
@@ -6443,6 +6426,7 @@
     m68ksysvcoff_vec)		tb="$tb coff-svm68k.lo cofflink.lo" ;;
     m88kbcs_vec)		tb="$tb coff-m88k.lo" ;;
     m88kmach3_vec)		tb="$tb m88kmach3.lo aout32.lo" ;;
+    m88kopenbsd_vec)		tb="$tb m88kopenbsd.lo aout32.lo" ;;
     mach_o_be_vec)              tb="$tb mach-o.lo" ;;
     mach_o_le_vec)              tb="$tb mach-o.lo" ;;
     mach_o_fat_vec)             tb="$tb mach-o.lo" ;;
@@ -6586,10 +6570,10 @@
     if test -n "$GCC" ; then
        bad_64bit_gcc=no;
        echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6
-echo "configure:6590: checking for gcc version with buggy 64-bit support" >&5
+echo "configure:6574: checking for gcc version with buggy 64-bit support" >&5
        # Add more tests for gcc versions with non-working 64-bit support here.
        cat > conftest.$ac_ext <<EOF
-#line 6593 "configure"
+#line 6577 "configure"
 #include "confdefs.h"
 :__GNUC__:__GNUC_MINOR__:__i386__:
 EOF
@@ -6631,12 +6615,12 @@
 for ac_func in ftello ftello64 fseeko fseeko64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6635: checking for $ac_func" >&5
+echo "configure:6619: 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 6640 "configure"
+#line 6624 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6659,7 +6643,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6647: \"$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
@@ -6685,13 +6669,13 @@
 
 if test x"$ac_cv_func_ftello" = xyes -a x"$ac_cv_func_fseeko" = xyes; then
     echo $ac_n "checking size of off_t""... $ac_c" 1>&6
-echo "configure:6689: checking size of off_t" >&5
+echo "configure:6673: checking size of off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   for ac_size in 4 8 1 2 16 12  ; do # List sizes in rough order of prevalence.
   cat > conftest.$ac_ext <<EOF
-#line 6695 "configure"
+#line 6679 "configure"
 #include "confdefs.h"
 #include "confdefs.h"
 #include <sys/types.h>
@@ -6701,7 +6685,7 @@
 switch (0) case 0: case (sizeof (off_t) == $ac_size):;
 ; return 0; }
 EOF
-if { (eval echo configure:6705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sizeof_off_t=$ac_size
 else
@@ -6725,7 +6709,7 @@
 
 fi
 echo $ac_n "checking file_ptr type""... $ac_c" 1>&6
-echo "configure:6729: checking file_ptr type" >&5
+echo "configure:6713: checking file_ptr type" >&5
 bfd_file_ptr="long"
 bfd_ufile_ptr="unsigned long"
 if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \
@@ -6746,21 +6730,21 @@
 test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}"
 
 
-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6754: checking for $ac_hdr" >&5
+echo "configure:6738: 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 6759 "configure"
+#line 6743 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6748: \"$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*
@@ -6789,12 +6773,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6793: checking for $ac_func" >&5
+echo "configure:6777: 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 6798 "configure"
+#line 6782 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6817,7 +6801,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6805: \"$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
@@ -6842,7 +6826,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6846: checking for working mmap" >&5
+echo "configure:6830: 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
@@ -6850,7 +6834,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 6854 "configure"
+#line 6838 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6878,24 +6862,11 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+# endif
 
 /* Assume that all systems that can run configure have sys/param.h.  */
 # ifndef HAVE_SYS_PARAM_H
@@ -7003,7 +6974,7 @@
 }
 
 EOF
-if { (eval echo configure:7007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6978: \"$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
@@ -7028,12 +6999,12 @@
 for ac_func in madvise mprotect
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7032: checking for $ac_func" >&5
+echo "configure:7003: 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 7037 "configure"
+#line 7008 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7056,7 +7027,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7031: \"$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
@@ -7189,7 +7160,7 @@
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -7247,8 +7218,6 @@
 s%@AUTOHEADER@%$AUTOHEADER%g
 s%@MAKEINFO@%$MAKEINFO%g
 s%@SET_MAKE@%$SET_MAKE%g
-s%@bfd_version@%$bfd_version%g
-s%@bfd_version_string@%$bfd_version_string%g
 s%@AR@%$AR%g
 s%@RANLIB@%$RANLIB%g
 s%@CC@%$CC%g
@@ -7350,7 +7319,7 @@
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
diff --git a/bfd/configure.in b/bfd/configure.in
index e08a663..229893e 100644
--- a/bfd/configure.in
+++ b/bfd/configure.in
@@ -7,21 +7,7 @@
 AC_CANONICAL_SYSTEM
 AC_ISC_POSIX
 
-AM_INIT_AUTOMAKE(bfd, 2.15.90)
-# Uncomment the next line to remove the date from the reported bfd version
-#is_release=y
-
-changequote(,)dnl
-bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'`
-changequote([,])dnl
-
-bfd_version_string="\"${VERSION}\""
-if test x${is_release} = x; then
-  bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h`
-  bfd_version_string="\"${VERSION} ${bfd_version_date}\""
-fi
-AC_SUBST(bfd_version)
-AC_SUBST(bfd_version_string)
+AM_INIT_AUTOMAKE(bfd, 2.15.91)
 
 dnl These must be called before AM_PROG_LIBTOOL, because it may want
 dnl to call AC_CHECK_PROG.
@@ -195,6 +181,10 @@
   hppa*-*-mpeix*)	COREFILE=hpux-core.lo ;;
   hppa*-*-bsd*)		COREFILE="hpux-core.lo hppabsd-core.lo"
 			COREFLAG="-DHPUX_CORE -DHPPABSD_CORE" ;;
+  hppa*-*-netbsd* | hppa*-*-openbsd*)
+	COREFILE=netbsd-core.lo
+	;;
+
   i370-*-*)
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/i370linux.h"'
@@ -219,7 +209,7 @@
 	COREFILE=
 	;;
 changequote(,)dnl
-  i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234]* | i[3-7]86-*-freebsd*aout*)
+  i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234] | i[3-7]86-*-freebsd4\.[01234]\.* | i[3-7]86-*-freebsd*aout*)
 changequote([,])dnl
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/i386bsd.h"'
@@ -272,14 +262,6 @@
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/i860mach3.h"'
 	;;
-  mips-dec-bsd*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/mipsbsd.h"'
-	;;
-  mips-dec-mach3*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/mipsmach3.h"'
-	;;
   mips-*-netbsd* | mips*-*-openbsd*)
 	COREFILE=netbsd-core.lo
 	;;
@@ -290,10 +272,6 @@
   mips-sgi-irix4*)	COREFILE=irix-core.lo ;;
   mips-sgi-irix5*)	COREFILE=irix-core.lo ;;
   mips-sgi-irix6*)	COREFILE=irix-core.lo ;;
-  mips-*-mach3*)
-	COREFILE=trad-core.lo
-	TRAD_HEADER='"hosts/mipsmach3.h"'
-	;;
   mips-*-sysv4*)	;;
   mips-*-sysv* | mips-*-riscos*)
 	COREFILE=trad-core.lo
@@ -340,6 +318,9 @@
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/m88kmach3.h"'
 	;;
+  m88*-*-openbsd*)
+	COREFILE=netbsd-core.lo
+	;;
   ns32k-pc532-mach)
 	COREFILE=trad-core.lo
 	TRAD_HEADER='"hosts/pc532mach.h"'
@@ -583,8 +564,6 @@
     aout0_big_vec)		tb="$tb aout0.lo aout32.lo" ;;
     aout_arm_big_vec)		tb="$tb aout-arm.lo aout32.lo" ;;
     aout_arm_little_vec)	tb="$tb aout-arm.lo aout32.lo" ;;
-    aout_mips_big_vec)		tb="$tb mipsbsd.lo aout32.lo" ;;
-    aout_mips_little_vec)	tb="$tb mipsbsd.lo aout32.lo" ;;
     apollocoff_vec)		tb="$tb coff-apollo.lo" ;;
     arm_epoc_pe_big_vec)	tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
     arm_epoc_pe_little_vec)	tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;;
@@ -608,12 +587,15 @@
     bfd_elf32_bigarm_oabi_vec)	tb="$tb elfarm-oabi.lo elf32.lo $elf" ;;
     bfd_elf32_bigarm_vec)	tb="$tb elfarm-nabi.lo elf32.lo $elf" ;;
     bfd_elf32_bigmips_vec) 	tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;;
+    bfd_elf32_cr16c_vec)	tb="$tb elf32-cr16c.lo elf32.lo $elf" ;;
     bfd_elf32_cris_vec)		tb="$tb elf32-cris.lo elf32.lo $elf" ;;
+    bfd_elf32_crx_vec)          tb="$tb elf32-crx.lo elf32.lo $elf" ;;    
     bfd_elf32_d10v_vec)		tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
     bfd_elf32_d30v_vec)		tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
     bfd_elf32_dlx_big_vec)	tb="$tb elf32-dlx.lo elf32.lo $elf" ;;
     bfd_elf32_fr30_vec)		tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
     bfd_elf32_frv_vec)		tb="$tb elf32-frv.lo elf32.lo $elf" ;;
+    bfd_elf32_frvfdpic_vec)	tb="$tb elf32-frv.lo elf32.lo $elf" ;;
     bfd_elf32_h8300_vec)	tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_linux_vec)	tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
     bfd_elf32_hppa_vec)		tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
@@ -668,6 +650,7 @@
     bfd_elf32_sh_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_shblin_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shl_vec)		tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
+    bfd_elf32_shl_symbian_vec)	tb="$tb elf32-sh-symbian.lo elf32-sh64-com.lo elf32.lo $elf coff-sh.lo" ;;
     bfd_elf32_shlin_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shlnbsd_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
     bfd_elf32_shnbsd_vec)	tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;;
@@ -752,6 +735,7 @@
     m68ksysvcoff_vec)		tb="$tb coff-svm68k.lo cofflink.lo" ;;
     m88kbcs_vec)		tb="$tb coff-m88k.lo" ;;
     m88kmach3_vec)		tb="$tb m88kmach3.lo aout32.lo" ;;
+    m88kopenbsd_vec)		tb="$tb m88kopenbsd.lo aout32.lo" ;;
     mach_o_be_vec)              tb="$tb mach-o.lo" ;;
     mach_o_le_vec)              tb="$tb mach-o.lo" ;;
     mach_o_fat_vec)             tb="$tb mach-o.lo" ;;
@@ -957,6 +941,6 @@
 esac
 
 rm -f doc/config.status
-AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in,
+AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in,
 [sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile])
 
diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c
index 17889f3..39367a8 100644
--- a/bfd/cpu-arm.c
+++ b/bfd/cpu-arm.c
@@ -1,5 +1,6 @@
 /* BFD support for the ARM processor
-   Copyright 1994, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1994, 1997, 1999, 2000, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -286,7 +287,7 @@
 {
   asection *     arm_arch_section;
   bfd_size_type  buffer_size;
-  char *         buffer;
+  bfd_byte *     buffer;
   char *         arch_string;
   char *         expected;
 
@@ -298,16 +299,11 @@
   if (arm_arch_section == NULL)
     return TRUE;
 
-  buffer_size = arm_arch_section->_raw_size;
+  buffer_size = arm_arch_section->size;
   if (buffer_size == 0)
     return FALSE;
 
-  buffer = bfd_malloc (buffer_size);
-  if (buffer == NULL)
-    return FALSE;
-  
-  if (! bfd_get_section_contents (abfd, arm_arch_section, buffer,
-				  (file_ptr) 0, buffer_size))
+  if (!bfd_malloc_and_get_section (abfd, arm_arch_section, &buffer))
     goto FAIL;
 
   /* Parse the note.  */
@@ -351,7 +347,8 @@
   return TRUE;
 
  FAIL:
-  free (buffer);
+  if (buffer != NULL)
+    free (buffer);
   return FALSE;
 }
 
@@ -385,7 +382,7 @@
 {
   asection *     arm_arch_section;
   bfd_size_type  buffer_size;
-  char *         buffer;
+  bfd_byte *     buffer;
   char *         arch_string;
   int            i;
 
@@ -397,16 +394,11 @@
   if (arm_arch_section == NULL)
     return bfd_mach_arm_unknown;
 
-  buffer_size = arm_arch_section->_raw_size;
+  buffer_size = arm_arch_section->size;
   if (buffer_size == 0)
     return bfd_mach_arm_unknown;
 
-  buffer = bfd_malloc (buffer_size);
-  if (buffer == NULL)
-    return bfd_mach_arm_unknown;
-  
-  if (! bfd_get_section_contents (abfd, arm_arch_section, buffer,
-				  (file_ptr) 0, buffer_size))
+  if (!bfd_malloc_and_get_section (abfd, arm_arch_section, &buffer))
     goto FAIL;
 
   /* Parse the note.  */
@@ -422,6 +414,7 @@
       }
 
  FAIL:
-  free (buffer);
+  if (buffer != NULL)
+    free (buffer);
   return bfd_mach_arm_unknown;
 }
diff --git a/bfd/cpu-cr16c.c b/bfd/cpu-cr16c.c
new file mode 100644
index 0000000..0773e08
--- /dev/null
+++ b/bfd/cpu-cr16c.c
@@ -0,0 +1,38 @@
+/* BFD support for the CR16C processor.
+   Copyright 2004 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"
+
+const bfd_arch_info_type bfd_cr16c_arch =
+  {
+    16,		/* 16 bits in a word.  */
+    32,		/* 32 bits in an address.  */
+    8,		/*  8 bits in a byte.  */
+    bfd_arch_cr16c,
+    bfd_mach_cr16c,
+    "cr16c",
+    "cr16c",
+    1,
+    TRUE, 	/* The one and only.  */
+    bfd_default_compatible, 
+    bfd_default_scan ,
+    0,
+  };
diff --git a/bfd/cpu-crx.c b/bfd/cpu-crx.c
new file mode 100644
index 0000000..9636630
--- /dev/null
+++ b/bfd/cpu-crx.c
@@ -0,0 +1,39 @@
+/* BFD support for the CRX processor.
+   Copyright 2004 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"
+
+
+const bfd_arch_info_type bfd_crx_arch =
+  {
+    16,		/* 16 bits in a word.  */
+    32,		/* 32 bits in an address.  */
+    8,		/*  8 bits in a byte.  */
+    bfd_arch_crx, /* enum bfd_architecture arch.  */
+    bfd_mach_crx,
+    "crx", 	/* Arch name.  */
+    "crx", 	/* Printable name.  */
+    1,      	/* Unsigned int section alignment power.  */
+    TRUE, 	/* The one and only.  */
+    bfd_default_compatible, 
+    bfd_default_scan ,
+    0,
+  };
diff --git a/bfd/cpu-h8300.c b/bfd/cpu-h8300.c
index 5907de0..d726dc3 100644
--- a/bfd/cpu-h8300.c
+++ b/bfd/cpu-h8300.c
@@ -96,8 +96,18 @@
 static const bfd_arch_info_type *
 compatible (const bfd_arch_info_type *in, const bfd_arch_info_type *out)
 {
+  if (in->arch != out->arch)
+    return 0;
+  if (in->mach == bfd_mach_h8300sx && out->mach == bfd_mach_h8300s)
+    return in;
+  if (in->mach == bfd_mach_h8300s && out->mach == bfd_mach_h8300sx)
+    return out;
+  if (in->mach == bfd_mach_h8300sxn && out->mach == bfd_mach_h8300sn)
+    return in;
+  if (in->mach == bfd_mach_h8300sn && out->mach == bfd_mach_h8300sxn)
+    return out;
   /* It's really not a good idea to mix and match modes.  */
-  if (in->arch != out->arch || in->mach != out->mach)
+  if (in->mach != out->mach)
     return 0;
   else
     return in;
diff --git a/bfd/cpu-m68k.c b/bfd/cpu-m68k.c
index 71c7029..c4112d3 100644
--- a/bfd/cpu-m68k.c
+++ b/bfd/cpu-m68k.c
@@ -1,6 +1,6 @@
 /* BFD library support routines for architectures.
    Copyright 1990, 1991, 1992, 1993, 1994, 1997, 1998, 2000, 2001, 2002,
-   2003 Free Software Foundation, Inc.
+   2003, 2004 Free Software Foundation, Inc.
    Hacked by Steve Chamberlain of Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -40,7 +40,12 @@
     N(bfd_mach_mcf5307, "m68k:5307",  FALSE, &arch_info_struct[10]),
     N(bfd_mach_mcf5407, "m68k:5407",  FALSE, &arch_info_struct[11]),
     N(bfd_mach_m68060,  "m68k:68060", FALSE, &arch_info_struct[12]),
-    N(bfd_mach_mcf528x, "m68k:528x",  FALSE, 0),
+    N(bfd_mach_mcf528x, "m68k:528x",  FALSE, &arch_info_struct[13]),
+    N(bfd_mach_mcf521x, "m68k:521x",  FALSE, &arch_info_struct[14]),
+    N(bfd_mach_mcf5249, "m68k:5249",  FALSE, &arch_info_struct[15]),
+    N(bfd_mach_mcf547x, "m68k:547x",  FALSE, &arch_info_struct[16]),
+    N(bfd_mach_mcf548x, "m68k:548x",  FALSE, &arch_info_struct[17]),
+    N(bfd_mach_mcfv4e,  "m68k:cfv4e", FALSE, 0),
   };
 
 const bfd_arch_info_type bfd_m68k_arch =
diff --git a/bfd/cpu-ns32k.c b/bfd/cpu-ns32k.c
index 39e5b23..0cd358d 100644
--- a/bfd/cpu-ns32k.c
+++ b/bfd/cpu-ns32k.c
@@ -1,5 +1,5 @@
 /* BFD support for the ns32k architecture.
-   Copyright 1990, 1991, 1994, 1995, 1998, 2000, 2001, 2002, 2003
+   Copyright 1990, 1991, 1994, 1995, 1998, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Almost totally rewritten by Ian Dall from initial work
    by Andrew Cagney.
@@ -191,7 +191,7 @@
     flag = bfd_reloc_undefined;
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
@@ -804,7 +804,7 @@
   bfd_vma relocation;
 
   /* Sanity check the address.  */
-  if (address > input_section->_cooked_size)
+  if (address > bfd_get_section_limit (input_bfd, input_section))
     return bfd_reloc_outofrange;
 
   /* This function assumes that we are dealing with a basic relocation
diff --git a/bfd/cpu-sh.c b/bfd/cpu-sh.c
index be359df..98d7288 100644
--- a/bfd/cpu-sh.c
+++ b/bfd/cpu-sh.c
@@ -22,20 +22,22 @@
 #include "bfd.h"
 #include "sysdep.h"
 #include "libbfd.h"
+#include "../opcodes/sh-opc.h"
 
 #define SH_NEXT      &arch_info_struct[0]
 #define SH2_NEXT     &arch_info_struct[1]
 #define SH2E_NEXT    &arch_info_struct[2]
 #define SH_DSP_NEXT  &arch_info_struct[3]
 #define SH3_NEXT     &arch_info_struct[4]
-#define SH3_DSP_NEXT &arch_info_struct[5]
-#define SH3E_NEXT    &arch_info_struct[6]
-#define SH4_NEXT     &arch_info_struct[7]
-#define SH4A_NEXT    &arch_info_struct[8]
-#define SH4AL_DSP_NEXT &arch_info_struct[9]
-#define SH4_NOFPU_NEXT &arch_info_struct[10]
-#define SH4_NOMMU_NOFPU_NEXT &arch_info_struct[11]
-#define SH4A_NOFPU_NEXT &arch_info_struct[12]
+#define SH3_NOMMU_NEXT &arch_info_struct[5]
+#define SH3_DSP_NEXT &arch_info_struct[6]
+#define SH3E_NEXT    &arch_info_struct[7]
+#define SH4_NEXT     &arch_info_struct[8]
+#define SH4A_NEXT    &arch_info_struct[9]
+#define SH4AL_DSP_NEXT &arch_info_struct[10]
+#define SH4_NOFPU_NEXT &arch_info_struct[11]
+#define SH4_NOMMU_NOFPU_NEXT &arch_info_struct[12]
+#define SH4A_NOFPU_NEXT &arch_info_struct[13]
 #define SH64_NEXT    NULL
 
 static const bfd_arch_info_type arch_info_struct[] =
@@ -101,6 +103,20 @@
     32,				/* 32 bits in an address */
     8,				/* 8 bits in a byte */
     bfd_arch_sh,
+    bfd_mach_sh3_nommu,
+    "sh",			/* arch_name  */
+    "sh3-nommu",		/* printable name */
+    1,
+    FALSE,			/* not the default */
+    bfd_default_compatible,
+    bfd_default_scan,
+    SH3_NOMMU_NEXT
+  },
+  {
+    32,				/* 32 bits in a word */
+    32,				/* 32 bits in an address */
+    8,				/* 8 bits in a byte */
+    bfd_arch_sh,
     bfd_mach_sh3_dsp,
     "sh",			/* arch_name  */
     "sh3-dsp",			/* printable name */
@@ -239,3 +255,172 @@
   bfd_default_scan,
   SH_NEXT
 };
+
+
+/* This table defines the mappings from the BFD internal numbering
+   system to the opcodes internal flags system.
+   It is used by the functions defined below.
+   The prototypes for these SH specific functions are found in
+   sh-opc.h .  */
+
+static struct { unsigned long bfd_mach, arch, arch_up; } bfd_to_arch_table[] =
+{
+  { bfd_mach_sh,              arch_sh1,             arch_sh1_up },
+  { bfd_mach_sh2,             arch_sh2,             arch_sh2_up },
+  { bfd_mach_sh2e,            arch_sh2e,            arch_sh2e_up },
+  { bfd_mach_sh_dsp,          arch_sh_dsp,          arch_sh_dsp_up },
+  { bfd_mach_sh3,             arch_sh3,             arch_sh3_up },
+  { bfd_mach_sh3_nommu,       arch_sh3_nommu,       arch_sh3_nommu_up },
+  { bfd_mach_sh3_dsp,         arch_sh3_dsp,         arch_sh3_dsp_up },
+  { bfd_mach_sh3e,            arch_sh3e,            arch_sh3e_up },
+  { bfd_mach_sh4,             arch_sh4,             arch_sh4_up },
+  { bfd_mach_sh4a,            arch_sh4a,            arch_sh4a_up },
+  { bfd_mach_sh4al_dsp,       arch_sh4al_dsp,       arch_sh4al_dsp_up },
+  { bfd_mach_sh4_nofpu,       arch_sh4_nofpu,       arch_sh4_nofp_up },
+  { bfd_mach_sh4_nommu_nofpu, arch_sh4_nommu_nofpu, arch_sh4_nommu_nofpu_up },
+  { bfd_mach_sh4a_nofpu,      arch_sh4a_nofpu,      arch_sh4a_nofp_up },
+  { 0, 0, 0 }   /* Terminator.  */
+};
+
+
+/* Convert a BFD mach number into the right opcodes arch flags
+   using the table above.  */
+
+unsigned int
+sh_get_arch_from_bfd_mach (unsigned long mach)
+{
+  int i = 0;
+  
+  while (bfd_to_arch_table[i].bfd_mach != 0)
+    if (bfd_to_arch_table[i].bfd_mach == mach)
+      return bfd_to_arch_table[i].arch;
+    else
+      i++;
+
+  /* mach not found.  */
+  BFD_FAIL();
+
+  return SH_ARCH_UNKNOWN_ARCH;
+}
+
+
+/* Convert a BFD mach number into a set of opcodes arch flags
+   describing all the compatible architectures (i.e. arch_up)
+   using the table above.  */
+
+unsigned int
+sh_get_arch_up_from_bfd_mach (unsigned long mach)
+{
+  int i = 0;
+  
+  while (bfd_to_arch_table[i].bfd_mach != 0)
+    if (bfd_to_arch_table[i].bfd_mach == mach)
+      return bfd_to_arch_table[i].arch_up;
+    else
+      i++;
+
+  /* mach not found.  */
+  BFD_FAIL();
+
+  return SH_ARCH_UNKNOWN_ARCH;
+}
+
+
+/* Convert an arbitary arch_set - not necessarily corresponding
+   directly to anything in the table above - to the most generic
+   architecture which supports all the required features, and
+   return the corresponding BFD mach.  */
+
+unsigned long
+sh_get_bfd_mach_from_arch_set (unsigned int arch_set)
+{
+  unsigned long result = 0;
+  unsigned int best = ~arch_set;
+  unsigned int co_mask = ~0;
+  int i = 0;
+
+  /* If arch_set permits variants with no coprocessor then do not allow
+     the other irrelevant co-processor bits to influence the choice:
+       e.g. if dsp is disallowed by arch_set, then the algorithm would
+       prefer fpu variants over nofpu variants because they also disallow
+       dsp - even though the nofpu would be the most correct choice.
+     This assumes that EVERY fpu/dsp variant has a no-coprocessor
+     counter-part, or their non-fpu/dsp instructions do not have the
+     no co-processor bit set.  */
+  if (arch_set & arch_sh_no_co)
+    co_mask = ~(arch_sh_sp_fpu | arch_sh_dp_fpu | arch_sh_has_dsp);
+
+  while (bfd_to_arch_table[i].bfd_mach != 0)
+    {
+      unsigned int try = bfd_to_arch_table[i].arch_up & co_mask;
+
+      /* Conceptually: Find the architecture with the least number
+	 of extra features or, if they have the same number, then
+	 the greatest number of required features.  Disregard
+         architectures where the required features alone do
+	 not describe a valid architecture.  */
+      if (((try & ~arch_set) < (best & ~arch_set)
+	   || ((try & ~arch_set) == (best & ~arch_set)
+	       && (~try & arch_set) < (~best & arch_set)))
+	  && SH_MERGE_ARCH_SET_VALID (try, arch_set))
+	{
+	  result = bfd_to_arch_table[i].bfd_mach;
+	  best = try;
+	}
+
+      i++;
+    }
+
+  /* This might happen if a new variant is added to sh-opc.h
+     but no corresponding entry is added to the table above.  */
+  BFD_ASSERT (result != 0);
+
+  return result;
+}
+
+
+/* Merge the architecture type of two BFD files, such that the
+   resultant architecture supports all the features required
+   by the two input BFDs.
+   If the input BFDs are multually incompatible - i.e. one uses
+   DSP while the other uses FPU - or there is no known architecture
+   that fits the requirements then an error is emitted.  */
+
+bfd_boolean
+sh_merge_bfd_arch (bfd *ibfd, bfd *obfd)
+{
+  unsigned int old_arch, new_arch, merged_arch;
+
+  if (! _bfd_generic_verify_endian_match (ibfd, obfd))
+    return FALSE;
+
+  old_arch = sh_get_arch_up_from_bfd_mach (bfd_get_mach (obfd));
+  new_arch = sh_get_arch_up_from_bfd_mach (bfd_get_mach (ibfd));
+
+  merged_arch = SH_MERGE_ARCH_SET (old_arch, new_arch);
+
+  if (!SH_VALID_CO_ARCH_SET (merged_arch))
+    {
+      (*_bfd_error_handler)
+	("%s: uses %s instructions while previous modules use %s instructions",
+	 bfd_archive_filename (ibfd),
+	 SH_ARCH_SET_HAS_DSP (new_arch) ? "dsp" : "floating point",
+	 SH_ARCH_SET_HAS_DSP (new_arch) ? "floating point" : "dsp");
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
+  else if (!SH_VALID_ARCH_SET (merged_arch))
+    {
+      (*_bfd_error_handler)
+	("internal error: merge of architecture '%s' with architecture '%s' produced unknown architecture\n",
+	 bfd_printable_name (obfd),
+	 bfd_printable_name (ibfd));
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
+
+  bfd_default_set_arch_mach (obfd, bfd_arch_sh,
+			     sh_get_bfd_mach_from_arch_set (merged_arch));
+  
+  return TRUE;
+}
diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog
index c2ab8aa..cc57b2b 100644
--- a/bfd/doc/ChangeLog
+++ b/bfd/doc/ChangeLog
@@ -1,3 +1,7 @@
+2004-03-27  Alan Modra  <amodra@bigpond.net.au>
+
+	* bfdint.texi: Remove all mention of elflink.h.
+
 2004-03-19  Alan Modra  <amodra@bigpond.net.au>
 
 	* Makefile.in: Regenerate.
diff --git a/bfd/doc/Makefile.in b/bfd/doc/Makefile.in
index 85d6427..4ad6c41 100644
--- a/bfd/doc/Makefile.in
+++ b/bfd/doc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
 
 # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -121,8 +121,6 @@
 bfd_libs = @bfd_libs@
 bfd_machines = @bfd_machines@
 bfd_ufile_ptr = @bfd_ufile_ptr@
-bfd_version = @bfd_version@
-bfd_version_string = @bfd_version_string@
 bfdincludedir = @bfdincludedir@
 bfdlibdir = @bfdlibdir@
 l = @l@
@@ -257,7 +255,7 @@
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = tar
+TAR = gtar
 GZIP_ENV = --best
 all: all-redirect
 .SUFFIXES:
diff --git a/bfd/doc/bfdint.texi b/bfd/doc/bfdint.texi
index cd29ae8..95c0096 100644
--- a/bfd/doc/bfdint.texi
+++ b/bfd/doc/bfdint.texi
@@ -1073,11 +1073,6 @@
 Like @file{elfcode.h}, but for functions that are specific to ELF core
 files.  This is included only by @file{elfcode.h}.
 
-@item elflink.h
-@cindex @file{elflink.h}
-Like @file{elfcode.h}, but for functions used by the ELF linker.  This
-is included only by @file{elfcode.h}.
-
 @item elfxx-target.h
 @cindex @file{elfxx-target.h}
 This file is the source for the generated files @file{elf32-target.h}
@@ -1482,8 +1477,7 @@
 @file{elfcode.h} includes functions to swap the ELF structures in and
 out of external form, as well as a few more complex functions.
 
-Linker support is found in @file{elflink.c} and @file{elflink.h}.  The
-latter file is compiled twice, for both 32 and 64 bit support.  The
+Linker support is found in @file{elflink.c}.  The
 linker support is only used if the processor specific file defines
 @samp{elf_backend_relocate_section}, which is required to relocate the
 section contents.  If that macro is not defined, the generic linker code
diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c
index 1047ebf..6fa74fc 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, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
 
 Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com).
 
@@ -285,14 +285,14 @@
       if (! msec)
 	return FALSE;
 
-      size = bfd_get_section_size_before_reloc (msec);
+      size = msec->rawsize ? msec->rawsize : msec->size;
       stash->line_section = (char *) bfd_alloc (stash->abfd, size);
 
       if (! stash->line_section)
 	return FALSE;
 
       if (! bfd_get_section_contents (stash->abfd, msec, stash->line_section,
-				      (bfd_vma) 0, size))
+				      0, size))
 	{
 	  stash->line_section = 0;
 	  return FALSE;
@@ -502,14 +502,14 @@
 	  return FALSE;
 	}
 
-      size = bfd_get_section_size_before_reloc (msec);
+      size = msec->rawsize ? msec->rawsize : msec->size;
       stash->debug_section = (char *) bfd_alloc (abfd, size);
 
       if (! stash->debug_section)
 	return FALSE;
 
       if (! bfd_get_section_contents (abfd, msec, stash->debug_section,
-				      (bfd_vma) 0, size))
+				      0, size))
 	{
 	  stash->debug_section = 0;
 	  return FALSE;
diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index ceb28af..a092657 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -281,6 +281,7 @@
     {
       asection *msec;
       bfd *abfd = unit->abfd;
+      bfd_size_type sz;
 
       msec = bfd_get_section_by_name (abfd, ".debug_str");
       if (! msec)
@@ -291,13 +292,14 @@
 	  return NULL;
 	}
 
-      stash->dwarf_str_size = msec->_raw_size;
-      stash->dwarf_str_buffer = bfd_alloc (abfd, msec->_raw_size);
+      sz = msec->rawsize ? msec->rawsize : msec->size;
+      stash->dwarf_str_size = sz;
+      stash->dwarf_str_buffer = bfd_alloc (abfd, sz);
       if (! stash->dwarf_abbrev_buffer)
 	return NULL;
 
       if (! bfd_get_section_contents (abfd, msec, stash->dwarf_str_buffer,
-				      0, msec->_raw_size))
+				      0, sz))
 	return NULL;
     }
 
@@ -443,7 +445,7 @@
 	  return 0;
 	}
 
-      stash->dwarf_abbrev_size = msec->_raw_size;
+      stash->dwarf_abbrev_size = msec->size;
       stash->dwarf_abbrev_buffer
 	= bfd_simple_get_relocated_section_contents (abfd, msec, NULL,
 						     stash->syms);
@@ -801,10 +803,9 @@
   info->column = column;
   info->end_sequence = end_sequence;
 
-  amt = strlen (filename);
-  if (amt)
+  if (filename && filename[0])
     {
-      info->filename = bfd_alloc (table->abfd, amt + 1);
+      info->filename = bfd_alloc (table->abfd, strlen (filename) + 1);
       if (info->filename)
 	strcpy (info->filename, filename);
     }
@@ -922,7 +923,7 @@
 	  return 0;
 	}
 
-      stash->dwarf_line_size = msec->_raw_size;
+      stash->dwarf_line_size = msec->size;
       stash->dwarf_line_buffer
 	= bfd_simple_get_relocated_section_contents (abfd, msec, NULL,
 						     stash->syms);
@@ -1677,7 +1678,7 @@
   return NULL;
 }
 
-/* The DWARF2 version of find_nearest line.  Return TRUE if the line
+/* 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
@@ -1745,7 +1746,7 @@
 	 In the second pass we read in the section's contents.  The allows
 	 us to avoid reallocing the data as we add sections to the stash.  */
       for (total_size = 0; msec; msec = find_debug_info (abfd, msec))
-	total_size += msec->_raw_size;
+	total_size += msec->size;
 
       stash->info_ptr = bfd_alloc (abfd, total_size);
       if (stash->info_ptr == NULL)
@@ -1760,7 +1761,7 @@
 	  bfd_size_type size;
 	  bfd_size_type start;
 
-	  size = msec->_raw_size;
+	  size = msec->size;
 	  if (size == 0)
 	    continue;
 
@@ -1834,7 +1835,7 @@
 	  stash->info_ptr += length;
 
 	  if ((bfd_vma) (stash->info_ptr - stash->sec_info_ptr)
-	      == stash->sec->_raw_size)
+	      == stash->sec->size)
 	    {
 	      stash->sec = find_debug_info (abfd, stash->sec);
 	      stash->sec_info_ptr = stash->info_ptr;
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index cfc5ae1..40faea7 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -1,6 +1,6 @@
 /* Generic ECOFF (Extended-COFF) routines.
    Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+   2002, 2003, 2004 Free Software Foundation, Inc.
    Original version by Per Bothner.
    Full support added by Ian Lance Taylor, ian@cygnus.com.
 
@@ -74,21 +74,18 @@
   PARAMS ((const char *, unsigned int *, unsigned int, unsigned int));
 
 /* This stuff is somewhat copied from coffcode.h.  */
-
 static asection bfd_debug_section =
 {
-  /* name,   id,  index, next, flags, user_set_vma, reloc_done,    */
-  "*DEBUG*", 0,   0,     NULL, 0,     0,            0,
+  /* name,      id,  index, next, flags, user_set_vma,             */
+     "*DEBUG*", 0,   0,     NULL, 0,     0,
   /* linker_mark, linker_has_input, gc_mark, segment_mark,         */
      0,           0,                0,       0,
-  /* sec_info_type, use_rela_p, has_tls_reloc,                     */
-     0,		    0,		0,
-  /* need_finalize_relax, has_gp_reloc,                            */
+  /* sec_info_type, use_rela_p, has_tls_reloc, has_gp_reloc,       */
+     0,		    0,		0,	       0,
+  /* need_finalize_relax, reloc_done,                              */
      0,			  0,
-  /* flag13, flag14, flag15, flag16, flag20, flag24,               */
-     0,      0,      0,      0,      0,	     0,
-  /* vma, lma, _cooked_size, _raw_size,                            */
-     0,   0,   0,            0,
+  /* vma, lma, size, rawsize,                                      */
+     0,   0,   0,    0,
   /* output_offset, output_section, alignment_power,               */
      0,             NULL,           0,
   /* relocation, orelocation, reloc_count, filepos, rel_filepos,   */
@@ -908,7 +905,7 @@
 	      return FALSE;
 	    reloc_chain->relent.sym_ptr_ptr =
 	      bfd_get_section (asym)->symbol_ptr_ptr;
-	    reloc_chain->relent.address = section->_raw_size;
+	    reloc_chain->relent.address = section->size;
 	    reloc_chain->relent.addend = asym->value;
 	    reloc_chain->relent.howto =
 	      ecoff_backend (abfd)->constructor_reloc;
@@ -928,7 +925,7 @@
 
 	    reloc_chain->next = section->constructor_chain;
 	    section->constructor_chain = reloc_chain;
-	    section->_raw_size += bitsize / 8;
+	    section->size += bitsize / 8;
 
 #endif /* 0 */
 
@@ -2118,7 +2115,7 @@
 	 really in the section.  Each entry is 8 bytes.  We store this
 	 away in line_filepos before increasing the section size.  */
       if (strcmp (current->name, _PDATA) == 0)
-	current->line_filepos = current->_raw_size / 8;
+	current->line_filepos = current->size / 8;
 
       alignment_power = current->alignment_power;
 
@@ -2179,16 +2176,16 @@
       if ((current->flags & (SEC_HAS_CONTENTS | SEC_LOAD)) != 0)
 	current->filepos = file_sofar;
 
-      sofar += current->_raw_size;
+      sofar += current->size;
       if ((current->flags & SEC_HAS_CONTENTS) != 0)
-	file_sofar += current->_raw_size;
+	file_sofar += current->size;
 
       /* Make sure that this section is of the right size too.  */
       old_sofar = sofar;
       sofar = BFD_ALIGN (sofar, 1 << alignment_power);
       if ((current->flags & SEC_HAS_CONTENTS) != 0)
 	file_sofar = BFD_ALIGN (file_sofar, 1 << alignment_power);
-      current->_raw_size += sofar - old_sofar;
+      current->size += sofar - old_sofar;
     }
 
   free (sorted_hdrs);
@@ -2550,7 +2547,7 @@
 	section.s_vaddr = vma;
 
       section.s_paddr = current->lma;
-      section.s_size = bfd_get_section_size_before_reloc (current);
+      section.s_size = current->size;
 
       /* If this section is unloadable then the scnptr will be 0.  */
       if ((current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
@@ -2601,7 +2598,7 @@
 	  || (section.s_flags & STYP_ECOFF_FINI) != 0
 	  || section.s_flags == STYP_RCONST)
 	{
-	  text_size += bfd_get_section_size_before_reloc (current);
+	  text_size += current->size;
 	  if (! set_text_start || text_start > vma)
 	    {
 	      text_start = vma;
@@ -2617,7 +2614,7 @@
 	       || section.s_flags == STYP_XDATA
 	       || (section.s_flags & STYP_GOT) != 0)
 	{
-	  data_size += bfd_get_section_size_before_reloc (current);
+	  data_size += current->size;
 	  if (! set_data_start || data_start > vma)
 	    {
 	      data_start = vma;
@@ -2626,7 +2623,7 @@
 	}
       else if ((section.s_flags & STYP_BSS) != 0
 	       || (section.s_flags & STYP_SBSS) != 0)
-	bss_size += bfd_get_section_size_before_reloc (current);
+	bss_size += current->size;
       else if (section.s_flags == 0
 	       || (section.s_flags & STYP_ECOFF_LIB) != 0
 	       || section.s_flags == STYP_COMMENT)
@@ -4526,14 +4523,10 @@
 {
   asection *input_section;
   bfd *input_bfd;
-  struct ecoff_section_tdata *section_tdata;
-  bfd_size_type raw_size;
-  bfd_size_type cooked_size;
   bfd_byte *contents = NULL;
   bfd_size_type external_reloc_size;
   bfd_size_type external_relocs_size;
   PTR external_relocs = NULL;
-  bfd_size_type amt;
 
   BFD_ASSERT ((output_section->flags & SEC_HAS_CONTENTS) != 0);
 
@@ -4542,57 +4535,28 @@
 
   input_section = link_order->u.indirect.section;
   input_bfd = input_section->owner;
-  section_tdata = ecoff_section_data (input_bfd, input_section);
-
-  raw_size = input_section->_raw_size;
-  cooked_size = input_section->_cooked_size;
-  if (cooked_size == 0)
-    cooked_size = raw_size;
 
   BFD_ASSERT (input_section->output_section == output_section);
   BFD_ASSERT (input_section->output_offset == link_order->offset);
-  BFD_ASSERT (cooked_size == link_order->size);
+  BFD_ASSERT (input_section->size == link_order->size);
 
-  /* Get the section contents.  We allocate memory for the larger of
-     the size before relocating and the size after relocating.  */
-  amt = raw_size >= cooked_size ? raw_size : cooked_size;
-  contents = (bfd_byte *) bfd_malloc (amt);
-  if (contents == NULL && amt != 0)
+  /* Get the section contents.  */
+  if (!bfd_malloc_and_get_section (input_bfd, input_section, &contents))
     goto error_return;
 
-  /* If we are relaxing, the contents may have already been read into
-     memory, in which case we copy them into our new buffer.  We don't
-     simply reuse the old buffer in case cooked_size > raw_size.  */
-  if (section_tdata != (struct ecoff_section_tdata *) NULL
-      && section_tdata->contents != (bfd_byte *) NULL)
-    memcpy (contents, section_tdata->contents, (size_t) raw_size);
-  else
-    {
-      if (! bfd_get_section_contents (input_bfd, input_section,
-				      (PTR) contents,
-				      (file_ptr) 0, raw_size))
-	goto error_return;
-    }
-
   /* Get the relocs.  If we are relaxing MIPS code, they will already
      have been read in.  Otherwise, we read them in now.  */
   external_reloc_size = ecoff_backend (input_bfd)->external_reloc_size;
   external_relocs_size = external_reloc_size * input_section->reloc_count;
 
-  if (section_tdata != (struct ecoff_section_tdata *) NULL
-      && section_tdata->external_relocs != NULL)
-    external_relocs = section_tdata->external_relocs;
-  else
-    {
-      external_relocs = (PTR) bfd_malloc (external_relocs_size);
-      if (external_relocs == NULL && external_relocs_size != 0)
-	goto error_return;
+  external_relocs = (PTR) bfd_malloc (external_relocs_size);
+  if (external_relocs == NULL && external_relocs_size != 0)
+    goto error_return;
 
-      if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
-	  || (bfd_bread (external_relocs, external_relocs_size, input_bfd)
-	      != external_relocs_size))
-	goto error_return;
-    }
+  if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
+      || (bfd_bread (external_relocs, external_relocs_size, input_bfd)
+	  != external_relocs_size))
+    goto error_return;
 
   /* Relocate the section contents.  */
   if (! ((*ecoff_backend (input_bfd)->relocate_section)
@@ -4603,9 +4567,9 @@
   /* Write out the relocated section.  */
   if (! bfd_set_section_contents (output_bfd,
 				  output_section,
-				  (PTR) contents,
-				  (file_ptr) input_section->output_offset,
-				  cooked_size))
+				  contents,
+				  input_section->output_offset,
+				  input_section->size))
     goto error_return;
 
   /* If we are producing relocatable output, the relocs were
@@ -4625,14 +4589,14 @@
 
   if (contents != NULL)
     free (contents);
-  if (external_relocs != NULL && section_tdata == NULL)
+  if (external_relocs != NULL)
     free (external_relocs);
   return TRUE;
 
  error_return:
   if (contents != NULL)
     free (contents);
-  if (external_relocs != NULL && section_tdata == NULL)
+  if (external_relocs != NULL)
     free (external_relocs);
   return FALSE;
 }
diff --git a/bfd/ecofflink.c b/bfd/ecofflink.c
index 9e23848..9abf9d1 100644
--- a/bfd/ecofflink.c
+++ b/bfd/ecofflink.c
@@ -800,20 +800,6 @@
 
       fdr_adr = fdr.adr;
 
-      /* Adjust the FDR address for any changes that may have been
-	 made by relaxing.  */
-      if (input_debug->adjust != (struct ecoff_value_adjust *) NULL)
-	{
-	  struct ecoff_value_adjust *adjust;
-
-	  for (adjust = input_debug->adjust;
-	       adjust != (struct ecoff_value_adjust *) NULL;
-	       adjust = adjust->next)
-	    if (fdr_adr >= adjust->start
-		&& fdr_adr < adjust->end)
-	      fdr.adr += adjust->adjust;
-	}
-
       /* FIXME: It is conceivable that this FDR points to the .init or
 	 .fini section, in which case this will not do the right
 	 thing.  */
@@ -856,19 +842,6 @@
 	    case stLabel:
 	    case stProc:
 	    case stStaticProc:
-	      if (input_debug->adjust != (struct ecoff_value_adjust *) NULL)
-		{
-		  bfd_vma value;
-		  struct ecoff_value_adjust *adjust;
-
-		  value = internal_sym.value;
-		  for (adjust = input_debug->adjust;
-		       adjust != (struct ecoff_value_adjust *) NULL;
-		       adjust = adjust->next)
-		    if (value >= adjust->start
-			&& value < adjust->end)
-		      internal_sym.value += adjust->adjust;
-		}
 	      internal_sym.value += section_adjust[internal_sym.sc];
 	      break;
 
@@ -978,9 +951,8 @@
 	  output_symhdr->issMax += fdr.cbSs;
 	}
 
-      if ((output_bfd->xvec->header_byteorder
-	   == input_bfd->xvec->header_byteorder)
-	  && input_debug->adjust == (struct ecoff_value_adjust *) NULL)
+      if (output_bfd->xvec->header_byteorder
+	  == input_bfd->xvec->header_byteorder)
 	{
 	  /* The two BFD's have the same endianness, and we don't have
 	     to adjust the PDR addresses, so simply copying the
@@ -1036,23 +1008,6 @@
 	      PDR pdr;
 
 	      (*input_swap->swap_pdr_in) (input_bfd, (PTR) in, &pdr);
-
-	      /* If we have been relaxing, we may have to adjust the
-		 address.  */
-	      if (input_debug->adjust != (struct ecoff_value_adjust *) NULL)
-		{
-		  bfd_vma adr;
-		  struct ecoff_value_adjust *adjust;
-
-		  adr = fdr_adr + pdr.adr;
-		  for (adjust = input_debug->adjust;
-		       adjust != (struct ecoff_value_adjust *) NULL;
-		       adjust = adjust->next)
-		    if (adr >= adjust->start
-			&& adr < adjust->end)
-		      pdr.adr += adjust->adjust;
-		}
-
 	      (*output_swap->swap_pdr_out) (output_bfd, &pdr, (PTR) out);
 	    }
 
diff --git a/bfd/ecoffswap.h b/bfd/ecoffswap.h
index 7ea0394..0e77052 100644
--- a/bfd/ecoffswap.h
+++ b/bfd/ecoffswap.h
@@ -324,8 +324,6 @@
 #endif
 }
 
-#ifndef MPW_C
-
 /* Swap in the procedure descriptor record.  */
 
 static void
@@ -454,78 +452,6 @@
 #endif
 }
 
-#else /* MPW_C */
-/* Same routines, but with ECOFF_64 code removed, so ^&%$#&! MPW C doesn't
-   corrupt itself and then freak out.  */
-/* Swap in the procedure descriptor record.  */
-
-static void
-ecoff_swap_pdr_in (abfd, ext_copy, intern)
-     bfd *abfd;
-     PTR ext_copy;
-     PDR *intern;
-{
-  struct pdr_ext ext[1];
-
-  *ext = *(struct pdr_ext *) ext_copy;
-
-  intern->adr           = ECOFF_GET_OFF (abfd, ext->p_adr);
-  intern->isym          = H_GET_32 (abfd, ext->p_isym);
-  intern->iline         = H_GET_32 (abfd, ext->p_iline);
-  intern->regmask       = H_GET_32 (abfd, ext->p_regmask);
-  intern->regoffset     = H_GET_S32 (abfd, ext->p_regoffset);
-  intern->iopt          = H_GET_S32 (abfd, ext->p_iopt);
-  intern->fregmask      = H_GET_32 (abfd, ext->p_fregmask);
-  intern->fregoffset    = H_GET_S32 (abfd, ext->p_fregoffset);
-  intern->frameoffset   = H_GET_S32 (abfd, ext->p_frameoffset);
-  intern->framereg      = H_GET_16 (abfd, ext->p_framereg);
-  intern->pcreg         = H_GET_16 (abfd, ext->p_pcreg);
-  intern->lnLow         = H_GET_32 (abfd, ext->p_lnLow);
-  intern->lnHigh        = H_GET_32 (abfd, ext->p_lnHigh);
-  intern->cbLineOffset  = ECOFF_GET_OFF (abfd, ext->p_cbLineOffset);
-
-#ifdef TEST
-  if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
-    abort ();
-#endif
-}
-
-/* Swap out the procedure descriptor record.  */
-
-static void
-ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr)
-     bfd *abfd;
-     const PDR *intern_copy;
-     PTR ext_ptr;
-{
-  struct pdr_ext *ext = (struct pdr_ext *) ext_ptr;
-  PDR intern[1];
-
-  /* Make it reasonable to do in-place.  */
-  *intern = *intern_copy;
-
-  ECOFF_PUT_OFF (abfd, intern->adr,          ext->p_adr);
-  H_PUT_32      (abfd, intern->isym,         ext->p_isym);
-  H_PUT_32      (abfd, intern->iline,        ext->p_iline);
-  H_PUT_32      (abfd, intern->regmask,      ext->p_regmask);
-  H_PUT_32      (abfd, intern->regoffset,    ext->p_regoffset);
-  H_PUT_32      (abfd, intern->iopt,         ext->p_iopt);
-  H_PUT_32      (abfd, intern->fregmask,     ext->p_fregmask);
-  H_PUT_32      (abfd, intern->fregoffset,   ext->p_fregoffset);
-  H_PUT_32      (abfd, intern->frameoffset,  ext->p_frameoffset);
-  H_PUT_16      (abfd, intern->framereg,     ext->p_framereg);
-  H_PUT_16      (abfd, intern->pcreg,        ext->p_pcreg);
-  H_PUT_32      (abfd, intern->lnLow,        ext->p_lnLow);
-  H_PUT_32      (abfd, intern->lnHigh,       ext->p_lnHigh);
-  ECOFF_PUT_OFF (abfd, intern->cbLineOffset, ext->p_cbLineOffset);
-
-#ifdef TEST
-  if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0)
-    abort ();
-#endif
-}
-#endif /* MPW_C */
-
 /* Swap in a symbol record.  */
 
 static void
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index cd51e32..94a847d 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -278,11 +278,11 @@
   unsigned char fde_encoding;
   unsigned char lsda_encoding;
   unsigned char lsda_offset;
-  unsigned char cie : 1;
-  unsigned char removed : 1;
-  unsigned char make_relative : 1;
-  unsigned char make_lsda_relative : 1;
-  unsigned char per_encoding_relative : 1;
+  unsigned int cie : 1;
+  unsigned int removed : 1;
+  unsigned int make_relative : 1;
+  unsigned int make_lsda_relative : 1;
+  unsigned int per_encoding_relative : 1;
 };
 
 struct eh_frame_sec_info
@@ -356,12 +356,12 @@
   /* The _GLOBAL_OFFSET_TABLE_ symbol.  */
   struct elf_link_hash_entry *hgot;
 
-  /* A pointer to information used to link stabs in sections.  */
-  void *stab_info;
-
   /* A pointer to information used to merge SEC_MERGE sections.  */
   void *merge_info;
 
+  /* Used to link stabs in sections.  */
+  struct stab_info stab_info;
+
   /* Used by eh_frame code when editing .eh_frame.  */
   struct eh_frame_hdr_info eh_info;
 
@@ -492,6 +492,7 @@
   size_t locsymcount;
   size_t extsymoff;
   struct elf_link_hash_entry **sym_hashes;
+  int r_sym_shift;
   bfd_boolean bad_symtab;
 };
 
@@ -596,7 +597,7 @@
   /* A function to convert machine dependent section header flags to
      BFD internal section header flags.  */
   bfd_boolean (*elf_backend_section_flags)
-    (flagword *, Elf_Internal_Shdr *);
+    (flagword *, const Elf_Internal_Shdr *);
 
   /* A function to handle unusual program segment types when creating BFD
      sections from ELF program segments.  */
@@ -625,7 +626,7 @@
      indices, and must set at least *FLAGS and *SEC for each processor
      dependent case; failure to do so will cause a link error.  */
   bfd_boolean (*elf_add_symbol_hook)
-    (bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *,
+    (bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *,
      const char **name, flagword *flags, asection **sec, bfd_vma *value);
 
   /* If this field is not NULL, it is called by the elf_link_output_sym
@@ -645,6 +646,11 @@
   bfd_boolean (*elf_backend_create_dynamic_sections)
     (bfd *abfd, struct bfd_link_info *info);
 
+  /* When creating a shared library, determine whether to omit the
+     dynamic symbol for the section.  */
+  bfd_boolean (*elf_backend_omit_section_dynsym)
+    (bfd *output_bfd, struct bfd_link_info *info, asection *osec);
+
   /* The CHECK_RELOCS function is called by the add_symbols phase of
      the ELF backend linker.  It is called once for each section with
      relocs of an object file, just after the symbols for the object
@@ -659,6 +665,13 @@
     (bfd *abfd, struct bfd_link_info *info, asection *o,
      const Elf_Internal_Rela *relocs);
 
+  /* The CHECK_DIRECTIVES function is called once per input file by
+     the add_symbols phase of the ELF backend linker.  The function
+     must inspect the bfd and create any additional symbols according
+     to any custom directives in the bfd.  */
+  bfd_boolean (*check_directives)
+    (bfd *abfd, struct bfd_link_info *info);
+
   /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend
      linker for every symbol which is defined by a dynamic object and
      referenced by a regular object.  This is called after all the
@@ -901,6 +914,13 @@
      (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
       int (*target_read_memory) (bfd_vma vma, char *myaddr, int len));
 
+  /* This function is used by `_bfd_elf_get_synthetic_symtab';
+     see elf.c.  */
+  bfd_vma (*plt_sym_val) (bfd_vma, const asection *, const arelent *);
+
+  /* Name of the PLT relocation section.  */
+  const char *relplt_name;
+
   /* Alternate EM_xxxx machine codes for this backend.  */
   int elf_machine_alt1;
   int elf_machine_alt2;
@@ -1054,8 +1074,8 @@
 #define elf_discarded_section(sec)				\
   (!bfd_is_abs_section (sec)					\
    && bfd_is_abs_section ((sec)->output_section)		\
-   && sec->sec_info_type != ELF_INFO_TYPE_MERGE			\
-   && sec->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
+   && (sec)->sec_info_type != ELF_INFO_TYPE_MERGE		\
+   && (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS)
 
 #define get_elf_backend_data(abfd) \
   ((const struct elf_backend_data *) (abfd)->xvec->backend_data)
@@ -1203,6 +1223,9 @@
   /* Segment flags for the PT_GNU_STACK segment.  */
   unsigned int stack_flags;  
 
+  /* Should the PT_GNU_RELRO segment be emitted?  */
+  bfd_boolean relro;
+
   /* Symbol version definitions in external objects.  */
   Elf_Internal_Verdef *verdef;
 
@@ -1308,9 +1331,6 @@
   bfd_elf_string_from_elf_section (abfd, elf_elfheader(abfd)->e_shstrndx, \
 				   strindex)
 
-#define bfd_elf32_print_symbol	bfd_elf_print_symbol
-#define bfd_elf64_print_symbol	bfd_elf_print_symbol
-
 extern void _bfd_elf_sprintf_vma
   (bfd *, char *, bfd_vma);
 extern void _bfd_elf_fprintf_vma
@@ -1363,12 +1383,16 @@
   (bfd *);
 extern bfd_boolean _bfd_elf_merge_sections
   (bfd *, struct bfd_link_info *);
+extern bfd_boolean bfd_elf_is_group_section
+  (bfd *, const struct bfd_section *);
 extern bfd_boolean bfd_elf_discard_group
   (bfd *, struct bfd_section *);
 extern void bfd_elf_set_group_contents
   (bfd *, asection *, void *);
 extern void _bfd_elf_link_just_syms
   (asection *, struct bfd_link_info *);
+extern bfd_boolean _bfd_elf_copy_private_header_data
+  (bfd *, bfd *);
 extern bfd_boolean _bfd_elf_copy_private_symbol_data
   (bfd *, asymbol *, bfd *, asymbol *);
 extern bfd_boolean _bfd_elf_copy_private_section_data
@@ -1387,6 +1411,8 @@
   (bfd *);
 extern long _bfd_elf_canonicalize_dynamic_symtab
   (bfd *, asymbol **);
+extern long _bfd_elf_get_synthetic_symtab
+  (bfd *, asymbol **, asymbol **);
 extern long _bfd_elf_get_reloc_upper_bound
   (bfd *, sec_ptr);
 extern long _bfd_elf_canonicalize_reloc
@@ -1492,8 +1518,6 @@
 extern bfd_boolean _bfd_elf_link_assign_sym_version
   (struct elf_link_hash_entry *, void *);
 
-extern bfd_boolean _bfd_elf_link_record_dynamic_symbol
-  (struct bfd_link_info *, struct elf_link_hash_entry *);
 extern long _bfd_elf_link_lookup_local_dynindx
   (struct bfd_link_info *, bfd *, long);
 extern bfd_boolean _bfd_elf_compute_section_file_positions
@@ -1508,6 +1532,8 @@
 
 extern bfd_boolean _bfd_elf_link_create_dynamic_sections
   (bfd *, struct bfd_link_info *);
+extern bfd_boolean _bfd_elf_link_omit_section_dynsym
+  (bfd *, struct bfd_link_info *, asection *);
 extern bfd_boolean _bfd_elf_create_dynamic_sections
   (bfd *, struct bfd_link_info *);
 extern bfd_boolean _bfd_elf_create_got_section
@@ -1544,9 +1570,6 @@
 extern bfd_boolean _bfd_elf_symbol_refs_local_p
   (struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean);
 
-extern bfd_boolean _bfd_elf_link_add_archive_symbols
-  (bfd *, struct bfd_link_info *);
-
 extern const bfd_target *bfd_elf32_object_p
   (bfd *);
 extern const bfd_target *bfd_elf32_core_file_p
@@ -1558,11 +1581,6 @@
 extern bfd_boolean bfd_elf32_core_file_matches_executable_p
   (bfd *, bfd *);
 
-extern bfd_boolean bfd_elf32_bfd_link_add_symbols
-  (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf32_bfd_final_link
-  (bfd *, struct bfd_link_info *);
-
 extern void bfd_elf32_swap_symbol_in
   (bfd *, const void *, const void *, Elf_Internal_Sym *);
 extern void bfd_elf32_swap_symbol_out
@@ -1593,8 +1611,6 @@
   (bfd *, asection *, void *);
 extern bfd_boolean bfd_elf32_slurp_reloc_table
   (bfd *, asection *, asymbol **, bfd_boolean);
-extern bfd_boolean bfd_elf32_add_dynamic_entry
-  (struct bfd_link_info *, bfd_vma, bfd_vma);
 
 extern const bfd_target *bfd_elf64_object_p
   (bfd *);
@@ -1606,10 +1622,6 @@
   (bfd *);
 extern bfd_boolean bfd_elf64_core_file_matches_executable_p
   (bfd *, bfd *);
-extern bfd_boolean bfd_elf64_bfd_link_add_symbols
-  (bfd *, struct bfd_link_info *);
-extern bfd_boolean bfd_elf64_bfd_final_link
-  (bfd *, struct bfd_link_info *);
 
 extern void bfd_elf64_swap_symbol_in
   (bfd *, const void *, const void *, Elf_Internal_Sym *);
@@ -1641,20 +1653,17 @@
   (bfd *, asection *, void *);
 extern bfd_boolean bfd_elf64_slurp_reloc_table
   (bfd *, asection *, asymbol **, bfd_boolean);
-extern bfd_boolean bfd_elf64_add_dynamic_entry
+
+extern bfd_boolean bfd_elf_link_add_symbols
+  (bfd *, struct bfd_link_info *);
+extern bfd_boolean _bfd_elf_add_dynamic_entry
   (struct bfd_link_info *, bfd_vma, bfd_vma);
 
-#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
+extern bfd_boolean bfd_elf_link_record_dynamic_symbol
+  (struct bfd_link_info *, struct elf_link_hash_entry *);
 
-extern int elf_link_record_local_dynamic_symbol
+extern int bfd_elf_link_record_local_dynamic_symbol
   (struct bfd_link_info *, bfd *, long);
-#define _bfd_elf32_link_record_local_dynamic_symbol \
-  elf_link_record_local_dynamic_symbol
-#define _bfd_elf64_link_record_local_dynamic_symbol \
-  elf_link_record_local_dynamic_symbol
 
 extern bfd_boolean _bfd_elf_close_and_cleanup
   (bfd *);
@@ -1662,31 +1671,25 @@
   (bfd *, arelent *, struct bfd_symbol *, void *,
    asection *, bfd *, char **);
 
-extern bfd_boolean _bfd_elf32_gc_sections
+extern bfd_boolean bfd_elf_final_link
   (bfd *, struct bfd_link_info *);
-extern bfd_boolean _bfd_elf32_gc_common_finalize_got_offsets
+
+extern bfd_boolean bfd_elf_gc_sections
   (bfd *, struct bfd_link_info *);
-extern bfd_boolean _bfd_elf32_gc_common_final_link
-  (bfd *, struct bfd_link_info *);
-extern bfd_boolean _bfd_elf32_gc_record_vtinherit
-  (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
-extern bfd_boolean _bfd_elf32_gc_record_vtentry
+
+extern bfd_boolean bfd_elf_gc_record_vtinherit
   (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
 
-extern bfd_boolean _bfd_elf64_gc_sections
-  (bfd *, struct bfd_link_info *);
-extern bfd_boolean _bfd_elf64_gc_common_finalize_got_offsets
-  (bfd *, struct bfd_link_info *);
-extern bfd_boolean _bfd_elf64_gc_common_final_link
-  (bfd *, struct bfd_link_info *);
-extern bfd_boolean _bfd_elf64_gc_record_vtinherit
-  (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
-extern bfd_boolean _bfd_elf64_gc_record_vtentry
+extern bfd_boolean bfd_elf_gc_record_vtentry
   (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma);
 
-extern bfd_boolean _bfd_elf32_reloc_symbol_deleted_p
-  (bfd_vma, void *);
-extern bfd_boolean _bfd_elf64_reloc_symbol_deleted_p
+extern bfd_boolean bfd_elf_gc_common_finalize_got_offsets
+  (bfd *, struct bfd_link_info *);
+
+extern bfd_boolean bfd_elf_gc_common_final_link
+  (bfd *, struct bfd_link_info *);
+
+extern bfd_boolean bfd_elf_reloc_symbol_deleted_p
   (bfd_vma, void *);
 
 /* Exported interface for writing elf corefile notes. */
@@ -1717,6 +1720,16 @@
 extern bfd_boolean _sh_elf_set_mach_from_flags
   (bfd *);
 
+/* This is the condition under which finish_dynamic_symbol will be called.
+   If our finish_dynamic_symbol isn't called, we'll need to do something
+   about initializing any .plt and .got entries in relocate_section.  */
+#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
+  ((DYN)								\
+   && ((SHARED)								\
+       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
+   && ((H)->dynindx != -1						\
+       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
+
 /* This macro is to avoid lots of duplicated code in the body
    of xxx_relocate_section() in the various elfxx-xxxx.c files.  */
 #define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel,	\
@@ -1762,12 +1775,14 @@
 	;								\
       else								\
 	{								\
-	  if (! info->callbacks->undefined_symbol			\
-	      (info, h->root.root.string, input_bfd,			\
-	       input_section, rel->r_offset,				\
-	       (info->unresolved_syms_in_objects == RM_GENERATE_ERROR	\
-		|| ELF_ST_VISIBILITY (h->other))			\
-	       ))							\
+	  bfd_boolean err;						\
+	  err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR	\
+		 || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT);	\
+	  if (!info->callbacks->undefined_symbol (info,			\
+						  h->root.root.string,	\
+						  input_bfd,		\
+						  input_section,	\
+						  rel->r_offset, err))	\
 	    return FALSE;						\
 	  warned = TRUE;						\
 	}								\
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index d3777b4..be4e307 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -1,5 +1,5 @@
 /* .eh_frame section optimization.
-   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Written by Jakub Jelinek <jakub@redhat.com>.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -224,7 +224,7 @@
   bfd_size_type new_size;
   unsigned int ptr_size;
 
-  if (sec->_raw_size == 0)
+  if (sec->size == 0)
     {
       /* This file does not contain .eh_frame information.  */
       return FALSE;
@@ -243,14 +243,10 @@
 
   /* Read the frame unwind information from abfd.  */
 
-  ehbuf = bfd_malloc (sec->_raw_size);
-  if (ehbuf == NULL)
+  if (!bfd_malloc_and_get_section (abfd, sec, &ehbuf))
     goto free_no_table;
 
-  if (! bfd_get_section_contents (abfd, sec, ehbuf, 0, sec->_raw_size))
-    goto free_no_table;
-
-  if (sec->_raw_size >= 4
+  if (sec->size >= 4
       && bfd_get_32 (abfd, ehbuf) == 0
       && cookie->rel == cookie->relend)
     {
@@ -261,7 +257,7 @@
 
   /* If .eh_frame section size doesn't fit into int, we cannot handle
      it (it would need to use 64-bit .eh_frame format anyway).  */
-  if (sec->_raw_size != (unsigned int) sec->_raw_size)
+  if (sec->size != (unsigned int) sec->size)
     goto free_no_table;
 
   ptr_size = (elf_elfheader (abfd)->e_ident[EI_CLASS]
@@ -271,13 +267,14 @@
   last_cie_ndx = 0;
   memset (&cie, 0, sizeof (cie));
   cie_usage_count = 0;
-  new_size = sec->_raw_size;
+  new_size = sec->size;
   make_relative = hdr_info->last_cie.make_relative;
   make_lsda_relative = hdr_info->last_cie.make_lsda_relative;
   sec_info = bfd_zmalloc (sizeof (struct eh_frame_sec_info)
 			  + 99 * sizeof (struct eh_cie_fde));
   if (sec_info == NULL)
     goto free_no_table;
+
   sec_info->alloced = 100;
 
 #define ENSURE_NO_RELOCS(buf)				\
@@ -320,11 +317,11 @@
       last_fde = buf;
       /* If we are at the end of the section, we still need to decide
 	 on whether to output or discard last encountered CIE (if any).  */
-      if ((bfd_size_type) (buf - ehbuf) == sec->_raw_size)
+      if ((bfd_size_type) (buf - ehbuf) == sec->size)
 	hdr.id = (unsigned int) -1;
       else
 	{
-	  if ((bfd_size_type) (buf + 4 - ehbuf) > sec->_raw_size)
+	  if ((bfd_size_type) (buf + 4 - ehbuf) > sec->size)
 	    /* No space for CIE/FDE header length.  */
 	    goto free_no_table;
 
@@ -333,7 +330,7 @@
 	    /* 64-bit .eh_frame is not supported.  */
 	    goto free_no_table;
 	  buf += 4;
-	  if ((bfd_size_type) (buf - ehbuf) + hdr.length > sec->_raw_size)
+	  if ((bfd_size_type) (buf - ehbuf) + hdr.length > sec->size)
 	    /* CIE/FDE not contained fully in this .eh_frame input section.  */
 	    goto free_no_table;
 
@@ -343,7 +340,7 @@
 	  if (hdr.length == 0)
 	    {
 	      /* CIE with length 0 must be only the last in the section.  */
-	      if ((bfd_size_type) (buf - ehbuf) < sec->_raw_size)
+	      if ((bfd_size_type) (buf - ehbuf) < sec->size)
 		goto free_no_table;
 	      ENSURE_NO_RELOCS (buf);
 	      sec_info->count++;
@@ -410,7 +407,7 @@
 	  cie.version = *buf++;
 
 	  /* Cannot handle unknown versions.  */
-	  if (cie.version != 1)
+	  if (cie.version != 1 && cie.version != 3)
 	    goto free_no_table;
 	  if (strlen (buf) > sizeof (cie.augmentation) - 1)
 	    goto free_no_table;
@@ -429,12 +426,10 @@
 	    }
 	  read_uleb128 (cie.code_align, buf);
 	  read_sleb128 (cie.data_align, buf);
-	  /* Note - in DWARF2 the return address column is an unsigned byte.
-	     In DWARF3 it is a ULEB128.  We are following DWARF3.  For most
-	     ports this will not matter as the value will be less than 128.
-	     For the others (eg FRV, SH, MMIX, IA64) they need a fixed GCC
-	     which conforms to the DWARF3 standard.  */
-	  read_uleb128 (cie.ra_column, buf);
+	  if (cie.version == 1)
+	    cie.ra_column = *buf++;
+	  else
+	    read_uleb128 (cie.ra_column, buf);
 	  ENSURE_NO_RELOCS (buf);
 	  cie.lsda_encoding = DW_EH_PE_omit;
 	  cie.fde_encoding = DW_EH_PE_omit;
@@ -642,18 +637,14 @@
       hdr_info->last_cie_offset = sec_info->entry[last_cie_ndx].new_offset;
     }
 
-  /* FIXME: Currently it is not possible to shrink sections to zero size at
-     this point, so build a fake minimal CIE.  */
-  if (new_size == 0)
-    new_size = 16;
-
   /* Shrink the sec as needed.  */
-  sec->_cooked_size = new_size;
-  if (sec->_cooked_size == 0)
+  sec->rawsize = sec->size;
+  sec->size = new_size;
+  if (sec->size == 0)
     sec->flags |= SEC_EXCLUDE;
 
   free (ehbuf);
-  return new_size != sec->_raw_size;
+  return new_size != sec->rawsize;
 
 free_no_table:
   if (ehbuf)
@@ -682,9 +673,9 @@
   if (sec == NULL)
     return FALSE;
 
-  sec->_cooked_size = EH_FRAME_HDR_SIZE;
+  sec->size = EH_FRAME_HDR_SIZE;
   if (hdr_info->table)
-    sec->_cooked_size += 4 + hdr_info->fde_count * 8;
+    sec->size += 4 + hdr_info->fde_count * 8;
 
   /* Request program headers to be recalculated.  */
   elf_tdata (abfd)->program_header_size = 0;
@@ -723,7 +714,7 @@
 	/* Count only sections which have at least a single CIE or FDE.
 	   There cannot be any CIE or FDE <= 8 bytes.  */
 	o = bfd_get_section_by_name (abfd, ".eh_frame");
-	if (o && o->_raw_size > 8 && !bfd_is_abs_section (o->output_section))
+	if (o && o->size > 8 && !bfd_is_abs_section (o->output_section))
 	  break;
       }
 
@@ -755,8 +746,8 @@
     return offset;
   sec_info = elf_section_data (sec)->sec_info;
 
-  if (offset >= sec->_raw_size)
-    return offset - (sec->_cooked_size - sec->_raw_size);
+  if (offset >= sec->rawsize)
+    return offset - sec->rawsize + sec->size;
 
   lo = 0;
   hi = sec_info->count;
@@ -821,7 +812,7 @@
 
   if (sec->sec_info_type != ELF_INFO_TYPE_EH_FRAME)
     return bfd_set_section_contents (abfd, sec->output_section, contents,
-				     sec->output_offset, sec->_raw_size);
+				     sec->output_offset, sec->size);
   sec_info = elf_section_data (sec)->sec_info;
   htab = elf_hash_table (info);
   hdr_info = &htab->eh_info;
@@ -1024,27 +1015,15 @@
       p += sec_info->entry[i].size;
     }
 
-  /* FIXME: Once _bfd_elf_discard_section_eh_frame will be able to
-     shrink sections to zero size, this won't be needed any more.  */
-  if (p == contents && sec->_cooked_size == 16)
-    {
-      bfd_put_32 (abfd, 12, p);		/* Fake CIE length */
-      bfd_put_32 (abfd, 0, p + 4);	/* Fake CIE id */
-      p[8] = 1;				/* Fake CIE version */
-      memset (p + 9, 0, 7);		/* Fake CIE augmentation, 3xleb128
-					   and 3xDW_CFA_nop as pad  */
-      p += 16;
-    }
-  else
     {
       unsigned int alignment = 1 << sec->alignment_power;
-      unsigned int pad = sec->_cooked_size % alignment;
+      unsigned int pad = sec->size % alignment;
 
       /* Don't pad beyond the raw size of the output section. It
 	 can happen at the last input section.  */
       if (pad
-	  && ((sec->output_offset + sec->_cooked_size + pad)
-	      <= sec->output_section->_raw_size))
+	  && ((sec->output_offset + sec->size + pad)
+	      <= sec->output_section->size))
 	{
 	  /* Find the last CIE/FDE.  */
 	  for (i = sec_info->count - 1; i > 0; i--)
@@ -1068,15 +1047,15 @@
 	  memset (p, 0, pad);
 	  p += pad;
 
-	  sec->_cooked_size += pad;
+	  sec->size += pad;
 	}
     }
 
-  BFD_ASSERT ((bfd_size_type) (p - contents) == sec->_cooked_size);
+  BFD_ASSERT ((bfd_size_type) (p - contents) == sec->size);
 
   return bfd_set_section_contents (abfd, sec->output_section,
                                    contents, (file_ptr) sec->output_offset,
-                                   sec->_cooked_size);
+                                   sec->size);
 }
 
 /* Helper function used to sort .eh_frame_hdr search table by increasing
@@ -1187,7 +1166,7 @@
 
   retval = bfd_set_section_contents (abfd, sec->output_section,
 				     contents, (file_ptr) sec->output_offset,
-				     sec->_cooked_size);
+				     sec->size);
   free (contents);
   return retval;
 }
diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h
index f5aba51..1e280b7 100644
--- a/bfd/elf-hppa.h
+++ b/bfd/elf-hppa.h
@@ -1,5 +1,6 @@
 /* Common code for PA ELF implementations.
-   Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -31,7 +32,6 @@
 #define elf_hppa_reloc_final_type elf64_hppa_reloc_final_type
 #define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type
 #define elf_hppa_relocate_section elf64_hppa_relocate_section
-#define bfd_elf_bfd_final_link bfd_elf64_bfd_final_link
 #define elf_hppa_final_link elf64_hppa_final_link
 #endif
 #if ARCH_SIZE == 32
@@ -40,7 +40,6 @@
 #define elf_hppa_reloc_final_type elf32_hppa_reloc_final_type
 #define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type
 #define elf_hppa_relocate_section elf32_hppa_relocate_section
-#define bfd_elf_bfd_final_link bfd_elf32_bfd_final_link
 #define elf_hppa_final_link elf32_hppa_final_link
 #endif
 
@@ -1043,16 +1042,12 @@
   if (s != NULL)
     {
       bfd_size_type size;
-      char *contents;
+      bfd_byte *contents;
 
-      size = s->_raw_size;
-      contents = bfd_malloc (size);
-      if (contents == NULL)
+      if (!bfd_malloc_and_get_section (abfd, s, &contents))
 	return FALSE;
 
-      if (! bfd_get_section_contents (abfd, s, contents, (file_ptr) 0, size))
-	return FALSE;
-
+      size = s->size;
       qsort (contents, (size_t) (size / 16), 16, hppa_unwind_entry_compare);
 
       if (! bfd_set_section_contents (abfd, s, contents, (file_ptr) 0, size))
@@ -1070,7 +1065,7 @@
 static bfd_boolean
 elf_hppa_add_symbol_hook (bfd *abfd,
 			  struct bfd_link_info *info ATTRIBUTE_UNUSED,
-			  const Elf_Internal_Sym *sym,
+			  Elf_Internal_Sym *sym,
 			  const char **namep ATTRIBUTE_UNUSED,
 			  flagword *flagsp ATTRIBUTE_UNUSED,
 			  asection **secp,
@@ -1294,7 +1289,7 @@
 			  info);
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  retval = bfd_elf_bfd_final_link (abfd, info);
+  retval = bfd_elf_final_link (abfd, info);
 
   elf_link_hash_traverse (elf_hash_table (info),
 			  elf_hppa_remark_useless_dynamic_symbols,
diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c
index 5268525..c9e32be 100644
--- a/bfd/elf-m10200.c
+++ b/bfd/elf-m10200.c
@@ -505,11 +505,6 @@
       || (sec->flags & SEC_CODE) == 0)
     return TRUE;
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
-
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
   /* Get a copy of the native relocations.  */
@@ -541,12 +536,7 @@
 	  else
 	    {
 	      /* Go get them off disk.  */
-	      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	      if (contents == NULL)
-		goto error_return;
-
-	      if (! bfd_get_section_contents (abfd, sec, contents,
-					      (file_ptr) 0, sec->_raw_size))
+	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		goto error_return;
 	    }
 	}
@@ -737,7 +727,7 @@
 	  value += irel->r_addend;
 
 	  /* Do nothing if this reloc is the last byte in the section.  */
-	  if (irel->r_offset == sec->_cooked_size)
+	  if (irel->r_offset == sec->size)
 	    continue;
 
 	  /* See if the next instruction is an unconditional pc-relative
@@ -1189,7 +1179,7 @@
      power larger than the number of bytes we are deleting.  */
 
   irelalign = NULL;
-  toaddr = sec->_cooked_size;
+  toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
   irelend = irel + sec->reloc_count;
@@ -1197,7 +1187,7 @@
   /* Actually delete the bytes.  */
   memmove (contents + addr, contents + addr + count,
 	   (size_t) (toaddr - addr - count));
-  sec->_cooked_size -= count;
+  sec->size -= count;
 
   /* Adjust all the relocs.  */
   for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
@@ -1316,7 +1306,7 @@
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
 
   memcpy (data, elf_section_data (input_section)->this_hdr.contents,
-	  (size_t) input_section->_raw_size);
+	  (size_t) input_section->size);
 
   if ((input_section->flags & SEC_RELOC) != 0
       && input_section->reloc_count > 0)
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index a132794..f41c118 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -52,19 +52,6 @@
    linking with -Bsymbolic.  We store the information in a field
    extending the regular ELF linker hash table.  */
 
-/* This structure keeps track of the number of PC relative relocs we
-   have copied for a given symbol.  */
-
-struct elf_mn10300_pcrel_relocs_copied
-{
-  /* Next section.  */
-  struct elf_mn10300_pcrel_relocs_copied * next;
-  /* A section in dynobj.  */
-  asection * section;
-  /* Number of relocs copied in this section.  */
-  bfd_size_type count;
-};
-
 struct elf32_mn10300_link_hash_entry {
   /* The basic elf link hash table entry.  */
   struct elf_link_hash_entry root;
@@ -90,9 +77,6 @@
      add it to the hash table to avoid computing it over and over.  */
   unsigned char movm_stack_size;
 
-  /* Number of PC relative relocs copied for this symbol.  */
-  struct elf_mn10300_pcrel_relocs_copied * pcrel_relocs_copied;
-
 /* When set, convert all "call" instructions to this target into "calls"
    instructions.  */
 #define MN10300_CONVERT_CALL_TO_CALLS 0x1
@@ -166,9 +150,6 @@
   PARAMS ((bfd *, struct bfd_link_info *));
 static bfd_boolean _bfd_mn10300_elf_adjust_dynamic_symbol
   PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
-static bfd_boolean _bfd_mn10300_elf_discard_copies
-  PARAMS ((struct elf32_mn10300_link_hash_entry *,
-	   struct bfd_link_info *));
 static bfd_boolean _bfd_mn10300_elf_size_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
 static bfd_boolean _bfd_mn10300_elf_finish_dynamic_symbol
@@ -616,7 +597,7 @@
       h->type = STT_OBJECT;
 
       if (info->shared
-	  && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+	  && ! bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
     }
 
@@ -650,13 +631,13 @@
   h->type = STT_OBJECT;
 
   if (info->shared
-      && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+      && ! bfd_elf_link_record_dynamic_symbol (info, h))
     return FALSE;
 
   elf_hash_table (info)->hgot = h;
 
   /* The first bit of the global offset table is the header.  */
-  s->_raw_size += bed->got_header_size + bed->got_symbol_offset;
+  s->size += bed->got_header_size + bed->got_symbol_offset;
 
   return TRUE;
 }
@@ -770,14 +751,14 @@
 	/* This relocation describes the C++ object vtable hierarchy.
 	   Reconstruct it for later use during GC.  */
 	case R_MN10300_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_MN10300_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 	case R_MN10300_GOT32:
@@ -817,16 +798,16 @@
 		/* We have already allocated space in the .got.  */
 		break;
 
-	      h->got.offset = sgot->_raw_size;
+	      h->got.offset = sgot->size;
 
 	      /* Make sure this symbol is output as a dynamic symbol.  */
 	      if (h->dynindx == -1)
 		{
-		  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+		  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		    return FALSE;
 		}
 
-	      srelgot->_raw_size += sizeof (Elf32_External_Rela);
+	      srelgot->size += sizeof (Elf32_External_Rela);
 	    }
 	  else
 	    {
@@ -852,16 +833,16 @@
 		/* We have already allocated space in the .got.  */
 		break;
 
-	      local_got_offsets[r_symndx] = sgot->_raw_size;
+	      local_got_offsets[r_symndx] = sgot->size;
 
 	      if (info->shared)
 		/* If we are generating a shared object, we need to
 		   output a R_MN10300_RELATIVE reloc so that the dynamic
 		   linker can adjust this GOT entry.  */
-		srelgot->_raw_size += sizeof (Elf32_External_Rela);
+		srelgot->size += sizeof (Elf32_External_Rela);
 	    }
 
-	  sgot->_raw_size += 4;
+	  sgot->size += 4;
 
 	  break;
 
@@ -887,7 +868,6 @@
 
 	  break;
 
-	case R_MN10300_32:
 	case R_MN10300_24:
 	case R_MN10300_16:
 	case R_MN10300_8:
@@ -896,28 +876,16 @@
 	case R_MN10300_PCREL8:
 	  if (h != NULL)
 	    h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+	  break;
 
-	  /* If we are creating a shared library, and this is a reloc
-	     against a global symbol, or a non PC relative reloc
-	     against a local symbol, then we need to copy the reloc
-	     into the shared library.  However, if we are linking with
-	     -Bsymbolic, we do not need to copy a reloc against a
-	     global symbol which is defined in an object we are
-	     including in the link (i.e., DEF_REGULAR is set).  At
-	     this point we have not seen all the input files, so it is
-	     possible that DEF_REGULAR is not set now but will be set
-	     later (it is never cleared).  We account for that
-	     possibility below by storing information in the
-	     pcrel_relocs_copied field of the hash table entry.  */
+	case R_MN10300_32:
+	  if (h != NULL)
+	    h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF;
+
+	  /* If we are creating a shared library, then we need to copy
+	     the reloc into the shared library.  */
 	  if (info->shared
-	      && (sec->flags & SEC_ALLOC) != 0
-	      && (! (elf_mn10300_howto_table[ELF32_R_TYPE (rel->r_info)]
-		     .pc_relative)
-		  || (h != NULL
-		      && (! info->symbolic
-			  || h->root.type == bfd_link_hash_defweak
-			  || (h->elf_link_hash_flags
-			      & ELF_LINK_HASH_DEF_REGULAR) == 0))))
+	      && (sec->flags & SEC_ALLOC) != 0)
 	    {
 	      /* When creating a shared object, we must copy these
 		 reloc types into the output file.  We create a reloc
@@ -954,44 +922,7 @@
 		    }
 		}
 
-	      sreloc->_raw_size += sizeof (Elf32_External_Rela);
-
-	      /* If we are linking with -Bsymbolic, and this is a
-		 global symbol, we count the number of PC relative
-		 relocations we have entered for this symbol, so that
-		 we can discard them again if the symbol is later
-		 defined by a regular object.  Note that this function
-		 is only called if we are using an elf_sh linker
-		 hash table, which means that h is really a pointer to
-		 an elf32_mn10300_link_hash_entry.  */
-	      if (h != NULL
-		  && (elf_mn10300_howto_table[ELF32_R_TYPE (rel->r_info)]
-		      .pc_relative))
-		{
-		  struct elf32_mn10300_link_hash_entry *eh;
-		  struct elf_mn10300_pcrel_relocs_copied *p;
-
-		  eh = (struct elf32_mn10300_link_hash_entry *) h;
-
-		  for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next)
-		    if (p->section == sreloc)
-		      break;
-
-		  if (p == NULL)
-		    {
-		      p = ((struct elf_mn10300_pcrel_relocs_copied *)
-			   bfd_alloc (dynobj, sizeof *p));
-		      if (p == NULL)
-			return FALSE;
-
-		      p->next = eh->pcrel_relocs_copied;
-		      eh->pcrel_relocs_copied = p;
-		      p->section = sreloc;
-		      p->count = 0;
-		    }
-
-		  ++p->count;
-		}
+	      sreloc->size += sizeof (Elf32_External_Rela);
 	    }
 
 	  break;
@@ -1056,7 +987,7 @@
      bfd_vma addend;
      struct elf_link_hash_entry * h;
      unsigned long symndx;
-     struct bfd_link_info *info ATTRIBUTE_UNUSED;
+     struct bfd_link_info *info;
      asection *sym_sec ATTRIBUTE_UNUSED;
      int is_local ATTRIBUTE_UNUSED;
 {
@@ -1077,6 +1008,24 @@
 
   switch (r_type)
     {
+    case R_MN10300_24:
+    case R_MN10300_16:
+    case R_MN10300_8:
+    case R_MN10300_PCREL8:
+    case R_MN10300_PCREL16:
+    case R_MN10300_PCREL32:
+    case R_MN10300_GOTOFF32:
+    case R_MN10300_GOTOFF24:
+    case R_MN10300_GOTOFF16:
+      if (info->shared
+	  && (input_section->flags & SEC_ALLOC) != 0
+	  && h != NULL
+	  && ! _bfd_elf_symbol_refs_local_p (h, info, 1))
+	return bfd_reloc_dangerous;
+    }
+
+  switch (r_type)
+    {
     case R_MN10300_NONE:
       return bfd_reloc_ok;
 
@@ -1112,22 +1061,10 @@
 
 	  skip = FALSE;
 
-	  if (elf_section_data (input_section)->sec_info == NULL
-	      || (input_section->sec_info_type != ELF_INFO_TYPE_STABS))
-	    outrel.r_offset = 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)->sec_info,
-		      offset));
-	      if (off == (bfd_vma) -1)
-		skip = TRUE;
-	      outrel.r_offset = off;
-	    }
+	  outrel.r_offset = _bfd_elf_section_offset (input_bfd, info,
+						     input_section, offset);
+	  if (outrel.r_offset == (bfd_vma) -1)
+	    skip = TRUE;
 
 	  outrel.r_offset += (input_section->output_section->vma
 			      + input_section->output_offset);
@@ -1142,9 +1079,7 @@
 	      /* h->dynindx may be -1 if this symbol was marked to
 		 become local.  */
 	      if (h == NULL
-		  || ((info->symbolic || h->dynindx == -1)
-		      && (h->elf_link_hash_flags
-			  & ELF_LINK_HASH_DEF_REGULAR) != 0))
+		  || _bfd_elf_symbol_refs_local_p (h, info, 1))
 		{
 		  relocate = TRUE;
 		  outrel.r_info = ELF32_R_INFO (0, R_MN10300_RELATIVE);
@@ -1229,81 +1164,6 @@
       return bfd_reloc_ok;
 
     case R_MN10300_PCREL32:
-      if (info->shared
-	  && (input_section->flags & SEC_ALLOC) != 0
-	  && h != NULL
-	  && h->dynindx != -1
-	  && (! info->symbolic
-	      || (h->elf_link_hash_flags
-		  & ELF_LINK_HASH_DEF_REGULAR) == 0))
-	{
-	  Elf_Internal_Rela outrel;
-	  bfd_boolean skip;
-
-	  /* When generating a shared object, these relocations
-	     are copied into the output file to be resolved at run
-	     time.  */
-
-	  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 FALSE;
-
-	      BFD_ASSERT (strncmp (name, ".rela", 5) == 0
-			  && strcmp (bfd_get_section_name (input_bfd,
-							   input_section),
-				     name + 5) == 0);
-
-	      sreloc = bfd_get_section_by_name (dynobj, name);
-	      BFD_ASSERT (sreloc != NULL);
-	    }
-
-	  skip = FALSE;
-
-	  if (elf_section_data (input_section)->sec_info == NULL
-	      || (input_section->sec_info_type != ELF_INFO_TYPE_STABS))
-	    outrel.r_offset = 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)->sec_info,
-		      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 (skip)
-	    memset (&outrel, 0, sizeof outrel);
-	  else
-	    {
-	      BFD_ASSERT (h != NULL && h->dynindx != -1);
-	      outrel.r_info = ELF32_R_INFO (h->dynindx, R_MN10300_PCREL32);
-	      outrel.r_addend = addend;
-	    }
-
-	  bfd_elf32_swap_reloca_out (output_bfd, &outrel,
-				     (bfd_byte *) (((Elf32_External_Rela *)
-						    sreloc->contents)
-						   + sreloc->reloc_count));
-	  ++sreloc->reloc_count;
-
-	  return bfd_reloc_ok;
-	}
-
       value -= (input_section->output_section->vma
 		+ input_section->output_offset);
       value -= offset;
@@ -1442,9 +1302,7 @@
 	      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)))
+		  || _bfd_elf_symbol_refs_local_p (h, info, 1))
 		/* This is actually a static link, or it is a
 		   -Bsymbolic link and the symbol is defined
 		   locally, or the symbol was forced to be local
@@ -1603,16 +1461,9 @@
 		       || r_type == R_MN10300_GOT24
 		       || r_type == R_MN10300_GOT16)
 		      && elf_hash_table (info)->dynamic_sections_created
-		      && (! info->shared
-			  || (! info->symbolic && h->root.dynindx != -1)
-			  || (h->root.elf_link_hash_flags
-			      & ELF_LINK_HASH_DEF_REGULAR) == 0))
-		  || (info->shared
-		      && ((! info->symbolic && h->root.dynindx != -1)
-			  || (h->root.elf_link_hash_flags
-			      & ELF_LINK_HASH_DEF_REGULAR) == 0)
-		      && (   r_type == R_MN10300_32
-			  || r_type == R_MN10300_PCREL32)
+		      && !_bfd_elf_symbol_refs_local_p (h, info, 1))
+		  || (r_type == R_MN10300_32
+		      && !_bfd_elf_symbol_refs_local_p (h, info, 1)
 		      && ((input_section->flags & SEC_ALLOC) != 0
 			  /* DWARF will emit R_MN10300_32 relocations
 			     in its sections against symbols defined
@@ -1705,9 +1556,10 @@
 static bfd_boolean
 elf32_mn10300_finish_hash_table_entry (gen_entry, in_args)
      struct bfd_hash_entry *gen_entry;
-     PTR in_args ATTRIBUTE_UNUSED;
+     PTR in_args;
 {
   struct elf32_mn10300_link_hash_entry *entry;
+  struct bfd_link_info *link_info = (struct bfd_link_info *)in_args;
   unsigned int byte_count = 0;
 
   entry = (struct elf32_mn10300_link_hash_entry *) gen_entry;
@@ -1721,11 +1573,16 @@
     return TRUE;
 
   /* If there are no named calls to this symbol, or there's nothing we
-     can move from the function itself into the "call" instruction, then
-     note that all "call" instructions should be converted into "calls"
-     instructions and return.  */
+     can move from the function itself into the "call" instruction,
+     then note that all "call" instructions should be converted into
+     "calls" instructions and return.  If a symbol is available for
+     dynamic symbol resolution (overridable or overriding), avoid
+     custom calling conventions.  */
   if (entry->direct_calls == 0
-      || (entry->stack_size == 0 && entry->movm_args == 0))
+      || (entry->stack_size == 0 && entry->movm_args == 0)
+      || (elf_hash_table (link_info)->dynamic_sections_created
+	  && ELF_ST_VISIBILITY (entry->root.other) != STV_INTERNAL
+	  && ELF_ST_VISIBILITY (entry->root.other) != STV_HIDDEN))
     {
       /* Make a note that we should convert "call" instructions to "calls"
 	 instructions for calls to this symbol.  */
@@ -1862,16 +1719,11 @@
 	      /* Get cached copy of section contents if it exists.  */
 	      if (elf_section_data (section)->this_hdr.contents != NULL)
 		contents = elf_section_data (section)->this_hdr.contents;
-	      else if (section->_raw_size != 0)
+	      else if (section->size != 0)
 		{
 		  /* Go get them off disk.  */
-		  contents = (bfd_byte *) bfd_malloc (section->_raw_size);
-		  if (contents == NULL)
-		    goto error_return;
-
-		  if (!bfd_get_section_contents (input_bfd, section,
-						 contents, (file_ptr) 0,
-						 section->_raw_size))
+		  if (!bfd_malloc_and_get_section (input_bfd, section,
+						   &contents))
 		    goto error_return;
 		}
 	      else
@@ -2000,6 +1852,11 @@
 		  sec_shndx = _bfd_elf_section_from_bfd_section (input_bfd,
 								 section);
 
+		  symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)
+			      - symtab_hdr->sh_info);
+		  hashes = elf_sym_hashes (input_bfd);
+		  end_hashes = hashes + symcount;
+
 		  /* Look at each function defined in this section and
 		     update info for that function.  */
 		  isymend = isymbuf + symtab_hdr->sh_info;
@@ -2010,6 +1867,22 @@
 			{
 			  struct elf_link_hash_table *elftab;
 			  bfd_size_type amt;
+			  struct elf_link_hash_entry **lhashes = hashes;
+
+			  /* Skip a local symbol if it aliases a
+			     global one.  */
+			  for (; lhashes < end_hashes; lhashes++)
+			    {
+			      hash = (struct elf32_mn10300_link_hash_entry *) *lhashes;
+			      if ((hash->root.root.type == bfd_link_hash_defined
+				   || hash->root.root.type == bfd_link_hash_defweak)
+				  && hash->root.root.u.def.section == section
+				  && hash->root.type == STT_FUNC
+				  && hash->root.root.u.def.value == isym->st_value)
+				break;
+			    }
+			  if (lhashes != end_hashes)
+			    continue;
 
 			  if (isym->st_shndx == SHN_UNDEF)
 			    sym_sec = bfd_und_section_ptr;
@@ -2047,17 +1920,13 @@
 			}
 		    }
 
-		  symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)
-			      - symtab_hdr->sh_info);
-		  hashes = elf_sym_hashes (input_bfd);
-		  end_hashes = hashes + symcount;
 		  for (; hashes < end_hashes; hashes++)
 		    {
 		      hash = (struct elf32_mn10300_link_hash_entry *) *hashes;
 		      if ((hash->root.root.type == bfd_link_hash_defined
 			   || hash->root.root.type == bfd_link_hash_defweak)
 			  && hash->root.root.u.def.section == section
-			  && ELF_ST_TYPE (isym->st_info) == STT_FUNC)
+			  && hash->root.type == STT_FUNC)
 			compute_function_info (input_bfd, hash,
 					       (hash)->root.root.u.def.value,
 					       contents);
@@ -2104,10 +1973,10 @@
 	 the final initialization steps on each.  */
       elf32_mn10300_link_hash_traverse (hash_table,
 					elf32_mn10300_finish_hash_table_entry,
-					NULL);
+					link_info);
       elf32_mn10300_link_hash_traverse (hash_table->static_hash_table,
 					elf32_mn10300_finish_hash_table_entry,
-					NULL);
+					link_info);
 
       /* All entries in the hash table are fully initialized.  */
       hash_table->flags |= MN10300_HASH_ENTRIES_INITIALIZED;
@@ -2145,7 +2014,7 @@
 	      unsigned int symcount;
 
 	      /* Skip non-code sections and empty sections.  */
-	      if ((section->flags & SEC_CODE) == 0 || section->_raw_size == 0)
+	      if ((section->flags & SEC_CODE) == 0 || section->size == 0)
 		continue;
 
 	      if (section->reloc_count != 0)
@@ -2165,13 +2034,8 @@
 	      else
 		{
 		  /* Go get them off disk.  */
-		  contents = (bfd_byte *) bfd_malloc (section->_raw_size);
-		  if (contents == NULL)
-		    goto error_return;
-
-		  if (!bfd_get_section_contents (input_bfd, section,
-						 contents, (file_ptr) 0,
-						 section->_raw_size))
+		  if (!bfd_malloc_and_get_section (input_bfd, section,
+						   &contents))
 		    goto error_return;
 		}
 
@@ -2373,11 +2237,6 @@
       || (sec->flags & SEC_CODE) == 0)
     return TRUE;
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
-
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
   /* Get a copy of the native relocations.  */
@@ -2410,12 +2269,7 @@
 	  else
 	    {
 	      /* Go get them off disk.  */
-	      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	      if (contents == NULL)
-		goto error_return;
-
-	      if (! bfd_get_section_contents (abfd, sec, contents,
-					      (file_ptr) 0, sec->_raw_size))
+	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		goto error_return;
 	    }
 	}
@@ -2439,6 +2293,7 @@
 	  asection *sym_sec = NULL;
 	  const char *sym_name;
 	  char *new_name;
+	  bfd_vma saved_addend;
 
 	  /* A local symbol.  */
 	  isym = isymbuf + ELF32_R_SYM (irel->r_info);
@@ -2451,13 +2306,25 @@
 	  else
 	    sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
 
-	  symval = (isym->st_value
-		    + sym_sec->output_section->vma
-		    + sym_sec->output_offset);
 	  sym_name = bfd_elf_string_from_elf_section (abfd,
 						      symtab_hdr->sh_link,
 						      isym->st_name);
 
+	  if ((sym_sec->flags & SEC_MERGE)
+	      && ELF_ST_TYPE (isym->st_info) == STT_SECTION
+	      && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE)
+	    {
+	      saved_addend = irel->r_addend;
+	      symval = _bfd_elf_rela_local_sym (abfd, isym, &sym_sec, irel);
+	      symval += irel->r_addend;
+	      irel->r_addend = saved_addend;
+	    }
+	  else
+	    {
+	      symval = (isym->st_value
+			+ sym_sec->output_section->vma
+			+ sym_sec->output_offset);
+	    }
 	  /* Tack on an ID so we can uniquely identify this
 	     local symbol in the global hash table.  */
 	  new_name = bfd_malloc ((bfd_size_type) strlen (sym_name) + 10);
@@ -2756,7 +2623,7 @@
 	  value += irel->r_addend;
 
 	  /* Do nothing if this reloc is the last byte in the section.  */
-	  if (irel->r_offset == sec->_cooked_size)
+	  if (irel->r_offset == sec->size)
 	    continue;
 
 	  /* See if the next instruction is an unconditional pc-relative
@@ -3589,7 +3456,7 @@
      power larger than the number of bytes we are deleting.  */
 
   irelalign = NULL;
-  toaddr = sec->_cooked_size;
+  toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
   irelend = irel + sec->reloc_count;
@@ -3597,7 +3464,7 @@
   /* Actually delete the bytes.  */
   memmove (contents + addr, contents + addr + count,
 	   (size_t) (toaddr - addr - count));
-  sec->_cooked_size -= count;
+  sec->size -= count;
 
   /* Adjust all the relocs.  */
   for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
@@ -3716,7 +3583,7 @@
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
 
   memcpy (data, elf_section_data (input_section)->this_hdr.contents,
-	  (size_t) input_section->_raw_size);
+	  (size_t) input_section->size);
 
   if ((input_section->flags & SEC_RELOC) != 0
       && input_section->reloc_count > 0)
@@ -3825,7 +3692,6 @@
       ret->stack_size = 0;
       ret->movm_args = 0;
       ret->movm_stack_size = 0;
-      ret->pcrel_relocs_copied = NULL;
       ret->flags = 0;
     }
 
@@ -4186,7 +4052,7 @@
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (h->dynindx == -1)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -4195,8 +4061,8 @@
 
       /* If this is the first .plt entry, make room for the special
 	 first entry.  */
-      if (s->_raw_size == 0)
-	s->_raw_size += elf_mn10300_sizeof_plt0 (info);
+      if (s->size == 0)
+	s->size += elf_mn10300_sizeof_plt0 (info);
 
       /* If this symbol is not defined in a regular file, and we are
 	 not generating a shared library, then set the symbol to this
@@ -4207,26 +4073,26 @@
 	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
 	{
 	  h->root.u.def.section = s;
-	  h->root.u.def.value = s->_raw_size;
+	  h->root.u.def.value = s->size;
 	}
 
-      h->plt.offset = s->_raw_size;
+      h->plt.offset = s->size;
 
       /* Make room for this entry.  */
-      s->_raw_size += elf_mn10300_sizeof_plt (info);
+      s->size += elf_mn10300_sizeof_plt (info);
 
       /* We also need to make an entry in the .got.plt section, which
 	 will be placed in the .got section by the linker script.  */
 
       s = bfd_get_section_by_name (dynobj, ".got.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += 4;
+      s->size += 4;
 
       /* We also need to make an entry in the .rela.plt section.  */
 
       s = bfd_get_section_by_name (dynobj, ".rela.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += sizeof (Elf32_External_Rela);
+      s->size += sizeof (Elf32_External_Rela);
 
       return TRUE;
     }
@@ -4281,7 +4147,7 @@
 
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf32_External_Rela);
+      srel->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -4292,8 +4158,7 @@
     power_of_two = 3;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (! bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -4302,38 +4167,10 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
-
-  return TRUE;
-}
-
-/* This function is called via elf32_mn10300_link_hash_traverse if we are
-   creating a shared object with -Bsymbolic.  It discards the space
-   allocated to copy PC relative relocs against symbols which are
-   defined in regular objects.  We allocated space for them in the
-   check_relocs routine, but we won't fill them in in the
-   relocate_section routine.  */
-
-static bfd_boolean
-_bfd_mn10300_elf_discard_copies (h, info)
-     struct elf32_mn10300_link_hash_entry *h;
-     struct bfd_link_info *info;
-{
-  struct elf_mn10300_pcrel_relocs_copied *s;
-
-  /* If a symbol has been forced local or we have found a regular
-     definition for the symbolic link case, then we won't be needing
-     any relocs.  */
-  if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0
-      && ((h->root.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0
-	  || info->symbolic))
-    {
-      for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
-	s->section->_raw_size -= s->count * sizeof (Elf32_External_Rel);
-    }
+  s->size += h->size;
 
   return TRUE;
 }
@@ -4361,7 +4198,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -4374,18 +4211,9 @@
 	 below.  */
       s = bfd_get_section_by_name (dynobj, ".rela.got");
       if (s != NULL)
-	s->_raw_size = 0;
+	s->size = 0;
     }
 
-  /* If this is a -Bsymbolic shared link, then we need to discard all
-     PC relative relocs against symbols defined in a regular object.
-     We allocated space for them in the check_relocs routine, but we
-     will not fill them in in the relocate_section routine.  */
-  if (info->shared && info->symbolic)
-    elf32_mn10300_link_hash_traverse (elf32_mn10300_hash_table (info),
-				      _bfd_mn10300_elf_discard_copies,
-				      info);
-
   /* The check_relocs and adjust_dynamic_symbol entry points have
      determined the sizes of the various dynamic sections.  Allocate
      memory for them.  */
@@ -4408,7 +4236,7 @@
 
       if (strcmp (name, ".plt") == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    /* Strip this section if we don't need it; see the
 	       comment below.  */
 	    strip = TRUE;
@@ -4418,7 +4246,7 @@
 	}
       else if (strncmp (name, ".rela", 5) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is mostly to handle .rela.bss and
@@ -4477,8 +4305,8 @@
 	 section's contents are written out.  This should not happen,
 	 but this way if it does, we get a R_MN10300_NONE reloc
 	 instead of garbage.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
     }
 
@@ -4491,31 +4319,31 @@
 	 in by the dynamic linker and used by the debugger.  */
       if (! info->shared)
 	{
-	  if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0))
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_DEBUG, 0))
 	    return FALSE;
 	}
 
       if (plt)
 	{
-	  if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0)
-	      || ! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0)
-	      || ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
-	      || ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0))
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_PLTGOT, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_JMPREL, 0))
 	    return FALSE;
 	}
 
       if (relocs)
 	{
-	  if (! bfd_elf32_add_dynamic_entry (info, DT_RELA, 0)
-	      || ! bfd_elf32_add_dynamic_entry (info, DT_RELASZ, 0)
-	      || ! bfd_elf32_add_dynamic_entry (info, DT_RELAENT,
-						sizeof (Elf32_External_Rela)))
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_RELA, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_RELASZ, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_RELAENT,
+					      sizeof (Elf32_External_Rela)))
 	    return FALSE;
 	}
 
       if (reltext)
 	{
-	  if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0))
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_TEXTREL, 0))
 	    return FALSE;
 	}
     }
@@ -4725,7 +4553,7 @@
       BFD_ASSERT (sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
 
       for (; dyncon < dynconend; dyncon++)
 	{
@@ -4756,10 +4584,7 @@
 	    case DT_PLTRELSZ:
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      BFD_ASSERT (s != NULL);
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size;
-	      else
-		dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
@@ -4775,12 +4600,7 @@
 		 about changing the DT_RELA entry.  */
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      if (s != NULL)
-		{
-		  if (s->_cooked_size != 0)
-		    dyn.d_un.d_val -= s->_cooked_size;
-		  else
-		    dyn.d_un.d_val -= s->_raw_size;
-		}
+		dyn.d_un.d_val -= s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 	    }
@@ -4788,7 +4608,7 @@
 
       /* Fill in the first entry in the procedure linkage table.  */
       splt = bfd_get_section_by_name (dynobj, ".plt");
-      if (splt && splt->_raw_size > 0)
+      if (splt && splt->size > 0)
 	{
 	  if (info->shared)
 	    {
@@ -4813,7 +4633,7 @@
     }
 
   /* Fill in the first three entries in the global offset table.  */
-  if (sgot->_raw_size > 0)
+  if (sgot->size > 0)
     {
       if (sdyn == NULL)
 	bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
@@ -4830,6 +4650,25 @@
   return TRUE;
 }
 
+/* Classify relocation types, such that combreloc can sort them
+   properly.  */
+
+static enum elf_reloc_type_class
+_bfd_mn10300_elf_reloc_type_class (const Elf_Internal_Rela *rela)
+{
+  switch ((int) ELF32_R_TYPE (rela->r_info))
+    {
+    case R_MN10300_RELATIVE:
+      return reloc_class_relative;
+    case R_MN10300_JMP_SLOT:
+      return reloc_class_plt;
+    case R_MN10300_COPY:
+      return reloc_class_copy;
+    default:
+      return reloc_class_normal;
+    }
+}
+
 #ifndef ELF_ARCH
 #define TARGET_LITTLE_SYM	bfd_elf32_mn10300_vec
 #define TARGET_LITTLE_NAME	"elf32-mn10300"
@@ -4878,6 +4717,9 @@
 #define elf_backend_finish_dynamic_sections \
   _bfd_mn10300_elf_finish_dynamic_sections
 
+#define elf_backend_reloc_type_class \
+  _bfd_mn10300_elf_reloc_type_class
+
 #define elf_backend_want_got_plt	1
 #define elf_backend_plt_readonly	1
 #define elf_backend_want_plt_sym	0
diff --git a/bfd/elf.c b/bfd/elf.c
index afde13e..1cf2dc0 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -613,6 +613,12 @@
 }
 
 bfd_boolean
+bfd_elf_is_group_section (bfd *abfd ATTRIBUTE_UNUSED, const asection *sec)
+{
+  return elf_next_in_group (sec) != NULL;
+}
+
+bfd_boolean
 bfd_elf_discard_group (bfd *abfd ATTRIBUTE_UNUSED, asection *group)
 {
   asection *first = elf_next_in_group (group);
@@ -652,6 +658,9 @@
   if (newsect == NULL)
     return FALSE;
 
+  hdr->bfd_section = newsect;
+  elf_section_data (newsect)->this_hdr = *hdr;
+
   /* Always use the real type/flags.  */
   elf_section_type (newsect) = hdr->sh_type;
   elf_section_flags (newsect) = hdr->sh_flags;
@@ -798,9 +807,6 @@
 	}
     }
 
-  hdr->bfd_section = newsect;
-  elf_section_data (newsect)->this_hdr = *hdr;
-
   return TRUE;
 }
 
@@ -895,10 +901,31 @@
 bfd_boolean
 _bfd_elf_merge_sections (bfd *abfd, struct bfd_link_info *info)
 {
+  bfd *ibfd;
+  asection *sec;
+
   if (!is_elf_hash_table (info->hash))
     return FALSE;
-  if (elf_hash_table (info)->merge_info)
-    _bfd_merge_sections (abfd, elf_hash_table (info)->merge_info,
+
+  for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next)
+    if ((ibfd->flags & DYNAMIC) == 0)
+      for (sec = ibfd->sections; sec != NULL; sec = sec->next)
+	if ((sec->flags & SEC_MERGE) != 0
+	    && !bfd_is_abs_section (sec->output_section))
+	  {
+	    struct bfd_elf_section_data *secdata;
+
+	    secdata = elf_section_data (sec);
+	    if (! _bfd_add_merge_section (abfd,
+					  &elf_hash_table (info)->merge_info,
+					  sec, &secdata->sec_info))
+	      return FALSE;
+	    else if (secdata->sec_info)
+	      sec->sec_info_type = ELF_INFO_TYPE_MERGE;
+	  }
+
+  if (elf_hash_table (info)->merge_info != NULL)
+    _bfd_merge_sections (abfd, info, elf_hash_table (info)->merge_info,
 			 merge_sections_remove_hook);
   return TRUE;
 }
@@ -968,6 +995,7 @@
 	    case PT_TLS: pt = "TLS"; break;
 	    case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break;
 	    case PT_GNU_STACK: pt = "STACK"; break;
+	    case PT_GNU_RELRO: pt = "RELRO"; break;
 	    default: sprintf (buf, "0x%lx", p->p_type); pt = buf; break;
 	    }
 	  fprintf (f, "%8s off    0x", pt);
@@ -1002,10 +1030,7 @@
 
       fprintf (f, _("\nDynamic Section:\n"));
 
-      dynbuf = bfd_malloc (s->_raw_size);
-      if (dynbuf == NULL)
-	goto error_return;
-      if (! bfd_get_section_contents (abfd, s, dynbuf, 0, s->_raw_size))
+      if (!bfd_malloc_and_get_section (abfd, s, &dynbuf))
 	goto error_return;
 
       elfsec = _bfd_elf_section_from_bfd_section (abfd, s);
@@ -1017,7 +1042,7 @@
       swap_dyn_in = get_elf_backend_data (abfd)->s->swap_dyn_in;
 
       extdyn = dynbuf;
-      extdynend = extdyn + s->_raw_size;
+      extdynend = extdyn + s->size;
       for (; extdyn < extdynend; extdyn += extdynsize)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -1441,8 +1466,8 @@
   table->bucketcount = 0;
   table->needed = NULL;
   table->hgot = NULL;
-  table->stab_info = NULL;
   table->merge_info = NULL;
+  memset (&table->stab_info, 0, sizeof (table->stab_info));
   memset (&table->eh_info, 0, sizeof (table->eh_info));
   table->dynlocal = NULL;
   table->runpath = NULL;
@@ -1556,14 +1581,10 @@
     return TRUE;
 
   s = bfd_get_section_by_name (abfd, ".dynamic");
-  if (s == NULL || s->_raw_size == 0)
+  if (s == NULL || s->size == 0)
     return TRUE;
 
-  dynbuf = bfd_malloc (s->_raw_size);
-  if (dynbuf == NULL)
-    goto error_return;
-
-  if (! bfd_get_section_contents (abfd, s, dynbuf, 0, s->_raw_size))
+  if (!bfd_malloc_and_get_section (abfd, s, &dynbuf))
     goto error_return;
 
   elfsec = _bfd_elf_section_from_bfd_section (abfd, s);
@@ -1576,7 +1597,7 @@
   swap_dyn_in = get_elf_backend_data (abfd)->s->swap_dyn_in;
 
   extdyn = dynbuf;
-  extdynend = extdyn + s->_raw_size;
+  extdynend = extdyn + s->size;
   for (; extdyn < extdynend; extdyn += extdynsize)
     {
       Elf_Internal_Dyn dyn;
@@ -1945,8 +1966,10 @@
 	    hdr->bfd_section->flags
 	      |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
 
+	  /* We try to keep the same section order as it comes in.  */
+	  idx += n_elt;
 	  while (--n_elt != 0)
-	    if ((s = (++idx)->shdr->bfd_section) != NULL
+	    if ((s = (--idx)->shdr->bfd_section) != NULL
 		&& elf_next_in_group (s) != NULL)
 	      {
 		elf_next_in_group (hdr->bfd_section) = s;
@@ -2054,6 +2077,7 @@
   { ".gnu.version",   12,  0, SHT_GNU_versym, 0 },
   { ".gnu.version_d", 14,  0, SHT_GNU_verdef, 0 },
   { ".gnu.version_r", 14,  0, SHT_GNU_verneed, 0 },
+  { ".note.GNU-stack",15,  0, SHT_PROGBITS, 0 },
   { ".note",           5, -1, SHT_NOTE,     0 },
   { ".rela",           5, -1, SHT_RELA,     0 },
   { ".rel",            4, -1, SHT_REL,      0 },
@@ -2205,7 +2229,7 @@
     return FALSE;
   newsect->vma = hdr->p_vaddr;
   newsect->lma = hdr->p_paddr;
-  newsect->_raw_size = hdr->p_filesz;
+  newsect->size = hdr->p_filesz;
   newsect->filepos = hdr->p_offset;
   newsect->flags |= SEC_HAS_CONTENTS;
   newsect->alignment_power = bfd_log2 (hdr->p_align);
@@ -2238,7 +2262,7 @@
 	return FALSE;
       newsect->vma = hdr->p_vaddr + hdr->p_filesz;
       newsect->lma = hdr->p_paddr + hdr->p_filesz;
-      newsect->_raw_size = hdr->p_memsz - hdr->p_filesz;
+      newsect->size = hdr->p_memsz - hdr->p_filesz;
       if (hdr->p_type == PT_LOAD)
 	{
 	  newsect->flags |= SEC_ALLOC;
@@ -2291,6 +2315,9 @@
     case PT_GNU_STACK:
       return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "stack");
 
+    case PT_GNU_RELRO:
+      return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "relro");
+
     default:
       /* Check for any processor-specific program segment types.
          If no handler for them, default to making "segment" sections.  */
@@ -2373,7 +2400,7 @@
     this_hdr->sh_addr = 0;
 
   this_hdr->sh_offset = 0;
-  this_hdr->sh_size = asect->_raw_size;
+  this_hdr->sh_size = asect->size;
   this_hdr->sh_link = 0;
   this_hdr->sh_addralign = 1 << asect->alignment_power;
   /* The sh_entsize and sh_info fields may have been set already by
@@ -2386,7 +2413,31 @@
      asect->flags.  */
   if (this_hdr->sh_type == SHT_NULL)
     {
-      if ((asect->flags & SEC_ALLOC) != 0
+      if ((asect->flags & SEC_GROUP) != 0)
+	{
+	  /* We also need to mark SHF_GROUP here for relocatable
+	     link.  */
+	  struct bfd_link_order *l;
+	  asection *elt;
+
+	  for (l = asect->link_order_head; l != NULL; l = l->next)
+	    if (l->type == bfd_indirect_link_order
+		&& (elt = elf_next_in_group (l->u.indirect.section)) != NULL)
+	      do
+		{
+		  /* The name is not important. Anything will do.  */
+		  elf_group_name (elt->output_section) = "G";
+		  elf_section_flags (elt->output_section) |= SHF_GROUP;
+
+		  elt = elf_next_in_group (elt);
+		  /* During a relocatable link, the lists are
+		     circular.  */
+		}
+	      while (elt != elf_next_in_group (l->u.indirect.section));
+
+	  this_hdr->sh_type = SHT_GROUP;
+	}
+      else if ((asect->flags & SEC_ALLOC) != 0
 	  && (((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
 	      || (asect->flags & SEC_NEVER_LOAD) != 0))
 	this_hdr->sh_type = SHT_NOBITS;
@@ -2481,7 +2532,7 @@
   if ((asect->flags & SEC_THREAD_LOCAL) != 0)
     {
       this_hdr->sh_flags |= SHF_TLS;
-      if (asect->_raw_size == 0 && (asect->flags & SEC_HAS_CONTENTS) == 0)
+      if (asect->size == 0 && (asect->flags & SEC_HAS_CONTENTS) == 0)
 	{
 	  struct bfd_link_order *o;
 
@@ -2547,7 +2598,7 @@
   if (sec->contents == NULL)
     {
       gas = FALSE;
-      sec->contents = bfd_alloc (abfd, sec->_raw_size);
+      sec->contents = bfd_alloc (abfd, sec->size);
 
       /* Arrange for the section to be written out.  */
       elf_section_data (sec)->this_hdr.contents = sec->contents;
@@ -2558,7 +2609,7 @@
 	}
     }
 
-  loc = sec->contents + sec->_raw_size;
+  loc = sec->contents + sec->size;
 
   /* Get the pointer to the first section in the group that gas
      squirreled away here.  objcopy arranges for this to be set to the
@@ -3186,6 +3237,7 @@
   struct elf_segment_map **pm;
   struct elf_segment_map *m;
   asection *last_hdr;
+  bfd_vma last_size;
   unsigned int phdr_index;
   bfd_vma maxpagesize;
   asection **hdrpp;
@@ -3265,6 +3317,7 @@
      segment when the start of the second section can be placed within
      a few bytes of the end of the first section.  */
   last_hdr = NULL;
+  last_size = 0;
   phdr_index = 0;
   maxpagesize = get_elf_backend_data (abfd)->maxpagesize;
   writable = FALSE;
@@ -3313,18 +3366,19 @@
              segment.  */
 	  new_segment = TRUE;
 	}
-      else if (BFD_ALIGN (last_hdr->lma + last_hdr->_raw_size, maxpagesize)
+      else if (BFD_ALIGN (last_hdr->lma + last_size, maxpagesize)
 	       < BFD_ALIGN (hdr->lma, maxpagesize))
 	{
 	  /* If putting this section in this segment would force us to
              skip a page in the segment, then we need a new segment.  */
 	  new_segment = TRUE;
 	}
-      else if ((last_hdr->flags & SEC_LOAD) == 0
-	       && (hdr->flags & SEC_LOAD) != 0)
+      else if ((last_hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0
+	       && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0)
 	{
 	  /* We don't want to put a loadable section after a
-             nonloadable section in the same segment.  */
+             nonloadable section in the same segment.
+             Consider .tbss sections as loadable for this purpose.  */
 	  new_segment = TRUE;
 	}
       else if ((abfd->flags & D_PAGED) == 0)
@@ -3336,7 +3390,7 @@
 	}
       else if (! writable
 	       && (hdr->flags & SEC_READONLY) == 0
-	       && (((last_hdr->lma + last_hdr->_raw_size - 1)
+	       && (((last_hdr->lma + last_size - 1)
 		    & ~(maxpagesize - 1))
 		   != (hdr->lma & ~(maxpagesize - 1))))
 	{
@@ -3359,9 +3413,12 @@
 	{
 	  if ((hdr->flags & SEC_READONLY) == 0)
 	    writable = TRUE;
-	  /* Ignore .tbss section for segment layout purposes.  */
+	  last_hdr = hdr;
+	  /* .tbss sections effectively have zero size.  */
 	  if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL)
-	    last_hdr = hdr;
+	    last_size = hdr->size;
+	  else
+	    last_size = 0;
 	  continue;
 	}
 
@@ -3381,6 +3438,11 @@
 	writable = FALSE;
 
       last_hdr = hdr;
+      /* .tbss sections effectively have zero size.  */
+      if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL)
+	last_size = hdr->size;
+      else
+	last_size = 0;
       phdr_index = i;
       phdr_in_segment = FALSE;
     }
@@ -3503,6 +3565,21 @@
       pm = &m->next;
     }
 
+  if (elf_tdata (abfd)->relro)
+    {
+      amt = sizeof (struct elf_segment_map);
+      m = bfd_zalloc (abfd, amt);
+      if (m == NULL)
+	goto error_return;
+      m->next = NULL;
+      m->p_type = PT_GNU_RELRO;
+      m->p_flags = PF_R;
+      m->p_flags_valid = 1;
+
+      *pm = m;
+      pm = &m->next;
+    }
+
   free (sections);
   sections = NULL;
 
@@ -3562,8 +3639,8 @@
   /* Sort by size, to put zero sized sections
      before others at the same address.  */
 
-  size1 = (sec1->flags & SEC_LOAD) ? sec1->_raw_size : 0;
-  size2 = (sec2->flags & SEC_LOAD) ? sec2->_raw_size : 0;
+  size1 = (sec1->flags & SEC_LOAD) ? sec1->size : 0;
+  size2 = (sec2->flags & SEC_LOAD) ? sec2->size : 0;
 
   if (size1 < size2)
     return -1;
@@ -3749,6 +3826,18 @@
 					    1 << align);
 	    }
 	}
+      /* Make sure the .dynamic section is the first section in the
+	 PT_DYNAMIC segment.  */
+      else if (p->p_type == PT_DYNAMIC
+	       && m->count > 1
+	       && strcmp (m->sections[0]->name, ".dynamic") != 0)
+	{
+	  _bfd_error_handler
+	    (_("%s: The first section in the PT_DYNAMIC segment is not the .dynamic section"),
+	     bfd_get_filename (abfd));
+	  bfd_set_error (bfd_error_bad_value);
+	  return FALSE;
+	}
 
       if (m->count == 0)
 	p->p_vaddr = 0;
@@ -3943,12 +4032,12 @@
                  contents.  */
 	      if ((flags & SEC_LOAD) != 0
 		  || (flags & SEC_HAS_CONTENTS) != 0)
-		off += sec->_raw_size;
+		off += sec->size;
 
 	      if ((flags & SEC_ALLOC) != 0
 		  && ((flags & SEC_LOAD) != 0
 		      || (flags & SEC_THREAD_LOCAL) == 0))
-		voff += sec->_raw_size;
+		voff += sec->size;
 	    }
 
 	  if (p->p_type == PT_NOTE && bfd_get_format (abfd) == bfd_core)
@@ -3958,15 +4047,15 @@
 	      if (i == 0)
 		{
 		  sec->filepos = off;
-		  p->p_filesz = sec->_raw_size;
-		  off += sec->_raw_size;
+		  p->p_filesz = sec->size;
+		  off += sec->size;
 		  voff = off;
 		}
 	      else
 		{
 		  /* Fake sections -- don't need to be written.  */
 		  sec->filepos = 0;
-		  sec->_raw_size = 0;
+		  sec->size = 0;
 		  flags = sec->flags = 0;
 		}
 	      p->p_memsz = 0;
@@ -3977,13 +4066,13 @@
 	      if ((sec->flags & SEC_LOAD) != 0
 		  || (sec->flags & SEC_THREAD_LOCAL) == 0
 		  || p->p_type == PT_TLS)
-	      p->p_memsz += sec->_raw_size;
+	      p->p_memsz += sec->size;
 
 	      if ((flags & SEC_LOAD) != 0)
-		p->p_filesz += sec->_raw_size;
+		p->p_filesz += sec->size;
 
 	      if (p->p_type == PT_TLS
-		  && sec->_raw_size == 0
+		  && sec->size == 0
 		  && (sec->flags & SEC_HAS_CONTENTS) == 0)
 		{
 		  struct bfd_link_order *o;
@@ -4037,6 +4126,37 @@
 	      if (! m->p_paddr_valid)
 		p->p_paddr = phdrs_paddr;
 	    }
+	  else if (p->p_type == PT_GNU_RELRO)
+	    {
+	      Elf_Internal_Phdr *lp;
+
+	      for (lp = phdrs; lp < phdrs + count; ++lp)
+		{
+		  if (lp->p_type == PT_LOAD
+		      && lp->p_vaddr <= link_info->relro_end
+		      && lp->p_vaddr >= link_info->relro_start
+		      && lp->p_vaddr + lp->p_filesz
+			 >= link_info->relro_end)
+		    break;
+		}
+
+	      if (lp < phdrs + count
+		  && link_info->relro_end > lp->p_vaddr)
+		{
+		  p->p_vaddr = lp->p_vaddr;
+		  p->p_paddr = lp->p_paddr;
+		  p->p_offset = lp->p_offset;
+		  p->p_filesz = link_info->relro_end - lp->p_vaddr;
+		  p->p_memsz = p->p_filesz;
+		  p->p_align = 1;
+		  p->p_flags = (lp->p_flags & ~PF_W);
+		}
+	      else
+		{
+		  memset (p, 0, sizeof *p);
+		  p->p_type = PT_NULL;
+		}
+	    }
 	}
     }
 
@@ -4124,6 +4244,12 @@
       ++segs;
     }
 
+  if (elf_tdata (abfd)->relro)
+    {
+      /* We need a PT_GNU_RELRO segment.  */
+      ++segs;
+    }
+
   for (s = abfd->sections; s != NULL; s = s->next)
     {
       if ((s->flags & SEC_LOAD) != 0
@@ -4616,7 +4742,7 @@
 #define SECTION_SIZE(section, segment)					\
   (((section->flags & (SEC_HAS_CONTENTS | SEC_THREAD_LOCAL))		\
     != SEC_THREAD_LOCAL || segment->p_type == PT_TLS)			\
-   ? section->_raw_size : 0)
+   ? section->size : 0)
 
   /* Returns TRUE if the given section is contained within
      the given segment.  VMA addresses are compared.  */
@@ -4638,7 +4764,7 @@
    && bfd_get_format (ibfd) == bfd_core					\
    && s->vma == 0 && s->lma == 0					\
    && (bfd_vma) s->filepos >= p->p_offset				\
-   && ((bfd_vma) s->filepos + s->_raw_size				\
+   && ((bfd_vma) s->filepos + s->size				\
        <= p->p_offset + p->p_filesz))
 
   /* The complicated case when p_vaddr is 0 is to handle the Solaris
@@ -4650,9 +4776,9 @@
    && p->p_memsz == 0							\
    && p->p_filesz > 0							\
    && (s->flags & SEC_HAS_CONTENTS) != 0				\
-   && s->_raw_size > 0							\
+   && s->size > 0							\
    && (bfd_vma) s->filepos >= p->p_offset				\
-   && ((bfd_vma) s->filepos + s->_raw_size				\
+   && ((bfd_vma) s->filepos + s->size				\
        <= p->p_offset + p->p_filesz))
 
   /* Decide if the given section should be included in the given segment.
@@ -5050,10 +5176,10 @@
 		      /* If the gap between the end of the previous section
 			 and the start of this section is more than
 			 maxpagesize then we need to start a new segment.  */
-		      if ((BFD_ALIGN (prev_sec->lma + prev_sec->_raw_size,
+		      if ((BFD_ALIGN (prev_sec->lma + prev_sec->size,
 				      maxpagesize)
 			   < BFD_ALIGN (output_section->lma, maxpagesize))
-			  || ((prev_sec->lma + prev_sec->_raw_size)
+			  || ((prev_sec->lma + prev_sec->size)
 			      > output_section->lma))
 			{
 			  if (suggested_lma == 0)
@@ -5190,24 +5316,6 @@
       || obfd->xvec->flavour != bfd_target_elf_flavour)
     return TRUE;
 
-  if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL)
-    {
-	asection *s;
-
-	/* Only set up the segments if there are no more SEC_ALLOC
-	   sections.  FIXME: This won't do the right thing if objcopy is
-	   used to remove the last SEC_ALLOC section, since objcopy
-	   won't call this routine in that case.  */
-	for (s = isec->next; s != NULL; s = s->next)
-	  if ((s->flags & SEC_ALLOC) != 0)
-	    break;
-	if (s == NULL)
-	  {
-	    if (! copy_private_bfd_data (ibfd, obfd))
-	      return FALSE;
-	  }
-    }
-
   ihdr = &elf_section_data (isec)->this_hdr;
   ohdr = &elf_section_data (osec)->this_hdr;
 
@@ -5230,6 +5338,29 @@
   return TRUE;
 }
 
+/* Copy private header information.  */
+
+bfd_boolean
+_bfd_elf_copy_private_header_data (bfd *ibfd, bfd *obfd)
+{
+  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+    return TRUE;
+
+  /* Copy over private BFD data if it has not already been copied.
+     This must be done here, rather than in the copy_private_bfd_data
+     entry point, because the latter is called after the section
+     contents have been set, which means that the program headers have
+     already been worked out.  */
+  if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL)
+    {
+      if (! copy_private_bfd_data (ibfd, obfd))
+	return FALSE;
+    }
+
+  return TRUE;
+}
+
 /* Copy private symbol information.  If this symbol is in a section
    which we did not map into a BFD section, try to map the section
    index correctly.  We use special macro definitions for the mapped
@@ -5684,7 +5815,7 @@
     if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd)
 	&& (elf_section_data (s)->this_hdr.sh_type == SHT_REL
 	    || elf_section_data (s)->this_hdr.sh_type == SHT_RELA))
-      ret += ((s->_raw_size / elf_section_data (s)->this_hdr.sh_entsize)
+      ret += ((s->size / elf_section_data (s)->this_hdr.sh_entsize)
 	      * sizeof (arelent *));
 
   return ret;
@@ -5727,7 +5858,7 @@
 
 	  if (! (*slurp_relocs) (abfd, s, syms, TRUE))
 	    return -1;
-	  count = s->_raw_size / elf_section_data (s)->this_hdr.sh_entsize;
+	  count = s->size / elf_section_data (s)->this_hdr.sh_entsize;
 	  p = s->relocation;
 	  for (i = 0; i < count; i++)
 	    *storage++ = p++;
@@ -6329,7 +6460,7 @@
   if (sect2 == NULL)
     return FALSE;
 
-  sect2->_raw_size = sect->_raw_size;
+  sect2->size = sect->size;
   sect2->filepos = sect->filepos;
   sect2->flags = sect->flags;
   sect2->alignment_power = sect->alignment_power;
@@ -6366,7 +6497,7 @@
   sect = bfd_make_section_anyway (abfd, threaded_name);
   if (sect == NULL)
     return FALSE;
-  sect->_raw_size = size;
+  sect->size = size;
   sect->filepos = filepos;
   sect->flags = SEC_HAS_CONTENTS;
   sect->alignment_power = 2;
@@ -6385,14 +6516,14 @@
 static bfd_boolean
 elfcore_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 {
-  size_t raw_size;
+  size_t size;
   int offset;
 
   if (note->descsz == sizeof (prstatus_t))
     {
       prstatus_t prstat;
 
-      raw_size = sizeof (prstat.pr_reg);
+      size = sizeof (prstat.pr_reg);
       offset   = offsetof (prstatus_t, pr_reg);
       memcpy (&prstat, note->descdata, sizeof (prstat));
 
@@ -6418,7 +6549,7 @@
       /* 64-bit host, 32-bit corefile */
       prstatus32_t prstat;
 
-      raw_size = sizeof (prstat.pr_reg);
+      size = sizeof (prstat.pr_reg);
       offset   = offsetof (prstatus32_t, pr_reg);
       memcpy (&prstat, note->descdata, sizeof (prstat));
 
@@ -6448,7 +6579,7 @@
 
   /* Make a ".reg/999" section and a ".reg" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 #endif /* defined (HAVE_PRSTATUS_T) */
 
@@ -6652,13 +6783,13 @@
     return FALSE;
 
 #if defined (HAVE_LWPSTATUS_T_PR_CONTEXT)
-  sect->_raw_size = sizeof (lwpstat.pr_context.uc_mcontext.gregs);
+  sect->size = sizeof (lwpstat.pr_context.uc_mcontext.gregs);
   sect->filepos = note->descpos
     + offsetof (lwpstatus_t, pr_context.uc_mcontext.gregs);
 #endif
 
 #if defined (HAVE_LWPSTATUS_T_PR_REG)
-  sect->_raw_size = sizeof (lwpstat.pr_reg);
+  sect->size = sizeof (lwpstat.pr_reg);
   sect->filepos = note->descpos + offsetof (lwpstatus_t, pr_reg);
 #endif
 
@@ -6682,13 +6813,13 @@
     return FALSE;
 
 #if defined (HAVE_LWPSTATUS_T_PR_CONTEXT)
-  sect->_raw_size = sizeof (lwpstat.pr_context.uc_mcontext.fpregs);
+  sect->size = sizeof (lwpstat.pr_context.uc_mcontext.fpregs);
   sect->filepos = note->descpos
     + offsetof (lwpstatus_t, pr_context.uc_mcontext.fpregs);
 #endif
 
 #if defined (HAVE_LWPSTATUS_T_PR_FPREG)
-  sect->_raw_size = sizeof (lwpstat.pr_fpreg);
+  sect->size = sizeof (lwpstat.pr_fpreg);
   sect->filepos = note->descpos + offsetof (lwpstatus_t, pr_fpreg);
 #endif
 
@@ -6737,7 +6868,7 @@
       if (sect == NULL)
 	return FALSE;
 
-      sect->_raw_size = sizeof (pstatus.data.thread_info.thread_context);
+      sect->size = sizeof (pstatus.data.thread_info.thread_context);
       sect->filepos = (note->descpos
 		       + offsetof (struct win32_pstatus,
 				   data.thread_info.thread_context));
@@ -6765,7 +6896,7 @@
       if (sect == NULL)
 	return FALSE;
 
-      sect->_raw_size = note->descsz;
+      sect->size = note->descsz;
       sect->filepos = note->descpos;
       sect->flags = SEC_HAS_CONTENTS;
       sect->alignment_power = 2;
@@ -6841,7 +6972,7 @@
 
 	if (sect == NULL)
 	  return FALSE;
-	sect->_raw_size = note->descsz;
+	sect->size = note->descsz;
 	sect->filepos = note->descpos;
 	sect->flags = SEC_HAS_CONTENTS;
 	sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32;
@@ -6994,7 +7125,7 @@
   if (sect == NULL)
     return FALSE;
 
-  sect->_raw_size       = note->descsz;
+  sect->size            = note->descsz;
   sect->filepos         = note->descpos;
   sect->flags           = SEC_HAS_CONTENTS;
   sect->alignment_power = 2;
@@ -7021,7 +7152,7 @@
   if (sect == NULL)
     return FALSE;
 
-  sect->_raw_size       = note->descsz;
+  sect->size            = note->descsz;
   sect->filepos         = note->descpos;
   sect->flags           = SEC_HAS_CONTENTS;
   sect->alignment_power = 2;
@@ -7432,9 +7563,18 @@
       rel->r_addend =
 	_bfd_merged_section_offset (abfd, psec,
 				    elf_section_data (sec)->sec_info,
-				    sym->st_value + rel->r_addend,
-				    0);
-      sec = *psec;
+				    sym->st_value + rel->r_addend);
+      if (sec != *psec)
+	{
+	  /* If we have changed the section, and our original section is
+	     marked with SEC_EXCLUDE, it means that the original
+	     SEC_MERGE section has been completely subsumed in some
+	     other SEC_MERGE section.  In this case, we need to leave
+	     some info around for --emit-relocs.  */
+	  if ((sec->flags & SEC_EXCLUDE) != 0)
+	    sec->kept_section = *psec;
+	  sec = *psec;
+	}
       rel->r_addend -= relocation;
       rel->r_addend += sec->output_section->vma + sec->output_offset;
     }
@@ -7454,24 +7594,20 @@
 
   return _bfd_merged_section_offset (abfd, psec,
 				     elf_section_data (sec)->sec_info,
-				     sym->st_value + addend, 0);
+				     sym->st_value + addend);
 }
 
 bfd_vma
 _bfd_elf_section_offset (bfd *abfd,
-			 struct bfd_link_info *info,
+			 struct bfd_link_info *info ATTRIBUTE_UNUSED,
 			 asection *sec,
 			 bfd_vma offset)
 {
-  struct bfd_elf_section_data *sec_data;
-
-  sec_data = elf_section_data (sec);
   switch (sec->sec_info_type)
     {
     case ELF_INFO_TYPE_STABS:
-      return _bfd_stab_section_offset (abfd,
-				       &elf_hash_table (info)->merge_info,
-				       sec, &sec_data->sec_info, offset);
+      return _bfd_stab_section_offset (sec, elf_section_data (sec)->sec_info,
+				       offset);
     case ELF_INFO_TYPE_EH_FRAME:
       return _bfd_elf_eh_frame_section_offset (abfd, sec, offset);
     default:
@@ -7502,3 +7638,79 @@
   return (*get_elf_backend_data (templ)->elf_backend_bfd_from_remote_memory)
     (templ, ehdr_vma, loadbasep, target_read_memory);
 }
+
+long
+_bfd_elf_get_synthetic_symtab (bfd *abfd, asymbol **dynsyms, asymbol **ret)
+{
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  asection *relplt;
+  asymbol *s;
+  const char *relplt_name;
+  bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean);
+  arelent *p;
+  long count, i, n;
+  size_t size;
+  Elf_Internal_Shdr *hdr;
+  char *names;
+  asection *plt;
+
+  *ret = NULL;
+  if (!bed->plt_sym_val)
+    return 0;
+
+  relplt_name = bed->relplt_name;
+  if (relplt_name == NULL)
+    relplt_name = bed->default_use_rela_p ? ".rela.plt" : ".rel.plt";
+  relplt = bfd_get_section_by_name (abfd, relplt_name);
+  if (relplt == NULL)
+    return 0;
+
+  hdr = &elf_section_data (relplt)->this_hdr;
+  if (hdr->sh_link != elf_dynsymtab (abfd)
+      || (hdr->sh_type != SHT_REL && hdr->sh_type != SHT_RELA))
+    return 0;
+
+  plt = bfd_get_section_by_name (abfd, ".plt");
+  if (plt == NULL)
+    return 0;
+
+  slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table;
+  if (! (*slurp_relocs) (abfd, relplt, dynsyms, TRUE))
+    return -1;
+
+  count = relplt->size / hdr->sh_entsize;
+  size = count * sizeof (asymbol);
+  p = relplt->relocation;
+  for (i = 0; i < count; i++, s++, p++)
+    size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt");
+
+  s = *ret = bfd_malloc (size);
+  if (s == NULL)
+    return -1;
+
+  names = (char *) (s + count);
+  p = relplt->relocation;
+  n = 0;
+  for (i = 0; i < count; i++, s++, p++)
+    {
+      size_t len;
+      bfd_vma addr;
+
+      addr = bed->plt_sym_val (i, plt, p);
+      if (addr == (bfd_vma) -1)
+	continue;
+
+      *s = **p->sym_ptr_ptr;
+      s->section = plt;
+      s->value = addr - plt->vma;
+      s->name = names;
+      len = strlen ((*p->sym_ptr_ptr)->name);
+      memcpy (names, (*p->sym_ptr_ptr)->name, len);
+      names += len;
+      memcpy (names, "@plt", sizeof ("@plt"));
+      names += sizeof ("@plt");
+      ++n;
+    }
+
+  return n;
+}
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index 33f85bd..6854b7d 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -106,7 +106,7 @@
 bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
   PARAMS ((bfd *, struct bfd_link_info *));
 bfd_boolean bfd_elf32_arm_process_before_allocation
-  PARAMS ((bfd *, struct bfd_link_info *, int));
+  PARAMS ((bfd *, struct bfd_link_info *, int, int));
 #endif
 
 
@@ -190,6 +190,26 @@
 
 #endif
 
+/* Used to build a map of a section.  This is required for mixed-endian
+   code/data.  */
+
+typedef struct elf32_elf_section_map
+{
+  bfd_vma vma;
+  char type;
+}
+elf32_arm_section_map;
+
+struct _arm_elf_section_data
+{
+  struct bfd_elf_section_data elf;
+  int mapcount;
+  elf32_arm_section_map *map;
+};
+
+#define elf32_arm_section_data(sec) \
+  ((struct _arm_elf_section_data *) elf_section_data (sec))
+
 /* The ARM 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
@@ -247,6 +267,9 @@
        length should be applied by the linker.  */
     int no_pipeline_knowledge;
 
+    /* Nonzero to output a BE8 image.  */
+    int byteswap_code;
+
     /* Short-cuts to get to dynamic linker sections.  */
     asection *sgot;
     asection *sgotplt;
@@ -430,6 +453,7 @@
   ret->arm_glue_size = 0;
   ret->bfd_of_glue_owner = NULL;
   ret->no_pipeline_knowledge = 0;
+  ret->byteswap_code = 0;
   ret->sym_sec.abfd = NULL;
 
   return &ret->root.root;
@@ -565,7 +589,7 @@
       foo = (bfd_byte *) bfd_alloc (globals->bfd_of_glue_owner,
 				    globals->arm_glue_size);
 
-      s->_raw_size = s->_cooked_size = globals->arm_glue_size;
+      s->size = globals->arm_glue_size;
       s->contents = foo;
     }
 
@@ -581,7 +605,7 @@
       foo = (bfd_byte *) bfd_alloc (globals->bfd_of_glue_owner,
 				    globals->thumb_glue_size);
 
-      s->_raw_size = s->_cooked_size = globals->thumb_glue_size;
+      s->size = globals->thumb_glue_size;
       s->contents = foo;
     }
 
@@ -808,10 +832,13 @@
 }
 
 bfd_boolean
-bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge)
+bfd_elf32_arm_process_before_allocation (abfd, link_info,
+					 no_pipeline_knowledge,
+					 byteswap_code)
      bfd *abfd;
      struct bfd_link_info *link_info;
      int no_pipeline_knowledge;
+     int byteswap_code;
 {
   Elf_Internal_Shdr *symtab_hdr;
   Elf_Internal_Rela *internal_relocs = NULL;
@@ -834,6 +861,14 @@
   BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
 
   globals->no_pipeline_knowledge = no_pipeline_knowledge;
+  if (byteswap_code && !bfd_big_endian (abfd))
+    {
+      _bfd_error_handler (
+	  _("%s: BE8 images only valid in big-endian mode."),
+	  bfd_archive_filename (abfd));
+      return FALSE;
+    }
+  globals->byteswap_code = byteswap_code;
 
   /* Rummage around all the relocs and map the glue vectors.  */
   sec = abfd->sections;
@@ -881,12 +916,7 @@
 	      else
 		{
 		  /* Go get them off disk.  */
-		  contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-		  if (contents == NULL)
-		    goto error_return;
-
-		  if (!bfd_get_section_contents (abfd, sec, contents,
-						 (file_ptr) 0, sec->_raw_size))
+		  if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		    goto error_return;
 		}
 	    }
@@ -1209,18 +1239,6 @@
   return TRUE;
 }
 
-/* This is the condition under which elf32_arm_finish_dynamic_symbol
-   will be called from elflink.h.  If elflink.h doesn't call our
-   finish_dynamic_symbol routine, we'll need to do something about
-   initializing any .plt and .got entries in elf32_arm_relocate_section
-   and elf32_arm_final_link_relocate.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H)			\
-  ((DYN)								\
-   && ((SHARED)							 	\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Perform a relocation as part of a final link.  */
 
 static bfd_reloc_status_type
@@ -1338,6 +1356,8 @@
 	 into the output file to be resolved at run time.  */
       if (info->shared
 	  && (input_section->flags & SEC_ALLOC)
+	  && (r_type != R_ARM_REL32
+	      || !SYMBOL_CALLS_LOCAL (info, h))
 	  && (h == NULL
 	      || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 	      || h->root.type != bfd_link_hash_undefweak)
@@ -1744,6 +1764,33 @@
 	return bfd_reloc_ok;
       }
 
+#ifndef OLD_ARM_ABI
+    case R_ARM_ALU_PCREL7_0:
+    case R_ARM_ALU_PCREL15_8:
+    case R_ARM_ALU_PCREL23_15:
+      {
+	bfd_vma insn;
+	bfd_vma relocation;
+
+	insn = bfd_get_32 (input_bfd, hit_data);
+#if USE_REL
+	/* Extract the addend.  */
+	addend = (insn & 0xff) << ((insn & 0xf00) >> 7);
+	signed_addend = addend;
+#endif
+	relocation = value + signed_addend;
+
+	relocation -= (input_section->output_section->vma
+		       + input_section->output_offset
+		       + rel->r_offset);
+	insn = (insn & ~0xfff)
+	       | ((howto->bitpos << 7) & 0xf00)
+	       | ((relocation >> howto->bitpos) & 0xff);
+	bfd_put_32 (input_bfd, value, hit_data);
+      }
+      return bfd_reloc_ok;
+#endif
+
     case R_ARM_GNU_VTINHERIT:
     case R_ARM_GNU_VTENTRY:
       return bfd_reloc_ok;
@@ -2140,6 +2187,8 @@
 	        case R_ARM_PC24:
 	        case R_ARM_ABS32:
 		case R_ARM_THM_PC22:
+	        case R_ARM_PLT32:
+
 	          if (info->shared
 	              && (
 			  (!info->symbolic && h->dynindx != -1)
@@ -2173,11 +2222,6 @@
 	            relocation = 0;
 		  break;
 
-	        case R_ARM_PLT32:
-	          if (h->plt.offset != (bfd_vma)-1)
-	            relocation = 0;
-		  break;
-
 	        default:
 		  if (unresolved_reloc)
 		    _bfd_error_handler
@@ -2991,7 +3035,8 @@
 	    if (info->shared
 		&& (sec->flags & SEC_ALLOC) != 0
 		&& ((ELF32_R_TYPE (rel->r_info) != R_ARM_PC24
-		     && ELF32_R_TYPE (rel->r_info) != R_ARM_PLT32)
+		     && ELF32_R_TYPE (rel->r_info) != R_ARM_PLT32
+		     && ELF32_R_TYPE (rel->r_info) != R_ARM_REL32)
 		    || (h != NULL
 			&& (! info->symbolic
 			    || (h->elf_link_hash_flags
@@ -3080,14 +3125,14 @@
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_ARM_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
             return FALSE;
           break;
         }
@@ -3281,7 +3326,7 @@
 
       srel = bfd_get_section_by_name (dynobj, ".rel.bss");
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf32_External_Rel);
+      srel->size += sizeof (Elf32_External_Rel);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -3292,8 +3337,7 @@
     power_of_two = 3;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (! bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -3302,10 +3346,10 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
@@ -3343,7 +3387,7 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -3354,10 +3398,10 @@
 
 	  /* If this is the first .plt entry, make room for the special
 	     first entry.  */
-	  if (s->_raw_size == 0)
-	    s->_raw_size += PLT_HEADER_SIZE;
+	  if (s->size == 0)
+	    s->size += PLT_HEADER_SIZE;
 
-	  h->plt.offset = s->_raw_size;
+	  h->plt.offset = s->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
@@ -3372,14 +3416,14 @@
 	    }
 
 	  /* Make room for this entry.  */
-	  s->_raw_size += PLT_ENTRY_SIZE;
+	  s->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.  */
-	  htab->sgotplt->_raw_size += 4;
+	  htab->sgotplt->size += 4;
 
 	  /* We also need to make an entry in the .rel.plt section.  */
-	  htab->srelplt->_raw_size += sizeof (Elf32_External_Rel);
+	  htab->srelplt->size += sizeof (Elf32_External_Rel);
 	}
       else
 	{
@@ -3403,19 +3447,19 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       s = htab->sgot;
-      h->got.offset = s->_raw_size;
-      s->_raw_size += 4;
+      h->got.offset = s->size;
+      s->size += 4;
       dyn = htab->root.dynamic_sections_created;
       if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 	   || h->root.type != bfd_link_hash_undefweak)
 	  && (info->shared
 	      || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
-	htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
+	htab->srelgot->size += sizeof (Elf32_External_Rel);
     }
   else
     h->got.offset = (bfd_vma) -1;
@@ -3456,7 +3500,7 @@
 	  if (h->dynindx == -1
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	    {
-	      if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -3475,7 +3519,7 @@
   for (p = eh->relocs_copied; p != NULL; p = p->next)
     {
       asection *sreloc = elf_section_data (p->section)->sreloc;
-      sreloc->_raw_size += p->count * sizeof (Elf32_External_Rel);
+      sreloc->size += p->count * sizeof (Elf32_External_Rel);
     }
 
   return TRUE;
@@ -3506,7 +3550,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -3545,7 +3589,7 @@
 	      else if (p->count != 0)
 		{
 		  srel = elf_section_data (p->section)->sreloc;
-		  srel->_raw_size += p->count * sizeof (Elf32_External_Rel);
+		  srel->size += p->count * sizeof (Elf32_External_Rel);
 		  if ((p->section->output_section->flags & SEC_READONLY) != 0)
 		    info->flags |= DF_TEXTREL;
 		}
@@ -3565,10 +3609,10 @@
 	{
 	  if (*local_got > 0)
 	    {
-	      *local_got = s->_raw_size;
-	      s->_raw_size += 4;
+	      *local_got = s->size;
+	      s->size += 4;
 	      if (info->shared)
-		srel->_raw_size += sizeof (Elf32_External_Rel);
+		srel->size += sizeof (Elf32_External_Rel);
 	    }
 	  else
 	    *local_got = (bfd_vma) -1;
@@ -3600,7 +3644,7 @@
 
       if (strcmp (name, ".plt") == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* Strip this section if we don't need it; see the
                  comment below.  */
@@ -3614,7 +3658,7 @@
 	}
       else if (strncmp (name, ".rel", 4) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is mostly to handle .rel.bss and
@@ -3652,8 +3696,8 @@
 	}
 
       /* Allocate memory for the section contents.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
     }
 
@@ -3665,7 +3709,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (!info->shared)
 	{
@@ -3897,7 +3941,7 @@
       BFD_ASSERT (splt != NULL && sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
 
       for (; dyncon < dynconend; dyncon++)
 	{
@@ -3927,10 +3971,7 @@
 	    case DT_PLTRELSZ:
 	      s = bfd_get_section_by_name (output_bfd, ".rel.plt");
 	      BFD_ASSERT (s != NULL);
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size;
-	      else
-		dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
@@ -3946,12 +3987,7 @@
 		 about changing the DT_REL entry.  */
 	      s = bfd_get_section_by_name (output_bfd, ".rel.plt");
 	      if (s != NULL)
-		{
-		  if (s->_cooked_size != 0)
-		    dyn.d_un.d_val -= s->_cooked_size;
-		  else
-		    dyn.d_un.d_val -= s->_raw_size;
-		}
+		dyn.d_un.d_val -= s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
@@ -3983,7 +4019,7 @@
 	}
 
       /* Fill in the first entry in the procedure linkage table.  */
-      if (splt->_raw_size > 0)
+      if (splt->size > 0)
 	{
 	  bfd_vma got_displacement;
 
@@ -4013,7 +4049,7 @@
     }
 
   /* Fill in the first three entries in the global offset table.  */
-  if (sgot->_raw_size > 0)
+  if (sgot->size > 0)
     {
       if (sdyn == NULL)
 	bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
@@ -4036,11 +4072,19 @@
      struct bfd_link_info * link_info ATTRIBUTE_UNUSED;
 {
   Elf_Internal_Ehdr * i_ehdrp;	/* ELF file header, internal form.  */
+  struct elf32_arm_link_hash_table *globals;
 
   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;
+
+  if (link_info)
+    {
+      globals = elf32_arm_hash_table (link_info);
+      if (globals->byteswap_code)
+	i_ehdrp->e_flags |= EF_ARM_BE8;
+    }
 }
 
 static enum elf_reloc_type_class
@@ -4060,7 +4104,7 @@
     }
 }
 
-static bfd_boolean elf32_arm_section_flags           PARAMS ((flagword *, Elf_Internal_Shdr *));
+static bfd_boolean elf32_arm_section_flags           PARAMS ((flagword *, const Elf_Internal_Shdr *));
 static void        elf32_arm_final_write_processing  PARAMS ((bfd *, bfd_boolean));
 
 /* Set the right machine number for an Arm ELF file.  */
@@ -4068,7 +4112,7 @@
 static bfd_boolean
 elf32_arm_section_flags (flags, hdr)
      flagword *flags;
-     Elf_Internal_Shdr *hdr;
+     const Elf_Internal_Shdr *hdr;
 {
   if (hdr->sh_type == SHT_NOTE)
     *flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_SAME_CONTENTS;
@@ -4076,7 +4120,7 @@
   return TRUE;
 }
 
-void
+static void
 elf32_arm_final_write_processing (abfd, linker)
      bfd *abfd;
      bfd_boolean linker ATTRIBUTE_UNUSED;
@@ -4084,6 +4128,148 @@
   bfd_arm_update_notes (abfd, ARM_NOTE_SECTION);
 }
 
+
+/* Called for each symbol.  Builds a section map based on mapping symbols.
+   Does not alter any of the symbols.  */
+
+static bfd_boolean
+elf32_arm_output_symbol_hook (struct bfd_link_info *info,
+			      const char *name,
+			      Elf_Internal_Sym *elfsym,
+			      asection *input_sec,
+			      struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
+{
+  int mapcount;
+  elf32_arm_section_map *map;
+  struct elf32_arm_link_hash_table *globals;
+
+  /* Only do this on final link.  */
+  if (info->relocatable)
+    return TRUE;
+
+  /* Only build a map if we need to byteswap code.  */
+  globals = elf32_arm_hash_table (info);
+  if (!globals->byteswap_code)
+    return TRUE;
+
+  /* We only want mapping symbols.  */
+  if (name == NULL
+      || name[0] != '$'
+      || (name[1] != 'a'
+	  && name[1] != 't'
+	  && name[1] != 'd'))
+    return TRUE;
+
+  mapcount = ++(elf32_arm_section_data (input_sec)->mapcount);
+  map = elf32_arm_section_data (input_sec)->map;
+  /* TODO: This may be inefficient, but we probably don't usually have many
+     mapping symbols per section.  */
+  map = bfd_realloc (map, mapcount * sizeof (elf32_arm_section_map));
+  elf32_arm_section_data (input_sec)->map = map;
+  
+  map[mapcount - 1].vma = elfsym->st_value;
+  map[mapcount - 1].type = name[1];
+  return TRUE;
+}
+
+
+/* Allocate target specific section data.  */
+
+static bfd_boolean
+elf32_arm_new_section_hook (bfd *abfd, asection *sec)
+{
+  struct _arm_elf_section_data *sdata;
+  bfd_size_type amt = sizeof (*sdata);
+
+  sdata = bfd_zalloc (abfd, amt);
+  if (sdata == NULL)
+    return FALSE;
+  sec->used_by_bfd = sdata;
+
+  return _bfd_elf_new_section_hook (abfd, sec);
+}
+
+
+/* Used to order a list of mapping symbols by address.  */
+
+static int
+elf32_arm_compare_mapping (const void * a, const void * b)
+{
+  return ((const elf32_arm_section_map *) a)->vma
+	 > ((const elf32_arm_section_map *) b)->vma;
+}
+
+
+/* Do code byteswapping.  Return FALSE afterwards so that the section is
+   written out as normal.  */
+
+static bfd_boolean
+elf32_arm_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec,
+			 bfd_byte *contents)
+{
+  int mapcount;
+  elf32_arm_section_map *map;
+  bfd_vma ptr;
+  bfd_vma end;
+  bfd_vma offset;
+  bfd_byte tmp;
+  int i;
+  
+  mapcount = elf32_arm_section_data (sec)->mapcount;
+  map = elf32_arm_section_data (sec)->map;
+
+  if (mapcount == 0)
+    return FALSE;
+
+  qsort (map, mapcount, sizeof (elf32_arm_section_map),
+	 elf32_arm_compare_mapping);
+
+  offset = sec->output_section->vma + sec->output_offset;
+  ptr = map[0].vma - offset;
+  for (i = 0; i < mapcount; i++)
+    {
+      if (i == mapcount - 1)
+	end = sec->size;
+      else
+	end = map[i + 1].vma - offset;
+      
+      switch (map[i].type)
+	{
+	case 'a':
+	  /* Byte swap code words.  */
+	  while (ptr + 3 < end)
+	    {
+	      tmp = contents[ptr];
+	      contents[ptr] = contents[ptr + 3];
+	      contents[ptr + 3] = tmp;
+	      tmp = contents[ptr + 1];
+	      contents[ptr + 1] = contents[ptr + 2];
+	      contents[ptr + 2] = tmp;
+	      ptr += 4;
+	    }
+	  break;
+
+	case 't':
+	  /* Byte swap code halfwords.  */
+	  while (ptr + 1 < end)
+	    {
+	      tmp = contents[ptr];
+	      contents[ptr] = contents[ptr + 1];
+	      contents[ptr + 1] = tmp;
+	      ptr += 2;
+	    }
+	  break;
+
+	case 'd':
+	  /* Leave data alone.  */
+	  break;
+	}
+      ptr = end;
+    }
+  free (map);
+  return FALSE;
+}
+
 #define ELF_ARCH			bfd_arch_arm
 #define ELF_MACHINE_CODE		EM_ARM
 #ifdef __QNXTARGET__
@@ -4099,16 +4285,19 @@
 #define bfd_elf32_bfd_link_hash_table_create    elf32_arm_link_hash_table_create
 #define bfd_elf32_bfd_reloc_type_lookup		elf32_arm_reloc_type_lookup
 #define bfd_elf32_find_nearest_line	        elf32_arm_find_nearest_line
+#define bfd_elf32_new_section_hook		elf32_arm_new_section_hook
 
 #define elf_backend_get_symbol_type             elf32_arm_get_symbol_type
 #define elf_backend_gc_mark_hook                elf32_arm_gc_mark_hook
 #define elf_backend_gc_sweep_hook               elf32_arm_gc_sweep_hook
 #define elf_backend_check_relocs                elf32_arm_check_relocs
 #define elf_backend_relocate_section		elf32_arm_relocate_section
+#define elf_backend_write_section		elf32_arm_write_section
 #define elf_backend_adjust_dynamic_symbol	elf32_arm_adjust_dynamic_symbol
 #define elf_backend_create_dynamic_sections     elf32_arm_create_dynamic_sections
 #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_link_output_symbol_hook	elf32_arm_output_symbol_hook
 #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_reloc_type_class		elf32_arm_reloc_type_class
diff --git a/bfd/elf32-cr16c.c b/bfd/elf32-cr16c.c
new file mode 100644
index 0000000..e722335
--- /dev/null
+++ b/bfd/elf32-cr16c.c
@@ -0,0 +1,1000 @@
+/* BFD back-end for National Semiconductor's CR16C ELF
+   Copyright 2004 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 "bfdlink.h"
+#include "elf/cr16c.h"
+#include "elf-bfd.h"
+
+
+#define USE_REL	1	/* CR16C uses REL relocations instead of RELA.  */
+
+/* The following definition is based on EMPTY_HOWTO macro, 
+   but also initiates the "name" field in HOWTO struct.  */
+#define ONLY_NAME_HOWTO(C) \
+  HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
+	  STRINGX(C), FALSE, 0, 0, FALSE)
+
+/* reloc_map_index array maps CRASM relocation type into a BFD
+   relocation enum. The array's indices are synchronized with 
+   RINDEX_16C_* indices, created in include/elf/cr16c.h.
+   The array is used in:
+   1. elf32-cr16c.c : elf_cr16c_reloc_type_lookup().
+   2. asreloc.c : find_reloc_type(). */
+
+RELOC_MAP reloc_map_index[RINDEX_16C_MAX] =
+{
+  {R_16C_NUM08,     BFD_RELOC_16C_NUM08},
+  {R_16C_NUM08_C,   BFD_RELOC_16C_NUM08_C},
+  {R_16C_NUM16,     BFD_RELOC_16C_NUM16},
+  {R_16C_NUM16_C,   BFD_RELOC_16C_NUM16_C},
+  {R_16C_NUM32,     BFD_RELOC_16C_NUM32},
+  {R_16C_NUM32_C,   BFD_RELOC_16C_NUM32_C},
+  {R_16C_DISP04,    BFD_RELOC_16C_DISP04},
+  {R_16C_DISP04_C,  BFD_RELOC_16C_DISP04_C},
+  {R_16C_DISP08,    BFD_RELOC_16C_DISP08},
+  {R_16C_DISP08_C,  BFD_RELOC_16C_DISP08_C},
+  {R_16C_DISP16,    BFD_RELOC_16C_DISP16},
+  {R_16C_DISP16_C,  BFD_RELOC_16C_DISP16_C},
+  {R_16C_DISP24,    BFD_RELOC_16C_DISP24},
+  {R_16C_DISP24_C,  BFD_RELOC_16C_DISP24_C},
+  {R_16C_DISP24a,   BFD_RELOC_16C_DISP24a},
+  {R_16C_DISP24a_C, BFD_RELOC_16C_DISP24a_C},
+  {R_16C_REG04,     BFD_RELOC_16C_REG04},
+  {R_16C_REG04_C,   BFD_RELOC_16C_REG04_C},
+  {R_16C_REG04a,    BFD_RELOC_16C_REG04a},
+  {R_16C_REG04a_C,  BFD_RELOC_16C_REG04a_C},
+  {R_16C_REG14,     BFD_RELOC_16C_REG14},
+  {R_16C_REG14_C,   BFD_RELOC_16C_REG14_C},
+  {R_16C_REG16,     BFD_RELOC_16C_REG16},
+  {R_16C_REG16_C,   BFD_RELOC_16C_REG16_C},
+  {R_16C_REG20,     BFD_RELOC_16C_REG20},
+  {R_16C_REG20_C,   BFD_RELOC_16C_REG20_C},
+  {R_16C_ABS20,     BFD_RELOC_16C_ABS20},
+  {R_16C_ABS20_C,   BFD_RELOC_16C_ABS20_C},
+  {R_16C_ABS24,     BFD_RELOC_16C_ABS24},
+  {R_16C_ABS24_C,   BFD_RELOC_16C_ABS24_C},
+  {R_16C_IMM04,     BFD_RELOC_16C_IMM04},
+  {R_16C_IMM04_C,   BFD_RELOC_16C_IMM04_C},
+  {R_16C_IMM16,     BFD_RELOC_16C_IMM16},
+  {R_16C_IMM16_C,   BFD_RELOC_16C_IMM16_C},
+  {R_16C_IMM20,     BFD_RELOC_16C_IMM20},
+  {R_16C_IMM20_C,   BFD_RELOC_16C_IMM20_C},
+  {R_16C_IMM24,     BFD_RELOC_16C_IMM24},
+  {R_16C_IMM24_C,   BFD_RELOC_16C_IMM24_C},
+  {R_16C_IMM32,     BFD_RELOC_16C_IMM32},
+  {R_16C_IMM32_C,   BFD_RELOC_16C_IMM32_C}
+};
+
+static reloc_howto_type elf_howto_table[] =
+{
+  /* 00 */ ONLY_NAME_HOWTO (RINDEX_16C_NUM08),
+  /* 01 */ ONLY_NAME_HOWTO (RINDEX_16C_NUM08_C),
+  /* 02 */ ONLY_NAME_HOWTO (RINDEX_16C_NUM16),
+  /* 03 */ ONLY_NAME_HOWTO (RINDEX_16C_NUM16_C),
+  /* 04 */ ONLY_NAME_HOWTO (RINDEX_16C_NUM32),
+  /* 05 */ ONLY_NAME_HOWTO (RINDEX_16C_NUM32_C),
+  /* 06 */ ONLY_NAME_HOWTO (RINDEX_16C_DISP04),
+  /* 07 */ ONLY_NAME_HOWTO (RINDEX_16C_DISP04_C),
+  /* 08 */ ONLY_NAME_HOWTO (RINDEX_16C_DISP08),
+  /* 09 */ ONLY_NAME_HOWTO (RINDEX_16C_DISP08_C),
+  /* 10 */ ONLY_NAME_HOWTO (RINDEX_16C_DISP16),
+  /* 11 */ ONLY_NAME_HOWTO (RINDEX_16C_DISP16_C),
+  /* 12 */ ONLY_NAME_HOWTO (RINDEX_16C_DISP24),
+  /* 13 */ ONLY_NAME_HOWTO (RINDEX_16C_DISP24_C),
+  /* 14 */ ONLY_NAME_HOWTO (RINDEX_16C_DISP24a),
+  /* 15 */ ONLY_NAME_HOWTO (RINDEX_16C_DISP24a_C),
+  /* 16 */ ONLY_NAME_HOWTO (RINDEX_16C_REG04),
+  /* 17 */ ONLY_NAME_HOWTO (RINDEX_16C_REG04_C),
+  /* 18 */ ONLY_NAME_HOWTO (RINDEX_16C_REG04a),
+  /* 19 */ ONLY_NAME_HOWTO (RINDEX_16C_REG04a_C),
+  /* 20 */ ONLY_NAME_HOWTO (RINDEX_16C_REG14),
+  /* 21 */ ONLY_NAME_HOWTO (RINDEX_16C_REG14_C),
+  /* 22 */ ONLY_NAME_HOWTO (RINDEX_16C_REG16),
+  /* 23 */ ONLY_NAME_HOWTO (RINDEX_16C_REG16_C),
+  /* 24 */ ONLY_NAME_HOWTO (RINDEX_16C_REG20),
+  /* 25 */ ONLY_NAME_HOWTO (RINDEX_16C_REG20_C),
+  /* 26 */ ONLY_NAME_HOWTO (RINDEX_16C_ABS20),
+  /* 27 */ ONLY_NAME_HOWTO (RINDEX_16C_ABS20_C),
+  /* 28 */ ONLY_NAME_HOWTO (RINDEX_16C_ABS24),
+  /* 29 */ ONLY_NAME_HOWTO (RINDEX_16C_ABS24_C),
+  /* 30 */ ONLY_NAME_HOWTO (RINDEX_16C_IMM04),
+  /* 31 */ ONLY_NAME_HOWTO (RINDEX_16C_IMM04_C),
+  /* 32 */ ONLY_NAME_HOWTO (RINDEX_16C_IMM16),
+  /* 33 */ ONLY_NAME_HOWTO (RINDEX_16C_IMM16_C),
+  /* 34 */ ONLY_NAME_HOWTO (RINDEX_16C_IMM20),
+  /* 35 */ ONLY_NAME_HOWTO (RINDEX_16C_IMM20_C),
+  /* 36 */ ONLY_NAME_HOWTO (RINDEX_16C_IMM24),
+  /* 37 */ ONLY_NAME_HOWTO (RINDEX_16C_IMM24_C),
+  /* 38 */ ONLY_NAME_HOWTO (RINDEX_16C_IMM32),
+  /* 39 */ ONLY_NAME_HOWTO (RINDEX_16C_IMM32_C)
+};
+
+
+/* Code to turn a code_type into a howto ptr, uses the above howto table.  */
+
+static reloc_howto_type *
+elf_cr16c_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			     bfd_reloc_code_real_type code)
+{
+  unsigned int i;
+
+  for (i = 0; i < RINDEX_16C_MAX; i++)
+    {
+      if (code == reloc_map_index[i].bfd_reloc_enum)
+	{
+	  /* printf ("CR16C Relocation Type is - %x\n", code); */
+	  return & elf_howto_table[i];
+	}
+    }
+
+  /* printf ("This relocation Type is not supported - %x\n", code); */
+  return 0;
+}
+
+static void
+elf_cr16c_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
+			 arelent *cache_ptr ATTRIBUTE_UNUSED,
+			 Elf_Internal_Rela *dst ATTRIBUTE_UNUSED)
+{
+  abort ();
+}
+
+static void
+elf_cr16c_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+			     arelent *cache_ptr,
+			     Elf_Internal_Rela *dst)
+{
+  unsigned int r_type = ELF32_R_TYPE (dst->r_info);
+
+  BFD_ASSERT (r_type < (unsigned int) RINDEX_16C_MAX);
+  cache_ptr->howto = &elf_howto_table[r_type];
+}
+
+/* Perform a relocation as part of a final link.  */
+
+static bfd_reloc_status_type
+cr16c_elf_final_link_relocate (reloc_howto_type *howto,
+			       bfd *abfd,
+			       bfd *output_bfd ATTRIBUTE_UNUSED,
+			       asection *input_section,
+			       bfd_byte *data,
+			       bfd_vma octets,
+			       bfd_vma Rvalue,
+			       bfd_vma addend ATTRIBUTE_UNUSED,
+			       struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			       asection *sym_sec ATTRIBUTE_UNUSED,
+			       int is_local ATTRIBUTE_UNUSED)
+{
+  long value;
+  short sword;			/* Extracted from the hole and put back.  */
+  unsigned long format, addr_type, code_factor;
+  unsigned short size;
+  unsigned short r_type;
+  asymbol *symbol = NULL;
+
+  unsigned long disp20_opcod;
+  char neg = 0;
+  char neg2pos = 0;
+
+  long left_val = 0;
+  long plus_factor = 0;		/* To be added to the hole.  */
+
+#define MIN_BYTE	((int) 0xFFFFFF80)
+#define MIN_WORD	((int) 0xFFFF8000)
+#define	MAX_UWORD	((unsigned) 0x0000FFFF)
+#define	MAX_UBYTE	((unsigned) 0x000000FF)
+
+  r_type = reloc_map_index[howto->type].cr_reloc_type;
+  format = r_type & R_FORMAT;
+  size = r_type & R_SIZESP;
+  addr_type = r_type & R_ADDRTYPE;
+  code_factor = ((addr_type == R_CODE_ADDR) ? 1 : 0);
+
+  if (sym_sec)
+    symbol = sym_sec->symbol;
+
+  switch (format)
+    {
+    case R_NUMBER:
+      switch (size)
+	{
+	case R_S_16C_08: 	/* One byte.  */
+	  value = bfd_get_8 (abfd, (char *) data + octets);
+	  break;
+	case R_S_16C_16: 	/* Two bytes. */
+	  sword = bfd_get_16 (abfd, (bfd_byte *) data + octets);
+	  value = sword;
+	  break;
+	case R_S_16C_32:	/* Four bytes.  */
+	  value = bfd_get_32 (abfd, (bfd_byte *) data + octets);
+	  break;
+	default:
+	  return bfd_reloc_notsupported;
+	}
+      break;
+
+    case R_16C_DISPL:
+      switch (size)
+	{
+	case R_S_16C_04:    /* word1(4-7).  */
+	  value = bfd_get_8 (abfd, (char *) data + octets);
+	  left_val = value & 0xF;
+	  value = (value & 0xF0) >> 4;
+	  value++;
+	  value <<= 1;
+	  break;
+	case R_S_16C_08:    /* word1(0-3,8-11).  */
+	  sword = bfd_get_16 (abfd, (char *) data + octets);
+	  value = sword & 0x000F;
+	  value |= ((sword & 0x0F00) >> 4);
+	  left_val = sword & 0xF0F0;
+	  value <<= 1;
+	  if (value & 0x100)
+	    value |= 0xFFFFFF00;
+	  break;
+	case R_S_16C_16:    /* word2.  */
+	  sword = bfd_get_16 (abfd, (bfd_byte *) data + octets);
+	  value = sword;
+	  value = ((value & 0xFFFE) >> 1) | ((value & 0x1) << 15);
+	  value <<= 1;
+	  if (value & 0x10000)
+	    value |= 0xFFFF0000;
+	  break;
+	case R_S_16C_24_a:	/* word1(0-7),word2.  */
+	  value = bfd_get_32 (abfd, (bfd_byte *) data + octets);
+	  left_val = value & 0x0000FF00;
+	  value = ((value & 0xFFFE0000) >> 17) |
+	    ((value & 0x00010000) << 7) | ((value & 0x000000FF) << 15);
+	  value <<= 1;
+	  if (value & 0x1000000)
+	    value |= 0xFE000000;
+	  break;
+	case R_S_16C_24:    /* word2(0-3,8-11),word3.  */
+	  value = bfd_get_32 (abfd, (bfd_byte *) data + octets);
+	  left_val = value & 0x0000F0F0;
+	  value = ((value >> 16) & 0x0000FFFF) |
+	    ((value & 0x00000F00) << 8) | ((value & 0x0000000F) << 20);
+
+	  value = ((value & 0x00FFFFFE) >> 1) | ((value & 0x00000001) << 23);
+
+	  value <<= 1;
+	  if (value & 0x1000000)
+	    value |= 0xFE000000;
+	  break;
+	default:
+	  return bfd_reloc_notsupported;
+	}
+      break;
+
+    case R_16C_REGREL:
+      switch (size)
+	{
+	case R_S_16C_04:    /* word1(12-15) not scaled.  */
+	  value = bfd_get_8 (abfd, (char *) data + octets);
+	  left_val = value & 0xF0;
+	  value = value & 0xF;
+	  break;
+	case R_S_16C_04_a:	/* word1(12-15) scaled by 2.  */
+	  value = bfd_get_8 (abfd, (char *) data + octets);
+	  left_val = value & 0xF0;
+	  value = value & 0xF;
+	  value <<= 1;
+	  break;
+	case R_S_16C_14:    /* word1(4-5),word2(0-3,8-15).  */
+	  value = bfd_get_32 (abfd, (bfd_byte *) data + octets);
+	  left_val = value & 0x00F0FFCF;
+	  value = ((value & 0xc0000000) >> 24) |
+	    ((value & 0x3F000000) >> 16) |
+	    ((value & 0x000F0000) >> 16) | (value & 0x00000030);
+	  break;
+	case R_S_16C_16:    /* word2.  */
+	  sword = bfd_get_16 (abfd, (bfd_byte *) data + octets);
+	  value = sword;
+	  break;
+	case R_S_16C_20:    /* word2(8-11),word3.  */
+	  value = bfd_get_32 (abfd, (bfd_byte *) data + octets);
+	  left_val = value & 0xF0;
+	  value = (value & 0xF) << 16;
+	  sword = bfd_get_16 (abfd, (bfd_byte *) data + octets + 1);
+	  value = value | (unsigned short) sword;
+	  disp20_opcod = bfd_get_32 (abfd, (bfd_byte *) data + octets - 3);
+	  disp20_opcod |= 0x0FFF0000;
+	  if ((disp20_opcod == 0x4FFF0018) ||	/* loadb -disp20(reg) */
+	      (disp20_opcod == 0x5FFF0018) ||	/* loadb -disp20(rp)  */
+	      (disp20_opcod == 0x8FFF0018) ||	/* loadd -disp20(reg) */
+	      (disp20_opcod == 0x9FFF0018) ||	/* loadd -disp20(rp)  */
+	      (disp20_opcod == 0xCFFF0018) ||	/* loadw -disp20(reg) */
+	      (disp20_opcod == 0xDFFF0018) ||	/* loadw -disp20(rp)  */
+	      (disp20_opcod == 0x4FFF0019) ||	/* storb -disp20(reg) */
+	      (disp20_opcod == 0x5FFF0019) ||	/* storb -disp20(rp)  */
+	      (disp20_opcod == 0x8FFF0019) ||	/* stord -disp20(reg) */
+	      (disp20_opcod == 0x9FFF0019) ||	/* stord -disp20(rp)  */
+	      (disp20_opcod == 0xCFFF0019) ||	/* storw -disp20(reg) */
+	      (disp20_opcod == 0xDFFF0019))
+	    {	/* storw -disp20(rp).  */
+	      neg = 1;
+	      value |= 0xFFF00000;
+	    }
+
+	  break;
+	default:
+	  return bfd_reloc_notsupported;
+	}
+      break;
+
+    case R_16C_ABS:
+      switch (size)
+	{
+	case R_S_16C_20:    /* word1(0-3),word2.  */
+	  value = bfd_get_32 (abfd, (bfd_byte *) data + octets);
+	  left_val = value & 0x0000FFF0;
+	  value = ((value & 0xFFFF0000) >> 16) |
+	    ((value & 0x0000000F) << 16);
+	  break;
+	case R_S_16C_24:   /* word2(0-3,8-11),word3.  */
+	  value = bfd_get_32 (abfd, (bfd_byte *) data + octets);
+	  left_val = value & 0x0000F0F0;
+	  value = ((value & 0xFFFF0000) >> 16) |
+	    ((value & 0x00000F00) << 8) | ((value & 0x0000000F) << 20);
+	  break;
+	default:
+	  return bfd_reloc_notsupported;
+	}
+      break;
+
+    case R_16C_IMMED:
+      switch (size)
+	{
+	case R_S_16C_04:    /* word1/2(4-7).  */
+	  value = bfd_get_8 (abfd, (char *) data + octets);
+	  left_val = value & 0xF;
+	  value = (value & 0xF0) >> 4;
+	  break;
+	case R_S_16C_16:    /* word2.  */
+	  sword = bfd_get_16 (abfd, (bfd_byte *) data + octets);
+	  value = sword;
+	  break;
+	case R_S_16C_20:    /* word1(0-3),word2.  */
+	  value = bfd_get_32 (abfd, (bfd_byte *) data + octets);
+	  left_val = value & 0x0000FFF0;
+	  value = ((value & 0xFFFF0000) >> 16) |
+	    ((value & 0x0000000F) << 16);
+	  break;
+	case R_S_16C_32:    /* word2, word3.  */
+	  value = bfd_get_32 (abfd, (bfd_byte *) data + octets);
+	  value = ((value & 0x0000FFFF) << 16) |
+	    ((value & 0xFFFF0000) >> 16);
+	  break;
+	default:
+	  return bfd_reloc_notsupported;
+	}
+      break;
+    default:
+      return bfd_reloc_notsupported;
+    }
+
+  switch ((r_type & R_RELTO) >> 4)
+    {
+
+    case 0:	/* R_ABS.  */
+      plus_factor = Rvalue;
+      break;
+    case 1:	/* R_PCREL.  */
+      plus_factor = Rvalue -
+	(input_section->output_section->vma + input_section->output_offset);
+      break;
+    default:
+      return bfd_reloc_notsupported;
+    }
+
+  if (neg)
+    {
+      if (plus_factor >= -value)
+	neg2pos = 1;
+      /* We need to change load/stor with negative
+	 displ opcode to positive disp opcode (CR16C).  */
+    }
+
+  value = value + (plus_factor >> code_factor);
+
+  switch (format)
+    {
+    case R_NUMBER:
+      switch (size)
+	{
+	case R_S_16C_08: 	/* One byte.  */
+	  if (value > (int) MAX_UBYTE || value < MIN_BYTE)
+	    return bfd_reloc_overflow;
+	  value &= 0xFF;
+	  bfd_put_8 (abfd, (bfd_vma) value, (unsigned char *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_16:	/* Two bytes.  */
+	  if (value > (int) MAX_UWORD || value < MIN_WORD)
+	    return bfd_reloc_overflow;
+	  value &= 0xFFFF;
+	  sword = value;
+	  bfd_put_16 (abfd, (bfd_vma) sword,
+		      (unsigned char *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_32:	/* Four bytes.  */
+	  value &= 0xFFFFFFFF;
+	  bfd_put_32 (abfd, (bfd_vma) value, (bfd_byte *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	default:
+	  return bfd_reloc_notsupported;
+	}
+      break;
+
+    case R_16C_DISPL:
+      switch (size)
+	{
+	case R_S_16C_04:	/* word1(4-7).  */
+	  if ((value - 32) > 32 || value < 2)
+	    return bfd_reloc_overflow;
+	  value >>= 1;
+	  value--;
+	  value &= 0xF;
+	  value <<= 4;
+	  value |= left_val;
+	  bfd_put_8 (abfd, (bfd_vma) value, (unsigned char *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_08:    /* word1(0-3,8-11).  */
+	  if (value > 255 || value < -256 || value == 0x80)
+	    return bfd_reloc_overflow;
+	  value &= 0x1FF;
+	  value >>= 1;
+	  sword = value & 0x000F;
+	  sword |= (value & 0x00F0) << 4;
+	  sword |= left_val;
+	  bfd_put_16 (abfd, (bfd_vma) sword,
+		      (unsigned char *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_16:    /* word2.  */
+	  if (value > 65535 || value < -65536)
+	    return bfd_reloc_overflow;
+	  value >>= 1;
+	  value &= 0xFFFF;
+	  value = ((value & 0x8000) >> 15) | ((value & 0x7FFF) << 1);
+	  sword = value;
+	  bfd_put_16 (abfd, (bfd_vma) sword,
+		      (unsigned char *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_24_a:	/* word1(0-7),word2.  */
+	  if (value > 16777215 || value < -16777216)
+	    return bfd_reloc_overflow;
+	  value &= 0x1FFFFFF;
+	  value >>= 1;
+	  value = ((value & 0x00007FFF) << 17) |
+	    ((value & 0x00800000) >> 7) | ((value & 0x007F8000) >> 15);
+	  value |= left_val;
+	  bfd_put_32 (abfd, (bfd_vma) value, (bfd_byte *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_24:    /* word2(0-3,8-11),word3.  */
+	  if (value > 16777215 || value < -16777216)
+	    return bfd_reloc_overflow;
+	  value &= 0x1FFFFFF;
+	  value >>= 1;
+
+	  value = ((value & 0x007FFFFF) << 1) | ((value & 0x00800000) >> 23);
+
+	  value = ((value & 0x0000FFFF) << 16) |
+	    ((value & 0x000F0000) >> 8) | ((value & 0x00F00000) >> 20);
+	  value |= left_val;
+	  bfd_put_32 (abfd, (bfd_vma) value, (bfd_byte *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	default:
+	  return bfd_reloc_notsupported;
+	}
+      break;
+
+    case R_16C_REGREL:
+      switch (size)
+	{
+	case R_S_16C_04:	/* word1(12-15) not scaled.  */
+	  if (value > 13 || value < 0)
+	    return bfd_reloc_overflow;
+	  value &= 0xF;
+	  value |= left_val;
+	  bfd_put_8 (abfd, (bfd_vma) value, (unsigned char *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_04_a:	/* word1(12-15) not scaled.  */
+	  if (value > 26 || value < 0)
+	    return bfd_reloc_overflow;
+	  value &= 0x1F;
+	  value >>= 1;
+	  value |= left_val;
+	  bfd_put_8 (abfd, (bfd_vma) value, (unsigned char *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_14:	/* word1(4-5),word2(0-3,8-15).  */
+	  if (value < 0 || value > 16383)
+	    return bfd_reloc_overflow;
+	  value &= 0x3FFF;
+	  value = ((value & 0x000000c0) << 24) |
+	    ((value & 0x00003F00) << 16) |
+	    ((value & 0x0000000F) << 16) | (value & 0x00000030);
+	  value |= left_val;
+	  bfd_put_32 (abfd, (bfd_vma) value, (bfd_byte *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_16:	/* word2.  */
+	  if (value > 65535 || value < 0)
+	    return bfd_reloc_overflow;
+	  value &= 0xFFFF;
+	  sword = value;
+	  bfd_put_16 (abfd, (bfd_vma) sword,
+		      (unsigned char *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_20:	/* word2(8-11),word3.  */
+	  /* if (value > 1048575 || value < 0) RELOC_ERROR(1); */
+	  value &= 0xFFFFF;
+	  sword = value & 0x0000FFFF;
+	  value = (value & 0x000F0000) >> 16;
+	  value |= left_val;
+	  bfd_put_8 (abfd, (bfd_vma) value, (unsigned char *) data + octets);
+	  bfd_put_16 (abfd, (bfd_vma) sword,
+		      (unsigned char *) data + octets + 1);
+	  if (neg2pos)
+	    {
+	      /* Change load/stor negative displ opcode
+	         to load/stor positive displ opcode.  */
+	      value = bfd_get_8 (abfd, (char *) data + octets - 3);
+	      value &= 0xF7;
+	      value |= 0x2;
+	      bfd_put_8 (abfd, (bfd_vma) value,
+			 (unsigned char *) data + octets - 3);
+	    }
+	  return bfd_reloc_ok;
+	  break;
+	default:
+	  return bfd_reloc_notsupported;
+	}
+      break;
+
+    case R_16C_ABS:
+      switch (size)
+	{
+	case R_S_16C_20:	/* word1(0-3),word2.  */
+	  if (value > 1048575 || value < 0)
+	    return bfd_reloc_overflow;
+	  value &= 0xFFFFF;
+	  value = ((value & 0x0000FFFF) << 16) |
+	    ((value & 0x000F0000) >> 16);
+	  value |= left_val;
+	  bfd_put_32 (abfd, (bfd_vma) value, (bfd_byte *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_24:	/* word2(0-3,8-11),word3.  */
+	  /* if (value > 16777215 || value < 0) RELOC_ERROR(1); */
+	  value &= 0xFFFFFF;
+	  value = ((value & 0x0000FFFF) << 16) |
+	    ((value & 0x000F0000) >> 8) | ((value & 0x00F00000) >> 20);
+	  value |= left_val;
+	  bfd_put_32 (abfd, (bfd_vma) value, (bfd_byte *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	default:
+	  return bfd_reloc_notsupported;
+	}
+      break;
+
+    case R_16C_IMMED:
+      switch (size)
+	{
+	case R_S_16C_04:	/* word1/2(4-7).  */
+	  if (value > 15 || value < -1)
+	    return bfd_reloc_overflow;
+	  value &= 0xF;
+	  value <<= 4;
+	  value |= left_val;
+	  bfd_put_8 (abfd, (bfd_vma) value, (unsigned char *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_16:	/* word2.  */
+	  if (value > 32767 || value < -32768)
+	    return bfd_reloc_overflow;
+	  value &= 0xFFFF;
+	  sword = value;
+	  bfd_put_16 (abfd, (bfd_vma) sword,
+		      (unsigned char *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_20:	/* word1(0-3),word2.  */
+	  if (value > 1048575 || value < 0)
+	    return bfd_reloc_overflow;
+	  value &= 0xFFFFF;
+	  value = ((value & 0x0000FFFF) << 16) |
+	    ((value & 0x000F0000) >> 16);
+	  value |= left_val;
+	  bfd_put_32 (abfd, (bfd_vma) value, (bfd_byte *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	case R_S_16C_32:	/* word2, word3.  */
+	  value &= 0xFFFFFFFF;
+	  value = ((value & 0x0000FFFF) << 16) |
+	    ((value & 0xFFFF0000) >> 16);
+	  bfd_put_32 (abfd, (bfd_vma) value, (bfd_byte *) data + octets);
+	  return bfd_reloc_ok;
+	  break;
+	default:
+	  return bfd_reloc_notsupported;
+	}
+      break;
+    default:
+      return bfd_reloc_notsupported;
+    }
+}
+
+/* Relocate a CR16C ELF section.  */
+
+static bfd_boolean
+elf32_cr16c_relocate_section (bfd *output_bfd,
+			      struct bfd_link_info *info,
+			      bfd *input_bfd,
+			      asection *input_section,
+			      bfd_byte *contents,
+			      Elf_Internal_Rela *relocs,
+			      Elf_Internal_Sym *local_syms,
+			      asection **local_sections)
+{
+  Elf_Internal_Shdr *symtab_hdr;
+  struct elf_link_hash_entry **sym_hashes;
+  Elf_Internal_Rela *rel, *relend;
+
+  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  sym_hashes = elf_sym_hashes (input_bfd);
+
+  rel = relocs;
+  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;
+      struct elf_link_hash_entry *h;
+      bfd_vma relocation;
+      bfd_reloc_status_type r;
+
+      r_symndx = ELF32_R_SYM (rel->r_info);
+      r_type = ELF32_R_TYPE (rel->r_info);
+      howto = elf_howto_table + r_type;
+
+      if (info->relocatable)
+	{
+	  /* This is a relocatable 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 < symtab_hdr->sh_info)
+	    {
+	      sym = local_syms + r_symndx;
+	      if (ELF_ST_TYPE (sym->st_info) == STT_SECTION)
+		{
+		  sec = local_sections[r_symndx];
+		  rel->r_addend += sec->output_offset + sym->st_value;
+		}
+	    }
+
+	  continue;
+	}
+
+      /* This is a final link.  */
+      h = NULL;
+      sym = NULL;
+      sec = NULL;
+      if (r_symndx < symtab_hdr->sh_info)
+	{
+	  sym = local_syms + r_symndx;
+	  sec = local_sections[r_symndx];
+	  relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+	}
+      else
+	{
+	  bfd_boolean unresolved_reloc, warned;
+
+	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+				   r_symndx, symtab_hdr, sym_hashes,
+				   h, sec, relocation,
+				   unresolved_reloc, warned);
+	}
+
+      r = cr16c_elf_final_link_relocate (howto, input_bfd, output_bfd,
+					 input_section,
+					 contents, rel->r_offset,
+					 relocation, rel->r_addend,
+					 info, sec, h == NULL);
+
+      if (r != bfd_reloc_ok)
+	{
+	  const char *name;
+	  const char *msg = (const char *) 0;
+
+	  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 || *name == '\0')
+		name = bfd_section_name (input_bfd, sec);
+	    }
+
+	  switch (r)
+	    {
+	    case bfd_reloc_overflow:
+	      if (!((*info->callbacks->reloc_overflow)
+		    (info, name, howto->name, (bfd_vma) 0,
+		     input_bfd, input_section, rel->r_offset)))
+		return FALSE;
+	      break;
+
+	    case bfd_reloc_undefined:
+	      if (!((*info->callbacks->undefined_symbol)
+		    (info, name, input_bfd, input_section,
+		     rel->r_offset, TRUE)))
+		return FALSE;
+	      break;
+
+	    case bfd_reloc_outofrange:
+	      msg = _("internal error: out of range error");
+	      goto common_error;
+
+	    case bfd_reloc_notsupported:
+	      msg = _("internal error: unsupported relocation error");
+	      goto common_error;
+
+	    case bfd_reloc_dangerous:
+	      msg = _("internal error: dangerous error");
+	      goto common_error;
+
+	    default:
+	      msg = _("internal error: unknown error");
+	      /* fall through */
+
+	    common_error:
+	      if (!((*info->callbacks->warning)
+		    (info, msg, name, input_bfd, input_section,
+		     rel->r_offset)))
+		return FALSE;
+	      break;
+	    }
+	}
+    }
+
+  return TRUE;
+}
+
+static asection *
+elf32_cr16c_gc_mark_hook (asection *sec,
+			  struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			  Elf_Internal_Rela *rel,
+			  struct elf_link_hash_entry *h,
+			  Elf_Internal_Sym *sym)
+{
+  if (h != NULL)
+    {
+      switch (ELF32_R_TYPE (rel->r_info))
+	{
+
+	default:
+	  switch (h->root.type)
+	    {
+	    case bfd_link_hash_defined:
+	    case bfd_link_hash_defweak:
+	      return h->root.u.def.section;
+
+	    case bfd_link_hash_common:
+	      return h->root.u.c.p->section;
+
+	    default:
+	      break;
+	    }
+	}
+    }
+  else
+    {
+      return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+    }
+
+  return NULL;
+}
+
+/* Update the got entry reference counts for the section being removed.  */
+
+static bfd_boolean
+elf32_cr16c_gc_sweep_hook (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 support garbage collection of GOT and PLT relocs yet.  */
+  return TRUE;
+}
+
+/* CR16C ELF uses three common sections:
+   One is for default common symbols (placed in usual common section).
+   Second is for near common symbols (placed in "ncommon" section).
+   Third is for far common symbols (placed in "fcommon" section).
+   The following implementation is based on elf32-mips architecture */
+
+static asection  cr16c_elf_fcom_section;
+static asymbol   cr16c_elf_fcom_symbol;
+static asymbol * cr16c_elf_fcom_symbol_ptr;
+static asection  cr16c_elf_ncom_section;
+static asymbol   cr16c_elf_ncom_symbol;
+static asymbol * cr16c_elf_ncom_symbol_ptr;
+
+/* Given a BFD section, try to locate the
+   corresponding ELF section index.  */
+
+static bfd_boolean
+elf32_cr16c_section_from_bfd_section (bfd *abfd ATTRIBUTE_UNUSED,
+				      asection *sec,
+				      int *retval)
+{
+  if (strcmp (bfd_get_section_name (abfd, sec), ".fcommon") == 0)
+    *retval = SHN_CR16C_FCOMMON;
+  else if (strcmp (bfd_get_section_name (abfd, sec), ".ncommon") == 0)
+    *retval = SHN_CR16C_NCOMMON;
+  else
+    return FALSE;
+
+  return TRUE;
+}
+
+/* Handle the special CR16C section numbers that a symbol may use.  */
+
+static void
+elf32_cr16c_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED,
+			       asymbol *asym)
+{
+  elf_symbol_type *elfsym = (elf_symbol_type *) asym;
+  unsigned int indx;
+
+  indx = elfsym->internal_elf_sym.st_shndx;
+
+  switch (indx)
+    {
+    case SHN_CR16C_FCOMMON:
+      if (cr16c_elf_fcom_section.name == NULL)
+	{
+	  /* Initialize the far common section.  */
+	  cr16c_elf_fcom_section.name = ".fcommon";
+	  cr16c_elf_fcom_section.flags = SEC_IS_COMMON | SEC_ALLOC;
+	  cr16c_elf_fcom_section.output_section = &cr16c_elf_fcom_section;
+	  cr16c_elf_fcom_section.symbol = &cr16c_elf_fcom_symbol;
+	  cr16c_elf_fcom_section.symbol_ptr_ptr = &cr16c_elf_fcom_symbol_ptr;
+	  cr16c_elf_fcom_symbol.name = ".fcommon";
+	  cr16c_elf_fcom_symbol.flags = BSF_SECTION_SYM;
+	  cr16c_elf_fcom_symbol.section = &cr16c_elf_fcom_section;
+	  cr16c_elf_fcom_symbol_ptr = &cr16c_elf_fcom_symbol;
+	}
+      asym->section = &cr16c_elf_fcom_section;
+      asym->value = elfsym->internal_elf_sym.st_size;
+      break;
+    case SHN_CR16C_NCOMMON:
+      if (cr16c_elf_ncom_section.name == NULL)
+	{
+	  /* Initialize the far common section.  */
+	  cr16c_elf_ncom_section.name = ".ncommon";
+	  cr16c_elf_ncom_section.flags = SEC_IS_COMMON | SEC_ALLOC;
+	  cr16c_elf_ncom_section.output_section = &cr16c_elf_ncom_section;
+	  cr16c_elf_ncom_section.symbol = &cr16c_elf_ncom_symbol;
+	  cr16c_elf_ncom_section.symbol_ptr_ptr = &cr16c_elf_ncom_symbol_ptr;
+	  cr16c_elf_ncom_symbol.name = ".ncommon";
+	  cr16c_elf_ncom_symbol.flags = BSF_SECTION_SYM;
+	  cr16c_elf_ncom_symbol.section = &cr16c_elf_ncom_section;
+	  cr16c_elf_ncom_symbol_ptr = &cr16c_elf_ncom_symbol;
+	}
+      asym->section = &cr16c_elf_ncom_section;
+      asym->value = elfsym->internal_elf_sym.st_size;
+      break;
+    }
+}
+
+/* Hook called by the linker routine which adds symbols from an object
+   file.  We must handle the special cr16c section numbers here.  */
+
+static bfd_boolean
+elf32_cr16c_add_symbol_hook (bfd *abfd,
+			     struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			     Elf_Internal_Sym *sym,
+			     const char **namep ATTRIBUTE_UNUSED,
+			     flagword *flagsp ATTRIBUTE_UNUSED,
+			     asection **secp,
+			     bfd_vma *valp)
+{
+  unsigned int indx = sym->st_shndx;
+
+  switch (indx)
+    {
+    case SHN_CR16C_FCOMMON:
+      *secp = bfd_make_section_old_way (abfd, ".fcommon");
+      (*secp)->flags |= SEC_IS_COMMON;
+      *valp = sym->st_size;
+      break;
+    case SHN_CR16C_NCOMMON:
+      *secp = bfd_make_section_old_way (abfd, ".ncommon");
+      (*secp)->flags |= SEC_IS_COMMON;
+      *valp = sym->st_size;
+      break;
+    }
+
+  return TRUE;
+}
+
+static bfd_boolean
+elf32_cr16c_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+				     const char *name ATTRIBUTE_UNUSED,
+				     Elf_Internal_Sym *sym,
+				     asection *input_sec,
+				     struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
+{
+  /* If we see a common symbol, which implies a relocatable link, then
+     if a symbol was in a special common section in an input file, mark
+     it as a special common in the output file.  */
+
+  if (sym->st_shndx == SHN_COMMON)
+    {
+      if (strcmp (input_sec->name, ".fcommon") == 0)
+	sym->st_shndx = SHN_CR16C_FCOMMON;
+      else if (strcmp (input_sec->name, ".ncommon") == 0)
+	sym->st_shndx = SHN_CR16C_NCOMMON;
+    }
+
+  return TRUE;
+}
+
+/* Definitions for setting CR16C target vector.  */
+#define TARGET_LITTLE_SYM		bfd_elf32_cr16c_vec
+#define TARGET_LITTLE_NAME		"elf32-cr16c"
+#define ELF_ARCH			bfd_arch_cr16c
+#define ELF_MACHINE_CODE		EM_CR
+#define ELF_MAXPAGESIZE			0x1
+#define elf_symbol_leading_char		'_'
+
+#define bfd_elf32_bfd_reloc_type_lookup		elf_cr16c_reloc_type_lookup
+#define elf_info_to_howto			elf_cr16c_info_to_howto
+#define elf_info_to_howto_rel			elf_cr16c_info_to_howto_rel
+#define elf_backend_relocate_section		elf32_cr16c_relocate_section
+#define elf_backend_gc_mark_hook        	elf32_cr16c_gc_mark_hook
+#define elf_backend_gc_sweep_hook       	elf32_cr16c_gc_sweep_hook
+#define elf_backend_symbol_processing		elf32_cr16c_symbol_processing
+#define elf_backend_section_from_bfd_section 	elf32_cr16c_section_from_bfd_section
+#define elf_backend_add_symbol_hook		elf32_cr16c_add_symbol_hook
+#define elf_backend_link_output_symbol_hook 	elf32_cr16c_link_output_symbol_hook
+
+#define elf_backend_can_gc_sections     1
+
+#include "elf32-target.h"
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index b851392..ab98304 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -475,7 +475,7 @@
      Elf_Internal_Note *note;
 {
   int offset;
-  size_t raw_size;
+  size_t size;
 
   switch (note->descsz)
     {
@@ -491,14 +491,14 @@
 
 	/* pr_reg */
 	offset = 70;
-	raw_size = 140;
+	size = 140;
 
 	break;
     }
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
 static bfd_boolean
@@ -1442,7 +1442,7 @@
 	 to this function.  Note that we embed knowledge that "incoming"
 	 .got goes after .got.plt in the output without padding (pointer
 	 aligned).  However, that knowledge is present in several other
-	 places too, here and in elflink.h at least.  */
+	 places too.  */
       bfd_vma got_offset
 	= (has_gotplt
 	   ? gotplt_offset
@@ -1645,7 +1645,7 @@
       BFD_ASSERT (splt != NULL && sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -1677,10 +1677,8 @@
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      if (s == NULL)
 		dyn.d_un.d_val = 0;
-	      else if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size;
 	      else
-		dyn.d_un.d_val = s->_raw_size;
+		dyn.d_un.d_val = s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
@@ -1694,19 +1692,14 @@
 		 about changing the DT_RELA entry.  */
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      if (s != NULL)
-		{
-		  if (s->_cooked_size != 0)
-		    dyn.d_un.d_val -= s->_cooked_size;
-		  else
-		    dyn.d_un.d_val -= s->_raw_size;
-		}
+		dyn.d_un.d_val -= s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 	    }
 	}
 
       /* Fill in the first entry in the procedure linkage table.  */
-      if (splt->_raw_size > 0)
+      if (splt->size > 0)
 	{
 	  if (info->shared)
 	    memcpy (splt->contents, elf_cris_pic_plt0_entry, PLT_ENTRY_SIZE);
@@ -1727,7 +1720,7 @@
     }
 
   /* Fill in the first three entries in the global offset table.  */
-  if (sgot->_raw_size > 0)
+  if (sgot->size > 0)
     {
       if (sdyn == NULL)
 	bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
@@ -1832,8 +1825,8 @@
 		  if (h->got.refcount == 0)
 		    {
 		      /* We don't need the .got entry any more.  */
-		      sgot->_raw_size -= 4;
-		      srelgot->_raw_size -= sizeof (Elf32_External_Rela);
+		      sgot->size -= 4;
+		      srelgot->size -= sizeof (Elf32_External_Rela);
 		    }
 		}
 	      break;
@@ -1848,9 +1841,9 @@
 		  if (local_got_refcounts[r_symndx] == 0)
 		    {
 		      /* We don't need the .got entry any more.  */
-		      sgot->_raw_size -= 4;
+		      sgot->size -= 4;
 		      if (info->shared)
-			srelgot->_raw_size -= sizeof (Elf32_External_Rela);
+			srelgot->size -= sizeof (Elf32_External_Rela);
 		    }
 		}
 	    }
@@ -1939,10 +1932,10 @@
       BFD_ASSERT (sgot != NULL && srelgot != NULL);
 
       /* Allocate space in the .got section.  */
-      sgot->_raw_size += 4;
+      sgot->size += 4;
 
       /* Allocate relocation space.  */
-      srelgot->_raw_size += sizeof (Elf32_External_Rela);
+      srelgot->size += sizeof (Elf32_External_Rela);
     }
 
   return TRUE;
@@ -2095,7 +2088,7 @@
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (h->dynindx == -1)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -2104,8 +2097,8 @@
 
       /* 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 (s->size == 0)
+	s->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
@@ -2114,7 +2107,7 @@
 	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
 	{
 	  h->root.u.def.section = s;
-	  h->root.u.def.value = s->_raw_size;
+	  h->root.u.def.value = s->size;
 	}
 
       /* If there's already a GOT entry, use that, not a .got.plt.  A
@@ -2130,10 +2123,10 @@
 	  /* Mark the PLT offset to use the GOT entry by setting the low
 	     bit in the plt offset; it is always a multiple of
 	     pointer-size.  */
-	  BFD_ASSERT ((s->_raw_size & 3) == 0);
+	  BFD_ASSERT ((s->size & 3) == 0);
 
 	  /* Change the PLT refcount to an offset.  */
-	  h->plt.offset = s->_raw_size;
+	  h->plt.offset = s->size;
 
 	  /* By not setting gotplt_offset (i.e. it remains at 0), we signal
 	     that the got entry should be used instead.  */
@@ -2141,16 +2134,16 @@
 		       h)->gotplt_offset == 0);
 
 	  /* Make room for this entry.  */
-	  s->_raw_size += PLT_ENTRY_SIZE;
+	  s->size += PLT_ENTRY_SIZE;
 
 	  return TRUE;
 	}
 
       /* No GOT reference for this symbol; prepare for an ordinary PLT.  */
-      h->plt.offset = s->_raw_size;
+      h->plt.offset = s->size;
 
       /* Make room for this entry.  */
-      s->_raw_size += PLT_ENTRY_SIZE;
+      s->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.  */
@@ -2160,13 +2153,13 @@
 
       s = bfd_get_section_by_name (dynobj, ".got.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += 4;
+      s->size += 4;
 
       /* We also need to make an entry in the .rela.plt section.  */
 
       s = bfd_get_section_by_name (dynobj, ".rela.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += sizeof (Elf32_External_Rela);
+      s->size += sizeof (Elf32_External_Rela);
 
       return TRUE;
     }
@@ -2225,7 +2218,7 @@
 
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf32_External_Rela);
+      srel->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -2239,8 +2232,7 @@
     power_of_two = 3;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (!bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -2249,10 +2241,10 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
@@ -2422,14 +2414,14 @@
 		  /* Make sure this symbol is output as a dynamic symbol.  */
 		  if (h->dynindx == -1)
 		    {
-		      if (!bfd_elf32_link_record_dynamic_symbol (info, h))
+		      if (!bfd_elf_link_record_dynamic_symbol (info, h))
 			return FALSE;
 		    }
 
 		  /* Allocate space in the .got section.  */
-		  sgot->_raw_size += 4;
+		  sgot->size += 4;
 		  /* Allocate relocation space.  */
-		  srelgot->_raw_size += sizeof (Elf32_External_Rela);
+		  srelgot->size += sizeof (Elf32_External_Rela);
 		}
 	      h->got.refcount++;
 	    }
@@ -2438,13 +2430,13 @@
 	      /* This is a global offset table entry for a local symbol.  */
 	      if (local_got_refcounts[r_symndx] == 0)
 		{
-		  sgot->_raw_size += 4;
+		  sgot->size += 4;
 		  if (info->shared)
 		    {
 		      /* If we are generating a shared object, we need to
 			 output a R_CRIS_RELATIVE reloc so that the dynamic
 			 linker can adjust this GOT entry.  */
-		      srelgot->_raw_size += sizeof (Elf32_External_Rela);
+		      srelgot->size += sizeof (Elf32_External_Rela);
 		    }
 		}
 	      local_got_refcounts[r_symndx]++;
@@ -2599,7 +2591,7 @@
 		info->flags |= DF_TEXTREL;
 	    }
 
-	  sreloc->_raw_size += sizeof (Elf32_External_Rela);
+	  sreloc->size += sizeof (Elf32_External_Rela);
 
 	  /* If we are linking with -Bsymbolic, we count the number of PC
 	     relative relocations we have entered for this symbol, so that
@@ -2639,14 +2631,14 @@
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_CRIS_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_CRIS_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
 
@@ -2682,7 +2674,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -2700,7 +2692,7 @@
 	 below.  */
       s = bfd_get_section_by_name (dynobj, ".rela.got");
       if (s != NULL)
-	s->_raw_size = 0;
+	s->size = 0;
     }
 
   /* If this is a -Bsymbolic shared link, then we need to discard all PC
@@ -2740,7 +2732,7 @@
 
       if (strcmp (name, ".plt") == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* Strip this section if we don't need it; see the
                  comment below.  */
@@ -2754,7 +2746,7 @@
 	}
       else if (strncmp (name, ".rela", 5) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is mostly to handle .rela.bss and
@@ -2796,8 +2788,8 @@
 	 contents are written out.  This should not happen, but this way
 	 if it does, we will not write out garbage.  For reloc sections,
 	 this will make entries have the type R_CRIS_NONE.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
     }
 
@@ -2809,7 +2801,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (!info->shared)
 	{
@@ -2874,7 +2866,7 @@
 	  || info->symbolic))
     {
       for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
-	s->section->_raw_size -= s->count * sizeof (Elf32_External_Rela);
+	s->section->size -= s->count * sizeof (Elf32_External_Rela);
     }
 
   return TRUE;
@@ -2917,7 +2909,7 @@
 
 	  BFD_ASSERT (srelgot != NULL);
 
-	  srelgot->_raw_size -= sizeof (Elf32_External_Rela);
+	  srelgot->size -= sizeof (Elf32_External_Rela);
 	}
 
       /* If the locally-defined symbol isn't used by a DSO, then we don't
@@ -3090,7 +3082,7 @@
 #define elf_backend_create_dynamic_sections \
 	_bfd_elf_create_dynamic_sections
 #define bfd_elf32_bfd_final_link \
-	_bfd_elf32_gc_common_final_link
+	bfd_elf_gc_common_final_link
 #define elf_backend_hide_symbol			elf_cris_hide_symbol
 #define elf_backend_reloc_type_class		elf_cris_reloc_type_class
 
diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c
new file mode 100644
index 0000000..03575f2
--- /dev/null
+++ b/bfd/elf32-crx.c
@@ -0,0 +1,1233 @@
+/* BFD back-end for National Semiconductor's CRX ELF
+   Copyright 2004 Free Software Foundation, Inc.
+   Written by Tomer Levi, NSC, Israel.
+
+   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 "bfdlink.h"
+#include "libbfd.h"
+#include "elf-bfd.h"
+#include "elf/crx.h"
+
+static reloc_howto_type *elf_crx_reloc_type_lookup
+  (bfd *, bfd_reloc_code_real_type);
+static void elf_crx_info_to_howto
+  (bfd *, arelent *, Elf_Internal_Rela *);
+static bfd_boolean elf32_crx_relax_delete_bytes
+  (bfd *, asection *, bfd_vma, int);
+static bfd_reloc_status_type crx_elf_final_link_relocate
+  (reloc_howto_type *, bfd *, bfd *, asection *,
+   bfd_byte *, bfd_vma, bfd_vma, bfd_vma,
+   struct bfd_link_info *, asection *, int);
+static bfd_boolean elf32_crx_relocate_section
+  (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+   Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
+static asection * elf32_crx_gc_mark_hook
+  (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
+   struct elf_link_hash_entry *, Elf_Internal_Sym *);
+static bfd_boolean elf32_crx_gc_sweep_hook
+  (bfd *, struct bfd_link_info *, asection *,
+   const Elf_Internal_Rela *);
+static bfd_boolean elf32_crx_relax_section
+  (bfd *, asection *, struct bfd_link_info *, bfd_boolean *);
+static bfd_byte * elf32_crx_get_relocated_section_contents
+  (bfd *, struct bfd_link_info *, struct bfd_link_order *,
+   bfd_byte *, bfd_boolean, asymbol **);
+
+/* crx_reloc_map array maps BFD relocation enum into a CRGAS relocation type.  */
+
+struct crx_reloc_map
+{
+  bfd_reloc_code_real_type bfd_reloc_enum; /* BFD relocation enum.  */
+  unsigned short crx_reloc_type;	   /* CRX relocation type.  */
+};
+
+static const struct crx_reloc_map crx_reloc_map[R_CRX_MAX] =
+{
+  {BFD_RELOC_NONE,	    R_CRX_NONE},
+  {BFD_RELOC_CRX_REL4,	    R_CRX_REL4},
+  {BFD_RELOC_CRX_REL8,	    R_CRX_REL8},
+  {BFD_RELOC_CRX_REL8_CMP,  R_CRX_REL8_CMP},
+  {BFD_RELOC_CRX_REL16,	    R_CRX_REL16},
+  {BFD_RELOC_CRX_REL24,	    R_CRX_REL24},
+  {BFD_RELOC_CRX_REL32,	    R_CRX_REL32},
+  {BFD_RELOC_CRX_REGREL12,  R_CRX_REGREL12},
+  {BFD_RELOC_CRX_REGREL22,  R_CRX_REGREL22},
+  {BFD_RELOC_CRX_REGREL28,  R_CRX_REGREL28},
+  {BFD_RELOC_CRX_REGREL32,  R_CRX_REGREL32},
+  {BFD_RELOC_CRX_ABS16,	    R_CRX_ABS16},
+  {BFD_RELOC_CRX_ABS32,	    R_CRX_ABS32},
+  {BFD_RELOC_CRX_NUM8,	    R_CRX_NUM8},
+  {BFD_RELOC_CRX_NUM16,	    R_CRX_NUM16},
+  {BFD_RELOC_CRX_NUM32,	    R_CRX_NUM32},
+  {BFD_RELOC_CRX_IMM16,	    R_CRX_IMM16},
+  {BFD_RELOC_CRX_IMM32,	    R_CRX_IMM32}
+};
+
+static reloc_howto_type crx_elf_howto_table[] =
+{
+  HOWTO (R_CRX_NONE,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size */
+	 32,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_NONE",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0,			/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_REL4,		/* type */
+	 1,			/* rightshift */
+	 0,			/* size */
+	 4,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_REL4",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xf,			/* src_mask */
+	 0xf,			/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_REL8,		/* type */
+	 1,			/* rightshift */
+	 0,			/* size */
+	 8,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_REL8",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xff,			/* src_mask */
+	 0xff,			/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_REL8_CMP,	/* type */
+	 1,			/* rightshift */
+	 0,			/* size */
+	 8,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_REL8_CMP",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0xff,			/* src_mask */
+	 0xff,			/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_REL16,		/* type */
+	 1,			/* rightshift */
+	 1,			/* size */
+	 16,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_REL16",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_REL24,		/* type */
+	 1,			/* rightshift */
+	 2,			/* size */
+	 24,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_REL24",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffffff,		/* src_mask */
+	 0xffffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_REL32,		/* type */
+	 1,			/* rightshift */
+	 2,			/* size */
+	 32,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_REL32",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_REGREL12,	/* type */
+	 0,			/* rightshift */
+	 1,			/* size */
+	 12,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_REGREL12",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0xfff,			/* src_mask */
+	 0xfff,			/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_REGREL22,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size */
+	 22,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_REGREL22",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0x3fffff,		/* src_mask */
+	 0x3fffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_REGREL28,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size */
+	 28,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_REGREL28",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0xfffffff,		/* src_mask */
+	 0xfffffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_REGREL32,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size */
+	 32,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_REGREL32",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_ABS16,		/* type */
+	 0,			/* rightshift */
+	 1,			/* size */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_ABS16",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_ABS32,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size */
+	 32,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_ABS32",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_NUM8,		/* type */
+	 0,			/* rightshift */
+	 0,			/* size */
+	 8,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_NUM8",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xff,	  		/* src_mask */
+	 0xff,			/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_NUM16,		/* type */
+	 0,			/* rightshift */
+	 1,			/* size */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_NUM16",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,  		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_NUM32,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size */
+	 32,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_NUM32",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffffffff,  		/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_IMM16,		/* type */
+	 0,			/* rightshift */
+	 1,			/* size */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_IMM16",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffff,  		/* src_mask */
+	 0xffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_CRX_IMM32,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size */
+	 32,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_bitfield,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_CRX_IMM32",		/* name */
+	 FALSE,			/* partial_inplace */
+	 0xffffffff,  		/* src_mask */
+	 0xffffffff,		/* dst_mask */
+	 FALSE)			/* pcrel_offset */
+};
+
+/* Retrieve a howto ptr using a BFD reloc_code.  */
+
+static reloc_howto_type *
+elf_crx_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+			   bfd_reloc_code_real_type code)
+{
+  unsigned int i;
+
+  for (i = 0; i < R_CRX_MAX; i++)
+    if (code == crx_reloc_map[i].bfd_reloc_enum)
+      return &crx_elf_howto_table[crx_reloc_map[i].crx_reloc_type];
+
+  printf ("This relocation Type is not supported -0x%x\n", code);
+  return 0;
+}
+
+/* Retrieve a howto ptr using an internal relocation entry.  */
+
+static void
+elf_crx_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
+		       Elf_Internal_Rela *dst)
+{
+  unsigned int r_type = ELF32_R_TYPE (dst->r_info);
+  BFD_ASSERT (r_type < (unsigned int) R_CRX_MAX);
+  cache_ptr->howto = &crx_elf_howto_table[r_type];
+}
+
+/* Perform a relocation as part of a final link.  */
+
+static bfd_reloc_status_type
+crx_elf_final_link_relocate (reloc_howto_type *howto, bfd *input_bfd,
+			     bfd *output_bfd ATTRIBUTE_UNUSED,
+			     asection *input_section, bfd_byte *contents,
+			     bfd_vma offset, bfd_vma Rvalue, bfd_vma addend,
+			     struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			     asection *sec ATTRIBUTE_UNUSED,
+			     int is_local ATTRIBUTE_UNUSED)
+{
+  unsigned short r_type = howto->type;
+  bfd_byte *hit_data = contents + offset;
+  bfd_vma reloc_bits, check;
+
+  switch (r_type)
+    {
+     case R_CRX_IMM16:
+     case R_CRX_IMM32:
+     case R_CRX_ABS16:
+     case R_CRX_ABS32:
+     case R_CRX_REL8_CMP:
+     case R_CRX_REL16:
+     case R_CRX_REL24:
+     case R_CRX_REL32:
+     case R_CRX_REGREL12:
+     case R_CRX_REGREL22:
+     case R_CRX_REGREL28:
+     case R_CRX_REGREL32:
+       /* 'hit_data' is relative to the start of the instruction, not the
+	  relocation offset. Advance it to account for the exact offset.  */
+       hit_data += 2;
+       break;
+
+     case R_CRX_REL4:
+       /* This relocation type is used only in 'Branch if Equal to 0'
+	  instructions and requires special handling.  */
+       Rvalue -= 1;
+       break;
+
+     case R_CRX_NONE:
+       return bfd_reloc_ok;
+       break;
+
+     default:
+       break;
+    }
+
+  if (howto->pc_relative)
+    {
+      /* Subtract the address of the section containing the location.  */
+      Rvalue -= (input_section->output_section->vma
+		 + input_section->output_offset);
+      /* Subtract the position of the location within the section.  */
+      Rvalue -= offset;
+    }
+
+  /* Add in supplied addend.  */
+  Rvalue += addend;
+
+  /* Complain if the bitfield overflows, whether it is considered
+     as signed or unsigned.  */
+  check = Rvalue >> howto->rightshift;
+
+  /* Assumes two's complement.  This expression avoids
+     overflow if howto->bitsize is the number of bits in
+     bfd_vma.  */
+  reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
+
+  if (((bfd_vma) check & ~reloc_bits) != 0
+      && (((bfd_vma) check & ~reloc_bits)
+	  != (-(bfd_vma) 1 & ~reloc_bits)))
+    {
+      /* The above right shift is incorrect for a signed
+	 value.  See if turning on the upper bits fixes the
+	 overflow.  */
+      if (howto->rightshift && (bfd_signed_vma) Rvalue < 0)
+	{
+	  check |= ((bfd_vma) - 1
+		    & ~((bfd_vma) - 1
+			>> howto->rightshift));
+	  if (((bfd_vma) check & ~reloc_bits)
+	      != (-(bfd_vma) 1 & ~reloc_bits))
+	    return bfd_reloc_overflow;
+	}
+      else
+	return bfd_reloc_overflow;
+    }
+
+  /* Drop unwanted bits from the value we are relocating to.  */
+  Rvalue >>= (bfd_vma) howto->rightshift;
+
+  /* Apply dst_mask to select only relocatable part of the insn.  */
+  Rvalue &= howto->dst_mask;
+
+  switch (howto->size)
+    {
+     case 0:
+       if (r_type == R_CRX_REL4)
+	 {
+	   Rvalue <<= 4;
+	   Rvalue |= (bfd_get_8 (input_bfd, hit_data) & 0x0f);
+	 }
+
+       bfd_put_8 (input_bfd, (unsigned char) Rvalue, hit_data);
+       break;
+
+     case 1:
+       if (r_type == R_CRX_REGREL12)
+	 Rvalue |= (bfd_get_16 (input_bfd, hit_data) & 0xf000);
+
+       bfd_put_16 (input_bfd, Rvalue, hit_data);
+       break;
+
+     case 2:
+       if (r_type == R_CRX_REL24
+	   || r_type == R_CRX_REGREL22
+	   || r_type == R_CRX_REGREL28)
+	 Rvalue |= (((bfd_get_16 (input_bfd, hit_data) << 16) |
+		      bfd_get_16 (input_bfd, hit_data + 2)) & ~howto->dst_mask);
+
+       if (r_type == R_CRX_NUM32)
+	 /* Relocation on DATA is purely little-endian, that is, for a
+	    multi-byte datum, the lowest address in memory contains the
+	    little end of the datum, that is, the least significant byte.
+	    Therefore we use BFD's byte Putting functions.  */
+	 bfd_put_32 (input_bfd, Rvalue, hit_data);
+       else
+	 /* Relocation on INSTRUCTIONS is different : Instructions are
+	    word-addressable, that is, each word itself is arranged according
+	    to little-endian convention, whereas the words are arranged with
+	    respect to one another in BIG ENDIAN fashion.
+	    When there is an immediate value that spans a word boundary, it is
+	    split in a big-endian way with respect to the words.  */
+	 {
+	   bfd_put_16 (input_bfd, (Rvalue >> 16) & 0xffff, hit_data);
+	   bfd_put_16 (input_bfd, Rvalue & 0xffff, hit_data + 2);
+	 }
+     break;
+
+     default:
+       return bfd_reloc_notsupported;
+    }
+
+  return bfd_reloc_ok;
+}
+
+/* Delete some bytes from a section while relaxing.  */
+
+static bfd_boolean
+elf32_crx_relax_delete_bytes (bfd *abfd, asection *sec,
+			      bfd_vma addr, int count)
+{
+  Elf_Internal_Shdr *symtab_hdr;
+  unsigned int sec_shndx;
+  bfd_byte *contents;
+  Elf_Internal_Rela *irel, *irelend;
+  Elf_Internal_Rela *irelalign;
+  bfd_vma toaddr;
+  Elf_Internal_Sym *isym;
+  Elf_Internal_Sym *isymend;
+  struct elf_link_hash_entry **sym_hashes;
+  struct elf_link_hash_entry **end_hashes;
+  unsigned int symcount;
+
+  sec_shndx = _bfd_elf_section_from_bfd_section (abfd, sec);
+
+  contents = elf_section_data (sec)->this_hdr.contents;
+
+  /* The deletion must stop at the next ALIGN reloc for an aligment
+     power larger than the number of bytes we are deleting.  */
+
+  irelalign = NULL;
+  toaddr = sec->size;
+
+  irel = elf_section_data (sec)->relocs;
+  irelend = irel + sec->reloc_count;
+
+  /* Actually delete the bytes.  */
+  memmove (contents + addr, contents + addr + count,
+	   (size_t) (toaddr - addr - count));
+  sec->size -= count;
+
+  /* Adjust all the relocs.  */
+  for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
+    {
+      /* Get the new reloc address.  */
+      if ((irel->r_offset > addr
+	   && irel->r_offset < toaddr))
+	irel->r_offset -= count;
+    }
+
+  /* Adjust the local symbols defined in this section.  */
+  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  isym = (Elf_Internal_Sym *) symtab_hdr->contents;
+  for (isymend = isym + symtab_hdr->sh_info; isym < isymend; isym++)
+    {
+      if (isym->st_shndx == sec_shndx
+	  && isym->st_value > addr
+	  && isym->st_value < toaddr)
+	isym->st_value -= count;
+    }
+
+  /* Now adjust the global symbols defined in this section.  */
+  symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym)
+	      - symtab_hdr->sh_info);
+  sym_hashes = elf_sym_hashes (abfd);
+  end_hashes = sym_hashes + symcount;
+
+  for (; sym_hashes < end_hashes; sym_hashes++)
+    {
+      struct elf_link_hash_entry *sym_hash = *sym_hashes;
+
+      if ((sym_hash->root.type == bfd_link_hash_defined
+	   || sym_hash->root.type == bfd_link_hash_defweak)
+	  && sym_hash->root.u.def.section == sec
+	  && sym_hash->root.u.def.value > addr
+	  && sym_hash->root.u.def.value < toaddr)
+	sym_hash->root.u.def.value -= count;
+    }
+
+  return TRUE;
+}
+
+/* This is a version of bfd_generic_get_relocated_section_contents
+   which uses elf32_crx_relocate_section.  */
+
+static bfd_byte *
+elf32_crx_get_relocated_section_contents (bfd *output_bfd,
+					  struct bfd_link_info *link_info,
+					  struct bfd_link_order *link_order,
+					  bfd_byte *data,
+					  bfd_boolean relocatable,
+					  asymbol **symbols)
+{
+  Elf_Internal_Shdr *symtab_hdr;
+  asection *input_section = link_order->u.indirect.section;
+  bfd *input_bfd = input_section->owner;
+  asection **sections = NULL;
+  Elf_Internal_Rela *internal_relocs = NULL;
+  Elf_Internal_Sym *isymbuf = NULL;
+
+  /* We only need to handle the case of relaxing, or of having a
+     particular set of section contents, specially.  */
+  if (relocatable
+      || elf_section_data (input_section)->this_hdr.contents == NULL)
+    return bfd_generic_get_relocated_section_contents (output_bfd, link_info,
+						       link_order, data,
+						       relocatable,
+						       symbols);
+
+  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+
+  memcpy (data, elf_section_data (input_section)->this_hdr.contents,
+	  (size_t) input_section->size);
+
+  if ((input_section->flags & SEC_RELOC) != 0
+      && input_section->reloc_count > 0)
+    {
+      Elf_Internal_Sym *isym;
+      Elf_Internal_Sym *isymend;
+      asection **secpp;
+      bfd_size_type amt;
+
+      internal_relocs = (_bfd_elf_link_read_relocs
+			 (input_bfd, input_section, (PTR) NULL,
+			  (Elf_Internal_Rela *) NULL, FALSE));
+      if (internal_relocs == NULL)
+	goto error_return;
+
+      if (symtab_hdr->sh_info != 0)
+	{
+	  isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+	  if (isymbuf == NULL)
+	    isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr,
+					    symtab_hdr->sh_info, 0,
+					    NULL, NULL, NULL);
+	  if (isymbuf == NULL)
+	    goto error_return;
+	}
+
+      amt = symtab_hdr->sh_info;
+      amt *= sizeof (asection *);
+      sections = bfd_malloc (amt);
+      if (sections == NULL && amt != 0)
+	goto error_return;
+
+      isymend = isymbuf + symtab_hdr->sh_info;
+      for (isym = isymbuf, secpp = sections; isym < isymend; ++isym, ++secpp)
+	{
+	  asection *isec;
+
+	  if (isym->st_shndx == SHN_UNDEF)
+	    isec = bfd_und_section_ptr;
+	  else if (isym->st_shndx == SHN_ABS)
+	    isec = bfd_abs_section_ptr;
+	  else if (isym->st_shndx == SHN_COMMON)
+	    isec = bfd_com_section_ptr;
+	  else
+	    isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx);
+
+	  *secpp = isec;
+	}
+
+      if (! elf32_crx_relocate_section (output_bfd, link_info, input_bfd,
+				     input_section, data, internal_relocs,
+				     isymbuf, sections))
+	goto error_return;
+
+      if (sections != NULL)
+	free (sections);
+      if (isymbuf != NULL
+	  && symtab_hdr->contents != (unsigned char *) isymbuf)
+	free (isymbuf);
+      if (elf_section_data (input_section)->relocs != internal_relocs)
+	free (internal_relocs);
+    }
+
+  return data;
+
+ error_return:
+  if (sections != NULL)
+    free (sections);
+  if (isymbuf != NULL
+      && symtab_hdr->contents != (unsigned char *) isymbuf)
+    free (isymbuf);
+  if (internal_relocs != NULL
+      && elf_section_data (input_section)->relocs != internal_relocs)
+    free (internal_relocs);
+  return NULL;
+}
+
+/* Relocate a CRX ELF section.  */
+
+static bfd_boolean
+elf32_crx_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
+			    bfd *input_bfd, asection *input_section,
+			    bfd_byte *contents, Elf_Internal_Rela *relocs,
+			    Elf_Internal_Sym *local_syms,
+			    asection **local_sections)
+{
+  Elf_Internal_Shdr *symtab_hdr;
+  struct elf_link_hash_entry **sym_hashes;
+  Elf_Internal_Rela *rel, *relend;
+
+  if (info->relocatable)
+    return TRUE;
+
+  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  sym_hashes = elf_sym_hashes (input_bfd);
+
+  rel = relocs;
+  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;
+      struct elf_link_hash_entry *h;
+      bfd_vma relocation;
+      bfd_reloc_status_type r;
+
+      r_symndx = ELF32_R_SYM (rel->r_info);
+      r_type = ELF32_R_TYPE (rel->r_info);
+      howto = crx_elf_howto_table + (r_type);
+
+      h = NULL;
+      sym = NULL;
+      sec = NULL;
+      if (r_symndx < symtab_hdr->sh_info)
+	{
+	  sym = local_syms + r_symndx;
+	  sec = local_sections[r_symndx];
+	  relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
+	}
+      else
+	{
+	  bfd_boolean unresolved_reloc, warned;
+
+	  RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
+				   r_symndx, symtab_hdr, sym_hashes,
+				   h, sec, relocation,
+				   unresolved_reloc, warned);
+	}
+
+      r = crx_elf_final_link_relocate (howto, input_bfd, output_bfd,
+					input_section,
+					contents, rel->r_offset,
+					relocation, rel->r_addend,
+					info, sec, h == NULL);
+
+      if (r != bfd_reloc_ok)
+	{
+	  const char *name;
+	  const char *msg = (const char *) 0;
+
+	  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 || *name == '\0')
+		name = bfd_section_name (input_bfd, sec);
+	    }
+
+	  switch (r)
+	    {
+	     case bfd_reloc_overflow:
+	       if (!((*info->callbacks->reloc_overflow)
+		     (info, name, howto->name, (bfd_vma) 0,
+		      input_bfd, input_section, rel->r_offset)))
+		 return FALSE;
+	       break;
+
+	     case bfd_reloc_undefined:
+	       if (!((*info->callbacks->undefined_symbol)
+		     (info, name, input_bfd, input_section,
+		      rel->r_offset, TRUE)))
+		 return FALSE;
+	       break;
+
+	     case bfd_reloc_outofrange:
+	       msg = _("internal error: out of range error");
+	       goto common_error;
+
+	     case bfd_reloc_notsupported:
+	       msg = _("internal error: unsupported relocation error");
+	       goto common_error;
+
+	     case bfd_reloc_dangerous:
+	       msg = _("internal error: dangerous error");
+	       goto common_error;
+
+	     default:
+	       msg = _("internal error: unknown error");
+	       /* Fall through.  */
+
+	     common_error:
+	       if (!((*info->callbacks->warning)
+		     (info, msg, name, input_bfd, input_section,
+		      rel->r_offset)))
+		 return FALSE;
+	       break;
+	    }
+	}
+    }
+
+  return TRUE;
+}
+
+/* This function handles relaxing for the CRX.
+
+   There's quite a few relaxing opportunites available on the CRX:
+
+	* bal/bcond:32 -> bal/bcond:16				   2 bytes
+	* bcond:16 -> bcond:8					   2 bytes
+	* cmpbcond:24 -> cmpbcond:8				   2 bytes
+	* arithmetic imm32 -> arithmetic imm16			   2 bytes
+
+   Symbol- and reloc-reading infrastructure copied from elf-m10200.c.  */
+
+static bfd_boolean
+elf32_crx_relax_section (bfd *abfd, asection *sec,
+			 struct bfd_link_info *link_info, bfd_boolean *again)
+{
+  Elf_Internal_Shdr *symtab_hdr;
+  Elf_Internal_Rela *internal_relocs;
+  Elf_Internal_Rela *irel, *irelend;
+  bfd_byte *contents = NULL;
+  Elf_Internal_Sym *isymbuf = NULL;
+
+  /* Assume nothing changes.  */
+  *again = FALSE;
+
+  /* We don't have to do anything for a relocatable link, if
+     this section does not have relocs, or if this is not a
+     code section.  */
+  if (link_info->relocatable
+      || (sec->flags & SEC_RELOC) == 0
+      || sec->reloc_count == 0
+      || (sec->flags & SEC_CODE) == 0)
+    return TRUE;
+
+  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+
+  /* Get a copy of the native relocations.  */
+  internal_relocs = (_bfd_elf_link_read_relocs
+		     (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL,
+		      link_info->keep_memory));
+  if (internal_relocs == NULL)
+    goto error_return;
+
+  /* Walk through them looking for relaxing opportunities.  */
+  irelend = internal_relocs + sec->reloc_count;
+  for (irel = internal_relocs; irel < irelend; irel++)
+    {
+      bfd_vma symval;
+
+      /* If this isn't something that can be relaxed, then ignore
+	 this reloc.  */
+      if (ELF32_R_TYPE (irel->r_info) != (int) R_CRX_REL32
+	  && ELF32_R_TYPE (irel->r_info) != (int) R_CRX_REL16
+	  && ELF32_R_TYPE (irel->r_info) != (int) R_CRX_REL24
+	  && ELF32_R_TYPE (irel->r_info) != (int) R_CRX_IMM32)
+	continue;
+
+      /* Get the section contents if we haven't done so already.  */
+      if (contents == NULL)
+	{
+	  /* Get cached copy if it exists.  */
+	  if (elf_section_data (sec)->this_hdr.contents != NULL)
+	    contents = elf_section_data (sec)->this_hdr.contents;
+	  /* Go get them off disk.  */
+	  else if (!bfd_malloc_and_get_section (abfd, sec, &contents))
+	    goto error_return;
+	}
+
+      /* Read this BFD's local symbols if we haven't done so already.  */
+      if (isymbuf == NULL && symtab_hdr->sh_info != 0)
+	{
+	  isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+	  if (isymbuf == NULL)
+	    isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
+					    symtab_hdr->sh_info, 0,
+					    NULL, NULL, NULL);
+	  if (isymbuf == NULL)
+	    goto error_return;
+	}
+
+      /* Get the value of the symbol referred to by the reloc.  */
+      if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
+	{
+	  /* A local symbol.  */
+	  Elf_Internal_Sym *isym;
+	  asection *sym_sec;
+
+	  isym = isymbuf + ELF32_R_SYM (irel->r_info);
+	  if (isym->st_shndx == SHN_UNDEF)
+	    sym_sec = bfd_und_section_ptr;
+	  else if (isym->st_shndx == SHN_ABS)
+	    sym_sec = bfd_abs_section_ptr;
+	  else if (isym->st_shndx == SHN_COMMON)
+	    sym_sec = bfd_com_section_ptr;
+	  else
+	    sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+	  symval = (isym->st_value
+		    + sym_sec->output_section->vma
+		    + sym_sec->output_offset);
+	}
+      else
+	{
+	  unsigned long indx;
+	  struct elf_link_hash_entry *h;
+
+	  /* An external symbol.  */
+	  indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info;
+	  h = elf_sym_hashes (abfd)[indx];
+	  BFD_ASSERT (h != NULL);
+
+	  if (h->root.type != bfd_link_hash_defined
+	      && h->root.type != bfd_link_hash_defweak)
+	    /* This appears to be a reference to an undefined
+	       symbol.  Just ignore it--it will be caught by the
+	       regular reloc processing.  */
+	    continue;
+
+	  symval = (h->root.u.def.value
+		    + h->root.u.def.section->output_section->vma
+		    + h->root.u.def.section->output_offset);
+	}
+
+      /* For simplicity of coding, we are going to modify the section
+	 contents, the section relocs, and the BFD symbol table.  We
+	 must tell the rest of the code not to free up this
+	 information.  It would be possible to instead create a table
+	 of changes which have to be made, as is done in coff-mips.c;
+	 that would be more work, but would require less memory when
+	 the linker is run.  */
+
+      /* Try to turn a 32bit pc-relative branch/call into
+	 a 16bit pc-relative branch/call.  */
+      if (ELF32_R_TYPE (irel->r_info) == (int) R_CRX_REL32)
+	{
+	  bfd_vma value = symval;
+
+	  /* Deal with pc-relative gunk.  */
+	  value -= (sec->output_section->vma + sec->output_offset);
+	  value -= irel->r_offset;
+	  value += irel->r_addend;
+
+	  /* See if the value will fit in 16 bits, note the high value is
+	     0xfffe + 2 as the target will be two bytes closer if we are
+	     able to relax.  */
+	  if ((long) value < 0x10000 && (long) value > -0x10002)
+	    {
+	      unsigned short code;
+
+	      /* Get the opcode.  */
+	      code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
+
+	      /* Verify it's a 'bal'/'bcond' and fix the opcode.  */
+	      if ((code & 0xfff0) == 0x3170)
+		bfd_put_8 (abfd, 0x30, contents + irel->r_offset + 1);
+	      else if ((code & 0xf0ff) == 0x707f)
+		bfd_put_8 (abfd, 0x7e, contents + irel->r_offset);
+	      else
+		continue;
+
+	      /* Note that we've changed the relocs, section contents, etc.  */
+	      elf_section_data (sec)->relocs = internal_relocs;
+	      elf_section_data (sec)->this_hdr.contents = contents;
+	      symtab_hdr->contents = (unsigned char *) isymbuf;
+
+	      /* Fix the relocation's type.  */
+	      irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+					   R_CRX_REL16);
+
+	      /* Delete two bytes of data.  */
+	      if (!elf32_crx_relax_delete_bytes (abfd, sec,
+						   irel->r_offset + 2, 2))
+		goto error_return;
+
+	      /* That will change things, so, we should relax again.
+		 Note that this is not required, and it may be slow.  */
+	      *again = TRUE;
+	    }
+	}
+
+      /* Try to turn a 16bit pc-relative branch into an
+	 8bit pc-relative branch.  */
+      if (ELF32_R_TYPE (irel->r_info) == (int) R_CRX_REL16)
+	{
+	  bfd_vma value = symval;
+
+	  /* Deal with pc-relative gunk.  */
+	  value -= (sec->output_section->vma + sec->output_offset);
+	  value -= irel->r_offset;
+	  value += irel->r_addend;
+
+	  /* See if the value will fit in 8 bits, note the high value is
+	     0xfc + 2 as the target will be two bytes closer if we are
+	     able to relax.  */
+	  if ((long) value < 0xfe && (long) value > -0x100)
+	    {
+	      unsigned short code;
+
+	      /* Get the opcode.  */
+	      code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
+
+	      /* Verify it's a 'bcond' opcode.  */
+	      if ((code & 0xf0ff) != 0x707e)
+		continue;
+
+	      /* Note that we've changed the relocs, section contents, etc.  */
+	      elf_section_data (sec)->relocs = internal_relocs;
+	      elf_section_data (sec)->this_hdr.contents = contents;
+	      symtab_hdr->contents = (unsigned char *) isymbuf;
+
+	      /* Fix the relocation's type.  */
+	      irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+					   R_CRX_REL8);
+
+	      /* Delete two bytes of data.  */
+	      if (!elf32_crx_relax_delete_bytes (abfd, sec,
+						   irel->r_offset + 2, 2))
+		goto error_return;
+
+	      /* That will change things, so, we should relax again.
+		 Note that this is not required, and it may be slow.  */
+	      *again = TRUE;
+	    }
+	}
+
+      /* Try to turn a 24bit pc-relative cmp&branch into
+	 an 8bit pc-relative cmp&branch.  */
+      if (ELF32_R_TYPE (irel->r_info) == (int) R_CRX_REL24)
+	{
+	  bfd_vma value = symval;
+
+	  /* Deal with pc-relative gunk.  */
+	  value -= (sec->output_section->vma + sec->output_offset);
+	  value -= irel->r_offset;
+	  value += irel->r_addend;
+
+	  /* See if the value will fit in 8 bits, note the high value is
+	     0x7e + 2 as the target will be two bytes closer if we are
+	     able to relax.  */
+	  if ((long) value < 0x100 && (long) value > -0x100)
+	    {
+	      unsigned short code;
+
+	      /* Get the opcode.  */
+	      code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
+
+	      /* Verify it's a 'cmp&branch' opcode.  */
+	      if ((code & 0xfff0) != 0x3180 && (code & 0xfff0) != 0x3190
+	       && (code & 0xfff0) != 0x31a0 && (code & 0xfff0) != 0x31c0
+	       && (code & 0xfff0) != 0x31d0 && (code & 0xfff0) != 0x31e0)
+		continue;
+
+	      /* Note that we've changed the relocs, section contents, etc.  */
+	      elf_section_data (sec)->relocs = internal_relocs;
+	      elf_section_data (sec)->this_hdr.contents = contents;
+	      symtab_hdr->contents = (unsigned char *) isymbuf;
+
+	      /* Fix the opcode.  */
+	      bfd_put_8 (abfd, 0x30, contents + irel->r_offset + 1);
+
+	      /* Fix the relocation's type.  */
+	      irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+					   R_CRX_REL8_CMP);
+
+	      /* Delete two bytes of data.  */
+	      if (!elf32_crx_relax_delete_bytes (abfd, sec,
+						   irel->r_offset + 4, 2))
+		goto error_return;
+
+	      /* That will change things, so, we should relax again.
+		 Note that this is not required, and it may be slow.  */
+	      *again = TRUE;
+	    }
+	}
+
+      /* Try to turn a 32bit immediate address into
+	 a 16bit immediate address.  */
+      if (ELF32_R_TYPE (irel->r_info) == (int) R_CRX_IMM32)
+	{
+	  bfd_vma value = symval;
+
+	  /* See if the value will fit in 16 bits.  */
+	  if ((long) value < 0x7fff && (long) value > -0x8000)
+	    {
+	      unsigned short code;
+
+	      /* Get the opcode.  */
+	      code = (unsigned short) bfd_get_16 (abfd, contents + irel->r_offset);
+
+	      /* Verify it's a 'arithmetic double'.  */
+	      if ((code & 0xf0f0) != 0x20f0)
+		continue;
+
+	      /* Note that we've changed the relocs, section contents, etc.  */
+	      elf_section_data (sec)->relocs = internal_relocs;
+	      elf_section_data (sec)->this_hdr.contents = contents;
+	      symtab_hdr->contents = (unsigned char *) isymbuf;
+
+	      /* Fix the opcode.  */
+	      bfd_put_8 (abfd, (code & 0xff) - 0x10, contents + irel->r_offset);
+
+	      /* Fix the relocation's type.  */
+	      irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+					   R_CRX_IMM16);
+
+	      /* Delete two bytes of data.  */
+	      if (!elf32_crx_relax_delete_bytes (abfd, sec,
+						   irel->r_offset + 2, 2))
+		goto error_return;
+
+	      /* That will change things, so, we should relax again.
+		 Note that this is not required, and it may be slow.  */
+	      *again = TRUE;
+	    }
+	}
+    }
+
+  if (isymbuf != NULL
+      && symtab_hdr->contents != (unsigned char *) isymbuf)
+    {
+      if (! link_info->keep_memory)
+	free (isymbuf);
+      else
+	{
+	  /* Cache the symbols for elf_link_input_bfd.  */
+	  symtab_hdr->contents = (unsigned char *) isymbuf;
+	}
+    }
+
+  if (contents != NULL
+      && elf_section_data (sec)->this_hdr.contents != contents)
+    {
+      if (! link_info->keep_memory)
+	free (contents);
+      else
+	{
+	  /* Cache the section contents for elf_link_input_bfd.  */
+	  elf_section_data (sec)->this_hdr.contents = contents;
+	}
+    }
+
+  if (internal_relocs != NULL
+      && elf_section_data (sec)->relocs != internal_relocs)
+    free (internal_relocs);
+
+  return TRUE;
+
+ error_return:
+  if (isymbuf != NULL
+      && symtab_hdr->contents != (unsigned char *) isymbuf)
+    free (isymbuf);
+  if (contents != NULL
+      && elf_section_data (sec)->this_hdr.contents != contents)
+    free (contents);
+  if (internal_relocs != NULL
+      && elf_section_data (sec)->relocs != internal_relocs)
+    free (internal_relocs);
+
+  return FALSE;
+}
+
+static asection *
+elf32_crx_gc_mark_hook (asection *sec,
+			struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			Elf_Internal_Rela *rel ATTRIBUTE_UNUSED,
+			struct elf_link_hash_entry *h,
+			Elf_Internal_Sym *sym)
+{
+  if (h == NULL)
+    return bfd_section_from_elf_index (sec->owner, sym->st_shndx);
+
+  switch (h->root.type)
+    {
+    case bfd_link_hash_defined:
+    case bfd_link_hash_defweak:
+      return h->root.u.def.section;
+
+    case bfd_link_hash_common:
+      return h->root.u.c.p->section;
+
+    default:
+      return NULL;
+    }
+}
+
+/* Update the got entry reference counts for the section being removed.  */
+
+static bfd_boolean
+elf32_crx_gc_sweep_hook (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 support garbage collection of GOT and PLT relocs yet.  */
+  return TRUE;
+}
+
+/* Definitions for setting CRX target vector.  */
+#define TARGET_LITTLE_SYM		bfd_elf32_crx_vec
+#define TARGET_LITTLE_NAME		"elf32-crx"
+#define ELF_ARCH			bfd_arch_crx
+#define ELF_MACHINE_CODE		EM_CRX
+#define ELF_MAXPAGESIZE			0x1
+#define elf_symbol_leading_char		'_'
+
+#define bfd_elf32_bfd_reloc_type_lookup	elf_crx_reloc_type_lookup
+#define elf_info_to_howto		elf_crx_info_to_howto
+#define elf_info_to_howto_rel		0
+#define elf_backend_relocate_section	elf32_crx_relocate_section
+#define bfd_elf32_bfd_relax_section	elf32_crx_relax_section
+#define bfd_elf32_bfd_get_relocated_section_contents \
+				elf32_crx_get_relocated_section_contents
+#define elf_backend_gc_mark_hook        elf32_crx_gc_mark_hook
+#define elf_backend_gc_sweep_hook       elf32_crx_gc_sweep_hook
+#define elf_backend_can_gc_sections     1
+#define elf_backend_rela_normal		1
+
+#include "elf32-target.h"
diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c
index 4bdaffc..e845a25 100644
--- a/bfd/elf32-d10v.c
+++ b/bfd/elf32-d10v.c
@@ -334,14 +334,14 @@
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_D10V_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_D10V_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
             return FALSE;
           break;
         }
diff --git a/bfd/elf32-d30v.c b/bfd/elf32-d30v.c
index b08977f..6a84522 100644
--- a/bfd/elf32-d30v.c
+++ b/bfd/elf32-d30v.c
@@ -1,5 +1,5 @@
 /* D30V-specific support for 32-bit ELF
-   Copyright 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2004
    Free Software Foundation, Inc.
    Contributed by Martin Hunt (hunt@cygnus.com).
 
@@ -290,7 +290,7 @@
     flag = bfd_reloc_undefined;
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
@@ -399,7 +399,7 @@
     flag = bfd_reloc_undefined;
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c
index 6ccb9f5..f8a3946 100644
--- a/bfd/elf32-dlx.c
+++ b/bfd/elf32-dlx.c
@@ -1,5 +1,5 @@
 /* DLX specific support for 32-bit ELF
-   Copyright 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -307,7 +307,7 @@
   relocation += reloc_entry->addend;
   relocation += bfd_get_16 (abfd, (bfd_byte *)data + reloc_entry->address);
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
 #if 0
@@ -558,14 +558,14 @@
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_DLX_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_DLX_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
         }
diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c
index 80408fa..5f70e3f 100644
--- a/bfd/elf32-fr30.c
+++ b/bfd/elf32-fr30.c
@@ -718,14 +718,14 @@
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_FR30_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_FR30_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
         }
diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c
index eedc55d..3b64a0e 100644
--- a/bfd/elf32-frv.c
+++ b/bfd/elf32-frv.c
@@ -1,5 +1,5 @@
 /* FRV-specific support for 32-bit ELF.
-   Copyright 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -52,7 +52,7 @@
   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
 	   Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));
 static bfd_boolean elf32_frv_add_symbol_hook
-  PARAMS (( bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+  PARAMS (( bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
 	    const char **, flagword *, asection **, bfd_vma *));
 static bfd_reloc_status_type frv_final_link_relocate
   PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,
@@ -583,10 +583,12 @@
 };
 #endif
 
+extern const bfd_target bfd_elf32_frvfdpic_vec;
+#define IS_FDPIC(bfd) ((bfd)->xvec == &bfd_elf32_frvfdpic_vec)
 
 /* An extension of the elf hash table data structure, containing some
    additional FRV-specific data.  */
-struct frv_elf_link_hash_table
+struct frvfdpic_elf_link_hash_table
 {
   struct elf_link_hash_table elf;
 
@@ -612,33 +614,33 @@
 
 /* Get the FRV ELF linker hash table from a link_info structure.  */
 
-#define frv_hash_table(info) \
-  ((struct frv_elf_link_hash_table *) ((info)->hash))
+#define frvfdpic_hash_table(info) \
+  ((struct frvfdpic_elf_link_hash_table *) ((info)->hash))
 
-#define frv_got_section(info) \
-  (frv_hash_table (info)->sgot)
-#define frv_gotrel_section(info) \
-  (frv_hash_table (info)->sgotrel)
-#define frv_gotfixup_section(info) \
-  (frv_hash_table (info)->sgotfixup)
-#define frv_plt_section(info) \
-  (frv_hash_table (info)->splt)
-#define frv_pltrel_section(info) \
-  (frv_hash_table (info)->spltrel)
-#define frv_relocs_info(info) \
-  (frv_hash_table (info)->relocs_info)
-#define frv_got_initial_offset(info) \
-  (frv_hash_table (info)->got0)
-#define frv_plt_initial_offset(info) \
-  (frv_hash_table (info)->plt0)
+#define frvfdpic_got_section(info) \
+  (frvfdpic_hash_table (info)->sgot)
+#define frvfdpic_gotrel_section(info) \
+  (frvfdpic_hash_table (info)->sgotrel)
+#define frvfdpic_gotfixup_section(info) \
+  (frvfdpic_hash_table (info)->sgotfixup)
+#define frvfdpic_plt_section(info) \
+  (frvfdpic_hash_table (info)->splt)
+#define frvfdpic_pltrel_section(info) \
+  (frvfdpic_hash_table (info)->spltrel)
+#define frvfdpic_relocs_info(info) \
+  (frvfdpic_hash_table (info)->relocs_info)
+#define frvfdpic_got_initial_offset(info) \
+  (frvfdpic_hash_table (info)->got0)
+#define frvfdpic_plt_initial_offset(info) \
+  (frvfdpic_hash_table (info)->plt0)
 
 /* Create an FRV ELF linker hash table.  */
 
 static struct bfd_link_hash_table *
-frv_elf_link_hash_table_create (bfd *abfd)
+frvfdpic_elf_link_hash_table_create (bfd *abfd)
 {
-  struct frv_elf_link_hash_table *ret;
-  bfd_size_type amt = sizeof (struct frv_elf_link_hash_table);
+  struct frvfdpic_elf_link_hash_table *ret;
+  bfd_size_type amt = sizeof (struct frvfdpic_elf_link_hash_table);
 
   ret = bfd_zalloc (abfd, amt);
   if (ret == NULL)
@@ -657,7 +659,7 @@
 /* Decide whether a reference to a symbol can be resolved locally or
    not.  If the symbol is protected, we want the local address, but
    its function descriptor must be assigned by the dynamic linker.  */
-#define FRV_SYM_LOCAL(INFO, H) \
+#define FRVFDPIC_SYM_LOCAL(INFO, H) \
   (_bfd_elf_symbol_refs_local_p ((H), (INFO), 1) \
    || ! elf_hash_table (INFO)->dynamic_sections_created \
    || (/* The condition below is an ugly hack to get .scommon data to
@@ -670,13 +672,13 @@
 	|| (H)->root.type == bfd_link_hash_defweak) \
        && (H)->root.u.def.section->output_section \
        && ((H)->root.u.def.section->flags & SEC_LINKER_CREATED)))
-#define FRV_FUNCDESC_LOCAL(INFO, H) \
+#define FRVFDPIC_FUNCDESC_LOCAL(INFO, H) \
   ((H)->dynindx == -1 || ! elf_hash_table (INFO)->dynamic_sections_created)
 
 /* This structure collects information on what kind of GOT, PLT or
    function descriptors are required by relocations that reference a
    certain symbol.  */
-struct frv_pic_relocs_info
+struct frvfdpic_relocs_info
 {
   /* The index of the symbol, as stored in the relocation r_info, if
      we have a local symbol; -1 otherwise.  */
@@ -727,17 +729,17 @@
   unsigned sym:1;
   /* Whether we need a PLT entry for a symbol.  Should be implied by
      something like:
-     (call && symndx == -1 && ! FRV_SYM_LOCAL (info, d.h))  */
+     (call && symndx == -1 && ! FRVFDPIC_SYM_LOCAL (info, d.h))  */
   unsigned plt:1;
   /* Whether a function descriptor should be created in this link unit
      for symbol+addend.  Should be implied by something like:
      (plt || fdgotoff12 || fdgotofflos || fdgotofflohi
       || ((fd || fdgot12 || fdgotlos || fdgothilo)
-          && (symndx != -1 || FRV_FUNCDESC_LOCAL (info, d.h))))  */
+          && (symndx != -1 || FRVFDPIC_FUNCDESC_LOCAL (info, d.h))))  */
   unsigned privfd:1;
   /* Whether a lazy PLT entry is needed for this symbol+addend.
      Should be implied by something like:
-     (privfd && symndx == -1 && ! FRV_SYM_LOCAL (info, d.h)
+     (privfd && symndx == -1 && ! FRVFDPIC_SYM_LOCAL (info, d.h)
       && ! (info->flags & DF_BIND_NOW))  */
   unsigned lazyplt:1;
   /* Whether we've already emitted GOT relocations and PLT entries as
@@ -764,24 +766,24 @@
   bfd_vma plt_entry, lzplt_entry;
 };
 
-/* Compute a hash with the key fields of an frv_pic_relocs_info entry.  */
+/* Compute a hash with the key fields of an frvfdpic_relocs_info entry.  */
 static hashval_t
-frv_pic_relocs_info_hash (const void *entry_)
+frvfdpic_relocs_info_hash (const void *entry_)
 {
-  const struct frv_pic_relocs_info *entry = entry_;
+  const struct frvfdpic_relocs_info *entry = entry_;
 
   return (entry->symndx == -1
 	  ? entry->d.h->root.root.hash
 	  : entry->symndx + entry->d.abfd->id * 257) + entry->addend;
 }
 
-/* Test whether the key fields of two frv_pic_relocs_info entries are
+/* Test whether the key fields of two frvfdpic_relocs_info entries are
    identical.  */
 static int
-frv_pic_relocs_info_eq (const void *entry1, const void *entry2)
+frvfdpic_relocs_info_eq (const void *entry1, const void *entry2)
 {
-  const struct frv_pic_relocs_info *e1 = entry1;
-  const struct frv_pic_relocs_info *e2 = entry2;
+  const struct frvfdpic_relocs_info *e1 = entry1;
+  const struct frvfdpic_relocs_info *e2 = entry2;
 
   return e1->symndx == e2->symndx && e1->addend == e2->addend
     && (e1->symndx == -1 ? e1->d.h == e2->d.h : e1->d.abfd == e2->d.abfd);
@@ -790,14 +792,14 @@
 /* Find or create an entry in a hash table HT that matches the key
    fields of the given ENTRY.  If it's not found, memory for a new
    entry is allocated in ABFD's obstack.  */
-static struct frv_pic_relocs_info *
-frv_pic_relocs_info_find (struct htab *ht,
-			  bfd *abfd,
-			  const struct frv_pic_relocs_info *entry,
-			  enum insert_option insert)
+static struct frvfdpic_relocs_info *
+frvfdpic_relocs_info_find (struct htab *ht,
+			   bfd *abfd,
+			   const struct frvfdpic_relocs_info *entry,
+			   enum insert_option insert)
 {
-  struct frv_pic_relocs_info **loc =
-    (struct frv_pic_relocs_info **) htab_find_slot (ht, entry, insert);
+  struct frvfdpic_relocs_info **loc =
+    (struct frvfdpic_relocs_info **) htab_find_slot (ht, entry, insert);
 
   if (! loc)
     return NULL;
@@ -822,47 +824,47 @@
 /* Obtain the address of the entry in HT associated with H's symbol +
    addend, creating a new entry if none existed.  ABFD is only used
    for memory allocation purposes.  */
-inline static struct frv_pic_relocs_info *
-frv_pic_relocs_info_for_global (struct htab *ht,
-				bfd *abfd,
-				struct elf_link_hash_entry *h,
-				bfd_vma addend,
-				enum insert_option insert)
+inline static struct frvfdpic_relocs_info *
+frvfdpic_relocs_info_for_global (struct htab *ht,
+				 bfd *abfd,
+				 struct elf_link_hash_entry *h,
+				 bfd_vma addend,
+				 enum insert_option insert)
 {
-  struct frv_pic_relocs_info entry;
+  struct frvfdpic_relocs_info entry;
 
   entry.symndx = -1;
   entry.d.h = h;
   entry.addend = addend;
 
-  return frv_pic_relocs_info_find (ht, abfd, &entry, insert);
+  return frvfdpic_relocs_info_find (ht, abfd, &entry, insert);
 }
 
 /* Obtain the address of the entry in HT associated with the SYMNDXth
    local symbol of the input bfd ABFD, plus the addend, creating a new
    entry if none existed.  */  
-inline static struct frv_pic_relocs_info *
-frv_pic_relocs_info_for_local (struct htab *ht,
-			       bfd *abfd,
-			       long symndx,
-			       bfd_vma addend,
-			       enum insert_option insert)
+inline static struct frvfdpic_relocs_info *
+frvfdpic_relocs_info_for_local (struct htab *ht,
+				bfd *abfd,
+				long symndx,
+				bfd_vma addend,
+				enum insert_option insert)
 {
-  struct frv_pic_relocs_info entry;
+  struct frvfdpic_relocs_info entry;
 
   entry.symndx = symndx;
   entry.d.abfd = abfd;
   entry.addend = addend;
 
-  return frv_pic_relocs_info_find (ht, abfd, &entry, insert);
+  return frvfdpic_relocs_info_find (ht, abfd, &entry, insert);
 }
 
 /* Merge fields set by check_relocs() of two entries that end up being
    mapped to the same (presumably global) symbol.  */
 
 inline static void
-frv_pic_merge_early_relocs_info (struct frv_pic_relocs_info *e2,
-				 struct frv_pic_relocs_info const *e1)
+frvfdpic_pic_merge_early_relocs_info (struct frvfdpic_relocs_info *e2,
+				      struct frvfdpic_relocs_info const *e1)
 {
   e2->got12 |= e1->got12;
   e2->gotlos |= e1->gotlos;
@@ -879,8 +881,8 @@
   e2->sym |= e1->sym;
 
 #if 0
-  /* These are set in _frv_count_got_plt_entries() or later, and this
-     function is only called in _frv_resolve_final_relocs_info(), that
+  /* These are set in _frvfdpic_count_got_plt_entries() or later, and this
+     function is only called in _frvfdpic_resolve_final_relocs_info(), that
      runs just before it, so we don't have to worry about the fields
      below.  */
 
@@ -914,15 +916,15 @@
    32767, counting from 0).  All other lazy PLT entries branch to it
    in a single instruction.  */
 
-#define FRV_LZPLT_BLOCK_SIZE ((bfd_vma) 8 * 65535 + 4)
-#define FRV_LZPLT_RESOLV_LOC (8 * 32767)
+#define FRVFDPIC_LZPLT_BLOCK_SIZE ((bfd_vma) 8 * 65535 + 4)
+#define FRVFDPIC_LZPLT_RESOLV_LOC (8 * 32767)
 
 /* Add a dynamic relocation to the SRELOC section.  */
 
 inline static bfd_vma
-_frv_add_dyn_reloc (bfd *output_bfd, asection *sreloc, bfd_vma offset,
-		    int reloc_type, long dynindx, bfd_vma addend,
-		    struct frv_pic_relocs_info *entry)
+_frvfdpic_add_dyn_reloc (bfd *output_bfd, asection *sreloc, bfd_vma offset,
+			 int reloc_type, long dynindx, bfd_vma addend,
+			 struct frvfdpic_relocs_info *entry)
 {
   Elf_Internal_Rela outrel;
   bfd_vma reloc_offset;
@@ -932,13 +934,23 @@
   outrel.r_addend = addend;
 
   reloc_offset = sreloc->reloc_count * sizeof (Elf32_External_Rel);
-  BFD_ASSERT (reloc_offset < sreloc->_raw_size);
+  BFD_ASSERT (reloc_offset < sreloc->size);
   bfd_elf32_swap_reloc_out (output_bfd, &outrel,
 			    sreloc->contents + reloc_offset);
   sreloc->reloc_count++;
 
-  BFD_ASSERT (entry->dynrelocs > 0);
-  entry->dynrelocs--;
+  /* If the entry's index is zero, this relocation was probably to a
+     linkonce section that got discarded.  We reserved a dynamic
+     relocation, but it was for another entry than the one we got at
+     the time of emitting the relocation.  Unfortunately there's no
+     simple way for us to catch this situation, since the relocation
+     is cleared right before calling relocate_section, at which point
+     we no longer know what the relocation used to point to.  */
+  if (entry->symndx)
+    {
+      BFD_ASSERT (entry->dynrelocs > 0);
+      entry->dynrelocs--;
+    }
 
   return reloc_offset;
 }
@@ -946,8 +958,8 @@
 /* Add a fixup to the ROFIXUP section.  */
 
 static bfd_vma
-_frv_add_rofixup (bfd *output_bfd, asection *rofixup, bfd_vma offset,
-		  struct frv_pic_relocs_info *entry)
+_frvfdpic_add_rofixup (bfd *output_bfd, asection *rofixup, bfd_vma offset,
+		       struct frvfdpic_relocs_info *entry)
 {
   bfd_vma fixup_offset;
 
@@ -957,13 +969,15 @@
   fixup_offset = rofixup->reloc_count * 4;
   if (rofixup->contents)
     {
-      BFD_ASSERT (fixup_offset < rofixup->_raw_size);
+      BFD_ASSERT (fixup_offset < rofixup->size);
       bfd_put_32 (output_bfd, offset, rofixup->contents + fixup_offset);
     }
   rofixup->reloc_count++;
 
-  if (entry)
+  if (entry && entry->symndx)
     {
+      /* See discussion about symndx == 0 in _frvfdpic_add_dyn_reloc
+	 above.  */
       BFD_ASSERT (entry->fixups > 0);
       entry->fixups--;
     }
@@ -975,7 +989,7 @@
    located.  */
 
 static unsigned
-_frv_osec_to_segment (bfd *output_bfd, asection *osec)
+_frvfdpic_osec_to_segment (bfd *output_bfd, asection *osec)
 {
   struct elf_segment_map *m;
   Elf_Internal_Phdr *p;
@@ -1000,9 +1014,9 @@
 }
 
 inline static bfd_boolean
-_frv_osec_readonly_p (bfd *output_bfd, asection *osec)
+_frvfdpic_osec_readonly_p (bfd *output_bfd, asection *osec)
 {
-  unsigned seg = _frv_osec_to_segment (output_bfd, osec);
+  unsigned seg = _frvfdpic_osec_to_segment (output_bfd, osec);
 
   return ! (elf_tdata (output_bfd)->phdr[seg].p_flags & PF_W);
 }
@@ -1011,12 +1025,12 @@
    code for PLT and lazy PLT entries.  */
 
 inline static bfd_boolean
-_frv_emit_got_relocs_plt_entries (struct frv_pic_relocs_info *entry,
-				  bfd *output_bfd,
-				  struct bfd_link_info *info,
-				  asection *sec,
-				  Elf_Internal_Sym *sym,
-				  bfd_vma addend)
+_frvfdpic_emit_got_relocs_plt_entries (struct frvfdpic_relocs_info *entry,
+				       bfd *output_bfd,
+				       struct bfd_link_info *info,
+				       asection *sec,
+				       Elf_Internal_Sym *sym,
+				       bfd_vma addend)
 				  
 {
   bfd_vma fd_lazy_rel_offset = (bfd_vma)-1;
@@ -1051,7 +1065,8 @@
 
       /* If the symbol is dynamic but binds locally, use
 	 section+offset.  */
-      if (sec && (entry->symndx != -1 || FRV_SYM_LOCAL (info, entry->d.h)))
+      if (sec && (entry->symndx != -1
+		  || FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
 	{
 	  if (entry->symndx == -1)
 	    ad += entry->d.h->root.u.def.value;
@@ -1068,32 +1083,36 @@
 	 omit the dynamic relocation as long as the symbol is local to
 	 this module.  */
       if (info->executable && !info->pie
-	  && (entry->symndx != -1 || FRV_SYM_LOCAL (info, entry->d.h)))
+	  && (entry->symndx != -1
+	      || FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
 	{
 	  if (sec)
 	    ad += sec->output_section->vma;
 	  if (entry->symndx != -1
 	      || entry->d.h->root.type != bfd_link_hash_undefweak)
-	    _frv_add_rofixup (output_bfd, frv_gotfixup_section (info),
-			      frv_got_section (info)->output_section->vma
-			      + frv_got_section (info)->output_offset
-			      + frv_got_initial_offset (info)
-			      + entry->got_entry, entry);
+	    _frvfdpic_add_rofixup (output_bfd,
+				   frvfdpic_gotfixup_section (info),
+				   frvfdpic_got_section (info)->output_section
+				   ->vma
+				   + frvfdpic_got_section (info)->output_offset
+				   + frvfdpic_got_initial_offset (info)
+				   + entry->got_entry, entry);
 	}
       else
-	_frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
-			    _bfd_elf_section_offset
-			    (output_bfd, info,
-			     frv_got_section (info),
-			     frv_got_initial_offset (info)
-			     + entry->got_entry)
-			    + frv_got_section (info)->output_section->vma
-			    + frv_got_section (info)->output_offset,
-			    R_FRV_32, idx, ad, entry);
+	_frvfdpic_add_dyn_reloc (output_bfd, frvfdpic_gotrel_section (info),
+				 _bfd_elf_section_offset
+				 (output_bfd, info,
+				  frvfdpic_got_section (info),
+				  frvfdpic_got_initial_offset (info)
+				  + entry->got_entry)
+				 + frvfdpic_got_section (info)
+				 ->output_section->vma
+				 + frvfdpic_got_section (info)->output_offset,
+				 R_FRV_32, idx, ad, entry);
 	
       bfd_put_32 (output_bfd, ad,
-		  frv_got_section (info)->contents
-		  + frv_got_initial_offset (info)
+		  frvfdpic_got_section (info)->contents
+		  + frvfdpic_got_initial_offset (info)
 		  + entry->got_entry);
     }
 
@@ -1106,7 +1125,7 @@
       
       if (! (entry->symndx == -1
 	     && entry->d.h->root.type == bfd_link_hash_undefweak
-	     && FRV_SYM_LOCAL (info, entry->d.h)))
+	     && FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
 	{
 	  /* If the symbol is dynamic and there may be dynamic symbol
 	     resolution because we are, or are linked with, a shared
@@ -1115,8 +1134,9 @@
 	     symbol needs a non-local function descriptor but binds
 	     locally (e.g., its visibility is protected, emit a
 	     dynamic relocation decayed to section+offset.  */
-	  if (entry->symndx == -1 && ! FRV_FUNCDESC_LOCAL (info, entry->d.h)
-	      && FRV_SYM_LOCAL (info, entry->d.h)
+	  if (entry->symndx == -1
+	      && ! FRVFDPIC_FUNCDESC_LOCAL (info, entry->d.h)
+	      && FRVFDPIC_SYM_LOCAL (info, entry->d.h)
 	      && !(info->executable && !info->pie))
 	    {
 	      reloc = R_FRV_FUNCDESC;
@@ -1126,7 +1146,7 @@
 		+ entry->d.h->root.u.def.value;
 	    }
 	  else if (entry->symndx == -1
-		   && ! FRV_FUNCDESC_LOCAL (info, entry->d.h))
+		   && ! FRVFDPIC_FUNCDESC_LOCAL (info, entry->d.h))
 	    {
 	      reloc = R_FRV_FUNCDESC;
 	      idx = dynindx;
@@ -1141,10 +1161,10 @@
 	      if (elf_hash_table (info)->dynamic_sections_created)
 		BFD_ASSERT (entry->privfd);
 	      reloc = R_FRV_32;
-	      idx = elf_section_data (frv_got_section (info)
+	      idx = elf_section_data (frvfdpic_got_section (info)
 				      ->output_section)->dynindx;
-	      ad = frv_got_section (info)->output_offset
-		+ frv_got_initial_offset (info) + entry->fd_entry;
+	      ad = frvfdpic_got_section (info)->output_offset
+		+ frvfdpic_got_initial_offset (info) + entry->fd_entry;
 	    }
 
 	  /* If there is room for dynamic symbol resolution, emit the
@@ -1155,30 +1175,36 @@
 	     of the private descriptor ourselves.  */
 	  if (info->executable && !info->pie
 	      && (entry->symndx != -1
-		  || FRV_FUNCDESC_LOCAL (info, entry->d.h)))
+		  || FRVFDPIC_FUNCDESC_LOCAL (info, entry->d.h)))
 	    {
-	      ad += frv_got_section (info)->output_section->vma;
-	      _frv_add_rofixup (output_bfd, frv_gotfixup_section (info),
-				frv_got_section (info)->output_section->vma
-				+ frv_got_section (info)->output_offset
-				+ frv_got_initial_offset (info)
-				+ entry->fdgot_entry, entry);
+	      ad += frvfdpic_got_section (info)->output_section->vma;
+	      _frvfdpic_add_rofixup (output_bfd,
+				     frvfdpic_gotfixup_section (info),
+				     frvfdpic_got_section (info)
+				     ->output_section->vma
+				     + frvfdpic_got_section (info)
+				     ->output_offset
+				     + frvfdpic_got_initial_offset (info)
+				     + entry->fdgot_entry, entry);
 	    }
 	  else
-	    _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
-				_bfd_elf_section_offset
-				(output_bfd, info,
-				 frv_got_section (info),
-				 frv_got_initial_offset (info)
-				 + entry->fdgot_entry)
-				+ frv_got_section (info)->output_section->vma
-				+ frv_got_section (info)->output_offset,
-				reloc, idx, ad, entry);
+	    _frvfdpic_add_dyn_reloc (output_bfd,
+				     frvfdpic_gotrel_section (info),
+				     _bfd_elf_section_offset
+				     (output_bfd, info,
+				      frvfdpic_got_section (info),
+				      frvfdpic_got_initial_offset (info)
+				      + entry->fdgot_entry)
+				     + frvfdpic_got_section (info)
+				     ->output_section->vma
+				     + frvfdpic_got_section (info)
+				     ->output_offset,
+				     reloc, idx, ad, entry);
 	}
 
       bfd_put_32 (output_bfd, ad,
-		  frv_got_section (info)->contents
-		  + frv_got_initial_offset (info)
+		  frvfdpic_got_section (info)->contents
+		  + frvfdpic_got_initial_offset (info)
 		  + entry->fdgot_entry);
     }
 
@@ -1193,7 +1219,8 @@
 
       /* If the symbol is dynamic but binds locally, use
 	 section+offset.  */
-      if (sec && (entry->symndx != -1 || FRV_SYM_LOCAL (info, entry->d.h)))
+      if (sec && (entry->symndx != -1
+		  || FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
 	{
 	  if (entry->symndx == -1)
 	    ad += entry->d.h->root.u.def.value;
@@ -1210,7 +1237,7 @@
 	 omit the dynamic relocation as long as the symbol is local to
 	 this module.  */
       if (info->executable && !info->pie
-	  && (entry->symndx != -1 || FRV_SYM_LOCAL (info, entry->d.h)))
+	  && (entry->symndx != -1 || FRVFDPIC_SYM_LOCAL (info, entry->d.h)))
 	{
 	  if (sec)
 	    ad += sec->output_section->vma;
@@ -1218,32 +1245,41 @@
 	  if (entry->symndx != -1
 	      || entry->d.h->root.type != bfd_link_hash_undefweak)
 	    {
-	      _frv_add_rofixup (output_bfd, frv_gotfixup_section (info),
-				frv_got_section (info)->output_section->vma
-				+ frv_got_section (info)->output_offset
-				+ frv_got_initial_offset (info)
-				+ entry->fd_entry, entry);
-	      _frv_add_rofixup (output_bfd, frv_gotfixup_section (info),
-				frv_got_section (info)->output_section->vma
-				+ frv_got_section (info)->output_offset
-				+ frv_got_initial_offset (info)
-				+ entry->fd_entry + 4, entry);
+	      _frvfdpic_add_rofixup (output_bfd,
+				     frvfdpic_gotfixup_section (info),
+				     frvfdpic_got_section (info)
+				     ->output_section->vma
+				     + frvfdpic_got_section (info)
+				     ->output_offset
+				     + frvfdpic_got_initial_offset (info)
+				     + entry->fd_entry, entry);
+	      _frvfdpic_add_rofixup (output_bfd,
+				     frvfdpic_gotfixup_section (info),
+				     frvfdpic_got_section (info)
+				     ->output_section->vma
+				     + frvfdpic_got_section (info)
+				     ->output_offset
+				     + frvfdpic_got_initial_offset (info)
+				     + entry->fd_entry + 4, entry);
 	    }
 	}
       else
 	{
 	  ofst =
-	    _frv_add_dyn_reloc (output_bfd,
-				entry->lazyplt ? frv_pltrel_section (info)
-				: frv_gotrel_section (info),
-				_bfd_elf_section_offset
-				(output_bfd, info,
-				 frv_got_section (info),
-				 frv_got_initial_offset (info)
-				 + entry->fd_entry)
-				+ frv_got_section (info)->output_section->vma
-				+ frv_got_section (info)->output_offset,
-				R_FRV_FUNCDESC_VALUE, idx, ad, entry);
+	    _frvfdpic_add_dyn_reloc (output_bfd,
+				     entry->lazyplt
+				     ? frvfdpic_pltrel_section (info)
+				     : frvfdpic_gotrel_section (info),
+				     _bfd_elf_section_offset
+				     (output_bfd, info,
+				      frvfdpic_got_section (info),
+				      frvfdpic_got_initial_offset (info)
+				      + entry->fd_entry)
+				     + frvfdpic_got_section (info)
+				     ->output_section->vma
+				     + frvfdpic_got_section (info)
+				     ->output_offset,
+				     R_FRV_FUNCDESC_VALUE, idx, ad, entry);
 	}
 
       /* If we've omitted the dynamic relocation, just emit the fixed
@@ -1251,9 +1287,9 @@
       if (info->executable && !info->pie && sec && sec->output_section)
 	{
 	  lowword = ad;
-	  highword = frv_got_section (info)->output_section->vma
-	    + frv_got_section (info)->output_offset
-	    + frv_got_initial_offset (info);
+	  highword = frvfdpic_got_section (info)->output_section->vma
+	    + frvfdpic_got_section (info)->output_offset
+	    + frvfdpic_got_initial_offset (info);
 	}
       else if (entry->lazyplt)
 	{
@@ -1269,10 +1305,10 @@
 	     entry point, that must be within the memory region
 	     assigned to that section.  */
 	  lowword = entry->lzplt_entry + 4
-	    + frv_plt_section (info)->output_offset
-	    + frv_plt_section (info)->output_section->vma;
-	  highword = _frv_osec_to_segment 
-	    (output_bfd, frv_plt_section (info)->output_section);
+	    + frvfdpic_plt_section (info)->output_offset
+	    + frvfdpic_plt_section (info)->output_section->vma;
+	  highword = _frvfdpic_osec_to_segment 
+	    (output_bfd, frvfdpic_plt_section (info)->output_section);
 	}
       else
 	{
@@ -1284,23 +1320,25 @@
 	      && entry->d.h->dynindx == idx)
 	    highword = 0;
 	  else
-	    highword = _frv_osec_to_segment (output_bfd, sec->output_section);
+	    highword = _frvfdpic_osec_to_segment
+	      (output_bfd, sec->output_section);
 	}
 
       bfd_put_32 (output_bfd, lowword,
-		  frv_got_section (info)->contents
-		  + frv_got_initial_offset (info)
+		  frvfdpic_got_section (info)->contents
+		  + frvfdpic_got_initial_offset (info)
 		  + entry->fd_entry);
       bfd_put_32 (output_bfd, highword,
-		  frv_got_section (info)->contents
-		  + frv_got_initial_offset (info)
+		  frvfdpic_got_section (info)->contents
+		  + frvfdpic_got_initial_offset (info)
 		  + entry->fd_entry + 4);
     }
 
   /* Generate code for the PLT entry.  */
   if (entry->plt_entry != (bfd_vma) -1)
     {
-      bfd_byte *plt_code = frv_plt_section (info)->contents + entry->plt_entry;
+      bfd_byte *plt_code = frvfdpic_plt_section (info)->contents
+	+ entry->plt_entry;
 
       BFD_ASSERT (entry->fd_entry);
 
@@ -1353,17 +1391,17 @@
   /* Generate code for the lazy PLT entry.  */
   if (entry->lzplt_entry != (bfd_vma) -1)
     {
-      bfd_byte *lzplt_code = frv_plt_section (info)->contents
+      bfd_byte *lzplt_code = frvfdpic_plt_section (info)->contents
 	+ entry->lzplt_entry;
       bfd_vma resolverStub_addr;
 
       bfd_put_32 (output_bfd, fd_lazy_rel_offset, lzplt_code);
       lzplt_code += 4;
 
-      resolverStub_addr = entry->lzplt_entry / FRV_LZPLT_BLOCK_SIZE
-	* FRV_LZPLT_BLOCK_SIZE + FRV_LZPLT_RESOLV_LOC;
-      if (resolverStub_addr >= frv_plt_initial_offset (info))
-	resolverStub_addr = frv_plt_initial_offset (info) - 12;
+      resolverStub_addr = entry->lzplt_entry / FRVFDPIC_LZPLT_BLOCK_SIZE
+	* FRVFDPIC_LZPLT_BLOCK_SIZE + FRVFDPIC_LZPLT_RESOLV_LOC;
+      if (resolverStub_addr >= frvfdpic_plt_initial_offset (info))
+	resolverStub_addr = frvfdpic_plt_initial_offset (info) - 12;
 
       if (entry->lzplt_entry == resolverStub_addr)
 	{
@@ -1767,8 +1805,8 @@
 
 /* Set the howto pointer for an FRV ELF REL reloc.  */
 static void
-frv_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
-		       arelent *cache_ptr, Elf_Internal_Rela *dst)
+frvfdpic_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
+			    arelent *cache_ptr, Elf_Internal_Rela *dst)
 {
   unsigned int r_type;
 
@@ -1869,24 +1907,24 @@
   sym_hashes = elf_sym_hashes (input_bfd);
   relend     = relocs + input_section->reloc_count;
 
-  isec_segment = _frv_osec_to_segment (output_bfd,
-				       input_section->output_section);
-  if (frv_got_section (info))
-    got_segment = _frv_osec_to_segment (output_bfd,
-					frv_got_section (info)
-					->output_section);
+  isec_segment = _frvfdpic_osec_to_segment (output_bfd,
+					    input_section->output_section);
+  if (IS_FDPIC (output_bfd) && frvfdpic_got_section (info))
+    got_segment = _frvfdpic_osec_to_segment (output_bfd,
+					     frvfdpic_got_section (info)
+					     ->output_section);
   else
     got_segment = -1;
-  if (frv_gotfixup_section (info))
-    gprel_segment = _frv_osec_to_segment (output_bfd,
-					  frv_gotfixup_section (info)
-					  ->output_section);
+  if (IS_FDPIC (output_bfd) && frvfdpic_gotfixup_section (info))
+    gprel_segment = _frvfdpic_osec_to_segment (output_bfd,
+					       frvfdpic_gotfixup_section (info)
+					       ->output_section);
   else
     gprel_segment = -1;
-  if (elf_hash_table (info)->dynamic_sections_created)
-    plt_segment = _frv_osec_to_segment (output_bfd,
-					frv_plt_section (info)
-					->output_section);
+  if (IS_FDPIC (output_bfd) && elf_hash_table (info)->dynamic_sections_created)
+    plt_segment = _frvfdpic_osec_to_segment (output_bfd,
+					     frvfdpic_plt_section (info)
+					     ->output_section);
   else
     plt_segment = -1;
 
@@ -1902,7 +1940,7 @@
       const char * name = NULL;
       int r_type;
       asection *osec;
-      struct frv_pic_relocs_info *picrel;
+      struct frvfdpic_relocs_info *picrel;
       bfd_vma orig_addend = rel->r_addend;
 
       r_type = ELF32_R_TYPE (rel->r_info);
@@ -1940,7 +1978,7 @@
 
 	  if ((h->root.type == bfd_link_hash_defined
 	       || h->root.type == bfd_link_hash_defweak)
-	      && ! FRV_SYM_LOCAL (info, h))
+	      && ! FRVFDPIC_SYM_LOCAL (info, h))
 	    {
 	      sec = NULL;
 	      relocation = 0;
@@ -1978,6 +2016,9 @@
 	{
 	case R_FRV_LABEL24:
 	case R_FRV_32:
+	  if (! IS_FDPIC (output_bfd))
+	    goto non_fdpic;
+
 	case R_FRV_GOT12:
 	case R_FRV_GOTHI:
 	case R_FRV_GOTLO:
@@ -1993,25 +2034,27 @@
 	case R_FRV_FUNCDESC:
 	case R_FRV_FUNCDESC_VALUE:
 	  if (h != NULL)
-	    picrel = frv_pic_relocs_info_for_global (frv_relocs_info (info),
-						     input_bfd, h,
-						     orig_addend, INSERT);
+	    picrel = frvfdpic_relocs_info_for_global (frvfdpic_relocs_info
+						      (info), input_bfd, h,
+						      orig_addend, INSERT);
 	  else
 	    /* In order to find the entry we created before, we must
 	       use the original addend, not the one that may have been
 	       modified by _bfd_elf_rela_local_sym().  */
-	    picrel = frv_pic_relocs_info_for_local (frv_relocs_info (info),
-						    input_bfd, r_symndx,
-						    orig_addend, INSERT);
+	    picrel = frvfdpic_relocs_info_for_local (frvfdpic_relocs_info
+						     (info), input_bfd, r_symndx,
+						     orig_addend, INSERT);
 	  if (! picrel)
 	    return FALSE;
 
-	  if (!_frv_emit_got_relocs_plt_entries (picrel, output_bfd, info,
-						 osec, sym, rel->r_addend))
+	  if (!_frvfdpic_emit_got_relocs_plt_entries (picrel, output_bfd, info,
+						      osec, sym,
+						      rel->r_addend))
 	    {
-	      info->callbacks->warning
-		(info, _("Dynamic relocation references symbol with nonzero addend"),
-		 name, input_bfd, input_section, rel->r_offset);
+	      (*_bfd_error_handler)
+		(_("%s: relocation at `%s+0x%x' references symbol `%s' with nonzero addend"),
+		 bfd_archive_filename (input_bfd), input_section->name,
+		 rel->r_offset, name);
 	      return FALSE;
 
 	    }
@@ -2019,8 +2062,9 @@
 	  break;
 
 	default:
+	non_fdpic:
 	  picrel = NULL;
-	  if (h && ! FRV_SYM_LOCAL (info, h))
+	  if (h && ! FRVFDPIC_SYM_LOCAL (info, h))
 	    {
 	      info->callbacks->warning
 		(info, _("relocation references symbol not defined in the module"),
@@ -2034,10 +2078,12 @@
 	{
 	case R_FRV_LABEL24:
 	  check_segment[0] = isec_segment;
-	  if (picrel->plt)
+	  if (! IS_FDPIC (output_bfd))
+	    check_segment[1] = isec_segment;
+	  else if (picrel->plt)
 	    {
-	      relocation = frv_plt_section (info)->output_section->vma
-		+ frv_plt_section (info)->output_offset
+	      relocation = frvfdpic_plt_section (info)->output_section->vma
+		+ frvfdpic_plt_section (info)->output_offset
 		+ picrel->plt_entry;
 	      check_segment[1] = plt_segment;
 	    }
@@ -2050,7 +2096,7 @@
 	    check_segment[1] = check_segment[0];
 	  else
 	    check_segment[1] = sec
-	      ? _frv_osec_to_segment (output_bfd, sec->output_section)
+	      ? _frvfdpic_osec_to_segment (output_bfd, sec->output_section)
 	      : (unsigned)-1;
 	  break;
 
@@ -2071,12 +2117,12 @@
 	case R_FRV_GOTOFFHI:
 	case R_FRV_GOTOFF12:
 	case R_FRV_GOTOFFLO:
-	  relocation -= frv_got_section (info)->output_section->vma
-	    + frv_got_section (info)->output_offset
-	    + frv_got_initial_offset (info);
+	  relocation -= frvfdpic_got_section (info)->output_section->vma
+	    + frvfdpic_got_section (info)->output_offset
+	    + frvfdpic_got_initial_offset (info);
 	  check_segment[0] = got_segment;
 	  check_segment[1] = sec
-	    ? _frv_osec_to_segment (output_bfd, sec->output_section)
+	    ? _frvfdpic_osec_to_segment (output_bfd, sec->output_section)
 	    : (unsigned)-1;
 	  break;
 
@@ -2093,7 +2139,7 @@
 	    bfd_vma addend = rel->r_addend;
 
 	    if (! (h && h->root.type == bfd_link_hash_undefweak
-		   && FRV_SYM_LOCAL (info, h)))
+		   && FRVFDPIC_SYM_LOCAL (info, h)))
 	      {
 		/* If the symbol is dynamic and there may be dynamic
 		   symbol resolution because we are or are linked with a
@@ -2103,8 +2149,8 @@
 		   descriptor but binds locally (e.g., its visibility is
 		   protected, emit a dynamic relocation decayed to
 		   section+offset.  */
-		if (h && ! FRV_FUNCDESC_LOCAL (info, h)
-		    && FRV_SYM_LOCAL (info, h)
+		if (h && ! FRVFDPIC_FUNCDESC_LOCAL (info, h)
+		    && FRVFDPIC_SYM_LOCAL (info, h)
 		    && !(info->executable && !info->pie))
 		  {
 		    dynindx = elf_section_data (h->root.u.def.section
@@ -2112,7 +2158,7 @@
 		    addend += h->root.u.def.section->output_offset
 		      + h->root.u.def.value;
 		  }
-		else if (h && ! FRV_FUNCDESC_LOCAL (info, h))
+		else if (h && ! FRVFDPIC_FUNCDESC_LOCAL (info, h))
 		  {
 		    if (addend)
 		      {
@@ -2129,10 +2175,10 @@
 		       descriptor, so reference it directly.  */
 		    BFD_ASSERT (picrel->privfd);
 		    r_type = R_FRV_32;
-		    dynindx = elf_section_data (frv_got_section	(info)
+		    dynindx = elf_section_data (frvfdpic_got_section (info)
 						->output_section)->dynindx;
-		    addend = frv_got_section (info)->output_offset
-		      + frv_got_initial_offset (info)
+		    addend = frvfdpic_got_section (info)->output_offset
+		      + frvfdpic_got_initial_offset (info)
 		      + picrel->fd_entry;
 		  }
 
@@ -2143,15 +2189,16 @@
 		   be zero, which means we can and should compute the
 		   address of the private descriptor ourselves.  */
 		if (info->executable && !info->pie
-		    && (!h || FRV_FUNCDESC_LOCAL (info, h)))
+		    && (!h || FRVFDPIC_FUNCDESC_LOCAL (info, h)))
 		  {
-		    addend += frv_got_section (info)->output_section->vma;
+		    addend += frvfdpic_got_section (info)->output_section->vma;
 		    if ((bfd_get_section_flags (output_bfd,
 						input_section->output_section)
 			 & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
 		      {
-			if (_frv_osec_readonly_p (output_bfd,
-						  input_section->output_section))
+			if (_frvfdpic_osec_readonly_p (output_bfd,
+						       input_section
+						       ->output_section))
 			  {
 			    info->callbacks->warning
 			      (info,
@@ -2159,22 +2206,25 @@
 			       name, input_bfd, input_section, rel->r_offset);
 			    return FALSE;
 			  }
-			_frv_add_rofixup (output_bfd,
-					  frv_gotfixup_section (info),
-					  _bfd_elf_section_offset
-					  (output_bfd, info,
-					   input_section, rel->r_offset)
-					  + input_section->output_section->vma
-					  + input_section->output_offset,
-					  picrel);
+			_frvfdpic_add_rofixup (output_bfd,
+					       frvfdpic_gotfixup_section
+					       (info),
+					       _bfd_elf_section_offset
+					       (output_bfd, info,
+						input_section, rel->r_offset)
+					       + input_section
+					       ->output_section->vma
+					       + input_section->output_offset,
+					       picrel);
 		      }
 		  }
 		else if ((bfd_get_section_flags (output_bfd,
 						 input_section->output_section)
 			  & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
 		  {
-		    if (_frv_osec_readonly_p (output_bfd,
-					      input_section->output_section))
+		    if (_frvfdpic_osec_readonly_p (output_bfd,
+						   input_section
+						   ->output_section))
 		      {
 			info->callbacks->warning
 			  (info,
@@ -2182,14 +2232,18 @@
 			   name, input_bfd, input_section, rel->r_offset);
 			return FALSE;
 		      }
-		    _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
-					_bfd_elf_section_offset
-					(output_bfd, info,
-					 input_section, rel->r_offset)
-					+ input_section->output_section->vma
-					+ input_section->output_offset,
-					r_type, dynindx, addend, picrel);
+		    _frvfdpic_add_dyn_reloc (output_bfd,
+					     frvfdpic_gotrel_section (info),
+					     _bfd_elf_section_offset
+					     (output_bfd, info,
+					      input_section, rel->r_offset)
+					     + input_section
+					     ->output_section->vma
+					     + input_section->output_offset,
+					     r_type, dynindx, addend, picrel);
 		  }
+		else
+		  addend += frvfdpic_got_section (info)->output_section->vma;
 	      }
 
 	    /* We want the addend in-place because dynamic
@@ -2201,6 +2255,12 @@
 	  break;
 
 	case R_FRV_32:
+	  if (! IS_FDPIC (output_bfd))
+	    {
+	      check_segment[0] = check_segment[1] = -1;
+	      break;
+	    }
+	  /* Fall through.  */
 	case R_FRV_FUNCDESC_VALUE:
 	  {
 	    int dynindx;
@@ -2208,7 +2268,7 @@
 
 	    /* If the symbol is dynamic but binds locally, use
 	       section+offset.  */
-	    if (h && ! FRV_SYM_LOCAL (info, h))
+	    if (h && ! FRVFDPIC_SYM_LOCAL (info, h))
 	      {
 		if (addend && r_type == R_FRV_FUNCDESC_VALUE)
 		  {
@@ -2240,17 +2300,18 @@
 	       is defined in the current link unit (which is implied
 	       by its output section not being NULL).  */
 	    if (info->executable && !info->pie
-		&& (!h || FRV_SYM_LOCAL (info, h)))
+		&& (!h || FRVFDPIC_SYM_LOCAL (info, h)))
 	      {
 		if (osec)
 		  addend += osec->output_section->vma;
-		if ((elf_elfheader (input_bfd)->e_flags & EF_FRV_FDPIC)
+		if (IS_FDPIC (input_bfd)
 		    && (bfd_get_section_flags (output_bfd,
 					       input_section->output_section)
 			& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
 		  {
-		    if (_frv_osec_readonly_p (output_bfd,
-					      input_section->output_section))
+		    if (_frvfdpic_osec_readonly_p (output_bfd,
+						   input_section
+						   ->output_section))
 		      {
 			info->callbacks->warning
 			  (info,
@@ -2260,18 +2321,20 @@
 		      }
 		    if (!h || h->root.type != bfd_link_hash_undefweak)
 		      {
-			_frv_add_rofixup (output_bfd,
-					  frv_gotfixup_section (info),
-					  _bfd_elf_section_offset
-					  (output_bfd, info,
-					   input_section, rel->r_offset)
-					  + input_section->output_section->vma
-					  + input_section->output_offset,
-					  picrel);
+			_frvfdpic_add_rofixup (output_bfd,
+					       frvfdpic_gotfixup_section
+					       (info),
+					       _bfd_elf_section_offset
+					       (output_bfd, info,
+						input_section, rel->r_offset)
+					       + input_section
+					       ->output_section->vma
+					       + input_section->output_offset,
+					       picrel);
 			if (r_type == R_FRV_FUNCDESC_VALUE)
-			  _frv_add_rofixup
+			  _frvfdpic_add_rofixup
 			    (output_bfd,
-			     frv_gotfixup_section (info),
+			     frvfdpic_gotfixup_section (info),
 			     _bfd_elf_section_offset
 			     (output_bfd, info,
 			      input_section, rel->r_offset)
@@ -2286,8 +2349,9 @@
 					    input_section->output_section)
 		     & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
 		  {
-		    if (_frv_osec_readonly_p (output_bfd,
-					      input_section->output_section))
+		    if (_frvfdpic_osec_readonly_p (output_bfd,
+						   input_section
+						   ->output_section))
 		      {
 			info->callbacks->warning
 			  (info,
@@ -2295,14 +2359,18 @@
 			   name, input_bfd, input_section, rel->r_offset);
 			return FALSE;
 		      }
-		    _frv_add_dyn_reloc (output_bfd, frv_gotrel_section (info),
-					_bfd_elf_section_offset
-					(output_bfd, info,
-					 input_section, rel->r_offset)
-					+ input_section->output_section->vma
-					+ input_section->output_offset,
-					r_type, dynindx, addend, picrel);
+		    _frvfdpic_add_dyn_reloc (output_bfd,
+					     frvfdpic_gotrel_section (info),
+					     _bfd_elf_section_offset
+					     (output_bfd, info,
+					      input_section, rel->r_offset)
+					     + input_section
+					     ->output_section->vma
+					     + input_section->output_offset,
+					     r_type, dynindx, addend, picrel);
 		  }
+		else if (osec)
+		  addend += osec->output_section->vma;
 		/* We want the addend in-place because dynamic
 		   relocations are REL.  Setting relocation to it
 		   should arrange for it to be installed.  */
@@ -2315,11 +2383,11 @@
 		   the fixed addresses of the symbol and of the local
 		   GOT base offset.  */
 		if (info->executable && !info->pie
-		    && (!h || FRV_SYM_LOCAL (info, h)))
+		    && (!h || FRVFDPIC_SYM_LOCAL (info, h)))
 		  bfd_put_32 (output_bfd,
-			      frv_got_section (info)->output_section->vma
-			      + frv_got_section (info)->output_offset
-			      + frv_got_initial_offset (info),
+			      frvfdpic_got_section (info)->output_section->vma
+			      + frvfdpic_got_section (info)->output_offset
+			      + frvfdpic_got_initial_offset (info),
 			      contents + rel->r_offset + 4);
 		else
 		  /* A function descriptor used for lazy or local
@@ -2329,10 +2397,11 @@
 		     contains the offset of the lazy PLT entry entry
 		     point into that section.  */
 		  bfd_put_32 (output_bfd,
-			      h && ! FRV_SYM_LOCAL (info, h)
+			      h && ! FRVFDPIC_SYM_LOCAL (info, h)
 			      ? 0
-			      : _frv_osec_to_segment (output_bfd,
-						      sec->output_section),
+			      : _frvfdpic_osec_to_segment (output_bfd,
+							   sec
+							   ->output_section),
 			      contents + rel->r_offset + 4);
 	      }
 	  }
@@ -2346,22 +2415,22 @@
 	case R_FRV_GPRELLO:
 	  check_segment[0] = gprel_segment;
 	  check_segment[1] = sec
-	    ? _frv_osec_to_segment (output_bfd, sec->output_section)
+	    ? _frvfdpic_osec_to_segment (output_bfd, sec->output_section)
 	    : (unsigned)-1;
 	  break;
 
 	default:
 	  check_segment[0] = isec_segment;
 	  check_segment[1] = sec
-	    ? _frv_osec_to_segment (output_bfd, sec->output_section)
+	    ? _frvfdpic_osec_to_segment (output_bfd, sec->output_section)
 	    : (unsigned)-1;
 	  break;
 	}
 
-      if (check_segment[0] != check_segment[1]
-	  && (elf_elfheader (output_bfd)->e_flags & EF_FRV_FDPIC))
+      if (check_segment[0] != check_segment[1] && IS_FDPIC (output_bfd))
 	{
-#if 1
+#if 1 /* If you take this out, remove the #error from fdpic-static-6.d
+	 in the ld testsuite.  */
 	  /* This helps catch problems in GCC while we can't do more
 	     than static linking.  The idea is to test whether the
 	     input file basename is crt0.o only once.  */
@@ -2418,7 +2487,7 @@
       switch (r_type)
 	{
 	case R_FRV_LABEL24:
-	  if (! picrel->plt)
+	  if (! IS_FDPIC (output_bfd) || ! picrel->plt)
 	    break;
 	  /* Fall through.  */
 	  
@@ -2584,7 +2653,7 @@
 elf32_frv_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd *abfd;
      struct bfd_link_info *info;
-     const Elf_Internal_Sym *sym;
+     Elf_Internal_Sym *sym;
      const char **namep ATTRIBUTE_UNUSED;
      flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
@@ -2615,7 +2684,32 @@
 
   return TRUE;
 }
-/* Create a .got section, as well as its additional info field.  This
+
+/* We need dynamic symbols for every section, since segments can
+   relocate independently.  */
+static bfd_boolean
+_frvfdpic_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED,
+				    struct bfd_link_info *info
+				    ATTRIBUTE_UNUSED,
+				    asection *p ATTRIBUTE_UNUSED)
+{
+  switch (elf_section_data (p)->this_hdr.sh_type)
+    {
+    case SHT_PROGBITS:
+    case SHT_NOBITS:
+      /* If sh_type is yet undecided, assume it could be
+	 SHT_PROGBITS/SHT_NOBITS.  */
+    case SHT_NULL:
+      return FALSE;
+
+      /* There shouldn't be section relative relocations
+	 against any other section.  */
+    default:
+      return TRUE;
+    }
+}
+
+/* Create  a .got section, as well as its additional info field.  This
    is almost entirely copied from
    elflink.c:_bfd_elf_create_got_section().  */
 
@@ -2628,6 +2722,7 @@
   struct bfd_link_hash_entry *bh;
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
   int ptralign;
+  int offset;
 
   /* This function may be called more than once.  */
   s = bfd_get_section_by_name (abfd, ".got");
@@ -2676,47 +2771,57 @@
 
       /* Machine-specific: we want the symbol for executables as
 	 well.  */
-      if (! _bfd_elf_link_record_dynamic_symbol (info, h))
+      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
 
       elf_hash_table (info)->hgot = h;
     }
 
   /* The first bit of the global offset table is the header.  */
-  s->_raw_size += bed->got_header_size + bed->got_symbol_offset;
+  s->size += bed->got_header_size + bed->got_symbol_offset;
 
   /* This is the machine-specific part.  Create and initialize section
      data for the got.  */
-  frv_got_section (info) = s;
-  frv_relocs_info (info) = htab_try_create (1, frv_pic_relocs_info_hash,
-					    frv_pic_relocs_info_eq,
-					    (htab_del) NULL);
-  if (! frv_relocs_info (info))
-    return FALSE;
+  if (IS_FDPIC (abfd))
+    {
+      frvfdpic_got_section (info) = s;
+      frvfdpic_relocs_info (info) = htab_try_create (1, frvfdpic_relocs_info_hash,
+						     frvfdpic_relocs_info_eq,
+						     (htab_del) NULL);
+      if (! frvfdpic_relocs_info (info))
+	return FALSE;
 
-  s = bfd_make_section (abfd, ".rel.got");
-  if (s == NULL
-      || ! bfd_set_section_flags (abfd, s, (flags | SEC_READONLY))
-      || ! bfd_set_section_alignment (abfd, s, 2))
-    return FALSE;
+      s = bfd_make_section (abfd, ".rel.got");
+      if (s == NULL
+	  || ! bfd_set_section_flags (abfd, s, (flags | SEC_READONLY))
+	  || ! bfd_set_section_alignment (abfd, s, 2))
+	return FALSE;
 
-  frv_gotrel_section (info) = s;
+      frvfdpic_gotrel_section (info) = s;
 
-  /* Machine-specific.  */
-  s = bfd_make_section (abfd, ".rofixup");
-  if (s == NULL
-      || ! bfd_set_section_flags (abfd, s, (flags | SEC_READONLY))
-      || ! bfd_set_section_alignment (abfd, s, 2))
-    return FALSE;
+      /* Machine-specific.  */
+      s = bfd_make_section (abfd, ".rofixup");
+      if (s == NULL
+	  || ! bfd_set_section_flags (abfd, s, (flags | SEC_READONLY))
+	  || ! bfd_set_section_alignment (abfd, s, 2))
+	return FALSE;
 
-  frv_gotfixup_section (info) = s;
+      frvfdpic_gotfixup_section (info) = s;
+      offset = -2048;
+      flags = BSF_GLOBAL;
+    }
+  else
+    {
+      offset = 2048;
+      flags = BSF_GLOBAL | BSF_WEAK;
+    }
 
-  /* Define _gp in .rofixup, for FDPIC.  If it turns out that
-     we're linking with a different linker script, the linker script
-     will override it.  */
+  /* Define _gp in .rofixup, for FDPIC, or .got otherwise.  If it
+     turns out that we're linking with a different linker script, the
+     linker script will override it.  */
   bh = NULL;
   if (!(_bfd_generic_link_add_one_symbol
-	(info, abfd, "_gp", BSF_GLOBAL, s, -2048, (const char *) NULL, FALSE,
+	(info, abfd, "_gp", flags, s, offset, (const char *) NULL, FALSE,
 	 bed->collect, &bh)))
     return FALSE;
   h = (struct elf_link_hash_entry *) bh;
@@ -2724,9 +2829,9 @@
   h->type = STT_OBJECT;
 
   /* Machine-specific: we want the symbol for executables as well.  */
-  if (! _bfd_elf_link_record_dynamic_symbol (info, h))
+  if (IS_FDPIC (abfd) && ! bfd_elf_link_record_dynamic_symbol (info, h))
     return FALSE;
-  
+
   return TRUE;
 }
 
@@ -2734,7 +2839,7 @@
    the link hash table point to them.  */
 
 static bfd_boolean
-elf32_frv_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
+elf32_frvfdpic_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
 {
   /* This is mostly copied from
      elflink.c:_bfd_elf_create_dynamic_sections().  */
@@ -2761,7 +2866,7 @@
       || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment))
     return FALSE;
   /* FRV-specific: remember it.  */
-  frv_plt_section (info) = s;
+  frvfdpic_plt_section (info) = s;
 
   if (bed->want_plt_sym)
     {
@@ -2779,7 +2884,7 @@
       h->type = STT_OBJECT;
 
       if (! info->executable
-	  && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+	  && ! bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
     }
 
@@ -2790,16 +2895,17 @@
       || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align))
     return FALSE;
   /* FRV-specific: remember it.  */
-  frv_pltrel_section (info) = s;
+  frvfdpic_pltrel_section (info) = s;
 
   /* FRV-specific: we want to create the GOT in the FRV way.  */
   if (! _frv_create_got_section (abfd, info))
     return FALSE;
 
   /* FRV-specific: make sure we created everything we wanted.  */
-  BFD_ASSERT (frv_got_section (info) && frv_gotrel_section (info)
-	      && frv_gotfixup_section (info)
-	      && frv_plt_section (info) && frv_pltrel_section (info));
+  BFD_ASSERT (frvfdpic_got_section (info) && frvfdpic_gotrel_section (info)
+	      && frvfdpic_gotfixup_section (info)
+	      && frvfdpic_plt_section (info)
+	      && frvfdpic_pltrel_section (info));
 
   if (bed->want_dynbss)
     {
@@ -2849,7 +2955,7 @@
 
 /* This structure is used to collect the number of entries present in
    each addressable range of the got.  */
-struct _frv_dynamic_got_info
+struct _frvfdpic_dynamic_got_info
 {
   /* Several bits of information about the current link.  */
   struct bfd_link_info *info;
@@ -2877,10 +2983,10 @@
    private function descriptors taking two words.  */
 
 static int
-_frv_count_got_plt_entries (void **entryp, void *dinfo_)
+_frvfdpic_count_got_plt_entries (void **entryp, void *dinfo_)
 {
-  struct frv_pic_relocs_info *entry = *entryp;
-  struct _frv_dynamic_got_info *dinfo = dinfo_;
+  struct frvfdpic_relocs_info *entry = *entryp;
+  struct _frvfdpic_dynamic_got_info *dinfo = dinfo_;
   unsigned relocs = 0, fixups = 0;
 
   /* Allocate space for a GOT entry pointing to the symbol.  */
@@ -2909,15 +3015,15 @@
   /* Decide whether we need a PLT entry, a function descriptor in the
      GOT, and a lazy PLT entry for this symbol.  */
   entry->plt = entry->call
-    && entry->symndx == -1 && ! FRV_SYM_LOCAL (dinfo->info, entry->d.h)
+    && entry->symndx == -1 && ! FRVFDPIC_SYM_LOCAL (dinfo->info, entry->d.h)
     && elf_hash_table (dinfo->info)->dynamic_sections_created;
   entry->privfd = entry->plt
     || entry->fdgoff12 || entry->fdgofflos || entry->fdgoffhilo
     || ((entry->fd || entry->fdgot12 || entry->fdgotlos || entry->fdgothilo)
 	&& (entry->symndx != -1
-	    || FRV_FUNCDESC_LOCAL (dinfo->info, entry->d.h)));
+	    || FRVFDPIC_FUNCDESC_LOCAL (dinfo->info, entry->d.h)));
   entry->lazyplt = entry->privfd
-    && entry->symndx == -1 && ! FRV_SYM_LOCAL (dinfo->info, entry->d.h)
+    && entry->symndx == -1 && ! FRVFDPIC_SYM_LOCAL (dinfo->info, entry->d.h)
     && ! (dinfo->info->flags & DF_BIND_NOW)
     && elf_hash_table (dinfo->info)->dynamic_sections_created;
 
@@ -2941,7 +3047,7 @@
     relocs = entry->relocs32 + entry->relocsfd + entry->relocsfdv;
   else
     {
-      if (entry->symndx != -1 || FRV_SYM_LOCAL (dinfo->info, entry->d.h))
+      if (entry->symndx != -1 || FRVFDPIC_SYM_LOCAL (dinfo->info, entry->d.h))
 	{
 	  if (entry->symndx != -1
 	      || entry->d.h->root.type != bfd_link_hash_undefweak)
@@ -2950,7 +3056,8 @@
       else
 	relocs += entry->relocs32 + entry->relocsfdv;
 
-      if (entry->symndx != -1 || FRV_FUNCDESC_LOCAL (dinfo->info, entry->d.h))
+      if (entry->symndx != -1
+	  || FRVFDPIC_FUNCDESC_LOCAL (dinfo->info, entry->d.h))
 	{
 	  if (entry->symndx != -1
 	      || entry->d.h->root.type != bfd_link_hash_undefweak)
@@ -2971,10 +3078,10 @@
 /* This structure is used to assign offsets to got entries, function
    descriptors, plt entries and lazy plt entries.  */
 
-struct _frv_dynamic_got_plt_info
+struct _frvfdpic_dynamic_got_plt_info
 {
-  /* Summary information collected with _frv_count_got_plt_entries.  */
-  struct _frv_dynamic_got_info g;
+  /* Summary information collected with _frvfdpic_count_got_plt_entries.  */
+  struct _frvfdpic_dynamic_got_info g;
 
   /* For each addressable range, we record a MAX (positive) and MIN
      (negative) value.  CUR is used to assign got entries, and it's
@@ -2990,7 +3097,7 @@
      descriptor is chosen.  FDPLT indicates the number of remaining
      slots that can be used for function descriptors used only by PLT
      entries.  */
-  struct _frv_dynamic_got_alloc_data
+  struct _frvfdpic_dynamic_got_alloc_data
   {
     bfd_signed_vma max, cur, odd, fdcur, min;
     bfd_vma fdplt;
@@ -3008,14 +3115,14 @@
    descriptors.  */
 
 inline static bfd_signed_vma
-_frv_compute_got_alloc_data (struct _frv_dynamic_got_alloc_data *gad,
-			     bfd_signed_vma fdcur,
-			     bfd_signed_vma odd,
-			     bfd_signed_vma cur,
-			     bfd_vma got,
-			     bfd_vma fd,
-			     bfd_vma fdplt,
-			     bfd_vma wrap)
+_frvfdpic_compute_got_alloc_data (struct _frvfdpic_dynamic_got_alloc_data *gad,
+				  bfd_signed_vma fdcur,
+				  bfd_signed_vma odd,
+				  bfd_signed_vma cur,
+				  bfd_vma got,
+				  bfd_vma fd,
+				  bfd_vma fdplt,
+				  bfd_vma wrap)
 {
   bfd_signed_vma wrapmin = -wrap;
 
@@ -3109,7 +3216,7 @@
   if (odd > gad->max)
     odd = gad->min + odd - gad->max;
 
-  /* _frv_get_got_entry() below will always wrap gad->cur if needed
+  /* _frvfdpic_get_got_entry() below will always wrap gad->cur if needed
      before returning, so do it here too.  This guarantees that,
      should cur and fdcur meet at the wrap point, they'll both be
      equal to min.  */
@@ -3123,7 +3230,7 @@
    data for a range.  */
 
 inline static bfd_signed_vma
-_frv_get_got_entry (struct _frv_dynamic_got_alloc_data *gad)
+_frvfdpic_get_got_entry (struct _frvfdpic_dynamic_got_alloc_data *gad)
 {
   bfd_signed_vma ret;
   
@@ -3152,7 +3259,7 @@
    GOT, given the allocation data for a range.  */
 
 inline static bfd_signed_vma
-_frv_get_fd_entry (struct _frv_dynamic_got_alloc_data *gad)
+_frvfdpic_get_fd_entry (struct _frvfdpic_dynamic_got_alloc_data *gad)
 {
   /* If we're at the bottom, wrap around, and only then allocate the
      next pair of words.  */
@@ -3165,46 +3272,46 @@
    Doing everything in a single pass is tricky.  */
 
 static int
-_frv_assign_got_entries (void **entryp, void *info_)
+_frvfdpic_assign_got_entries (void **entryp, void *info_)
 {
-  struct frv_pic_relocs_info *entry = *entryp;
-  struct _frv_dynamic_got_plt_info *dinfo = info_;
+  struct frvfdpic_relocs_info *entry = *entryp;
+  struct _frvfdpic_dynamic_got_plt_info *dinfo = info_;
 
   if (entry->got12)
-    entry->got_entry = _frv_get_got_entry (&dinfo->got12);
+    entry->got_entry = _frvfdpic_get_got_entry (&dinfo->got12);
   else if (entry->gotlos)
-    entry->got_entry = _frv_get_got_entry (&dinfo->gotlos);
+    entry->got_entry = _frvfdpic_get_got_entry (&dinfo->gotlos);
   else if (entry->gothilo)
-    entry->got_entry = _frv_get_got_entry (&dinfo->gothilo);
+    entry->got_entry = _frvfdpic_get_got_entry (&dinfo->gothilo);
 
   if (entry->fdgot12)
-    entry->fdgot_entry = _frv_get_got_entry (&dinfo->got12);
+    entry->fdgot_entry = _frvfdpic_get_got_entry (&dinfo->got12);
   else if (entry->fdgotlos)
-    entry->fdgot_entry = _frv_get_got_entry (&dinfo->gotlos);
+    entry->fdgot_entry = _frvfdpic_get_got_entry (&dinfo->gotlos);
   else if (entry->fdgothilo)
-    entry->fdgot_entry = _frv_get_got_entry (&dinfo->gothilo);
+    entry->fdgot_entry = _frvfdpic_get_got_entry (&dinfo->gothilo);
 
   if (entry->fdgoff12)
-    entry->fd_entry = _frv_get_fd_entry (&dinfo->got12);
+    entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->got12);
   else if (entry->plt && dinfo->got12.fdplt)
     {
       dinfo->got12.fdplt -= 8;
-      entry->fd_entry = _frv_get_fd_entry (&dinfo->got12);
+      entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->got12);
     }
   else if (entry->fdgofflos)
-    entry->fd_entry = _frv_get_fd_entry (&dinfo->gotlos);
+    entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->gotlos);
   else if (entry->plt && dinfo->gotlos.fdplt)
     {
       dinfo->gotlos.fdplt -= 8;
-      entry->fd_entry = _frv_get_fd_entry (&dinfo->gotlos);
+      entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->gotlos);
     }
   else if (entry->plt)
     {
       dinfo->gothilo.fdplt -= 8;
-      entry->fd_entry = _frv_get_fd_entry (&dinfo->gothilo);
+      entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->gothilo);
     }
   else if (entry->privfd)
-    entry->fd_entry = _frv_get_fd_entry (&dinfo->gothilo);
+    entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->gothilo);
   
   return 1;
 }
@@ -3214,10 +3321,10 @@
    and lazy PLT entries.  */
 
 static int
-_frv_assign_plt_entries (void **entryp, void *info_)
+_frvfdpic_assign_plt_entries (void **entryp, void *info_)
 {
-  struct frv_pic_relocs_info *entry = *entryp;
-  struct _frv_dynamic_got_plt_info *dinfo = info_;
+  struct frvfdpic_relocs_info *entry = *entryp;
+  struct _frvfdpic_dynamic_got_plt_info *dinfo = info_;
 
   /* If this symbol requires a local function descriptor, allocate
      one.  */
@@ -3225,18 +3332,18 @@
     {
       if (dinfo->got12.fdplt)
 	{
-	  entry->fd_entry = _frv_get_fd_entry (&dinfo->got12);
+	  entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->got12);
 	  dinfo->got12.fdplt -= 8;
 	}
       else if (dinfo->gotlos.fdplt)
 	{
-	  entry->fd_entry = _frv_get_fd_entry (&dinfo->gotlos);
+	  entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->gotlos);
 	  dinfo->gotlos.fdplt -= 8;
 	}
       else
 	{
 	  BFD_ASSERT (dinfo->gothilo.fdplt)
-	  entry->fd_entry = _frv_get_fd_entry (&dinfo->gothilo);
+	  entry->fd_entry = _frvfdpic_get_fd_entry (&dinfo->gothilo);
 	  dinfo->gothilo.fdplt -= 8;
 	}
     }
@@ -3247,7 +3354,7 @@
 
       /* We use the section's raw size to mark the location of the
 	 next PLT entry.  */
-      entry->plt_entry = frv_plt_section (dinfo->g.info)->_raw_size;
+      entry->plt_entry = frvfdpic_plt_section (dinfo->g.info)->size;
 
       /* Figure out the length of this PLT entry based on the
 	 addressing mode we need to reach the function descriptor.  */
@@ -3261,7 +3368,7 @@
       else
 	size = 16;
 
-      frv_plt_section (dinfo->g.info)->_raw_size += size;
+      frvfdpic_plt_section (dinfo->g.info)->size += size;
     }
 
   if (entry->lazyplt)
@@ -3270,7 +3377,8 @@
       dinfo->g.lzplt += 8;
       /* If this entry is the one that gets the resolver stub, account
 	 for the additional instruction.  */
-      if (entry->lzplt_entry % FRV_LZPLT_BLOCK_SIZE == FRV_LZPLT_RESOLV_LOC)
+      if (entry->lzplt_entry % FRVFDPIC_LZPLT_BLOCK_SIZE
+	  == FRVFDPIC_LZPLT_RESOLV_LOC)
 	dinfo->g.lzplt += 4;
     }
       
@@ -3284,15 +3392,15 @@
    we've made a potentially-destructive change to the hash table, so
    the traversal must be restarted.  */
 static int
-_frv_resolve_final_relocs_info (void **entryp, void *p)
+_frvfdpic_resolve_final_relocs_info (void **entryp, void *p)
 {
-  struct frv_pic_relocs_info *entry = *entryp;
+  struct frvfdpic_relocs_info *entry = *entryp;
   htab_t *htab = p;
 
   if (entry->symndx == -1)
     {
       struct elf_link_hash_entry *h = entry->d.h;
-      struct frv_pic_relocs_info *oentry;
+      struct frvfdpic_relocs_info *oentry;
 
       while (h->root.type == bfd_link_hash_indirect
 	     || h->root.type == bfd_link_hash_warning)
@@ -3301,13 +3409,13 @@
       if (entry->d.h == h)
 	return 1;
 
-      oentry = frv_pic_relocs_info_for_global (*htab, 0, h, entry->addend,
-					       NO_INSERT);
+      oentry = frvfdpic_relocs_info_for_global (*htab, 0, h, entry->addend,
+						NO_INSERT);
 
       if (oentry)
 	{
 	  /* Merge the two entries.  */
-	  frv_pic_merge_early_relocs_info (oentry, entry);
+	  frvfdpic_pic_merge_early_relocs_info (oentry, entry);
 	  htab_clear_slot (*htab, entryp);
 	  return 1;
 	}
@@ -3336,12 +3444,12 @@
 /* Set the sizes of the dynamic sections.  */
 
 static bfd_boolean
-elf32_frv_size_dynamic_sections (bfd *output_bfd,
-				 struct bfd_link_info *info)
+elf32_frvfdpic_size_dynamic_sections (bfd *output_bfd,
+				      struct bfd_link_info *info)
 {
   bfd *dynobj;
   asection *s;
-  struct _frv_dynamic_got_plt_info gpinfo;
+  struct _frvfdpic_dynamic_got_plt_info gpinfo;
   bfd_signed_vma odd;
   bfd_vma limit;
 
@@ -3355,7 +3463,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -3365,15 +3473,15 @@
 
   for (;;)
     {
-      htab_t relocs = frv_relocs_info (info);
+      htab_t relocs = frvfdpic_relocs_info (info);
 
-      htab_traverse (relocs, _frv_resolve_final_relocs_info, &relocs);
+      htab_traverse (relocs, _frvfdpic_resolve_final_relocs_info, &relocs);
 
-      if (relocs == frv_relocs_info (info))
+      if (relocs == frvfdpic_relocs_info (info))
 	break;
     }
 
-  htab_traverse (frv_relocs_info (info), _frv_count_got_plt_entries,
+  htab_traverse (frvfdpic_relocs_info (info), _frvfdpic_count_got_plt_entries,
 		 &gpinfo.g);
 
   odd = 12;
@@ -3392,164 +3500,170 @@
 
   /* Determine the ranges of GOT offsets that we can use for each
      range of addressing modes.  */
-  odd = _frv_compute_got_alloc_data (&gpinfo.got12,
-				     0,
-				     odd,
-				     16,
-				     gpinfo.g.got12,
-				     gpinfo.g.fd12,
-				     limit,
-				     (bfd_vma)1 << (12-1));
-  odd = _frv_compute_got_alloc_data (&gpinfo.gotlos,
-				     gpinfo.got12.min,
-				     odd,
-				     gpinfo.got12.max,
-				     gpinfo.g.gotlos,
-				     gpinfo.g.fdlos,
-				     gpinfo.g.fdplt - gpinfo.got12.fdplt,
-				     (bfd_vma)1 << (16-1));
-  odd = _frv_compute_got_alloc_data (&gpinfo.gothilo,
-				     gpinfo.gotlos.min,
-				     odd,
-				     gpinfo.gotlos.max,
-				     gpinfo.g.gothilo,
-				     gpinfo.g.fdhilo,
-				     gpinfo.g.fdplt - gpinfo.got12.fdplt
-				     - gpinfo.gotlos.fdplt,
-				     (bfd_vma)1 << (32-1));
+  odd = _frvfdpic_compute_got_alloc_data (&gpinfo.got12,
+					  0,
+					  odd,
+					  16,
+					  gpinfo.g.got12,
+					  gpinfo.g.fd12,
+					  limit,
+					  (bfd_vma)1 << (12-1));
+  odd = _frvfdpic_compute_got_alloc_data (&gpinfo.gotlos,
+					  gpinfo.got12.min,
+					  odd,
+					  gpinfo.got12.max,
+					  gpinfo.g.gotlos,
+					  gpinfo.g.fdlos,
+					  gpinfo.g.fdplt - gpinfo.got12.fdplt,
+					  (bfd_vma)1 << (16-1));
+  odd = _frvfdpic_compute_got_alloc_data (&gpinfo.gothilo,
+					  gpinfo.gotlos.min,
+					  odd,
+					  gpinfo.gotlos.max,
+					  gpinfo.g.gothilo,
+					  gpinfo.g.fdhilo,
+					  gpinfo.g.fdplt - gpinfo.got12.fdplt
+					  - gpinfo.gotlos.fdplt,
+					  (bfd_vma)1 << (32-1));
 
   /* Now assign (most) GOT offsets.  */
-  htab_traverse (frv_relocs_info (info), _frv_assign_got_entries, &gpinfo);
+  htab_traverse (frvfdpic_relocs_info (info), _frvfdpic_assign_got_entries,
+		 &gpinfo);
 
-  frv_got_section (info)->_raw_size = gpinfo.gothilo.max - gpinfo.gothilo.min
+  frvfdpic_got_section (info)->size = gpinfo.gothilo.max
+    - gpinfo.gothilo.min
     /* If an odd word is the last word of the GOT, we don't need this
        word to be part of the GOT.  */
     - (odd + 4 == gpinfo.gothilo.max ? 4 : 0);
-  if (frv_got_section (info)->_raw_size == 0)
-    frv_got_section (info)->flags |= SEC_EXCLUDE;
-  else if (frv_got_section (info)->_raw_size == 12
+  if (frvfdpic_got_section (info)->size == 0)
+    frvfdpic_got_section (info)->flags |= SEC_EXCLUDE;
+  else if (frvfdpic_got_section (info)->size == 12
 	   && ! elf_hash_table (info)->dynamic_sections_created)
     {
-      frv_got_section (info)->flags |= SEC_EXCLUDE;
-      frv_got_section (info)->_raw_size = 0;
+      frvfdpic_got_section (info)->flags |= SEC_EXCLUDE;
+      frvfdpic_got_section (info)->size = 0;
     }
   else
     {
-      frv_got_section (info)->contents =
-	(bfd_byte *) bfd_zalloc (dynobj, frv_got_section (info)->_raw_size);
-      if (frv_got_section (info)->contents == NULL)
+      frvfdpic_got_section (info)->contents =
+	(bfd_byte *) bfd_zalloc (dynobj,
+				 frvfdpic_got_section (info)->size);
+      if (frvfdpic_got_section (info)->contents == NULL)
 	return FALSE;
     }
   
   if (elf_hash_table (info)->dynamic_sections_created)
     /* Subtract the number of lzplt entries, since those will generate
        relocations in the pltrel section.  */
-    frv_gotrel_section (info)->_raw_size =
+    frvfdpic_gotrel_section (info)->size =
       (gpinfo.g.relocs - gpinfo.g.lzplt / 8)
       * get_elf_backend_data (output_bfd)->s->sizeof_rel;
   else
     BFD_ASSERT (gpinfo.g.relocs == 0);
-  if (frv_gotrel_section (info)->_raw_size == 0)
-    frv_gotrel_section (info)->flags |= SEC_EXCLUDE;
+  if (frvfdpic_gotrel_section (info)->size == 0)
+    frvfdpic_gotrel_section (info)->flags |= SEC_EXCLUDE;
   else
     {
-      frv_gotrel_section (info)->contents =
-	(bfd_byte *) bfd_zalloc (dynobj, frv_gotrel_section (info)->_raw_size);
-      if (frv_gotrel_section (info)->contents == NULL)
+      frvfdpic_gotrel_section (info)->contents =
+	(bfd_byte *) bfd_zalloc (dynobj,
+				 frvfdpic_gotrel_section (info)->size);
+      if (frvfdpic_gotrel_section (info)->contents == NULL)
 	return FALSE;
     }
 
-  if (elf_elfheader (output_bfd)->e_flags & EF_FRV_FDPIC)
-    frv_gotfixup_section (info)->_raw_size = (gpinfo.g.fixups + 1) * 4;
-  if (frv_gotfixup_section (info)->_raw_size == 0)
-    frv_gotfixup_section (info)->flags |= SEC_EXCLUDE;
+  frvfdpic_gotfixup_section (info)->size = (gpinfo.g.fixups + 1) * 4;
+  if (frvfdpic_gotfixup_section (info)->size == 0)
+    frvfdpic_gotfixup_section (info)->flags |= SEC_EXCLUDE;
   else
     {
-      frv_gotfixup_section (info)->contents =
+      frvfdpic_gotfixup_section (info)->contents =
 	(bfd_byte *) bfd_zalloc (dynobj,
-				 frv_gotfixup_section (info)->_raw_size);
-      if (frv_gotfixup_section (info)->contents == NULL)
+				 frvfdpic_gotfixup_section (info)->size);
+      if (frvfdpic_gotfixup_section (info)->contents == NULL)
 	return FALSE;
     }
   
   if (elf_hash_table (info)->dynamic_sections_created)
     {
-      frv_pltrel_section (info)->_raw_size =
+      frvfdpic_pltrel_section (info)->size =
 	gpinfo.g.lzplt / 8 * get_elf_backend_data (output_bfd)->s->sizeof_rel;
-      if (frv_pltrel_section (info)->_raw_size == 0)
-	frv_pltrel_section (info)->flags |= SEC_EXCLUDE;
+      if (frvfdpic_pltrel_section (info)->size == 0)
+	frvfdpic_pltrel_section (info)->flags |= SEC_EXCLUDE;
       else
 	{
-	  frv_pltrel_section (info)->contents =
+	  frvfdpic_pltrel_section (info)->contents =
 	    (bfd_byte *) bfd_zalloc (dynobj,
-				     frv_pltrel_section (info)->_raw_size);
-	  if (frv_pltrel_section (info)->contents == NULL)
+				     frvfdpic_pltrel_section (info)->size);
+	  if (frvfdpic_pltrel_section (info)->contents == NULL)
 	    return FALSE;
 	}
     }
   
   /* Add 4 bytes for every block of at most 65535 lazy PLT entries,
      such that there's room for the additional instruction needed to
-     call the resolver.  Since _frv_assign_got_entries didn't account
-     for them, our block size is 4 bytes smaller than the real block
-     size.  */
+     call the resolver.  Since _frvfdpic_assign_got_entries didn't
+     account for them, our block size is 4 bytes smaller than the real
+     block size.  */
   if (elf_hash_table (info)->dynamic_sections_created)
     {
-      frv_plt_section (info)->_raw_size = gpinfo.g.lzplt
-	+ ((gpinfo.g.lzplt + (FRV_LZPLT_BLOCK_SIZE - 4) - 8)
-	   / (FRV_LZPLT_BLOCK_SIZE - 4) * 4);
+      frvfdpic_plt_section (info)->size = gpinfo.g.lzplt
+	+ ((gpinfo.g.lzplt + (FRVFDPIC_LZPLT_BLOCK_SIZE - 4) - 8)
+	   / (FRVFDPIC_LZPLT_BLOCK_SIZE - 4) * 4);
     }
 
-  /* Reset it, such that _frv_assign_plt_entries() can use it to
+  /* Reset it, such that _frvfdpic_assign_plt_entries() can use it to
      actually assign lazy PLT entries addresses.  */
   gpinfo.g.lzplt = 0;
 
   /* Save information that we're going to need to generate GOT and PLT
      entries.  */
-  frv_got_initial_offset (info) = -gpinfo.gothilo.min;
+  frvfdpic_got_initial_offset (info) = -gpinfo.gothilo.min;
 
   if (get_elf_backend_data (output_bfd)->want_got_sym)
     elf_hash_table (info)->hgot->root.u.def.value
-      += frv_got_initial_offset (info);
+      += frvfdpic_got_initial_offset (info);
 
   if (elf_hash_table (info)->dynamic_sections_created)
-    frv_plt_initial_offset (info) = frv_plt_section (info)->_raw_size;
+    frvfdpic_plt_initial_offset (info) =
+      frvfdpic_plt_section (info)->size;
 
-  htab_traverse (frv_relocs_info (info), _frv_assign_plt_entries, &gpinfo);
+  htab_traverse (frvfdpic_relocs_info (info), _frvfdpic_assign_plt_entries,
+		 &gpinfo);
 
   /* Allocate the PLT section contents only after
-     _frv_assign_plt_entries has a chance to add the size of the
+     _frvfdpic_assign_plt_entries has a chance to add the size of the
      non-lazy PLT entries.  */
   if (elf_hash_table (info)->dynamic_sections_created)
     {
-      if (frv_plt_section (info)->_raw_size == 0)
-	frv_plt_section (info)->flags |= SEC_EXCLUDE;
+      if (frvfdpic_plt_section (info)->size == 0)
+	frvfdpic_plt_section (info)->flags |= SEC_EXCLUDE;
       else
 	{
-	  frv_plt_section (info)->contents =
-	    (bfd_byte *) bfd_zalloc (dynobj, frv_plt_section (info)->_raw_size);
-	  if (frv_plt_section (info)->contents == NULL)
+	  frvfdpic_plt_section (info)->contents =
+	    (bfd_byte *) bfd_zalloc (dynobj,
+				     frvfdpic_plt_section (info)->size);
+	  if (frvfdpic_plt_section (info)->contents == NULL)
 	    return FALSE;
 	}
     }
 
   if (elf_hash_table (info)->dynamic_sections_created)
     {
-      if (frv_got_section (info)->_raw_size)
-	if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0))
+      if (frvfdpic_got_section (info)->size)
+	if (!_bfd_elf_add_dynamic_entry (info, DT_PLTGOT, 0))
 	  return FALSE;
 
-      if (frv_pltrel_section (info)->_raw_size)
-	if (! bfd_elf32_add_dynamic_entry (info, DT_PLTRELSZ, 0)
-	    || ! bfd_elf32_add_dynamic_entry (info, DT_PLTREL, DT_REL)
-	    || ! bfd_elf32_add_dynamic_entry (info, DT_JMPREL, 0))
+      if (frvfdpic_pltrel_section (info)->size)
+	if (!_bfd_elf_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+	    || !_bfd_elf_add_dynamic_entry (info, DT_PLTREL, DT_REL)
+	    || !_bfd_elf_add_dynamic_entry (info, DT_JMPREL, 0))
 	  return FALSE;
 
-      if (frv_gotrel_section (info)->_raw_size)
-	if (! bfd_elf32_add_dynamic_entry (info, DT_REL, 0)
-	    || ! bfd_elf32_add_dynamic_entry (info, DT_RELSZ, 0)
-	    || ! bfd_elf32_add_dynamic_entry (info, DT_RELENT,
-					      sizeof (Elf32_External_Rel)))
+      if (frvfdpic_gotrel_section (info)->size)
+	if (!_bfd_elf_add_dynamic_entry (info, DT_REL, 0)
+	    || !_bfd_elf_add_dynamic_entry (info, DT_RELSZ, 0)
+	    || !_bfd_elf_add_dynamic_entry (info, DT_RELENT,
+					    sizeof (Elf32_External_Rel)))
 	  return FALSE;
     }
 
@@ -3557,11 +3671,10 @@
 }
 
 static bfd_boolean
-elf32_frv_always_size_sections (bfd *output_bfd,
-				struct bfd_link_info *info)
+elf32_frvfdpic_always_size_sections (bfd *output_bfd,
+				     struct bfd_link_info *info)
 {
-  if (!info->relocatable
-      && elf_elfheader (output_bfd)->e_flags & EF_FRV_FDPIC)
+  if (!info->relocatable)
     {
       struct elf_link_hash_entry *h;
       asection *sec;
@@ -3603,45 +3716,47 @@
 }
 
 static bfd_boolean
-elf32_frv_modify_segment_map (bfd *output_bfd,
-			      struct bfd_link_info *info)
+elf32_frvfdpic_modify_segment_map (bfd *output_bfd,
+				   struct bfd_link_info *info)
 {
-  if (elf_elfheader (output_bfd)->e_flags & EF_FRV_FDPIC)
+  struct elf_segment_map *m;
+
+  /* objcopy and strip preserve what's already there using
+     elf32_frvfdpic_copy_private_bfd_data ().  */
+  if (! info)
+    return TRUE;
+
+  for (m = elf_tdata (output_bfd)->segment_map; m != NULL; m = m->next)
+    if (m->p_type == PT_GNU_STACK)
+      break;
+
+  if (m)
     {
-      struct elf_segment_map *m;
+      asection *sec = bfd_get_section_by_name (output_bfd, ".stack");
+      struct elf_link_hash_entry *h;
 
-      for (m = elf_tdata (output_bfd)->segment_map; m != NULL; m = m->next)
-	if (m->p_type == PT_GNU_STACK)
-	  break;
-
-      if (m)
+      if (sec)
 	{
-	  asection *sec = bfd_get_section_by_name (output_bfd, ".stack");
-	  struct elf_link_hash_entry *h;
+	  /* Obtain the pointer to the __stacksize symbol.  */
+	  h = elf_link_hash_lookup (elf_hash_table (info), "__stacksize",
+				    FALSE, FALSE, FALSE);
+	  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;
+	  BFD_ASSERT (h->root.type == bfd_link_hash_defined);
 
-	  if (sec)
-	    {
-	      /* Obtain the pointer to the __stacksize symbol.  */
-	      h = elf_link_hash_lookup (elf_hash_table (info), "__stacksize",
-					FALSE, FALSE, FALSE);
-	      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;
-	      BFD_ASSERT (h->root.type == bfd_link_hash_defined);
+	  /* Set the section size from the symbol value.  We
+	     intentionally ignore the symbol section.  */
+	  if (h->root.type == bfd_link_hash_defined)
+	    sec->size = h->root.u.def.value;
+	  else
+	    sec->size = DEFAULT_STACK_SIZE;
 
-	      /* Set the section size from the symbol value.  We
-		 intentionally ignore the symbol section.  */
-	      if (h->root.type == bfd_link_hash_defined)
-		sec->_raw_size = h->root.u.def.value;
-	      else
-		sec->_raw_size = DEFAULT_STACK_SIZE;
-
-	      /* Add the stack section to the PT_GNU_STACK segment,
-		 such that its size and alignment requirements make it
-		 to the segment.  */
-	      m->sections[m->count] = sec;
-	      m->count++;
-	    }
+	  /* Add the stack section to the PT_GNU_STACK segment,
+	     such that its size and alignment requirements make it
+	     to the segment.  */
+	  m->sections[m->count] = sec;
+	  m->count++;
 	}
     }
 
@@ -3651,60 +3766,51 @@
 /* Fill in code and data in dynamic sections.  */
 
 static bfd_boolean
-elf32_frv_finish_dynamic_sections (bfd *output_bfd,
-				   struct bfd_link_info *info)
+elf32_frv_finish_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+				   struct bfd_link_info *info ATTRIBUTE_UNUSED)
+{
+  /* Nothing to be done for non-FDPIC.  */
+  return TRUE;
+}
+
+static bfd_boolean
+elf32_frvfdpic_finish_dynamic_sections (bfd *output_bfd,
+					struct bfd_link_info *info)
 {
   bfd *dynobj;
   asection *sdyn;
 
   dynobj = elf_hash_table (info)->dynobj;
 
-  if (frv_got_section (info))
+  if (frvfdpic_got_section (info))
     {
-      BFD_ASSERT (frv_gotrel_section (info)->_raw_size
-		  == (frv_gotrel_section (info)->reloc_count
+      BFD_ASSERT (frvfdpic_gotrel_section (info)->size
+		  == (frvfdpic_gotrel_section (info)->reloc_count
 		      * sizeof (Elf32_External_Rel)));
 
-      if (frv_gotfixup_section (info))
+      if (frvfdpic_gotfixup_section (info))
 	{
-	  if (elf_elfheader (output_bfd)->e_flags & EF_FRV_FDPIC)
-	    {
-	      struct elf_link_hash_entry *hgot = elf_hash_table (info)->hgot;
-	      bfd_vma got_value = hgot->root.u.def.value
-		+ hgot->root.u.def.section->output_section->vma
-		+ hgot->root.u.def.section->output_offset;
+	  struct elf_link_hash_entry *hgot = elf_hash_table (info)->hgot;
+	  bfd_vma got_value = hgot->root.u.def.value
+	    + hgot->root.u.def.section->output_section->vma
+	    + hgot->root.u.def.section->output_offset;
 
-	      _frv_add_rofixup (output_bfd, frv_gotfixup_section (info),
-				got_value, 0);
-	    }
+	  _frvfdpic_add_rofixup (output_bfd, frvfdpic_gotfixup_section (info),
+				 got_value, 0);
 
-	  if (frv_gotfixup_section (info)->_raw_size
-	      != (frv_gotfixup_section (info)->reloc_count * 4))
+	  if (frvfdpic_gotfixup_section (info)->size
+	      != (frvfdpic_gotfixup_section (info)->reloc_count * 4))
 	    {
-	      if (frv_gotfixup_section (info)->_raw_size
-		  < frv_gotfixup_section (info)->reloc_count * 4)
-		{
-		  info->callbacks->warning
-		    (info, "LINKER BUG: .rofixup section size mismatch",
-		     ".rofixup", NULL, NULL, 0);
-		  abort ();
-		  return FALSE;
-		}
-	      else if (!elf_hash_table (info)->dynamic_sections_created)
-		{
-		  info->callbacks->warning
-		    (info, "no dynamic sections, missing -melf32frvfd?",
-		     ".rofixup", NULL, NULL, 0);
-		  return FALSE;
-		}
-	      BFD_ASSERT (0);
+	      (*_bfd_error_handler)
+		("LINKER BUG: .rofixup section size mismatch");
+	      return FALSE;
 	    }
 	}
     }
   if (elf_hash_table (info)->dynamic_sections_created)
     {
-      BFD_ASSERT (frv_pltrel_section (info)->_raw_size
-		  == (frv_pltrel_section (info)->reloc_count
+      BFD_ASSERT (frvfdpic_pltrel_section (info)->size
+		  == (frvfdpic_pltrel_section (info)->reloc_count
 		      * sizeof (Elf32_External_Rel)));
     }
 
@@ -3718,7 +3824,7 @@
       BFD_ASSERT (sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
 
       for (; dyncon < dynconend; dyncon++)
 	{
@@ -3732,23 +3838,21 @@
 	      break;
 
 	    case DT_PLTGOT:
-	      dyn.d_un.d_ptr = frv_got_section (info)->output_section->vma
-		+ frv_got_section (info)->output_offset
-		+ frv_got_initial_offset (info);
+	      dyn.d_un.d_ptr = frvfdpic_got_section (info)->output_section->vma
+		+ frvfdpic_got_section (info)->output_offset
+		+ frvfdpic_got_initial_offset (info);
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_JMPREL:
-	      dyn.d_un.d_ptr = frv_pltrel_section (info)->output_section->vma
-		+ frv_pltrel_section (info)->output_offset;
+	      dyn.d_un.d_ptr = frvfdpic_pltrel_section (info)
+		->output_section->vma
+		+ frvfdpic_pltrel_section (info)->output_offset;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_PLTRELSZ:
-	      if (frv_pltrel_section (info)->_cooked_size != 0)
-		dyn.d_un.d_val = frv_pltrel_section (info)->_cooked_size;
-	      else
-		dyn.d_un.d_val = frv_pltrel_section (info)->_raw_size;
+	      dyn.d_un.d_val = frvfdpic_pltrel_section (info)->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 	    }
@@ -3762,8 +3866,9 @@
    regular object.  */
 
 static bfd_boolean
-elf32_frv_adjust_dynamic_symbol (struct bfd_link_info *info ATTRIBUTE_UNUSED,
-				 struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
+elf32_frvfdpic_adjust_dynamic_symbol
+(struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED)
 {
   bfd * dynobj;
 
@@ -3796,10 +3901,11 @@
 /* Perform any actions needed for dynamic symbols.  */
 
 static bfd_boolean
-elf32_frv_finish_dynamic_symbol (bfd *output_bfd ATTRIBUTE_UNUSED,
-				 struct bfd_link_info *info ATTRIBUTE_UNUSED,
-				 struct elf_link_hash_entry *h ATTRIBUTE_UNUSED,
-				 Elf_Internal_Sym *sym ATTRIBUTE_UNUSED)
+elf32_frvfdpic_finish_dynamic_symbol
+(bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ struct elf_link_hash_entry *h ATTRIBUTE_UNUSED,
+ Elf_Internal_Sym *sym ATTRIBUTE_UNUSED)
 {
   return TRUE;
 }
@@ -3808,44 +3914,37 @@
    shared libraries into pcrel within the given input section.  */
 
 static bfd_boolean
-frv_elf_use_relative_eh_frame (bfd *input_bfd,
-			       struct bfd_link_info *info ATTRIBUTE_UNUSED,
-			       asection *eh_frame_section ATTRIBUTE_UNUSED)
+frvfdpic_elf_use_relative_eh_frame
+(bfd *input_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ asection *eh_frame_section ATTRIBUTE_UNUSED)
 {
   /* We can't use PC-relative encodings in FDPIC binaries, in general.  */
-  if (elf_elfheader (input_bfd)->e_flags & EF_FRV_FDPIC)
-    return FALSE;
-
-  return TRUE;
+  return FALSE;
 }
 
 /* Adjust the contents of an eh_frame_hdr section before they're output.  */
 
 static bfd_byte
-frv_elf_encode_eh_address (bfd *abfd,
-			   struct bfd_link_info *info,
-			   asection *osec, bfd_vma offset,
-			   asection *loc_sec, bfd_vma loc_offset,
-			   bfd_vma *encoded)
+frvfdpic_elf_encode_eh_address (bfd *abfd,
+				struct bfd_link_info *info,
+				asection *osec, bfd_vma offset,
+				asection *loc_sec, bfd_vma loc_offset,
+				bfd_vma *encoded)
 {
   struct elf_link_hash_entry *h;
 
-  /* Non-FDPIC binaries can use PC-relative encodings.  */
-  if (! (elf_elfheader (abfd)->e_flags & EF_FRV_FDPIC))
-    return _bfd_elf_encode_eh_address (abfd, info, osec, offset,
-				       loc_sec, loc_offset, encoded);
-
   h = elf_hash_table (info)->hgot;
   BFD_ASSERT (h && h->root.type == bfd_link_hash_defined);
 
-  if (! h || (_frv_osec_to_segment (abfd, osec)
-	      == _frv_osec_to_segment (abfd, loc_sec->output_section)))
+  if (! h || (_frvfdpic_osec_to_segment (abfd, osec)
+	      == _frvfdpic_osec_to_segment (abfd, loc_sec->output_section)))
     return _bfd_elf_encode_eh_address (abfd, info, osec, offset,
 				       loc_sec, loc_offset, encoded);
 
-  BFD_ASSERT (_frv_osec_to_segment (abfd, osec)
-	      == _frv_osec_to_segment (abfd,
-				       h->root.u.def.section->output_section));
+  BFD_ASSERT (_frvfdpic_osec_to_segment (abfd, osec)
+	      == (_frvfdpic_osec_to_segment
+		  (abfd, h->root.u.def.section->output_section)));
 
   *encoded = osec->vma + offset
     - (h->root.u.def.value
@@ -3971,7 +4070,7 @@
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
   bfd *dynobj;
-  struct frv_pic_relocs_info *picrel;
+  struct frvfdpic_relocs_info *picrel;
 
   if (info->relocatable)
     return TRUE;
@@ -3997,8 +4096,6 @@
 
       switch (ELF32_R_TYPE (rel->r_info))
 	{
-	case R_FRV_LABEL24:
-	case R_FRV_32:
 	case R_FRV_GOT12:
 	case R_FRV_GOTHI:
 	case R_FRV_GOTLO:
@@ -4013,12 +4110,26 @@
 	case R_FRV_FUNCDESC_GOTOFFLO:
 	case R_FRV_FUNCDESC:
 	case R_FRV_FUNCDESC_VALUE:
+	  if (! IS_FDPIC (abfd))
+	    goto bad_reloc;
+	  /* Fall through.  */
+	case R_FRV_GPREL12:
+	case R_FRV_GPRELU12:
+	case R_FRV_GPRELHI:
+	case R_FRV_GPRELLO:
+	case R_FRV_LABEL24:
+	case R_FRV_32:
 	  if (! dynobj)
 	    {
 	      elf_hash_table (info)->dynobj = dynobj = abfd;
 	      if (! _frv_create_got_section (abfd, info))
 		return FALSE;
 	    }
+	  if (! IS_FDPIC (abfd))
+	    {
+	      picrel = NULL;
+	      break;
+	    }
 	  if (h != NULL)
 	    {
 	      if (h->dynindx == -1)
@@ -4028,18 +4139,18 @@
 		  case STV_HIDDEN:
 		    break;
 		  default:
-		    bfd_elf32_link_record_dynamic_symbol (info, h);
+		    bfd_elf_link_record_dynamic_symbol (info, h);
 		    break;
 		  }
 	      picrel
-		= frv_pic_relocs_info_for_global (frv_relocs_info (info),
-						  abfd, h,
-						  rel->r_addend, INSERT);
+		= frvfdpic_relocs_info_for_global (frvfdpic_relocs_info (info),
+						   abfd, h,
+						   rel->r_addend, INSERT);
 	    }
 	  else
-	    picrel = frv_pic_relocs_info_for_local (frv_relocs_info (info),
-						    abfd, r_symndx,
-						    rel->r_addend, INSERT);
+	    picrel = frvfdpic_relocs_info_for_local (frvfdpic_relocs_info
+						     (info), abfd, r_symndx,
+						     rel->r_addend, INSERT);
 	  if (! picrel)
 	    return FALSE;
 	  break;
@@ -4052,7 +4163,8 @@
       switch (ELF32_R_TYPE (rel->r_info))
         {
 	case R_FRV_LABEL24:
-	  picrel->call = 1;
+	  if (IS_FDPIC (abfd))
+	    picrel->call = 1;
 	  break;
 		
 	case R_FRV_FUNCDESC_VALUE:
@@ -4060,7 +4172,11 @@
 	  if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
 	    picrel->relocs32--;
 	  /* Fall through.  */
+
 	case R_FRV_32:
+	  if (! IS_FDPIC (abfd))
+	    break;
+
 	  picrel->sym = 1;
 	  if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
 	    picrel->relocs32++;
@@ -4107,16 +4223,33 @@
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_FRV_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_FRV_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
+
+	case R_FRV_LABEL16:
+	case R_FRV_LO16:
+	case R_FRV_HI16:
+	case R_FRV_GPREL12:
+	case R_FRV_GPRELU12:
+	case R_FRV_GPREL32:
+	case R_FRV_GPRELHI:
+	case R_FRV_GPRELLO:
+	  break;
+
+	default:
+	bad_reloc:
+	  (*_bfd_error_handler)
+	    (_("%s: unsupported relocation type %i"),
+	     bfd_archive_filename (abfd), ELF32_R_TYPE (rel->r_info));
+	  return FALSE;
         }
     }
 
@@ -4153,7 +4286,8 @@
      bfd *abfd;
 {
   bfd_default_set_arch_mach (abfd, bfd_arch_frv, elf32_frv_machine (abfd));
-  return TRUE;
+  return (((elf_elfheader (abfd)->e_flags & EF_FRV_FDPIC) != 0)
+	  == (IS_FDPIC (abfd)));
 }
 
 /* Function to set the ELF flag bits.  */
@@ -4214,6 +4348,50 @@
   return FALSE;
 }
 
+static bfd_boolean
+elf32_frvfdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
+{
+  unsigned i;
+
+  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
+      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
+    return TRUE;
+
+  if (! frv_elf_copy_private_bfd_data (ibfd, obfd))
+    return FALSE;
+
+  if (! elf_tdata (ibfd) || ! elf_tdata (ibfd)->phdr
+      || ! elf_tdata (obfd) || ! elf_tdata (obfd)->phdr)
+    return TRUE;
+
+  /* Copy the stack size.  */
+  for (i = 0; i < elf_elfheader (ibfd)->e_phnum; i++)
+    if (elf_tdata (ibfd)->phdr[i].p_type == PT_GNU_STACK)
+      {
+	Elf_Internal_Phdr *iphdr = &elf_tdata (ibfd)->phdr[i];
+
+	for (i = 0; i < elf_elfheader (obfd)->e_phnum; i++)
+	  if (elf_tdata (obfd)->phdr[i].p_type == PT_GNU_STACK)
+	    {
+	      memcpy (&elf_tdata (obfd)->phdr[i], iphdr, sizeof (*iphdr));
+
+	      /* Rewrite the phdrs, since we're only called after they
+		 were first written.  */
+	      if (bfd_seek (obfd, (bfd_signed_vma) get_elf_backend_data (obfd)
+			    ->s->sizeof_ehdr, SEEK_SET) != 0
+		  || get_elf_backend_data (obfd)->s
+		  ->write_out_phdrs (obfd, elf_tdata (obfd)->phdr,
+				     elf_elfheader (obfd)->e_phnum) != 0)
+		return FALSE;
+	      break;
+	    }
+
+	break;
+      }
+
+  return TRUE;
+}
+
 /* Merge backend specific data from an object file to the output
    object file when linking.  */
 
@@ -4467,6 +4645,20 @@
   if (old_partial != (old_flags & EF_FRV_CPU_MASK))
     bfd_default_set_arch_mach (obfd, bfd_arch_frv, elf32_frv_machine (obfd));
 
+  if (((new_flags & EF_FRV_FDPIC) == 0)
+      != (! IS_FDPIC (ibfd)))
+    {
+      error = TRUE;
+      if (IS_FDPIC (obfd))
+	(*_bfd_error_handler)
+	  (_("%s: cannot link non-fdpic object file into fdpic executable"),
+	   bfd_get_filename (ibfd));
+      else
+	(*_bfd_error_handler)
+	  (_("%s: cannot link fdpic object file into non-fdpic executable"),
+	   bfd_get_filename (ibfd));
+    }
+
   if (error)
     bfd_set_error (bfd_error_bad_value);
 
@@ -4564,7 +4756,6 @@
 #define TARGET_BIG_SYM          bfd_elf32_frv_vec
 #define TARGET_BIG_NAME		"elf32-frv"
 
-#define elf_info_to_howto_rel			frv_info_to_howto_rel
 #define elf_info_to_howto			frv_info_to_howto_rela
 #define elf_backend_relocate_section		elf32_frv_relocate_section
 #define elf_backend_gc_mark_hook		elf32_frv_gc_mark_hook
@@ -4582,23 +4773,6 @@
 #define bfd_elf32_bfd_merge_private_bfd_data	frv_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_print_private_bfd_data	frv_elf_print_private_bfd_data
 
-#define bfd_elf32_bfd_link_hash_table_create  frv_elf_link_hash_table_create
-#define elf_backend_always_size_sections \
-		elf32_frv_always_size_sections
-#define elf_backend_modify_segment_map \
-		elf32_frv_modify_segment_map
-
-#define elf_backend_create_dynamic_sections \
-		elf32_frv_create_dynamic_sections
-#define elf_backend_adjust_dynamic_symbol \
-		elf32_frv_adjust_dynamic_symbol
-#define elf_backend_size_dynamic_sections \
-		elf32_frv_size_dynamic_sections
-#define elf_backend_finish_dynamic_symbol \
-		elf32_frv_finish_dynamic_symbol
-#define elf_backend_finish_dynamic_sections \
-		elf32_frv_finish_dynamic_sections
-
 #define elf_backend_want_got_sym	1
 #define elf_backend_got_header_size	0
 #define elf_backend_want_got_plt	0
@@ -4606,15 +4780,72 @@
 #define elf_backend_want_plt_sym	0
 #define elf_backend_plt_header_size	0
 
-#define elf_backend_can_make_relative_eh_frame \
-		frv_elf_use_relative_eh_frame
-#define elf_backend_can_make_lsda_relative_eh_frame \
-		frv_elf_use_relative_eh_frame
-#define elf_backend_encode_eh_address	frv_elf_encode_eh_address
+#define elf_backend_finish_dynamic_sections \
+		elf32_frv_finish_dynamic_sections
 
+#include "elf32-target.h"
+
+#undef ELF_MAXPAGESIZE
+#define ELF_MAXPAGESIZE		0x4000
+
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM          bfd_elf32_frvfdpic_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME		"elf32-frvfdpic"
+#undef	elf32_bed
+#define	elf32_bed		elf32_frvfdpic_bed
+
+#undef elf_info_to_howto_rel
+#define elf_info_to_howto_rel	frvfdpic_info_to_howto_rel
+
+#undef bfd_elf32_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create \
+		frvfdpic_elf_link_hash_table_create
+#undef elf_backend_always_size_sections
+#define elf_backend_always_size_sections \
+		elf32_frvfdpic_always_size_sections
+#undef elf_backend_modify_segment_map
+#define elf_backend_modify_segment_map \
+		elf32_frvfdpic_modify_segment_map
+#undef bfd_elf32_bfd_copy_private_bfd_data
+#define bfd_elf32_bfd_copy_private_bfd_data \
+		elf32_frvfdpic_copy_private_bfd_data
+
+#undef elf_backend_create_dynamic_sections
+#define elf_backend_create_dynamic_sections \
+		elf32_frvfdpic_create_dynamic_sections
+#undef elf_backend_adjust_dynamic_symbol
+#define elf_backend_adjust_dynamic_symbol \
+		elf32_frvfdpic_adjust_dynamic_symbol
+#undef elf_backend_size_dynamic_sections
+#define elf_backend_size_dynamic_sections \
+		elf32_frvfdpic_size_dynamic_sections
+#undef elf_backend_finish_dynamic_symbol
+#define elf_backend_finish_dynamic_symbol \
+		elf32_frvfdpic_finish_dynamic_symbol
+#undef elf_backend_finish_dynamic_sections
+#define elf_backend_finish_dynamic_sections \
+		elf32_frvfdpic_finish_dynamic_sections
+
+#undef elf_backend_can_make_relative_eh_frame
+#define elf_backend_can_make_relative_eh_frame \
+		frvfdpic_elf_use_relative_eh_frame
+#undef elf_backend_can_make_lsda_relative_eh_frame
+#define elf_backend_can_make_lsda_relative_eh_frame \
+		frvfdpic_elf_use_relative_eh_frame
+#undef elf_backend_encode_eh_address
+#define elf_backend_encode_eh_address \
+		frvfdpic_elf_encode_eh_address
+
+#undef elf_backend_may_use_rel_p
 #define elf_backend_may_use_rel_p       1
+#undef elf_backend_may_use_rela_p
 #define elf_backend_may_use_rela_p      1
 /* We use REL for dynamic relocations only.  */
+#undef elf_backend_default_use_rela_p
 #define elf_backend_default_use_rela_p  1
 
+#undef elf_backend_omit_section_dynsym
+#define elf_backend_omit_section_dynsym _frvfdpic_link_omit_section_dynsym
+
 #include "elf32-target.h"
diff --git a/bfd/elf32-gen.c b/bfd/elf32-gen.c
index b1ad744..f2edf69 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, 1999, 2001, 2002
+   Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -88,7 +88,7 @@
 	return FALSE;
       }
 
-  return bfd_elf32_bfd_link_add_symbols (abfd, info);
+  return bfd_elf_link_add_symbols (abfd, info);
 }
 
 #define TARGET_LITTLE_SYM		bfd_elf32_little_generic_vec
diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c
index 6943391..3daef62 100644
--- a/bfd/elf32-h8300.c
+++ b/bfd/elf32-h8300.c
@@ -679,11 +679,6 @@
       || (sec->flags & SEC_CODE) == 0)
     return TRUE;
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
-
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
   /* Get a copy of the native relocations.  */
@@ -725,12 +720,7 @@
 	  else
 	    {
 	      /* Go get them off disk.  */
-	      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	      if (contents == NULL)
-		goto error_return;
-
-	      if (! bfd_get_section_contents (abfd, sec, contents,
-					      (file_ptr) 0, sec->_raw_size))
+	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		goto error_return;
 	    }
 	}
@@ -1297,7 +1287,7 @@
      power larger than the number of bytes we are deleting.  */
 
   irelalign = NULL;
-  toaddr = sec->_cooked_size;
+  toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
   irelend = irel + sec->reloc_count;
@@ -1305,7 +1295,7 @@
   /* Actually delete the bytes.  */
   memmove (contents + addr, contents + addr + count,
 	   (size_t) (toaddr - addr - count));
-  sec->_cooked_size -= count;
+  sec->size -= count;
 
   /* Adjust all the relocs.  */
   for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
@@ -1422,7 +1412,7 @@
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
 
   memcpy (data, elf_section_data (input_section)->this_hdr.contents,
-	  (size_t) input_section->_raw_size);
+	  (size_t) input_section->size);
 
   if ((input_section->flags & SEC_RELOC) != 0
       && input_section->reloc_count > 0)
@@ -1558,7 +1548,7 @@
 
 /* ??? when elf_backend_relocate_section is not defined, elf32-target.h
    defaults to using _bfd_generic_link_hash_table_create, but
-   elflink.h:bfd_elf32_size_dynamic_sections uses
+   bfd_elf_size_dynamic_sections uses
    dynobj = elf_hash_table (info)->dynobj;
    and thus requires an elf hash table.  */
 #define bfd_elf32_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 63b98e5..4c35bbe 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -672,7 +672,7 @@
   stub_sec = stub_entry->stub_sec;
 
   /* Make a note of the offset within the stubs for this entry.  */
-  stub_entry->stub_offset = stub_sec->_raw_size;
+  stub_entry->stub_offset = stub_sec->size;
   loc = stub_sec->contents + stub_entry->stub_offset;
 
   stub_bfd = stub_sec->owner;
@@ -816,7 +816,7 @@
 
       /* Point the function symbol at the stub.  */
       stub_entry->h->elf.root.u.def.section = stub_sec;
-      stub_entry->h->elf.root.u.def.value = stub_sec->_raw_size;
+      stub_entry->h->elf.root.u.def.value = stub_sec->size;
 
       size = 24;
       break;
@@ -826,7 +826,7 @@
       return FALSE;
     }
 
-  stub_sec->_raw_size += size;
+  stub_sec->size += size;
   return TRUE;
 }
 
@@ -879,7 +879,7 @@
 	size = 16;
     }
 
-  stub_entry->stub_sec->_raw_size += size;
+  stub_entry->stub_sec->size += size;
   return TRUE;
 }
 
@@ -1199,16 +1199,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_PARISC_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec,
-					       &h->elf, rel->r_offset))
+	  if (!bfd_elf_gc_record_vtinherit (abfd, sec, &h->elf, rel->r_offset))
 	    return FALSE;
 	  continue;
 
 	  /* This relocation describes which C++ vtable entries are actually
 	     used.  Record for later use during GC.  */
 	case R_PARISC_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec,
-					     &h->elf, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, &h->elf, rel->r_addend))
 	    return FALSE;
 	  continue;
 
@@ -1621,17 +1619,6 @@
     }
 }
 
-/* This is the condition under which elf32_hppa_finish_dynamic_symbol
-   will be called from elflink.h.  If elflink.h doesn't call our
-   finish_dynamic_symbol routine, we'll need to do something about
-   initializing any .plt and .got entries in elf32_hppa_relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \
-  ((DYN)								\
-   && ((INFO)->shared							\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Adjust a symbol defined by a dynamic object and referenced by a
    regular object.  The current definition is in some section of the
    dynamic object, but we're not including those sections.  We have to
@@ -1745,7 +1732,7 @@
      runtime process image.  */
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
-      htab->srelbss->_raw_size += sizeof (Elf32_External_Rela);
+      htab->srelbss->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -1758,8 +1745,7 @@
 
   /* Apply the required alignment.  */
   s = htab->sdynbss;
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s))
     {
       if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two))
@@ -1768,10 +1754,10 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
@@ -1803,11 +1789,11 @@
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
 	  && h->type != STT_PARISC_MILLI)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
-      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
+      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h))
 	{
 	  /* Allocate these later.  From this point on, h->plabel
 	     means that the plt entry is only used by a plabel.
@@ -1820,8 +1806,8 @@
 	  /* Make an entry in the .plt section for plabel references
 	     that won't have a .plt entry for other reasons.  */
 	  s = htab->splt;
-	  h->plt.offset = s->_raw_size;
-	  s->_raw_size += PLT_ENTRY_SIZE;
+	  h->plt.offset = s->size;
+	  s->size += PLT_ENTRY_SIZE;
 	}
       else
 	{
@@ -1865,11 +1851,11 @@
     {
       /* Make an entry in the .plt section.  */
       s = htab->splt;
-      h->plt.offset = s->_raw_size;
-      s->_raw_size += PLT_ENTRY_SIZE;
+      h->plt.offset = s->size;
+      s->size += PLT_ENTRY_SIZE;
 
       /* We also need to make an entry in the .rela.plt section.  */
-      htab->srelplt->_raw_size += sizeof (Elf32_External_Rela);
+      htab->srelplt->size += sizeof (Elf32_External_Rela);
       htab->need_plt_stub = 1;
     }
 
@@ -1881,19 +1867,19 @@
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
 	  && h->type != STT_PARISC_MILLI)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       s = htab->sgot;
-      h->got.offset = s->_raw_size;
-      s->_raw_size += GOT_ENTRY_SIZE;
+      h->got.offset = s->size;
+      s->size += GOT_ENTRY_SIZE;
       if (htab->elf.dynamic_sections_created
 	  && (info->shared
 	      || (h->dynindx != -1
 		  && h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0))
 	{
-	  htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+	  htab->srelgot->size += sizeof (Elf32_External_Rela);
 	}
     }
   else
@@ -1952,7 +1938,7 @@
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0
 	      && h->type != STT_PARISC_MILLI)
 	    {
-	      if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -1972,7 +1958,7 @@
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
       asection *sreloc = elf_section_data (p->sec)->sreloc;
-      sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela);
+      sreloc->size += p->count * sizeof (Elf32_External_Rela);
     }
 
   return TRUE;
@@ -2054,7 +2040,7 @@
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  if (s == NULL)
 	    abort ();
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
 
@@ -2099,7 +2085,7 @@
 	      else if (p->count != 0)
 		{
 		  srel = elf_section_data (p->sec)->sreloc;
-		  srel->_raw_size += p->count * sizeof (Elf32_External_Rela);
+		  srel->size += p->count * sizeof (Elf32_External_Rela);
 		  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
 		    info->flags |= DF_TEXTREL;
 		}
@@ -2119,10 +2105,10 @@
 	{
 	  if (*local_got > 0)
 	    {
-	      *local_got = s->_raw_size;
-	      s->_raw_size += GOT_ENTRY_SIZE;
+	      *local_got = s->size;
+	      s->size += GOT_ENTRY_SIZE;
 	      if (info->shared)
-		srel->_raw_size += sizeof (Elf32_External_Rela);
+		srel->size += sizeof (Elf32_External_Rela);
 	    }
 	  else
 	    *local_got = (bfd_vma) -1;
@@ -2144,10 +2130,10 @@
 	    {
 	      if (*local_plt > 0)
 		{
-		  *local_plt = s->_raw_size;
-		  s->_raw_size += PLT_ENTRY_SIZE;
+		  *local_plt = s->size;
+		  s->size += PLT_ENTRY_SIZE;
 		  if (info->shared)
-		    srel->_raw_size += sizeof (Elf32_External_Rela);
+		    srel->size += sizeof (Elf32_External_Rela);
 		}
 	      else
 		*local_plt = (bfd_vma) -1;
@@ -2187,14 +2173,14 @@
 	      if (gotalign > pltalign)
 		bfd_set_section_alignment (dynobj, s, gotalign);
 	      mask = ((bfd_size_type) 1 << gotalign) - 1;
-	      s->_raw_size = (s->_raw_size + sizeof (plt_stub) + mask) & ~mask;
+	      s->size = (s->size + sizeof (plt_stub) + mask) & ~mask;
 	    }
 	}
       else if (s == htab->sgot)
 	;
       else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
 	{
-	  if (s->_raw_size != 0)
+	  if (s->size != 0)
 	    {
 	      /* Remember whether there are any reloc sections other
 		 than .rela.plt.  */
@@ -2212,7 +2198,7 @@
 	  continue;
 	}
 
-      if (s->_raw_size == 0)
+      if (s->size == 0)
 	{
 	  /* If we don't need this section, strip it from the
 	     output file.  This is mostly to handle .rela.bss and
@@ -2229,8 +2215,8 @@
 
       /* Allocate memory for the section contents.  Zero it, because
 	 we may not fill in all the reloc sections.  */
-      s->contents = bfd_zalloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = bfd_zalloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
     }
 
@@ -2241,7 +2227,7 @@
 	 communicate the LTP value of a load module to the dynamic
 	 linker.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (!add_dynamic_entry (DT_PLTGOT, 0))
 	return FALSE;
@@ -2257,7 +2243,7 @@
 	    return FALSE;
 	}
 
-      if (htab->srelplt->_raw_size != 0)
+      if (htab->srelplt->size != 0)
 	{
 	  if (!add_dynamic_entry (DT_PLTRELSZ, 0)
 	      || !add_dynamic_entry (DT_PLTREL, DT_RELA)
@@ -2414,10 +2400,7 @@
 	  bfd_boolean big_sec;
 
 	  curr = tail;
-	  if (tail->_cooked_size)
-	    total = tail->_cooked_size;
-	  else
-	    total = tail->_raw_size;
+	  total = tail->size;
 	  big_sec = total >= stub_group_size;
 
 	  while ((prev = PREV_SEC (curr)) != NULL
@@ -2865,10 +2848,7 @@
       for (stub_sec = htab->stub_bfd->sections;
 	   stub_sec != NULL;
 	   stub_sec = stub_sec->next)
-	{
-	  stub_sec->_raw_size = 0;
-	  stub_sec->_cooked_size = 0;
-	}
+	stub_sec->size = 0;
 
       bfd_hash_traverse (&htab->stub_hash_table, hppa_size_one_stub, htab);
 
@@ -2922,8 +2902,8 @@
       sec = splt;
       if (sec != NULL)
 	{
-	  gp_val = sec->_raw_size;
-	  if (gp_val > 0x2000 || (sgot && sgot->_raw_size > 0x2000))
+	  gp_val = sec->size;
+	  if (gp_val > 0x2000 || (sgot && sgot->size > 0x2000))
 	    {
 	      gp_val = 0x2000;
 	    }
@@ -2935,7 +2915,7 @@
 	    {
 	      /* We know we don't have a .plt.  If .got is large,
 		 offset our LTP.  */
-	      if (sec->_raw_size > 0x2000)
+	      if (sec->size > 0x2000)
 		gp_val = 0x2000;
 	    }
 	  else
@@ -2985,11 +2965,11 @@
       bfd_size_type size;
 
       /* Allocate memory to hold the linker stubs.  */
-      size = stub_sec->_raw_size;
+      size = stub_sec->size;
       stub_sec->contents = bfd_zalloc (htab->stub_bfd, size);
       if (stub_sec->contents == NULL && size != 0)
 	return FALSE;
-      stub_sec->_raw_size = 0;
+      stub_sec->size = 0;
     }
 
   /* Build the stubs as directed by the stub hash table.  */
@@ -3005,7 +2985,7 @@
 elf32_hppa_final_link (bfd *abfd, struct bfd_link_info *info)
 {
   /* Invoke the regular ELF linker to do all the work.  */
-  if (!bfd_elf32_bfd_final_link (abfd, info))
+  if (!bfd_elf_final_link (abfd, info))
     return FALSE;
 
   /* If we're producing a final executable, sort the contents of the
@@ -3479,7 +3459,8 @@
 
 		off = h->elf.got.offset;
 		dyn = htab->elf.dynamic_sections_created;
-		if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, &h->elf))
+		if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared,
+						       &h->elf))
 		  {
 		    /* If we aren't going to call finish_dynamic_symbol,
 		       then we need to handle initialisation of the .got
@@ -3571,7 +3552,8 @@
 	      if (h != NULL)
 		{
 		  off = h->elf.plt.offset;
-		  if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, &h->elf))
+		  if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared,
+							 &h->elf))
 		    {
 		      /* In a non-shared link, adjust_dynamic_symbols
 			 isn't called for symbols forced local.  We
@@ -4021,7 +4003,7 @@
 	abort ();
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -4046,7 +4028,7 @@
 
 	    case DT_PLTRELSZ:
 	      s = htab->srelplt;
-	      dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      break;
 
 	    case DT_RELASZ:
@@ -4055,7 +4037,7 @@
 	      s = htab->srelplt;
 	      if (s == NULL)
 		continue;
-	      dyn.d_un.d_val -= s->_raw_size;
+	      dyn.d_un.d_val -= s->size;
 	      break;
 
 	    case DT_RELA:
@@ -4067,7 +4049,7 @@
 		continue;
 	      if (dyn.d_un.d_ptr != s->output_section->vma + s->output_offset)
 		continue;
-	      dyn.d_un.d_ptr += s->_raw_size;
+	      dyn.d_un.d_ptr += s->size;
 	      break;
 	    }
 
@@ -4075,7 +4057,7 @@
 	}
     }
 
-  if (htab->sgot != NULL && htab->sgot->_raw_size != 0)
+  if (htab->sgot != NULL && htab->sgot->size != 0)
     {
       /* Fill in the first entry in the global offset table.
 	 We use it to point to our dynamic section, if we have one.  */
@@ -4091,7 +4073,7 @@
 	->this_hdr.sh_entsize = GOT_ENTRY_SIZE;
     }
 
-  if (htab->splt != NULL && htab->splt->_raw_size != 0)
+  if (htab->splt != NULL && htab->splt->size != 0)
     {
       /* Set plt entry size.  */
       elf_section_data (htab->splt->output_section)
@@ -4101,12 +4083,12 @@
 	{
 	  /* Set up the .plt stub.  */
 	  memcpy (htab->splt->contents
-		  + htab->splt->_raw_size - sizeof (plt_stub),
+		  + htab->splt->size - sizeof (plt_stub),
 		  plt_stub, sizeof (plt_stub));
 
 	  if ((htab->splt->output_offset
 	       + htab->splt->output_section->vma
-	       + htab->splt->_raw_size)
+	       + htab->splt->size)
 	      != (htab->sgot->output_offset
 		  + htab->sgot->output_section->vma))
 	    {
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c
index 57854c8..49ecbb2 100644
--- a/bfd/elf32-i370.c
+++ b/bfd/elf32-i370.c
@@ -1,5 +1,5 @@
 /* i370-specific support for 32-bit ELF
-   Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003
+   Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
    Hacked by Linas Vepstas for i370 linas@linas.org
@@ -511,7 +511,7 @@
 
   s = bfd_get_section_by_name (dynobj, ".rela.text");
   BFD_ASSERT (s != NULL);
-  s->_raw_size += sizeof (Elf32_External_Rela);
+  s->size += sizeof (Elf32_External_Rela);
 
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
@@ -568,7 +568,7 @@
       else
 	srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf32_External_Rela);
+      srel->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -579,8 +579,7 @@
     power_of_two = 4;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (! bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -589,10 +588,10 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
@@ -657,7 +656,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -677,7 +676,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, *p);
 	  if (s != NULL)
-	    s->_raw_size = 0;
+	    s->size = 0;
 	}
     }
 
@@ -702,7 +701,7 @@
 
       if (strcmp (name, ".plt") == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* Strip this section if we don't need it; see the
                  comment below.  */
@@ -716,7 +715,7 @@
 	}
       else if (strncmp (name, ".rela", 5) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is mostly to handle .rela.bss and
@@ -778,8 +777,8 @@
 	  continue;
 	}
       /* Allocate memory for the section contents.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
     }
 
@@ -791,7 +790,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (!info->shared)
 	{
@@ -955,7 +954,7 @@
 		}
 	    }
 
-	  sreloc->_raw_size += sizeof (Elf32_External_Rela);
+	  sreloc->size += sizeof (Elf32_External_Rela);
 
 	  /* FIXME: We should here do what the m68k and i386
 	     backends do: if the reloc is pc-relative, record it
@@ -999,7 +998,7 @@
       BFD_ASSERT (splt != NULL && sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -1028,12 +1027,7 @@
 		  if (! size)
 		    dyn.d_un.d_ptr = s->vma;
 		  else
-		    {
-		      if (s->_cooked_size != 0)
-			dyn.d_un.d_val = s->_cooked_size;
-		      else
-			dyn.d_un.d_val = s->_raw_size;
-		    }
+		    dyn.d_un.d_val = s->size;
 		}
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	    }
@@ -1548,7 +1542,7 @@
 
 #define elf_backend_add_symbol_hook \
   (bfd_boolean (*) \
-     PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, \
+     PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *, \
 	      const char **, flagword *, asection **, bfd_vma *))) i370_noop
 #define elf_backend_finish_dynamic_symbol \
   (bfd_boolean (*) \
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 8f30bb2..97891a5 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -351,7 +351,7 @@
 elf_i386_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 {
   int offset;
-  size_t raw_size;
+  size_t size;
 
   if (note->namesz == 8 && strcmp (note->namedata, "FreeBSD") == 0)
     {
@@ -368,7 +368,7 @@
 
       /* pr_reg */
       offset = 28;
-      raw_size = bfd_get_32 (abfd, note->descdata + 8);
+      size = bfd_get_32 (abfd, note->descdata + 8);
     }
   else
     {
@@ -386,7 +386,7 @@
 
 	  /* pr_reg */
 	  offset = 72;
-	  raw_size = 68;
+	  size = 68;
 
 	  break;
 	}
@@ -394,7 +394,7 @@
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
 static bfd_boolean
@@ -1157,14 +1157,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_386_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_386_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
 	    return FALSE;
 	  break;
 
@@ -1429,7 +1429,7 @@
      runtime process image.  */
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
-      htab->srelbss->_raw_size += sizeof (Elf32_External_Rel);
+      htab->srelbss->size += sizeof (Elf32_External_Rel);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -1441,7 +1441,7 @@
 
   /* Apply the required alignment.  */
   s = htab->sdynbss;
-  s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s))
     {
       if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two))
@@ -1450,25 +1450,14 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
 
-/* This is the condition under which elf_i386_finish_dynamic_symbol
-   will be called from elflink.h.  If elflink.h doesn't call our
-   finish_dynamic_symbol routine, we'll need to do something about
-   initializing any .plt and .got entries in elf_i386_relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
-  ((DYN)								\
-   && ((SHARED)								\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Allocate space in .plt, .got and associated reloc sections for
    dynamic relocs.  */
 
@@ -1500,7 +1489,7 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -1511,10 +1500,10 @@
 
 	  /* 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 (s->size == 0)
+	    s->size += PLT_ENTRY_SIZE;
 
-	  h->plt.offset = s->_raw_size;
+	  h->plt.offset = s->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
@@ -1529,14 +1518,14 @@
 	    }
 
 	  /* Make room for this entry.  */
-	  s->_raw_size += PLT_ENTRY_SIZE;
+	  s->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.  */
-	  htab->sgotplt->_raw_size += 4;
+	  htab->sgotplt->size += 4;
 
 	  /* We also need to make an entry in the .rel.plt section.  */
-	  htab->srelplt->_raw_size += sizeof (Elf32_External_Rel);
+	  htab->srelplt->size += sizeof (Elf32_External_Rel);
 	}
       else
 	{
@@ -1568,16 +1557,16 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       s = htab->sgot;
-      h->got.offset = s->_raw_size;
-      s->_raw_size += 4;
+      h->got.offset = s->size;
+      s->size += 4;
       /* R_386_TLS_GD needs 2 consecutive GOT slots.  */
       if (tls_type == GOT_TLS_GD || tls_type == GOT_TLS_IE_BOTH)
-	s->_raw_size += 4;
+	s->size += 4;
       dyn = htab->elf.dynamic_sections_created;
       /* R_386_TLS_IE_32 needs one dynamic relocation,
 	 R_386_TLS_IE resp. R_386_TLS_GOTIE needs one dynamic relocation,
@@ -1585,17 +1574,17 @@
 	 need two), R_386_TLS_GD needs one if local symbol and two if
 	 global.  */
       if (tls_type == GOT_TLS_IE_BOTH)
-	htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rel);
+	htab->srelgot->size += 2 * sizeof (Elf32_External_Rel);
       else if ((tls_type == GOT_TLS_GD && h->dynindx == -1)
 	       || (tls_type & GOT_TLS_IE))
-	htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
+	htab->srelgot->size += sizeof (Elf32_External_Rel);
       else if (tls_type == GOT_TLS_GD)
-	htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rel);
+	htab->srelgot->size += 2 * sizeof (Elf32_External_Rel);
       else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 		|| h->root.type != bfd_link_hash_undefweak)
 	       && (info->shared
 		   || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
-	htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
+	htab->srelgot->size += sizeof (Elf32_External_Rel);
     }
   else
     h->got.offset = (bfd_vma) -1;
@@ -1657,7 +1646,7 @@
 	  if (h->dynindx == -1
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	    {
-	      if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -1676,7 +1665,7 @@
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
       asection *sreloc = elf_section_data (p->sec)->sreloc;
-      sreloc->_raw_size += p->count * sizeof (Elf32_External_Rel);
+      sreloc->size += p->count * sizeof (Elf32_External_Rel);
     }
 
   return TRUE;
@@ -1736,7 +1725,7 @@
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  if (s == NULL)
 	    abort ();
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -1775,7 +1764,7 @@
 	      else if (p->count != 0)
 		{
 		  srel = elf_section_data (p->sec)->sreloc;
-		  srel->_raw_size += p->count * sizeof (Elf32_External_Rel);
+		  srel->size += p->count * sizeof (Elf32_External_Rel);
 		  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
 		    info->flags |= DF_TEXTREL;
 		}
@@ -1796,19 +1785,19 @@
 	{
 	  if (*local_got > 0)
 	    {
-	      *local_got = s->_raw_size;
-	      s->_raw_size += 4;
+	      *local_got = s->size;
+	      s->size += 4;
 	      if (*local_tls_type == GOT_TLS_GD
 		  || *local_tls_type == GOT_TLS_IE_BOTH)
-		s->_raw_size += 4;
+		s->size += 4;
 	      if (info->shared
 		  || *local_tls_type == GOT_TLS_GD
 		  || (*local_tls_type & GOT_TLS_IE))
 		{
 		  if (*local_tls_type == GOT_TLS_IE_BOTH)
-		    srel->_raw_size += 2 * sizeof (Elf32_External_Rel);
+		    srel->size += 2 * sizeof (Elf32_External_Rel);
 		  else
-		    srel->_raw_size += sizeof (Elf32_External_Rel);
+		    srel->size += sizeof (Elf32_External_Rel);
 		}
 	    }
 	  else
@@ -1820,9 +1809,9 @@
     {
       /* Allocate 2 got entries and 1 dynamic reloc for R_386_TLS_LDM
 	 relocs.  */
-      htab->tls_ldm_got.offset = htab->sgot->_raw_size;
-      htab->sgot->_raw_size += 8;
-      htab->srelgot->_raw_size += sizeof (Elf32_External_Rel);
+      htab->tls_ldm_got.offset = htab->sgot->size;
+      htab->sgot->size += 8;
+      htab->srelgot->size += sizeof (Elf32_External_Rel);
     }
   else
     htab->tls_ldm_got.offset = -1;
@@ -1848,7 +1837,7 @@
 	}
       else if (strncmp (bfd_get_section_name (dynobj, s), ".rel", 4) == 0)
 	{
-	  if (s->_raw_size != 0 && s != htab->srelplt)
+	  if (s->size != 0 && s != htab->srelplt)
 	    relocs = TRUE;
 
 	  /* We use the reloc_count field as a counter if we need
@@ -1861,7 +1850,7 @@
 	  continue;
 	}
 
-      if (s->_raw_size == 0)
+      if (s->size == 0)
 	{
 	  /* If we don't need this section, strip it from the
 	     output file.  This is mostly to handle .rel.bss and
@@ -1882,7 +1871,7 @@
 	 section's contents are written out.  This should not happen,
 	 but this way if it does, we get a R_386_NONE reloc instead
 	 of garbage.  */
-      s->contents = bfd_zalloc (dynobj, s->_raw_size);
+      s->contents = bfd_zalloc (dynobj, s->size);
       if (s->contents == NULL)
 	return FALSE;
     }
@@ -1895,7 +1884,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (TAG), (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (info->executable)
 	{
@@ -1903,7 +1892,7 @@
 	    return FALSE;
 	}
 
-      if (htab->splt->_raw_size != 0)
+      if (htab->splt->size != 0)
 	{
 	  if (!add_dynamic_entry (DT_PLTGOT, 0)
 	      || !add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -2272,24 +2261,29 @@
 	  if (off >= (bfd_vma) -2)
 	    abort ();
 
-	  relocation = htab->sgot->output_offset + off;
+	  relocation = htab->sgot->output_section->vma
+		       + htab->sgot->output_offset + off
+		       - htab->sgotplt->output_section->vma
+		       - htab->sgotplt->output_offset;
 	  break;
 
 	case R_386_GOTOFF:
 	  /* Relocation is relative to the start of the global offset
 	     table.  */
 
-	  /* Note that sgot->output_offset is not involved in this
-	     calculation.  We always want the start of .got.  If we
-	     defined _GLOBAL_OFFSET_TABLE in a different way, as is
+	  /* Note that sgot is not involved in this
+	     calculation.  We always want the start of .got.plt.  If we
+	     defined _GLOBAL_OFFSET_TABLE_ in a different way, as is
 	     permitted by the ABI, we might have to change this
 	     calculation.  */
-	  relocation -= htab->sgot->output_section->vma;
+	  relocation -= htab->sgotplt->output_section->vma
+			+ htab->sgotplt->output_offset;
 	  break;
 
 	case R_386_GOTPC:
 	  /* Use global offset table as symbol value.  */
-	  relocation = htab->sgot->output_section->vma;
+	  relocation = htab->sgotplt->output_section->vma
+		       + htab->sgotplt->output_offset;
 	  unresolved_reloc = FALSE;
 	  break;
 
@@ -2455,7 +2449,7 @@
 		  BFD_ASSERT (rel->r_offset >= 2);
 		  type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
 		  BFD_ASSERT (type == 0x8d || type == 0x04);
-		  BFD_ASSERT (rel->r_offset + 9 <= input_section->_raw_size);
+		  BFD_ASSERT (rel->r_offset + 9 <= input_section->size);
 		  BFD_ASSERT (bfd_get_8 (input_bfd,
 					 contents + rel->r_offset + 4)
 			      == 0xe8);
@@ -2481,7 +2475,7 @@
 		  else
 		    {
 		      BFD_ASSERT ((val & 0xf8) == 0x80 && (val & 7) != 4);
-		      if (rel->r_offset + 10 <= input_section->_raw_size
+		      if (rel->r_offset + 10 <= input_section->size
 			  && bfd_get_8 (input_bfd,
 					contents + rel->r_offset + 9) == 0x90)
 			{
@@ -2524,7 +2518,7 @@
 		     addl $foo, %reg.  */
 		  BFD_ASSERT (rel->r_offset >= 1);
 		  val = bfd_get_8 (input_bfd, contents + rel->r_offset - 1);
-		  BFD_ASSERT (rel->r_offset + 4 <= input_section->_raw_size);
+		  BFD_ASSERT (rel->r_offset + 4 <= input_section->size);
 		  if (val == 0xa1)
 		    {
 		      /* movl foo, %eax.  */
@@ -2581,7 +2575,7 @@
 		  BFD_ASSERT (rel->r_offset >= 2);
 		  type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
 		  val = bfd_get_8 (input_bfd, contents + rel->r_offset - 1);
-		  BFD_ASSERT (rel->r_offset + 4 <= input_section->_raw_size);
+		  BFD_ASSERT (rel->r_offset + 4 <= input_section->size);
 		  BFD_ASSERT ((val & 0xc0) == 0x80 && (val & 7) != 4);
 		  if (type == 0x8b)
 		    {
@@ -2710,12 +2704,15 @@
 	    abort ();
 	  if (r_type == ELF32_R_TYPE (rel->r_info))
 	    {
-	      relocation = htab->sgot->output_offset + off;
+	      bfd_vma g_o_t = htab->sgotplt->output_section->vma
+			      + htab->sgotplt->output_offset;
+	      relocation = htab->sgot->output_section->vma
+			   + htab->sgot->output_offset + off - g_o_t;
 	      if ((r_type == R_386_TLS_IE || r_type == R_386_TLS_GOTIE)
 		  && tls_type == GOT_TLS_IE_BOTH)
 		relocation += 4;
 	      if (r_type == R_386_TLS_IE)
-		relocation += htab->sgot->output_section->vma;
+		relocation += g_o_t;
 	      unresolved_reloc = FALSE;
 	    }
 	  else
@@ -2727,7 +2724,7 @@
 	      BFD_ASSERT (rel->r_offset >= 2);
 	      type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
 	      BFD_ASSERT (type == 0x8d || type == 0x04);
-	      BFD_ASSERT (rel->r_offset + 9 <= input_section->_raw_size);
+	      BFD_ASSERT (rel->r_offset + 9 <= input_section->size);
 	      BFD_ASSERT (bfd_get_8 (input_bfd, contents + rel->r_offset + 4)
 			  == 0xe8);
 	      BFD_ASSERT (rel + 1 < relend);
@@ -2751,7 +2748,7 @@
 		  /* leal foo(%reg), %eax; call ___tls_get_addr; nop
 		     Change it into:
 		     movl %gs:0, %eax; subl $foo@gottpoff(%reg), %eax.  */
-		  BFD_ASSERT (rel->r_offset + 10 <= input_section->_raw_size);
+		  BFD_ASSERT (rel->r_offset + 10 <= input_section->size);
 		  BFD_ASSERT ((val & 0xf8) == 0x80 && (val & 7) != 4);
 		  BFD_ASSERT (bfd_get_8 (input_bfd,
 					 contents + rel->r_offset + 9)
@@ -2772,7 +2769,11 @@
 		  if (tls_type == GOT_TLS_IE_BOTH)
 		    off += 4;
 		}
-	      bfd_put_32 (output_bfd, htab->sgot->output_offset + off,
+	      bfd_put_32 (output_bfd,
+			  htab->sgot->output_section->vma
+			  + htab->sgot->output_offset + off
+			  - htab->sgotplt->output_section->vma
+			  - htab->sgotplt->output_offset,
 			  contents + roff + 8);
 	      /* Skip R_386_PLT32.  */
 	      rel++;
@@ -2795,7 +2796,7 @@
 			  == 0x8d);
 	      val = bfd_get_8 (input_bfd, contents + rel->r_offset - 1);
 	      BFD_ASSERT ((val & 0xf8) == 0x80 && (val & 7) != 4);
-	      BFD_ASSERT (rel->r_offset + 9 <= input_section->_raw_size);
+	      BFD_ASSERT (rel->r_offset + 9 <= input_section->size);
 	      BFD_ASSERT (bfd_get_8 (input_bfd, contents + rel->r_offset + 4)
 			  == 0xe8);
 	      BFD_ASSERT (rel + 1 < relend);
@@ -2834,7 +2835,10 @@
 	      bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc);
 	      htab->tls_ldm_got.offset |= 1;
 	    }
-	  relocation = htab->sgot->output_offset + off;
+	  relocation = htab->sgot->output_section->vma
+		       + htab->sgot->output_offset + off
+		       - htab->sgotplt->output_section->vma
+		       - htab->sgotplt->output_offset;
 	  unresolved_reloc = FALSE;
 	  break;
 
@@ -3156,7 +3160,7 @@
 	abort ();
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -3170,7 +3174,8 @@
 	      continue;
 
 	    case DT_PLTGOT:
-	      dyn.d_un.d_ptr = htab->sgot->output_section->vma;
+	      s = htab->sgotplt;
+	      dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
 	      break;
 
 	    case DT_JMPREL:
@@ -3180,7 +3185,7 @@
 
 	    case DT_PLTRELSZ:
 	      s = htab->srelplt;
-	      dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      break;
 
 	    case DT_RELSZ:
@@ -3193,7 +3198,7 @@
 	      s = htab->srelplt;
 	      if (s == NULL)
 		continue;
-	      dyn.d_un.d_val -= s->_raw_size;
+	      dyn.d_un.d_val -= s->size;
 	      break;
 
 	    case DT_REL:
@@ -3205,7 +3210,7 @@
 		continue;
 	      if (dyn.d_un.d_ptr != s->output_section->vma + s->output_offset)
 		continue;
-	      dyn.d_un.d_ptr += s->_raw_size;
+	      dyn.d_un.d_ptr += s->size;
 	      break;
 	    }
 
@@ -3213,7 +3218,7 @@
 	}
 
       /* Fill in the first entry in the procedure linkage table.  */
-      if (htab->splt && htab->splt->_raw_size > 0)
+      if (htab->splt && htab->splt->size > 0)
 	{
 	  if (info->shared)
 	    memcpy (htab->splt->contents,
@@ -3244,7 +3249,7 @@
   if (htab->sgotplt)
     {
       /* Fill in the first three entries in the global offset table.  */
-      if (htab->sgotplt->_raw_size > 0)
+      if (htab->sgotplt->size > 0)
 	{
 	  bfd_put_32 (output_bfd,
 		      (sdyn == NULL ? 0
@@ -3256,9 +3261,24 @@
 
       elf_section_data (htab->sgotplt->output_section)->this_hdr.sh_entsize = 4;
     }
+
+  if (htab->sgot && htab->sgot->size > 0)
+    elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize = 4;
+
   return TRUE;
 }
 
+/* Return address for Ith PLT stub in section PLT, for relocation REL
+   or (bfd_vma) -1 if it should not be included.  */
+
+static bfd_vma
+elf_i386_plt_sym_val (bfd_vma i, const asection *plt,
+		      const arelent *rel ATTRIBUTE_UNUSED)
+{
+  return plt->vma + (i + 1) * PLT_ENTRY_SIZE;
+}
+
+
 #define TARGET_LITTLE_SYM		bfd_elf32_i386_vec
 #define TARGET_LITTLE_NAME		"elf32-i386"
 #define ELF_ARCH			bfd_arch_i386
@@ -3296,6 +3316,7 @@
 #define elf_backend_reloc_type_class	      elf_i386_reloc_type_class
 #define elf_backend_relocate_section	      elf_i386_relocate_section
 #define elf_backend_size_dynamic_sections     elf_i386_size_dynamic_sections
+#define elf_backend_plt_sym_val		      elf_i386_plt_sym_val
 
 #include "elf32-target.h"
 
diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c
index f156bc5..010ac2e 100644
--- a/bfd/elf32-i860.c
+++ b/bfd/elf32-i860.c
@@ -63,7 +63,7 @@
   relocation += symbol->section->output_offset;
   relocation += reloc_entry->addend;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Adjust for PC-relative relocation.  */
@@ -126,7 +126,7 @@
   relocation += symbol->section->output_offset;
   relocation += reloc_entry->addend;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Adjust for PC-relative relocation.  */
@@ -191,7 +191,7 @@
   relocation += reloc_entry->addend;
   relocation += 0x8000;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   addr = (bfd_byte *) data + reloc_entry->address;
@@ -243,7 +243,7 @@
   relocation += symbol->section->output_offset;
   relocation += reloc_entry->addend;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   addr = (bfd_byte *) data + reloc_entry->address;
diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c
index 6493be6..758842b 100644
--- a/bfd/elf32-ip2k.c
+++ b/bfd/elf32-ip2k.c
@@ -503,7 +503,7 @@
   int index = 0;
   
   /* Check current page-jmp.  */
-  if (addr + 4 > sec->_cooked_size)
+  if (addr + 4 > sec->size)
     return -1;
 
   ip2k_get_mem (abfd, contents + addr, 4, code);
@@ -550,7 +550,7 @@
   addr = irel->r_offset;
   while (1)
     {
-      if (addr + 4 > sec->_cooked_size)
+      if (addr + 4 > sec->size)
 	break;
 
       ip2k_get_mem (abfd, misc->contents + addr, 4, code);
@@ -656,7 +656,7 @@
   int index = 0;
   
   /* Check current page-jmp.  */
-  if (addr + 4 > sec->_cooked_size)
+  if (addr + 4 > sec->size)
     return -1;
 
   ip2k_get_mem (abfd, contents + addr, 4, code);
@@ -718,7 +718,7 @@
 
   while (1)
     {
-      if (addr + 4 > sec->_cooked_size)
+      if (addr + 4 > sec->size)
 	break;
 
       ip2k_get_mem (abfd, misc->contents + addr, 4, code);
@@ -840,11 +840,6 @@
       || (sec->flags & SEC_CODE) == 0)
     return TRUE;
 
-  /* If this is the first time we have been called
-      for this section, initialise the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
-
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
   internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL,
@@ -875,12 +870,7 @@
       else
 	{
 	  /* Go get them off disk.  */
-	  contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	  if (contents == NULL)
-	    goto error_return;
-
-	  if (! bfd_get_section_contents (abfd, sec, contents,
-					  (file_ptr) 0, sec->_raw_size))
+	  if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 	    goto error_return;
 	}
     }
@@ -917,8 +907,8 @@
 	  search_addr = 0xFFFFFFFF;
 	}
 
-      if ((BASEADDR (sec) + sec->_cooked_size < search_addr)
-	  && (BASEADDR (sec) + sec->_cooked_size > page_end))
+      if ((BASEADDR (sec) + sec->size < search_addr)
+	  && (BASEADDR (sec) + sec->size > page_end))
 	{
 	  if (BASEADDR (sec) <= page_end)
 	    search_addr = page_end + 1;
@@ -940,7 +930,7 @@
 	}
 
       /* Only process sections in range.  */
-      if ((BASEADDR (sec) + sec->_cooked_size >= page_start)
+      if ((BASEADDR (sec) + sec->size >= page_start)
 	  && (BASEADDR (sec) <= page_end))
 	{
           if (!ip2k_elf_relax_section_page (abfd, sec, &changed, &misc, page_start, page_end))
@@ -1137,6 +1127,7 @@
   if (stab)
     {
       bfd_byte *stabcontents, *stabend, *stabp;
+      bfd_size_type stab_size = stab->rawsize ? stab->rawsize : stab->size;
 
       irelbase = elf_section_data (stab)->relocs;
       irelend = irelbase + stab->reloc_count;
@@ -1146,19 +1137,18 @@
 	stabcontents = elf_section_data (stab)->this_hdr.contents;
       else
 	{
-	  stabcontents = (bfd_byte *) bfd_alloc (abfd, stab->_raw_size);
-	  if (stabcontents == NULL)
-	    return;
-
-	  if (! bfd_get_section_contents (abfd, stab, stabcontents,
-					  (file_ptr) 0, stab->_raw_size))
-	    return;
+	  if (!bfd_malloc_and_get_section (abfd, stab, &stabcontents))
+	    {
+	      if (stabcontents != NULL)
+		free (stabcontents);
+	      return;
+	    }
 
 	  /* We need to remember this.  */
 	  elf_section_data (stab)->this_hdr.contents = stabcontents;
 	}
 
-      stabend = stabcontents + stab->_raw_size;
+      stabend = stabcontents + stab_size;
 
       for (irel = irelbase; irel < irelend; irel++)
 	{
@@ -1308,13 +1298,13 @@
      int count;
 {
   bfd_byte *contents = elf_section_data (sec)->this_hdr.contents;
-  bfd_vma endaddr = sec->_cooked_size;
+  bfd_vma endaddr = sec->size;
 
   /* Actually delete the bytes.  */
   memmove (contents + addr, contents + addr + count,
 	   endaddr - addr - count);
 
-  sec->_cooked_size -= count;
+  sec->size -= count;
 
   adjust_all_relocations (abfd, sec, addr + count, endaddr, -count, 0);
   return TRUE;
diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c
index 67be175..60dab34 100644
--- a/bfd/elf32-iq2000.c
+++ b/bfd/elf32-iq2000.c
@@ -484,14 +484,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_IQ2000_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_IQ2000_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index e3c6ffb..6776a62 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -51,7 +51,7 @@
 void _bfd_m32r_elf_symbol_processing
   PARAMS ((bfd *, asymbol *));
 static bfd_boolean m32r_elf_add_symbol_hook
-  PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+  PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
 	   const char **, flagword *, asection **, bfd_vma *));
 static bfd_boolean m32r_elf_relocate_section
   PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
@@ -669,7 +669,7 @@
 	 0,			/* bitpos */
 	 complain_overflow_bitfield, /* complain_on_overflow */
 	 bfd_elf_generic_reloc, /* special_function */
-	 "R_M32R_RELATIVE",		/* name */
+	 "R_M32R_RELATIVE",	/* name */
 	 FALSE,			/* partial_inplace */
 	 0xffffffff,		/* src_mask */
 	 0xffffffff,		/* dst_mask */
@@ -678,15 +678,15 @@
   HOWTO (R_M32R_GOTOFF,	/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
-	 32,			/* bitsize */
+	 24,			/* bitsize */
 	 FALSE,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_bitfield, /* complain_on_overflow */
 	 bfd_elf_generic_reloc, /* special_function */
-	 "R_M32R_GOTOFF",		/* name */
+	 "R_M32R_GOTOFF",	/* name */
 	 FALSE,			/* partial_inplace */
-	 0xffffffff,		/* src_mask */
-	 0xffffffff,		/* dst_mask */
+	 0xffffff,		/* src_mask */
+	 0xffffff,		/* dst_mask */
 	 FALSE),		/* pcrel_offset */
 
   /* An PC Relative 24-bit relocation used when setting PIC offset
@@ -803,6 +803,48 @@
 	 0x0000ffff,		/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 TRUE),			/* pcrel_offset */
+
+  HOWTO (R_M32R_GOTOFF_HI_ULO,	/* type */
+	 16,			/* 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_M32R_GOTOFF_HI_ULO",/* name */
+	 FALSE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_M32R_GOTOFF_HI_SLO,	/* type */
+	 16,			/* 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_M32R_GOTOFF_HI_SLO",/* name */
+	 FALSE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_M32R_GOTOFF_LO,	/* 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_M32R_GOTOFF_LO",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
 };
 
 /* Handle the R_M32R_10_PCREL reloc.  */
@@ -863,7 +905,7 @@
   bfd_reloc_status_type status;
 
   /* Sanity check the address (offset in section).  */
-  if (offset > input_section->_cooked_size)
+  if (offset > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   relocation = symbol_value + addend;
@@ -942,7 +984,7 @@
     }
 
   /* Sanity check the address (offset in section).  */
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   ret = bfd_reloc_ok;
@@ -1115,7 +1157,7 @@
      a section relative addend which is wrong.  */
 
   /* Sanity check the address (offset in section).  */
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (input_bfd, input_section))
     return bfd_reloc_outofrange;
 
   ret = bfd_reloc_ok;
@@ -1263,6 +1305,9 @@
   { BFD_RELOC_M32R_GOTPC_HI_ULO, R_M32R_GOTPC_HI_ULO },
   { BFD_RELOC_M32R_GOTPC_HI_SLO, R_M32R_GOTPC_HI_SLO },
   { BFD_RELOC_M32R_GOTPC_LO, R_M32R_GOTPC_LO },
+  { BFD_RELOC_M32R_GOTOFF_HI_ULO, R_M32R_GOTOFF_HI_ULO },
+  { BFD_RELOC_M32R_GOTOFF_HI_SLO, R_M32R_GOTOFF_HI_SLO },
+  { BFD_RELOC_M32R_GOTOFF_LO, R_M32R_GOTOFF_LO },
 };
 
 static reloc_howto_type *
@@ -1391,7 +1436,7 @@
 m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd *abfd;
      struct bfd_link_info *info;
-     const Elf_Internal_Sym *sym;
+     Elf_Internal_Sym *sym;
      const char **namep;
      flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
@@ -1742,7 +1787,7 @@
       h->type = STT_OBJECT;
 
       if (info->shared
-          && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+          && ! bfd_elf_link_record_dynamic_symbol (info, h))
         return FALSE;
     }
 
@@ -2020,7 +2065,7 @@
 
       srel = htab->srelbss;
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf32_External_Rela);
+      srel->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -2031,8 +2076,7 @@
     power_of_two = 3;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-                            (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (! bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -2041,25 +2085,14 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
 
-/* This is the condition under which finish_dynamic_symbol will be called
-   from elflink.h.  If elflink.h doesn't call our finish_dynamic_symbol
-   routine, we'll need to do something about initializing any .plt and .got
-   entries in relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H)			\
-  ((DYN)								\
-   && ((INFO)->shared							\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Allocate space in .plt, .got and associated reloc sections for
    dynamic relocs.  */
 
@@ -2105,20 +2138,20 @@
       if (h->dynindx == -1
           && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
         {
-          if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+          if (! bfd_elf_link_record_dynamic_symbol (info, h))
             return FALSE;
         }
 
-      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
+      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h))
         {
           asection *s = htab->splt;
 
           /* 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 (s->size == 0)
+            s->size += PLT_ENTRY_SIZE;
 
-          h->plt.offset = s->_raw_size;
+          h->plt.offset = s->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
@@ -2133,14 +2166,14 @@
             }
 
           /* Make room for this entry.  */
-          s->_raw_size += PLT_ENTRY_SIZE;
+          s->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.  */
-          htab->sgotplt->_raw_size += 4;
+          htab->sgotplt->size += 4;
 
           /* We also need to make an entry in the .rel.plt section.  */
-          htab->srelplt->_raw_size += sizeof (Elf32_External_Rela);
+          htab->srelplt->size += sizeof (Elf32_External_Rela);
         }
       else
         {
@@ -2164,17 +2197,17 @@
       if (h->dynindx == -1
           && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
         {
-          if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+          if (! bfd_elf_link_record_dynamic_symbol (info, h))
             return FALSE;
         }
 
       s = htab->sgot;
 
-      h->got.offset = s->_raw_size;
-      s->_raw_size += 4;
+      h->got.offset = s->size;
+      s->size += 4;
       dyn = htab->root.dynamic_sections_created;
-      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
-        htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h))
+        htab->srelgot->size += sizeof (Elf32_External_Rela);
     }
   else
     h->got.offset = (bfd_vma) -1;
@@ -2224,7 +2257,7 @@
           if (h->dynindx == -1
               && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
             {
-              if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+              if (! bfd_elf_link_record_dynamic_symbol (info, h))
                 return FALSE;
             }
 
@@ -2243,7 +2276,7 @@
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
       asection *sreloc = elf_section_data (p->sec)->sreloc;
-      sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela);
+      sreloc->size += p->count * sizeof (Elf32_External_Rela);
     }
 
   return TRUE;
@@ -2307,7 +2340,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -2345,7 +2378,7 @@
               else if (p->count != 0)
                 {
                   srel = elf_section_data (p->sec)->sreloc;
-                  srel->_raw_size += p->count * sizeof (Elf32_External_Rela);
+                  srel->size += p->count * sizeof (Elf32_External_Rela);
                   if ((p->sec->output_section->flags & SEC_READONLY) != 0)
                     info->flags |= DF_TEXTREL;
                 }
@@ -2365,10 +2398,10 @@
         {
           if (*local_got > 0)
             {
-              *local_got = s->_raw_size;
-              s->_raw_size += 4;
+              *local_got = s->size;
+              s->size += 4;
               if (info->shared)
-                srel->_raw_size += sizeof (Elf32_External_Rela);
+                srel->size += sizeof (Elf32_External_Rela);
             }
           else
             *local_got = (bfd_vma) -1;
@@ -2396,7 +2429,7 @@
         }
       else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
         {
-          if (s->_raw_size != 0 && s != htab->srelplt)
+          if (s->size != 0 && s != htab->srelplt)
             relocs = TRUE;
 
           /* We use the reloc_count field as a counter if we need
@@ -2409,7 +2442,7 @@
           continue;
         }
 
-      if (s->_raw_size == 0)
+      if (s->size == 0)
         {
           /* If we don't need this section, strip it from the
              output file.  This is mostly to handle .rela.bss and
@@ -2429,7 +2462,7 @@
          section's contents are written out.  This should not happen,
          but this way if it does, we get a R_M32R_NONE reloc instead
          of garbage.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
       if (s->contents == NULL)
         return FALSE;
     }
@@ -2442,7 +2475,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (! info->shared)
 	{
@@ -2450,7 +2483,7 @@
 	    return FALSE;
 	}
 
-      if (htab->splt->_raw_size != 0)
+      if (htab->splt->size != 0)
         {
           if (! add_dynamic_entry (DT_PLTGOT, 0)
               || ! add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -2539,6 +2572,7 @@
   bfd *dynobj;
   bfd_vma *local_got_offsets;
   asection *sgot, *splt, *sreloc;
+  bfd_vma high_address = bfd_get_section_limit (input_bfd, input_section);
 
   dynobj = htab->root.dynobj;
   local_got_offsets = elf_local_got_offsets (input_bfd);
@@ -2723,7 +2757,8 @@
                            || r_type == R_M32R_GOT16_HI_ULO
                            || r_type == R_M32R_GOT16_HI_SLO
                            || r_type == R_M32R_GOT16_LO)
-                          && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
+                          && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn,
+							      info->shared, h)
                           && (! info->shared
                               || (! info->symbolic && h->dynindx != -1)
                               || (h->elf_link_hash_flags
@@ -2789,7 +2824,7 @@
 	    }
 
 	  /* Sanity check the address.  */
-	  if (offset > input_section->_raw_size)
+	  if (offset > high_address)
 	    {
 	      r = bfd_reloc_outofrange;
 	      goto check_reloc;
@@ -2797,6 +2832,31 @@
 
 	  switch ((int) r_type)
 	    {
+            case R_M32R_GOTOFF:
+              /* Relocation is relative to the start of the global offset
+                 table (for ld24 rx, #uimm24). eg access at label+addend
+		 
+                 ld24 rx. #label@GOTOFF + addend
+                 sub  rx, r12.  */
+
+              BFD_ASSERT (sgot != NULL);
+
+              relocation = -(relocation - sgot->output_section->vma);
+              rel->r_addend = -rel->r_addend;
+              break;
+
+            case R_M32R_GOTOFF_HI_ULO:
+            case R_M32R_GOTOFF_HI_SLO:
+            case R_M32R_GOTOFF_LO:
+	      BFD_ASSERT (sgot != NULL);
+
+	      relocation -= sgot->output_section->vma;
+
+	      if ((r_type == R_M32R_GOTOFF_HI_SLO)
+		  && ((relocation + rel->r_addend) & 0x8000))
+		rel->r_addend += 0x10000;
+	      break;
+
             case R_M32R_GOTPC24:
               /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation
                  ld24 rx,#_GLOBAL_OFFSET_TABLE_
@@ -2845,7 +2905,7 @@
                   BFD_ASSERT (off != (bfd_vma) -1);
 
                   dyn = htab->root.dynamic_sections_created;
-                  if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
+                  if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
                       || (info->shared
                           && (info->symbolic
                               || h->dynindx == -1
@@ -3460,7 +3520,7 @@
       BFD_ASSERT (sgot != NULL && sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
 
       for (; dyncon < dynconend; dyncon++)
         {
@@ -3491,10 +3551,7 @@
             case DT_PLTRELSZ:
               s = htab->srelplt->output_section;
               BFD_ASSERT (s != NULL);
-              if (s->_cooked_size != 0)
-                dyn.d_un.d_val = s->_cooked_size;
-              else
-                dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
               bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
               break;
 
@@ -3511,10 +3568,7 @@
               if (htab->srelplt != NULL)
                 {
                   s = htab->srelplt->output_section;
-                  if (s->_cooked_size != 0)
-                    dyn.d_un.d_val -= s->_cooked_size;
-                  else
-                    dyn.d_un.d_val -= s->_raw_size;
+		  dyn.d_un.d_val -= s->size;
                 }
               bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
               break;
@@ -3523,7 +3577,7 @@
 
       /* Fill in the first entry in the procedure linkage table.  */
       splt = htab->splt;
-      if (splt && splt->_raw_size > 0)
+      if (splt && splt->size > 0)
         {
           if (info->shared)
             {
@@ -3555,7 +3609,7 @@
     }
 
   /* Fill in the first three entries in the global offset table.  */
-  if (sgot && sgot->_raw_size > 0)
+  if (sgot && sgot->size > 0)
     {
       if (sdyn == NULL)
         bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
@@ -3625,11 +3679,6 @@
       || 0 /* FIXME: check SHF_M32R_CAN_RELAX */)
     return TRUE;
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
-
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
   /* Get a copy of the native relocations.  */
@@ -3659,12 +3708,7 @@
 	  else
 	    {
 	      /* Go get them off disk.  */
-	      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	      if (contents == NULL)
-		goto error_return;
-
-	      if (! bfd_get_section_contents (abfd, sec, contents,
-					      (file_ptr) 0, sec->_raw_size))
+	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		goto error_return;
 	    }
 	}
@@ -3744,7 +3788,7 @@
 
 	  /* Do nothing if no room in the section for this to be what we're
 	     looking for.  */
-	  if (irel->r_offset > sec->_cooked_size - 8)
+	  if (irel->r_offset > sec->size - 8)
 	    continue;
 
 	  /* Make sure the next relocation applies to the next
@@ -3786,7 +3830,7 @@
 	  if (pcrel_value >= -(1 << 25) && pcrel_value < (1 << 25) + 4
 	      /* Do nothing if no room in the section for this to be what we're
 		 looking for.  */
-	      && (irel->r_offset <= sec->_cooked_size - 12)
+	      && (irel->r_offset <= sec->size - 12)
 	      /* Ensure the next insn is "jl rN".  */
 	      && ((code = bfd_get_16 (abfd, contents + irel->r_offset + 8)),
 		  code != (0x1ec0 | reg)))
@@ -3953,14 +3997,14 @@
      power larger than the number of bytes we are deleting.  */
 
   irelalign = NULL;
-  toaddr = sec->_cooked_size;
+  toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
   irelend = irel + sec->reloc_count;
 
   /* Actually delete the bytes.  */
   memmove (contents + addr, contents + addr + count, toaddr - addr - count);
-  sec->_cooked_size -= count;
+  sec->size -= count;
 
   /* Adjust all the relocs.  */
   for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
@@ -4037,7 +4081,7 @@
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
 
   memcpy (data, elf_section_data (input_section)->this_hdr.contents,
-	  input_section->_raw_size);
+	  input_section->size);
 
   if ((input_section->flags & SEC_RELOC) != 0
       && input_section->reloc_count > 0)
@@ -4323,6 +4367,10 @@
       case R_M32R_GOT16_HI_ULO:
       case R_M32R_GOT16_HI_SLO:
       case R_M32R_GOT16_LO:
+      case R_M32R_GOTOFF:
+      case R_M32R_GOTOFF_HI_ULO:
+      case R_M32R_GOTOFF_HI_SLO:
+      case R_M32R_GOTOFF_LO:
       case R_M32R_GOT24:
       case R_M32R_GOTPC_HI_ULO:
       case R_M32R_GOTPC_HI_SLO:
@@ -4452,6 +4500,10 @@
             {
             case R_M32R_GOT16_HI_ULO:
             case R_M32R_GOT16_HI_SLO:
+            case R_M32R_GOTOFF:
+            case R_M32R_GOTOFF_HI_ULO:
+            case R_M32R_GOTOFF_HI_SLO:
+            case R_M32R_GOTOFF_LO:
             case R_M32R_GOT16_LO:
             case R_M32R_GOTPC24:
             case R_M32R_GOTPC_HI_ULO:
@@ -4656,18 +4708,18 @@
            Reconstruct it for later use during GC.  */
         case R_M32R_RELA_GNU_VTINHERIT:
         case R_M32R_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_M32R_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
             return FALSE;
           break;
         case R_M32R_RELA_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
         }
diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c
index 42010b0..00df7aa 100644
--- a/bfd/elf32-m68hc11.c
+++ b/bfd/elf32-m68hc11.c
@@ -1,5 +1,6 @@
 /* Motorola 68HC11-specific support for 32-bit ELF
-   Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
    (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
 
@@ -394,8 +395,8 @@
   stub_sec = stub_entry->stub_sec;
 
   /* Make a note of the offset within the stubs for this entry.  */
-  stub_entry->stub_offset = stub_sec->_raw_size;
-  stub_sec->_raw_size += 10;
+  stub_entry->stub_offset = stub_sec->size;
+  stub_sec->size += 10;
   loc = stub_sec->contents + stub_entry->stub_offset;
 
   stub_bfd = stub_sec->owner;
@@ -445,7 +446,7 @@
   /* Massage our args to the form they really have.  */
   stub_entry = (struct elf32_m68hc11_stub_hash_entry *) gen_entry;
 
-  stub_entry->stub_sec->_raw_size += 10;
+  stub_entry->stub_sec->size += 10;
   return TRUE;
 }
 
@@ -679,11 +680,6 @@
       || (sec->flags & SEC_CODE) == 0)
     return TRUE;
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
-
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
 
@@ -731,13 +727,7 @@
 	  else
 	    {
 	      /* Go get them off disk.  */
-	      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	      if (contents == NULL)
-		goto error_return;
-	      free_contents = contents;
-
-	      if (! bfd_get_section_contents (abfd, sec, contents,
-					      (file_ptr) 0, sec->_raw_size))
+	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		goto error_return;
 	    }
 	}
@@ -763,7 +753,7 @@
           prev_insn_group = 0;
 
 	  /* Do nothing if this reloc is the last byte in the section.  */
-	  if (irel->r_offset + 2 >= sec->_cooked_size)
+	  if (irel->r_offset + 2 >= sec->size)
 	    continue;
 
 	  /* See if the next instruction is an unconditional pc-relative
@@ -849,7 +839,7 @@
           prev_insn_group = 0;
 
 	  /* Do nothing if this reloc is the last byte in the section.  */
-	  if (irel->r_offset == sec->_cooked_size)
+	  if (irel->r_offset == sec->size)
 	    continue;
 
           prev_insn_group = irel;
@@ -952,7 +942,7 @@
 
           if (prev_insn_group)
             {
-              unsigned long old_sec_size = sec->_cooked_size;
+              unsigned long old_sec_size = sec->size;
 
               /* Note that we've changed the relocation contents, etc.  */
               elf_section_data (sec)->relocs = internal_relocs;
@@ -971,7 +961,7 @@
               prev_insn_group = 0;
               irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
                                            R_M68HC11_NONE);
-              if (sec->_cooked_size != old_sec_size)
+              if (sec->size != old_sec_size)
                 *again = TRUE;
               continue;
             }
@@ -1124,7 +1114,7 @@
 
   contents = elf_section_data (sec)->this_hdr.contents;
 
-  toaddr = sec->_cooked_size;
+  toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
   irelend = irel + sec->reloc_count;
@@ -1133,7 +1123,7 @@
   memmove (contents + addr, contents + addr + count,
 	   (size_t) (toaddr - addr - count));
 
-  sec->_cooked_size -= count;
+  sec->size -= count;
 
   /* Adjust all the relocs.  */
   for (irel = elf_section_data (sec)->relocs; irel < irelend; irel++)
diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c
index cfc265e..6115ee4 100644
--- a/bfd/elf32-m68hc12.c
+++ b/bfd/elf32-m68hc12.c
@@ -1,5 +1,5 @@
 /* Motorola 68HC12-specific support for 32-bit ELF
-   Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
    (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com))
 
@@ -443,8 +443,8 @@
   stub_sec = stub_entry->stub_sec;
 
   /* Make a note of the offset within the stubs for this entry.  */
-  stub_entry->stub_offset = stub_sec->_raw_size;
-  stub_sec->_raw_size += 7;
+  stub_entry->stub_offset = stub_sec->size;
+  stub_sec->size += 7;
   loc = stub_sec->contents + stub_entry->stub_offset;
 
   stub_bfd = stub_sec->owner;
@@ -486,7 +486,7 @@
   /* Massage our args to the form they really have.  */
   stub_entry = (struct elf32_m68hc11_stub_hash_entry *) gen_entry;
 
-  stub_entry->stub_sec->_raw_size += 7;
+  stub_entry->stub_sec->size += 7;
   return TRUE;
 }
 
diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c
index 00b75df..3b453ec 100644
--- a/bfd/elf32-m68hc1x.c
+++ b/bfd/elf32-m68hc1x.c
@@ -181,7 +181,7 @@
 
 bfd_boolean
 elf32_m68hc11_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
-                               const Elf_Internal_Sym *sym,
+                               Elf_Internal_Sym *sym,
                                const char **namep ATTRIBUTE_UNUSED,
                                flagword *flagsp ATTRIBUTE_UNUSED,
                                asection **secp ATTRIBUTE_UNUSED,
@@ -534,8 +534,7 @@
            stub_sec != NULL;
            stub_sec = stub_sec->next)
         {
-          stub_sec->_raw_size = 0;
-          stub_sec->_cooked_size = 0;
+          stub_sec->size = 0;
         }
 
       bfd_hash_traverse (htab->stub_hash_table, htab->size_one_stub, htab);
@@ -629,11 +628,11 @@
       bfd_size_type size;
 
       /* Allocate memory to hold the linker stubs.  */
-      size = stub_sec->_raw_size;
+      size = stub_sec->size;
       stub_sec->contents = (unsigned char *) bfd_zalloc (htab->stub_bfd, size);
       if (stub_sec->contents == NULL && size != 0)
 	return FALSE;
-      stub_sec->_raw_size = 0;
+      stub_sec->size = 0;
     }
 
   /* Build the stubs as directed by the stub hash table.  */
@@ -803,7 +802,7 @@
   if (output_bfd != NULL)
     return bfd_reloc_continue;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   abort();
@@ -893,14 +892,14 @@
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_M68HC11_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_M68HC11_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
         }
diff --git a/bfd/elf32-m68hc1x.h b/bfd/elf32-m68hc1x.h
index 5964023..f6b2001 100644
--- a/bfd/elf32-m68hc1x.h
+++ b/bfd/elf32-m68hc1x.h
@@ -1,5 +1,5 @@
 /* Motorola 68HC11/68HC12-specific support for 32-bit ELF
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -178,7 +178,7 @@
 
 bfd_boolean elf32_m68hc11_add_symbol_hook
   (bfd *abfd, struct bfd_link_info *info,
-   const Elf_Internal_Sym *sym, const char **namep,
+   Elf_Internal_Sym *sym, const char **namep,
    flagword *flagsp, asection **secp,
    bfd_vma *valp);
 
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index f1bdd1a..842f38c 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -508,14 +508,14 @@
 		  if (h->dynindx == -1
 		      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 		    {
-		      if (!bfd_elf32_link_record_dynamic_symbol (info, h))
+		      if (!bfd_elf_link_record_dynamic_symbol (info, h))
 			return FALSE;
 		    }
 
 		  /* Allocate space in the .got section.  */
-		  sgot->_raw_size += 4;
+		  sgot->size += 4;
 		  /* Allocate relocation space.  */
-		  srelgot->_raw_size += sizeof (Elf32_External_Rela);
+		  srelgot->size += sizeof (Elf32_External_Rela);
 		}
 	      h->got.refcount++;
 	    }
@@ -536,13 +536,13 @@
 		}
 	      if (local_got_refcounts[r_symndx] == 0)
 		{
-		  sgot->_raw_size += 4;
+		  sgot->size += 4;
 		  if (info->shared)
 		    {
 		      /* If we are generating a shared object, we need to
 			 output a R_68K_RELATIVE reloc so that the dynamic
 			 linker can adjust this GOT entry.  */
-		      srelgot->_raw_size += sizeof (Elf32_External_Rela);
+		      srelgot->size += sizeof (Elf32_External_Rela);
 		    }
 		}
 	      local_got_refcounts[r_symndx]++;
@@ -586,7 +586,7 @@
 	  if (h->dynindx == -1
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	    {
-	      if (!bfd_elf32_link_record_dynamic_symbol (info, h))
+	      if (!bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -684,7 +684,7 @@
 		       || ELF32_R_TYPE (rel->r_info) == R_68K_PC32))
 		    info->flags |= DF_TEXTREL;
 
-	      sreloc->_raw_size += sizeof (Elf32_External_Rela);
+	      sreloc->size += sizeof (Elf32_External_Rela);
 
 	      /* We count the number of PC relative relocations we have
 		 entered for this symbol, so that we can discard them
@@ -745,14 +745,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_68K_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_68K_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
@@ -856,8 +856,8 @@
 		  if (h->got.refcount == 0)
 		    {
 		      /* We don't need the .got entry any more.  */
-		      sgot->_raw_size -= 4;
-		      srelgot->_raw_size -= sizeof (Elf32_External_Rela);
+		      sgot->size -= 4;
+		      srelgot->size -= sizeof (Elf32_External_Rela);
 		    }
 		}
 	    }
@@ -869,9 +869,9 @@
 		  if (local_got_refcounts[r_symndx] == 0)
 		    {
 		      /* We don't need the .got entry any more.  */
-		      sgot->_raw_size -= 4;
+		      sgot->size -= 4;
 		      if (info->shared)
-			srelgot->_raw_size -= sizeof (Elf32_External_Rela);
+			srelgot->size -= sizeof (Elf32_External_Rela);
 		    }
 		}
 	    }
@@ -970,7 +970,7 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -979,12 +979,12 @@
 
       /* If this is the first .plt entry, make room for the special
 	 first entry.  */
-      if (s->_raw_size == 0)
+      if (s->size == 0)
 	{
 	  if (CPU32_FLAG (dynobj))
-	    s->_raw_size += PLT_CPU32_ENTRY_SIZE;
+	    s->size += PLT_CPU32_ENTRY_SIZE;
 	  else
-	    s->_raw_size += PLT_ENTRY_SIZE;
+	    s->size += PLT_ENTRY_SIZE;
 	}
 
       /* If this symbol is not defined in a regular file, and we are
@@ -996,27 +996,27 @@
 	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
 	{
 	  h->root.u.def.section = s;
-	  h->root.u.def.value = s->_raw_size;
+	  h->root.u.def.value = s->size;
 	}
 
-      h->plt.offset = s->_raw_size;
+      h->plt.offset = s->size;
 
       /* Make room for this entry.  */
       if (CPU32_FLAG (dynobj))
-        s->_raw_size += PLT_CPU32_ENTRY_SIZE;
+        s->size += PLT_CPU32_ENTRY_SIZE;
       else
-        s->_raw_size += PLT_ENTRY_SIZE;
+        s->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.  */
       s = bfd_get_section_by_name (dynobj, ".got.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += 4;
+      s->size += 4;
 
       /* We also need to make an entry in the .rela.plt section.  */
       s = bfd_get_section_by_name (dynobj, ".rela.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += sizeof (Elf32_External_Rela);
+      s->size += sizeof (Elf32_External_Rela);
 
       return TRUE;
     }
@@ -1070,7 +1070,7 @@
 
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf32_External_Rela);
+      srel->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -1081,8 +1081,7 @@
     power_of_two = 3;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (!bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -1091,25 +1090,14 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
 
-/* This is the condition under which elf_m68k_finish_dynamic_symbol
-   will be called from elflink.h.  If elflink.h doesn't call our
-   finish_dynamic_symbol routine, we'll need to do something about
-   initializing any .plt and .got entries in elf_m68k_relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
-  ((DYN)								\
-   && ((SHARED)								\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Set the sizes of the dynamic sections.  */
 
 static bfd_boolean
@@ -1132,7 +1120,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -1145,7 +1133,7 @@
 	 below.  */
       s = bfd_get_section_by_name (dynobj, ".rela.got");
       if (s != NULL)
-	s->_raw_size = 0;
+	s->size = 0;
     }
 
   /* If this is a -Bsymbolic shared link, then we need to discard all
@@ -1180,7 +1168,7 @@
 
       if (strcmp (name, ".plt") == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* Strip this section if we don't need it; see the
                  comment below.  */
@@ -1194,7 +1182,7 @@
 	}
       else if (strncmp (name, ".rela", 5) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is mostly to handle .rela.bss and
@@ -1234,8 +1222,8 @@
 	 are written out, but at the moment this does not happen.  Thus in
 	 order to prevent writing out garbage, we initialise the section's
 	 contents to zero.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
     }
 
@@ -1247,7 +1235,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (!info->shared)
 	{
@@ -1330,7 +1318,7 @@
   for (s = elf_m68k_hash_entry (h)->pcrel_relocs_copied;
        s != NULL;
        s = s->next)
-    s->section->_raw_size -= s->count * sizeof (Elf32_External_Rela);
+    s->section->size -= s->count * sizeof (Elf32_External_Rela);
 
   return TRUE;
 }
@@ -1981,7 +1969,7 @@
       BFD_ASSERT (splt != NULL && sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -2010,10 +1998,7 @@
 	    case DT_PLTRELSZ:
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      BFD_ASSERT (s != NULL);
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size;
-	      else
-		dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
@@ -2027,19 +2012,14 @@
 		 about changing the DT_RELA entry.  */
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      if (s != NULL)
-		{
-		  if (s->_cooked_size != 0)
-		    dyn.d_un.d_val -= s->_cooked_size;
-		  else
-		    dyn.d_un.d_val -= s->_raw_size;
-		}
+		dyn.d_un.d_val -= s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 	    }
 	}
 
       /* Fill in the first entry in the procedure linkage table.  */
-      if (splt->_raw_size > 0)
+      if (splt->size > 0)
 	{
           if (!CPU32_FLAG (output_bfd))
             {
@@ -2077,7 +2057,7 @@
     }
 
   /* Fill in the first three entries in the global offset table.  */
-  if (sgot->_raw_size > 0)
+  if (sgot->size > 0)
     {
       if (sdyn == NULL)
 	bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
@@ -2242,7 +2222,7 @@
 					_bfd_elf_create_dynamic_sections
 #define bfd_elf32_bfd_link_hash_table_create \
 					elf_m68k_link_hash_table_create
-#define bfd_elf32_bfd_final_link	_bfd_elf32_gc_common_final_link
+#define bfd_elf32_bfd_final_link	bfd_elf_gc_common_final_link
 
 #define elf_backend_check_relocs	elf_m68k_check_relocs
 #define elf_backend_adjust_dynamic_symbol \
diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c
index fd13ea8..e6aa666 100644
--- a/bfd/elf32-mcore.c
+++ b/bfd/elf32-mcore.c
@@ -647,14 +647,14 @@
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_MCORE_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_MCORE_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
         }
diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c
index a0480f0..9774215 100644
--- a/bfd/elf32-mips.c
+++ b/bfd/elf32-mips.c
@@ -1,6 +1,6 @@
 /* MIPS-specific support for 32-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003 Free Software Foundation, Inc.
+   2003, 2004 Free Software Foundation, Inc.
 
    Most of the information added by Ian Lance Taylor, Cygnus Support,
    <ian@cygnus.com>.
@@ -599,39 +599,6 @@
 	 0x07ff001f,	        /* dst_mask */
 	 FALSE);		/* pcrel_offset */
 
-/* GNU extensions for embedded-pic.  */
-/* High 16 bits of symbol value, pc-relative.  */
-static reloc_howto_type elf_mips_gnu_rel_hi16 =
-  HOWTO (R_MIPS_GNU_REL_HI16,	/* type */
-	 16,			/* rightshift */
-	 2,			/* size (0 = byte, 1 = short, 2 = long) */
-	 16,			/* bitsize */
-	 TRUE,			/* pc_relative */
-	 0,			/* bitpos */
-	 complain_overflow_dont, /* complain_on_overflow */
-	 _bfd_mips_elf_hi16_reloc, /* special_function */
-	 "R_MIPS_GNU_REL_HI16",	/* name */
-	 TRUE,			/* partial_inplace */
-	 0xffff,		/* src_mask */
-	 0xffff,		/* dst_mask */
-	 TRUE);			/* pcrel_offset */
-
-/* Low 16 bits of symbol value, pc-relative.  */
-static reloc_howto_type elf_mips_gnu_rel_lo16 =
-  HOWTO (R_MIPS_GNU_REL_LO16,	/* type */
-	 0,			/* rightshift */
-	 2,			/* size (0 = byte, 1 = short, 2 = long) */
-	 16,			/* bitsize */
-	 TRUE,			/* pc_relative */
-	 0,			/* bitpos */
-	 complain_overflow_dont, /* complain_on_overflow */
-	 _bfd_mips_elf_lo16_reloc, /* special_function */
-	 "R_MIPS_GNU_REL_LO16",	/* name */
-	 TRUE,			/* partial_inplace */
-	 0xffff,		/* src_mask */
-	 0xffff,		/* dst_mask */
-	 TRUE);			/* pcrel_offset */
-
 /* 16 bit offset for pc-relative branches.  */
 static reloc_howto_type elf_mips_gnu_rel16_s2 =
   HOWTO (R_MIPS_GNU_REL16_S2,	/* type */
@@ -648,23 +615,10 @@
 	 0xffff,		/* dst_mask */
 	 TRUE);			/* pcrel_offset */
 
-/* 64 bit pc-relative.  */
-static reloc_howto_type elf_mips_gnu_pcrel64 =
-  HOWTO (R_MIPS_PC64,		/* type */
-	 0,			/* rightshift */
-	 4,			/* size (0 = byte, 1 = short, 2 = long) */
-	 64,			/* bitsize */
-	 TRUE,			/* pc_relative */
-	 0,			/* bitpos */
-	 complain_overflow_signed, /* complain_on_overflow */
-	 _bfd_mips_elf_generic_reloc, /* special_function */
-	 "R_MIPS_PC64",		/* name */
-	 TRUE,			/* partial_inplace */
-	 MINUS_ONE,		/* src_mask */
-	 MINUS_ONE,		/* dst_mask */
-	 TRUE);			/* pcrel_offset */
-
-/* 32 bit pc-relative.  */
+/* 32 bit pc-relative.  This was a GNU extension used by embedded-PIC.
+   It was co-opted by mips-linux for exception-handling data.  It is no
+   longer used, but should continue to be supported by the linker for
+   backward compatibility.  (GCC stopped using it in May, 2004.)  */
 static reloc_howto_type elf_mips_gnu_pcrel32 =
   HOWTO (R_MIPS_PC32,		/* type */
 	 0,			/* rightshift */
@@ -879,7 +833,7 @@
   relocation += symbol->section->output_section->vma;
   relocation += symbol->section->output_offset;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Set val to the offset into the section or symbol.  */
@@ -1011,7 +965,7 @@
   if (ret != bfd_reloc_ok)
     return ret;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   if (bfd_is_com_section (symbol->section))
@@ -1134,14 +1088,8 @@
       return &elf_mips_gnu_vtinherit_howto;
     case BFD_RELOC_VTABLE_ENTRY:
       return &elf_mips_gnu_vtentry_howto;
-    case BFD_RELOC_PCREL_HI16_S:
-      return &elf_mips_gnu_rel_hi16;
-    case BFD_RELOC_PCREL_LO16:
-      return &elf_mips_gnu_rel_lo16;
     case BFD_RELOC_16_PCREL_S2:
       return &elf_mips_gnu_rel16_s2;
-    case BFD_RELOC_64_PCREL:
-      return &elf_mips_gnu_pcrel64;
     case BFD_RELOC_32_PCREL:
       return &elf_mips_gnu_pcrel32;
     }
@@ -1163,14 +1111,8 @@
       return &elf_mips_gnu_vtinherit_howto;
     case R_MIPS_GNU_VTENTRY:
       return &elf_mips_gnu_vtentry_howto;
-    case R_MIPS_GNU_REL_HI16:
-      return &elf_mips_gnu_rel_hi16;
-    case R_MIPS_GNU_REL_LO16:
-      return &elf_mips_gnu_rel_lo16;
     case R_MIPS_GNU_REL16_S2:
       return &elf_mips_gnu_rel16_s2;
-    case R_MIPS_PC64:
-      return &elf_mips_gnu_pcrel64;
     case R_MIPS_PC32:
       return &elf_mips_gnu_pcrel32;
     default:
@@ -1267,7 +1209,7 @@
 elf32_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 {
   int offset;
-  unsigned int raw_size;
+  unsigned int size;
 
   switch (note->descsz)
     {
@@ -1283,14 +1225,14 @@
 
 	/* pr_reg */
 	offset = 72;
-	raw_size = 180;
+	size = 180;
 
 	break;
     }
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
 static bfd_boolean
@@ -1335,139 +1277,6 @@
     return ict_none;
 }
 
-/* Given a data section and an in-memory embedded reloc section, store
-   relocation information into the embedded reloc section which can be
-   used at runtime to relocate the data section.  This is called by the
-   linker when the --embedded-relocs switch is used.  This is called
-   after the add_symbols entry point has been called for all the
-   objects, and before the final_link entry point is called.  */
-
-bfd_boolean
-bfd_mips_elf32_create_embedded_relocs (bfd *abfd, struct bfd_link_info *info,
-				       asection *datasec, asection *relsec,
-				       char **errmsg)
-{
-  Elf_Internal_Shdr *symtab_hdr;
-  Elf_Internal_Sym *isymbuf = NULL;
-  Elf_Internal_Rela *internal_relocs = NULL;
-  Elf_Internal_Rela *irel, *irelend;
-  bfd_byte *p;
-
-  BFD_ASSERT (! info->relocatable);
-
-  *errmsg = NULL;
-
-  if (datasec->reloc_count == 0)
-    return TRUE;
-
-  /* Read this BFD's symbols if we haven't done so already, or get the cached
-     copy if it exists.  */
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
-  if (symtab_hdr->sh_info != 0)
-    {
-      isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
-      if (isymbuf == NULL)
-	isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr,
-					symtab_hdr->sh_info, 0,
-					NULL, NULL, NULL);
-      if (isymbuf == NULL)
-	goto error_return;
-    }
-
-  /* Get a copy of the native relocations.  */
-  internal_relocs = _bfd_elf_link_read_relocs (abfd, datasec, NULL, NULL,
-					       info->keep_memory);
-  if (internal_relocs == NULL)
-    goto error_return;
-
-  relsec->contents = bfd_alloc (abfd, datasec->reloc_count * 12);
-  if (relsec->contents == NULL)
-    goto error_return;
-
-  p = relsec->contents;
-
-  irelend = internal_relocs + datasec->reloc_count;
-
-  for (irel = internal_relocs; irel < irelend; irel++, p += 12)
-    {
-      asection *targetsec;
-
-      /* We are going to write a four byte longword into the runtime
-	 reloc section.  The longword will be the address in the data
-	 section which must be relocated.  It is followed by the name
-	 of the target section NUL-padded or truncated to 8
-	 characters.  */
-
-      /* We can only relocate absolute longword relocs at run time.  */
-      if ((ELF32_R_TYPE (irel->r_info) != (int) R_MIPS_32) &&
-	  (ELF32_R_TYPE (irel->r_info) != (int) R_MIPS_64))
-	{
-	  *errmsg = _("unsupported reloc type");
-	  bfd_set_error (bfd_error_bad_value);
-	  goto error_return;
-	}
-      /* Get the target section referred to by the reloc.  */
-      if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info)
-	{
-          Elf_Internal_Sym *isym;
-
-          /* A local symbol.  */
-	  isym = isymbuf + ELF32_R_SYM (irel->r_info);
-	  targetsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
-	}
-      else
-	{
-	  unsigned long indx;
-	  struct elf_link_hash_entry *h;
-
-	  /* An external symbol.  */
-	  indx = ELF32_R_SYM (irel->r_info);
-	  h = elf_sym_hashes (abfd)[indx];
-	  targetsec = NULL;
-	  /*
-	     For some reason, in certain programs, the symbol will
-	     not be in the hash table.  It seems to happen when you
-	     declare a static table of pointers to const external structures.
-	     In this case, the relocs are relative to data, not
-	     text, so just treating it like an undefined link
-	     should be sufficient.  */
-	  BFD_ASSERT(h != NULL);
-	  if (h->root.type == bfd_link_hash_defined
-	      || h->root.type == bfd_link_hash_defweak)
-	    targetsec = h->root.u.def.section;
-	}
-
-
-      /*
-         Set the low bit of the relocation offset if it's a MIPS64 reloc.
-         Relocations will always be on (at least) 32-bit boundaries.  */
-
-      bfd_put_32 (abfd, ((irel->r_offset + datasec->output_offset) +
-		  ((ELF32_R_TYPE (irel->r_info) == (int) R_MIPS_64) ? 1 : 0)),
-		  p);
-      memset (p + 4, 0, 8);
-      if (targetsec != NULL)
-	strncpy (p + 4, targetsec->output_section->name, 8);
-    }
-
-  if (internal_relocs != NULL
-      && elf_section_data (datasec)->relocs != internal_relocs)
-    free (internal_relocs);
-  if (isymbuf != NULL
-      && symtab_hdr->contents != (unsigned char *) isymbuf)
-    free (isymbuf);
-  return TRUE;
-
- error_return:
-  if (internal_relocs != NULL
-      && elf_section_data (datasec)->relocs != internal_relocs)
-    free (internal_relocs);
-  if (isymbuf != NULL
-      && symtab_hdr->contents != (unsigned char *) isymbuf)
-    free (isymbuf);
-  return FALSE;
-}
-
 /* ECOFF swapping routines.  These are used when dealing with the
    .mdebug section, which is in the ECOFF debugging format.  */
 static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
diff --git a/bfd/elf32-openrisc.c b/bfd/elf32-openrisc.c
index 5513ad6..af1c222 100644
--- a/bfd/elf32-openrisc.c
+++ b/bfd/elf32-openrisc.c
@@ -535,14 +535,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_OPENRISC_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_OPENRISC_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 	}
diff --git a/bfd/elf32-or32.c b/bfd/elf32-or32.c
index 65f8e26..1419520 100644
--- a/bfd/elf32-or32.c
+++ b/bfd/elf32-or32.c
@@ -1,5 +1,5 @@
 /* OR32-specific support for 32-bit ELF
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2004 Free Software Foundation, Inc.
    Contributed by Ivan Guzvinec  <ivang@opencores.org>
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -417,7 +417,7 @@
   relocation += symbol->section->output_offset;
   relocation += reloc_entry->addend;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Save the information, and let LO16 do the actual relocation.  */
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 5798eca..e53c47d 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -1679,11 +1679,7 @@
   if ((isec->flags & SEC_RELOC) == 0 || isec->reloc_count == 0)
     return TRUE;
 
-  /* If needed, initialize this section's cooked size.  */
-  if (isec->_cooked_size == 0)
-    isec->_cooked_size = isec->_raw_size;
-
-  trampoff = (isec->_cooked_size + 3) & (bfd_vma) -4;
+  trampoff = (isec->size + 3) & (bfd_vma) -4;
   /* Space for a branch around any trampolines.  */
   trampoff += 4;
 
@@ -1698,21 +1694,6 @@
   ppc_info = ppc_elf_hash_table (link_info);
   irelend = internal_relocs + isec->reloc_count;
 
-  /* Get the section contents.  */
-  /* Get cached copy if it exists.  */
-  if (elf_section_data (isec)->this_hdr.contents != NULL)
-    contents = elf_section_data (isec)->this_hdr.contents;
-  else
-    {
-      /* Go get them off disk.  */
-      contents = bfd_malloc (isec->_raw_size);
-      if (contents == NULL)
-	goto error_return;
-
-      if (!bfd_get_section_contents (abfd, isec, contents, 0, isec->_raw_size))
-	goto error_return;
-    }
-
   for (irel = internal_relocs; irel < irelend; irel++)
     {
       unsigned long r_type = ELF32_R_TYPE (irel->r_info);
@@ -1723,6 +1704,7 @@
       bfd_vma max_branch_offset, val;
       bfd_byte *hit_addr;
       unsigned long t0;
+      unsigned char sym_type;
 
       switch (r_type)
 	{
@@ -1770,6 +1752,7 @@
 	    tsec = bfd_section_from_elf_index (abfd, isym->st_shndx);
 
 	  toff = isym->st_value;
+	  sym_type = ELF_ST_TYPE (isym->st_info);
 	}
       else
 	{
@@ -1799,6 +1782,8 @@
 	    }
 	  else
 	    continue;
+
+	  sym_type = h->type;
 	}
 
       /* If the branch and target are in the same section, you have
@@ -1807,11 +1792,41 @@
       if (tsec == isec)
 	continue;
 
-      toff += irel->r_addend;
-      if (tsec->sec_info_type == ELF_INFO_TYPE_MERGE)
-	toff = _bfd_merged_section_offset (abfd, &tsec,
-					   elf_section_data (tsec)->sec_info,
-					   toff, 0);
+      /* There probably isn't any reason to handle symbols in
+	 SEC_MERGE sections;  SEC_MERGE doesn't seem a likely
+	 attribute for a code section, and we are only looking at
+	 branches.  However, implement it correctly here as a
+	 reference for other target relax_section functions.  */
+      if (0 && tsec->sec_info_type == ELF_INFO_TYPE_MERGE)
+	{
+	  /* At this stage in linking, no SEC_MERGE symbol has been
+	     adjusted, so all references to such symbols need to be
+	     passed through _bfd_merged_section_offset.  (Later, in
+	     relocate_section, all SEC_MERGE symbols *except* for
+	     section symbols have been adjusted.)
+
+	     gas may reduce relocations against symbols in SEC_MERGE
+	     sections to a relocation against the section symbol when
+	     the original addend was zero.  When the reloc is against
+	     a section symbol we should include the addend in the
+	     offset passed to _bfd_merged_section_offset, since the
+	     location of interest is the original symbol.  On the
+	     other hand, an access to "sym+addend" where "sym" is not
+	     a section symbol should not include the addend;  Such an
+	     access is presumed to be an offset from "sym";  The
+	     location of interest is just "sym".  */
+	  if (sym_type == STT_SECTION)
+	    toff += irel->r_addend;
+
+	  toff = _bfd_merged_section_offset (abfd, &tsec,
+					     elf_section_data (tsec)->sec_info,
+					     toff);
+
+	  if (sym_type != STT_SECTION)
+	    toff += irel->r_addend;
+	}
+      else
+	toff += irel->r_addend;
 
       symaddr = tsec->output_section->vma + tsec->output_offset + toff;
 
@@ -1877,6 +1892,20 @@
 	  irel->r_info = ELF32_R_INFO (0, R_PPC_NONE);
 	}
 
+      /* Get the section contents.  */
+      if (contents == NULL)
+	{
+	  /* Get cached copy if it exists.  */
+	  if (elf_section_data (isec)->this_hdr.contents != NULL)
+	    contents = elf_section_data (isec)->this_hdr.contents;
+	  else
+	    {
+	      /* Go get them off disk.  */
+	      if (!bfd_malloc_and_get_section (abfd, isec, &contents))
+		goto error_return;
+	    }
+	}
+
       /* Fix up the existing branch to hit the trampoline.  */
       hit_addr = contents + roff;
       switch (r_type)
@@ -1922,11 +1951,11 @@
       if (contents == NULL)
 	goto error_return;
 
-      isec->_cooked_size = (isec->_cooked_size + 3) & (bfd_vma) -4;
+      isec->size = (isec->size + 3) & (bfd_vma) -4;
       /* Branch around the trampolines.  */
-      val = trampoff - isec->_cooked_size + 0x48000000;
-      dest = contents + isec->_cooked_size;
-      isec->_cooked_size = trampoff;
+      val = trampoff - isec->size + 0x48000000;
+      dest = contents + isec->size;
+      isec->size = trampoff;
       bfd_put_32 (abfd, val, dest);
       dest += 4;
 
@@ -2135,7 +2164,7 @@
       return bfd_reloc_ok;
     }
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   if (bfd_is_com_section (symbol->section))
@@ -2392,12 +2421,12 @@
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (h->dynindx == -1)
 	{
-	  if (! _bfd_elf_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       if (lsect->rel_section)
-	lsect->rel_section->_raw_size += sizeof (Elf32_External_Rela);
+	lsect->rel_section->size += sizeof (Elf32_External_Rela);
     }
   else
     {
@@ -2433,7 +2462,7 @@
 	     output a R_<xxx>_RELATIVE reloc so that the
 	     dynamic linker can adjust this GOT entry.  */
 	  BFD_ASSERT (lsect->rel_section != NULL);
-	  lsect->rel_section->_raw_size += sizeof (Elf32_External_Rela);
+	  lsect->rel_section->size += sizeof (Elf32_External_Rela);
 	}
     }
 
@@ -2452,14 +2481,14 @@
   linker_section_ptr->written_address_p = FALSE;
   *ptr_linker_section_ptr = linker_section_ptr;
 
-  linker_section_ptr->offset = lsect->section->_raw_size;
-  lsect->section->_raw_size += 4;
+  linker_section_ptr->offset = lsect->section->size;
+  lsect->section->size += 4;
 
 #ifdef DEBUG
   fprintf (stderr,
 	   "Create pointer in linker section %s, offset = %ld, section size = %ld\n",
 	   lsect->name, (long) linker_section_ptr->offset,
-	   (long) lsect->section->_raw_size);
+	   (long) lsect->section->size);
 #endif
 
   return TRUE;
@@ -2593,7 +2622,7 @@
 {
   elf_linker_section_t *lsect;
   struct ppc_elf_link_hash_table *htab = ppc_elf_hash_table (info);
-  asection *s;
+  asection *s, *sym_sec;
   bfd_size_type amt;
   flagword flags;
   const char *name;
@@ -2642,13 +2671,15 @@
   lsect->sym_offset = sym_offset;
 
   /* See if the sections already exist.  */
-  s = bfd_get_section_by_name (htab->elf.dynobj, name);
+  sym_sec = s = bfd_get_section_by_name (htab->elf.dynobj, name);
   if (s == NULL || (s->flags & flags) != flags)
     {
       s = bfd_make_section_anyway (htab->elf.dynobj, name);
       if (s == NULL
 	  || !bfd_set_section_flags (htab->elf.dynobj, s, flags))
 	return NULL;
+      if (sym_sec == NULL)
+	sym_sec = s;
     }
   lsect->section = s;
 
@@ -2656,11 +2687,11 @@
       && !bfd_set_section_alignment (htab->elf.dynobj, s, 2))
     return NULL;
 
-  s->_raw_size = align_power (s->_raw_size, 2);
+  s->size = align_power (s->size, 2);
 
 #ifdef DEBUG
   fprintf (stderr, "Creating section %s, current size = %ld\n",
-	   name, (long) s->_raw_size);
+	   name, (long) s->size);
 #endif
 
   if (sym_name)
@@ -2676,7 +2707,7 @@
 
       if ((bh == NULL || bh->type == bfd_link_hash_undefined)
 	  && !(_bfd_generic_link_add_one_symbol
-	       (info, abfd, sym_name, BSF_GLOBAL, s, sym_offset, NULL,
+	       (info, abfd, sym_name, BSF_GLOBAL, sym_sec, sym_offset, NULL,
 		FALSE, get_elf_backend_data (abfd)->collect, &bh)))
 	return NULL;
       h = (struct elf_link_hash_entry *) bh;
@@ -2685,7 +2716,7 @@
       lsect->sym_hash = h;
 
       if (info->shared
-	  && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+	  && ! bfd_elf_link_record_dynamic_symbol (info, h))
 	return NULL;
     }
 
@@ -2720,11 +2751,11 @@
     ++ret;
 
   s = bfd_get_section_by_name (abfd, ".sbss2");
-  if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->_raw_size > 0)
+  if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->size > 0)
     ++ret;
 
   s = bfd_get_section_by_name (abfd, ".PPC.EMB.sbss0");
-  if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->_raw_size > 0)
+  if (s != NULL && (s->flags & SEC_LOAD) != 0 && s->size > 0)
     ++ret;
 
   return ret;
@@ -2964,7 +2995,7 @@
       else
 	srel = htab->relbss;
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf32_External_Rela);
+      srel->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -2975,8 +3006,7 @@
     power_of_two = 4;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s))
     {
       if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two))
@@ -2985,25 +3015,14 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
 
-/* This is the condition under which finish_dynamic_symbol will be
-   called from elflink.h.  If elflink.h doesn't call our
-   finish_dynamic_symbol routine, we'll need to do something about
-   initializing any .plt and .got entries in relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
-  ((DYN)								\
-   && ((SHARED)								\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Of those relocs that might be copied as dynamic relocs, this macro
    selects those that must be copied when linking a shared library,
    even when the symbol is local.  */
@@ -3042,7 +3061,7 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -3053,15 +3072,15 @@
 
 	  /* If this is the first .plt entry, make room for the special
 	     first entry.  */
-	  if (s->_raw_size == 0)
-	    s->_raw_size += PLT_INITIAL_ENTRY_SIZE;
+	  if (s->size == 0)
+	    s->size += PLT_INITIAL_ENTRY_SIZE;
 
 	  /* The PowerPC PLT is actually composed of two parts, the
 	     first part is 2 words (for a load and a jump), and then
 	     there is a remaining word available at the end.  */
 	  h->plt.offset = (PLT_INITIAL_ENTRY_SIZE
 			   + (PLT_SLOT_SIZE
-			      * ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE)
+			      * ((s->size - PLT_INITIAL_ENTRY_SIZE)
 				 / PLT_ENTRY_SIZE)));
 
 	  /* If this symbol is not defined in a regular file, and we
@@ -3078,13 +3097,13 @@
 
 	  /* Make room for this entry.  After the 8192nd entry, room
 	     for two entries is allocated.  */
-	  s->_raw_size += PLT_ENTRY_SIZE;
-	  if ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE
+	  s->size += PLT_ENTRY_SIZE;
+	  if ((s->size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE
 	      > PLT_NUM_SINGLE_ENTRIES)
-	    s->_raw_size += PLT_ENTRY_SIZE;
+	    s->size += PLT_ENTRY_SIZE;
 
 	  /* We also need to make an entry in the .rela.plt section.  */
-	  htab->relplt->_raw_size += sizeof (Elf32_External_Rela);
+	  htab->relplt->size += sizeof (Elf32_External_Rela);
 	}
       else
 	{
@@ -3105,7 +3124,7 @@
       if (eh->elf.dynindx == -1
 	  && (eh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (!bfd_elf32_link_record_dynamic_symbol (info, &eh->elf))
+	  if (!bfd_elf_link_record_dynamic_symbol (info, &eh->elf))
 	    return FALSE;
 	}
 
@@ -3116,20 +3135,20 @@
       else
 	{
 	  bfd_boolean dyn;
-	  eh->elf.got.offset = htab->got->_raw_size;
+	  eh->elf.got.offset = htab->got->size;
 	  if ((eh->tls_mask & TLS_TLS) != 0)
 	    {
 	      if ((eh->tls_mask & TLS_LD) != 0)
-		htab->got->_raw_size += 8;
+		htab->got->size += 8;
 	      if ((eh->tls_mask & TLS_GD) != 0)
-		htab->got->_raw_size += 8;
+		htab->got->size += 8;
 	      if ((eh->tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0)
-		htab->got->_raw_size += 4;
+		htab->got->size += 4;
 	      if ((eh->tls_mask & TLS_DTPREL) != 0)
-		htab->got->_raw_size += 4;
+		htab->got->size += 4;
 	    }
 	  else
-	    htab->got->_raw_size += 4;
+	    htab->got->size += 4;
 	  dyn = htab->elf.dynamic_sections_created;
 	  if ((info->shared
 	       || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf))
@@ -3137,12 +3156,12 @@
 		  || eh->elf.root.type != bfd_link_hash_undefweak))
 	    {
 	      /* All the entries we allocated need relocs.  */
-	      htab->relgot->_raw_size
-		+= ((htab->got->_raw_size - eh->elf.got.offset) / 4
+	      htab->relgot->size
+		+= ((htab->got->size - eh->elf.got.offset) / 4
 		    * sizeof (Elf32_External_Rela));
 	      /* Except LD only needs one.  */
 	      if ((eh->tls_mask & TLS_LD) != 0)
-		htab->relgot->_raw_size -= sizeof (Elf32_External_Rela);
+		htab->relgot->size -= sizeof (Elf32_External_Rela);
 	    }
 	}
     }
@@ -3195,7 +3214,7 @@
 	  && h->root.type == bfd_link_hash_undefweak
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
     }
@@ -3214,7 +3233,7 @@
 	  if (h->dynindx == -1
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	    {
-	      if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -3233,7 +3252,7 @@
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
       asection *sreloc = elf_section_data (p->sec)->sreloc;
-      sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela);
+      sreloc->size += p->count * sizeof (Elf32_External_Rela);
     }
 
   return TRUE;
@@ -3294,17 +3313,17 @@
 	{
 	  s = bfd_get_section_by_name (htab->elf.dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
 
   if (htab->tlsld_got.refcount > 0)
     {
-      htab->tlsld_got.offset = htab->got->_raw_size;
-      htab->got->_raw_size += 8;
+      htab->tlsld_got.offset = htab->got->size;
+      htab->got->size += 8;
       if (info->shared)
-	htab->relgot->_raw_size += sizeof (Elf32_External_Rela);
+	htab->relgot->size += sizeof (Elf32_External_Rela);
     }
   else
     htab->tlsld_got.offset = (bfd_vma) -1;
@@ -3342,7 +3361,7 @@
 		}
 	      else if (p->count != 0)
 		{
-		  elf_section_data (p->sec)->sreloc->_raw_size
+		  elf_section_data (p->sec)->sreloc->size
 		    += p->count * sizeof (Elf32_External_Rela);
 		  if ((p->sec->output_section->flags
 		       & (SEC_READONLY | SEC_ALLOC))
@@ -3371,30 +3390,30 @@
 		   htab->tlsld_got.offset.  */
 		if (htab->tlsld_got.offset == (bfd_vma) -1)
 		  {
-		    htab->tlsld_got.offset = s->_raw_size;
-		    s->_raw_size += 8;
+		    htab->tlsld_got.offset = s->size;
+		    s->size += 8;
 		    if (info->shared)
-		      srel->_raw_size += sizeof (Elf32_External_Rela);
+		      srel->size += sizeof (Elf32_External_Rela);
 		  }
 		*local_got = (bfd_vma) -1;
 	      }
 	    else
 	      {
-		*local_got = s->_raw_size;
+		*local_got = s->size;
 		if ((*lgot_masks & TLS_TLS) != 0)
 		  {
 		    if ((*lgot_masks & TLS_GD) != 0)
-		      s->_raw_size += 8;
+		      s->size += 8;
 		    if ((*lgot_masks & (TLS_TPREL | TLS_TPRELGD)) != 0)
-		      s->_raw_size += 4;
+		      s->size += 4;
 		    if ((*lgot_masks & TLS_DTPREL) != 0)
-		      s->_raw_size += 4;
+		      s->size += 4;
 		  }
 		else
-		  s->_raw_size += 4;
+		  s->size += 4;
 		if (info->shared)
-		  srel->_raw_size += ((s->_raw_size - *local_got) / 4
-				      * sizeof (Elf32_External_Rela));
+		  srel->size += ((s->size - *local_got) / 4
+				 * sizeof (Elf32_External_Rela));
 	      }
 	  }
 	else
@@ -3422,7 +3441,7 @@
 	}
       else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is mostly to handle .rela.bss and
@@ -3450,14 +3469,14 @@
 	  continue;
 	}
 
-      if (s->_raw_size == 0)
+      if (s->size == 0)
 	{
 	  _bfd_strip_section_from_output (info, s);
 	  continue;
 	}
 
       /* Allocate memory for the section contents.  */
-      s->contents = bfd_zalloc (htab->elf.dynobj, s->_raw_size);
+      s->contents = bfd_zalloc (htab->elf.dynobj, s->size);
       if (s->contents == NULL)
 	return FALSE;
     }
@@ -3470,7 +3489,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (TAG), (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (info->executable)
 	{
@@ -3478,7 +3497,7 @@
 	    return FALSE;
 	}
 
-      if (htab->plt != NULL && htab->plt->_raw_size != 0)
+      if (htab->plt != NULL && htab->plt->size != 0)
 	{
 	  if (!add_dynamic_entry (DT_PLTGOT, 0)
 	      || !add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -3806,14 +3825,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_PPC_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_PPC_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
@@ -4376,7 +4395,7 @@
 static bfd_boolean
 ppc_elf_add_symbol_hook (bfd *abfd,
 			 struct bfd_link_info *info,
-			 const Elf_Internal_Sym *sym,
+			 Elf_Internal_Sym *sym,
 			 const char **namep ATTRIBUTE_UNUSED,
 			 flagword *flagsp ATTRIBUTE_UNUSED,
 			 asection **secp,
@@ -4542,7 +4561,7 @@
       BFD_ASSERT (htab->plt != NULL && sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -4558,7 +4577,7 @@
 	      break;
 
 	    case DT_PLTRELSZ:
-	      dyn.d_un.d_val = htab->relplt->_raw_size;
+	      dyn.d_un.d_val = htab->relplt->size;
 	      break;
 
 	    case DT_JMPREL:
@@ -5800,7 +5819,7 @@
 ppc_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 {
   int offset;
-  unsigned int raw_size;
+  unsigned int size;
 
   switch (note->descsz)
     {
@@ -5816,14 +5835,14 @@
 
       /* pr_reg */
       offset = 72;
-      raw_size = 192;
+      size = 192;
 
       break;
     }
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
 static bfd_boolean
@@ -5969,7 +5988,7 @@
       if (asec)
 	{
 	  ++ num_input_sections;
-	  output_section_size += asec->_raw_size;
+	  output_section_size += asec->size;
 	}
     }
 
@@ -6001,7 +6020,7 @@
       if (asec == NULL)
 	continue;
 
-      length = asec->_raw_size;
+      length = asec->size;
       if (length < 24)
 	{
 	  error_message = _("corrupt or empty %s section in %s");
@@ -6102,7 +6121,7 @@
   if (apuinfo_list_length () == 0)
     return;
 
-  length = asec->_raw_size;
+  length = asec->size;
   if (length < 20)
     return;
 
@@ -6128,7 +6147,7 @@
       length += 4;
     }
 
-  if (length != asec->_raw_size)
+  if (length != asec->size)
     (*_bfd_error_handler) (_("failed to compute new APUinfo section."));
 
   if (! bfd_set_section_contents (abfd, asec, buffer, (file_ptr) 0, length))
@@ -6139,6 +6158,17 @@
   apuinfo_list_finish ();
 }
 
+/* Return address for Ith PLT stub in section PLT, for relocation REL
+   or (bfd_vma) -1 if it should not be included.  */
+
+static bfd_vma
+ppc_elf_plt_sym_val (bfd_vma i ATTRIBUTE_UNUSED,
+		     const asection *plt ATTRIBUTE_UNUSED,
+		     const arelent *rel)
+{
+  return rel->address;
+}
+
 /* Add extra PPC sections -- Note, for now, make .sbss2 and
    .PPC.EMB.sbss0 a normal section, and not a bss section so
    that the linker doesn't crater when trying to make more than
@@ -6216,5 +6246,6 @@
 #define elf_backend_final_write_processing	ppc_elf_final_write_processing
 #define elf_backend_write_section		ppc_elf_write_section
 #define elf_backend_special_sections		ppc_elf_special_sections
+#define elf_backend_plt_sym_val			ppc_elf_plt_sym_val
 
 #include "elf32-target.h"
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index bb88dff..3c54d56 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -411,7 +411,7 @@
   if (output_bfd != NULL)
     return bfd_reloc_continue;
   
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
   
   relocation = (symbol->value
@@ -1345,14 +1345,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_390_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_390_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
@@ -1687,7 +1687,7 @@
      runtime process image.  */
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
-      htab->srelbss->_raw_size += sizeof (Elf32_External_Rela);
+      htab->srelbss->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -1699,7 +1699,7 @@
 
   /* Apply the required alignment.  */
   s = htab->sdynbss;
-  s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s))
     {
       if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two))
@@ -1708,25 +1708,14 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
 
-/* This is the condition under which elf_s390_finish_dynamic_symbol
-   will be called from elflink.h.  If elflink.h doesn't call our
-   finish_dynamic_symbol routine, we'll need to do something about
-   initializing any .plt and .got entries in elf_s390_relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
-  ((DYN)								\
-   && ((SHARED)								\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Allocate space in .plt, .got and associated reloc sections for
    dynamic relocs.  */
 
@@ -1762,7 +1751,7 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -1773,10 +1762,10 @@
 
 	  /* If this is the first .plt entry, make room for the special
 	     first entry.  */
-	  if (s->_raw_size == 0)
-	    s->_raw_size += PLT_FIRST_ENTRY_SIZE;
+	  if (s->size == 0)
+	    s->size += PLT_FIRST_ENTRY_SIZE;
 
-	  h->plt.offset = s->_raw_size;
+	  h->plt.offset = s->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
@@ -1791,14 +1780,14 @@
 	    }
 
 	  /* Make room for this entry.  */
-	  s->_raw_size += PLT_ENTRY_SIZE;
+	  s->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.  */
-	  htab->sgotplt->_raw_size += GOT_ENTRY_SIZE;
+	  htab->sgotplt->size += GOT_ENTRY_SIZE;
 
 	  /* We also need to make an entry in the .rela.plt section.  */
-	  htab->srelplt->_raw_size += sizeof (Elf32_External_Rela);
+	  htab->srelplt->size += sizeof (Elf32_External_Rela);
 	}
       else
 	{
@@ -1828,8 +1817,8 @@
 	   to be stored somewhere. The immediate value in the instruction
 	   is not bit enough so the value is stored in the got.  */
 	{
-	  h->got.offset = htab->sgot->_raw_size;
-	  htab->sgot->_raw_size += GOT_ENTRY_SIZE;
+	  h->got.offset = htab->sgot->size;
+	  htab->sgot->size += GOT_ENTRY_SIZE;
 	}
       else
 	h->got.offset = (bfd_vma) -1;
@@ -1845,29 +1834,29 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       s = htab->sgot;
-      h->got.offset = s->_raw_size;
-      s->_raw_size += GOT_ENTRY_SIZE;
+      h->got.offset = s->size;
+      s->size += GOT_ENTRY_SIZE;
       /* R_390_TLS_GD32 needs 2 consecutive GOT slots.  */
       if (tls_type == GOT_TLS_GD)
-	s->_raw_size += GOT_ENTRY_SIZE;
+	s->size += GOT_ENTRY_SIZE;
       dyn = htab->elf.dynamic_sections_created;
       /* R_390_TLS_IE32 needs one dynamic relocation,
 	 R_390_TLS_GD32 needs one if local symbol and two if global.  */
       if ((tls_type == GOT_TLS_GD && h->dynindx == -1)
 	  || tls_type >= GOT_TLS_IE)
-	htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+	htab->srelgot->size += sizeof (Elf32_External_Rela);
       else if (tls_type == GOT_TLS_GD)
-	htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela);
+	htab->srelgot->size += 2 * sizeof (Elf32_External_Rela);
       else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 		|| h->root.type != bfd_link_hash_undefweak)
 	       && (info->shared
 		   || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
-	htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+	htab->srelgot->size += sizeof (Elf32_External_Rela);
     }
   else
     h->got.offset = (bfd_vma) -1;
@@ -1923,7 +1912,7 @@
 	  if (h->dynindx == -1
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	    {
-	      if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -1943,7 +1932,7 @@
     {
       asection *sreloc = elf_section_data (p->sec)->sreloc;
 
-      sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela);
+      sreloc->size += p->count * sizeof (Elf32_External_Rela);
     }
 
   return TRUE;
@@ -2006,7 +1995,7 @@
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  if (s == NULL)
 	    abort ();
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -2045,7 +2034,7 @@
 	      else if (p->count != 0)
 		{
 		  srela = elf_section_data (p->sec)->sreloc;
-		  srela->_raw_size += p->count * sizeof (Elf32_External_Rela);
+		  srela->size += p->count * sizeof (Elf32_External_Rela);
 		  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
 		    info->flags |= DF_TEXTREL;
 		}
@@ -2066,12 +2055,12 @@
 	{
 	  if (*local_got > 0)
 	    {
-	      *local_got = s->_raw_size;
-	      s->_raw_size += GOT_ENTRY_SIZE;
+	      *local_got = s->size;
+	      s->size += GOT_ENTRY_SIZE;
 	      if (*local_tls_type == GOT_TLS_GD)
-		s->_raw_size += GOT_ENTRY_SIZE;
+		s->size += GOT_ENTRY_SIZE;
 	      if (info->shared)
-		srela->_raw_size += sizeof (Elf32_External_Rela);
+		srela->size += sizeof (Elf32_External_Rela);
 	    }
 	  else
 	    *local_got = (bfd_vma) -1;
@@ -2082,9 +2071,9 @@
     {
       /* Allocate 2 got entries and 1 dynamic reloc for R_390_TLS_LDM32
 	 relocs.  */
-      htab->tls_ldm_got.offset = htab->sgot->_raw_size;
-      htab->sgot->_raw_size += 2 * GOT_ENTRY_SIZE;
-      htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+      htab->tls_ldm_got.offset = htab->sgot->size;
+      htab->sgot->size += 2 * GOT_ENTRY_SIZE;
+      htab->srelgot->size += sizeof (Elf32_External_Rela);
     }
   else
     htab->tls_ldm_got.offset = -1;
@@ -2110,7 +2099,7 @@
 	}
       else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
 	{
-	  if (s->_raw_size != 0)
+	  if (s->size != 0)
 	    relocs = TRUE;
 
 	  /* We use the reloc_count field as a counter if we need
@@ -2123,7 +2112,7 @@
 	  continue;
 	}
 
-      if (s->_raw_size == 0)
+      if (s->size == 0)
 	{
 	  /* If we don't need this section, strip it from the
 	     output file.  This is to handle .rela.bss and
@@ -2144,7 +2133,7 @@
 	 section's contents are written out.  This should not happen,
 	 but this way if it does, we get a R_390_NONE reloc instead
 	 of garbage.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
       if (s->contents == NULL)
 	return FALSE;
     }
@@ -2157,7 +2146,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (info->executable)
 	{
@@ -2165,7 +2154,7 @@
 	    return FALSE;
 	}
 
-      if (htab->splt->_raw_size != 0)
+      if (htab->splt->size != 0)
 	{
 	  if (!add_dynamic_entry (DT_PLTGOT, 0)
 	      || !add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -3341,7 +3330,7 @@
 	abort ();
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -3364,10 +3353,7 @@
 
 	    case DT_PLTRELSZ:
 	      s = htab->srelplt->output_section;
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size;
-	      else
-		dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      break;
 	    }
 
@@ -3375,7 +3361,7 @@
 	}
 
       /* Fill in the special first entry in the procedure linkage table.  */
-      if (htab->splt && htab->splt->_raw_size > 0)
+      if (htab->splt && htab->splt->size > 0)
 	{
 	  memset (htab->splt->contents, 0, PLT_FIRST_ENTRY_SIZE);
 	  if (info->shared)
@@ -3419,7 +3405,7 @@
   if (htab->sgotplt)
     {
       /* Fill in the first three entries in the global offset table.  */
-      if (htab->sgotplt->_raw_size > 0)
+      if (htab->sgotplt->size > 0)
 	{
 	  bfd_put_32 (output_bfd,
 		      (sdyn == NULL ? (bfd_vma) 0
@@ -3443,7 +3429,7 @@
      Elf_Internal_Note * note;
 {
   int offset;
-  unsigned int raw_size;
+  unsigned int size;
 
   switch (note->descsz)
     {
@@ -3459,15 +3445,26 @@
 
 	/* pr_reg */
 	offset = 72;
-	raw_size = 144;
+	size = 144;
 	break;
     }
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
+/* Return address for Ith PLT stub in section PLT, for relocation REL
+   or (bfd_vma) -1 if it should not be included.  */
+
+static bfd_vma
+elf_s390_plt_sym_val (bfd_vma i, const asection *plt,
+		      const arelent *rel ATTRIBUTE_UNUSED)
+{
+  return plt->vma + PLT_FIRST_ENTRY_SIZE + i * PLT_ENTRY_SIZE;
+}
+
+
 #define TARGET_BIG_SYM	bfd_elf32_s390_vec
 #define TARGET_BIG_NAME	"elf32-s390"
 #define ELF_ARCH	bfd_arch_s390
@@ -3502,6 +3499,7 @@
 #define elf_backend_size_dynamic_sections     elf_s390_size_dynamic_sections
 #define elf_backend_reloc_type_class	      elf_s390_reloc_type_class
 #define elf_backend_grok_prstatus	      elf_s390_grok_prstatus
+#define elf_backend_plt_sym_val		      elf_s390_plt_sym_val
 
 #define bfd_elf32_mkobject		elf_s390_mkobject
 #define elf_backend_object_p		elf_s390_object_p
diff --git a/bfd/elf32-sh-symbian.c b/bfd/elf32-sh-symbian.c
new file mode 100644
index 0000000..6c24339
--- /dev/null
+++ b/bfd/elf32-sh-symbian.c
@@ -0,0 +1,627 @@
+/* Renesas / SuperH specific support for Symbian 32-bit ELF files
+   Copyright 2004
+   Free Software Foundation, Inc.
+   Contributed by Red Hat
+
+   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.  */
+
+/* Stop elf32-sh.c from defining any target vectors.  */
+#define SH_TARGET_ALREADY_DEFINED
+#define sh_find_elf_flags           sh_symbian_find_elf_flags
+#define sh_elf_get_flags_from_mach  sh_symbian_elf_get_flags_from_mach 
+#include "elf32-sh.c"
+
+
+//#define DEBUG 1
+#define DEBUG 0
+
+#define DIRECTIVE_HEADER	"#<SYMEDIT>#\n"
+#define DIRECTIVE_IMPORT	"IMPORT "
+#define DIRECTIVE_EXPORT	"EXPORT "
+#define DIRECTIVE_AS		"AS "
+
+/* Macro to advance 's' until either it reaches 'e' or the
+   character pointed to by 's' is equal to 'c'.  If 'e' is
+   reached and DEBUG is enabled then the error message 'm'
+   is displayed.  */
+#define SKIP_UNTIL(s,e,c,m)					\
+  do								\
+    {								\
+      while (s < e && *s != c)					\
+	++ s;							\
+      if (s >= e)						\
+	{							\
+          if (DEBUG)						\
+	    fprintf (stderr, "Corrupt directive: %s\n", m);	\
+	  result = FALSE;					\
+	}							\
+    }								\
+  while (0);							\
+  if (!result)							\
+     break;
+
+/* Like SKIP_UNTIL except there are two terminator characters
+   c1 and c2.  */
+#define SKIP_UNTIL2(s,e,c1,c2,m)				\
+  do								\
+    {								\
+      while (s < e && *s != c1 && *s != c2)			\
+	++ s;							\
+      if (s >= e)						\
+	{							\
+          if (DEBUG)						\
+	    fprintf (stderr, "Corrupt directive: %s\n", m);	\
+	  result = FALSE;					\
+	}							\
+    }								\
+  while (0);							\
+  if (!result)							\
+     break;
+
+/* Macro to advance 's' until either it reaches 'e' or the
+   character pointed to by 's' is not equal to 'c'.  If 'e'
+   is reached and DEBUG is enabled then the error message
+   'm' is displayed.  */
+#define SKIP_WHILE(s,e,c,m)					\
+  do								\
+    {								\
+      while (s < e && *s == c)					\
+	++ s;							\
+      if (s >= e)						\
+	{							\
+          if (DEBUG)						\
+	    fprintf (stderr, "Corrupt directive: %s\n", m);	\
+	  result = FALSE;					\
+	}							\
+    }								\
+  while (0);							\
+  if (!result)							\
+     break;
+
+
+typedef struct symbol_rename
+{
+  struct symbol_rename *       next;
+  bfd_byte *                   current_name;
+  bfd_byte *                   new_name;
+  struct elf_link_hash_entry * current_hash;
+  unsigned long                new_symndx;
+}
+symbol_rename;
+
+static symbol_rename * rename_list = NULL;
+
+/* Accumulate a list of symbols to be renamed.  */
+
+static bfd_boolean
+sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd,
+		      bfd_byte * current_name, bfd_byte * new_name)
+{
+  struct elf_link_hash_entry * new_hash;
+  symbol_rename * node;
+
+  if (DEBUG)
+    fprintf (stderr, "IMPORT '%s' AS '%s'\n", current_name, new_name);
+
+  for (node = rename_list; node; node = node->next)
+    if (strcmp (node->current_name, current_name) == 0)
+      {
+	if (strcmp (node->new_name, new_name) == 0)
+	  /* Already added to rename list.  */
+	  return TRUE;
+
+	bfd_set_error (bfd_error_invalid_operation);
+	_bfd_error_handler (_("%s: IMPORT AS directive for %s conceals previous IMPORT AS"),
+			    bfd_archive_filename (abfd), current_name);
+	return FALSE;	    
+      }
+
+  if ((node = bfd_malloc (sizeof * node)) == NULL)
+    {
+      if (DEBUG)
+	fprintf (stderr, "IMPORT AS: No mem for new rename node\n");
+      return FALSE;
+    }
+
+  if ((node->current_name = bfd_malloc (strlen (current_name) + 1)) == NULL)
+    {
+      if (DEBUG)
+	fprintf (stderr, "IMPORT AS: No mem for current name field in rename node\n");
+      free (node);
+      return FALSE;
+    }
+  else
+    strcpy (node->current_name, current_name);
+  
+  if ((node->new_name = bfd_malloc (strlen (new_name) + 1)) == NULL)
+    {
+      if (DEBUG)
+	fprintf (stderr, "IMPORT AS: No mem for new name field in rename node\n");
+      free (node->current_name);
+      free (node);
+      return FALSE;
+    }
+  else
+    strcpy (node->new_name, new_name);
+
+  node->next = rename_list;
+  node->current_hash = NULL;
+  node->new_symndx = 0;
+  rename_list = node;
+
+  new_hash = elf_link_hash_lookup (elf_hash_table (info), node->new_name, TRUE, FALSE, TRUE);
+  bfd_elf_link_record_dynamic_symbol (info, new_hash);
+  if (new_hash->root.type == bfd_link_hash_new)
+    new_hash->root.type = bfd_link_hash_undefined;
+
+  return TRUE;
+}
+
+
+static bfd_boolean
+sh_symbian_import (bfd * abfd ATTRIBUTE_UNUSED, bfd_byte * name)
+{
+  if (DEBUG)
+    fprintf (stderr, "IMPORT '%s'\n", name);
+
+  /* XXX: Generate an import somehow ?  */
+
+  return TRUE;
+}
+
+static bfd_boolean
+sh_symbian_export (bfd * abfd ATTRIBUTE_UNUSED, bfd_byte * name)
+{
+  if (DEBUG)
+    fprintf (stderr, "EXPORT '%s'\n", name);
+
+  /* XXX: Generate an export somehow ?  */
+
+  return TRUE;
+}
+
+/* Process any magic embedded commands in the .directive. section.
+   Returns TRUE upon sucecss, but if it fails it sets bfd_error and
+   returns FALSE.  */
+
+static bfd_boolean
+sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd,
+				      asection * sec, bfd_byte * contents)
+{
+  bfd_byte *s;
+  bfd_byte *e;
+  bfd_boolean result = TRUE;
+  bfd_size_type sz = sec->rawsize ? sec->rawsize : sec->size;
+
+  for (s = contents, e = s + sz; s < e;)
+    {
+      bfd_byte * directive = s;
+
+      switch (*s)
+	{
+	  /* I want to use "case DIRECTIVE_HEADER [0]:" here but gcc won't let me :-(  */
+	case '#':
+	  if (strcmp (s, DIRECTIVE_HEADER))
+	    result = FALSE;
+	  else
+	    /* Just ignore the header.
+	       XXX: Strictly speaking we ought to check that the header
+	       is present and that it is the first thing in the file.  */
+	    s += strlen (DIRECTIVE_HEADER) + 1;
+	  break;
+
+	case 'I':
+	  if (strncmp (s, DIRECTIVE_IMPORT, strlen (DIRECTIVE_IMPORT)))
+	    result = FALSE;
+	  else
+	    {
+	      bfd_byte * new_name;
+	      bfd_byte * new_name_end;
+	      bfd_byte   name_end_char;
+
+	      /* Skip the IMPORT directive.  */
+	      s += strlen (DIRECTIVE_IMPORT);
+
+	      new_name = s;
+	      /* Find the end of the new name.  */
+	      while (s < e && *s != ' ' && *s != '\n')
+		++ s;
+	      if (s >= e)
+		{
+		  /* We have reached the end of the .directive section
+		     without encountering a string terminator.  This is
+		     allowed for IMPORT directives.  */
+		  new_name_end   = e - 1;
+		  name_end_char  = * new_name_end;
+		  * new_name_end = 0;
+		  result = sh_symbian_import (abfd, new_name);
+		  * new_name_end = name_end_char;
+		  break;
+		}
+
+	      /* Remember where the name ends.  */
+	      new_name_end = s;
+	      /* Skip any whitespace before the 'AS'.  */
+	      SKIP_WHILE (s, e, ' ', "IMPORT: Name just followed by spaces");
+	      /* Terminate the new name.  (Do this after skiping...)  */
+	      name_end_char = * new_name_end;
+	      * new_name_end = 0;
+
+	      /* Check to see if 'AS '... is present.  If se we have an IMPORT AS
+		 directive, otherwise we have an IMPORT directive.  */
+	      if (strncmp (s, DIRECTIVE_AS, strlen (DIRECTIVE_AS)))
+		{
+		  /* Skip the new-line at the end of the name.  */
+		  if (DEBUG && name_end_char != '\n')
+		    fprintf (stderr, "IMPORT: No newline at end of directive\n");
+		  else
+		    s ++;
+
+		  result = sh_symbian_import (abfd, new_name);
+
+		  /* Skip past the NUL character.  */
+		  if (* s ++ != 0)
+		    {
+		      if (DEBUG)
+			fprintf (stderr, "IMPORT: No NUL at end of directive\n");
+		    }
+		}
+	      else
+		{
+		  bfd_byte * current_name;
+		  bfd_byte * current_name_end;
+		  bfd_byte   current_name_end_char;
+
+		  /* Skip the 'AS '.  */
+		  s += strlen (DIRECTIVE_AS);
+		  /* Skip any white space after the 'AS '.  */
+		  SKIP_WHILE (s, e, ' ', "IMPORT AS: Nothing after AS");
+		  current_name = s;
+		  /* Find the end of the current name.  */
+		  SKIP_UNTIL2 (s, e, ' ', '\n', "IMPORT AS: No newline at the end of the current name");
+		  /* Skip (backwards) over spaces at the end of the current name.  */
+		  current_name_end = s;
+		  current_name_end_char = * current_name_end;
+
+		  SKIP_WHILE (s, e, ' ', "IMPORT AS: Current name just followed by spaces");
+		  /* Skip past the newline character.  */
+		  if (* s ++ != '\n')
+		    if (DEBUG)
+		      fprintf (stderr, "IMPORT AS: No newline at end of directive\n");
+
+		  /* Terminate the current name after having performed the skips.  */
+		  * current_name_end = 0;
+
+		  result = sh_symbian_import_as (info, abfd, current_name, new_name);
+
+		  /* The next character should be a NUL.  */
+		  if (* s != 0)
+		    {
+		      if (DEBUG)
+			fprintf (stderr, "IMPORT AS: Junk at end of directive\n");
+		      result = FALSE;
+		    }
+		  s ++;
+
+		  * current_name_end = current_name_end_char;
+		}
+
+	      /* Restore the characters we overwrote, since
+		 the .directive section will be emitted.  */
+	      * new_name_end = name_end_char;
+	    }
+	  break;
+
+	case 'E':
+	  if (strncmp (s, DIRECTIVE_EXPORT, strlen (DIRECTIVE_EXPORT)))
+	    result = FALSE;
+	  else
+	    {
+	      bfd_byte * name;
+	      bfd_byte * name_end;
+	      bfd_byte   name_end_char;
+
+	      /* Skip the directive.  */
+	      s += strlen (DIRECTIVE_EXPORT);
+	      name = s;
+	      /* Find the end of the name to be exported.  */
+	      SKIP_UNTIL (s, e, '\n', "EXPORT: no newline at end of directive");
+	      /* Skip (backwards) over spaces at end of exported name.  */
+	      for (name_end = s; name_end[-1] == ' '; name_end --)
+		;
+	      /* name_end now points at the first character after the
+		 end of the exported name, so we can termiante it  */
+	      name_end_char = * name_end;
+	      * name_end = 0;
+	      /* Skip passed the newline character.  */
+	      s ++;
+
+	      result = sh_symbian_export (abfd, name);
+
+	      /* The next character should be a NUL.  */
+	      if (* s != 0)
+		{
+		  if (DEBUG)
+		    fprintf (stderr, "EXPORT: Junk at end of directive\n");
+		  result = FALSE;
+		}
+	      s++;
+
+	      /* Restore the character we deleted.  */
+	      * name_end = name_end_char;
+	    }
+	  break;
+
+	default:
+	  result = FALSE;
+	  break;
+	}
+
+      if (! result)
+	{
+	  if (DEBUG)
+	    fprintf (stderr, "offset into .directive section: %d\n", directive - contents);
+	  
+	  bfd_set_error (bfd_error_invalid_operation);
+	  _bfd_error_handler (_("%s: Unrecognised .directive command: %s"),
+			      bfd_archive_filename (abfd), directive);
+	  break;
+	}
+    }
+
+  return result;
+}
+
+
+/* Scan a bfd for a .directive section, and if found process it.
+   Returns TRUE upon success, FALSE otherwise.  */
+bfd_boolean bfd_elf32_sh_symbian_process_directives (struct bfd_link_info *info, bfd * abfd);
+
+bfd_boolean
+bfd_elf32_sh_symbian_process_directives (struct bfd_link_info *info, bfd * abfd)
+{
+  bfd_boolean result = FALSE;
+  bfd_byte *  contents;
+  asection *  sec = bfd_get_section_by_name (abfd, ".directive");
+  bfd_size_type sz;
+
+  if (!sec)
+    return TRUE;
+
+  sz = sec->rawsize ? sec->rawsize : sec->size;
+  contents = bfd_malloc (sz);
+
+  if (!contents)
+    bfd_set_error (bfd_error_no_memory);
+  else 
+    {
+      if (bfd_get_section_contents (abfd, sec, contents, 0, sz))
+	result = sh_symbian_process_embedded_commands (info, abfd, sec, contents);
+      free (contents);
+    }
+
+  return result;
+}
+
+/* Intercept the normal sh_relocate_section() function
+   and magle the relocs to allow for symbol renaming.  */
+
+static bfd_boolean
+sh_symbian_relocate_section (bfd *                  output_bfd,
+			     struct bfd_link_info * info,
+			     bfd *                  input_bfd,
+			     asection *             input_section,
+			     bfd_byte *             contents,
+			     Elf_Internal_Rela *    relocs,
+			     Elf_Internal_Sym *     local_syms,
+			     asection **            local_sections)
+{
+  /* When performing a final link we implement the IMPORT AS directives.  */
+  if (!info->relocatable)
+    {
+      Elf_Internal_Rela *            rel;
+      Elf_Internal_Rela *            relend;
+      Elf_Internal_Shdr *            symtab_hdr;
+      struct elf_link_hash_entry **  sym_hashes;
+      struct elf_link_hash_entry **  sym_hashes_end;
+      struct elf_link_hash_table *   hash_table;
+      symbol_rename *                ptr;
+      bfd_size_type                  num_global_syms;
+      unsigned long		     num_local_syms;
+      
+      BFD_ASSERT (! elf_bad_symtab (input_bfd));
+ 
+      symtab_hdr       = & elf_tdata (input_bfd)->symtab_hdr;
+      hash_table       = elf_hash_table (info);
+      num_local_syms   = symtab_hdr->sh_info;
+      num_global_syms  = symtab_hdr->sh_size / sizeof (Elf32_External_Sym);
+      num_global_syms -= num_local_syms;
+      sym_hashes       = elf_sym_hashes (input_bfd);
+      sym_hashes_end   = sym_hashes + num_global_syms;
+
+      /* First scan the rename table, caching the hash entry and the new index.  */
+      for (ptr = rename_list; ptr; ptr = ptr->next)
+	{
+	  struct elf_link_hash_entry *   new_hash;
+	  struct elf_link_hash_entry **  h;
+
+	  ptr->current_hash = elf_link_hash_lookup (hash_table, ptr->current_name, FALSE, FALSE, TRUE);
+
+	  if (ptr->current_hash == NULL)
+	    {
+	      if (DEBUG)
+		fprintf (stderr, "IMPORT AS: current symbol '%s' does not exist\n", ptr->current_name);
+	      continue;
+	    }
+	  
+	  new_hash = elf_link_hash_lookup (hash_table, ptr->new_name, FALSE, FALSE, TRUE);
+
+	  /* If we could not find the symbol then it is a new, undefined symbol.
+	     Symbian want this behaviour - ie they want to be able to rename the
+	     reference in a reloc from one undefined symbol to another, new and
+	     undefined symbol.  So we create that symbol here.  */
+	  if (new_hash == NULL)
+	    {
+	      asection *                     psec = bfd_und_section_ptr;
+	      Elf_Internal_Sym               new_sym;
+	      bfd_vma                        new_value = 0;
+	      bfd_boolean                    skip;
+	      bfd_boolean                    override;
+	      bfd_boolean                    type_change_ok;
+	      bfd_boolean                    size_change_ok;
+
+	      new_sym.st_value = 0;
+	      new_sym.st_size  = 0;
+	      new_sym.st_name  = -1;
+	      new_sym.st_info  = ELF_ST_INFO (STB_GLOBAL, STT_FUNC);
+	      new_sym.st_other = ELF_ST_VISIBILITY (STV_DEFAULT);
+	      new_sym.st_shndx = SHN_UNDEF;
+
+	      if (! _bfd_elf_merge_symbol (input_bfd, info, ptr->new_name, & new_sym, & psec,
+					   & new_value, & new_hash, & skip, & override, & type_change_ok,
+					   & size_change_ok))
+		{
+		  _bfd_error_handler (_("%s: Failed to add renamed symbol %s"),
+				      bfd_archive_filename (input_bfd), ptr->new_name);
+		  continue;
+		}
+	      /* XXX - should we check psec, skip, override etc ?  */
+
+	      new_hash->root.type = bfd_link_hash_undefined;
+
+	      /* Allow the symbol to become local if necessary.  */
+	      if (new_hash->dynindx == -1)
+		new_hash->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+
+	      if (DEBUG)
+		fprintf (stderr, "Created new symbol %s\n", ptr->new_name);
+	    }
+
+	  /* Convert the new_hash value into a index into the table of symbol hashes.  */
+	  for (h = sym_hashes; h < sym_hashes_end; h ++)
+	    {
+	      if (* h == new_hash)
+		{
+		  ptr->new_symndx = h - sym_hashes + num_local_syms;
+		  if (DEBUG)
+		    fprintf (stderr, "Converted new hash to index of %ld\n", ptr->new_symndx);
+		  break;
+		}
+	    }
+	  /* If the new symbol is not in the hash table then it must be
+	     because it is one of the newly created undefined symbols
+	     manufactured above.  So we extend the sym has table here to
+	     include this extra symbol.  */
+	  if (h == sym_hashes_end)
+	    {
+	      struct elf_link_hash_entry **  new_sym_hashes;
+
+	      /* This is not very efficient, but it works.  */
+	      ++ num_global_syms;
+	      new_sym_hashes = bfd_alloc (input_bfd, num_global_syms * sizeof * sym_hashes);
+	      if (new_sym_hashes == NULL)
+		{
+		  if (DEBUG)
+		    fprintf (stderr, "Out of memory extending hash table\n");
+		  continue;
+		}
+	      memcpy (new_sym_hashes, sym_hashes, (num_global_syms - 1) * sizeof * sym_hashes);
+	      new_sym_hashes[num_global_syms - 1] = new_hash;
+	      elf_sym_hashes (input_bfd) = sym_hashes = new_sym_hashes;
+	      sym_hashes_end = sym_hashes + num_global_syms;
+	      symtab_hdr->sh_size  = (num_global_syms + num_local_syms) * sizeof (Elf32_External_Sym);
+
+	      ptr->new_symndx = num_global_syms - 1 + num_local_syms;
+
+	      if (DEBUG)
+		fprintf (stderr, "Extended symbol hash table to insert new symbol as index %ld\n",
+			 ptr->new_symndx);
+	    }
+	}
+
+      /* Walk the reloc list looking for references to renamed symbols.
+	 When we find one, we alter the index in the reloc to point to the new symbol.  */
+      for (rel = relocs, relend = relocs + input_section->reloc_count;
+	   rel < relend;
+	   rel ++)
+	{
+	  int                          r_type;
+	  unsigned long                r_symndx;
+	  struct elf_link_hash_entry * h;
+      
+	  r_symndx = ELF32_R_SYM (rel->r_info);
+	  r_type = ELF32_R_TYPE (rel->r_info);
+
+	  /* Ignore unused relocs.  */
+	  if ((r_type >= (int) R_SH_GNU_VTINHERIT
+	       && r_type <= (int) R_SH_LABEL)
+	      || r_type == (int) R_SH_NONE
+	      || r_type < 0
+	      || r_type >= R_SH_max)
+	    continue;
+
+	  /* Ignore relocs against local symbols.  */
+	  if (r_symndx < num_local_syms)
+	    continue;
+
+	  BFD_ASSERT (r_symndx < (num_global_syms + num_local_syms));
+	  h = sym_hashes[r_symndx - num_local_syms];
+	  BFD_ASSERT (h != NULL);
+
+	  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 the symbol is defined there is no need to rename it.
+	     XXX - is this true ?  */
+	  if (   h->root.type == bfd_link_hash_defined
+	      || h->root.type == bfd_link_hash_defweak
+	      || h->root.type == bfd_link_hash_undefweak)
+	    continue;
+
+	  for (ptr = rename_list; ptr; ptr = ptr->next)
+	    if (h == ptr->current_hash)
+	      {
+		BFD_ASSERT (ptr->new_symndx);
+		if (DEBUG)
+		  fprintf (stderr, "convert reloc %lx from using index %ld to using index %ld\n",
+			   (long) rel->r_info, (long) ELF32_R_SYM (rel->r_info), ptr->new_symndx);
+		rel->r_info = ELF32_R_INFO (ptr->new_symndx, r_type);
+		break;
+	      }
+	}
+    }
+  
+  return sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
+				  contents, relocs, local_syms, local_sections);
+}
+
+static bfd_boolean
+sh_symbian_check_directives (bfd *abfd, struct bfd_link_info *info)
+{
+  return bfd_elf32_sh_symbian_process_directives (info, abfd);
+}
+
+#define TARGET_LITTLE_SYM	bfd_elf32_shl_symbian_vec
+#define TARGET_LITTLE_NAME      "elf32-shl-symbian"
+
+#undef  elf_backend_relocate_section
+#define elf_backend_relocate_section	sh_symbian_relocate_section
+#undef  elf_backend_check_directives
+#define elf_backend_check_directives    sh_symbian_check_directives
+
+#include "elf32-target.h"
diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c
index 28a2fcc..e989bd5 100644
--- a/bfd/elf32-sh.c
+++ b/bfd/elf32-sh.c
@@ -25,6 +25,8 @@
 #include "libbfd.h"
 #include "elf-bfd.h"
 #include "elf/sh.h"
+#include "libiberty.h"
+#include "../opcodes/sh-opc.h"
 
 static bfd_reloc_status_type sh_elf_reloc
   (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **);
@@ -48,8 +50,10 @@
   (bfd *, asection *, bfd_vma, int);
 static bfd_boolean sh_elf_align_loads
   (bfd *, asection *, Elf_Internal_Rela *, bfd_byte *, bfd_boolean *);
+#ifndef SH64_ELF
 static bfd_boolean sh_elf_swap_insns
   (bfd *, asection *, void *, bfd_byte *, bfd_vma);
+#endif
 static bfd_boolean sh_elf_relocate_section
   (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
    Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
@@ -105,10 +109,12 @@
 #ifdef INCLUDE_SHMEDIA
 inline static void movi_shori_putval (bfd *, unsigned long, char *);
 #endif
+#if !defined SH_TARGET_ALREADY_DEFINED
 static bfd_boolean elf32_shlin_grok_prstatus
   (bfd *abfd, Elf_Internal_Note *note);
 static bfd_boolean elf32_shlin_grok_psinfo
   (bfd *abfd, Elf_Internal_Note *note);
+#endif
 
 /* The name of the dynamic interpreter.  This is put in the .interp
    section.  */
@@ -1845,7 +1851,7 @@
   int insn;
 
   /* Sanity check the address.  */
-  if (addr > input_section->_raw_size)
+  if (addr > bfd_get_section_limit (input_bfd, input_section))
     return bfd_reloc_outofrange;
 
   /* We require the start and end relocations to be processed consecutively -
@@ -1870,14 +1876,11 @@
 	contents = elf_section_data (symbol_section)->this_hdr.contents;
       else
 	{
-	  contents = (bfd_byte *) bfd_malloc (symbol_section->_raw_size);
-	  if (contents == NULL)
-	    return bfd_reloc_outofrange;
-	  if (! bfd_get_section_contents (input_bfd, symbol_section, contents,
-					  (file_ptr) 0,
-					  symbol_section->_raw_size))
+	  if (!bfd_malloc_and_get_section (input_bfd, symbol_section,
+					   &contents))
 	    {
-	      free (contents);
+	      if (contents != NULL)
+		free (contents);
 	      return bfd_reloc_outofrange;
 	    }
 	}
@@ -2196,11 +2199,6 @@
     }
 #endif
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
-
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
   internal_relocs = (_bfd_elf_link_read_relocs
@@ -2232,12 +2230,7 @@
 	    contents = elf_section_data (sec)->this_hdr.contents;
 	  else
 	    {
-	      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	      if (contents == NULL)
-		goto error_return;
-
-	      if (! bfd_get_section_contents (abfd, sec, contents,
-					      (file_ptr) 0, sec->_raw_size))
+	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		goto error_return;
 	    }
 	}
@@ -2247,7 +2240,7 @@
 	 computed as though it were a jump offset, which are based
 	 from 4 bytes after the jump instruction.  */
       laddr = irel->r_offset + 4 + irel->r_addend;
-      if (laddr >= sec->_raw_size)
+      if (laddr >= sec->size)
 	{
 	  (*_bfd_error_handler) (_("%s: 0x%lx: warning: bad R_SH_USES offset"),
 				 bfd_archive_filename (abfd),
@@ -2275,7 +2268,7 @@
       paddr = insn & 0xff;
       paddr *= 4;
       paddr += (laddr + 4) &~ (bfd_vma) 3;
-      if (paddr >= sec->_raw_size)
+      if (paddr >= sec->size)
 	{
 	  ((*_bfd_error_handler)
 	   (_("%s: 0x%lx: warning: bad R_SH_USES load offset"),
@@ -2489,12 +2482,7 @@
 	    contents = elf_section_data (sec)->this_hdr.contents;
 	  else
 	    {
-	      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-	      if (contents == NULL)
-		goto error_return;
-
-	      if (! bfd_get_section_contents (abfd, sec, contents,
-					      (file_ptr) 0, sec->_raw_size))
+	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		goto error_return;
 	    }
 	}
@@ -2586,7 +2574,7 @@
      power larger than the number of bytes we are deleting.  */
 
   irelalign = NULL;
-  toaddr = sec->_cooked_size;
+  toaddr = sec->size;
 
   irel = elf_section_data (sec)->relocs;
   irelend = irel + sec->reloc_count;
@@ -2606,7 +2594,7 @@
   memmove (contents + addr, contents + addr + count,
 	   (size_t) (toaddr - addr - count));
   if (irelalign == NULL)
-    sec->_cooked_size -= count;
+    sec->size -= count;
   else
     {
       int i;
@@ -2907,13 +2895,13 @@
 			 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;
+		      if (!bfd_malloc_and_get_section (abfd, o, &ocontents))
+			{
+			  if (ocontents != NULL)
+			    free (ocontents);
+			  return FALSE;
+			}
+
 		      elf_section_data (o)->this_hdr.contents = ocontents;
 		    }
 		}
@@ -2965,13 +2953,13 @@
 			 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;
+		      if (!bfd_malloc_and_get_section (abfd, o, &ocontents))
+			{
+			  if (ocontents != NULL)
+			    free (ocontents);
+			  return FALSE;
+			}
+
 		      elf_section_data (o)->this_hdr.contents = ocontents;
 		    }
 		}
@@ -3088,7 +3076,7 @@
       if (irel < irelend)
 	stop = irel->r_offset;
       else
-	stop = sec->_cooked_size;
+	stop = sec->size;
 
       if (! _bfd_sh_align_load_span (abfd, sec, contents, sh_elf_swap_insns,
 				     internal_relocs, &label,
@@ -3106,6 +3094,7 @@
   return FALSE;
 }
 
+#ifndef SH64_ELF
 /* Swap two SH instructions.  This is like sh_swap_insns in coff-sh.c.  */
 
 static bfd_boolean
@@ -3234,6 +3223,7 @@
 
   return TRUE;
 }
+#endif /* defined SH64_ELF */
 
 #ifdef INCLUDE_SHMEDIA
 
@@ -3924,7 +3914,7 @@
       h->type = STT_OBJECT;
 
       if (info->shared
-	  && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+	  && ! bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
     }
 
@@ -4139,7 +4129,7 @@
 
       srel = htab->srelbss;
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf32_External_Rela);
+      srel->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -4150,7 +4140,7 @@
     power_of_two = 3;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (htab->root.dynobj, s))
     {
       if (! bfd_set_section_alignment (htab->root.dynobj, s, power_of_two))
@@ -4159,25 +4149,14 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
 
-/* This is the condition under which sh_elf_finish_dynamic_symbol
-   will be called from elflink.h.  If elflink.h doesn't call our
-   finish_dynamic_symbol routine, we'll need to do something about
-   initializing any .plt and .got entries in sh_elf_relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
-  ((DYN)								\
-   && ((SHARED)								\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Allocate space in .plt, .got and associated reloc sections for
    dynamic relocs.  */
 
@@ -4223,7 +4202,7 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -4234,10 +4213,10 @@
 
 	  /* 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 (s->size == 0)
+	    s->size += PLT_ENTRY_SIZE;
 
-	  h->plt.offset = s->_raw_size;
+	  h->plt.offset = s->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
@@ -4252,14 +4231,14 @@
 	    }
 
 	  /* Make room for this entry.  */
-	  s->_raw_size += PLT_ENTRY_SIZE;
+	  s->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.  */
-	  htab->sgotplt->_raw_size += 4;
+	  htab->sgotplt->size += 4;
 
 	  /* We also need to make an entry in the .rel.plt section.  */
-	  htab->srelplt->_raw_size += sizeof (Elf32_External_Rela);
+	  htab->srelplt->size += sizeof (Elf32_External_Rela);
 	}
       else
 	{
@@ -4284,29 +4263,29 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       s = htab->sgot;
-      h->got.offset = s->_raw_size;
-      s->_raw_size += 4;
+      h->got.offset = s->size;
+      s->size += 4;
       /* R_SH_TLS_GD needs 2 consecutive GOT slots.  */
       if (tls_type == GOT_TLS_GD)
-	s->_raw_size += 4;
+	s->size += 4;
       dyn = htab->root.dynamic_sections_created;
       /* R_SH_TLS_IE_32 needs one dynamic relocation if dynamic,
 	 R_SH_TLS_GD needs one if local symbol and two if global.  */
       if ((tls_type == GOT_TLS_GD && h->dynindx == -1)
 	  || (tls_type == GOT_TLS_IE && dyn))
-	htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+	htab->srelgot->size += sizeof (Elf32_External_Rela);
       else if (tls_type == GOT_TLS_GD)
-	htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela);
+	htab->srelgot->size += 2 * sizeof (Elf32_External_Rela);
       else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 		|| h->root.type != bfd_link_hash_undefweak)
 	       && (info->shared
 		   || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
-	htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+	htab->srelgot->size += sizeof (Elf32_External_Rela);
     }
   else
     h->got.offset = (bfd_vma) -1;
@@ -4322,16 +4301,16 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       s = htab->sgot;
-      eh->datalabel_got.offset = s->_raw_size;
-      s->_raw_size += 4;
+      eh->datalabel_got.offset = s->size;
+      s->size += 4;
       dyn = htab->root.dynamic_sections_created;
       if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h))
-	htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+	htab->srelgot->size += sizeof (Elf32_External_Rela);
     }
   else
     eh->datalabel_got.offset = (bfd_vma) -1;
@@ -4387,7 +4366,7 @@
 	  if (h->dynindx == -1
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	    {
-	      if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -4406,7 +4385,7 @@
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
       asection *sreloc = elf_section_data (p->sec)->sreloc;
-      sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela);
+      sreloc->size += p->count * sizeof (Elf32_External_Rela);
     }
 
   return TRUE;
@@ -4464,7 +4443,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -4503,7 +4482,7 @@
 	      else if (p->count != 0)
 		{
 		  srel = elf_section_data (p->sec)->sreloc;
-		  srel->_raw_size += p->count * sizeof (Elf32_External_Rela);
+		  srel->size += p->count * sizeof (Elf32_External_Rela);
 		  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
 		    info->flags |= DF_TEXTREL;
 		}
@@ -4528,12 +4507,12 @@
 	{
 	  if (*local_got > 0)
 	    {
-	      *local_got = s->_raw_size;
-	      s->_raw_size += 4;
+	      *local_got = s->size;
+	      s->size += 4;
 	      if (*local_tls_type == GOT_TLS_GD)
-		s->_raw_size += 4;
+		s->size += 4;
 	      if (info->shared)
-		srel->_raw_size += sizeof (Elf32_External_Rela);
+		srel->size += sizeof (Elf32_External_Rela);
 	    }
 	  else
 	    *local_got = (bfd_vma) -1;
@@ -4545,9 +4524,9 @@
     {
       /* Allocate 2 got entries and 1 dynamic reloc for R_SH_TLS_LD_32
 	 relocs.  */
-      htab->tls_ldm_got.offset = htab->sgot->_raw_size;
-      htab->sgot->_raw_size += 8;
-      htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+      htab->tls_ldm_got.offset = htab->sgot->size;
+      htab->sgot->size += 8;
+      htab->srelgot->size += sizeof (Elf32_External_Rela);
     }
   else
     htab->tls_ldm_got.offset = -1;
@@ -4573,7 +4552,7 @@
 	}
       else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
 	{
-	  if (s->_raw_size != 0 && s != htab->srelplt)
+	  if (s->size != 0 && s != htab->srelplt)
 	    relocs = TRUE;
 
 	  /* We use the reloc_count field as a counter if we need
@@ -4586,7 +4565,7 @@
 	  continue;
 	}
 
-      if (s->_raw_size == 0)
+      if (s->size == 0)
 	{
 	  /* If we don't need this section, strip it from the
 	     output file.  This is mostly to handle .rela.bss and
@@ -4607,7 +4586,7 @@
 	 section's contents are written out.  This should not happen,
 	 but this way if it does, we get a R_SH_NONE reloc instead
 	 of garbage.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
       if (s->contents == NULL)
 	return FALSE;
     }
@@ -4620,7 +4599,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (info->executable)
 	{
@@ -4628,7 +4607,7 @@
 	    return FALSE;
 	}
 
-      if (htab->splt->_raw_size != 0)
+      if (htab->splt->size != 0)
 	{
 	  if (! add_dynamic_entry (DT_PLTGOT, 0)
 	      || ! add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -5935,7 +5914,7 @@
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
 
   memcpy (data, elf_section_data (input_section)->this_hdr.contents,
-	  (size_t) input_section->_raw_size);
+	  (size_t) input_section->size);
 
   if ((input_section->flags & SEC_RELOC) != 0
       && input_section->reloc_count > 0)
@@ -6490,14 +6469,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_SH_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_SH_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
@@ -6830,58 +6809,44 @@
 }
 
 #ifndef sh_elf_set_mach_from_flags
+static unsigned int sh_ef_bfd_table[] = { EF_SH_BFD_TABLE };
+
 static bfd_boolean
 sh_elf_set_mach_from_flags (bfd *abfd)
 {
-  flagword flags = elf_elfheader (abfd)->e_flags;
+  flagword flags = elf_elfheader (abfd)->e_flags & EF_SH_MACH_MASK;
 
-  switch (flags & EF_SH_MACH_MASK)
-    {
-    case EF_SH1:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh);
-      break;
-    case EF_SH2:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh2);
-      break;
-    case EF_SH2E:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh2e);
-      break;
-    case EF_SH_DSP:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh_dsp);
-      break;
-    case EF_SH3:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh3);
-      break;
-    case EF_SH3_DSP:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh3_dsp);
-      break;
-    case EF_SH3E:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh3e);
-      break;
-    case EF_SH_UNKNOWN:
-    case EF_SH4:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh4);
-      break;
-    case EF_SH4_NOFPU:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh4_nofpu);
-      break;
-    case EF_SH4A:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh4a);
-      break;
-    case EF_SH4A_NOFPU:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh4a_nofpu);
-      break;
-    case EF_SH4AL_DSP:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh4al_dsp);
-      break;
-    case EF_SH4_NOMMU_NOFPU:
-      bfd_default_set_arch_mach (abfd, bfd_arch_sh, bfd_mach_sh4_nommu_nofpu);
-      break;
-    default:
-      return FALSE;
-    }
+  if (flags >= sizeof(sh_ef_bfd_table))
+    return FALSE;
+
+  if (sh_ef_bfd_table[flags] == 0)
+    return FALSE;
+  
+  bfd_default_set_arch_mach (abfd, bfd_arch_sh, sh_ef_bfd_table[flags]);
+
   return TRUE;
 }
+
+
+/* Reverse table lookup for sh_ef_bfd_table[].
+   Given a bfd MACH value from archures.c
+   return the equivalent ELF flags from the table.
+   Return -1 if no match is found.  */
+
+int
+sh_elf_get_flags_from_mach (unsigned long mach)
+{
+  int i = ARRAY_SIZE (sh_ef_bfd_table);
+  
+  for (; i>0; i--)
+    if (sh_ef_bfd_table[i] == mach)
+      return i;
+  
+  /* shouldn't get here */
+  BFD_FAIL();
+
+  return -1;
+}
 #endif /* not sh_elf_set_mach_from_flags */
 
 #ifndef sh_elf_set_private_flags
@@ -6914,16 +6879,26 @@
 #endif /* not sh_elf_copy_private_data */
 
 #ifndef sh_elf_merge_private_data
-/* This routine checks for linking big and little endian objects
-   together, and for linking sh-dsp with sh3e / sh4 objects.  */
+
+/* This function returns the ELF architecture number that
+   corresponds to the given arch_sh* flags.  */
+
+int
+sh_find_elf_flags (unsigned int arch_set)
+{
+  extern unsigned long sh_get_bfd_mach_from_arch_set (unsigned int);
+  unsigned long bfd_mach = sh_get_bfd_mach_from_arch_set (arch_set);
+
+  return sh_elf_get_flags_from_mach (bfd_mach);
+}
+
+/* This routine initialises the elf flags when required and
+   calls sh_merge_bfd_arch() to check dsp/fpu compatibility.  */
 
 static bfd_boolean
 sh_elf_merge_private_data (bfd *ibfd, bfd *obfd)
 {
-  flagword old_flags, new_flags;
-
-  if (! _bfd_generic_verify_endian_match (ibfd, obfd))
-    return FALSE;
+  extern bfd_boolean sh_merge_bfd_arch (bfd *, bfd *);
 
   if (   bfd_get_flavour (ibfd) != bfd_target_elf_flavour
       || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
@@ -6934,23 +6909,16 @@
       /* This happens when ld starts out with a 'blank' output file.  */
       elf_flags_init (obfd) = TRUE;
       elf_elfheader (obfd)->e_flags = EF_SH1;
+      sh_elf_set_mach_from_flags (obfd);
     }
-  old_flags = elf_elfheader (obfd)->e_flags;
-  new_flags = elf_elfheader (ibfd)->e_flags;
-  if ((EF_SH_HAS_DSP (old_flags) && EF_SH_HAS_FP (new_flags))
-      || (EF_SH_HAS_DSP (new_flags) && EF_SH_HAS_FP (old_flags)))
-    {
-      (*_bfd_error_handler)
-	("%s: uses %s instructions while previous modules use %s instructions",
-	 bfd_archive_filename (ibfd),
-	 EF_SH_HAS_DSP (new_flags) ? "dsp" : "floating point",
-	 EF_SH_HAS_DSP (new_flags) ? "floating point" : "dsp");
-      bfd_set_error (bfd_error_bad_value);
-      return FALSE;
-    }
-  elf_elfheader (obfd)->e_flags = EF_SH_MERGE_MACH (old_flags, new_flags);
 
-  return sh_elf_set_mach_from_flags (obfd);
+  if (! sh_merge_bfd_arch (ibfd, obfd))
+    return FALSE;
+
+  elf_elfheader (obfd)->e_flags =
+    sh_elf_get_flags_from_mach (bfd_get_mach (obfd));
+  
+  return TRUE;
 }
 #endif /* not sh_elf_merge_private_data */
 
@@ -7266,7 +7234,7 @@
       BFD_ASSERT (sgot != NULL && sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -7320,10 +7288,7 @@
 	    case DT_PLTRELSZ:
 	      s = htab->srelplt->output_section;
 	      BFD_ASSERT (s != NULL);
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size;
-	      else
-		dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
@@ -7340,10 +7305,7 @@
 	      if (htab->srelplt != NULL)
 		{
 		  s = htab->srelplt->output_section;
-		  if (s->_cooked_size != 0)
-		    dyn.d_un.d_val -= s->_cooked_size;
-		  else
-		    dyn.d_un.d_val -= s->_raw_size;
+		  dyn.d_un.d_val -= s->size;
 		}
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
@@ -7352,7 +7314,7 @@
 
       /* Fill in the first entry in the procedure linkage table.  */
       splt = htab->splt;
-      if (splt && splt->_raw_size > 0)
+      if (splt && splt->size > 0)
 	{
 	  if (info->shared)
 	    {
@@ -7397,7 +7359,7 @@
     }
 
   /* Fill in the first three entries in the global offset table.  */
-  if (sgot && sgot->_raw_size > 0)
+  if (sgot && sgot->size > 0)
     {
       if (sdyn == NULL)
 	bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
@@ -7430,12 +7392,14 @@
     }
 }
 
+#if !defined SH_TARGET_ALREADY_DEFINED
 /* Support for Linux core dump NOTE sections.  */
+
 static bfd_boolean
 elf32_shlin_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 {
   int offset;
-  unsigned int raw_size;
+  unsigned int size;
 
   switch (note->descsz)
     {
@@ -7451,14 +7415,14 @@
 
 	/* pr_reg */
 	offset = 72;
-	raw_size = 92;
+	size = 92;
 
 	break;
     }
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
 static bfd_boolean
@@ -7490,11 +7454,26 @@
 
   return TRUE;
 }
+#endif /* not SH_TARGET_ALREADY_DEFINED */
 
+ 
+/* Return address for Ith PLT stub in section PLT, for relocation REL
+   or (bfd_vma) -1 if it should not be included.  */
+
+static bfd_vma
+sh_elf_plt_sym_val (bfd_vma i, const asection *plt,
+		    const arelent *rel ATTRIBUTE_UNUSED)
+{
+  return plt->vma + (i + 1) * PLT_ENTRY_SIZE;
+}
+
+#if !defined SH_TARGET_ALREADY_DEFINED
 #define TARGET_BIG_SYM		bfd_elf32_sh_vec
 #define TARGET_BIG_NAME		"elf32-sh"
 #define TARGET_LITTLE_SYM	bfd_elf32_shl_vec
 #define TARGET_LITTLE_NAME	"elf32-shl"
+#endif
+
 #define ELF_ARCH		bfd_arch_sh
 #define ELF_MACHINE_CODE	EM_SH
 #ifdef __QNXTARGET__
@@ -7538,6 +7517,7 @@
 #define elf_backend_finish_dynamic_sections \
 					sh_elf_finish_dynamic_sections
 #define elf_backend_reloc_type_class	sh_elf_reloc_type_class
+#define elf_backend_plt_sym_val		sh_elf_plt_sym_val
 
 #define elf_backend_can_gc_sections	1
 #define elf_backend_can_refcount	1
@@ -7546,7 +7526,7 @@
 #define elf_backend_want_plt_sym	0
 #define elf_backend_got_header_size	12
 
-#ifndef INCLUDE_SHMEDIA
+#if !defined INCLUDE_SHMEDIA && !defined SH_TARGET_ALREADY_DEFINED
 
 #include "elf32-target.h"
 
@@ -7588,4 +7568,4 @@
 
 #include "elf32-target.h"
 
-#endif /* INCLUDE_SHMEDIA */
+#endif /* neither INCLUDE_SHMEDIA nor SH_TARGET_ALREADY_DEFINED */
diff --git a/bfd/elf32-sh64-com.c b/bfd/elf32-sh64-com.c
index 4c219e8..98f47a9 100644
--- a/bfd/elf32-sh64-com.c
+++ b/bfd/elf32-sh64-com.c
@@ -1,5 +1,5 @@
 /* SuperH SH64-specific support for 32-bit ELF
-   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -99,7 +99,7 @@
 {
   bfd_byte *cranges_contents;
   bfd_byte *found_rangep;
-  bfd_size_type cranges_size = bfd_section_size (cranges->owner, cranges);
+  bfd_size_type cranges_size = cranges->size;
 
   /* If the size is not a multiple of the cranges entry size, then
      something is badly wrong.  */
@@ -117,15 +117,8 @@
     cranges_contents = cranges->contents;
   else
     {
-      cranges_contents
-	= bfd_malloc (cranges->_cooked_size != 0
-		      ? cranges->_cooked_size : cranges->_raw_size);
-      if (cranges_contents == NULL)
-	return FALSE;
-
-      if (! bfd_get_section_contents (cranges->owner, cranges,
-				      cranges_contents, (file_ptr) 0,
-				      cranges_size))
+      if (!bfd_malloc_and_get_section (cranges->owner, cranges,
+				       &cranges_contents))
 	goto error_return;
 
       /* Is it sorted?  */
@@ -182,7 +175,8 @@
   return FALSE;
 
 error_return:
-  free (cranges_contents);
+  if (cranges_contents != NULL)
+    free (cranges_contents);
   return FALSE;
 }
 
@@ -199,7 +193,7 @@
       && elf_elfheader (sec->owner)->e_type == ET_EXEC)
     {
       rangep->cr_addr = bfd_get_section_vma (sec->owner, sec);
-      rangep->cr_size = bfd_section_size (sec->owner, sec);
+      rangep->cr_size = sec->size;
       rangep->cr_type = CRT_NONE;
     }
   else
diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c
index eac444a..5883371 100644
--- a/bfd/elf32-sh64.c
+++ b/bfd/elf32-sh64.c
@@ -1,5 +1,5 @@
 /* SuperH SH64-specific support for 32-bit ELF
-   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -56,7 +56,7 @@
 static int sh64_elf_get_symbol_type
   (Elf_Internal_Sym *, int);
 static bfd_boolean sh64_elf_add_symbol_hook
-  (bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, const char **,
+  (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **,
    flagword *, asection **, bfd_vma *);
 static bfd_boolean sh64_elf_link_output_symbol_hook
   (struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *,
@@ -89,6 +89,7 @@
 #define elf_backend_final_write_processing 	sh64_elf_final_write_processing
 #define elf_backend_section_from_shdr		sh64_backend_section_from_shdr
 #define elf_backend_special_sections		sh64_elf_special_sections
+#define elf_backend_section_flags		sh64_elf_section_flags
 
 #define bfd_elf32_new_section_hook		sh64_elf_new_section_hook
 
@@ -105,6 +106,7 @@
 
 #define GOT_BIAS (-((long)-32768))
 #define INCLUDE_SHMEDIA
+#define SH_TARGET_ALREADY_DEFINED
 #include "elf32-sh.c"
 
 /* Tack some extra info on struct bfd_elf_section_data.  */
@@ -149,7 +151,6 @@
 sh64_elf_set_mach_from_flags (bfd *abfd)
 {
   flagword flags = elf_elfheader (abfd)->e_flags;
-  asection *cranges;
 
   switch (flags & EF_SH_MACH_MASK)
     {
@@ -164,18 +165,19 @@
       return FALSE;
     }
 
-  /* We also need to set SEC_DEBUGGING on an incoming .cranges section.
-     We could have used elf_backend_section_flags if it had given us the
-     section name; the bfd_section member in the header argument is not
-     set at the point of the call.  FIXME: Find out whether that is by
-     undocumented design or a bug.  */
-  cranges = bfd_get_section_by_name (abfd, SH64_CRANGES_SECTION_NAME);
-  if (cranges != NULL
-      && ! bfd_set_section_flags (abfd, cranges,
-				  bfd_get_section_flags (abfd, cranges)
-				  | SEC_DEBUGGING))
+  return TRUE;
+}
+
+static bfd_boolean
+sh64_elf_section_flags (flagword *flags,
+			const Elf_Internal_Shdr *hdr)
+{
+  if (hdr->bfd_section == NULL)
     return FALSE;
 
+  if (strcmp (hdr->bfd_section->name, SH64_CRANGES_SECTION_NAME) == 0)
+    *flags |= SEC_DEBUGGING;
+
   return TRUE;
 }
 
@@ -374,7 +376,7 @@
 
 static bfd_boolean
 sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
-			  const Elf_Internal_Sym *sym, const char **namep,
+			  Elf_Internal_Sym *sym, const char **namep,
 			  flagword *flagsp ATTRIBUTE_UNUSED,
 			  asection **secp, bfd_vma *valp)
 {
@@ -604,6 +606,7 @@
 {
   bfd_vma vma;
   bfd_size_type size;
+
   struct sh64_find_section_vma_data *fsec_datap
     = (struct sh64_find_section_vma_data *) data;
 
@@ -619,11 +622,7 @@
   if (fsec_datap->addr < vma)
     return;
 
-  /* FIXME: section->reloc_done isn't set properly; a generic buglet
-     preventing us from using bfd_get_section_size_after_reloc.  */
-  size
-    = section->_cooked_size ? section->_cooked_size : section->_raw_size;
-
+  size = section->size;
   if (fsec_datap->addr >= vma + size)
     return;
 
@@ -654,9 +653,7 @@
 	  = sh64_elf_section_data (cranges)->sh64_info->cranges_growth) != 0)
     {
       bfd_vma incoming_cranges_size
-	= ((cranges->_cooked_size != 0
-	    ? cranges->_cooked_size : cranges->_raw_size)
-	   - ld_generated_cranges_size);
+	= cranges->size - ld_generated_cranges_size;
 
       if (! bfd_set_section_contents (abfd, cranges,
 				      cranges->contents
@@ -699,9 +696,7 @@
       /* If we have a .cranges section, sort the entries.  */
       if (cranges != NULL)
 	{
-	  bfd_size_type cranges_size
-	    = (cranges->_cooked_size != 0
-	       ? cranges->_cooked_size : cranges->_raw_size);
+	  bfd_size_type cranges_size = cranges->size;
 
 	  /* We know we always have these in memory at this time.  */
 	  BFD_ASSERT (cranges->contents != NULL);
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index 0f8afe0..15868eb 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -387,7 +387,7 @@
   if (output_bfd != NULL)
     return bfd_reloc_continue;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   relocation = (symbol->value
@@ -441,7 +441,7 @@
   if (output_bfd != NULL)
     return bfd_reloc_continue;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   relocation = (symbol->value
@@ -487,7 +487,7 @@
   if (output_bfd != NULL)
     return bfd_reloc_continue;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   relocation = (symbol->value
@@ -1267,12 +1267,12 @@
 	  break;
 
 	case R_SPARC_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
 	    return FALSE;
 	  break;
 
 	case R_SPARC_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
@@ -1562,7 +1562,7 @@
      .rel.bss section we are going to use.  */
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
-      htab->srelbss->_raw_size += sizeof (Elf32_External_Rela);
+      htab->srelbss->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -1574,8 +1574,7 @@
 
   /* Apply the required alignment.  */
   s = htab->sdynbss;
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (! bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -1584,25 +1583,14 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
 
-/* This is the condition under which finish_dynamic_symbol will be called
-   from elflink.h.  If elflink.h doesn't call our finish_dynamic_symbol
-   routine, we'll need to do something about initializing any .plt and .got
-   entries in relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H)			\
-  ((DYN)								\
-   && ((INFO)->shared							\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Allocate space in .plt, .got and associated reloc sections for
    dynamic relocs.  */
 
@@ -1636,26 +1624,26 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
-      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
+      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h))
 	{
 	  asection *s = htab->splt;
 
 	  /* The first four entries in .plt are reserved.  */
-	  if (s->_raw_size == 0)
-	    s->_raw_size = 4 * PLT_ENTRY_SIZE;
+	  if (s->size == 0)
+	    s->size = 4 * PLT_ENTRY_SIZE;
 
 	  /* The procedure linkage table has a maximum size.  */
-	  if (s->_raw_size >= 0x400000)
+	  if (s->size >= 0x400000)
 	    {
 	      bfd_set_error (bfd_error_bad_value);
 	      return FALSE;
 	    }
 
-	  h->plt.offset = s->_raw_size;
+	  h->plt.offset = s->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
@@ -1670,10 +1658,10 @@
 	    }
 
 	  /* Make room for this entry.  */
-	  s->_raw_size += PLT_ENTRY_SIZE;
+	  s->size += PLT_ENTRY_SIZE;
 
 	  /* We also need to make an entry in the .rela.plt section.  */
-	  htab->srelplt->_raw_size += sizeof (Elf32_External_Rela);
+	  htab->srelplt->size += sizeof (Elf32_External_Rela);
 	}
       else
 	{
@@ -1705,27 +1693,27 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       s = htab->sgot;
-      h->got.offset = s->_raw_size;
-      s->_raw_size += 4;
+      h->got.offset = s->size;
+      s->size += 4;
       /* R_SPARC_TLS_GD_HI{22,LO10} needs 2 consecutive GOT slots.  */
       if (tls_type == GOT_TLS_GD)
-	s->_raw_size += 4;
+	s->size += 4;
       dyn = htab->elf.dynamic_sections_created;
       /* R_SPARC_TLS_IE_{HI22,LO10} needs one dynamic relocation,
 	 R_SPARC_TLS_GD_{HI22,LO10} needs one if local symbol and two if
 	 global.  */
       if ((tls_type == GOT_TLS_GD && h->dynindx == -1)
 	  || tls_type == GOT_TLS_IE)
-	htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+	htab->srelgot->size += sizeof (Elf32_External_Rela);
       else if (tls_type == GOT_TLS_GD)
-	htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela);
-      else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
-	htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+	htab->srelgot->size += 2 * sizeof (Elf32_External_Rela);
+      else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h))
+	htab->srelgot->size += sizeof (Elf32_External_Rela);
     }
   else
     h->got.offset = (bfd_vma) -1;
@@ -1777,7 +1765,7 @@
 	  if (h->dynindx == -1
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	    {
-	      if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -1796,7 +1784,7 @@
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
       asection *sreloc = elf_section_data (p->sec)->sreloc;
-      sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela);
+      sreloc->size += p->count * sizeof (Elf32_External_Rela);
     }
 
   return TRUE;
@@ -1856,7 +1844,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -1895,7 +1883,7 @@
 	      else if (p->count != 0)
 		{
 		  srel = elf_section_data (p->sec)->sreloc;
-		  srel->_raw_size += p->count * sizeof (Elf32_External_Rela);
+		  srel->size += p->count * sizeof (Elf32_External_Rela);
 		  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
 		    info->flags |= DF_TEXTREL;
 		}
@@ -1916,14 +1904,14 @@
 	{
 	  if (*local_got > 0)
 	    {
-	      *local_got = s->_raw_size;
-	      s->_raw_size += 4;
+	      *local_got = s->size;
+	      s->size += 4;
 	      if (*local_tls_type == GOT_TLS_GD)
-		s->_raw_size += 4;
+		s->size += 4;
 	      if (info->shared
 		  || *local_tls_type == GOT_TLS_GD
 		  || *local_tls_type == GOT_TLS_IE)
-		srel->_raw_size += sizeof (Elf32_External_Rela);
+		srel->size += sizeof (Elf32_External_Rela);
 	    }
 	  else
 	    *local_got = (bfd_vma) -1;
@@ -1934,9 +1922,9 @@
     {
       /* Allocate 2 got entries and 1 dynamic reloc for
 	 R_SPARC_TLS_LDM_{HI22,LO10} relocs.  */
-      htab->tls_ldm_got.offset = htab->sgot->_raw_size;
-      htab->sgot->_raw_size += 8;
-      htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+      htab->tls_ldm_got.offset = htab->sgot->size;
+      htab->sgot->size += 8;
+      htab->srelgot->size += sizeof (Elf32_External_Rela);
     }
   else
     htab->tls_ldm_got.offset = -1;
@@ -1948,13 +1936,13 @@
   if (elf_hash_table (info)->dynamic_sections_created)
     {
       /* Make space for the trailing nop in .plt.  */
-      if (htab->splt->_raw_size > 0)
-	htab->splt->_raw_size += 4;
+      if (htab->splt->size > 0)
+	htab->splt->size += 4;
 
       /* If the .got section is more than 0x1000 bytes, we add
 	 0x1000 to the value of _GLOBAL_OFFSET_TABLE_, so that 13
 	 bit relocations have a greater chance of working.  */
-      if (htab->sgot->_raw_size >= 0x1000
+      if (htab->sgot->size >= 0x1000
 	  && elf_hash_table (info)->hgot->root.u.def.value == 0)
 	elf_hash_table (info)->hgot->root.u.def.value = 0x1000;
     }
@@ -1976,7 +1964,7 @@
 
       if (strncmp (name, ".rela", 5) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is to handle .rela.bss and
@@ -2014,8 +2002,8 @@
 	 are written out, but at the moment this does not happen.  Thus in
 	 order to prevent writing out garbage, we initialise the section's
 	 contents to zero.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
     }
 
@@ -2027,7 +2015,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (info->executable)
 	{
@@ -2035,7 +2023,7 @@
 	    return FALSE;
 	}
 
-      if (htab->srelplt->_raw_size != 0)
+      if (htab->srelplt->size != 0)
 	{
 	  if (!add_dynamic_entry (DT_PLTGOT, 0)
 	      || !add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -2239,7 +2227,7 @@
 	      BFD_ASSERT (off != (bfd_vma) -1);
 	      dyn = elf_hash_table (info)->dynamic_sections_created;
 
-	      if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
+	      if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
 		  || (info->shared
 		      && (info->symbolic
 			  || h->dynindx == -1
@@ -2334,7 +2322,7 @@
 	  if (h == NULL)
 	    break;
 
-	  if (h->plt.offset == (bfd_vma) -1)
+	  if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL)
 	    {
 	      /* We didn't make a PLT entry for this symbol.  This
 		 happens when statically linking PIC code, or when
@@ -2342,9 +2330,6 @@
 	      break;
 	    }
 
-	  if (htab->splt == NULL)
-	    abort ();
-
 	  relocation = (htab->splt->output_section->vma
 			+ htab->splt->output_offset
 			+ h->plt.offset);
@@ -2388,6 +2373,9 @@
 	    break;
 
 	  if ((info->shared
+	       && (h == NULL
+		   || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+		   || h->root.type != bfd_link_hash_undefweak)
 	       && (! howto->pc_relative
 		   || (h != NULL
 		       && h->dynindx != -1
@@ -2932,7 +2920,7 @@
 	}
       else if ((r_type == R_SPARC_WDISP30 || r_type == R_SPARC_WPLT30)
 	       && sec_do_relax (input_section)
-	       && rel->r_offset + 4 < input_section->_raw_size)
+	       && rel->r_offset + 4 < input_section->size)
 	{
 #define G0		0
 #define O7		15
@@ -3234,7 +3222,7 @@
       BFD_ASSERT (splt != NULL && sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -3263,12 +3251,7 @@
 		  if (! size)
 		    dyn.d_un.d_ptr = s->vma;
 		  else
-		    {
-		      if (s->_cooked_size != 0)
-			dyn.d_un.d_val = s->_cooked_size;
-		      else
-			dyn.d_un.d_val = s->_raw_size;
-		    }
+		    dyn.d_un.d_val = s->size;
 		}
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	    }
@@ -3276,11 +3259,11 @@
 
       /* Clear the first four entries in the procedure linkage table,
 	 and put a nop in the last four bytes.  */
-      if (splt->_raw_size > 0)
+      if (splt->size > 0)
 	{
 	  memset (splt->contents, 0, 4 * PLT_ENTRY_SIZE);
 	  bfd_put_32 (output_bfd, (bfd_vma) SPARC_NOP,
-		      splt->contents + splt->_raw_size - 4);
+		      splt->contents + splt->size - 4);
 	}
 
       elf_section_data (splt->output_section)->this_hdr.sh_entsize = 0;
@@ -3288,7 +3271,7 @@
 
   /* Set the first entry in the global offset table to the address of
      the dynamic section.  */
-  if (htab->sgot && htab->sgot->_raw_size > 0)
+  if (htab->sgot && htab->sgot->size > 0)
     {
       if (sdyn == NULL)
 	bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgot->contents);
@@ -3443,6 +3426,17 @@
       return reloc_class_normal;
     }
 }
+
+/* Return address for Ith PLT stub in section PLT, for relocation REL
+   or (bfd_vma) -1 if it should not be included.  */
+
+static bfd_vma
+elf32_sparc_plt_sym_val (bfd_vma i ATTRIBUTE_UNUSED,
+			 const asection *plt ATTRIBUTE_UNUSED,
+			 const arelent *rel)
+{
+  return rel->address;
+}
 
 #define TARGET_BIG_SYM	bfd_elf32_sparc_vec
 #define TARGET_BIG_NAME	"elf32-sparc"
@@ -3481,6 +3475,7 @@
 #define elf_backend_gc_sweep_hook       elf32_sparc_gc_sweep_hook
 #define elf_backend_grok_psinfo		elf32_sparc_grok_psinfo
 #define elf_backend_reloc_type_class	elf32_sparc_reloc_type_class
+#define elf_backend_plt_sym_val		elf32_sparc_plt_sym_val
 
 #define elf_backend_can_gc_sections 1
 #define elf_backend_can_refcount 1
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 7470952..d52c303 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -73,7 +73,7 @@
 static void v850_elf_symbol_processing
   PARAMS ((bfd *, asymbol *));
 static bfd_boolean v850_elf_add_symbol_hook
-  PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+  PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
 	   const char **, flagword *, asection **, bfd_vma *));
 static bfd_boolean v850_elf_link_output_symbol_hook
   PARAMS ((struct bfd_link_info *, const char *, Elf_Internal_Sym *,
@@ -699,14 +699,14 @@
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_V850_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_V850_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
 
@@ -1359,7 +1359,7 @@
   /* We handle final linking of some relocs ourselves.  */
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc->address > isection->_cooked_size)
+  if (reloc->address > bfd_get_section_limit (abfd, isection))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
@@ -2124,7 +2124,7 @@
 v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd *abfd;
      struct bfd_link_info *info ATTRIBUTE_UNUSED;
-     const Elf_Internal_Sym *sym;
+     Elf_Internal_Sym *sym;
      const char **namep ATTRIBUTE_UNUSED;
      flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
@@ -2515,11 +2515,6 @@
       || sec->reloc_count == 0)
     return TRUE;
 
-  /* If this is the first time we have been called
-     for this section, initialize the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
-
   symtab_hdr = & elf_tdata (abfd)->symtab_hdr;
 
   internal_relocs = (_bfd_elf_link_read_relocs
@@ -2530,9 +2525,9 @@
 
   irelend = internal_relocs + sec->reloc_count;
 
-  while (addr < sec->_cooked_size)
+  while (addr < sec->size)
     {
-      toaddr = sec->_cooked_size;
+      toaddr = sec->size;
 
       for (irel = internal_relocs; irel < irelend; irel ++)
 	if (ELF32_R_TYPE (irel->r_info) == (int) R_V850_ALIGN
@@ -2606,12 +2601,7 @@
 		contents = elf_section_data (sec)->this_hdr.contents;
 	      else
 		{
-		  contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-		  if (contents == NULL)
-		    goto error_return;
-
-		  if (! bfd_get_section_contents (abfd, sec, contents,
-						  (file_ptr) 0, sec->_raw_size))
+		  if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		    goto error_return;
 		}
 	    }
@@ -2633,7 +2623,7 @@
 	  if (ELF32_R_TYPE (irel->r_info) == (int) R_V850_LONGCALL)
 	    {
 	      /* Check code for -mlong-calls output. */
-	      if (laddr + 16 <= (bfd_vma) sec->_raw_size)
+	      if (laddr + 16 <= (bfd_vma) sec->size)
 		{
 		  insn[0] = bfd_get_16 (abfd, contents + laddr);
 		  insn[1] = bfd_get_16 (abfd, contents + laddr + 4);
@@ -2862,7 +2852,7 @@
 	  else if (ELF32_R_TYPE (irel->r_info) == (int) R_V850_LONGJUMP)
 	    {
 	      /* Check code for -mlong-jumps output.  */
-	      if (laddr + 10 <= (bfd_vma) sec->_raw_size)
+	      if (laddr + 10 <= (bfd_vma) sec->size)
 		{
 		  insn[0] = bfd_get_16 (abfd, contents + laddr);
 		  insn[1] = bfd_get_16 (abfd, contents + laddr + 4);
@@ -3104,10 +3094,10 @@
 #ifdef DEBUG_RELAX
       fprintf (stderr, "relax pad %d shorten %d -> %d\n",
 	       align_pad_size,
-	       sec->_cooked_size,
-	       sec->_cooked_size - align_pad_size);
+	       sec->size,
+	       sec->size - align_pad_size);
 #endif
-      sec->_cooked_size -= align_pad_size;
+      sec->size -= align_pad_size;
     }
 
  finish:
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index d2d5905..a0249b1 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -777,7 +777,7 @@
 		    info->flags |= DF_TEXTREL;
 		}
 
-	      sreloc->_raw_size += sizeof (Elf32_External_Rela);
+	      sreloc->size += sizeof (Elf32_External_Rela);
 
 	      /* If we are linking with -Bsymbolic, we count the number of
 		 PC relative relocations we have entered for this symbol,
@@ -821,14 +821,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_VAX_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_VAX_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
@@ -1006,7 +1006,7 @@
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (h->dynindx == -1)
 	{
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -1015,9 +1015,9 @@
 
       /* If this is the first .plt entry, make room for the special
 	 first entry.  */
-      if (s->_raw_size == 0)
+      if (s->size == 0)
 	{
-	  s->_raw_size += PLT_ENTRY_SIZE;
+	  s->size += PLT_ENTRY_SIZE;
 	}
 
       /* If this symbol is not defined in a regular file, and we are
@@ -1029,26 +1029,26 @@
 	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
 	{
 	  h->root.u.def.section = s;
-	  h->root.u.def.value = s->_raw_size;
+	  h->root.u.def.value = s->size;
 	}
 
-      h->plt.offset = s->_raw_size;
+      h->plt.offset = s->size;
 
       /* Make room for this entry.  */
-      s->_raw_size += PLT_ENTRY_SIZE;
+      s->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.  */
 
       s = bfd_get_section_by_name (dynobj, ".got.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += 4;
+      s->size += 4;
 
       /* We also need to make an entry in the .rela.plt section.  */
 
       s = bfd_get_section_by_name (dynobj, ".rela.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += sizeof (Elf32_External_Rela);
+      s->size += sizeof (Elf32_External_Rela);
 
       return TRUE;
     }
@@ -1102,7 +1102,7 @@
 
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf32_External_Rela);
+      srel->size += sizeof (Elf32_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -1113,8 +1113,7 @@
     power_of_two = 3;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (!bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -1123,10 +1122,10 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
@@ -1154,7 +1153,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -1167,13 +1166,13 @@
 	 file below.  */
       s = bfd_get_section_by_name (dynobj, ".rela.got");
       if (s != NULL)
-	s->_raw_size = 0;
+	s->size = 0;
       s = bfd_get_section_by_name (dynobj, ".got.plt");
       if (s != NULL)
-	s->_raw_size = 0;
+	s->size = 0;
       s = bfd_get_section_by_name (dynobj, ".got");
       if (s != NULL)
-	s->_raw_size = 0;
+	s->size = 0;
     }
 
   /* If this is a -Bsymbolic shared link, then we need to discard all PC
@@ -1214,7 +1213,7 @@
 
       if (strcmp (name, ".plt") == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* Strip this section if we don't need it; see the
                  comment below.  */
@@ -1228,7 +1227,7 @@
 	}
       else if (strncmp (name, ".rela", 5) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is mostly to handle .rela.bss and
@@ -1284,8 +1283,8 @@
 	}
 
       /* Allocate memory for the section contents.  */
-      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
     }
 
@@ -1297,7 +1296,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (!info->shared)
 	{
@@ -1354,7 +1353,7 @@
     return TRUE;
 
   for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
-    s->section->_raw_size -= s->count * sizeof (Elf32_External_Rela);
+    s->section->size -= s->count * sizeof (Elf32_External_Rela);
 
   return TRUE;
 }
@@ -1400,13 +1399,13 @@
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (h->dynindx == -1)
 	{
-	  if (!bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (!bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       /* Allocate space in the .got and .rela.got sections.  */
-      sgot->_raw_size += 4;
-      srelgot->_raw_size += sizeof (Elf32_External_Rela);
+      sgot->size += 4;
+      srelgot->size += sizeof (Elf32_External_Rela);
     }
 
   return TRUE;
@@ -1555,7 +1554,7 @@
 	    BFD_ASSERT (h != NULL);
 	    off = h->got.offset;
 	    BFD_ASSERT (off != (bfd_vma) -1);
-	    BFD_ASSERT (off < sgot->_raw_size);
+	    BFD_ASSERT (off < sgot->size);
 
 	    if (info->shared
 		&& h->dynindx == -1
@@ -2030,7 +2029,7 @@
       BFD_ASSERT (splt != NULL && sdyn != NULL);
 
       dyncon = (Elf32_External_Dyn *) sdyn->contents;
-      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -2059,10 +2058,7 @@
 	    case DT_PLTRELSZ:
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      BFD_ASSERT (s != NULL);
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size;
-	      else
-		dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
@@ -2076,19 +2072,14 @@
 		 about changing the DT_RELA entry.  */
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      if (s != NULL)
-		{
-		  if (s->_cooked_size != 0)
-		    dyn.d_un.d_val -= s->_cooked_size;
-		  else
-		    dyn.d_un.d_val -= s->_raw_size;
-		}
+		dyn.d_un.d_val -= s->size;
 	      bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 	    }
 	}
 
       /* Fill in the first entry in the procedure linkage table.  */
-      if (splt->_raw_size > 0)
+      if (splt->size > 0)
 	{
 	  memcpy (splt->contents, elf_vax_plt0_entry, PLT_ENTRY_SIZE);
 	  bfd_put_32 (output_bfd,
@@ -2107,7 +2098,7 @@
     }
 
   /* Fill in the first three entries in the global offset table.  */
-  if (sgot->_raw_size > 0)
+  if (sgot->size > 0)
     {
       if (sdyn == NULL)
 	bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
@@ -2133,7 +2124,7 @@
 					_bfd_elf_create_dynamic_sections
 #define bfd_elf32_bfd_link_hash_table_create \
 					elf_vax_link_hash_table_create
-#define bfd_elf32_bfd_final_link	_bfd_elf32_gc_common_final_link
+#define bfd_elf32_bfd_final_link	bfd_elf_gc_common_final_link
 
 #define elf_backend_check_relocs	elf_vax_check_relocs
 #define elf_backend_adjust_dynamic_symbol \
diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c
index 985a43a..e03cc77 100644
--- a/bfd/elf32-xstormy16.c
+++ b/bfd/elf32-xstormy16.c
@@ -379,7 +379,7 @@
       return bfd_reloc_ok;
     }
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   if (bfd_is_com_section (symbol->section))
@@ -508,22 +508,22 @@
 
 	  if (*offset == (bfd_vma) -1)
 	    {
-	      *offset = splt->_raw_size;
-	      splt->_raw_size += 4;
+	      *offset = splt->size;
+	      splt->size += 4;
 	    }
 	  break;
 
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
         case R_XSTORMY16_GNU_VTINHERIT:
-          if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_XSTORMY16_GNU_VTENTRY:
-          if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
 	}
@@ -566,7 +566,7 @@
       if (address <= 0xffff)
 	{
 	  h->plt.offset = -1;
-	  data->splt->_cooked_size -= 4;
+	  data->splt->size -= 4;
 	  *data->again = TRUE;
 	}
     }
@@ -618,14 +618,9 @@
     return TRUE;
 
   /* Quick check for an empty plt.  */
-  if (splt->_raw_size == 0)
+  if (splt->size == 0)
     return TRUE;
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (splt->_cooked_size == 0)
-    splt->_cooked_size = splt->_raw_size;
-
   /* Map across all global symbols; see which ones happen to
      fall in the low 64k.  */
   relax_plt_data.splt = splt;
@@ -682,7 +677,7 @@
 	  if (address <= 0xffff)
 	    {
 	      local_plt_offsets[idx] = -1;
-	      splt->_cooked_size -= 4;
+	      splt->size -= 4;
 	      *again = TRUE;
 	    }
 	}
@@ -702,7 +697,7 @@
 
   /* If we changed anything, walk the symbols again to reallocate
      .plt entry addresses.  */
-  if (*again && splt->_cooked_size > 0)
+  if (*again && splt->size > 0)
     {
       bfd_vma entry = 0;
 
@@ -727,7 +722,6 @@
 	}
     }
 
-  splt->_raw_size = splt->_cooked_size;
   return TRUE;
 }
 
@@ -749,7 +743,7 @@
   splt = bfd_get_section_by_name (dynobj, ".plt");
   BFD_ASSERT (splt != NULL);
 
-  splt->contents = (bfd_byte *) bfd_zalloc (dynobj, splt->_raw_size);
+  splt->contents = (bfd_byte *) bfd_zalloc (dynobj, splt->size);
   if (splt->contents == NULL)
     return FALSE;
 
@@ -996,7 +990,7 @@
       && (splt = bfd_get_section_by_name (dynobj, ".plt")) != NULL)
     {
       bfd_byte *contents = splt->contents;
-      unsigned int i, size = splt->_raw_size;
+      unsigned int i, size = splt->size;
       for (i = 0; i < size; i += 4)
 	{
 	  unsigned int x = bfd_get_32 (dynobj, contents + i);
diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index c376a17..c259662 100644
--- a/bfd/elf32-xtensa.c
+++ b/bfd/elf32-xtensa.c
@@ -497,13 +497,14 @@
   int block_count;
   bfd_size_type num_records;
   Elf_Internal_Rela *internal_relocs;
+  bfd_vma section_addr;
 
   table_section_name = 
     xtensa_get_property_section_name (section, sec_name);
   table_section = bfd_get_section_by_name (abfd, table_section_name);
   free (table_section_name);
   if (table_section != NULL)
-    table_size = bfd_get_section_size_before_reloc (table_section);
+    table_size = table_section->size;
   
   if (table_size == 0) 
     {
@@ -517,10 +518,12 @@
     bfd_malloc (num_records * sizeof (property_table_entry));
   block_count = 0;
   
+  section_addr = section->output_section->vma + section->output_offset;
+
   /* If the file has not yet been relocated, process the relocations
      and sort out the table entries that apply to the specified section.  */
   internal_relocs = retrieve_internal_relocs (abfd, table_section, TRUE);
-  if (internal_relocs)
+  if (internal_relocs && !table_section->reloc_done)
     {
       unsigned i;
 
@@ -539,7 +542,7 @@
 	    {
 	      bfd_vma sym_off = get_elf_r_symndx_offset (abfd, r_symndx);
 	      blocks[block_count].address =
-		(section->vma + sym_off + rel->r_addend
+		(section_addr + sym_off + rel->r_addend
 		 + bfd_get_32 (abfd, table_data + rel->r_offset));
 	      blocks[block_count].size =
 		bfd_get_32 (abfd, table_data + rel->r_offset + 4);
@@ -549,16 +552,16 @@
     }
   else
     {
-      /* No relocations.  Presumably the file has been relocated
-	 and the addresses are already in the table.  */
+      /* The file has already been relocated and the addresses are
+	 already in the table.  */
       bfd_vma off;
 
       for (off = 0; off < table_size; off += 8) 
 	{
 	  bfd_vma address = bfd_get_32 (abfd, table_data + off);
 
-	  if (address >= section->vma
-	      && address < ( section->vma + section->_raw_size))
+	  if (address >= section_addr
+	      && address < section_addr + section->size)
 	    {
 	      blocks[block_count].address = address;
 	      blocks[block_count].size =
@@ -733,14 +736,14 @@
 	case R_XTENSA_GNU_VTINHERIT:
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
 	    return FALSE;
 	  break;
 
 	case R_XTENSA_GNU_VTENTRY:
 	  /* This relocation describes which C++ vtable entries are actually
 	     used.  Record for later use during GC.  */
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
@@ -1052,7 +1055,7 @@
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
   if (h->plt.refcount > 0)
-    srelplt->_raw_size += (h->plt.refcount * sizeof (Elf32_External_Rela));
+    srelplt->size += (h->plt.refcount * sizeof (Elf32_External_Rela));
 
   return TRUE;
 }
@@ -1069,7 +1072,7 @@
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
   if (h->got.refcount > 0)
-    srelgot->_raw_size += (h->got.refcount * sizeof (Elf32_External_Rela));
+    srelgot->size += (h->got.refcount * sizeof (Elf32_External_Rela));
 
   return TRUE;
 }
@@ -1098,8 +1101,8 @@
       for (j = 0; j < cnt; ++j)
 	{
 	  if (local_got_refcounts[j] > 0)
-	    srelgot->_raw_size += (local_got_refcounts[j]
-				   * sizeof (Elf32_External_Rela));
+	    srelgot->size += (local_got_refcounts[j]
+			      * sizeof (Elf32_External_Rela));
 	}
     }
 }
@@ -1133,7 +1136,7 @@
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  if (s == NULL)
 	    abort ();
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
 
@@ -1141,7 +1144,7 @@
       s = bfd_get_section_by_name (dynobj, ".got");
       if (s == NULL)
 	abort ();
-      s->_raw_size = 4;
+      s->size = 4;
 
       /* Adjust refcounts for symbols that we now know are not "dynamic".  */
       elf_link_hash_traverse (elf_hash_table (info),
@@ -1180,7 +1183,7 @@
       if (spltlittbl == NULL)
 	abort ();
 
-      plt_entries = srelplt->_raw_size / sizeof (Elf32_External_Rela);
+      plt_entries = srelplt->size / sizeof (Elf32_External_Rela);
       plt_chunks =
 	(plt_entries + PLT_ENTRIES_PER_CHUNK - 1) / PLT_ENTRIES_PER_CHUNK;
 
@@ -1206,15 +1209,15 @@
 
 	  if (chunk_entries != 0)
 	    {
-	      sgotplt->_raw_size = 4 * (chunk_entries + 2);
-	      splt->_raw_size = PLT_ENTRY_SIZE * chunk_entries;
-	      srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela);
-	      spltlittbl->_raw_size += 8;
+	      sgotplt->size = 4 * (chunk_entries + 2);
+	      splt->size = PLT_ENTRY_SIZE * chunk_entries;
+	      srelgot->size += 2 * sizeof (Elf32_External_Rela);
+	      spltlittbl->size += 8;
 	    }
 	  else
 	    {
-	      sgotplt->_raw_size = 0;
-	      splt->_raw_size = 0;
+	      sgotplt->size = 0;
+	      splt->size = 0;
 	    }
 	}
 
@@ -1223,7 +1226,7 @@
       sgotloc = bfd_get_section_by_name (dynobj, ".got.loc");
       if (sgotloc == NULL)
 	abort ();
-      sgotloc->_raw_size = spltlittbl->_raw_size;
+      sgotloc->size = spltlittbl->size;
       for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next)
 	{
 	  if (abfd->flags & DYNAMIC)
@@ -1233,7 +1236,7 @@
 	      if (! elf_discarded_section (s)
 		  && xtensa_is_littable_section (s)
 		  && s != spltlittbl)
-		sgotloc->_raw_size += s->_raw_size;
+		sgotloc->size += s->size;
 	    }
 	}
     }
@@ -1269,7 +1272,7 @@
       else if (strncmp (name, ".plt.", 5) == 0
 	       || strncmp (name, ".got.plt.", 9) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the output
 		 file.  We must create the ".plt*" and ".got.plt*"
@@ -1298,8 +1301,8 @@
       else
 	{
 	  /* Allocate memory for the section contents.  */
-	  s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-	  if (s->contents == NULL && s->_raw_size != 0)
+	  s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+	  if (s->contents == NULL && s->size != 0)
 	    return FALSE;
 	}
     }
@@ -1334,7 +1337,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (! info->shared)
 	{
@@ -1435,7 +1438,7 @@
 	  /* Check for windowed CALL across a 1GB boundary.  */
 	  xtensa_opcode opcode =
 	    get_expanded_call_opcode (contents + address,
-				      input_section->_raw_size - address);
+				      input_section->size - address);
 	  if (is_windowed_call_opcode (opcode))
 	    {
 	      self_address = (input_section->output_section->vma
@@ -1456,8 +1459,7 @@
       { 
         /* Convert the L32R/CALLX to CALL.  */
 	bfd_reloc_status_type retval = 
-	  elf_xtensa_do_asm_simplify (contents, address,
-				      input_section->_raw_size);
+	  elf_xtensa_do_asm_simplify (contents, address, input_section->size);
 	if (retval != bfd_reloc_ok)
 	  return retval;
 
@@ -1672,8 +1674,7 @@
     }
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > (input_section->_cooked_size
-			      / bfd_octets_per_byte (abfd)))
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
@@ -1891,7 +1892,7 @@
 	    {
 	      /* Convert ASM_SIMPLIFY into the simpler relocation
 		 so that they never escape a relaxing link.  */
-	      contract_asm_expansion (contents, input_section->_raw_size, rel);
+	      contract_asm_expansion (contents, input_section->size, rel);
 	      r_type = ELF32_R_TYPE (rel->r_info);
 	    }
 
@@ -1987,7 +1988,7 @@
 	}
 
       /* Sanity check the address.  */
-      if (rel->r_offset >= input_section->_raw_size
+      if (rel->r_offset >= bfd_get_section_limit (input_bfd, input_section)
 	  && ELF32_R_TYPE (rel->r_info) != R_XTENSA_NONE)
 	{
 	  bfd_set_error (bfd_error_bad_value);
@@ -2044,8 +2045,7 @@
 		     and not in a literal pool.  */
 		  if ((input_section->flags & SEC_READONLY) != 0
 		      && !elf_xtensa_in_literal_pool (lit_table, ltblsize,
-						      input_section->vma
-						      + rel->r_offset))
+						      outrel.r_offset))
 		    {
 		      error_message =
 			_("dynamic relocation in read-only section");
@@ -2092,7 +2092,7 @@
 		     + srel->reloc_count++ * sizeof (Elf32_External_Rela));
 	      bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
 	      BFD_ASSERT (sizeof (Elf32_External_Rela) * srel->reloc_count
-			  <= srel->_cooked_size);
+			  <= srel->size);
 	    }
 	}
 
@@ -2145,6 +2145,8 @@
   if (lit_table)
     free (lit_table);
 
+  input_section->reloc_done = TRUE;
+
   return TRUE;
 }
 
@@ -2196,13 +2198,11 @@
   bfd_vma offset;
   int n, m, num;
 
-  section_size = (sxtlit->_cooked_size != 0
-		  ? sxtlit->_cooked_size : sxtlit->_raw_size);
+  section_size = sxtlit->size;
   BFD_ASSERT (section_size % 8 == 0);
   num = section_size / 8;
 
-  sgotloc_size = (sgotloc->_cooked_size != 0
-		  ? sgotloc->_cooked_size : sgotloc->_raw_size);
+  sgotloc_size = sgotloc->size;
   if (sgotloc_size != section_size)
     {
       (*_bfd_error_handler)
@@ -2210,20 +2210,22 @@
       return -1;
     }
 
-  contents = (bfd_byte *) bfd_malloc (section_size);
-  table = (property_table_entry *)
-    bfd_malloc (num * sizeof (property_table_entry));
-  if (contents == 0 || table == 0)
+  table = bfd_malloc (num * sizeof (property_table_entry));
+  if (table == 0)
     return -1;
 
   /* The ".xt.lit.plt" section has the SEC_IN_MEMORY flag set and this
      propagates to the output section, where it doesn't really apply and
-     where it breaks the following call to bfd_get_section_contents.  */
+     where it breaks the following call to bfd_malloc_and_get_section.  */
   sxtlit->flags &= ~SEC_IN_MEMORY;
 
-  if (! bfd_get_section_contents (output_bfd, sxtlit, contents, 0,
-				  section_size))
-    return -1;
+  if (!bfd_malloc_and_get_section (output_bfd, sxtlit, &contents))
+    {
+      if (contents != 0)
+	free (contents);
+      free (table);
+      return -1;
+    }
 
   /* There should never be any relocations left at this point, so this
      is quite a bit easier than what is done during relaxation.  */
@@ -2275,10 +2277,7 @@
 
   /* Clear the removed bytes.  */
   if ((bfd_size_type) (num * 8) < section_size)
-    {
-      memset (&contents[num * 8], 0, section_size - num * 8);
-      sxtlit->_cooked_size = num * 8;
-    }
+    memset (&contents[num * 8], 0, section_size - num * 8);
 
   if (! bfd_set_section_contents (output_bfd, sxtlit, contents, 0,
 				  section_size))
@@ -2317,7 +2316,7 @@
   sgot = bfd_get_section_by_name (dynobj, ".got");
   if (sgot)
     {
-      BFD_ASSERT (sgot->_raw_size == 4);
+      BFD_ASSERT (sgot->size == 4);
       if (sdyn == NULL)
 	bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents);
       else
@@ -2327,7 +2326,7 @@
     }
 
   srelplt = bfd_get_section_by_name (dynobj, ".rela.plt");
-  if (srelplt != NULL && srelplt->_raw_size != 0)
+  if (srelplt != NULL && srelplt->size != 0)
     {
       asection *sgotplt, *srelgot, *spltlittbl;
       int chunk, plt_chunks, plt_entries;
@@ -2352,7 +2351,7 @@
 	}
       BFD_ASSERT (rtld_reloc < srelgot->reloc_count);
 
-      plt_entries = (srelplt->_raw_size / sizeof (Elf32_External_Rela));
+      plt_entries = srelplt->size / sizeof (Elf32_External_Rela);
       plt_chunks =
 	(plt_entries + PLT_ENTRIES_PER_CHUNK - 1) / PLT_ENTRIES_PER_CHUNK;
 
@@ -2394,7 +2393,7 @@
 	  else
 	    chunk_entries = plt_entries - (chunk * PLT_ENTRIES_PER_CHUNK);
 
-	  BFD_ASSERT ((unsigned) (chunk + 1) * 8 <= spltlittbl->_cooked_size);
+	  BFD_ASSERT ((unsigned) (chunk + 1) * 8 <= spltlittbl->size);
 	  bfd_put_32 (output_bfd,
 		      sgotplt->output_section->vma + sgotplt->output_offset,
 		      spltlittbl->contents + (chunk * 8) + 0);
@@ -2405,10 +2404,10 @@
 
       /* All the dynamic relocations have been emitted at this point.
 	 Make sure the relocation sections are the correct size.  */
-      if (srelgot->_cooked_size != (sizeof (Elf32_External_Rela)
-				    * srelgot->reloc_count)
-	  || srelplt->_cooked_size != (sizeof (Elf32_External_Rela)
-				       * srelplt->reloc_count))
+      if (srelgot->size != (sizeof (Elf32_External_Rela)
+			    * srelgot->reloc_count)
+	  || srelplt->size != (sizeof (Elf32_External_Rela)
+			       * srelplt->reloc_count))
 	abort ();
 
      /* The .xt.lit.plt section has just been modified.  This must
@@ -2419,7 +2418,7 @@
 				      spltlittbl->output_section,
 				      spltlittbl->contents,
 				      spltlittbl->output_offset,
-				      spltlittbl->_raw_size))
+				      spltlittbl->size))
 	return FALSE;
       /* Clear SEC_HAS_CONTENTS so the contents won't be output again.  */
       spltlittbl->flags &= ~SEC_HAS_CONTENTS;
@@ -2436,7 +2435,7 @@
     return FALSE;
 
   dyncon = (Elf32_External_Dyn *) sdyn->contents;
-  dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+  dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size);
   for (; dyncon < dynconend; dyncon++)
     {
       Elf_Internal_Dyn dyn;
@@ -2471,7 +2470,7 @@
 	case DT_PLTRELSZ:
 	  s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	  BFD_ASSERT (s);
-	  dyn.d_un.d_val = (s->_cooked_size ? s->_cooked_size : s->_raw_size);
+	  dyn.d_un.d_val = s->size;
 	  break;
 
 	case DT_RELASZ:
@@ -2483,10 +2482,7 @@
 	     don't have to worry about changing the DT_RELA entry.  */
 	  s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	  if (s)
-	    {
-	      dyn.d_un.d_val -=
-		(s->_cooked_size ? s->_cooked_size : s->_raw_size);
-	    }
+	    dyn.d_un.d_val -= s->size;
 	  break;
 	}
 
@@ -2682,7 +2678,7 @@
   bfd_vma offset, actual_offset;
   size_t removed_bytes = 0;
 
-  section_size = (sec->_cooked_size ? sec->_cooked_size : sec->_raw_size);
+  section_size = sec->size;
   if (section_size == 0 || section_size % 8 != 0)
     return FALSE;
 
@@ -2720,7 +2716,7 @@
       while (cookie->rel < cookie->relend
 	     && cookie->rel->r_offset == offset)
 	{
-	  if (_bfd_elf32_reloc_symbol_deleted_p (offset, cookie))
+	  if (bfd_elf_reloc_symbol_deleted_p (offset, cookie))
 	    {
 	      /* Remove the table entry.  (If the reloc type is NONE, then
 		 the entry has already been merged with another and deleted
@@ -2770,9 +2766,8 @@
       pin_contents (sec, contents);
       pin_internal_relocs (sec, cookie->rels);
 
-      sec->_cooked_size = section_size - removed_bytes;
-      /* Also shrink _raw_size.  See comments in relax_property_section.  */
-      sec->_raw_size = sec->_cooked_size;
+      /* Shrink size.  */
+      sec->size = section_size - removed_bytes;
 
       if (xtensa_is_littable_section (sec))
 	{
@@ -2782,13 +2777,7 @@
 	      asection *sgotloc =
 		bfd_get_section_by_name (dynobj, ".got.loc");
 	      if (sgotloc)
-		{
-		  bfd_size_type sgotloc_size =
-		    (sgotloc->_cooked_size ? sgotloc->_cooked_size
-		     : sgotloc->_raw_size);
-		  sgotloc->_cooked_size = sgotloc_size - removed_bytes;
-		  sgotloc->_raw_size = sgotloc_size - removed_bytes;
-		}
+		sgotloc->size -= removed_bytes;
 	    }
 	}
     }
@@ -2840,7 +2829,7 @@
      Elf_Internal_Note *note;
 {
   int offset;
-  unsigned int raw_size;
+  unsigned int size;
 
   /* The size for Xtensa is variable, so don't try to recognize the format
      based on the size.  Just assume this is GNU/Linux.  */
@@ -2853,11 +2842,11 @@
 
   /* pr_reg */
   offset = 72;
-  raw_size = note->descsz - offset - 4;
+  size = note->descsz - offset - 4;
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
 
@@ -3019,7 +3008,7 @@
   if (contents == NULL)
     return XTENSA_UNDEFINED;
 
-  if (sec->_raw_size <= irel->r_offset)
+  if (sec->size <= irel->r_offset)
     return XTENSA_UNDEFINED;
 
   if (ibuff == NULL)
@@ -3431,7 +3420,7 @@
 
 
 static bfd_boolean is_same_value
-  PARAMS ((const literal_value *, const literal_value *));
+  PARAMS ((const literal_value *, const literal_value *, bfd_boolean));
 static value_map_hash_table *value_map_hash_table_init
   PARAMS ((void));
 static unsigned hash_literal_value
@@ -3439,16 +3428,20 @@
 static unsigned hash_bfd_vma
   PARAMS ((bfd_vma));
 static value_map *get_cached_value
-  PARAMS ((value_map_hash_table *, const literal_value *));
+  PARAMS ((value_map_hash_table *, const literal_value *, bfd_boolean));
 static value_map *add_value_map
-  PARAMS ((value_map_hash_table *, const literal_value *, const r_reloc *));
+  PARAMS ((value_map_hash_table *, const literal_value *, const r_reloc *,
+	   bfd_boolean));
 
 
 static bfd_boolean
-is_same_value (src1, src2)
+is_same_value (src1, src2, final_static_link)
      const literal_value *src1;
      const literal_value *src2;
+     bfd_boolean final_static_link;
 {
+  struct elf_link_hash_entry *h1, *h2;
+
   if (r_reloc_is_const (&src1->r_rel) != r_reloc_is_const (&src2->r_rel)) 
     return FALSE;
 
@@ -3466,8 +3459,14 @@
   if (src1->value != src2->value)
     return FALSE;
   
-  /* Now check for the same section and the same elf_hash.  */
-  if (r_reloc_is_defined (&src1->r_rel))
+  /* Now check for the same section (if defined) or the same elf_hash
+     (if undefined or weak).  */
+  h1 = r_reloc_get_hash_entry (&src1->r_rel);
+  h2 = r_reloc_get_hash_entry (&src2->r_rel);
+  if (r_reloc_is_defined (&src1->r_rel)
+      && (final_static_link
+	  || ((!h1 || h1->root.type != bfd_link_hash_defweak)
+	      && (!h2 || h2->root.type != bfd_link_hash_defweak))))
     {
       if (r_reloc_get_section (&src1->r_rel)
 	  != r_reloc_get_section (&src2->r_rel))
@@ -3475,11 +3474,8 @@
     }
   else
     {
-      if (r_reloc_get_hash_entry (&src1->r_rel)
-	  != r_reloc_get_hash_entry (&src2->r_rel))
-	return FALSE;
-
-      if (r_reloc_get_hash_entry (&src1->r_rel) == 0)
+      /* Require that the hash entries (i.e., symbols) be identical.  */
+      if (h1 != h2 || h1 == 0)
 	return FALSE;
     }
 
@@ -3540,9 +3536,10 @@
 /* Check if the specified literal_value has been seen before.  */
 
 static value_map *
-get_cached_value (map, val)
+get_cached_value (map, val, final_static_link)
      value_map_hash_table *map;
      const literal_value *val;
+     bfd_boolean final_static_link;
 {
   value_map *map_e;
   value_map *bucket;
@@ -3553,7 +3550,7 @@
   bucket = map->buckets[idx];
   for (map_e = bucket; map_e; map_e = map_e->next)
     {
-      if (is_same_value (&map_e->val, val))
+      if (is_same_value (&map_e->val, val, final_static_link))
 	return map_e;
     }
   return NULL;
@@ -3564,17 +3561,18 @@
    already has an entry here.  */
 
 static value_map *
-add_value_map (map, val, loc)
+add_value_map (map, val, loc, final_static_link)
      value_map_hash_table *map;
      const literal_value *val;
      const r_reloc *loc;
+     bfd_boolean final_static_link;
 {
   value_map **bucket_p;
   unsigned idx;
 
   value_map *val_e = (value_map *) bfd_zmalloc (sizeof (value_map));
 
-  BFD_ASSERT (get_cached_value (map, val) == NULL);
+  BFD_ASSERT (get_cached_value (map, val, final_static_link) == NULL);
   val_e->val = *val;
   val_e->loc = *loc;
 
@@ -3944,20 +3942,16 @@
 
   contents = elf_section_data (sec)->this_hdr.contents;
   
-  if (contents == NULL && sec->_raw_size != 0)
+  if (contents == NULL && sec->size != 0)
     {
-      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-      if (contents != NULL)
+      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 	{
-	  if (! bfd_get_section_contents (abfd, sec, contents,
-					  (file_ptr) 0, sec->_raw_size))
-	    {
-	      free (contents);
-	      return NULL;
-	    }
-	  if (keep_memory) 
-	    elf_section_data (sec)->this_hdr.contents = contents;
+	  if (contents != NULL)
+	    free (contents);
+	  return NULL;
 	}
+      if (keep_memory) 
+	elf_section_data (sec)->this_hdr.contents = contents;
     }
   return contents;
 }
@@ -4183,7 +4177,7 @@
     return ok;
 
   contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec->_raw_size != 0)
+  if (contents == NULL && sec->size != 0)
     {
       ok = FALSE;
       goto error_return;
@@ -4244,7 +4238,7 @@
     return ok;
 
   contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec->_raw_size != 0)
+  if (contents == NULL && sec->size != 0)
     {
       ok = FALSE;
       goto error_return;
@@ -4392,7 +4386,7 @@
     return FALSE;
   
   opcode = get_expanded_call_opcode (contents + irel->r_offset,
-				     sec->_raw_size - irel->r_offset);
+				     sec->size - irel->r_offset);
   
   direct_call_opcode = swap_callx_for_call_opcode (opcode);
   if (direct_call_opcode == XTENSA_UNDEFINED)
@@ -4480,6 +4474,7 @@
   bfd_byte *contents;
   Elf_Internal_Rela *internal_relocs;
   source_reloc *src_relocs;
+  bfd_boolean final_static_link;
   bfd_boolean ok = TRUE;
   int i;
 
@@ -4494,12 +4489,16 @@
 					      link_info->keep_memory);
 
   contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec->_raw_size != 0)
+  if (contents == NULL && sec->size != 0)
     {
       ok = FALSE;
       goto error_return;
     }
 
+  final_static_link =
+    (!link_info->relocatable
+     && !elf_hash_table (link_info)->dynamic_sections_created);
+
   /* Sort the source_relocs by target offset.  */
   src_relocs = relax_info->src_relocs;
   qsort (src_relocs, relax_info->src_count,
@@ -4548,11 +4547,11 @@
 
       /* Find the literal value.  */
       r_reloc_init (&val.r_rel, abfd, irel);
-      BFD_ASSERT (rel->r_rel.target_offset < sec->_raw_size);
+      BFD_ASSERT (rel->r_rel.target_offset < sec->size);
       val.value = bfd_get_32 (abfd, contents + rel->r_rel.target_offset);
           
       /* Check if we've seen another literal with the same value.  */
-      val_map = get_cached_value (values, &val);
+      val_map = get_cached_value (values, &val, final_static_link);
       if (val_map != NULL) 
 	{
 	  /* First check that THIS and all the other relocs to this
@@ -4575,7 +4574,7 @@
 	{
 	  /* This is the first time we've seen this literal value.  */
 	  BFD_ASSERT (sec == r_reloc_get_section (&rel->r_rel));
-	  add_value_map (values, &val, &rel->r_rel);
+	  add_value_map (values, &val, &rel->r_rel, final_static_link);
 	}
     }
 
@@ -4704,7 +4703,7 @@
   internal_relocs = retrieve_internal_relocs (abfd, sec, 
 					      link_info->keep_memory);
   contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec->_raw_size != 0)
+  if (contents == NULL && sec->size != 0)
     {
       ok = FALSE;
       goto error_return;
@@ -4783,13 +4782,13 @@
       /* Walk through the contents and delete literals that are not needed 
          anymore.  */
 
-      unsigned long size = sec->_cooked_size;
+      unsigned long size = sec->size;
       unsigned long removed = 0;
 
       removed_literal *reloc = relax_info->removed_list.head;
       for (; reloc; reloc = reloc->next) 
 	{
-	  unsigned long upper = sec->_raw_size;
+	  unsigned long upper = sec->size;
 	  bfd_vma start = reloc->from.target_offset + 4;
 	  if (reloc->next)
 	    upper = reloc->next->from.target_offset;
@@ -4806,13 +4805,7 @@
 	}
 
       /* Change the section size.  */
-      sec->_cooked_size = size;
-      /* Also shrink _raw_size.  (The code in relocate_section that
-	 checks that relocations are within the section must use
-	 _raw_size because of the way the stabs sections are relaxed;
-	 shrinking _raw_size means that these checks will not be
-	 unnecessarily lax.)  */
-      sec->_raw_size = size;
+      sec->size = size;
     }
   
  error_return:
@@ -4938,13 +4931,8 @@
       /* Reduce size of the .rela.* section by one reloc.  */
       srel = bfd_get_section_by_name (dynobj, srel_name);
       BFD_ASSERT (srel != NULL);
-      BFD_ASSERT (srel->_cooked_size >= sizeof (Elf32_External_Rela));
-      srel->_cooked_size -= sizeof (Elf32_External_Rela);
-
-      /* Also shrink _raw_size.  (This seems wrong but other bfd code seems
-	 to assume that linker-created sections will never be relaxed and
-	 hence _raw_size must always equal _cooked_size.) */
-      srel->_raw_size = srel->_cooked_size;
+      BFD_ASSERT (srel->size >= sizeof (Elf32_External_Rela));
+      srel->size -= sizeof (Elf32_External_Rela);
 
       if (is_plt)
 	{
@@ -4957,7 +4945,7 @@
 	     = size - 1" since the index starts at zero, but in this
 	     context, the size has just been decremented so there's no
 	     need to subtract one.  */
-	  reloc_index = srel->_cooked_size / sizeof (Elf32_External_Rela);
+	  reloc_index = srel->size / sizeof (Elf32_External_Rela);
 
 	  chunk = reloc_index / PLT_ENTRIES_PER_CHUNK;
 	  splt = elf_xtensa_get_plt_section (dynobj, chunk);
@@ -4971,27 +4959,20 @@
 	      srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
 	      BFD_ASSERT (srelgot != NULL);
 	      srelgot->reloc_count -= 2;
-	      srelgot->_cooked_size -= 2 * sizeof (Elf32_External_Rela);
-	      /* Shrink _raw_size (see comment above).  */
-	      srelgot->_raw_size = srelgot->_cooked_size;
-
-	      sgotplt->_cooked_size -= 8;
+	      srelgot->size -= 2 * sizeof (Elf32_External_Rela);
+	      sgotplt->size -= 8;
 
 	      /* There should be only one entry left (and it will be
 		 removed below).  */
-	      BFD_ASSERT (sgotplt->_cooked_size == 4);
-	      BFD_ASSERT (splt->_cooked_size == PLT_ENTRY_SIZE);
+	      BFD_ASSERT (sgotplt->size == 4);
+	      BFD_ASSERT (splt->size == PLT_ENTRY_SIZE);
 	    }
 
-	  BFD_ASSERT (sgotplt->_cooked_size >= 4);
-	  BFD_ASSERT (splt->_cooked_size >= PLT_ENTRY_SIZE);
+	  BFD_ASSERT (sgotplt->size >= 4);
+	  BFD_ASSERT (splt->size >= PLT_ENTRY_SIZE);
 
-	  sgotplt->_cooked_size -= 4;
-	  splt->_cooked_size -= PLT_ENTRY_SIZE;
-
-	  /* Shrink _raw_sizes (see comment above).  */
-	  sgotplt->_raw_size = sgotplt->_cooked_size;
-	  splt->_raw_size = splt->_cooked_size;
+	  sgotplt->size -= 4;
+	  splt->size -= PLT_ENTRY_SIZE;
 	}
     }
 }
@@ -5016,7 +4997,7 @@
   internal_relocs = retrieve_internal_relocs (abfd, sec, 
 					      link_info->keep_memory);
   contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec->_raw_size != 0)
+  if (contents == NULL && sec->size != 0)
     {
       ok = FALSE;
       goto error_return;
@@ -5107,7 +5088,7 @@
       pin_contents (sec, contents);
 
       last_irel_offset = (bfd_vma) -1;
-      section_size = (sec->_cooked_size ? sec->_cooked_size : sec->_raw_size);
+      section_size = sec->size;
       BFD_ASSERT (section_size % 8 == 0);
 
       for (offset = 0; offset < section_size; offset += 8)
@@ -5239,13 +5220,7 @@
 	  /* Clear the removed bytes.  */
 	  memset (&contents[section_size - removed_bytes], 0, removed_bytes);
 
-	  sec->_cooked_size = section_size - removed_bytes;
-	  /* Also shrink _raw_size.  (The code in relocate_section that
-	     checks that relocations are within the section must use
-	     _raw_size because of the way the stabs sections are
-	     relaxed; shrinking _raw_size means that these checks will
-	     not be unnecessarily lax.)  */
-	  sec->_raw_size = sec->_cooked_size;
+	  sec->size = section_size - removed_bytes;
 
 	  if (xtensa_is_littable_section (sec))
 	    {
@@ -5255,13 +5230,7 @@
 		  asection *sgotloc =
 		    bfd_get_section_by_name (dynobj, ".got.loc");
 		  if (sgotloc)
-		    {
-		      bfd_size_type sgotloc_size =
-			(sgotloc->_cooked_size ? sgotloc->_cooked_size
-			 : sgotloc->_raw_size);
-		      sgotloc->_cooked_size = sgotloc_size - removed_bytes;
-		      sgotloc->_raw_size = sgotloc_size - removed_bytes;
-		    }
+		    sgotloc->size -= removed_bytes;
 		}
 	    }
 	}
@@ -5666,12 +5635,10 @@
       prop_sec_name[linkonce_len + 1] = '.';
 
       suffix = sec->name + linkonce_len;
-      while (*suffix)
-	{
-	  suffix += 1;
-	  if (suffix[-1] == '.')
-	    break;
-	}
+      /* For backward compatibility, replace "t." instead of inserting
+	 the new linkonce_kind.  */
+      if (strncmp (suffix, "t.", 2) == 0)
+	suffix += 2;
       strcpy (prop_sec_name + linkonce_len + 2, suffix);
 
       return prop_sec_name;
@@ -5722,7 +5689,7 @@
       /* Assume worst-case offsets: L32R at the very end of the ".plt"
 	 section referencing a literal at the very beginning of
 	 ".got.plt".  This is very close to the real dependence, anyway.  */
-      (*callback) (sec, sec->_raw_size, sgotplt, 0, closure);
+      (*callback) (sec, sec->size, sgotplt, 0, closure);
     }
 
   internal_relocs = retrieve_internal_relocs (abfd, sec, 
@@ -5733,7 +5700,7 @@
 
   /* Cache the contents for the duration of this scan.  */
   contents = retrieve_contents (abfd, sec, link_info->keep_memory);
-  if (contents == NULL && sec->_raw_size != 0)
+  if (contents == NULL && sec->size != 0)
     {
       ok = FALSE;
       goto error_return;
@@ -5815,7 +5782,6 @@
 
 #define elf_info_to_howto		     elf_xtensa_info_to_howto_rela
 
-#define bfd_elf32_bfd_final_link	     bfd_elf32_bfd_final_link
 #define bfd_elf32_bfd_merge_private_bfd_data elf_xtensa_merge_private_bfd_data
 #define bfd_elf32_new_section_hook	     elf_xtensa_new_section_hook
 #define bfd_elf32_bfd_print_private_bfd_data elf_xtensa_print_private_bfd_data
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index 22c12c0..7b17db5 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -75,7 +75,7 @@
 static bfd_boolean elf64_alpha_section_from_shdr
   PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
 static bfd_boolean elf64_alpha_section_flags
-  PARAMS ((flagword *, Elf_Internal_Shdr *));
+  PARAMS ((flagword *, const Elf_Internal_Shdr *));
 static bfd_boolean elf64_alpha_fake_sections
   PARAMS ((bfd *, Elf_Internal_Shdr *, asection *));
 static bfd_boolean elf64_alpha_create_got_section
@@ -123,7 +123,7 @@
 static bfd_boolean elf64_alpha_size_rela_got_1
   PARAMS ((struct alpha_elf_link_hash_entry *, struct bfd_link_info *));
 static bfd_boolean elf64_alpha_add_symbol_hook
-  PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+  PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
 	   const char **, flagword *, asection **, bfd_vma *));
 static struct alpha_elf_got_entry *get_got_entry
   PARAMS ((bfd *, struct alpha_elf_link_hash_entry *, unsigned long,
@@ -1036,6 +1036,7 @@
 {
   bfd_reloc_status_type ret;
   bfd_vma gp, relocation;
+  bfd_vma high_address;
   bfd_byte *p_ldah, *p_lda;
 
   /* Don't do anything if we're not doing a final link.  */
@@ -1045,8 +1046,9 @@
       return bfd_reloc_ok;
     }
 
-  if (reloc_entry->address > input_section->_cooked_size ||
-      reloc_entry->address + reloc_entry->addend > input_section->_cooked_size)
+  high_address = bfd_get_section_limit (abfd, input_section);
+  if (reloc_entry->address > high_address
+      || reloc_entry->address + reloc_entry->addend > high_address)
     return bfd_reloc_outofrange;
 
   /* The gp used in the portion of the output object to which this
@@ -1973,11 +1975,6 @@
       || sec->reloc_count == 0)
     return TRUE;
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
-
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   local_got_entries = alpha_elf_tdata(abfd)->local_got_entries;
 
@@ -2012,12 +2009,7 @@
     info.contents = elf_section_data (sec)->this_hdr.contents;
   else
     {
-      info.contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-      if (info.contents == NULL)
-	goto error_return;
-
-      if (! bfd_get_section_contents (abfd, sec, info.contents,
-				      (file_ptr) 0, sec->_raw_size))
+      if (!bfd_malloc_and_get_section (abfd, sec, &info.contents))
 	goto error_return;
     }
 
@@ -2315,7 +2307,7 @@
 static bfd_boolean
 elf64_alpha_section_flags (flags, hdr)
      flagword *flags;
-     Elf_Internal_Shdr *hdr;
+     const Elf_Internal_Shdr *hdr;
 {
   if (hdr->sh_flags & SHF_ALPHA_GPREL)
     *flags |= SEC_SMALL_DATA;
@@ -2363,7 +2355,7 @@
 elf64_alpha_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd *abfd;
      struct bfd_link_info *info;
-     const Elf_Internal_Sym *sym;
+     Elf_Internal_Sym *sym;
      const char **namep ATTRIBUTE_UNUSED;
      flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
@@ -2462,7 +2454,7 @@
   h->type = STT_OBJECT;
 
   if (info->shared
-      && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+      && ! bfd_elf_link_record_dynamic_symbol (info, h))
     return FALSE;
 
   s = bfd_make_section (abfd, ".rela.plt");
@@ -2506,7 +2498,7 @@
   h->type = STT_OBJECT;
 
   if (info->shared
-      && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+      && ! bfd_elf_link_record_dynamic_symbol (info, h))
     return FALSE;
 
   elf_hash_table (info)->hgot = h;
@@ -2572,7 +2564,6 @@
 #undef READ
 
   debug->fdr = NULL;
-  debug->adjust = NULL;
 
   return TRUE;
 
@@ -3205,7 +3196,7 @@
 	    {
 	      /* If this is a shared library, and the section is to be
 		 loaded into memory, we need a RELATIVE reloc.  */
-	      sreloc->_raw_size += sizeof (Elf64_External_Rela);
+	      sreloc->size += sizeof (Elf64_External_Rela);
 	      if ((sec->flags & (SEC_READONLY | SEC_ALLOC))
 		  == (SEC_READONLY | SEC_ALLOC))
 		info->flags |= DF_TEXTREL;
@@ -3256,11 +3247,11 @@
 	return FALSE;
 
       /* The first bit of the .plt is reserved.  */
-      if (s->_raw_size == 0)
-	s->_raw_size = PLT_HEADER_SIZE;
+      if (s->size == 0)
+	s->size = PLT_HEADER_SIZE;
 
-      h->plt.offset = s->_raw_size;
-      s->_raw_size += PLT_ENTRY_SIZE;
+      h->plt.offset = s->size;
+      s->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 the location
@@ -3279,7 +3270,7 @@
       /* We also need a JMP_SLOT entry in the .rela.plt section.  */
       s = bfd_get_section_by_name (dynobj, ".rela.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += sizeof (Elf64_External_Rela);
+      s->size += sizeof (Elf64_External_Rela);
 
       return TRUE;
     }
@@ -3567,7 +3558,7 @@
 	    result = FALSE;
 	    continue;
 	  }
-	plge = &td->got->_raw_size;
+	plge = &td->got->size;
 	gotent->got_offset = *plge;
 	*plge += alpha_got_entry_size (gotent->reloc_type);
       }
@@ -3584,7 +3575,7 @@
   /* First, zero out the .got sizes, as we may be recalculating the
      .got after optimizing it.  */
   for (i = got_list; i ; i = alpha_elf_tdata(i)->got_link_next)
-    alpha_elf_tdata(i)->got->_raw_size = 0;
+    alpha_elf_tdata(i)->got->size = 0;
 
   /* Next, fill in the offsets for all the global entries.  */
   alpha_elf_link_hash_traverse (alpha_elf_hash_table (info),
@@ -3594,7 +3585,7 @@
   /* Finally, fill in the offsets for the local entries.  */
   for (i = got_list; i ; i = alpha_elf_tdata(i)->got_link_next)
     {
-      bfd_size_type got_offset = alpha_elf_tdata(i)->got->_raw_size;
+      bfd_size_type got_offset = alpha_elf_tdata(i)->got->size;
       bfd *j;
 
       for (j = i; j ; j = alpha_elf_tdata(j)->in_got_link_next)
@@ -3615,8 +3606,7 @@
 	        }
 	}
 
-      alpha_elf_tdata(i)->got->_raw_size = got_offset;
-      alpha_elf_tdata(i)->got->_cooked_size = got_offset;
+      alpha_elf_tdata(i)->got->size = got_offset;
     }
 }
 
@@ -3713,21 +3703,18 @@
   if (splt == NULL)
     return TRUE;
 
-  splt->_raw_size = 0;
+  splt->size = 0;
 
   alpha_elf_link_hash_traverse (alpha_elf_hash_table (info),
 				elf64_alpha_size_plt_section_1, splt);
 
-  splt->_cooked_size = splt->_raw_size;
-
   /* Every plt entry requires a JMP_SLOT relocation.  */
   spltrel = bfd_get_section_by_name (dynobj, ".rela.plt");
-  if (splt->_raw_size)
-    entries = (splt->_raw_size - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE;
+  if (splt->size)
+    entries = (splt->size - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE;
   else
     entries = 0;
-  spltrel->_raw_size = entries * sizeof (Elf64_External_Rela);
-  spltrel->_cooked_size = spltrel->_raw_size;
+  spltrel->size = entries * sizeof (Elf64_External_Rela);
 
   return TRUE;
 }
@@ -3754,10 +3741,10 @@
      a need for the PLT entry.  */
   if (gotent)
     {
-      if (splt->_raw_size == 0)
-	splt->_raw_size = PLT_HEADER_SIZE;
-      h->root.plt.offset = splt->_raw_size;
-      splt->_raw_size += PLT_ENTRY_SIZE;
+      if (splt->size == 0)
+	splt->size = PLT_HEADER_SIZE;
+      h->root.plt.offset = splt->size;
+      splt->size += PLT_ENTRY_SIZE;
     }
   else
     {
@@ -3799,9 +3786,9 @@
   for ( ; i ; i = alpha_elf_tdata(i)->got_link_next)
     {
       asection *s = alpha_elf_tdata(i)->got;
-      if (s->_raw_size > 0)
+      if (s->size > 0)
 	{
-	  s->contents = (bfd_byte *) bfd_zalloc (i, s->_raw_size);
+	  s->contents = (bfd_byte *) bfd_zalloc (i, s->size);
 	  if (s->contents == NULL)
 	    return FALSE;
 	}
@@ -3885,7 +3872,7 @@
 						 info->shared);
       if (entries)
 	{
-	  relent->srel->_raw_size +=
+	  relent->srel->size +=
 	    entries * sizeof (Elf64_External_Rela) * relent->count;
 	  if (relent->reltext)
 	    info->flags |= DT_TEXTREL;
@@ -3939,14 +3926,12 @@
       BFD_ASSERT (entries == 0);
       return TRUE;
     }
-  srel->_raw_size = sizeof (Elf64_External_Rela) * entries;
+  srel->size = sizeof (Elf64_External_Rela) * entries;
 
   /* Now do the non-local symbols.  */
   alpha_elf_link_hash_traverse (alpha_elf_hash_table (info),
 				elf64_alpha_size_rela_got_1, info);
 
-  srel->_cooked_size = srel->_raw_size;
-
   return TRUE;
 }
 
@@ -3987,7 +3972,7 @@
       bfd *dynobj = elf_hash_table(info)->dynobj;
       asection *srel = bfd_get_section_by_name (dynobj, ".rela.got");
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf64_External_Rela) * entries;
+      srel->size += sizeof (Elf64_External_Rela) * entries;
     }
 
   return TRUE;
@@ -4014,7 +3999,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
 
@@ -4057,7 +4042,7 @@
 
       if (strncmp (name, ".rela", 5) == 0)
 	{
-	  strip = (s->_raw_size == 0);
+	  strip = (s->size == 0);
 
 	  if (!strip)
 	    {
@@ -4080,8 +4065,8 @@
       else
 	{
 	  /* Allocate memory for the section contents.  */
-	  s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-	  if (s->contents == NULL && s->_raw_size != 0)
+	  s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+	  if (s->contents == NULL && s->size != 0)
 	    return FALSE;
 	}
     }
@@ -4094,7 +4079,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (info->executable)
 	{
@@ -4155,8 +4140,7 @@
   loc = srel->contents;
   loc += srel->reloc_count++ * sizeof (Elf64_External_Rela);
   bfd_elf64_swap_reloca_out (abfd, &outrel, loc);
-  BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count
-	      <= srel->_cooked_size);
+  BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count <= srel->size);
 }
 
 /* Relocate an Alpha ELF section for a relocatable link.
@@ -4382,8 +4366,7 @@
 		    _bfd_merged_section_offset (output_bfd, &msec,
 						elf_section_data (sec)->
 						  sec_info,
-						sym->st_value + ent->addend,
-						(bfd_vma) 0);
+						sym->st_value + ent->addend);
 		  ent->addend -= sym->st_value;
 		  ent->addend += msec->output_section->vma
 				 + msec->output_offset
@@ -5034,7 +5017,7 @@
       BFD_ASSERT (splt != NULL && sdyn != NULL);
 
       dyncon = (Elf64_External_Dyn *) sdyn->contents;
-      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -5063,10 +5046,7 @@
 		 out who is right.  */
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      if (s)
-		{
-		  dyn.d_un.d_val -=
-		    (s->_cooked_size ? s->_cooked_size : s->_raw_size);
-		}
+		dyn.d_un.d_val -= s->size;
 	      break;
 
 	    get_vma:
@@ -5076,8 +5056,7 @@
 
 	    get_size:
 	      s = bfd_get_section_by_name (output_bfd, name);
-	      dyn.d_un.d_val =
-		(s->_cooked_size ? s->_cooked_size : s->_raw_size);
+	      dyn.d_un.d_val = s->size;
 	      break;
 	    }
 
@@ -5085,7 +5064,7 @@
 	}
 
       /* Initialize the PLT0 entry.  */
-      if (splt->_raw_size > 0)
+      if (splt->size > 0)
 	{
 	  bfd_put_32 (output_bfd, PLT_HEADER_WORD1, splt->contents);
 	  bfd_put_32 (output_bfd, PLT_HEADER_WORD2, splt->contents + 4);
@@ -5196,7 +5175,7 @@
 		  if (s != NULL)
 		    {
 		      esym.asym.value = s->vma;
-		      last = s->vma + s->_raw_size;
+		      last = s->vma + s->size;
 		    }
 		  else
 		    esym.asym.value = last;
@@ -5241,7 +5220,7 @@
 	      input_swap = (get_elf_backend_data (input_bfd)
 			    ->elf_backend_ecoff_debug_swap);
 
-	      BFD_ASSERT (p->size == input_section->_raw_size);
+	      BFD_ASSERT (p->size == input_section->size);
 
 	      /* The ECOFF linking code expects that we have already
 		 read in the debugging information and set up an
@@ -5324,7 +5303,7 @@
 	    return FALSE;
 
 	  /* Set the size of the .mdebug section.  */
-	  o->_raw_size = bfd_ecoff_debug_size (abfd, &debug, swap);
+	  o->size = bfd_ecoff_debug_size (abfd, &debug, swap);
 
 	  /* Skip this section later on (I don't think this currently
 	     matters, but someday it might).  */
@@ -5335,7 +5314,7 @@
     }
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (! bfd_elf64_bfd_final_link (abfd, info))
+  if (! bfd_elf_final_link (abfd, info))
     return FALSE;
 
   /* Now write out the computed sections.  */
@@ -5357,7 +5336,7 @@
 	if (! bfd_set_section_contents (abfd, sgot->output_section,
 					sgot->contents,
 					(file_ptr) sgot->output_offset,
-					sgot->_raw_size))
+					sgot->size))
 	  return FALSE;
       }
   }
diff --git a/bfd/elf64-gen.c b/bfd/elf64-gen.c
index 590456c..be1dc3e 100644
--- a/bfd/elf64-gen.c
+++ b/bfd/elf64-gen.c
@@ -1,5 +1,6 @@
 /* Generic support for 64-bit ELF
-   Copyright 1993, 1995, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004
+   Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -87,7 +88,7 @@
 	return FALSE;
       }
 
-  return bfd_elf64_bfd_link_add_symbols (abfd, info);
+  return bfd_elf_link_add_symbols (abfd, info);
 }
 
 #define TARGET_LITTLE_SYM		bfd_elf64_little_generic_vec
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 5bc9309..25431d4 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -1,5 +1,6 @@
 /* Support for HPPA 64-bit ELF
-   Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -932,7 +933,7 @@
 	     section symbol for this section ends up in the dynamic
 	     symbol table.  */
 	  if (info->shared && dynrel_type == R_PARISC_FPTR64
-	      && ! (_bfd_elf64_link_record_local_dynamic_symbol
+	      && ! (bfd_elf_link_record_local_dynamic_symbol
 		    (info, abfd, sec_symndx)))
 	    return FALSE;
 	}
@@ -1043,7 +1044,7 @@
 	      bfd *owner;
 	      owner = (h ? h->root.u.def.section->owner : dyn_h->owner);
 
-	      if (! (_bfd_elf64_link_record_local_dynamic_symbol
+	      if (! (bfd_elf_link_record_local_dynamic_symbol
 		     (x->info, owner, dyn_h->sym_indx)))
 		return FALSE;
 	    }
@@ -1147,7 +1148,7 @@
 	      bfd *owner;
 	      owner = (h ? h->root.u.def.section->owner : dyn_h->owner);
 
-	      if (!_bfd_elf64_link_record_local_dynamic_symbol
+	      if (!bfd_elf_link_record_local_dynamic_symbol
 		    (x->info, owner, dyn_h->sym_indx))
 		return FALSE;
 	    }
@@ -1173,7 +1174,7 @@
 	      nh->root.u.def.value = h->root.u.def.value;
 	      nh->root.u.def.section = h->root.u.def.section;
 
-	      if (! bfd_elf64_link_record_dynamic_symbol (x->info, nh))
+	      if (! bfd_elf_link_record_dynamic_symbol (x->info, nh))
 		return FALSE;
 
 	     }
@@ -1502,14 +1503,14 @@
       if (!shared && rent->type == R_PARISC_FPTR64 && dyn_h->want_opd)
 	continue;
 
-      hppa_info->other_rel_sec->_raw_size += sizeof (Elf64_External_Rela);
+      hppa_info->other_rel_sec->size += sizeof (Elf64_External_Rela);
 
       /* Make sure this symbol gets into the dynamic symbol table if it is
 	 not already recorded.  ?!? This should not be in the loop since
 	 the symbol need only be added once.  */
       if (dyn_h->h == 0
 	  || (dyn_h->h->dynindx == -1 && dyn_h->h->type != STT_PARISC_MILLI))
-	if (!_bfd_elf64_link_record_local_dynamic_symbol
+	if (!bfd_elf_link_record_local_dynamic_symbol
 	    (x->info, rent->sec->owner, dyn_h->sym_indx))
 	  return FALSE;
     }
@@ -1517,13 +1518,13 @@
   /* Take care of the GOT and PLT relocations.  */
 
   if ((dynamic_symbol || shared) && dyn_h->want_dlt)
-    hppa_info->dlt_rel_sec->_raw_size += sizeof (Elf64_External_Rela);
+    hppa_info->dlt_rel_sec->size += sizeof (Elf64_External_Rela);
 
   /* If we are building a shared library, then every symbol that has an
      opd entry will need an EPLT relocation to relocate the symbol's address
      and __gp value based on the runtime load address.  */
   if (shared && dyn_h->want_opd)
-    hppa_info->opd_rel_sec->_raw_size += sizeof (Elf64_External_Rela);
+    hppa_info->opd_rel_sec->size += sizeof (Elf64_External_Rela);
 
   if (dyn_h->want_plt && dynamic_symbol)
     {
@@ -1537,7 +1538,7 @@
       else if (shared)
 	t = 2 * sizeof (Elf64_External_Rela);
 
-      hppa_info->plt_rel_sec->_raw_size += t;
+      hppa_info->plt_rel_sec->size += t;
     }
 
   return TRUE;
@@ -1647,7 +1648,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -1660,7 +1661,7 @@
 	 below.  */
       s = bfd_get_section_by_name (dynobj, ".rela.dlt");
       if (s != NULL)
-	s->_raw_size = 0;
+	s->size = 0;
     }
 
   /* Allocate the GOT entries.  */
@@ -1671,17 +1672,17 @@
       data.ofs = 0x0;
       elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
 				    allocate_global_data_dlt, &data);
-      hppa_info->dlt_sec->_raw_size = data.ofs;
+      hppa_info->dlt_sec->size = data.ofs;
 
       data.ofs = 0x0;
       elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
 				    allocate_global_data_plt, &data);
-      hppa_info->plt_sec->_raw_size = data.ofs;
+      hppa_info->plt_sec->size = data.ofs;
 
       data.ofs = 0x0;
       elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
 				    allocate_global_data_stub, &data);
-      hppa_info->stub_sec->_raw_size = data.ofs;
+      hppa_info->stub_sec->size = data.ofs;
     }
 
   /* Allocate space for entries in the .opd section.  */
@@ -1690,7 +1691,7 @@
       data.ofs = 0;
       elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table,
 				    allocate_global_data_opd, &data);
-      hppa_info->opd_sec->_raw_size = data.ofs;
+      hppa_info->opd_sec->size = data.ofs;
     }
 
   /* Now allocate space for dynamic relocations, if necessary.  */
@@ -1719,7 +1720,7 @@
       if (strcmp (name, ".plt") == 0)
 	{
 	  /* Strip this section if we don't need it; see the comment below.  */
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      strip = TRUE;
 	    }
@@ -1732,7 +1733,7 @@
       else if (strcmp (name, ".dlt") == 0)
 	{
 	  /* Strip this section if we don't need it; see the comment below.  */
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      strip = TRUE;
 	    }
@@ -1740,7 +1741,7 @@
       else if (strcmp (name, ".opd") == 0)
 	{
 	  /* Strip this section if we don't need it; see the comment below.  */
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      strip = TRUE;
 	    }
@@ -1754,7 +1755,7 @@
 	     sections.  The linker does that before adjust_dynamic_symbol
 	     is called, and it is that function which decides whether
 	     anything needs to go into these sections.  */
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is mostly to handle .rela.bss and
@@ -1820,8 +1821,8 @@
 	 garbage.  */
       if (s->contents == NULL)
 	{
-	  s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-	  if (s->contents == NULL && s->_raw_size != 0)
+	  s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+	  if (s->contents == NULL && s->size != 0)
 	    return FALSE;
 	}
     }
@@ -1832,7 +1833,7 @@
 	 the PLT, it is how we communicate the __gp value of a load
 	 module to the dynamic linker.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (!add_dynamic_entry (DT_HP_DLD_FLAGS, 0)
 	  || !add_dynamic_entry (DT_PLTGOT, 0))
@@ -2497,7 +2498,7 @@
       BFD_ASSERT (sdyn != NULL);
 
       dyncon = (Elf64_External_Dyn *) sdyn->contents;
-      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -2536,15 +2537,15 @@
 
 	    case DT_PLTRELSZ:
 	      s = hppa_info->plt_rel_sec;
-	      dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
 	    case DT_RELA:
 	      s = hppa_info->other_rel_sec;
-	      if (! s || ! s->_raw_size)
+	      if (! s || ! s->size)
 		s = hppa_info->dlt_rel_sec;
-	      if (! s || ! s->_raw_size)
+	      if (! s || ! s->size)
 		s = hppa_info->opd_rel_sec;
 	      dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
 	      bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
@@ -2552,16 +2553,16 @@
 
 	    case DT_RELASZ:
 	      s = hppa_info->other_rel_sec;
-	      dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      s = hppa_info->dlt_rel_sec;
-	      dyn.d_un.d_val += s->_raw_size;
+	      dyn.d_un.d_val += s->size;
 	      s = hppa_info->opd_rel_sec;
-	      dyn.d_un.d_val += s->_raw_size;
+	      dyn.d_un.d_val += s->size;
 	      /* There is some question about whether or not the size of
 		 the PLT relocs should be included here.  HP's tools do
 		 it, so we'll emulate them.  */
 	      s = hppa_info->plt_rel_sec;
-	      dyn.d_un.d_val += s->_raw_size;
+	      dyn.d_un.d_val += s->size;
 	      bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index fa3b494..ac9f96f 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -1,5 +1,5 @@
 /* MIPS-specific support for 64-bit ELF
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Ian Lance Taylor, Cygnus Support
    Linker support added by Mark Mitchell, CodeSourcery, LLC.
@@ -1621,7 +1621,7 @@
   relocation += symbol->section->output_section->vma;
   relocation += symbol->section->output_offset;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Set val to the offset into the section or symbol.  */
@@ -1736,7 +1736,7 @@
   if (ret != bfd_reloc_ok)
     return ret;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   if (bfd_is_com_section (symbol->section))
@@ -1984,7 +1984,7 @@
 
 	  if (! (*slurp_relocs) (abfd, s, syms, TRUE))
 	    return -1;
-	  count = s->_raw_size / elf_section_data (s)->this_hdr.sh_entsize * 3;
+	  count = s->size / elf_section_data (s)->this_hdr.sh_entsize * 3;
 	  p = s->relocation;
 	  for (i = 0; i < count; i++)
 	    *storage++ = p++;
@@ -2210,7 +2210,7 @@
 	 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)
+      if (asect->size == 0)
 	return TRUE;
 
       rel_hdr = &d->this_hdr;
@@ -2539,7 +2539,7 @@
 elf64_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 {
   int offset;
-  unsigned int raw_size;
+  unsigned int size;
 
   switch (note->descsz)
     {
@@ -2555,14 +2555,14 @@
 
 	/* pr_reg */
 	offset = 112;
-	raw_size = 360;
+	size = 360;
 
 	break;
     }
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
 static bfd_boolean
diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c
index 0e1da06..4a0c321 100644
--- a/bfd/elf64-mmix.c
+++ b/bfd/elf64-mmix.c
@@ -205,7 +205,7 @@
   PARAMS ((bfd *, asection *, int *));
 
 static bfd_boolean mmix_elf_add_symbol_hook
-  PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+  PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
 	   const char **, flagword *, asection **, bfd_vma *));
 
 static bfd_boolean mmix_elf_is_local_label_name
@@ -991,10 +991,7 @@
 	goto pcrel_mmix_reloc_fits;
       else
 	{
-	  bfd_size_type raw_size
-	    = (isec->_raw_size
-	       - mmix_elf_section_data (isec)->pjs.n_pushj_relocs
-	       * MAX_PUSHJ_STUB_SIZE);
+	  bfd_size_type size = isec->rawsize ? isec->rawsize : isec->size;
 
 	  /* We have the bytes at the PUSHJ insn and need to get the
 	     position for the stub.  There's supposed to be room allocated
@@ -1002,7 +999,7 @@
 	  bfd_byte *stubcontents
 	    = ((char *) datap
 	       - (addr - (isec->output_section->vma + isec->output_offset))
-	       + raw_size
+	       + size
 	       + mmix_elf_section_data (isec)->pjs.stub_offset);
 	  bfd_vma stubaddr;
 
@@ -1015,7 +1012,7 @@
 					   addr,
 					   isec->output_section->vma
 					   + isec->output_offset
-					   + raw_size
+					   + size
 					   + (mmix_elf_section_data (isec)
 					      ->pjs.stub_offset)
 					   - addr);
@@ -1025,7 +1022,7 @@
 	  stubaddr
 	    = (isec->output_section->vma
 	       + isec->output_offset
-	       + raw_size
+	       + size
 	       + mmix_elf_section_data (isec)->pjs.stub_offset);
 
 	  /* We generate a simple JMP if that suffices, else the whole 5
@@ -1045,9 +1042,8 @@
 					       value + addr - stubaddr);
 	      mmix_elf_section_data (isec)->pjs.stub_offset += 4;
 
-	      if (raw_size
-		  + mmix_elf_section_data (isec)->pjs.stub_offset
-		  > isec->_cooked_size)
+	      if (size + mmix_elf_section_data (isec)->pjs.stub_offset
+		  > isec->size)
 		abort ();
 
 	      return r;
@@ -1277,7 +1273,7 @@
     return bfd_reloc_undefined;
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
@@ -1342,16 +1338,20 @@
   struct elf_link_hash_entry **sym_hashes;
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
-  bfd_size_type raw_size
-    = (input_section->_raw_size
-       - mmix_elf_section_data (input_section)->pjs.n_pushj_relocs
-       * MAX_PUSHJ_STUB_SIZE);
+  bfd_size_type size;
   size_t pjsno = 0;
 
+  size = input_section->rawsize ? input_section->rawsize : input_section->size;
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (input_bfd);
   relend = relocs + input_section->reloc_count;
 
+  /* Zero the stub area before we start.  */
+  if (input_section->rawsize != 0
+      && input_section->size > input_section->rawsize)
+    memset (contents + input_section->rawsize, 0,
+	    input_section->size - input_section->rawsize);
+
   for (rel = relocs; rel < relend; rel ++)
     {
       reloc_howto_type *howto;
@@ -1421,7 +1421,7 @@
 						input_section
 						->output_section->vma
 						+ input_section->output_offset
-						+ raw_size
+						+ size
 						+ mmix_elf_section_data (input_section)
 						->pjs.stub_offset,
 						NULL, NULL) != bfd_reloc_ok)
@@ -1431,7 +1431,7 @@
 		     R_MMIX_JMP reloc.  */
 		  bfd_put_32 (output_bfd, JMP_INSN_BYTE << 24,
 			      contents
-			      + raw_size
+			      + size
 			      + mmix_elf_section_data (input_section)
 			      ->pjs.stub_offset);
 
@@ -1439,7 +1439,7 @@
 		     R_MMIX_JMP reloc.  */
 		  rel->r_info = ELF64_R_INFO (r_symndx, R_MMIX_JMP);
 		  rel->r_offset
-		    = (raw_size
+		    = (size
 		       + mmix_elf_section_data (input_section)
 		       ->pjs.stub_offset);
 
@@ -1474,9 +1474,11 @@
 	  sec = local_sections [r_symndx];
 	  relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
 
-	  name = bfd_elf_string_from_elf_section
-	    (input_bfd, symtab_hdr->sh_link, sym->st_name);
-	  name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name;
+	  name = bfd_elf_string_from_elf_section (input_bfd,
+						  symtab_hdr->sh_link,
+						  sym->st_name);
+	  if (name == NULL)
+	    name = bfd_section_name (input_bfd, sec);
 	}
       else
 	{
@@ -1486,6 +1488,7 @@
 				   r_symndx, symtab_hdr, sym_hashes,
 				   h, sec, relocation,
 				   unresolved_reloc, undefined_signalled);
+	  name = h->root.root.string;
 	}
 
       r = mmix_final_link_relocate (howto, input_section,
@@ -2024,14 +2027,14 @@
         /* This relocation describes the C++ object vtable hierarchy.
            Reconstruct it for later use during GC.  */
         case R_MMIX_GNU_VTINHERIT:
-          if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_MMIX_GNU_VTENTRY:
-          if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
 	}
@@ -2175,7 +2178,7 @@
 mmix_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd *abfd;
      struct bfd_link_info *info ATTRIBUTE_UNUSED;
-     const Elf_Internal_Sym *sym;
+     Elf_Internal_Sym *sym;
      const char **namep ATTRIBUTE_UNUSED;
      flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
@@ -2269,7 +2272,7 @@
       --abfd->section_count;
     }
 
-  if (! bfd_elf64_bfd_final_link (abfd, info))
+  if (! bfd_elf_final_link (abfd, info))
     return FALSE;
 
   /* Since this section is marked SEC_LINKER_CREATED, it isn't output by
@@ -2284,22 +2287,14 @@
 				     greg_section->output_section,
 				     greg_section->contents,
 				     (file_ptr) greg_section->output_offset,
-				     greg_section->_cooked_size))
+				     greg_section->size))
 	return FALSE;
     }
   return TRUE;
 }
 
 /* We need to include the maximum size of PUSHJ-stubs in the initial
-   section size.  This is expected to shrink during linker relaxation.
-
-   You might think that we should set *only* _cooked_size, but that won't
-   work: section contents allocation will be using _raw_size in mixed
-   format linking and not enough storage will be allocated.  FIXME: That's
-   a major bug, including the name bfd_get_section_size_before_reloc; it
-   should be bfd_get_section_size_before_relax.  The relaxation functions
-   set _cooked size.  Relaxation happens before relocation.  All functions
-   *after relaxation* should be using _cooked size.  */
+   section size.  This is expected to shrink during linker relaxation.  */
 
 static void
 mmix_set_relaxable_size (abfd, sec, ptr)
@@ -2314,11 +2309,9 @@
   if (mmix_elf_section_data (sec)->pjs.n_pushj_relocs == 0)
     return;
 
-  sec->_cooked_size
-    = (sec->_raw_size
-       + mmix_elf_section_data (sec)->pjs.n_pushj_relocs
-       * MAX_PUSHJ_STUB_SIZE);
-  sec->_raw_size = sec->_cooked_size;
+  sec->rawsize = sec->size;
+  sec->size += (mmix_elf_section_data (sec)->pjs.n_pushj_relocs
+		* MAX_PUSHJ_STUB_SIZE);
 
   /* For use in relocatable link, we start with a max stubs size.  See
      mmix_elf_relax_section.  */
@@ -2448,11 +2441,8 @@
 
   n_gregs = gregdata->n_allocated_bpo_gregs;
 
-  /* We need to have a _raw_size contents even though there's only
-     _cooked_size worth of data, since the generic relocation machinery
-     will allocate and copy that much temporarily.  */
   bpo_gregs_section->contents
-    = contents = bfd_alloc (bpo_greg_owner, bpo_gregs_section->_raw_size);
+    = contents = bfd_alloc (bpo_greg_owner, bpo_gregs_section->size);
   if (contents == NULL)
     return FALSE;
 
@@ -2599,21 +2589,13 @@
   size_t pjsno = 0;
   bfd *bpo_greg_owner;
   Elf_Internal_Sym *isymbuf = NULL;
-  bfd_size_type raw_size
-    = (sec->_raw_size
-       - mmix_elf_section_data (sec)->pjs.n_pushj_relocs
-       * MAX_PUSHJ_STUB_SIZE);
+  bfd_size_type size = sec->rawsize ? sec->rawsize : sec->size;
 
   mmix_elf_section_data (sec)->pjs.stubs_size_sum = 0;
 
   /* Assume nothing changes.  */
   *again = FALSE;
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (sec->_cooked_size == 0 && sec->_raw_size != 0)
-    abort ();
-
   /* We don't have to do anything if this section does not have relocs, or
      if this is not a code section.  */
   if ((sec->flags & SEC_RELOC) == 0
@@ -2685,7 +2667,7 @@
 				      0,
 				      bfd_arch_bits_per_address (abfd),
 				      /* Output-stub location.  */
-				      sec->output_section->_cooked_size
+				      sec->output_section->rawsize
 				      + (mmix_elf_section_data (sec
 							       ->output_section)
 					 ->pjs.stubs_size_sum)
@@ -2778,7 +2760,7 @@
 	  bfd_vma stubaddr
 	    = (sec->output_section->vma
 	       + sec->output_offset
-	       + raw_size
+	       + size
 	       + mmix_elf_section_data (sec)->pjs.stubs_size_sum);
 
 	  if ((value & 3) == 0
@@ -2889,7 +2871,7 @@
 	  *again = TRUE;
 	}
 
-      bpo_gregs_section->_cooked_size = (regindex + 1) * 8;
+      bpo_gregs_section->size = (regindex + 1) * 8;
     }
 
   if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents)
@@ -2907,15 +2889,12 @@
       && elf_section_data (sec)->relocs != internal_relocs)
     free (internal_relocs);
 
-  if (sec->_cooked_size
-      < raw_size + mmix_elf_section_data (sec)->pjs.stubs_size_sum)
+  if (sec->size < size + mmix_elf_section_data (sec)->pjs.stubs_size_sum)
     abort ();
 
-  if (sec->_cooked_size
-      > raw_size + mmix_elf_section_data (sec)->pjs.stubs_size_sum)
+  if (sec->size > size + mmix_elf_section_data (sec)->pjs.stubs_size_sum)
     {
-      sec->_cooked_size
-	= raw_size + mmix_elf_section_data (sec)->pjs.stubs_size_sum;
+      sec->size = size + mmix_elf_section_data (sec)->pjs.stubs_size_sum;
       *again = TRUE;
     }
 
@@ -2929,53 +2908,6 @@
     free (internal_relocs);
   return FALSE;
 }
-
-/* Because we set _raw_size to include the max size of pushj stubs,
-   i.e. larger than the actual section input size (see
-   mmix_set_relaxable_raw_size), we have to take care of that when reading
-   the section.  */
-
-static bfd_boolean
-mmix_elf_get_section_contents (abfd, section, location, offset, count)
-     bfd *abfd;
-     sec_ptr section;
-     void *location;
-     file_ptr offset;
-     bfd_size_type count;
-{
-  bfd_size_type raw_size
-    = (section->_raw_size
-       - mmix_elf_section_data (section)->pjs.n_pushj_relocs
-       * MAX_PUSHJ_STUB_SIZE);
-
-  if (offset + count > section->_raw_size)
-    {
-      abort();
-      bfd_set_error (bfd_error_invalid_operation);
-      return FALSE;
-    }
-
-  /* Check bounds against the faked raw_size.  */
-  if (offset + count > raw_size)
-    {
-      /* Clear the part in the faked area.  */
-      memset (location + raw_size - offset, 0, count - (raw_size - offset));
-
-      /* If there's no initial part within the "real" contents, we're
-         done.  */
-      if ((bfd_size_type) offset >= raw_size)
-	return TRUE;
-
-      /* Else adjust the count and fall through to call the generic
-         function.  */
-      count = raw_size - offset;
-    }
-
-  return
-    _bfd_generic_get_section_contents (abfd, section, location, offset,
-				       count);
-}
-
 
 #define ELF_ARCH		bfd_arch_mmix
 #define ELF_MACHINE_CODE 	EM_MMIX
@@ -3024,6 +2956,5 @@
 #define bfd_elf64_new_section_hook	mmix_elf_new_section_hook
 #define bfd_elf64_bfd_final_link	mmix_elf_final_link
 #define bfd_elf64_bfd_relax_section	mmix_elf_relax_section
-#define bfd_elf64_get_section_contents	mmix_elf_get_section_contents
 
 #include "elf64-target.h"
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index d8f0b5e..2b64041 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -82,6 +82,7 @@
 #define elf_backend_grok_psinfo		      ppc64_elf_grok_psinfo
 #define elf_backend_create_dynamic_sections   ppc64_elf_create_dynamic_sections
 #define elf_backend_copy_indirect_symbol      ppc64_elf_copy_indirect_symbol
+#define elf_backend_add_symbol_hook	      ppc64_elf_add_symbol_hook
 #define elf_backend_check_relocs	      ppc64_elf_check_relocs
 #define elf_backend_gc_mark_hook	      ppc64_elf_gc_mark_hook
 #define elf_backend_gc_sweep_hook	      ppc64_elf_gc_sweep_hook
@@ -2381,7 +2382,7 @@
 static bfd_boolean
 ppc64_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 {
-  size_t offset, raw_size;
+  size_t offset, size;
 
   if (note->descsz != 504)
     return FALSE;
@@ -2394,11 +2395,11 @@
 
   /* pr_reg */
   offset = 112;
-  raw_size = 384;
+  size = 384;
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
 static bfd_boolean
@@ -3474,6 +3475,22 @@
   return TRUE;
 }
 
+/* Hack symbols defined in .opd sections to be function type.  */
+
+static bfd_boolean
+ppc64_elf_add_symbol_hook (bfd *ibfd ATTRIBUTE_UNUSED,
+			   struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			   Elf_Internal_Sym *isym,
+			   const char **name ATTRIBUTE_UNUSED,
+			   flagword *flags ATTRIBUTE_UNUSED,
+			   asection **sec,
+			   bfd_vma *value ATTRIBUTE_UNUSED)
+{
+  if (strcmp (bfd_get_section_name (ibfd, *sec), ".opd") == 0)
+    isym->st_info = ELF_ST_INFO (ELF_ST_BIND (isym->st_info), STT_FUNC);
+  return TRUE;
+}
+
 static bfd_boolean
 update_local_sym_info (bfd *abfd, Elf_Internal_Shdr *symtab_hdr,
 		       unsigned long r_symndx, bfd_vma r_addend, int tls_type)
@@ -3627,7 +3644,7 @@
       };
       bfd_size_type amt;
 
-      amt = sec->_raw_size * sizeof (union opd_info) / 24;
+      amt = sec->size * sizeof (union opd_info) / 24;
       opd_sym_map = bfd_zalloc (abfd, amt);
       if (opd_sym_map == NULL)
 	return FALSE;
@@ -3791,14 +3808,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_PPC64_GNU_VTINHERIT:
-	  if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_PPC64_GNU_VTENTRY:
-	  if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
@@ -3871,7 +3888,7 @@
 	  if (ppc64_elf_section_data (sec)->t_symndx == NULL)
 	    {
 	      /* One extra to simplify get_tls_mask.  */
-	      bfd_size_type amt = sec->_raw_size * sizeof (unsigned) / 8 + 1;
+	      bfd_size_type amt = sec->size * sizeof (unsigned) / 8 + 1;
 	      ppc64_elf_section_data (sec)->t_symndx = bfd_zalloc (abfd, amt);
 	      if (ppc64_elf_section_data (sec)->t_symndx == NULL)
 		return FALSE;
@@ -4387,7 +4404,7 @@
 	      && ELF_ST_VISIBILITY (fdh->elf.other) == STV_DEFAULT)))
     {
       if (fdh->elf.dynindx == -1)
-	if (! bfd_elf64_link_record_dynamic_symbol (info, &fdh->elf))
+	if (! bfd_elf_link_record_dynamic_symbol (info, &fdh->elf))
 	  return FALSE;
       fdh->elf.elf_link_hash_flags
 	|= (fh->elf.elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR
@@ -4491,10 +4508,10 @@
 
   elf_link_hash_traverse (&htab->elf, func_desc_adjust, info);
 
-  htab->sfpr->_raw_size = ((MAX_SAVE_FPR + 2 - lowest_savef) * 4
-			   + (MAX_SAVE_FPR + 2 - lowest_restf) * 4);
+  htab->sfpr->size = ((MAX_SAVE_FPR + 2 - lowest_savef) * 4
+		      + (MAX_SAVE_FPR + 2 - lowest_restf) * 4);
 
-  if (htab->sfpr->_raw_size == 0)
+  if (htab->sfpr->size == 0)
     {
       if (!htab->have_undefweak)
 	{
@@ -4502,10 +4519,10 @@
 	  return TRUE;
 	}
 
-      htab->sfpr->_raw_size = 4;
+      htab->sfpr->size = 4;
     }
 
-  p = bfd_alloc (htab->elf.dynobj, htab->sfpr->_raw_size);
+  p = bfd_alloc (htab->elf.dynobj, htab->sfpr->size);
   if (p == NULL)
     return FALSE;
   htab->sfpr->contents = p;
@@ -4531,7 +4548,7 @@
       p += 4;
     }
   if (lowest_restf <= MAX_SAVE_FPR
-      || htab->sfpr->_raw_size == 4)
+      || htab->sfpr->size == 4)
     {
       bfd_put_32 (htab->elf.dynobj, BLR, p);
     }
@@ -4660,7 +4677,7 @@
      .rela.bss section we are going to use.  */
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
-      htab->relbss->_raw_size += sizeof (Elf64_External_Rela);
+      htab->relbss->size += sizeof (Elf64_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -4672,7 +4689,7 @@
 
   /* Apply the required alignment.  */
   s = htab->dynbss;
-  s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s))
     {
       if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two))
@@ -4681,10 +4698,10 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
@@ -4953,7 +4970,7 @@
       if (sec == NULL)
 	continue;
 
-      amt = sec->_raw_size * sizeof (long) / 24;
+      amt = sec->size * sizeof (long) / 24;
       adjust = ppc64_elf_section_data (sec)->opd.adjust;
       if (adjust == NULL)
 	{
@@ -5075,11 +5092,11 @@
 	     the third word of .opd entries.  */
 	  if ((sec->flags & SEC_IN_MEMORY) == 0)
 	    {
-	      bfd_byte *loc = bfd_alloc (ibfd, sec->_raw_size);
-	      if (loc == NULL
-		  || !bfd_get_section_contents (ibfd, sec, loc, 0,
-						sec->_raw_size))
+	      bfd_byte *loc;
+	      if (!bfd_malloc_and_get_section (ibfd, sec, &loc))
 		{
+		  if (loc != NULL)
+		    free (loc);
 		error_ret:
 		  if (local_syms != NULL
 		      && symtab_hdr->contents != (unsigned char *) local_syms)
@@ -5205,7 +5222,7 @@
 		}
 	    }
 
-	  sec->_cooked_size = wptr - sec->contents;
+	  sec->size = wptr - sec->contents;
 	  sec->reloc_count = write_rel - relstart;
 	  /* Fudge the size too, as this is used later in
 	     elf_bfd_final_link if we are emitting relocs.  */
@@ -5557,17 +5574,6 @@
   return TRUE;
 }
 
-/* This is the condition under which ppc64_elf_finish_dynamic_symbol
-   will be called from elflink.h.  If elflink.h doesn't call our
-   finish_dynamic_symbol routine, we'll need to do something about
-   initializing any .plt and .got entries in ppc64_elf_relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
-  ((DYN)								\
-   && ((SHARED)								\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Allocate space in .plt, .got and associated reloc sections for
    dynamic relocs.  */
 
@@ -5604,26 +5610,26 @@
 	    /* If this is the first .plt entry, make room for the special
 	       first entry.  */
 	    s = htab->plt;
-	    if (s->_raw_size == 0)
-	      s->_raw_size += PLT_INITIAL_ENTRY_SIZE;
+	    if (s->size == 0)
+	      s->size += PLT_INITIAL_ENTRY_SIZE;
 
-	    pent->plt.offset = s->_raw_size;
+	    pent->plt.offset = s->size;
 
 	    /* Make room for this entry.  */
-	    s->_raw_size += PLT_ENTRY_SIZE;
+	    s->size += PLT_ENTRY_SIZE;
 
 	    /* Make room for the .glink code.  */
 	    s = htab->glink;
-	    if (s->_raw_size == 0)
-	      s->_raw_size += GLINK_CALL_STUB_SIZE;
+	    if (s->size == 0)
+	      s->size += GLINK_CALL_STUB_SIZE;
 	    /* We need bigger stubs past index 32767.  */
-	    if (s->_raw_size >= GLINK_CALL_STUB_SIZE + 32768*2*4)
-	      s->_raw_size += 4;
-	    s->_raw_size += 2*4;
+	    if (s->size >= GLINK_CALL_STUB_SIZE + 32768*2*4)
+	      s->size += 4;
+	    s->size += 2*4;
 
 	    /* We also need to make an entry in the .rela.plt section.  */
 	    s = htab->relplt;
-	    s->_raw_size += sizeof (Elf64_External_Rela);
+	    s->size += sizeof (Elf64_External_Rela);
 	    doneone = TRUE;
 	  }
 	else
@@ -5677,7 +5683,7 @@
 	if (h->dynindx == -1
 	    && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	  {
-	    if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	    if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	      return FALSE;
 	  }
 
@@ -5689,15 +5695,15 @@
 	  }
 
 	s = ppc64_elf_tdata (gent->owner)->got;
-	gent->got.offset = s->_raw_size;
-	s->_raw_size
+	gent->got.offset = s->size;
+	s->size
 	  += (gent->tls_type & eh->tls_mask & (TLS_GD | TLS_LD)) ? 16 : 8;
 	dyn = htab->elf.dynamic_sections_created;
 	if ((info->shared
 	     || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
 	    && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 		|| h->root.type != bfd_link_hash_undefweak))
-	  ppc64_elf_tdata (gent->owner)->relgot->_raw_size
+	  ppc64_elf_tdata (gent->owner)->relgot->size
 	    += (gent->tls_type & eh->tls_mask & TLS_GD
 		? 2 * sizeof (Elf64_External_Rela)
 		: sizeof (Elf64_External_Rela));
@@ -5758,7 +5764,7 @@
 	  if (h->dynindx == -1
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	    {
-	      if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -5777,7 +5783,7 @@
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
       asection *sreloc = elf_section_data (p->sec)->sreloc;
-      sreloc->_raw_size += p->count * sizeof (Elf64_External_Rela);
+      sreloc->size += p->count * sizeof (Elf64_External_Rela);
     }
 
   return TRUE;
@@ -5837,7 +5843,7 @@
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  if (s == NULL)
 	    abort ();
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -5859,12 +5865,12 @@
       if (ppc64_tlsld_got (ibfd)->refcount > 0)
 	{
 	  s = ppc64_elf_tdata (ibfd)->got;
-	  ppc64_tlsld_got (ibfd)->offset = s->_raw_size;
-	  s->_raw_size += 16;
+	  ppc64_tlsld_got (ibfd)->offset = s->size;
+	  s->size += 16;
 	  if (info->shared)
 	    {
 	      srel = ppc64_elf_tdata (ibfd)->relgot;
-	      srel->_raw_size += sizeof (Elf64_External_Rela);
+	      srel->size += sizeof (Elf64_External_Rela);
 	    }
 	}
       else
@@ -5890,7 +5896,7 @@
 	      else if (p->count != 0)
 		{
 		  srel = elf_section_data (p->sec)->sreloc;
-		  srel->_raw_size += p->count * sizeof (Elf64_External_Rela);
+		  srel->size += p->count * sizeof (Elf64_External_Rela);
 		  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
 		    info->flags |= DF_TEXTREL;
 		}
@@ -5918,27 +5924,27 @@
 		  {
 		    if (ppc64_tlsld_got (ibfd)->offset == (bfd_vma) -1)
 		      {
-			ppc64_tlsld_got (ibfd)->offset = s->_raw_size;
-			s->_raw_size += 16;
+			ppc64_tlsld_got (ibfd)->offset = s->size;
+			s->size += 16;
 			if (info->shared)
-			  srel->_raw_size += sizeof (Elf64_External_Rela);
+			  srel->size += sizeof (Elf64_External_Rela);
 		      }
 		    ent->got.offset = ppc64_tlsld_got (ibfd)->offset;
 		  }
 		else
 		  {
-		    ent->got.offset = s->_raw_size;
+		    ent->got.offset = s->size;
 		    if ((ent->tls_type & *lgot_masks & TLS_GD) != 0)
 		      {
-			s->_raw_size += 16;
+			s->size += 16;
 			if (info->shared)
-			  srel->_raw_size += 2 * sizeof (Elf64_External_Rela);
+			  srel->size += 2 * sizeof (Elf64_External_Rela);
 		      }
 		    else
 		      {
-			s->_raw_size += 8;
+			s->size += 8;
 			if (info->shared)
-			  srel->_raw_size += sizeof (Elf64_External_Rela);
+			  srel->size += sizeof (Elf64_External_Rela);
 		      }
 		  }
 	      }
@@ -5959,10 +5965,6 @@
       if ((s->flags & SEC_LINKER_CREATED) == 0)
 	continue;
 
-      /* Reset _cooked_size since prelim layout will set it wrongly,
-	 and a non-zero _cooked_size sticks.  */
-      s->_cooked_size = 0;
-
       if (s == htab->brlt || s == htab->relbrlt)
 	/* These haven't been allocated yet;  don't strip.  */
 	continue;
@@ -5975,7 +5977,7 @@
 	}
       else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is mostly to handle .rela.bss and
@@ -6003,7 +6005,7 @@
 	  continue;
 	}
 
-      if (s->_raw_size == 0)
+      if (s->size == 0)
 	{
 	  _bfd_strip_section_from_output (info, s);
 	  continue;
@@ -6020,7 +6022,7 @@
 	 sections instead of garbage.
 	 We also rely on the section contents being zero when writing
 	 the GOT.  */
-      s->contents = bfd_zalloc (dynobj, s->_raw_size);
+      s->contents = bfd_zalloc (dynobj, s->size);
       if (s->contents == NULL)
 	return FALSE;
     }
@@ -6030,12 +6032,11 @@
       s = ppc64_elf_tdata (ibfd)->got;
       if (s != NULL && s != htab->got)
 	{
-	  s->_cooked_size = 0;
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    _bfd_strip_section_from_output (info, s);
 	  else
 	    {
-	      s->contents = bfd_zalloc (ibfd, s->_raw_size);
+	      s->contents = bfd_zalloc (ibfd, s->size);
 	      if (s->contents == NULL)
 		return FALSE;
 	    }
@@ -6043,12 +6044,11 @@
       s = ppc64_elf_tdata (ibfd)->relgot;
       if (s != NULL)
 	{
-	  s->_cooked_size = 0;
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    _bfd_strip_section_from_output (info, s);
 	  else
 	    {
-	      s->contents = bfd_zalloc (ibfd, s->_raw_size);
+	      s->contents = bfd_zalloc (ibfd, s->size);
 	      if (s->contents == NULL)
 		return FALSE;
 	      relocs = TRUE;
@@ -6065,7 +6065,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf64_add_dynamic_entry (info, (TAG), (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (info->executable)
 	{
@@ -6073,7 +6073,7 @@
 	    return FALSE;
 	}
 
-      if (htab->plt != NULL && htab->plt->_raw_size != 0)
+      if (htab->plt != NULL && htab->plt->size != 0)
 	{
 	  if (!add_dynamic_entry (DT_PLTGOT, 0)
 	      || !add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -6216,7 +6216,7 @@
   htab = ppc_hash_table (info);
 
   /* Make a note of the offset within the stubs for this entry.  */
-  stub_entry->stub_offset = stub_entry->stub_sec->_cooked_size;
+  stub_entry->stub_offset = stub_entry->stub_sec->size;
   loc = stub_entry->stub_sec->contents + stub_entry->stub_offset;
 
   htab->stub_count[stub_entry->stub_type - 1] += 1;
@@ -6393,7 +6393,7 @@
       return FALSE;
     }
 
-  stub_entry->stub_sec->_cooked_size += size;
+  stub_entry->stub_sec->size += size;
 
   if (htab->emit_stub_syms
       && !(stub_entry->stub_type == ppc_stub_plt_call
@@ -6468,7 +6468,7 @@
       off = (stub_entry->target_value
 	     + stub_entry->target_section->output_offset
 	     + stub_entry->target_section->output_section->vma);
-      off -= (stub_entry->stub_sec->_raw_size
+      off -= (stub_entry->stub_sec->size
 	      + stub_entry->stub_sec->output_offset
 	      + stub_entry->stub_sec->output_section->vma);
 
@@ -6503,11 +6503,11 @@
 	  if (br_entry->iter != htab->stub_iteration)
 	    {
 	      br_entry->iter = htab->stub_iteration;
-	      br_entry->offset = htab->brlt->_raw_size;
-	      htab->brlt->_raw_size += 8;
+	      br_entry->offset = htab->brlt->size;
+	      htab->brlt->size += 8;
 
 	      if (info->shared)
-		htab->relbrlt->_raw_size += sizeof (Elf64_External_Rela);
+		htab->relbrlt->size += sizeof (Elf64_External_Rela);
 	    }
 
 	  stub_entry->stub_type += ppc_stub_plt_branch - ppc_stub_long_branch;
@@ -6517,7 +6517,7 @@
 	}
     }
 
-  stub_entry->stub_sec->_raw_size += size;
+  stub_entry->stub_sec->size += size;
   return TRUE;
 }
 
@@ -6599,7 +6599,7 @@
     {
       bfd_vma addr = isec->output_offset + isec->output_section->vma;
       bfd_vma off = addr - htab->toc_curr;
-      if (off + isec->_raw_size > 0x10000)
+      if (off + isec->size > 0x10000)
 	{
 	  htab->toc_curr = addr;
 	  htab->multi_toc_needed = 1;
@@ -6640,7 +6640,7 @@
   if ((isec->flags & SEC_LINKER_CREATED) != 0)
     return 0;
 
-  if (isec->_raw_size == 0)
+  if (isec->size == 0)
     return 0;
 
   /* Hack for linux kernel.  .fixup contains branches, but only back to
@@ -6650,13 +6650,10 @@
   contents = elf_section_data (isec)->this_hdr.contents;
   if (contents == NULL)
     {
-      contents = bfd_malloc (isec->_raw_size);
-      if (contents == NULL)
-	return -1;
-      if (! bfd_get_section_contents (isec->owner, isec, contents,
-				      0, isec->_raw_size))
+      if (!bfd_malloc_and_get_section (isec->owner, isec, &contents))
 	{
-	  free (contents);
+	  if (contents != NULL)
+	    free (contents);
 	  return -1;
 	}
       if (info->keep_memory)
@@ -6666,7 +6663,7 @@
   /* Code scan, because we don't necessarily have relocs on calls to
      static functions.  */
   ret = 0;
-  for (i = 0; i < isec->_raw_size; i += 4)
+  for (i = 0; i < isec->size; i += 4)
     {
       unsigned long insn = bfd_get_32 (isec->owner, contents + i);
       /* Is this a branch?  */
@@ -6756,10 +6753,7 @@
 	  bfd_vma curr_toc;
 
 	  curr = tail;
-	  if (tail->_cooked_size)
-	    total = tail->_cooked_size;
-	  else
-	    total = tail->_raw_size;
+	  total = tail->size;
 	  big_sec = total >= stub_group_size;
 	  curr_toc = htab->stub_group[tail->id].toc_off;
 
@@ -7085,17 +7079,11 @@
 	   stub_sec != NULL;
 	   stub_sec = stub_sec->next)
 	if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
-	  {
-	    stub_sec->_raw_size = 0;
-	    stub_sec->_cooked_size = 0;
-	  }
-      htab->brlt->_raw_size = 0;
-      htab->brlt->_cooked_size = 0;
+	  stub_sec->size = 0;
+
+      htab->brlt->size = 0;
       if (info->shared)
-	{
-	  htab->relbrlt->_raw_size = 0;
-	  htab->relbrlt->_cooked_size = 0;
-	}
+	htab->relbrlt->size = 0;
 
       bfd_hash_traverse (&htab->stub_hash_table, ppc_size_one_stub, info);
 
@@ -7182,22 +7170,21 @@
   int stub_sec_count = 0;
 
   htab->emit_stub_syms = emit_stub_syms;
+
+  /* Allocate memory to hold the linker stubs.  */
   for (stub_sec = htab->stub_bfd->sections;
        stub_sec != NULL;
        stub_sec = stub_sec->next)
-    if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
+    if ((stub_sec->flags & SEC_LINKER_CREATED) == 0
+	&& stub_sec->size != 0)
       {
-	bfd_size_type size;
-
-	/* Allocate memory to hold the linker stubs.  */
-	size = stub_sec->_raw_size;
-	if (size != 0)
-	  {
-	    stub_sec->contents = bfd_zalloc (htab->stub_bfd, size);
-	    if (stub_sec->contents == NULL)
-	      return FALSE;
-	  }
-	stub_sec->_cooked_size = 0;
+	stub_sec->contents = bfd_zalloc (htab->stub_bfd, stub_sec->size);
+	if (stub_sec->contents == NULL)
+	  return FALSE;
+	/* We want to check that built size is the same as calculated
+	   size.  rawsize is a convenient location to use.  */
+	stub_sec->rawsize = stub_sec->size;
+	stub_sec->size = 0;
       }
 
   if (htab->plt != NULL)
@@ -7271,7 +7258,7 @@
 
       /* Build the .glink lazy link call stubs.  */
       indx = 0;
-      while (p < htab->glink->contents + htab->glink->_raw_size)
+      while (p < htab->glink->contents + htab->glink->size)
 	{
 	  if (indx < 0x8000)
 	    {
@@ -7290,20 +7277,20 @@
 	  indx++;
 	  p += 4;
 	}
-      htab->glink->_cooked_size = p - htab->glink->contents;
+      htab->glink->rawsize = p - htab->glink->contents;
     }
 
-  if (htab->brlt->_raw_size != 0)
+  if (htab->brlt->size != 0)
     {
       htab->brlt->contents = bfd_zalloc (htab->brlt->owner,
-					 htab->brlt->_raw_size);
+					 htab->brlt->size);
       if (htab->brlt->contents == NULL)
 	return FALSE;
     }
-  if (info->shared && htab->relbrlt->_raw_size != 0)
+  if (info->shared && htab->relbrlt->size != 0)
     {
       htab->relbrlt->contents = bfd_zalloc (htab->relbrlt->owner,
-					    htab->relbrlt->_raw_size);
+					    htab->relbrlt->size);
       if (htab->relbrlt->contents == NULL)
 	return FALSE;
     }
@@ -7317,12 +7304,12 @@
     if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
       {
 	stub_sec_count += 1;
-	if (stub_sec->_raw_size != stub_sec->_cooked_size)
+	if (stub_sec->rawsize != stub_sec->size)
 	  break;
       }
 
   if (stub_sec != NULL
-      || htab->glink->_raw_size != htab->glink->_cooked_size)
+      || htab->glink->rawsize != htab->glink->size)
     {
       htab->stub_error = TRUE;
       (*_bfd_error_handler) (_("stubs don't match calculated size"));
@@ -7911,7 +7898,7 @@
 	    {
 	      bfd_boolean can_plt_call = 0;
 
-	      if (rel->r_offset + 8 <= input_section->_cooked_size)
+	      if (rel->r_offset + 8 <= input_section->size)
 		{
 		  insn = bfd_get_32 (input_bfd, contents + rel->r_offset + 4);
 		  if (insn == NOP
@@ -7989,8 +7976,8 @@
 		 blr.  We can thus call a weak function without first
 		 checking whether the function is defined.  We have a
 		 blr at the end of .sfpr.  */
-	      BFD_ASSERT (htab->sfpr->_raw_size != 0);
-	      relocation = (htab->sfpr->_raw_size - 4
+	      BFD_ASSERT (htab->sfpr->size != 0);
+	      relocation = (htab->sfpr->size - 4
 			    + htab->sfpr->output_offset
 			    + htab->sfpr->output_section->vma);
 	      from = (rel->r_offset
@@ -8000,7 +7987,7 @@
 	      /* But let's not be silly about it.  If the blr isn't in
 		 reach, just go to the next instruction.  */
 	      if (relocation - from + (1 << 25) >= (1 << 26)
-		  || htab->sfpr->_raw_size == 0)
+		  || htab->sfpr->size == 0)
 		relocation = from + 4;
 	    }
 	  break;
@@ -8893,7 +8880,7 @@
 	abort ();
 
       dyncon = (Elf64_External_Dyn *) sdyn->contents;
-      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -8927,7 +8914,7 @@
 	      s = bfd_get_section_by_name (output_bfd, ".opd");
 	      if (s == NULL)
 		continue;
-	      dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      break;
 
 	    case DT_PLTGOT:
@@ -8941,7 +8928,7 @@
 	      break;
 
 	    case DT_PLTRELSZ:
-	      dyn.d_un.d_val = htab->relplt->_raw_size;
+	      dyn.d_un.d_val = htab->relplt->size;
 	      break;
 
 	    case DT_RELASZ:
@@ -8950,7 +8937,7 @@
 	      s = htab->relplt;
 	      if (s == NULL)
 		continue;
-	      dyn.d_un.d_val -= s->_raw_size;
+	      dyn.d_un.d_val -= s->size;
 	      break;
 
 	    case DT_RELA:
@@ -8962,7 +8949,7 @@
 		continue;
 	      if (dyn.d_un.d_ptr != s->output_section->vma + s->output_offset)
 		continue;
-	      dyn.d_un.d_ptr += s->_raw_size;
+	      dyn.d_un.d_ptr += s->size;
 	      break;
 	    }
 
@@ -8970,7 +8957,7 @@
 	}
     }
 
-  if (htab->got != NULL && htab->got->_raw_size != 0)
+  if (htab->got != NULL && htab->got->size != 0)
     {
       /* Fill in the first entry in the global offset table.
 	 We use it to hold the link-time TOCbase.  */
@@ -8982,7 +8969,7 @@
       elf_section_data (htab->got->output_section)->this_hdr.sh_entsize = 8;
     }
 
-  if (htab->plt != NULL && htab->plt->_raw_size != 0)
+  if (htab->plt != NULL && htab->plt->size != 0)
     {
       /* Set .plt entry size.  */
       elf_section_data (htab->plt->output_section)->this_hdr.sh_entsize
@@ -8996,19 +8983,19 @@
       asection *s;
       s = ppc64_elf_tdata (dynobj)->got;
       if (s != NULL
-	  && s->_raw_size != 0
+	  && s->size != 0
 	  && s->output_section != bfd_abs_section_ptr
 	  && !bfd_set_section_contents (output_bfd, s->output_section,
 					s->contents, s->output_offset,
-					s->_raw_size))
+					s->size))
 	return FALSE;
       s = ppc64_elf_tdata (dynobj)->relgot;
       if (s != NULL
-	  && s->_raw_size != 0
+	  && s->size != 0
 	  && s->output_section != bfd_abs_section_ptr
 	  && !bfd_set_section_contents (output_bfd, s->output_section,
 					s->contents, s->output_offset,
-					s->_raw_size))
+					s->size))
 	return FALSE;
     }
 
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 3bf26bc..2c3246f 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -432,7 +432,7 @@
   if (output_bfd != NULL)
     return bfd_reloc_continue;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   relocation = (symbol->value
@@ -1309,14 +1309,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_390_GNU_VTINHERIT:
-	  if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_390_GNU_VTENTRY:
-	  if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
@@ -1658,7 +1658,7 @@
      runtime process image.  */
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
-      htab->srelbss->_raw_size += sizeof (Elf64_External_Rela);
+      htab->srelbss->size += sizeof (Elf64_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -1670,7 +1670,7 @@
 
   /* Apply the required alignment.  */
   s = htab->sdynbss;
-  s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s))
     {
       if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two))
@@ -1679,25 +1679,14 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
 
-/* This is the condition under which elf_s390_finish_dynamic_symbol
-   will be called from elflink.h.  If elflink.h doesn't call our
-   finish_dynamic_symbol routine, we'll need to do something about
-   initializing any .plt and .got entries in elf_s390_relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
-  ((DYN)								\
-   && ((SHARED)								\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Allocate space in .plt, .got and associated reloc sections for
    dynamic relocs.  */
 
@@ -1733,7 +1722,7 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -1744,10 +1733,10 @@
 
 	  /* If this is the first .plt entry, make room for the special
 	     first entry.  */
-	  if (s->_raw_size == 0)
-	    s->_raw_size += PLT_FIRST_ENTRY_SIZE;
+	  if (s->size == 0)
+	    s->size += PLT_FIRST_ENTRY_SIZE;
 
-	  h->plt.offset = s->_raw_size;
+	  h->plt.offset = s->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
@@ -1762,14 +1751,14 @@
 	    }
 
 	  /* Make room for this entry.  */
-	  s->_raw_size += PLT_ENTRY_SIZE;
+	  s->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.  */
-	  htab->sgotplt->_raw_size += GOT_ENTRY_SIZE;
+	  htab->sgotplt->size += GOT_ENTRY_SIZE;
 
 	  /* We also need to make an entry in the .rela.plt section.  */
-	  htab->srelplt->_raw_size += sizeof (Elf64_External_Rela);
+	  htab->srelplt->size += sizeof (Elf64_External_Rela);
 	}
       else
 	{
@@ -1799,8 +1788,8 @@
 	   to be stored somewhere. The immediate value in the instruction
 	   is not bit enough so the value is stored in the got.  */
 	{
-	  h->got.offset = htab->sgot->_raw_size;
-	  htab->sgot->_raw_size += GOT_ENTRY_SIZE;
+	  h->got.offset = htab->sgot->size;
+	  htab->sgot->size += GOT_ENTRY_SIZE;
 	}
       else
 	h->got.offset = (bfd_vma) -1;
@@ -1816,29 +1805,29 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       s = htab->sgot;
-      h->got.offset = s->_raw_size;
-      s->_raw_size += GOT_ENTRY_SIZE;
+      h->got.offset = s->size;
+      s->size += GOT_ENTRY_SIZE;
       /* R_390_TLS_GD64 needs 2 consecutive GOT slots.  */
       if (tls_type == GOT_TLS_GD)
-	s->_raw_size += GOT_ENTRY_SIZE;
+	s->size += GOT_ENTRY_SIZE;
       dyn = htab->elf.dynamic_sections_created;
       /* R_390_TLS_IE64 needs one dynamic relocation,
 	 R_390_TLS_GD64 needs one if local symbol and two if global.  */
       if ((tls_type == GOT_TLS_GD && h->dynindx == -1)
 	  || tls_type >= GOT_TLS_IE)
-	htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
+	htab->srelgot->size += sizeof (Elf64_External_Rela);
       else if (tls_type == GOT_TLS_GD)
-	htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela);
+	htab->srelgot->size += 2 * sizeof (Elf64_External_Rela);
       else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 		|| h->root.type != bfd_link_hash_undefweak)
 	       && (info->shared
 		   || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
-	htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
+	htab->srelgot->size += sizeof (Elf64_External_Rela);
     }
   else
     h->got.offset = (bfd_vma) -1;
@@ -1894,7 +1883,7 @@
 	  if (h->dynindx == -1
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	    {
-	      if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -1913,7 +1902,7 @@
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
       asection *sreloc = elf_section_data (p->sec)->sreloc;
-      sreloc->_raw_size += p->count * sizeof (Elf64_External_Rela);
+      sreloc->size += p->count * sizeof (Elf64_External_Rela);
     }
 
   return TRUE;
@@ -1976,7 +1965,7 @@
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  if (s == NULL)
 	    abort ();
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -2015,7 +2004,7 @@
 	      else if (p->count != 0)
 		{
 		  srela = elf_section_data (p->sec)->sreloc;
-		  srela->_raw_size += p->count * sizeof (Elf64_External_Rela);
+		  srela->size += p->count * sizeof (Elf64_External_Rela);
 		  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
 		    info->flags |= DF_TEXTREL;
 		}
@@ -2036,12 +2025,12 @@
 	{
 	  if (*local_got > 0)
 	    {
-	      *local_got = s->_raw_size;
-	      s->_raw_size += GOT_ENTRY_SIZE;
+	      *local_got = s->size;
+	      s->size += GOT_ENTRY_SIZE;
 	      if (*local_tls_type == GOT_TLS_GD)
-		s->_raw_size += GOT_ENTRY_SIZE;
+		s->size += GOT_ENTRY_SIZE;
 	      if (info->shared)
-		srela->_raw_size += sizeof (Elf64_External_Rela);
+		srela->size += sizeof (Elf64_External_Rela);
 	    }
 	  else
 	    *local_got = (bfd_vma) -1;
@@ -2052,9 +2041,9 @@
     {
       /* Allocate 2 got entries and 1 dynamic reloc for R_390_TLS_LDM64
 	 relocs.  */
-      htab->tls_ldm_got.offset = htab->sgot->_raw_size;
-      htab->sgot->_raw_size += 2 * GOT_ENTRY_SIZE;
-      htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
+      htab->tls_ldm_got.offset = htab->sgot->size;
+      htab->sgot->size += 2 * GOT_ENTRY_SIZE;
+      htab->srelgot->size += sizeof (Elf64_External_Rela);
     }
   else
     htab->tls_ldm_got.offset = -1;
@@ -2080,7 +2069,7 @@
 	}
       else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
 	{
-	  if (s->_raw_size != 0 && s != htab->srelplt)
+	  if (s->size != 0 && s != htab->srelplt)
 	    relocs = TRUE;
 
 	  /* We use the reloc_count field as a counter if we need
@@ -2093,7 +2082,7 @@
 	  continue;
 	}
 
-      if (s->_raw_size == 0)
+      if (s->size == 0)
 	{
 	  /* If we don't need this section, strip it from the
 	     output file.  This is to handle .rela.bss and
@@ -2114,7 +2103,7 @@
 	 section's contents are written out.  This should not happen,
 	 but this way if it does, we get a R_390_NONE reloc instead
 	 of garbage.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
       if (s->contents == NULL)
 	return FALSE;
     }
@@ -2127,7 +2116,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (info->executable)
 	{
@@ -2135,7 +2124,7 @@
 	    return FALSE;
 	}
 
-      if (htab->splt->_raw_size != 0)
+      if (htab->splt->size != 0)
 	{
 	  if (!add_dynamic_entry (DT_PLTGOT, 0)
 	      || !add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -3282,7 +3271,7 @@
 	abort ();
 
       dyncon = (Elf64_External_Dyn *) sdyn->contents;
-      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -3305,10 +3294,7 @@
 
 	    case DT_PLTRELSZ:
 	      s = htab->srelplt->output_section;
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size;
-	      else
-		dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      break;
 
 	    case DT_RELASZ:
@@ -3320,10 +3306,7 @@
 		 other relocation sections, we don't have to worry
 		 about changing the DT_RELA entry.  */
 	      s = htab->srelplt->output_section;
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val -= s->_cooked_size;
-	      else
-		dyn.d_un.d_val -= s->_raw_size;
+	      dyn.d_un.d_val -= s->size;
 	      break;
 	    }
 
@@ -3331,7 +3314,7 @@
 	}
 
       /* Fill in the special first entry in the procedure linkage table.  */
-      if (htab->splt && htab->splt->_raw_size > 0)
+      if (htab->splt && htab->splt->size > 0)
 	{
 	  /* fill in blueprint for plt 0 entry */
 	  bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD0,
@@ -3362,7 +3345,7 @@
   if (htab->sgotplt)
     {
       /* Fill in the first three entries in the global offset table.  */
-      if (htab->sgotplt->_raw_size > 0)
+      if (htab->sgotplt->size > 0)
 	{
 	  bfd_put_64 (output_bfd,
 		      (sdyn == NULL ? (bfd_vma) 0
@@ -3380,6 +3363,17 @@
   return TRUE;
 }
 
+/* Return address for Ith PLT stub in section PLT, for relocation REL
+   or (bfd_vma) -1 if it should not be included.  */
+
+static bfd_vma
+elf_s390_plt_sym_val (bfd_vma i, const asection *plt,
+		      const arelent *rel ATTRIBUTE_UNUSED)
+{
+  return plt->vma + PLT_FIRST_ENTRY_SIZE + i * PLT_ENTRY_SIZE;
+}
+
+
 /* Why was the hash table entry size definition changed from
    ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and
    this is the only reason for the s390_elf64_size_info structure.  */
@@ -3449,6 +3443,7 @@
 #define elf_backend_relocate_section	      elf_s390_relocate_section
 #define elf_backend_size_dynamic_sections     elf_s390_size_dynamic_sections
 #define elf_backend_reloc_type_class	      elf_s390_reloc_type_class
+#define elf_backend_plt_sym_val		      elf_s390_plt_sym_val
 
 #define bfd_elf64_mkobject		elf_s390_mkobject
 #define elf_backend_object_p		elf_s390_object_p
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index 03196c5..e94aff1 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -1,5 +1,5 @@
 /* SuperH SH64-specific support for 64-bit ELF
-   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -141,7 +141,7 @@
 static int sh64_elf64_get_symbol_type
   (Elf_Internal_Sym *, int);
 static bfd_boolean sh64_elf64_add_symbol_hook
-  (bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, const char **,
+  (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **,
    flagword *, asection **, bfd_vma *);
 static bfd_boolean sh64_elf64_link_output_symbol_hook
   (struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *,
@@ -2191,7 +2191,7 @@
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
 
   memcpy (data, elf_section_data (input_section)->this_hdr.contents,
-	  input_section->_raw_size);
+	  input_section->size);
 
   if ((input_section->flags & SEC_RELOC) != 0
       && input_section->reloc_count > 0)
@@ -2562,14 +2562,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
         case R_SH_GNU_VTINHERIT:
-          if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+          if (!bfd_elf_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_SH_GNU_VTENTRY:
-          if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+          if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
 
@@ -2619,7 +2619,7 @@
 		  if (hsh->datalabel_got_offset != (bfd_vma) -1)
 		    break;
 
-		  hsh->datalabel_got_offset = sgot->_raw_size;
+		  hsh->datalabel_got_offset = sgot->size;
 		}
 	      else
 		{
@@ -2628,17 +2628,17 @@
 		      /* We have already allocated space in the .got.  */
 		      break;
 		    }
-		  h->got.offset = sgot->_raw_size;
+		  h->got.offset = sgot->size;
 		}
 
 	      /* Make sure this symbol is output as a dynamic symbol.  */
 	      if (h->dynindx == -1)
 		{
-		  if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+		  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		    return FALSE;
 		}
 
-	      srelgot->_raw_size += sizeof (Elf64_External_Rela);
+	      srelgot->size += sizeof (Elf64_External_Rela);
 	    }
 	  else
 	    {
@@ -2671,7 +2671,7 @@
 		      break;
 		    }
 		  local_got_offsets[symtab_hdr->sh_info
-				    + r_symndx] = sgot->_raw_size;
+				    + r_symndx] = sgot->size;
 		}
 	      else
 		{
@@ -2680,7 +2680,7 @@
 		      /* We have already allocated space in the .got.  */
 		      break;
 		    }
-		  local_got_offsets[r_symndx] = sgot->_raw_size;
+		  local_got_offsets[r_symndx] = sgot->size;
 		}
 
 	      if (info->shared)
@@ -2688,11 +2688,11 @@
 		  /* If we are generating a shared object, we need to
 		     output a R_SH_RELATIVE reloc so that the dynamic
 		     linker can adjust this GOT entry.  */
-		  srelgot->_raw_size += sizeof (Elf64_External_Rela);
+		  srelgot->size += sizeof (Elf64_External_Rela);
 		}
 	    }
 
-	  sgot->_raw_size += 8;
+	  sgot->size += 8;
 
 	  break;
 
@@ -2717,7 +2717,7 @@
 	  /* Make sure this symbol is output as a dynamic symbol.  */
 	  if (h->dynindx == -1)
 	    {
-	      if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -2809,7 +2809,7 @@
 		    }
 		}
 
-	      sreloc->_raw_size += sizeof (Elf64_External_Rela);
+	      sreloc->size += sizeof (Elf64_External_Rela);
 
 	      /* If we are linking with -Bsymbolic, and this is a
 		 global symbol, we count the number of PC relative
@@ -2887,7 +2887,7 @@
 
 static bfd_boolean
 sh64_elf64_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
-			    const Elf_Internal_Sym *sym, const char **namep,
+			    Elf_Internal_Sym *sym, const char **namep,
 			    flagword *flagsp ATTRIBUTE_UNUSED,
 			    asection **secp, bfd_vma *valp)
 {
@@ -3299,7 +3299,7 @@
       h->type = STT_OBJECT;
 
       if (info->shared
-	  && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+	  && ! bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
     }
 
@@ -3425,7 +3425,7 @@
       /* Make sure this symbol is output as a dynamic symbol.  */
       if (h->dynindx == -1)
 	{
-	  if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -3434,8 +3434,8 @@
 
       /* 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 (s->size == 0)
+	s->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
@@ -3446,26 +3446,26 @@
 	  && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
 	{
 	  h->root.u.def.section = s;
-	  h->root.u.def.value = s->_raw_size;
+	  h->root.u.def.value = s->size;
 	}
 
-      h->plt.offset = s->_raw_size;
+      h->plt.offset = s->size;
 
       /* Make room for this entry.  */
-      s->_raw_size += elf_sh64_sizeof_plt (info);
+      s->size += elf_sh64_sizeof_plt (info);
 
       /* We also need to make an entry in the .got.plt section, which
 	 will be placed in the .got section by the linker script.  */
 
       s = bfd_get_section_by_name (dynobj, ".got.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += 8;
+      s->size += 8;
 
       /* We also need to make an entry in the .rela.plt section.  */
 
       s = bfd_get_section_by_name (dynobj, ".rela.plt");
       BFD_ASSERT (s != NULL);
-      s->_raw_size += sizeof (Elf64_External_Rela);
+      s->size += sizeof (Elf64_External_Rela);
 
       return TRUE;
     }
@@ -3520,7 +3520,7 @@
 
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf64_External_Rela);
+      srel->size += sizeof (Elf64_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -3531,8 +3531,7 @@
     power_of_two = 3;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (! bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -3541,10 +3540,10 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
@@ -3570,7 +3569,7 @@
     return TRUE;
 
   for (s = h->pcrel_relocs_copied; s != NULL; s = s->next)
-    s->section->_raw_size -= s->count * sizeof (Elf64_External_Rela);
+    s->section->size -= s->count * sizeof (Elf64_External_Rela);
 
   return TRUE;
 }
@@ -3597,7 +3596,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -3610,7 +3609,7 @@
 	 below.  */
       s = bfd_get_section_by_name (dynobj, ".rela.got");
       if (s != NULL)
-	s->_raw_size = 0;
+	s->size = 0;
     }
 
   /* If this is a -Bsymbolic shared link, then we need to discard all
@@ -3643,7 +3642,7 @@
 
       if (strcmp (name, ".plt") == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* Strip this section if we don't need it; see the
 		 comment below.  */
@@ -3657,7 +3656,7 @@
 	}
       else if (strncmp (name, ".rela", 5) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is mostly to handle .rela.bss and
@@ -3714,8 +3713,8 @@
 	}
 
       /* Allocate memory for the section contents.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
     }
 
@@ -3728,31 +3727,31 @@
 	 dynamic linker and used by the debugger.  */
       if (info->executable)
 	{
-	  if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0))
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_DEBUG, 0))
 	    return FALSE;
 	}
 
       if (plt)
 	{
-	  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))
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_PLTGOT, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_PLTRELSZ, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_PLTREL, DT_RELA)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_JMPREL, 0))
 	    return FALSE;
 	}
 
       if (relocs)
 	{
-	  if (! bfd_elf64_add_dynamic_entry (info, DT_RELA, 0)
-	      || ! bfd_elf64_add_dynamic_entry (info, DT_RELASZ, 0)
-	      || ! bfd_elf64_add_dynamic_entry (info, DT_RELAENT,
-						sizeof (Elf64_External_Rela)))
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_RELA, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_RELASZ, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_RELAENT,
+					      sizeof (Elf64_External_Rela)))
 	    return FALSE;
 	}
 
       if (reltext)
 	{
-	  if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0))
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_TEXTREL, 0))
 	    return FALSE;
 	}
     }
@@ -3984,7 +3983,7 @@
       BFD_ASSERT (sdyn != NULL);
 
       dyncon = (Elf64_External_Dyn *) sdyn->contents;
-      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -4034,10 +4033,7 @@
 	    case DT_PLTRELSZ:
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      BFD_ASSERT (s != NULL);
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size;
-	      else
-		dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 
@@ -4053,12 +4049,7 @@
 		 about changing the DT_RELA entry.  */
 	      s = bfd_get_section_by_name (output_bfd, ".rela.plt");
 	      if (s != NULL)
-		{
-		  if (s->_cooked_size != 0)
-		    dyn.d_un.d_val -= s->_cooked_size;
-		  else
-		    dyn.d_un.d_val -= s->_raw_size;
-		}
+		dyn.d_un.d_val -= s->size;
 	      bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
 	      break;
 	    }
@@ -4066,7 +4057,7 @@
 
       /* Fill in the first entry in the procedure linkage table.  */
       splt = bfd_get_section_by_name (dynobj, ".plt");
-      if (splt && splt->_raw_size > 0)
+      if (splt && splt->size > 0)
 	{
 	  if (info->shared)
 	    {
@@ -4102,7 +4093,7 @@
     }
 
   /* Fill in the first three entries in the global offset table.  */
-  if (sgot->_raw_size > 0)
+  if (sgot->size > 0)
     {
       if (sdyn == NULL)
 	bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents);
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index 001f3a5..75704e2 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -1,6 +1,6 @@
 /* SPARC-specific support for 64-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003 Free Software Foundation, Inc.
+   2003, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -61,7 +61,7 @@
 static int sparc64_elf_get_symbol_type
   PARAMS (( Elf_Internal_Sym *, int));
 static bfd_boolean sparc64_elf_add_symbol_hook
-  PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+  PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
 	   const char **, flagword *, asection **, bfd_vma *));
 static bfd_boolean sparc64_elf_output_arch_syms
   PARAMS ((bfd *, struct bfd_link_info *, PTR,
@@ -478,7 +478,7 @@
 	 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)
+      if (asect->size == 0)
 	return TRUE;
 
       rel_hdr = &d->this_hdr;
@@ -809,7 +809,7 @@
   if (output_bfd != NULL)
     return bfd_reloc_continue;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   relocation = (symbol->value
@@ -1173,16 +1173,16 @@
 		  /* We have already allocated space in the .got.  */
 		  break;
 		}
-	      h->got.offset = sgot->_raw_size;
+	      h->got.offset = sgot->size;
 
 	      /* Make sure this symbol is output as a dynamic symbol.  */
 	      if (h->dynindx == -1)
 		{
-		  if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+		  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		    return FALSE;
 		}
 
-	      srelgot->_raw_size += sizeof (Elf64_External_Rela);
+	      srelgot->size += sizeof (Elf64_External_Rela);
 	    }
 	  else
 	    {
@@ -1207,18 +1207,18 @@
 		  /* We have already allocated space in the .got.  */
 		  break;
 		}
-	      local_got_offsets[r_symndx] = sgot->_raw_size;
+	      local_got_offsets[r_symndx] = sgot->size;
 
 	      if (info->shared)
 		{
 		  /* If we are generating a shared object, we need to
                      output a R_SPARC_RELATIVE reloc so that the
                      dynamic linker can adjust this GOT entry.  */
-		  srelgot->_raw_size += sizeof (Elf64_External_Rela);
+		  srelgot->size += sizeof (Elf64_External_Rela);
 		}
 	    }
 
-	  sgot->_raw_size += 8;
+	  sgot->size += 8;
 
 #if 0
 	  /* Doesn't work for 64-bit -fPIC, since sethi/or builds
@@ -1229,7 +1229,7 @@
 	  /* If the .got section is more than 0x1000 bytes, we add
 	     0x1000 to the value of _GLOBAL_OFFSET_TABLE_, so that 13
 	     bit relocations have a greater chance of working.  */
-	  if (sgot->_raw_size >= 0x1000
+	  if (sgot->size >= 0x1000
 	      && elf_hash_table (info)->hgot->root.u.def.value == 0)
 	    elf_hash_table (info)->hgot->root.u.def.value = 0x1000;
 #endif
@@ -1261,7 +1261,7 @@
 	  /* Make sure this symbol is output as a dynamic symbol.  */
 	  if (h->dynindx == -1)
 	    {
-	      if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -1359,7 +1359,7 @@
 		    info->flags |= DF_TEXTREL;
 		}
 
-	      sreloc->_raw_size += sizeof (Elf64_External_Rela);
+	      sreloc->size += sizeof (Elf64_External_Rela);
 	    }
 	  break;
 
@@ -1385,7 +1385,7 @@
 sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd *abfd;
      struct bfd_link_info *info;
-     const Elf_Internal_Sym *sym;
+     Elf_Internal_Sym *sym;
      const char **namep;
      flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp ATTRIBUTE_UNUSED;
@@ -1653,11 +1653,11 @@
       BFD_ASSERT (s != NULL);
 
       /* The first four bit in .plt is reserved.  */
-      if (s->_raw_size == 0)
-	s->_raw_size = PLT_HEADER_SIZE;
+      if (s->size == 0)
+	s->size = PLT_HEADER_SIZE;
 
       /* To simplify matters later, just store the plt index here.  */
-      h->plt.offset = s->_raw_size / PLT_ENTRY_SIZE;
+      h->plt.offset = s->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
@@ -1672,18 +1672,18 @@
 	}
 
       /* Make room for this entry.  */
-      s->_raw_size += PLT_ENTRY_SIZE;
+      s->size += PLT_ENTRY_SIZE;
 
       /* We also need to make an entry in the .rela.plt section.  */
 
       s = bfd_get_section_by_name (dynobj, ".rela.plt");
       BFD_ASSERT (s != NULL);
 
-      s->_raw_size += sizeof (Elf64_External_Rela);
+      s->size += sizeof (Elf64_External_Rela);
 
       /* The procedure linkage table size is bounded by the magnitude
 	 of the offset we can describe in the entry.  */
-      if (s->_raw_size >= (bfd_vma)1 << 32)
+      if (s->size >= (bfd_vma)1 << 32)
 	{
 	  bfd_set_error (bfd_error_bad_value);
 	  return FALSE;
@@ -1737,7 +1737,7 @@
 
       srel = bfd_get_section_by_name (dynobj, ".rela.bss");
       BFD_ASSERT (srel != NULL);
-      srel->_raw_size += sizeof (Elf64_External_Rela);
+      srel->size += sizeof (Elf64_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -1749,8 +1749,7 @@
     power_of_two = 4;
 
   /* Apply the required alignment.  */
-  s->_raw_size = BFD_ALIGN (s->_raw_size,
-			    (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (dynobj, s))
     {
       if (! bfd_set_section_alignment (dynobj, s, power_of_two))
@@ -1759,10 +1758,10 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
@@ -1788,7 +1787,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -1801,7 +1800,7 @@
          below.  */
       s = bfd_get_section_by_name (dynobj, ".rela.got");
       if (s != NULL)
-	s->_raw_size = 0;
+	s->size = 0;
     }
 
   /* The check_relocs and adjust_dynamic_symbol entry points have
@@ -1824,7 +1823,7 @@
 
       if (strncmp (name, ".rela", 5) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* If we don't need this section, strip it from the
 		 output file.  This is to handle .rela.bss and
@@ -1863,8 +1862,8 @@
       /* Allocate memory for the section contents.  Zero the memory
 	 for the benefit of .rela.plt, which has 4 unused entries
 	 at the beginning, and we don't want garbage.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
     }
 
@@ -1876,7 +1875,7 @@
 	 the .dynamic section.  The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       int reg;
       struct sparc64_elf_app_reg * app_regs;
@@ -1989,17 +1988,6 @@
   return TRUE;
 }
 
-/* This is the condition under which finish_dynamic_symbol will be called
-   from elflink.h.  If elflink.h doesn't call our finish_dynamic_symbol
-   routine, we'll need to do something about initializing any .plt and
-   .got entries in relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H)			\
-  ((DYN)								\
-   && ((INFO)->shared							\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Relocate a SPARC64 ELF section.  */
 
 static bfd_boolean
@@ -2039,6 +2027,8 @@
     got_base = elf_hash_table (info)->hgot->root.u.def.value;
 
   sgot = splt = sreloc = NULL;
+  if (dynobj != NULL)
+    splt = bfd_get_section_by_name (dynobj, ".plt");
 
   rel = relocs;
   relend = relocs + NUM_SHDR_ENTRIES (& elf_section_data (input_section)->rel_hdr);
@@ -2222,6 +2212,13 @@
 		    break;
 		  }
 
+		/* FIXME: Dynamic reloc handling really needs to be rewritten.  */
+		if (!skip
+		    && h != NULL
+		    && ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+		    && h->root.type == bfd_link_hash_undefweak)
+		  skip = TRUE, relocate = TRUE;
+
 		if (skip)
 		  memset (&outrel, 0, sizeof outrel);
 		/* h->dynindx may be -1 if the symbol was marked to
@@ -2327,7 +2324,7 @@
 	      BFD_ASSERT (off != (bfd_vma) -1);
 	      dyn = elf_hash_table (info)->dynamic_sections_created;
 
-	      if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)
+	      if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)
 		  || (info->shared
 		      && (info->symbolic
 			  || h->dynindx == -1
@@ -2420,7 +2417,7 @@
              procedure linkage table.  */
 	  BFD_ASSERT (h != NULL);
 
-	  if (h->plt.offset == (bfd_vma) -1)
+	  if (h->plt.offset == (bfd_vma) -1 || splt == NULL)
 	    {
 	      /* We didn't make a PLT entry for this symbol.  This
 		 happens when statically linking PIC code, or when
@@ -2428,12 +2425,6 @@
 	      goto do_default;
 	    }
 
-	  if (splt == NULL)
-	    {
-	      splt = bfd_get_section_by_name (dynobj, ".plt");
-	      BFD_ASSERT (splt != NULL);
-	    }
-
 	  relocation = (splt->output_section->vma
 			+ splt->output_offset
 			+ sparc64_elf_plt_entry_offset (h->plt.offset));
@@ -2525,7 +2516,7 @@
 	case R_SPARC_WDISP30:
 	do_wplt30:
 	  if (sec_do_relax (input_section)
-	      && rel->r_offset + 4 < input_section->_raw_size)
+	      && rel->r_offset + 4 < input_section->size)
 	    {
 #define G0		0
 #define O7		15
@@ -2732,7 +2723,7 @@
 	}
       else
 	{
-	  bfd_vma max = splt->_raw_size / PLT_ENTRY_SIZE;
+	  bfd_vma max = splt->size / PLT_ENTRY_SIZE;
 	  rela.r_offset = sparc64_elf_plt_ptr_offset (h->plt.offset, max);
 	  rela.r_addend = -(sparc64_elf_plt_entry_offset (h->plt.offset) + 4)
 			  -(splt->output_section->vma + splt->output_offset);
@@ -2865,7 +2856,7 @@
       BFD_ASSERT (splt != NULL && sdyn != NULL);
 
       dyncon = (Elf64_External_Dyn *) sdyn->contents;
-      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -2905,21 +2896,16 @@
 		  if (! size)
 		    dyn.d_un.d_ptr = s->vma;
 		  else
-		    {
-		      if (s->_cooked_size != 0)
-			dyn.d_un.d_val = s->_cooked_size;
-		      else
-			dyn.d_un.d_val = s->_raw_size;
-		    }
+		    dyn.d_un.d_val = s->size;
 		}
 	      bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon);
 	    }
 	}
 
       /* Initialize the contents of the .plt section.  */
-      if (splt->_raw_size > 0)
+      if (splt->size > 0)
 	sparc64_elf_build_plt (output_bfd, splt->contents,
-			       (int) (splt->_raw_size / PLT_ENTRY_SIZE));
+			       (int) (splt->size / PLT_ENTRY_SIZE));
 
       elf_section_data (splt->output_section)->this_hdr.sh_entsize =
 	PLT_ENTRY_SIZE;
@@ -2929,7 +2915,7 @@
      the dynamic section.  */
   sgot = bfd_get_section_by_name (dynobj, ".got");
   BFD_ASSERT (sgot != NULL);
-  if (sgot->_raw_size > 0)
+  if (sgot->size > 0)
     {
       if (sdyn == NULL)
 	bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents);
@@ -3115,6 +3101,24 @@
   return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, mach);
 }
 
+/* Return address for Ith PLT stub in section PLT, for relocation REL
+   or (bfd_vma) -1 if it should not be included.  */
+
+static bfd_vma
+sparc64_elf_plt_sym_val (bfd_vma i, const asection *plt,
+			 const arelent *rel ATTRIBUTE_UNUSED)
+{
+  bfd_vma j;
+
+  i += PLT_HEADER_SIZE / PLT_ENTRY_SIZE;
+  if (i < LARGE_PLT_THRESHOLD)
+    return plt->vma + i * PLT_ENTRY_SIZE;
+
+  j = (i - LARGE_PLT_THRESHOLD) % 160;
+  i -= j;
+  return plt->vma + i * PLT_ENTRY_SIZE + j * 4 * 6;
+}
+
 /* 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
@@ -3214,6 +3218,8 @@
   sparc64_elf_merge_private_bfd_data
 #define elf_backend_fake_sections \
   sparc64_elf_fake_sections
+#define elf_backend_plt_sym_val	\
+  sparc64_elf_plt_sym_val
 
 #define elf_backend_size_info \
   sparc64_elf_size_info
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 528f7a8..72b0652 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -195,7 +195,7 @@
 elf64_x86_64_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 {
   int offset;
-  size_t raw_size;
+  size_t size;
 
   switch (note->descsz)
     {
@@ -213,14 +213,14 @@
 
 	/* pr_reg */
 	offset = 112;
-	raw_size = 216;
+	size = 216;
 
 	break;
     }
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
 static bfd_boolean
@@ -561,7 +561,8 @@
       (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC
 				   | ELF_LINK_HASH_REF_REGULAR
 				   | ELF_LINK_HASH_REF_REGULAR_NONWEAK
-				   | ELF_LINK_HASH_NEEDS_PLT));
+				   | ELF_LINK_HASH_NEEDS_PLT
+				   | ELF_LINK_POINTER_EQUALITY_NEEDED));
   else
     _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
 }
@@ -662,9 +663,10 @@
 	  if (info->shared)
 	    {
 	      (*_bfd_error_handler)
-		(_("%s: relocation %s can not be used when making a shared object; recompile with -fPIC"),
+		(_("%s: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
 		 bfd_archive_filename (abfd),
-		 x86_64_elf_howto_table[r_type].name);
+		 x86_64_elf_howto_table[r_type].name,
+		 (h) ? h->root.root.string : "a local symbol");
 	      bfd_set_error (bfd_error_bad_value);
 	      return FALSE;
 	    }
@@ -787,9 +789,10 @@
 	      && (sec->flags & SEC_READONLY) != 0)
 	    {
 	      (*_bfd_error_handler)
-		(_("%s: relocation %s can not be used when making a shared object; recompile with -fPIC"),
+		(_("%s: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
 		 bfd_archive_filename (abfd),
-		 x86_64_elf_howto_table[r_type].name);
+		 x86_64_elf_howto_table[r_type].name,
+		 (h) ? h->root.root.string : "a local symbol");
 	      bfd_set_error (bfd_error_bad_value);
 	      return FALSE;
 	    }
@@ -812,6 +815,8 @@
 	      /* We may need a .plt entry if the function this reloc
 		 refers to is in a shared lib.  */
 	      h->plt.refcount += 1;
+	      if (r_type != R_X86_64_PC32)
+		h->elf_link_hash_flags |= ELF_LINK_POINTER_EQUALITY_NEEDED;
 	    }
 
 	  /* If we are creating a shared library, and this is a reloc
@@ -951,14 +956,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_X86_64_GNU_VTINHERIT:
-	  if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_X86_64_GNU_VTENTRY:
-	  if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
 	    return FALSE;
 	  break;
 
@@ -1226,7 +1231,7 @@
      runtime process image.  */
   if ((h->root.u.def.section->flags & SEC_ALLOC) != 0)
     {
-      htab->srelbss->_raw_size += sizeof (Elf64_External_Rela);
+      htab->srelbss->size += sizeof (Elf64_External_Rela);
       h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY;
     }
 
@@ -1241,7 +1246,7 @@
 
   /* Apply the required alignment.  */
   s = htab->sdynbss;
-  s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two));
+  s->size = BFD_ALIGN (s->size, (bfd_size_type) (1 << power_of_two));
   if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s))
     {
       if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two))
@@ -1250,25 +1255,14 @@
 
   /* Define the symbol as being at this point in the section.  */
   h->root.u.def.section = s;
-  h->root.u.def.value = s->_raw_size;
+  h->root.u.def.value = s->size;
 
   /* Increment the section size to make room for the symbol.  */
-  s->_raw_size += h->size;
+  s->size += h->size;
 
   return TRUE;
 }
 
-/* This is the condition under which elf64_x86_64_finish_dynamic_symbol
-   will be called from elflink.h.  If elflink.h doesn't call our
-   finish_dynamic_symbol routine, we'll need to do something about
-   initializing any .plt and .got entries in elf64_x86_64_relocate_section.  */
-#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \
-  ((DYN)								\
-   && ((SHARED)								\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)	\
-   && ((H)->dynindx != -1						\
-       || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0))
-
 /* Allocate space in .plt, .got and associated reloc sections for
    dynamic relocs.  */
 
@@ -1297,7 +1291,7 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -1308,10 +1302,10 @@
 
 	  /* 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 (s->size == 0)
+	    s->size += PLT_ENTRY_SIZE;
 
-	  h->plt.offset = s->_raw_size;
+	  h->plt.offset = s->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
@@ -1326,14 +1320,14 @@
 	    }
 
 	  /* Make room for this entry.  */
-	  s->_raw_size += PLT_ENTRY_SIZE;
+	  s->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.  */
-	  htab->sgotplt->_raw_size += GOT_ENTRY_SIZE;
+	  htab->sgotplt->size += GOT_ENTRY_SIZE;
 
 	  /* We also need to make an entry in the .rela.plt section.  */
-	  htab->srelplt->_raw_size += sizeof (Elf64_External_Rela);
+	  htab->srelplt->size += sizeof (Elf64_External_Rela);
 	}
       else
 	{
@@ -1365,30 +1359,30 @@
       if (h->dynindx == -1
 	  && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	{
-	  if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
       s = htab->sgot;
-      h->got.offset = s->_raw_size;
-      s->_raw_size += GOT_ENTRY_SIZE;
+      h->got.offset = s->size;
+      s->size += GOT_ENTRY_SIZE;
       /* R_X86_64_TLSGD needs 2 consecutive GOT slots.  */
       if (tls_type == GOT_TLS_GD)
-	s->_raw_size += GOT_ENTRY_SIZE;
+	s->size += GOT_ENTRY_SIZE;
       dyn = htab->elf.dynamic_sections_created;
       /* R_X86_64_TLSGD needs one dynamic relocation if local symbol
 	 and two if global.
 	 R_X86_64_GOTTPOFF needs one dynamic relocation.  */
       if ((tls_type == GOT_TLS_GD && h->dynindx == -1)
 	  || tls_type == GOT_TLS_IE)
-	htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
+	htab->srelgot->size += sizeof (Elf64_External_Rela);
       else if (tls_type == GOT_TLS_GD)
-	htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela);
+	htab->srelgot->size += 2 * sizeof (Elf64_External_Rela);
       else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
 		|| h->root.type != bfd_link_hash_undefweak)
 	       && (info->shared
 		   || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)))
-	htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
+	htab->srelgot->size += sizeof (Elf64_External_Rela);
     }
   else
     h->got.offset = (bfd_vma) -1;
@@ -1450,7 +1444,7 @@
 	  if (h->dynindx == -1
 	      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
 	    {
-	      if (! bfd_elf64_link_record_dynamic_symbol (info, h))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 		return FALSE;
 	    }
 
@@ -1469,7 +1463,7 @@
   for (p = eh->dyn_relocs; p != NULL; p = p->next)
     {
       asection *sreloc = elf_section_data (p->sec)->sreloc;
-      sreloc->_raw_size += p->count * sizeof (Elf64_External_Rela);
+      sreloc->size += p->count * sizeof (Elf64_External_Rela);
     }
 
   return TRUE;
@@ -1529,7 +1523,7 @@
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  if (s == NULL)
 	    abort ();
-	  s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER;
+	  s->size = sizeof ELF_DYNAMIC_INTERPRETER;
 	  s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
 	}
     }
@@ -1568,7 +1562,7 @@
 	      else if (p->count != 0)
 		{
 		  srel = elf_section_data (p->sec)->sreloc;
-		  srel->_raw_size += p->count * sizeof (Elf64_External_Rela);
+		  srel->size += p->count * sizeof (Elf64_External_Rela);
 		  if ((p->sec->output_section->flags & SEC_READONLY) != 0)
 		    info->flags |= DF_TEXTREL;
 
@@ -1590,14 +1584,14 @@
 	{
 	  if (*local_got > 0)
 	    {
-	      *local_got = s->_raw_size;
-	      s->_raw_size += GOT_ENTRY_SIZE;
+	      *local_got = s->size;
+	      s->size += GOT_ENTRY_SIZE;
 	      if (*local_tls_type == GOT_TLS_GD)
-		s->_raw_size += GOT_ENTRY_SIZE;
+		s->size += GOT_ENTRY_SIZE;
 	      if (info->shared
 		  || *local_tls_type == GOT_TLS_GD
 		  || *local_tls_type == GOT_TLS_IE)
-		srel->_raw_size += sizeof (Elf64_External_Rela);
+		srel->size += sizeof (Elf64_External_Rela);
 	    }
 	  else
 	    *local_got = (bfd_vma) -1;
@@ -1608,9 +1602,9 @@
     {
       /* Allocate 2 got entries and 1 dynamic reloc for R_X86_64_TLSLD
 	 relocs.  */
-      htab->tls_ld_got.offset = htab->sgot->_raw_size;
-      htab->sgot->_raw_size += 2 * GOT_ENTRY_SIZE;
-      htab->srelgot->_raw_size += sizeof (Elf64_External_Rela);
+      htab->tls_ld_got.offset = htab->sgot->size;
+      htab->sgot->size += 2 * GOT_ENTRY_SIZE;
+      htab->srelgot->size += sizeof (Elf64_External_Rela);
     }
   else
     htab->tls_ld_got.offset = -1;
@@ -1636,7 +1630,7 @@
 	}
       else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0)
 	{
-	  if (s->_raw_size != 0 && s != htab->srelplt)
+	  if (s->size != 0 && s != htab->srelplt)
 	    relocs = TRUE;
 
 	  /* We use the reloc_count field as a counter if we need
@@ -1649,7 +1643,7 @@
 	  continue;
 	}
 
-      if (s->_raw_size == 0)
+      if (s->size == 0)
 	{
 	  /* If we don't need this section, strip it from the
 	     output file.  This is mostly to handle .rela.bss and
@@ -1670,7 +1664,7 @@
 	 section's contents are written out.  This should not happen,
 	 but this way if it does, we get a R_X86_64_NONE reloc instead
 	 of garbage.  */
-      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size);
+      s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->size);
       if (s->contents == NULL)
 	return FALSE;
     }
@@ -1683,7 +1677,7 @@
 	 the .dynamic section.	The DT_DEBUG entry is filled in by the
 	 dynamic linker and used by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
       if (info->executable)
 	{
@@ -1691,7 +1685,7 @@
 	    return FALSE;
 	}
 
-      if (htab->splt->_raw_size != 0)
+      if (htab->splt->size != 0)
 	{
 	  if (!add_dynamic_entry (DT_PLTGOT, 0)
 	      || !add_dynamic_entry (DT_PLTRELSZ, 0)
@@ -1919,9 +1913,11 @@
 	  if (off >= (bfd_vma) -2)
 	    abort ();
 
-	  relocation = htab->sgot->output_offset + off;
-	  if (r_type == R_X86_64_GOTPCREL)
-	    relocation += htab->sgot->output_section->vma;
+	  relocation = htab->sgot->output_section->vma
+		       + htab->sgot->output_offset + off;
+	  if (r_type != R_X86_64_GOTPCREL)
+	    relocation -= htab->sgotplt->output_section->vma
+			  - htab->sgotplt->output_offset;
 
 	  break;
 
@@ -1952,6 +1948,21 @@
 	case R_X86_64_PC8:
 	case R_X86_64_PC16:
 	case R_X86_64_PC32:
+	  if (info->shared
+	      && !SYMBOL_REFERENCES_LOCAL (info, h)
+	      && (sec->flags & SEC_ALLOC) != 0
+	      && (sec->flags & SEC_READONLY) != 0)
+	    {
+	      (*_bfd_error_handler)
+		(_("%s: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
+		 bfd_archive_filename (input_bfd),
+		 x86_64_elf_howto_table[r_type].name,
+		 (h) ? h->root.root.string : "a local symbol");
+	      bfd_set_error (bfd_error_bad_value);
+	      return FALSE;
+	    }
+	  /* Fall through.  */
+
 	case R_X86_64_8:
 	case R_X86_64_16:
 	case R_X86_64_32:
@@ -2116,7 +2127,7 @@
 		    BFD_ASSERT (bfd_get_8 (input_bfd,
 					   contents + rel->r_offset - 4 + i)
 				== tlsgd[i]);
-		  BFD_ASSERT (rel->r_offset + 12 <= input_section->_raw_size);
+		  BFD_ASSERT (rel->r_offset + 12 <= input_section->size);
 		  for (i = 0; i < 4; i++)
 		    BFD_ASSERT (bfd_get_8 (input_bfd,
 					   contents + rel->r_offset + 4 + i)
@@ -2152,7 +2163,7 @@
 		  reg = bfd_get_8 (input_bfd, contents + rel->r_offset - 1);
 		  BFD_ASSERT ((reg & 0xc7) == 5);
 		  reg >>= 3;
-		  BFD_ASSERT (rel->r_offset + 4 <= input_section->_raw_size);
+		  BFD_ASSERT (rel->r_offset + 4 <= input_section->size);
 		  if (type == 0x8b)
 		    {
 		      /* movq */
@@ -2289,7 +2300,7 @@
 		BFD_ASSERT (bfd_get_8 (input_bfd,
 				       contents + rel->r_offset - 4 + i)
 			    == tlsgd[i]);
-	      BFD_ASSERT (rel->r_offset + 12 <= input_section->_raw_size);
+	      BFD_ASSERT (rel->r_offset + 12 <= input_section->size);
 	      for (i = 0; i < 4; i++)
 		BFD_ASSERT (bfd_get_8 (input_bfd,
 				       contents + rel->r_offset + 4 + i)
@@ -2329,7 +2340,7 @@
 			  == 0x8d);
 	      BFD_ASSERT (bfd_get_8 (input_bfd, contents + rel->r_offset - 1)
 			  == 0x3d);
-	      BFD_ASSERT (rel->r_offset + 9 <= input_section->_raw_size);
+	      BFD_ASSERT (rel->r_offset + 9 <= input_section->size);
 	      BFD_ASSERT (bfd_get_8 (input_bfd, contents + rel->r_offset + 4)
 			  == 0xe8);
 	      BFD_ASSERT (rel + 1 < relend);
@@ -2426,6 +2437,11 @@
 
 	  if (r == bfd_reloc_overflow)
 	    {
+	      if (h != NULL
+		  && h->root.type == bfd_link_hash_undefweak
+		  && howto->pc_relative)
+		/* Ignore reloc overflow on branches to undefweak syms.  */
+		continue;
 
 	      if (! ((*info->callbacks->reloc_overflow)
 		     (info, name, howto->name, (bfd_vma) 0,
@@ -2530,11 +2546,16 @@
       if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
 	{
 	  /* Mark the symbol as undefined, rather than as defined in
-	     the .plt section.  Leave the value alone.  This is a clue
+	     the .plt section.  Leave the value if there were any
+	     relocations where pointer equality matters (this is a clue
 	     for the dynamic linker, to make function pointer
 	     comparisons work between an application and shared
-	     library.  */
+	     library), otherwise set it to zero.  If a function is only
+	     called from a binary, there is no need to slow down
+	     shared libraries because of that.  */
 	  sym->st_shndx = SHN_UNDEF;
+	  if ((h->elf_link_hash_flags & ELF_LINK_POINTER_EQUALITY_NEEDED) == 0)
+	    sym->st_value = 0;
 	}
     }
 
@@ -2653,7 +2674,7 @@
 	abort ();
 
       dyncon = (Elf64_External_Dyn *) sdyn->contents;
-      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->size);
       for (; dyncon < dynconend; dyncon++)
 	{
 	  Elf_Internal_Dyn dyn;
@@ -2667,7 +2688,8 @@
 	      continue;
 
 	    case DT_PLTGOT:
-	      dyn.d_un.d_ptr = htab->sgot->output_section->vma;
+	      s = htab->sgotplt;
+	      dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
 	      break;
 
 	    case DT_JMPREL:
@@ -2676,10 +2698,7 @@
 
 	    case DT_PLTRELSZ:
 	      s = htab->srelplt->output_section;
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size;
-	      else
-		dyn.d_un.d_val = s->_raw_size;
+	      dyn.d_un.d_val = s->size;
 	      break;
 
 	    case DT_RELASZ:
@@ -2693,10 +2712,7 @@
 	      if (htab->srelplt != NULL)
 		{
 		  s = htab->srelplt->output_section;
-		  if (s->_cooked_size != 0)
-		    dyn.d_un.d_val -= s->_cooked_size;
-		  else
-		    dyn.d_un.d_val -= s->_raw_size;
+		  dyn.d_un.d_val -= s->size;
 		}
 	      break;
 	    }
@@ -2705,7 +2721,7 @@
 	}
 
       /* Fill in the special first entry in the procedure linkage table.  */
-      if (htab->splt && htab->splt->_raw_size > 0)
+      if (htab->splt && htab->splt->size > 0)
 	{
 	  /* Fill in the first entry in the procedure linkage table.  */
 	  memcpy (htab->splt->contents, elf64_x86_64_plt0_entry,
@@ -2739,7 +2755,7 @@
   if (htab->sgotplt)
     {
       /* Fill in the first three entries in the global offset table.  */
-      if (htab->sgotplt->_raw_size > 0)
+      if (htab->sgotplt->size > 0)
 	{
 	  /* Set the first entry in the global offset table to the address of
 	     the dynamic section.  */
@@ -2758,9 +2774,22 @@
 	GOT_ENTRY_SIZE;
     }
 
+  if (htab->sgot && htab->sgot->size > 0)
+    elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize
+      = GOT_ENTRY_SIZE;
+
   return TRUE;
 }
 
+/* Return address for Ith PLT stub in section PLT, for relocation REL
+   or (bfd_vma) -1 if it should not be included.  */
+
+static bfd_vma
+elf64_x86_64_plt_sym_val (bfd_vma i, const asection *plt,
+			  const arelent *rel ATTRIBUTE_UNUSED)
+{
+  return plt->vma + (i + 1) * PLT_ENTRY_SIZE;
+}
 
 #define TARGET_LITTLE_SYM		    bfd_elf64_x86_64_vec
 #define TARGET_LITTLE_NAME		    "elf64-x86-64"
@@ -2795,6 +2824,7 @@
 #define elf_backend_reloc_type_class	    elf64_x86_64_reloc_type_class
 #define elf_backend_relocate_section	    elf64_x86_64_relocate_section
 #define elf_backend_size_dynamic_sections   elf64_x86_64_size_dynamic_sections
+#define elf_backend_plt_sym_val		    elf64_x86_64_plt_sym_val
 #define elf_backend_object_p		    elf64_x86_64_elf_object_p
 #define bfd_elf64_mkobject		    elf64_x86_64_mkobject
 
diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c
index 5ecbe8e..e2e34f3 100644
--- a/bfd/elfarm-nabi.c
+++ b/bfd/elfarm-nabi.c
@@ -516,6 +516,47 @@
 	 0,			/* dst_mask */
 	 FALSE),		/* pcrel_offset */
 
+  HOWTO (R_ARM_ALU_PCREL7_0,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 12,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_ARM_ALU_PCREL_7_0",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0x00000fff,		/* src_mask */
+	 0x00000fff,		/* dst_mask */
+	 TRUE),			/* pcrel_offset */
+
+  HOWTO (R_ARM_ALU_PCREL15_8,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 12,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 8,			/* bitpos */
+	 complain_overflow_dont,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_ARM_ALU_PCREL_15_8",/* name */
+	 FALSE,			/* partial_inplace */
+	 0x00000fff,		/* src_mask */
+	 0x00000fff,		/* dst_mask */
+	 TRUE),			/* pcrel_offset */
+
+  HOWTO (R_ARM_ALU_PCREL23_15,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 12,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 16,			/* bitpos */
+	 complain_overflow_dont,/* complain_on_overflow */
+	 bfd_elf_generic_reloc,	/* special_function */
+	 "R_ARM_ALU_PCREL_23_15",/* name */
+	 FALSE,			/* partial_inplace */
+	 0x00000fff,		/* src_mask */
+	 0x00000fff,		/* dst_mask */
+	 TRUE),			/* pcrel_offset */
 };
 
   /* GNU extension to record C++ vtable hierarchy */
@@ -688,7 +729,7 @@
      Elf_Internal_Note *note;
 {
   int offset;
-  size_t raw_size;
+  size_t size;
 
   switch (note->descsz)
     {
@@ -704,14 +745,14 @@
 
 	/* pr_reg */
 	offset = 72;
-	raw_size = 72;
+	size = 72;
 
 	break;
     }
 
   /* Make a ".reg/999" section.  */
   return _bfd_elfcore_make_pseudosection (abfd, ".reg",
-					  raw_size, note->descpos + offset);
+					  size, note->descpos + offset);
 }
 
 static bfd_boolean
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 87d96fa..4a2d7a4 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -1,6 +1,6 @@
 /* ELF executable support for BFD.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    Written by Fred Fish @ Cygnus Support, from information published
    in "UNIX System V Release 4, Programmers Guide: ANSI C and
@@ -105,6 +105,8 @@
 #define elf_canonicalize_symtab		NAME(bfd_elf,canonicalize_symtab)
 #define elf_canonicalize_dynamic_symtab \
   NAME(bfd_elf,canonicalize_dynamic_symtab)
+#define elf_get_synthetic_symtab \
+  NAME(bfd_elf,get_synthetic_symtab)
 #define elf_make_empty_symbol		NAME(bfd_elf,make_empty_symbol)
 #define elf_get_symbol_info		NAME(bfd_elf,get_symbol_info)
 #define elf_get_lineno			NAME(bfd_elf,get_lineno)
@@ -115,24 +117,10 @@
 #define elf_no_info_to_howto		NAME(bfd_elf,no_info_to_howto)
 #define elf_no_info_to_howto_rel	NAME(bfd_elf,no_info_to_howto_rel)
 #define elf_find_section		NAME(bfd_elf,find_section)
-#define elf_bfd_link_add_symbols	NAME(bfd_elf,bfd_link_add_symbols)
-#define elf_add_dynamic_entry		NAME(bfd_elf,add_dynamic_entry)
 #define elf_write_shdrs_and_ehdr	NAME(bfd_elf,write_shdrs_and_ehdr)
 #define elf_write_out_phdrs		NAME(bfd_elf,write_out_phdrs)
 #define elf_write_relocs		NAME(bfd_elf,write_relocs)
 #define elf_slurp_reloc_table		NAME(bfd_elf,slurp_reloc_table)
-#define elf_bfd_discard_info		NAME(bfd_elf,discard_info)
-#define elf_reloc_symbol_deleted_p	NAME(_bfd_elf,reloc_symbol_deleted_p)
-#define elf_link_record_dynamic_symbol  _bfd_elf_link_record_dynamic_symbol
-#define elf_bfd_final_link		NAME(bfd_elf,bfd_final_link)
-#define elf_gc_sections			NAME(_bfd_elf,gc_sections)
-#define elf_gc_common_finalize_got_offsets \
-  NAME(_bfd_elf,gc_common_finalize_got_offsets)
-#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)
@@ -151,10 +139,6 @@
 #define LOG_FILE_ALIGN	2
 #endif
 
-#define elf_stringtab_init _bfd_elf_stringtab_init
-
-#define section_from_elf_index bfd_section_from_elf_index
-
 #ifdef DEBUG
 static void elf_debug_section (int, Elf_Internal_Shdr *);
 static void elf_debug_file (Elf_Internal_Ehdr *);
@@ -1111,8 +1095,8 @@
 	  else if (isym->st_shndx < SHN_LORESERVE
 		   || isym->st_shndx > SHN_HIRESERVE)
 	    {
-	      sym->symbol.section = section_from_elf_index (abfd,
-							    isym->st_shndx);
+	      sym->symbol.section = bfd_section_from_elf_index (abfd,
+								isym->st_shndx);
 	      if (sym->symbol.section == NULL)
 		{
 		  /* This symbol is in a section for which we did not
@@ -1371,7 +1355,7 @@
 	 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)
+      if (asect->size == 0)
 	return TRUE;
 
       rel_hdr = &d->this_hdr;
@@ -1737,7 +1721,6 @@
 }
 
 #include "elfcore.h"
-#include "elflink.h"
 
 /* Size-dependent data and functions.  */
 const struct elf_size_info NAME(_bfd_elf,size_info) = {
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 39bf46f..1c1de27 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -24,6 +24,8 @@
 #include "libbfd.h"
 #define ARCH_SIZE 0
 #include "elf-bfd.h"
+#include "safe-ctype.h"
+#include "libiberty.h"
 
 bfd_boolean
 _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
@@ -89,14 +91,14 @@
       h->type = STT_OBJECT;
 
       if (! info->executable
-	  && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+	  && ! bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
 
       elf_hash_table (info)->hgot = h;
     }
 
   /* The first bit of the global offset table is the header.  */
-  s->_raw_size += bed->got_header_size + bed->got_symbol_offset;
+  s->size += bed->got_header_size + bed->got_symbol_offset;
 
   return TRUE;
 }
@@ -219,7 +221,7 @@
   h->type = STT_OBJECT;
 
   if (! info->executable
-      && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+      && ! bfd_elf_link_record_dynamic_symbol (info, h))
     return FALSE;
 
   s = bfd_make_section (abfd, ".hash");
@@ -284,7 +286,7 @@
       h->type = STT_OBJECT;
 
       if (! info->executable
-	  && ! _bfd_elf_link_record_dynamic_symbol (info, h))
+	  && ! bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
     }
 
@@ -346,8 +348,8 @@
    one.  */
 
 bfd_boolean
-_bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info,
-				     struct elf_link_hash_entry *h)
+bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info,
+				    struct elf_link_hash_entry *h)
 {
   if (h->dynindx == -1)
     {
@@ -465,7 +467,7 @@
        || info->shared)
       && h->dynindx == -1)
     {
-      if (! _bfd_elf_link_record_dynamic_symbol (info, h))
+      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
 
       /* If this is a weak defined symbol, and we know a corresponding
@@ -474,7 +476,7 @@
       if (h->weakdef != NULL
 	  && h->weakdef->dynindx == -1)
 	{
-	  if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h->weakdef))
 	    return FALSE;
 	}
     }
@@ -487,9 +489,9 @@
    in a discarded section, eg. a discarded link-once section symbol.  */
 
 int
-elf_link_record_local_dynamic_symbol (struct bfd_link_info *info,
-				      bfd *input_bfd,
-				      long input_indx)
+bfd_elf_link_record_local_dynamic_symbol (struct bfd_link_info *info,
+					  bfd *input_bfd,
+					  long input_indx)
 {
   bfd_size_type amt;
   struct elf_link_local_dynamic_entry *entry;
@@ -606,6 +608,43 @@
   return TRUE;
 }
 
+/* Return true if the dynamic symbol for a given section should be
+   omitted when creating a shared library.  */
+bfd_boolean
+_bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED,
+				   struct bfd_link_info *info,
+				   asection *p)
+{
+  switch (elf_section_data (p)->this_hdr.sh_type)
+    {
+    case SHT_PROGBITS:
+    case SHT_NOBITS:
+      /* If sh_type is yet undecided, assume it could be
+	 SHT_PROGBITS/SHT_NOBITS.  */
+    case SHT_NULL:
+      if (strcmp (p->name, ".got") == 0
+	  || strcmp (p->name, ".got.plt") == 0
+	  || strcmp (p->name, ".plt") == 0)
+	{
+	  asection *ip;
+	  bfd *dynobj = elf_hash_table (info)->dynobj;
+
+	  if (dynobj != NULL
+	      && (ip = bfd_get_section_by_name (dynobj, p->name))
+	      != NULL
+	      && (ip->flags & SEC_LINKER_CREATED)
+	      && ip->output_section == p)
+	    return TRUE;
+	}
+      return FALSE;
+
+      /* There shouldn't be section relative relocations
+	 against any other section.  */
+    default:
+      return TRUE;
+    }
+}
+
 /* Assign dynsym indices.  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
@@ -618,9 +657,12 @@
 
   if (info->shared)
     {
+      const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
       asection *p;
       for (p = output_bfd->sections; p ; p = p->next)
-	if ((p->flags & SEC_EXCLUDE) == 0)
+	if ((p->flags & SEC_EXCLUDE) == 0
+	    && (p->flags & SEC_ALLOC) != 0
+	    && !(*bed->elf_backend_omit_section_dynsym) (output_bfd, info, p))
 	  elf_section_data (p)->dynindx = ++dynsymcount;
     }
 
@@ -835,7 +877,7 @@
 
 	 FIXME: Should we check type and size for protected symbol?  */
       if (ELF_ST_VISIBILITY (h->other) == STV_PROTECTED)
-	return _bfd_elf_link_record_dynamic_symbol (info, h);
+	return bfd_elf_link_record_dynamic_symbol (info, h);
       else
 	return TRUE;
     }
@@ -885,16 +927,20 @@
   oldweak = (h->root.type == bfd_link_hash_defweak
 	     || h->root.type == bfd_link_hash_undefweak);
 
-  /* If a new weak symbol comes from a regular file and the old symbol
-     comes from a dynamic library, we treat the new one as strong.
-     Similarly, an old weak symbol from a regular file is treated as
-     strong when the new symbol comes from a dynamic library.  Further,
-     an old weak symbol from a dynamic library is treated as strong if
-     the new symbol is from a dynamic library.  This reflects the way
-     glibc's ld.so works.  */
-  if (!newdyn && olddyn)
+  /* If a new weak symbol definition comes from a regular file and the
+     old symbol comes from a dynamic library, we treat the new one as
+     strong.  Similarly, an old weak symbol definition from a regular
+     file is treated as strong when the new symbol comes from a dynamic
+     library.  Further, an old weak symbol from a dynamic library is
+     treated as strong if the new symbol is from a dynamic library.
+     This reflects the way glibc's ld.so works.
+
+     Do this before setting *type_change_ok or *size_change_ok so that
+     we warn properly when dynamic library symbols are overridden.  */
+
+  if (newdef && !newdyn && olddyn)
     newweak = FALSE;
-  if (newdyn)
+  if (olddef && newdyn)
     oldweak = FALSE;
 
   /* It's OK to change the type if either the existing symbol or the
@@ -1274,7 +1320,7 @@
 	      & (ELF_LINK_HASH_REF_REGULAR
 		 | ELF_LINK_HASH_DEF_REGULAR))
 	    {
-	      if (! _bfd_elf_link_record_dynamic_symbol (info, hi))
+	      if (! bfd_elf_link_record_dynamic_symbol (info, hi))
 		return FALSE;
 	    }
 	}
@@ -1432,7 +1478,7 @@
       if (!eif->verdefs)
 	{
 	doit:
-	  if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (eif->info, h))
 	    {
 	      eif->failed = TRUE;
 	      return FALSE;
@@ -1813,10 +1859,14 @@
 	r_symndx >>= 24;
       if ((size_t) r_symndx >= nsyms)
 	{
+	  char *sec_name = bfd_get_section_ident (sec);
 	  (*_bfd_error_handler)
 	    (_("%s: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%s'"),
 	     bfd_archive_filename (abfd), (unsigned long) r_symndx,
-	     (unsigned long) nsyms, irela->r_offset, sec->name);
+	     (unsigned long) nsyms, irela->r_offset,
+	     sec_name ? sec_name : sec->name);
+	  if (sec_name)
+	    free (sec_name);
 	  bfd_set_error (bfd_error_bad_value);
 	  return FALSE;
 	}
@@ -2002,11 +2052,14 @@
     }
   else
     {
+      char *sec_name = bfd_get_section_ident (input_section);
       (*_bfd_error_handler)
 	(_("%s: relocation size mismatch in %s section %s"),
 	 bfd_get_filename (output_bfd),
 	 bfd_archive_filename (input_section->owner),
-	 input_section->name);
+	 sec_name ? sec_name : input_section->name);
+      if (sec_name)
+	free (sec_name);
       bfd_set_error (bfd_error_wrong_object_format);
       return FALSE;
     }
@@ -2076,7 +2129,7 @@
 	  && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
 	      || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0))
 	{
-	  if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (eif->info, h))
 	    {
 	      eif->failed = TRUE;
 	      return FALSE;
@@ -2328,7 +2381,7 @@
 	_bfd_merged_section_offset (output_bfd,
 				    &h->root.u.def.section,
 				    elf_section_data (sec)->sec_info,
-				    h->root.u.def.value, 0);
+				    h->root.u.def.value);
     }
 
   return TRUE;
@@ -2585,6 +2638,1543 @@
   return result;
 }
 
+/* Add an entry to the .dynamic table.  */
+
+bfd_boolean
+_bfd_elf_add_dynamic_entry (struct bfd_link_info *info,
+			    bfd_vma tag,
+			    bfd_vma val)
+{
+  struct elf_link_hash_table *hash_table;
+  const struct elf_backend_data *bed;
+  asection *s;
+  bfd_size_type newsize;
+  bfd_byte *newcontents;
+  Elf_Internal_Dyn dyn;
+
+  hash_table = elf_hash_table (info);
+  if (! is_elf_hash_table (hash_table))
+    return FALSE;
+
+  bed = get_elf_backend_data (hash_table->dynobj);
+  s = bfd_get_section_by_name (hash_table->dynobj, ".dynamic");
+  BFD_ASSERT (s != NULL);
+
+  newsize = s->size + bed->s->sizeof_dyn;
+  newcontents = bfd_realloc (s->contents, newsize);
+  if (newcontents == NULL)
+    return FALSE;
+
+  dyn.d_tag = tag;
+  dyn.d_un.d_val = val;
+  bed->s->swap_dyn_out (hash_table->dynobj, &dyn, newcontents + s->size);
+
+  s->size = newsize;
+  s->contents = newcontents;
+
+  return TRUE;
+}
+
+/* Add a DT_NEEDED entry for this dynamic object if DO_IT is true,
+   otherwise just check whether one already exists.  Returns -1 on error,
+   1 if a DT_NEEDED tag already exists, and 0 on success.  */
+
+static int
+elf_add_dt_needed_tag (struct bfd_link_info *info,
+		       const char *soname,
+		       bfd_boolean do_it)
+{
+  struct elf_link_hash_table *hash_table;
+  bfd_size_type oldsize;
+  bfd_size_type strindex;
+
+  hash_table = elf_hash_table (info);
+  oldsize = _bfd_elf_strtab_size (hash_table->dynstr);
+  strindex = _bfd_elf_strtab_add (hash_table->dynstr, soname, FALSE);
+  if (strindex == (bfd_size_type) -1)
+    return -1;
+
+  if (oldsize == _bfd_elf_strtab_size (hash_table->dynstr))
+    {
+      asection *sdyn;
+      const struct elf_backend_data *bed;
+      bfd_byte *extdyn;
+
+      bed = get_elf_backend_data (hash_table->dynobj);
+      sdyn = bfd_get_section_by_name (hash_table->dynobj, ".dynamic");
+      BFD_ASSERT (sdyn != NULL);
+
+      for (extdyn = sdyn->contents;
+	   extdyn < sdyn->contents + sdyn->size;
+	   extdyn += bed->s->sizeof_dyn)
+	{
+	  Elf_Internal_Dyn dyn;
+
+	  bed->s->swap_dyn_in (hash_table->dynobj, extdyn, &dyn);
+	  if (dyn.d_tag == DT_NEEDED
+	      && dyn.d_un.d_val == strindex)
+	    {
+	      _bfd_elf_strtab_delref (hash_table->dynstr, strindex);
+	      return 1;
+	    }
+	}
+    }
+
+  if (do_it)
+    {
+      if (!_bfd_elf_add_dynamic_entry (info, DT_NEEDED, strindex))
+	return -1;
+    }
+  else
+    /* We were just checking for existence of the tag.  */
+    _bfd_elf_strtab_delref (hash_table->dynstr, strindex);
+
+  return 0;
+}
+
+/* Sort symbol by value and section.  */
+static int
+elf_sort_symbol (const void *arg1, const void *arg2)
+{
+  const struct elf_link_hash_entry *h1;
+  const struct elf_link_hash_entry *h2;
+  bfd_signed_vma vdiff;
+
+  h1 = *(const struct elf_link_hash_entry **) arg1;
+  h2 = *(const struct elf_link_hash_entry **) arg2;
+  vdiff = h1->root.u.def.value - h2->root.u.def.value;
+  if (vdiff != 0)
+    return vdiff > 0 ? 1 : -1;
+  else
+    {
+      long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id;
+      if (sdiff != 0)
+	return sdiff > 0 ? 1 : -1;
+    }
+  return 0;
+}
+
+/* This function is used to adjust offsets into .dynstr for
+   dynamic symbols.  This is called via elf_link_hash_traverse.  */
+
+static bfd_boolean
+elf_adjust_dynstr_offsets (struct elf_link_hash_entry *h, void *data)
+{
+  struct elf_strtab_hash *dynstr = data;
+
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+  if (h->dynindx != -1)
+    h->dynstr_index = _bfd_elf_strtab_offset (dynstr, h->dynstr_index);
+  return TRUE;
+}
+
+/* Assign string offsets in .dynstr, update all structures referencing
+   them.  */
+
+static bfd_boolean
+elf_finalize_dynstr (bfd *output_bfd, struct bfd_link_info *info)
+{
+  struct elf_link_hash_table *hash_table = elf_hash_table (info);
+  struct elf_link_local_dynamic_entry *entry;
+  struct elf_strtab_hash *dynstr = hash_table->dynstr;
+  bfd *dynobj = hash_table->dynobj;
+  asection *sdyn;
+  bfd_size_type size;
+  const struct elf_backend_data *bed;
+  bfd_byte *extdyn;
+
+  _bfd_elf_strtab_finalize (dynstr);
+  size = _bfd_elf_strtab_size (dynstr);
+
+  bed = get_elf_backend_data (dynobj);
+  sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
+  BFD_ASSERT (sdyn != NULL);
+
+  /* Update all .dynamic entries referencing .dynstr strings.  */
+  for (extdyn = sdyn->contents;
+       extdyn < sdyn->contents + sdyn->size;
+       extdyn += bed->s->sizeof_dyn)
+    {
+      Elf_Internal_Dyn dyn;
+
+      bed->s->swap_dyn_in (dynobj, extdyn, &dyn);
+      switch (dyn.d_tag)
+	{
+	case DT_STRSZ:
+	  dyn.d_un.d_val = size;
+	  break;
+	case DT_NEEDED:
+	case DT_SONAME:
+	case DT_RPATH:
+	case DT_RUNPATH:
+	case DT_FILTER:
+	case DT_AUXILIARY:
+	  dyn.d_un.d_val = _bfd_elf_strtab_offset (dynstr, dyn.d_un.d_val);
+	  break;
+	default:
+	  continue;
+	}
+      bed->s->swap_dyn_out (dynobj, &dyn, extdyn);
+    }
+
+  /* Now update local dynamic symbols.  */
+  for (entry = hash_table->dynlocal; entry ; entry = entry->next)
+    entry->isym.st_name = _bfd_elf_strtab_offset (dynstr,
+						  entry->isym.st_name);
+
+  /* And the rest of dynamic symbols.  */
+  elf_link_hash_traverse (hash_table, elf_adjust_dynstr_offsets, dynstr);
+
+  /* Adjust version definitions.  */
+  if (elf_tdata (output_bfd)->cverdefs)
+    {
+      asection *s;
+      bfd_byte *p;
+      bfd_size_type i;
+      Elf_Internal_Verdef def;
+      Elf_Internal_Verdaux defaux;
+
+      s = bfd_get_section_by_name (dynobj, ".gnu.version_d");
+      p = s->contents;
+      do
+	{
+	  _bfd_elf_swap_verdef_in (output_bfd, (Elf_External_Verdef *) p,
+				   &def);
+	  p += sizeof (Elf_External_Verdef);
+	  for (i = 0; i < def.vd_cnt; ++i)
+	    {
+	      _bfd_elf_swap_verdaux_in (output_bfd,
+					(Elf_External_Verdaux *) p, &defaux);
+	      defaux.vda_name = _bfd_elf_strtab_offset (dynstr,
+							defaux.vda_name);
+	      _bfd_elf_swap_verdaux_out (output_bfd,
+					 &defaux, (Elf_External_Verdaux *) p);
+	      p += sizeof (Elf_External_Verdaux);
+	    }
+	}
+      while (def.vd_next);
+    }
+
+  /* Adjust version references.  */
+  if (elf_tdata (output_bfd)->verref)
+    {
+      asection *s;
+      bfd_byte *p;
+      bfd_size_type i;
+      Elf_Internal_Verneed need;
+      Elf_Internal_Vernaux needaux;
+
+      s = bfd_get_section_by_name (dynobj, ".gnu.version_r");
+      p = s->contents;
+      do
+	{
+	  _bfd_elf_swap_verneed_in (output_bfd, (Elf_External_Verneed *) p,
+				    &need);
+	  need.vn_file = _bfd_elf_strtab_offset (dynstr, need.vn_file);
+	  _bfd_elf_swap_verneed_out (output_bfd, &need,
+				     (Elf_External_Verneed *) p);
+	  p += sizeof (Elf_External_Verneed);
+	  for (i = 0; i < need.vn_cnt; ++i)
+	    {
+	      _bfd_elf_swap_vernaux_in (output_bfd,
+					(Elf_External_Vernaux *) p, &needaux);
+	      needaux.vna_name = _bfd_elf_strtab_offset (dynstr,
+							 needaux.vna_name);
+	      _bfd_elf_swap_vernaux_out (output_bfd,
+					 &needaux,
+					 (Elf_External_Vernaux *) p);
+	      p += sizeof (Elf_External_Vernaux);
+	    }
+	}
+      while (need.vn_next);
+    }
+
+  return TRUE;
+}
+
+/* Add symbols from an ELF object file to the linker hash table.  */
+
+static bfd_boolean
+elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
+{
+  bfd_boolean (*add_symbol_hook)
+    (bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
+     const char **, flagword *, asection **, bfd_vma *);
+  bfd_boolean (*check_relocs)
+    (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
+  bfd_boolean (*check_directives)
+    (bfd *, struct bfd_link_info *);
+  bfd_boolean collect;
+  Elf_Internal_Shdr *hdr;
+  bfd_size_type symcount;
+  bfd_size_type extsymcount;
+  bfd_size_type extsymoff;
+  struct elf_link_hash_entry **sym_hash;
+  bfd_boolean dynamic;
+  Elf_External_Versym *extversym = NULL;
+  Elf_External_Versym *ever;
+  struct elf_link_hash_entry *weaks;
+  struct elf_link_hash_entry **nondeflt_vers = NULL;
+  bfd_size_type nondeflt_vers_cnt = 0;
+  Elf_Internal_Sym *isymbuf = NULL;
+  Elf_Internal_Sym *isym;
+  Elf_Internal_Sym *isymend;
+  const struct elf_backend_data *bed;
+  bfd_boolean add_needed;
+  struct elf_link_hash_table * hash_table;
+  bfd_size_type amt;
+
+  hash_table = elf_hash_table (info);
+
+  bed = get_elf_backend_data (abfd);
+  add_symbol_hook = bed->elf_add_symbol_hook;
+  collect = bed->collect;
+
+  if ((abfd->flags & DYNAMIC) == 0)
+    dynamic = FALSE;
+  else
+    {
+      dynamic = TRUE;
+
+      /* You can't use -r against a dynamic object.  Also, there's no
+	 hope of using a dynamic object which does not exactly match
+	 the format of the output file.  */
+      if (info->relocatable
+	  || !is_elf_hash_table (hash_table)
+	  || hash_table->root.creator != abfd->xvec)
+	{
+	  bfd_set_error (bfd_error_invalid_operation);
+	  goto error_return;
+	}
+    }
+
+  /* As a GNU extension, any input sections which are named
+     .gnu.warning.SYMBOL are treated as warning symbols for the given
+     symbol.  This differs from .gnu.warning sections, which generate
+     warnings when they are included in an output file.  */
+  if (info->executable)
+    {
+      asection *s;
+
+      for (s = abfd->sections; s != NULL; s = s->next)
+	{
+	  const char *name;
+
+	  name = bfd_get_section_name (abfd, s);
+	  if (strncmp (name, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0)
+	    {
+	      char *msg;
+	      bfd_size_type sz;
+	      bfd_size_type prefix_len;
+	      const char * gnu_warning_prefix = _("warning: ");
+
+	      name += sizeof ".gnu.warning." - 1;
+
+	      /* If this is a shared object, then look up the symbol
+		 in the hash table.  If it is there, and it is already
+		 been defined, then we will not be using the entry
+		 from this shared object, so we don't need to warn.
+		 FIXME: If we see the definition in a regular object
+		 later on, we will warn, but we shouldn't.  The only
+		 fix is to keep track of what warnings we are supposed
+		 to emit, and then handle them all at the end of the
+		 link.  */
+	      if (dynamic)
+		{
+		  struct elf_link_hash_entry *h;
+
+		  h = elf_link_hash_lookup (hash_table, name,
+					    FALSE, FALSE, TRUE);
+
+		  /* FIXME: What about bfd_link_hash_common?  */
+		  if (h != NULL
+		      && (h->root.type == bfd_link_hash_defined
+			  || h->root.type == bfd_link_hash_defweak))
+		    {
+		      /* We don't want to issue this warning.  Clobber
+			 the section size so that the warning does not
+			 get copied into the output file.  */
+		      s->size = 0;
+		      continue;
+		    }
+		}
+
+	      sz = s->size;
+	      prefix_len = strlen (gnu_warning_prefix);
+	      msg = bfd_alloc (abfd, prefix_len + sz + 1);
+	      if (msg == NULL)
+		goto error_return;
+
+	      strcpy (msg, gnu_warning_prefix);
+	      if (! bfd_get_section_contents (abfd, s, msg + prefix_len, 0, sz))
+		goto error_return;
+
+	      msg[prefix_len + sz] = '\0';
+
+	      if (! (_bfd_generic_link_add_one_symbol
+		     (info, abfd, name, BSF_WARNING, s, 0, msg,
+		      FALSE, collect, NULL)))
+		goto error_return;
+
+	      if (! info->relocatable)
+		{
+		  /* Clobber the section size so that the warning does
+		     not get copied into the output file.  */
+		  s->size = 0;
+		}
+	    }
+	}
+    }
+
+  add_needed = TRUE;
+  if (! dynamic)
+    {
+      /* If we are creating a shared library, create all the dynamic
+	 sections immediately.  We need to attach them to something,
+	 so we attach them to this BFD, provided it is the right
+	 format.  FIXME: If there are no input BFD's of the same
+	 format as the output, we can't make a shared library.  */
+      if (info->shared
+	  && is_elf_hash_table (hash_table)
+	  && hash_table->root.creator == abfd->xvec
+	  && ! hash_table->dynamic_sections_created)
+	{
+	  if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
+	    goto error_return;
+	}
+    }
+  else if (!is_elf_hash_table (hash_table))
+    goto error_return;
+  else
+    {
+      asection *s;
+      const char *soname = NULL;
+      struct bfd_link_needed_list *rpath = NULL, *runpath = NULL;
+      int ret;
+
+      /* ld --just-symbols and dynamic objects don't mix very well.
+	 Test for --just-symbols by looking at info set up by
+	 _bfd_elf_link_just_syms.  */
+      if ((s = abfd->sections) != NULL
+	  && s->sec_info_type == ELF_INFO_TYPE_JUST_SYMS)
+	goto error_return;
+
+      /* If this dynamic lib was specified on the command line with
+	 --as-needed in effect, then we don't want to add a DT_NEEDED
+	 tag unless the lib is actually used.  Similary for libs brought
+	 in by another lib's DT_NEEDED.  */
+      add_needed = elf_dyn_lib_class (abfd) == DYN_NORMAL;
+
+      s = bfd_get_section_by_name (abfd, ".dynamic");
+      if (s != NULL)
+	{
+	  bfd_byte *dynbuf;
+	  bfd_byte *extdyn;
+	  int elfsec;
+	  unsigned long shlink;
+
+	  if (!bfd_malloc_and_get_section (abfd, s, &dynbuf))
+	    goto error_free_dyn;
+
+	  elfsec = _bfd_elf_section_from_bfd_section (abfd, s);
+	  if (elfsec == -1)
+	    goto error_free_dyn;
+	  shlink = elf_elfsections (abfd)[elfsec]->sh_link;
+
+	  for (extdyn = dynbuf;
+	       extdyn < dynbuf + s->size;
+	       extdyn += bed->s->sizeof_dyn)
+	    {
+	      Elf_Internal_Dyn dyn;
+
+	      bed->s->swap_dyn_in (abfd, extdyn, &dyn);
+	      if (dyn.d_tag == DT_SONAME)
+		{
+		  unsigned int tagv = dyn.d_un.d_val;
+		  soname = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
+		  if (soname == NULL)
+		    goto error_free_dyn;
+		}
+	      if (dyn.d_tag == DT_NEEDED)
+		{
+		  struct bfd_link_needed_list *n, **pn;
+		  char *fnm, *anm;
+		  unsigned int tagv = dyn.d_un.d_val;
+
+		  amt = sizeof (struct bfd_link_needed_list);
+		  n = bfd_alloc (abfd, amt);
+		  fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
+		  if (n == NULL || fnm == NULL)
+		    goto error_free_dyn;
+		  amt = strlen (fnm) + 1;
+		  anm = bfd_alloc (abfd, amt);
+		  if (anm == NULL)
+		    goto error_free_dyn;
+		  memcpy (anm, fnm, amt);
+		  n->name = anm;
+		  n->by = abfd;
+		  n->next = NULL;
+		  for (pn = & hash_table->needed;
+		       *pn != NULL;
+		       pn = &(*pn)->next)
+		    ;
+		  *pn = n;
+		}
+	      if (dyn.d_tag == DT_RUNPATH)
+		{
+		  struct bfd_link_needed_list *n, **pn;
+		  char *fnm, *anm;
+		  unsigned int tagv = dyn.d_un.d_val;
+
+		  amt = sizeof (struct bfd_link_needed_list);
+		  n = bfd_alloc (abfd, amt);
+		  fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
+		  if (n == NULL || fnm == NULL)
+		    goto error_free_dyn;
+		  amt = strlen (fnm) + 1;
+		  anm = bfd_alloc (abfd, amt);
+		  if (anm == NULL)
+		    goto error_free_dyn;
+		  memcpy (anm, fnm, amt);
+		  n->name = anm;
+		  n->by = abfd;
+		  n->next = NULL;
+		  for (pn = & runpath;
+		       *pn != NULL;
+		       pn = &(*pn)->next)
+		    ;
+		  *pn = n;
+		}
+	      /* Ignore DT_RPATH if we have seen DT_RUNPATH.  */
+	      if (!runpath && dyn.d_tag == DT_RPATH)
+		{
+		  struct bfd_link_needed_list *n, **pn;
+		  char *fnm, *anm;
+		  unsigned int tagv = dyn.d_un.d_val;
+
+		  amt = sizeof (struct bfd_link_needed_list);
+		  n = bfd_alloc (abfd, amt);
+		  fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
+		  if (n == NULL || fnm == NULL)
+		    goto error_free_dyn;
+		  amt = strlen (fnm) + 1;
+		  anm = bfd_alloc (abfd, amt);
+		  if (anm == NULL)
+		    {
+		    error_free_dyn:
+		      free (dynbuf);
+		      goto error_return;
+		    }
+		  memcpy (anm, fnm, amt);
+		  n->name = anm;
+		  n->by = abfd;
+		  n->next = NULL;
+		  for (pn = & rpath;
+		       *pn != NULL;
+		       pn = &(*pn)->next)
+		    ;
+		  *pn = n;
+		}
+	    }
+
+	  free (dynbuf);
+	}
+
+      /* DT_RUNPATH overrides DT_RPATH.  Do _NOT_ bfd_release, as that
+	 frees all more recently bfd_alloc'd blocks as well.  */
+      if (runpath)
+	rpath = runpath;
+
+      if (rpath)
+	{
+	  struct bfd_link_needed_list **pn;
+	  for (pn = & hash_table->runpath;
+	       *pn != NULL;
+	       pn = &(*pn)->next)
+	    ;
+	  *pn = rpath;
+	}
+
+      /* We do not want to include any of the sections in a dynamic
+	 object in the output file.  We hack by simply clobbering the
+	 list of sections in the BFD.  This could be handled more
+	 cleanly by, say, a new section flag; the existing
+	 SEC_NEVER_LOAD flag is not the one we want, because that one
+	 still implies that the section takes up space in the output
+	 file.  */
+      bfd_section_list_clear (abfd);
+
+      /* If this is the first dynamic object found in the link, create
+	 the special sections required for dynamic linking.  */
+      if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
+	goto error_return;
+
+      /* Find the name to use in a DT_NEEDED entry that refers to this
+	 object.  If the object has a DT_SONAME entry, we use it.
+	 Otherwise, if the generic linker stuck something in
+	 elf_dt_name, we use that.  Otherwise, we just use the file
+	 name.  */
+      if (soname == NULL || *soname == '\0')
+	{
+	  soname = elf_dt_name (abfd);
+	  if (soname == NULL || *soname == '\0')
+	    soname = bfd_get_filename (abfd);
+	}
+
+      /* Save the SONAME because sometimes the linker emulation code
+	 will need to know it.  */
+      elf_dt_name (abfd) = soname;
+
+      ret = elf_add_dt_needed_tag (info, soname, add_needed);
+      if (ret < 0)
+	goto error_return;
+
+      /* If we have already included this dynamic object in the
+	 link, just ignore it.  There is no reason to include a
+	 particular dynamic object more than once.  */
+      if (ret > 0)
+	return TRUE;
+    }
+
+  /* If this is a dynamic object, we always link against the .dynsym
+     symbol table, not the .symtab symbol table.  The dynamic linker
+     will only see the .dynsym symbol table, so there is no reason to
+     look at .symtab for a dynamic object.  */
+
+  if (! dynamic || elf_dynsymtab (abfd) == 0)
+    hdr = &elf_tdata (abfd)->symtab_hdr;
+  else
+    hdr = &elf_tdata (abfd)->dynsymtab_hdr;
+
+  symcount = hdr->sh_size / bed->s->sizeof_sym;
+
+  /* The sh_info field of the symtab header tells us where the
+     external symbols start.  We don't care about the local symbols at
+     this point.  */
+  if (elf_bad_symtab (abfd))
+    {
+      extsymcount = symcount;
+      extsymoff = 0;
+    }
+  else
+    {
+      extsymcount = symcount - hdr->sh_info;
+      extsymoff = hdr->sh_info;
+    }
+
+  sym_hash = NULL;
+  if (extsymcount != 0)
+    {
+      isymbuf = bfd_elf_get_elf_syms (abfd, hdr, extsymcount, extsymoff,
+				      NULL, NULL, NULL);
+      if (isymbuf == NULL)
+	goto error_return;
+
+      /* We store a pointer to the hash table entry for each external
+	 symbol.  */
+      amt = extsymcount * sizeof (struct elf_link_hash_entry *);
+      sym_hash = bfd_alloc (abfd, amt);
+      if (sym_hash == NULL)
+	goto error_free_sym;
+      elf_sym_hashes (abfd) = sym_hash;
+    }
+
+  if (dynamic)
+    {
+      /* Read in any version definitions.  */
+      if (! _bfd_elf_slurp_version_tables (abfd))
+	goto error_free_sym;
+
+      /* Read in the symbol versions, but don't bother to convert them
+	 to internal format.  */
+      if (elf_dynversym (abfd) != 0)
+	{
+	  Elf_Internal_Shdr *versymhdr;
+
+	  versymhdr = &elf_tdata (abfd)->dynversym_hdr;
+	  extversym = bfd_malloc (versymhdr->sh_size);
+	  if (extversym == NULL)
+	    goto error_free_sym;
+	  amt = versymhdr->sh_size;
+	  if (bfd_seek (abfd, versymhdr->sh_offset, SEEK_SET) != 0
+	      || bfd_bread (extversym, amt, abfd) != amt)
+	    goto error_free_vers;
+	}
+    }
+
+  weaks = NULL;
+
+  ever = extversym != NULL ? extversym + extsymoff : NULL;
+  for (isym = isymbuf, isymend = isymbuf + extsymcount;
+       isym < isymend;
+       isym++, sym_hash++, ever = (ever != NULL ? ever + 1 : NULL))
+    {
+      int bind;
+      bfd_vma value;
+      asection *sec;
+      flagword flags;
+      const char *name;
+      struct elf_link_hash_entry *h;
+      bfd_boolean definition;
+      bfd_boolean size_change_ok;
+      bfd_boolean type_change_ok;
+      bfd_boolean new_weakdef;
+      bfd_boolean override;
+      unsigned int old_alignment;
+      bfd *old_bfd;
+
+      override = FALSE;
+
+      flags = BSF_NO_FLAGS;
+      sec = NULL;
+      value = isym->st_value;
+      *sym_hash = NULL;
+
+      bind = ELF_ST_BIND (isym->st_info);
+      if (bind == STB_LOCAL)
+	{
+	  /* This should be impossible, since ELF requires that all
+	     global symbols follow all local symbols, and that sh_info
+	     point to the first global symbol.  Unfortunately, Irix 5
+	     screws this up.  */
+	  continue;
+	}
+      else if (bind == STB_GLOBAL)
+	{
+	  if (isym->st_shndx != SHN_UNDEF
+	      && isym->st_shndx != SHN_COMMON)
+	    flags = BSF_GLOBAL;
+	}
+      else if (bind == STB_WEAK)
+	flags = BSF_WEAK;
+      else
+	{
+	  /* Leave it up to the processor backend.  */
+	}
+
+      if (isym->st_shndx == SHN_UNDEF)
+	sec = bfd_und_section_ptr;
+      else if (isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE)
+	{
+	  sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
+	  if (sec == NULL)
+	    sec = bfd_abs_section_ptr;
+	  else if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
+	    value -= sec->vma;
+	}
+      else if (isym->st_shndx == SHN_ABS)
+	sec = bfd_abs_section_ptr;
+      else if (isym->st_shndx == SHN_COMMON)
+	{
+	  sec = bfd_com_section_ptr;
+	  /* What ELF calls the size we call the value.  What ELF
+	     calls the value we call the alignment.  */
+	  value = isym->st_size;
+	}
+      else
+	{
+	  /* Leave it up to the processor backend.  */
+	}
+
+      name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link,
+					      isym->st_name);
+      if (name == NULL)
+	goto error_free_vers;
+
+      if (isym->st_shndx == SHN_COMMON
+	  && ELF_ST_TYPE (isym->st_info) == STT_TLS)
+	{
+	  asection *tcomm = bfd_get_section_by_name (abfd, ".tcommon");
+
+	  if (tcomm == NULL)
+	    {
+	      tcomm = bfd_make_section (abfd, ".tcommon");
+	      if (tcomm == NULL
+		  || !bfd_set_section_flags (abfd, tcomm, (SEC_ALLOC
+							   | SEC_IS_COMMON
+							   | SEC_LINKER_CREATED
+							   | SEC_THREAD_LOCAL)))
+		goto error_free_vers;
+	    }
+	  sec = tcomm;
+	}
+      else if (add_symbol_hook)
+	{
+	  if (! (*add_symbol_hook) (abfd, info, isym, &name, &flags, &sec,
+				    &value))
+	    goto error_free_vers;
+
+	  /* The hook function sets the name to NULL if this symbol
+	     should be skipped for some reason.  */
+	  if (name == NULL)
+	    continue;
+	}
+
+      /* Sanity check that all possibilities were handled.  */
+      if (sec == NULL)
+	{
+	  bfd_set_error (bfd_error_bad_value);
+	  goto error_free_vers;
+	}
+
+      if (bfd_is_und_section (sec)
+	  || bfd_is_com_section (sec))
+	definition = FALSE;
+      else
+	definition = TRUE;
+
+      size_change_ok = FALSE;
+      type_change_ok = get_elf_backend_data (abfd)->type_change_ok;
+      old_alignment = 0;
+      old_bfd = NULL;
+
+      if (is_elf_hash_table (hash_table))
+	{
+	  Elf_Internal_Versym iver;
+	  unsigned int vernum = 0;
+	  bfd_boolean skip;
+
+	  if (ever != NULL)
+	    {
+	      _bfd_elf_swap_versym_in (abfd, ever, &iver);
+	      vernum = iver.vs_vers & VERSYM_VERSION;
+
+	      /* If this is a hidden symbol, or if it is not version
+		 1, we append the version name to the symbol name.
+		 However, we do not modify a non-hidden absolute
+		 symbol, because it might be the version symbol
+		 itself.  FIXME: What if it isn't?  */
+	      if ((iver.vs_vers & VERSYM_HIDDEN) != 0
+		  || (vernum > 1 && ! bfd_is_abs_section (sec)))
+		{
+		  const char *verstr;
+		  size_t namelen, verlen, newlen;
+		  char *newname, *p;
+
+		  if (isym->st_shndx != SHN_UNDEF)
+		    {
+		      if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info)
+			{
+			  (*_bfd_error_handler)
+			    (_("%s: %s: invalid version %u (max %d)"),
+			     bfd_archive_filename (abfd), name, vernum,
+			     elf_tdata (abfd)->dynverdef_hdr.sh_info);
+			  bfd_set_error (bfd_error_bad_value);
+			  goto error_free_vers;
+			}
+		      else if (vernum > 1)
+			verstr =
+			  elf_tdata (abfd)->verdef[vernum - 1].vd_nodename;
+		      else
+			verstr = "";
+		    }
+		  else
+		    {
+		      /* We cannot simply test for the number of
+			 entries in the VERNEED section since the
+			 numbers for the needed versions do not start
+			 at 0.  */
+		      Elf_Internal_Verneed *t;
+
+		      verstr = NULL;
+		      for (t = elf_tdata (abfd)->verref;
+			   t != NULL;
+			   t = t->vn_nextref)
+			{
+			  Elf_Internal_Vernaux *a;
+
+			  for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
+			    {
+			      if (a->vna_other == vernum)
+				{
+				  verstr = a->vna_nodename;
+				  break;
+				}
+			    }
+			  if (a != NULL)
+			    break;
+			}
+		      if (verstr == NULL)
+			{
+			  (*_bfd_error_handler)
+			    (_("%s: %s: invalid needed version %d"),
+			     bfd_archive_filename (abfd), name, vernum);
+			  bfd_set_error (bfd_error_bad_value);
+			  goto error_free_vers;
+			}
+		    }
+
+		  namelen = strlen (name);
+		  verlen = strlen (verstr);
+		  newlen = namelen + verlen + 2;
+		  if ((iver.vs_vers & VERSYM_HIDDEN) == 0
+		      && isym->st_shndx != SHN_UNDEF)
+		    ++newlen;
+
+		  newname = bfd_alloc (abfd, newlen);
+		  if (newname == NULL)
+		    goto error_free_vers;
+		  memcpy (newname, name, namelen);
+		  p = newname + namelen;
+		  *p++ = ELF_VER_CHR;
+		  /* If this is a defined non-hidden version symbol,
+		     we add another @ to the name.  This indicates the
+		     default version of the symbol.  */
+		  if ((iver.vs_vers & VERSYM_HIDDEN) == 0
+		      && isym->st_shndx != SHN_UNDEF)
+		    *p++ = ELF_VER_CHR;
+		  memcpy (p, verstr, verlen + 1);
+
+		  name = newname;
+		}
+	    }
+
+	  if (!_bfd_elf_merge_symbol (abfd, info, name, isym, &sec, &value,
+				      sym_hash, &skip, &override,
+				      &type_change_ok, &size_change_ok))
+	    goto error_free_vers;
+
+	  if (skip)
+	    continue;
+
+	  if (override)
+	    definition = FALSE;
+
+	  h = *sym_hash;
+	  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;
+
+	  /* Remember the old alignment if this is a common symbol, so
+	     that we don't reduce the alignment later on.  We can't
+	     check later, because _bfd_generic_link_add_one_symbol
+	     will set a default for the alignment which we want to
+	     override. We also remember the old bfd where the existing
+	     definition comes from.  */
+	  switch (h->root.type)
+	    {
+	    default:
+	      break;
+
+	    case bfd_link_hash_defined:
+	    case bfd_link_hash_defweak:
+	      old_bfd = h->root.u.def.section->owner;
+	      break;
+
+	    case bfd_link_hash_common:
+	      old_bfd = h->root.u.c.p->section->owner;
+	      old_alignment = h->root.u.c.p->alignment_power;
+	      break;
+	    }
+
+	  if (elf_tdata (abfd)->verdef != NULL
+	      && ! override
+	      && vernum > 1
+	      && definition)
+	    h->verinfo.verdef = &elf_tdata (abfd)->verdef[vernum - 1];
+	}
+
+      if (! (_bfd_generic_link_add_one_symbol
+	     (info, abfd, name, flags, sec, value, NULL, FALSE, collect,
+	      (struct bfd_link_hash_entry **) sym_hash)))
+	goto error_free_vers;
+
+      h = *sym_hash;
+      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;
+      *sym_hash = h;
+
+      new_weakdef = FALSE;
+      if (dynamic
+	  && definition
+	  && (flags & BSF_WEAK) != 0
+	  && ELF_ST_TYPE (isym->st_info) != STT_FUNC
+	  && is_elf_hash_table (hash_table)
+	  && h->weakdef == NULL)
+	{
+	  /* Keep a list of all weak defined non function symbols from
+	     a dynamic object, using the weakdef field.  Later in this
+	     function we will set the weakdef field to the correct
+	     value.  We only put non-function symbols from dynamic
+	     objects on this list, because that happens to be the only
+	     time we need to know the normal symbol corresponding to a
+	     weak symbol, and the information is time consuming to
+	     figure out.  If the weakdef field is not already NULL,
+	     then this symbol was already defined by some previous
+	     dynamic object, and we will be using that previous
+	     definition anyhow.  */
+
+	  h->weakdef = weaks;
+	  weaks = h;
+	  new_weakdef = TRUE;
+	}
+
+      /* Set the alignment of a common symbol.  */
+      if (isym->st_shndx == SHN_COMMON
+	  && h->root.type == bfd_link_hash_common)
+	{
+	  unsigned int align;
+
+	  align = bfd_log2 (isym->st_value);
+	  if (align > old_alignment
+	      /* Permit an alignment power of zero if an alignment of one
+		 is specified and no other alignments have been specified.  */
+	      || (isym->st_value == 1 && old_alignment == 0))
+	    h->root.u.c.p->alignment_power = align;
+	  else
+	    h->root.u.c.p->alignment_power = old_alignment;
+	}
+
+      if (is_elf_hash_table (hash_table))
+	{
+	  int old_flags;
+	  bfd_boolean dynsym;
+	  int new_flag;
+
+	  /* Check the alignment when a common symbol is involved. This
+	     can change when a common symbol is overridden by a normal
+	     definition or a common symbol is ignored due to the old
+	     normal definition. We need to make sure the maximum
+	     alignment is maintained.  */
+	  if ((old_alignment || isym->st_shndx == SHN_COMMON)
+	      && h->root.type != bfd_link_hash_common)
+	    {
+	      unsigned int common_align;
+	      unsigned int normal_align;
+	      unsigned int symbol_align;
+	      bfd *normal_bfd;
+	      bfd *common_bfd;
+
+	      symbol_align = ffs (h->root.u.def.value) - 1;
+	      if (h->root.u.def.section->owner != NULL
+		  && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
+		{
+		  normal_align = h->root.u.def.section->alignment_power;
+		  if (normal_align > symbol_align)
+		    normal_align = symbol_align;
+		}
+	      else
+		normal_align = symbol_align;
+
+	      if (old_alignment)
+		{
+		  common_align = old_alignment;
+		  common_bfd = old_bfd;
+		  normal_bfd = abfd;
+		}
+	      else
+		{
+		  common_align = bfd_log2 (isym->st_value);
+		  common_bfd = abfd;
+		  normal_bfd = old_bfd;
+		}
+
+	      if (normal_align < common_align)
+		(*_bfd_error_handler)
+		  (_("Warning: alignment %u of symbol `%s' in %s is smaller than %u in %s"),
+		   1 << normal_align,
+		   name,
+		   bfd_archive_filename (normal_bfd),
+		   1 << common_align,
+		   bfd_archive_filename (common_bfd));
+	    }
+
+	  /* Remember the symbol size and type.  */
+	  if (isym->st_size != 0
+	      && (definition || h->size == 0))
+	    {
+	      if (h->size != 0 && h->size != isym->st_size && ! size_change_ok)
+		(*_bfd_error_handler)
+		  (_("Warning: size of symbol `%s' changed from %lu in %s to %lu in %s"),
+		   name, (unsigned long) h->size,
+		   bfd_archive_filename (old_bfd),
+		   (unsigned long) isym->st_size,
+		   bfd_archive_filename (abfd));
+
+	      h->size = isym->st_size;
+	    }
+
+	  /* If this is a common symbol, then we always want H->SIZE
+	     to be the size of the common symbol.  The code just above
+	     won't fix the size if a common symbol becomes larger.  We
+	     don't warn about a size change here, because that is
+	     covered by --warn-common.  */
+	  if (h->root.type == bfd_link_hash_common)
+	    h->size = h->root.u.c.size;
+
+	  if (ELF_ST_TYPE (isym->st_info) != STT_NOTYPE
+	      && (definition || h->type == STT_NOTYPE))
+	    {
+	      if (h->type != STT_NOTYPE
+		  && h->type != ELF_ST_TYPE (isym->st_info)
+		  && ! type_change_ok)
+		(*_bfd_error_handler)
+		  (_("Warning: type of symbol `%s' changed from %d to %d in %s"),
+		   name, h->type, ELF_ST_TYPE (isym->st_info),
+		   bfd_archive_filename (abfd));
+
+	      h->type = ELF_ST_TYPE (isym->st_info);
+	    }
+
+	  /* If st_other has a processor-specific meaning, specific
+	     code might be needed here. We never merge the visibility
+	     attribute with the one from a dynamic object.  */
+	  if (bed->elf_backend_merge_symbol_attribute)
+	    (*bed->elf_backend_merge_symbol_attribute) (h, isym, definition,
+							dynamic);
+
+	  if (isym->st_other != 0 && !dynamic)
+	    {
+	      unsigned char hvis, symvis, other, nvis;
+
+	      /* Take the balance of OTHER from the definition.  */
+	      other = (definition ? isym->st_other : h->other);
+	      other &= ~ ELF_ST_VISIBILITY (-1);
+
+	      /* Combine visibilities, using the most constraining one.  */
+	      hvis   = ELF_ST_VISIBILITY (h->other);
+	      symvis = ELF_ST_VISIBILITY (isym->st_other);
+	      if (! hvis)
+		nvis = symvis;
+	      else if (! symvis)
+		nvis = hvis;
+	      else
+		nvis = hvis < symvis ? hvis : symvis;
+
+	      h->other = other | nvis;
+	    }
+
+	  /* Set a flag in the hash table entry indicating the type of
+	     reference or definition we just found.  Keep a count of
+	     the number of dynamic symbols we find.  A dynamic symbol
+	     is one which is referenced or defined by both a regular
+	     object and a shared object.  */
+	  old_flags = h->elf_link_hash_flags;
+	  dynsym = FALSE;
+	  if (! dynamic)
+	    {
+	      if (! definition)
+		{
+		  new_flag = ELF_LINK_HASH_REF_REGULAR;
+		  if (bind != STB_WEAK)
+		    new_flag |= ELF_LINK_HASH_REF_REGULAR_NONWEAK;
+		}
+	      else
+		new_flag = ELF_LINK_HASH_DEF_REGULAR;
+	      if (! info->executable
+		  || (old_flags & (ELF_LINK_HASH_DEF_DYNAMIC
+				   | ELF_LINK_HASH_REF_DYNAMIC)) != 0)
+		dynsym = TRUE;
+	    }
+	  else
+	    {
+	      if (! definition)
+		new_flag = ELF_LINK_HASH_REF_DYNAMIC;
+	      else
+		new_flag = ELF_LINK_HASH_DEF_DYNAMIC;
+	      if ((old_flags & (ELF_LINK_HASH_DEF_REGULAR
+				| ELF_LINK_HASH_REF_REGULAR)) != 0
+		  || (h->weakdef != NULL
+		      && ! new_weakdef
+		      && h->weakdef->dynindx != -1))
+		dynsym = TRUE;
+	    }
+
+	  h->elf_link_hash_flags |= new_flag;
+
+	  /* Check to see if we need to add an indirect symbol for
+	     the default name.  */
+	  if (definition || h->root.type == bfd_link_hash_common)
+	    if (!_bfd_elf_add_default_symbol (abfd, info, h, name, isym,
+					      &sec, &value, &dynsym,
+					      override))
+	      goto error_free_vers;
+
+	  if (definition && !dynamic)
+	    {
+	      char *p = strchr (name, ELF_VER_CHR);
+	      if (p != NULL && p[1] != ELF_VER_CHR)
+		{
+		  /* Queue non-default versions so that .symver x, x@FOO
+		     aliases can be checked.  */
+		  if (! nondeflt_vers)
+		    {
+		      amt = (isymend - isym + 1)
+			    * sizeof (struct elf_link_hash_entry *);
+		      nondeflt_vers = bfd_malloc (amt);
+		    }
+		  nondeflt_vers [nondeflt_vers_cnt++] = h;
+		}
+	    }
+
+	  if (dynsym && h->dynindx == -1)
+	    {
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
+		goto error_free_vers;
+	      if (h->weakdef != NULL
+		  && ! new_weakdef
+		  && h->weakdef->dynindx == -1)
+		{
+		  if (! bfd_elf_link_record_dynamic_symbol (info, h->weakdef))
+		    goto error_free_vers;
+		}
+	    }
+	  else if (dynsym && h->dynindx != -1)
+	    /* If the symbol already has a dynamic index, but
+	       visibility says it should not be visible, turn it into
+	       a local symbol.  */
+	    switch (ELF_ST_VISIBILITY (h->other))
+	      {
+	      case STV_INTERNAL:
+	      case STV_HIDDEN:
+		(*bed->elf_backend_hide_symbol) (info, h, TRUE);
+		dynsym = FALSE;
+		break;
+	      }
+
+	  if (!add_needed
+	      && definition
+	      && dynsym
+	      && (h->elf_link_hash_flags
+		  & ELF_LINK_HASH_REF_REGULAR) != 0)
+	    {
+	      int ret;
+	      const char *soname = elf_dt_name (abfd);
+
+	      /* A symbol from a library loaded via DT_NEEDED of some
+		 other library is referenced by a regular object.
+		 Add a DT_NEEDED entry for it.  */
+	      add_needed = TRUE;
+	      ret = elf_add_dt_needed_tag (info, soname, add_needed);
+	      if (ret < 0)
+		goto error_free_vers;
+
+	      BFD_ASSERT (ret == 0);
+	    }
+	}
+    }
+
+  /* Now that all the symbols from this input file are created, handle
+     .symver foo, foo@BAR such that any relocs against foo become foo@BAR.  */
+  if (nondeflt_vers != NULL)
+    {
+      bfd_size_type cnt, symidx;
+
+      for (cnt = 0; cnt < nondeflt_vers_cnt; ++cnt)
+	{
+	  struct elf_link_hash_entry *h = nondeflt_vers[cnt], *hi;
+	  char *shortname, *p;
+
+	  p = strchr (h->root.root.string, ELF_VER_CHR);
+	  if (p == NULL
+	      || (h->root.type != bfd_link_hash_defined
+		  && h->root.type != bfd_link_hash_defweak))
+	    continue;
+
+	  amt = p - h->root.root.string;
+	  shortname = bfd_malloc (amt + 1);
+	  memcpy (shortname, h->root.root.string, amt);
+	  shortname[amt] = '\0';
+
+	  hi = (struct elf_link_hash_entry *)
+	       bfd_link_hash_lookup (&hash_table->root, shortname,
+				     FALSE, FALSE, FALSE);
+	  if (hi != NULL
+	      && hi->root.type == h->root.type
+	      && hi->root.u.def.value == h->root.u.def.value
+	      && hi->root.u.def.section == h->root.u.def.section)
+	    {
+	      (*bed->elf_backend_hide_symbol) (info, hi, TRUE);
+	      hi->root.type = bfd_link_hash_indirect;
+	      hi->root.u.i.link = (struct bfd_link_hash_entry *) h;
+	      (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi);
+	      sym_hash = elf_sym_hashes (abfd);
+	      if (sym_hash)
+		for (symidx = 0; symidx < extsymcount; ++symidx)
+		  if (sym_hash[symidx] == hi)
+		    {
+		      sym_hash[symidx] = h;
+		      break;
+		    }
+	    }
+	  free (shortname);
+	}
+      free (nondeflt_vers);
+      nondeflt_vers = NULL;
+    }
+
+  if (extversym != NULL)
+    {
+      free (extversym);
+      extversym = NULL;
+    }
+
+  if (isymbuf != NULL)
+    free (isymbuf);
+  isymbuf = NULL;
+
+  /* Now set the weakdefs field correctly for all the weak defined
+     symbols we found.  The only way to do this is to search all the
+     symbols.  Since we only need the information for non functions in
+     dynamic objects, that's the only time we actually put anything on
+     the list WEAKS.  We need this information so that if a regular
+     object refers to a symbol defined weakly in a dynamic object, the
+     real symbol in the dynamic object is also put in the dynamic
+     symbols; we also must arrange for both symbols to point to the
+     same memory location.  We could handle the general case of symbol
+     aliasing, but a general symbol alias can only be generated in
+     assembler code, handling it correctly would be very time
+     consuming, and other ELF linkers don't handle general aliasing
+     either.  */
+  if (weaks != NULL)
+    {
+      struct elf_link_hash_entry **hpp;
+      struct elf_link_hash_entry **hppend;
+      struct elf_link_hash_entry **sorted_sym_hash;
+      struct elf_link_hash_entry *h;
+      size_t sym_count;
+
+      /* Since we have to search the whole symbol list for each weak
+	 defined symbol, search time for N weak defined symbols will be
+	 O(N^2). Binary search will cut it down to O(NlogN).  */
+      amt = extsymcount * sizeof (struct elf_link_hash_entry *);
+      sorted_sym_hash = bfd_malloc (amt);
+      if (sorted_sym_hash == NULL)
+	goto error_return;
+      sym_hash = sorted_sym_hash;
+      hpp = elf_sym_hashes (abfd);
+      hppend = hpp + extsymcount;
+      sym_count = 0;
+      for (; hpp < hppend; hpp++)
+	{
+	  h = *hpp;
+	  if (h != NULL
+	      && h->root.type == bfd_link_hash_defined
+	      && h->type != STT_FUNC)
+	    {
+	      *sym_hash = h;
+	      sym_hash++;
+	      sym_count++;
+	    }
+	}
+
+      qsort (sorted_sym_hash, sym_count,
+	     sizeof (struct elf_link_hash_entry *),
+	     elf_sort_symbol);
+
+      while (weaks != NULL)
+	{
+	  struct elf_link_hash_entry *hlook;
+	  asection *slook;
+	  bfd_vma vlook;
+	  long ilook;
+	  size_t i, j, idx;
+
+	  hlook = weaks;
+	  weaks = hlook->weakdef;
+	  hlook->weakdef = NULL;
+
+	  BFD_ASSERT (hlook->root.type == bfd_link_hash_defined
+		      || hlook->root.type == bfd_link_hash_defweak
+		      || hlook->root.type == bfd_link_hash_common
+		      || hlook->root.type == bfd_link_hash_indirect);
+	  slook = hlook->root.u.def.section;
+	  vlook = hlook->root.u.def.value;
+
+	  ilook = -1;
+	  i = 0;
+	  j = sym_count;
+	  while (i < j)
+	    {
+	      bfd_signed_vma vdiff;
+	      idx = (i + j) / 2;
+	      h = sorted_sym_hash [idx];
+	      vdiff = vlook - h->root.u.def.value;
+	      if (vdiff < 0)
+		j = idx;
+	      else if (vdiff > 0)
+		i = idx + 1;
+	      else
+		{
+		  long sdiff = slook->id - h->root.u.def.section->id;
+		  if (sdiff < 0)
+		    j = idx;
+		  else if (sdiff > 0)
+		    i = idx + 1;
+		  else
+		    {
+		      ilook = idx;
+		      break;
+		    }
+		}
+	    }
+
+	  /* We didn't find a value/section match.  */
+	  if (ilook == -1)
+	    continue;
+
+	  for (i = ilook; i < sym_count; i++)
+	    {
+	      h = sorted_sym_hash [i];
+
+	      /* Stop if value or section doesn't match.  */
+	      if (h->root.u.def.value != vlook
+		  || h->root.u.def.section != slook)
+		break;
+	      else if (h != hlook)
+		{
+		  hlook->weakdef = h;
+
+		  /* If the weak definition is in the list of dynamic
+		     symbols, make sure the real definition is put
+		     there as well.  */
+		  if (hlook->dynindx != -1 && h->dynindx == -1)
+		    {
+		      if (! bfd_elf_link_record_dynamic_symbol (info, h))
+			goto error_return;
+		    }
+
+		  /* If the real definition is in the list of dynamic
+		     symbols, make sure the weak definition is put
+		     there as well.  If we don't do this, then the
+		     dynamic loader might not merge the entries for the
+		     real definition and the weak definition.  */
+		  if (h->dynindx != -1 && hlook->dynindx == -1)
+		    {
+		      if (! bfd_elf_link_record_dynamic_symbol (info, hlook))
+			goto error_return;
+		    }
+		  break;
+		}
+	    }
+	}
+
+      free (sorted_sym_hash);
+    }
+
+  check_directives = get_elf_backend_data (abfd)->check_directives;
+  if (check_directives)
+    check_directives (abfd, info);
+
+  /* If this object is the same format as the output object, and it is
+     not a shared library, then let the backend look through the
+     relocs.
+
+     This is required to build global offset table entries and to
+     arrange for dynamic relocs.  It is not required for the
+     particular common case of linking non PIC code, even when linking
+     against shared libraries, but unfortunately there is no way of
+     knowing whether an object file has been compiled PIC or not.
+     Looking through the relocs is not particularly time consuming.
+     The problem is that we must either (1) keep the relocs in memory,
+     which causes the linker to require additional runtime memory or
+     (2) read the relocs twice from the input file, which wastes time.
+     This would be a good case for using mmap.
+
+     I have no idea how to handle linking PIC code into a file of a
+     different format.  It probably can't be done.  */
+  check_relocs = get_elf_backend_data (abfd)->check_relocs;
+  if (! dynamic
+      && is_elf_hash_table (hash_table)
+      && hash_table->root.creator == abfd->xvec
+      && check_relocs != NULL)
+    {
+      asection *o;
+
+      for (o = abfd->sections; o != NULL; o = o->next)
+	{
+	  Elf_Internal_Rela *internal_relocs;
+	  bfd_boolean ok;
+
+	  if ((o->flags & SEC_RELOC) == 0
+	      || o->reloc_count == 0
+	      || ((info->strip == strip_all || info->strip == strip_debugger)
+		  && (o->flags & SEC_DEBUGGING) != 0)
+	      || bfd_is_abs_section (o->output_section))
+	    continue;
+
+	  internal_relocs = _bfd_elf_link_read_relocs (abfd, o, NULL, NULL,
+						       info->keep_memory);
+	  if (internal_relocs == NULL)
+	    goto error_return;
+
+	  ok = (*check_relocs) (abfd, info, o, internal_relocs);
+
+	  if (elf_section_data (o)->relocs != internal_relocs)
+	    free (internal_relocs);
+
+	  if (! ok)
+	    goto error_return;
+	}
+    }
+
+  /* If this is a non-traditional link, try to optimize the handling
+     of the .stab/.stabstr sections.  */
+  if (! dynamic
+      && ! info->traditional_format
+      && is_elf_hash_table (hash_table)
+      && (info->strip != strip_all && info->strip != strip_debugger))
+    {
+      asection *stabstr;
+
+      stabstr = bfd_get_section_by_name (abfd, ".stabstr");
+      if (stabstr != NULL)
+	{
+	  bfd_size_type string_offset = 0;
+	  asection *stab;
+
+	  for (stab = abfd->sections; stab; stab = stab->next)
+	    if (strncmp (".stab", stab->name, 5) == 0
+		&& (!stab->name[5] ||
+		    (stab->name[5] == '.' && ISDIGIT (stab->name[6])))
+		&& (stab->flags & SEC_MERGE) == 0
+		&& !bfd_is_abs_section (stab->output_section))
+	      {
+		struct bfd_elf_section_data *secdata;
+
+		secdata = elf_section_data (stab);
+		if (! _bfd_link_section_stabs (abfd,
+					       &hash_table->stab_info,
+					       stab, stabstr,
+					       &secdata->sec_info,
+					       &string_offset))
+		  goto error_return;
+		if (secdata->sec_info)
+		  stab->sec_info_type = ELF_INFO_TYPE_STABS;
+	    }
+	}
+    }
+
+  if (is_elf_hash_table (hash_table))
+    {
+      /* Add this bfd to the loaded list.  */
+      struct elf_link_loaded_list *n;
+
+      n = bfd_alloc (abfd, sizeof (struct elf_link_loaded_list));
+      if (n == NULL)
+	goto error_return;
+      n->abfd = abfd;
+      n->next = hash_table->loaded;
+      hash_table->loaded = n;
+    }
+
+  return TRUE;
+
+ error_free_vers:
+  if (nondeflt_vers != NULL)
+    free (nondeflt_vers);
+  if (extversym != NULL)
+    free (extversym);
+ error_free_sym:
+  if (isymbuf != NULL)
+    free (isymbuf);
+ error_return:
+  return FALSE;
+}
+
 /* Add symbols from an ELF archive file to the linker hash table.  We
    don't use _bfd_generic_link_add_archive_symbols because of a
    problem which arises on UnixWare.  The UnixWare libc.so is an
@@ -2610,9 +4200,8 @@
    Unfortunately, we do have to make multiple passes over the symbol
    table until nothing further is resolved.  */
 
-bfd_boolean
-_bfd_elf_link_add_archive_symbols (bfd *abfd,
-				   struct bfd_link_info *info)
+static bfd_boolean
+elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
 {
   symindex c;
   bfd_boolean *defined = NULL;
@@ -2809,3 +4398,4621 @@
     free (included);
   return FALSE;
 }
+
+/* Given an ELF BFD, add symbols to the global hash table as
+   appropriate.  */
+
+bfd_boolean
+bfd_elf_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
+{
+  switch (bfd_get_format (abfd))
+    {
+    case bfd_object:
+      return elf_link_add_object_symbols (abfd, info);
+    case bfd_archive:
+      return elf_link_add_archive_symbols (abfd, info);
+    default:
+      bfd_set_error (bfd_error_wrong_format);
+      return FALSE;
+    }
+}
+
+/* This function will be called though elf_link_hash_traverse to store
+   all hash value of the exported symbols in an array.  */
+
+static bfd_boolean
+elf_collect_hash_codes (struct elf_link_hash_entry *h, void *data)
+{
+  unsigned long **valuep = data;
+  const char *name;
+  char *p;
+  unsigned long ha;
+  char *alc = NULL;
+
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+  /* Ignore indirect symbols.  These are added by the versioning code.  */
+  if (h->dynindx == -1)
+    return TRUE;
+
+  name = h->root.root.string;
+  p = strchr (name, ELF_VER_CHR);
+  if (p != NULL)
+    {
+      alc = bfd_malloc (p - name + 1);
+      memcpy (alc, name, p - name);
+      alc[p - name] = '\0';
+      name = alc;
+    }
+
+  /* Compute the hash value.  */
+  ha = bfd_elf_hash (name);
+
+  /* Store the found hash value in the array given as the argument.  */
+  *(*valuep)++ = ha;
+
+  /* And store it in the struct so that we can put it in the hash table
+     later.  */
+  h->elf_hash_value = ha;
+
+  if (alc != NULL)
+    free (alc);
+
+  return TRUE;
+}
+
+/* Array used to determine the number of hash table buckets to use
+   based on the number of symbols there are.  If there are fewer than
+   3 symbols we use 1 bucket, fewer than 17 symbols we use 3 buckets,
+   fewer than 37 we use 17 buckets, and so forth.  We never use more
+   than 32771 buckets.  */
+
+static const size_t elf_buckets[] =
+{
+  1, 3, 17, 37, 67, 97, 131, 197, 263, 521, 1031, 2053, 4099, 8209,
+  16411, 32771, 0
+};
+
+/* Compute bucket count for hashing table.  We do not use a static set
+   of possible tables sizes anymore.  Instead we determine for all
+   possible reasonable sizes of the table the outcome (i.e., the
+   number of collisions etc) and choose the best solution.  The
+   weighting functions are not too simple to allow the table to grow
+   without bounds.  Instead one of the weighting factors is the size.
+   Therefore the result is always a good payoff between few collisions
+   (= short chain lengths) and table size.  */
+static size_t
+compute_bucket_count (struct bfd_link_info *info)
+{
+  size_t dynsymcount = elf_hash_table (info)->dynsymcount;
+  size_t best_size = 0;
+  unsigned long int *hashcodes;
+  unsigned long int *hashcodesp;
+  unsigned long int i;
+  bfd_size_type amt;
+
+  /* Compute the hash values for all exported symbols.  At the same
+     time store the values in an array so that we could use them for
+     optimizations.  */
+  amt = dynsymcount;
+  amt *= sizeof (unsigned long int);
+  hashcodes = bfd_malloc (amt);
+  if (hashcodes == NULL)
+    return 0;
+  hashcodesp = hashcodes;
+
+  /* Put all hash values in HASHCODES.  */
+  elf_link_hash_traverse (elf_hash_table (info),
+			  elf_collect_hash_codes, &hashcodesp);
+
+  /* We have a problem here.  The following code to optimize the table
+     size requires an integer type with more the 32 bits.  If
+     BFD_HOST_U_64_BIT is set we know about such a type.  */
+#ifdef BFD_HOST_U_64_BIT
+  if (info->optimize)
+    {
+      unsigned long int nsyms = hashcodesp - hashcodes;
+      size_t minsize;
+      size_t maxsize;
+      BFD_HOST_U_64_BIT best_chlen = ~((BFD_HOST_U_64_BIT) 0);
+      unsigned long int *counts ;
+      bfd *dynobj = elf_hash_table (info)->dynobj;
+      const struct elf_backend_data *bed = get_elf_backend_data (dynobj);
+
+      /* Possible optimization parameters: if we have NSYMS symbols we say
+	 that the hashing table must at least have NSYMS/4 and at most
+	 2*NSYMS buckets.  */
+      minsize = nsyms / 4;
+      if (minsize == 0)
+	minsize = 1;
+      best_size = maxsize = nsyms * 2;
+
+      /* Create array where we count the collisions in.  We must use bfd_malloc
+	 since the size could be large.  */
+      amt = maxsize;
+      amt *= sizeof (unsigned long int);
+      counts = bfd_malloc (amt);
+      if (counts == NULL)
+	{
+	  free (hashcodes);
+	  return 0;
+	}
+
+      /* Compute the "optimal" size for the hash table.  The criteria is a
+	 minimal chain length.  The minor criteria is (of course) the size
+	 of the table.  */
+      for (i = minsize; i < maxsize; ++i)
+	{
+	  /* Walk through the array of hashcodes and count the collisions.  */
+	  BFD_HOST_U_64_BIT max;
+	  unsigned long int j;
+	  unsigned long int fact;
+
+	  memset (counts, '\0', i * sizeof (unsigned long int));
+
+	  /* Determine how often each hash bucket is used.  */
+	  for (j = 0; j < nsyms; ++j)
+	    ++counts[hashcodes[j] % i];
+
+	  /* For the weight function we need some information about the
+	     pagesize on the target.  This is information need not be 100%
+	     accurate.  Since this information is not available (so far) we
+	     define it here to a reasonable default value.  If it is crucial
+	     to have a better value some day simply define this value.  */
+# ifndef BFD_TARGET_PAGESIZE
+#  define BFD_TARGET_PAGESIZE	(4096)
+# endif
+
+	  /* We in any case need 2 + NSYMS entries for the size values and
+	     the chains.  */
+	  max = (2 + nsyms) * (bed->s->arch_size / 8);
+
+# if 1
+	  /* Variant 1: optimize for short chains.  We add the squares
+	     of all the chain lengths (which favors many small chain
+	     over a few long chains).  */
+	  for (j = 0; j < i; ++j)
+	    max += counts[j] * counts[j];
+
+	  /* This adds penalties for the overall size of the table.  */
+	  fact = i / (BFD_TARGET_PAGESIZE / (bed->s->arch_size / 8)) + 1;
+	  max *= fact * fact;
+# else
+	  /* Variant 2: Optimize a lot more for small table.  Here we
+	     also add squares of the size but we also add penalties for
+	     empty slots (the +1 term).  */
+	  for (j = 0; j < i; ++j)
+	    max += (1 + counts[j]) * (1 + counts[j]);
+
+	  /* The overall size of the table is considered, but not as
+	     strong as in variant 1, where it is squared.  */
+	  fact = i / (BFD_TARGET_PAGESIZE / (bed->s->arch_size / 8)) + 1;
+	  max *= fact;
+# endif
+
+	  /* Compare with current best results.  */
+	  if (max < best_chlen)
+	    {
+	      best_chlen = max;
+	      best_size = i;
+	    }
+	}
+
+      free (counts);
+    }
+  else
+#endif /* defined (BFD_HOST_U_64_BIT) */
+    {
+      /* This is the fallback solution if no 64bit type is available or if we
+	 are not supposed to spend much time on optimizations.  We select the
+	 bucket count using a fixed set of numbers.  */
+      for (i = 0; elf_buckets[i] != 0; i++)
+	{
+	  best_size = elf_buckets[i];
+	  if (dynsymcount < elf_buckets[i + 1])
+	    break;
+	}
+    }
+
+  /* Free the arrays we needed.  */
+  free (hashcodes);
+
+  return best_size;
+}
+
+/* Set up the sizes and contents of the ELF dynamic sections.  This is
+   called by the ELF linker emulation before_allocation routine.  We
+   must set the sizes of the sections before the linker sets the
+   addresses of the various sections.  */
+
+bfd_boolean
+bfd_elf_size_dynamic_sections (bfd *output_bfd,
+			       const char *soname,
+			       const char *rpath,
+			       const char *filter_shlib,
+			       const char * const *auxiliary_filters,
+			       struct bfd_link_info *info,
+			       asection **sinterpptr,
+			       struct bfd_elf_version_tree *verdefs)
+{
+  bfd_size_type soname_indx;
+  bfd *dynobj;
+  const struct elf_backend_data *bed;
+  struct elf_assign_sym_version_info asvinfo;
+
+  *sinterpptr = NULL;
+
+  soname_indx = (bfd_size_type) -1;
+
+  if (!is_elf_hash_table (info->hash))
+    return TRUE;
+
+  elf_tdata (output_bfd)->relro = info->relro;
+  if (info->execstack)
+    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
+  else if (info->noexecstack)
+    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
+  else
+    {
+      bfd *inputobj;
+      asection *notesec = NULL;
+      int exec = 0;
+
+      for (inputobj = info->input_bfds;
+	   inputobj;
+	   inputobj = inputobj->link_next)
+	{
+	  asection *s;
+
+	  if (inputobj->flags & DYNAMIC)
+	    continue;
+	  s = bfd_get_section_by_name (inputobj, ".note.GNU-stack");
+	  if (s)
+	    {
+	      if (s->flags & SEC_CODE)
+		exec = PF_X;
+	      notesec = s;
+	    }
+	  else
+	    exec = PF_X;
+	}
+      if (notesec)
+	{
+	  elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | exec;
+	  if (exec && info->relocatable
+	      && notesec->output_section != bfd_abs_section_ptr)
+	    notesec->output_section->flags |= SEC_CODE;
+	}
+    }
+
+  /* Any syms created from now on start with -1 in
+     got.refcount/offset and plt.refcount/offset.  */
+  elf_hash_table (info)->init_refcount = elf_hash_table (info)->init_offset;
+
+  /* The backend may have to create some sections regardless of whether
+     we're dynamic or not.  */
+  bed = get_elf_backend_data (output_bfd);
+  if (bed->elf_backend_always_size_sections
+      && ! (*bed->elf_backend_always_size_sections) (output_bfd, info))
+    return FALSE;
+
+  dynobj = elf_hash_table (info)->dynobj;
+
+  /* If there were no dynamic objects in the link, there is nothing to
+     do here.  */
+  if (dynobj == NULL)
+    return TRUE;
+
+  if (! _bfd_elf_maybe_strip_eh_frame_hdr (info))
+    return FALSE;
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      struct elf_info_failed eif;
+      struct elf_link_hash_entry *h;
+      asection *dynstr;
+      struct bfd_elf_version_tree *t;
+      struct bfd_elf_version_expr *d;
+      bfd_boolean all_defined;
+
+      *sinterpptr = bfd_get_section_by_name (dynobj, ".interp");
+      BFD_ASSERT (*sinterpptr != NULL || !info->executable);
+
+      if (soname != NULL)
+	{
+	  soname_indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
+					     soname, TRUE);
+	  if (soname_indx == (bfd_size_type) -1
+	      || !_bfd_elf_add_dynamic_entry (info, DT_SONAME, soname_indx))
+	    return FALSE;
+	}
+
+      if (info->symbolic)
+	{
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_SYMBOLIC, 0))
+	    return FALSE;
+	  info->flags |= DF_SYMBOLIC;
+	}
+
+      if (rpath != NULL)
+	{
+	  bfd_size_type indx;
+
+	  indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, rpath,
+				      TRUE);
+	  if (indx == (bfd_size_type) -1
+	      || !_bfd_elf_add_dynamic_entry (info, DT_RPATH, indx))
+	    return FALSE;
+
+	  if  (info->new_dtags)
+	    {
+	      _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, indx);
+	      if (!_bfd_elf_add_dynamic_entry (info, DT_RUNPATH, indx))
+		return FALSE;
+	    }
+	}
+
+      if (filter_shlib != NULL)
+	{
+	  bfd_size_type indx;
+
+	  indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
+				      filter_shlib, TRUE);
+	  if (indx == (bfd_size_type) -1
+	      || !_bfd_elf_add_dynamic_entry (info, DT_FILTER, indx))
+	    return FALSE;
+	}
+
+      if (auxiliary_filters != NULL)
+	{
+	  const char * const *p;
+
+	  for (p = auxiliary_filters; *p != NULL; p++)
+	    {
+	      bfd_size_type indx;
+
+	      indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
+					  *p, TRUE);
+	      if (indx == (bfd_size_type) -1
+		  || !_bfd_elf_add_dynamic_entry (info, DT_AUXILIARY, indx))
+		return FALSE;
+	    }
+	}
+
+      eif.info = info;
+      eif.verdefs = verdefs;
+      eif.failed = FALSE;
+
+      /* If we are supposed to export all symbols into the dynamic symbol
+	 table (this is not the normal case), then do so.  */
+      if (info->export_dynamic)
+	{
+	  elf_link_hash_traverse (elf_hash_table (info),
+				  _bfd_elf_export_symbol,
+				  &eif);
+	  if (eif.failed)
+	    return FALSE;
+	}
+
+      /* Make all global versions with definition.  */
+      for (t = verdefs; t != NULL; t = t->next)
+	for (d = t->globals.list; d != NULL; d = d->next)
+	  if (!d->symver && d->symbol)
+	    {
+	      const char *verstr, *name;
+	      size_t namelen, verlen, newlen;
+	      char *newname, *p;
+	      struct elf_link_hash_entry *newh;
+
+	      name = d->symbol;
+	      namelen = strlen (name);
+	      verstr = t->name;
+	      verlen = strlen (verstr);
+	      newlen = namelen + verlen + 3;
+
+	      newname = bfd_malloc (newlen);
+	      if (newname == NULL)
+		return FALSE;
+	      memcpy (newname, name, namelen);
+
+	      /* Check the hidden versioned definition.  */
+	      p = newname + namelen;
+	      *p++ = ELF_VER_CHR;
+	      memcpy (p, verstr, verlen + 1);
+	      newh = elf_link_hash_lookup (elf_hash_table (info),
+					   newname, FALSE, FALSE,
+					   FALSE);
+	      if (newh == NULL
+		  || (newh->root.type != bfd_link_hash_defined
+		      && newh->root.type != bfd_link_hash_defweak))
+		{
+		  /* Check the default versioned definition.  */
+		  *p++ = ELF_VER_CHR;
+		  memcpy (p, verstr, verlen + 1);
+		  newh = elf_link_hash_lookup (elf_hash_table (info),
+					       newname, FALSE, FALSE,
+					       FALSE);
+		}
+	      free (newname);
+
+	      /* Mark this version if there is a definition and it is
+		 not defined in a shared object.  */
+	      if (newh != NULL
+		  && ((newh->elf_link_hash_flags
+		       & ELF_LINK_HASH_DEF_DYNAMIC) == 0)
+		  && (newh->root.type == bfd_link_hash_defined
+		      || newh->root.type == bfd_link_hash_defweak))
+		d->symver = 1;
+	    }
+
+      /* Attach all the symbols to their version information.  */
+      asvinfo.output_bfd = output_bfd;
+      asvinfo.info = info;
+      asvinfo.verdefs = verdefs;
+      asvinfo.failed = FALSE;
+
+      elf_link_hash_traverse (elf_hash_table (info),
+			      _bfd_elf_link_assign_sym_version,
+			      &asvinfo);
+      if (asvinfo.failed)
+	return FALSE;
+
+      if (!info->allow_undefined_version)
+	{
+	  /* Check if all global versions have a definition.  */
+	  all_defined = TRUE;
+	  for (t = verdefs; t != NULL; t = t->next)
+	    for (d = t->globals.list; d != NULL; d = d->next)
+	      if (!d->symver && !d->script)
+		{
+		  (*_bfd_error_handler)
+		    (_("%s: undefined version: %s"),
+		     d->pattern, t->name);
+		  all_defined = FALSE;
+		}
+
+	  if (!all_defined)
+	    {
+	      bfd_set_error (bfd_error_bad_value);
+	      return FALSE;
+	    }
+	}
+
+      /* Find all symbols which were defined in a dynamic object and make
+	 the backend pick a reasonable value for them.  */
+      elf_link_hash_traverse (elf_hash_table (info),
+			      _bfd_elf_adjust_dynamic_symbol,
+			      &eif);
+      if (eif.failed)
+	return FALSE;
+
+      /* 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.  */
+
+      /* 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)
+	{
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_INIT, 0))
+	    return 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)
+	{
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_FINI, 0))
+	    return FALSE;
+	}
+
+      if (bfd_get_section_by_name (output_bfd, ".preinit_array") != NULL)
+	{
+	  /* DT_PREINIT_ARRAY is not allowed in shared library.  */
+	  if (! info->executable)
+	    {
+	      bfd *sub;
+	      asection *o;
+
+	      for (sub = info->input_bfds; sub != NULL;
+		   sub = sub->link_next)
+		for (o = sub->sections; o != NULL; o = o->next)
+		  if (elf_section_data (o)->this_hdr.sh_type
+		      == SHT_PREINIT_ARRAY)
+		    {
+		      (*_bfd_error_handler)
+			(_("%s: .preinit_array section is not allowed in DSO"),
+			 bfd_archive_filename (sub));
+		      break;
+		    }
+
+	      bfd_set_error (bfd_error_nonrepresentable_section);
+	      return FALSE;
+	    }
+
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_PREINIT_ARRAY, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_PREINIT_ARRAYSZ, 0))
+	    return FALSE;
+	}
+      if (bfd_get_section_by_name (output_bfd, ".init_array") != NULL)
+	{
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_INIT_ARRAY, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_INIT_ARRAYSZ, 0))
+	    return FALSE;
+	}
+      if (bfd_get_section_by_name (output_bfd, ".fini_array") != NULL)
+	{
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_FINI_ARRAY, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_FINI_ARRAYSZ, 0))
+	    return FALSE;
+	}
+
+      dynstr = bfd_get_section_by_name (dynobj, ".dynstr");
+      /* If .dynstr is excluded from the link, we don't want any of
+	 these tags.  Strictly, we should be checking each section
+	 individually;  This quick check covers for the case where
+	 someone does a /DISCARD/ : { *(*) }.  */
+      if (dynstr != NULL && dynstr->output_section != bfd_abs_section_ptr)
+	{
+	  bfd_size_type strsize;
+
+	  strsize = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr);
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_HASH, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_STRTAB, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_SYMTAB, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_STRSZ, strsize)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_SYMENT,
+					      bed->s->sizeof_sym))
+	    return FALSE;
+	}
+    }
+
+  /* The backend must work out the sizes of all the other dynamic
+     sections.  */
+  if (bed->elf_backend_size_dynamic_sections
+      && ! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info))
+    return FALSE;
+
+  if (elf_hash_table (info)->dynamic_sections_created)
+    {
+      bfd_size_type dynsymcount;
+      asection *s;
+      size_t bucketcount = 0;
+      size_t hash_entry_size;
+      unsigned int dtagcount;
+
+      /* Set up the version definition section.  */
+      s = bfd_get_section_by_name (dynobj, ".gnu.version_d");
+      BFD_ASSERT (s != NULL);
+
+      /* We may have created additional version definitions if we are
+	 just linking a regular application.  */
+      verdefs = asvinfo.verdefs;
+
+      /* Skip anonymous version tag.  */
+      if (verdefs != NULL && verdefs->vernum == 0)
+	verdefs = verdefs->next;
+
+      if (verdefs == NULL)
+	_bfd_strip_section_from_output (info, s);
+      else
+	{
+	  unsigned int cdefs;
+	  bfd_size_type size;
+	  struct bfd_elf_version_tree *t;
+	  bfd_byte *p;
+	  Elf_Internal_Verdef def;
+	  Elf_Internal_Verdaux defaux;
+
+	  cdefs = 0;
+	  size = 0;
+
+	  /* Make space for the base version.  */
+	  size += sizeof (Elf_External_Verdef);
+	  size += sizeof (Elf_External_Verdaux);
+	  ++cdefs;
+
+	  for (t = verdefs; t != NULL; t = t->next)
+	    {
+	      struct bfd_elf_version_deps *n;
+
+	      size += sizeof (Elf_External_Verdef);
+	      size += sizeof (Elf_External_Verdaux);
+	      ++cdefs;
+
+	      for (n = t->deps; n != NULL; n = n->next)
+		size += sizeof (Elf_External_Verdaux);
+	    }
+
+	  s->size = size;
+	  s->contents = bfd_alloc (output_bfd, s->size);
+	  if (s->contents == NULL && s->size != 0)
+	    return FALSE;
+
+	  /* Fill in the version definition section.  */
+
+	  p = s->contents;
+
+	  def.vd_version = VER_DEF_CURRENT;
+	  def.vd_flags = VER_FLG_BASE;
+	  def.vd_ndx = 1;
+	  def.vd_cnt = 1;
+	  def.vd_aux = sizeof (Elf_External_Verdef);
+	  def.vd_next = (sizeof (Elf_External_Verdef)
+			 + sizeof (Elf_External_Verdaux));
+
+	  if (soname_indx != (bfd_size_type) -1)
+	    {
+	      _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr,
+				      soname_indx);
+	      def.vd_hash = bfd_elf_hash (soname);
+	      defaux.vda_name = soname_indx;
+	    }
+	  else
+	    {
+	      const char *name;
+	      bfd_size_type indx;
+
+	      name = basename (output_bfd->filename);
+	      def.vd_hash = bfd_elf_hash (name);
+	      indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
+					  name, FALSE);
+	      if (indx == (bfd_size_type) -1)
+		return FALSE;
+	      defaux.vda_name = indx;
+	    }
+	  defaux.vda_next = 0;
+
+	  _bfd_elf_swap_verdef_out (output_bfd, &def,
+				    (Elf_External_Verdef *) p);
+	  p += sizeof (Elf_External_Verdef);
+	  _bfd_elf_swap_verdaux_out (output_bfd, &defaux,
+				     (Elf_External_Verdaux *) p);
+	  p += sizeof (Elf_External_Verdaux);
+
+	  for (t = verdefs; t != NULL; t = t->next)
+	    {
+	      unsigned int cdeps;
+	      struct bfd_elf_version_deps *n;
+	      struct elf_link_hash_entry *h;
+	      struct bfd_link_hash_entry *bh;
+
+	      cdeps = 0;
+	      for (n = t->deps; n != NULL; n = n->next)
+		++cdeps;
+
+	      /* Add a symbol representing this version.  */
+	      bh = NULL;
+	      if (! (_bfd_generic_link_add_one_symbol
+		     (info, dynobj, t->name, BSF_GLOBAL, bfd_abs_section_ptr,
+		      0, NULL, FALSE,
+		      get_elf_backend_data (dynobj)->collect, &bh)))
+		return FALSE;
+	      h = (struct elf_link_hash_entry *) bh;
+	      h->elf_link_hash_flags &= ~ ELF_LINK_NON_ELF;
+	      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
+	      h->type = STT_OBJECT;
+	      h->verinfo.vertree = t;
+
+	      if (! bfd_elf_link_record_dynamic_symbol (info, h))
+		return FALSE;
+
+	      def.vd_version = VER_DEF_CURRENT;
+	      def.vd_flags = 0;
+	      if (t->globals.list == NULL
+		  && t->locals.list == NULL
+		  && ! t->used)
+		def.vd_flags |= VER_FLG_WEAK;
+	      def.vd_ndx = t->vernum + 1;
+	      def.vd_cnt = cdeps + 1;
+	      def.vd_hash = bfd_elf_hash (t->name);
+	      def.vd_aux = sizeof (Elf_External_Verdef);
+	      def.vd_next = 0;
+	      if (t->next != NULL)
+		def.vd_next = (sizeof (Elf_External_Verdef)
+			       + (cdeps + 1) * sizeof (Elf_External_Verdaux));
+
+	      _bfd_elf_swap_verdef_out (output_bfd, &def,
+					(Elf_External_Verdef *) p);
+	      p += sizeof (Elf_External_Verdef);
+
+	      defaux.vda_name = h->dynstr_index;
+	      _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr,
+				      h->dynstr_index);
+	      defaux.vda_next = 0;
+	      if (t->deps != NULL)
+		defaux.vda_next = sizeof (Elf_External_Verdaux);
+	      t->name_indx = defaux.vda_name;
+
+	      _bfd_elf_swap_verdaux_out (output_bfd, &defaux,
+					 (Elf_External_Verdaux *) p);
+	      p += sizeof (Elf_External_Verdaux);
+
+	      for (n = t->deps; n != NULL; n = n->next)
+		{
+		  if (n->version_needed == NULL)
+		    {
+		      /* This can happen if there was an error in the
+			 version script.  */
+		      defaux.vda_name = 0;
+		    }
+		  else
+		    {
+		      defaux.vda_name = n->version_needed->name_indx;
+		      _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr,
+					      defaux.vda_name);
+		    }
+		  if (n->next == NULL)
+		    defaux.vda_next = 0;
+		  else
+		    defaux.vda_next = sizeof (Elf_External_Verdaux);
+
+		  _bfd_elf_swap_verdaux_out (output_bfd, &defaux,
+					     (Elf_External_Verdaux *) p);
+		  p += sizeof (Elf_External_Verdaux);
+		}
+	    }
+
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_VERDEF, 0)
+	      || !_bfd_elf_add_dynamic_entry (info, DT_VERDEFNUM, cdefs))
+	    return FALSE;
+
+	  elf_tdata (output_bfd)->cverdefs = cdefs;
+	}
+
+      if ((info->new_dtags && info->flags) || (info->flags & DF_STATIC_TLS))
+	{
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_FLAGS, info->flags))
+	    return FALSE;
+	}
+      else if (info->flags & DF_BIND_NOW)
+	{
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_BIND_NOW, 0))
+	    return FALSE;
+	}
+
+      if (info->flags_1)
+	{
+	  if (info->executable)
+	    info->flags_1 &= ~ (DF_1_INITFIRST
+				| DF_1_NODELETE
+				| DF_1_NOOPEN);
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_FLAGS_1, info->flags_1))
+	    return FALSE;
+	}
+
+      /* Work out the size of the version reference section.  */
+
+      s = bfd_get_section_by_name (dynobj, ".gnu.version_r");
+      BFD_ASSERT (s != NULL);
+      {
+	struct elf_find_verdep_info sinfo;
+
+	sinfo.output_bfd = output_bfd;
+	sinfo.info = info;
+	sinfo.vers = elf_tdata (output_bfd)->cverdefs;
+	if (sinfo.vers == 0)
+	  sinfo.vers = 1;
+	sinfo.failed = FALSE;
+
+	elf_link_hash_traverse (elf_hash_table (info),
+				_bfd_elf_link_find_version_dependencies,
+				&sinfo);
+
+	if (elf_tdata (output_bfd)->verref == NULL)
+	  _bfd_strip_section_from_output (info, s);
+	else
+	  {
+	    Elf_Internal_Verneed *t;
+	    unsigned int size;
+	    unsigned int crefs;
+	    bfd_byte *p;
+
+	    /* Build the version definition section.  */
+	    size = 0;
+	    crefs = 0;
+	    for (t = elf_tdata (output_bfd)->verref;
+		 t != NULL;
+		 t = t->vn_nextref)
+	      {
+		Elf_Internal_Vernaux *a;
+
+		size += sizeof (Elf_External_Verneed);
+		++crefs;
+		for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
+		  size += sizeof (Elf_External_Vernaux);
+	      }
+
+	    s->size = size;
+	    s->contents = bfd_alloc (output_bfd, s->size);
+	    if (s->contents == NULL)
+	      return FALSE;
+
+	    p = s->contents;
+	    for (t = elf_tdata (output_bfd)->verref;
+		 t != NULL;
+		 t = t->vn_nextref)
+	      {
+		unsigned int caux;
+		Elf_Internal_Vernaux *a;
+		bfd_size_type indx;
+
+		caux = 0;
+		for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
+		  ++caux;
+
+		t->vn_version = VER_NEED_CURRENT;
+		t->vn_cnt = caux;
+		indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
+					    elf_dt_name (t->vn_bfd) != NULL
+					    ? elf_dt_name (t->vn_bfd)
+					    : basename (t->vn_bfd->filename),
+					    FALSE);
+		if (indx == (bfd_size_type) -1)
+		  return FALSE;
+		t->vn_file = indx;
+		t->vn_aux = sizeof (Elf_External_Verneed);
+		if (t->vn_nextref == NULL)
+		  t->vn_next = 0;
+		else
+		  t->vn_next = (sizeof (Elf_External_Verneed)
+				+ caux * sizeof (Elf_External_Vernaux));
+
+		_bfd_elf_swap_verneed_out (output_bfd, t,
+					   (Elf_External_Verneed *) p);
+		p += sizeof (Elf_External_Verneed);
+
+		for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
+		  {
+		    a->vna_hash = bfd_elf_hash (a->vna_nodename);
+		    indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
+						a->vna_nodename, FALSE);
+		    if (indx == (bfd_size_type) -1)
+		      return FALSE;
+		    a->vna_name = indx;
+		    if (a->vna_nextptr == NULL)
+		      a->vna_next = 0;
+		    else
+		      a->vna_next = sizeof (Elf_External_Vernaux);
+
+		    _bfd_elf_swap_vernaux_out (output_bfd, a,
+					       (Elf_External_Vernaux *) p);
+		    p += sizeof (Elf_External_Vernaux);
+		  }
+	      }
+
+	    if (!_bfd_elf_add_dynamic_entry (info, DT_VERNEED, 0)
+		|| !_bfd_elf_add_dynamic_entry (info, DT_VERNEEDNUM, crefs))
+	      return FALSE;
+
+	    elf_tdata (output_bfd)->cverrefs = crefs;
+	  }
+      }
+
+      /* 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");
+      BFD_ASSERT (s != NULL);
+      if (dynsymcount == 0
+	  || (verdefs == NULL && elf_tdata (output_bfd)->verref == NULL))
+	{
+	  _bfd_strip_section_from_output (info, 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
+	{
+	  s->size = dynsymcount * sizeof (Elf_External_Versym);
+	  s->contents = bfd_zalloc (output_bfd, s->size);
+	  if (s->contents == NULL)
+	    return FALSE;
+
+	  if (!_bfd_elf_add_dynamic_entry (info, DT_VERSYM, 0))
+	    return FALSE;
+	}
+
+      /* Set the size of the .dynsym and .hash sections.  We counted
+	 the number of dynamic symbols in elf_link_add_object_symbols.
+	 We will build the contents of .dynsym and .hash when we build
+	 the final symbol table, because until then we do not know the
+	 correct value to give the symbols.  We built the .dynstr
+	 section as we went along in elf_link_add_object_symbols.  */
+      s = bfd_get_section_by_name (dynobj, ".dynsym");
+      BFD_ASSERT (s != NULL);
+      s->size = dynsymcount * bed->s->sizeof_sym;
+      s->contents = bfd_alloc (output_bfd, s->size);
+      if (s->contents == NULL && s->size != 0)
+	return FALSE;
+
+      if (dynsymcount != 0)
+	{
+	  Elf_Internal_Sym isym;
+
+	  /* The first entry in .dynsym is a dummy symbol.  */
+	  isym.st_value = 0;
+	  isym.st_size = 0;
+	  isym.st_name = 0;
+	  isym.st_info = 0;
+	  isym.st_other = 0;
+	  isym.st_shndx = 0;
+	  bed->s->swap_symbol_out (output_bfd, &isym, s->contents, 0);
+	}
+
+      /* Compute the size of the hashing table.  As a side effect this
+	 computes the hash values for all the names we export.  */
+      bucketcount = compute_bucket_count (info);
+
+      s = bfd_get_section_by_name (dynobj, ".hash");
+      BFD_ASSERT (s != NULL);
+      hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize;
+      s->size = ((2 + bucketcount + dynsymcount) * hash_entry_size);
+      s->contents = bfd_zalloc (output_bfd, s->size);
+      if (s->contents == NULL)
+	return FALSE;
+
+      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;
+
+      s = bfd_get_section_by_name (dynobj, ".dynstr");
+      BFD_ASSERT (s != NULL);
+
+      elf_finalize_dynstr (output_bfd, info);
+
+      s->size = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr);
+
+      for (dtagcount = 0; dtagcount <= info->spare_dynamic_tags; ++dtagcount)
+	if (!_bfd_elf_add_dynamic_entry (info, DT_NULL, 0))
+	  return FALSE;
+    }
+
+  return TRUE;
+}
+
+/* Final phase of ELF linker.  */
+
+/* A structure we use to avoid passing large numbers of arguments.  */
+
+struct elf_final_link_info
+{
+  /* General link information.  */
+  struct bfd_link_info *info;
+  /* Output BFD.  */
+  bfd *output_bfd;
+  /* Symbol string table.  */
+  struct bfd_strtab_hash *symstrtab;
+  /* .dynsym section.  */
+  asection *dynsym_sec;
+  /* .hash section.  */
+  asection *hash_sec;
+  /* symbol version section (.gnu.version).  */
+  asection *symver_sec;
+  /* Buffer large enough to hold contents of any section.  */
+  bfd_byte *contents;
+  /* Buffer large enough to hold external relocs of any section.  */
+  void *external_relocs;
+  /* Buffer large enough to hold internal relocs of any section.  */
+  Elf_Internal_Rela *internal_relocs;
+  /* Buffer large enough to hold external local symbols of any input
+     BFD.  */
+  bfd_byte *external_syms;
+  /* And a buffer for symbol section indices.  */
+  Elf_External_Sym_Shndx *locsym_shndx;
+  /* Buffer large enough to hold internal local symbols of any input
+     BFD.  */
+  Elf_Internal_Sym *internal_syms;
+  /* Array large enough to hold a symbol index for each local symbol
+     of any input BFD.  */
+  long *indices;
+  /* Array large enough to hold a section pointer for each local
+     symbol of any input BFD.  */
+  asection **sections;
+  /* Buffer to hold swapped out symbols.  */
+  bfd_byte *symbuf;
+  /* And one for symbol section indices.  */
+  Elf_External_Sym_Shndx *symshndxbuf;
+  /* Number of swapped out symbols in buffer.  */
+  size_t symbuf_count;
+  /* Number of symbols which fit in symbuf.  */
+  size_t symbuf_size;
+  /* And same for symshndxbuf.  */
+  size_t shndxbuf_size;
+};
+
+/* This struct is used to pass information to elf_link_output_extsym.  */
+
+struct elf_outext_info
+{
+  bfd_boolean failed;
+  bfd_boolean localsyms;
+  struct elf_final_link_info *finfo;
+};
+
+/* When performing a relocatable 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 (bfd *abfd,
+			Elf_Internal_Shdr *rel_hdr,
+			unsigned int count,
+			struct elf_link_hash_entry **rel_hash)
+{
+  unsigned int i;
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  bfd_byte *erela;
+  void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *);
+  void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
+  bfd_vma r_type_mask;
+  int r_sym_shift;
+
+  if (rel_hdr->sh_entsize == bed->s->sizeof_rel)
+    {
+      swap_in = bed->s->swap_reloc_in;
+      swap_out = bed->s->swap_reloc_out;
+    }
+  else if (rel_hdr->sh_entsize == bed->s->sizeof_rela)
+    {
+      swap_in = bed->s->swap_reloca_in;
+      swap_out = bed->s->swap_reloca_out;
+    }
+  else
+    abort ();
+
+  if (bed->s->int_rels_per_ext_rel > MAX_INT_RELS_PER_EXT_REL)
+    abort ();
+
+  if (bed->s->arch_size == 32)
+    {
+      r_type_mask = 0xff;
+      r_sym_shift = 8;
+    }
+  else
+    {
+      r_type_mask = 0xffffffff;
+      r_sym_shift = 32;
+    }
+
+  erela = rel_hdr->contents;
+  for (i = 0; i < count; i++, rel_hash++, erela += rel_hdr->sh_entsize)
+    {
+      Elf_Internal_Rela irela[MAX_INT_RELS_PER_EXT_REL];
+      unsigned int j;
+
+      if (*rel_hash == NULL)
+	continue;
+
+      BFD_ASSERT ((*rel_hash)->indx >= 0);
+
+      (*swap_in) (abfd, erela, irela);
+      for (j = 0; j < bed->s->int_rels_per_ext_rel; j++)
+	irela[j].r_info = ((bfd_vma) (*rel_hash)->indx << r_sym_shift
+			   | (irela[j].r_info & r_type_mask));
+      (*swap_out) (abfd, irela, erela);
+    }
+}
+
+struct elf_link_sort_rela
+{
+  union {
+    bfd_vma offset;
+    bfd_vma sym_mask;
+  } u;
+  enum elf_reloc_type_class type;
+  /* We use this as an array of size int_rels_per_ext_rel.  */
+  Elf_Internal_Rela rela[1];
+};
+
+static int
+elf_link_sort_cmp1 (const void *A, const void *B)
+{
+  const struct elf_link_sort_rela *a = A;
+  const struct elf_link_sort_rela *b = B;
+  int relativea, relativeb;
+
+  relativea = a->type == reloc_class_relative;
+  relativeb = b->type == reloc_class_relative;
+
+  if (relativea < relativeb)
+    return 1;
+  if (relativea > relativeb)
+    return -1;
+  if ((a->rela->r_info & a->u.sym_mask) < (b->rela->r_info & b->u.sym_mask))
+    return -1;
+  if ((a->rela->r_info & a->u.sym_mask) > (b->rela->r_info & b->u.sym_mask))
+    return 1;
+  if (a->rela->r_offset < b->rela->r_offset)
+    return -1;
+  if (a->rela->r_offset > b->rela->r_offset)
+    return 1;
+  return 0;
+}
+
+static int
+elf_link_sort_cmp2 (const void *A, const void *B)
+{
+  const struct elf_link_sort_rela *a = A;
+  const struct elf_link_sort_rela *b = B;
+  int copya, copyb;
+
+  if (a->u.offset < b->u.offset)
+    return -1;
+  if (a->u.offset > b->u.offset)
+    return 1;
+  copya = (a->type == reloc_class_copy) * 2 + (a->type == reloc_class_plt);
+  copyb = (b->type == reloc_class_copy) * 2 + (b->type == reloc_class_plt);
+  if (copya < copyb)
+    return -1;
+  if (copya > copyb)
+    return 1;
+  if (a->rela->r_offset < b->rela->r_offset)
+    return -1;
+  if (a->rela->r_offset > b->rela->r_offset)
+    return 1;
+  return 0;
+}
+
+static size_t
+elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec)
+{
+  asection *reldyn;
+  bfd_size_type count, size;
+  size_t i, ret, sort_elt, ext_size;
+  bfd_byte *sort, *s_non_relative, *p;
+  struct elf_link_sort_rela *sq;
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  int i2e = bed->s->int_rels_per_ext_rel;
+  void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *);
+  void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
+  struct bfd_link_order *lo;
+  bfd_vma r_sym_mask;
+
+  reldyn = bfd_get_section_by_name (abfd, ".rela.dyn");
+  if (reldyn == NULL || reldyn->size == 0)
+    {
+      reldyn = bfd_get_section_by_name (abfd, ".rel.dyn");
+      if (reldyn == NULL || reldyn->size == 0)
+	return 0;
+      ext_size = bed->s->sizeof_rel;
+      swap_in = bed->s->swap_reloc_in;
+      swap_out = bed->s->swap_reloc_out;
+    }
+  else
+    {
+      ext_size = bed->s->sizeof_rela;
+      swap_in = bed->s->swap_reloca_in;
+      swap_out = bed->s->swap_reloca_out;
+    }
+  count = reldyn->size / ext_size;
+
+  size = 0;
+  for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next)
+    if (lo->type == bfd_indirect_link_order)
+      {
+	asection *o = lo->u.indirect.section;
+	size += o->size;
+      }
+
+  if (size != reldyn->size)
+    return 0;
+
+  sort_elt = (sizeof (struct elf_link_sort_rela)
+	      + (i2e - 1) * sizeof (Elf_Internal_Rela));
+  sort = bfd_zmalloc (sort_elt * count);
+  if (sort == NULL)
+    {
+      (*info->callbacks->warning)
+	(info, _("Not enough memory to sort relocations"), 0, abfd, 0, 0);
+      return 0;
+    }
+
+  if (bed->s->arch_size == 32)
+    r_sym_mask = ~(bfd_vma) 0xff;
+  else
+    r_sym_mask = ~(bfd_vma) 0xffffffff;
+
+  for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next)
+    if (lo->type == bfd_indirect_link_order)
+      {
+	bfd_byte *erel, *erelend;
+	asection *o = lo->u.indirect.section;
+
+	erel = o->contents;
+	erelend = o->contents + o->size;
+	p = sort + o->output_offset / ext_size * sort_elt;
+	while (erel < erelend)
+	  {
+	    struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p;
+	    (*swap_in) (abfd, erel, s->rela);
+	    s->type = (*bed->elf_backend_reloc_type_class) (s->rela);
+	    s->u.sym_mask = r_sym_mask;
+	    p += sort_elt;
+	    erel += ext_size;
+	  }
+      }
+
+  qsort (sort, count, sort_elt, elf_link_sort_cmp1);
+
+  for (i = 0, p = sort; i < count; i++, p += sort_elt)
+    {
+      struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p;
+      if (s->type != reloc_class_relative)
+	break;
+    }
+  ret = i;
+  s_non_relative = p;
+
+  sq = (struct elf_link_sort_rela *) s_non_relative;
+  for (; i < count; i++, p += sort_elt)
+    {
+      struct elf_link_sort_rela *sp = (struct elf_link_sort_rela *) p;
+      if (((sp->rela->r_info ^ sq->rela->r_info) & r_sym_mask) != 0)
+	sq = sp;
+      sp->u.offset = sq->rela->r_offset;
+    }
+
+  qsort (s_non_relative, count - ret, sort_elt, elf_link_sort_cmp2);
+
+  for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next)
+    if (lo->type == bfd_indirect_link_order)
+      {
+	bfd_byte *erel, *erelend;
+	asection *o = lo->u.indirect.section;
+
+	erel = o->contents;
+	erelend = o->contents + o->size;
+	p = sort + o->output_offset / ext_size * sort_elt;
+	while (erel < erelend)
+	  {
+	    struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p;
+	    (*swap_out) (abfd, s->rela, erel);
+	    p += sort_elt;
+	    erel += ext_size;
+	  }
+      }
+
+  free (sort);
+  *psec = reldyn;
+  return ret;
+}
+
+/* Flush the output symbols to the file.  */
+
+static bfd_boolean
+elf_link_flush_output_syms (struct elf_final_link_info *finfo,
+			    const struct elf_backend_data *bed)
+{
+  if (finfo->symbuf_count > 0)
+    {
+      Elf_Internal_Shdr *hdr;
+      file_ptr pos;
+      bfd_size_type amt;
+
+      hdr = &elf_tdata (finfo->output_bfd)->symtab_hdr;
+      pos = hdr->sh_offset + hdr->sh_size;
+      amt = finfo->symbuf_count * bed->s->sizeof_sym;
+      if (bfd_seek (finfo->output_bfd, pos, SEEK_SET) != 0
+	  || bfd_bwrite (finfo->symbuf, amt, finfo->output_bfd) != amt)
+	return FALSE;
+
+      hdr->sh_size += amt;
+      finfo->symbuf_count = 0;
+    }
+
+  return TRUE;
+}
+
+/* Add a symbol to the output symbol table.  */
+
+static bfd_boolean
+elf_link_output_sym (struct elf_final_link_info *finfo,
+		     const char *name,
+		     Elf_Internal_Sym *elfsym,
+		     asection *input_sec,
+		     struct elf_link_hash_entry *h)
+{
+  bfd_byte *dest;
+  Elf_External_Sym_Shndx *destshndx;
+  bfd_boolean (*output_symbol_hook)
+    (struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *,
+     struct elf_link_hash_entry *);
+  const struct elf_backend_data *bed;
+
+  bed = get_elf_backend_data (finfo->output_bfd);
+  output_symbol_hook = bed->elf_backend_link_output_symbol_hook;
+  if (output_symbol_hook != NULL)
+    {
+      if (! (*output_symbol_hook) (finfo->info, name, elfsym, input_sec, h))
+	return FALSE;
+    }
+
+  if (name == NULL || *name == '\0')
+    elfsym->st_name = 0;
+  else if (input_sec->flags & SEC_EXCLUDE)
+    elfsym->st_name = 0;
+  else
+    {
+      elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab,
+							    name, TRUE, FALSE);
+      if (elfsym->st_name == (unsigned long) -1)
+	return FALSE;
+    }
+
+  if (finfo->symbuf_count >= finfo->symbuf_size)
+    {
+      if (! elf_link_flush_output_syms (finfo, bed))
+	return FALSE;
+    }
+
+  dest = finfo->symbuf + finfo->symbuf_count * bed->s->sizeof_sym;
+  destshndx = finfo->symshndxbuf;
+  if (destshndx != NULL)
+    {
+      if (bfd_get_symcount (finfo->output_bfd) >= finfo->shndxbuf_size)
+	{
+	  bfd_size_type amt;
+
+	  amt = finfo->shndxbuf_size * sizeof (Elf_External_Sym_Shndx);
+	  finfo->symshndxbuf = destshndx = bfd_realloc (destshndx, amt * 2);
+	  if (destshndx == NULL)
+	    return FALSE;
+	  memset ((char *) destshndx + amt, 0, amt);
+	  finfo->shndxbuf_size *= 2;
+	}
+      destshndx += bfd_get_symcount (finfo->output_bfd);
+    }
+
+  bed->s->swap_symbol_out (finfo->output_bfd, elfsym, dest, destshndx);
+  finfo->symbuf_count += 1;
+  bfd_get_symcount (finfo->output_bfd) += 1;
+
+  return TRUE;
+}
+
+/* For DSOs loaded in via a DT_NEEDED entry, emulate ld.so in
+   allowing an unsatisfied unversioned symbol in the DSO to match a
+   versioned symbol that would normally require an explicit version.
+   We also handle the case that a DSO references a hidden symbol
+   which may be satisfied by a versioned symbol in another DSO.  */
+
+static bfd_boolean
+elf_link_check_versioned_symbol (struct bfd_link_info *info,
+				 const struct elf_backend_data *bed,
+				 struct elf_link_hash_entry *h)
+{
+  bfd *abfd;
+  struct elf_link_loaded_list *loaded;
+
+  if (!is_elf_hash_table (info->hash))
+    return FALSE;
+
+  switch (h->root.type)
+    {
+    default:
+      abfd = NULL;
+      break;
+
+    case bfd_link_hash_undefined:
+    case bfd_link_hash_undefweak:
+      abfd = h->root.u.undef.abfd;
+      if ((abfd->flags & DYNAMIC) == 0
+	  || elf_dyn_lib_class (abfd) != DYN_DT_NEEDED)
+	return FALSE;
+      break;
+
+    case bfd_link_hash_defined:
+    case bfd_link_hash_defweak:
+      abfd = h->root.u.def.section->owner;
+      break;
+
+    case bfd_link_hash_common:
+      abfd = h->root.u.c.p->section->owner;
+      break;
+    }
+  BFD_ASSERT (abfd != NULL);
+
+  for (loaded = elf_hash_table (info)->loaded;
+       loaded != NULL;
+       loaded = loaded->next)
+    {
+      bfd *input;
+      Elf_Internal_Shdr *hdr;
+      bfd_size_type symcount;
+      bfd_size_type extsymcount;
+      bfd_size_type extsymoff;
+      Elf_Internal_Shdr *versymhdr;
+      Elf_Internal_Sym *isym;
+      Elf_Internal_Sym *isymend;
+      Elf_Internal_Sym *isymbuf;
+      Elf_External_Versym *ever;
+      Elf_External_Versym *extversym;
+
+      input = loaded->abfd;
+
+      /* We check each DSO for a possible hidden versioned definition.  */
+      if (input == abfd
+	  || (input->flags & DYNAMIC) == 0
+	  || elf_dynversym (input) == 0)
+	continue;
+
+      hdr = &elf_tdata (input)->dynsymtab_hdr;
+
+      symcount = hdr->sh_size / bed->s->sizeof_sym;
+      if (elf_bad_symtab (input))
+	{
+	  extsymcount = symcount;
+	  extsymoff = 0;
+	}
+      else
+	{
+	  extsymcount = symcount - hdr->sh_info;
+	  extsymoff = hdr->sh_info;
+	}
+
+      if (extsymcount == 0)
+	continue;
+
+      isymbuf = bfd_elf_get_elf_syms (input, hdr, extsymcount, extsymoff,
+				      NULL, NULL, NULL);
+      if (isymbuf == NULL)
+	return FALSE;
+
+      /* Read in any version definitions.  */
+      versymhdr = &elf_tdata (input)->dynversym_hdr;
+      extversym = bfd_malloc (versymhdr->sh_size);
+      if (extversym == NULL)
+	goto error_ret;
+
+      if (bfd_seek (input, versymhdr->sh_offset, SEEK_SET) != 0
+	  || (bfd_bread (extversym, versymhdr->sh_size, input)
+	      != versymhdr->sh_size))
+	{
+	  free (extversym);
+	error_ret:
+	  free (isymbuf);
+	  return FALSE;
+	}
+
+      ever = extversym + extsymoff;
+      isymend = isymbuf + extsymcount;
+      for (isym = isymbuf; isym < isymend; isym++, ever++)
+	{
+	  const char *name;
+	  Elf_Internal_Versym iver;
+	  unsigned short version_index;
+
+	  if (ELF_ST_BIND (isym->st_info) == STB_LOCAL
+	      || isym->st_shndx == SHN_UNDEF)
+	    continue;
+
+	  name = bfd_elf_string_from_elf_section (input,
+						  hdr->sh_link,
+						  isym->st_name);
+	  if (strcmp (name, h->root.root.string) != 0)
+	    continue;
+
+	  _bfd_elf_swap_versym_in (input, ever, &iver);
+
+	  if ((iver.vs_vers & VERSYM_HIDDEN) == 0)
+	    {
+	      /* If we have a non-hidden versioned sym, then it should
+		 have provided a definition for the undefined sym.  */
+	      abort ();
+	    }
+
+	  version_index = iver.vs_vers & VERSYM_VERSION;
+	  if (version_index == 1 || version_index == 2)
+	    {
+	      /* This is the base or first version.  We can use it.  */
+	      free (extversym);
+	      free (isymbuf);
+	      return TRUE;
+	    }
+	}
+
+      free (extversym);
+      free (isymbuf);
+    }
+
+  return FALSE;
+}
+
+/* Add an external symbol to the symbol table.  This is called from
+   the hash table traversal routine.  When generating a shared object,
+   we go through the symbol table twice.  The first time we output
+   anything that might have been forced to local scope in a version
+   script.  The second time we output the symbols that are still
+   global symbols.  */
+
+static bfd_boolean
+elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
+{
+  struct elf_outext_info *eoinfo = data;
+  struct elf_final_link_info *finfo = eoinfo->finfo;
+  bfd_boolean strip;
+  Elf_Internal_Sym sym;
+  asection *input_sec;
+  const struct elf_backend_data *bed;
+
+  if (h->root.type == bfd_link_hash_warning)
+    {
+      h = (struct elf_link_hash_entry *) h->root.u.i.link;
+      if (h->root.type == bfd_link_hash_new)
+	return TRUE;
+    }
+
+  /* Decide whether to output this symbol in this pass.  */
+  if (eoinfo->localsyms)
+    {
+      if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+	return TRUE;
+    }
+  else
+    {
+      if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+	return TRUE;
+    }
+
+  bed = get_elf_backend_data (finfo->output_bfd);
+
+  /* If we have an undefined symbol reference here then it must have
+     come from a shared library that is being linked in.  (Undefined
+     references in regular files have already been handled).  If we
+     are reporting errors for this situation then do so now.  */
+  if (h->root.type == bfd_link_hash_undefined
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
+      && ! elf_link_check_versioned_symbol (finfo->info, bed, h)
+      && finfo->info->unresolved_syms_in_shared_libs != RM_IGNORE)
+    {
+      if (! ((*finfo->info->callbacks->undefined_symbol)
+	     (finfo->info, h->root.root.string, h->root.u.undef.abfd,
+	      NULL, 0, finfo->info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)))
+	{
+	  eoinfo->failed = TRUE;
+	  return FALSE;
+	}
+    }
+
+  /* We should also warn if a forced local symbol is referenced from
+     shared libraries.  */
+  if (! finfo->info->relocatable
+      && (! finfo->info->shared)
+      && (h->elf_link_hash_flags
+	  & (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_DYNAMIC_DEF | ELF_LINK_DYNAMIC_WEAK))
+	 == (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC)
+      && ! elf_link_check_versioned_symbol (finfo->info, bed, h))
+    {
+      (*_bfd_error_handler)
+	(_("%s: %s symbol `%s' in %s is referenced by DSO"),
+	 bfd_get_filename (finfo->output_bfd),
+	 ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
+	 ? "internal"
+	 : ELF_ST_VISIBILITY (h->other) == STV_HIDDEN
+	   ? "hidden" : "local",
+	 h->root.root.string,
+	 bfd_archive_filename (h->root.u.def.section->owner));
+      eoinfo->failed = TRUE;
+      return FALSE;
+    }
+
+  /* We don't want to output symbols that have never been mentioned by
+     a regular file, or that we have been told to strip.  However, if
+     h->indx is set to -2, the symbol is used by a reloc and we must
+     output it.  */
+  if (h->indx == -2)
+    strip = FALSE;
+  else if (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
+	    || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
+	   && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
+	   && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
+    strip = TRUE;
+  else if (finfo->info->strip == strip_all)
+    strip = TRUE;
+  else if (finfo->info->strip == strip_some
+	   && bfd_hash_lookup (finfo->info->keep_hash,
+			       h->root.root.string, FALSE, FALSE) == NULL)
+    strip = TRUE;
+  else if (finfo->info->strip_discarded
+	   && (h->root.type == bfd_link_hash_defined
+	       || h->root.type == bfd_link_hash_defweak)
+	   && elf_discarded_section (h->root.u.def.section))
+    strip = TRUE;
+  else
+    strip = FALSE;
+
+  /* If we're stripping it, and it's not a dynamic symbol, there's
+     nothing else to do unless it is a forced local symbol.  */
+  if (strip
+      && h->dynindx == -1
+      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+    return TRUE;
+
+  sym.st_value = 0;
+  sym.st_size = h->size;
+  sym.st_other = h->other;
+  if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+    sym.st_info = ELF_ST_INFO (STB_LOCAL, h->type);
+  else if (h->root.type == bfd_link_hash_undefweak
+	   || h->root.type == bfd_link_hash_defweak)
+    sym.st_info = ELF_ST_INFO (STB_WEAK, h->type);
+  else
+    sym.st_info = ELF_ST_INFO (STB_GLOBAL, h->type);
+
+  switch (h->root.type)
+    {
+    default:
+    case bfd_link_hash_new:
+    case bfd_link_hash_warning:
+      abort ();
+      return FALSE;
+
+    case bfd_link_hash_undefined:
+    case bfd_link_hash_undefweak:
+      input_sec = bfd_und_section_ptr;
+      sym.st_shndx = SHN_UNDEF;
+      break;
+
+    case bfd_link_hash_defined:
+    case bfd_link_hash_defweak:
+      {
+	input_sec = h->root.u.def.section;
+	if (input_sec->output_section != NULL)
+	  {
+	    sym.st_shndx =
+	      _bfd_elf_section_from_bfd_section (finfo->output_bfd,
+						 input_sec->output_section);
+	    if (sym.st_shndx == SHN_BAD)
+	      {
+		char *sec_name = bfd_get_section_ident (input_sec);
+		(*_bfd_error_handler)
+		  (_("%s: could not find output section %s for input section %s"),
+		   bfd_get_filename (finfo->output_bfd),
+		   input_sec->output_section->name,
+		   sec_name ? sec_name : input_sec->name);
+		if (sec_name)
+		  free (sec_name);
+		eoinfo->failed = TRUE;
+		return FALSE;
+	      }
+
+	    /* ELF symbols in relocatable files are section relative,
+	       but in nonrelocatable files they are virtual
+	       addresses.  */
+	    sym.st_value = h->root.u.def.value + input_sec->output_offset;
+	    if (! finfo->info->relocatable)
+	      {
+		sym.st_value += input_sec->output_section->vma;
+		if (h->type == STT_TLS)
+		  {
+		    /* STT_TLS symbols are relative to PT_TLS segment
+		       base.  */
+		    BFD_ASSERT (elf_hash_table (finfo->info)->tls_sec != NULL);
+		    sym.st_value -= elf_hash_table (finfo->info)->tls_sec->vma;
+		  }
+	      }
+	  }
+	else
+	  {
+	    BFD_ASSERT (input_sec->owner == NULL
+			|| (input_sec->owner->flags & DYNAMIC) != 0);
+	    sym.st_shndx = SHN_UNDEF;
+	    input_sec = bfd_und_section_ptr;
+	  }
+      }
+      break;
+
+    case bfd_link_hash_common:
+      input_sec = h->root.u.c.p->section;
+      sym.st_shndx = SHN_COMMON;
+      sym.st_value = 1 << h->root.u.c.p->alignment_power;
+      break;
+
+    case bfd_link_hash_indirect:
+      /* These symbols are created by symbol versioning.  They point
+	 to the decorated version of the name.  For example, if the
+	 symbol foo@@GNU_1.2 is the default, which should be used when
+	 foo is used with no version, then we add an indirect symbol
+	 foo which points to foo@@GNU_1.2.  We ignore these symbols,
+	 since the indirected symbol is already in the hash table.  */
+      return TRUE;
+    }
+
+  /* Give the processor backend a chance to tweak the symbol value,
+     and also to finish up anything that needs to be done for this
+     symbol.  FIXME: Not calling elf_backend_finish_dynamic_symbol for
+     forced local syms when non-shared is due to a historical quirk.  */
+  if ((h->dynindx != -1
+       || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
+      && ((finfo->info->shared
+	   && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+	       || h->root.type != bfd_link_hash_undefweak))
+	  || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
+      && elf_hash_table (finfo->info)->dynamic_sections_created)
+    {
+      if (! ((*bed->elf_backend_finish_dynamic_symbol)
+	     (finfo->output_bfd, finfo->info, h, &sym)))
+	{
+	  eoinfo->failed = TRUE;
+	  return FALSE;
+	}
+    }
+
+  /* If we are marking the symbol as undefined, and there are no
+     non-weak references to this symbol from a regular object, then
+     mark the symbol as weak undefined; if there are non-weak
+     references, mark the symbol as strong.  We can't do this earlier,
+     because it might not be marked as undefined until the
+     finish_dynamic_symbol routine gets through with it.  */
+  if (sym.st_shndx == SHN_UNDEF
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
+      && (ELF_ST_BIND (sym.st_info) == STB_GLOBAL
+	  || ELF_ST_BIND (sym.st_info) == STB_WEAK))
+    {
+      int bindtype;
+
+      if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) != 0)
+	bindtype = STB_GLOBAL;
+      else
+	bindtype = STB_WEAK;
+      sym.st_info = ELF_ST_INFO (bindtype, ELF_ST_TYPE (sym.st_info));
+    }
+
+  /* If a non-weak symbol with non-default visibility is not defined
+     locally, it is a fatal error.  */
+  if (! finfo->info->relocatable
+      && ELF_ST_VISIBILITY (sym.st_other) != STV_DEFAULT
+      && ELF_ST_BIND (sym.st_info) != STB_WEAK
+      && h->root.type == bfd_link_hash_undefined
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+    {
+      (*_bfd_error_handler)
+	(_("%s: %s symbol `%s' isn't defined"),
+	  bfd_get_filename (finfo->output_bfd),
+	  ELF_ST_VISIBILITY (sym.st_other) == STV_PROTECTED
+	  ? "protected"
+	  : ELF_ST_VISIBILITY (sym.st_other) == STV_INTERNAL
+	    ? "internal" : "hidden",
+	  h->root.root.string);
+      eoinfo->failed = TRUE;
+      return FALSE;
+    }
+
+  /* If this symbol should be put in the .dynsym section, then put it
+     there now.  We already know the symbol index.  We also fill in
+     the entry in the .hash section.  */
+  if (h->dynindx != -1
+      && elf_hash_table (finfo->info)->dynamic_sections_created)
+    {
+      size_t bucketcount;
+      size_t bucket;
+      size_t hash_entry_size;
+      bfd_byte *bucketpos;
+      bfd_vma chain;
+      bfd_byte *esym;
+
+      sym.st_name = h->dynstr_index;
+      esym = finfo->dynsym_sec->contents + h->dynindx * bed->s->sizeof_sym;
+      bed->s->swap_symbol_out (finfo->output_bfd, &sym, esym, 0);
+
+      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) * 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)
+	{
+	  Elf_Internal_Versym iversym;
+	  Elf_External_Versym *eversym;
+
+	  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+	    {
+	      if (h->verinfo.verdef == NULL)
+		iversym.vs_vers = 0;
+	      else
+		iversym.vs_vers = h->verinfo.verdef->vd_exp_refno + 1;
+	    }
+	  else
+	    {
+	      if (h->verinfo.vertree == NULL)
+		iversym.vs_vers = 1;
+	      else
+		iversym.vs_vers = h->verinfo.vertree->vernum + 1;
+	    }
+
+	  if ((h->elf_link_hash_flags & ELF_LINK_HIDDEN) != 0)
+	    iversym.vs_vers |= VERSYM_HIDDEN;
+
+	  eversym = (Elf_External_Versym *) finfo->symver_sec->contents;
+	  eversym += h->dynindx;
+	  _bfd_elf_swap_versym_out (finfo->output_bfd, &iversym, eversym);
+	}
+    }
+
+  /* If we're stripping it, then it was just a dynamic symbol, and
+     there's nothing else to do.  */
+  if (strip || (input_sec->flags & SEC_EXCLUDE) != 0)
+    return TRUE;
+
+  h->indx = bfd_get_symcount (finfo->output_bfd);
+
+  if (! elf_link_output_sym (finfo, h->root.root.string, &sym, input_sec, h))
+    {
+      eoinfo->failed = TRUE;
+      return FALSE;
+    }
+
+  return TRUE;
+}
+
+/* Return TRUE if special handling is done for relocs in SEC against
+   symbols defined in discarded sections.  */
+
+static bfd_boolean
+elf_section_ignore_discarded_relocs (asection *sec)
+{
+  const struct elf_backend_data *bed;
+
+  switch (sec->sec_info_type)
+    {
+    case ELF_INFO_TYPE_STABS:
+    case ELF_INFO_TYPE_EH_FRAME:
+      return TRUE;
+    default:
+      break;
+    }
+
+  bed = get_elf_backend_data (sec->owner);
+  if (bed->elf_backend_ignore_discarded_relocs != NULL
+      && (*bed->elf_backend_ignore_discarded_relocs) (sec))
+    return TRUE;
+
+  return FALSE;
+}
+
+/* Return TRUE if we should complain about a reloc in SEC against a
+   symbol defined in a discarded section.  */
+
+static bfd_boolean
+elf_section_complain_discarded (asection *sec)
+{
+  if (strncmp (".stab", sec->name, 5) == 0
+      && (!sec->name[5] ||
+	  (sec->name[5] == '.' && ISDIGIT (sec->name[6]))))
+    return FALSE;
+
+  if (strcmp (".eh_frame", sec->name) == 0)
+    return FALSE;
+
+  if (strcmp (".gcc_except_table", sec->name) == 0)
+    return FALSE;
+
+  return TRUE;
+}
+
+/* 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
+   don't have to keep them in memory.  */
+
+static bfd_boolean
+elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
+{
+  bfd_boolean (*relocate_section)
+    (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
+     Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
+  bfd *output_bfd;
+  Elf_Internal_Shdr *symtab_hdr;
+  size_t locsymcount;
+  size_t extsymoff;
+  Elf_Internal_Sym *isymbuf;
+  Elf_Internal_Sym *isym;
+  Elf_Internal_Sym *isymend;
+  long *pindex;
+  asection **ppsection;
+  asection *o;
+  const struct elf_backend_data *bed;
+  bfd_boolean emit_relocs;
+  struct elf_link_hash_entry **sym_hashes;
+
+  output_bfd = finfo->output_bfd;
+  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
+     contents.  */
+  if ((input_bfd->flags & DYNAMIC) != 0)
+    return TRUE;
+
+  emit_relocs = (finfo->info->relocatable
+		 || finfo->info->emitrelocations
+		 || bed->elf_backend_emit_relocs);
+
+  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+  if (elf_bad_symtab (input_bfd))
+    {
+      locsymcount = symtab_hdr->sh_size / bed->s->sizeof_sym;
+      extsymoff = 0;
+    }
+  else
+    {
+      locsymcount = symtab_hdr->sh_info;
+      extsymoff = symtab_hdr->sh_info;
+    }
+
+  /* Read the local symbols.  */
+  isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
+  if (isymbuf == NULL && locsymcount != 0)
+    {
+      isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, locsymcount, 0,
+				      finfo->internal_syms,
+				      finfo->external_syms,
+				      finfo->locsym_shndx);
+      if (isymbuf == NULL)
+	return FALSE;
+    }
+
+  /* Find local symbol sections and adjust values of symbols in
+     SEC_MERGE sections.  Write out those local symbols we know are
+     going into the output file.  */
+  isymend = isymbuf + locsymcount;
+  for (isym = isymbuf, pindex = finfo->indices, ppsection = finfo->sections;
+       isym < isymend;
+       isym++, pindex++, ppsection++)
+    {
+      asection *isec;
+      const char *name;
+      Elf_Internal_Sym osym;
+
+      *pindex = -1;
+
+      if (elf_bad_symtab (input_bfd))
+	{
+	  if (ELF_ST_BIND (isym->st_info) != STB_LOCAL)
+	    {
+	      *ppsection = NULL;
+	      continue;
+	    }
+	}
+
+      if (isym->st_shndx == SHN_UNDEF)
+	isec = bfd_und_section_ptr;
+      else if (isym->st_shndx < SHN_LORESERVE
+	       || isym->st_shndx > SHN_HIRESERVE)
+	{
+	  isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx);
+	  if (isec
+	      && isec->sec_info_type == ELF_INFO_TYPE_MERGE
+	      && ELF_ST_TYPE (isym->st_info) != STT_SECTION)
+	    isym->st_value =
+	      _bfd_merged_section_offset (output_bfd, &isec,
+					  elf_section_data (isec)->sec_info,
+					  isym->st_value);
+	}
+      else if (isym->st_shndx == SHN_ABS)
+	isec = bfd_abs_section_ptr;
+      else if (isym->st_shndx == SHN_COMMON)
+	isec = bfd_com_section_ptr;
+      else
+	{
+	  /* Who knows?  */
+	  isec = NULL;
+	}
+
+      *ppsection = isec;
+
+      /* Don't output the first, undefined, symbol.  */
+      if (ppsection == finfo->sections)
+	continue;
+
+      if (ELF_ST_TYPE (isym->st_info) == STT_SECTION)
+	{
+	  /* We never output section symbols.  Instead, we use the
+	     section symbol of the corresponding section in the output
+	     file.  */
+	  continue;
+	}
+
+      /* If we are stripping all symbols, we don't want to output this
+	 one.  */
+      if (finfo->info->strip == strip_all)
+	continue;
+
+      /* If we are discarding all local symbols, we don't want to
+	 output this one.  If we are generating a relocatable output
+	 file, then some of the local symbols may be required by
+	 relocs; we output them below as we discover that they are
+	 needed.  */
+      if (finfo->info->discard == discard_all)
+	continue;
+
+      /* If this symbol is defined in a section which we are
+	 discarding, we don't need to keep it, but note that
+	 linker_mark is only reliable for sections that have contents.
+	 For the benefit of the MIPS ELF linker, we check SEC_EXCLUDE
+	 as well as linker_mark.  */
+      if ((isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE)
+	  && isec != NULL
+	  && ((! isec->linker_mark && (isec->flags & SEC_HAS_CONTENTS) != 0)
+	      || (! finfo->info->relocatable
+		  && (isec->flags & SEC_EXCLUDE) != 0)))
+	continue;
+
+      /* Get the name of the symbol.  */
+      name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link,
+					      isym->st_name);
+      if (name == NULL)
+	return FALSE;
+
+      /* See if we are discarding symbols with this name.  */
+      if ((finfo->info->strip == strip_some
+	   && (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE)
+	       == NULL))
+	  || (((finfo->info->discard == discard_sec_merge
+		&& (isec->flags & SEC_MERGE) && ! finfo->info->relocatable)
+	       || finfo->info->discard == discard_l)
+	      && bfd_is_local_label_name (input_bfd, name)))
+	continue;
+
+      /* If we get here, we are going to output this symbol.  */
+
+      osym = *isym;
+
+      /* Adjust the section index for the output file.  */
+      osym.st_shndx = _bfd_elf_section_from_bfd_section (output_bfd,
+							 isec->output_section);
+      if (osym.st_shndx == SHN_BAD)
+	return FALSE;
+
+      *pindex = bfd_get_symcount (output_bfd);
+
+      /* ELF symbols in relocatable files are section relative, but
+	 in executable files they are virtual addresses.  Note that
+	 this code assumes that all ELF sections have an associated
+	 BFD section with a reasonable value for output_offset; below
+	 we assume that they also have a reasonable value for
+	 output_section.  Any special sections must be set up to meet
+	 these requirements.  */
+      osym.st_value += isec->output_offset;
+      if (! finfo->info->relocatable)
+	{
+	  osym.st_value += isec->output_section->vma;
+	  if (ELF_ST_TYPE (osym.st_info) == STT_TLS)
+	    {
+	      /* STT_TLS symbols are relative to PT_TLS segment base.  */
+	      BFD_ASSERT (elf_hash_table (finfo->info)->tls_sec != NULL);
+	      osym.st_value -= elf_hash_table (finfo->info)->tls_sec->vma;
+	    }
+	}
+
+      if (! elf_link_output_sym (finfo, name, &osym, isec, NULL))
+	return FALSE;
+    }
+
+  /* Relocate the contents of each section.  */
+  sym_hashes = elf_sym_hashes (input_bfd);
+  for (o = input_bfd->sections; o != NULL; o = o->next)
+    {
+      bfd_byte *contents;
+
+      if (! o->linker_mark)
+	{
+	  /* This section was omitted from the link.  */
+	  continue;
+	}
+
+      if ((o->flags & SEC_HAS_CONTENTS) == 0
+	  || (o->size == 0 && (o->flags & SEC_RELOC) == 0))
+	continue;
+
+      if ((o->flags & SEC_LINKER_CREATED) != 0)
+	{
+	  /* Section was created by _bfd_elf_link_create_dynamic_sections
+	     or somesuch.  */
+	  continue;
+	}
+
+      /* Get the contents of the section.  They have been cached by a
+	 relaxation routine.  Note that o is a section in an input
+	 file, so the contents field will not have been set by any of
+	 the routines which work on output files.  */
+      if (elf_section_data (o)->this_hdr.contents != NULL)
+	contents = elf_section_data (o)->this_hdr.contents;
+      else
+	{
+	  bfd_size_type amt = o->rawsize ? o->rawsize : o->size;
+
+	  contents = finfo->contents;
+	  if (! bfd_get_section_contents (input_bfd, o, contents, 0, amt))
+	    return FALSE;
+	}
+
+      if ((o->flags & SEC_RELOC) != 0)
+	{
+	  Elf_Internal_Rela *internal_relocs;
+	  bfd_vma r_type_mask;
+	  int r_sym_shift;
+
+	  /* Get the swapped relocs.  */
+	  internal_relocs
+	    = _bfd_elf_link_read_relocs (input_bfd, o, finfo->external_relocs,
+					 finfo->internal_relocs, FALSE);
+	  if (internal_relocs == NULL
+	      && o->reloc_count > 0)
+	    return FALSE;
+
+	  if (bed->s->arch_size == 32)
+	    {
+	      r_type_mask = 0xff;
+	      r_sym_shift = 8;
+	    }
+	  else
+	    {
+	      r_type_mask = 0xffffffff;
+	      r_sym_shift = 32;
+	    }
+
+	  /* Run through the relocs looking for any against symbols
+	     from discarded sections and section symbols from
+	     removed link-once sections.  Complain about relocs
+	     against discarded sections.  Zero relocs against removed
+	     link-once sections.  Preserve debug information as much
+	     as we can.  */
+	  if (!elf_section_ignore_discarded_relocs (o))
+	    {
+	      Elf_Internal_Rela *rel, *relend;
+	      bfd_boolean complain = elf_section_complain_discarded (o);
+
+	      rel = internal_relocs;
+	      relend = rel + o->reloc_count * bed->s->int_rels_per_ext_rel;
+	      for ( ; rel < relend; rel++)
+		{
+		  unsigned long r_symndx = rel->r_info >> r_sym_shift;
+		  asection **ps, *sec;
+		  struct elf_link_hash_entry *h = NULL;
+		  const char *sym_name;
+
+		  if (r_symndx >= locsymcount
+		      || (elf_bad_symtab (input_bfd)
+			  && finfo->sections[r_symndx] == NULL))
+		    {
+		      h = sym_hashes[r_symndx - extsymoff];
+		      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 (h->root.type != bfd_link_hash_defined
+			  && h->root.type != bfd_link_hash_defweak)
+			continue;
+
+		      ps = &h->root.u.def.section;
+		      sym_name = h->root.root.string;
+		    }
+		  else
+		    {
+		      Elf_Internal_Sym *sym = isymbuf + r_symndx;
+		      ps = &finfo->sections[r_symndx];
+		      sym_name = bfd_elf_local_sym_name (input_bfd, sym);
+		    }
+
+		  /* Complain if the definition comes from a
+		     discarded section.  */
+		  if ((sec = *ps) != NULL && elf_discarded_section (sec))
+		    {
+		      if ((o->flags & SEC_DEBUGGING) != 0)
+			{
+			  BFD_ASSERT (r_symndx != 0);
+
+			  /* Try to preserve debug information.
+			     FIXME: This is quite broken.  Modifying
+			     the symbol here means we will be changing
+			     all uses of the symbol, not just those in
+			     debug sections.  The only thing that makes
+			     this half reasonable is that debug sections
+			     tend to come after other sections.  Of
+			     course, that doesn't help with globals.
+			     ??? All link-once sections of the same name
+			     ought to define the same set of symbols, so
+			     it would seem that globals ought to always
+			     be defined in the kept section.  */
+			  if (sec->kept_section != NULL
+			      && sec->size == sec->kept_section->size)
+			    {
+			      *ps = sec->kept_section;
+			      continue;
+			    }
+			}
+		      else if (complain)
+			{
+			  char *r_sec
+			    = bfd_get_section_ident (o);
+			  char *d_sec
+			    = bfd_get_section_ident (sec);
+			  finfo->info->callbacks->error_handler
+			    (LD_DEFINITION_IN_DISCARDED_SECTION,
+			     _("`%T' referenced in section `%s' of %B: "
+			       "defined in discarded section `%s' of %B\n"),
+			     sym_name, sym_name,
+			     r_sec ? r_sec : o->name, input_bfd,
+			     d_sec ? d_sec : sec->name, sec->owner);
+			  if (r_sec)
+			    free (r_sec);
+			  if (d_sec)
+			    free (d_sec);
+			}
+
+		      /* Remove the symbol reference from the reloc, but
+			 don't kill the reloc completely.  This is so that
+			 a zero value will be written into the section,
+			 which may have non-zero contents put there by the
+			 assembler.  Zero in things like an eh_frame fde
+			 pc_begin allows stack unwinders to recognize the
+			 fde as bogus.  */
+		      rel->r_info &= r_type_mask;
+		      rel->r_addend = 0;
+		    }
+		}
+	    }
+
+	  /* Relocate the section by invoking a back end routine.
+
+	     The back end routine is responsible for adjusting the
+	     section contents as necessary, and (if using Rela relocs
+	     and generating a relocatable output file) adjusting the
+	     reloc addend as necessary.
+
+	     The back end routine does not have to worry about setting
+	     the reloc address or the reloc symbol index.
+
+	     The back end routine is given a pointer to the swapped in
+	     internal symbols, and can access the hash table entries
+	     for the external symbols via elf_sym_hashes (input_bfd).
+
+	     When generating relocatable output, the back end routine
+	     must handle STB_LOCAL/STT_SECTION symbols specially.  The
+	     output symbol is going to be a section symbol
+	     corresponding to the output section, which will require
+	     the addend to be adjusted.  */
+
+	  if (! (*relocate_section) (output_bfd, finfo->info,
+				     input_bfd, o, contents,
+				     internal_relocs,
+				     isymbuf,
+				     finfo->sections))
+	    return FALSE;
+
+	  if (emit_relocs)
+	    {
+	      Elf_Internal_Rela *irela;
+	      Elf_Internal_Rela *irelaend;
+	      bfd_vma last_offset;
+	      struct elf_link_hash_entry **rel_hash;
+	      Elf_Internal_Shdr *input_rel_hdr, *input_rel_hdr2;
+	      unsigned int next_erel;
+	      bfd_boolean (*reloc_emitter)
+		(bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *);
+	      bfd_boolean rela_normal;
+
+	      input_rel_hdr = &elf_section_data (o)->rel_hdr;
+	      rela_normal = (bed->rela_normal
+			     && (input_rel_hdr->sh_entsize
+				 == bed->s->sizeof_rela));
+
+	      /* Adjust the reloc addresses and symbol indices.  */
+
+	      irela = internal_relocs;
+	      irelaend = irela + o->reloc_count * bed->s->int_rels_per_ext_rel;
+	      rel_hash = (elf_section_data (o->output_section)->rel_hashes
+			  + elf_section_data (o->output_section)->rel_count
+			  + elf_section_data (o->output_section)->rel_count2);
+	      last_offset = o->output_offset;
+	      if (!finfo->info->relocatable)
+		last_offset += o->output_section->vma;
+	      for (next_erel = 0; irela < irelaend; irela++, next_erel++)
+		{
+		  unsigned long r_symndx;
+		  asection *sec;
+		  Elf_Internal_Sym sym;
+
+		  if (next_erel == bed->s->int_rels_per_ext_rel)
+		    {
+		      rel_hash++;
+		      next_erel = 0;
+		    }
+
+		  irela->r_offset = _bfd_elf_section_offset (output_bfd,
+							     finfo->info, o,
+							     irela->r_offset);
+		  if (irela->r_offset >= (bfd_vma) -2)
+		    {
+		      /* This is a reloc for a deleted entry or somesuch.
+			 Turn it into an R_*_NONE reloc, at the same
+			 offset as the last reloc.  elf_eh_frame.c and
+			 elf_bfd_discard_info rely on reloc offsets
+			 being ordered.  */
+		      irela->r_offset = last_offset;
+		      irela->r_info = 0;
+		      irela->r_addend = 0;
+		      continue;
+		    }
+
+		  irela->r_offset += o->output_offset;
+
+		  /* Relocs in an executable have to be virtual addresses.  */
+		  if (!finfo->info->relocatable)
+		    irela->r_offset += o->output_section->vma;
+
+		  last_offset = irela->r_offset;
+
+		  r_symndx = irela->r_info >> r_sym_shift;
+		  if (r_symndx == STN_UNDEF)
+		    continue;
+
+		  if (r_symndx >= locsymcount
+		      || (elf_bad_symtab (input_bfd)
+			  && finfo->sections[r_symndx] == NULL))
+		    {
+		      struct elf_link_hash_entry *rh;
+		      unsigned long indx;
+
+		      /* This is a reloc against a global symbol.  We
+			 have not yet output all the local symbols, so
+			 we do not know the symbol index of any global
+			 symbol.  We set the rel_hash entry for this
+			 reloc to point to the global hash table entry
+			 for this symbol.  The symbol index is then
+			 set at the end of elf_bfd_final_link.  */
+		      indx = r_symndx - extsymoff;
+		      rh = elf_sym_hashes (input_bfd)[indx];
+		      while (rh->root.type == bfd_link_hash_indirect
+			     || rh->root.type == bfd_link_hash_warning)
+			rh = (struct elf_link_hash_entry *) rh->root.u.i.link;
+
+		      /* Setting the index to -2 tells
+			 elf_link_output_extsym that this symbol is
+			 used by a reloc.  */
+		      BFD_ASSERT (rh->indx < 0);
+		      rh->indx = -2;
+
+		      *rel_hash = rh;
+
+		      continue;
+		    }
+
+		  /* This is a reloc against a local symbol.  */
+
+		  *rel_hash = NULL;
+		  sym = isymbuf[r_symndx];
+		  sec = finfo->sections[r_symndx];
+		  if (ELF_ST_TYPE (sym.st_info) == STT_SECTION)
+		    {
+		      /* I suppose the backend ought to fill in the
+			 section of any STT_SECTION symbol against a
+			 processor specific section.  */
+		      r_symndx = 0;
+		      if (bfd_is_abs_section (sec))
+			;
+		      else if (sec == NULL || sec->owner == NULL)
+			{
+			  bfd_set_error (bfd_error_bad_value);
+			  return FALSE;
+			}
+		      else
+			{
+			  asection *osec = sec->output_section;
+
+			  /* If we have discarded a section, the output
+			     section will be the absolute section.  In
+			     case of discarded link-once and discarded
+			     SEC_MERGE sections, use the kept section.  */
+			  if (bfd_is_abs_section (osec)
+			      && sec->kept_section != NULL
+			      && sec->kept_section->output_section != NULL)
+			    {
+			      osec = sec->kept_section->output_section;
+			      irela->r_addend -= osec->vma;
+			    }
+
+			  if (!bfd_is_abs_section (osec))
+			    {
+			      r_symndx = osec->target_index;
+			      BFD_ASSERT (r_symndx != 0);
+			    }
+			}
+
+		      /* Adjust the addend according to where the
+			 section winds up in the output section.  */
+		      if (rela_normal)
+			irela->r_addend += sec->output_offset;
+		    }
+		  else
+		    {
+		      if (finfo->indices[r_symndx] == -1)
+			{
+			  unsigned long shlink;
+			  const char *name;
+			  asection *osec;
+
+			  if (finfo->info->strip == strip_all)
+			    {
+			      /* You can't do ld -r -s.  */
+			      bfd_set_error (bfd_error_invalid_operation);
+			      return FALSE;
+			    }
+
+			  /* This symbol was skipped earlier, but
+			     since it is needed by a reloc, we
+			     must output it now.  */
+			  shlink = symtab_hdr->sh_link;
+			  name = (bfd_elf_string_from_elf_section
+				  (input_bfd, shlink, sym.st_name));
+			  if (name == NULL)
+			    return FALSE;
+
+			  osec = sec->output_section;
+			  sym.st_shndx =
+			    _bfd_elf_section_from_bfd_section (output_bfd,
+							       osec);
+			  if (sym.st_shndx == SHN_BAD)
+			    return FALSE;
+
+			  sym.st_value += sec->output_offset;
+			  if (! finfo->info->relocatable)
+			    {
+			      sym.st_value += osec->vma;
+			      if (ELF_ST_TYPE (sym.st_info) == STT_TLS)
+				{
+				  /* STT_TLS symbols are relative to PT_TLS
+				     segment base.  */
+				  BFD_ASSERT (elf_hash_table (finfo->info)
+					      ->tls_sec != NULL);
+				  sym.st_value -= (elf_hash_table (finfo->info)
+						   ->tls_sec->vma);
+				}
+			    }
+
+			  finfo->indices[r_symndx]
+			    = bfd_get_symcount (output_bfd);
+
+			  if (! elf_link_output_sym (finfo, name, &sym, sec,
+						     NULL))
+			    return FALSE;
+			}
+
+		      r_symndx = finfo->indices[r_symndx];
+		    }
+
+		  irela->r_info = ((bfd_vma) r_symndx << r_sym_shift
+				   | (irela->r_info & r_type_mask));
+		}
+
+	      /* Swap out the relocs.  */
+	      if (bed->elf_backend_emit_relocs
+		  && !(finfo->info->relocatable
+		       || finfo->info->emitrelocations))
+		reloc_emitter = bed->elf_backend_emit_relocs;
+	      else
+		reloc_emitter = _bfd_elf_link_output_relocs;
+
+	      if (input_rel_hdr->sh_size != 0
+		  && ! (*reloc_emitter) (output_bfd, o, input_rel_hdr,
+					 internal_relocs))
+		return FALSE;
+
+	      input_rel_hdr2 = elf_section_data (o)->rel_hdr2;
+	      if (input_rel_hdr2 && input_rel_hdr2->sh_size != 0)
+		{
+		  internal_relocs += (NUM_SHDR_ENTRIES (input_rel_hdr)
+				      * bed->s->int_rels_per_ext_rel);
+		  if (! (*reloc_emitter) (output_bfd, o, input_rel_hdr2,
+					  internal_relocs))
+		    return FALSE;
+		}
+	    }
+	}
+
+      /* Write out the modified section contents.  */
+      if (bed->elf_backend_write_section
+	  && (*bed->elf_backend_write_section) (output_bfd, o, contents))
+	{
+	  /* Section written out.  */
+	}
+      else switch (o->sec_info_type)
+	{
+	case ELF_INFO_TYPE_STABS:
+	  if (! (_bfd_write_section_stabs
+		 (output_bfd,
+		  &elf_hash_table (finfo->info)->stab_info,
+		  o, &elf_section_data (o)->sec_info, contents)))
+	    return FALSE;
+	  break;
+	case ELF_INFO_TYPE_MERGE:
+	  if (! _bfd_write_merged_section (output_bfd, o,
+					   elf_section_data (o)->sec_info))
+	    return FALSE;
+	  break;
+	case ELF_INFO_TYPE_EH_FRAME:
+	  {
+	    if (! _bfd_elf_write_section_eh_frame (output_bfd, finfo->info,
+						   o, contents))
+	      return FALSE;
+	  }
+	  break;
+	default:
+	  {
+	    if (! (o->flags & SEC_EXCLUDE)
+		&& ! bfd_set_section_contents (output_bfd, o->output_section,
+					       contents,
+					       (file_ptr) o->output_offset,
+					       o->size))
+	      return FALSE;
+	  }
+	  break;
+	}
+    }
+
+  return TRUE;
+}
+
+/* Generate a reloc when linking an ELF file.  This is a reloc
+   requested by the linker, and does come from any input file.  This
+   is used to build constructor and destructor tables when linking
+   with -Ur.  */
+
+static bfd_boolean
+elf_reloc_link_order (bfd *output_bfd,
+		      struct bfd_link_info *info,
+		      asection *output_section,
+		      struct bfd_link_order *link_order)
+{
+  reloc_howto_type *howto;
+  long indx;
+  bfd_vma offset;
+  bfd_vma addend;
+  struct elf_link_hash_entry **rel_hash_ptr;
+  Elf_Internal_Shdr *rel_hdr;
+  const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
+  Elf_Internal_Rela irel[MAX_INT_RELS_PER_EXT_REL];
+  bfd_byte *erel;
+  unsigned int i;
+
+  howto = bfd_reloc_type_lookup (output_bfd, link_order->u.reloc.p->reloc);
+  if (howto == NULL)
+    {
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
+
+  addend = link_order->u.reloc.p->addend;
+
+  /* Figure out the symbol index.  */
+  rel_hash_ptr = (elf_section_data (output_section)->rel_hashes
+		  + 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;
+      BFD_ASSERT (indx != 0);
+      *rel_hash_ptr = NULL;
+    }
+  else
+    {
+      struct elf_link_hash_entry *h;
+
+      /* Treat a reloc against a defined symbol as though it were
+	 actually against the section.  */
+      h = ((struct elf_link_hash_entry *)
+	   bfd_wrapped_link_hash_lookup (output_bfd, info,
+					 link_order->u.reloc.p->u.name,
+					 FALSE, FALSE, TRUE));
+      if (h != NULL
+	  && (h->root.type == bfd_link_hash_defined
+	      || h->root.type == bfd_link_hash_defweak))
+	{
+	  asection *section;
+
+	  section = h->root.u.def.section;
+	  indx = section->output_section->target_index;
+	  *rel_hash_ptr = NULL;
+	  /* It seems that we ought to add the symbol value to the
+	     addend here, but in practice it has already been added
+	     because it was passed to constructor_callback.  */
+	  addend += section->output_section->vma + section->output_offset;
+	}
+      else if (h != NULL)
+	{
+	  /* Setting the index to -2 tells elf_link_output_extsym that
+	     this symbol is used by a reloc.  */
+	  h->indx = -2;
+	  *rel_hash_ptr = h;
+	  indx = 0;
+	}
+      else
+	{
+	  if (! ((*info->callbacks->unattached_reloc)
+		 (info, link_order->u.reloc.p->u.name, NULL, NULL, 0)))
+	    return FALSE;
+	  indx = 0;
+	}
+    }
+
+  /* If this is an inplace reloc, we must write the addend into the
+     object file.  */
+  if (howto->partial_inplace && addend != 0)
+    {
+      bfd_size_type size;
+      bfd_reloc_status_type rstat;
+      bfd_byte *buf;
+      bfd_boolean ok;
+      const char *sym_name;
+
+      size = bfd_get_reloc_size (howto);
+      buf = bfd_zmalloc (size);
+      if (buf == NULL)
+	return FALSE;
+      rstat = _bfd_relocate_contents (howto, output_bfd, addend, buf);
+      switch (rstat)
+	{
+	case bfd_reloc_ok:
+	  break;
+
+	default:
+	case bfd_reloc_outofrange:
+	  abort ();
+
+	case bfd_reloc_overflow:
+	  if (link_order->type == bfd_section_reloc_link_order)
+	    sym_name = bfd_section_name (output_bfd,
+					 link_order->u.reloc.p->u.section);
+	  else
+	    sym_name = link_order->u.reloc.p->u.name;
+	  if (! ((*info->callbacks->reloc_overflow)
+		 (info, sym_name, howto->name, addend, NULL, NULL, 0)))
+	    {
+	      free (buf);
+	      return FALSE;
+	    }
+	  break;
+	}
+      ok = bfd_set_section_contents (output_bfd, output_section, buf,
+				     link_order->offset, size);
+      free (buf);
+      if (! ok)
+	return FALSE;
+    }
+
+  /* The address of a reloc is relative to the section in a
+     relocatable file, and is a virtual address in an executable
+     file.  */
+  offset = link_order->offset;
+  if (! info->relocatable)
+    offset += output_section->vma;
+
+  for (i = 0; i < bed->s->int_rels_per_ext_rel; i++)
+    {
+      irel[i].r_offset = offset;
+      irel[i].r_info = 0;
+      irel[i].r_addend = 0;
+    }
+  if (bed->s->arch_size == 32)
+    irel[0].r_info = ELF32_R_INFO (indx, howto->type);
+  else
+    irel[0].r_info = ELF64_R_INFO (indx, howto->type);
+
+  rel_hdr = &elf_section_data (output_section)->rel_hdr;
+  erel = rel_hdr->contents;
+  if (rel_hdr->sh_type == SHT_REL)
+    {
+      erel += (elf_section_data (output_section)->rel_count
+	       * bed->s->sizeof_rel);
+      (*bed->s->swap_reloc_out) (output_bfd, irel, erel);
+    }
+  else
+    {
+      irel[0].r_addend = addend;
+      erel += (elf_section_data (output_section)->rel_count
+	       * bed->s->sizeof_rela);
+      (*bed->s->swap_reloca_out) (output_bfd, irel, erel);
+    }
+
+  ++elf_section_data (output_section)->rel_count;
+
+  return TRUE;
+}
+
+/* Do the final step of an ELF link.  */
+
+bfd_boolean
+bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
+{
+  bfd_boolean dynamic;
+  bfd_boolean emit_relocs;
+  bfd *dynobj;
+  struct elf_final_link_info finfo;
+  register asection *o;
+  register struct bfd_link_order *p;
+  register bfd *sub;
+  bfd_size_type max_contents_size;
+  bfd_size_type max_external_reloc_size;
+  bfd_size_type max_internal_reloc_count;
+  bfd_size_type max_sym_count;
+  bfd_size_type max_sym_shndx_count;
+  file_ptr off;
+  Elf_Internal_Sym elfsym;
+  unsigned int i;
+  Elf_Internal_Shdr *symtab_hdr;
+  Elf_Internal_Shdr *symtab_shndx_hdr;
+  Elf_Internal_Shdr *symstrtab_hdr;
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  struct elf_outext_info eoinfo;
+  bfd_boolean merged;
+  size_t relativecount = 0;
+  asection *reldyn = 0;
+  bfd_size_type amt;
+
+  if (! is_elf_hash_table (info->hash))
+    return FALSE;
+
+  if (info->shared)
+    abfd->flags |= DYNAMIC;
+
+  dynamic = elf_hash_table (info)->dynamic_sections_created;
+  dynobj = elf_hash_table (info)->dynobj;
+
+  emit_relocs = (info->relocatable
+		 || info->emitrelocations
+		 || bed->elf_backend_emit_relocs);
+
+  finfo.info = info;
+  finfo.output_bfd = abfd;
+  finfo.symstrtab = _bfd_elf_stringtab_init ();
+  if (finfo.symstrtab == NULL)
+    return FALSE;
+
+  if (! dynamic)
+    {
+      finfo.dynsym_sec = NULL;
+      finfo.hash_sec = NULL;
+      finfo.symver_sec = NULL;
+    }
+  else
+    {
+      finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym");
+      finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash");
+      BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL);
+      finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version");
+      /* Note that it is OK if symver_sec is NULL.  */
+    }
+
+  finfo.contents = NULL;
+  finfo.external_relocs = NULL;
+  finfo.internal_relocs = NULL;
+  finfo.external_syms = NULL;
+  finfo.locsym_shndx = NULL;
+  finfo.internal_syms = NULL;
+  finfo.indices = NULL;
+  finfo.sections = NULL;
+  finfo.symbuf = NULL;
+  finfo.symshndxbuf = NULL;
+  finfo.symbuf_count = 0;
+  finfo.shndxbuf_size = 0;
+
+  /* Count up the number of relocations we will output for each output
+     section, so that we know the sizes of the reloc sections.  We
+     also figure out some maximum sizes.  */
+  max_contents_size = 0;
+  max_external_reloc_size = 0;
+  max_internal_reloc_count = 0;
+  max_sym_count = 0;
+  max_sym_shndx_count = 0;
+  merged = FALSE;
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      struct bfd_elf_section_data *esdo = elf_section_data (o);
+      o->reloc_count = 0;
+
+      for (p = o->link_order_head; p != NULL; p = p->next)
+	{
+	  unsigned int reloc_count = 0;
+	  struct bfd_elf_section_data *esdi = NULL;
+	  unsigned int *rel_count1;
+
+	  if (p->type == bfd_section_reloc_link_order
+	      || p->type == bfd_symbol_reloc_link_order)
+	    reloc_count = 1;
+	  else if (p->type == bfd_indirect_link_order)
+	    {
+	      asection *sec;
+
+	      sec = p->u.indirect.section;
+	      esdi = elf_section_data (sec);
+
+	      /* Mark all sections which are to be included in the
+		 link.  This will normally be every section.  We need
+		 to do this so that we can identify any sections which
+		 the linker has decided to not include.  */
+	      sec->linker_mark = TRUE;
+
+	      if (sec->flags & SEC_MERGE)
+		merged = TRUE;
+
+	      if (info->relocatable || info->emitrelocations)
+		reloc_count = sec->reloc_count;
+	      else if (bed->elf_backend_count_relocs)
+		{
+		  Elf_Internal_Rela * relocs;
+
+		  relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
+						      info->keep_memory);
+
+		  reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs);
+
+		  if (elf_section_data (o)->relocs != relocs)
+		    free (relocs);
+		}
+
+	      if (sec->rawsize > max_contents_size)
+		max_contents_size = sec->rawsize;
+	      if (sec->size > max_contents_size)
+		max_contents_size = sec->size;
+
+	      /* We are interested in just local symbols, not all
+		 symbols.  */
+	      if (bfd_get_flavour (sec->owner) == bfd_target_elf_flavour
+		  && (sec->owner->flags & DYNAMIC) == 0)
+		{
+		  size_t sym_count;
+
+		  if (elf_bad_symtab (sec->owner))
+		    sym_count = (elf_tdata (sec->owner)->symtab_hdr.sh_size
+				 / bed->s->sizeof_sym);
+		  else
+		    sym_count = elf_tdata (sec->owner)->symtab_hdr.sh_info;
+
+		  if (sym_count > max_sym_count)
+		    max_sym_count = sym_count;
+
+		  if (sym_count > max_sym_shndx_count
+		      && elf_symtab_shndx (sec->owner) != 0)
+		    max_sym_shndx_count = sym_count;
+
+		  if ((sec->flags & SEC_RELOC) != 0)
+		    {
+		      size_t ext_size;
+
+		      ext_size = elf_section_data (sec)->rel_hdr.sh_size;
+		      if (ext_size > max_external_reloc_size)
+			max_external_reloc_size = ext_size;
+		      if (sec->reloc_count > max_internal_reloc_count)
+			max_internal_reloc_count = sec->reloc_count;
+		    }
+		}
+	    }
+
+	  if (reloc_count == 0)
+	    continue;
+
+	  o->reloc_count += reloc_count;
+
+	  /* MIPS may have a mix of REL and RELA relocs on sections.
+	     To support this curious ABI we keep reloc counts in
+	     elf_section_data too.  We must be careful to add the
+	     relocations from the input section to the right output
+	     count.  FIXME: Get rid of one count.  We have
+	     o->reloc_count == esdo->rel_count + esdo->rel_count2.  */
+	  rel_count1 = &esdo->rel_count;
+	  if (esdi != NULL)
+	    {
+	      bfd_boolean same_size;
+	      bfd_size_type entsize1;
+
+	      entsize1 = esdi->rel_hdr.sh_entsize;
+	      BFD_ASSERT (entsize1 == bed->s->sizeof_rel
+			  || entsize1 == bed->s->sizeof_rela);
+	      same_size = !o->use_rela_p == (entsize1 == bed->s->sizeof_rel);
+
+	      if (!same_size)
+		rel_count1 = &esdo->rel_count2;
+
+	      if (esdi->rel_hdr2 != NULL)
+		{
+		  bfd_size_type entsize2 = esdi->rel_hdr2->sh_entsize;
+		  unsigned int alt_count;
+		  unsigned int *rel_count2;
+
+		  BFD_ASSERT (entsize2 != entsize1
+			      && (entsize2 == bed->s->sizeof_rel
+				  || entsize2 == bed->s->sizeof_rela));
+
+		  rel_count2 = &esdo->rel_count2;
+		  if (!same_size)
+		    rel_count2 = &esdo->rel_count;
+
+		  /* The following is probably too simplistic if the
+		     backend counts output relocs unusually.  */
+		  BFD_ASSERT (bed->elf_backend_count_relocs == NULL);
+		  alt_count = NUM_SHDR_ENTRIES (esdi->rel_hdr2);
+		  *rel_count2 += alt_count;
+		  reloc_count -= alt_count;
+		}
+	    }
+	  *rel_count1 += reloc_count;
+	}
+
+      if (o->reloc_count > 0)
+	o->flags |= SEC_RELOC;
+      else
+	{
+	  /* Explicitly clear the SEC_RELOC flag.  The linker tends to
+	     set it (this is probably a bug) and if it is set
+	     assign_section_numbers will create a reloc section.  */
+	  o->flags &=~ SEC_RELOC;
+	}
+
+      /* If the SEC_ALLOC flag is not set, force the section VMA to
+	 zero.  This is done in elf_fake_sections as well, but forcing
+	 the VMA to 0 here will ensure that relocs against these
+	 sections are handled correctly.  */
+      if ((o->flags & SEC_ALLOC) == 0
+	  && ! o->user_set_vma)
+	o->vma = 0;
+    }
+
+  if (! info->relocatable && merged)
+    elf_link_hash_traverse (elf_hash_table (info),
+			    _bfd_elf_link_sec_merge_syms, abfd);
+
+  /* Figure out the file positions for everything but the symbol table
+     and the relocs.  We set symcount to force assign_section_numbers
+     to create a symbol table.  */
+  bfd_get_symcount (abfd) = info->strip == strip_all ? 0 : 1;
+  BFD_ASSERT (! abfd->output_has_begun);
+  if (! _bfd_elf_compute_section_file_positions (abfd, info))
+    goto error_return;
+
+  /* That created the reloc sections.  Set their sizes, and assign
+     them file positions, and allocate some buffers.  */
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      if ((o->flags & SEC_RELOC) != 0)
+	{
+	  if (!(_bfd_elf_link_size_reloc_section
+		(abfd, &elf_section_data (o)->rel_hdr, o)))
+	    goto error_return;
+
+	  if (elf_section_data (o)->rel_hdr2
+	      && !(_bfd_elf_link_size_reloc_section
+		   (abfd, elf_section_data (o)->rel_hdr2, o)))
+	    goto error_return;
+	}
+
+      /* Now, reset REL_COUNT and REL_COUNT2 so that we can use them
+	 to count upwards while actually outputting the relocations.  */
+      elf_section_data (o)->rel_count = 0;
+      elf_section_data (o)->rel_count2 = 0;
+    }
+
+  _bfd_elf_assign_file_positions_for_relocs (abfd);
+
+  /* We have now assigned file positions for all the sections except
+     .symtab and .strtab.  We start the .symtab section at the current
+     file position, and write directly to it.  We build the .strtab
+     section in memory.  */
+  bfd_get_symcount (abfd) = 0;
+  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+  /* sh_name is set in prep_headers.  */
+  symtab_hdr->sh_type = SHT_SYMTAB;
+  /* sh_flags, sh_addr and sh_size all start off zero.  */
+  symtab_hdr->sh_entsize = bed->s->sizeof_sym;
+  /* sh_link is set in assign_section_numbers.  */
+  /* sh_info is set below.  */
+  /* sh_offset is set just below.  */
+  symtab_hdr->sh_addralign = 1 << bed->s->log_file_align;
+
+  off = elf_tdata (abfd)->next_file_pos;
+  off = _bfd_elf_assign_file_position_for_section (symtab_hdr, off, TRUE);
+
+  /* Note that at this point elf_tdata (abfd)->next_file_pos is
+     incorrect.  We do not yet know the size of the .symtab section.
+     We correct next_file_pos below, after we do know the size.  */
+
+  /* Allocate a buffer to hold swapped out symbols.  This is to avoid
+     continuously seeking to the right position in the file.  */
+  if (! info->keep_memory || max_sym_count < 20)
+    finfo.symbuf_size = 20;
+  else
+    finfo.symbuf_size = max_sym_count;
+  amt = finfo.symbuf_size;
+  amt *= bed->s->sizeof_sym;
+  finfo.symbuf = bfd_malloc (amt);
+  if (finfo.symbuf == NULL)
+    goto error_return;
+  if (elf_numsections (abfd) > SHN_LORESERVE)
+    {
+      /* Wild guess at number of output symbols.  realloc'd as needed.  */
+      amt = 2 * max_sym_count + elf_numsections (abfd) + 1000;
+      finfo.shndxbuf_size = amt;
+      amt *= sizeof (Elf_External_Sym_Shndx);
+      finfo.symshndxbuf = bfd_zmalloc (amt);
+      if (finfo.symshndxbuf == NULL)
+	goto error_return;
+    }
+
+  /* Start writing out the symbol table.  The first symbol is always a
+     dummy symbol.  */
+  if (info->strip != strip_all
+      || emit_relocs)
+    {
+      elfsym.st_value = 0;
+      elfsym.st_size = 0;
+      elfsym.st_info = 0;
+      elfsym.st_other = 0;
+      elfsym.st_shndx = SHN_UNDEF;
+      if (! elf_link_output_sym (&finfo, NULL, &elfsym, bfd_und_section_ptr,
+				 NULL))
+	goto error_return;
+    }
+
+#if 0
+  /* Some standard ELF linkers do this, but we don't because it causes
+     bootstrap comparison failures.  */
+  /* Output a file symbol for the output file as the second symbol.
+     We output this even if we are discarding local symbols, although
+     I'm not sure if this is correct.  */
+  elfsym.st_value = 0;
+  elfsym.st_size = 0;
+  elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_FILE);
+  elfsym.st_other = 0;
+  elfsym.st_shndx = SHN_ABS;
+  if (! elf_link_output_sym (&finfo, bfd_get_filename (abfd),
+			     &elfsym, bfd_abs_section_ptr, NULL))
+    goto error_return;
+#endif
+
+  /* Output a symbol for each section.  We output these even if we are
+     discarding local symbols, since they are used for relocs.  These
+     symbols have no names.  We store the index of each one in the
+     index field of the section, so that we can find it again when
+     outputting relocs.  */
+  if (info->strip != strip_all
+      || emit_relocs)
+    {
+      elfsym.st_size = 0;
+      elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
+      elfsym.st_other = 0;
+      for (i = 1; i < elf_numsections (abfd); i++)
+	{
+	  o = bfd_section_from_elf_index (abfd, i);
+	  if (o != NULL)
+	    o->target_index = bfd_get_symcount (abfd);
+	  elfsym.st_shndx = i;
+	  if (info->relocatable || o == NULL)
+	    elfsym.st_value = 0;
+	  else
+	    elfsym.st_value = o->vma;
+	  if (! elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL))
+	    goto error_return;
+	  if (i == SHN_LORESERVE - 1)
+	    i += SHN_HIRESERVE + 1 - SHN_LORESERVE;
+	}
+    }
+
+  /* Allocate some memory to hold information read in from the input
+     files.  */
+  if (max_contents_size != 0)
+    {
+      finfo.contents = bfd_malloc (max_contents_size);
+      if (finfo.contents == NULL)
+	goto error_return;
+    }
+
+  if (max_external_reloc_size != 0)
+    {
+      finfo.external_relocs = bfd_malloc (max_external_reloc_size);
+      if (finfo.external_relocs == NULL)
+	goto error_return;
+    }
+
+  if (max_internal_reloc_count != 0)
+    {
+      amt = max_internal_reloc_count * bed->s->int_rels_per_ext_rel;
+      amt *= sizeof (Elf_Internal_Rela);
+      finfo.internal_relocs = bfd_malloc (amt);
+      if (finfo.internal_relocs == NULL)
+	goto error_return;
+    }
+
+  if (max_sym_count != 0)
+    {
+      amt = max_sym_count * bed->s->sizeof_sym;
+      finfo.external_syms = bfd_malloc (amt);
+      if (finfo.external_syms == NULL)
+	goto error_return;
+
+      amt = max_sym_count * sizeof (Elf_Internal_Sym);
+      finfo.internal_syms = bfd_malloc (amt);
+      if (finfo.internal_syms == NULL)
+	goto error_return;
+
+      amt = max_sym_count * sizeof (long);
+      finfo.indices = bfd_malloc (amt);
+      if (finfo.indices == NULL)
+	goto error_return;
+
+      amt = max_sym_count * sizeof (asection *);
+      finfo.sections = bfd_malloc (amt);
+      if (finfo.sections == NULL)
+	goto error_return;
+    }
+
+  if (max_sym_shndx_count != 0)
+    {
+      amt = max_sym_shndx_count * sizeof (Elf_External_Sym_Shndx);
+      finfo.locsym_shndx = bfd_malloc (amt);
+      if (finfo.locsym_shndx == NULL)
+	goto error_return;
+    }
+
+  if (elf_hash_table (info)->tls_sec)
+    {
+      bfd_vma base, end = 0;
+      asection *sec;
+
+      for (sec = elf_hash_table (info)->tls_sec;
+	   sec && (sec->flags & SEC_THREAD_LOCAL);
+	   sec = sec->next)
+	{
+	  bfd_vma size = sec->size;
+
+	  if (size == 0 && (sec->flags & SEC_HAS_CONTENTS) == 0)
+	    {
+	      struct bfd_link_order *o;
+
+	      for (o = sec->link_order_head; o != NULL; o = o->next)
+		if (size < o->offset + o->size)
+		  size = o->offset + o->size;
+	    }
+	  end = sec->vma + size;
+	}
+      base = elf_hash_table (info)->tls_sec->vma;
+      end = align_power (end, elf_hash_table (info)->tls_sec->alignment_power);
+      elf_hash_table (info)->tls_size = end - base;
+    }
+
+  /* Since ELF permits relocations to be against local symbols, we
+     must have the local symbols available when we do the relocations.
+     Since we would rather only read the local symbols once, and we
+     would rather not keep them in memory, we handle all the
+     relocations for a single input file at the same time.
+
+     Unfortunately, there is no way to know the total number of local
+     symbols until we have seen all of them, and the local symbol
+     indices precede the global symbol indices.  This means that when
+     we are generating relocatable output, and we see a reloc against
+     a global symbol, we can not know the symbol index until we have
+     finished examining all the local symbols to see which ones we are
+     going to output.  To deal with this, we keep the relocations in
+     memory, and don't output them until the end of the link.  This is
+     an unfortunate waste of memory, but I don't see a good way around
+     it.  Fortunately, it only happens when performing a relocatable
+     link, which is not the common case.  FIXME: If keep_memory is set
+     we could write the relocs out and then read them again; I don't
+     know how bad the memory loss will be.  */
+
+  for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+    sub->output_has_begun = FALSE;
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      for (p = o->link_order_head; p != NULL; p = p->next)
+	{
+	  if (p->type == bfd_indirect_link_order
+	      && (bfd_get_flavour ((sub = p->u.indirect.section->owner))
+		  == bfd_target_elf_flavour)
+	      && elf_elfheader (sub)->e_ident[EI_CLASS] == bed->s->elfclass)
+	    {
+	      if (! sub->output_has_begun)
+		{
+		  if (! elf_link_input_bfd (&finfo, sub))
+		    goto error_return;
+		  sub->output_has_begun = TRUE;
+		}
+	    }
+	  else if (p->type == bfd_section_reloc_link_order
+		   || p->type == bfd_symbol_reloc_link_order)
+	    {
+	      if (! elf_reloc_link_order (abfd, info, o, p))
+		goto error_return;
+	    }
+	  else
+	    {
+	      if (! _bfd_default_link_order (abfd, info, o, p))
+		goto error_return;
+	    }
+	}
+    }
+
+  /* Output any global symbols that got converted to local in a
+     version script or due to symbol visibility.  We do this in a
+     separate step since ELF requires all local symbols to appear
+     prior to any global symbols.  FIXME: We should only do this if
+     some global symbols were, in fact, converted to become local.
+     FIXME: Will this work correctly with the Irix 5 linker?  */
+  eoinfo.failed = FALSE;
+  eoinfo.finfo = &finfo;
+  eoinfo.localsyms = TRUE;
+  elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym,
+			  &eoinfo);
+  if (eoinfo.failed)
+    return FALSE;
+
+  /* That wrote out all the local symbols.  Finish up the symbol table
+     with the global symbols. Even if we want to strip everything we
+     can, we still need to deal with those global symbols that got
+     converted to local in a version script.  */
+
+  /* The sh_info field records the index of the first non local symbol.  */
+  symtab_hdr->sh_info = bfd_get_symcount (abfd);
+
+  if (dynamic
+      && finfo.dynsym_sec->output_section != bfd_abs_section_ptr)
+    {
+      Elf_Internal_Sym sym;
+      bfd_byte *dynsym = finfo.dynsym_sec->contents;
+      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;
+	      bfd_byte *dest;
+	      long dynindx;
+
+	      dynindx = elf_section_data (s)->dynindx;
+	      if (dynindx <= 0)
+		continue;
+	      indx = elf_section_data (s)->this_idx;
+	      BFD_ASSERT (indx > 0);
+	      sym.st_shndx = indx;
+	      sym.st_value = s->vma;
+	      dest = dynsym + dynindx * bed->s->sizeof_sym;
+	      if (last_local < dynindx)
+		last_local = dynindx;
+	      bed->s->swap_symbol_out (abfd, &sym, dest, 0);
+	    }
+	}
+
+      /* 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;
+	      bfd_byte *dest;
+
+	      sym.st_size = e->isym.st_size;
+	      sym.st_other = e->isym.st_other;
+
+	      /* Copy the internal symbol as is.
+		 Note that we saved a word of storage and overwrote
+		 the original st_name with the dynstr_index.  */
+	      sym = e->isym;
+
+	      if (e->isym.st_shndx != SHN_UNDEF
+		  && (e->isym.st_shndx < SHN_LORESERVE
+		      || e->isym.st_shndx > SHN_HIRESERVE))
+		{
+		  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;
+
+	      dest = dynsym + e->dynindx * bed->s->sizeof_sym;
+	      bed->s->swap_symbol_out (abfd, &sym, dest, 0);
+	    }
+	}
+
+      elf_section_data (finfo.dynsym_sec->output_section)->this_hdr.sh_info =
+	last_local + 1;
+    }
+
+  /* We get the global symbols from the hash table.  */
+  eoinfo.failed = FALSE;
+  eoinfo.localsyms = FALSE;
+  eoinfo.finfo = &finfo;
+  elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym,
+			  &eoinfo);
+  if (eoinfo.failed)
+    return FALSE;
+
+  /* If backend needs to output some symbols not present in the hash
+     table, do it now.  */
+  if (bed->elf_backend_output_arch_syms)
+    {
+      typedef bfd_boolean (*out_sym_func)
+	(void *, const char *, Elf_Internal_Sym *, asection *,
+	 struct elf_link_hash_entry *);
+
+      if (! ((*bed->elf_backend_output_arch_syms)
+	     (abfd, info, &finfo, (out_sym_func) elf_link_output_sym)))
+	return FALSE;
+    }
+
+  /* Flush all symbols to the file.  */
+  if (! elf_link_flush_output_syms (&finfo, bed))
+    return FALSE;
+
+  /* Now we know the size of the symtab section.  */
+  off += symtab_hdr->sh_size;
+
+  symtab_shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
+  if (symtab_shndx_hdr->sh_name != 0)
+    {
+      symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX;
+      symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx);
+      symtab_shndx_hdr->sh_addralign = sizeof (Elf_External_Sym_Shndx);
+      amt = bfd_get_symcount (abfd) * sizeof (Elf_External_Sym_Shndx);
+      symtab_shndx_hdr->sh_size = amt;
+
+      off = _bfd_elf_assign_file_position_for_section (symtab_shndx_hdr,
+						       off, TRUE);
+
+      if (bfd_seek (abfd, symtab_shndx_hdr->sh_offset, SEEK_SET) != 0
+	  || (bfd_bwrite (finfo.symshndxbuf, amt, abfd) != amt))
+	return FALSE;
+    }
+
+
+  /* Finish up and write out the symbol string table (.strtab)
+     section.  */
+  symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr;
+  /* sh_name was set in prep_headers.  */
+  symstrtab_hdr->sh_type = SHT_STRTAB;
+  symstrtab_hdr->sh_flags = 0;
+  symstrtab_hdr->sh_addr = 0;
+  symstrtab_hdr->sh_size = _bfd_stringtab_size (finfo.symstrtab);
+  symstrtab_hdr->sh_entsize = 0;
+  symstrtab_hdr->sh_link = 0;
+  symstrtab_hdr->sh_info = 0;
+  /* sh_offset is set just below.  */
+  symstrtab_hdr->sh_addralign = 1;
+
+  off = _bfd_elf_assign_file_position_for_section (symstrtab_hdr, off, TRUE);
+  elf_tdata (abfd)->next_file_pos = off;
+
+  if (bfd_get_symcount (abfd) > 0)
+    {
+      if (bfd_seek (abfd, symstrtab_hdr->sh_offset, SEEK_SET) != 0
+	  || ! _bfd_stringtab_emit (abfd, finfo.symstrtab))
+	return FALSE;
+    }
+
+  /* Adjust the relocs to have the correct symbol indices.  */
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      if ((o->flags & SEC_RELOC) == 0)
+	continue;
+
+      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.  */
+      o->reloc_count = 0;
+    }
+
+  if (dynamic && info->combreloc && dynobj != NULL)
+    relativecount = elf_link_sort_relocs (abfd, info, &reldyn);
+
+  /* If we are linking against a dynamic object, or generating a
+     shared library, finish up the dynamic linking information.  */
+  if (dynamic)
+    {
+      bfd_byte *dyncon, *dynconend;
+
+      /* Fix up .dynamic entries.  */
+      o = bfd_get_section_by_name (dynobj, ".dynamic");
+      BFD_ASSERT (o != NULL);
+
+      dyncon = o->contents;
+      dynconend = o->contents + o->size;
+      for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
+	{
+	  Elf_Internal_Dyn dyn;
+	  const char *name;
+	  unsigned int type;
+
+	  bed->s->swap_dyn_in (dynobj, dyncon, &dyn);
+
+	  switch (dyn.d_tag)
+	    {
+	    default:
+	      continue;
+	    case DT_NULL:
+	      if (relativecount > 0 && dyncon + bed->s->sizeof_dyn < dynconend)
+		{
+		  switch (elf_section_data (reldyn)->this_hdr.sh_type)
+		    {
+		    case SHT_REL: dyn.d_tag = DT_RELCOUNT; break;
+		    case SHT_RELA: dyn.d_tag = DT_RELACOUNT; break;
+		    default: continue;
+		    }
+		  dyn.d_un.d_val = relativecount;
+		  relativecount = 0;
+		  break;
+		}
+	      continue;
+
+	    case DT_INIT:
+	      name = info->init_function;
+	      goto get_sym;
+	    case DT_FINI:
+	      name = info->fini_function;
+	    get_sym:
+	      {
+		struct elf_link_hash_entry *h;
+
+		h = elf_link_hash_lookup (elf_hash_table (info), name,
+					  FALSE, FALSE, TRUE);
+		if (h != NULL
+		    && (h->root.type == bfd_link_hash_defined
+			|| h->root.type == bfd_link_hash_defweak))
+		  {
+		    dyn.d_un.d_val = h->root.u.def.value;
+		    o = h->root.u.def.section;
+		    if (o->output_section != NULL)
+		      dyn.d_un.d_val += (o->output_section->vma
+					 + o->output_offset);
+		    else
+		      {
+			/* The symbol is imported from another shared
+			   library and does not apply to this one.  */
+			dyn.d_un.d_val = 0;
+		      }
+		    break;
+		  }
+	      }
+	      continue;
+
+	    case DT_PREINIT_ARRAYSZ:
+	      name = ".preinit_array";
+	      goto get_size;
+	    case DT_INIT_ARRAYSZ:
+	      name = ".init_array";
+	      goto get_size;
+	    case DT_FINI_ARRAYSZ:
+	      name = ".fini_array";
+	    get_size:
+	      o = bfd_get_section_by_name (abfd, name);
+	      if (o == NULL)
+		{
+		  (*_bfd_error_handler)
+		    (_("%s: could not find output section %s"),
+		     bfd_get_filename (abfd), name);
+		  goto error_return;
+		}
+	      if (o->size == 0)
+		(*_bfd_error_handler)
+		  (_("warning: %s section has zero size"), name);
+	      dyn.d_un.d_val = o->size;
+	      break;
+
+	    case DT_PREINIT_ARRAY:
+	      name = ".preinit_array";
+	      goto get_vma;
+	    case DT_INIT_ARRAY:
+	      name = ".init_array";
+	      goto get_vma;
+	    case DT_FINI_ARRAY:
+	      name = ".fini_array";
+	      goto get_vma;
+
+	    case DT_HASH:
+	      name = ".hash";
+	      goto get_vma;
+	    case DT_STRTAB:
+	      name = ".dynstr";
+	      goto get_vma;
+	    case DT_SYMTAB:
+	      name = ".dynsym";
+	      goto get_vma;
+	    case DT_VERDEF:
+	      name = ".gnu.version_d";
+	      goto get_vma;
+	    case DT_VERNEED:
+	      name = ".gnu.version_r";
+	      goto get_vma;
+	    case DT_VERSYM:
+	      name = ".gnu.version";
+	    get_vma:
+	      o = bfd_get_section_by_name (abfd, name);
+	      if (o == NULL)
+		{
+		  (*_bfd_error_handler)
+		    (_("%s: could not find output section %s"),
+		     bfd_get_filename (abfd), name);
+		  goto error_return;
+		}
+	      dyn.d_un.d_ptr = o->vma;
+	      break;
+
+	    case DT_REL:
+	    case DT_RELA:
+	    case DT_RELSZ:
+	    case DT_RELASZ:
+	      if (dyn.d_tag == DT_REL || dyn.d_tag == DT_RELSZ)
+		type = SHT_REL;
+	      else
+		type = SHT_RELA;
+	      dyn.d_un.d_val = 0;
+	      for (i = 1; i < elf_numsections (abfd); i++)
+		{
+		  Elf_Internal_Shdr *hdr;
+
+		  hdr = elf_elfsections (abfd)[i];
+		  if (hdr->sh_type == type
+		      && (hdr->sh_flags & SHF_ALLOC) != 0)
+		    {
+		      if (dyn.d_tag == DT_RELSZ || dyn.d_tag == DT_RELASZ)
+			dyn.d_un.d_val += hdr->sh_size;
+		      else
+			{
+			  if (dyn.d_un.d_val == 0
+			      || hdr->sh_addr < dyn.d_un.d_val)
+			    dyn.d_un.d_val = hdr->sh_addr;
+			}
+		    }
+		}
+	      break;
+	    }
+	  bed->s->swap_dyn_out (dynobj, &dyn, dyncon);
+	}
+    }
+
+  /* If we have created any dynamic sections, then output them.  */
+  if (dynobj != NULL)
+    {
+      if (! (*bed->elf_backend_finish_dynamic_sections) (abfd, info))
+	goto error_return;
+
+      for (o = dynobj->sections; o != NULL; o = o->next)
+	{
+	  if ((o->flags & SEC_HAS_CONTENTS) == 0
+	      || o->size == 0
+	      || o->output_section == bfd_abs_section_ptr)
+	    continue;
+	  if ((o->flags & SEC_LINKER_CREATED) == 0)
+	    {
+	      /* At this point, we are only interested in sections
+		 created by _bfd_elf_link_create_dynamic_sections.  */
+	      continue;
+	    }
+	  if (elf_hash_table (info)->stab_info.stabstr == o)
+	    continue;
+	  if (elf_hash_table (info)->eh_info.hdr_sec == o)
+	    continue;
+	  if ((elf_section_data (o->output_section)->this_hdr.sh_type
+	       != SHT_STRTAB)
+	      || strcmp (bfd_get_section_name (abfd, o), ".dynstr") != 0)
+	    {
+	      if (! bfd_set_section_contents (abfd, o->output_section,
+					      o->contents,
+					      (file_ptr) o->output_offset,
+					      o->size))
+		goto error_return;
+	    }
+	  else
+	    {
+	      /* The contents of the .dynstr section are actually in a
+		 stringtab.  */
+	      off = elf_section_data (o->output_section)->this_hdr.sh_offset;
+	      if (bfd_seek (abfd, off, SEEK_SET) != 0
+		  || ! _bfd_elf_strtab_emit (abfd,
+					     elf_hash_table (info)->dynstr))
+		goto error_return;
+	    }
+	}
+    }
+
+  if (info->relocatable)
+    {
+      bfd_boolean failed = FALSE;
+
+      bfd_map_over_sections (abfd, bfd_elf_set_group_contents, &failed);
+      if (failed)
+	goto error_return;
+    }
+
+  /* If we have optimized stabs strings, output them.  */
+  if (elf_hash_table (info)->stab_info.stabstr != NULL)
+    {
+      if (! _bfd_write_stab_strings (abfd, &elf_hash_table (info)->stab_info))
+	goto error_return;
+    }
+
+  if (info->eh_frame_hdr)
+    {
+      if (! _bfd_elf_write_section_eh_frame_hdr (abfd, info))
+	goto error_return;
+    }
+
+  if (finfo.symstrtab != NULL)
+    _bfd_stringtab_free (finfo.symstrtab);
+  if (finfo.contents != NULL)
+    free (finfo.contents);
+  if (finfo.external_relocs != NULL)
+    free (finfo.external_relocs);
+  if (finfo.internal_relocs != NULL)
+    free (finfo.internal_relocs);
+  if (finfo.external_syms != NULL)
+    free (finfo.external_syms);
+  if (finfo.locsym_shndx != NULL)
+    free (finfo.locsym_shndx);
+  if (finfo.internal_syms != NULL)
+    free (finfo.internal_syms);
+  if (finfo.indices != NULL)
+    free (finfo.indices);
+  if (finfo.sections != NULL)
+    free (finfo.sections);
+  if (finfo.symbuf != NULL)
+    free (finfo.symbuf);
+  if (finfo.symshndxbuf != NULL)
+    free (finfo.symshndxbuf);
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      if ((o->flags & SEC_RELOC) != 0
+	  && elf_section_data (o)->rel_hashes != NULL)
+	free (elf_section_data (o)->rel_hashes);
+    }
+
+  elf_tdata (abfd)->linker = TRUE;
+
+  return TRUE;
+
+ error_return:
+  if (finfo.symstrtab != NULL)
+    _bfd_stringtab_free (finfo.symstrtab);
+  if (finfo.contents != NULL)
+    free (finfo.contents);
+  if (finfo.external_relocs != NULL)
+    free (finfo.external_relocs);
+  if (finfo.internal_relocs != NULL)
+    free (finfo.internal_relocs);
+  if (finfo.external_syms != NULL)
+    free (finfo.external_syms);
+  if (finfo.locsym_shndx != NULL)
+    free (finfo.locsym_shndx);
+  if (finfo.internal_syms != NULL)
+    free (finfo.internal_syms);
+  if (finfo.indices != NULL)
+    free (finfo.indices);
+  if (finfo.sections != NULL)
+    free (finfo.sections);
+  if (finfo.symbuf != NULL)
+    free (finfo.symbuf);
+  if (finfo.symshndxbuf != NULL)
+    free (finfo.symshndxbuf);
+  for (o = abfd->sections; o != NULL; o = o->next)
+    {
+      if ((o->flags & SEC_RELOC) != 0
+	  && elf_section_data (o)->rel_hashes != NULL)
+	free (elf_section_data (o)->rel_hashes);
+    }
+
+  return FALSE;
+}
+
+/* Garbage collect unused sections.  */
+
+/* The mark phase of garbage collection.  For a given section, mark
+   it and any sections in this section's group, and all the sections
+   which define symbols to which it refers.  */
+
+typedef asection * (*gc_mark_hook_fn)
+  (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
+   struct elf_link_hash_entry *, Elf_Internal_Sym *);
+
+static bfd_boolean
+elf_gc_mark (struct bfd_link_info *info,
+	     asection *sec,
+	     gc_mark_hook_fn gc_mark_hook)
+{
+  bfd_boolean ret;
+  asection *group_sec;
+
+  sec->gc_mark = 1;
+
+  /* Mark all the sections in the group.  */
+  group_sec = elf_section_data (sec)->next_in_group;
+  if (group_sec && !group_sec->gc_mark)
+    if (!elf_gc_mark (info, group_sec, gc_mark_hook))
+      return FALSE;
+
+  /* Look through the section relocs.  */
+  ret = TRUE;
+  if ((sec->flags & SEC_RELOC) != 0 && sec->reloc_count > 0)
+    {
+      Elf_Internal_Rela *relstart, *rel, *relend;
+      Elf_Internal_Shdr *symtab_hdr;
+      struct elf_link_hash_entry **sym_hashes;
+      size_t nlocsyms;
+      size_t extsymoff;
+      bfd *input_bfd = sec->owner;
+      const struct elf_backend_data *bed = get_elf_backend_data (input_bfd);
+      Elf_Internal_Sym *isym = NULL;
+      int r_sym_shift;
+
+      symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
+      sym_hashes = elf_sym_hashes (input_bfd);
+
+      /* Read the local symbols.  */
+      if (elf_bad_symtab (input_bfd))
+	{
+	  nlocsyms = symtab_hdr->sh_size / bed->s->sizeof_sym;
+	  extsymoff = 0;
+	}
+      else
+	extsymoff = nlocsyms = symtab_hdr->sh_info;
+
+      isym = (Elf_Internal_Sym *) symtab_hdr->contents;
+      if (isym == NULL && nlocsyms != 0)
+	{
+	  isym = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, nlocsyms, 0,
+				       NULL, NULL, NULL);
+	  if (isym == NULL)
+	    return FALSE;
+	}
+
+      /* Read the relocations.  */
+      relstart = _bfd_elf_link_read_relocs (input_bfd, sec, NULL, NULL,
+					    info->keep_memory);
+      if (relstart == NULL)
+	{
+	  ret = FALSE;
+	  goto out1;
+	}
+      relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel;
+
+      if (bed->s->arch_size == 32)
+	r_sym_shift = 8;
+      else
+	r_sym_shift = 32;
+
+      for (rel = relstart; rel < relend; rel++)
+	{
+	  unsigned long r_symndx;
+	  asection *rsec;
+	  struct elf_link_hash_entry *h;
+
+	  r_symndx = rel->r_info >> r_sym_shift;
+	  if (r_symndx == 0)
+	    continue;
+
+	  if (r_symndx >= nlocsyms
+	      || ELF_ST_BIND (isym[r_symndx].st_info) != STB_LOCAL)
+	    {
+	      h = sym_hashes[r_symndx - extsymoff];
+	      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;
+	      rsec = (*gc_mark_hook) (sec, info, rel, h, NULL);
+	    }
+	  else
+	    {
+	      rsec = (*gc_mark_hook) (sec, info, rel, NULL, &isym[r_symndx]);
+	    }
+
+	  if (rsec && !rsec->gc_mark)
+	    {
+	      if (bfd_get_flavour (rsec->owner) != bfd_target_elf_flavour)
+		rsec->gc_mark = 1;
+	      else if (!elf_gc_mark (info, rsec, gc_mark_hook))
+		{
+		  ret = FALSE;
+		  goto out2;
+		}
+	    }
+	}
+
+    out2:
+      if (elf_section_data (sec)->relocs != relstart)
+	free (relstart);
+    out1:
+      if (isym != NULL && symtab_hdr->contents != (unsigned char *) isym)
+	{
+	  if (! info->keep_memory)
+	    free (isym);
+	  else
+	    symtab_hdr->contents = (unsigned char *) isym;
+	}
+    }
+
+  return ret;
+}
+
+/* Sweep symbols in swept sections.  Called via elf_link_hash_traverse.  */
+
+static bfd_boolean
+elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *idxptr)
+{
+  int *idx = idxptr;
+
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+  if (h->dynindx != -1
+      && ((h->root.type != bfd_link_hash_defined
+	   && h->root.type != bfd_link_hash_defweak)
+	  || h->root.u.def.section->gc_mark))
+    h->dynindx = (*idx)++;
+
+  return TRUE;
+}
+
+/* The sweep phase of garbage collection.  Remove all garbage sections.  */
+
+typedef bfd_boolean (*gc_sweep_hook_fn)
+  (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
+
+static bfd_boolean
+elf_gc_sweep (struct bfd_link_info *info, gc_sweep_hook_fn gc_sweep_hook)
+{
+  bfd *sub;
+
+  for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+    {
+      asection *o;
+
+      if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
+	continue;
+
+      for (o = sub->sections; o != NULL; o = o->next)
+	{
+	  /* Keep special sections.  Keep .debug sections.  */
+	  if ((o->flags & SEC_LINKER_CREATED)
+	      || (o->flags & SEC_DEBUGGING))
+	    o->gc_mark = 1;
+
+	  if (o->gc_mark)
+	    continue;
+
+	  /* Skip sweeping sections already excluded.  */
+	  if (o->flags & SEC_EXCLUDE)
+	    continue;
+
+	  /* Since this is early in the link process, it is simple
+	     to remove a section from the output.  */
+	  o->flags |= SEC_EXCLUDE;
+
+	  /* But we also have to update some of the relocation
+	     info we collected before.  */
+	  if (gc_sweep_hook
+	      && (o->flags & SEC_RELOC) && o->reloc_count > 0)
+	    {
+	      Elf_Internal_Rela *internal_relocs;
+	      bfd_boolean r;
+
+	      internal_relocs
+		= _bfd_elf_link_read_relocs (o->owner, o, NULL, NULL,
+					     info->keep_memory);
+	      if (internal_relocs == NULL)
+		return FALSE;
+
+	      r = (*gc_sweep_hook) (o->owner, info, o, internal_relocs);
+
+	      if (elf_section_data (o)->relocs != internal_relocs)
+		free (internal_relocs);
+
+	      if (!r)
+		return FALSE;
+	    }
+	}
+    }
+
+  /* Remove the symbols that were in the swept sections from the dynamic
+     symbol table.  GCFIXME: Anyone know how to get them out of the
+     static symbol table as well?  */
+  {
+    int i = 0;
+
+    elf_link_hash_traverse (elf_hash_table (info), elf_gc_sweep_symbol, &i);
+
+    elf_hash_table (info)->dynsymcount = i;
+  }
+
+  return TRUE;
+}
+
+/* Propagate collected vtable information.  This is called through
+   elf_link_hash_traverse.  */
+
+static bfd_boolean
+elf_gc_propagate_vtable_entries_used (struct elf_link_hash_entry *h, void *okp)
+{
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+  /* Those that are not vtables.  */
+  if (h->vtable_parent == NULL)
+    return TRUE;
+
+  /* Those vtables that do not have parents, we cannot merge.  */
+  if (h->vtable_parent == (struct elf_link_hash_entry *) -1)
+    return TRUE;
+
+  /* If we've already been done, exit.  */
+  if (h->vtable_entries_used && h->vtable_entries_used[-1])
+    return TRUE;
+
+  /* Make sure the parent's table is up to date.  */
+  elf_gc_propagate_vtable_entries_used (h->vtable_parent, okp);
+
+  if (h->vtable_entries_used == NULL)
+    {
+      /* None of this table's entries were referenced.  Re-use the
+	 parent's table.  */
+      h->vtable_entries_used = h->vtable_parent->vtable_entries_used;
+      h->vtable_entries_size = h->vtable_parent->vtable_entries_size;
+    }
+  else
+    {
+      size_t n;
+      bfd_boolean *cu, *pu;
+
+      /* Or the parent's entries into ours.  */
+      cu = h->vtable_entries_used;
+      cu[-1] = TRUE;
+      pu = h->vtable_parent->vtable_entries_used;
+      if (pu != NULL)
+	{
+	  const struct elf_backend_data *bed;
+	  unsigned int log_file_align;
+
+	  bed = get_elf_backend_data (h->root.u.def.section->owner);
+	  log_file_align = bed->s->log_file_align;
+	  n = h->vtable_parent->vtable_entries_size >> log_file_align;
+	  while (n--)
+	    {
+	      if (*pu)
+		*cu = TRUE;
+	      pu++;
+	      cu++;
+	    }
+	}
+    }
+
+  return TRUE;
+}
+
+static bfd_boolean
+elf_gc_smash_unused_vtentry_relocs (struct elf_link_hash_entry *h, void *okp)
+{
+  asection *sec;
+  bfd_vma hstart, hend;
+  Elf_Internal_Rela *relstart, *relend, *rel;
+  const struct elf_backend_data *bed;
+  unsigned int log_file_align;
+
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+  /* Take care of both those symbols that do not describe vtables as
+     well as those that are not loaded.  */
+  if (h->vtable_parent == NULL)
+    return TRUE;
+
+  BFD_ASSERT (h->root.type == bfd_link_hash_defined
+	      || h->root.type == bfd_link_hash_defweak);
+
+  sec = h->root.u.def.section;
+  hstart = h->root.u.def.value;
+  hend = hstart + h->size;
+
+  relstart = _bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL, TRUE);
+  if (!relstart)
+    return *(bfd_boolean *) okp = FALSE;
+  bed = get_elf_backend_data (sec->owner);
+  log_file_align = bed->s->log_file_align;
+
+  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)
+      {
+	/* If the entry is in use, do nothing.  */
+	if (h->vtable_entries_used
+	    && (rel->r_offset - hstart) < h->vtable_entries_size)
+	  {
+	    bfd_vma entry = (rel->r_offset - hstart) >> log_file_align;
+	    if (h->vtable_entries_used[entry])
+	      continue;
+	  }
+	/* Otherwise, kill it.  */
+	rel->r_offset = rel->r_info = rel->r_addend = 0;
+      }
+
+  return TRUE;
+}
+
+/* Mark sections containing dynamically referenced symbols.  This is called
+   through elf_link_hash_traverse.  */
+
+static bfd_boolean
+elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h,
+				void *okp ATTRIBUTE_UNUSED)
+{
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+  if ((h->root.type == bfd_link_hash_defined
+       || h->root.type == bfd_link_hash_defweak)
+      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC))
+    h->root.u.def.section->flags |= SEC_KEEP;
+
+  return TRUE;
+}
+
+/* Do mark and sweep of unused sections.  */
+
+bfd_boolean
+bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
+{
+  bfd_boolean ok = TRUE;
+  bfd *sub;
+  asection * (*gc_mark_hook)
+    (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
+     struct elf_link_hash_entry *h, Elf_Internal_Sym *);
+
+  if (!get_elf_backend_data (abfd)->can_gc_sections
+      || info->relocatable
+      || info->emitrelocations
+      || info->shared
+      || !is_elf_hash_table (info->hash))
+    {
+      (*_bfd_error_handler)(_("Warning: gc-sections option ignored"));
+      return TRUE;
+    }
+
+  /* Apply transitive closure to the vtable entry usage info.  */
+  elf_link_hash_traverse (elf_hash_table (info),
+			  elf_gc_propagate_vtable_entries_used,
+			  &ok);
+  if (!ok)
+    return FALSE;
+
+  /* Kill the vtable relocations that were not used.  */
+  elf_link_hash_traverse (elf_hash_table (info),
+			  elf_gc_smash_unused_vtentry_relocs,
+			  &ok);
+  if (!ok)
+    return FALSE;
+
+  /* Mark dynamically referenced symbols.  */
+  if (elf_hash_table (info)->dynamic_sections_created)
+    elf_link_hash_traverse (elf_hash_table (info),
+			    elf_gc_mark_dynamic_ref_symbol,
+			    &ok);
+  if (!ok)
+    return FALSE;
+
+  /* Grovel through relocs to find out who stays ...  */
+  gc_mark_hook = get_elf_backend_data (abfd)->gc_mark_hook;
+  for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+    {
+      asection *o;
+
+      if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
+	continue;
+
+      for (o = sub->sections; o != NULL; o = o->next)
+	{
+	  if (o->flags & SEC_KEEP)
+	    {
+	      /* _bfd_elf_discard_section_eh_frame knows how to discard
+		 orphaned FDEs so don't mark sections referenced by the
+		 EH frame section.  */  
+	      if (strcmp (o->name, ".eh_frame") == 0)
+		o->gc_mark = 1;
+	      else if (!elf_gc_mark (info, o, gc_mark_hook))
+		return FALSE;
+	    }
+	}
+    }
+
+  /* ... and mark SEC_EXCLUDE for those that go.  */
+  if (!elf_gc_sweep (info, get_elf_backend_data (abfd)->gc_sweep_hook))
+    return FALSE;
+
+  return TRUE;
+}
+
+/* Called from check_relocs to record the existence of a VTINHERIT reloc.  */
+
+bfd_boolean
+bfd_elf_gc_record_vtinherit (bfd *abfd,
+			     asection *sec,
+			     struct elf_link_hash_entry *h,
+			     bfd_vma offset)
+{
+  struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
+  struct elf_link_hash_entry **search, *child;
+  bfd_size_type extsymcount;
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  char *sec_name;
+
+  /* The sh_info field of the symtab header tells us where the
+     external symbols start.  We don't care about the local symbols at
+     this point.  */
+  extsymcount = elf_tdata (abfd)->symtab_hdr.sh_size / bed->s->sizeof_sym;
+  if (!elf_bad_symtab (abfd))
+    extsymcount -= elf_tdata (abfd)->symtab_hdr.sh_info;
+
+  sym_hashes = elf_sym_hashes (abfd);
+  sym_hashes_end = sym_hashes + extsymcount;
+
+  /* Hunt down the child symbol, which is in this section at the same
+     offset as the relocation.  */
+  for (search = sym_hashes; search != sym_hashes_end; ++search)
+    {
+      if ((child = *search) != NULL
+	  && (child->root.type == bfd_link_hash_defined
+	      || child->root.type == bfd_link_hash_defweak)
+	  && child->root.u.def.section == sec
+	  && child->root.u.def.value == offset)
+	goto win;
+    }
+
+  sec_name = bfd_get_section_ident (sec);
+  (*_bfd_error_handler) ("%s: %s+%lu: No symbol found for INHERIT",
+			 bfd_archive_filename (abfd),
+			 sec_name ? sec_name : sec->name,
+			 (unsigned long) offset);
+  bfd_set_error (bfd_error_invalid_operation);
+  return FALSE;
+
+ win:
+  if (!h)
+    {
+      /* This *should* only be the absolute section.  It could potentially
+	 be that someone has defined a non-global vtable though, which
+	 would be bad.  It isn't worth paging in the local symbols to be
+	 sure though; that case should simply be handled by the assembler.  */
+
+      child->vtable_parent = (struct elf_link_hash_entry *) -1;
+    }
+  else
+    child->vtable_parent = h;
+
+  return TRUE;
+}
+
+/* Called from check_relocs to record the existence of a VTENTRY reloc.  */
+
+bfd_boolean
+bfd_elf_gc_record_vtentry (bfd *abfd ATTRIBUTE_UNUSED,
+			   asection *sec ATTRIBUTE_UNUSED,
+			   struct elf_link_hash_entry *h,
+			   bfd_vma addend)
+{
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  unsigned int log_file_align = bed->s->log_file_align;
+
+  if (addend >= h->vtable_entries_size)
+    {
+      size_t size, bytes, file_align;
+      bfd_boolean *ptr = h->vtable_entries_used;
+
+      /* While the symbol is undefined, we have to be prepared to handle
+	 a zero size.  */
+      file_align = 1 << log_file_align;
+      if (h->root.type == bfd_link_hash_undefined)
+	size = addend + file_align;
+      else
+	{
+	  size = h->size;
+	  if (addend >= size)
+	    {
+	      /* Oops!  We've got a reference past the defined end of
+		 the table.  This is probably a bug -- shall we warn?  */
+	      size = addend + file_align;
+	    }
+	}
+      size = (size + file_align - 1) & -file_align;
+
+      /* Allocate one extra entry for use as a "done" flag for the
+	 consolidation pass.  */
+      bytes = ((size >> log_file_align) + 1) * sizeof (bfd_boolean);
+
+      if (ptr)
+	{
+	  ptr = bfd_realloc (ptr - 1, bytes);
+
+	  if (ptr != NULL)
+	    {
+	      size_t oldbytes;
+
+	      oldbytes = (((h->vtable_entries_size >> log_file_align) + 1)
+			  * sizeof (bfd_boolean));
+	      memset (((char *) ptr) + oldbytes, 0, bytes - oldbytes);
+	    }
+	}
+      else
+	ptr = bfd_zmalloc (bytes);
+
+      if (ptr == NULL)
+	return FALSE;
+
+      /* And arrange for that done flag to be at index -1.  */
+      h->vtable_entries_used = ptr + 1;
+      h->vtable_entries_size = size;
+    }
+
+  h->vtable_entries_used[addend >> log_file_align] = TRUE;
+
+  return TRUE;
+}
+
+struct alloc_got_off_arg {
+  bfd_vma gotoff;
+  unsigned int got_elt_size;
+};
+
+/* We need a special top-level link routine to convert got reference counts
+   to real got offsets.  */
+
+static bfd_boolean
+elf_gc_allocate_got_offsets (struct elf_link_hash_entry *h, void *arg)
+{
+  struct alloc_got_off_arg *gofarg = arg;
+
+  if (h->root.type == bfd_link_hash_warning)
+    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+  if (h->got.refcount > 0)
+    {
+      h->got.offset = gofarg->gotoff;
+      gofarg->gotoff += gofarg->got_elt_size;
+    }
+  else
+    h->got.offset = (bfd_vma) -1;
+
+  return TRUE;
+}
+
+/* And an accompanying bit to work out final got entry offsets once
+   we're done.  Should be called from final_link.  */
+
+bfd_boolean
+bfd_elf_gc_common_finalize_got_offsets (bfd *abfd,
+					struct bfd_link_info *info)
+{
+  bfd *i;
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  bfd_vma gotoff;
+  unsigned int got_elt_size = bed->s->arch_size / 8;
+  struct alloc_got_off_arg gofarg;
+
+  if (! is_elf_hash_table (info->hash))
+    return FALSE;
+
+  /* The GOT offset is relative to the .got section, but the GOT header is
+     put into the .got.plt section, if the backend uses it.  */
+  if (bed->want_got_plt)
+    gotoff = 0;
+  else
+    gotoff = bed->got_header_size;
+
+  /* Do the local .got entries first.  */
+  for (i = info->input_bfds; i; i = i->link_next)
+    {
+      bfd_signed_vma *local_got;
+      bfd_size_type j, locsymcount;
+      Elf_Internal_Shdr *symtab_hdr;
+
+      if (bfd_get_flavour (i) != bfd_target_elf_flavour)
+	continue;
+
+      local_got = elf_local_got_refcounts (i);
+      if (!local_got)
+	continue;
+
+      symtab_hdr = &elf_tdata (i)->symtab_hdr;
+      if (elf_bad_symtab (i))
+	locsymcount = symtab_hdr->sh_size / bed->s->sizeof_sym;
+      else
+	locsymcount = symtab_hdr->sh_info;
+
+      for (j = 0; j < locsymcount; ++j)
+	{
+	  if (local_got[j] > 0)
+	    {
+	      local_got[j] = gotoff;
+	      gotoff += got_elt_size;
+	    }
+	  else
+	    local_got[j] = (bfd_vma) -1;
+	}
+    }
+
+  /* Then the global .got entries.  .plt refcounts are handled by
+     adjust_dynamic_symbol  */
+  gofarg.gotoff = gotoff;
+  gofarg.got_elt_size = got_elt_size;
+  elf_link_hash_traverse (elf_hash_table (info),
+			  elf_gc_allocate_got_offsets,
+			  &gofarg);
+  return TRUE;
+}
+
+/* Many folk need no more in the way of final link than this, once
+   got entry reference counting is enabled.  */
+
+bfd_boolean
+bfd_elf_gc_common_final_link (bfd *abfd, struct bfd_link_info *info)
+{
+  if (!bfd_elf_gc_common_finalize_got_offsets (abfd, info))
+    return FALSE;
+
+  /* Invoke the regular ELF backend linker to do all the work.  */
+  return bfd_elf_final_link (abfd, info);
+}
+
+bfd_boolean
+bfd_elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie)
+{
+  struct elf_reloc_cookie *rcookie = cookie;
+
+  if (rcookie->bad_symtab)
+    rcookie->rel = rcookie->rels;
+
+  for (; rcookie->rel < rcookie->relend; rcookie->rel++)
+    {
+      unsigned long r_symndx;
+
+      if (! rcookie->bad_symtab)
+	if (rcookie->rel->r_offset > offset)
+	  return FALSE;
+      if (rcookie->rel->r_offset != offset)
+	continue;
+
+      r_symndx = rcookie->rel->r_info >> rcookie->r_sym_shift;
+      if (r_symndx == SHN_UNDEF)
+	return TRUE;
+
+      if (r_symndx >= rcookie->locsymcount
+	  || ELF_ST_BIND (rcookie->locsyms[r_symndx].st_info) != STB_LOCAL)
+	{
+	  struct elf_link_hash_entry *h;
+
+	  h = rcookie->sym_hashes[r_symndx - rcookie->extsymoff];
+
+	  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 ((h->root.type == bfd_link_hash_defined
+	       || h->root.type == bfd_link_hash_defweak)
+	      && elf_discarded_section (h->root.u.def.section))
+	    return TRUE;
+	  else
+	    return FALSE;
+	}
+      else
+	{
+	  /* It's not a relocation against a global symbol,
+	     but it could be a relocation against a local
+	     symbol for a discarded section.  */
+	  asection *isec;
+	  Elf_Internal_Sym *isym;
+
+	  /* Need to: get the symbol; get the section.  */
+	  isym = &rcookie->locsyms[r_symndx];
+	  if (isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE)
+	    {
+	      isec = bfd_section_from_elf_index (rcookie->abfd, isym->st_shndx);
+	      if (isec != NULL && elf_discarded_section (isec))
+		return TRUE;
+	    }
+	}
+      return FALSE;
+    }
+  return FALSE;
+}
+
+/* Discard unneeded references to discarded sections.
+   Returns TRUE if any section's size was changed.  */
+/* This function assumes that the relocations are in sorted order,
+   which is true for all known assemblers.  */
+
+bfd_boolean
+bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
+{
+  struct elf_reloc_cookie cookie;
+  asection *stab, *eh;
+  Elf_Internal_Shdr *symtab_hdr;
+  const struct elf_backend_data *bed;
+  bfd *abfd;
+  unsigned int count;
+  bfd_boolean ret = FALSE;
+
+  if (info->traditional_format
+      || !is_elf_hash_table (info->hash))
+    return FALSE;
+
+  for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next)
+    {
+      if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
+	continue;
+
+      bed = get_elf_backend_data (abfd);
+
+      if ((abfd->flags & DYNAMIC) != 0)
+	continue;
+
+      eh = bfd_get_section_by_name (abfd, ".eh_frame");
+      if (info->relocatable
+	  || (eh != NULL
+	      && (eh->size == 0
+		  || bfd_is_abs_section (eh->output_section))))
+	eh = NULL;
+
+      stab = bfd_get_section_by_name (abfd, ".stab");
+      if (stab != NULL
+	  && (stab->size == 0
+	      || bfd_is_abs_section (stab->output_section)
+	      || stab->sec_info_type != ELF_INFO_TYPE_STABS))
+	stab = NULL;
+
+      if (stab == NULL
+	  && eh == NULL
+	  && bed->elf_backend_discard_info == NULL)
+	continue;
+
+      symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
+      cookie.abfd = abfd;
+      cookie.sym_hashes = elf_sym_hashes (abfd);
+      cookie.bad_symtab = elf_bad_symtab (abfd);
+      if (cookie.bad_symtab)
+	{
+	  cookie.locsymcount = symtab_hdr->sh_size / bed->s->sizeof_sym;
+	  cookie.extsymoff = 0;
+	}
+      else
+	{
+	  cookie.locsymcount = symtab_hdr->sh_info;
+	  cookie.extsymoff = symtab_hdr->sh_info;
+	}
+
+      if (bed->s->arch_size == 32)
+	cookie.r_sym_shift = 8;
+      else
+	cookie.r_sym_shift = 32;
+
+      cookie.locsyms = (Elf_Internal_Sym *) symtab_hdr->contents;
+      if (cookie.locsyms == NULL && cookie.locsymcount != 0)
+	{
+	  cookie.locsyms = bfd_elf_get_elf_syms (abfd, symtab_hdr,
+						 cookie.locsymcount, 0,
+						 NULL, NULL, NULL);
+	  if (cookie.locsyms == NULL)
+	    return FALSE;
+	}
+
+      if (stab != NULL)
+	{
+	  cookie.rels = NULL;
+	  count = stab->reloc_count;
+	  if (count != 0)
+	    cookie.rels = _bfd_elf_link_read_relocs (abfd, stab, NULL, NULL,
+						     info->keep_memory);
+	  if (cookie.rels != NULL)
+	    {
+	      cookie.rel = cookie.rels;
+	      cookie.relend = cookie.rels;
+	      cookie.relend += count * bed->s->int_rels_per_ext_rel;
+	      if (_bfd_discard_section_stabs (abfd, stab,
+					      elf_section_data (stab)->sec_info,
+					      bfd_elf_reloc_symbol_deleted_p,
+					      &cookie))
+		ret = TRUE;
+	      if (elf_section_data (stab)->relocs != cookie.rels)
+		free (cookie.rels);
+	    }
+	}
+
+      if (eh != NULL)
+	{
+	  cookie.rels = NULL;
+	  count = eh->reloc_count;
+	  if (count != 0)
+	    cookie.rels = _bfd_elf_link_read_relocs (abfd, eh, NULL, NULL,
+						     info->keep_memory);
+	  cookie.rel = cookie.rels;
+	  cookie.relend = cookie.rels;
+	  if (cookie.rels != NULL)
+	    cookie.relend += count * bed->s->int_rels_per_ext_rel;
+
+	  if (_bfd_elf_discard_section_eh_frame (abfd, info, eh,
+						 bfd_elf_reloc_symbol_deleted_p,
+						 &cookie))
+	    ret = TRUE;
+
+	  if (cookie.rels != NULL
+	      && elf_section_data (eh)->relocs != cookie.rels)
+	    free (cookie.rels);
+	}
+
+      if (bed->elf_backend_discard_info != NULL
+	  && (*bed->elf_backend_discard_info) (abfd, &cookie, info))
+	ret = TRUE;
+
+      if (cookie.locsyms != NULL
+	  && symtab_hdr->contents != (unsigned char *) cookie.locsyms)
+	{
+	  if (! info->keep_memory)
+	    free (cookie.locsyms);
+	  else
+	    symtab_hdr->contents = (unsigned char *) cookie.locsyms;
+	}
+    }
+
+  if (info->eh_frame_hdr
+      && !info->relocatable
+      && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info))
+    ret = TRUE;
+
+  return ret;
+}
diff --git a/bfd/elflink.h b/bfd/elflink.h
deleted file mode 100644
index adecd80..0000000
--- a/bfd/elflink.h
+++ /dev/null
@@ -1,6070 +0,0 @@
-/* ELF linker support.
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-   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.  */
-
-/* ELF linker code.  */
-
-#include "safe-ctype.h"
-
-static bfd_boolean elf_link_add_object_symbols (bfd *, struct bfd_link_info *);
-static bfd_boolean elf_finalize_dynstr (bfd *, struct bfd_link_info *);
-static bfd_boolean elf_collect_hash_codes (struct elf_link_hash_entry *,
-					   void *);
-static bfd_boolean elf_section_ignore_discarded_relocs (asection *);
-
-/* Given an ELF BFD, add symbols to the global hash table as
-   appropriate.  */
-
-bfd_boolean
-elf_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
-{
-  switch (bfd_get_format (abfd))
-    {
-    case bfd_object:
-      return elf_link_add_object_symbols (abfd, info);
-    case bfd_archive:
-      return _bfd_elf_link_add_archive_symbols (abfd, info);
-    default:
-      bfd_set_error (bfd_error_wrong_format);
-      return FALSE;
-    }
-}
-
-/* Sort symbol by value and section.  */
-static int
-sort_symbol (const void *arg1, const void *arg2)
-{
-  const struct elf_link_hash_entry *h1
-    = *(const struct elf_link_hash_entry **) arg1;
-  const struct elf_link_hash_entry *h2
-    = *(const struct elf_link_hash_entry **) arg2;
-  bfd_signed_vma vdiff = h1->root.u.def.value - h2->root.u.def.value;
-
-  if (vdiff)
-    return vdiff > 0 ? 1 : -1;
-  else
-    {
-      long sdiff = h1->root.u.def.section - h2->root.u.def.section;
-      if (sdiff)
-	return sdiff > 0 ? 1 : -1;
-      else
-	return 0;
-    }
-}
-
-/* Add a DT_NEEDED entry for this dynamic object.  Returns -1 on error,
-   1 if a DT_NEEDED tag already exists, and 0 on success.  */
-
-static int
-add_dt_needed_tag (struct bfd_link_info *info, const char *soname,
-		   bfd_boolean do_it)
-{
-  struct elf_link_hash_table *hash_table;
-  bfd_size_type oldsize;
-  bfd_size_type strindex;
-
-  hash_table = elf_hash_table (info);
-  oldsize = _bfd_elf_strtab_size (hash_table->dynstr);
-  strindex = _bfd_elf_strtab_add (hash_table->dynstr, soname, FALSE);
-  if (strindex == (bfd_size_type) -1)
-    return -1;
-
-  if (oldsize == _bfd_elf_strtab_size (hash_table->dynstr))
-    {
-      asection *sdyn;
-      Elf_External_Dyn *dyncon, *dynconend;
-
-      sdyn = bfd_get_section_by_name (hash_table->dynobj, ".dynamic");
-      BFD_ASSERT (sdyn != NULL);
-
-      dyncon = (Elf_External_Dyn *) sdyn->contents;
-      dynconend = (Elf_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
-      for (; dyncon < dynconend; dyncon++)
-	{
-	  Elf_Internal_Dyn dyn;
-
-	  elf_swap_dyn_in (hash_table->dynobj, dyncon, & dyn);
-	  if (dyn.d_tag == DT_NEEDED
-	      && dyn.d_un.d_val == strindex)
-	    {
-	      _bfd_elf_strtab_delref (hash_table->dynstr, strindex);
-	      return 1;
-	    }
-	}
-    }
-
-  if (do_it)
-    {
-      if (! elf_add_dynamic_entry (info, DT_NEEDED, strindex))
-	return -1;
-    }
-  else
-    /* We were just checking for existence of the tag.  */
-    _bfd_elf_strtab_delref (hash_table->dynstr, strindex);
-
-  return 0;
-}
-
-/* Add symbols from an ELF object file to the linker hash table.  */
-
-static bfd_boolean
-elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
-{
-  bfd_boolean (*add_symbol_hook)
-    (bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
-     const char **, flagword *, asection **, bfd_vma *);
-  bfd_boolean (*check_relocs)
-    (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
-  bfd_boolean collect;
-  Elf_Internal_Shdr *hdr;
-  bfd_size_type symcount;
-  bfd_size_type extsymcount;
-  bfd_size_type extsymoff;
-  struct elf_link_hash_entry **sym_hash;
-  bfd_boolean dynamic;
-  Elf_External_Versym *extversym = NULL;
-  Elf_External_Versym *ever;
-  struct elf_link_hash_entry *weaks;
-  struct elf_link_hash_entry **nondeflt_vers = NULL;
-  bfd_size_type nondeflt_vers_cnt = 0;
-  Elf_Internal_Sym *isymbuf = NULL;
-  Elf_Internal_Sym *isym;
-  Elf_Internal_Sym *isymend;
-  const struct elf_backend_data *bed;
-  bfd_boolean add_needed;
-  struct elf_link_hash_table * hash_table;
-  bfd_size_type amt;
-
-  hash_table = elf_hash_table (info);
-
-  bed = get_elf_backend_data (abfd);
-  add_symbol_hook = bed->elf_add_symbol_hook;
-  collect = bed->collect;
-
-  if ((abfd->flags & DYNAMIC) == 0)
-    dynamic = FALSE;
-  else
-    {
-      dynamic = TRUE;
-
-      /* You can't use -r against a dynamic object.  Also, there's no
-	 hope of using a dynamic object which does not exactly match
-	 the format of the output file.  */
-      if (info->relocatable
-	  || !is_elf_hash_table (hash_table)
-	  || hash_table->root.creator != abfd->xvec)
-	{
-	  bfd_set_error (bfd_error_invalid_operation);
-	  goto error_return;
-	}
-    }
-
-  /* As a GNU extension, any input sections which are named
-     .gnu.warning.SYMBOL are treated as warning symbols for the given
-     symbol.  This differs from .gnu.warning sections, which generate
-     warnings when they are included in an output file.  */
-  if (info->executable)
-    {
-      asection *s;
-
-      for (s = abfd->sections; s != NULL; s = s->next)
-	{
-	  const char *name;
-
-	  name = bfd_get_section_name (abfd, s);
-	  if (strncmp (name, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0)
-	    {
-	      char *msg;
-	      bfd_size_type sz;
-	      bfd_size_type prefix_len;
-	      const char * gnu_warning_prefix = _("warning: ");
-
-	      name += sizeof ".gnu.warning." - 1;
-
-	      /* If this is a shared object, then look up the symbol
-		 in the hash table.  If it is there, and it is already
-		 been defined, then we will not be using the entry
-		 from this shared object, so we don't need to warn.
-		 FIXME: If we see the definition in a regular object
-		 later on, we will warn, but we shouldn't.  The only
-		 fix is to keep track of what warnings we are supposed
-		 to emit, and then handle them all at the end of the
-		 link.  */
-	      if (dynamic)
-		{
-		  struct elf_link_hash_entry *h;
-
-		  h = elf_link_hash_lookup (hash_table, name,
-					    FALSE, FALSE, TRUE);
-
-		  /* FIXME: What about bfd_link_hash_common?  */
-		  if (h != NULL
-		      && (h->root.type == bfd_link_hash_defined
-			  || h->root.type == bfd_link_hash_defweak))
-		    {
-		      /* We don't want to issue this warning.  Clobber
-			 the section size so that the warning does not
-			 get copied into the output file.  */
-		      s->_raw_size = 0;
-		      continue;
-		    }
-		}
-
-	      sz = bfd_section_size (abfd, s);
-	      prefix_len = strlen (gnu_warning_prefix);
-	      msg = bfd_alloc (abfd, prefix_len + sz + 1);
-	      if (msg == NULL)
-		goto error_return;
-
-	      strcpy (msg, gnu_warning_prefix);
-	      if (! bfd_get_section_contents (abfd, s, msg + prefix_len, 0, sz))
-		goto error_return;
-
-	      msg[prefix_len + sz] = '\0';
-
-	      if (! (_bfd_generic_link_add_one_symbol
-		     (info, abfd, name, BSF_WARNING, s, 0, msg,
-		      FALSE, collect, NULL)))
-		goto error_return;
-
-	      if (! info->relocatable)
-		{
-		  /* Clobber the section size so that the warning does
-		     not get copied into the output file.  */
-		  s->_raw_size = 0;
-		}
-	    }
-	}
-    }
-
-  add_needed = TRUE;
-  if (! dynamic)
-    {
-      /* If we are creating a shared library, create all the dynamic
-	 sections immediately.  We need to attach them to something,
-	 so we attach them to this BFD, provided it is the right
-	 format.  FIXME: If there are no input BFD's of the same
-	 format as the output, we can't make a shared library.  */
-      if (info->shared
-	  && is_elf_hash_table (hash_table)
-	  && hash_table->root.creator == abfd->xvec
-	  && ! hash_table->dynamic_sections_created)
-	{
-	  if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
-	    goto error_return;
-	}
-    }
-  else if (!is_elf_hash_table (hash_table))
-    goto error_return;
-  else
-    {
-      asection *s;
-      const char *soname = NULL;
-      struct bfd_link_needed_list *rpath = NULL, *runpath = NULL;
-      int ret;
-
-      /* ld --just-symbols and dynamic objects don't mix very well.
-	 Test for --just-symbols by looking at info set up by
-	 _bfd_elf_link_just_syms.  */
-      if ((s = abfd->sections) != NULL
-	  && s->sec_info_type == ELF_INFO_TYPE_JUST_SYMS)
-	goto error_return;
-
-      /* If this dynamic lib was specified on the command line with
-	 --as-needed in effect, then we don't want to add a DT_NEEDED
-	 tag unless the lib is actually used.  Similary for libs brought
-	 in by another lib's DT_NEEDED.  */
-      add_needed = elf_dyn_lib_class (abfd) == DYN_NORMAL;
-
-      s = bfd_get_section_by_name (abfd, ".dynamic");
-      if (s != NULL)
-	{
-	  Elf_External_Dyn *dynbuf = NULL;
-	  Elf_External_Dyn *extdyn;
-	  Elf_External_Dyn *extdynend;
-	  int elfsec;
-	  unsigned long shlink;
-
-	  dynbuf = bfd_malloc (s->_raw_size);
-	  if (dynbuf == NULL)
-	    goto error_return;
-
-	  if (! bfd_get_section_contents (abfd, s, dynbuf, 0, s->_raw_size))
-	    goto error_free_dyn;
-
-	  elfsec = _bfd_elf_section_from_bfd_section (abfd, s);
-	  if (elfsec == -1)
-	    goto error_free_dyn;
-	  shlink = elf_elfsections (abfd)[elfsec]->sh_link;
-
-	  extdyn = dynbuf;
-	  extdynend = extdyn + s->_raw_size / sizeof (Elf_External_Dyn);
-	  for (; extdyn < extdynend; extdyn++)
-	    {
-	      Elf_Internal_Dyn dyn;
-
-	      elf_swap_dyn_in (abfd, extdyn, &dyn);
-	      if (dyn.d_tag == DT_SONAME)
-		{
-		  unsigned int tagv = dyn.d_un.d_val;
-		  soname = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
-		  if (soname == NULL)
-		    goto error_free_dyn;
-		}
-	      if (dyn.d_tag == DT_NEEDED)
-		{
-		  struct bfd_link_needed_list *n, **pn;
-		  char *fnm, *anm;
-		  unsigned int tagv = dyn.d_un.d_val;
-
-		  amt = sizeof (struct bfd_link_needed_list);
-		  n = bfd_alloc (abfd, amt);
-		  fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
-		  if (n == NULL || fnm == NULL)
-		    goto error_free_dyn;
-		  amt = strlen (fnm) + 1;
-		  anm = bfd_alloc (abfd, amt);
-		  if (anm == NULL)
-		    goto error_free_dyn;
-		  memcpy (anm, fnm, amt);
-		  n->name = anm;
-		  n->by = abfd;
-		  n->next = NULL;
-		  for (pn = & hash_table->needed;
-		       *pn != NULL;
-		       pn = &(*pn)->next)
-		    ;
-		  *pn = n;
-		}
-	      if (dyn.d_tag == DT_RUNPATH)
-		{
-		  struct bfd_link_needed_list *n, **pn;
-		  char *fnm, *anm;
-		  unsigned int tagv = dyn.d_un.d_val;
-
-		  amt = sizeof (struct bfd_link_needed_list);
-		  n = bfd_alloc (abfd, amt);
-		  fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
-		  if (n == NULL || fnm == NULL)
-		    goto error_free_dyn;
-		  amt = strlen (fnm) + 1;
-		  anm = bfd_alloc (abfd, amt);
-		  if (anm == NULL)
-		    goto error_free_dyn;
-		  memcpy (anm, fnm, amt);
-		  n->name = anm;
-		  n->by = abfd;
-		  n->next = NULL;
-		  for (pn = & runpath;
-		       *pn != NULL;
-		       pn = &(*pn)->next)
-		    ;
-		  *pn = n;
-		}
-	      /* Ignore DT_RPATH if we have seen DT_RUNPATH.  */
-	      if (!runpath && dyn.d_tag == DT_RPATH)
-		{
-		  struct bfd_link_needed_list *n, **pn;
-		  char *fnm, *anm;
-		  unsigned int tagv = dyn.d_un.d_val;
-
-		  amt = sizeof (struct bfd_link_needed_list);
-		  n = bfd_alloc (abfd, amt);
-		  fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv);
-		  if (n == NULL || fnm == NULL)
-		    goto error_free_dyn;
-		  amt = strlen (fnm) + 1;
-		  anm = bfd_alloc (abfd, amt);
-		  if (anm == NULL)
-		    {
-		    error_free_dyn:
-		      free (dynbuf);
-		      goto error_return;
-		    }
-		  memcpy (anm, fnm, amt);
-		  n->name = anm;
-		  n->by = abfd;
-		  n->next = NULL;
-		  for (pn = & rpath;
-		       *pn != NULL;
-		       pn = &(*pn)->next)
-		    ;
-		  *pn = n;
-		}
-	    }
-
-	  free (dynbuf);
-	}
-
-      /* DT_RUNPATH overrides DT_RPATH.  Do _NOT_ bfd_release, as that
-	 frees all more recently bfd_alloc'd blocks as well.  */
-      if (runpath)
-	rpath = runpath;
-
-      if (rpath)
-	{
-	  struct bfd_link_needed_list **pn;
-	  for (pn = & hash_table->runpath;
-	       *pn != NULL;
-	       pn = &(*pn)->next)
-	    ;
-	  *pn = rpath;
-	}
-
-      /* We do not want to include any of the sections in a dynamic
-	 object in the output file.  We hack by simply clobbering the
-	 list of sections in the BFD.  This could be handled more
-	 cleanly by, say, a new section flag; the existing
-	 SEC_NEVER_LOAD flag is not the one we want, because that one
-	 still implies that the section takes up space in the output
-	 file.  */
-      bfd_section_list_clear (abfd);
-
-      /* If this is the first dynamic object found in the link, create
-	 the special sections required for dynamic linking.  */
-      if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
-	goto error_return;
-
-      /* Find the name to use in a DT_NEEDED entry that refers to this
-	 object.  If the object has a DT_SONAME entry, we use it.
-	 Otherwise, if the generic linker stuck something in
-	 elf_dt_name, we use that.  Otherwise, we just use the file
-	 name.  */
-      if (soname == NULL || *soname == '\0')
-	{
-	  soname = elf_dt_name (abfd);
-	  if (soname == NULL || *soname == '\0')
-	    soname = bfd_get_filename (abfd);
-	}
-
-      /* Save the SONAME because sometimes the linker emulation code
-	 will need to know it.  */
-      elf_dt_name (abfd) = soname;
-
-      ret = add_dt_needed_tag (info, soname, add_needed);
-      if (ret < 0)
-	goto error_return;
-
-      /* If we have already included this dynamic object in the
-	 link, just ignore it.  There is no reason to include a
-	 particular dynamic object more than once.  */
-      if (ret > 0)
-	return TRUE;
-    }
-
-  /* If this is a dynamic object, we always link against the .dynsym
-     symbol table, not the .symtab symbol table.  The dynamic linker
-     will only see the .dynsym symbol table, so there is no reason to
-     look at .symtab for a dynamic object.  */
-
-  if (! dynamic || elf_dynsymtab (abfd) == 0)
-    hdr = &elf_tdata (abfd)->symtab_hdr;
-  else
-    hdr = &elf_tdata (abfd)->dynsymtab_hdr;
-
-  symcount = hdr->sh_size / sizeof (Elf_External_Sym);
-
-  /* The sh_info field of the symtab header tells us where the
-     external symbols start.  We don't care about the local symbols at
-     this point.  */
-  if (elf_bad_symtab (abfd))
-    {
-      extsymcount = symcount;
-      extsymoff = 0;
-    }
-  else
-    {
-      extsymcount = symcount - hdr->sh_info;
-      extsymoff = hdr->sh_info;
-    }
-
-  sym_hash = NULL;
-  if (extsymcount != 0)
-    {
-      isymbuf = bfd_elf_get_elf_syms (abfd, hdr, extsymcount, extsymoff,
-				      NULL, NULL, NULL);
-      if (isymbuf == NULL)
-	goto error_return;
-
-      /* We store a pointer to the hash table entry for each external
-	 symbol.  */
-      amt = extsymcount * sizeof (struct elf_link_hash_entry *);
-      sym_hash = bfd_alloc (abfd, amt);
-      if (sym_hash == NULL)
-	goto error_free_sym;
-      elf_sym_hashes (abfd) = sym_hash;
-    }
-
-  if (dynamic)
-    {
-      /* Read in any version definitions.  */
-      if (! _bfd_elf_slurp_version_tables (abfd))
-	goto error_free_sym;
-
-      /* Read in the symbol versions, but don't bother to convert them
-	 to internal format.  */
-      if (elf_dynversym (abfd) != 0)
-	{
-	  Elf_Internal_Shdr *versymhdr;
-
-	  versymhdr = &elf_tdata (abfd)->dynversym_hdr;
-	  extversym = bfd_malloc (versymhdr->sh_size);
-	  if (extversym == NULL)
-	    goto error_free_sym;
-	  amt = versymhdr->sh_size;
-	  if (bfd_seek (abfd, versymhdr->sh_offset, SEEK_SET) != 0
-	      || bfd_bread (extversym, amt, abfd) != amt)
-	    goto error_free_vers;
-	}
-    }
-
-  weaks = NULL;
-
-  ever = extversym != NULL ? extversym + extsymoff : NULL;
-  for (isym = isymbuf, isymend = isymbuf + extsymcount;
-       isym < isymend;
-       isym++, sym_hash++, ever = (ever != NULL ? ever + 1 : NULL))
-    {
-      int bind;
-      bfd_vma value;
-      asection *sec;
-      flagword flags;
-      const char *name;
-      struct elf_link_hash_entry *h;
-      bfd_boolean definition;
-      bfd_boolean size_change_ok;
-      bfd_boolean type_change_ok;
-      bfd_boolean new_weakdef;
-      bfd_boolean override;
-      unsigned int old_alignment;
-      bfd *old_bfd;
-
-      override = FALSE;
-
-      flags = BSF_NO_FLAGS;
-      sec = NULL;
-      value = isym->st_value;
-      *sym_hash = NULL;
-
-      bind = ELF_ST_BIND (isym->st_info);
-      if (bind == STB_LOCAL)
-	{
-	  /* This should be impossible, since ELF requires that all
-	     global symbols follow all local symbols, and that sh_info
-	     point to the first global symbol.  Unfortunately, Irix 5
-	     screws this up.  */
-	  continue;
-	}
-      else if (bind == STB_GLOBAL)
-	{
-	  if (isym->st_shndx != SHN_UNDEF
-	      && isym->st_shndx != SHN_COMMON)
-	    flags = BSF_GLOBAL;
-	}
-      else if (bind == STB_WEAK)
-	flags = BSF_WEAK;
-      else
-	{
-	  /* Leave it up to the processor backend.  */
-	}
-
-      if (isym->st_shndx == SHN_UNDEF)
-	sec = bfd_und_section_ptr;
-      else if (isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE)
-	{
-	  sec = section_from_elf_index (abfd, isym->st_shndx);
-	  if (sec == NULL)
-	    sec = bfd_abs_section_ptr;
-	  else if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
-	    value -= sec->vma;
-	}
-      else if (isym->st_shndx == SHN_ABS)
-	sec = bfd_abs_section_ptr;
-      else if (isym->st_shndx == SHN_COMMON)
-	{
-	  sec = bfd_com_section_ptr;
-	  /* What ELF calls the size we call the value.  What ELF
-	     calls the value we call the alignment.  */
-	  value = isym->st_size;
-	}
-      else
-	{
-	  /* Leave it up to the processor backend.  */
-	}
-
-      name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link,
-					      isym->st_name);
-      if (name == NULL)
-	goto error_free_vers;
-
-      if (isym->st_shndx == SHN_COMMON
-	  && ELF_ST_TYPE (isym->st_info) == STT_TLS)
-	{
-	  asection *tcomm = bfd_get_section_by_name (abfd, ".tcommon");
-
-	  if (tcomm == NULL)
-	    {
-	      tcomm = bfd_make_section (abfd, ".tcommon");
-	      if (tcomm == NULL
-		  || !bfd_set_section_flags (abfd, tcomm, (SEC_ALLOC
-							   | SEC_IS_COMMON
-							   | SEC_LINKER_CREATED
-							   | SEC_THREAD_LOCAL)))
-		goto error_free_vers;
-	    }
-	  sec = tcomm;
-	}
-      else if (add_symbol_hook)
-	{
-	  if (! (*add_symbol_hook) (abfd, info, isym, &name, &flags, &sec,
-				    &value))
-	    goto error_free_vers;
-
-	  /* The hook function sets the name to NULL if this symbol
-	     should be skipped for some reason.  */
-	  if (name == NULL)
-	    continue;
-	}
-
-      /* Sanity check that all possibilities were handled.  */
-      if (sec == NULL)
-	{
-	  bfd_set_error (bfd_error_bad_value);
-	  goto error_free_vers;
-	}
-
-      if (bfd_is_und_section (sec)
-	  || bfd_is_com_section (sec))
-	definition = FALSE;
-      else
-	definition = TRUE;
-
-      size_change_ok = FALSE;
-      type_change_ok = get_elf_backend_data (abfd)->type_change_ok;
-      old_alignment = 0;
-      old_bfd = NULL;
-
-      if (is_elf_hash_table (hash_table))
-	{
-	  Elf_Internal_Versym iver;
-	  unsigned int vernum = 0;
-	  bfd_boolean skip;
-
-	  if (ever != NULL)
-	    {
-	      _bfd_elf_swap_versym_in (abfd, ever, &iver);
-	      vernum = iver.vs_vers & VERSYM_VERSION;
-
-	      /* If this is a hidden symbol, or if it is not version
-		 1, we append the version name to the symbol name.
-		 However, we do not modify a non-hidden absolute
-		 symbol, because it might be the version symbol
-		 itself.  FIXME: What if it isn't?  */
-	      if ((iver.vs_vers & VERSYM_HIDDEN) != 0
-		  || (vernum > 1 && ! bfd_is_abs_section (sec)))
-		{
-		  const char *verstr;
-		  size_t namelen, verlen, newlen;
-		  char *newname, *p;
-
-		  if (isym->st_shndx != SHN_UNDEF)
-		    {
-		      if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info)
-			{
-			  (*_bfd_error_handler)
-			    (_("%s: %s: invalid version %u (max %d)"),
-			     bfd_archive_filename (abfd), name, vernum,
-			     elf_tdata (abfd)->dynverdef_hdr.sh_info);
-			  bfd_set_error (bfd_error_bad_value);
-			  goto error_free_vers;
-			}
-		      else if (vernum > 1)
-			verstr =
-			  elf_tdata (abfd)->verdef[vernum - 1].vd_nodename;
-		      else
-			verstr = "";
-		    }
-		  else
-		    {
-		      /* We cannot simply test for the number of
-			 entries in the VERNEED section since the
-			 numbers for the needed versions do not start
-			 at 0.  */
-		      Elf_Internal_Verneed *t;
-
-		      verstr = NULL;
-		      for (t = elf_tdata (abfd)->verref;
-			   t != NULL;
-			   t = t->vn_nextref)
-			{
-			  Elf_Internal_Vernaux *a;
-
-			  for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
-			    {
-			      if (a->vna_other == vernum)
-				{
-				  verstr = a->vna_nodename;
-				  break;
-				}
-			    }
-			  if (a != NULL)
-			    break;
-			}
-		      if (verstr == NULL)
-			{
-			  (*_bfd_error_handler)
-			    (_("%s: %s: invalid needed version %d"),
-			     bfd_archive_filename (abfd), name, vernum);
-			  bfd_set_error (bfd_error_bad_value);
-			  goto error_free_vers;
-			}
-		    }
-
-		  namelen = strlen (name);
-		  verlen = strlen (verstr);
-		  newlen = namelen + verlen + 2;
-		  if ((iver.vs_vers & VERSYM_HIDDEN) == 0
-		      && isym->st_shndx != SHN_UNDEF)
-		    ++newlen;
-
-		  newname = bfd_alloc (abfd, newlen);
-		  if (newname == NULL)
-		    goto error_free_vers;
-		  memcpy (newname, name, namelen);
-		  p = newname + namelen;
-		  *p++ = ELF_VER_CHR;
-		  /* If this is a defined non-hidden version symbol,
-		     we add another @ to the name.  This indicates the
-		     default version of the symbol.  */
-		  if ((iver.vs_vers & VERSYM_HIDDEN) == 0
-		      && isym->st_shndx != SHN_UNDEF)
-		    *p++ = ELF_VER_CHR;
-		  memcpy (p, verstr, verlen + 1);
-
-		  name = newname;
-		}
-	    }
-
-	  if (!_bfd_elf_merge_symbol (abfd, info, name, isym, &sec, &value,
-				      sym_hash, &skip, &override,
-				      &type_change_ok, &size_change_ok))
-	    goto error_free_vers;
-
-	  if (skip)
-	    continue;
-
-	  if (override)
-	    definition = FALSE;
-
-	  h = *sym_hash;
-	  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;
-
-	  /* Remember the old alignment if this is a common symbol, so
-	     that we don't reduce the alignment later on.  We can't
-	     check later, because _bfd_generic_link_add_one_symbol
-	     will set a default for the alignment which we want to
-	     override. We also remember the old bfd where the existing
-	     definition comes from.  */
-	  switch (h->root.type)
-	    {
-	    default:
-	      break;
-
-	    case bfd_link_hash_defined:
-	    case bfd_link_hash_defweak:
-	      old_bfd = h->root.u.def.section->owner;
-	      break;
-
-	    case bfd_link_hash_common:
-	      old_bfd = h->root.u.c.p->section->owner;
-	      old_alignment = h->root.u.c.p->alignment_power;
-	      break;
-	    }
-
-	  if (elf_tdata (abfd)->verdef != NULL
-	      && ! override
-	      && vernum > 1
-	      && definition)
-	    h->verinfo.verdef = &elf_tdata (abfd)->verdef[vernum - 1];
-	}
-
-      if (! (_bfd_generic_link_add_one_symbol
-	     (info, abfd, name, flags, sec, value, NULL, FALSE, collect,
-	      (struct bfd_link_hash_entry **) sym_hash)))
-	goto error_free_vers;
-
-      h = *sym_hash;
-      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;
-      *sym_hash = h;
-
-      new_weakdef = FALSE;
-      if (dynamic
-	  && definition
-	  && (flags & BSF_WEAK) != 0
-	  && ELF_ST_TYPE (isym->st_info) != STT_FUNC
-	  && is_elf_hash_table (hash_table)
-	  && h->weakdef == NULL)
-	{
-	  /* Keep a list of all weak defined non function symbols from
-	     a dynamic object, using the weakdef field.  Later in this
-	     function we will set the weakdef field to the correct
-	     value.  We only put non-function symbols from dynamic
-	     objects on this list, because that happens to be the only
-	     time we need to know the normal symbol corresponding to a
-	     weak symbol, and the information is time consuming to
-	     figure out.  If the weakdef field is not already NULL,
-	     then this symbol was already defined by some previous
-	     dynamic object, and we will be using that previous
-	     definition anyhow.  */
-
-	  h->weakdef = weaks;
-	  weaks = h;
-	  new_weakdef = TRUE;
-	}
-
-      /* Set the alignment of a common symbol.  */
-      if (isym->st_shndx == SHN_COMMON
-	  && h->root.type == bfd_link_hash_common)
-	{
-	  unsigned int align;
-
-	  align = bfd_log2 (isym->st_value);
-	  if (align > old_alignment
-	      /* Permit an alignment power of zero if an alignment of one
-		 is specified and no other alignments have been specified.  */
-	      || (isym->st_value == 1 && old_alignment == 0))
-	    h->root.u.c.p->alignment_power = align;
-	  else
-	    h->root.u.c.p->alignment_power = old_alignment;
-	}
-
-      if (is_elf_hash_table (hash_table))
-	{
-	  int old_flags;
-	  bfd_boolean dynsym;
-	  int new_flag;
-
-	  /* Check the alignment when a common symbol is involved. This
-	     can change when a common symbol is overridden by a normal
-	     definition or a common symbol is ignored due to the old
-	     normal definition. We need to make sure the maximum
-	     alignment is maintained.  */
-	  if ((old_alignment || isym->st_shndx == SHN_COMMON)
-	      && h->root.type != bfd_link_hash_common)
-	    {
-	      unsigned int common_align;
-	      unsigned int normal_align;
-	      unsigned int symbol_align;
-	      bfd *normal_bfd;
-	      bfd *common_bfd;
-
-	      symbol_align = ffs (h->root.u.def.value) - 1;
-	      if (h->root.u.def.section->owner != NULL
-		  && (h->root.u.def.section->owner->flags & DYNAMIC) == 0)
-		{
-		  normal_align = h->root.u.def.section->alignment_power;
-		  if (normal_align > symbol_align)
-		    normal_align = symbol_align;
-		}
-	      else
-		normal_align = symbol_align;
-
-	      if (old_alignment)
-		{
-		  common_align = old_alignment;
-		  common_bfd = old_bfd;
-		  normal_bfd = abfd;
-		}
-	      else
-		{
-		  common_align = bfd_log2 (isym->st_value);
-		  common_bfd = abfd;
-		  normal_bfd = old_bfd;
-		}
-
-	      if (normal_align < common_align)
-		(*_bfd_error_handler)
-		  (_("Warning: alignment %u of symbol `%s' in %s is smaller than %u in %s"),
-		   1 << normal_align,
-		   name,
-		   bfd_archive_filename (normal_bfd),
-		   1 << common_align,
-		   bfd_archive_filename (common_bfd));
-	    }
-
-	  /* Remember the symbol size and type.  */
-	  if (isym->st_size != 0
-	      && (definition || h->size == 0))
-	    {
-	      if (h->size != 0 && h->size != isym->st_size && ! size_change_ok)
-		(*_bfd_error_handler)
-		  (_("Warning: size of symbol `%s' changed from %lu in %s to %lu in %s"),
-		   name, (unsigned long) h->size,
-		   bfd_archive_filename (old_bfd),
-		   (unsigned long) isym->st_size,
-		   bfd_archive_filename (abfd));
-
-	      h->size = isym->st_size;
-	    }
-
-	  /* If this is a common symbol, then we always want H->SIZE
-	     to be the size of the common symbol.  The code just above
-	     won't fix the size if a common symbol becomes larger.  We
-	     don't warn about a size change here, because that is
-	     covered by --warn-common.  */
-	  if (h->root.type == bfd_link_hash_common)
-	    h->size = h->root.u.c.size;
-
-	  if (ELF_ST_TYPE (isym->st_info) != STT_NOTYPE
-	      && (definition || h->type == STT_NOTYPE))
-	    {
-	      if (h->type != STT_NOTYPE
-		  && h->type != ELF_ST_TYPE (isym->st_info)
-		  && ! type_change_ok)
-		(*_bfd_error_handler)
-		  (_("Warning: type of symbol `%s' changed from %d to %d in %s"),
-		   name, h->type, ELF_ST_TYPE (isym->st_info),
-		   bfd_archive_filename (abfd));
-
-	      h->type = ELF_ST_TYPE (isym->st_info);
-	    }
-
-	  /* If st_other has a processor-specific meaning, specific
-	     code might be needed here. We never merge the visibility
-	     attribute with the one from a dynamic object.  */
-	  if (bed->elf_backend_merge_symbol_attribute)
-	    (*bed->elf_backend_merge_symbol_attribute) (h, isym, definition,
-							dynamic);
-
-	  if (isym->st_other != 0 && !dynamic)
-	    {
-	      unsigned char hvis, symvis, other, nvis;
-
-	      /* Take the balance of OTHER from the definition.  */
-	      other = (definition ? isym->st_other : h->other);
-	      other &= ~ ELF_ST_VISIBILITY (-1);
-
-	      /* Combine visibilities, using the most constraining one.  */
-	      hvis   = ELF_ST_VISIBILITY (h->other);
-	      symvis = ELF_ST_VISIBILITY (isym->st_other);
-	      if (! hvis)
-		nvis = symvis;
-	      else if (! symvis)
-		nvis = hvis;
-	      else
-		nvis = hvis < symvis ? hvis : symvis;
-
-	      h->other = other | nvis;
-	    }
-
-	  /* Set a flag in the hash table entry indicating the type of
-	     reference or definition we just found.  Keep a count of
-	     the number of dynamic symbols we find.  A dynamic symbol
-	     is one which is referenced or defined by both a regular
-	     object and a shared object.  */
-	  old_flags = h->elf_link_hash_flags;
-	  dynsym = FALSE;
-	  if (! dynamic)
-	    {
-	      if (! definition)
-		{
-		  new_flag = ELF_LINK_HASH_REF_REGULAR;
-		  if (bind != STB_WEAK)
-		    new_flag |= ELF_LINK_HASH_REF_REGULAR_NONWEAK;
-		}
-	      else
-		new_flag = ELF_LINK_HASH_DEF_REGULAR;
-	      if (! info->executable
-		  || (old_flags & (ELF_LINK_HASH_DEF_DYNAMIC
-				   | ELF_LINK_HASH_REF_DYNAMIC)) != 0)
-		dynsym = TRUE;
-	    }
-	  else
-	    {
-	      if (! definition)
-		new_flag = ELF_LINK_HASH_REF_DYNAMIC;
-	      else
-		new_flag = ELF_LINK_HASH_DEF_DYNAMIC;
-	      if ((old_flags & (ELF_LINK_HASH_DEF_REGULAR
-				| ELF_LINK_HASH_REF_REGULAR)) != 0
-		  || (h->weakdef != NULL
-		      && ! new_weakdef
-		      && h->weakdef->dynindx != -1))
-		dynsym = TRUE;
-	    }
-
-	  h->elf_link_hash_flags |= new_flag;
-
-	  /* Check to see if we need to add an indirect symbol for
-	     the default name.  */
-	  if (definition || h->root.type == bfd_link_hash_common)
-	    if (!_bfd_elf_add_default_symbol (abfd, info, h, name, isym,
-					      &sec, &value, &dynsym,
-					      override))
-	      goto error_free_vers;
-
-	  if (definition && !dynamic)
-	    {
-	      char *p = strchr (name, ELF_VER_CHR);
-	      if (p != NULL && p[1] != ELF_VER_CHR)
-		{
-		  /* Queue non-default versions so that .symver x, x@FOO
-		     aliases can be checked.  */
-		  if (! nondeflt_vers)
-		    {
-		      amt = (isymend - isym + 1)
-			    * sizeof (struct elf_link_hash_entry *);
-		      nondeflt_vers = bfd_malloc (amt);
-		    }
-		  nondeflt_vers [nondeflt_vers_cnt++] = h;
-		}
-	    }
-
-	  if (dynsym && h->dynindx == -1)
-	    {
-	      if (! _bfd_elf_link_record_dynamic_symbol (info, h))
-		goto error_free_vers;
-	      if (h->weakdef != NULL
-		  && ! new_weakdef
-		  && h->weakdef->dynindx == -1)
-		{
-		  if (! _bfd_elf_link_record_dynamic_symbol (info, h->weakdef))
-		    goto error_free_vers;
-		}
-	    }
-	  else if (dynsym && h->dynindx != -1)
-	    /* If the symbol already has a dynamic index, but
-	       visibility says it should not be visible, turn it into
-	       a local symbol.  */
-	    switch (ELF_ST_VISIBILITY (h->other))
-	      {
-	      case STV_INTERNAL:
-	      case STV_HIDDEN:
-		(*bed->elf_backend_hide_symbol) (info, h, TRUE);
-		break;
-	      }
-
-	  if (!add_needed && definition
-	      && (h->elf_link_hash_flags
-		  & ELF_LINK_HASH_REF_REGULAR) != 0)
-	    {
-	      int ret;
-
-	      /* A symbol from a library loaded via DT_NEEDED of some
-		 other library is referenced by a regular object.
-		 Add a DT_NEEDED entry for it.  */
-	      add_needed = TRUE;
-	      ret = add_dt_needed_tag (info, elf_dt_name (abfd), add_needed);
-	      if (ret < 0)
-		goto error_free_vers;
-
-	      BFD_ASSERT (ret == 0);
-	    }
-	}
-    }
-
-  /* Now that all the symbols from this input file are created, handle
-     .symver foo, foo@BAR such that any relocs against foo become foo@BAR.  */
-  if (nondeflt_vers != NULL)
-    {
-      bfd_size_type cnt, symidx;
-
-      for (cnt = 0; cnt < nondeflt_vers_cnt; ++cnt)
-	{
-	  struct elf_link_hash_entry *h = nondeflt_vers[cnt], *hi;
-	  char *shortname, *p;
-
-	  p = strchr (h->root.root.string, ELF_VER_CHR);
-	  if (p == NULL
-	      || (h->root.type != bfd_link_hash_defined
-		  && h->root.type != bfd_link_hash_defweak))
-	    continue;
-
-	  amt = p - h->root.root.string;
-	  shortname = bfd_malloc (amt + 1);
-	  memcpy (shortname, h->root.root.string, amt);
-	  shortname[amt] = '\0';
-
-	  hi = (struct elf_link_hash_entry *)
-	       bfd_link_hash_lookup (&hash_table->root, shortname,
-				     FALSE, FALSE, FALSE);
-	  if (hi != NULL
-	      && hi->root.type == h->root.type
-	      && hi->root.u.def.value == h->root.u.def.value
-	      && hi->root.u.def.section == h->root.u.def.section)
-	    {
-	      (*bed->elf_backend_hide_symbol) (info, hi, TRUE);
-	      hi->root.type = bfd_link_hash_indirect;
-	      hi->root.u.i.link = (struct bfd_link_hash_entry *) h;
-	      (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi);
-	      sym_hash = elf_sym_hashes (abfd);
-	      if (sym_hash)
-		for (symidx = 0; symidx < extsymcount; ++symidx)
-		  if (sym_hash[symidx] == hi)
-		    {
-		      sym_hash[symidx] = h;
-		      break;
-		    }
-	    }
-	  free (shortname);
-	}
-      free (nondeflt_vers);
-      nondeflt_vers = NULL;
-    }
-
-  if (extversym != NULL)
-    {
-      free (extversym);
-      extversym = NULL;
-    }
-
-  if (isymbuf != NULL)
-    free (isymbuf);
-  isymbuf = NULL;
-
-  /* Now set the weakdefs field correctly for all the weak defined
-     symbols we found.  The only way to do this is to search all the
-     symbols.  Since we only need the information for non functions in
-     dynamic objects, that's the only time we actually put anything on
-     the list WEAKS.  We need this information so that if a regular
-     object refers to a symbol defined weakly in a dynamic object, the
-     real symbol in the dynamic object is also put in the dynamic
-     symbols; we also must arrange for both symbols to point to the
-     same memory location.  We could handle the general case of symbol
-     aliasing, but a general symbol alias can only be generated in
-     assembler code, handling it correctly would be very time
-     consuming, and other ELF linkers don't handle general aliasing
-     either.  */
-  if (weaks != NULL)
-    {
-      struct elf_link_hash_entry **hpp;
-      struct elf_link_hash_entry **hppend;
-      struct elf_link_hash_entry **sorted_sym_hash;
-      struct elf_link_hash_entry *h;
-      size_t sym_count;
-
-      /* Since we have to search the whole symbol list for each weak
-	 defined symbol, search time for N weak defined symbols will be
-	 O(N^2). Binary search will cut it down to O(NlogN).  */
-      amt = extsymcount * sizeof (struct elf_link_hash_entry *);
-      sorted_sym_hash = bfd_malloc (amt);
-      if (sorted_sym_hash == NULL)
-	goto error_return;
-      sym_hash = sorted_sym_hash;
-      hpp = elf_sym_hashes (abfd);
-      hppend = hpp + extsymcount;
-      sym_count = 0;
-      for (; hpp < hppend; hpp++)
-	{
-	  h = *hpp;
-	  if (h != NULL
-	      && h->root.type == bfd_link_hash_defined
-	      && h->type != STT_FUNC)
-	    {
-	      *sym_hash = h;
-	      sym_hash++;
-	      sym_count++;
-	    }
-	}
-
-      qsort (sorted_sym_hash, sym_count,
-	     sizeof (struct elf_link_hash_entry *),
-	     sort_symbol);
-
-      while (weaks != NULL)
-	{
-	  struct elf_link_hash_entry *hlook;
-	  asection *slook;
-	  bfd_vma vlook;
-	  long ilook;
-	  size_t i, j, idx;
-
-	  hlook = weaks;
-	  weaks = hlook->weakdef;
-	  hlook->weakdef = NULL;
-
-	  BFD_ASSERT (hlook->root.type == bfd_link_hash_defined
-		      || hlook->root.type == bfd_link_hash_defweak
-		      || hlook->root.type == bfd_link_hash_common
-		      || hlook->root.type == bfd_link_hash_indirect);
-	  slook = hlook->root.u.def.section;
-	  vlook = hlook->root.u.def.value;
-
-	  ilook = -1;
-	  i = 0;
-	  j = sym_count;
-	  while (i < j)
-	    {
-	      bfd_signed_vma vdiff;
-	      idx = (i + j) / 2;
-	      h = sorted_sym_hash [idx];
-	      vdiff = vlook - h->root.u.def.value;
-	      if (vdiff < 0)
-		j = idx;
-	      else if (vdiff > 0)
-		i = idx + 1;
-	      else
-		{
-		  long sdiff = slook - h->root.u.def.section;
-		  if (sdiff < 0)
-		    j = idx;
-		  else if (sdiff > 0)
-		    i = idx + 1;
-		  else
-		    {
-		      ilook = idx;
-		      break;
-		    }
-		}
-	    }
-
-	  /* We didn't find a value/section match.  */
-	  if (ilook == -1)
-	    continue;
-
-	  for (i = ilook; i < sym_count; i++)
-	    {
-	      h = sorted_sym_hash [i];
-
-	      /* Stop if value or section doesn't match.  */
-	      if (h->root.u.def.value != vlook
-		  || h->root.u.def.section != slook)
-		break;
-	      else if (h != hlook)
-		{
-		  hlook->weakdef = h;
-
-		  /* If the weak definition is in the list of dynamic
-		     symbols, make sure the real definition is put
-		     there as well.  */
-		  if (hlook->dynindx != -1 && h->dynindx == -1)
-		    {
-		      if (! _bfd_elf_link_record_dynamic_symbol (info,
-								 h))
-			goto error_return;
-		    }
-
-		  /* If the real definition is in the list of dynamic
-		     symbols, make sure the weak definition is put
-		     there as well.  If we don't do this, then the
-		     dynamic loader might not merge the entries for the
-		     real definition and the weak definition.  */
-		  if (h->dynindx != -1 && hlook->dynindx == -1)
-		    {
-		      if (! _bfd_elf_link_record_dynamic_symbol (info,
-								 hlook))
-			goto error_return;
-		    }
-		  break;
-		}
-	    }
-	}
-
-      free (sorted_sym_hash);
-    }
-
-  /* If this object is the same format as the output object, and it is
-     not a shared library, then let the backend look through the
-     relocs.
-
-     This is required to build global offset table entries and to
-     arrange for dynamic relocs.  It is not required for the
-     particular common case of linking non PIC code, even when linking
-     against shared libraries, but unfortunately there is no way of
-     knowing whether an object file has been compiled PIC or not.
-     Looking through the relocs is not particularly time consuming.
-     The problem is that we must either (1) keep the relocs in memory,
-     which causes the linker to require additional runtime memory or
-     (2) read the relocs twice from the input file, which wastes time.
-     This would be a good case for using mmap.
-
-     I have no idea how to handle linking PIC code into a file of a
-     different format.  It probably can't be done.  */
-  check_relocs = get_elf_backend_data (abfd)->check_relocs;
-  if (! dynamic
-      && is_elf_hash_table (hash_table)
-      && hash_table->root.creator == abfd->xvec
-      && check_relocs != NULL)
-    {
-      asection *o;
-
-      for (o = abfd->sections; o != NULL; o = o->next)
-	{
-	  Elf_Internal_Rela *internal_relocs;
-	  bfd_boolean ok;
-
-	  if ((o->flags & SEC_RELOC) == 0
-	      || o->reloc_count == 0
-	      || ((info->strip == strip_all || info->strip == strip_debugger)
-		  && (o->flags & SEC_DEBUGGING) != 0)
-	      || bfd_is_abs_section (o->output_section))
-	    continue;
-
-	  internal_relocs = _bfd_elf_link_read_relocs (abfd, o, NULL, NULL,
-						       info->keep_memory);
-	  if (internal_relocs == NULL)
-	    goto error_return;
-
-	  ok = (*check_relocs) (abfd, info, o, internal_relocs);
-
-	  if (elf_section_data (o)->relocs != internal_relocs)
-	    free (internal_relocs);
-
-	  if (! ok)
-	    goto error_return;
-	}
-    }
-
-  /* If this is a non-traditional link, try to optimize the handling
-     of the .stab/.stabstr sections.  */
-  if (! dynamic
-      && ! info->traditional_format
-      && is_elf_hash_table (hash_table)
-      && (info->strip != strip_all && info->strip != strip_debugger))
-    {
-      asection *stabstr;
-
-      stabstr = bfd_get_section_by_name (abfd, ".stabstr");
-      if (stabstr != NULL)
-	{
-	  bfd_size_type string_offset = 0;
-	  asection *stab;
-
-	  for (stab = abfd->sections; stab; stab = stab->next)
-	    if (strncmp (".stab", stab->name, 5) == 0
-		&& (!stab->name[5] ||
-		    (stab->name[5] == '.' && ISDIGIT (stab->name[6])))
-		&& (stab->flags & SEC_MERGE) == 0
-		&& !bfd_is_abs_section (stab->output_section))
-	      {
-		struct bfd_elf_section_data *secdata;
-
-		secdata = elf_section_data (stab);
-		if (! _bfd_link_section_stabs (abfd,
-					       & hash_table->stab_info,
-					       stab, stabstr,
-					       &secdata->sec_info,
-					       &string_offset))
-		  goto error_return;
-		if (secdata->sec_info)
-		  stab->sec_info_type = ELF_INFO_TYPE_STABS;
-	    }
-	}
-    }
-
-  if (! info->relocatable
-      && ! dynamic
-      && is_elf_hash_table (hash_table))
-    {
-      asection *s;
-
-      for (s = abfd->sections; s != NULL; s = s->next)
-	if ((s->flags & SEC_MERGE) != 0
-	    && !bfd_is_abs_section (s->output_section))
-	  {
-	    struct bfd_elf_section_data *secdata;
-
-	    secdata = elf_section_data (s);
-	    if (! _bfd_merge_section (abfd,
-				      & hash_table->merge_info,
-				      s, &secdata->sec_info))
-	      goto error_return;
-	    else if (secdata->sec_info)
-	      s->sec_info_type = ELF_INFO_TYPE_MERGE;
-	  }
-    }
-
-  if (is_elf_hash_table (hash_table))
-    {
-      /* Add this bfd to the loaded list.  */
-      struct elf_link_loaded_list *n;
-
-      n = bfd_alloc (abfd, sizeof (struct elf_link_loaded_list));
-      if (n == NULL)
-	goto error_return;
-      n->abfd = abfd;
-      n->next = hash_table->loaded;
-      hash_table->loaded = n;
-    }
-
-  return TRUE;
-
- error_free_vers:
-  if (nondeflt_vers != NULL)
-    free (nondeflt_vers);
-  if (extversym != NULL)
-    free (extversym);
- error_free_sym:
-  if (isymbuf != NULL)
-    free (isymbuf);
- error_return:
-  return FALSE;
-}
-
-/* Add an entry to the .dynamic table.  */
-
-bfd_boolean
-elf_add_dynamic_entry (struct bfd_link_info *info, bfd_vma tag, bfd_vma val)
-{
-  Elf_Internal_Dyn dyn;
-  bfd *dynobj;
-  asection *s;
-  bfd_size_type newsize;
-  bfd_byte *newcontents;
-
-  if (! is_elf_hash_table (info->hash))
-    return FALSE;
-
-  dynobj = elf_hash_table (info)->dynobj;
-
-  s = bfd_get_section_by_name (dynobj, ".dynamic");
-  BFD_ASSERT (s != NULL);
-
-  newsize = s->_raw_size + sizeof (Elf_External_Dyn);
-  newcontents = bfd_realloc (s->contents, newsize);
-  if (newcontents == NULL)
-    return FALSE;
-
-  dyn.d_tag = tag;
-  dyn.d_un.d_val = val;
-  elf_swap_dyn_out (dynobj, &dyn,
-		    (Elf_External_Dyn *) (newcontents + s->_raw_size));
-
-  s->_raw_size = newsize;
-  s->contents = newcontents;
-
-  return TRUE;
-}
-
-/* Array used to determine the number of hash table buckets to use
-   based on the number of symbols there are.  If there are fewer than
-   3 symbols we use 1 bucket, fewer than 17 symbols we use 3 buckets,
-   fewer than 37 we use 17 buckets, and so forth.  We never use more
-   than 32771 buckets.  */
-
-static const size_t elf_buckets[] =
-{
-  1, 3, 17, 37, 67, 97, 131, 197, 263, 521, 1031, 2053, 4099, 8209,
-  16411, 32771, 0
-};
-
-/* Compute bucket count for hashing table.  We do not use a static set
-   of possible tables sizes anymore.  Instead we determine for all
-   possible reasonable sizes of the table the outcome (i.e., the
-   number of collisions etc) and choose the best solution.  The
-   weighting functions are not too simple to allow the table to grow
-   without bounds.  Instead one of the weighting factors is the size.
-   Therefore the result is always a good payoff between few collisions
-   (= short chain lengths) and table size.  */
-static size_t
-compute_bucket_count (struct bfd_link_info *info)
-{
-  size_t dynsymcount = elf_hash_table (info)->dynsymcount;
-  size_t best_size = 0;
-  unsigned long int *hashcodes;
-  unsigned long int *hashcodesp;
-  unsigned long int i;
-  bfd_size_type amt;
-
-  /* Compute the hash values for all exported symbols.  At the same
-     time store the values in an array so that we could use them for
-     optimizations.  */
-  amt = dynsymcount;
-  amt *= sizeof (unsigned long int);
-  hashcodes = bfd_malloc (amt);
-  if (hashcodes == NULL)
-    return 0;
-  hashcodesp = hashcodes;
-
-  /* Put all hash values in HASHCODES.  */
-  elf_link_hash_traverse (elf_hash_table (info),
-			  elf_collect_hash_codes, &hashcodesp);
-
-  /* We have a problem here.  The following code to optimize the table
-     size requires an integer type with more the 32 bits.  If
-     BFD_HOST_U_64_BIT is set we know about such a type.  */
-#ifdef BFD_HOST_U_64_BIT
-  if (info->optimize)
-    {
-      unsigned long int nsyms = hashcodesp - hashcodes;
-      size_t minsize;
-      size_t maxsize;
-      BFD_HOST_U_64_BIT best_chlen = ~((BFD_HOST_U_64_BIT) 0);
-      unsigned long int *counts ;
-
-      /* Possible optimization parameters: if we have NSYMS symbols we say
-	 that the hashing table must at least have NSYMS/4 and at most
-	 2*NSYMS buckets.  */
-      minsize = nsyms / 4;
-      if (minsize == 0)
-	minsize = 1;
-      best_size = maxsize = nsyms * 2;
-
-      /* Create array where we count the collisions in.  We must use bfd_malloc
-	 since the size could be large.  */
-      amt = maxsize;
-      amt *= sizeof (unsigned long int);
-      counts = bfd_malloc (amt);
-      if (counts == NULL)
-	{
-	  free (hashcodes);
-	  return 0;
-	}
-
-      /* Compute the "optimal" size for the hash table.  The criteria is a
-	 minimal chain length.  The minor criteria is (of course) the size
-	 of the table.  */
-      for (i = minsize; i < maxsize; ++i)
-	{
-	  /* Walk through the array of hashcodes and count the collisions.  */
-	  BFD_HOST_U_64_BIT max;
-	  unsigned long int j;
-	  unsigned long int fact;
-
-	  memset (counts, '\0', i * sizeof (unsigned long int));
-
-	  /* Determine how often each hash bucket is used.  */
-	  for (j = 0; j < nsyms; ++j)
-	    ++counts[hashcodes[j] % i];
-
-	  /* For the weight function we need some information about the
-	     pagesize on the target.  This is information need not be 100%
-	     accurate.  Since this information is not available (so far) we
-	     define it here to a reasonable default value.  If it is crucial
-	     to have a better value some day simply define this value.  */
-# ifndef BFD_TARGET_PAGESIZE
-#  define BFD_TARGET_PAGESIZE	(4096)
-# endif
-
-	  /* We in any case need 2 + NSYMS entries for the size values and
-	     the chains.  */
-	  max = (2 + nsyms) * (ARCH_SIZE / 8);
-
-# if 1
-	  /* Variant 1: optimize for short chains.  We add the squares
-	     of all the chain lengths (which favors many small chain
-	     over a few long chains).  */
-	  for (j = 0; j < i; ++j)
-	    max += counts[j] * counts[j];
-
-	  /* This adds penalties for the overall size of the table.  */
-	  fact = i / (BFD_TARGET_PAGESIZE / (ARCH_SIZE / 8)) + 1;
-	  max *= fact * fact;
-# else
-	  /* Variant 2: Optimize a lot more for small table.  Here we
-	     also add squares of the size but we also add penalties for
-	     empty slots (the +1 term).  */
-	  for (j = 0; j < i; ++j)
-	    max += (1 + counts[j]) * (1 + counts[j]);
-
-	  /* The overall size of the table is considered, but not as
-	     strong as in variant 1, where it is squared.  */
-	  fact = i / (BFD_TARGET_PAGESIZE / (ARCH_SIZE / 8)) + 1;
-	  max *= fact;
-# endif
-
-	  /* Compare with current best results.  */
-	  if (max < best_chlen)
-	    {
-	      best_chlen = max;
-	      best_size = i;
-	    }
-	}
-
-      free (counts);
-    }
-  else
-#endif /* defined (BFD_HOST_U_64_BIT) */
-    {
-      /* This is the fallback solution if no 64bit type is available or if we
-	 are not supposed to spend much time on optimizations.  We select the
-	 bucket count using a fixed set of numbers.  */
-      for (i = 0; elf_buckets[i] != 0; i++)
-	{
-	  best_size = elf_buckets[i];
-	  if (dynsymcount < elf_buckets[i + 1])
-	    break;
-	}
-    }
-
-  /* Free the arrays we needed.  */
-  free (hashcodes);
-
-  return best_size;
-}
-
-/* Set up the sizes and contents of the ELF dynamic sections.  This is
-   called by the ELF linker emulation before_allocation routine.  We
-   must set the sizes of the sections before the linker sets the
-   addresses of the various sections.  */
-
-bfd_boolean
-NAME(bfd_elf,size_dynamic_sections) (bfd *output_bfd,
-				     const char *soname,
-				     const char *rpath,
-				     const char *filter_shlib,
-				     const char * const *auxiliary_filters,
-				     struct bfd_link_info *info,
-				     asection **sinterpptr,
-				     struct bfd_elf_version_tree *verdefs)
-{
-  bfd_size_type soname_indx;
-  bfd *dynobj;
-  const struct elf_backend_data *bed;
-  struct elf_assign_sym_version_info asvinfo;
-
-  *sinterpptr = NULL;
-
-  soname_indx = (bfd_size_type) -1;
-
-  if (!is_elf_hash_table (info->hash))
-    return TRUE;
-
-  if (info->execstack)
-    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X;
-  else if (info->noexecstack)
-    elf_tdata (output_bfd)->stack_flags = PF_R | PF_W;
-  else
-    {
-      bfd *inputobj;
-      asection *notesec = NULL;
-      int exec = 0;
-
-      for (inputobj = info->input_bfds;
-	   inputobj;
-	   inputobj = inputobj->link_next)
-	{
-	  asection *s;
-
-	  if (inputobj->flags & DYNAMIC)
-	    continue;
-	  s = bfd_get_section_by_name (inputobj, ".note.GNU-stack");
-	  if (s)
-	    {
-	      if (s->flags & SEC_CODE)
-		exec = PF_X;
-	      notesec = s;
-	    }
-	  else
-	    exec = PF_X;
-	}
-      if (notesec)
-	{
-	  elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | exec;
-	  if (exec && info->relocatable
-	      && notesec->output_section != bfd_abs_section_ptr)
-	    notesec->output_section->flags |= SEC_CODE;
-	}
-    }
-
-  /* Any syms created from now on start with -1 in
-     got.refcount/offset and plt.refcount/offset.  */
-  elf_hash_table (info)->init_refcount = elf_hash_table (info)->init_offset;
-
-  /* The backend may have to create some sections regardless of whether
-     we're dynamic or not.  */
-  bed = get_elf_backend_data (output_bfd);
-  if (bed->elf_backend_always_size_sections
-      && ! (*bed->elf_backend_always_size_sections) (output_bfd, info))
-    return FALSE;
-
-  dynobj = elf_hash_table (info)->dynobj;
-
-  /* If there were no dynamic objects in the link, there is nothing to
-     do here.  */
-  if (dynobj == NULL)
-    return TRUE;
-
-  if (! _bfd_elf_maybe_strip_eh_frame_hdr (info))
-    return FALSE;
-
-  if (elf_hash_table (info)->dynamic_sections_created)
-    {
-      struct elf_info_failed eif;
-      struct elf_link_hash_entry *h;
-      asection *dynstr;
-      struct bfd_elf_version_tree *t;
-      struct bfd_elf_version_expr *d;
-      bfd_boolean all_defined;
-
-      *sinterpptr = bfd_get_section_by_name (dynobj, ".interp");
-      BFD_ASSERT (*sinterpptr != NULL || !info->executable);
-
-      if (soname != NULL)
-	{
-	  soname_indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
-					     soname, TRUE);
-	  if (soname_indx == (bfd_size_type) -1
-	      || ! elf_add_dynamic_entry (info, DT_SONAME, soname_indx))
-	    return FALSE;
-	}
-
-      if (info->symbolic)
-	{
-	  if (! elf_add_dynamic_entry (info, DT_SYMBOLIC, 0))
-	    return FALSE;
-	  info->flags |= DF_SYMBOLIC;
-	}
-
-      if (rpath != NULL)
-	{
-	  bfd_size_type indx;
-
-	  indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, rpath,
-				      TRUE);
-	  if (info->new_dtags)
-	    _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, indx);
-	  if (indx == (bfd_size_type) -1
-	      || ! elf_add_dynamic_entry (info, DT_RPATH, indx)
-	      || (info->new_dtags
-		  && ! elf_add_dynamic_entry (info, DT_RUNPATH, indx)))
-	    return FALSE;
-	}
-
-      if (filter_shlib != NULL)
-	{
-	  bfd_size_type indx;
-
-	  indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
-				      filter_shlib, TRUE);
-	  if (indx == (bfd_size_type) -1
-	      || ! elf_add_dynamic_entry (info, DT_FILTER, indx))
-	    return FALSE;
-	}
-
-      if (auxiliary_filters != NULL)
-	{
-	  const char * const *p;
-
-	  for (p = auxiliary_filters; *p != NULL; p++)
-	    {
-	      bfd_size_type indx;
-
-	      indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
-					  *p, TRUE);
-	      if (indx == (bfd_size_type) -1
-		  || ! elf_add_dynamic_entry (info, DT_AUXILIARY, indx))
-		return FALSE;
-	    }
-	}
-
-      eif.info = info;
-      eif.verdefs = verdefs;
-      eif.failed = FALSE;
-
-      /* If we are supposed to export all symbols into the dynamic symbol
-	 table (this is not the normal case), then do so.  */
-      if (info->export_dynamic)
-	{
-	  elf_link_hash_traverse (elf_hash_table (info),
-				  _bfd_elf_export_symbol,
-				  &eif);
-	  if (eif.failed)
-	    return FALSE;
-	}
-
-      /* Make all global versions with definition.  */
-      for (t = verdefs; t != NULL; t = t->next)
-	for (d = t->globals.list; d != NULL; d = d->next)
-	  if (!d->symver && d->symbol)
-	    {
-	      const char *verstr, *name;
-	      size_t namelen, verlen, newlen;
-	      char *newname, *p;
-	      struct elf_link_hash_entry *newh;
-
-	      name = d->symbol;
-	      namelen = strlen (name);
-	      verstr = t->name;
-	      verlen = strlen (verstr);
-	      newlen = namelen + verlen + 3;
-
-	      newname = bfd_malloc (newlen);
-	      if (newname == NULL)
-		return FALSE;
-	      memcpy (newname, name, namelen);
-
-	      /* Check the hidden versioned definition.  */
-	      p = newname + namelen;
-	      *p++ = ELF_VER_CHR;
-	      memcpy (p, verstr, verlen + 1);
-	      newh = elf_link_hash_lookup (elf_hash_table (info),
-					   newname, FALSE, FALSE,
-					   FALSE);
-	      if (newh == NULL
-		  || (newh->root.type != bfd_link_hash_defined
-		      && newh->root.type != bfd_link_hash_defweak))
-		{
-		  /* Check the default versioned definition.  */
-		  *p++ = ELF_VER_CHR;
-		  memcpy (p, verstr, verlen + 1);
-		  newh = elf_link_hash_lookup (elf_hash_table (info),
-					       newname, FALSE, FALSE,
-					       FALSE);
-		}
-	      free (newname);
-
-	      /* Mark this version if there is a definition and it is
-		 not defined in a shared object.  */
-	      if (newh != NULL
-		  && ((newh->elf_link_hash_flags
-		       & ELF_LINK_HASH_DEF_DYNAMIC) == 0)
-		  && (newh->root.type == bfd_link_hash_defined
-		      || newh->root.type == bfd_link_hash_defweak))
-		d->symver = 1;
-	    }
-
-      /* Attach all the symbols to their version information.  */
-      asvinfo.output_bfd = output_bfd;
-      asvinfo.info = info;
-      asvinfo.verdefs = verdefs;
-      asvinfo.failed = FALSE;
-
-      elf_link_hash_traverse (elf_hash_table (info),
-			      _bfd_elf_link_assign_sym_version,
-			      &asvinfo);
-      if (asvinfo.failed)
-	return FALSE;
-
-      if (!info->allow_undefined_version)
-	{
-	  /* Check if all global versions have a definition.  */
-	  all_defined = TRUE;
-	  for (t = verdefs; t != NULL; t = t->next)
-	    for (d = t->globals.list; d != NULL; d = d->next)
-	      if (!d->symver && !d->script)
-		{
-		  (*_bfd_error_handler)
-		    (_("%s: undefined version: %s"),
-		     d->pattern, t->name);
-		  all_defined = FALSE;
-		}
-
-	  if (!all_defined)
-	    {
-	      bfd_set_error (bfd_error_bad_value);
-	      return FALSE;
-	    }
-	}
-
-      /* Find all symbols which were defined in a dynamic object and make
-	 the backend pick a reasonable value for them.  */
-      elf_link_hash_traverse (elf_hash_table (info),
-			      _bfd_elf_adjust_dynamic_symbol,
-			      &eif);
-      if (eif.failed)
-	return FALSE;
-
-      /* 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.  */
-
-      /* 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)
-	{
-	  if (! elf_add_dynamic_entry (info, DT_INIT, 0))
-	    return 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)
-	{
-	  if (! elf_add_dynamic_entry (info, DT_FINI, 0))
-	    return FALSE;
-	}
-
-      if (bfd_get_section_by_name (output_bfd, ".preinit_array") != NULL)
-	{
-	  /* DT_PREINIT_ARRAY is not allowed in shared library.  */
-	  if (! info->executable)
-	    {
-	      bfd *sub;
-	      asection *o;
-
-	      for (sub = info->input_bfds; sub != NULL;
-		   sub = sub->link_next)
-		for (o = sub->sections; o != NULL; o = o->next)
-		  if (elf_section_data (o)->this_hdr.sh_type
-		      == SHT_PREINIT_ARRAY)
-		    {
-		      (*_bfd_error_handler)
-			(_("%s: .preinit_array section is not allowed in DSO"),
-			 bfd_archive_filename (sub));
-		      break;
-		    }
-
-	      bfd_set_error (bfd_error_nonrepresentable_section);
-	      return FALSE;
-	    }
-
-	  if (!elf_add_dynamic_entry (info, DT_PREINIT_ARRAY, 0)
-	      || !elf_add_dynamic_entry (info, DT_PREINIT_ARRAYSZ, 0))
-	    return FALSE;
-	}
-      if (bfd_get_section_by_name (output_bfd, ".init_array") != NULL)
-	{
-	  if (!elf_add_dynamic_entry (info, DT_INIT_ARRAY, 0)
-	      || !elf_add_dynamic_entry (info, DT_INIT_ARRAYSZ, 0))
-	    return FALSE;
-	}
-      if (bfd_get_section_by_name (output_bfd, ".fini_array") != NULL)
-	{
-	  if (!elf_add_dynamic_entry (info, DT_FINI_ARRAY, 0)
-	      || !elf_add_dynamic_entry (info, DT_FINI_ARRAYSZ, 0))
-	    return FALSE;
-	}
-
-      dynstr = bfd_get_section_by_name (dynobj, ".dynstr");
-      /* If .dynstr is excluded from the link, we don't want any of
-	 these tags.  Strictly, we should be checking each section
-	 individually;  This quick check covers for the case where
-	 someone does a /DISCARD/ : { *(*) }.  */
-      if (dynstr != NULL && dynstr->output_section != bfd_abs_section_ptr)
-	{
-	  bfd_size_type strsize;
-
-	  strsize = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr);
-	  if (! elf_add_dynamic_entry (info, DT_HASH, 0)
-	      || ! elf_add_dynamic_entry (info, DT_STRTAB, 0)
-	      || ! elf_add_dynamic_entry (info, DT_SYMTAB, 0)
-	      || ! elf_add_dynamic_entry (info, DT_STRSZ, strsize)
-	      || ! elf_add_dynamic_entry (info, DT_SYMENT,
-					  sizeof (Elf_External_Sym)))
-	    return FALSE;
-	}
-    }
-
-  /* The backend must work out the sizes of all the other dynamic
-     sections.  */
-  if (bed->elf_backend_size_dynamic_sections
-      && ! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info))
-    return FALSE;
-
-  if (elf_hash_table (info)->dynamic_sections_created)
-    {
-      bfd_size_type dynsymcount;
-      asection *s;
-      size_t bucketcount = 0;
-      size_t hash_entry_size;
-      unsigned int dtagcount;
-
-      /* Set up the version definition section.  */
-      s = bfd_get_section_by_name (dynobj, ".gnu.version_d");
-      BFD_ASSERT (s != NULL);
-
-      /* We may have created additional version definitions if we are
-	 just linking a regular application.  */
-      verdefs = asvinfo.verdefs;
-
-      /* Skip anonymous version tag.  */
-      if (verdefs != NULL && verdefs->vernum == 0)
-	verdefs = verdefs->next;
-
-      if (verdefs == NULL)
-	_bfd_strip_section_from_output (info, s);
-      else
-	{
-	  unsigned int cdefs;
-	  bfd_size_type size;
-	  struct bfd_elf_version_tree *t;
-	  bfd_byte *p;
-	  Elf_Internal_Verdef def;
-	  Elf_Internal_Verdaux defaux;
-
-	  cdefs = 0;
-	  size = 0;
-
-	  /* Make space for the base version.  */
-	  size += sizeof (Elf_External_Verdef);
-	  size += sizeof (Elf_External_Verdaux);
-	  ++cdefs;
-
-	  for (t = verdefs; t != NULL; t = t->next)
-	    {
-	      struct bfd_elf_version_deps *n;
-
-	      size += sizeof (Elf_External_Verdef);
-	      size += sizeof (Elf_External_Verdaux);
-	      ++cdefs;
-
-	      for (n = t->deps; n != NULL; n = n->next)
-		size += sizeof (Elf_External_Verdaux);
-	    }
-
-	  s->_raw_size = size;
-	  s->contents = bfd_alloc (output_bfd, s->_raw_size);
-	  if (s->contents == NULL && s->_raw_size != 0)
-	    return FALSE;
-
-	  /* Fill in the version definition section.  */
-
-	  p = s->contents;
-
-	  def.vd_version = VER_DEF_CURRENT;
-	  def.vd_flags = VER_FLG_BASE;
-	  def.vd_ndx = 1;
-	  def.vd_cnt = 1;
-	  def.vd_aux = sizeof (Elf_External_Verdef);
-	  def.vd_next = (sizeof (Elf_External_Verdef)
-			 + sizeof (Elf_External_Verdaux));
-
-	  if (soname_indx != (bfd_size_type) -1)
-	    {
-	      _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr,
-				      soname_indx);
-	      def.vd_hash = bfd_elf_hash (soname);
-	      defaux.vda_name = soname_indx;
-	    }
-	  else
-	    {
-	      const char *name;
-	      bfd_size_type indx;
-
-	      name = basename (output_bfd->filename);
-	      def.vd_hash = bfd_elf_hash (name);
-	      indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
-					  name, FALSE);
-	      if (indx == (bfd_size_type) -1)
-		return FALSE;
-	      defaux.vda_name = indx;
-	    }
-	  defaux.vda_next = 0;
-
-	  _bfd_elf_swap_verdef_out (output_bfd, &def,
-				    (Elf_External_Verdef *) p);
-	  p += sizeof (Elf_External_Verdef);
-	  _bfd_elf_swap_verdaux_out (output_bfd, &defaux,
-				     (Elf_External_Verdaux *) p);
-	  p += sizeof (Elf_External_Verdaux);
-
-	  for (t = verdefs; t != NULL; t = t->next)
-	    {
-	      unsigned int cdeps;
-	      struct bfd_elf_version_deps *n;
-	      struct elf_link_hash_entry *h;
-	      struct bfd_link_hash_entry *bh;
-
-	      cdeps = 0;
-	      for (n = t->deps; n != NULL; n = n->next)
-		++cdeps;
-
-	      /* Add a symbol representing this version.  */
-	      bh = NULL;
-	      if (! (_bfd_generic_link_add_one_symbol
-		     (info, dynobj, t->name, BSF_GLOBAL, bfd_abs_section_ptr,
-		      0, NULL, FALSE,
-		      get_elf_backend_data (dynobj)->collect, &bh)))
-		return FALSE;
-	      h = (struct elf_link_hash_entry *) bh;
-	      h->elf_link_hash_flags &= ~ ELF_LINK_NON_ELF;
-	      h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
-	      h->type = STT_OBJECT;
-	      h->verinfo.vertree = t;
-
-	      if (! _bfd_elf_link_record_dynamic_symbol (info, h))
-		return FALSE;
-
-	      def.vd_version = VER_DEF_CURRENT;
-	      def.vd_flags = 0;
-	      if (t->globals.list == NULL && t->locals.list == NULL && ! t->used)
-		def.vd_flags |= VER_FLG_WEAK;
-	      def.vd_ndx = t->vernum + 1;
-	      def.vd_cnt = cdeps + 1;
-	      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)
-			       + (cdeps + 1) * sizeof (Elf_External_Verdaux));
-	      else
-		def.vd_next = 0;
-
-	      _bfd_elf_swap_verdef_out (output_bfd, &def,
-					(Elf_External_Verdef *) p);
-	      p += sizeof (Elf_External_Verdef);
-
-	      defaux.vda_name = h->dynstr_index;
-	      _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr,
-				      h->dynstr_index);
-	      if (t->deps == NULL)
-		defaux.vda_next = 0;
-	      else
-		defaux.vda_next = sizeof (Elf_External_Verdaux);
-	      t->name_indx = defaux.vda_name;
-
-	      _bfd_elf_swap_verdaux_out (output_bfd, &defaux,
-					 (Elf_External_Verdaux *) p);
-	      p += sizeof (Elf_External_Verdaux);
-
-	      for (n = t->deps; n != NULL; n = n->next)
-		{
-		  if (n->version_needed == NULL)
-		    {
-		      /* This can happen if there was an error in the
-			 version script.  */
-		      defaux.vda_name = 0;
-		    }
-		  else
-		    {
-		      defaux.vda_name = n->version_needed->name_indx;
-		      _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr,
-					      defaux.vda_name);
-		    }
-		  if (n->next == NULL)
-		    defaux.vda_next = 0;
-		  else
-		    defaux.vda_next = sizeof (Elf_External_Verdaux);
-
-		  _bfd_elf_swap_verdaux_out (output_bfd, &defaux,
-					     (Elf_External_Verdaux *) p);
-		  p += sizeof (Elf_External_Verdaux);
-		}
-	    }
-
-	  if (! elf_add_dynamic_entry (info, DT_VERDEF, 0)
-	      || ! elf_add_dynamic_entry (info, DT_VERDEFNUM, cdefs))
-	    return FALSE;
-
-	  elf_tdata (output_bfd)->cverdefs = cdefs;
-	}
-
-      if ((info->new_dtags && info->flags) || (info->flags & DF_STATIC_TLS))
-	{
-	  if (! elf_add_dynamic_entry (info, DT_FLAGS, info->flags))
-	    return FALSE;
-	}
-      else if (info->flags & DF_BIND_NOW)
-	{
-	  if (! elf_add_dynamic_entry (info, DT_BIND_NOW, 0))
-	    return FALSE;
-	}
-
-      if (info->flags_1)
-	{
-	  if (info->executable)
-	    info->flags_1 &= ~ (DF_1_INITFIRST
-				| DF_1_NODELETE
-				| DF_1_NOOPEN);
-	  if (! elf_add_dynamic_entry (info, DT_FLAGS_1, info->flags_1))
-	    return FALSE;
-	}
-
-      /* Work out the size of the version reference section.  */
-
-      s = bfd_get_section_by_name (dynobj, ".gnu.version_r");
-      BFD_ASSERT (s != NULL);
-      {
-	struct elf_find_verdep_info sinfo;
-
-	sinfo.output_bfd = output_bfd;
-	sinfo.info = info;
-	sinfo.vers = elf_tdata (output_bfd)->cverdefs;
-	if (sinfo.vers == 0)
-	  sinfo.vers = 1;
-	sinfo.failed = FALSE;
-
-	elf_link_hash_traverse (elf_hash_table (info),
-				_bfd_elf_link_find_version_dependencies,
-				&sinfo);
-
-	if (elf_tdata (output_bfd)->verref == NULL)
-	  _bfd_strip_section_from_output (info, s);
-	else
-	  {
-	    Elf_Internal_Verneed *t;
-	    unsigned int size;
-	    unsigned int crefs;
-	    bfd_byte *p;
-
-	    /* Build the version definition section.  */
-	    size = 0;
-	    crefs = 0;
-	    for (t = elf_tdata (output_bfd)->verref;
-		 t != NULL;
-		 t = t->vn_nextref)
-	      {
-		Elf_Internal_Vernaux *a;
-
-		size += sizeof (Elf_External_Verneed);
-		++crefs;
-		for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
-		  size += sizeof (Elf_External_Vernaux);
-	      }
-
-	    s->_raw_size = size;
-	    s->contents = bfd_alloc (output_bfd, s->_raw_size);
-	    if (s->contents == NULL)
-	      return FALSE;
-
-	    p = s->contents;
-	    for (t = elf_tdata (output_bfd)->verref;
-		 t != NULL;
-		 t = t->vn_nextref)
-	      {
-		unsigned int caux;
-		Elf_Internal_Vernaux *a;
-		bfd_size_type indx;
-
-		caux = 0;
-		for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
-		  ++caux;
-
-		t->vn_version = VER_NEED_CURRENT;
-		t->vn_cnt = caux;
-		indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
-					    elf_dt_name (t->vn_bfd) != NULL
-					    ? elf_dt_name (t->vn_bfd)
-					    : basename (t->vn_bfd->filename),
-					    FALSE);
-		if (indx == (bfd_size_type) -1)
-		  return FALSE;
-		t->vn_file = indx;
-		t->vn_aux = sizeof (Elf_External_Verneed);
-		if (t->vn_nextref == NULL)
-		  t->vn_next = 0;
-		else
-		  t->vn_next = (sizeof (Elf_External_Verneed)
-				+ caux * sizeof (Elf_External_Vernaux));
-
-		_bfd_elf_swap_verneed_out (output_bfd, t,
-					   (Elf_External_Verneed *) p);
-		p += sizeof (Elf_External_Verneed);
-
-		for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr)
-		  {
-		    a->vna_hash = bfd_elf_hash (a->vna_nodename);
-		    indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr,
-						a->vna_nodename, FALSE);
-		    if (indx == (bfd_size_type) -1)
-		      return FALSE;
-		    a->vna_name = indx;
-		    if (a->vna_nextptr == NULL)
-		      a->vna_next = 0;
-		    else
-		      a->vna_next = sizeof (Elf_External_Vernaux);
-
-		    _bfd_elf_swap_vernaux_out (output_bfd, a,
-					       (Elf_External_Vernaux *) p);
-		    p += sizeof (Elf_External_Vernaux);
-		  }
-	      }
-
-	    if (! elf_add_dynamic_entry (info, DT_VERNEED, 0)
-		|| ! elf_add_dynamic_entry (info, DT_VERNEEDNUM, crefs))
-	      return FALSE;
-
-	    elf_tdata (output_bfd)->cverrefs = crefs;
-	  }
-      }
-
-      /* 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");
-      BFD_ASSERT (s != NULL);
-      if (dynsymcount == 0
-	  || (verdefs == NULL && elf_tdata (output_bfd)->verref == NULL))
-	{
-	  _bfd_strip_section_from_output (info, 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
-	{
-	  s->_raw_size = dynsymcount * sizeof (Elf_External_Versym);
-	  s->contents = bfd_zalloc (output_bfd, s->_raw_size);
-	  if (s->contents == NULL)
-	    return FALSE;
-
-	  if (! elf_add_dynamic_entry (info, DT_VERSYM, 0))
-	    return FALSE;
-	}
-
-      /* Set the size of the .dynsym and .hash sections.  We counted
-	 the number of dynamic symbols in elf_link_add_object_symbols.
-	 We will build the contents of .dynsym and .hash when we build
-	 the final symbol table, because until then we do not know the
-	 correct value to give the symbols.  We built the .dynstr
-	 section as we went along in elf_link_add_object_symbols.  */
-      s = bfd_get_section_by_name (dynobj, ".dynsym");
-      BFD_ASSERT (s != NULL);
-      s->_raw_size = dynsymcount * sizeof (Elf_External_Sym);
-      s->contents = bfd_alloc (output_bfd, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
-	return FALSE;
-
-      if (dynsymcount != 0)
-	{
-	  Elf_Internal_Sym isym;
-
-	  /* The first entry in .dynsym is a dummy symbol.  */
-	  isym.st_value = 0;
-	  isym.st_size = 0;
-	  isym.st_name = 0;
-	  isym.st_info = 0;
-	  isym.st_other = 0;
-	  isym.st_shndx = 0;
-	  elf_swap_symbol_out (output_bfd, &isym, s->contents, 0);
-	}
-
-      /* Compute the size of the hashing table.  As a side effect this
-	 computes the hash values for all the names we export.  */
-      bucketcount = compute_bucket_count (info);
-
-      s = bfd_get_section_by_name (dynobj, ".hash");
-      BFD_ASSERT (s != NULL);
-      hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize;
-      s->_raw_size = ((2 + bucketcount + dynsymcount) * hash_entry_size);
-      s->contents = bfd_zalloc (output_bfd, s->_raw_size);
-      if (s->contents == NULL)
-	return FALSE;
-
-      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;
-
-      s = bfd_get_section_by_name (dynobj, ".dynstr");
-      BFD_ASSERT (s != NULL);
-
-      elf_finalize_dynstr (output_bfd, info);
-
-      s->_raw_size = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr);
-
-      for (dtagcount = 0; dtagcount <= info->spare_dynamic_tags; ++dtagcount)
-	if (! elf_add_dynamic_entry (info, DT_NULL, 0))
-	  return FALSE;
-    }
-
-  return TRUE;
-}
-
-/* This function is used to adjust offsets into .dynstr for
-   dynamic symbols.  This is called via elf_link_hash_traverse.  */
-
-static bfd_boolean
-elf_adjust_dynstr_offsets (struct elf_link_hash_entry *h, void *data)
-{
-  struct elf_strtab_hash *dynstr = data;
-
-  if (h->root.type == bfd_link_hash_warning)
-    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
-  if (h->dynindx != -1)
-    h->dynstr_index = _bfd_elf_strtab_offset (dynstr, h->dynstr_index);
-  return TRUE;
-}
-
-/* Assign string offsets in .dynstr, update all structures referencing
-   them.  */
-
-static bfd_boolean
-elf_finalize_dynstr (bfd *output_bfd, struct bfd_link_info *info)
-{
-  struct elf_link_local_dynamic_entry *entry;
-  struct elf_strtab_hash *dynstr = elf_hash_table (info)->dynstr;
-  bfd *dynobj = elf_hash_table (info)->dynobj;
-  asection *sdyn;
-  bfd_size_type size;
-  Elf_External_Dyn *dyncon, *dynconend;
-
-  _bfd_elf_strtab_finalize (dynstr);
-  size = _bfd_elf_strtab_size (dynstr);
-
-  /* Update all .dynamic entries referencing .dynstr strings.  */
-  sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
-  BFD_ASSERT (sdyn != NULL);
-
-  dyncon = (Elf_External_Dyn *) sdyn->contents;
-  dynconend = (Elf_External_Dyn *) (sdyn->contents +
-				    sdyn->_raw_size);
-  for (; dyncon < dynconend; dyncon++)
-    {
-      Elf_Internal_Dyn dyn;
-
-      elf_swap_dyn_in (dynobj, dyncon, & dyn);
-      switch (dyn.d_tag)
-	{
-	case DT_STRSZ:
-	  dyn.d_un.d_val = size;
-	  elf_swap_dyn_out (dynobj, & dyn, dyncon);
-	  break;
-	case DT_NEEDED:
-	case DT_SONAME:
-	case DT_RPATH:
-	case DT_RUNPATH:
-	case DT_FILTER:
-	case DT_AUXILIARY:
-	  dyn.d_un.d_val = _bfd_elf_strtab_offset (dynstr, dyn.d_un.d_val);
-	  elf_swap_dyn_out (dynobj, & dyn, dyncon);
-	  break;
-	default:
-	  break;
-	}
-    }
-
-  /* Now update local dynamic symbols.  */
-  for (entry = elf_hash_table (info)->dynlocal; entry ; entry = entry->next)
-    entry->isym.st_name = _bfd_elf_strtab_offset (dynstr,
-						  entry->isym.st_name);
-
-  /* And the rest of dynamic symbols.  */
-  elf_link_hash_traverse (elf_hash_table (info),
-			  elf_adjust_dynstr_offsets, dynstr);
-
-  /* Adjust version definitions.  */
-  if (elf_tdata (output_bfd)->cverdefs)
-    {
-      asection *s;
-      bfd_byte *p;
-      bfd_size_type i;
-      Elf_Internal_Verdef def;
-      Elf_Internal_Verdaux defaux;
-
-      s = bfd_get_section_by_name (dynobj, ".gnu.version_d");
-      p = (bfd_byte *) s->contents;
-      do
-	{
-	  _bfd_elf_swap_verdef_in (output_bfd, (Elf_External_Verdef *) p,
-				   &def);
-	  p += sizeof (Elf_External_Verdef);
-	  for (i = 0; i < def.vd_cnt; ++i)
-	    {
-	      _bfd_elf_swap_verdaux_in (output_bfd,
-					(Elf_External_Verdaux *) p, &defaux);
-	      defaux.vda_name = _bfd_elf_strtab_offset (dynstr,
-							defaux.vda_name);
-	      _bfd_elf_swap_verdaux_out (output_bfd,
-					 &defaux, (Elf_External_Verdaux *) p);
-	      p += sizeof (Elf_External_Verdaux);
-	    }
-	}
-      while (def.vd_next);
-    }
-
-  /* Adjust version references.  */
-  if (elf_tdata (output_bfd)->verref)
-    {
-      asection *s;
-      bfd_byte *p;
-      bfd_size_type i;
-      Elf_Internal_Verneed need;
-      Elf_Internal_Vernaux needaux;
-
-      s = bfd_get_section_by_name (dynobj, ".gnu.version_r");
-      p = (bfd_byte *) s->contents;
-      do
-	{
-	  _bfd_elf_swap_verneed_in (output_bfd, (Elf_External_Verneed *) p,
-				    &need);
-	  need.vn_file = _bfd_elf_strtab_offset (dynstr, need.vn_file);
-	  _bfd_elf_swap_verneed_out (output_bfd, &need,
-				     (Elf_External_Verneed *) p);
-	  p += sizeof (Elf_External_Verneed);
-	  for (i = 0; i < need.vn_cnt; ++i)
-	    {
-	      _bfd_elf_swap_vernaux_in (output_bfd,
-					(Elf_External_Vernaux *) p, &needaux);
-	      needaux.vna_name = _bfd_elf_strtab_offset (dynstr,
-							 needaux.vna_name);
-	      _bfd_elf_swap_vernaux_out (output_bfd,
-					 &needaux,
-					 (Elf_External_Vernaux *) p);
-	      p += sizeof (Elf_External_Vernaux);
-	    }
-	}
-      while (need.vn_next);
-    }
-
-  return TRUE;
-}
-
-/* Final phase of ELF linker.  */
-
-/* A structure we use to avoid passing large numbers of arguments.  */
-
-struct elf_final_link_info
-{
-  /* General link information.  */
-  struct bfd_link_info *info;
-  /* Output BFD.  */
-  bfd *output_bfd;
-  /* Symbol string table.  */
-  struct bfd_strtab_hash *symstrtab;
-  /* .dynsym section.  */
-  asection *dynsym_sec;
-  /* .hash section.  */
-  asection *hash_sec;
-  /* symbol version section (.gnu.version).  */
-  asection *symver_sec;
-  /* Buffer large enough to hold contents of any section.  */
-  bfd_byte *contents;
-  /* Buffer large enough to hold external relocs of any section.  */
-  void *external_relocs;
-  /* Buffer large enough to hold internal relocs of any section.  */
-  Elf_Internal_Rela *internal_relocs;
-  /* Buffer large enough to hold external local symbols of any input
-     BFD.  */
-  Elf_External_Sym *external_syms;
-  /* And a buffer for symbol section indices.  */
-  Elf_External_Sym_Shndx *locsym_shndx;
-  /* Buffer large enough to hold internal local symbols of any input
-     BFD.  */
-  Elf_Internal_Sym *internal_syms;
-  /* Array large enough to hold a symbol index for each local symbol
-     of any input BFD.  */
-  long *indices;
-  /* Array large enough to hold a section pointer for each local
-     symbol of any input BFD.  */
-  asection **sections;
-  /* Buffer to hold swapped out symbols.  */
-  Elf_External_Sym *symbuf;
-  /* And one for symbol section indices.  */
-  Elf_External_Sym_Shndx *symshndxbuf;
-  /* Number of swapped out symbols in buffer.  */
-  size_t symbuf_count;
-  /* Number of symbols which fit in symbuf.  */
-  size_t symbuf_size;
-  /* And same for symshndxbuf.  */
-  size_t shndxbuf_size;
-};
-
-static bfd_boolean elf_link_output_sym
-  (struct elf_final_link_info *, const char *, Elf_Internal_Sym *, asection *,
-   struct elf_link_hash_entry *);
-static bfd_boolean elf_link_flush_output_syms
-  (struct elf_final_link_info *);
-static bfd_boolean elf_link_output_extsym
-  (struct elf_link_hash_entry *, void *);
-static bfd_boolean elf_link_input_bfd
-  (struct elf_final_link_info *, bfd *);
-static bfd_boolean elf_reloc_link_order
-  (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *);
-
-/* This struct is used to pass information to elf_link_output_extsym.  */
-
-struct elf_outext_info
-{
-  bfd_boolean failed;
-  bfd_boolean localsyms;
-  struct elf_final_link_info *finfo;
-};
-
-/* When performing a relocatable 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 (bfd *abfd,
-			Elf_Internal_Shdr *rel_hdr,
-			unsigned int count,
-			struct elf_link_hash_entry **rel_hash)
-{
-  unsigned int i;
-  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
-  bfd_byte *erela;
-  void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *);
-  void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
-
-  if (rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
-    {
-      swap_in = bed->s->swap_reloc_in;
-      swap_out = bed->s->swap_reloc_out;
-    }
-  else if (rel_hdr->sh_entsize == sizeof (Elf_External_Rela))
-    {
-      swap_in = bed->s->swap_reloca_in;
-      swap_out = bed->s->swap_reloca_out;
-    }
-  else
-    abort ();
-
-  if (bed->s->int_rels_per_ext_rel > MAX_INT_RELS_PER_EXT_REL)
-    abort ();
-
-  erela = rel_hdr->contents;
-  for (i = 0; i < count; i++, rel_hash++, erela += rel_hdr->sh_entsize)
-    {
-      Elf_Internal_Rela irela[MAX_INT_RELS_PER_EXT_REL];
-      unsigned int j;
-
-      if (*rel_hash == NULL)
-	continue;
-
-      BFD_ASSERT ((*rel_hash)->indx >= 0);
-
-      (*swap_in) (abfd, erela, irela);
-      for (j = 0; j < bed->s->int_rels_per_ext_rel; j++)
-	irela[j].r_info = ELF_R_INFO ((*rel_hash)->indx,
-				      ELF_R_TYPE (irela[j].r_info));
-      (*swap_out) (abfd, irela, erela);
-    }
-}
-
-struct elf_link_sort_rela
-{
-  bfd_vma offset;
-  enum elf_reloc_type_class type;
-  /* We use this as an array of size int_rels_per_ext_rel.  */
-  Elf_Internal_Rela rela[1];
-};
-
-static int
-elf_link_sort_cmp1 (const void *A, const void *B)
-{
-  const struct elf_link_sort_rela *a = A;
-  const struct elf_link_sort_rela *b = B;
-  int relativea, relativeb;
-
-  relativea = a->type == reloc_class_relative;
-  relativeb = b->type == reloc_class_relative;
-
-  if (relativea < relativeb)
-    return 1;
-  if (relativea > relativeb)
-    return -1;
-  if (ELF_R_SYM (a->rela->r_info) < ELF_R_SYM (b->rela->r_info))
-    return -1;
-  if (ELF_R_SYM (a->rela->r_info) > ELF_R_SYM (b->rela->r_info))
-    return 1;
-  if (a->rela->r_offset < b->rela->r_offset)
-    return -1;
-  if (a->rela->r_offset > b->rela->r_offset)
-    return 1;
-  return 0;
-}
-
-static int
-elf_link_sort_cmp2 (const void *A, const void *B)
-{
-  const struct elf_link_sort_rela *a = A;
-  const struct elf_link_sort_rela *b = B;
-  int copya, copyb;
-
-  if (a->offset < b->offset)
-    return -1;
-  if (a->offset > b->offset)
-    return 1;
-  copya = (a->type == reloc_class_copy) * 2 + (a->type == reloc_class_plt);
-  copyb = (b->type == reloc_class_copy) * 2 + (b->type == reloc_class_plt);
-  if (copya < copyb)
-    return -1;
-  if (copya > copyb)
-    return 1;
-  if (a->rela->r_offset < b->rela->r_offset)
-    return -1;
-  if (a->rela->r_offset > b->rela->r_offset)
-    return 1;
-  return 0;
-}
-
-static size_t
-elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec)
-{
-  asection *reldyn;
-  bfd_size_type count, size;
-  size_t i, ret, sort_elt, ext_size;
-  bfd_byte *sort, *s_non_relative, *p;
-  struct elf_link_sort_rela *sq;
-  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
-  int i2e = bed->s->int_rels_per_ext_rel;
-  void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *);
-  void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *);
-  struct bfd_link_order *lo;
-
-  reldyn = bfd_get_section_by_name (abfd, ".rela.dyn");
-  if (reldyn == NULL || reldyn->_raw_size == 0)
-    {
-      reldyn = bfd_get_section_by_name (abfd, ".rel.dyn");
-      if (reldyn == NULL || reldyn->_raw_size == 0)
-	return 0;
-      ext_size = sizeof (Elf_External_Rel);
-      swap_in = bed->s->swap_reloc_in;
-      swap_out = bed->s->swap_reloc_out;
-    }
-  else
-    {
-      ext_size = sizeof (Elf_External_Rela);
-      swap_in = bed->s->swap_reloca_in;
-      swap_out = bed->s->swap_reloca_out;
-    }
-  count = reldyn->_raw_size / ext_size;
-
-  size = 0;
-  for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next)
-    if (lo->type == bfd_indirect_link_order)
-      {
-	asection *o = lo->u.indirect.section;
-	size += o->_raw_size;
-      }
-
-  if (size != reldyn->_raw_size)
-    return 0;
-
-  sort_elt = (sizeof (struct elf_link_sort_rela)
-	      + (i2e - 1) * sizeof (Elf_Internal_Rela));
-  sort = bfd_zmalloc (sort_elt * count);
-  if (sort == NULL)
-    {
-      (*info->callbacks->warning)
-	(info, _("Not enough memory to sort relocations"), 0, abfd, 0, 0);
-      return 0;
-    }
-
-  for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next)
-    if (lo->type == bfd_indirect_link_order)
-      {
-	bfd_byte *erel, *erelend;
-	asection *o = lo->u.indirect.section;
-
-	erel = o->contents;
-	erelend = o->contents + o->_raw_size;
-	p = sort + o->output_offset / ext_size * sort_elt;
-	while (erel < erelend)
-	  {
-	    struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p;
-	    (*swap_in) (abfd, erel, s->rela);
-	    s->type = (*bed->elf_backend_reloc_type_class) (s->rela);
-	    p += sort_elt;
-	    erel += ext_size;
-	  }
-      }
-
-  qsort (sort, count, sort_elt, elf_link_sort_cmp1);
-
-  for (i = 0, p = sort; i < count; i++, p += sort_elt)
-    {
-      struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p;
-      if (s->type != reloc_class_relative)
-	break;
-    }
-  ret = i;
-  s_non_relative = p;
-
-  sq = (struct elf_link_sort_rela *) s_non_relative;
-  for (; i < count; i++, p += sort_elt)
-    {
-      struct elf_link_sort_rela *sp = (struct elf_link_sort_rela *) p;
-      if (ELF_R_SYM (sp->rela->r_info) != ELF_R_SYM (sq->rela->r_info))
-	sq = sp;
-      sp->offset = sq->rela->r_offset;
-    }
-
-  qsort (s_non_relative, count - ret, sort_elt, elf_link_sort_cmp2);
-
-  for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next)
-    if (lo->type == bfd_indirect_link_order)
-      {
-	bfd_byte *erel, *erelend;
-	asection *o = lo->u.indirect.section;
-
-	erel = o->contents;
-	erelend = o->contents + o->_raw_size;
-	p = sort + o->output_offset / ext_size * sort_elt;
-	while (erel < erelend)
-	  {
-	    struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p;
-	    (*swap_out) (abfd, s->rela, erel);
-	    p += sort_elt;
-	    erel += ext_size;
-	  }
-      }
-
-  free (sort);
-  *psec = reldyn;
-  return ret;
-}
-
-/* Do the final step of an ELF link.  */
-
-bfd_boolean
-elf_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
-{
-  bfd_boolean dynamic;
-  bfd_boolean emit_relocs;
-  bfd *dynobj;
-  struct elf_final_link_info finfo;
-  register asection *o;
-  register struct bfd_link_order *p;
-  register bfd *sub;
-  bfd_size_type max_contents_size;
-  bfd_size_type max_external_reloc_size;
-  bfd_size_type max_internal_reloc_count;
-  bfd_size_type max_sym_count;
-  bfd_size_type max_sym_shndx_count;
-  file_ptr off;
-  Elf_Internal_Sym elfsym;
-  unsigned int i;
-  Elf_Internal_Shdr *symtab_hdr;
-  Elf_Internal_Shdr *symtab_shndx_hdr;
-  Elf_Internal_Shdr *symstrtab_hdr;
-  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
-  struct elf_outext_info eoinfo;
-  bfd_boolean merged;
-  size_t relativecount = 0;
-  asection *reldyn = 0;
-  bfd_size_type amt;
-
-  if (! is_elf_hash_table (info->hash))
-    return FALSE;
-
-  if (info->shared)
-    abfd->flags |= DYNAMIC;
-
-  dynamic = elf_hash_table (info)->dynamic_sections_created;
-  dynobj = elf_hash_table (info)->dynobj;
-
-  emit_relocs = (info->relocatable
-		 || info->emitrelocations
-		 || bed->elf_backend_emit_relocs);
-
-  finfo.info = info;
-  finfo.output_bfd = abfd;
-  finfo.symstrtab = elf_stringtab_init ();
-  if (finfo.symstrtab == NULL)
-    return FALSE;
-
-  if (! dynamic)
-    {
-      finfo.dynsym_sec = NULL;
-      finfo.hash_sec = NULL;
-      finfo.symver_sec = NULL;
-    }
-  else
-    {
-      finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym");
-      finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash");
-      BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL);
-      finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version");
-      /* Note that it is OK if symver_sec is NULL.  */
-    }
-
-  finfo.contents = NULL;
-  finfo.external_relocs = NULL;
-  finfo.internal_relocs = NULL;
-  finfo.external_syms = NULL;
-  finfo.locsym_shndx = NULL;
-  finfo.internal_syms = NULL;
-  finfo.indices = NULL;
-  finfo.sections = NULL;
-  finfo.symbuf = NULL;
-  finfo.symshndxbuf = NULL;
-  finfo.symbuf_count = 0;
-  finfo.shndxbuf_size = 0;
-
-  /* Count up the number of relocations we will output for each output
-     section, so that we know the sizes of the reloc sections.  We
-     also figure out some maximum sizes.  */
-  max_contents_size = 0;
-  max_external_reloc_size = 0;
-  max_internal_reloc_count = 0;
-  max_sym_count = 0;
-  max_sym_shndx_count = 0;
-  merged = FALSE;
-  for (o = abfd->sections; o != NULL; o = o->next)
-    {
-      struct bfd_elf_section_data *esdo = elf_section_data (o);
-      o->reloc_count = 0;
-
-      for (p = o->link_order_head; p != NULL; p = p->next)
-	{
-	  unsigned int reloc_count = 0;
-	  struct bfd_elf_section_data *esdi = NULL;
-	  unsigned int *rel_count1;
-
-	  if (p->type == bfd_section_reloc_link_order
-	      || p->type == bfd_symbol_reloc_link_order)
-	    reloc_count = 1;
-	  else if (p->type == bfd_indirect_link_order)
-	    {
-	      asection *sec;
-
-	      sec = p->u.indirect.section;
-	      esdi = elf_section_data (sec);
-
-	      /* Mark all sections which are to be included in the
-		 link.  This will normally be every section.  We need
-		 to do this so that we can identify any sections which
-		 the linker has decided to not include.  */
-	      sec->linker_mark = TRUE;
-
-	      if (sec->flags & SEC_MERGE)
-		merged = TRUE;
-
-	      if (info->relocatable || info->emitrelocations)
-		reloc_count = sec->reloc_count;
-	      else if (bed->elf_backend_count_relocs)
-		{
-		  Elf_Internal_Rela * relocs;
-
-		  relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL,
-						      info->keep_memory);
-
-		  reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs);
-
-		  if (elf_section_data (o)->relocs != relocs)
-		    free (relocs);
-		}
-
-	      if (sec->_raw_size > max_contents_size)
-		max_contents_size = sec->_raw_size;
-	      if (sec->_cooked_size > max_contents_size)
-		max_contents_size = sec->_cooked_size;
-
-	      /* We are interested in just local symbols, not all
-		 symbols.  */
-	      if (bfd_get_flavour (sec->owner) == bfd_target_elf_flavour
-		  && (sec->owner->flags & DYNAMIC) == 0)
-		{
-		  size_t sym_count;
-
-		  if (elf_bad_symtab (sec->owner))
-		    sym_count = (elf_tdata (sec->owner)->symtab_hdr.sh_size
-				 / sizeof (Elf_External_Sym));
-		  else
-		    sym_count = elf_tdata (sec->owner)->symtab_hdr.sh_info;
-
-		  if (sym_count > max_sym_count)
-		    max_sym_count = sym_count;
-
-		  if (sym_count > max_sym_shndx_count
-		      && elf_symtab_shndx (sec->owner) != 0)
-		    max_sym_shndx_count = sym_count;
-
-		  if ((sec->flags & SEC_RELOC) != 0)
-		    {
-		      size_t ext_size;
-
-		      ext_size = elf_section_data (sec)->rel_hdr.sh_size;
-		      if (ext_size > max_external_reloc_size)
-			max_external_reloc_size = ext_size;
-		      if (sec->reloc_count > max_internal_reloc_count)
-			max_internal_reloc_count = sec->reloc_count;
-		    }
-		}
-	    }
-
-	  if (reloc_count == 0)
-	    continue;
-
-	  o->reloc_count += reloc_count;
-
-	  /* MIPS may have a mix of REL and RELA relocs on sections.
-	     To support this curious ABI we keep reloc counts in
-	     elf_section_data too.  We must be careful to add the
-	     relocations from the input section to the right output
-	     count.  FIXME: Get rid of one count.  We have
-	     o->reloc_count == esdo->rel_count + esdo->rel_count2.  */
-	  rel_count1 = &esdo->rel_count;
-	  if (esdi != NULL)
-	    {
-	      bfd_boolean same_size;
-	      bfd_size_type entsize1;
-
-	      entsize1 = esdi->rel_hdr.sh_entsize;
-	      BFD_ASSERT (entsize1 == sizeof (Elf_External_Rel)
-			  || entsize1 == sizeof (Elf_External_Rela));
-	      same_size = (!o->use_rela_p
-			   == (entsize1 == sizeof (Elf_External_Rel)));
-
-	      if (!same_size)
-		rel_count1 = &esdo->rel_count2;
-
-	      if (esdi->rel_hdr2 != NULL)
-		{
-		  bfd_size_type entsize2 = esdi->rel_hdr2->sh_entsize;
-		  unsigned int alt_count;
-		  unsigned int *rel_count2;
-
-		  BFD_ASSERT (entsize2 != entsize1
-			      && (entsize2 == sizeof (Elf_External_Rel)
-				  || entsize2 == sizeof (Elf_External_Rela)));
-
-		  rel_count2 = &esdo->rel_count2;
-		  if (!same_size)
-		    rel_count2 = &esdo->rel_count;
-
-		  /* The following is probably too simplistic if the
-		     backend counts output relocs unusually.  */
-		  BFD_ASSERT (bed->elf_backend_count_relocs == NULL);
-		  alt_count = NUM_SHDR_ENTRIES (esdi->rel_hdr2);
-		  *rel_count2 += alt_count;
-		  reloc_count -= alt_count;
-		}
-	    }
-	  *rel_count1 += reloc_count;
-	}
-
-      if (o->reloc_count > 0)
-	o->flags |= SEC_RELOC;
-      else
-	{
-	  /* Explicitly clear the SEC_RELOC flag.  The linker tends to
-	     set it (this is probably a bug) and if it is set
-	     assign_section_numbers will create a reloc section.  */
-	  o->flags &=~ SEC_RELOC;
-	}
-
-      /* If the SEC_ALLOC flag is not set, force the section VMA to
-	 zero.  This is done in elf_fake_sections as well, but forcing
-	 the VMA to 0 here will ensure that relocs against these
-	 sections are handled correctly.  */
-      if ((o->flags & SEC_ALLOC) == 0
-	  && ! o->user_set_vma)
-	o->vma = 0;
-    }
-
-  if (! info->relocatable && merged)
-    elf_link_hash_traverse (elf_hash_table (info),
-			    _bfd_elf_link_sec_merge_syms, abfd);
-
-  /* Figure out the file positions for everything but the symbol table
-     and the relocs.  We set symcount to force assign_section_numbers
-     to create a symbol table.  */
-  bfd_get_symcount (abfd) = info->strip == strip_all ? 0 : 1;
-  BFD_ASSERT (! abfd->output_has_begun);
-  if (! _bfd_elf_compute_section_file_positions (abfd, info))
-    goto error_return;
-
-  /* That created the reloc sections.  Set their sizes, and assign
-     them file positions, and allocate some buffers.  */
-  for (o = abfd->sections; o != NULL; o = o->next)
-    {
-      if ((o->flags & SEC_RELOC) != 0)
-	{
-	  if (!(_bfd_elf_link_size_reloc_section
-		(abfd, &elf_section_data (o)->rel_hdr, o)))
-	    goto error_return;
-
-	  if (elf_section_data (o)->rel_hdr2
-	      && !(_bfd_elf_link_size_reloc_section
-		   (abfd, elf_section_data (o)->rel_hdr2, o)))
-	    goto error_return;
-	}
-
-      /* Now, reset REL_COUNT and REL_COUNT2 so that we can use them
-	 to count upwards while actually outputting the relocations.  */
-      elf_section_data (o)->rel_count = 0;
-      elf_section_data (o)->rel_count2 = 0;
-    }
-
-  _bfd_elf_assign_file_positions_for_relocs (abfd);
-
-  /* We have now assigned file positions for all the sections except
-     .symtab and .strtab.  We start the .symtab section at the current
-     file position, and write directly to it.  We build the .strtab
-     section in memory.  */
-  bfd_get_symcount (abfd) = 0;
-  symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
-  /* sh_name is set in prep_headers.  */
-  symtab_hdr->sh_type = SHT_SYMTAB;
-  /* sh_flags, sh_addr and sh_size all start off zero.  */
-  symtab_hdr->sh_entsize = sizeof (Elf_External_Sym);
-  /* sh_link is set in assign_section_numbers.  */
-  /* sh_info is set below.  */
-  /* sh_offset is set just below.  */
-  symtab_hdr->sh_addralign = 1 << bed->s->log_file_align;
-
-  off = elf_tdata (abfd)->next_file_pos;
-  off = _bfd_elf_assign_file_position_for_section (symtab_hdr, off, TRUE);
-
-  /* Note that at this point elf_tdata (abfd)->next_file_pos is
-     incorrect.  We do not yet know the size of the .symtab section.
-     We correct next_file_pos below, after we do know the size.  */
-
-  /* Allocate a buffer to hold swapped out symbols.  This is to avoid
-     continuously seeking to the right position in the file.  */
-  if (! info->keep_memory || max_sym_count < 20)
-    finfo.symbuf_size = 20;
-  else
-    finfo.symbuf_size = max_sym_count;
-  amt = finfo.symbuf_size;
-  amt *= sizeof (Elf_External_Sym);
-  finfo.symbuf = bfd_malloc (amt);
-  if (finfo.symbuf == NULL)
-    goto error_return;
-  if (elf_numsections (abfd) > SHN_LORESERVE)
-    {
-      /* Wild guess at number of output symbols.  realloc'd as needed.  */
-      amt = 2 * max_sym_count + elf_numsections (abfd) + 1000;
-      finfo.shndxbuf_size = amt;
-      amt *= sizeof (Elf_External_Sym_Shndx);
-      finfo.symshndxbuf = bfd_zmalloc (amt);
-      if (finfo.symshndxbuf == NULL)
-	goto error_return;
-    }
-
-  /* Start writing out the symbol table.  The first symbol is always a
-     dummy symbol.  */
-  if (info->strip != strip_all
-      || emit_relocs)
-    {
-      elfsym.st_value = 0;
-      elfsym.st_size = 0;
-      elfsym.st_info = 0;
-      elfsym.st_other = 0;
-      elfsym.st_shndx = SHN_UNDEF;
-      if (! elf_link_output_sym (&finfo, NULL, &elfsym, bfd_und_section_ptr,
-				 NULL))
-	goto error_return;
-    }
-
-#if 0
-  /* Some standard ELF linkers do this, but we don't because it causes
-     bootstrap comparison failures.  */
-  /* Output a file symbol for the output file as the second symbol.
-     We output this even if we are discarding local symbols, although
-     I'm not sure if this is correct.  */
-  elfsym.st_value = 0;
-  elfsym.st_size = 0;
-  elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_FILE);
-  elfsym.st_other = 0;
-  elfsym.st_shndx = SHN_ABS;
-  if (! elf_link_output_sym (&finfo, bfd_get_filename (abfd),
-			     &elfsym, bfd_abs_section_ptr, NULL))
-    goto error_return;
-#endif
-
-  /* Output a symbol for each section.  We output these even if we are
-     discarding local symbols, since they are used for relocs.  These
-     symbols have no names.  We store the index of each one in the
-     index field of the section, so that we can find it again when
-     outputting relocs.  */
-  if (info->strip != strip_all
-      || emit_relocs)
-    {
-      elfsym.st_size = 0;
-      elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
-      elfsym.st_other = 0;
-      for (i = 1; i < elf_numsections (abfd); i++)
-	{
-	  o = section_from_elf_index (abfd, i);
-	  if (o != NULL)
-	    o->target_index = bfd_get_symcount (abfd);
-	  elfsym.st_shndx = i;
-	  if (info->relocatable || o == NULL)
-	    elfsym.st_value = 0;
-	  else
-	    elfsym.st_value = o->vma;
-	  if (! elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL))
-	    goto error_return;
-	  if (i == SHN_LORESERVE - 1)
-	    i += SHN_HIRESERVE + 1 - SHN_LORESERVE;
-	}
-    }
-
-  /* Allocate some memory to hold information read in from the input
-     files.  */
-  if (max_contents_size != 0)
-    {
-      finfo.contents = bfd_malloc (max_contents_size);
-      if (finfo.contents == NULL)
-	goto error_return;
-    }
-
-  if (max_external_reloc_size != 0)
-    {
-      finfo.external_relocs = bfd_malloc (max_external_reloc_size);
-      if (finfo.external_relocs == NULL)
-	goto error_return;
-    }
-
-  if (max_internal_reloc_count != 0)
-    {
-      amt = max_internal_reloc_count * bed->s->int_rels_per_ext_rel;
-      amt *= sizeof (Elf_Internal_Rela);
-      finfo.internal_relocs = bfd_malloc (amt);
-      if (finfo.internal_relocs == NULL)
-	goto error_return;
-    }
-
-  if (max_sym_count != 0)
-    {
-      amt = max_sym_count * sizeof (Elf_External_Sym);
-      finfo.external_syms = bfd_malloc (amt);
-      if (finfo.external_syms == NULL)
-	goto error_return;
-
-      amt = max_sym_count * sizeof (Elf_Internal_Sym);
-      finfo.internal_syms = bfd_malloc (amt);
-      if (finfo.internal_syms == NULL)
-	goto error_return;
-
-      amt = max_sym_count * sizeof (long);
-      finfo.indices = bfd_malloc (amt);
-      if (finfo.indices == NULL)
-	goto error_return;
-
-      amt = max_sym_count * sizeof (asection *);
-      finfo.sections = bfd_malloc (amt);
-      if (finfo.sections == NULL)
-	goto error_return;
-    }
-
-  if (max_sym_shndx_count != 0)
-    {
-      amt = max_sym_shndx_count * sizeof (Elf_External_Sym_Shndx);
-      finfo.locsym_shndx = bfd_malloc (amt);
-      if (finfo.locsym_shndx == NULL)
-	goto error_return;
-    }
-
-  if (elf_hash_table (info)->tls_sec)
-    {
-      bfd_vma base, end = 0;
-      asection *sec;
-
-      for (sec = elf_hash_table (info)->tls_sec;
-	   sec && (sec->flags & SEC_THREAD_LOCAL);
-	   sec = sec->next)
-	{
-	  bfd_vma size = sec->_raw_size;
-
-	  if (size == 0 && (sec->flags & SEC_HAS_CONTENTS) == 0)
-	    {
-	      struct bfd_link_order *o;
-
-	      for (o = sec->link_order_head; o != NULL; o = o->next)
-		if (size < o->offset + o->size)
-		  size = o->offset + o->size;
-	    }
-	  end = sec->vma + size;
-	}
-      base = elf_hash_table (info)->tls_sec->vma;
-      end = align_power (end, elf_hash_table (info)->tls_sec->alignment_power);
-      elf_hash_table (info)->tls_size = end - base;
-    }
-
-  /* Since ELF permits relocations to be against local symbols, we
-     must have the local symbols available when we do the relocations.
-     Since we would rather only read the local symbols once, and we
-     would rather not keep them in memory, we handle all the
-     relocations for a single input file at the same time.
-
-     Unfortunately, there is no way to know the total number of local
-     symbols until we have seen all of them, and the local symbol
-     indices precede the global symbol indices.  This means that when
-     we are generating relocatable output, and we see a reloc against
-     a global symbol, we can not know the symbol index until we have
-     finished examining all the local symbols to see which ones we are
-     going to output.  To deal with this, we keep the relocations in
-     memory, and don't output them until the end of the link.  This is
-     an unfortunate waste of memory, but I don't see a good way around
-     it.  Fortunately, it only happens when performing a relocatable
-     link, which is not the common case.  FIXME: If keep_memory is set
-     we could write the relocs out and then read them again; I don't
-     know how bad the memory loss will be.  */
-
-  for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
-    sub->output_has_begun = FALSE;
-  for (o = abfd->sections; o != NULL; o = o->next)
-    {
-      for (p = o->link_order_head; p != NULL; p = p->next)
-	{
-	  if (p->type == bfd_indirect_link_order
-	      && (bfd_get_flavour ((sub = p->u.indirect.section->owner))
-		  == bfd_target_elf_flavour)
-	      && elf_elfheader (sub)->e_ident[EI_CLASS] == bed->s->elfclass)
-	    {
-	      if (! sub->output_has_begun)
-		{
-		  if (! elf_link_input_bfd (&finfo, sub))
-		    goto error_return;
-		  sub->output_has_begun = TRUE;
-		}
-	    }
-	  else if (p->type == bfd_section_reloc_link_order
-		   || p->type == bfd_symbol_reloc_link_order)
-	    {
-	      if (! elf_reloc_link_order (abfd, info, o, p))
-		goto error_return;
-	    }
-	  else
-	    {
-	      if (! _bfd_default_link_order (abfd, info, o, p))
-		goto error_return;
-	    }
-	}
-    }
-
-  /* Output any global symbols that got converted to local in a
-     version script or due to symbol visibility.  We do this in a
-     separate step since ELF requires all local symbols to appear
-     prior to any global symbols.  FIXME: We should only do this if
-     some global symbols were, in fact, converted to become local.
-     FIXME: Will this work correctly with the Irix 5 linker?  */
-  eoinfo.failed = FALSE;
-  eoinfo.finfo = &finfo;
-  eoinfo.localsyms = TRUE;
-  elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym,
-			  &eoinfo);
-  if (eoinfo.failed)
-    return FALSE;
-
-  /* That wrote out all the local symbols.  Finish up the symbol table
-     with the global symbols. Even if we want to strip everything we
-     can, we still need to deal with those global symbols that got
-     converted to local in a version script.  */
-
-  /* The sh_info field records the index of the first non local symbol.  */
-  symtab_hdr->sh_info = bfd_get_symcount (abfd);
-
-  if (dynamic
-      && finfo.dynsym_sec->output_section != bfd_abs_section_ptr)
-    {
-      Elf_Internal_Sym sym;
-      Elf_External_Sym *dynsym =
-	(Elf_External_Sym *) finfo.dynsym_sec->contents;
-      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;
-	      Elf_External_Sym *dest;
-
-	      indx = elf_section_data (s)->this_idx;
-	      BFD_ASSERT (indx > 0);
-	      sym.st_shndx = indx;
-	      sym.st_value = s->vma;
-	      dest = dynsym + elf_section_data (s)->dynindx;
-	      elf_swap_symbol_out (abfd, &sym, dest, 0);
-	    }
-
-	  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;
-	      Elf_External_Sym *dest;
-
-	      sym.st_size = e->isym.st_size;
-	      sym.st_other = e->isym.st_other;
-
-	      /* Copy the internal symbol as is.
-		 Note that we saved a word of storage and overwrote
-		 the original st_name with the dynstr_index.  */
-	      sym = e->isym;
-
-	      if (e->isym.st_shndx != SHN_UNDEF
-		  && (e->isym.st_shndx < SHN_LORESERVE
-		      || e->isym.st_shndx > SHN_HIRESERVE))
-		{
-		  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;
-
-	      dest = dynsym + e->dynindx;
-	      elf_swap_symbol_out (abfd, &sym, dest, 0);
-	    }
-	}
-
-      elf_section_data (finfo.dynsym_sec->output_section)->this_hdr.sh_info =
-	last_local + 1;
-    }
-
-  /* We get the global symbols from the hash table.  */
-  eoinfo.failed = FALSE;
-  eoinfo.localsyms = FALSE;
-  eoinfo.finfo = &finfo;
-  elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym,
-			  &eoinfo);
-  if (eoinfo.failed)
-    return FALSE;
-
-  /* If backend needs to output some symbols not present in the hash
-     table, do it now.  */
-  if (bed->elf_backend_output_arch_syms)
-    {
-      typedef bfd_boolean (*out_sym_func)
-	(void *, const char *, Elf_Internal_Sym *, asection *,
-	 struct elf_link_hash_entry *);
-
-      if (! ((*bed->elf_backend_output_arch_syms)
-	     (abfd, info, &finfo, (out_sym_func) elf_link_output_sym)))
-	return FALSE;
-    }
-
-  /* Flush all symbols to the file.  */
-  if (! elf_link_flush_output_syms (&finfo))
-    return FALSE;
-
-  /* Now we know the size of the symtab section.  */
-  off += symtab_hdr->sh_size;
-
-  symtab_shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr;
-  if (symtab_shndx_hdr->sh_name != 0)
-    {
-      symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX;
-      symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx);
-      symtab_shndx_hdr->sh_addralign = sizeof (Elf_External_Sym_Shndx);
-      amt = bfd_get_symcount (abfd) * sizeof (Elf_External_Sym_Shndx);
-      symtab_shndx_hdr->sh_size = amt;
-
-      off = _bfd_elf_assign_file_position_for_section (symtab_shndx_hdr,
-						       off, TRUE);
-
-      if (bfd_seek (abfd, symtab_shndx_hdr->sh_offset, SEEK_SET) != 0
-	  || (bfd_bwrite (finfo.symshndxbuf, amt, abfd) != amt))
-	return FALSE;
-    }
-
-
-  /* Finish up and write out the symbol string table (.strtab)
-     section.  */
-  symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr;
-  /* sh_name was set in prep_headers.  */
-  symstrtab_hdr->sh_type = SHT_STRTAB;
-  symstrtab_hdr->sh_flags = 0;
-  symstrtab_hdr->sh_addr = 0;
-  symstrtab_hdr->sh_size = _bfd_stringtab_size (finfo.symstrtab);
-  symstrtab_hdr->sh_entsize = 0;
-  symstrtab_hdr->sh_link = 0;
-  symstrtab_hdr->sh_info = 0;
-  /* sh_offset is set just below.  */
-  symstrtab_hdr->sh_addralign = 1;
-
-  off = _bfd_elf_assign_file_position_for_section (symstrtab_hdr, off, TRUE);
-  elf_tdata (abfd)->next_file_pos = off;
-
-  if (bfd_get_symcount (abfd) > 0)
-    {
-      if (bfd_seek (abfd, symstrtab_hdr->sh_offset, SEEK_SET) != 0
-	  || ! _bfd_stringtab_emit (abfd, finfo.symstrtab))
-	return FALSE;
-    }
-
-  /* Adjust the relocs to have the correct symbol indices.  */
-  for (o = abfd->sections; o != NULL; o = o->next)
-    {
-      if ((o->flags & SEC_RELOC) == 0)
-	continue;
-
-      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.  */
-      o->reloc_count = 0;
-    }
-
-  if (dynamic && info->combreloc && dynobj != NULL)
-    relativecount = elf_link_sort_relocs (abfd, info, &reldyn);
-
-  /* If we are linking against a dynamic object, or generating a
-     shared library, finish up the dynamic linking information.  */
-  if (dynamic)
-    {
-      Elf_External_Dyn *dyncon, *dynconend;
-
-      /* Fix up .dynamic entries.  */
-      o = bfd_get_section_by_name (dynobj, ".dynamic");
-      BFD_ASSERT (o != NULL);
-
-      dyncon = (Elf_External_Dyn *) o->contents;
-      dynconend = (Elf_External_Dyn *) (o->contents + o->_raw_size);
-      for (; dyncon < dynconend; dyncon++)
-	{
-	  Elf_Internal_Dyn dyn;
-	  const char *name;
-	  unsigned int type;
-
-	  elf_swap_dyn_in (dynobj, dyncon, &dyn);
-
-	  switch (dyn.d_tag)
-	    {
-	    default:
-	      break;
-	    case DT_NULL:
-	      if (relativecount > 0 && dyncon + 1 < dynconend)
-		{
-		  switch (elf_section_data (reldyn)->this_hdr.sh_type)
-		    {
-		    case SHT_REL: dyn.d_tag = DT_RELCOUNT; break;
-		    case SHT_RELA: dyn.d_tag = DT_RELACOUNT; break;
-		    default: break;
-		    }
-		  if (dyn.d_tag != DT_NULL)
-		    {
-		      dyn.d_un.d_val = relativecount;
-		      elf_swap_dyn_out (dynobj, &dyn, dyncon);
-		      relativecount = 0;
-		    }
-		}
-	      break;
-	    case DT_INIT:
-	      name = info->init_function;
-	      goto get_sym;
-	    case DT_FINI:
-	      name = info->fini_function;
-	    get_sym:
-	      {
-		struct elf_link_hash_entry *h;
-
-		h = elf_link_hash_lookup (elf_hash_table (info), name,
-					  FALSE, FALSE, TRUE);
-		if (h != NULL
-		    && (h->root.type == bfd_link_hash_defined
-			|| h->root.type == bfd_link_hash_defweak))
-		  {
-		    dyn.d_un.d_val = h->root.u.def.value;
-		    o = h->root.u.def.section;
-		    if (o->output_section != NULL)
-		      dyn.d_un.d_val += (o->output_section->vma
-					 + o->output_offset);
-		    else
-		      {
-			/* The symbol is imported from another shared
-			   library and does not apply to this one.  */
-			dyn.d_un.d_val = 0;
-		      }
-
-		    elf_swap_dyn_out (dynobj, &dyn, dyncon);
-		  }
-	      }
-	      break;
-
-	    case DT_PREINIT_ARRAYSZ:
-	      name = ".preinit_array";
-	      goto get_size;
-	    case DT_INIT_ARRAYSZ:
-	      name = ".init_array";
-	      goto get_size;
-	    case DT_FINI_ARRAYSZ:
-	      name = ".fini_array";
-	    get_size:
-	      o = bfd_get_section_by_name (abfd, name);
-	      if (o == NULL)
-		{
-		  (*_bfd_error_handler)
-		    (_("%s: could not find output section %s"),
-		     bfd_get_filename (abfd), name);
-		  goto error_return;
-		}
-	      if (o->_raw_size == 0)
-		(*_bfd_error_handler)
-		  (_("warning: %s section has zero size"), name);
-	      dyn.d_un.d_val = o->_raw_size;
-	      elf_swap_dyn_out (dynobj, &dyn, dyncon);
-	      break;
-
-	    case DT_PREINIT_ARRAY:
-	      name = ".preinit_array";
-	      goto get_vma;
-	    case DT_INIT_ARRAY:
-	      name = ".init_array";
-	      goto get_vma;
-	    case DT_FINI_ARRAY:
-	      name = ".fini_array";
-	      goto get_vma;
-
-	    case DT_HASH:
-	      name = ".hash";
-	      goto get_vma;
-	    case DT_STRTAB:
-	      name = ".dynstr";
-	      goto get_vma;
-	    case DT_SYMTAB:
-	      name = ".dynsym";
-	      goto get_vma;
-	    case DT_VERDEF:
-	      name = ".gnu.version_d";
-	      goto get_vma;
-	    case DT_VERNEED:
-	      name = ".gnu.version_r";
-	      goto get_vma;
-	    case DT_VERSYM:
-	      name = ".gnu.version";
-	    get_vma:
-	      o = bfd_get_section_by_name (abfd, name);
-	      if (o == NULL)
-		{
-		  (*_bfd_error_handler)
-		    (_("%s: could not find output section %s"),
-		     bfd_get_filename (abfd), name);
-		  goto error_return;
-		}
-	      dyn.d_un.d_ptr = o->vma;
-	      elf_swap_dyn_out (dynobj, &dyn, dyncon);
-	      break;
-
-	    case DT_REL:
-	    case DT_RELA:
-	    case DT_RELSZ:
-	    case DT_RELASZ:
-	      if (dyn.d_tag == DT_REL || dyn.d_tag == DT_RELSZ)
-		type = SHT_REL;
-	      else
-		type = SHT_RELA;
-	      dyn.d_un.d_val = 0;
-	      for (i = 1; i < elf_numsections (abfd); i++)
-		{
-		  Elf_Internal_Shdr *hdr;
-
-		  hdr = elf_elfsections (abfd)[i];
-		  if (hdr->sh_type == type
-		      && (hdr->sh_flags & SHF_ALLOC) != 0)
-		    {
-		      if (dyn.d_tag == DT_RELSZ || dyn.d_tag == DT_RELASZ)
-			dyn.d_un.d_val += hdr->sh_size;
-		      else
-			{
-			  if (dyn.d_un.d_val == 0
-			      || hdr->sh_addr < dyn.d_un.d_val)
-			    dyn.d_un.d_val = hdr->sh_addr;
-			}
-		    }
-		}
-	      elf_swap_dyn_out (dynobj, &dyn, dyncon);
-	      break;
-	    }
-	}
-    }
-
-  /* If we have created any dynamic sections, then output them.  */
-  if (dynobj != NULL)
-    {
-      if (! (*bed->elf_backend_finish_dynamic_sections) (abfd, info))
-	goto error_return;
-
-      for (o = dynobj->sections; o != NULL; o = o->next)
-	{
-	  if ((o->flags & SEC_HAS_CONTENTS) == 0
-	      || o->_raw_size == 0
-	      || o->output_section == bfd_abs_section_ptr)
-	    continue;
-	  if ((o->flags & SEC_LINKER_CREATED) == 0)
-	    {
-	      /* At this point, we are only interested in sections
-		 created by _bfd_elf_link_create_dynamic_sections.  */
-	      continue;
-	    }
-	  if ((elf_section_data (o->output_section)->this_hdr.sh_type
-	       != SHT_STRTAB)
-	      || strcmp (bfd_get_section_name (abfd, o), ".dynstr") != 0)
-	    {
-	      if (! bfd_set_section_contents (abfd, o->output_section,
-					      o->contents,
-					      (file_ptr) o->output_offset,
-					      o->_raw_size))
-		goto error_return;
-	    }
-	  else
-	    {
-	      /* The contents of the .dynstr section are actually in a
-		 stringtab.  */
-	      off = elf_section_data (o->output_section)->this_hdr.sh_offset;
-	      if (bfd_seek (abfd, off, SEEK_SET) != 0
-		  || ! _bfd_elf_strtab_emit (abfd,
-					     elf_hash_table (info)->dynstr))
-		goto error_return;
-	    }
-	}
-    }
-
-  if (info->relocatable)
-    {
-      bfd_boolean failed = FALSE;
-
-      bfd_map_over_sections (abfd, bfd_elf_set_group_contents, &failed);
-      if (failed)
-	goto error_return;
-    }
-
-  /* If we have optimized stabs strings, output them.  */
-  if (elf_hash_table (info)->stab_info != NULL)
-    {
-      if (! _bfd_write_stab_strings (abfd, &elf_hash_table (info)->stab_info))
-	goto error_return;
-    }
-
-  if (info->eh_frame_hdr)
-    {
-      if (! _bfd_elf_write_section_eh_frame_hdr (abfd, info))
-	goto error_return;
-    }
-
-  if (finfo.symstrtab != NULL)
-    _bfd_stringtab_free (finfo.symstrtab);
-  if (finfo.contents != NULL)
-    free (finfo.contents);
-  if (finfo.external_relocs != NULL)
-    free (finfo.external_relocs);
-  if (finfo.internal_relocs != NULL)
-    free (finfo.internal_relocs);
-  if (finfo.external_syms != NULL)
-    free (finfo.external_syms);
-  if (finfo.locsym_shndx != NULL)
-    free (finfo.locsym_shndx);
-  if (finfo.internal_syms != NULL)
-    free (finfo.internal_syms);
-  if (finfo.indices != NULL)
-    free (finfo.indices);
-  if (finfo.sections != NULL)
-    free (finfo.sections);
-  if (finfo.symbuf != NULL)
-    free (finfo.symbuf);
-  if (finfo.symshndxbuf != NULL)
-    free (finfo.symshndxbuf);
-  for (o = abfd->sections; o != NULL; o = o->next)
-    {
-      if ((o->flags & SEC_RELOC) != 0
-	  && elf_section_data (o)->rel_hashes != NULL)
-	free (elf_section_data (o)->rel_hashes);
-    }
-
-  elf_tdata (abfd)->linker = TRUE;
-
-  return TRUE;
-
- error_return:
-  if (finfo.symstrtab != NULL)
-    _bfd_stringtab_free (finfo.symstrtab);
-  if (finfo.contents != NULL)
-    free (finfo.contents);
-  if (finfo.external_relocs != NULL)
-    free (finfo.external_relocs);
-  if (finfo.internal_relocs != NULL)
-    free (finfo.internal_relocs);
-  if (finfo.external_syms != NULL)
-    free (finfo.external_syms);
-  if (finfo.locsym_shndx != NULL)
-    free (finfo.locsym_shndx);
-  if (finfo.internal_syms != NULL)
-    free (finfo.internal_syms);
-  if (finfo.indices != NULL)
-    free (finfo.indices);
-  if (finfo.sections != NULL)
-    free (finfo.sections);
-  if (finfo.symbuf != NULL)
-    free (finfo.symbuf);
-  if (finfo.symshndxbuf != NULL)
-    free (finfo.symshndxbuf);
-  for (o = abfd->sections; o != NULL; o = o->next)
-    {
-      if ((o->flags & SEC_RELOC) != 0
-	  && elf_section_data (o)->rel_hashes != NULL)
-	free (elf_section_data (o)->rel_hashes);
-    }
-
-  return FALSE;
-}
-
-/* Add a symbol to the output symbol table.  */
-
-static bfd_boolean
-elf_link_output_sym (struct elf_final_link_info *finfo,
-		     const char *name,
-		     Elf_Internal_Sym *elfsym,
-		     asection *input_sec,
-		     struct elf_link_hash_entry *h)
-{
-  Elf_External_Sym *dest;
-  Elf_External_Sym_Shndx *destshndx;
-  bfd_boolean (*output_symbol_hook)
-    (struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *,
-     struct elf_link_hash_entry *);
-
-  output_symbol_hook = get_elf_backend_data (finfo->output_bfd)->
-    elf_backend_link_output_symbol_hook;
-  if (output_symbol_hook != NULL)
-    {
-      if (! (*output_symbol_hook) (finfo->info, name, elfsym, input_sec, h))
-	return FALSE;
-    }
-
-  if (name == NULL || *name == '\0')
-    elfsym->st_name = 0;
-  else if (input_sec->flags & SEC_EXCLUDE)
-    elfsym->st_name = 0;
-  else
-    {
-      elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab,
-							    name, TRUE, FALSE);
-      if (elfsym->st_name == (unsigned long) -1)
-	return FALSE;
-    }
-
-  if (finfo->symbuf_count >= finfo->symbuf_size)
-    {
-      if (! elf_link_flush_output_syms (finfo))
-	return FALSE;
-    }
-
-  dest = finfo->symbuf + finfo->symbuf_count;
-  destshndx = finfo->symshndxbuf;
-  if (destshndx != NULL)
-    {
-      if (bfd_get_symcount (finfo->output_bfd) >= finfo->shndxbuf_size)
-	{
-	  bfd_size_type amt;
-
-	  amt = finfo->shndxbuf_size * sizeof (Elf_External_Sym_Shndx);
-	  finfo->symshndxbuf = destshndx = bfd_realloc (destshndx, amt * 2);
-	  if (destshndx == NULL)
-	    return FALSE;
-	  memset ((char *) destshndx + amt, 0, amt);
-	  finfo->shndxbuf_size *= 2;
-	}
-      destshndx += bfd_get_symcount (finfo->output_bfd);
-    }
-
-  elf_swap_symbol_out (finfo->output_bfd, elfsym, dest, destshndx);
-  finfo->symbuf_count += 1;
-  bfd_get_symcount (finfo->output_bfd) += 1;
-
-  return TRUE;
-}
-
-/* Flush the output symbols to the file.  */
-
-static bfd_boolean
-elf_link_flush_output_syms (struct elf_final_link_info *finfo)
-{
-  if (finfo->symbuf_count > 0)
-    {
-      Elf_Internal_Shdr *hdr;
-      file_ptr pos;
-      bfd_size_type amt;
-
-      hdr = &elf_tdata (finfo->output_bfd)->symtab_hdr;
-      pos = hdr->sh_offset + hdr->sh_size;
-      amt = finfo->symbuf_count * sizeof (Elf_External_Sym);
-      if (bfd_seek (finfo->output_bfd, pos, SEEK_SET) != 0
-	  || bfd_bwrite (finfo->symbuf, amt, finfo->output_bfd) != amt)
-	return FALSE;
-
-      hdr->sh_size += amt;
-      finfo->symbuf_count = 0;
-    }
-
-  return TRUE;
-}
-
-/* For DSOs loaded in via a DT_NEEDED entry, emulate ld.so in
-   allowing an unsatisfied unversioned symbol in the DSO to match a
-   versioned symbol that would normally require an explicit version.
-   We also handle the case that a DSO references a hidden symbol
-   which may be satisfied by a versioned symbol in another DSO.  */
-
-static bfd_boolean
-elf_link_check_versioned_symbol (struct bfd_link_info *info,
-				 struct elf_link_hash_entry *h)
-{
-  bfd *abfd;
-  struct elf_link_loaded_list *loaded;
-
-  if (!is_elf_hash_table (info->hash))
-    return FALSE;
-
-  switch (h->root.type)
-    {
-    default:
-      abfd = NULL;
-      break;
-
-    case bfd_link_hash_undefined:
-    case bfd_link_hash_undefweak:
-      abfd = h->root.u.undef.abfd;
-      if ((abfd->flags & DYNAMIC) == 0
-	  || elf_dyn_lib_class (abfd) != DYN_DT_NEEDED)
-	return FALSE;
-      break;
-
-    case bfd_link_hash_defined:
-    case bfd_link_hash_defweak:
-      abfd = h->root.u.def.section->owner;
-      break;
-
-    case bfd_link_hash_common:
-      abfd = h->root.u.c.p->section->owner;
-      break;
-    }
-  BFD_ASSERT (abfd != NULL);
-
-  for (loaded = elf_hash_table (info)->loaded;
-       loaded != NULL;
-       loaded = loaded->next)
-    {
-      bfd *input;
-      Elf_Internal_Shdr *hdr;
-      bfd_size_type symcount;
-      bfd_size_type extsymcount;
-      bfd_size_type extsymoff;
-      Elf_Internal_Shdr *versymhdr;
-      Elf_Internal_Sym *isym;
-      Elf_Internal_Sym *isymend;
-      Elf_Internal_Sym *isymbuf;
-      Elf_External_Versym *ever;
-      Elf_External_Versym *extversym;
-
-      input = loaded->abfd;
-
-      /* We check each DSO for a possible hidden versioned definition.  */
-      if (input == abfd
-	  || (input->flags & DYNAMIC) == 0
-	  || elf_dynversym (input) == 0)
-	continue;
-
-      hdr = &elf_tdata (input)->dynsymtab_hdr;
-
-      symcount = hdr->sh_size / sizeof (Elf_External_Sym);
-      if (elf_bad_symtab (input))
-	{
-	  extsymcount = symcount;
-	  extsymoff = 0;
-	}
-      else
-	{
-	  extsymcount = symcount - hdr->sh_info;
-	  extsymoff = hdr->sh_info;
-	}
-
-      if (extsymcount == 0)
-	continue;
-
-      isymbuf = bfd_elf_get_elf_syms (input, hdr, extsymcount, extsymoff,
-				      NULL, NULL, NULL);
-      if (isymbuf == NULL)
-	return FALSE;
-
-      /* Read in any version definitions.  */
-      versymhdr = &elf_tdata (input)->dynversym_hdr;
-      extversym = bfd_malloc (versymhdr->sh_size);
-      if (extversym == NULL)
-	goto error_ret;
-
-      if (bfd_seek (input, versymhdr->sh_offset, SEEK_SET) != 0
-	  || (bfd_bread (extversym, versymhdr->sh_size, input)
-	      != versymhdr->sh_size))
-	{
-	  free (extversym);
-	error_ret:
-	  free (isymbuf);
-	  return FALSE;
-	}
-
-      ever = extversym + extsymoff;
-      isymend = isymbuf + extsymcount;
-      for (isym = isymbuf; isym < isymend; isym++, ever++)
-	{
-	  const char *name;
-	  Elf_Internal_Versym iver;
-	  unsigned short version_index;
-
-	  if (ELF_ST_BIND (isym->st_info) == STB_LOCAL
-	      || isym->st_shndx == SHN_UNDEF)
-	    continue;
-
-	  name = bfd_elf_string_from_elf_section (input,
-						  hdr->sh_link,
-						  isym->st_name);
-	  if (strcmp (name, h->root.root.string) != 0)
-	    continue;
-
-	  _bfd_elf_swap_versym_in (input, ever, &iver);
-
-	  if ((iver.vs_vers & VERSYM_HIDDEN) == 0)
-	    {
-	      /* If we have a non-hidden versioned sym, then it should
-		 have provided a definition for the undefined sym.  */
-	      abort ();
-	    }
-
-	  version_index = iver.vs_vers & VERSYM_VERSION;
-	  if (version_index == 1 || version_index == 2)
-	    {
-	      /* This is the base or first version.  We can use it.  */
-	      free (extversym);
-	      free (isymbuf);
-	      return TRUE;
-	    }
-	}
-
-      free (extversym);
-      free (isymbuf);
-    }
-
-  return FALSE;
-}
-
-/* Add an external symbol to the symbol table.  This is called from
-   the hash table traversal routine.  When generating a shared object,
-   we go through the symbol table twice.  The first time we output
-   anything that might have been forced to local scope in a version
-   script.  The second time we output the symbols that are still
-   global symbols.  */
-
-static bfd_boolean
-elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
-{
-  struct elf_outext_info *eoinfo = data;
-  struct elf_final_link_info *finfo = eoinfo->finfo;
-  bfd_boolean strip;
-  Elf_Internal_Sym sym;
-  asection *input_sec;
-
-  if (h->root.type == bfd_link_hash_warning)
-    {
-      h = (struct elf_link_hash_entry *) h->root.u.i.link;
-      if (h->root.type == bfd_link_hash_new)
-	return TRUE;
-    }
-
-  /* Decide whether to output this symbol in this pass.  */
-  if (eoinfo->localsyms)
-    {
-      if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
-	return TRUE;
-    }
-  else
-    {
-      if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
-	return TRUE;
-    }
-
-  /* If we have an undefined symbol reference here then it must have
-     come from a shared library that is being linked in.  (Undefined
-     references in regular files have already been handled).  If we
-     are reporting errors for this situation then do so now.  */
-  if (h->root.type == bfd_link_hash_undefined
-      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0
-      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0
-      && ! elf_link_check_versioned_symbol (finfo->info, h)
-      && finfo->info->unresolved_syms_in_shared_libs != RM_IGNORE)
-    {
-      if (! ((*finfo->info->callbacks->undefined_symbol)
-	     (finfo->info, h->root.root.string, h->root.u.undef.abfd,
-	      NULL, 0, finfo->info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR)))
-	{
-	  eoinfo->failed = TRUE;
-	  return FALSE;
-	}
-    }
-
-  /* We should also warn if a forced local symbol is referenced from
-     shared libraries.  */
-  if (! finfo->info->relocatable
-      && (! finfo->info->shared)
-      && (h->elf_link_hash_flags
-	  & (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_DYNAMIC_DEF | ELF_LINK_DYNAMIC_WEAK))
-	 == (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC)
-      && ! elf_link_check_versioned_symbol (finfo->info, h))
-    {
-      (*_bfd_error_handler)
-	(_("%s: %s symbol `%s' in %s is referenced by DSO"),
-	 bfd_get_filename (finfo->output_bfd),
-	 ELF_ST_VISIBILITY (h->other) == STV_INTERNAL
-	 ? "internal"
-	 : ELF_ST_VISIBILITY (h->other) == STV_HIDDEN
-	   ? "hidden" : "local",
-	 h->root.root.string,
-	 bfd_archive_filename (h->root.u.def.section->owner));
-      eoinfo->failed = TRUE;
-      return FALSE;
-    }
-
-  /* We don't want to output symbols that have never been mentioned by
-     a regular file, or that we have been told to strip.  However, if
-     h->indx is set to -2, the symbol is used by a reloc and we must
-     output it.  */
-  if (h->indx == -2)
-    strip = FALSE;
-  else if (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0
-	    || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)
-	   && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0
-	   && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0)
-    strip = TRUE;
-  else if (finfo->info->strip == strip_all)
-    strip = TRUE;
-  else if (finfo->info->strip == strip_some
-	   && bfd_hash_lookup (finfo->info->keep_hash,
-			       h->root.root.string, FALSE, FALSE) == NULL)
-    strip = TRUE;
-  else if (finfo->info->strip_discarded
-	   && (h->root.type == bfd_link_hash_defined
-	       || h->root.type == bfd_link_hash_defweak)
-	   && elf_discarded_section (h->root.u.def.section))
-    strip = TRUE;
-  else
-    strip = FALSE;
-
-  /* If we're stripping it, and it's not a dynamic symbol, there's
-     nothing else to do unless it is a forced local symbol.  */
-  if (strip
-      && h->dynindx == -1
-      && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
-    return TRUE;
-
-  sym.st_value = 0;
-  sym.st_size = h->size;
-  sym.st_other = h->other;
-  if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
-    sym.st_info = ELF_ST_INFO (STB_LOCAL, h->type);
-  else if (h->root.type == bfd_link_hash_undefweak
-	   || h->root.type == bfd_link_hash_defweak)
-    sym.st_info = ELF_ST_INFO (STB_WEAK, h->type);
-  else
-    sym.st_info = ELF_ST_INFO (STB_GLOBAL, h->type);
-
-  switch (h->root.type)
-    {
-    default:
-    case bfd_link_hash_new:
-    case bfd_link_hash_warning:
-      abort ();
-      return FALSE;
-
-    case bfd_link_hash_undefined:
-    case bfd_link_hash_undefweak:
-      input_sec = bfd_und_section_ptr;
-      sym.st_shndx = SHN_UNDEF;
-      break;
-
-    case bfd_link_hash_defined:
-    case bfd_link_hash_defweak:
-      {
-	input_sec = h->root.u.def.section;
-	if (input_sec->output_section != NULL)
-	  {
-	    sym.st_shndx =
-	      _bfd_elf_section_from_bfd_section (finfo->output_bfd,
-						 input_sec->output_section);
-	    if (sym.st_shndx == SHN_BAD)
-	      {
-		(*_bfd_error_handler)
-		  (_("%s: could not find output section %s for input section %s"),
-		   bfd_get_filename (finfo->output_bfd),
-		   input_sec->output_section->name,
-		   input_sec->name);
-		eoinfo->failed = TRUE;
-		return FALSE;
-	      }
-
-	    /* ELF symbols in relocatable files are section relative,
-	       but in nonrelocatable files they are virtual
-	       addresses.  */
-	    sym.st_value = h->root.u.def.value + input_sec->output_offset;
-	    if (! finfo->info->relocatable)
-	      {
-		sym.st_value += input_sec->output_section->vma;
-		if (h->type == STT_TLS)
-		  {
-		    /* STT_TLS symbols are relative to PT_TLS segment
-		       base.  */
-		    BFD_ASSERT (elf_hash_table (finfo->info)->tls_sec != NULL);
-		    sym.st_value -= elf_hash_table (finfo->info)->tls_sec->vma;
-		  }
-	      }
-	  }
-	else
-	  {
-	    BFD_ASSERT (input_sec->owner == NULL
-			|| (input_sec->owner->flags & DYNAMIC) != 0);
-	    sym.st_shndx = SHN_UNDEF;
-	    input_sec = bfd_und_section_ptr;
-	  }
-      }
-      break;
-
-    case bfd_link_hash_common:
-      input_sec = h->root.u.c.p->section;
-      sym.st_shndx = SHN_COMMON;
-      sym.st_value = 1 << h->root.u.c.p->alignment_power;
-      break;
-
-    case bfd_link_hash_indirect:
-      /* These symbols are created by symbol versioning.  They point
-	 to the decorated version of the name.  For example, if the
-	 symbol foo@@GNU_1.2 is the default, which should be used when
-	 foo is used with no version, then we add an indirect symbol
-	 foo which points to foo@@GNU_1.2.  We ignore these symbols,
-	 since the indirected symbol is already in the hash table.  */
-      return TRUE;
-    }
-
-  /* Give the processor backend a chance to tweak the symbol value,
-     and also to finish up anything that needs to be done for this
-     symbol.  FIXME: Not calling elf_backend_finish_dynamic_symbol for
-     forced local syms when non-shared is due to a historical quirk.  */
-  if ((h->dynindx != -1
-       || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)
-      && ((finfo->info->shared
-	   && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
-	       || h->root.type != bfd_link_hash_undefweak))
-	  || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0)
-      && elf_hash_table (finfo->info)->dynamic_sections_created)
-    {
-      const struct elf_backend_data *bed;
-
-      bed = get_elf_backend_data (finfo->output_bfd);
-      if (! ((*bed->elf_backend_finish_dynamic_symbol)
-	     (finfo->output_bfd, finfo->info, h, &sym)))
-	{
-	  eoinfo->failed = TRUE;
-	  return FALSE;
-	}
-    }
-
-  /* If we are marking the symbol as undefined, and there are no
-     non-weak references to this symbol from a regular object, then
-     mark the symbol as weak undefined; if there are non-weak
-     references, mark the symbol as strong.  We can't do this earlier,
-     because it might not be marked as undefined until the
-     finish_dynamic_symbol routine gets through with it.  */
-  if (sym.st_shndx == SHN_UNDEF
-      && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0
-      && (ELF_ST_BIND (sym.st_info) == STB_GLOBAL
-	  || ELF_ST_BIND (sym.st_info) == STB_WEAK))
-    {
-      int bindtype;
-
-      if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) != 0)
-	bindtype = STB_GLOBAL;
-      else
-	bindtype = STB_WEAK;
-      sym.st_info = ELF_ST_INFO (bindtype, ELF_ST_TYPE (sym.st_info));
-    }
-
-  /* If a non-weak symbol with non-default visibility is not defined
-     locally, it is a fatal error.  */
-  if (! finfo->info->relocatable
-      && ELF_ST_VISIBILITY (sym.st_other) != STV_DEFAULT
-      && ELF_ST_BIND (sym.st_info) != STB_WEAK
-      && h->root.type == bfd_link_hash_undefined
-      && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
-    {
-      (*_bfd_error_handler)
-	(_("%s: %s symbol `%s' isn't defined"),
-	  bfd_get_filename (finfo->output_bfd),
-	  ELF_ST_VISIBILITY (sym.st_other) == STV_PROTECTED
-	  ? "protected"
-	  : ELF_ST_VISIBILITY (sym.st_other) == STV_INTERNAL
-	    ? "internal" : "hidden",
-	  h->root.root.string);
-      eoinfo->failed = TRUE;
-      return FALSE;
-    }
-
-  /* If this symbol should be put in the .dynsym section, then put it
-     there now.  We already know the symbol index.  We also fill in
-     the entry in the .hash section.  */
-  if (h->dynindx != -1
-      && elf_hash_table (finfo->info)->dynamic_sections_created)
-    {
-      size_t bucketcount;
-      size_t bucket;
-      size_t hash_entry_size;
-      bfd_byte *bucketpos;
-      bfd_vma chain;
-      Elf_External_Sym *esym;
-
-      sym.st_name = h->dynstr_index;
-      esym = (Elf_External_Sym *) finfo->dynsym_sec->contents + h->dynindx;
-      elf_swap_symbol_out (finfo->output_bfd, &sym, esym, 0);
-
-      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) * 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)
-	{
-	  Elf_Internal_Versym iversym;
-	  Elf_External_Versym *eversym;
-
-	  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
-	    {
-	      if (h->verinfo.verdef == NULL)
-		iversym.vs_vers = 0;
-	      else
-		iversym.vs_vers = h->verinfo.verdef->vd_exp_refno + 1;
-	    }
-	  else
-	    {
-	      if (h->verinfo.vertree == NULL)
-		iversym.vs_vers = 1;
-	      else
-		iversym.vs_vers = h->verinfo.vertree->vernum + 1;
-	    }
-
-	  if ((h->elf_link_hash_flags & ELF_LINK_HIDDEN) != 0)
-	    iversym.vs_vers |= VERSYM_HIDDEN;
-
-	  eversym = (Elf_External_Versym *) finfo->symver_sec->contents;
-	  eversym += h->dynindx;
-	  _bfd_elf_swap_versym_out (finfo->output_bfd, &iversym, eversym);
-	}
-    }
-
-  /* If we're stripping it, then it was just a dynamic symbol, and
-     there's nothing else to do.  */
-  if (strip || (input_sec->flags & SEC_EXCLUDE) != 0)
-    return TRUE;
-
-  h->indx = bfd_get_symcount (finfo->output_bfd);
-
-  if (! elf_link_output_sym (finfo, h->root.root.string, &sym, input_sec, h))
-    {
-      eoinfo->failed = TRUE;
-      return FALSE;
-    }
-
-  return TRUE;
-}
-
-/* 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
-   don't have to keep them in memory.  */
-
-static bfd_boolean
-elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
-{
-  bfd_boolean (*relocate_section)
-    (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,
-     Elf_Internal_Rela *, Elf_Internal_Sym *, asection **);
-  bfd *output_bfd;
-  Elf_Internal_Shdr *symtab_hdr;
-  size_t locsymcount;
-  size_t extsymoff;
-  Elf_Internal_Sym *isymbuf;
-  Elf_Internal_Sym *isym;
-  Elf_Internal_Sym *isymend;
-  long *pindex;
-  asection **ppsection;
-  asection *o;
-  const struct elf_backend_data *bed;
-  bfd_boolean emit_relocs;
-  struct elf_link_hash_entry **sym_hashes;
-
-  output_bfd = finfo->output_bfd;
-  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
-     contents.  */
-  if ((input_bfd->flags & DYNAMIC) != 0)
-    return TRUE;
-
-  emit_relocs = (finfo->info->relocatable
-		 || finfo->info->emitrelocations
-		 || bed->elf_backend_emit_relocs);
-
-  symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
-  if (elf_bad_symtab (input_bfd))
-    {
-      locsymcount = symtab_hdr->sh_size / sizeof (Elf_External_Sym);
-      extsymoff = 0;
-    }
-  else
-    {
-      locsymcount = symtab_hdr->sh_info;
-      extsymoff = symtab_hdr->sh_info;
-    }
-
-  /* Read the local symbols.  */
-  isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents;
-  if (isymbuf == NULL && locsymcount != 0)
-    {
-      isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, locsymcount, 0,
-				      finfo->internal_syms,
-				      finfo->external_syms,
-				      finfo->locsym_shndx);
-      if (isymbuf == NULL)
-	return FALSE;
-    }
-
-  /* Find local symbol sections and adjust values of symbols in
-     SEC_MERGE sections.  Write out those local symbols we know are
-     going into the output file.  */
-  isymend = isymbuf + locsymcount;
-  for (isym = isymbuf, pindex = finfo->indices, ppsection = finfo->sections;
-       isym < isymend;
-       isym++, pindex++, ppsection++)
-    {
-      asection *isec;
-      const char *name;
-      Elf_Internal_Sym osym;
-
-      *pindex = -1;
-
-      if (elf_bad_symtab (input_bfd))
-	{
-	  if (ELF_ST_BIND (isym->st_info) != STB_LOCAL)
-	    {
-	      *ppsection = NULL;
-	      continue;
-	    }
-	}
-
-      if (isym->st_shndx == SHN_UNDEF)
-	isec = bfd_und_section_ptr;
-      else if (isym->st_shndx < SHN_LORESERVE
-	       || isym->st_shndx > SHN_HIRESERVE)
-	{
-	  isec = section_from_elf_index (input_bfd, isym->st_shndx);
-	  if (isec
-	      && isec->sec_info_type == ELF_INFO_TYPE_MERGE
-	      && ELF_ST_TYPE (isym->st_info) != STT_SECTION)
-	    isym->st_value =
-	      _bfd_merged_section_offset (output_bfd, &isec,
-					  elf_section_data (isec)->sec_info,
-					  isym->st_value, 0);
-	}
-      else if (isym->st_shndx == SHN_ABS)
-	isec = bfd_abs_section_ptr;
-      else if (isym->st_shndx == SHN_COMMON)
-	isec = bfd_com_section_ptr;
-      else
-	{
-	  /* Who knows?  */
-	  isec = NULL;
-	}
-
-      *ppsection = isec;
-
-      /* Don't output the first, undefined, symbol.  */
-      if (ppsection == finfo->sections)
-	continue;
-
-      if (ELF_ST_TYPE (isym->st_info) == STT_SECTION)
-	{
-	  /* We never output section symbols.  Instead, we use the
-	     section symbol of the corresponding section in the output
-	     file.  */
-	  continue;
-	}
-
-      /* If we are stripping all symbols, we don't want to output this
-	 one.  */
-      if (finfo->info->strip == strip_all)
-	continue;
-
-      /* If we are discarding all local symbols, we don't want to
-	 output this one.  If we are generating a relocatable output
-	 file, then some of the local symbols may be required by
-	 relocs; we output them below as we discover that they are
-	 needed.  */
-      if (finfo->info->discard == discard_all)
-	continue;
-
-      /* If this symbol is defined in a section which we are
-	 discarding, we don't need to keep it, but note that
-	 linker_mark is only reliable for sections that have contents.
-	 For the benefit of the MIPS ELF linker, we check SEC_EXCLUDE
-	 as well as linker_mark.  */
-      if ((isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE)
-	  && isec != NULL
-	  && ((! isec->linker_mark && (isec->flags & SEC_HAS_CONTENTS) != 0)
-	      || (! finfo->info->relocatable
-		  && (isec->flags & SEC_EXCLUDE) != 0)))
-	continue;
-
-      /* Get the name of the symbol.  */
-      name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link,
-					      isym->st_name);
-      if (name == NULL)
-	return FALSE;
-
-      /* See if we are discarding symbols with this name.  */
-      if ((finfo->info->strip == strip_some
-	   && (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE)
-	       == NULL))
-	  || (((finfo->info->discard == discard_sec_merge
-		&& (isec->flags & SEC_MERGE) && ! finfo->info->relocatable)
-	       || finfo->info->discard == discard_l)
-	      && bfd_is_local_label_name (input_bfd, name)))
-	continue;
-
-      /* If we get here, we are going to output this symbol.  */
-
-      osym = *isym;
-
-      /* Adjust the section index for the output file.  */
-      osym.st_shndx = _bfd_elf_section_from_bfd_section (output_bfd,
-							 isec->output_section);
-      if (osym.st_shndx == SHN_BAD)
-	return FALSE;
-
-      *pindex = bfd_get_symcount (output_bfd);
-
-      /* ELF symbols in relocatable files are section relative, but
-	 in executable files they are virtual addresses.  Note that
-	 this code assumes that all ELF sections have an associated
-	 BFD section with a reasonable value for output_offset; below
-	 we assume that they also have a reasonable value for
-	 output_section.  Any special sections must be set up to meet
-	 these requirements.  */
-      osym.st_value += isec->output_offset;
-      if (! finfo->info->relocatable)
-	{
-	  osym.st_value += isec->output_section->vma;
-	  if (ELF_ST_TYPE (osym.st_info) == STT_TLS)
-	    {
-	      /* STT_TLS symbols are relative to PT_TLS segment base.  */
-	      BFD_ASSERT (elf_hash_table (finfo->info)->tls_sec != NULL);
-	      osym.st_value -= elf_hash_table (finfo->info)->tls_sec->vma;
-	    }
-	}
-
-      if (! elf_link_output_sym (finfo, name, &osym, isec, NULL))
-	return FALSE;
-    }
-
-  /* Relocate the contents of each section.  */
-  sym_hashes = elf_sym_hashes (input_bfd);
-  for (o = input_bfd->sections; o != NULL; o = o->next)
-    {
-      bfd_byte *contents;
-
-      if (! o->linker_mark)
-	{
-	  /* This section was omitted from the link.  */
-	  continue;
-	}
-
-      if ((o->flags & SEC_HAS_CONTENTS) == 0
-	  || (o->_raw_size == 0 && (o->flags & SEC_RELOC) == 0))
-	continue;
-
-      if ((o->flags & SEC_LINKER_CREATED) != 0)
-	{
-	  /* Section was created by _bfd_elf_link_create_dynamic_sections
-	     or somesuch.  */
-	  continue;
-	}
-
-      /* Get the contents of the section.  They have been cached by a
-	 relaxation routine.  Note that o is a section in an input
-	 file, so the contents field will not have been set by any of
-	 the routines which work on output files.  */
-      if (elf_section_data (o)->this_hdr.contents != NULL)
-	contents = elf_section_data (o)->this_hdr.contents;
-      else
-	{
-	  contents = finfo->contents;
-	  if (! bfd_get_section_contents (input_bfd, o, contents, 0,
-					  o->_raw_size))
-	    return FALSE;
-	}
-
-      if ((o->flags & SEC_RELOC) != 0)
-	{
-	  Elf_Internal_Rela *internal_relocs;
-
-	  /* Get the swapped relocs.  */
-	  internal_relocs
-	    = _bfd_elf_link_read_relocs (input_bfd, o, finfo->external_relocs,
-					 finfo->internal_relocs, FALSE);
-	  if (internal_relocs == NULL
-	      && o->reloc_count > 0)
-	    return FALSE;
-
-	  /* Run through the relocs looking for any against symbols
-	     from discarded sections and section symbols from
-	     removed link-once sections.  Complain about relocs
-	     against discarded sections.  Zero relocs against removed
-	     link-once sections.  Preserve debug information as much
-	     as we can.  */
-	  if (!elf_section_ignore_discarded_relocs (o))
-	    {
-	      Elf_Internal_Rela *rel, *relend;
-
-	      rel = internal_relocs;
-	      relend = rel + o->reloc_count * bed->s->int_rels_per_ext_rel;
-	      for ( ; rel < relend; rel++)
-		{
-		  unsigned long r_symndx = ELF_R_SYM (rel->r_info);
-		  asection *sec;
-
-		  if (r_symndx >= locsymcount
-		      || (elf_bad_symtab (input_bfd)
-			  && finfo->sections[r_symndx] == NULL))
-		    {
-		      struct elf_link_hash_entry *h;
-
-		      h = sym_hashes[r_symndx - extsymoff];
-		      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;
-
-		      /* Complain if the definition comes from a
-			 discarded section.  */
-		      sec = h->root.u.def.section;
-		      if ((h->root.type == bfd_link_hash_defined
-			   || h->root.type == bfd_link_hash_defweak)
-			  && elf_discarded_section (sec))
-			{
-			  if ((o->flags & SEC_DEBUGGING) != 0)
-			    {
-			      BFD_ASSERT (r_symndx != 0);
-			      /* Try to preserve debug information.  */
-			      if ((o->flags & SEC_DEBUGGING) != 0
-				  && sec->kept_section != NULL
-				  && sec->_raw_size == sec->kept_section->_raw_size)
-				h->root.u.def.section
-				  = sec->kept_section;
-			      else
-				memset (rel, 0, sizeof (*rel));
-			    }
-			  else
-			    finfo->info->callbacks->error_handler
-			      (LD_DEFINITION_IN_DISCARDED_SECTION,
-			       _("%T: discarded in section `%s' from %s\n"),
-			       h->root.root.string,
-			       h->root.root.string,
-			       h->root.u.def.section->name,
-			       bfd_archive_filename (h->root.u.def.section->owner));
-			}
-		    }
-		  else
-		    {
-		      sec = finfo->sections[r_symndx];
-
-		      if (sec != NULL && elf_discarded_section (sec))
-			{
-			  if ((o->flags & SEC_DEBUGGING) != 0
-			      || (sec->flags & SEC_LINK_ONCE) != 0)
-			    {
-			      BFD_ASSERT (r_symndx != 0);
-			      /* Try to preserve debug information.  */
-			      if ((o->flags & SEC_DEBUGGING) != 0
-				  && sec->kept_section != NULL
-				  && sec->_raw_size == sec->kept_section->_raw_size)
-				finfo->sections[r_symndx]
-				  = sec->kept_section;
-			      else
-				{
-				  rel->r_info
-				    = ELF_R_INFO (0, ELF_R_TYPE (rel->r_info));
-				  rel->r_addend = 0;
-				}
-			    }
-			  else
-			    {
-			      static int count;
-			      int ok;
-			      char *buf;
-
-			      ok = asprintf (&buf, "local symbol %d",
-					     count++);
-			      if (ok <= 0)
-				buf = (char *) "local symbol";
-			      finfo->info->callbacks->error_handler
-				(LD_DEFINITION_IN_DISCARDED_SECTION,
-				 _("%T: discarded in section `%s' from %s\n"),
-				 buf, buf, sec->name,
-				 bfd_archive_filename (input_bfd));
-			      if (ok != -1)
-				free (buf);
-			    }
-			}
-		    }
-		}
-	    }
-
-	  /* Relocate the section by invoking a back end routine.
-
-	     The back end routine is responsible for adjusting the
-	     section contents as necessary, and (if using Rela relocs
-	     and generating a relocatable output file) adjusting the
-	     reloc addend as necessary.
-
-	     The back end routine does not have to worry about setting
-	     the reloc address or the reloc symbol index.
-
-	     The back end routine is given a pointer to the swapped in
-	     internal symbols, and can access the hash table entries
-	     for the external symbols via elf_sym_hashes (input_bfd).
-
-	     When generating relocatable output, the back end routine
-	     must handle STB_LOCAL/STT_SECTION symbols specially.  The
-	     output symbol is going to be a section symbol
-	     corresponding to the output section, which will require
-	     the addend to be adjusted.  */
-
-	  if (! (*relocate_section) (output_bfd, finfo->info,
-				     input_bfd, o, contents,
-				     internal_relocs,
-				     isymbuf,
-				     finfo->sections))
-	    return FALSE;
-
-	  if (emit_relocs)
-	    {
-	      Elf_Internal_Rela *irela;
-	      Elf_Internal_Rela *irelaend;
-	      bfd_vma last_offset;
-	      struct elf_link_hash_entry **rel_hash;
-	      Elf_Internal_Shdr *input_rel_hdr, *input_rel_hdr2;
-	      unsigned int next_erel;
-	      bfd_boolean (*reloc_emitter)
-		(bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *);
-	      bfd_boolean rela_normal;
-
-	      input_rel_hdr = &elf_section_data (o)->rel_hdr;
-	      rela_normal = (bed->rela_normal
-			     && (input_rel_hdr->sh_entsize
-				 == sizeof (Elf_External_Rela)));
-
-	      /* Adjust the reloc addresses and symbol indices.  */
-
-	      irela = internal_relocs;
-	      irelaend = irela + o->reloc_count * bed->s->int_rels_per_ext_rel;
-	      rel_hash = (elf_section_data (o->output_section)->rel_hashes
-			  + elf_section_data (o->output_section)->rel_count
-			  + elf_section_data (o->output_section)->rel_count2);
-	      last_offset = o->output_offset;
-	      if (!finfo->info->relocatable)
-		last_offset += o->output_section->vma;
-	      for (next_erel = 0; irela < irelaend; irela++, next_erel++)
-		{
-		  unsigned long r_symndx;
-		  asection *sec;
-		  Elf_Internal_Sym sym;
-
-		  if (next_erel == bed->s->int_rels_per_ext_rel)
-		    {
-		      rel_hash++;
-		      next_erel = 0;
-		    }
-
-		  irela->r_offset = _bfd_elf_section_offset (output_bfd,
-							     finfo->info, o,
-							     irela->r_offset);
-		  if (irela->r_offset >= (bfd_vma) -2)
-		    {
-		      /* This is a reloc for a deleted entry or somesuch.
-			 Turn it into an R_*_NONE reloc, at the same
-			 offset as the last reloc.  elf_eh_frame.c and
-			 elf_bfd_discard_info rely on reloc offsets
-			 being ordered.  */
-		      irela->r_offset = last_offset;
-		      irela->r_info = 0;
-		      irela->r_addend = 0;
-		      continue;
-		    }
-
-		  irela->r_offset += o->output_offset;
-
-		  /* Relocs in an executable have to be virtual addresses.  */
-		  if (!finfo->info->relocatable)
-		    irela->r_offset += o->output_section->vma;
-
-		  last_offset = irela->r_offset;
-
-		  r_symndx = ELF_R_SYM (irela->r_info);
-		  if (r_symndx == STN_UNDEF)
-		    continue;
-
-		  if (r_symndx >= locsymcount
-		      || (elf_bad_symtab (input_bfd)
-			  && finfo->sections[r_symndx] == NULL))
-		    {
-		      struct elf_link_hash_entry *rh;
-		      unsigned long indx;
-
-		      /* This is a reloc against a global symbol.  We
-			 have not yet output all the local symbols, so
-			 we do not know the symbol index of any global
-			 symbol.  We set the rel_hash entry for this
-			 reloc to point to the global hash table entry
-			 for this symbol.  The symbol index is then
-			 set at the end of elf_bfd_final_link.  */
-		      indx = r_symndx - extsymoff;
-		      rh = elf_sym_hashes (input_bfd)[indx];
-		      while (rh->root.type == bfd_link_hash_indirect
-			     || rh->root.type == bfd_link_hash_warning)
-			rh = (struct elf_link_hash_entry *) rh->root.u.i.link;
-
-		      /* Setting the index to -2 tells
-			 elf_link_output_extsym that this symbol is
-			 used by a reloc.  */
-		      BFD_ASSERT (rh->indx < 0);
-		      rh->indx = -2;
-
-		      *rel_hash = rh;
-
-		      continue;
-		    }
-
-		  /* This is a reloc against a local symbol.  */
-
-		  *rel_hash = NULL;
-		  sym = isymbuf[r_symndx];
-		  sec = finfo->sections[r_symndx];
-		  if (ELF_ST_TYPE (sym.st_info) == STT_SECTION)
-		    {
-		      /* I suppose the backend ought to fill in the
-			 section of any STT_SECTION symbol against a
-			 processor specific section.  If we have
-			 discarded a section, the output_section will
-			 be the absolute section.  */
-		      if (bfd_is_abs_section (sec)
-			  || (sec != NULL
-			      && bfd_is_abs_section (sec->output_section)))
-			r_symndx = 0;
-		      else if (sec == NULL || sec->owner == NULL)
-			{
-			  bfd_set_error (bfd_error_bad_value);
-			  return FALSE;
-			}
-		      else
-			{
-			  r_symndx = sec->output_section->target_index;
-			  BFD_ASSERT (r_symndx != 0);
-			}
-
-		      /* Adjust the addend according to where the
-			 section winds up in the output section.  */
-		      if (rela_normal)
-			irela->r_addend += sec->output_offset;
-		    }
-		  else
-		    {
-		      if (finfo->indices[r_symndx] == -1)
-			{
-			  unsigned long shlink;
-			  const char *name;
-			  asection *osec;
-
-			  if (finfo->info->strip == strip_all)
-			    {
-			      /* You can't do ld -r -s.  */
-			      bfd_set_error (bfd_error_invalid_operation);
-			      return FALSE;
-			    }
-
-			  /* This symbol was skipped earlier, but
-			     since it is needed by a reloc, we
-			     must output it now.  */
-			  shlink = symtab_hdr->sh_link;
-			  name = (bfd_elf_string_from_elf_section
-				  (input_bfd, shlink, sym.st_name));
-			  if (name == NULL)
-			    return FALSE;
-
-			  osec = sec->output_section;
-			  sym.st_shndx =
-			    _bfd_elf_section_from_bfd_section (output_bfd,
-							       osec);
-			  if (sym.st_shndx == SHN_BAD)
-			    return FALSE;
-
-			  sym.st_value += sec->output_offset;
-			  if (! finfo->info->relocatable)
-			    {
-			      sym.st_value += osec->vma;
-			      if (ELF_ST_TYPE (sym.st_info) == STT_TLS)
-				{
-				  /* STT_TLS symbols are relative to PT_TLS
-				     segment base.  */
-				  BFD_ASSERT (elf_hash_table (finfo->info)
-					      ->tls_sec != NULL);
-				  sym.st_value -= (elf_hash_table (finfo->info)
-						   ->tls_sec->vma);
-				}
-			    }
-
-			  finfo->indices[r_symndx]
-			    = bfd_get_symcount (output_bfd);
-
-			  if (! elf_link_output_sym (finfo, name, &sym, sec,
-						     NULL))
-			    return FALSE;
-			}
-
-		      r_symndx = finfo->indices[r_symndx];
-		    }
-
-		  irela->r_info = ELF_R_INFO (r_symndx,
-					      ELF_R_TYPE (irela->r_info));
-		}
-
-	      /* Swap out the relocs.  */
-	      if (bed->elf_backend_emit_relocs
-		  && !(finfo->info->relocatable
-		       || finfo->info->emitrelocations))
-		reloc_emitter = bed->elf_backend_emit_relocs;
-	      else
-		reloc_emitter = _bfd_elf_link_output_relocs;
-
-	      if (input_rel_hdr->sh_size != 0
-		  && ! (*reloc_emitter) (output_bfd, o, input_rel_hdr,
-					 internal_relocs))
-		return FALSE;
-
-	      input_rel_hdr2 = elf_section_data (o)->rel_hdr2;
-	      if (input_rel_hdr2 && input_rel_hdr2->sh_size != 0)
-		{
-		  internal_relocs += (NUM_SHDR_ENTRIES (input_rel_hdr)
-				      * bed->s->int_rels_per_ext_rel);
-		  if (! (*reloc_emitter) (output_bfd, o, input_rel_hdr2,
-					  internal_relocs))
-		    return FALSE;
-		}
-	    }
-	}
-
-      /* Write out the modified section contents.  */
-      if (bed->elf_backend_write_section
-	  && (*bed->elf_backend_write_section) (output_bfd, o, contents))
-	{
-	  /* Section written out.  */
-	}
-      else switch (o->sec_info_type)
-	{
-	case ELF_INFO_TYPE_STABS:
-	  if (! (_bfd_write_section_stabs
-		 (output_bfd,
-		  &elf_hash_table (finfo->info)->stab_info,
-		  o, &elf_section_data (o)->sec_info, contents)))
-	    return FALSE;
-	  break;
-	case ELF_INFO_TYPE_MERGE:
-	  if (! _bfd_write_merged_section (output_bfd, o,
-					   elf_section_data (o)->sec_info))
-	    return FALSE;
-	  break;
-	case ELF_INFO_TYPE_EH_FRAME:
-	  {
-	    if (! _bfd_elf_write_section_eh_frame (output_bfd, finfo->info,
-						   o, contents))
-	      return FALSE;
-	  }
-	  break;
-	default:
-	  {
-	    bfd_size_type sec_size;
-
-	    sec_size = (o->_cooked_size != 0 ? o->_cooked_size : o->_raw_size);
-	    if (! (o->flags & SEC_EXCLUDE)
-		&& ! bfd_set_section_contents (output_bfd, o->output_section,
-					       contents,
-					       (file_ptr) o->output_offset,
-					       sec_size))
-	      return FALSE;
-	  }
-	  break;
-	}
-    }
-
-  return TRUE;
-}
-
-/* Generate a reloc when linking an ELF file.  This is a reloc
-   requested by the linker, and does come from any input file.  This
-   is used to build constructor and destructor tables when linking
-   with -Ur.  */
-
-static bfd_boolean
-elf_reloc_link_order (bfd *output_bfd,
-		      struct bfd_link_info *info,
-		      asection *output_section,
-		      struct bfd_link_order *link_order)
-{
-  reloc_howto_type *howto;
-  long indx;
-  bfd_vma offset;
-  bfd_vma addend;
-  struct elf_link_hash_entry **rel_hash_ptr;
-  Elf_Internal_Shdr *rel_hdr;
-  const struct elf_backend_data *bed = get_elf_backend_data (output_bfd);
-  Elf_Internal_Rela irel[MAX_INT_RELS_PER_EXT_REL];
-  bfd_byte *erel;
-  unsigned int i;
-
-  howto = bfd_reloc_type_lookup (output_bfd, link_order->u.reloc.p->reloc);
-  if (howto == NULL)
-    {
-      bfd_set_error (bfd_error_bad_value);
-      return FALSE;
-    }
-
-  addend = link_order->u.reloc.p->addend;
-
-  /* Figure out the symbol index.  */
-  rel_hash_ptr = (elf_section_data (output_section)->rel_hashes
-		  + 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;
-      BFD_ASSERT (indx != 0);
-      *rel_hash_ptr = NULL;
-    }
-  else
-    {
-      struct elf_link_hash_entry *h;
-
-      /* Treat a reloc against a defined symbol as though it were
-	 actually against the section.  */
-      h = ((struct elf_link_hash_entry *)
-	   bfd_wrapped_link_hash_lookup (output_bfd, info,
-					 link_order->u.reloc.p->u.name,
-					 FALSE, FALSE, TRUE));
-      if (h != NULL
-	  && (h->root.type == bfd_link_hash_defined
-	      || h->root.type == bfd_link_hash_defweak))
-	{
-	  asection *section;
-
-	  section = h->root.u.def.section;
-	  indx = section->output_section->target_index;
-	  *rel_hash_ptr = NULL;
-	  /* It seems that we ought to add the symbol value to the
-	     addend here, but in practice it has already been added
-	     because it was passed to constructor_callback.  */
-	  addend += section->output_section->vma + section->output_offset;
-	}
-      else if (h != NULL)
-	{
-	  /* Setting the index to -2 tells elf_link_output_extsym that
-	     this symbol is used by a reloc.  */
-	  h->indx = -2;
-	  *rel_hash_ptr = h;
-	  indx = 0;
-	}
-      else
-	{
-	  if (! ((*info->callbacks->unattached_reloc)
-		 (info, link_order->u.reloc.p->u.name, NULL, NULL, 0)))
-	    return FALSE;
-	  indx = 0;
-	}
-    }
-
-  /* If this is an inplace reloc, we must write the addend into the
-     object file.  */
-  if (howto->partial_inplace && addend != 0)
-    {
-      bfd_size_type size;
-      bfd_reloc_status_type rstat;
-      bfd_byte *buf;
-      bfd_boolean ok;
-      const char *sym_name;
-
-      size = bfd_get_reloc_size (howto);
-      buf = bfd_zmalloc (size);
-      if (buf == NULL)
-	return FALSE;
-      rstat = _bfd_relocate_contents (howto, output_bfd, addend, buf);
-      switch (rstat)
-	{
-	case bfd_reloc_ok:
-	  break;
-
-	default:
-	case bfd_reloc_outofrange:
-	  abort ();
-
-	case bfd_reloc_overflow:
-	  if (link_order->type == bfd_section_reloc_link_order)
-	    sym_name = bfd_section_name (output_bfd,
-					 link_order->u.reloc.p->u.section);
-	  else
-	    sym_name = link_order->u.reloc.p->u.name;
-	  if (! ((*info->callbacks->reloc_overflow)
-		 (info, sym_name, howto->name, addend, NULL, NULL, 0)))
-	    {
-	      free (buf);
-	      return FALSE;
-	    }
-	  break;
-	}
-      ok = bfd_set_section_contents (output_bfd, output_section, buf,
-				     link_order->offset, size);
-      free (buf);
-      if (! ok)
-	return FALSE;
-    }
-
-  /* The address of a reloc is relative to the section in a
-     relocatable file, and is a virtual address in an executable
-     file.  */
-  offset = link_order->offset;
-  if (! info->relocatable)
-    offset += output_section->vma;
-
-  for (i = 0; i < bed->s->int_rels_per_ext_rel; i++)
-    {
-      irel[i].r_offset = offset;
-      irel[i].r_info = 0;
-      irel[i].r_addend = 0;
-    }
-  irel[0].r_info = ELF_R_INFO (indx, howto->type);
-
-  rel_hdr = &elf_section_data (output_section)->rel_hdr;
-  erel = rel_hdr->contents;
-  if (rel_hdr->sh_type == SHT_REL)
-    {
-      erel += (elf_section_data (output_section)->rel_count
-	       * sizeof (Elf_External_Rel));
-      (*bed->s->swap_reloc_out) (output_bfd, irel, erel);
-    }
-  else
-    {
-      irel[0].r_addend = addend;
-      erel += (elf_section_data (output_section)->rel_count
-	       * sizeof (Elf_External_Rela));
-      (*bed->s->swap_reloca_out) (output_bfd, irel, erel);
-    }
-
-  ++elf_section_data (output_section)->rel_count;
-
-  return TRUE;
-}
-
-/* Garbage collect unused sections.  */
-
-static bfd_boolean elf_gc_sweep_symbol
-  (struct elf_link_hash_entry *, void *);
-
-static bfd_boolean elf_gc_allocate_got_offsets
-  (struct elf_link_hash_entry *, void *);
-
-/* The mark phase of garbage collection.  For a given section, mark
-   it and any sections in this section's group, and all the sections
-   which define symbols to which it refers.  */
-
-typedef asection * (*gc_mark_hook_fn)
-  (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
-   struct elf_link_hash_entry *, Elf_Internal_Sym *);
-
-static bfd_boolean
-elf_gc_mark (struct bfd_link_info *info,
-	     asection *sec,
-	     gc_mark_hook_fn gc_mark_hook)
-{
-  bfd_boolean ret;
-  asection *group_sec;
-
-  sec->gc_mark = 1;
-
-  /* Mark all the sections in the group.  */
-  group_sec = elf_section_data (sec)->next_in_group;
-  if (group_sec && !group_sec->gc_mark)
-    if (!elf_gc_mark (info, group_sec, gc_mark_hook))
-      return FALSE;
-
-  /* Look through the section relocs.  */
-  ret = TRUE;
-  if ((sec->flags & SEC_RELOC) != 0 && sec->reloc_count > 0)
-    {
-      Elf_Internal_Rela *relstart, *rel, *relend;
-      Elf_Internal_Shdr *symtab_hdr;
-      struct elf_link_hash_entry **sym_hashes;
-      size_t nlocsyms;
-      size_t extsymoff;
-      bfd *input_bfd = sec->owner;
-      const struct elf_backend_data *bed = get_elf_backend_data (input_bfd);
-      Elf_Internal_Sym *isym = NULL;
-
-      symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
-      sym_hashes = elf_sym_hashes (input_bfd);
-
-      /* Read the local symbols.  */
-      if (elf_bad_symtab (input_bfd))
-	{
-	  nlocsyms = symtab_hdr->sh_size / sizeof (Elf_External_Sym);
-	  extsymoff = 0;
-	}
-      else
-	extsymoff = nlocsyms = symtab_hdr->sh_info;
-
-      isym = (Elf_Internal_Sym *) symtab_hdr->contents;
-      if (isym == NULL && nlocsyms != 0)
-	{
-	  isym = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, nlocsyms, 0,
-				       NULL, NULL, NULL);
-	  if (isym == NULL)
-	    return FALSE;
-	}
-
-      /* Read the relocations.  */
-      relstart = _bfd_elf_link_read_relocs (input_bfd, sec, NULL, NULL,
-					    info->keep_memory);
-      if (relstart == NULL)
-	{
-	  ret = FALSE;
-	  goto out1;
-	}
-      relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel;
-
-      for (rel = relstart; rel < relend; rel++)
-	{
-	  unsigned long r_symndx;
-	  asection *rsec;
-	  struct elf_link_hash_entry *h;
-
-	  r_symndx = ELF_R_SYM (rel->r_info);
-	  if (r_symndx == 0)
-	    continue;
-
-	  if (r_symndx >= nlocsyms
-	      || ELF_ST_BIND (isym[r_symndx].st_info) != STB_LOCAL)
-	    {
-	      h = sym_hashes[r_symndx - extsymoff];
-	      rsec = (*gc_mark_hook) (sec, info, rel, h, NULL);
-	    }
-	  else
-	    {
-	      rsec = (*gc_mark_hook) (sec, info, rel, NULL, &isym[r_symndx]);
-	    }
-
-	  if (rsec && !rsec->gc_mark)
-	    {
-	      if (bfd_get_flavour (rsec->owner) != bfd_target_elf_flavour)
-		rsec->gc_mark = 1;
-	      else if (!elf_gc_mark (info, rsec, gc_mark_hook))
-		{
-		  ret = FALSE;
-		  goto out2;
-		}
-	    }
-	}
-
-    out2:
-      if (elf_section_data (sec)->relocs != relstart)
-	free (relstart);
-    out1:
-      if (isym != NULL && symtab_hdr->contents != (unsigned char *) isym)
-	{
-	  if (! info->keep_memory)
-	    free (isym);
-	  else
-	    symtab_hdr->contents = (unsigned char *) isym;
-	}
-    }
-
-  return ret;
-}
-
-/* The sweep phase of garbage collection.  Remove all garbage sections.  */
-
-typedef bfd_boolean (*gc_sweep_hook_fn)
-  (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *);
-
-static bfd_boolean
-elf_gc_sweep (struct bfd_link_info *info, gc_sweep_hook_fn gc_sweep_hook)
-{
-  bfd *sub;
-
-  for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
-    {
-      asection *o;
-
-      if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
-	continue;
-
-      for (o = sub->sections; o != NULL; o = o->next)
-	{
-	  /* Keep special sections.  Keep .debug sections.  */
-	  if ((o->flags & SEC_LINKER_CREATED)
-	      || (o->flags & SEC_DEBUGGING))
-	    o->gc_mark = 1;
-
-	  if (o->gc_mark)
-	    continue;
-
-	  /* Skip sweeping sections already excluded.  */
-	  if (o->flags & SEC_EXCLUDE)
-	    continue;
-
-	  /* Since this is early in the link process, it is simple
-	     to remove a section from the output.  */
-	  o->flags |= SEC_EXCLUDE;
-
-	  /* But we also have to update some of the relocation
-	     info we collected before.  */
-	  if (gc_sweep_hook
-	      && (o->flags & SEC_RELOC) && o->reloc_count > 0)
-	    {
-	      Elf_Internal_Rela *internal_relocs;
-	      bfd_boolean r;
-
-	      internal_relocs
-		= _bfd_elf_link_read_relocs (o->owner, o, NULL, NULL,
-					     info->keep_memory);
-	      if (internal_relocs == NULL)
-		return FALSE;
-
-	      r = (*gc_sweep_hook) (o->owner, info, o, internal_relocs);
-
-	      if (elf_section_data (o)->relocs != internal_relocs)
-		free (internal_relocs);
-
-	      if (!r)
-		return FALSE;
-	    }
-	}
-    }
-
-  /* Remove the symbols that were in the swept sections from the dynamic
-     symbol table.  GCFIXME: Anyone know how to get them out of the
-     static symbol table as well?  */
-  {
-    int i = 0;
-
-    elf_link_hash_traverse (elf_hash_table (info), elf_gc_sweep_symbol, &i);
-
-    elf_hash_table (info)->dynsymcount = i;
-  }
-
-  return TRUE;
-}
-
-/* Sweep symbols in swept sections.  Called via elf_link_hash_traverse.  */
-
-static bfd_boolean
-elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *idxptr)
-{
-  int *idx = idxptr;
-
-  if (h->root.type == bfd_link_hash_warning)
-    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
-  if (h->dynindx != -1
-      && ((h->root.type != bfd_link_hash_defined
-	   && h->root.type != bfd_link_hash_defweak)
-	  || h->root.u.def.section->gc_mark))
-    h->dynindx = (*idx)++;
-
-  return TRUE;
-}
-
-/* Propagate collected vtable information.  This is called through
-   elf_link_hash_traverse.  */
-
-static bfd_boolean
-elf_gc_propagate_vtable_entries_used (struct elf_link_hash_entry *h, void *okp)
-{
-  if (h->root.type == bfd_link_hash_warning)
-    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
-  /* Those that are not vtables.  */
-  if (h->vtable_parent == NULL)
-    return TRUE;
-
-  /* Those vtables that do not have parents, we cannot merge.  */
-  if (h->vtable_parent == (struct elf_link_hash_entry *) -1)
-    return TRUE;
-
-  /* If we've already been done, exit.  */
-  if (h->vtable_entries_used && h->vtable_entries_used[-1])
-    return TRUE;
-
-  /* Make sure the parent's table is up to date.  */
-  elf_gc_propagate_vtable_entries_used (h->vtable_parent, okp);
-
-  if (h->vtable_entries_used == NULL)
-    {
-      /* None of this table's entries were referenced.  Re-use the
-	 parent's table.  */
-      h->vtable_entries_used = h->vtable_parent->vtable_entries_used;
-      h->vtable_entries_size = h->vtable_parent->vtable_entries_size;
-    }
-  else
-    {
-      size_t n;
-      bfd_boolean *cu, *pu;
-
-      /* Or the parent's entries into ours.  */
-      cu = h->vtable_entries_used;
-      cu[-1] = TRUE;
-      pu = h->vtable_parent->vtable_entries_used;
-      if (pu != NULL)
-	{
-	  const struct elf_backend_data *bed;
-	  unsigned int log_file_align;
-
-	  bed = get_elf_backend_data (h->root.u.def.section->owner);
-	  log_file_align = bed->s->log_file_align;
-	  n = h->vtable_parent->vtable_entries_size >> log_file_align;
-	  while (n--)
-	    {
-	      if (*pu)
-		*cu = TRUE;
-	      pu++;
-	      cu++;
-	    }
-	}
-    }
-
-  return TRUE;
-}
-
-static bfd_boolean
-elf_gc_smash_unused_vtentry_relocs (struct elf_link_hash_entry *h, void *okp)
-{
-  asection *sec;
-  bfd_vma hstart, hend;
-  Elf_Internal_Rela *relstart, *relend, *rel;
-  const struct elf_backend_data *bed;
-  unsigned int log_file_align;
-
-  if (h->root.type == bfd_link_hash_warning)
-    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
-  /* Take care of both those symbols that do not describe vtables as
-     well as those that are not loaded.  */
-  if (h->vtable_parent == NULL)
-    return TRUE;
-
-  BFD_ASSERT (h->root.type == bfd_link_hash_defined
-	      || h->root.type == bfd_link_hash_defweak);
-
-  sec = h->root.u.def.section;
-  hstart = h->root.u.def.value;
-  hend = hstart + h->size;
-
-  relstart = _bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL, TRUE);
-  if (!relstart)
-    return *(bfd_boolean *) okp = FALSE;
-  bed = get_elf_backend_data (sec->owner);
-  log_file_align = bed->s->log_file_align;
-
-  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)
-      {
-	/* If the entry is in use, do nothing.  */
-	if (h->vtable_entries_used
-	    && (rel->r_offset - hstart) < h->vtable_entries_size)
-	  {
-	    bfd_vma entry = (rel->r_offset - hstart) >> log_file_align;
-	    if (h->vtable_entries_used[entry])
-	      continue;
-	  }
-	/* Otherwise, kill it.  */
-	rel->r_offset = rel->r_info = rel->r_addend = 0;
-      }
-
-  return TRUE;
-}
-
-/* Do mark and sweep of unused sections.  */
-
-bfd_boolean
-elf_gc_sections (bfd *abfd, struct bfd_link_info *info)
-{
-  bfd_boolean ok = TRUE;
-  bfd *sub;
-  asection * (*gc_mark_hook)
-    (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
-     struct elf_link_hash_entry *h, Elf_Internal_Sym *);
-
-  if (!get_elf_backend_data (abfd)->can_gc_sections
-      || info->relocatable
-      || info->emitrelocations
-      || !is_elf_hash_table (info->hash)
-      || elf_hash_table (info)->dynamic_sections_created)
-    {
-      (*_bfd_error_handler)(_("Warning: gc-sections option ignored"));
-      return TRUE;
-    }
-
-  /* Apply transitive closure to the vtable entry usage info.  */
-  elf_link_hash_traverse (elf_hash_table (info),
-			  elf_gc_propagate_vtable_entries_used,
-			  &ok);
-  if (!ok)
-    return FALSE;
-
-  /* Kill the vtable relocations that were not used.  */
-  elf_link_hash_traverse (elf_hash_table (info),
-			  elf_gc_smash_unused_vtentry_relocs,
-			  &ok);
-  if (!ok)
-    return FALSE;
-
-  /* Grovel through relocs to find out who stays ...  */
-
-  gc_mark_hook = get_elf_backend_data (abfd)->gc_mark_hook;
-  for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
-    {
-      asection *o;
-
-      if (bfd_get_flavour (sub) != bfd_target_elf_flavour)
-	continue;
-
-      for (o = sub->sections; o != NULL; o = o->next)
-	{
-	  if (o->flags & SEC_KEEP)
-	    if (!elf_gc_mark (info, o, gc_mark_hook))
-	      return FALSE;
-	}
-    }
-
-  /* ... and mark SEC_EXCLUDE for those that go.  */
-  if (!elf_gc_sweep (info, get_elf_backend_data (abfd)->gc_sweep_hook))
-    return FALSE;
-
-  return TRUE;
-}
-
-/* Called from check_relocs to record the existence of a VTINHERIT reloc.  */
-
-bfd_boolean
-elf_gc_record_vtinherit (bfd *abfd,
-			 asection *sec,
-			 struct elf_link_hash_entry *h,
-			 bfd_vma offset)
-{
-  struct elf_link_hash_entry **sym_hashes, **sym_hashes_end;
-  struct elf_link_hash_entry **search, *child;
-  bfd_size_type extsymcount;
-
-  /* The sh_info field of the symtab header tells us where the
-     external symbols start.  We don't care about the local symbols at
-     this point.  */
-  extsymcount = elf_tdata (abfd)->symtab_hdr.sh_size/sizeof (Elf_External_Sym);
-  if (!elf_bad_symtab (abfd))
-    extsymcount -= elf_tdata (abfd)->symtab_hdr.sh_info;
-
-  sym_hashes = elf_sym_hashes (abfd);
-  sym_hashes_end = sym_hashes + extsymcount;
-
-  /* Hunt down the child symbol, which is in this section at the same
-     offset as the relocation.  */
-  for (search = sym_hashes; search != sym_hashes_end; ++search)
-    {
-      if ((child = *search) != NULL
-	  && (child->root.type == bfd_link_hash_defined
-	      || child->root.type == bfd_link_hash_defweak)
-	  && child->root.u.def.section == sec
-	  && child->root.u.def.value == offset)
-	goto win;
-    }
-
-  (*_bfd_error_handler) ("%s: %s+%lu: No symbol found for INHERIT",
-			 bfd_archive_filename (abfd), sec->name,
-			 (unsigned long) offset);
-  bfd_set_error (bfd_error_invalid_operation);
-  return FALSE;
-
- win:
-  if (!h)
-    {
-      /* This *should* only be the absolute section.  It could potentially
-	 be that someone has defined a non-global vtable though, which
-	 would be bad.  It isn't worth paging in the local symbols to be
-	 sure though; that case should simply be handled by the assembler.  */
-
-      child->vtable_parent = (struct elf_link_hash_entry *) -1;
-    }
-  else
-    child->vtable_parent = h;
-
-  return TRUE;
-}
-
-/* Called from check_relocs to record the existence of a VTENTRY reloc.  */
-
-bfd_boolean
-elf_gc_record_vtentry (bfd *abfd ATTRIBUTE_UNUSED,
-		       asection *sec ATTRIBUTE_UNUSED,
-		       struct elf_link_hash_entry *h,
-		       bfd_vma addend)
-{
-  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
-  unsigned int log_file_align = bed->s->log_file_align;
-
-  if (addend >= h->vtable_entries_size)
-    {
-      size_t size, bytes, file_align;
-      bfd_boolean *ptr = h->vtable_entries_used;
-
-      /* While the symbol is undefined, we have to be prepared to handle
-	 a zero size.  */
-      file_align = 1 << log_file_align;
-      if (h->root.type == bfd_link_hash_undefined)
-	size = addend + file_align;
-      else
-	{
-	  size = h->size;
-	  if (addend >= size)
-	    {
-	      /* Oops!  We've got a reference past the defined end of
-		 the table.  This is probably a bug -- shall we warn?  */
-	      size = addend + file_align;
-	    }
-	}
-      size = (size + file_align - 1) & -file_align;
-
-      /* Allocate one extra entry for use as a "done" flag for the
-	 consolidation pass.  */
-      bytes = ((size >> log_file_align) + 1) * sizeof (bfd_boolean);
-
-      if (ptr)
-	{
-	  ptr = bfd_realloc (ptr - 1, bytes);
-
-	  if (ptr != NULL)
-	    {
-	      size_t oldbytes;
-
-	      oldbytes = (((h->vtable_entries_size >> log_file_align) + 1)
-			  * sizeof (bfd_boolean));
-	      memset (((char *) ptr) + oldbytes, 0, bytes - oldbytes);
-	    }
-	}
-      else
-	ptr = bfd_zmalloc (bytes);
-
-      if (ptr == NULL)
-	return FALSE;
-
-      /* And arrange for that done flag to be at index -1.  */
-      h->vtable_entries_used = ptr + 1;
-      h->vtable_entries_size = size;
-    }
-
-  h->vtable_entries_used[addend >> log_file_align] = TRUE;
-
-  return TRUE;
-}
-
-/* And an accompanying bit to work out final got entry offsets once
-   we're done.  Should be called from final_link.  */
-
-bfd_boolean
-elf_gc_common_finalize_got_offsets (bfd *abfd,
-				    struct bfd_link_info *info)
-{
-  bfd *i;
-  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
-  bfd_vma gotoff;
-
-  if (! is_elf_hash_table (info->hash))
-    return FALSE;
-
-  /* The GOT offset is relative to the .got section, but the GOT header is
-     put into the .got.plt section, if the backend uses it.  */
-  if (bed->want_got_plt)
-    gotoff = 0;
-  else
-    gotoff = bed->got_header_size;
-
-  /* Do the local .got entries first.  */
-  for (i = info->input_bfds; i; i = i->link_next)
-    {
-      bfd_signed_vma *local_got;
-      bfd_size_type j, locsymcount;
-      Elf_Internal_Shdr *symtab_hdr;
-
-      if (bfd_get_flavour (i) != bfd_target_elf_flavour)
-	continue;
-
-      local_got = elf_local_got_refcounts (i);
-      if (!local_got)
-	continue;
-
-      symtab_hdr = &elf_tdata (i)->symtab_hdr;
-      if (elf_bad_symtab (i))
-	locsymcount = symtab_hdr->sh_size / sizeof (Elf_External_Sym);
-      else
-	locsymcount = symtab_hdr->sh_info;
-
-      for (j = 0; j < locsymcount; ++j)
-	{
-	  if (local_got[j] > 0)
-	    {
-	      local_got[j] = gotoff;
-	      gotoff += ARCH_SIZE / 8;
-	    }
-	  else
-	    local_got[j] = (bfd_vma) -1;
-	}
-    }
-
-  /* Then the global .got entries.  .plt refcounts are handled by
-     adjust_dynamic_symbol  */
-  elf_link_hash_traverse (elf_hash_table (info),
-			  elf_gc_allocate_got_offsets,
-			  &gotoff);
-  return TRUE;
-}
-
-/* We need a special top-level link routine to convert got reference counts
-   to real got offsets.  */
-
-static bfd_boolean
-elf_gc_allocate_got_offsets (struct elf_link_hash_entry *h, void *offarg)
-{
-  bfd_vma *off = offarg;
-
-  if (h->root.type == bfd_link_hash_warning)
-    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
-  if (h->got.refcount > 0)
-    {
-      h->got.offset = off[0];
-      off[0] += ARCH_SIZE / 8;
-    }
-  else
-    h->got.offset = (bfd_vma) -1;
-
-  return TRUE;
-}
-
-/* Many folk need no more in the way of final link than this, once
-   got entry reference counting is enabled.  */
-
-bfd_boolean
-elf_gc_common_final_link (bfd *abfd, struct bfd_link_info *info)
-{
-  if (!elf_gc_common_finalize_got_offsets (abfd, info))
-    return FALSE;
-
-  /* Invoke the regular ELF backend linker to do all the work.  */
-  return elf_bfd_final_link (abfd, info);
-}
-
-/* This function will be called though elf_link_hash_traverse to store
-   all hash value of the exported symbols in an array.  */
-
-static bfd_boolean
-elf_collect_hash_codes (struct elf_link_hash_entry *h, void *data)
-{
-  unsigned long **valuep = data;
-  const char *name;
-  char *p;
-  unsigned long ha;
-  char *alc = NULL;
-
-  if (h->root.type == bfd_link_hash_warning)
-    h = (struct elf_link_hash_entry *) h->root.u.i.link;
-
-  /* Ignore indirect symbols.  These are added by the versioning code.  */
-  if (h->dynindx == -1)
-    return TRUE;
-
-  name = h->root.root.string;
-  p = strchr (name, ELF_VER_CHR);
-  if (p != NULL)
-    {
-      alc = bfd_malloc (p - name + 1);
-      memcpy (alc, name, p - name);
-      alc[p - name] = '\0';
-      name = alc;
-    }
-
-  /* Compute the hash value.  */
-  ha = bfd_elf_hash (name);
-
-  /* Store the found hash value in the array given as the argument.  */
-  *(*valuep)++ = ha;
-
-  /* And store it in the struct so that we can put it in the hash table
-     later.  */
-  h->elf_hash_value = ha;
-
-  if (alc != NULL)
-    free (alc);
-
-  return TRUE;
-}
-
-bfd_boolean
-elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie)
-{
-  struct elf_reloc_cookie *rcookie = cookie;
-
-  if (rcookie->bad_symtab)
-    rcookie->rel = rcookie->rels;
-
-  for (; rcookie->rel < rcookie->relend; rcookie->rel++)
-    {
-      unsigned long r_symndx;
-
-      if (! rcookie->bad_symtab)
-	if (rcookie->rel->r_offset > offset)
-	  return FALSE;
-      if (rcookie->rel->r_offset != offset)
-	continue;
-
-      r_symndx = ELF_R_SYM (rcookie->rel->r_info);
-      if (r_symndx == SHN_UNDEF)
-	return TRUE;
-
-      if (r_symndx >= rcookie->locsymcount
-	  || ELF_ST_BIND (rcookie->locsyms[r_symndx].st_info) != STB_LOCAL)
-	{
-	  struct elf_link_hash_entry *h;
-
-	  h = rcookie->sym_hashes[r_symndx - rcookie->extsymoff];
-
-	  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 ((h->root.type == bfd_link_hash_defined
-	       || h->root.type == bfd_link_hash_defweak)
-	      && elf_discarded_section (h->root.u.def.section))
-	    return TRUE;
-	  else
-	    return FALSE;
-	}
-      else
-	{
-	  /* It's not a relocation against a global symbol,
-	     but it could be a relocation against a local
-	     symbol for a discarded section.  */
-	  asection *isec;
-	  Elf_Internal_Sym *isym;
-
-	  /* Need to: get the symbol; get the section.  */
-	  isym = &rcookie->locsyms[r_symndx];
-	  if (isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE)
-	    {
-	      isec = section_from_elf_index (rcookie->abfd, isym->st_shndx);
-	      if (isec != NULL && elf_discarded_section (isec))
-		return TRUE;
-	    }
-	}
-      return FALSE;
-    }
-  return FALSE;
-}
-
-/* Discard unneeded references to discarded sections.
-   Returns TRUE if any section's size was changed.  */
-/* This function assumes that the relocations are in sorted order,
-   which is true for all known assemblers.  */
-
-bfd_boolean
-elf_bfd_discard_info (bfd *output_bfd, struct bfd_link_info *info)
-{
-  struct elf_reloc_cookie cookie;
-  asection *stab, *eh;
-  Elf_Internal_Shdr *symtab_hdr;
-  const struct elf_backend_data *bed;
-  bfd *abfd;
-  unsigned int count;
-  bfd_boolean ret = FALSE;
-
-  if (info->traditional_format
-      || !is_elf_hash_table (info->hash))
-    return FALSE;
-
-  for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next)
-    {
-      if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
-	continue;
-
-      bed = get_elf_backend_data (abfd);
-
-      if ((abfd->flags & DYNAMIC) != 0)
-	continue;
-
-      eh = bfd_get_section_by_name (abfd, ".eh_frame");
-      if (info->relocatable
-	  || (eh != NULL
-	      && (eh->_raw_size == 0
-		  || bfd_is_abs_section (eh->output_section))))
-	eh = NULL;
-
-      stab = bfd_get_section_by_name (abfd, ".stab");
-      if (stab != NULL
-	  && (stab->_raw_size == 0
-	      || bfd_is_abs_section (stab->output_section)
-	      || stab->sec_info_type != ELF_INFO_TYPE_STABS))
-	stab = NULL;
-
-      if (stab == NULL
-	  && eh == NULL
-	  && bed->elf_backend_discard_info == NULL)
-	continue;
-
-      symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
-      cookie.abfd = abfd;
-      cookie.sym_hashes = elf_sym_hashes (abfd);
-      cookie.bad_symtab = elf_bad_symtab (abfd);
-      if (cookie.bad_symtab)
-	{
-	  cookie.locsymcount = symtab_hdr->sh_size / sizeof (Elf_External_Sym);
-	  cookie.extsymoff = 0;
-	}
-      else
-	{
-	  cookie.locsymcount = symtab_hdr->sh_info;
-	  cookie.extsymoff = symtab_hdr->sh_info;
-	}
-
-      cookie.locsyms = (Elf_Internal_Sym *) symtab_hdr->contents;
-      if (cookie.locsyms == NULL && cookie.locsymcount != 0)
-	{
-	  cookie.locsyms = bfd_elf_get_elf_syms (abfd, symtab_hdr,
-						 cookie.locsymcount, 0,
-						 NULL, NULL, NULL);
-	  if (cookie.locsyms == NULL)
-	    return FALSE;
-	}
-
-      if (stab != NULL)
-	{
-	  cookie.rels = NULL;
-	  count = stab->reloc_count;
-	  if (count != 0)
-	    cookie.rels = _bfd_elf_link_read_relocs (abfd, stab, NULL, NULL,
-						     info->keep_memory);
-	  if (cookie.rels != NULL)
-	    {
-	      cookie.rel = cookie.rels;
-	      cookie.relend = cookie.rels;
-	      cookie.relend += count * bed->s->int_rels_per_ext_rel;
-	      if (_bfd_discard_section_stabs (abfd, stab,
-					      elf_section_data (stab)->sec_info,
-					      elf_reloc_symbol_deleted_p,
-					      &cookie))
-		ret = TRUE;
-	      if (elf_section_data (stab)->relocs != cookie.rels)
-		free (cookie.rels);
-	    }
-	}
-
-      if (eh != NULL)
-	{
-	  cookie.rels = NULL;
-	  count = eh->reloc_count;
-	  if (count != 0)
-	    cookie.rels = _bfd_elf_link_read_relocs (abfd, eh, NULL, NULL,
-						     info->keep_memory);
-	  cookie.rel = cookie.rels;
-	  cookie.relend = cookie.rels;
-	  if (cookie.rels != NULL)
-	    cookie.relend += count * bed->s->int_rels_per_ext_rel;
-
-	  if (_bfd_elf_discard_section_eh_frame (abfd, info, eh,
-						 elf_reloc_symbol_deleted_p,
-						 &cookie))
-	    ret = TRUE;
-
-	  if (cookie.rels != NULL
-	      && elf_section_data (eh)->relocs != cookie.rels)
-	    free (cookie.rels);
-	}
-
-      if (bed->elf_backend_discard_info != NULL
-	  && (*bed->elf_backend_discard_info) (abfd, &cookie, info))
-	ret = TRUE;
-
-      if (cookie.locsyms != NULL
-	  && symtab_hdr->contents != (unsigned char *) cookie.locsyms)
-	{
-	  if (! info->keep_memory)
-	    free (cookie.locsyms);
-	  else
-	    symtab_hdr->contents = (unsigned char *) cookie.locsyms;
-	}
-    }
-
-  if (info->eh_frame_hdr
-      && !info->relocatable
-      && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info))
-    ret = TRUE;
-
-  return ret;
-}
-
-static bfd_boolean
-elf_section_ignore_discarded_relocs (asection *sec)
-{
-  const struct elf_backend_data *bed;
-
-  switch (sec->sec_info_type)
-    {
-    case ELF_INFO_TYPE_STABS:
-    case ELF_INFO_TYPE_EH_FRAME:
-      return TRUE;
-    default:
-      break;
-    }
-
-  bed = get_elf_backend_data (sec->owner);
-  if (bed->elf_backend_ignore_discarded_relocs != NULL
-      && (*bed->elf_backend_ignore_discarded_relocs) (sec))
-    return TRUE;
-
-  return FALSE;
-}
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index 973edd5..769c414 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -1,6 +1,6 @@
 /* MIPS-specific support for 32-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003  Free Software Foundation, Inc.
+   2003, 2004 Free Software Foundation, Inc.
 
    Most of the information added by Ian Lance Taylor, Cygnus Support,
    <ian@cygnus.com>.
@@ -1425,7 +1425,7 @@
   relocation += symbol->section->output_section->vma;
   relocation += symbol->section->output_offset;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   if (reloc_entry->howto->src_mask == 0)
@@ -1520,7 +1520,7 @@
   if (ret != bfd_reloc_ok)
     return ret;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   if (bfd_is_com_section (symbol->section))
@@ -1760,7 +1760,7 @@
 elf32_mips_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
 {
   int offset;
-  unsigned int raw_size;
+  unsigned int size;
 
   switch (note->descsz)
     {
@@ -1776,13 +1776,13 @@
 
 	/* pr_reg */
 	offset = 72;
-	raw_size = 360;
+	size = 360;
 
 	break;
     }
 
   /* Make a ".reg/999" section.  */
-  return _bfd_elfcore_make_pseudosection (abfd, ".reg", raw_size,
+  return _bfd_elfcore_make_pseudosection (abfd, ".reg", size,
 					  note->descpos + offset);
 }
 
diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c
index 47b4eae..74fbfba 100644
--- a/bfd/elfxx-ia64.c
+++ b/bfd/elfxx-ia64.c
@@ -186,13 +186,13 @@
 static bfd_boolean elfNN_ia64_section_from_shdr
   PARAMS ((bfd *, Elf_Internal_Shdr *, const char *));
 static bfd_boolean elfNN_ia64_section_flags
-  PARAMS ((flagword *, Elf_Internal_Shdr *));
+  PARAMS ((flagword *, const Elf_Internal_Shdr *));
 static bfd_boolean elfNN_ia64_fake_sections
   PARAMS ((bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec));
 static void elfNN_ia64_final_write_processing
   PARAMS ((bfd *abfd, bfd_boolean linker));
 static bfd_boolean elfNN_ia64_add_symbol_hook
-  PARAMS ((bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *sym,
+  PARAMS ((bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *sym,
 	   const char **namep, flagword *flagsp, asection **secp,
 	   bfd_vma *valp));
 static int elfNN_ia64_additional_program_headers
@@ -749,11 +749,6 @@
 	  && sec->need_finalize_relax == 0))
     return TRUE;
 
-  /* If this is the first time we have been called for this section,
-     initialize the cooked size.  */
-  if (sec->_cooked_size == 0)
-    sec->_cooked_size = sec->_raw_size;
-
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
   /* Load the relocations for this section.  */
@@ -771,12 +766,7 @@
     contents = elf_section_data (sec)->this_hdr.contents;
   else
     {
-      contents = (bfd_byte *) bfd_malloc (sec->_raw_size);
-      if (contents == NULL)
-	goto error_return;
-
-      if (! bfd_get_section_contents (abfd, sec, contents,
-				      (file_ptr) 0, sec->_raw_size))
+      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 	goto error_return;
     }
 
@@ -789,6 +779,7 @@
       bfd_size_type amt;
       bfd_boolean is_branch;
       struct elfNN_ia64_dyn_sym_info *dyn_i;
+      char symtype;
 
       switch (r_type)
 	{
@@ -864,6 +855,7 @@
 
 	  toff = isym->st_value;
 	  dyn_i = get_dyn_sym_info (ia64_info, NULL, abfd, irel, FALSE);
+	  symtype = ELF_ST_TYPE (isym->st_info);
 	}
       else
 	{
@@ -908,13 +900,38 @@
 	      tsec = h->root.u.def.section;
 	      toff = h->root.u.def.value;
 	    }
+
+	  symtype = h->type;
 	}
 
       if (tsec->sec_info_type == ELF_INFO_TYPE_MERGE)
-	toff = _bfd_merged_section_offset (abfd, &tsec,
-					   elf_section_data (tsec)->sec_info,
-					   toff + irel->r_addend,
-					   (bfd_vma) 0);
+	{
+	  /* At this stage in linking, no SEC_MERGE symbol has been
+	     adjusted, so all references to such symbols need to be
+	     passed through _bfd_merged_section_offset.  (Later, in
+	     relocate_section, all SEC_MERGE symbols *except* for
+	     section symbols have been adjusted.)
+
+	     gas may reduce relocations against symbols in SEC_MERGE
+	     sections to a relocation against the section symbol when
+	     the original addend was zero.  When the reloc is against
+	     a section symbol we should include the addend in the
+	     offset passed to _bfd_merged_section_offset, since the
+	     location of interest is the original symbol.  On the
+	     other hand, an access to "sym+addend" where "sym" is not
+	     a section symbol should not include the addend;  Such an
+	     access is presumed to be an offset from "sym";  The
+	     location of interest is just "sym".  */
+	   if (symtype == STT_SECTION)
+	     toff += irel->r_addend;
+	   
+	   toff = _bfd_merged_section_offset (abfd, &tsec,
+					      elf_section_data (tsec)->sec_info,
+					      toff);
+
+	   if (symtype != STT_SECTION)
+	     toff += irel->r_addend;
+	}
       else
 	toff += irel->r_addend;
 
@@ -954,6 +971,19 @@
 	  else if (r_type == R_IA64_PCREL60B)
 	    continue;
 
+	  /* We can't put a trampoline in a .init/.fini section. Issue
+	     an error.  */
+	  if (strcmp (sec->output_section->name, ".init") == 0
+	      || strcmp (sec->output_section->name, ".fini") == 0)
+	    {
+	      (*_bfd_error_handler)
+		(_("%s: Can't relax br at 0x%lx in section `%s'. Please use brl or indirect branch."),
+		 bfd_archive_filename (sec->owner),
+		 (unsigned long) roff, sec->name);
+	      bfd_set_error (bfd_error_bad_value);
+	      goto error_return;
+	    }
+
 	  /* If the branch and target are in the same section, you've
 	     got one honking big section and we can't help you.  You'll
 	     get an error message later.  */
@@ -979,7 +1009,7 @@
 		size = oor_branch_size;
 
 	      /* Resize the current section to make room for the new branch. */
-	      trampoff = (sec->_cooked_size + 15) & (bfd_vma) -16;
+	      trampoff = (sec->size + 15) & (bfd_vma) -16;
 
 	      /* If trampoline is out of range, there is nothing we
 		 can do.  */
@@ -991,7 +1021,7 @@
 	      contents = (bfd_byte *) bfd_realloc (contents, amt);
 	      if (contents == NULL)
 		goto error_return;
-	      sec->_cooked_size = amt;
+	      sec->size = amt;
 
 	      if (tsec == ia64_info->plt_sec)
 		{
@@ -1147,8 +1177,7 @@
       elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_data_got, &data);
       elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_fptr_got, &data);
       elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_local_got, &data);
-      ia64_info->got_sec->_raw_size = data.ofs;
-      ia64_info->got_sec->_cooked_size = data.ofs;
+      ia64_info->got_sec->size = data.ofs;
 
       /* ??? Resize .rela.got too.  */
     }
@@ -1271,7 +1300,7 @@
 static bfd_boolean
 elfNN_ia64_section_flags (flags, hdr)
      flagword *flags;
-     Elf_Internal_Shdr *hdr;
+     const Elf_Internal_Shdr *hdr;
 {
   if (hdr->sh_flags & SHF_IA_64_SHORT)
     *flags |= SEC_SMALL_DATA;
@@ -1430,7 +1459,7 @@
 elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
      bfd *abfd;
      struct bfd_link_info *info;
-     const Elf_Internal_Sym *sym;
+     Elf_Internal_Sym *sym;
      const char **namep ATTRIBUTE_UNUSED;
      flagword *flagsp ATTRIBUTE_UNUSED;
      asection **secp;
@@ -2219,7 +2248,7 @@
   const Elf_Internal_Rela *relend;
   Elf_Internal_Shdr *symtab_hdr;
   const Elf_Internal_Rela *rel;
-  asection *got, *fptr, *srel;
+  asection *got, *fptr, *srel, *pltoff;
 
   if (info->relocatable)
     return TRUE;
@@ -2227,7 +2256,7 @@
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   ia64_info = elfNN_ia64_hash_table (info);
 
-  got = fptr = srel = NULL;
+  got = fptr = srel = pltoff = NULL;
 
   relend = relocs + sec->reloc_count;
   for (rel = relocs; rel < relend; ++rel)
@@ -2459,7 +2488,7 @@
 	     dynamic symbol table.  */
 	  if (!h && info->shared)
 	    {
-	      if (! (_bfd_elfNN_link_record_local_dynamic_symbol
+	      if (! (bfd_elf_link_record_local_dynamic_symbol
 		     (info, abfd, (long) r_symndx)))
 		return FALSE;
 	    }
@@ -2478,7 +2507,18 @@
       if (need_entry & NEED_FULL_PLT)
 	dyn_i->want_plt2 = 1;
       if (need_entry & NEED_PLTOFF)
-	dyn_i->want_pltoff = 1;
+	{
+	  /* This is needed here, in case @pltoff is used in a non-shared
+	     link.  */
+	  if (!pltoff)
+	    {
+	      pltoff = get_pltoff (abfd, info, ia64_info);
+	      if (!pltoff)
+		return FALSE;
+	    }
+	  
+	  dyn_i->want_pltoff = 1;
+	}
       if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC))
 	{
 	  if (!srel)
@@ -2631,7 +2671,7 @@
 	      BFD_ASSERT ((h->root.type == bfd_link_hash_defined)
 			  || (h->root.type == bfd_link_hash_defweak));
 
-	      if (!_bfd_elfNN_link_record_local_dynamic_symbol
+	      if (!bfd_elf_link_record_local_dynamic_symbol
 		    (x->info, h->root.u.def.section->owner,
 		     global_sym_index (h)))
 		return FALSE;
@@ -2797,7 +2837,7 @@
 	}
       if (rent->reltext)
 	ia64_info->reltext = 1;
-      rent->srel->_raw_size += sizeof (ElfNN_External_Rela) * count;
+      rent->srel->size += sizeof (ElfNN_External_Rela) * count;
     }
 
   /* Take care of the GOT and PLT relocations.  */
@@ -2813,18 +2853,18 @@
 	  || !x->info->pie
 	  || dyn_i->h == NULL
 	  || dyn_i->h->root.type != bfd_link_hash_undefweak)
-	ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
+	ia64_info->rel_got_sec->size += sizeof (ElfNN_External_Rela);
     }
   if ((dynamic_symbol || shared) && dyn_i->want_tprel)
-    ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
+    ia64_info->rel_got_sec->size += sizeof (ElfNN_External_Rela);
   if (dynamic_symbol && dyn_i->want_dtpmod)
-    ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
+    ia64_info->rel_got_sec->size += sizeof (ElfNN_External_Rela);
   if (dynamic_symbol && dyn_i->want_dtprel)
-    ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
+    ia64_info->rel_got_sec->size += sizeof (ElfNN_External_Rela);
   if (ia64_info->rel_fptr_sec && dyn_i->want_fptr)
     {
       if (dyn_i->h == NULL || dyn_i->h->root.type != bfd_link_hash_undefweak)
-	ia64_info->rel_fptr_sec->_raw_size += sizeof (ElfNN_External_Rela);
+	ia64_info->rel_fptr_sec->size += sizeof (ElfNN_External_Rela);
     }
 
   if (!resolved_zero && dyn_i->want_pltoff)
@@ -2839,7 +2879,7 @@
       else if (shared)
 	t = 2 * sizeof (ElfNN_External_Rela);
 
-      ia64_info->rel_pltoff_sec->_raw_size += t;
+      ia64_info->rel_pltoff_sec->size += t;
     }
 
   return TRUE;
@@ -2899,7 +2939,7 @@
       sec = bfd_get_section_by_name (dynobj, ".interp");
       BFD_ASSERT (sec != NULL);
       sec->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER;
-      sec->_raw_size = strlen (ELF_DYNAMIC_INTERPRETER) + 1;
+      sec->size = strlen (ELF_DYNAMIC_INTERPRETER) + 1;
     }
 
   /* Allocate the GOT entries.  */
@@ -2910,7 +2950,7 @@
       elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_data_got, &data);
       elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_fptr_got, &data);
       elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_local_got, &data);
-      ia64_info->got_sec->_raw_size = data.ofs;
+      ia64_info->got_sec->size = data.ofs;
     }
 
   /* Allocate the FPTR entries.  */
@@ -2919,7 +2959,7 @@
     {
       data.ofs = 0;
       elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_fptr, &data);
-      ia64_info->fptr_sec->_raw_size = data.ofs;
+      ia64_info->fptr_sec->size = data.ofs;
     }
 
   /* Now that we've seen all of the input files, we can decide which
@@ -2941,16 +2981,20 @@
   data.ofs = (data.ofs + 31) & (bfd_vma) -32;
 
   elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_plt2_entries, &data);
-  if (data.ofs != 0)
+  if (data.ofs != 0 || ia64_info->root.dynamic_sections_created)
     {
+      /* FIXME: we always reserve the memory for dynamic linker even if
+	 there are no PLT entries since dynamic linker may assume the
+	 reserved memory always exists.  */
+
       BFD_ASSERT (ia64_info->root.dynamic_sections_created);
 
-      ia64_info->plt_sec->_raw_size = data.ofs;
+      ia64_info->plt_sec->size = data.ofs;
 
       /* If we've got a .plt, we need some extra memory for the dynamic
 	 linker.  We stuff these in .got.plt.  */
       sec = bfd_get_section_by_name (dynobj, ".got.plt");
-      sec->_raw_size = 8 * PLT_RESERVED_WORDS;
+      sec->size = 8 * PLT_RESERVED_WORDS;
     }
 
   /* Allocate the PLTOFF entries.  */
@@ -2959,7 +3003,7 @@
     {
       data.ofs = 0;
       elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_pltoff_entries, &data);
-      ia64_info->pltoff_sec->_raw_size = data.ofs;
+      ia64_info->pltoff_sec->size = data.ofs;
     }
 
   if (ia64_info->root.dynamic_sections_created)
@@ -2968,7 +3012,7 @@
 	 required.  */
 
       if (info->shared && ia64_info->self_dtpmod_offset != (bfd_vma) -1)
-	ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela);
+	ia64_info->rel_got_sec->size += sizeof (ElfNN_External_Rela);
       elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_dynrel_entries, &data);
     }
 
@@ -2989,7 +3033,7 @@
 	 function which decides whether anything needs to go into
 	 these sections.  */
 
-      strip = (sec->_raw_size == 0);
+      strip = (sec->size == 0);
 
       if (sec == ia64_info->got_sec)
 	strip = FALSE;
@@ -3066,8 +3110,8 @@
       else
 	{
 	  /* Allocate memory for the section contents.  */
-	  sec->contents = (bfd_byte *) bfd_zalloc (dynobj, sec->_raw_size);
-	  if (sec->contents == NULL && sec->_raw_size != 0)
+	  sec->contents = (bfd_byte *) bfd_zalloc (dynobj, sec->size);
+	  if (sec->contents == NULL && sec->size != 0)
 	    return FALSE;
 	}
     }
@@ -3083,7 +3127,7 @@
 	  /* The DT_DEBUG entry is filled in by the dynamic linker and used
 	     by the debugger.  */
 #define add_dynamic_entry(TAG, VAL) \
-  bfd_elfNN_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL))
+  _bfd_elf_add_dynamic_entry (info, TAG, VAL)
 
 	  if (!add_dynamic_entry (DT_DEBUG, 0))
 	    return FALSE;
@@ -3378,8 +3422,7 @@
   loc = srel->contents;
   loc += srel->reloc_count++ * sizeof (ElfNN_External_Rela);
   bfd_elfNN_swap_reloca_out (abfd, &outrel, loc);
-  BFD_ASSERT (sizeof (ElfNN_External_Rela) * srel->reloc_count
-	      <= srel->_cooked_size);
+  BFD_ASSERT (sizeof (ElfNN_External_Rela) * srel->reloc_count <= srel->size);
 }
 
 /* Store an entry for target address TARGET_ADDR in the linkage table
@@ -3695,7 +3738,7 @@
 	continue;
 
       lo = os->vma;
-      hi = os->vma + os->_raw_size;
+      hi = os->vma + os->size;
       if (hi < lo)
 	hi = (bfd_vma) -1;
 
@@ -3831,27 +3874,27 @@
 	{
 	  unwind_output_sec = s->output_section;
 	  unwind_output_sec->contents
-	    = bfd_malloc (unwind_output_sec->_raw_size);
+	    = bfd_malloc (unwind_output_sec->size);
 	  if (unwind_output_sec->contents == NULL)
 	    return FALSE;
 	}
     }
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (!bfd_elfNN_bfd_final_link (abfd, info))
+  if (!bfd_elf_final_link (abfd, info))
     return FALSE;
 
   if (unwind_output_sec)
     {
       elfNN_ia64_unwind_entry_compare_bfd = abfd;
       qsort (unwind_output_sec->contents,
-	     (size_t) (unwind_output_sec->_raw_size / 24),
+	     (size_t) (unwind_output_sec->size / 24),
 	     24,
 	     elfNN_ia64_unwind_entry_compare);
 
       if (! bfd_set_section_contents (abfd, unwind_output_sec,
 				      unwind_output_sec->contents, (bfd_vma) 0,
-				      unwind_output_sec->_raw_size))
+				      unwind_output_sec->size))
 	return FALSE;
     }
 
@@ -3959,8 +4002,7 @@
 						    elf_section_data (msec)->
 						    sec_info,
 						    sym->st_value
-						    + dynent->addend,
-						    (bfd_vma) 0);
+						    + dynent->addend);
 		      dynent->addend -= sym->st_value;
 		      dynent->addend += msec->output_section->vma
 					+ msec->output_offset
@@ -4596,7 +4638,7 @@
 	  /* Mark the symbol as undefined, rather than as defined in the
 	     plt section.  Leave the value alone.  */
 	  /* ??? We didn't redefine it in adjust_dynamic_symbol in the
-	     first place.  But perhaps elflink.h did some for us.  */
+	     first place.  But perhaps elflink.c did some for us.  */
 	  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
 	    sym->st_shndx = SHN_UNDEF;
 	}
@@ -4657,7 +4699,7 @@
       sgotplt = bfd_get_section_by_name (dynobj, ".got.plt");
       BFD_ASSERT (sdyn != NULL);
       dyncon = (ElfNN_External_Dyn *) sdyn->contents;
-      dynconend = (ElfNN_External_Dyn *) (sdyn->contents + sdyn->_raw_size);
+      dynconend = (ElfNN_External_Dyn *) (sdyn->contents + sdyn->size);
 
       gp_val = _bfd_get_gp_value (abfd);
 
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 76b3732..a18ac84 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -400,8 +400,6 @@
   (bfd *, bfd_boolean);
 static struct mips_got_info *mips_elf_got_info
   (bfd *, asection **);
-static long mips_elf_get_global_gotsym_index
-  (bfd *abfd);
 static bfd_vma mips_elf_local_got_index
   (bfd *, bfd *, struct bfd_link_info *, bfd_vma);
 static bfd_vma mips_elf_global_got_index
@@ -530,8 +528,7 @@
   (NEWABI_P (abfd) ? ".MIPS.options" : ".options")
 
 /* The name of the stub section.  */
-#define MIPS_ELF_STUB_SECTION_NAME(abfd) \
-  (NEWABI_P (abfd) ? ".MIPS.stubs" : ".stub")
+#define MIPS_ELF_STUB_SECTION_NAME(abfd) ".MIPS.stubs"
 
 /* The size of an external REL relocation.  */
 #define MIPS_ELF_REL_SIZE(abfd) \
@@ -564,17 +561,8 @@
    : 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
+  _bfd_elf_add_dynamic_entry (info, tag, val)
 
 #define MIPS_ELF_RTYPE_TO_HOWTO(abfd, rtype, rela)			\
   (get_elf_backend_data (abfd)->elf_backend_mips_rtype_to_howto (rtype, rela))
@@ -599,6 +587,7 @@
 /* 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)
+#define MINUS_TWO	(((bfd_vma)0) - 2)
 
 /* The number of local .got entries we reserve.  */
 #define MIPS_RESERVED_GOTNO (2)
@@ -821,7 +810,6 @@
 #undef READ
 
   debug->fdr = NULL;
-  debug->adjust = NULL;
 
   return TRUE;
 
@@ -990,7 +978,7 @@
   H_PUT_S32 (abfd, -1, (erp + count)->p_adr);
 
   /* Set the size and contents of .rtproc section.  */
-  s->_raw_size = size;
+  s->size = size;
   s->contents = rtproc;
 
   /* Skip this section later on (I don't think this currently
@@ -1040,8 +1028,7 @@
       /* We don't need the fn_stub; the only references to this symbol
          are 16 bit calls.  Clobber the size to 0 to prevent it from
          being included in the link.  */
-      h->fn_stub->_raw_size = 0;
-      h->fn_stub->_cooked_size = 0;
+      h->fn_stub->size = 0;
       h->fn_stub->flags &= ~SEC_RELOC;
       h->fn_stub->reloc_count = 0;
       h->fn_stub->flags |= SEC_EXCLUDE;
@@ -1053,8 +1040,7 @@
       /* We don't need the call_stub; this is a 16 bit function, so
          calls from other 16 bit functions are OK.  Clobber the size
          to 0 to prevent it from being included in the link.  */
-      h->call_stub->_raw_size = 0;
-      h->call_stub->_cooked_size = 0;
+      h->call_stub->size = 0;
       h->call_stub->flags &= ~SEC_RELOC;
       h->call_stub->reloc_count = 0;
       h->call_stub->flags |= SEC_EXCLUDE;
@@ -1066,8 +1052,7 @@
       /* We don't need the call_stub; this is a 16 bit function, so
          calls from other 16 bit functions are OK.  Clobber the size
          to 0 to prevent it from being included in the link.  */
-      h->call_fp_stub->_raw_size = 0;
-      h->call_fp_stub->_cooked_size = 0;
+      h->call_fp_stub->size = 0;
       h->call_fp_stub->flags &= ~SEC_RELOC;
       h->call_fp_stub->reloc_count = 0;
       h->call_fp_stub->flags |= SEC_EXCLUDE;
@@ -1093,7 +1078,7 @@
   relocation += symbol->section->output_section->vma;
   relocation += symbol->section->output_offset;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Set val to the offset into the section or symbol.  */
@@ -1159,7 +1144,7 @@
 {
   struct mips_hi16 *n;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   n = bfd_malloc (sizeof *n);
@@ -1210,7 +1195,7 @@
 {
   bfd_vma vallo;
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   vallo = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);
@@ -1233,13 +1218,6 @@
 	 carry or borrow will induce a change of +1 or -1 in the high part.  */
       hi->rel.addend += (vallo + 0x8000) & 0xffff;
 
-      /* R_MIPS_GNU_REL_HI16 relocations are relative to the address of the
-	 lo16 relocation, not their own address.  If we're calculating the
-	 final value, and hence subtracting the "PC", subtract the offset
-	 of the lo16 relocation from here.  */
-      if (output_bfd == NULL && hi->rel.howto->type == R_MIPS_GNU_REL_HI16)
-	hi->rel.addend -= reloc_entry->address - hi->rel.address;
-
       ret = _bfd_mips_elf_generic_reloc (abfd, &hi->rel, symbol, hi->data,
 					 hi->input_section, output_bfd,
 					 error_message);
@@ -1271,7 +1249,7 @@
 
   relocatable = (output_bfd != NULL);
 
-  if (reloc_entry->address > input_section->_cooked_size)
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Build up the field adjustment in VAL.  */
@@ -1825,28 +1803,6 @@
   return g;
 }
 
-/* Obtain the lowest dynamic index of a symbol that was assigned a
-   global GOT entry.  */
-static long
-mips_elf_get_global_gotsym_index (bfd *abfd)
-{
-  asection *sgot;
-  struct mips_got_info *g;
-
-  if (abfd == NULL)
-    return 0;
-
-  sgot = mips_elf_got_section (abfd, TRUE);
-  if (sgot == NULL || mips_elf_section_data (sgot) == NULL)
-    return 0;
-
-  g = mips_elf_section_data (sgot)->u.got_info;
-  if (g == NULL || g->global_gotsym == NULL)
-    return 0;
-
-  return g->global_gotsym->dynindx;
-}
-
 /* 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.  */
@@ -1909,7 +1865,7 @@
   BFD_ASSERT (h->dynindx >= global_got_dynindx);
   index = ((h->dynindx - global_got_dynindx + g->local_gotno)
 	   * MIPS_ELF_GOT_SIZE (abfd));
-  BFD_ASSERT (index < sgot->_raw_size);
+  BFD_ASSERT (index < sgot->size);
 
   return index;
 }
@@ -2153,7 +2109,7 @@
 	  _bfd_mips_elf_hide_symbol (info, h, TRUE);
 	  break;
 	}
-      if (!bfd_elf32_link_record_dynamic_symbol (info, h))
+      if (!bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
     }
 
@@ -2748,7 +2704,7 @@
     }
   while (g);
 
-  got->_raw_size = (gg->next->local_gotno
+  got->size = (gg->next->local_gotno
 		    + gg->next->global_gotno) * MIPS_ELF_GOT_SIZE (abfd);
 
   return TRUE;
@@ -2763,12 +2719,6 @@
 			  const Elf_Internal_Rela *relocation,
 			  const Elf_Internal_Rela *relend)
 {
-  /* 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 (ELF_R_TYPE (abfd, relocation->r_info) == r_type)
@@ -2870,7 +2820,7 @@
   return ((value + (bfd_vma) 0x80008000) >> 32) & 0xffff;
 #else
   abort ();
-  return (bfd_vma) -1;
+  return MINUS_ONE;
 #endif
 }
 
@@ -2883,7 +2833,7 @@
   return ((value + (((bfd_vma) 0x8000 << 32) | 0x80008000)) >> 48) & 0xffff;
 #else
   abort ();
-  return (bfd_vma) -1;
+  return MINUS_ONE;
 #endif
 }
 
@@ -2908,7 +2858,7 @@
 					  MIPS_ELF_LOG_FILE_ALIGN (abfd)))
 	return FALSE;
 
-      s->_raw_size = sizeof (Elf32_External_compact_rel);
+      s->size = sizeof (Elf32_External_compact_rel);
     }
 
   return TRUE;
@@ -2965,7 +2915,7 @@
   h->type = STT_OBJECT;
 
   if (info->shared
-      && ! bfd_elf32_link_record_dynamic_symbol (info, h))
+      && ! bfd_elf_link_record_dynamic_symbol (info, h))
     return FALSE;
 
   amt = sizeof (struct mips_got_info);
@@ -3240,7 +3190,7 @@
       else
 	sec = h->call_fp_stub;
 
-      BFD_ASSERT (sec->_raw_size > 0);
+      BFD_ASSERT (sec->size > 0);
       symbol = sec->output_section->vma + sec->output_offset;
     }
 
@@ -3384,8 +3334,6 @@
       break;
 
     case R_MIPS_PC32:
-    case R_MIPS_PC64:
-    case R_MIPS_GNU_REL_LO16:
       value = symbol + addend - p;
       value &= howto->dst_mask;
       break;
@@ -3396,16 +3344,6 @@
       value = (value >> 2) & howto->dst_mask;
       break;
 
-    case R_MIPS_GNU_REL_HI16:
-      /* Instead of subtracting 'p' here, we should be subtracting the
-	 equivalent value for the LO part of the reloc, since the value
-	 here is relative to that address.  Because that's not easy to do,
-	 we adjust 'addend' in _bfd_mips_elf_relocate_section().  See also
-	 the comment there for more information.  */
-      value = mips_elf_high (addend + symbol - p);
-      value &= howto->dst_mask;
-      break;
-
     case R_MIPS16_26:
       /* The calculation for R_MIPS16_26 is just the same as for an
 	 R_MIPS_26.  It's only the storage of the relocated field into
@@ -3826,13 +3764,13 @@
   s = mips_elf_rel_dyn_section (abfd, FALSE);
   BFD_ASSERT (s != NULL);
 
-  if (s->_raw_size == 0)
+  if (s->size == 0)
     {
       /* Make room for a null element.  */
-      s->_raw_size += MIPS_ELF_REL_SIZE (abfd);
+      s->size += MIPS_ELF_REL_SIZE (abfd);
       ++s->reloc_count;
     }
-  s->_raw_size += n * MIPS_ELF_REL_SIZE (abfd);
+  s->size += n * MIPS_ELF_REL_SIZE (abfd);
 }
 
 /* Create a rel.dyn relocation for the dynamic linker to resolve.  REL
@@ -3860,7 +3798,7 @@
   BFD_ASSERT (sreloc != NULL);
   BFD_ASSERT (sreloc->contents != NULL);
   BFD_ASSERT (sreloc->reloc_count * MIPS_ELF_REL_SIZE (output_bfd)
-	      < sreloc->_raw_size);
+	      < sreloc->size);
 
   skip = FALSE;
   outrel[0].r_offset =
@@ -3889,15 +3827,15 @@
       outrel[2].r_offset = outrel[0].r_offset;
       /* If we didn't need the relocation at all, this value will be
 	 -1.  */
-      if (outrel[0].r_offset == (bfd_vma) -1)
+      if (outrel[0].r_offset == MINUS_ONE)
 	skip = TRUE;
     }
 #endif
 
-  if (outrel[0].r_offset == (bfd_vma) -1)
+  if (outrel[0].r_offset == MINUS_ONE)
     /* The relocation field has been deleted.  */
     skip = TRUE;
-  else if (outrel[0].r_offset == (bfd_vma) -2)
+  else if (outrel[0].r_offset == MINUS_TWO)
     {
       /* The relocation field has been converted into a relative value of
 	 some sort.  Functions like _bfd_elf_write_section_eh_frame expect
@@ -4590,7 +4528,7 @@
   if (strcmp (name, ".liblist") == 0)
     {
       hdr->sh_type = SHT_MIPS_LIBLIST;
-      hdr->sh_info = sec->_raw_size / sizeof (Elf32_Lib);
+      hdr->sh_info = sec->size / sizeof (Elf32_Lib);
       /* The sh_link field is set in final_write_processing.  */
     }
   else if (strcmp (name, ".conflict") == 0)
@@ -4724,7 +4662,7 @@
 
 bfd_boolean
 _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
-			       const Elf_Internal_Sym *sym, const char **namep,
+			       Elf_Internal_Sym *sym, const char **namep,
 			       flagword *flagsp ATTRIBUTE_UNUSED,
 			       asection **secp, bfd_vma *valp)
 {
@@ -4857,7 +4795,7 @@
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
-      if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
 
       mips_elf_hash_table (info)->use_rld_obj_head = TRUE;
@@ -4969,7 +4907,7 @@
 	  h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
 	  h->type = STT_SECTION;
 
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
 
@@ -5014,7 +4952,7 @@
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_SECTION;
 
-      if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+      if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	return FALSE;
 
       if (! mips_elf_hash_table (info)->use_rld_obj_head)
@@ -5038,7 +4976,7 @@
 	  h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
 	  h->type = STT_OBJECT;
 
-	  if (! bfd_elf32_link_record_dynamic_symbol (info, h))
+	  if (! bfd_elf_link_record_dynamic_symbol (info, h))
 	    return FALSE;
 	}
     }
@@ -5357,7 +5295,7 @@
 
 	      /* We need a stub, not a plt entry for the undefined
 		 function.  But we record it as if it needs plt.  See
-		 elf_adjust_dynamic_symbol in elflink.h.  */
+		 _bfd_elf_adjust_dynamic_symbol.  */
 	      h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
 	      h->type = STT_FUNC;
 	    }
@@ -5469,14 +5407,14 @@
 	  /* This relocation describes the C++ object vtable hierarchy.
 	     Reconstruct it for later use during GC.  */
 	case R_MIPS_GNU_VTINHERIT:
-	  if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_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_MIPS_GNU_VTENTRY:
-	  if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset))
+	  if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset))
 	    return FALSE;
 	  break;
 
@@ -5535,7 +5473,6 @@
   Elf_Internal_Rela *irel, *irelend;
   Elf_Internal_Shdr *symtab_hdr;
   bfd_byte *contents = NULL;
-  bfd_byte *free_contents = NULL;
   size_t extsymoff;
   bfd_boolean changed_contents = FALSE;
   bfd_vma sec_start = sec->output_section->vma + sec->output_offset;
@@ -5656,13 +5593,7 @@
 	    contents = elf_section_data (sec)->this_hdr.contents;
 	  else
 	    {
-	      contents = bfd_malloc (sec->_raw_size);
-	      if (contents == NULL)
-		goto relax_return;
-
-	      free_contents = contents;
-	      if (! bfd_get_section_contents (abfd, sec, contents,
-					      0, sec->_raw_size))
+	      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
 		goto relax_return;
 	    }
 	}
@@ -5697,8 +5628,9 @@
   return TRUE;
 
  relax_return:
-  if (free_contents != NULL)
-    free (free_contents);
+  if (contents != NULL
+      && elf_section_data (sec)->this_hdr.contents != contents)
+    free (contents);
   return FALSE;
 }
 
@@ -5766,13 +5698,13 @@
 	  BFD_ASSERT (s != NULL);
 
 	  h->root.u.def.section = s;
-	  h->root.u.def.value = s->_raw_size;
+	  h->root.u.def.value = s->size;
 
 	  /* XXX Write this stub address somewhere.  */
-	  h->plt.offset = s->_raw_size;
+	  h->plt.offset = s->size;
 
 	  /* Make room for this stub code.  */
-	  s->_raw_size += MIPS_FUNCTION_STUB_SIZE;
+	  s->size += MIPS_FUNCTION_STUB_SIZE;
 
 	  /* The last half word of the stub will be filled with the index
 	     of this symbol in .dynsym section.  */
@@ -5856,7 +5788,7 @@
 	{
 	  if ((subsection->flags & SEC_ALLOC) == 0)
 	    continue;
-	  loadable_size += ((subsection->_raw_size + 0xf)
+	  loadable_size += ((subsection->size + 0xf)
 			    &~ (bfd_size_type) 0xf);
 	}
     }
@@ -5886,12 +5818,12 @@
   local_gotno = (loadable_size >> 16) + 5;
 
   g->local_gotno += local_gotno;
-  s->_raw_size += g->local_gotno * MIPS_ELF_GOT_SIZE (output_bfd);
+  s->size += g->local_gotno * MIPS_ELF_GOT_SIZE (output_bfd);
 
   g->global_gotno = i;
-  s->_raw_size += i * MIPS_ELF_GOT_SIZE (output_bfd);
+  s->size += i * MIPS_ELF_GOT_SIZE (output_bfd);
 
-  if (s->_raw_size > MIPS_ELF_GOT_MAX_SIZE (output_bfd)
+  if (s->size > MIPS_ELF_GOT_MAX_SIZE (output_bfd)
       && ! mips_elf_multi_got (output_bfd, info, g, s, local_gotno))
     return FALSE;
 
@@ -5918,7 +5850,7 @@
 	{
 	  s = bfd_get_section_by_name (dynobj, ".interp");
 	  BFD_ASSERT (s != NULL);
-	  s->_raw_size
+	  s->size
 	    = strlen (ELF_DYNAMIC_INTERPRETER (output_bfd)) + 1;
 	  s->contents
 	    = (bfd_byte *) ELF_DYNAMIC_INTERPRETER (output_bfd);
@@ -5945,7 +5877,7 @@
 
       if (strncmp (name, ".rel", 4) == 0)
 	{
-	  if (s->_raw_size == 0)
+	  if (s->size == 0)
 	    {
 	      /* We only strip the section if the output section name
                  has the same name.  Otherwise, there might be several
@@ -6045,7 +5977,7 @@
 	{
 	  /* IRIX rld assumes that the function stub isn't at the end
 	     of .text section. So put a dummy. XXX  */
-	  s->_raw_size += MIPS_FUNCTION_STUB_SIZE;
+	  s->size += MIPS_FUNCTION_STUB_SIZE;
 	}
       else if (! info->shared
 	       && ! mips_elf_hash_table (info)->use_rld_obj_head
@@ -6053,11 +5985,11 @@
 	{
 	  /* We add a room for __rld_map. It will be filled in by the
 	     rtld to contain a pointer to the _r_debug structure.  */
-	  s->_raw_size += 4;
+	  s->size += 4;
 	}
       else if (SGI_COMPAT (output_bfd)
 	       && strncmp (name, ".compact_rel", 12) == 0)
-	s->_raw_size += mips_elf_hash_table (info)->compact_rel_size;
+	s->size += mips_elf_hash_table (info)->compact_rel_size;
       else if (strncmp (name, ".init", 5) != 0)
 	{
 	  /* It's not one of our sections, so don't allocate space.  */
@@ -6071,8 +6003,8 @@
 	}
 
       /* Allocate memory for the section contents.  */
-      s->contents = bfd_zalloc (dynobj, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->contents = bfd_zalloc (dynobj, s->size);
+      if (s->contents == NULL && s->size != 0)
 	{
 	  bfd_set_error (bfd_error_no_memory);
 	  return FALSE;
@@ -6264,7 +6196,6 @@
 		 combination of the addend stored in two different
 		 relocations.   */
 	      if (r_type == R_MIPS_HI16
-		  || r_type == R_MIPS_GNU_REL_HI16
 		  || (r_type == R_MIPS_GOT16
 		      && mips_elf_local_relocation_p (input_bfd, rel,
 						      local_sections, FALSE)))
@@ -6272,7 +6203,6 @@
 		  bfd_vma l;
 		  const Elf_Internal_Rela *lo16_relocation;
 		  reloc_howto_type *lo16_howto;
-		  unsigned int lo;
 
 		  /* The combined value is the sum of the HI16 addend,
 		     left-shifted by sixteen bits, and the LO16
@@ -6280,18 +6210,25 @@
 		     a `lui' of the HI16 value, and then an `addiu' of
 		     the LO16 value.)
 
-		     Scan ahead to find a matching LO16 relocation.  */
-		  if (r_type == R_MIPS_GNU_REL_HI16)
-		    lo = R_MIPS_GNU_REL_LO16;
-		  else
-		    lo = R_MIPS_LO16;
-		  lo16_relocation = mips_elf_next_relocation (input_bfd, lo,
+		     Scan ahead to find a matching LO16 relocation.
+
+		     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.  */
+		  lo16_relocation = mips_elf_next_relocation (input_bfd,
+							      R_MIPS_LO16,
 							      rel, relend);
 		  if (lo16_relocation == NULL)
 		    return FALSE;
 
 		  /* Obtain the addend kept there.  */
-		  lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd, lo, FALSE);
+		  lo16_howto = MIPS_ELF_RTYPE_TO_HOWTO (input_bfd,
+							R_MIPS_LO16, FALSE);
 		  l = mips_elf_obtain_contents (lo16_howto, lo16_relocation,
 						input_bfd, contents);
 		  l &= lo16_howto->src_mask;
@@ -6302,16 +6239,6 @@
 
 		  /* Compute the combined addend.  */
 		  addend += l;
-
-		  /* If PC-relative, subtract the difference between the
-		     address of the LO part of the reloc and the address of
-		     the HI part.  The relocation is relative to the LO
-		     part, but mips_elf_calculate_relocation() doesn't
-		     know its address or the difference from the HI part, so
-		     we subtract that difference here.  See also the
-		     comment in mips_elf_calculate_relocation().  */
-		  if (r_type == R_MIPS_GNU_REL_HI16)
-		    addend -= (lo16_relocation->r_offset - rel->r_offset);
 		}
 	      else if (r_type == R_MIPS16_GPREL)
 		{
@@ -6369,8 +6296,7 @@
 	  else
 	    {
 	      if (r_type == R_MIPS_HI16
-		  || r_type == R_MIPS_GOT16
-		  || r_type == R_MIPS_GNU_REL_HI16)
+		  || r_type == R_MIPS_GOT16)
 		addend = mips_elf_high (addend);
 	      else if (r_type == R_MIPS_HIGHER)
 		addend = mips_elf_higher (addend);
@@ -6616,15 +6542,13 @@
 				     Elf_Internal_Sym *sym)
 {
   bfd *dynobj;
-  bfd_vma gval;
   asection *sgot;
   struct mips_got_info *g, *gg;
   const char *name;
 
   dynobj = elf_hash_table (info)->dynobj;
-  gval = sym->st_value;
 
-  if (h->plt.offset != (bfd_vma) -1)
+  if (h->plt.offset != MINUS_ONE)
     {
       asection *s;
       bfd_byte stub[MIPS_FUNCTION_STUB_SIZE];
@@ -6647,7 +6571,7 @@
       bfd_put_32 (output_bfd, STUB_JALR, stub + 8);
       bfd_put_32 (output_bfd, STUB_LI16 (output_bfd) + h->dynindx, stub + 12);
 
-      BFD_ASSERT (h->plt.offset <= s->_raw_size);
+      BFD_ASSERT (h->plt.offset <= s->size);
       memcpy (s->contents + h->plt.offset, stub, MIPS_FUNCTION_STUB_SIZE);
 
       /* Mark the symbol as undefined.  plt.offset != -1 occurs
@@ -6657,8 +6581,8 @@
       /* The run-time linker uses the st_value field of the symbol
 	 to reset the global offset table entry for this external
 	 to its stub address when unlinking a shared object.  */
-      gval = s->output_section->vma + s->output_offset + h->plt.offset;
-      sym->st_value = gval;
+      sym->st_value = (s->output_section->vma + s->output_offset
+		       + h->plt.offset);
     }
 
   BFD_ASSERT (h->dynindx != -1
@@ -6852,7 +6776,7 @@
       BFD_ASSERT (g != NULL);
 
       for (b = sdyn->contents;
-	   b < sdyn->contents + sdyn->_raw_size;
+	   b < sdyn->contents + sdyn->size;
 	   b += MIPS_ELF_DYN_SIZE (dynobj))
 	{
 	  Elf_Internal_Dyn dyn;
@@ -6943,10 +6867,7 @@
 	      s = bfd_get_section_by_name (output_bfd, name);
 	      BFD_ASSERT (s != NULL);
 
-	      if (s->_cooked_size != 0)
-		dyn.d_un.d_val = s->_cooked_size / elemsize;
-	      else
-		dyn.d_un.d_val = s->_raw_size / elemsize;
+	      dyn.d_un.d_val = s->size / elemsize;
 	      break;
 
 	    case DT_MIPS_HIPAGENO:
@@ -6989,7 +6910,7 @@
   /* The first entry of the global offset table will be filled at
      runtime. The second entry will be used by some runtime loaders.
      This isn't the case of IRIX rld.  */
-  if (sgot != NULL && sgot->_raw_size > 0)
+  if (sgot != NULL && sgot->size > 0)
     {
       MIPS_ELF_PUT_WORD (output_bfd, 0, sgot->contents);
       MIPS_ELF_PUT_WORD (output_bfd, 0x80000000,
@@ -7063,8 +6984,8 @@
 	      {
 		file_ptr dummy_offset;
 
-		BFD_ASSERT (s->_raw_size >= MIPS_FUNCTION_STUB_SIZE);
-		dummy_offset = s->_raw_size - MIPS_FUNCTION_STUB_SIZE;
+		BFD_ASSERT (s->size >= MIPS_FUNCTION_STUB_SIZE);
+		dummy_offset = s->size - MIPS_FUNCTION_STUB_SIZE;
 		memset (s->contents + dummy_offset, 0,
 			MIPS_FUNCTION_STUB_SIZE);
 	      }
@@ -7076,7 +6997,7 @@
     s = mips_elf_rel_dyn_section (dynobj, FALSE);
 
     if (s != NULL
-	&& s->_raw_size > (bfd_vma)2 * MIPS_ELF_REL_SIZE (output_bfd))
+	&& s->size > (bfd_vma)2 * MIPS_ELF_REL_SIZE (output_bfd))
       {
 	reldyn_sorting_bfd = output_bfd;
 
@@ -7471,9 +7392,7 @@
 
 		  if (low > s->vma)
 		    low = s->vma;
-		  sz = s->_cooked_size;
-		  if (sz == 0)
-		    sz = s->_raw_size;
+		  sz = s->size;
 		  if (high < s->vma + sz)
 		    high = s->vma + sz;
 		}
@@ -7483,9 +7402,7 @@
 	  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))
+		&& s->vma + s->size <= high)
 	      ++c;
 
 	  amt = sizeof *n + (bfd_size_type) (c - 1) * sizeof (asection *);
@@ -7500,9 +7417,7 @@
 	    {
 	      if ((s->flags & SEC_LOAD) != 0
 		  && s->vma >= low
-		  && ((s->vma
-		       + (s->_cooked_size != 0 ?
-			  s->_cooked_size : s->_raw_size)) <= high))
+		  && s->vma + s->size <= high)
 		{
 		  n->sections[i] = s;
 		  ++i;
@@ -7715,15 +7630,15 @@
   o = bfd_get_section_by_name (abfd, ".pdr");
   if (! o)
     return FALSE;
-  if (o->_raw_size == 0)
+  if (o->size == 0)
     return FALSE;
-  if (o->_raw_size % PDR_SIZE != 0)
+  if (o->size % PDR_SIZE != 0)
     return FALSE;
   if (o->output_section != NULL
       && bfd_is_abs_section (o->output_section))
     return FALSE;
 
-  tdata = bfd_zmalloc (o->_raw_size / PDR_SIZE);
+  tdata = bfd_zmalloc (o->size / PDR_SIZE);
   if (! tdata)
     return FALSE;
 
@@ -7738,9 +7653,9 @@
   cookie->rel = cookie->rels;
   cookie->relend = cookie->rels + o->reloc_count;
 
-  for (i = 0, skip = 0; i < o->_raw_size / PDR_SIZE; i ++)
+  for (i = 0, skip = 0; i < o->size / PDR_SIZE; i ++)
     {
-      if (MNAME(abfd,_bfd_elf,reloc_symbol_deleted_p) (i * PDR_SIZE, cookie))
+      if (bfd_elf_reloc_symbol_deleted_p (i * PDR_SIZE, cookie))
 	{
 	  tdata[i] = 1;
 	  skip ++;
@@ -7750,7 +7665,7 @@
   if (skip != 0)
     {
       mips_elf_section_data (o)->u.tdata = tdata;
-      o->_cooked_size = o->_raw_size - skip * PDR_SIZE;
+      o->size -= skip * PDR_SIZE;
       ret = TRUE;
     }
   else
@@ -7784,7 +7699,7 @@
     return FALSE;
 
   to = contents;
-  end = contents + sec->_raw_size;
+  end = contents + sec->size;
   for (from = contents, i = 0;
        from < end;
        from += PDR_SIZE, i++)
@@ -7796,7 +7711,7 @@
       to += PDR_SIZE;
     }
   bfd_set_section_contents (output_bfd, sec->output_section, contents,
-			    sec->output_offset, sec->_cooked_size);
+			    sec->output_offset, sec->size);
   return TRUE;
 }
 
@@ -7933,13 +7848,7 @@
       c = mips_elf_section_data (section)->u.tdata;
       if (c == NULL)
 	{
-	  bfd_size_type size;
-
-	  if (section->_cooked_size != 0)
-	    size = section->_cooked_size;
-	  else
-	    size = section->_raw_size;
-	  c = bfd_zalloc (abfd, size);
+	  c = bfd_zalloc (abfd, section->size);
 	  if (c == NULL)
 	    return FALSE;
 	  mips_elf_section_data (section)->u.tdata = c;
@@ -7967,6 +7876,7 @@
   /* Get enough memory to hold the stuff */
   bfd *input_bfd = link_order->u.indirect.section->owner;
   asection *input_section = link_order->u.indirect.section;
+  bfd_size_type sz;
 
   long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
   arelent **reloc_vector = NULL;
@@ -7980,14 +7890,10 @@
     goto error_return;
 
   /* read in the section */
-  if (!bfd_get_section_contents (input_bfd, input_section, data, 0,
-				 input_section->_raw_size))
+  sz = input_section->rawsize ? input_section->rawsize : input_section->size;
+  if (!bfd_get_section_contents (input_bfd, input_section, data, 0, sz))
     goto error_return;
 
-  /* We're not relaxing the section, so just copy the size info */
-  input_section->_cooked_size = input_section->_raw_size;
-  input_section->reloc_done = TRUE;
-
   reloc_count = bfd_canonicalize_reloc (input_bfd,
 					input_section,
 					reloc_vector,
@@ -8176,8 +8082,8 @@
   asection *rtproc_sec;
   Elf32_RegInfo reginfo;
   struct ecoff_debug_info debug;
-  const struct ecoff_debug_swap *swap
-    = get_elf_backend_data (abfd)->elf_backend_ecoff_debug_swap;
+  const struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  const struct ecoff_debug_swap *swap = bed->elf_backend_ecoff_debug_swap;
   HDRR *symhdr = &debug.symbolic_header;
   void *mdebug_handle = NULL;
   asection *s;
@@ -8205,6 +8111,7 @@
       bfd *dynobj;
       asection *got;
       struct mips_got_info *g;
+      bfd_size_type dynsecsymcount;
 
       /* 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
@@ -8212,9 +8119,20 @@
 	 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)))
+
+      dynsecsymcount = 0;
+      if (info->shared)
+	{
+	  asection * p;
+
+	  for (p = abfd->sections; p ; p = p->next)
+	    if ((p->flags & SEC_EXCLUDE) == 0
+		&& (p->flags & SEC_ALLOC) != 0
+		&& !(*bed->elf_backend_omit_section_dynsym) (abfd, info, p))
+	      ++ dynsecsymcount;
+	}
+      
+      if (! mips_elf_sort_hash_table (info, dynsecsymcount + 1))
 	return FALSE;
 
       /* Make sure we didn't grow the global .got region.  */
@@ -8332,11 +8250,6 @@
 	      input_section = p->u.indirect.section;
 	      input_bfd = input_section->owner;
 
-	      /* The linker emulation code has probably clobbered the
-                 size to be zero bytes.  */
-	      if (input_section->_raw_size == 0)
-		input_section->_raw_size = sizeof (Elf32_External_RegInfo);
-
 	      if (! bfd_get_section_contents (input_bfd, input_section,
 					      &ext, 0, sizeof ext))
 		return FALSE;
@@ -8359,7 +8272,7 @@
 	    }
 
 	  /* Size has been set in _bfd_mips_elf_always_size_sections.  */
-	  BFD_ASSERT(o->_raw_size == sizeof (Elf32_External_RegInfo));
+	  BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo));
 
 	  /* Skip this section later on (I don't think this currently
 	     matters, but someday it might).  */
@@ -8427,7 +8340,7 @@
 	      if (s != NULL)
 		{
 		  esym.asym.value = s->vma;
-		  last = s->vma + s->_raw_size;
+		  last = s->vma + s->size;
 		}
 	      else
 		esym.asym.value = last;
@@ -8468,7 +8381,7 @@
 	      input_swap = (get_elf_backend_data (input_bfd)
 			    ->elf_backend_ecoff_debug_swap);
 
-	      BFD_ASSERT (p->size == input_section->_raw_size);
+	      BFD_ASSERT (p->size == input_section->size);
 
 	      /* The ECOFF linking code expects that we have already
 		 read in the debugging information and set up an
@@ -8572,7 +8485,7 @@
 	    return FALSE;
 
 	  /* Set the size of the .mdebug section.  */
-	  o->_raw_size = bfd_ecoff_debug_size (abfd, &debug, swap);
+	  o->size = bfd_ecoff_debug_size (abfd, &debug, swap);
 
 	  /* Skip this section later on (I don't think this currently
 	     matters, but someday it might).  */
@@ -8690,7 +8603,7 @@
 	      /* Combine the gptab entries for this input section one
 		 by one.  We know that the input gptab entries are
 		 sorted by ascending -G value.  */
-	      size = bfd_section_size (input_bfd, input_section);
+	      size = input_section->size;
 	      last = 0;
 	      for (gpentry = sizeof (Elf32_External_gptab);
 		   gpentry < size;
@@ -8787,7 +8700,7 @@
 	    bfd_mips_elf32_swap_gptab_out (abfd, tab + j, ext_tab + j);
 	  free (tab);
 
-	  o->_raw_size = c * sizeof (Elf32_External_gptab);
+	  o->size = c * sizeof (Elf32_External_gptab);
 	  o->contents = (bfd_byte *) ext_tab;
 
 	  /* Skip this section later on (I don't think this currently
@@ -8797,7 +8710,7 @@
     }
 
   /* Invoke the regular ELF backend linker to do all the work.  */
-  if (!MNAME(abfd,bfd_elf,bfd_final_link) (abfd, info))
+  if (!bfd_elf_final_link (abfd, info))
     return FALSE;
 
   /* Now write out the computed sections.  */
@@ -8826,7 +8739,7 @@
     {
       if (! bfd_set_section_contents (abfd, gptab_data_sec,
 				      gptab_data_sec->contents,
-				      0, gptab_data_sec->_raw_size))
+				      0, gptab_data_sec->size))
 	return FALSE;
     }
 
@@ -8834,7 +8747,7 @@
     {
       if (! bfd_set_section_contents (abfd, gptab_bss_sec,
 				      gptab_bss_sec->contents,
-				      0, gptab_bss_sec->_raw_size))
+				      0, gptab_bss_sec->size))
 	return FALSE;
     }
 
@@ -8845,7 +8758,7 @@
 	{
 	  if (! bfd_set_section_contents (abfd, rtproc_sec,
 					  rtproc_sec->contents,
-					  0, rtproc_sec->_raw_size))
+					  0, rtproc_sec->size))
 	    return FALSE;
 	}
     }
@@ -9026,7 +8939,7 @@
 	  which are automatically generated by gas.  */
       if (strcmp (sec->name, ".reginfo")
 	  && strcmp (sec->name, ".mdebug")
-	  && (sec->_raw_size != 0
+	  && (sec->size != 0
 	      || (strcmp (sec->name, ".text")
 		  && strcmp (sec->name, ".data")
 		  && strcmp (sec->name, ".bss"))))
diff --git a/bfd/elfxx-mips.h b/bfd/elfxx-mips.h
index 9e5d7af..0a684d9 100644
--- a/bfd/elfxx-mips.h
+++ b/bfd/elfxx-mips.h
@@ -1,5 +1,5 @@
 /* MIPS ELF specific backend routines.
-   Copyright 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -35,7 +35,7 @@
 extern bfd_boolean _bfd_mips_elf_section_from_bfd_section
   (bfd *, asection *, int *);
 extern bfd_boolean _bfd_mips_elf_add_symbol_hook
-  (bfd *, struct bfd_link_info *, const Elf_Internal_Sym *,
+  (bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
    const char **, flagword *, asection **, bfd_vma *);
 extern bfd_boolean _bfd_mips_elf_link_output_symbol_hook
   (struct bfd_link_info *, const char *, Elf_Internal_Sym *,
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 5bf8f4d..a48b9f3 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -1,6 +1,6 @@
 /* Target definitions for NN-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003 Free Software Foundation, Inc.
+   2003, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -34,6 +34,8 @@
 
 #define bfd_elfNN_canonicalize_dynamic_symtab \
   _bfd_elf_canonicalize_dynamic_symtab
+#define bfd_elfNN_get_synthetic_symtab \
+  _bfd_elf_get_synthetic_symtab
 #ifndef bfd_elfNN_canonicalize_reloc
 #define bfd_elfNN_canonicalize_reloc	_bfd_elf_canonicalize_reloc
 #endif
@@ -126,7 +128,7 @@
 #define elf_backend_gc_sweep_hook	NULL
 #endif
 #ifndef bfd_elfNN_bfd_gc_sections
-#define bfd_elfNN_bfd_gc_sections _bfd_elfNN_gc_sections
+#define bfd_elfNN_bfd_gc_sections bfd_elf_gc_sections
 #endif
 
 #ifndef bfd_elfNN_bfd_merge_sections
@@ -134,6 +136,10 @@
   _bfd_elf_merge_sections
 #endif
 
+#ifndef bfd_elfNN_bfd_is_group_section
+#define bfd_elfNN_bfd_is_group_section bfd_elf_is_group_section
+#endif
+
 #ifndef bfd_elfNN_bfd_discard_group
 #define bfd_elfNN_bfd_discard_group bfd_elf_discard_group
 #endif
@@ -152,6 +158,10 @@
 #define bfd_elfNN_bfd_copy_private_section_data \
   _bfd_elf_copy_private_section_data
 #endif
+#ifndef bfd_elfNN_bfd_copy_private_header_data
+#define bfd_elfNN_bfd_copy_private_header_data \
+  _bfd_elf_copy_private_header_data
+#endif
 #ifndef bfd_elfNN_bfd_copy_private_bfd_data
 #define bfd_elfNN_bfd_copy_private_bfd_data \
   _bfd_elf_copy_private_bfd_data
@@ -189,6 +199,12 @@
 #ifndef bfd_elfNN_bfd_link_hash_table_create
 #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create
 #endif
+#ifndef bfd_elfNN_bfd_link_add_symbols
+#define bfd_elfNN_bfd_link_add_symbols	bfd_elf_link_add_symbols
+#endif
+#ifndef bfd_elfNN_bfd_final_link
+#define bfd_elfNN_bfd_final_link	bfd_elf_final_link
+#endif
 #else /* ! defined (elf_backend_relocate_section) */
 /* If no backend relocate_section routine, use the generic linker.
    Note - this will prevent the port from being able to use some of
@@ -235,6 +251,10 @@
 #define bfd_elfNN_mkarchive _bfd_generic_mkarchive
 #endif
 
+#ifndef bfd_elfNN_print_symbol
+#define bfd_elfNN_print_symbol bfd_elf_print_symbol
+#endif
+
 #ifndef elf_symbol_leading_char
 #define elf_symbol_leading_char 0
 #endif
@@ -304,9 +324,15 @@
 #ifndef elf_backend_create_dynamic_sections
 #define elf_backend_create_dynamic_sections 0
 #endif
+#ifndef elf_backend_omit_section_dynsym
+#define elf_backend_omit_section_dynsym _bfd_elf_link_omit_section_dynsym
+#endif
 #ifndef elf_backend_check_relocs
 #define elf_backend_check_relocs	0
 #endif
+#ifndef elf_backend_check_directives
+#define elf_backend_check_directives	0
+#endif
 #ifndef elf_backend_adjust_dynamic_symbol
 #define elf_backend_adjust_dynamic_symbol 0
 #endif
@@ -433,6 +459,13 @@
 #define elf_backend_rela_normal 0
 #endif
 
+#ifndef elf_backend_plt_sym_val
+#define elf_backend_plt_sym_val NULL
+#endif
+#ifndef elf_backend_relplt_name
+#define elf_backend_relplt_name NULL
+#endif
+
 #ifndef ELF_MACHINE_ALT1
 #define ELF_MACHINE_ALT1 0
 #endif
@@ -478,7 +511,9 @@
   elf_backend_add_symbol_hook,
   elf_backend_link_output_symbol_hook,
   elf_backend_create_dynamic_sections,
+  elf_backend_omit_section_dynsym,
   elf_backend_check_relocs,
+  elf_backend_check_directives,
   elf_backend_adjust_dynamic_symbol,
   elf_backend_always_size_sections,
   elf_backend_size_dynamic_sections,
@@ -514,6 +549,8 @@
   elf_backend_mips_rtype_to_howto,
   elf_backend_ecoff_debug_swap,
   elf_backend_bfd_from_remote_memory,
+  elf_backend_plt_sym_val,
+  elf_backend_relplt_name,
   ELF_MACHINE_ALT1,
   ELF_MACHINE_ALT2,
   &elf_backend_size_info,
diff --git a/bfd/hash.c b/bfd/hash.c
index 58fa532..2954ec8 100644
--- a/bfd/hash.c
+++ b/bfd/hash.c
@@ -1,28 +1,29 @@
 /* hash.c -- hash table routines for BFD
-   Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002, 2003
+   Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
 
-This file is part of BFD, the Binary File Descriptor library.
+   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 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.
+   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.  */
+   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 "objalloc.h"
+#include "libiberty.h"
 
 /*
 SECTION
@@ -87,6 +88,10 @@
 	been allocated for a hash table.  This will not free up the
 	<<struct bfd_hash_table>> itself, which you must provide.
 
+@findex bfd_hash_set_default_size
+	Use <<bfd_hash_set_default_size>> to set the default size of
+	hash table to use.
+
 INODE
 Looking Up or Entering a String, Traversing a Hash Table, Creating and Freeing a Hash Table, Hash Tables
 SUBSECTION
@@ -295,7 +300,8 @@
 */
 
 /* The default number of entries to use when creating a hash table.  */
-#define DEFAULT_SIZE (4051)
+#define DEFAULT_SIZE 4051
+static size_t bfd_default_hash_table_size = DEFAULT_SIZE;
 
 /* Create a new hash table, given a number of entries.  */
 
@@ -339,7 +345,7 @@
 						struct bfd_hash_table *,
 						const char *));
 {
-  return bfd_hash_table_init_n (table, newfunc, DEFAULT_SIZE);
+  return bfd_hash_table_init_n (table, newfunc, bfd_default_hash_table_size);
 }
 
 /* Free a hash table.  */
@@ -495,6 +501,24 @@
     }
 }
 
+void
+bfd_hash_set_default_size (bfd_size_type hash_size)
+{
+  int index;
+  /* Extend this prime list if you want more granularity of hash table size.  */
+  static bfd_size_type hash_size_primes[] =
+    {
+      1021, 4051, 8599, 16699
+    };
+
+  /* Work out best prime number near the hash_size.  */
+  for (index = 0; index < ARRAY_SIZE (hash_size_primes) - 1; ++index)
+    if (hash_size <= hash_size_primes[index])
+      break;
+
+  bfd_default_hash_table_size = hash_size_primes[index];
+}
+
 /* A few different object file formats (a.out, COFF, ELF) use a string
    table.  These functions support adding strings to a string table,
    returning the byte offset, and writing out the table.
diff --git a/bfd/hp300hpux.c b/bfd/hp300hpux.c
index f6cdd19..732073a 100644
--- a/bfd/hp300hpux.c
+++ b/bfd/hp300hpux.c
@@ -1,6 +1,6 @@
 /* BFD backend for hp-ux 9000/300
-   Copyright 1990, 1991, 1993, 1994, 1995, 1997, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1993, 1994, 1995, 1997, 2000, 2001, 2002, 2003,
+   2004 Free Software Foundation, Inc.
    Written by Glenn Engel.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -232,7 +232,7 @@
   struct internal_exec *execp = exec_hdr (abfd);
 
   /* Calculate the file positions of the parts of a newly read aout header */
-  obj_textsec (abfd)->_raw_size = N_TXTSIZE (*execp);
+  obj_textsec (abfd)->size = N_TXTSIZE (*execp);
 
   /* The virtual memory addresses of the sections */
   obj_textsec (abfd)->vma = N_TXTADDR (*execp);
diff --git a/bfd/hppabsd-core.c b/bfd/hppabsd-core.c
index ff88f9d..542930f 100644
--- a/bfd/hppabsd-core.c
+++ b/bfd/hppabsd-core.c
@@ -81,11 +81,11 @@
 #define core_regsec(bfd) (core_hdr(bfd)->reg_section)
 
 static asection *
-make_bfd_asection (abfd, name, flags, _raw_size, offset, alignment_power)
+make_bfd_asection (abfd, name, flags, size, offset, alignment_power)
      bfd *abfd;
      const char *name;
      flagword flags;
-     bfd_size_type _raw_size;
+     bfd_size_type size;
      file_ptr offset;
      unsigned int alignment_power;
 {
@@ -96,7 +96,7 @@
     return NULL;
 
   asect->flags = flags;
-  asect->_raw_size = _raw_size;
+  asect->size = size;
   asect->filepos = offset;
   asect->alignment_power = alignment_power;
 
@@ -139,7 +139,8 @@
   {
     FILE *stream = bfd_cache_lookup (abfd);
     struct stat statbuf;
-    if (stream == NULL || fstat (fileno (stream), &statbuf) < 0)
+
+    if (fstat (fileno (stream), &statbuf) < 0)
       {
 	bfd_set_error (bfd_error_system_call);
 	return NULL;
diff --git a/bfd/hpux-core.c b/bfd/hpux-core.c
index 30967c9..32b4eb4 100644
--- a/bfd/hpux-core.c
+++ b/bfd/hpux-core.c
@@ -115,11 +115,11 @@
   PARAMS ((void));
 
 static asection *
-make_bfd_asection (abfd, name, flags, _raw_size, vma, alignment_power)
+make_bfd_asection (abfd, name, flags, size, vma, alignment_power)
      bfd *abfd;
      const char *name;
      flagword flags;
-     bfd_size_type _raw_size;
+     bfd_size_type size;
      bfd_vma vma;
      unsigned int alignment_power;
 {
@@ -137,7 +137,7 @@
     return NULL;
 
   asect->flags = flags;
-  asect->_raw_size = _raw_size;
+  asect->size = size;
   asect->vma = vma;
   asect->filepos = bfd_tell (abfd);
   asect->alignment_power = alignment_power;
@@ -276,7 +276,8 @@
 	case CORE_ANON_SHMEM:
 	  if (!make_bfd_asection (abfd, ".data",
 				  SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS,
-				  core_header.len, core_header.addr, 2))
+				  core_header.len,
+				  (bfd_vma) core_header.addr, 2))
 	    goto fail;
 
 	  bfd_seek (abfd, (file_ptr) core_header.len, SEEK_CUR);
diff --git a/bfd/i386linux.c b/bfd/i386linux.c
index da36e75..7ef0946 100644
--- a/bfd/i386linux.c
+++ b/bfd/i386linux.c
@@ -1,5 +1,5 @@
 /* BFD back-end for linux flavored i386 a.out binaries.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -316,7 +316,7 @@
       || ! bfd_set_section_flags (abfd, s, flags)
       || ! bfd_set_section_alignment (abfd, s, 2))
     return FALSE;
-  s->_raw_size = 0;
+  s->size = 0;
   s->contents = 0;
 
   return TRUE;
@@ -594,9 +594,9 @@
 			       ".linux-dynamic");
   if (s != NULL)
     {
-      s->_raw_size = linux_hash_table (info)->fixup_count + 1;
-      s->_raw_size *= 8;
-      s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size);
+      s->size = linux_hash_table (info)->fixup_count + 1;
+      s->size *= 8;
+      s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->size);
       if (s->contents == NULL)
 	return FALSE;
     }
@@ -761,7 +761,7 @@
 		SEEK_SET) != 0)
     return FALSE;
 
-  if (bfd_bwrite ((PTR) s->contents, s->_raw_size, output_bfd) != s->_raw_size)
+  if (bfd_bwrite ((PTR) s->contents, s->size, output_bfd) != s->size)
     return FALSE;
 
   return TRUE;
diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c
index 059466b..65080e3 100644
--- a/bfd/i386msdos.c
+++ b/bfd/i386msdos.c
@@ -1,6 +1,6 @@
 /* BFD back-end for MS-DOS executables.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002,
-   2003 Free Software Foundation, Inc.
+   2003, 2004 Free Software Foundation, Inc.
    Written by Bryan Ford of the University of Utah.
 
    Contributed by the Center for Software Science at the
@@ -83,20 +83,19 @@
   /* Find the total size of the program on disk and in memory.  */
   for (sec = abfd->sections; sec != (asection *) NULL; sec = sec->next)
     {
-      if (bfd_get_section_size_before_reloc (sec) == 0)
+      if (sec->size == 0)
         continue;
       if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
         {
-	  bfd_vma sec_vma = bfd_get_section_vma (abfd, sec)
-	  		    + bfd_get_section_size_before_reloc (sec);
+	  bfd_vma sec_vma = bfd_get_section_vma (abfd, sec) + sec->size;
 	  if (sec_vma > high_vma)
 	    high_vma = sec_vma;
 	}
       if (bfd_get_section_flags (abfd, sec) & SEC_LOAD)
         {
-	  file_ptr sec_end = sizeof(hdr)
-	  		     + bfd_get_section_vma (abfd, sec)
-			     + bfd_get_section_size_before_reloc (sec);
+	  file_ptr sec_end = (sizeof (hdr)
+			      + bfd_get_section_vma (abfd, sec)
+			      + sec->size);
 	  if (sec_end > outfile_size)
 	    outfile_size = sec_end;
 	}
@@ -176,6 +175,7 @@
 #define msdos_bfd_relax_section bfd_generic_relax_section
 #define msdos_bfd_gc_sections bfd_generic_gc_sections
 #define msdos_bfd_merge_sections bfd_generic_merge_sections
+#define msdos_bfd_is_group_section bfd_generic_is_group_section
 #define msdos_bfd_discard_group bfd_generic_discard_group
 #define msdos_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define msdos_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
diff --git a/bfd/i386os9k.c b/bfd/i386os9k.c
index d9a34e3..1a272d2 100644
--- a/bfd/i386os9k.c
+++ b/bfd/i386os9k.c
@@ -1,6 +1,6 @@
 /* BFD back-end for os9000 i386 binaries.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002
-   Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 2002,
+   2004 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -170,7 +170,7 @@
   obj_datasec (abfd)->vma = execp->a_dload;
 
   /* And reload the sizes, since the aout module zaps them.  */
-  obj_textsec (abfd)->_raw_size = execp->a_text;
+  obj_textsec (abfd)->size = execp->a_text;
 
   bss_start = execp->a_dload + execp->a_data;	/* BSS = end of data section.  */
   obj_bsssec (abfd)->vma = align_power (bss_start, execp->a_balign);
@@ -229,9 +229,9 @@
 
   exec_hdr (abfd)->a_info = BMAGIC;
 
-  exec_hdr (abfd)->a_text = obj_textsec (abfd)->_raw_size;
-  exec_hdr (abfd)->a_data = obj_datasec (abfd)->_raw_size;
-  exec_hdr (abfd)->a_bss = obj_bsssec (abfd)->_raw_size;
+  exec_hdr (abfd)->a_text = obj_textsec (abfd)->size;
+  exec_hdr (abfd)->a_data = obj_datasec (abfd)->size;
+  exec_hdr (abfd)->a_bss = obj_bsssec (abfd)->size;
   exec_hdr (abfd)->a_syms = bfd_get_symcount (abfd) * sizeof (struct nlist);
   exec_hdr (abfd)->a_entry = bfd_get_start_address (abfd);
   exec_hdr (abfd)->a_trsize = ((obj_textsec (abfd)->reloc_count) *
@@ -295,7 +295,7 @@
 
       obj_textsec (abfd)->filepos = sizeof (struct internal_exec);
       obj_datasec (abfd)->filepos = obj_textsec (abfd)->filepos
-	+ obj_textsec (abfd)->_raw_size;
+	+ obj_textsec (abfd)->size;
 
     }
   /* Regardless, once we know what we're doing, we might as well get going.  */
@@ -333,6 +333,7 @@
 #define os9k_bfd_relax_section bfd_generic_relax_section
 #define os9k_bfd_gc_sections bfd_generic_gc_sections
 #define os9k_bfd_merge_sections bfd_generic_merge_sections
+#define os9k_bfd_is_group_section bfd_generic_is_group_section
 #define os9k_bfd_discard_group bfd_generic_discard_group
 #define os9k_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define os9k_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
diff --git a/bfd/ieee.c b/bfd/ieee.c
index 8a08028..ac0dcc3 100644
--- a/bfd/ieee.c
+++ b/bfd/ieee.c
@@ -1,6 +1,6 @@
 /* BFD back-end for ieee-695 objects.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    Written by Steve Chamberlain of Cygnus Support.
@@ -704,7 +704,7 @@
 	  next_byte (&(ieee->h));
 	  PUSH (NOSYMBOL,
 		0,
-		ieee->section_table[must_parse_int (&(ieee->h))]->_raw_size);
+		ieee->section_table[must_parse_int (&(ieee->h))]->size);
 	  break;
 	case ieee_variable_I_enum:
 	  /* Push the address of variable n.  */
@@ -1021,7 +1021,7 @@
 		val = symbol->symbol.value;
 		for (s = abfd->sections; s != NULL; s = s->next)
 		  {
-		    if (val >= s->vma && val < s->vma + s->_raw_size)
+		    if (val >= s->vma && val < s->vma + s->size)
 		      {
 			symbol->symbol.section = s;
 			symbol->symbol.value -= s->vma;
@@ -1378,11 +1378,11 @@
 		  {
 		  case ieee_section_size_enum:
 		    section = ieee->section_table[must_parse_int (&(ieee->h))];
-		    section->_raw_size = must_parse_int (&(ieee->h));
+		    section->size = must_parse_int (&(ieee->h));
 		    break;
 		  case ieee_physical_region_size_enum:
 		    section = ieee->section_table[must_parse_int (&(ieee->h))];
-		    section->_raw_size = must_parse_int (&(ieee->h));
+		    section->size = must_parse_int (&(ieee->h));
 		    break;
 		  case ieee_region_base_address_enum:
 		    section = ieee->section_table[must_parse_int (&(ieee->h))];
@@ -1441,7 +1441,7 @@
   sec->filepos = ieee->w.r.debug_information_part;
 
   debug_end = ieee_part_after (ieee, ieee->w.r.debug_information_part);
-  sec->_raw_size = debug_end - ieee->w.r.debug_information_part;
+  sec->size = debug_end - ieee->w.r.debug_information_part;
 
   return TRUE;
 }
@@ -2060,7 +2060,7 @@
       ieee_per_section_type *per = ieee_per_section (s);
       if ((s->flags & SEC_DEBUGGING) != 0)
 	continue;
-      per->data = (bfd_byte *) bfd_alloc (ieee->h.abfd, s->_raw_size);
+      per->data = (bfd_byte *) bfd_alloc (ieee->h.abfd, s->size);
       if (!per->data)
 	return FALSE;
       per->reloc_tail_ptr =
@@ -2106,7 +2106,7 @@
 				  &pcrel, &extra,
 				  0);
 		current_map->pc = value;
-		BFD_ASSERT ((unsigned) (value - s->vma) <= s->_raw_size);
+		BFD_ASSERT ((unsigned) (value - s->vma) <= s->size);
 	      }
 	      break;
 
@@ -2336,7 +2336,7 @@
 	      || ! ieee_write_byte (abfd,
 				    (bfd_byte) (s->index
 						+ IEEE_SECTION_NUMBER_BASE))
-	      || ! ieee_write_int (abfd, s->_raw_size))
+	      || ! ieee_write_int (abfd, s->size))
 	    return FALSE;
 	  if (abfd->flags & EXEC_P)
 	    {
@@ -2398,14 +2398,14 @@
     {
       /* If there aren't any relocations then output the load constant
 	 byte opcode rather than the load with relocation opcode.  */
-      while (current_byte_index < s->_raw_size)
+      while (current_byte_index < s->size)
 	{
 	  bfd_size_type run;
 	  unsigned int MAXRUN = 127;
 
 	  run = MAXRUN;
-	  if (run > s->_raw_size - current_byte_index)
-	    run = s->_raw_size - current_byte_index;
+	  if (run > s->size - current_byte_index)
+	    run = s->size - current_byte_index;
 
 	  if (run != 0)
 	    {
@@ -2433,11 +2433,11 @@
       if ((PTR) stream == (PTR) NULL)
 	{
 	  /* Outputting a section without data, fill it up.  */
-	  stream = (unsigned char *) bfd_zalloc (abfd, s->_raw_size);
+	  stream = (unsigned char *) bfd_zalloc (abfd, s->size);
 	  if (!stream)
 	    return FALSE;
 	}
-      while (current_byte_index < s->_raw_size)
+      while (current_byte_index < s->size)
 	{
 	  bfd_size_type run;
 	  unsigned int MAXRUN = 127;
@@ -2451,8 +2451,8 @@
 	  else
 	    run = MAXRUN;
 
-	  if (run > s->_raw_size - current_byte_index)
-	    run = s->_raw_size - current_byte_index;
+	  if (run > s->size - current_byte_index)
+	    run = s->size - current_byte_index;
 
 	  if (run != 0)
 	    {
@@ -2561,7 +2561,7 @@
      bfd *abfd;
      asection *s;
 {
-  if (s->_raw_size)
+  if (s->size)
     {
       if (! ieee_write_byte (abfd, ieee_set_current_section_enum)
 	  || ! ieee_write_byte (abfd,
@@ -2586,7 +2586,7 @@
 	}
 
       if (! ieee_write_byte (abfd, ieee_repeat_data_enum)
-	  || ! ieee_write_int (abfd, s->_raw_size)
+	  || ! ieee_write_int (abfd, s->size)
 	  || ! ieee_write_byte (abfd, ieee_load_constant_bytes_enum)
 	  || ! ieee_write_byte (abfd, 1)
 	  || ! ieee_write_byte (abfd, 0))
@@ -2612,7 +2612,7 @@
     {
       unsigned int i;
 
-      for (i = 0; i < s->_raw_size; i++)
+      for (i = 0; i < s->size; i++)
 	{
 	  if (stream[i] != 0)
 	    {
@@ -3342,7 +3342,7 @@
 	}
 
       ieee->w.r.debug_information_part = here;
-      if (bfd_bwrite (s->contents, s->_raw_size, abfd) != s->_raw_size)
+      if (bfd_bwrite (s->contents, s->size, abfd) != s->size)
 	return FALSE;
     }
   else
@@ -3420,9 +3420,9 @@
     {
       if ((s->flags & SEC_DEBUGGING) != 0)
 	continue;
-      if (s->_raw_size != 0)
+      if (s->size != 0)
 	{
-	  bfd_size_type size = s->_raw_size;
+	  bfd_size_type size = s->size;
 	  ieee_per_section (s)->data = (bfd_byte *) (bfd_alloc (abfd, size));
 	  if (!ieee_per_section (s)->data)
 	    return FALSE;
@@ -3448,7 +3448,7 @@
     {
       if (section->contents == NULL)
 	{
-	  bfd_size_type size = section->_raw_size;
+	  bfd_size_type size = section->size;
 	  section->contents = (unsigned char *) bfd_alloc (abfd, size);
 	  if (section->contents == NULL)
 	    return FALSE;
@@ -4037,6 +4037,7 @@
 #define ieee_bfd_relax_section bfd_generic_relax_section
 #define ieee_bfd_gc_sections bfd_generic_gc_sections
 #define ieee_bfd_merge_sections bfd_generic_merge_sections
+#define ieee_bfd_is_group_section bfd_generic_is_group_section
 #define ieee_bfd_discard_group bfd_generic_discard_group
 #define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define ieee_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
diff --git a/bfd/ihex.c b/bfd/ihex.c
index 5d2d47f..e818034 100644
--- a/bfd/ihex.c
+++ b/bfd/ihex.c
@@ -1,5 +1,5 @@
 /* BFD back-end for Intel Hex objects.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003
+   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor of Cygnus Support <ian@cygnus.com>.
 
@@ -381,11 +381,11 @@
 	    case 0:
 	      /* This is a data record.  */
 	      if (sec != NULL
-		  && sec->vma + sec->_raw_size == extbase + segbase + addr)
+		  && sec->vma + sec->size == extbase + segbase + addr)
 		{
 		  /* This data goes at the end of the section we are
                      currently building.  */
-		  sec->_raw_size += len;
+		  sec->size += len;
 		}
 	      else if (len > 0)
 		{
@@ -405,7 +405,7 @@
 		  sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
 		  sec->vma = extbase + segbase + addr;
 		  sec->lma = extbase + segbase + addr;
-		  sec->_raw_size = len;
+		  sec->size = len;
 		  sec->filepos = pos;
 		}
 	      break;
@@ -635,7 +635,7 @@
 
       for (i = 0; i < len; i++)
 	*p++ = HEX2 (buf + 2 * i);
-      if ((bfd_size_type) (p - contents) >= section->_raw_size)
+      if ((bfd_size_type) (p - contents) >= section->size)
 	{
 	  /* We've read everything in the section.  */
 	  if (buf != NULL)
@@ -648,7 +648,7 @@
 	goto error_return;
     }
 
-  if ((bfd_size_type) (p - contents) < section->_raw_size)
+  if ((bfd_size_type) (p - contents) < section->size)
     {
       (*_bfd_error_handler)
 	(_("%s: bad section length in ihex_read_section"),
@@ -680,7 +680,7 @@
 {
   if (section->used_by_bfd == NULL)
     {
-      section->used_by_bfd = bfd_alloc (abfd, section->_raw_size);
+      section->used_by_bfd = bfd_alloc (abfd, section->size);
       if (section->used_by_bfd == NULL)
 	return FALSE;
       if (! ihex_read_section (abfd, section, section->used_by_bfd))
@@ -988,6 +988,7 @@
 #define ihex_bfd_relax_section bfd_generic_relax_section
 #define ihex_bfd_gc_sections bfd_generic_gc_sections
 #define ihex_bfd_merge_sections bfd_generic_merge_sections
+#define ihex_bfd_is_group_section bfd_generic_is_group_section
 #define ihex_bfd_discard_group bfd_generic_discard_group
 #define ihex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define ihex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
diff --git a/bfd/irix-core.c b/bfd/irix-core.c
index 4868422..740907b 100644
--- a/bfd/irix-core.c
+++ b/bfd/irix-core.c
@@ -161,11 +161,11 @@
 }
 
 static asection *
-make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
+make_bfd_asection (abfd, name, flags, size, vma, filepos)
      bfd *abfd;
      const char *name;
      flagword flags;
-     bfd_size_type _raw_size;
+     bfd_size_type size;
      bfd_vma vma;
      file_ptr filepos;
 {
@@ -176,7 +176,7 @@
     return NULL;
 
   asect->flags = flags;
-  asect->_raw_size = _raw_size;
+  asect->size = size;
   asect->vma = vma;
   asect->filepos = filepos;
   asect->alignment_power = 4;
diff --git a/bfd/libaout.h b/bfd/libaout.h
index 87b49e5..a762895 100644
--- a/bfd/libaout.h
+++ b/bfd/libaout.h
@@ -273,9 +273,12 @@
   M_ALPHA_NETBSD = 141,	  /* NetBSD/alpha binary.  */
   M_ARM6_NETBSD = 143,	  /* NetBSD/arm32 binary.  */
   M_SPARCLET_1 = 147,	  /* 0x93, reserved.  */
+  M_POWERPC_NETBSD = 149, /* NetBSD/powerpc (big-endian) binary.  */
   M_VAX4K_NETBSD = 150,	  /* NetBSD/vax 4K pages binary.  */
   M_MIPS1 = 151,          /* MIPS R2000/R3000 binary.  */
   M_MIPS2 = 152,          /* MIPS R4000/R6000 binary.  */
+  M_88K_OPENBSD = 153,	  /* OpenBSD/m88k binary.  */
+  M_HPPA_OPENBSD = 154,	  /* OpenBSD/hppa binary.  */
   M_SPARC64_NETBSD = 156, /* NetBSD/sparc64 binary.  */
   M_X86_64_NETBSD = 157,  /* NetBSD/amd64 binary.  */
   M_SPARCLET_2 = 163,	  /* 0xa3, reserved.  */
@@ -663,8 +666,8 @@
    && obj_textsec (abfd) != NULL					\
    && obj_datasec (abfd) != NULL					\
    && (sec)->vma >= (obj_textsec (abfd)->vma +				\
-		     obj_textsec (abfd)->_cooked_size)			\
-   && ((sec)->vma + (sec)->_cooked_size) <= obj_datasec (abfd)->vma	\
+		     obj_textsec (abfd)->size)				\
+   && ((sec)->vma + (sec)->size) <= obj_datasec (abfd)->vma		\
    && ((abfd)->flags & D_PAGED) != 0)
 
 #endif /* ! defined (LIBAOUT_H) */
diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h
index 10cafef..1bfa220 100644
--- a/bfd/libbfd-in.h
+++ b/bfd/libbfd-in.h
@@ -212,6 +212,8 @@
   ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true)
 #define _bfd_generic_bfd_copy_private_symbol_data \
   ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true)
+#define _bfd_generic_bfd_copy_private_header_data \
+  ((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
 #define _bfd_generic_bfd_print_private_bfd_data \
   ((bfd_boolean (*) (bfd *, void *)) bfd_true)
 
@@ -355,6 +357,9 @@
 #define _bfd_nolink_bfd_merge_sections \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
    bfd_false)
+#define _bfd_nolink_bfd_is_group_section \
+  ((bfd_boolean (*) (bfd *, const struct bfd_section *)) \
+   bfd_false)
 #define _bfd_nolink_bfd_discard_group \
   ((bfd_boolean (*) (bfd *, struct bfd_section *)) \
    bfd_false)
@@ -378,6 +383,8 @@
 #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1
 #define _bfd_nodynamic_canonicalize_dynamic_symtab \
   ((long (*) (bfd *, asymbol **)) _bfd_n1)
+#define _bfd_nodynamic_get_synthetic_symtab \
+  ((long (*) (bfd *, asymbol **, asymbol **)) _bfd_n1)
 #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1
 #define _bfd_nodynamic_canonicalize_dynamic_reloc \
   ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1)
@@ -491,7 +498,8 @@
 /* Link stabs in sections in the first pass.  */
 
 extern bfd_boolean _bfd_link_section_stabs
-  (bfd *, void **, asection *, asection *, void **, bfd_size_type *);
+  (bfd *, struct stab_info *, asection *, asection *, void **,
+   bfd_size_type *);
 
 /* Eliminate stabs for discarded functions and symbols.  */
 extern bfd_boolean _bfd_discard_section_stabs
@@ -500,28 +508,28 @@
 /* Write out the .stab section when linking stabs in sections.  */
 
 extern bfd_boolean _bfd_write_section_stabs
-  (bfd *, void **, asection *, void **, bfd_byte *);
+  (bfd *, struct stab_info *, asection *, void **, bfd_byte *);
 
 /* Write out the .stabstr string table when linking stabs in sections.  */
 
 extern bfd_boolean _bfd_write_stab_strings
-  (bfd *, void **);
+  (bfd *, struct stab_info *);
 
 /* Find an offset within a .stab section when linking stabs in
    sections.  */
 
 extern bfd_vma _bfd_stab_section_offset
-  (bfd *, void **, asection *, void **, bfd_vma);
+  (asection *, void *, bfd_vma);
 
-/* Attempt to merge a SEC_MERGE section.  */
+/* Register a SEC_MERGE section as a candidate for merging.  */
 
-extern bfd_boolean _bfd_merge_section
+extern bfd_boolean _bfd_add_merge_section
   (bfd *, void **, asection *, void **);
 
 /* Attempt to merge SEC_MERGE sections.  */
 
 extern bfd_boolean _bfd_merge_sections
-  (bfd *, void *, void (*) (bfd *, asection *));
+  (bfd *, struct bfd_link_info *, void *, void (*) (bfd *, asection *));
 
 /* Write out a merged section.  */
 
@@ -531,7 +539,7 @@
 /* Find an offset within a modified SEC_MERGE section.  */
 
 extern bfd_vma _bfd_merged_section_offset
-  (bfd *, asection **, void *, bfd_vma, bfd_vma);
+  (bfd *, asection **, void *, bfd_vma);
 
 /* Create a string table.  */
 extern struct bfd_strtab_hash *_bfd_stringtab_init
diff --git a/bfd/libbfd.c b/bfd/libbfd.c
index be090e9..d76a12e 100644
--- a/bfd/libbfd.c
+++ b/bfd/libbfd.c
@@ -692,10 +692,12 @@
 				   file_ptr offset,
 				   bfd_size_type count)
 {
+  bfd_size_type sz;
   if (count == 0)
     return TRUE;
 
-  if (offset + count > section->_raw_size)
+  sz = section->rawsize ? section->rawsize : section->size;
+  if (offset + count > sz)
     {
       bfd_set_error (bfd_error_invalid_operation);
       return FALSE;
@@ -717,6 +719,8 @@
    bfd_size_type count ATTRIBUTE_UNUSED)
 {
 #ifdef USE_MMAP
+  bfd_size_type sz;
+
   if (count == 0)
     return TRUE;
   if (abfd->xvec->_bfd_get_section_contents
@@ -744,7 +748,8 @@
       w->data = w->i->data;
       return bfd_get_section_contents (abfd, section, w->data, offset, count);
     }
-  if (offset + count > section->_raw_size
+  sz = section->rawsize ? section->rawsize : section->size;
+  if (offset + count > sz
       || ! bfd_get_file_window (abfd, section->filepos + offset, count, w,
 				TRUE))
     return FALSE;
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 62043f3..095010c 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -217,6 +217,8 @@
   ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true)
 #define _bfd_generic_bfd_copy_private_symbol_data \
   ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true)
+#define _bfd_generic_bfd_copy_private_header_data \
+  ((bfd_boolean (*) (bfd *, bfd *)) bfd_true)
 #define _bfd_generic_bfd_print_private_bfd_data \
   ((bfd_boolean (*) (bfd *, void *)) bfd_true)
 
@@ -360,6 +362,9 @@
 #define _bfd_nolink_bfd_merge_sections \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
    bfd_false)
+#define _bfd_nolink_bfd_is_group_section \
+  ((bfd_boolean (*) (bfd *, const struct bfd_section *)) \
+   bfd_false)
 #define _bfd_nolink_bfd_discard_group \
   ((bfd_boolean (*) (bfd *, struct bfd_section *)) \
    bfd_false)
@@ -383,6 +388,8 @@
 #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1
 #define _bfd_nodynamic_canonicalize_dynamic_symtab \
   ((long (*) (bfd *, asymbol **)) _bfd_n1)
+#define _bfd_nodynamic_get_synthetic_symtab \
+  ((long (*) (bfd *, asymbol **, asymbol **)) _bfd_n1)
 #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1
 #define _bfd_nodynamic_canonicalize_dynamic_reloc \
   ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1)
@@ -496,7 +503,8 @@
 /* Link stabs in sections in the first pass.  */
 
 extern bfd_boolean _bfd_link_section_stabs
-  (bfd *, void **, asection *, asection *, void **, bfd_size_type *);
+  (bfd *, struct stab_info *, asection *, asection *, void **,
+   bfd_size_type *);
 
 /* Eliminate stabs for discarded functions and symbols.  */
 extern bfd_boolean _bfd_discard_section_stabs
@@ -505,28 +513,28 @@
 /* Write out the .stab section when linking stabs in sections.  */
 
 extern bfd_boolean _bfd_write_section_stabs
-  (bfd *, void **, asection *, void **, bfd_byte *);
+  (bfd *, struct stab_info *, asection *, void **, bfd_byte *);
 
 /* Write out the .stabstr string table when linking stabs in sections.  */
 
 extern bfd_boolean _bfd_write_stab_strings
-  (bfd *, void **);
+  (bfd *, struct stab_info *);
 
 /* Find an offset within a .stab section when linking stabs in
    sections.  */
 
 extern bfd_vma _bfd_stab_section_offset
-  (bfd *, void **, asection *, void **, bfd_vma);
+  (asection *, void *, bfd_vma);
 
-/* Attempt to merge a SEC_MERGE section.  */
+/* Register a SEC_MERGE section as a candidate for merging.  */
 
-extern bfd_boolean _bfd_merge_section
+extern bfd_boolean _bfd_add_merge_section
   (bfd *, void **, asection *, void **);
 
 /* Attempt to merge SEC_MERGE sections.  */
 
 extern bfd_boolean _bfd_merge_sections
-  (bfd *, void *, void (*) (bfd *, asection *));
+  (bfd *, struct bfd_link_info *, void *, void (*) (bfd *, asection *));
 
 /* Write out a merged section.  */
 
@@ -536,7 +544,7 @@
 /* Find an offset within a modified SEC_MERGE section.  */
 
 extern bfd_vma _bfd_merged_section_offset
-  (bfd *, asection **, void *, bfd_vma, bfd_vma);
+  (bfd *, asection **, void *, bfd_vma);
 
 /* Create a string table.  */
 extern struct bfd_strtab_hash *_bfd_stringtab_init
@@ -657,6 +665,27 @@
 unsigned int bfd_log2 (bfd_vma x);
 
 /* Extracted from bfdio.c.  */
+struct bfd_iovec
+{
+  /* To avoid problems with macros, a "b" rather than "f"
+     prefix is prepended to each method name.  */
+  /* Attempt to read/write NBYTES on ABFD's IOSTREAM storing/fetching
+     bytes starting at PTR.  Return the number of bytes actually
+     transfered (a read past end-of-file returns less than NBYTES),
+     or -1 (setting <<bfd_error>>) if an error occurs.  */
+  file_ptr (*bread) (struct bfd *abfd, void *ptr, file_ptr nbytes);
+  file_ptr (*bwrite) (struct bfd *abfd, const void *ptr,
+                      file_ptr nbytes);
+  /* Return the current IOSTREAM file offset, or -1 (setting <<bfd_error>>
+     if an error occurs.  */
+  file_ptr (*btell) (struct bfd *abfd);
+  /* For the following, on successful completion a value of 0 is returned.
+     Otherwise, a value of -1 is returned (and  <<bfd_error>> is set).  */
+  int (*bseek) (struct bfd *abfd, file_ptr offset, int whence);
+  int (*bclose) (struct bfd *abfd);
+  int (*bflush) (struct bfd *abfd);
+  int (*bstat) (struct bfd *abfd, struct stat *sb);
+};
 /* Extracted from bfdwin.c.  */
 struct _bfd_window_internal {
   struct _bfd_window_internal *next;
@@ -670,9 +699,9 @@
 extern bfd *bfd_last_cache;
 
 #define bfd_cache_lookup(x) \
-    ((x)==bfd_last_cache? \
-      (FILE*) (bfd_last_cache->iostream): \
-       bfd_cache_lookup_worker(x))
+    ((x) == bfd_last_cache ? \
+      (FILE *) (bfd_last_cache->iostream): \
+       bfd_cache_lookup_worker (x))
 bfd_boolean bfd_cache_init (bfd *abfd);
 
 bfd_boolean bfd_cache_close (bfd *abfd);
@@ -699,6 +728,7 @@
   "BFD_RELOC_16_PCREL",
   "BFD_RELOC_12_PCREL",
   "BFD_RELOC_8_PCREL",
+  "BFD_RELOC_32_SECREL",
   "BFD_RELOC_32_GOT_PCREL",
   "BFD_RELOC_16_GOT_PCREL",
   "BFD_RELOC_8_GOT_PCREL",
@@ -836,8 +866,6 @@
   "BFD_RELOC_HI16",
   "BFD_RELOC_HI16_S",
   "BFD_RELOC_LO16",
-  "BFD_RELOC_PCREL_HI16_S",
-  "BFD_RELOC_PCREL_LO16",
   "BFD_RELOC_MIPS_LITERAL",
   "BFD_RELOC_MIPS_GOT16",
   "BFD_RELOC_MIPS_CALL16",
@@ -1195,6 +1223,9 @@
   "BFD_RELOC_M32R_JMP_SLOT",
   "BFD_RELOC_M32R_RELATIVE",
   "BFD_RELOC_M32R_GOTOFF",
+  "BFD_RELOC_M32R_GOTOFF_HI_ULO",
+  "BFD_RELOC_M32R_GOTOFF_HI_SLO",
+  "BFD_RELOC_M32R_GOTOFF_LO",
   "BFD_RELOC_M32R_GOTPC24",
   "BFD_RELOC_M32R_GOT16_HI_ULO",
   "BFD_RELOC_M32R_GOT16_HI_SLO",
@@ -1437,6 +1468,63 @@
   "BFD_RELOC_M68HC11_PAGE",
   "BFD_RELOC_M68HC11_24",
   "BFD_RELOC_M68HC12_5B",
+  "BFD_RELOC_16C_NUM08",
+  "BFD_RELOC_16C_NUM08_C",
+  "BFD_RELOC_16C_NUM16",
+  "BFD_RELOC_16C_NUM16_C",
+  "BFD_RELOC_16C_NUM32",
+  "BFD_RELOC_16C_NUM32_C",
+  "BFD_RELOC_16C_DISP04",
+  "BFD_RELOC_16C_DISP04_C",
+  "BFD_RELOC_16C_DISP08",
+  "BFD_RELOC_16C_DISP08_C",
+  "BFD_RELOC_16C_DISP16",
+  "BFD_RELOC_16C_DISP16_C",
+  "BFD_RELOC_16C_DISP24",
+  "BFD_RELOC_16C_DISP24_C",
+  "BFD_RELOC_16C_DISP24a",
+  "BFD_RELOC_16C_DISP24a_C",
+  "BFD_RELOC_16C_REG04",
+  "BFD_RELOC_16C_REG04_C",
+  "BFD_RELOC_16C_REG04a",
+  "BFD_RELOC_16C_REG04a_C",
+  "BFD_RELOC_16C_REG14",
+  "BFD_RELOC_16C_REG14_C",
+  "BFD_RELOC_16C_REG16",
+  "BFD_RELOC_16C_REG16_C",
+  "BFD_RELOC_16C_REG20",
+  "BFD_RELOC_16C_REG20_C",
+  "BFD_RELOC_16C_ABS20",
+  "BFD_RELOC_16C_ABS20_C",
+  "BFD_RELOC_16C_ABS24",
+  "BFD_RELOC_16C_ABS24_C",
+  "BFD_RELOC_16C_IMM04",
+  "BFD_RELOC_16C_IMM04_C",
+  "BFD_RELOC_16C_IMM16",
+  "BFD_RELOC_16C_IMM16_C",
+  "BFD_RELOC_16C_IMM20",
+  "BFD_RELOC_16C_IMM20_C",
+  "BFD_RELOC_16C_IMM24",
+  "BFD_RELOC_16C_IMM24_C",
+  "BFD_RELOC_16C_IMM32",
+  "BFD_RELOC_16C_IMM32_C",
+  "BFD_RELOC_CRX_REL4",
+  "BFD_RELOC_CRX_REL8",
+  "BFD_RELOC_CRX_REL8_CMP",
+  "BFD_RELOC_CRX_REL16",
+  "BFD_RELOC_CRX_REL24",
+  "BFD_RELOC_CRX_REL32",
+  "BFD_RELOC_CRX_REGREL12",
+  "BFD_RELOC_CRX_REGREL22",
+  "BFD_RELOC_CRX_REGREL28",
+  "BFD_RELOC_CRX_REGREL32",
+  "BFD_RELOC_CRX_ABS16",
+  "BFD_RELOC_CRX_ABS32",
+  "BFD_RELOC_CRX_NUM8",
+  "BFD_RELOC_CRX_NUM16",
+  "BFD_RELOC_CRX_NUM32",
+  "BFD_RELOC_CRX_IMM16",
+  "BFD_RELOC_CRX_IMM32",
   "BFD_RELOC_CRIS_BDISP8",
   "BFD_RELOC_CRIS_UNSIGNED_5",
   "BFD_RELOC_CRIS_SIGNED_6",
diff --git a/bfd/libcoff-in.h b/bfd/libcoff-in.h
index 6b5947c..589f88c 100644
--- a/bfd/libcoff-in.h
+++ b/bfd/libcoff-in.h
@@ -276,7 +276,7 @@
 {
   struct bfd_link_hash_table root;
   /* A pointer to information used to link stabs in sections.  */
-  PTR stab_info;
+  struct stab_info stab_info;
 };
 
 /* Look up an entry in a COFF linker hash table.  */
diff --git a/bfd/libcoff.h b/bfd/libcoff.h
index 5771132..fd3ecd1 100644
--- a/bfd/libcoff.h
+++ b/bfd/libcoff.h
@@ -280,7 +280,7 @@
 {
   struct bfd_link_hash_table root;
   /* A pointer to information used to link stabs in sections.  */
-  PTR stab_info;
+  struct stab_info stab_info;
 };
 
 /* Look up an entry in a COFF linker hash table.  */
diff --git a/bfd/libecoff.h b/bfd/libecoff.h
index 161f06c..b809f3a 100644
--- a/bfd/libecoff.h
+++ b/bfd/libecoff.h
@@ -1,5 +1,5 @@
 /* BFD ECOFF object file private structure.
-   Copyright 1993, 1994, 1995, 1996, 1999, 2001, 2002, 2003
+   Copyright 1993, 1994, 1995, 1996, 1999, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
@@ -176,41 +176,13 @@
 #define ecoff_get_sym_index(symbol) ((symbol)->udata.i)
 #define ecoff_set_sym_index(symbol, idx) ((symbol)->udata.i = (idx))
 
-/* When generating MIPS embedded PIC code, the linker relaxes the code
-   to turn PC relative branches into longer code sequences when the PC
-   relative branch is out of range.  This involves reading the relocs
-   in bfd_relax_section as well as in bfd_final_link, and requires the
-   code to keep track of which relocs have been expanded.  A pointer
-   to this structure is put in the used_by_bfd pointer of a section to
-   keep track of this information.  The user_by_bfd pointer will be
-   NULL if the information was not needed.  */
+/* A pointer to this structure is put in the used_by_bfd pointer of
+   a section to keep track of any per-section data.
+   The user_by_bfd pointer will be NULL if the information was not
+   needed.  */
 
 struct ecoff_section_tdata
 {
-  /* The unswapped relocs for this section.  These are stored in
-     memory so the input file does not have to be read twice.  */
-  PTR external_relocs;
-
-  /* The contents of the section.  These bytes may or may not be saved
-     in memory, but if it is this is a pointer to them.  */
-  bfd_byte *contents;
-
-  /* Offset adjustments for PC relative branches.  A number other than
-     1 is an addend for a PC relative branch, or a switch table entry
-     which is the difference of two .text locations; this addend
-     arises because the branch or difference crosses one or more
-     branches which were expanded into a larger code sequence.  A 1
-     means that this branch was itself expanded into a larger code
-     sequence.  1 is not a possible offset, since all offsets must be
-     multiples of the instruction size, which is 4; also, the only
-     relocs with non-zero offsets will be PC relative branches or
-     switch table entries within the same object file.  If this field
-     is NULL, no branches were expanded and no offsets are required.
-     Otherwise there are as many entries as there are relocs in the
-     section, and the entry for any reloc that is not PC relative is
-     zero.  */
-  long *offsets;
-
   /* When producing an executable (i.e., final, non-relocatable link)
      on the Alpha, we may need to use multiple global pointer values
      to span the entire .lita section.  In essence, we allow each
@@ -277,6 +249,9 @@
 #define _bfd_ecoff_bfd_copy_private_symbol_data \
   _bfd_generic_bfd_copy_private_symbol_data
 
+#define _bfd_ecoff_bfd_copy_private_header_data \
+  _bfd_generic_bfd_copy_private_header_data
+
 #define _bfd_ecoff_bfd_print_private_bfd_data \
   _bfd_generic_bfd_print_private_bfd_data
 
diff --git a/bfd/linker.c b/bfd/linker.c
index 58befc3..10b4467 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -2684,7 +2684,7 @@
 
   BFD_ASSERT (input_section->output_section == output_section);
   BFD_ASSERT (input_section->output_offset == link_order->offset);
-  BFD_ASSERT (input_section->_cooked_size == link_order->size);
+  BFD_ASSERT (input_section->size == link_order->size);
 
   if (info->relocatable
       && input_section->reloc_count > 0
@@ -2756,7 +2756,9 @@
     }
 
   /* Get and relocate the section contents.  */
-  sec_size = bfd_section_size (input_bfd, input_section);
+  sec_size = (input_section->rawsize > input_section->size
+	      ? input_section->rawsize
+	      : input_section->size);
   contents = bfd_malloc (sec_size);
   if (contents == NULL && sec_size != 0)
     goto error_return;
diff --git a/bfd/lynx-core.c b/bfd/lynx-core.c
index 08bf233..8eadd2e 100644
--- a/bfd/lynx-core.c
+++ b/bfd/lynx-core.c
@@ -1,5 +1,6 @@
 /* BFD back end for Lynx core files
-   Copyright 1993, 1994, 1995, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1993, 1994, 1995, 2001, 2002, 2004
+   Free Software Foundation, Inc.
    Written by Stu Grossman of Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -53,11 +54,11 @@
 /* Handle Lynx core dump file.  */
 
 static asection *
-make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
+make_bfd_asection (abfd, name, flags, size, vma, filepos)
      bfd *abfd;
      const char *name;
      flagword flags;
-     bfd_size_type _raw_size;
+     bfd_size_type size;
      bfd_vma vma;
      file_ptr filepos;
 {
@@ -75,7 +76,7 @@
     return NULL;
 
   asect->flags = flags;
-  asect->_raw_size = _raw_size;
+  asect->size = size;
   asect->vma = vma;
   asect->filepos = filepos;
   asect->alignment_power = 2;
diff --git a/bfd/m68klinux.c b/bfd/m68klinux.c
index 996e516..d238e26 100644
--- a/bfd/m68klinux.c
+++ b/bfd/m68klinux.c
@@ -1,6 +1,6 @@
 /* BFD back-end for linux flavored m68k a.out binaries.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
+   2003, 2004 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -320,7 +320,7 @@
       || ! bfd_set_section_flags (abfd, s, flags)
       || ! bfd_set_section_alignment (abfd, s, 2))
     return FALSE;
-  s->_raw_size = 0;
+  s->size = 0;
   s->contents = 0;
 
   return TRUE;
@@ -598,9 +598,9 @@
 			       ".linux-dynamic");
   if (s != NULL)
     {
-      s->_raw_size = linux_hash_table (info)->fixup_count + 1;
-      s->_raw_size *= 8;
-      s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size);
+      s->size = linux_hash_table (info)->fixup_count + 1;
+      s->size *= 8;
+      s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->size);
       if (s->contents == NULL)
 	{
 	  bfd_set_error (bfd_error_no_memory);
@@ -766,7 +766,7 @@
 		SEEK_SET) != 0)
     return FALSE;
 
-  if (bfd_bwrite ((PTR) s->contents, s->_raw_size, output_bfd) != s->_raw_size)
+  if (bfd_bwrite ((PTR) s->contents, s->size, output_bfd) != s->size)
     return FALSE;
 
   return TRUE;
diff --git a/bfd/m88kopenbsd.c b/bfd/m88kopenbsd.c
new file mode 100644
index 0000000..459d3b2
--- /dev/null
+++ b/bfd/m88kopenbsd.c
@@ -0,0 +1,33 @@
+/* BFD back-end for OpenBSD/m88k a.out binaries.
+   Copyright 2004 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	TARGET_IS_BIG_ENDIAN_P
+
+#define	TARGET_PAGE_SIZE	4096
+
+#define	DEFAULT_ARCH		bfd_arch_m88k
+#define	DEFAULT_MID		M_88K_OPENBSD
+
+/* Do not "beautify" the CONCAT* macro args.  Traditional C will not
+   remove whitespace added here, and thus will fail to concatenate
+   the tokens.  */
+#define MY(OP) CONCAT2 (m88kopenbsd_,OP)
+#define TARGETNAME "a.out-m88k-openbsd"
+
+#include "netbsd.h"
diff --git a/bfd/mach-o.c b/bfd/mach-o.c
index b5d6a72..194898c 100644
--- a/bfd/mach-o.c
+++ b/bfd/mach-o.c
@@ -1,5 +1,5 @@
 /* Mach-O support for BFD.
-   Copyright 1999, 2000, 2001, 2002, 2003
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -68,7 +68,9 @@
 #define bfd_mach_o_set_section_contents _bfd_generic_set_section_contents
 #define bfd_mach_o_bfd_gc_sections bfd_generic_gc_sections
 #define bfd_mach_o_bfd_merge_sections bfd_generic_merge_sections
+#define bfd_mach_o_bfd_is_group_section bfd_generic_is_group_section
 #define bfd_mach_o_bfd_discard_group bfd_generic_discard_group
+#define bfd_mach_o_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
 
 static bfd_boolean bfd_mach_o_bfd_copy_private_symbol_data
   PARAMS ((bfd *, asymbol *, bfd *, asymbol *));
@@ -582,7 +584,7 @@
 
   bfdsec->vma = section->addr;
   bfdsec->lma = section->addr;
-  bfdsec->_raw_size = section->size;
+  bfdsec->size = section->size;
   bfdsec->filepos = section->offset;
   bfdsec->alignment_power = section->align;
 
@@ -1030,7 +1032,7 @@
 
   bfdsec->vma = 0;
   bfdsec->lma = 0;
-  bfdsec->_raw_size = command->len - 8;
+  bfdsec->size = command->len - 8;
   bfdsec->filepos = command->offset + 8;
   bfdsec->alignment_power = 0;
   bfdsec->flags = SEC_HAS_CONTENTS;
@@ -1088,7 +1090,7 @@
 
   bfdsec->vma = 0;
   bfdsec->lma = 0;
-  bfdsec->_raw_size = command->len - 8;
+  bfdsec->size = command->len - 8;
   bfdsec->filepos = command->offset + 8;
   bfdsec->alignment_power = 0;
   bfdsec->flags = SEC_HAS_CONTENTS;
@@ -1211,7 +1213,7 @@
 
       bfdsec->vma = 0;
       bfdsec->lma = 0;
-      bfdsec->_raw_size = cmd->flavours[i].size;
+      bfdsec->size = cmd->flavours[i].size;
       bfdsec->filepos = cmd->flavours[i].offset;
       bfdsec->alignment_power = 0x0;
       bfdsec->flags = SEC_HAS_CONTENTS;
@@ -1318,7 +1320,7 @@
 
   bfdsec->vma = 0;
   bfdsec->lma = 0;
-  bfdsec->_raw_size = seg->nsyms * 12;
+  bfdsec->size = seg->nsyms * 12;
   bfdsec->filepos = seg->symoff;
   bfdsec->alignment_power = 0;
   bfdsec->flags = SEC_HAS_CONTENTS;
@@ -1337,7 +1339,7 @@
 
   bfdsec->vma = 0;
   bfdsec->lma = 0;
-  bfdsec->_raw_size = seg->strsize;
+  bfdsec->size = seg->strsize;
   bfdsec->filepos = seg->stroff;
   bfdsec->alignment_power = 0;
   bfdsec->flags = SEC_HAS_CONTENTS;
@@ -1388,7 +1390,7 @@
 
   bfdsec->vma = seg->vmaddr;
   bfdsec->lma = seg->vmaddr;
-  bfdsec->_raw_size = seg->filesize;
+  bfdsec->size = seg->filesize;
   bfdsec->filepos = seg->fileoff;
   bfdsec->alignment_power = 0x0;
   bfdsec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_CODE;
diff --git a/bfd/merge.c b/bfd/merge.c
index 89f45cd..eb8ec66 100644
--- a/bfd/merge.c
+++ b/bfd/merge.c
@@ -1,5 +1,5 @@
 /* SEC_MERGE support.
-   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Written by Jakub Jelinek <jakub@redhat.com>.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -90,7 +90,7 @@
   /* A hash table used to hold section content.  */
   struct sec_merge_hash *htab;
   /* First string in this section.  */
-  struct sec_merge_hash_entry *first;
+  struct sec_merge_hash_entry *first_str;
   /* Original section content.  */
   unsigned char contents[1];
 };
@@ -102,30 +102,28 @@
 sec_merge_hash_newfunc (struct bfd_hash_entry *entry,
 			struct bfd_hash_table *table, const char *string)
 {
-  struct sec_merge_hash_entry *ret = (struct sec_merge_hash_entry *) entry;
-
   /* Allocate the structure if it has not already been allocated by a
      subclass.  */
-  if (ret == (struct sec_merge_hash_entry *) NULL)
-    ret = ((struct sec_merge_hash_entry *)
-	   bfd_hash_allocate (table, sizeof (struct sec_merge_hash_entry)));
-  if (ret == (struct sec_merge_hash_entry *) NULL)
+  if (entry == NULL)
+    entry = bfd_hash_allocate (table, sizeof (struct sec_merge_hash_entry));
+  if (entry == NULL)
     return NULL;
 
   /* Call the allocation method of the superclass.  */
-  ret = ((struct sec_merge_hash_entry *)
-	 bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string));
+  entry = bfd_hash_newfunc (entry, table, string);
 
-  if (ret)
+  if (entry != NULL)
     {
       /* Initialize the local fields.  */
+      struct sec_merge_hash_entry *ret = (struct sec_merge_hash_entry *) entry;
+
       ret->u.suffix = NULL;
       ret->alignment = 0;
       ret->secinfo = NULL;
       ret->next = NULL;
     }
 
-  return (struct bfd_hash_entry *) ret;
+  return entry;
 }
 
 /* Look up an entry in a section merge hash table.  */
@@ -192,7 +190,7 @@
 
   index = hash % table->table.size;
   for (hashp = (struct sec_merge_hash_entry *) table->table.table[index];
-       hashp != (struct sec_merge_hash_entry *) NULL;
+       hashp != NULL;
        hashp = (struct sec_merge_hash_entry *) hashp->root.next)
     {
       if (hashp->root.hash == hash
@@ -216,13 +214,12 @@
     }
 
   if (! create)
-    return (struct sec_merge_hash_entry *) NULL;
+    return NULL;
 
-  hashp = (struct sec_merge_hash_entry *)
-	  sec_merge_hash_newfunc ((struct bfd_hash_entry *) NULL,
-				  (struct bfd_hash_table *) table, string);
-  if (hashp == (struct sec_merge_hash_entry *) NULL)
-    return (struct sec_merge_hash_entry *) NULL;
+  hashp = ((struct sec_merge_hash_entry *)
+	   sec_merge_hash_newfunc (NULL, &table->table, string));
+  if (hashp == NULL)
+    return NULL;
   hashp->root.string = string;
   hashp->root.hash = hash;
   hashp->len = len;
@@ -239,9 +236,8 @@
 sec_merge_init (unsigned int entsize, bfd_boolean strings)
 {
   struct sec_merge_hash *table;
-  bfd_size_type amt = sizeof (struct sec_merge_hash);
 
-  table = (struct sec_merge_hash *) bfd_malloc (amt);
+  table = bfd_malloc (sizeof (struct sec_merge_hash));
   if (table == NULL)
     return NULL;
 
@@ -294,7 +290,7 @@
   asection *sec = secinfo->sec;
   char *pad = "";
   bfd_size_type off = 0;
-  int alignment_power = bfd_get_section_alignment (abfd, sec->output_section);
+  int alignment_power = sec->output_section->alignment_power;
 
   if (alignment_power)
     pad = bfd_zmalloc ((bfd_size_type) 1 << alignment_power);
@@ -308,7 +304,7 @@
       if (len)
 	{
 	  len = entry->alignment - len;
-	  if (bfd_bwrite (pad, (bfd_size_type) len, abfd) != len)
+	  if (bfd_bwrite (pad, len, abfd) != len)
 	    break;
 	  off += len;
 	}
@@ -316,7 +312,7 @@
       str = entry->root.string;
       len = entry->len;
 
-      if (bfd_bwrite (str, (bfd_size_type) len, abfd) != len)
+      if (bfd_bwrite (str, len, abfd) != len)
 	break;
 
       off += len;
@@ -328,20 +324,24 @@
   return entry == NULL || entry->secinfo != secinfo;
 }
 
-/* This function is called for each input file from the add_symbols
-   pass of the linker.  */
+/* Register a SEC_MERGE section as a candidate for merging.
+   This function is called for all non-dynamic SEC_MERGE input sections.  */
 
 bfd_boolean
-_bfd_merge_section (bfd *abfd, void **psinfo, asection *sec, void **psecinfo)
+_bfd_add_merge_section (bfd *abfd, void **psinfo, asection *sec,
+			void **psecinfo)
 {
   struct sec_merge_info *sinfo;
   struct sec_merge_sec_info *secinfo;
   unsigned int align;
   bfd_size_type amt;
 
-  if (sec->_raw_size == 0
-      || (sec->flags & SEC_EXCLUDE)
-      || (sec->flags & SEC_MERGE) == 0
+  if ((abfd->flags & DYNAMIC) != 0
+      || (sec->flags & SEC_MERGE) == 0)
+    abort ();
+
+  if (sec->size == 0
+      || (sec->flags & SEC_EXCLUDE) != 0
       || sec->entsize == 0)
     return TRUE;
 
@@ -351,12 +351,12 @@
       return TRUE;
     }
 
-  align = bfd_get_section_alignment (sec->owner, sec);
-  if ((sec->entsize < (unsigned int)(1 << align)
+  align = sec->alignment_power;
+  if ((sec->entsize < (unsigned) 1 << align
        && ((sec->entsize & (sec->entsize - 1))
 	   || !(sec->flags & SEC_STRINGS)))
-      || (sec->entsize > (unsigned int)(1 << align)
-	  && (sec->entsize & ((1 << align) - 1))))
+      || (sec->entsize > (unsigned) 1 << align
+	  && (sec->entsize & (((unsigned) 1 << align) - 1))))
     {
       /* Sanity check.  If string character size is smaller than
 	 alignment, then we require character size to be a power
@@ -371,14 +371,14 @@
     if ((secinfo = sinfo->chain)
 	&& ! ((secinfo->sec->flags ^ sec->flags) & (SEC_MERGE | SEC_STRINGS))
 	&& secinfo->sec->entsize == sec->entsize
-	&& ! strcmp (secinfo->sec->name, sec->name))
+	&& secinfo->sec->alignment_power == sec->alignment_power
+	&& secinfo->sec->output_section == sec->output_section)
       break;
 
   if (sinfo == NULL)
     {
       /* Initialize the information we need to keep track of.  */
-      amt = sizeof (struct sec_merge_info);
-      sinfo = (struct sec_merge_info *) bfd_alloc (abfd, amt);
+      sinfo = bfd_alloc (abfd, sizeof (struct sec_merge_info));
       if (sinfo == NULL)
 	goto error_return;
       sinfo->next = (struct sec_merge_info *) *psinfo;
@@ -391,12 +391,12 @@
 
   /* Read the section from abfd.  */
 
-  amt = sizeof (struct sec_merge_sec_info) + sec->_raw_size - 1;
+  amt = sizeof (struct sec_merge_sec_info) + sec->size - 1;
   *psecinfo = bfd_alloc (abfd, amt);
   if (*psecinfo == NULL)
     goto error_return;
 
-  secinfo = (struct sec_merge_sec_info *)*psecinfo;
+  secinfo = (struct sec_merge_sec_info *) *psecinfo;
   if (sinfo->chain)
     {
       secinfo->next = sinfo->chain->next;
@@ -408,10 +408,11 @@
   secinfo->sec = sec;
   secinfo->psecinfo = psecinfo;
   secinfo->htab = sinfo->htab;
-  secinfo->first = NULL;
+  secinfo->first_str = NULL;
 
+  sec->rawsize = sec->size;
   if (! bfd_get_section_contents (sec->owner, sec, secinfo->contents,
-				  (bfd_vma) 0, sec->_raw_size))
+				  0, sec->size))
     goto error_return;
 
   return TRUE;
@@ -433,8 +434,8 @@
   bfd_vma mask, eltalign;
   unsigned int align, i;
 
-  align = bfd_get_section_alignment (sec->owner, sec);
-  end = secinfo->contents + sec->_raw_size;
+  align = sec->alignment_power;
+  end = secinfo->contents + sec->size;
   nul = FALSE;
   mask = ((bfd_vma) 1 << align) - 1;
   if (sec->flags & SEC_STRINGS)
@@ -580,7 +581,7 @@
 
   /* Now sort the strings */
   amt = sinfo->htab->size * sizeof (struct sec_merge_hash_entry *);
-  array = (struct sec_merge_hash_entry **) bfd_malloc (amt);
+  array = bfd_malloc (amt);
   if (array == NULL)
     goto alloc_failure;
 
@@ -638,14 +639,14 @@
     {
       if (e->secinfo != secinfo)
 	{
-	  secinfo->sec->_cooked_size = size;
+	  secinfo->sec->size = size;
 	  secinfo = e->secinfo;
 	}
       if (e->alignment)
 	{
-	  if (e->secinfo->first == NULL)
+	  if (e->secinfo->first_str == NULL)
 	    {
-	      e->secinfo->first = e;
+	      e->secinfo->first_str = e;
 	      size = 0;
 	    }
 	  size = (size + e->alignment - 1) & ~((bfd_vma) e->alignment - 1);
@@ -653,7 +654,7 @@
 	  size += e->len;
 	}
     }
-  secinfo->sec->_cooked_size = size;
+  secinfo->sec->size = size;
 
   /* And now adjust the rest, removing them from the chain (but not hashtable)
      at the same time.  */
@@ -676,8 +677,8 @@
    with _bfd_merge_section.  */
 
 bfd_boolean
-_bfd_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, void *xsinfo,
-		     void (*remove_hook) (bfd *, asection *))
+_bfd_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info,
+		     void *xsinfo, void (*remove_hook) (bfd *, asection *))
 {
   struct sec_merge_info *sinfo;
 
@@ -722,11 +723,11 @@
 	  secinfo = NULL;
 	  for (e = sinfo->htab->first; e; e = e->next)
 	    {
-	      if (e->secinfo->first == NULL)
+	      if (e->secinfo->first_str == NULL)
 		{
 		  if (secinfo)
-		    secinfo->sec->_cooked_size = size;
-		  e->secinfo->first = e;
+		    secinfo->sec->size = size;
+		  e->secinfo->first_str = e;
 		  size = 0;
 		}
 	      size = (size + e->alignment - 1)
@@ -735,17 +736,14 @@
 	      size += e->len;
 	      secinfo = e->secinfo;
 	    }
-	  secinfo->sec->_cooked_size = size;
+	  secinfo->sec->size = size;
 	}
 
 	/* Finally remove all input sections which have not made it into
 	   the hash table at all.  */
 	for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next)
-	  if (secinfo->first == NULL)
-	    {
-	      secinfo->sec->_cooked_size = 0;
-	      secinfo->sec->flags |= SEC_EXCLUDE;
-	    }
+	  if (secinfo->first_str == NULL)
+	    _bfd_strip_section_from_output (info, secinfo->sec);
     }
 
   return TRUE;
@@ -761,14 +759,14 @@
 
   secinfo = (struct sec_merge_sec_info *) psecinfo;
 
-  if (!secinfo->first)
+  if (secinfo->first_str == NULL)
     return TRUE;
 
   pos = sec->output_section->filepos + sec->output_offset;
   if (bfd_seek (output_bfd, pos, SEEK_SET) != 0)
     return FALSE;
 
-  if (! sec_merge_emit (output_bfd, secinfo->first))
+  if (! sec_merge_emit (output_bfd, secinfo->first_str))
     return FALSE;
 
   return TRUE;
@@ -780,7 +778,7 @@
 
 bfd_vma
 _bfd_merged_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, asection **psec,
-			    void *psecinfo, bfd_vma offset, bfd_vma addend)
+			    void *psecinfo, bfd_vma offset)
 {
   struct sec_merge_sec_info *secinfo;
   struct sec_merge_hash_entry *entry;
@@ -789,30 +787,29 @@
 
   secinfo = (struct sec_merge_sec_info *) psecinfo;
 
-  if (offset + addend >= sec->_raw_size)
+  if (offset >= sec->rawsize)
     {
-      if (offset + addend > sec->_raw_size)
+      if (offset > sec->rawsize)
 	{
 	  (*_bfd_error_handler)
-	    (_("%s: access beyond end of merged section (%ld + %ld)"),
-	     bfd_get_filename (sec->owner), (long) offset, (long) addend);
+	    (_("%s: access beyond end of merged section (%ld)"),
+	     bfd_get_filename (sec->owner), (long) offset);
 	}
-      return (secinfo->first ? sec->_cooked_size : 0);
+      return secinfo->first_str ? sec->size : 0;
     }
 
   if (secinfo->htab->strings)
     {
       if (sec->entsize == 1)
 	{
-	  p = secinfo->contents + offset + addend - 1;
+	  p = secinfo->contents + offset - 1;
 	  while (p >= secinfo->contents && *p)
 	    --p;
 	  ++p;
 	}
       else
 	{
-	  p = secinfo->contents
-	      + ((offset + addend) / sec->entsize) * sec->entsize;
+	  p = secinfo->contents + (offset / sec->entsize) * sec->entsize;
 	  p -= sec->entsize;
 	  while (p >= secinfo->contents)
 	    {
@@ -830,8 +827,7 @@
     }
   else
     {
-      p = secinfo->contents
-	  + ((offset + addend) / sec->entsize) * sec->entsize;
+      p = secinfo->contents + (offset / sec->entsize) * sec->entsize;
     }
   entry = sec_merge_hash_lookup (secinfo->htab, p, 0, FALSE);
   if (!entry)
@@ -845,9 +841,8 @@
       if (! secinfo->htab->first)
 	abort ();
       entry = secinfo->htab->first;
-      p = secinfo->contents
-	  + ((offset + addend) / sec->entsize + 1) * sec->entsize
-	  - entry->len;
+      p = (secinfo->contents + (offset / sec->entsize + 1) * sec->entsize
+	   - entry->len);
     }
 
   *psec = entry->secinfo->sec;
diff --git a/bfd/mmo.c b/bfd/mmo.c
index 74b4c9d..0324462 100644
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -1,5 +1,5 @@
 /* BFD back-end for mmo objects (MMIX-specific object-format).
-   Copyright 2001, 2002, 2003
+   Copyright 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Hans-Peter Nilsson (hp@bitrange.com).
    Infrastructure and other bits originally copied from srec.c and
@@ -665,7 +665,7 @@
       !=  (SEC_LOAD | SEC_ALLOC))
     return;
 
-  if (infop->addr >= vma && infop->addr < vma + sec->_raw_size)
+  if (infop->addr >= vma && infop->addr < vma + sec->size)
     infop->sec = sec;
 }
 
@@ -1168,8 +1168,7 @@
 			       bfd_sec_flags_from_mmo_flags (flags)
 			       | bfd_get_section_flags (abfd, sec)
 			       | (section_length != 0 ? SEC_HAS_CONTENTS : 0))
-      || ! bfd_set_section_size (abfd, sec,
-				 sec->_cooked_size + section_length)
+      || ! bfd_set_section_size (abfd, sec, sec->size + section_length)
       /* Set VMA only for the first occurrence.  */
       || (! sec->user_set_vma
 	  && ! bfd_set_section_vma  (abfd, sec, section_vma)))
@@ -1545,8 +1544,8 @@
 	     non-32-bit-aligned sections should do all allocation and
 	     size-setting by themselves or at least set the section size
 	     after the last allocating call to this function.  */
-	  if (vma + size > sec->vma + sec->_raw_size)
-	    sec->_raw_size += (vma + size) - (sec->vma + sec->_raw_size);
+	  if (vma + size > sec->vma + sec->size)
+	    sec->size += (vma + size) - (sec->vma + sec->size);
 
 	  return datap->data + vma - datap->where;
 	}
@@ -1608,8 +1607,8 @@
 
   /* Update the section size.  This happens only when we add contents and
      re-size as we go.  The section size will then be aligned to 32 bits.  */
-  if (vma + size > sec->vma + sec->_raw_size)
-    sec->_raw_size += (vma + size) - (sec->vma + sec->_raw_size);
+  if (vma + size > sec->vma + sec->size)
+    sec->size += (vma + size) - (sec->vma + sec->size);
   return entry->data;
 }
 
@@ -1621,7 +1620,6 @@
      asection *sec;
      PTR ignored ATTRIBUTE_UNUSED;
 {
-  sec->_cooked_size = sec->_raw_size;
   sec->lma = sec->vma;
 }
 
@@ -2269,7 +2267,7 @@
 
 	      if (textsec != NULL
 		  && c->value >= textsec->vma
-		  && c->value <= textsec->vma + textsec->_cooked_size)
+		  && c->value <= textsec->vma + textsec->size)
 		{
 		  c->section = textsec;
 		  c->value -= c->section->vma;
@@ -2486,7 +2484,7 @@
   /* Ignore sections that are just allocated or empty; we write out
      _contents_ here.  */
   else if ((bfd_get_section_flags (abfd, sec) & SEC_HAS_CONTENTS) != 0
-	   && sec->_raw_size != 0)
+	   && sec->size != 0)
     {
       /* Keep the document-comment formatted the way it is.  */
 /*
@@ -2592,7 +2590,7 @@
       mmo_write_tetra (abfd,
 		       mmo_sec_flags_from_bfd_flags
 		       (bfd_get_section_flags (abfd, sec)));
-      mmo_write_octa (abfd, sec->_raw_size);
+      mmo_write_octa (abfd, sec->size);
       mmo_write_octa (abfd, bfd_get_section_vma (abfd, sec));
 
       /* Writing a LOP_LOC ends the LOP_SPEC data, and makes data actually
@@ -3181,11 +3179,11 @@
 	 of the register contents section and check that it corresponds to
 	 the length of the section.  */
       if (z < 32 || z >= 255 || (sec->vma & 7) != 0
-	  || sec->vma != 256 * 8 - sec->_raw_size - 8)
+	  || sec->vma != 256 * 8 - sec->size - 8)
 	{
 	  bfd_set_error (bfd_error_bad_value);
 
-	  if (sec->_raw_size == 0)
+	  if (sec->size == 0)
 	    /* There must always be at least one such register.  */
 	    (*_bfd_error_handler)
 	      (_("%s: no initialized registers; section length 0\n"),
@@ -3196,13 +3194,13 @@
 	    (*_bfd_error_handler)
 	      (_("%s: too many initialized registers; section length %ld\n"),
 	       bfd_get_filename (abfd),
-	       (long) sec->_raw_size);
+	       (long) sec->size);
 	  else
 	    (*_bfd_error_handler)
 	      (_("%s: invalid start address for initialized registers of\
  length %ld: 0x%lx%08lx\n"),
 	       bfd_get_filename (abfd),
-	       (long) sec->_raw_size,
+	       (long) sec->size,
 	       (unsigned long) (sec->vma >> 32), (unsigned long) (sec->vma));
 
 	  return FALSE;
@@ -3286,6 +3284,7 @@
 #define mmo_set_arch_mach bfd_default_set_arch_mach
 #define mmo_bfd_relax_section bfd_generic_relax_section
 #define mmo_bfd_merge_sections bfd_generic_merge_sections
+#define mmo_bfd_is_group_section bfd_generic_is_group_section
 #define mmo_bfd_discard_group bfd_generic_discard_group
 
 /* objcopy will be upset if we return -1 from bfd_get_reloc_upper_bound by
@@ -3305,6 +3304,7 @@
 #define mmo_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
 #define mmo_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data
 #define mmo_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
+#define mmo_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
 #define mmo_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
 #define mmo_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
 
diff --git a/bfd/mpw-config.in b/bfd/mpw-config.in
deleted file mode 100644
index 31addee..0000000
--- a/bfd/mpw-config.in
+++ /dev/null
@@ -1,86 +0,0 @@
-# Configuration fragment for BFD.
-
-# This is almost always correct.
-
-Set selarchs "&bfd_{target_cpu}_arch"
-Set defvec ""
-Set selvecs ""
-Set havevecs ""
-
-If "{target_canonical}" =~ /m68k-apple-macos/
-	Set BFD_BACKENDS '"{o}"coff-m68k.c.o "{o}"cofflink.c.o'
-	Set defvec m68kcoff_vec
-	Set selvecs '&m68kcoff_vec'
-	Set havevecs '-d HAVE_m68kcoff_vec'
-
-Else If "{target_canonical}" =~ /powerpc-apple-macos/
-	Set BFD_BACKENDS '"{o}"coff-pmac.c.o "{o}"xcofflink.c.o'
-	Set defvec pmac_xcoff_vec
-	Set selvecs '&pmac_xcoff_vec'
-	Set havevecs '-d HAVE_pmac_xcoff_vec'
-	Set selarchs "&bfd_powerpc_arch"
-
-Else If "{target_canonical}" =~ /i386-\Option-x-go32/
-	Set BFD_BACKENDS '"{o}"coff-i386.c.o'
-	Set defvec i386coff_vec
-	Set selvecs '&i386coff_vec'
-	Set havevecs '-d HAVE_i386coff_vec'
-
-Else If "{target_canonical}" =~ /mips-\Option-x-\Option-x/
-	Set BFD_BACKENDS '"{o}"coff-mips.c.o "{o}"ecoff.c.o "{o}"ecofflink.c.o "{o}"elf32.c.o "{o}"elf32-mips.c.o "{o}"elflink.c.o'
-	Set defvec ecoff_big_vec
-	Set selvecs '&ecoff_big_vec,&ecoff_little_vec,&bfd_elf32_bigmips_vec'
-	Set havevecs '-d HAVE_ecoff_big_vec -d HAVE_ecoff_little_vec -d HAVE_bfd_elf32_bigmips_vec'
-
-Else If "{target_canonical}" =~ /sh-\Option-x-hms/
-	Set BFD_BACKENDS '"{o}"coff-sh.c.o "{o}"cofflink.c.o'
-	Set defvec shcoff_vec
-	Set selvecs '&shcoff_vec,&shlcoff_vec'
-	Set havevecs '-d HAVE_shcoff_vec -d HAVE_shlcoff_vec'
-End If
-
-Set ta `echo {selarchs} | sed -e 's/&bfd_/{o}cpu-/g' -e 's/_arch/.c.o/g'`
-
-Set tdefaults "-d DEFAULT_VECTOR={defvec} -d SELECT_VECS={selvecs} -d SELECT_ARCHITECTURES={selarchs} {havevecs}"
-
-Echo '# From mpw-config.in'				 > "{o}"mk.tmp
-Echo 'WORDSIZE = 32'					>> "{o}"mk.tmp
-Echo 'BFD_MACHINES = ' {ta}				>> "{o}"mk.tmp
-Echo 'BFD_BACKENDS = ' {BFD_BACKENDS}			>> "{o}"mk.tmp
-Echo 'TDEFAULTS = ' {tdefaults}				>> "{o}"mk.tmp
-Echo 'HDEPFILES = '					>> "{o}"mk.tmp
-Echo 'TDEPFILES = '					>> "{o}"mk.tmp
-Echo '# End from mpw-config.in'				>> "{o}"mk.tmp
-
-Echo '/* config.h.  Generated by mpw-configure.  */'	 > "{o}"config.new
-Echo '#include "mpw.h"'					>> "{o}"config.new
-
-MoveIfChange "{o}"config.new "{o}"config.h
-
-# We can only handle 32-bit targets right now.
-
-sed -e 's/@WORDSIZE@/32/' \Option-d
-    -e 's/@wordsize@/32/' \Option-d
-    -e "s/@VERSION@/`Catenate {srcdir}VERSION`/" \Option-d
-    -e 's/@BFD_HOST_64_BIT_DEFINED@/0/' \Option-d
-    -e 's/@BFD_HOST_64_BIT@//' \Option-d
-    -e 's/@BFD_HOST_U_64_BIT@//' \Option-d
-    -e 's/@BFD_HOST_64BIT_LONG@/0/' \Option-d
-    "{srcdir}"bfd-in2.h >"{o}"bfd.h-new
-
-MoveIfChange "{o}"bfd.h-new "{o}"bfd.h
-
-sed -e 's/NN/32/g' "{srcdir}"elfxx-target.h >"{o}"elf32-target.h-new
-MoveIfChange "{o}"elf32-target.h-new "{o}"elf32-target.h
-
-# Pre-expand some macros in coffswap.h, so MPW C doesn't choke.
-
-sed -e 's/^  PUT_AOUTHDR_TSIZE (/  bfd_h_put_32 (/' \Option-d
-    -e 's/^  PUT_AOUTHDR_DSIZE (/  bfd_h_put_32 (/' \Option-d
-    -e 's/^  PUT_AOUTHDR_BSIZE (/  bfd_h_put_32 (/' \Option-d
-    -e 's/^  PUT_AOUTHDR_ENTRY (/  bfd_h_put_32 (/' \Option-d
-    -e 's/^  PUT_AOUTHDR_TEXT_START (/  bfd_h_put_32 (/' \Option-d
-    -e 's/^  PUT_AOUTHDR_DATA_START (/  bfd_h_put_32 (/' \Option-d
-    "{srcdir}"coffswap.h >"{o}"coffswap.h-new
-
-MoveIfChange "{o}"coffswap.h-new "{o}"coffswap.h
diff --git a/bfd/mpw-make.sed b/bfd/mpw-make.sed
deleted file mode 100644
index b2463c7..0000000
--- a/bfd/mpw-make.sed
+++ /dev/null
@@ -1,81 +0,0 @@
-# Sed commands to finish translating the Unix BFD Makefile into MPW syntax.
-
-# Whack out unused host and target define bits.
-/HDEFINES/s/@HDEFINES@//
-/TDEFINES/s/@TDEFINES@//
-
-# Fix pathnames to include directories.
-/^INCDIR = /s/^INCDIR = .*$/INCDIR = "{topsrcdir}"include/
-/^CSEARCH = /s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/
-
-# Comment out setting of vars, configure script will add these itself.
-/^WORDSIZE =/s/^/#/
-# /^ALL_BACKENDS/s/^/#/
-/^BFD_BACKENDS/s/^/#/
-/^BFD_MACHINES/s/^/#/
-/^TDEFAULTS/s/^/#/
-
-# Remove extra, useless, "all".
-/^all \\Option-f _oldest/,/^$/d
-
-# Remove the Makefile rebuild rule.
-/^Makefile /,/--recheck/d
-
-# Don't do any recursive subdir stuff.
-/ subdir_do/s/{MAKE}/null-command/
-
-/BFD_H/s/^{BFD_H}/#{BFD_H}/
-
-# Add explicit srcdir paths to special files.
-/config.bfd/s/ config.bfd/ "{s}"config.bfd/g
-/targmatch.sed/s/ targmatch.sed/ "{s}"targmatch.sed/g
-
-# Point at include files that are always in the objdir.
-/bfd/s/"{s}"bfd\.h/"{o}"bfd.h/g
-/config/s/"{s}"config\.h/"{o}"config.h/g
-/targmatch/s/"{s}"targmatch\.h/"{o}"targmatch.h/g
-/targmatch/s/^targmatch\.h/"{o}"targmatch.h/
-/elf32-target/s/"{s}"elf32-target\.h/"{o}"elf32-target.h/g
-/elf32-target/s/^elf32-target\.h/"{o}"elf32-target.h/
-/elf64-target/s/"{s}"elf64-target\.h/"{o}"elf64-target.h/g
-/elf64-target/s/^elf64-target\.h/"{o}"elf64-target.h/
-
-/"{s}"{INCDIR}/s/"{s}"{INCDIR}/"{INCDIR}"/g
-
-/dep/s/\.dep/__dep/g
-
-# Removing duplicates is cool but presently unnecessary,
-# so whack this out.
-/^ofiles \\Option-f/,/^$/d
-/ofiles/s/{OFILES} ofiles/{OFILES}/
-/echo ofiles = /d
-/cat ofiles/s/`cat ofiles`/{OFILES}/
-
-# No corefile support.
-/COREFILE/s/@COREFILE@//
-/COREFLAG/s/@COREFLAG@//
-
-# No PIC foolery in this environment.
-/@ALLLIBS@/s/@ALLLIBS@/{TARGETLIB}/
-/@PICLIST@/s/@PICLIST@//
-/@PICFLAG@/s/@PICFLAG@//
-/^{OFILES} \\Option-f stamp-picdir/,/^$/d
-
-# Remove the pic trickery from the default build rule.
-/^\.c\.o \\Option-f /,/End If/c\
-.c.o \\Option-f .c
-
-# MPW Make doesn't know about $<.
-/"{o}"targets.c.o \\Option-f "{s}"targets.c Makefile/,/^$/c\
-"{o}"targets.c.o \\Option-f "{s}"targets.c Makefile\
-	{CC} @DASH_C_FLAG@ {ALL_CFLAGS} {TDEFAULTS} "{s}"targets.c -o "{o}"targets.c.o
-
-/"{o}"archures.c.o \\Option-f "{s}"archures.c Makefile/,/^$/c\
-"{o}"archures.c.o \\Option-f "{s}"archures.c Makefile\
-	{CC} @DASH_C_FLAG@ {ALL_CFLAGS} {TDEFAULTS} "{s}"archures.c -o "{o}"archures.c.o
-
-# Remove the .h rebuilding rules, we don't currently have a doc subdir,
-# or a way to build the prototype-hacking tool that's in it.
-/^"{srcdir}"bfd-in2.h \\Option-f /,/^$/d
-/^"{srcdir}"libbfd.h \\Option-f /,/^$/d
-/^"{srcdir}"libcoff.h \\Option-f /,/^$/d
diff --git a/bfd/netbsd-core.c b/bfd/netbsd-core.c
index 250c6f4..6c43e9e 100644
--- a/bfd/netbsd-core.c
+++ b/bfd/netbsd-core.c
@@ -34,6 +34,10 @@
    NetBSD/sparc64 overlaps with M_MIPS1.  */
 #define M_SPARC64_OPENBSD	M_MIPS1
 
+/* Offset of StackGhost cookie within `struct md_coredump' on
+   OpenBSD/sparc.  */
+#define CORE_WCOOKIE_OFFSET	344
+
 struct netbsd_core_struct
 {
   struct core core;
@@ -135,35 +139,84 @@
 	goto punt;
 
       asect->flags = flags;
-      asect->_raw_size = coreseg.c_size;
+      asect->size = coreseg.c_size;
       asect->vma = coreseg.c_addr;
       asect->filepos = offset;
       asect->alignment_power = 2;
 
+      if (CORE_GETMID (core) == M_SPARC_NETBSD
+	  && CORE_GETFLAG (coreseg) == CORE_CPU
+	  && coreseg.c_size > CORE_WCOOKIE_OFFSET)
+	{
+	  /* Truncate the .reg section.  */
+	  asect->size = CORE_WCOOKIE_OFFSET;
+
+	  /* And create the .wcookie section.  */
+	  asect = bfd_make_section_anyway (abfd, ".wcookie");
+	  if (asect == NULL)
+	    goto punt;
+
+	  asect->flags = SEC_ALLOC + SEC_HAS_CONTENTS;
+	  asect->size = 4;
+	  asect->vma = 0;
+	  asect->filepos = offset + CORE_WCOOKIE_OFFSET;
+	  asect->alignment_power = 2;
+	}
+
       offset += coreseg.c_size;
     }
 
- /* Set architecture from machine ID.  */
- switch (CORE_GETMID (core))
-   {
-   case M_X86_64_NETBSD:
-     bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x86_64);
-     break;
+  /* Set architecture from machine ID.  */
+  switch (CORE_GETMID (core))
+    {
+    case M_ALPHA_NETBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_alpha, 0);
+      break;
 
-   case M_386_NETBSD:
-     bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_i386_i386);
-     break;
+    case M_ARM6_NETBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_arm, bfd_mach_arm_3);
+      break;
 
-   case M_SPARC_NETBSD:
-     bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc);
-     break;
+    case M_X86_64_NETBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x86_64);
+      break;
 
-   case M_SPARC64_NETBSD:
-   case M_SPARC64_OPENBSD:
-     bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc_v9);
-     break;
-   }
- 
+    case M_386_NETBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_i386_i386);
+      break;
+
+    case M_68K_NETBSD:
+    case M_68K4K_NETBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_m68k, 0);
+      break;
+
+    case M_88K_OPENBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_m88k, 0);
+      break;
+
+    case M_HPPA_OPENBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_hppa, bfd_mach_hppa11);
+      break;
+
+    case M_POWERPC_NETBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_powerpc, bfd_mach_ppc);
+      break;
+
+    case M_SPARC_NETBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc);
+      break;
+
+    case M_SPARC64_NETBSD:
+    case M_SPARC64_OPENBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc_v9);
+      break;
+
+    case M_VAX_NETBSD:
+    case M_VAX4K_NETBSD:
+      bfd_default_set_arch_mach (abfd, bfd_arch_vax, 0);
+      break;
+    }
+
   /* OK, we believe you.  You're a core file (sure, sure).  */
   return abfd->xvec;
 
diff --git a/bfd/nlm-target.h b/bfd/nlm-target.h
index 70ae4f4..cf84000 100644
--- a/bfd/nlm-target.h
+++ b/bfd/nlm-target.h
@@ -1,5 +1,5 @@
 /* Target definitions for 32/64-bit NLM (NetWare Loadable Module)
-   Copyright 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003
+   Copyright 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -44,6 +44,7 @@
 #define nlm_bfd_relax_section bfd_generic_relax_section
 #define nlm_bfd_gc_sections bfd_generic_gc_sections
 #define nlm_bfd_merge_sections bfd_generic_merge_sections
+#define nlm_bfd_is_group_section bfd_generic_is_group_section
 #define nlm_bfd_discard_group bfd_generic_discard_group
 #define nlm_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define nlm_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
diff --git a/bfd/nlm32-alpha.c b/bfd/nlm32-alpha.c
index 990ce8d..3bf597b 100644
--- a/bfd/nlm32-alpha.c
+++ b/bfd/nlm32-alpha.c
@@ -1,5 +1,5 @@
 /* Support for 32-bit Alpha NLM (NetWare Loadable Module)
-   Copyright 1993, 1994, 2000, 2001, 2002, 2003
+   Copyright 1993, 1994, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
@@ -490,7 +490,7 @@
      or .data section.  R_NW_RELOC relocs don't really have a section,
      so we put them in .text.  */
   if (r_type == ALPHA_R_NW_RELOC
-      || r_vaddr < bfd_section_size (abfd, code_sec))
+      || r_vaddr < code_sec->size)
     {
       *secp = code_sec;
       rel->address = r_vaddr;
@@ -498,7 +498,7 @@
   else
     {
       *secp = data_sec;
-      rel->address = r_vaddr - bfd_section_size (abfd, code_sec);
+      rel->address = r_vaddr - code_sec->size;
     }
 
   /* We must adjust the addend based on the type.  */
@@ -689,9 +689,7 @@
     {
       r_vaddr = bfd_get_section_vma (abfd, sec) + rel->address;
       if ((sec->flags & SEC_CODE) == 0)
-	r_vaddr += bfd_section_size (abfd,
-				     bfd_get_section_by_name (abfd,
-							      NLM_CODE_NAME));
+	r_vaddr += bfd_get_section_by_name (abfd, NLM_CODE_NAME) -> size;
       if (bfd_is_und_section (bfd_get_section (sym)))
 	{
 	  r_extern = 1;
@@ -791,7 +789,7 @@
 
   code_sec = bfd_get_section_by_name (abfd, NLM_CODE_NAME);
   data_sec = bfd_get_section_by_name (abfd, NLM_INITIALIZED_DATA_NAME);
-  if (sym->symbol.value < bfd_section_size (abfd, code_sec))
+  if (sym->symbol.value < code_sec->size)
     {
       sym->symbol.section = code_sec;
       sym->symbol.flags |= BSF_FUNCTION;
@@ -799,9 +797,9 @@
   else
     {
       sym->symbol.section = data_sec;
-      sym->symbol.value -= bfd_section_size (abfd, code_sec);
+      sym->symbol.value -= code_sec->size;
       /* The data segment had better be aligned.  */
-      BFD_ASSERT ((bfd_section_size (abfd, code_sec) & 0xf) == 0);
+      BFD_ASSERT ((code_sec->size & 0xf) == 0);
     }
   return TRUE;
 }
diff --git a/bfd/nlm32-ppc.c b/bfd/nlm32-ppc.c
index aafe2cc..9fb59b0 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 1994, 1995, 2000, 2001, 2002, 2003
+   Copyright 1994, 1995, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -621,7 +621,7 @@
   else if (l_rsecnm == 1)
     {
       *secp = data_sec;
-      l_vaddr -= bfd_section_size (abfd, code_sec);
+      l_vaddr -= code_sec->size;
     }
   else
     {
@@ -858,7 +858,7 @@
   else if (sec == data_sec)
     {
       l_rsecnm = 1;
-      address += bfd_section_size (abfd, code_sec);
+      address += code_sec->size;
     }
   else
     {
diff --git a/bfd/nlm32-sparc.c b/bfd/nlm32-sparc.c
index e973d42..847220e 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 1993, 1994, 2000, 2001, 2002, 2003
+   Copyright 1993, 1994, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -325,9 +325,9 @@
   if (symsec == code)
     base = 0;
   else if (symsec == data)
-    base = bfd_section_size (abfd, code);
+    base = code->size;
   else if (symsec == bss)
-    base = bfd_section_size (abfd, code) + bfd_section_size (abfd, data);
+    base = code->size + data->size;
   else
     base = 0;
 
diff --git a/bfd/nlmcode.h b/bfd/nlmcode.h
index 68e4a2a..bf41f27 100644
--- a/bfd/nlmcode.h
+++ b/bfd/nlmcode.h
@@ -1,5 +1,5 @@
 /* NLM (NetWare Loadable Module) executable support for BFD.
-   Copyright 1993, 1994, 1995, 1998, 2000, 2001, 2002, 2003
+   Copyright 1993, 1994, 1995, 1998, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    Written by Fred Fish @ Cygnus Support, using ELF support as the
@@ -236,7 +236,7 @@
     return FALSE;
 
   newsect->vma = 0;		/* NLM's are relocatable.  */
-  newsect->_raw_size = size;
+  newsect->size = size;
   newsect->filepos = offset;
   newsect->flags = flags;
   newsect->alignment_power = bfd_log2 ((bfd_vma) 0);	/* FIXME */
@@ -630,7 +630,7 @@
 		  newsec = bfd_make_section_anyway (abfd, name);
 		  if (newsec == (asection *) NULL)
 		    return FALSE;
-		  newsec->_raw_size = size;
+		  newsec->size = size;
 		  if (filepos != 0)
 		    {
 		      newsec->filepos = filepos;
@@ -1437,12 +1437,12 @@
     {
       flagword f;
 
-      sec->_raw_size = BFD_ALIGN (sec->_raw_size, 1 << sec->alignment_power);
+      sec->size = BFD_ALIGN (sec->size, 1 << sec->alignment_power);
 
       f = bfd_get_section_flags (abfd, sec);
       if (f & SEC_CODE)
 	{
-	  text += sec->_raw_size;
+	  text += sec->size;
 	  if (bfd_get_section_vma (abfd, sec) < text_low)
 	    text_low = bfd_get_section_vma (abfd, sec);
 	  if (sec->alignment_power > text_align)
@@ -1450,7 +1450,7 @@
 	}
       else if (f & SEC_DATA)
 	{
-	  data += sec->_raw_size;
+	  data += sec->size;
 	  if (bfd_get_section_vma (abfd, sec) < data_low)
 	    data_low = bfd_get_section_vma (abfd, sec);
 	  if (sec->alignment_power > data_align)
@@ -1462,7 +1462,7 @@
 	    other_align = sec->alignment_power;
 	}
       else if (f & SEC_ALLOC)
-	bss += sec->_raw_size;
+	bss += sec->size;
     }
 
   nlm_set_text_low (abfd, text_low);
@@ -1498,17 +1498,17 @@
       if (f & SEC_CODE)
 	{
 	  sec->filepos = text_ptr;
-	  text_ptr += sec->_raw_size;
+	  text_ptr += sec->size;
 	}
       else if (f & SEC_DATA)
 	{
 	  sec->filepos = data_ptr;
-	  data_ptr += sec->_raw_size;
+	  data_ptr += sec->size;
 	}
       else if (f & SEC_HAS_CONTENTS)
 	{
 	  sec->filepos = other_ptr;
-	  other_ptr += sec->_raw_size;
+	  other_ptr += sec->size;
 	}
     }
 
@@ -1539,7 +1539,7 @@
 	     symbol (which is the old value of the symbol).  */
 	  sym->section = bss_sec;
 	  size = sym->value;
-	  sym->value = bss_sec->_raw_size + add;
+	  sym->value = bss_sec->size + add;
 	  add += size;
 	  add = BFD_ALIGN (add, 1 << bss_sec->alignment_power);
 	}
@@ -1552,7 +1552,7 @@
 	      abort ();
 	    }
 	  nlm_fixed_header (abfd)->uninitializedDataSize += add;
-	  bss_sec->_raw_size += add;
+	  bss_sec->size += add;
 	}
     }
 
diff --git a/bfd/oasys.c b/bfd/oasys.c
index be6a8d9..7df9c87 100644
--- a/bfd/oasys.c
+++ b/bfd/oasys.c
@@ -1,6 +1,6 @@
 /* BFD back-end for oasys objects.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+   2002, 2003, 2004 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.
@@ -507,7 +507,7 @@
 		BFD_FAIL ();
 	      }
 
-	    s->_raw_size = H_GET_32 (abfd, record.section.value);
+	    s->size = H_GET_32 (abfd, record.section.value);
 	    s->vma = H_GET_32 (abfd, record.section.vma);
 	    s->flags = 0;
 	    had_usefull = TRUE;
@@ -657,7 +657,7 @@
 
 	    if (! per->initialized)
 	      {
-		per->data = (bfd_byte *) bfd_zalloc (abfd, section->_raw_size);
+		per->data = (bfd_byte *) bfd_zalloc (abfd, section->size);
 		if (!per->data)
 		  return FALSE;
 		per->reloc_tail_ptr
@@ -1055,7 +1055,7 @@
 	  return FALSE;
 	}
       out.relb = RELOCATION_TYPE_REL | s->target_index;
-      H_PUT_32 (abfd, s->_cooked_size, out.value);
+      H_PUT_32 (abfd, s->size, out.value);
       H_PUT_32 (abfd, s->vma, out.vma);
 
       if (! oasys_write_record (abfd,
@@ -1159,7 +1159,7 @@
 	  current_byte_index = 0;
 	  processed_data.relb = s->target_index | RELOCATION_TYPE_REL;
 
-	  while (current_byte_index < s->_cooked_size)
+	  while (current_byte_index < s->size)
 	    {
 	      /* Scan forwards by eight bytes or however much is left and see if
 	       there are any relocations going on */
@@ -1180,7 +1180,7 @@
  	       1 modification byte + 2 data = 8 bytes total).  That's where
  	       the magic number 8 comes from.
  	    */
-	      while (current_byte_index < s->_raw_size && dst <=
+	      while (current_byte_index < s->size && dst <=
 		     &processed_data.data[sizeof (processed_data.data) - 8])
 		{
 
@@ -1355,7 +1355,7 @@
       if (oasys_per_section (section)->data == (bfd_byte *) NULL)
 	{
 	  oasys_per_section (section)->data =
-	    (bfd_byte *) (bfd_alloc (abfd, section->_cooked_size));
+	    (bfd_byte *) (bfd_alloc (abfd, section->size));
 	  if (!oasys_per_section (section)->data)
 	    return FALSE;
 	}
@@ -1506,6 +1506,7 @@
 #define oasys_bfd_relax_section bfd_generic_relax_section
 #define oasys_bfd_gc_sections bfd_generic_gc_sections
 #define oasys_bfd_merge_sections bfd_generic_merge_sections
+#define oasys_bfd_is_group_section bfd_generic_is_group_section
 #define oasys_bfd_discard_group bfd_generic_discard_group
 #define oasys_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define oasys_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
diff --git a/bfd/opncls.c b/bfd/opncls.c
index 6abd405..e54e099 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -1,6 +1,6 @@
 /* opncls.c -- open and close a BFD.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
-   2001, 2002, 2003
+   2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    Written by Cygnus Support.
@@ -103,6 +103,7 @@
   if (nbfd == NULL)
     return NULL;
   nbfd->xvec = obfd->xvec;
+  nbfd->iovec = obfd->iovec;
   nbfd->my_archive = obfd;
   nbfd->direction = read_direction;
   nbfd->target_defaulted = obfd->target_defaulted;
@@ -322,6 +323,183 @@
 
   return nbfd;
 }
+
+/*
+FUNCTION
+	bfd_openr_iovec
+
+SYNOPSIS
+        bfd *bfd_openr_iovec (const char *filename, const char *target,
+                              void *(*open) (struct bfd *nbfd,
+                                             void *open_closure),
+                              void *open_closure,
+                              file_ptr (*pread) (struct bfd *nbfd,
+                                                 void *stream,
+                                                 void *buf,
+                                                 file_ptr nbytes,
+                                                 file_ptr offset),
+                              int (*close) (struct bfd *nbfd,
+                                            void *stream));
+
+DESCRIPTION
+
+        Create and return a BFD backed by a read-only @var{stream}.
+        The @var{stream} is created using @var{open}, accessed using
+        @var{pread} and destroyed using @var{close}.
+
+	Calls <<bfd_find_target>>, so @var{target} is interpreted as by
+	that function.
+
+	Calls @var{open} (which can call <<bfd_zalloc>> and
+	<<bfd_get_filename>>) to obtain the read-only stream backing
+	the BFD.  @var{open} either succeeds returning the
+	non-<<NULL>> @var{stream}, or fails returning <<NULL>>
+	(setting <<bfd_error>>).
+
+	Calls @var{pread} to request @var{nbytes} of data from
+	@var{stream} starting at @var{offset} (e.g., via a call to
+	<<bfd_read>>).  @var{pread} either succeeds returning the
+	number of bytes read (which can be less than @var{nbytes} when
+	end-of-file), or fails returning -1 (setting <<bfd_error>>).
+
+	Calls @var{close} when the BFD is later closed using
+	<<bfd_close>>.  @var{close} either succeeds returning 0, or
+	fails returning -1 (setting <<bfd_error>>).
+
+	If <<bfd_openr_iovec>> returns <<NULL>> then an error has
+	occurred.  Possible errors are <<bfd_error_no_memory>>,
+	<<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
+
+*/
+
+struct opncls
+{
+  void *stream;
+  file_ptr (*pread) (struct bfd *abfd, void *stream, void *buf,
+		     file_ptr nbytes, file_ptr offset);
+  int (*close) (struct bfd *abfd, void *stream);
+  file_ptr where;
+};
+
+static file_ptr
+opncls_btell (struct bfd *abfd)
+{
+  struct opncls *vec = abfd->iostream;
+  return vec->where;
+}
+
+static int
+opncls_bseek (struct bfd *abfd, file_ptr offset, int whence)
+{
+  struct opncls *vec = abfd->iostream;
+  switch (whence)
+    {
+    case SEEK_SET: vec->where = offset; break;
+    case SEEK_CUR: vec->where += offset; break;
+    case SEEK_END: return -1;
+    }
+  return 0;
+}
+
+static file_ptr
+opncls_bread (struct bfd *abfd, void *buf, file_ptr nbytes)
+{
+  struct opncls *vec = abfd->iostream;
+  file_ptr nread = vec->pread (abfd, vec->stream, buf, nbytes, vec->where);
+  if (nread < 0)
+    return nread;
+  vec->where += nread;
+  return nread;
+}
+
+static file_ptr
+opncls_bwrite (struct bfd *abfd ATTRIBUTE_UNUSED,
+	      const void *where ATTRIBUTE_UNUSED,
+	      file_ptr nbytes ATTRIBUTE_UNUSED)
+{
+  return -1;
+}
+
+static int
+opncls_bclose (struct bfd *abfd)
+{
+  struct opncls *vec = abfd->iostream;
+  /* Since the VEC's memory is bound to the bfd deleting the bfd will
+     free it.  */
+  int status = 0;
+  if (vec->close != NULL)
+    status = vec->close (abfd, vec->stream);
+  abfd->iostream = NULL;
+  return status;
+}
+
+static int
+opncls_bflush (struct bfd *abfd ATTRIBUTE_UNUSED)
+{
+  return 0;
+}
+
+static int
+opncls_bstat (struct bfd *abfd ATTRIBUTE_UNUSED, struct stat *sb)
+{
+  memset (sb, 0, sizeof (*sb));
+  return 0;
+}
+
+static const struct bfd_iovec opncls_iovec = {
+  &opncls_bread, &opncls_bwrite, &opncls_btell, &opncls_bseek,
+  &opncls_bclose, &opncls_bflush, &opncls_bstat
+};
+
+bfd *
+bfd_openr_iovec (const char *filename, const char *target,
+		 void *(*open) (struct bfd *nbfd,
+				void *open_closure),
+		 void *open_closure,
+		 file_ptr (*pread) (struct bfd *abfd,
+				    void *stream,
+				    void *buf,
+				    file_ptr nbytes,
+				    file_ptr offset),
+		 int (*close) (struct bfd *nbfd,
+			       void *stream))
+{
+  bfd *nbfd;
+  const bfd_target *target_vec;
+  struct opncls *vec;
+  void *stream;
+
+  nbfd = _bfd_new_bfd ();
+  if (nbfd == NULL)
+    return NULL;
+
+  target_vec = bfd_find_target (target, nbfd);
+  if (target_vec == NULL)
+    {
+      _bfd_delete_bfd (nbfd);
+      return NULL;
+    }
+
+  nbfd->filename = filename;
+  nbfd->direction = read_direction;
+
+  stream = open (nbfd, open_closure);
+  if (stream == NULL)
+    {
+      _bfd_delete_bfd (nbfd);
+      return NULL;
+    }
+
+  vec = bfd_zalloc (nbfd, sizeof (struct opncls));
+  vec->stream = stream;
+  vec->pread = pread;
+  vec->close = close;
+
+  nbfd->iovec = &opncls_iovec;
+  nbfd->iostream = vec;
+
+  return nbfd;
+}
 
 /* bfd_openw -- open for writing.
    Returns a pointer to a freshly-allocated BFD on success, or NULL.
@@ -415,7 +593,12 @@
   if (! BFD_SEND (abfd, _close_and_cleanup, (abfd)))
     return FALSE;
 
-  ret = bfd_cache_close (abfd);
+  /* FIXME: cagney/2004-02-15: Need to implement a BFD_IN_MEMORY io
+     vector.  */
+  if (!(abfd->flags & BFD_IN_MEMORY))
+    ret = abfd->iovec->bclose (abfd);
+  else
+    ret = 0;
 
   /* If the file was open for writing and is now executable,
      make it so.  */
@@ -630,7 +813,7 @@
 	bfd_alloc
 
 SYNOPSIS
-	void *bfd_alloc (bfd *abfd, size_t wanted);
+	void *bfd_alloc (bfd *abfd, bfd_size_type wanted);
 
 DESCRIPTION
 	Allocate a block of @var{wanted} bytes of memory attached to
@@ -793,12 +976,10 @@
 static char *
 get_debug_link_info (bfd *abfd, unsigned long *crc32_out)
 {
-  asection * sect;
-  bfd_size_type debuglink_size;
+  asection *sect;
   unsigned long crc32;
-  char * contents;
+  bfd_byte *contents;
   int crc_offset;
-  bfd_boolean ret;
 
   BFD_ASSERT (abfd);
   BFD_ASSERT (crc32_out);
@@ -808,16 +989,10 @@
   if (sect == NULL)
     return NULL;
 
-  debuglink_size = bfd_section_size (abfd, sect);  
-
-  contents = malloc (debuglink_size);
-  if (contents == NULL)
-    return NULL;
-
-  ret = bfd_get_section_contents (abfd, sect, contents, 0, debuglink_size);
-  if (! ret)
+  if (!bfd_malloc_and_get_section (abfd, sect, &contents))
     {
-      free (contents);
+      if (contents != NULL)
+	free (contents);
       return NULL;
     }
 
diff --git a/bfd/osf-core.c b/bfd/osf-core.c
index 8273504..7fe2b08 100644
--- a/bfd/osf-core.c
+++ b/bfd/osf-core.c
@@ -56,11 +56,11 @@
 #define core_command(bfd) (core_hdr(bfd)->cmd)
 
 static asection *
-make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
+make_bfd_asection (abfd, name, flags, size, vma, filepos)
      bfd *abfd;
      const char *name;
      flagword flags;
-     bfd_size_type _raw_size;
+     bfd_size_type size;
      bfd_vma vma;
      file_ptr filepos;
 {
@@ -71,7 +71,7 @@
     return NULL;
 
   asect->flags = flags;
-  asect->_raw_size = _raw_size;
+  asect->size = size;
   asect->vma = vma;
   asect->filepos = filepos;
   asect->alignment_power = 8;
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index 95d2ccd..3bff3a6 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -1,5 +1,5 @@
 /* BFD back-end for PDP-11 a.out binaries.
-   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -741,8 +741,8 @@
   if (! NAME(aout,make_sections) (abfd))
     return NULL;
 
-  obj_datasec (abfd)->_raw_size = execp->a_data;
-  obj_bsssec (abfd)->_raw_size = execp->a_bss;
+  obj_datasec (abfd)->size = execp->a_data;
+  obj_bsssec (abfd)->size = execp->a_bss;
 
   obj_textsec (abfd)->flags =
     (execp->a_trsize != 0
@@ -768,7 +768,6 @@
   struct exec *execp = exec_hdr (abfd);
 
   obj_textsec (abfd)->size = N_TXTSIZE(*execp);
-  obj_textsec (abfd)->raw_size = N_TXTSIZE(*execp);
   /* data and bss are already filled in since they're so standard */
 
   /* The virtual memory addresses of the sections */
@@ -826,7 +825,7 @@
 
   if (execp->a_entry != 0
       || (execp->a_entry >= obj_textsec(abfd)->vma
-	  && execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size))
+	  && execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->size))
     abfd->flags |= EXEC_P;
 #ifdef STAT_FOR_EXEC
   else
@@ -1074,8 +1073,8 @@
   else
     vma = obj_textsec (abfd)->vma;
 
-  pos += obj_textsec (abfd)->_raw_size;
-  vma += obj_textsec (abfd)->_raw_size;
+  pos += obj_textsec (abfd)->size;
+  vma += obj_textsec (abfd)->size;
 
   /* Data.  */
   if (!obj_datasec (abfd)->user_set_vma)
@@ -1083,7 +1082,7 @@
 #if 0	    /* ?? Does alignment in the file image really matter? */
       pad = align_power (vma, obj_datasec (abfd)->alignment_power) - vma;
 #endif
-      obj_textsec (abfd)->_raw_size += pad;
+      obj_textsec (abfd)->size += pad;
       pos += pad;
       vma += pad;
       obj_datasec (abfd)->vma = vma;
@@ -1091,8 +1090,8 @@
   else
     vma = obj_datasec (abfd)->vma;
   obj_datasec (abfd)->filepos = pos;
-  pos += obj_datasec (abfd)->_raw_size;
-  vma += obj_datasec (abfd)->_raw_size;
+  pos += obj_datasec (abfd)->size;
+  vma += obj_datasec (abfd)->size;
 
   /* BSS.  */
   if (! obj_bsssec (abfd)->user_set_vma)
@@ -1100,7 +1099,7 @@
 #if 0
       pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
 #endif
-      obj_datasec (abfd)->_raw_size += pad;
+      obj_datasec (abfd)->size += pad;
       pos += pad;
       vma += pad;
       obj_bsssec (abfd)->vma = vma;
@@ -1113,16 +1112,16 @@
       pad = obj_bsssec (abfd)->vma - vma;
       if (pad > 0)
 	{
-	  obj_datasec (abfd)->_raw_size += pad;
+	  obj_datasec (abfd)->size += pad;
 	  pos += pad;
 	}
     }
   obj_bsssec (abfd)->filepos = pos;
 
   /* Fix up the exec header.  */
-  execp->a_text = obj_textsec (abfd)->_raw_size;
-  execp->a_data = obj_datasec (abfd)->_raw_size;
-  execp->a_bss  = obj_bsssec (abfd)->_raw_size;
+  execp->a_text = obj_textsec (abfd)->size;
+  execp->a_data = obj_datasec (abfd)->size;
+  execp->a_bss  = obj_bsssec (abfd)->size;
   N_SET_MAGIC (*execp, OMAGIC);
 }
 
@@ -1172,7 +1171,7 @@
   /* Find start of data.  */
   if (ztih)
     {
-      text_end = obj_textsec (abfd)->filepos + obj_textsec (abfd)->_raw_size;
+      text_end = obj_textsec (abfd)->filepos + obj_textsec (abfd)->size;
       text_pad += BFD_ALIGN (text_end, adata (abfd).page_size) - text_end;
     }
   else
@@ -1180,33 +1179,33 @@
       /* Note that if page_size == zmagic_disk_block_size, then
 	 filepos == page_size, and this case is the same as the ztih
 	 case.  */
-      text_end = obj_textsec (abfd)->_raw_size;
+      text_end = obj_textsec (abfd)->size;
       text_pad += BFD_ALIGN (text_end, adata (abfd).page_size) - text_end;
       text_end += obj_textsec (abfd)->filepos;
     }
 
-  obj_textsec (abfd)->_raw_size += text_pad;
+  obj_textsec (abfd)->size += text_pad;
   text_end += text_pad;
 
   /* Data.  */
   if (!obj_datasec(abfd)->user_set_vma)
     {
       bfd_vma vma;
-      vma = obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size;
+      vma = obj_textsec(abfd)->vma + obj_textsec(abfd)->size;
       obj_datasec(abfd)->vma = BFD_ALIGN (vma, adata(abfd).segment_size);
     }
   if (abdp && abdp->zmagic_mapped_contiguous)
     {
       text_pad = (obj_datasec(abfd)->vma
 		  - obj_textsec(abfd)->vma
-		  - obj_textsec(abfd)->_raw_size);
-      obj_textsec(abfd)->_raw_size += text_pad;
+		  - obj_textsec(abfd)->size);
+      obj_textsec(abfd)->size += text_pad;
     }
   obj_datasec (abfd)->filepos = (obj_textsec (abfd)->filepos
-				+ obj_textsec (abfd)->_raw_size);
+				+ obj_textsec (abfd)->size);
 
   /* Fix up exec header while we're at it.  */
-  execp->a_text = obj_textsec(abfd)->_raw_size;
+  execp->a_text = obj_textsec(abfd)->size;
   if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
     execp->a_text += adata(abfd).exec_bytes_size;
   if (obj_aout_subformat (abfd) == q_magic_format)
@@ -1215,17 +1214,17 @@
     N_SET_MAGIC (*execp, ZMAGIC);
 
   /* Spec says data section should be rounded up to page boundary.  */
-  obj_datasec(abfd)->_raw_size
-    = align_power (obj_datasec(abfd)->_raw_size,
+  obj_datasec(abfd)->size
+    = align_power (obj_datasec(abfd)->size,
 		   obj_bsssec(abfd)->alignment_power);
-  execp->a_data = BFD_ALIGN (obj_datasec(abfd)->_raw_size,
+  execp->a_data = BFD_ALIGN (obj_datasec(abfd)->size,
 			     adata(abfd).page_size);
-  data_pad = execp->a_data - obj_datasec(abfd)->_raw_size;
+  data_pad = execp->a_data - obj_datasec(abfd)->size;
 
   /* BSS.  */
   if (!obj_bsssec(abfd)->user_set_vma)
     obj_bsssec(abfd)->vma = (obj_datasec(abfd)->vma
-			     + obj_datasec(abfd)->_raw_size);
+			     + obj_datasec(abfd)->size);
   /* If the BSS immediately follows the data section and extra space
      in the page is left after the data section, fudge data
      in the header so that the bss section looks smaller by that
@@ -1234,11 +1233,11 @@
      could have explicitly set the BSS vma to immediately follow
      the data section.)  */
   if (align_power (obj_bsssec(abfd)->vma, obj_bsssec(abfd)->alignment_power)
-      == obj_datasec(abfd)->vma + obj_datasec(abfd)->_raw_size)
-    execp->a_bss = (data_pad > obj_bsssec(abfd)->_raw_size) ? 0 :
-      obj_bsssec(abfd)->_raw_size - data_pad;
+      == obj_datasec(abfd)->vma + obj_datasec(abfd)->size)
+    execp->a_bss = (data_pad > obj_bsssec(abfd)->size) ? 0 :
+      obj_bsssec(abfd)->size - data_pad;
   else
-    execp->a_bss = obj_bsssec(abfd)->_raw_size;
+    execp->a_bss = obj_bsssec(abfd)->size;
 }
 
 static void
@@ -1256,8 +1255,8 @@
     obj_textsec(abfd)->vma = vma;
   else
     vma = obj_textsec(abfd)->vma;
-  pos += obj_textsec(abfd)->_raw_size;
-  vma += obj_textsec(abfd)->_raw_size;
+  pos += obj_textsec(abfd)->size;
+  vma += obj_textsec(abfd)->size;
 
   /* Data.  */
   obj_datasec(abfd)->filepos = pos;
@@ -1266,10 +1265,10 @@
   vma = obj_datasec(abfd)->vma;
 
   /* Since BSS follows data immediately, see if it needs alignment.  */
-  vma += obj_datasec(abfd)->_raw_size;
+  vma += obj_datasec(abfd)->size;
   pad = align_power (vma, obj_bsssec(abfd)->alignment_power) - vma;
-  obj_datasec(abfd)->_raw_size += pad;
-  pos += obj_datasec(abfd)->_raw_size;
+  obj_datasec(abfd)->size += pad;
+  pos += obj_datasec(abfd)->size;
 
   /* BSS.  */
   if (!obj_bsssec(abfd)->user_set_vma)
@@ -1278,9 +1277,9 @@
     vma = obj_bsssec(abfd)->vma;
 
   /* Fix up exec header.  */
-  execp->a_text = obj_textsec(abfd)->_raw_size;
-  execp->a_data = obj_datasec(abfd)->_raw_size;
-  execp->a_bss = obj_bsssec(abfd)->_raw_size;
+  execp->a_text = obj_textsec(abfd)->size;
+  execp->a_data = obj_datasec(abfd)->size;
+  execp->a_bss = obj_bsssec(abfd)->size;
   N_SET_MAGIC (*execp, NMAGIC);
 }
 
@@ -1298,11 +1297,11 @@
   if (adata(abfd).magic != undecided_magic)
     return TRUE;
 
-  obj_textsec(abfd)->_raw_size =
-    align_power(obj_textsec(abfd)->_raw_size,
+  obj_textsec(abfd)->size =
+    align_power(obj_textsec(abfd)->size,
 		obj_textsec(abfd)->alignment_power);
 
-  *text_size = obj_textsec (abfd)->_raw_size;
+  *text_size = obj_textsec (abfd)->size;
   /* Rule (heuristic) for when to pad to a new page.  Note that there
      are (at least) two ways demand-paged (ZMAGIC) files have been
      handled.  Most Berkeley-based systems start the text segment at
@@ -1336,11 +1335,11 @@
 	      }
 	      str;
 	    }),
-	   obj_textsec(abfd)->vma, obj_textsec(abfd)->_raw_size,
+	   obj_textsec(abfd)->vma, obj_textsec(abfd)->size,
 	   	obj_textsec(abfd)->alignment_power,
-	   obj_datasec(abfd)->vma, obj_datasec(abfd)->_raw_size,
+	   obj_datasec(abfd)->vma, obj_datasec(abfd)->size,
 	   	obj_datasec(abfd)->alignment_power,
-	   obj_bsssec(abfd)->vma, obj_bsssec(abfd)->_raw_size,
+	   obj_bsssec(abfd)->vma, obj_bsssec(abfd)->size,
 	   	obj_bsssec(abfd)->alignment_power);
 #endif
 #endif
@@ -1362,11 +1361,11 @@
 
 #ifdef BFD_AOUT_DEBUG
   fprintf (stderr, "       text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x>\n",
-	   obj_textsec(abfd)->vma, obj_textsec(abfd)->_raw_size,
+	   obj_textsec(abfd)->vma, obj_textsec(abfd)->size,
 	   	obj_textsec(abfd)->filepos,
-	   obj_datasec(abfd)->vma, obj_datasec(abfd)->_raw_size,
+	   obj_datasec(abfd)->vma, obj_datasec(abfd)->size,
 	   	obj_datasec(abfd)->filepos,
-	   obj_bsssec(abfd)->vma, obj_bsssec(abfd)->_raw_size);
+	   obj_bsssec(abfd)->vma, obj_bsssec(abfd)->size);
 #endif
 
   return TRUE;
@@ -2314,7 +2313,7 @@
     return TRUE;
 #endif
 
-  natsize = bfd_get_section_size_before_reloc (section);
+  natsize = section->size;
   native = (unsigned char *) bfd_zalloc (abfd, natsize);
   if (!native)
     return FALSE;
@@ -3469,10 +3468,10 @@
 
       if (bfd_get_flavour (sub) == bfd_target_aout_flavour)
 	{
-	  sz = bfd_section_size (sub, obj_textsec (sub));
+	  sz = obj_textsec (sub)->size;
 	  if (sz > max_contents_size)
 	    max_contents_size = sz;
-	  sz = bfd_section_size (sub, obj_datasec (sub));
+	  sz = obj_datasec (sub)->size;
 	  if (sz > max_contents_size)
 	    max_contents_size = sz;
 
@@ -4424,7 +4423,7 @@
   PTR relocs;
 
   /* Get the section contents.  */
-  input_size = bfd_section_size (input_bfd, input_section);
+  input_size = input_section->size;
   if (! bfd_get_section_contents (input_bfd, input_section,
 				  (PTR) finfo->contents,
 				  (file_ptr) 0, input_size))
diff --git a/bfd/pe-i386.c b/bfd/pe-i386.c
index a912cff..be691fd 100644
--- a/bfd/pe-i386.c
+++ b/bfd/pe-i386.c
@@ -1,5 +1,5 @@
 /* BFD back-end for Intel 386 PECOFF files.
-   Copyright 1995, 1996, 1999, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -20,12 +20,13 @@
 #include "bfd.h"
 #include "sysdep.h"
 
-#define TARGET_SYM i386pe_vec
-#define TARGET_NAME "pe-i386"
+#define TARGET_SYM 		i386pe_vec
+#define TARGET_NAME 		"pe-i386"
 #define COFF_WITH_PE
-#define PCRELOFFSET TRUE
-#define TARGET_UNDERSCORE '_'
+#define PCRELOFFSET 		TRUE
+#define TARGET_UNDERSCORE 	'_'
 #define COFF_LONG_SECTION_NAMES
+#define COFF_SUPPORT_GNU_LINKONCE
 #define COFF_LONG_FILENAMES
 
 #define COFF_SECTION_ALIGNMENT_ENTRIES \
@@ -38,6 +39,10 @@
 { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
   COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
 { COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }
+  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \
+  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \
+  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }
 
 #include "coff-i386.c"
diff --git a/bfd/pe-mips.c b/bfd/pe-mips.c
index 3066aaa..6e74c7e 100644
--- a/bfd/pe-mips.c
+++ b/bfd/pe-mips.c
@@ -41,16 +41,6 @@
   PARAMS ((bfd *, asection *, struct internal_reloc *,
 	   struct coff_link_hash_entry *, struct internal_syment *,
 	   bfd_vma *));
-#if 0
-static void mips_ecoff_swap_reloc_in
-  PARAMS ((bfd *, PTR, struct internal_reloc *));
-static void mips_ecoff_swap_reloc_out
-  PARAMS ((bfd *, const struct internal_reloc *, PTR));
-static void mips_adjust_reloc_in
-  PARAMS ((bfd *, const struct internal_reloc *, arelent *));
-static void mips_adjust_reloc_out
-  PARAMS ((bfd *, const arelent *, struct internal_reloc *));
-#endif
 
 static bfd_boolean in_reloc_p
   PARAMS ((bfd *, reloc_howto_type *));
@@ -534,20 +524,6 @@
     case BFD_RELOC_MIPS_LITERAL:
       mips_type = MIPS_R_LITERAL;
       break;
-/* FIXME?
-    case BFD_RELOC_16_PCREL_S2:
-      mips_type = MIPS_R_PCREL16;
-      break;
-    case BFD_RELOC_PCREL_HI16_S:
-      mips_type = MIPS_R_RELHI;
-      break;
-    case BFD_RELOC_PCREL_LO16:
-      mips_type = MIPS_R_RELLO;
-      break;
-    case BFD_RELOC_GPREL32:
-      mips_type = MIPS_R_SWITCH;
-      break;
-*/
     case BFD_RELOC_RVA:
       mips_type = MIPS_R_RVA;
       break;
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 598aa7c..6a41e9b 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -189,8 +189,7 @@
 
 	  sec->vma = 0;
 	  sec->lma = 0;
-	  sec->_cooked_size = 0;
-	  sec->_raw_size = 0;
+	  sec->size = 0;
 	  sec->filepos = 0;
 	  sec->rel_filepos = 0;
 	  sec->reloc_count = 0;
@@ -198,7 +197,6 @@
 	  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;
 
@@ -658,14 +656,19 @@
 
   {
     asection *sec;
+    bfd_vma hsize = 0;
     bfd_vma dsize = 0;
-    bfd_vma isize = SA(abfd->sections->filepos);
+    bfd_vma isize = 0;
     bfd_vma tsize = 0;
 
     for (sec = abfd->sections; sec; sec = sec->next)
       {
-	int rounded = FA(sec->_raw_size);
+	int rounded = FA(sec->size);
 
+	/* The first non-zero section filepos is the header size.
+	   Sections without contents will have a filepos of 0.  */
+	if (hsize == 0)
+	  hsize = sec->filepos;
 	if (sec->flags & SEC_DATA)
 	  dsize += rounded;
 	if (sec->flags & SEC_CODE)
@@ -682,10 +685,10 @@
 
     aouthdr_in->dsize = dsize;
     aouthdr_in->tsize = tsize;
-    extra->SizeOfImage = isize;
+    extra->SizeOfHeaders = hsize;
+    extra->SizeOfImage = SA(hsize) + isize;
   }
 
-  extra->SizeOfHeaders = abfd->sections->filepos;
   H_PUT_16 (abfd, aouthdr_in->magic, aouthdr_out->standard.magic);
 
 #define LINKER_VERSION 256 /* That is, 2.56 */
@@ -983,7 +986,6 @@
       };
 
     pe_required_section_flags * p;
-    int flags = scnhdr_int->s_flags;
 
     /* We have defaulted to adding the IMAGE_SCN_MEM_WRITE flag, but now
        we know exactly what this specific section wants so we remove it
@@ -998,12 +1000,12 @@
 	{
 	  if (strcmp (scnhdr_int->s_name, ".text")
 	      || (bfd_get_file_flags (abfd) & WP_TEXT))
-	    flags &= ~IMAGE_SCN_MEM_WRITE;
-	  flags |= p->must_have;
+	    scnhdr_int->s_flags &= ~IMAGE_SCN_MEM_WRITE;
+	  scnhdr_int->s_flags |= p->must_have;
 	  break;
 	}
 
-    H_PUT_32 (abfd, flags, scnhdr_ext->s_flags);
+    H_PUT_32 (abfd, scnhdr_int->s_flags, scnhdr_ext->s_flags);
   }
 
   if (coff_data (abfd)->link_info
@@ -1106,7 +1108,6 @@
   bfd_size_type datasize = 0;
   bfd_size_type dataoff;
   bfd_size_type i;
-  bfd_size_type amt;
   int onaline = 20;
 
   pe_data_type *pe = pe_data (abfd);
@@ -1124,7 +1125,7 @@
 	return TRUE;
 
       addr = section->vma;
-      datasize = bfd_section_size (abfd, section);
+      datasize = section->size;
       if (datasize == 0)
 	return TRUE;
     }
@@ -1133,7 +1134,7 @@
       addr += extra->ImageBase;
       for (section = abfd->sections; section != NULL; section = section->next)
 	{
-	  datasize = bfd_section_size (abfd, section);
+	  datasize = section->size;
 	  if (addr >= section->vma && addr < section->vma + datasize)
 	    break;
 	}
@@ -1153,7 +1154,7 @@
   datasize -= dataoff;
 
 #ifdef POWERPC_LE_PE
-  if (rel_section != 0 && bfd_section_size (abfd, rel_section) != 0)
+  if (rel_section != 0 && rel_section->size != 0)
     {
       /* The toc address can be found by taking the starting address,
 	 which on the PPC locates a function descriptor. The
@@ -1165,16 +1166,15 @@
       bfd_vma loadable_toc_address;
       bfd_vma toc_address;
       bfd_vma start_address;
-      bfd_byte *data = 0;
+      bfd_byte *data;
       int offset;
 
-      amt = bfd_section_size (abfd, rel_section);
-      data = (bfd_byte *) bfd_malloc (amt);
-      if (data == NULL && amt != 0)
-	return FALSE;
-
-      bfd_get_section_contents (abfd, rel_section, (PTR) data, (bfd_vma) 0,
-				amt);
+      if (!bfd_malloc_and_get_section (abfd, rel_section, &data))
+	{
+	  if (data != NULL)
+	    free (data);
+	  return FALSE;
+	}
 
       offset = abfd->start_address - rel_section->vma;
 
@@ -1188,6 +1188,8 @@
       fprintf (file,
 	       _("\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"),
 	       start_address, loadable_toc_address, toc_address);
+      if (data != NULL)
+	free (data);
     }
   else
     {
@@ -1204,14 +1206,13 @@
  vma:            Hint    Time      Forward  DLL       First\n\
                  Table   Stamp     Chain    Name      Thunk\n"));
 
-  amt = dataoff + datasize;
-  data = (bfd_byte *) bfd_malloc (amt);
-  if (data == NULL)
-    return FALSE;
-
   /* Read the whole section.  Some of the fields might be before dataoff.  */
-  if (! bfd_get_section_contents (abfd, section, (PTR) data, (bfd_vma) 0, amt))
-    return FALSE;
+  if (!bfd_malloc_and_get_section (abfd, section, &data))
+    {
+      if (data != NULL)
+	free (data);
+      return FALSE;
+    }
 
   adj = section->vma - extra->ImageBase;
 
@@ -1278,7 +1279,7 @@
 		   ft_section != NULL;
 		   ft_section = ft_section->next)
 		{
-		  ft_datasize = bfd_section_size (abfd, ft_section);
+		  ft_datasize = ft_section->size;
 		  if (ft_addr >= ft_section->vma
 		      && ft_addr < ft_section->vma + ft_datasize)
 		    break;
@@ -1408,7 +1409,7 @@
 	return TRUE;
 
       addr = section->vma;
-      datasize = bfd_section_size (abfd, section);
+      datasize = section->size;
       if (datasize == 0)
 	return TRUE;
     }
@@ -1418,7 +1419,7 @@
 
       for (section = abfd->sections; section != NULL; section = section->next)
 	{
-	  datasize = bfd_section_size (abfd, section);
+	  datasize = section->size;
 
 	  if (addr >= section->vma && addr < section->vma + datasize)
 	    break;
@@ -1629,16 +1630,16 @@
      \t\tAddress  Address  Handler  Data     Address    Mask\n"));
 #endif
 
-  datasize = bfd_section_size (abfd, section);
+  datasize = section->size;
   if (datasize == 0)
     return TRUE;
 
-  data = (bfd_byte *) bfd_malloc (datasize);
-  if (data == NULL && datasize != 0)
-    return FALSE;
-
-  bfd_get_section_contents (abfd, section, (PTR) data, (bfd_vma) 0,
-			    datasize);
+  if (!bfd_malloc_and_get_section (abfd, section, &data))
+    {
+      if (data != NULL)
+	free (data);
+      return FALSE;
+    }
 
   start = 0;
 
@@ -1748,23 +1749,23 @@
   if (section == NULL)
     return TRUE;
 
-  if (bfd_section_size (abfd, section) == 0)
+  if (section->size == 0)
     return TRUE;
 
   fprintf (file,
 	   _("\n\nPE File Base Relocations (interpreted .reloc section contents)\n"));
 
-  datasize = bfd_section_size (abfd, section);
-  data = (bfd_byte *) bfd_malloc (datasize);
-  if (data == NULL && datasize != 0)
-    return FALSE;
-
-  bfd_get_section_contents (abfd, section, (PTR) data, (bfd_vma) 0,
-			    datasize);
+  datasize = section->size;
+  if (!bfd_malloc_and_get_section (abfd, section, &data))
+    {
+      if (data != NULL)
+	free (data);
+      return FALSE;
+    }
 
   start = 0;
 
-  stop = bfd_section_size (abfd, section);
+  stop = section->size;
 
   for (i = start; i < stop;)
     {
@@ -1838,16 +1839,17 @@
   fprintf (file, _("\nCharacteristics 0x%x\n"), pe->real_flags);
 #undef PF
 #define PF(x, y) if (pe->real_flags & x) { fprintf (file, "\t%s\n", y); }
-  PF (F_RELFLG, "relocations stripped");
-  PF (F_EXEC, "executable");
-  PF (F_LNNO, "line numbers stripped");
-  PF (F_LSYMS, "symbols stripped");
-  PF (0x80, "little endian");
-  PF (F_AR32WR, "32 bit words");
-  PF (0x200, "debugging information removed");
-  PF (0x1000, "system file");
-  PF (F_DLL, "DLL");
-  PF (0x8000, "big endian");
+  PF (IMAGE_FILE_RELOCS_STRIPPED, "relocations stripped");
+  PF (IMAGE_FILE_EXECUTABLE_IMAGE, "executable");
+  PF (IMAGE_FILE_LINE_NUMS_STRIPPED, "line numbers stripped");
+  PF (IMAGE_FILE_LOCAL_SYMS_STRIPPED, "symbols stripped");
+  PF (IMAGE_FILE_LARGE_ADDRESS_AWARE, "large address aware");
+  PF (IMAGE_FILE_BYTES_REVERSED_LO, "little endian");
+  PF (IMAGE_FILE_32BIT_MACHINE, "32 bit words");
+  PF (IMAGE_FILE_DEBUG_STRIPPED, "debugging information removed");
+  PF (IMAGE_FILE_SYSTEM, "system file");
+  PF (IMAGE_FILE_DLL, "DLL");
+  PF (IMAGE_FILE_BYTES_REVERSED_HI, "big endian");
 #undef PF
 
   /* ctime implies '\n'.  */
diff --git a/bfd/pef.c b/bfd/pef.c
index 7d758cf..8e63359 100644
--- a/bfd/pef.c
+++ b/bfd/pef.c
@@ -1,5 +1,5 @@
 /* PEF support for BFD.
-   Copyright 1999, 2000, 2001, 2002, 2003
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -52,6 +52,7 @@
 #define bfd_pef_bfd_relax_section                   bfd_generic_relax_section
 #define bfd_pef_bfd_gc_sections                     bfd_generic_gc_sections
 #define bfd_pef_bfd_merge_sections                  bfd_generic_merge_sections
+#define bfd_pef_bfd_is_group_section		    bfd_generic_is_group_section
 #define bfd_pef_bfd_discard_group                   bfd_generic_discard_group
 #define bfd_pef_bfd_link_hash_table_create          _bfd_generic_link_hash_table_create
 #define bfd_pef_bfd_link_hash_table_free            _bfd_generic_link_hash_table_free
@@ -329,7 +330,7 @@
 
   bfdsec->vma = section->default_address + section->container_offset;
   bfdsec->lma = section->default_address + section->container_offset;
-  bfdsec->_raw_size = section->container_length;
+  bfdsec->size = section->container_length;
   bfdsec->filepos = section->container_offset;
   bfdsec->alignment_power = section->alignment;
 
@@ -471,7 +472,7 @@
   if (loadersec == NULL)
     return -1;
 
-  loaderlen = bfd_section_size (abfd, loadersec);
+  loaderlen = loadersec->size;
   loaderbuf = (unsigned char *) bfd_malloc (loaderlen);
   if (bfd_seek (abfd, loadersec->filepos, SEEK_SET) < 0)
     {
@@ -516,7 +517,7 @@
   if (loadersec == NULL)
     goto end;
 
-  loaderlen = bfd_section_size (abfd, loadersec);
+  loaderlen = loadersec->size;
   loaderbuf = (unsigned char *) bfd_malloc (loaderlen);
   if (bfd_seek (abfd, loadersec->filepos, SEEK_SET) < 0)
     goto error;
@@ -959,7 +960,7 @@
   codesec = bfd_get_section_by_name (abfd, "code");
   if (codesec != NULL)
     {
-      codelen = bfd_section_size (abfd, codesec);
+      codelen = codesec->size;
       codebuf = (unsigned char *) bfd_malloc (codelen);
       if (bfd_seek (abfd, codesec->filepos, SEEK_SET) < 0)
 	goto end;
@@ -970,7 +971,7 @@
   loadersec = bfd_get_section_by_name (abfd, "loader");
   if (loadersec != NULL)
     {
-      loaderlen = bfd_section_size (abfd, loadersec);
+      loaderlen = loadersec->size;
       loaderbuf = (unsigned char *) bfd_malloc (loaderlen);
       if (bfd_seek (abfd, loadersec->filepos, SEEK_SET) < 0)
 	goto end;
diff --git a/bfd/pei-i386.c b/bfd/pei-i386.c
index 63a63a8..4a59f14 100644
--- a/bfd/pei-i386.c
+++ b/bfd/pei-i386.c
@@ -1,5 +1,5 @@
 /* BFD back-end for Intel 386 PE IMAGE COFF files.
-   Copyright 1995, 1996, 1999, 2002 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1999, 2002, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -20,13 +20,14 @@
 #include "bfd.h"
 #include "sysdep.h"
 
-#define TARGET_SYM i386pei_vec
-#define TARGET_NAME "pei-i386"
+#define TARGET_SYM 		i386pei_vec
+#define TARGET_NAME 		"pei-i386"
 #define COFF_IMAGE_WITH_PE
 #define COFF_WITH_PE
-#define PCRELOFFSET TRUE
-#define TARGET_UNDERSCORE '_'
+#define PCRELOFFSET 		TRUE
+#define TARGET_UNDERSCORE 	'_'
 #define COFF_LONG_SECTION_NAMES
+#define COFF_SUPPORT_GNU_LINKONCE
 #define COFF_LONG_FILENAMES
 
 #define COFF_SECTION_ALIGNMENT_ENTRIES \
@@ -39,6 +40,10 @@
 { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
   COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
 { COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \
-  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }
+  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \
+  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \
+{ COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \
+  COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }
 
 #include "coff-i386.c"
diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in
index 07742dd..a48688e 100644
--- a/bfd/po/SRC-POTFILES.in
+++ b/bfd/po/SRC-POTFILES.in
@@ -185,7 +185,6 @@
 elf-eh-frame.c
 elf-hppa.h
 elflink.c
-elflink.h
 elf-m10200.c
 elf-m10300.c
 elfn32-mips.c
@@ -233,6 +232,7 @@
 m68klynx.c
 m68knetbsd.c
 m88kmach3.c
+m88kopenbsd.c
 mach-o.c
 mach-o.h
 merge.c
diff --git a/bfd/po/bfd.pot b/bfd/po/bfd.pot
index 3396c4f..dd37e15 100644
--- a/bfd/po/bfd.pot
+++ b/bfd/po/bfd.pot
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2004-03-19 14:59+1030\n"
+"POT-Creation-Date: 2004-03-27 15:34+1030\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"
@@ -259,14 +259,14 @@
 msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d"
 msgstr ""
 
-#: coff-arm.c:2289 elf32-arm.h:2494
+#: coff-arm.c:2289 elf32-arm.h:2482
 #, c-format
 msgid ""
 "ERROR: %s passes floats in float registers, whereas %s passes them in "
 "integer registers"
 msgstr ""
 
-#: coff-arm.c:2292 elf32-arm.h:2499
+#: coff-arm.c:2292 elf32-arm.h:2487
 #, c-format
 msgid ""
 "ERROR: %s passes floats in integer registers, whereas %s passes them in "
@@ -287,12 +287,12 @@
 "position independent"
 msgstr ""
 
-#: coff-arm.c:2339 elf32-arm.h:2571
+#: coff-arm.c:2339 elf32-arm.h:2559
 #, c-format
 msgid "Warning: %s supports interworking, whereas %s does not"
 msgstr ""
 
-#: coff-arm.c:2342 elf32-arm.h:2578
+#: coff-arm.c:2342 elf32-arm.h:2566
 #, c-format
 msgid "Warning: %s does not support interworking, whereas %s does"
 msgstr ""
@@ -302,7 +302,7 @@
 msgid "private flags = %x:"
 msgstr ""
 
-#: coff-arm.c:2377 elf32-arm.h:2633
+#: coff-arm.c:2377 elf32-arm.h:2621
 #, c-format
 msgid " [floats passed in float registers]"
 msgstr ""
@@ -312,7 +312,7 @@
 msgid " [floats passed in integer registers]"
 msgstr ""
 
-#: coff-arm.c:2382 elf32-arm.h:2636
+#: coff-arm.c:2382 elf32-arm.h:2624
 #, c-format
 msgid " [position independent]"
 msgstr ""
@@ -337,14 +337,14 @@
 msgid " [interworking not supported]"
 msgstr ""
 
-#: coff-arm.c:2440 elf32-arm.h:2298
+#: coff-arm.c:2440 elf32-arm.h:2286
 #, c-format
 msgid ""
 "Warning: Not setting interworking flag of %s since it has already been "
 "specified as non-interworking"
 msgstr ""
 
-#: coff-arm.c:2444 elf32-arm.h:2302
+#: coff-arm.c:2444 elf32-arm.h:2290
 #, c-format
 msgid "Warning: Clearing the interworking flag of %s due to outside request"
 msgstr ""
@@ -413,7 +413,7 @@
 msgid "uncertain calling convention for non-COFF symbol"
 msgstr ""
 
-#: cofflink.c:506 elflink.h:945
+#: cofflink.c:506 elflink.c:3665
 #, c-format
 msgid "Warning: type of symbol `%s' changed from %d to %d in %s"
 msgstr ""
@@ -433,7 +433,7 @@
 msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
 msgstr ""
 
-#: coff-m68k.c:482 coff-mips.c:2394 elf32-m68k.c:2153 elf32-mips.c:1405
+#: coff-m68k.c:482 coff-mips.c:2394 elf32-m68k.c:2145 elf32-mips.c:1405
 msgid "unsupported reloc type"
 msgstr ""
 
@@ -612,102 +612,102 @@
 "      Type: %s"
 msgstr ""
 
-#: elf32-arm.h:1428
+#: elf32-arm.h:1416
 #, c-format
 msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'."
 msgstr ""
 
-#: elf32-arm.h:1624
+#: elf32-arm.h:1612
 #, c-format
 msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'."
 msgstr ""
 
-#: elf32-arm.h:2092 elf32-sh.c:4819 elf64-sh64.c:1596
+#: elf32-arm.h:2080 elf32-sh.c:4808 elf64-sh64.c:1596
 #, c-format
 msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section"
 msgstr ""
 
-#: elf32-arm.h:2184
+#: elf32-arm.h:2172
 #, c-format
 msgid ""
 "%s: warning: unresolvable relocation %d against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-arm.h:2236 elf32-avr.c:812 elf32-cris.c:1352 elf32-d10v.c:579
-#: elf32-fr30.c:634 elf32-frv.c:2499 elf32-h8300.c:509 elf32-i860.c:1218
-#: elf32-ip2k.c:1565 elf32-iq2000.c:665 elf32-m32r.c:3202 elf32-m68hc1x.c:1214
-#: elf32-msp430.c:510 elf32-openrisc.c:436 elf32-v850.c:1777
-#: elf32-xstormy16.c:976 elf64-mmix.c:1545 elf-m10200.c:442 elf-m10300.c:1677
+#: elf32-arm.h:2224 elf32-avr.c:791 elf32-cris.c:1376 elf32-d10v.c:563
+#: elf32-fr30.c:599 elf32-frv.c:2499 elf32-h8300.c:493 elf32-i860.c:1196
+#: elf32-ip2k.c:1568 elf32-iq2000.c:666 elf32-m32r.c:3191 elf32-m68hc1x.c:1190
+#: elf32-msp430.c:489 elf32-openrisc.c:415 elf32-v850.c:1746
+#: elf32-xstormy16.c:954 elf64-mmix.c:1518 elf-m10200.c:426 elf-m10300.c:1676
 msgid "internal error: out of range error"
 msgstr ""
 
-#: elf32-arm.h:2240 elf32-avr.c:816 elf32-cris.c:1356 elf32-d10v.c:583
-#: elf32-fr30.c:638 elf32-frv.c:2503 elf32-h8300.c:513 elf32-i860.c:1222
-#: elf32-iq2000.c:669 elf32-m32r.c:3206 elf32-m68hc1x.c:1218
-#: elf32-msp430.c:514 elf32-openrisc.c:440 elf32-v850.c:1781
-#: elf32-xstormy16.c:980 elf64-mmix.c:1549 elf-m10200.c:446 elf-m10300.c:1681
-#: elfxx-mips.c:6470
+#: elf32-arm.h:2228 elf32-avr.c:795 elf32-cris.c:1380 elf32-d10v.c:567
+#: elf32-fr30.c:603 elf32-frv.c:2503 elf32-h8300.c:497 elf32-i860.c:1200
+#: elf32-iq2000.c:670 elf32-m32r.c:3195 elf32-m68hc1x.c:1194
+#: elf32-msp430.c:493 elf32-openrisc.c:419 elf32-v850.c:1750
+#: elf32-xstormy16.c:958 elf64-mmix.c:1522 elf-m10200.c:430 elf-m10300.c:1680
+#: elfxx-mips.c:6459
 msgid "internal error: unsupported relocation error"
 msgstr ""
 
-#: elf32-arm.h:2244 elf32-d10v.c:587 elf32-h8300.c:517 elf32-m32r.c:3210
-#: elf32-m68hc1x.c:1222 elf-m10200.c:450 elf-m10300.c:1685
+#: elf32-arm.h:2232 elf32-d10v.c:571 elf32-h8300.c:501 elf32-m32r.c:3199
+#: elf32-m68hc1x.c:1198 elf-m10200.c:434 elf-m10300.c:1684
 msgid "internal error: dangerous error"
 msgstr ""
 
-#: elf32-arm.h:2248 elf32-avr.c:824 elf32-cris.c:1364 elf32-d10v.c:591
-#: elf32-fr30.c:646 elf32-frv.c:2511 elf32-h8300.c:521 elf32-i860.c:1230
-#: elf32-ip2k.c:1580 elf32-iq2000.c:677 elf32-m32r.c:3214 elf32-m68hc1x.c:1226
-#: elf32-msp430.c:522 elf32-openrisc.c:448 elf32-v850.c:1801
-#: elf32-xstormy16.c:988 elf64-mmix.c:1557 elf-m10200.c:454 elf-m10300.c:1689
+#: elf32-arm.h:2236 elf32-avr.c:803 elf32-cris.c:1388 elf32-d10v.c:575
+#: elf32-fr30.c:611 elf32-frv.c:2511 elf32-h8300.c:505 elf32-i860.c:1208
+#: elf32-ip2k.c:1583 elf32-iq2000.c:678 elf32-m32r.c:3203 elf32-m68hc1x.c:1202
+#: elf32-msp430.c:501 elf32-openrisc.c:427 elf32-v850.c:1770
+#: elf32-xstormy16.c:966 elf64-mmix.c:1530 elf-m10200.c:438 elf-m10300.c:1688
 msgid "internal error: unknown error"
 msgstr ""
 
-#: elf32-arm.h:2350
+#: elf32-arm.h:2338
 #, c-format
 msgid ""
 "Warning: Clearing the interworking flag of %s because non-interworking code "
 "in %s has been linked with it"
 msgstr ""
 
-#: elf32-arm.h:2468
+#: elf32-arm.h:2456
 #, c-format
 msgid ""
 "ERROR: %s is compiled for EABI version %d, whereas %s is compiled for "
 "version %d"
 msgstr ""
 
-#: elf32-arm.h:2482
+#: elf32-arm.h:2470
 #, c-format
 msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d"
 msgstr ""
 
-#: elf32-arm.h:2510
+#: elf32-arm.h:2498
 #, c-format
 msgid "ERROR: %s uses VFP instructions, whereas %s does not"
 msgstr ""
 
-#: elf32-arm.h:2515
+#: elf32-arm.h:2503
 #, c-format
 msgid "ERROR: %s uses FPA instructions, whereas %s does not"
 msgstr ""
 
-#: elf32-arm.h:2526
+#: elf32-arm.h:2514
 #, c-format
 msgid "ERROR: %s uses Maverick instructions, whereas %s does not"
 msgstr ""
 
-#: elf32-arm.h:2531
+#: elf32-arm.h:2519
 #, c-format
 msgid "ERROR: %s does not use Maverick instructions, whereas %s does"
 msgstr ""
 
-#: elf32-arm.h:2551
+#: elf32-arm.h:2539
 #, c-format
 msgid "ERROR: %s uses software FP, whereas %s uses hardware FP"
 msgstr ""
 
-#: elf32-arm.h:2556
+#: elf32-arm.h:2544
 #, c-format
 msgid "ERROR: %s uses hardware FP, whereas %s uses software FP"
 msgstr ""
@@ -715,77 +715,92 @@
 #. Ignore init flag - it may not be set, despite the flags field
 #. containing valid data.
 #. Ignore init flag - it may not be set, despite the flags field containing valid data.
-#: elf32-arm.h:2609 elf32-cris.c:2938 elf32-m68hc1x.c:1362 elf32-m68k.c:397
-#: elf32-vax.c:546 elfxx-mips.c:9179
+#: elf32-arm.h:2597 elf32-cris.c:2980 elf32-m68hc1x.c:1338 elf32-m68k.c:397
+#: elf32-vax.c:546 elfxx-mips.c:9168
 #, c-format
 msgid "private flags = %lx:"
 msgstr ""
 
-#: elf32-arm.h:2618
+#: elf32-arm.h:2606
 #, c-format
 msgid " [interworking enabled]"
 msgstr ""
 
-#: elf32-arm.h:2626
+#: elf32-arm.h:2614
 #, c-format
 msgid " [VFP float format]"
 msgstr ""
 
-#: elf32-arm.h:2628
+#: elf32-arm.h:2616
 #, c-format
 msgid " [Maverick float format]"
 msgstr ""
 
-#: elf32-arm.h:2630
+#: elf32-arm.h:2618
 #, c-format
 msgid " [FPA float format]"
 msgstr ""
 
-#: elf32-arm.h:2639
+#: elf32-arm.h:2627
 #, c-format
 msgid " [new ABI]"
 msgstr ""
 
-#: elf32-arm.h:2642
+#: elf32-arm.h:2630
 #, c-format
 msgid " [old ABI]"
 msgstr ""
 
-#: elf32-arm.h:2645
+#: elf32-arm.h:2633
 #, c-format
 msgid " [software FP]"
 msgstr ""
 
-#: elf32-arm.h:2654
+#: elf32-arm.h:2642
 #, c-format
 msgid " [Version1 EABI]"
 msgstr ""
 
-#: elf32-arm.h:2657 elf32-arm.h:2668
+#: elf32-arm.h:2645 elf32-arm.h:2656
 #, c-format
 msgid " [sorted symbol table]"
 msgstr ""
 
-#: elf32-arm.h:2659 elf32-arm.h:2670
+#: elf32-arm.h:2647 elf32-arm.h:2658
 #, c-format
 msgid " [unsorted symbol table]"
 msgstr ""
 
-#: elf32-arm.h:2665
+#: elf32-arm.h:2653
 #, c-format
 msgid " [Version2 EABI]"
 msgstr ""
 
-#: elf32-arm.h:2673
+#: elf32-arm.h:2661
 #, c-format
 msgid " [dynamic symbols use segment index]"
 msgstr ""
 
-#: elf32-arm.h:2676
+#: elf32-arm.h:2664
 #, c-format
 msgid " [mapping symbols precede others]"
 msgstr ""
 
+#: elf32-arm.h:2671
+#, c-format
+msgid " [Version3 EABI]"
+msgstr ""
+
+#: elf32-arm.h:2674
+#, c-format
+msgid " [BE8]"
+msgstr ""
+
+#: elf32-arm.h:2677
+#, c-format
+msgid " [LE8]"
+msgstr ""
+
 #: elf32-arm.h:2683
 #, c-format
 msgid " <EABI version unrecognised>"
@@ -806,75 +821,80 @@
 msgid "<Unrecognised flag bits set>"
 msgstr ""
 
-#: elf32-avr.c:820 elf32-cris.c:1360 elf32-fr30.c:642 elf32-frv.c:2507
-#: elf32-i860.c:1226 elf32-ip2k.c:1576 elf32-iq2000.c:673 elf32-msp430.c:518
-#: elf32-openrisc.c:444 elf32-v850.c:1785 elf32-xstormy16.c:984
-#: elf64-mmix.c:1553
+#: elf32-avr.c:799 elf32-cris.c:1384 elf32-fr30.c:607 elf32-frv.c:2507
+#: elf32-i860.c:1204 elf32-ip2k.c:1579 elf32-iq2000.c:674 elf32-msp430.c:497
+#: elf32-openrisc.c:423 elf32-v850.c:1754 elf32-xstormy16.c:962
+#: elf64-mmix.c:1526
 msgid "internal error: dangerous relocation"
 msgstr ""
 
-#: elf32-cris.c:918
+#: elf32-cris.c:921
 #, c-format
 msgid "%s: unresolvable relocation %s against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-cris.c:964
+#: elf32-cris.c:978
 #, c-format
 msgid ""
 "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-cris.c:967 elf32-cris.c:1093
+#: elf32-cris.c:980
+#, c-format
+msgid "%s: No PLT for relocation %s against symbol `%s' from %s section"
+msgstr ""
+
+#: elf32-cris.c:984 elf32-cris.c:1117
 msgid "[whose name is lost]"
 msgstr ""
 
-#: elf32-cris.c:1082
+#: elf32-cris.c:1106
 #, c-format
 msgid ""
 "%s: relocation %s with non-zero addend %d against local symbol from %s "
 "section"
 msgstr ""
 
-#: elf32-cris.c:1089
+#: elf32-cris.c:1113
 #, c-format
 msgid ""
 "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-cris.c:1114
+#: elf32-cris.c:1138
 #, c-format
 msgid ""
 "%s: relocation %s is not allowed for global symbol: `%s' from %s section"
 msgstr ""
 
-#: elf32-cris.c:1129
+#: elf32-cris.c:1153
 #, c-format
 msgid "%s: relocation %s in section %s with no GOT created"
 msgstr ""
 
-#: elf32-cris.c:1248
+#: elf32-cris.c:1272
 #, c-format
 msgid "%s: Internal inconsistency; no relocation section %s"
 msgstr ""
 
-#: elf32-cris.c:2463
+#: elf32-cris.c:2502
 #, c-format
 msgid ""
 "%s, section %s:\n"
 "  relocation %s should not be used in a shared object; recompile with -fPIC"
 msgstr ""
 
-#: elf32-cris.c:2941
+#: elf32-cris.c:2983
 #, c-format
 msgid " [symbols have a _ prefix]"
 msgstr ""
 
-#: elf32-cris.c:2980
+#: elf32-cris.c:3022
 #, c-format
 msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols"
 msgstr ""
 
-#: elf32-cris.c:2981
+#: elf32-cris.c:3023
 #, c-format
 msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols"
 msgstr ""
@@ -917,7 +937,7 @@
 "%s: compiled with %s and linked with modules that use non-pic relocations"
 msgstr ""
 
-#: elf32-frv.c:4443 elf32-iq2000.c:861
+#: elf32-frv.c:4443 elf32-iq2000.c:862
 #, c-format
 msgid "%s: compiled with %s and linked with modules compiled with %s"
 msgstr ""
@@ -929,67 +949,67 @@
 "lx)"
 msgstr ""
 
-#: elf32-frv.c:4491 elf32-iq2000.c:899
+#: elf32-frv.c:4491 elf32-iq2000.c:900
 #, c-format
 msgid "private flags = 0x%lx:"
 msgstr ""
 
-#: elf32-gen.c:83 elf64-gen.c:82
+#: elf32-gen.c:83 elf64-gen.c:83
 #, c-format
 msgid "%s: Relocations in generic ELF (EM: %d)"
 msgstr ""
 
-#: elf32-hppa.c:542 elf32-m68hc1x.c:170 elf64-ppc.c:3186
+#: elf32-hppa.c:542 elf32-m68hc1x.c:161 elf64-ppc.c:3188
 #, c-format
 msgid "%s: cannot create stub entry %s"
 msgstr ""
 
-#: elf32-hppa.c:795 elf32-hppa.c:3326
+#: elf32-hppa.c:795 elf32-hppa.c:3315
 #, c-format
 msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections"
 msgstr ""
 
-#: elf32-hppa.c:1166 elf64-x86-64.c:665 elf64-x86-64.c:790
+#: elf32-hppa.c:1167 elf64-x86-64.c:665 elf64-x86-64.c:790
 #, c-format
 msgid ""
 "%s: relocation %s can not be used when making a shared object; recompile "
 "with -fPIC"
 msgstr ""
 
-#: elf32-hppa.c:1186
+#: elf32-hppa.c:1187
 #, c-format
 msgid ""
 "%s: relocation %s should not be used when making a shared object; recompile "
 "with -fPIC"
 msgstr ""
 
-#: elf32-hppa.c:1378
+#: elf32-hppa.c:1377
 #, c-format
 msgid "Could not find relocation section for %s"
 msgstr ""
 
-#: elf32-hppa.c:2584
+#: elf32-hppa.c:2572
 #, c-format
 msgid "%s: duplicate export stub %s"
 msgstr ""
 
-#: elf32-hppa.c:3174
+#: elf32-hppa.c:3162
 #, c-format
 msgid ""
 "%s(%s+0x%lx): %s fixup for insn 0x%x is not supported in a non-shared link"
 msgstr ""
 
-#: elf32-hppa.c:3204
+#: elf32-hppa.c:3192
 #, c-format
 msgid "%s(%s+0x%lx): fixing %s"
 msgstr ""
 
-#: elf32-hppa.c:3820
+#: elf32-hppa.c:3810
 #, c-format
 msgid "%s(%s+0x%lx): cannot handle %s for %s"
 msgstr ""
 
-#: elf32-hppa.c:4113
+#: elf32-hppa.c:4103
 msgid ".got section not immediately after .plt section"
 msgstr ""
 
@@ -998,33 +1018,33 @@
 msgid "%s: invalid relocation type %d"
 msgstr ""
 
-#: elf32-i386.c:864 elf32-s390.c:983 elf32-sparc.c:916 elf32-xtensa.c:648
+#: elf32-i386.c:864 elf32-s390.c:983 elf32-sparc.c:916 elf32-xtensa.c:641
 #: elf64-s390.c:936 elf64-x86-64.c:643
 #, c-format
 msgid "%s: bad symbol index: %d"
 msgstr ""
 
-#: elf32-i386.c:972 elf32-s390.c:1161 elf32-sh.c:6603 elf32-sparc.c:1040
+#: elf32-i386.c:972 elf32-s390.c:1161 elf32-sh.c:6590 elf32-sparc.c:1040
 #: elf64-s390.c:1122
 #, c-format
 msgid "%s: `%s' accessed both as normal and thread local symbol"
 msgstr ""
 
-#: elf32-i386.c:1089 elf32-s390.c:1272 elf64-ppc.c:4018 elf64-s390.c:1236
+#: elf32-i386.c:1089 elf32-s390.c:1272 elf64-ppc.c:4036 elf64-s390.c:1236
 #: elf64-x86-64.c:879
 #, c-format
 msgid "%s: bad relocation section name `%s'"
 msgstr ""
 
-#: elf32-i386.c:2897 elf32-m68k.c:1717 elf32-s390.c:3007 elf32-sparc.c:2868
-#: elf32-xtensa.c:2119 elf64-s390.c:3003 elf64-sparc.c:2631
-#: elf64-x86-64.c:2400
+#: elf32-i386.c:2889 elf32-m68k.c:1709 elf32-s390.c:2996 elf32-sparc.c:2857
+#: elf32-xtensa.c:2106 elf64-s390.c:2992 elf64-sparc.c:2620
+#: elf64-x86-64.c:2389
 #, c-format
 msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'"
 msgstr ""
 
-#: elf32-i386.c:2936 elf32-m68k.c:1756 elf32-s390.c:3057 elf64-s390.c:3053
-#: elf64-x86-64.c:2438
+#: elf32-i386.c:2928 elf32-m68k.c:1748 elf32-s390.c:3046 elf64-s390.c:3042
+#: elf64-x86-64.c:2427
 #, c-format
 msgid "%s(%s+0x%lx): reloc against `%s': error %d"
 msgstr ""
@@ -1049,12 +1069,12 @@
 msgstr ""
 
 #. Only if it's not an unresolved symbol.
-#: elf32-ip2k.c:1572
+#: elf32-ip2k.c:1575
 msgid "unsupported relocation between data/insn address spaces"
 msgstr ""
 
-#: elf32-iq2000.c:873 elf32-m68hc1x.c:1336 elf32-ppc.c:2293 elf64-sparc.c:3039
-#: elfxx-mips.c:9140
+#: elf32-iq2000.c:874 elf32-m68hc1x.c:1312 elf32-ppc.c:2293 elf64-sparc.c:3028
+#: elfxx-mips.c:9129
 #, c-format
 msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
 msgstr ""
@@ -1063,130 +1083,130 @@
 msgid "SDA relocation when _SDA_BASE_ not defined"
 msgstr ""
 
-#: elf32-m32r.c:2575 elf64-alpha.c:4199 elf64-alpha.c:4325 elf32-ia64.c:3920
-#: elf64-ia64.c:3920
+#: elf32-m32r.c:2564 elf64-alpha.c:4199 elf64-alpha.c:4325 elf32-ia64.c:3921
+#: elf64-ia64.c:3921
 #, c-format
 msgid "%s: unknown relocation type %d"
 msgstr ""
 
-#: elf32-m32r.c:2763 elf64-sh64.c:1689 elf-hppa.h:1387 elf-hppa.h:1421
-#: elf-hppa.h:1437 elf-m10300.c:1632
+#: elf32-m32r.c:2753 elf64-sh64.c:1689 elf-hppa.h:1406 elf-hppa.h:1433
+#: elf-hppa.h:1449 elf-m10300.c:1631
 #, c-format
 msgid ""
 "%s: warning: unresolvable relocation against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-m32r.c:3139
+#: elf32-m32r.c:3128
 #, c-format
 msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)"
 msgstr ""
 
-#: elf32-m32r.c:4222
+#: elf32-m32r.c:4211
 #, c-format
 msgid "%s: Instruction set mismatch with previous modules"
 msgstr ""
 
-#: elf32-m32r.c:4245
+#: elf32-m32r.c:4234
 #, c-format
 msgid "private flags = %lx"
 msgstr ""
 
-#: elf32-m32r.c:4250
+#: elf32-m32r.c:4239
 #, c-format
 msgid ": m32r instructions"
 msgstr ""
 
-#: elf32-m32r.c:4251
+#: elf32-m32r.c:4240
 #, c-format
 msgid ": m32rx instructions"
 msgstr ""
 
-#: elf32-m32r.c:4252
+#: elf32-m32r.c:4241
 #, c-format
 msgid ": m32r2 instructions"
 msgstr ""
 
-#: elf32-m68hc1x.c:1126
+#: elf32-m68hc1x.c:1102
 #, c-format
 msgid ""
 "Reference to the far symbol `%s' using a wrong relocation may result in "
 "incorrect execution"
 msgstr ""
 
-#: elf32-m68hc1x.c:1149
+#: elf32-m68hc1x.c:1125
 #, c-format
 msgid ""
 "banked address [%lx:%04lx] (%lx) is not in the same bank as current banked "
 "address [%lx:%04lx] (%lx)"
 msgstr ""
 
-#: elf32-m68hc1x.c:1168
+#: elf32-m68hc1x.c:1144
 #, c-format
 msgid ""
 "reference to a banked address [%lx:%04lx] in the normal address space at %"
 "04lx"
 msgstr ""
 
-#: elf32-m68hc1x.c:1301
+#: elf32-m68hc1x.c:1277
 #, c-format
 msgid ""
 "%s: linking files compiled for 16-bit integers (-mshort) and others for 32-"
 "bit integers"
 msgstr ""
 
-#: elf32-m68hc1x.c:1309
+#: elf32-m68hc1x.c:1285
 #, c-format
 msgid ""
 "%s: linking files compiled for 32-bit double (-fshort-double) and others for "
 "64-bit double"
 msgstr ""
 
-#: elf32-m68hc1x.c:1319
+#: elf32-m68hc1x.c:1295
 #, c-format
 msgid "%s: linking files compiled for HCS12 with others compiled for HC12"
 msgstr ""
 
-#: elf32-m68hc1x.c:1365
+#: elf32-m68hc1x.c:1341
 #, c-format
 msgid "[abi=32-bit int, "
 msgstr ""
 
-#: elf32-m68hc1x.c:1367
+#: elf32-m68hc1x.c:1343
 #, c-format
 msgid "[abi=16-bit int, "
 msgstr ""
 
-#: elf32-m68hc1x.c:1370
+#: elf32-m68hc1x.c:1346
 #, c-format
 msgid "64-bit double, "
 msgstr ""
 
-#: elf32-m68hc1x.c:1372
+#: elf32-m68hc1x.c:1348
 #, c-format
 msgid "32-bit double, "
 msgstr ""
 
-#: elf32-m68hc1x.c:1375
+#: elf32-m68hc1x.c:1351
 #, c-format
 msgid "cpu=HC11]"
 msgstr ""
 
-#: elf32-m68hc1x.c:1377
+#: elf32-m68hc1x.c:1353
 #, c-format
 msgid "cpu=HCS12]"
 msgstr ""
 
-#: elf32-m68hc1x.c:1379
+#: elf32-m68hc1x.c:1355
 #, c-format
 msgid "cpu=HC12]"
 msgstr ""
 
-#: elf32-m68hc1x.c:1382
+#: elf32-m68hc1x.c:1358
 #, c-format
 msgid " [memory=bank-model]"
 msgstr ""
 
-#: elf32-m68hc1x.c:1384
+#: elf32-m68hc1x.c:1360
 #, c-format
 msgid " [memory=flat]"
 msgstr ""
@@ -1233,100 +1253,100 @@
 "%s: compiled normally and linked with modules compiled with -mrelocatable"
 msgstr ""
 
-#: elf32-ppc.c:3545
+#: elf32-ppc.c:3534
 #, c-format
 msgid "%s: relocation %s cannot be used when making a shared object"
 msgstr ""
 
-#: elf32-ppc.c:3751
+#: elf32-ppc.c:3740
 #, c-format
 msgid "%s(%s+0x%lx): %s reloc against local symbol"
 msgstr ""
 
-#: elf32-ppc.c:4956 elf64-ppc.c:8015
+#: elf32-ppc.c:4945 elf64-ppc.c:8022
 #, c-format
 msgid "%s: unknown relocation type %d for symbol %s"
 msgstr ""
 
-#: elf32-ppc.c:5207
+#: elf32-ppc.c:5196
 #, c-format
 msgid "%s(%s+0x%lx): non-zero addend on %s reloc against `%s'"
 msgstr ""
 
-#: elf32-ppc.c:5518 elf32-ppc.c:5544 elf32-ppc.c:5603
+#: elf32-ppc.c:5507 elf32-ppc.c:5533 elf32-ppc.c:5592
 #, c-format
 msgid ""
 "%s: the target (%s) of a %s relocation is in the wrong output section (%s)"
 msgstr ""
 
-#: elf32-ppc.c:5658
+#: elf32-ppc.c:5647
 #, c-format
 msgid "%s: relocation %s is not yet supported for symbol %s."
 msgstr ""
 
-#: elf32-ppc.c:5713 elf64-ppc.c:8687
+#: elf32-ppc.c:5702 elf64-ppc.c:8694
 #, c-format
 msgid "%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'"
 msgstr ""
 
-#: elf32-ppc.c:5763 elf64-ppc.c:8733
+#: elf32-ppc.c:5752 elf64-ppc.c:8740
 #, c-format
 msgid "%s(%s+0x%lx): %s reloc against `%s': error %d"
 msgstr ""
 
-#: elf32-ppc.c:6007
+#: elf32-ppc.c:5996
 #, c-format
 msgid "corrupt or empty %s section in %s"
 msgstr ""
 
-#: elf32-ppc.c:6014
+#: elf32-ppc.c:6003
 #, c-format
 msgid "unable to read in %s section from %s"
 msgstr ""
 
-#: elf32-ppc.c:6020
+#: elf32-ppc.c:6009
 #, c-format
 msgid "corrupt %s section in %s"
 msgstr ""
 
-#: elf32-ppc.c:6063
+#: elf32-ppc.c:6052
 #, c-format
 msgid "warning: unable to set size of %s section in %s"
 msgstr ""
 
-#: elf32-ppc.c:6113
+#: elf32-ppc.c:6102
 msgid "failed to allocate space for new APUinfo section."
 msgstr ""
 
-#: elf32-ppc.c:6132
+#: elf32-ppc.c:6121
 msgid "failed to compute new APUinfo section."
 msgstr ""
 
-#: elf32-ppc.c:6135
+#: elf32-ppc.c:6124
 msgid "failed to install new APUinfo section."
 msgstr ""
 
-#: elf32-s390.c:2245 elf64-s390.c:2215
+#: elf32-s390.c:2234 elf64-s390.c:2204
 #, c-format
 msgid "%s(%s+0x%lx): invalid instruction for TLS relocation %s"
 msgstr ""
 
-#: elf32-sh64.c:215 elf64-sh64.c:2382
+#: elf32-sh64.c:215 elf64-sh64.c:2383
 #, c-format
 msgid "%s: compiled as 32-bit object and %s is 64-bit"
 msgstr ""
 
-#: elf32-sh64.c:218 elf64-sh64.c:2385
+#: elf32-sh64.c:218 elf64-sh64.c:2386
 #, c-format
 msgid "%s: compiled as 64-bit object and %s is 32-bit"
 msgstr ""
 
-#: elf32-sh64.c:220 elf64-sh64.c:2387
+#: elf32-sh64.c:220 elf64-sh64.c:2388
 #, c-format
 msgid "%s: object size does not match that of target %s"
 msgstr ""
 
-#: elf32-sh64.c:442 elf64-sh64.c:2954
+#: elf32-sh64.c:442 elf64-sh64.c:2955
 #, c-format
 msgid "%s: encountered datalabel symbol in input"
 msgstr ""
@@ -1344,7 +1364,7 @@
 msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16"
 msgstr ""
 
-#: elf32-sh64.c:589 elf64-sh64.c:1735
+#: elf32-sh64.c:589 elf64-sh64.c:1736
 #, c-format
 msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n"
 msgstr ""
@@ -1399,51 +1419,51 @@
 msgid "%s: 0x%lx: fatal: reloc overflow while relaxing"
 msgstr ""
 
-#: elf32-sh.c:4767 elf64-sh64.c:1568
+#: elf32-sh.c:4756 elf64-sh64.c:1568
 msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled"
 msgstr ""
 
-#: elf32-sh.c:4924
+#: elf32-sh.c:4913
 #, c-format
 msgid "%s: unresolvable relocation against symbol `%s' from %s section"
 msgstr ""
 
-#: elf32-sh.c:4997
+#: elf32-sh.c:4984
 #, c-format
 msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation"
 msgstr ""
 
-#: elf32-sh.c:5030 elf32-sh.c:5045
+#: elf32-sh.c:5017 elf32-sh.c:5032
 #, c-format
 msgid "%s: 0x%lx: fatal: unaligned %s relocation 0x%lx"
 msgstr ""
 
-#: elf32-sh.c:5059
+#: elf32-sh.c:5046
 #, c-format
 msgid "%s: 0x%lx: fatal: R_SH_PSHA relocation %d not in range -32..32"
 msgstr ""
 
-#: elf32-sh.c:5073
+#: elf32-sh.c:5060
 #, c-format
 msgid "%s: 0x%lx: fatal: R_SH_PSHL relocation %d not in range -32..32"
 msgstr ""
 
-#: elf32-sh.c:6815 elf64-alpha.c:4744
+#: elf32-sh.c:6802 elf64-alpha.c:4744
 #, c-format
 msgid "%s: TLS local exec code cannot be linked into shared objects"
 msgstr ""
 
-#: elf32-sparc.c:2510 elf64-sparc.c:2281
+#: elf32-sparc.c:2499 elf64-sparc.c:2270
 #, c-format
 msgid "%s: probably compiled without -fPIC?"
 msgstr ""
 
-#: elf32-sparc.c:3336
+#: elf32-sparc.c:3325
 #, c-format
 msgid "%s: compiled for a 64 bit system and target is 32 bit"
 msgstr ""
 
-#: elf32-sparc.c:3350
+#: elf32-sparc.c:3339
 #, c-format
 msgid "%s: linking little endian files with big endian files"
 msgstr ""
@@ -1482,39 +1502,39 @@
 msgid "FAILED to find previous HI16 reloc\n"
 msgstr ""
 
-#: elf32-v850.c:1789
+#: elf32-v850.c:1758
 msgid "could not locate special linker symbol __gp"
 msgstr ""
 
-#: elf32-v850.c:1793
+#: elf32-v850.c:1762
 msgid "could not locate special linker symbol __ep"
 msgstr ""
 
-#: elf32-v850.c:1797
+#: elf32-v850.c:1766
 msgid "could not locate special linker symbol __ctbp"
 msgstr ""
 
-#: elf32-v850.c:1982
+#: elf32-v850.c:1951
 #, c-format
 msgid "%s: Architecture mismatch with previous modules"
 msgstr ""
 
-#: elf32-v850.c:2003
+#: elf32-v850.c:1972
 #, c-format
 msgid "private flags = %lx: "
 msgstr ""
 
-#: elf32-v850.c:2008
+#: elf32-v850.c:1977
 #, c-format
 msgid "v850 architecture"
 msgstr ""
 
-#: elf32-v850.c:2009
+#: elf32-v850.c:1978
 #, c-format
 msgid "v850e architecture"
 msgstr ""
 
-#: elf32-v850.c:2010
+#: elf32-v850.c:1979
 #, c-format
 msgid "v850e1 architecture"
 msgstr ""
@@ -1556,10 +1576,14 @@
 msgid "%s: warning: %s relocation to 0x%x from %s section"
 msgstr ""
 
-#: elf32-xstormy16.c:462 elf32-ia64.c:2417 elf64-ia64.c:2417
+#: elf32-xstormy16.c:462 elf32-ia64.c:2418 elf64-ia64.c:2418
 msgid "non-zero addend in @fptr reloc"
 msgstr ""
 
+#: elf32-xtensa.c:2051
+msgid "dynamic relocation in read-only section"
+msgstr ""
+
 #: elf64-alpha.c:1067
 msgid "GPDISP relocation did not find ldah and lda instructions"
 msgstr ""
@@ -1613,7 +1637,7 @@
 msgid "%s: tp-relative relocation against dynamic symbol %s"
 msgstr ""
 
-#: elf64-hppa.c:2082
+#: elf64-hppa.c:2083
 #, c-format
 msgid "stub entry for %s cannot load .plt, dp offset = %ld"
 msgstr ""
@@ -1630,113 +1654,113 @@
 "08lx\n"
 msgstr ""
 
-#: elf64-mmix.c:1630
+#: elf64-mmix.c:1603
 #, c-format
 msgid ""
 "%s: base-plus-offset relocation against register symbol: (unknown) in %s"
 msgstr ""
 
-#: elf64-mmix.c:1635
+#: elf64-mmix.c:1608
 #, c-format
 msgid "%s: base-plus-offset relocation against register symbol: %s in %s"
 msgstr ""
 
-#: elf64-mmix.c:1679
+#: elf64-mmix.c:1652
 #, c-format
 msgid "%s: register relocation against non-register symbol: (unknown) in %s"
 msgstr ""
 
-#: elf64-mmix.c:1684
+#: elf64-mmix.c:1657
 #, c-format
 msgid "%s: register relocation against non-register symbol: %s in %s"
 msgstr ""
 
-#: elf64-mmix.c:1721
+#: elf64-mmix.c:1694
 #, c-format
 msgid "%s: directive LOCAL valid only with a register or absolute value"
 msgstr ""
 
-#: elf64-mmix.c:1749
+#: elf64-mmix.c:1722
 #, c-format
 msgid ""
 "%s: LOCAL directive: Register $%ld is not a local register.  First global "
 "register is $%ld."
 msgstr ""
 
-#: elf64-mmix.c:2229
+#: elf64-mmix.c:2202
 #, c-format
 msgid ""
 "%s: Error: multiple definition of `%s'; start of %s is set in a earlier "
 "linked file\n"
 msgstr ""
 
-#: elf64-mmix.c:2288
+#: elf64-mmix.c:2261
 msgid "Register section has contents\n"
 msgstr ""
 
-#: elf64-mmix.c:2494
+#: elf64-mmix.c:2467
 #, c-format
 msgid ""
 "Internal inconsistency: remaining %u != max %u.\n"
 "  Please report this bug."
 msgstr ""
 
-#: elf64-ppc.c:2431 libbfd.c:821
+#: elf64-ppc.c:2433 libbfd.c:821
 #, c-format
 msgid "%s: compiled for a big endian system and target is little endian"
 msgstr ""
 
-#: elf64-ppc.c:2434 libbfd.c:823
+#: elf64-ppc.c:2436 libbfd.c:823
 #, c-format
 msgid "%s: compiled for a little endian system and target is big endian"
 msgstr ""
 
-#: elf64-ppc.c:4638
+#: elf64-ppc.c:4656
 #, c-format
 msgid ""
 "copy reloc against `%s' requires lazy plt linking; avoid setting "
 "LD_BIND_NOW=1 or upgrade gcc"
 msgstr ""
 
-#: elf64-ppc.c:5009
+#: elf64-ppc.c:5027
 #, c-format
 msgid "%s: .opd is not a regular array of opd entries"
 msgstr ""
 
-#: elf64-ppc.c:5019
+#: elf64-ppc.c:5037
 #, c-format
 msgid "%s: unexpected reloc type %u in .opd section"
 msgstr ""
 
-#: elf64-ppc.c:5039
+#: elf64-ppc.c:5057
 #, c-format
 msgid "%s: undefined sym `%s' in .opd section"
 msgstr ""
 
-#: elf64-ppc.c:6265
+#: elf64-ppc.c:6272
 #, c-format
 msgid "can't find branch stub `%s'"
 msgstr ""
 
-#: elf64-ppc.c:6304 elf64-ppc.c:6379
+#: elf64-ppc.c:6311 elf64-ppc.c:6386
 #, c-format
 msgid "linkage table error against `%s'"
 msgstr ""
 
-#: elf64-ppc.c:6496
+#: elf64-ppc.c:6503
 #, c-format
 msgid "can't build branch stub `%s'"
 msgstr ""
 
-#: elf64-ppc.c:7215
+#: elf64-ppc.c:7222
 msgid ".glink and .plt too far apart"
 msgstr ""
 
-#: elf64-ppc.c:7327
+#: elf64-ppc.c:7334
 msgid "stubs don't match calculated size"
 msgstr ""
 
-#: elf64-ppc.c:7339
+#: elf64-ppc.c:7346
 #, c-format
 msgid ""
 "linker stubs in %u groups\n"
@@ -1747,24 +1771,24 @@
 "  plt call     %lu"
 msgstr ""
 
-#: elf64-ppc.c:7537
+#: elf64-ppc.c:7544
 #, c-format
 msgid "%s(%s+0x%lx): %s used with TLS symbol %s"
 msgstr ""
 
-#: elf64-ppc.c:7538
+#: elf64-ppc.c:7545
 #, c-format
 msgid "%s(%s+0x%lx): %s used with non-TLS symbol %s"
 msgstr ""
 
-#: elf64-ppc.c:7949
+#: elf64-ppc.c:7956
 #, c-format
 msgid ""
 "%s(%s+0x%lx): automatic multiple TOCs not supported using your crt files; "
 "recompile with -mminimal-toc or upgrade gcc"
 msgstr ""
 
-#: elf64-ppc.c:7957
+#: elf64-ppc.c:7964
 #, c-format
 msgid ""
 "%s(%s+0x%lx): sibling call optimization to `%s' does not allow automatic "
@@ -1772,12 +1796,12 @@
 "or make `%s' extern"
 msgstr ""
 
-#: elf64-ppc.c:8555
+#: elf64-ppc.c:8562
 #, c-format
 msgid "%s: relocation %s is not supported for symbol %s."
 msgstr ""
 
-#: elf64-ppc.c:8634
+#: elf64-ppc.c:8641
 #, c-format
 msgid "%s: error: relocation %s not a multiple of %d"
 msgstr ""
@@ -1807,7 +1831,7 @@
 msgid "Symbol `%s' has differing types: %s in %s, previously REGISTER in %s"
 msgstr ""
 
-#: elf64-sparc.c:3020
+#: elf64-sparc.c:3009
 #, c-format
 msgid "%s: linking UltraSPARC specific with HAL specific code"
 msgstr ""
@@ -1913,277 +1937,277 @@
 msgid "%s: unsupported relocation type %s"
 msgstr ""
 
-#: elfcode.h:1068
+#: elfcode.h:1050
 #, c-format
 msgid "%s: version count (%ld) does not match symbol count (%ld)"
 msgstr ""
 
-#: elfcode.h:1294
+#: elfcode.h:1276
 #, c-format
 msgid "%s(%s): relocation %d has invalid symbol index %ld"
 msgstr ""
 
-#: elflink.c:1349
+#: elflink.c:1350
 #, c-format
 msgid "%s: warning: unexpected redefinition of indirect versioned symbol `%s'"
 msgstr ""
 
-#: elflink.c:1668
+#: elflink.c:1669
 #, c-format
 msgid "%s: undefined versioned symbol name %s"
 msgstr ""
 
-#: elflink.c:1817
+#: elflink.c:1818
 #, c-format
 msgid ""
 "%s: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%s'"
 msgstr ""
 
-#: elflink.c:2006
+#: elflink.c:2007
 #, c-format
 msgid "%s: relocation size mismatch in %s section %s"
 msgstr ""
 
-#: elflink.c:2295
+#: elflink.c:2296
 #, c-format
 msgid "warning: type and size of dynamic symbol `%s' are not defined"
 msgstr ""
 
-#: elflink.h:196
+#: elflink.c:2917
 msgid "warning: "
 msgstr ""
 
-#: elflink.h:691
+#: elflink.c:3411
 #, c-format
 msgid "%s: %s: invalid version %u (max %d)"
 msgstr ""
 
-#: elflink.h:732
+#: elflink.c:3452
 #, c-format
 msgid "%s: %s: invalid needed version %d"
 msgstr ""
 
-#: elflink.h:907
+#: elflink.c:3627
 #, c-format
 msgid "Warning: alignment %u of symbol `%s' in %s is smaller than %u in %s"
 msgstr ""
 
-#: elflink.h:921
+#: elflink.c:3641
 #, c-format
 msgid "Warning: size of symbol `%s' changed from %lu in %s to %lu in %s"
 msgstr ""
 
-#: elflink.h:1858
+#: elflink.c:4837
 #, c-format
 msgid "%s: undefined version: %s"
 msgstr ""
 
-#: elflink.h:1924
+#: elflink.c:4903
 #, c-format
 msgid "%s: .preinit_array section is not allowed in DSO"
 msgstr ""
 
-#: elflink.h:2750
+#: elflink.c:5594
 msgid "Not enough memory to sort relocations"
 msgstr ""
 
-#: elflink.h:3609 elflink.h:3652
-#, c-format
-msgid "%s: could not find output section %s"
-msgstr ""
-
-#: elflink.h:3615
-#, c-format
-msgid "warning: %s section has zero size"
-msgstr ""
-
-#: elflink.h:4124
+#: elflink.c:5976
 #, c-format
 msgid "%s: %s symbol `%s' in %s is referenced by DSO"
 msgstr ""
 
-#: elflink.h:4205
+#: elflink.c:6057
 #, c-format
 msgid "%s: could not find output section %s for input section %s"
 msgstr ""
 
-#: elflink.h:4307
+#: elflink.c:6156
 #, c-format
 msgid "%s: %s symbol `%s' isn't defined"
 msgstr ""
 
-#: elflink.h:4691 elflink.h:4733
+#: elflink.c:6575 elflink.c:6616
 msgid "%T: discarded in section `%s' from %s\n"
 msgstr ""
 
-#: elflink.h:5542
+#: elflink.c:7870 elflink.c:7912
+#, c-format
+msgid "%s: could not find output section %s"
+msgstr ""
+
+#: elflink.c:7876
+#, c-format
+msgid "warning: %s section has zero size"
+msgstr ""
+
+#: elflink.c:8427
 msgid "Warning: gc-sections option ignored"
 msgstr ""
 
-#: elfxx-mips.c:899
+#: elfxx-mips.c:890
 msgid "static procedure (no name)"
 msgstr ""
 
-#: elfxx-mips.c:2037
+#: elfxx-mips.c:2028
 msgid "not enough GOT space for local GOT entries"
 msgstr ""
 
-#: elfxx-mips.c:3786
+#: elfxx-mips.c:3775
 #, c-format
 msgid "%s: %s+0x%lx: jump to stub routine which is not jal"
 msgstr ""
 
-#: elfxx-mips.c:5271
+#: elfxx-mips.c:5260
 #, c-format
 msgid "%s: Malformed reloc detected for section %s"
 msgstr ""
 
-#: elfxx-mips.c:5345
+#: elfxx-mips.c:5334
 #, c-format
 msgid "%s: CALL16 reloc at 0x%lx not against global symbol"
 msgstr ""
 
-#: elfxx-mips.c:8642
+#: elfxx-mips.c:8631
 #, c-format
 msgid "%s: illegal section name `%s'"
 msgstr ""
 
-#: elfxx-mips.c:8965
+#: elfxx-mips.c:8954
 #, c-format
 msgid "%s: endianness incompatible with that of the selected emulation"
 msgstr ""
 
-#: elfxx-mips.c:8977
+#: elfxx-mips.c:8966
 #, c-format
 msgid "%s: ABI is incompatible with that of the selected emulation"
 msgstr ""
 
-#: elfxx-mips.c:9049
+#: elfxx-mips.c:9038
 #, c-format
 msgid "%s: warning: linking PIC files with non-PIC files"
 msgstr ""
 
-#: elfxx-mips.c:9066
+#: elfxx-mips.c:9055
 #, c-format
 msgid "%s: linking 32-bit code with 64-bit code"
 msgstr ""
 
-#: elfxx-mips.c:9094
+#: elfxx-mips.c:9083
 #, c-format
 msgid "%s: linking %s module with previous %s modules"
 msgstr ""
 
-#: elfxx-mips.c:9117
+#: elfxx-mips.c:9106
 #, c-format
 msgid "%s: ABI mismatch: linking %s module with previous %s modules"
 msgstr ""
 
-#: elfxx-mips.c:9182
+#: elfxx-mips.c:9171
 #, c-format
 msgid " [abi=O32]"
 msgstr ""
 
-#: elfxx-mips.c:9184
+#: elfxx-mips.c:9173
 #, c-format
 msgid " [abi=O64]"
 msgstr ""
 
-#: elfxx-mips.c:9186
+#: elfxx-mips.c:9175
 #, c-format
 msgid " [abi=EABI32]"
 msgstr ""
 
-#: elfxx-mips.c:9188
+#: elfxx-mips.c:9177
 #, c-format
 msgid " [abi=EABI64]"
 msgstr ""
 
-#: elfxx-mips.c:9190
+#: elfxx-mips.c:9179
 #, c-format
 msgid " [abi unknown]"
 msgstr ""
 
-#: elfxx-mips.c:9192
+#: elfxx-mips.c:9181
 #, c-format
 msgid " [abi=N32]"
 msgstr ""
 
-#: elfxx-mips.c:9194
+#: elfxx-mips.c:9183
 #, c-format
 msgid " [abi=64]"
 msgstr ""
 
-#: elfxx-mips.c:9196
+#: elfxx-mips.c:9185
 #, c-format
 msgid " [no abi set]"
 msgstr ""
 
-#: elfxx-mips.c:9199
+#: elfxx-mips.c:9188
 #, c-format
 msgid " [mips1]"
 msgstr ""
 
-#: elfxx-mips.c:9201
+#: elfxx-mips.c:9190
 #, c-format
 msgid " [mips2]"
 msgstr ""
 
-#: elfxx-mips.c:9203
+#: elfxx-mips.c:9192
 #, c-format
 msgid " [mips3]"
 msgstr ""
 
-#: elfxx-mips.c:9205
+#: elfxx-mips.c:9194
 #, c-format
 msgid " [mips4]"
 msgstr ""
 
-#: elfxx-mips.c:9207
+#: elfxx-mips.c:9196
 #, c-format
 msgid " [mips5]"
 msgstr ""
 
-#: elfxx-mips.c:9209
+#: elfxx-mips.c:9198
 #, c-format
 msgid " [mips32]"
 msgstr ""
 
-#: elfxx-mips.c:9211
+#: elfxx-mips.c:9200
 #, c-format
 msgid " [mips64]"
 msgstr ""
 
-#: elfxx-mips.c:9213
+#: elfxx-mips.c:9202
 #, c-format
 msgid " [mips32r2]"
 msgstr ""
 
-#: elfxx-mips.c:9215
+#: elfxx-mips.c:9204
 #, c-format
 msgid " [mips64r2]"
 msgstr ""
 
-#: elfxx-mips.c:9217
+#: elfxx-mips.c:9206
 #, c-format
 msgid " [unknown ISA]"
 msgstr ""
 
-#: elfxx-mips.c:9220
+#: elfxx-mips.c:9209
 #, c-format
 msgid " [mdmx]"
 msgstr ""
 
-#: elfxx-mips.c:9223
+#: elfxx-mips.c:9212
 #, c-format
 msgid " [mips16]"
 msgstr ""
 
-#: elfxx-mips.c:9226
+#: elfxx-mips.c:9215
 #, c-format
 msgid " [32bitmode]"
 msgstr ""
 
-#: elfxx-mips.c:9228
+#: elfxx-mips.c:9217
 #, c-format
 msgid " [not 32bitmode]"
 msgstr ""
@@ -2293,12 +2317,12 @@
 msgid "Deprecated %s called\n"
 msgstr ""
 
-#: linker.c:1829
+#: linker.c:1831
 #, c-format
 msgid "%s: indirect symbol `%s' to `%s' is a loop"
 msgstr ""
 
-#: linker.c:2697
+#: linker.c:2699
 #, c-format
 msgid "Attempt to do relocatable link with %s input and %s output"
 msgstr ""
@@ -2833,75 +2857,75 @@
 msgid "%s: loader reloc in read-only section %s"
 msgstr ""
 
-#: elf32-ia64.c:2362 elf64-ia64.c:2362
+#: elf32-ia64.c:2363 elf64-ia64.c:2363
 msgid "@pltoff reloc against local symbol"
 msgstr ""
 
-#: elf32-ia64.c:3767 elf64-ia64.c:3767
+#: elf32-ia64.c:3768 elf64-ia64.c:3768
 #, c-format
 msgid "%s: short data segment overflowed (0x%lx >= 0x400000)"
 msgstr ""
 
-#: elf32-ia64.c:3778 elf64-ia64.c:3778
+#: elf32-ia64.c:3779 elf64-ia64.c:3779
 #, c-format
 msgid "%s: __gp does not cover short data segment"
 msgstr ""
 
-#: elf32-ia64.c:4026 elf64-ia64.c:4026
+#: elf32-ia64.c:4027 elf64-ia64.c:4027
 #, c-format
 msgid "%s: non-pic code with imm relocation against dynamic symbol `%s'"
 msgstr ""
 
-#: elf32-ia64.c:4091 elf64-ia64.c:4091
+#: elf32-ia64.c:4092 elf64-ia64.c:4092
 #, c-format
 msgid "%s: @gprel relocation against dynamic symbol %s"
 msgstr ""
 
-#: elf32-ia64.c:4151 elf64-ia64.c:4151
+#: elf32-ia64.c:4152 elf64-ia64.c:4152
 #, c-format
 msgid "%s: linking non-pic code in a position independent executable"
 msgstr ""
 
-#: elf32-ia64.c:4288 elf64-ia64.c:4288
+#: elf32-ia64.c:4289 elf64-ia64.c:4289
 #, c-format
 msgid "%s: @internal branch to dynamic symbol %s"
 msgstr ""
 
-#: elf32-ia64.c:4290 elf64-ia64.c:4290
+#: elf32-ia64.c:4291 elf64-ia64.c:4291
 #, c-format
 msgid "%s: speculation fixup to dynamic symbol %s"
 msgstr ""
 
-#: elf32-ia64.c:4292 elf64-ia64.c:4292
+#: elf32-ia64.c:4293 elf64-ia64.c:4293
 #, c-format
 msgid "%s: @pcrel relocation against dynamic symbol %s"
 msgstr ""
 
-#: elf32-ia64.c:4504 elf64-ia64.c:4504
+#: elf32-ia64.c:4505 elf64-ia64.c:4505
 msgid "unsupported reloc"
 msgstr ""
 
-#: elf32-ia64.c:4783 elf64-ia64.c:4783
+#: elf32-ia64.c:4784 elf64-ia64.c:4784
 #, c-format
 msgid "%s: linking trap-on-NULL-dereference with non-trapping files"
 msgstr ""
 
-#: elf32-ia64.c:4792 elf64-ia64.c:4792
+#: elf32-ia64.c:4793 elf64-ia64.c:4793
 #, c-format
 msgid "%s: linking big-endian files with little-endian files"
 msgstr ""
 
-#: elf32-ia64.c:4801 elf64-ia64.c:4801
+#: elf32-ia64.c:4802 elf64-ia64.c:4802
 #, c-format
 msgid "%s: linking 64-bit files with 32-bit files"
 msgstr ""
 
-#: elf32-ia64.c:4810 elf64-ia64.c:4810
+#: elf32-ia64.c:4811 elf64-ia64.c:4811
 #, c-format
 msgid "%s: linking constant-gp files with non-constant-gp files"
 msgstr ""
 
-#: elf32-ia64.c:4820 elf64-ia64.c:4820
+#: elf32-ia64.c:4821 elf64-ia64.c:4821
 #, c-format
 msgid "%s: linking auto-pic files with non-auto-pic files"
 msgstr ""
diff --git a/bfd/po/fr.po b/bfd/po/fr.po
index 831daff..c5d65f6 100644
--- a/bfd/po/fr.po
+++ b/bfd/po/fr.po
@@ -1,17 +1,18 @@
 # Messages français pour GNU concernant bfd.
-# Copyright © 1996 Free Software Foundation, Inc.
+# Copyright © 2004 Free Software Foundation, Inc.
 # Michel Robitaille <robitail@IRO.UMontreal.CA>, traducteur depuis/since 1996.
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: GNU bfd 2.14rel030712\n"
 "POT-Creation-Date: 2003-07-11 13:53+0930\n"
-"PO-Revision-Date: 2003-08-05 08:00-0500\n"
+"PO-Revision-Date: 2004-05-10 08:00-0500\n"
 "Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n"
 "Language-Team: French <traduc@traduc.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=ISO-8859-1\n"
 "Content-Transfer-Encoding: 8-bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
 
 #: aout-adobe.c:204
 #, c-format
diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c
index 05fb7de..5c80561 100644
--- a/bfd/ppcboot.c
+++ b/bfd/ppcboot.c
@@ -1,5 +1,5 @@
 /* BFD back-end for PPCbug boot records.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Michael Meissner, Cygnus Support, <meissner@cygnus.com>
 
@@ -210,7 +210,7 @@
     return NULL;
   sec->flags = SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_CODE | SEC_HAS_CONTENTS;
   sec->vma = 0;
-  sec->_raw_size = statbuf.st_size - sizeof (ppcboot_hdr_t);
+  sec->size = statbuf.st_size - sizeof (ppcboot_hdr_t);
   sec->filepos = sizeof (ppcboot_hdr_t);
 
   ppcboot_mkobject (abfd);
@@ -311,7 +311,7 @@
   /* End symbol.  */
   syms[1].the_bfd = abfd;
   syms[1].name = mangle_name (abfd, "end");
-  syms[1].value = sec->_raw_size;
+  syms[1].value = sec->size;
   syms[1].flags = BSF_GLOBAL;
   syms[1].section = sec;
   syms[1].udata.p = NULL;
@@ -319,7 +319,7 @@
   /* Size symbol.  */
   syms[2].the_bfd = abfd;
   syms[2].name = mangle_name (abfd, "size");
-  syms[2].value = sec->_raw_size;
+  syms[2].value = sec->size;
   syms[2].flags = BSF_GLOBAL;
   syms[2].section = bfd_abs_section_ptr;
   syms[2].udata.p = NULL;
@@ -469,6 +469,7 @@
 #define ppcboot_bfd_relax_section bfd_generic_relax_section
 #define ppcboot_bfd_gc_sections bfd_generic_gc_sections
 #define ppcboot_bfd_merge_sections bfd_generic_merge_sections
+#define ppcboot_bfd_is_group_section bfd_generic_is_group_section
 #define ppcboot_bfd_discard_group bfd_generic_discard_group
 #define ppcboot_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define ppcboot_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
@@ -483,6 +484,7 @@
 #define ppcboot_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
 #define ppcboot_bfd_copy_private_section_data _bfd_generic_bfd_copy_private_section_data
 #define ppcboot_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
+#define ppcboot_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
 #define ppcboot_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
 #define ppcboot_bfd_print_private_bfd_dat ppcboot_bfd_print_private_bfd_data
 
diff --git a/bfd/ptrace-core.c b/bfd/ptrace-core.c
index 15b6777..c22864a 100644
--- a/bfd/ptrace-core.c
+++ b/bfd/ptrace-core.c
@@ -108,9 +108,9 @@
   core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
   core_regsec (abfd)->flags = SEC_HAS_CONTENTS;
 
-  core_datasec (abfd)->_raw_size =  u.pt_dsize;
-  core_stacksec (abfd)->_raw_size = u.pt_ssize;
-  core_regsec (abfd)->_raw_size = sizeof (u);
+  core_datasec (abfd)->size =  u.pt_dsize;
+  core_stacksec (abfd)->size = u.pt_ssize;
+  core_regsec (abfd)->size = sizeof (u);
 
   core_datasec (abfd)->vma = u.pt_o_data_start;
   core_stacksec (abfd)->vma = USRSTACK - u.pt_ssize;
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 9bffaa3..e8279d2 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -623,8 +623,7 @@
     }
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > (input_section->_cooked_size
-			      / bfd_octets_per_byte (abfd)))
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
@@ -1013,8 +1012,7 @@
     }
 
   /* Is the address of the relocation really within the section?  */
-  if (reloc_entry->address > (input_section->_cooked_size
-			      / bfd_octets_per_byte (abfd)))
+  if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
     return bfd_reloc_outofrange;
 
   /* Work out which section the relocation is targeted at and the
@@ -1350,7 +1348,7 @@
   bfd_vma relocation;
 
   /* Sanity check the address.  */
-  if (address > input_section->_raw_size)
+  if (address > bfd_get_section_limit (input_bfd, input_section))
     return bfd_reloc_outofrange;
 
   /* This function assumes that we are dealing with a basic relocation
@@ -1647,6 +1645,11 @@
 The 24-bit relocation is used in some Intel 960 configurations.
 
 ENUM
+  BFD_RELOC_32_SECREL
+ENUMDOC
+  Section relative relocations.  Some targets need this for DWARF2.
+
+ENUM
   BFD_RELOC_32_GOT_PCREL
 ENUMX
   BFD_RELOC_16_GOT_PCREL
@@ -2061,14 +2064,6 @@
   BFD_RELOC_LO16
 ENUMDOC
   Low 16 bits.
-ENUM
-  BFD_RELOC_PCREL_HI16_S
-ENUMDOC
-  Like BFD_RELOC_HI16_S, but PC relative.
-ENUM
-  BFD_RELOC_PCREL_LO16
-ENUMDOC
-  Like BFD_RELOC_LO16, but PC relative.
 
 ENUM
   BFD_RELOC_MIPS_LITERAL
@@ -2954,6 +2949,12 @@
 ENUMX
   BFD_RELOC_M32R_GOTOFF
 ENUMX
+  BFD_RELOC_M32R_GOTOFF_HI_ULO
+ENUMX
+  BFD_RELOC_M32R_GOTOFF_HI_SLO
+ENUMX
+  BFD_RELOC_M32R_GOTOFF_LO
+ENUMX
   BFD_RELOC_M32R_GOTPC24
 ENUMX
   BFD_RELOC_M32R_GOT16_HI_ULO
@@ -3771,6 +3772,126 @@
   This is the 5 bits of a value.
 
 ENUM
+  BFD_RELOC_16C_NUM08
+ENUMX
+  BFD_RELOC_16C_NUM08_C
+ENUMX
+  BFD_RELOC_16C_NUM16
+ENUMX
+  BFD_RELOC_16C_NUM16_C
+ENUMX
+  BFD_RELOC_16C_NUM32
+ENUMX
+  BFD_RELOC_16C_NUM32_C
+ENUMX
+  BFD_RELOC_16C_DISP04
+ENUMX
+  BFD_RELOC_16C_DISP04_C
+ENUMX
+  BFD_RELOC_16C_DISP08
+ENUMX
+  BFD_RELOC_16C_DISP08_C
+ENUMX
+  BFD_RELOC_16C_DISP16
+ENUMX
+  BFD_RELOC_16C_DISP16_C
+ENUMX
+  BFD_RELOC_16C_DISP24
+ENUMX
+  BFD_RELOC_16C_DISP24_C
+ENUMX
+  BFD_RELOC_16C_DISP24a
+ENUMX
+  BFD_RELOC_16C_DISP24a_C
+ENUMX
+  BFD_RELOC_16C_REG04
+ENUMX
+  BFD_RELOC_16C_REG04_C
+ENUMX
+  BFD_RELOC_16C_REG04a
+ENUMX
+  BFD_RELOC_16C_REG04a_C
+ENUMX
+  BFD_RELOC_16C_REG14
+ENUMX
+  BFD_RELOC_16C_REG14_C
+ENUMX
+  BFD_RELOC_16C_REG16
+ENUMX
+  BFD_RELOC_16C_REG16_C
+ENUMX
+  BFD_RELOC_16C_REG20
+ENUMX
+  BFD_RELOC_16C_REG20_C
+ENUMX
+  BFD_RELOC_16C_ABS20
+ENUMX
+  BFD_RELOC_16C_ABS20_C
+ENUMX
+  BFD_RELOC_16C_ABS24
+ENUMX
+  BFD_RELOC_16C_ABS24_C
+ENUMX
+  BFD_RELOC_16C_IMM04
+ENUMX
+  BFD_RELOC_16C_IMM04_C
+ENUMX
+  BFD_RELOC_16C_IMM16
+ENUMX
+  BFD_RELOC_16C_IMM16_C
+ENUMX
+  BFD_RELOC_16C_IMM20
+ENUMX
+  BFD_RELOC_16C_IMM20_C
+ENUMX
+  BFD_RELOC_16C_IMM24
+ENUMX
+  BFD_RELOC_16C_IMM24_C
+ENUMX
+  BFD_RELOC_16C_IMM32
+ENUMX
+  BFD_RELOC_16C_IMM32_C
+ENUMDOC
+  NS CR16C Relocations.
+
+ENUM 
+  BFD_RELOC_CRX_REL4
+ENUMX
+  BFD_RELOC_CRX_REL8
+ENUMX
+  BFD_RELOC_CRX_REL8_CMP
+ENUMX
+  BFD_RELOC_CRX_REL16
+ENUMX
+  BFD_RELOC_CRX_REL24
+ENUMX
+  BFD_RELOC_CRX_REL32
+ENUMX
+  BFD_RELOC_CRX_REGREL12
+ENUMX
+  BFD_RELOC_CRX_REGREL22
+ENUMX
+  BFD_RELOC_CRX_REGREL28
+ENUMX
+  BFD_RELOC_CRX_REGREL32
+ENUMX
+  BFD_RELOC_CRX_ABS16
+ENUMX
+  BFD_RELOC_CRX_ABS32
+ENUMX
+  BFD_RELOC_CRX_NUM8
+ENUMX
+  BFD_RELOC_CRX_NUM16
+ENUMX
+  BFD_RELOC_CRX_NUM32
+ENUMX
+  BFD_RELOC_CRX_IMM16
+ENUMX
+  BFD_RELOC_CRX_IMM32
+ENUMDOC 
+  NS CRX Relocations.
+
+ENUM
   BFD_RELOC_CRIS_BDISP8
 ENUMX
   BFD_RELOC_CRIS_UNSIGNED_5
@@ -4096,8 +4217,7 @@
 
 DESCRIPTION
 	Provides default handling for relaxing for back ends which
-	don't do relaxing -- i.e., does nothing except make sure that the
-	final size of the section is set.
+	don't do relaxing.
 */
 
 bfd_boolean
@@ -4106,11 +4226,6 @@
 			   struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
 			   bfd_boolean *again)
 {
-  /* We're not relaxing the section, so just copy the size info if it's
-     zero.  Someone else, like bfd_merge_sections, might have set it, so
-     don't overwrite a non-zero value.  */
-  if (section->_cooked_size == 0)
-    section->_cooked_size = section->_raw_size;
   *again = FALSE;
   return TRUE;
 }
@@ -4189,6 +4304,7 @@
   long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
   arelent **reloc_vector = NULL;
   long reloc_count;
+  bfd_size_type sz;
 
   if (reloc_size < 0)
     goto error_return;
@@ -4198,22 +4314,10 @@
     goto error_return;
 
   /* Read in the section.  */
-  if (!bfd_get_section_contents (input_bfd,
-				 input_section,
-				 data,
-				 0,
-				 input_section->_raw_size))
+  sz = input_section->rawsize ? input_section->rawsize : input_section->size;
+  if (!bfd_get_section_contents (input_bfd, input_section, data, 0, sz))
     goto error_return;
 
-  /* Don't set input_section->_cooked_size here.  The caller has set
-     _cooked_size or called bfd_relax_section, which sets _cooked_size.
-     Despite using this generic relocation function, some targets perform
-     target-specific relaxation or string merging, which happens before
-     this function is called.  We do not want to clobber the _cooked_size
-     they computed.  */
-
-  input_section->reloc_done = TRUE;
-
   reloc_count = bfd_canonicalize_reloc (input_bfd,
 					input_section,
 					reloc_vector,
diff --git a/bfd/reloc16.c b/bfd/reloc16.c
index 720e2d6..04e6a21 100644
--- a/bfd/reloc16.c
+++ b/bfd/reloc16.c
@@ -1,6 +1,6 @@
 /* 8 and 16 bit COFF relocation functions, for BFD.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+   2002, 2003, 2004 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -230,7 +230,8 @@
       free ((char *) shrinks);
     }
 
-  input_section->_cooked_size -= shrink;
+  input_section->rawsize = input_section->size;
+  input_section->size -= shrink;
   free ((char *) reloc_vector);
   return TRUE;
 }
@@ -255,6 +256,7 @@
   long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
   arelent **reloc_vector;
   long reloc_count;
+  bfd_size_type sz;
 
   if (reloc_size < 0)
     return NULL;
@@ -267,11 +269,8 @@
 						       symbols);
 
   /* Read in the section.  */
-  if (!bfd_get_section_contents (input_bfd,
-				 input_section,
-				 data,
-				 (bfd_vma) 0,
-				 input_section->_raw_size))
+  sz = input_section->rawsize ? input_section->rawsize : input_section->size;
+  if (!bfd_get_section_contents (input_bfd, input_section, data, 0, sz))
     return NULL;
 
   reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
diff --git a/bfd/riscix.c b/bfd/riscix.c
index 519514e..f9b5ae2 100644
--- a/bfd/riscix.c
+++ b/bfd/riscix.c
@@ -1,5 +1,5 @@
 /* BFD back-end for RISC iX (Acorn, arm) binaries.
-   Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002
+   Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2004
    Free Software Foundation, Inc.
    Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org)
 
@@ -577,8 +577,8 @@
   if (! NAME(aout,make_sections) (abfd))
     return NULL;
 
-  obj_datasec (abfd)->_raw_size = execp->a_data;
-  obj_bsssec (abfd)->_raw_size = execp->a_bss;
+  obj_datasec (abfd)->size = execp->a_data;
+  obj_bsssec (abfd)->size = execp->a_bss;
 
   obj_textsec (abfd)->flags =
     (execp->a_trsize != 0
@@ -619,7 +619,7 @@
      At some point we should probably break down and stat the file and
      declare it executable if (one of) its 'x' bits are on...  */
   if ((execp->a_entry >= obj_textsec(abfd)->vma) &&
-      (execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->_raw_size))
+      (execp->a_entry < obj_textsec(abfd)->vma + obj_textsec(abfd)->size))
     abfd->flags |= EXEC_P;
 #endif /* MACH */
   if (result)
diff --git a/bfd/rs6000-core.c b/bfd/rs6000-core.c
index 3fa0975..98cae9a 100644
--- a/bfd/rs6000-core.c
+++ b/bfd/rs6000-core.c
@@ -1,6 +1,6 @@
 /* IBM RS/6000 "XCOFF" back-end for BFD.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
-   2001, 2002
+   2001, 2002, 2004
    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
@@ -277,11 +277,11 @@
 }
 
 static asection *
-make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
+make_bfd_asection (abfd, name, flags, size, vma, filepos)
      bfd *abfd;
      const char *name;
      flagword flags;
-     bfd_size_type _raw_size;
+     bfd_size_type size;
      bfd_vma vma;
      file_ptr filepos;
 {
@@ -292,7 +292,7 @@
     return NULL;
 
   asect->flags = flags;
-  asect->_raw_size = _raw_size;
+  asect->size = size;
   asect->vma = vma;
   asect->filepos = filepos;
   asect->alignment_power = 8;
diff --git a/bfd/sco5-core.c b/bfd/sco5-core.c
index 5c34ff1..33592b2 100644
--- a/bfd/sco5-core.c
+++ b/bfd/sco5-core.c
@@ -52,11 +52,11 @@
 static void swap_abort PARAMS ((void));
 
 static asection *
-make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos)
+make_bfd_asection (abfd, name, flags, size, vma, filepos)
      bfd *abfd;
      const char *name;
      flagword flags;
-     bfd_size_type _raw_size;
+     bfd_size_type size;
      bfd_vma vma;
      file_ptr filepos;
 {
@@ -66,7 +66,7 @@
   if (!asect)
     return NULL;
   asect->flags = flags;
-  asect->_raw_size = _raw_size;
+  asect->size = size;
   asect->vma = vma;
   asect->filepos = filepos;
   asect->alignment_power = 2;
@@ -123,13 +123,12 @@
   char *secname;
   flagword flags;
 
-  /* Read coreoffsets region at end of core (see core(FP)) */
+  /* Read coreoffsets region at end of core (see core(FP)).  */
 
   {
     FILE *stream = bfd_cache_lookup (abfd);
     struct stat statbuf;
-    if (stream == NULL)
-      return NULL;
+
     if (fstat (fileno (stream), &statbuf) < 0)
       {
 	bfd_set_error (bfd_error_system_call);
diff --git a/bfd/section.c b/bfd/section.c
index fce8e1e..e178f58 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -1,6 +1,6 @@
 /* Object file "section" support for the BFD library.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -364,9 +364,6 @@
 .  {* See the vma field.  *}
 .  unsigned int user_set_vma : 1;
 .
-.  {* Whether relocations have been processed.  *}
-.  unsigned int reloc_done : 1;
-.
 .  {* A mark flag used by some of the linker backends.  *}
 .  unsigned int linker_mark : 1;
 .
@@ -394,21 +391,18 @@
 .  unsigned int use_rela_p:1;
 .
 .  {* Bits used by various backends.  *}
-.  unsigned int has_tls_reloc:1;
 .
-.  {* Nonzero if this section needs the relax finalize pass.  *}
-.  unsigned int need_finalize_relax:1;
+.  {* Nonzero if this section has TLS related relocations.  *}
+.  unsigned int has_tls_reloc:1;
 .
 .  {* Nonzero if this section has a gp reloc.  *}
 .  unsigned int has_gp_reloc:1;
 .
-.  {* Unused bits.  *}
-.  unsigned int flag13:1;
-.  unsigned int flag14:1;
-.  unsigned int flag15:1;
-.  unsigned int flag16:4;
-.  unsigned int flag20:4;
-.  unsigned int flag24:8;
+.  {* Nonzero if this section needs the relax finalize pass.  *}
+.  unsigned int need_finalize_relax:1;
+.
+.  {* Whether relocations have been processed.  *}
+.  unsigned int reloc_done : 1;
 .
 .  {* End of internal packed boolean fields.  *}
 .
@@ -427,13 +421,18 @@
 .
 .  {* The size of the section in octets, as it will be output.
 .     Contains a value even if the section has no contents (e.g., the
-.     size of <<.bss>>).  This will be filled in after relocation.  *}
-.  bfd_size_type _cooked_size;
+.     size of <<.bss>>).  *}
+.  bfd_size_type size;
 .
-.  {* The original size on disk of the section, in octets.  Normally this
-.     value is the same as the size, but if some relaxing has
-.     been done, then this value will be bigger.  *}
-.  bfd_size_type _raw_size;
+.  {* For input sections, the original size on disk of the section, in
+.     octets.  This field is used by the linker relaxation code.  It is
+.     currently only set for sections where the linker relaxation scheme
+.     doesn't cache altered section and reloc contents (stabs, eh_frame,
+.     SEC_MERGE, some coff relaxing targets), and thus the original size
+.     needs to be kept to read the section multiple times.
+.     For output sections, rawsize holds the section size calculated on
+.     a previous linker relaxation pass.  *}
+.  bfd_size_type rawsize;
 .
 .  {* If this section is going to be output, then this value is the
 .     offset in *bytes* into the output section of the first byte in the
@@ -557,11 +556,6 @@
 .extern const struct bfd_symbol * const bfd_com_symbol;
 .extern const struct bfd_symbol * const bfd_und_symbol;
 .extern const struct bfd_symbol * const bfd_ind_symbol;
-.#define bfd_get_section_size_before_reloc(section) \
-.     ((section)->_raw_size)
-.#define bfd_get_section_size_after_reloc(section) \
-.     ((section)->reloc_done ? (section)->_cooked_size \
-.                            : (abort (), (bfd_size_type) 1))
 .
 .{* Macros to handle insertion and deletion of a bfd's sections.  These
 .   only handle the list pointers, ie. do not adjust section_count,
@@ -616,25 +610,22 @@
 #define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX)				\
   const asymbol * const SYM = (asymbol *) &global_syms[IDX]; 		\
   asection SEC = 							\
-    /* name, id,  index, next, flags, user_set_vma, reloc_done,      */	\
-    { NAME,  IDX, 0,     NULL, FLAGS, 0,            0,			\
+    /* name, id,  index, next, flags, user_set_vma,                  */	\
+    { NAME,  IDX, 0,     NULL, FLAGS, 0,				\
 									\
     /* linker_mark, linker_has_input, gc_mark, segment_mark,         */	\
        0,           0,                1,       0,			\
 									\
-    /* sec_info_type, use_rela_p, has_tls_reloc,                     */ \
-       0,	      0,	  0,					\
+    /* sec_info_type, use_rela_p, has_tls_reloc, has_gp_reloc,       */ \
+       0,	      0,	  0,		 0,			\
 									\
-    /* need_finalize_relax, has_gp_reloc,                            */ \
+    /* need_finalize_relax, reloc_done,                              */ \
        0,		    0,						\
 									\
-    /* flag13, flag14, flag15, flag16, flag20, flag24,               */ \
-       0,      0,      0,      0,      0,      0,			\
+    /* vma, lma, size, rawsize                                       */	\
+       0,   0,   0,    0,						\
 									\
-    /* vma, lma, _cooked_size, _raw_size,                            */	\
-       0,   0,   0,            0,					\
-									\
-    /* output_offset, output_section,      alignment_power,          */	\
+    /* output_offset, output_section,              alignment_power,  */	\
        0,             (struct bfd_section *) &SEC, 0,			\
 									\
     /* relocation, orelocation, reloc_count, filepos, rel_filepos,   */	\
@@ -801,6 +792,57 @@
 
 /*
 FUNCTION
+	bfd_get_section_by_name_if
+
+SYNOPSIS
+	asection *bfd_get_section_by_name_if
+	  (bfd *abfd,
+	   const char *name,
+	   bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
+	   void *obj);
+
+DESCRIPTION
+	Call the provided function @var{func} for each section
+	attached to the BFD @var{abfd} whose name matches @var{name},
+	passing @var{obj} as an argument. The function will be called
+	as if by
+
+|	func (abfd, the_section, obj);
+
+	It returns the first section for which @var{func} returns true,
+	otherwise <<NULL>>.
+
+*/
+
+asection *
+bfd_get_section_by_name_if (bfd *abfd, const char *name,
+			    bfd_boolean (*operation) (bfd *,
+						      asection *,
+						      void *),
+			    void *user_storage)
+{
+  struct section_hash_entry *sh;
+  unsigned long hash;
+
+  sh = section_hash_lookup (&abfd->section_htab, name, FALSE, FALSE);
+  if (sh == NULL)
+    return NULL;
+
+  hash = sh->root.hash;
+  do
+    {
+      if ((*operation) (abfd, &sh->section, user_storage))
+	return &sh->section;
+      sh = (struct section_hash_entry *) sh->root.next;
+    }
+  while (sh != NULL && sh->root.hash == hash
+	 && strcmp (sh->root.string, name) == 0);
+
+  return NULL;
+}
+
+/*
+FUNCTION
 	bfd_get_unique_section_name
 
 SYNOPSIS
@@ -945,13 +987,19 @@
   newsect = &sh->section;
   if (newsect->name != NULL)
     {
-      /* We are making a section of the same name.  It can't go in
-	 section_htab without generating a unique section name and
-	 that would be pointless;  We don't need to traverse the
-	 hash table.  */
-      newsect = bfd_zalloc (abfd, sizeof (asection));
-      if (newsect == NULL)
+      /* We are making a section of the same name.  Put it in the
+	 section hash table.  Even though we can't find it directly by a
+	 hash lookup, we'll be able to find the section by traversing
+	 sh->root.next quicker than looking at all the bfd sections.  */
+      struct section_hash_entry *new_sh;
+      new_sh = (struct section_hash_entry *)
+	bfd_section_hash_newfunc (NULL, &abfd->section_htab, name);
+      if (new_sh == NULL)
 	return NULL;
+
+      new_sh->root = sh->root;
+      sh->root.next = &new_sh->root;
+      newsect = &new_sh->section;
     }
 
   newsect->name = name;
@@ -1090,6 +1138,41 @@
 
 /*
 FUNCTION
+	bfd_sections_find_if
+
+SYNOPSIS
+	asection *bfd_sections_find_if
+	  (bfd *abfd,
+	   bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
+	   void *obj);
+
+DESCRIPTION
+	Call the provided function @var{func} for each section
+	attached to the BFD @var{abfd}, passing @var{obj} as an
+	argument. The function will be called as if by
+
+|	func (abfd, the_section, obj);
+
+	It returns the first section for which @var{func} returns true.
+
+*/
+
+asection *
+bfd_sections_find_if (bfd *abfd,
+		      bfd_boolean (*operation) (bfd *, asection *, void *),
+		      void *user_storage)
+{
+  asection *sect;
+
+  for (sect = abfd->sections; sect != NULL; sect = sect->next)
+    if ((*operation) (abfd, sect, user_storage))
+      break;
+
+  return sect;
+}
+
+/*
+FUNCTION
 	bfd_set_section_size
 
 SYNOPSIS
@@ -1118,9 +1201,7 @@
       return FALSE;
     }
 
-  ptr->_cooked_size = val;
-  ptr->_raw_size = val;
-
+  ptr->size = val;
   return TRUE;
 }
 
@@ -1151,11 +1232,6 @@
 
 */
 
-#define bfd_get_section_size_now(abfd, sec) \
-  (sec->reloc_done \
-   ? bfd_get_section_size_after_reloc (sec) \
-   : bfd_get_section_size_before_reloc (sec))
-
 bfd_boolean
 bfd_set_section_contents (bfd *abfd,
 			  sec_ptr section,
@@ -1171,7 +1247,7 @@
       return FALSE;
     }
 
-  sz = bfd_get_section_size_now (abfd, section);
+  sz = section->size;
   if ((bfd_size_type) offset > sz
       || count > sz
       || offset + count > sz
@@ -1251,9 +1327,7 @@
       return TRUE;
     }
 
-  /* Even if reloc_done is TRUE, this function reads unrelocated
-     contents, so we want the raw size.  */
-  sz = section->_raw_size;
+  sz = section->rawsize ? section->rawsize : section->size;
   if ((bfd_size_type) offset > sz
       || count > sz
       || offset + count > sz
@@ -1285,6 +1359,36 @@
 
 /*
 FUNCTION
+	bfd_malloc_and_get_section
+
+SYNOPSIS
+	bfd_boolean bfd_malloc_and_get_section
+	  (bfd *abfd, asection *section, bfd_byte **buf);
+
+DESCRIPTION
+	Read all data from @var{section} in BFD @var{abfd}
+	into a buffer, *@var{buf}, malloc'd by this function.
+*/
+
+bfd_boolean
+bfd_malloc_and_get_section (bfd *abfd, sec_ptr sec, bfd_byte **buf)
+{
+  bfd_size_type sz = sec->rawsize ? sec->rawsize : sec->size;
+  bfd_byte *p = NULL;
+
+  *buf = p;
+  if (sz == 0)
+    return TRUE;
+
+  p = bfd_malloc (sec->rawsize > sec->size ? sec->rawsize : sec->size);
+  if (p == NULL)
+    return FALSE;
+  *buf = p;
+
+  return bfd_get_section_contents (abfd, sec, p, 0, sz);
+}
+/*
+FUNCTION
 	bfd_copy_private_section_data
 
 SYNOPSIS
@@ -1351,6 +1455,24 @@
 
 /*
 FUNCTION
+	bfd_generic_is_group_section
+
+SYNOPSIS
+	bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
+
+DESCRIPTION
+	Returns TRUE if @var{sec} is a member of a group.
+*/
+
+bfd_boolean
+bfd_generic_is_group_section (bfd *abfd ATTRIBUTE_UNUSED,
+			      const asection *sec ATTRIBUTE_UNUSED)
+{
+  return FALSE;
+}
+
+/*
+FUNCTION
 	bfd_generic_discard_group
 
 SYNOPSIS
diff --git a/bfd/simple.c b/bfd/simple.c
index 4b597a4..5039911 100644
--- a/bfd/simple.c
+++ b/bfd/simple.c
@@ -1,5 +1,5 @@
 /* simple.c -- BFD simple client routines
-   Copyright 2002, 2003
+   Copyright 2002, 2003, 2004
    Free Software Foundation, Inc.
    Contributed by MontaVista Software, Inc.
 
@@ -140,42 +140,21 @@
   bfd_byte *contents, *data;
   int storage_needed;
   void *saved_offsets;
-  bfd_boolean saved_reloc_done = sec->reloc_done;
-
-#undef RETURN
-#define RETURN(x)				\
-  do						\
-    {						\
-      sec->reloc_done = saved_reloc_done;	\
-      return (x);				\
-    }						\
-  while (0)
-
-  /* Foul hack to prevent bfd_section_size aborts.  The reloc_done flag
-     only controls that macro (and the related size macros), selecting
-     between _raw_size and _cooked_size.  We may be called with relocation
-     done or not, so we need to save the done-flag and mark the section as
-     not relocated.
-
-     Debug sections won't change size while we're only relocating.  There
-     may be trouble here someday if it tries to run relaxation
-     unexpectedly, so make sure.  */
-  BFD_ASSERT (sec->_raw_size == sec->_cooked_size);
-  sec->reloc_done = 0;
 
   if (! (sec->flags & SEC_RELOC))
     {
-      bfd_size_type size = bfd_section_size (abfd, sec);
+      bfd_size_type amt = sec->rawsize > sec->size ? sec->rawsize : sec->size;
+      bfd_size_type size = sec->rawsize ? sec->rawsize : sec->size;
 
       if (outbuf == NULL)
-	contents = bfd_malloc (size);
+	contents = bfd_malloc (amt);
       else
 	contents = outbuf;
 
       if (contents)
 	bfd_get_section_contents (abfd, sec, contents, 0, size);
 
-      RETURN (contents);
+      return contents;
     }
 
   /* In order to use bfd_get_relocated_section_contents, we need
@@ -197,15 +176,15 @@
   link_order.next = NULL;
   link_order.type = bfd_indirect_link_order;
   link_order.offset = 0;
-  link_order.size = bfd_section_size (abfd, sec);
+  link_order.size = sec->size;
   link_order.u.indirect.section = sec;
 
   data = NULL;
   if (outbuf == NULL)
     {
-      data = bfd_malloc (bfd_section_size (abfd, sec));
+      data = bfd_malloc (sec->size);
       if (data == NULL)
-	RETURN (NULL);
+	return NULL;
       outbuf = data;
     }
 
@@ -224,7 +203,7 @@
     {
       if (data)
 	free (data);
-      RETURN (NULL);
+      return NULL;
     }
   bfd_map_over_sections (abfd, simple_save_output_info, saved_offsets);
 
@@ -267,5 +246,5 @@
 
   _bfd_generic_link_hash_table_free (link_info.hash);
 
-  RETURN (contents);
+  return contents;
 }
diff --git a/bfd/som.c b/bfd/som.c
index 9066257..5903c1a 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -1,6 +1,6 @@
 /* bfd back-end for HP PA-RISC SOM objects.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    Contributed by the Center for Software Science at the
@@ -146,6 +146,9 @@
   unsigned int symbol_value;
   unsigned int priv_level;
   unsigned int secondary_def;
+  unsigned int is_comdat;
+  unsigned int is_common;
+  unsigned int dup_common;
 };
 
 /* Forward declarations.  */
@@ -189,12 +192,14 @@
   PARAMS ((bfd *, asection *, bfd *, asection *));
 static bfd_boolean som_bfd_copy_private_bfd_data
   PARAMS ((bfd *, bfd *));
+#define som_bfd_copy_private_header_data \
+  _bfd_generic_bfd_copy_private_header_data
 #define som_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
 #define som_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
 static bfd_boolean som_bfd_is_local_label_name
   PARAMS ((bfd *, const char *));
 static bfd_boolean som_set_section_contents
-  PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
+  PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type));
 static bfd_boolean som_get_section_contents
   PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
 static bfd_boolean som_set_arch_mach
@@ -206,7 +211,7 @@
   PARAMS ((bfd *, asymbol *, symbol_info *));
 static asection * bfd_section_from_som_symbol
   PARAMS ((bfd *, struct symbol_dictionary_record *));
-static int log2
+static int exact_log2
   PARAMS ((unsigned int));
 static bfd_reloc_status_type hppa_som_reloc
   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
@@ -1428,11 +1433,11 @@
   return p;
 }
 
-/* Return the logarithm of X, base 2, considering X unsigned.
-   Abort -1 if X is not a power or two or is zero.  */
+/* Return the logarithm of X, base 2, considering X unsigned,
+   if X is a power of 2.  Otherwise, returns -1.  */
 
 static int
-log2 (x)
+exact_log2 (x)
      unsigned int x;
 {
   int log = 0;
@@ -1589,6 +1594,11 @@
       final_types[3] = NULL;
       *final_type = base_type;
       break;
+
+    /* FIXME: These two field selectors are not currently supported.  */
+    case e_ltpsel:
+    case e_rtpsel:
+      abort ();
     }
 
   switch (base_type)
@@ -1820,10 +1830,13 @@
   found = 0;
   for (section = abfd->sections; section; section = section->next)
     {
+      bfd_vma entry;
+
       if ((section->flags & SEC_CODE) == 0)
 	continue;
-      if (aux_hdrp->exec_entry >= section->vma
-	  && aux_hdrp->exec_entry < section->vma + section->_cooked_size)
+      entry = aux_hdrp->exec_entry;
+      if (entry >= section->vma
+	  && entry < section->vma + section->size)
 	found = 1;
     }
   if (aux_hdrp->exec_entry == 0
@@ -1897,8 +1910,8 @@
   for (space_index = 0; space_index < file_hdr->space_total; space_index++)
     {
       struct space_dictionary_record space;
-      struct subspace_dictionary_record subspace, save_subspace;
-      int subspace_index;
+      struct som_subspace_dictionary_record subspace, save_subspace;
+      unsigned int subspace_index;
       asection *space_asect;
       char *newname;
 
@@ -1959,13 +1972,13 @@
 	 record.  */
       space_asect->vma = subspace.subspace_start;
       space_asect->filepos = subspace.file_loc_init_value + current_offset;
-      space_asect->alignment_power = log2 (subspace.alignment);
+      space_asect->alignment_power = exact_log2 (subspace.alignment);
       if (space_asect->alignment_power == (unsigned) -1)
 	goto error_return;
 
       /* Initialize save_subspace so we can reliably determine if this
 	 loop placed any useful values into it.  */
-      memset (&save_subspace, 0, sizeof (struct subspace_dictionary_record));
+      memset (&save_subspace, 0, sizeof (save_subspace));
 
       /* Loop over the rest of the subspaces, building up more sections.  */
       for (subspace_index = 0; subspace_index < space.subspace_quantity;
@@ -1996,7 +2009,10 @@
 	  if (! bfd_som_set_subsection_attributes (subspace_asect, space_asect,
 						   subspace.access_control_bits,
 						   subspace.sort_key,
-						   subspace.quadrant))
+						   subspace.quadrant,
+						   subspace.is_comdat,
+						   subspace.is_common,
+						   subspace.dup_common))
 	    goto error_return;
 
 	  /* Keep an easy mapping between subspaces and sections.
@@ -2042,9 +2058,10 @@
 	      break;
 	    }
 
-	  if (subspace.dup_common || subspace.is_common)
-	    subspace_asect->flags |= SEC_IS_COMMON;
-	  else if (subspace.subspace_length > 0)
+	  if (subspace.is_comdat || subspace.is_common || subspace.dup_common)
+	    subspace_asect->flags |= SEC_LINK_ONCE;
+
+	  if (subspace.subspace_length > 0)
 	    subspace_asect->flags |= SEC_HAS_CONTENTS;
 
 	  if (subspace.is_loadable)
@@ -2081,11 +2098,10 @@
 	    save_subspace = subspace;
 
 	  subspace_asect->vma = subspace.subspace_start;
-	  subspace_asect->_cooked_size = subspace.subspace_length;
-	  subspace_asect->_raw_size = subspace.subspace_length;
+	  subspace_asect->size = subspace.subspace_length;
 	  subspace_asect->filepos = (subspace.file_loc_init_value
 				     + current_offset);
-	  subspace_asect->alignment_power = log2 (subspace.alignment);
+	  subspace_asect->alignment_power = exact_log2 (subspace.alignment);
 	  if (subspace_asect->alignment_power == (unsigned) -1)
 	    goto error_return;
 	}
@@ -2093,21 +2109,13 @@
       /* This can happen for a .o which defines symbols in otherwise
 	 empty subspaces.  */
       if (!save_subspace.file_loc_init_value)
-	{
-	  space_asect->_cooked_size = 0;
-	  space_asect->_raw_size = 0;
-	}
+	space_asect->size = 0;
       else
-	{
-	  /* Setup the sizes for the space section based upon the info in the
-	     last subspace of the space.  */
-	  space_asect->_cooked_size = (save_subspace.subspace_start
-				       - space_asect->vma
-				       + save_subspace.subspace_length);
-	  space_asect->_raw_size = (save_subspace.file_loc_init_value
-				    - space_asect->filepos
-				    + save_subspace.initialization_length);
-	}
+	/* Setup the size for the space section based upon the info in the
+	   last subspace of the space.  */
+	space_asect->size = (save_subspace.subspace_start
+			     - space_asect->vma
+			     + save_subspace.subspace_length);
     }
   /* Now that we've read in all the subspace records, we need to assign
      a target index to each subspace.  */
@@ -2394,21 +2402,15 @@
       else
 	{
 	  /* Allocate space for the subspace dictionary.  */
-	  amt = sizeof (struct subspace_dictionary_record);
+	  amt = sizeof (struct som_subspace_dictionary_record);
 	  som_section_data (section)->subspace_dict =
-	    (struct subspace_dictionary_record *) bfd_zalloc (abfd, amt);
+	    (struct som_subspace_dictionary_record *) bfd_zalloc (abfd, amt);
 	  if (som_section_data (section)->subspace_dict == NULL)
 	    return FALSE;
 
 	  /* Set subspace attributes.  Basic stuff is done here, additional
 	     attributes are filled in later as more information becomes
 	     available.  */
-	  if (section->flags & SEC_IS_COMMON)
-	    {
-	      som_section_data (section)->subspace_dict->dup_common = 1;
-	      som_section_data (section)->subspace_dict->is_common = 1;
-	    }
-
 	  if (section->flags & SEC_ALLOC)
 	    som_section_data (section)->subspace_dict->is_loadable = 1;
 
@@ -2418,9 +2420,9 @@
 	  som_section_data (section)->subspace_dict->subspace_start =
 	    section->vma;
 	  som_section_data (section)->subspace_dict->subspace_length =
-	    bfd_section_size (abfd, section);
+	    section->size;
 	  som_section_data (section)->subspace_dict->initialization_length =
-	    bfd_section_size (abfd, section);
+	    section->size;
 	  som_section_data (section)->subspace_dict->alignment =
 	    1 << section->alignment_power;
 
@@ -2431,6 +2433,12 @@
 	    som_section_data (section)->copy_data->access_control_bits;
 	  som_section_data (section)->subspace_dict->quadrant =
 	    som_section_data (section)->copy_data->quadrant;
+	  som_section_data (section)->subspace_dict->is_comdat =
+	    som_section_data (section)->copy_data->is_comdat;
+	  som_section_data (section)->subspace_dict->is_common =
+	    som_section_data (section)->copy_data->is_common;
+	  som_section_data (section)->subspace_dict->dup_common =
+	    som_section_data (section)->copy_data->dup_common;
 	}
     }
   return TRUE;
@@ -2725,7 +2733,7 @@
 	  int reloc_offset;
 	  unsigned int current_rounding_mode;
 #ifndef NO_PCREL_MODES
-	  int current_call_mode;
+	  unsigned int current_call_mode;
 #endif
 
 	  /* Find a subspace of this space.  */
@@ -3052,8 +3060,7 @@
 
 	  /* Last BFD relocation for a subspace has been processed.
 	     Map the rest of the subspace with R_NO_RELOCATION fixups.  */
-	  p = som_reloc_skip (abfd, (bfd_section_size (abfd, subsection)
-				     - reloc_offset),
+	  p = som_reloc_skip (abfd, subsection->size - reloc_offset,
 			      p, &subspace_reloc_size, reloc_queue);
 
 	  /* Scribble out the relocations.  */
@@ -3466,7 +3473,8 @@
   num_subspaces = som_count_subspaces (abfd);
   obj_som_file_hdr (abfd)->subspace_location = current_offset;
   obj_som_file_hdr (abfd)->subspace_total = num_subspaces;
-  current_offset += num_subspaces * sizeof (struct subspace_dictionary_record);
+  current_offset
+    += num_subspaces * sizeof (struct som_subspace_dictionary_record);
 
   /* Next is the string table for the space/subspace names.  We will
      build and write the string table on the fly.  At the same time
@@ -3593,22 +3601,22 @@
 	      /* Update the size of the code & data.  */
 	      if (abfd->flags & (EXEC_P | DYNAMIC)
 		  && subsection->flags & SEC_CODE)
-		exec_header->exec_tsize += subsection->_cooked_size;
+		exec_header->exec_tsize += subsection->size;
 	      else if (abfd->flags & (EXEC_P | DYNAMIC)
 		       && subsection->flags & SEC_DATA)
-		exec_header->exec_dsize += subsection->_cooked_size;
+		exec_header->exec_dsize += subsection->size;
 	      som_section_data (subsection)->subspace_dict->file_loc_init_value
 		= current_offset;
 	      subsection->filepos = current_offset;
-	      current_offset += bfd_section_size (abfd, subsection);
-	      subspace_offset += bfd_section_size (abfd, subsection);
+	      current_offset += subsection->size;
+	      subspace_offset += subsection->size;
 	    }
 	  /* Looks like uninitialized data.  */
 	  else
 	    {
 	      /* Update the size of the bss section.  */
 	      if (abfd->flags & (EXEC_P | DYNAMIC))
-		exec_header->exec_bsize += subsection->_cooked_size;
+		exec_header->exec_bsize += subsection->size;
 
 	      som_section_data (subsection)->subspace_dict->file_loc_init_value
 		= 0;
@@ -3658,7 +3666,7 @@
 	      som_section_data (subsection)->subspace_dict->file_loc_init_value
 		= current_offset;
 	      subsection->filepos = current_offset;
-	      current_offset += bfd_section_size (abfd, subsection);
+	      current_offset += subsection->size;
 	    }
 	  /* Looks like uninitialized data.  */
 	  else
@@ -3666,7 +3674,7 @@
 	      som_section_data (subsection)->subspace_dict->file_loc_init_value
 		= 0;
 	      som_section_data (subsection)->subspace_dict->
-		initialization_length = bfd_section_size (abfd, subsection);
+		initialization_length = subsection->size;
 	    }
 	}
       /* Goto the next section.  */
@@ -3841,7 +3849,7 @@
 	  som_section_data (subsection)->subspace_dict->space_index = i;
 
 	  /* Dump the current subspace header.  */
-	  amt = sizeof (struct subspace_dictionary_record);
+	  amt = sizeof (struct som_subspace_dictionary_record);
 	  if (bfd_bwrite ((PTR) som_section_data (subsection)->subspace_dict,
 			 amt, abfd) != amt)
 	    return FALSE;
@@ -3897,7 +3905,7 @@
 	  som_section_data (subsection)->subspace_dict->space_index = i;
 
 	  /* Dump this subspace header.  */
-	  amt = sizeof (struct subspace_dictionary_record);
+	  amt = sizeof (struct som_subspace_dictionary_record);
 	  if (bfd_bwrite ((PTR) som_section_data (subsection)->subspace_dict,
 			 amt, abfd) != amt)
 	    return FALSE;
@@ -4045,12 +4053,12 @@
     info->symbol_type = ST_DATA;
   else
     {
-      /* Common symbols must have scope SS_UNSAT and type
-	 ST_STORAGE or the linker will choke.  */
+      /* For BFD style common, the linker will choke unless we set the
+	 type and scope to ST_STORAGE and SS_UNSAT, respectively.  */
       if (bfd_is_com_section (sym->section))
 	{
-	  info->symbol_scope = SS_UNSAT;
 	  info->symbol_type = ST_STORAGE;
+	  info->symbol_scope = SS_UNSAT;
 	}
 
       /* It is possible to have a symbol without an associated
@@ -4089,9 +4097,6 @@
 	    info->symbol_type = ST_DATA;
 	}
 
-      else if (som_symbol_data (sym)->som_type == SYMBOL_TYPE_UNKNOWN)
-	info->symbol_type = ST_DATA;
-
       /* From now on it's a very simple mapping.  */
       else if (som_symbol_data (sym)->som_type == SYMBOL_TYPE_ABSOLUTE)
 	info->symbol_type = ST_ABSOLUTE;
@@ -4112,14 +4117,15 @@
   /* Now handle the symbol's scope.  Exported data which is not
      in the common section has scope SS_UNIVERSAL.  Note scope
      of common symbols was handled earlier!  */
-  if (bfd_is_und_section (sym->section))
+  if (bfd_is_com_section (sym->section))
+    ;
+  else if (bfd_is_und_section (sym->section))
     info->symbol_scope = SS_UNSAT;
-  else if (sym->flags & (BSF_EXPORT | BSF_WEAK)
-	   && ! bfd_is_com_section (sym->section))
+  else if (sym->flags & (BSF_EXPORT | BSF_WEAK))
     info->symbol_scope = SS_UNIVERSAL;
   /* Anything else which is not in the common section has scope
      SS_LOCAL.  */
-  else if (! bfd_is_com_section (sym->section))
+  else
     info->symbol_scope = SS_LOCAL;
 
   /* Now set the symbol_info field.  It has no real meaning
@@ -4138,12 +4144,49 @@
   /* Set the symbol's value.  */
   info->symbol_value = sym->value + sym->section->vma;
 
-  /* The secondary_def field is for weak symbols.  */
+  /* The secondary_def field is for "weak" symbols.  */
   if (sym->flags & BSF_WEAK)
     info->secondary_def = TRUE;
   else
     info->secondary_def = FALSE;
 
+  /* The is_comdat, is_common and dup_common fields provide various
+     flavors of common.
+
+     For data symbols, setting IS_COMMON provides Fortran style common
+     (duplicate definitions and overlapped initialization).  Setting both
+     IS_COMMON and DUP_COMMON provides Cobol style common (duplicate
+     definitions as long as they are all the same length).  In a shared
+     link data symbols retain their IS_COMMON and DUP_COMMON flags.
+     An IS_COMDAT data symbol is similar to a IS_COMMON | DUP_COMMON
+     symbol except in that it loses its IS_COMDAT flag in a shared link.
+
+     For code symbols, IS_COMDAT and DUP_COMMON have effect.  Universal
+     DUP_COMMON code symbols are not exported from shared libraries.
+     IS_COMDAT symbols are exported but they lose their IS_COMDAT flag.
+
+     We take a simplified approach to setting the is_comdat, is_common
+     and dup_common flags in symbols based on the flag settings of their
+     subspace.  This avoids having to add directives like `.comdat' but
+     the linker behavior is probably undefined if there is more than one
+     universal symbol (comdat key sysmbol) in a subspace.
+
+     The behavior of these flags is not well documentmented, so there
+     may be bugs and some surprising interactions with other flags.  */
+  if (som_section_data (sym->section)
+      && som_section_data (sym->section)->subspace_dict
+      && info->symbol_scope == SS_UNIVERSAL
+      && (info->symbol_type == ST_ENTRY
+	  || info->symbol_type == ST_CODE
+	  || info->symbol_type == ST_DATA))
+    {
+      info->is_comdat
+	= som_section_data (sym->section)->subspace_dict->is_comdat;
+      info->is_common
+	= som_section_data (sym->section)->subspace_dict->is_common;
+      info->dup_common
+	= som_section_data (sym->section)->subspace_dict->dup_common;
+    }
 }
 
 /* Build and write, in one big chunk, the entire symbol table for
@@ -4189,6 +4232,9 @@
       som_symtab[i].xleast = 3;
       som_symtab[i].symbol_value = info.symbol_value | info.priv_level;
       som_symtab[i].secondary_def = info.secondary_def;
+      som_symtab[i].is_comdat = info.is_comdat;
+      som_symtab[i].is_common = info.is_common;
+      som_symtab[i].dup_common = info.dup_common;
     }
 
   /* Everything is ready, seek to the right location and
@@ -4298,7 +4344,7 @@
 	  && symbol->symbol_type != ST_SEC_PROG
 	  && symbol->symbol_type != ST_MILLICODE))
     {
-      unsigned int index = symbol->symbol_info;
+      int index = symbol->symbol_info;
       for (section = abfd->sections; section != NULL; section = section->next)
 	if (section->target_index == index && som_is_subspace (section))
 	  return section;
@@ -4317,7 +4363,7 @@
       for (section = abfd->sections; section; section = section->next)
 	{
 	  if (value >= section->vma
-	      && value <= section->vma + section->_cooked_size
+	      && value <= section->vma + section->size
 	      && som_is_subspace (section))
 	    return section;
 	}
@@ -4907,16 +4953,16 @@
 		      /* Got to read the damn contents first.  We don't
 			 bother saving the contents (yet).  Add it one
 			 day if the need arises.  */
-		      section->contents = bfd_malloc (section->_raw_size);
-		      if (section->contents == NULL)
-			return (unsigned) -1;
-
+		      bfd_byte *contents;
+		      if (!bfd_malloc_and_get_section (section->owner, section,
+						       &contents))
+			{
+			  if (contents != NULL)
+			    free (contents);
+			  return (unsigned) -1;
+			}
+		      section->contents = contents;
 		      deallocate_contents = 1;
-		      bfd_get_section_contents (section->owner,
-						section,
-						section->contents,
-						(bfd_vma) 0,
-						section->_raw_size);
 		    }
 		  else if (rptr->addend == 0)
 		    rptr->addend = bfd_get_32 (section->owner,
@@ -5212,12 +5258,13 @@
 
 bfd_boolean
 bfd_som_set_subsection_attributes (section, container, access,
-				   sort_key, quadrant)
+				   sort_key, quadrant, comdat,
+				   common, dup_common)
      asection *section;
      asection *container;
      int access;
      unsigned int sort_key;
-     int quadrant;
+     int quadrant, comdat, common, dup_common;
 {
   /* Allocate memory to hold the magic information.  */
   if (som_section_data (section)->copy_data == NULL)
@@ -5233,6 +5280,9 @@
   som_section_data (section)->copy_data->access_control_bits = access;
   som_section_data (section)->copy_data->quadrant = quadrant;
   som_section_data (section)->copy_data->container = container;
+  som_section_data (section)->copy_data->is_comdat = comdat;
+  som_section_data (section)->copy_data->is_common = common;
+  som_section_data (section)->copy_data->dup_common = dup_common;
   return TRUE;
 }
 
@@ -5347,7 +5397,7 @@
 {
   if (count == 0 || ((section->flags & SEC_HAS_CONTENTS) == 0))
     return TRUE;
-  if ((bfd_size_type) (offset+count) > section->_raw_size
+  if ((bfd_size_type) (offset+count) > section->size
       || bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) != 0
       || bfd_bread (location, count, abfd) != count)
     return FALSE; /* On error.  */
@@ -5358,7 +5408,7 @@
 som_set_section_contents (abfd, section, location, offset, count)
      bfd *abfd;
      sec_ptr section;
-     PTR location;
+     const PTR location;
      file_ptr offset;
      bfd_size_type count;
 {
@@ -5385,7 +5435,7 @@
   if (bfd_seek (abfd, offset, SEEK_SET) != 0)
     return FALSE;
 
-  if (bfd_bwrite ((PTR) location, count, abfd) != count)
+  if (bfd_bwrite (location, count, abfd) != count)
     return FALSE;
   return TRUE;
 }
@@ -6036,7 +6086,7 @@
 	  curr_lst_sym->initially_frozen = 0;
 	  curr_lst_sym->memory_resident = 0;
 	  curr_lst_sym->is_common = bfd_is_com_section (sym->symbol.section);
-	  curr_lst_sym->dup_common = 0;
+	  curr_lst_sym->dup_common = info.dup_common;
 	  curr_lst_sym->xleast = 3;
 	  curr_lst_sym->arg_reloc = info.arg_reloc;
 	  curr_lst_sym->name.n_strx = p - strings + 4;
@@ -6318,7 +6368,7 @@
      bfd *abfd ATTRIBUTE_UNUSED;
      asection *sec;
 {
-  return (som_is_subspace (sec) && sec->_raw_size > 240000);
+  return (som_is_subspace (sec) && sec->size > 240000);
 }
 
 #define	som_close_and_cleanup		som_bfd_free_cached_info
@@ -6352,6 +6402,7 @@
 
 #define som_bfd_gc_sections		bfd_generic_gc_sections
 #define som_bfd_merge_sections		bfd_generic_merge_sections
+#define som_bfd_is_group_section	bfd_generic_is_group_section
 #define som_bfd_discard_group		bfd_generic_discard_group
 
 const bfd_target som_vec = {
@@ -6362,7 +6413,7 @@
   (HAS_RELOC | EXEC_P |		/* object flags */
    HAS_LINENO | HAS_DEBUG |
    HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED | DYNAMIC),
-  (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS
+  (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS | SEC_LINK_ONCE
    | SEC_ALLOC | SEC_LOAD | SEC_RELOC),		/* section flags */
 
 /* leading_symbol_char: is the first char of a user symbol
diff --git a/bfd/som.h b/bfd/som.h
index 537ddaa..3954855 100644
--- a/bfd/som.h
+++ b/bfd/som.h
@@ -27,7 +27,7 @@
 
 #include "libhppa.h"
 
-/* Enable PA2.0 if available */
+/* We want reloc.h to provide PA 2.0 defines.  */
 #define PA_2_0
 
 #include <a.out.h>
@@ -143,6 +143,35 @@
     struct somdata a;
   };
 
+struct som_subspace_dictionary_record
+  {
+    int space_index;
+    unsigned int access_control_bits : 7;
+    unsigned int memory_resident : 1;
+    unsigned int dup_common : 1;
+    unsigned int is_common : 1;
+    unsigned int is_loadable : 1;
+    unsigned int quadrant : 2;
+    unsigned int initially_frozen : 1;
+    unsigned int is_first : 1;
+    unsigned int code_only : 1;
+    unsigned int sort_key : 8;
+    unsigned int replicate_init	: 1;
+    unsigned int continuation : 1;
+    unsigned int is_tspecific : 1;
+    unsigned int is_comdat : 1;
+    unsigned int reserved : 4;
+    int file_loc_init_value;
+    unsigned int initialization_length;
+    unsigned int subspace_start;
+    unsigned int subspace_length;
+    unsigned int reserved2 : 5;   
+    unsigned int alignment :27;
+    union name_pt name;
+    int fixup_request_index;
+    unsigned int fixup_request_quantity;
+  };
+
 /* Substructure of som_section_data_struct used to hold information
    which can't be represented by the generic BFD section structure,
    but which must be copied during objcopy or strip.  */
@@ -155,6 +184,9 @@
     unsigned int is_defined : 1;
     unsigned int is_private : 1;
     unsigned int quadrant : 2;
+    unsigned int is_comdat : 1;
+    unsigned int is_common : 1;
+    unsigned int dup_common : 1;
 
     /* For subspaces, this points to the section which represents the
        space in which the subspace is contained.  For spaces it points
@@ -184,7 +216,7 @@
     unsigned int reloc_size;
     char *reloc_stream;
     struct space_dictionary_record *space_dict;
-    struct subspace_dictionary_record *subspace_dict;
+    struct som_subspace_dictionary_record *subspace_dict;
   };
 
 #define somdata(bfd)			((bfd)->tdata.som_data->a)
@@ -231,7 +263,7 @@
 bfd_boolean bfd_som_set_section_attributes
   PARAMS ((asection *, int, int, unsigned int, int));
 bfd_boolean bfd_som_set_subsection_attributes
-  PARAMS ((asection *, asection *, int, unsigned int, int));
+  PARAMS ((asection *, asection *, int, unsigned int, int, int, int, int));
 void bfd_som_set_symbol_type PARAMS ((asymbol *, unsigned int));
 bfd_boolean bfd_som_attach_aux_hdr PARAMS ((bfd *, int, char *));
 int ** hppa_som_gen_reloc_type
diff --git a/bfd/sparclinux.c b/bfd/sparclinux.c
index ecaaa0f..0b6acd7 100644
--- a/bfd/sparclinux.c
+++ b/bfd/sparclinux.c
@@ -1,6 +1,6 @@
 /* BFD back-end for linux flavored sparc a.out binaries.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003,
+   2004 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -317,7 +317,7 @@
       || ! bfd_set_section_flags (abfd, s, flags)
       || ! bfd_set_section_alignment (abfd, s, 2))
     return FALSE;
-  s->_raw_size = 0;
+  s->size = 0;
   s->contents = 0;
 
   return TRUE;
@@ -596,9 +596,9 @@
 			       ".linux-dynamic");
   if (s != NULL)
     {
-      s->_raw_size = linux_hash_table (info)->fixup_count + 1;
-      s->_raw_size *= 8;
-      s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size);
+      s->size = linux_hash_table (info)->fixup_count + 1;
+      s->size *= 8;
+      s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->size);
       if (s->contents == NULL)
 	return FALSE;
     }
@@ -763,7 +763,7 @@
 		SEEK_SET) != 0)
     return FALSE;
 
-  if (bfd_bwrite ((PTR) s->contents, s->_raw_size, output_bfd) != s->_raw_size)
+  if (bfd_bwrite ((PTR) s->contents, s->size, output_bfd) != s->size)
     return FALSE;
 
   return TRUE;
diff --git a/bfd/srec.c b/bfd/srec.c
index c0a3d58..d75fa51 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -1,6 +1,6 @@
 /* BFD back-end for s-record objects.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
 
@@ -564,11 +564,11 @@
 		bytes -= 2;
 
 		if (sec != NULL
-		    && sec->vma + sec->_raw_size == address)
+		    && sec->vma + sec->size == address)
 		  {
 		    /* This data goes at the end of the section we are
 		       currently building.  */
-		    sec->_raw_size += bytes;
+		    sec->size += bytes;
 		  }
 		else
 		  {
@@ -586,7 +586,7 @@
 		    sec->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
 		    sec->vma = address;
 		    sec->lma = address;
-		    sec->_raw_size = bytes;
+		    sec->size = bytes;
 		    sec->filepos = pos;
 		  }
 
@@ -763,7 +763,7 @@
       switch (hdr[0])
 	{
 	default:
-	  BFD_ASSERT (sofar == section->_raw_size);
+	  BFD_ASSERT (sofar == section->size);
 	  if (buf != NULL)
 	    free (buf);
 	  return TRUE;
@@ -788,7 +788,7 @@
 	  if (address != section->vma + sofar)
 	    {
 	      /* We've come to the end of this section.  */
-	      BFD_ASSERT (sofar == section->_raw_size);
+	      BFD_ASSERT (sofar == section->size);
 	      if (buf != NULL)
 		free (buf);
 	      return TRUE;
@@ -811,7 +811,7 @@
   if (error)
     goto error_return;
 
-  BFD_ASSERT (sofar == section->_raw_size);
+  BFD_ASSERT (sofar == section->size);
 
   if (buf != NULL)
     free (buf);
@@ -836,8 +836,8 @@
 {
   if (section->used_by_bfd == NULL)
     {
-      section->used_by_bfd = bfd_alloc (abfd, section->_raw_size);
-      if (section->used_by_bfd == NULL && section->_raw_size != 0)
+      section->used_by_bfd = bfd_alloc (abfd, section->size);
+      if (section->used_by_bfd == NULL && section->size != 0)
 	return FALSE;
 
       if (! srec_read_section (abfd, section, section->used_by_bfd))
@@ -1284,6 +1284,7 @@
 #define srec_bfd_relax_section bfd_generic_relax_section
 #define srec_bfd_gc_sections bfd_generic_gc_sections
 #define srec_bfd_merge_sections bfd_generic_merge_sections
+#define srec_bfd_is_group_section bfd_generic_is_group_section
 #define srec_bfd_discard_group bfd_generic_discard_group
 #define srec_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define srec_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
diff --git a/bfd/stabs.c b/bfd/stabs.c
index 42944a4..12285a3 100644
--- a/bfd/stabs.c
+++ b/bfd/stabs.c
@@ -1,5 +1,5 @@
 /* Stabs in sections linking support.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
@@ -48,20 +48,20 @@
 #define VALOFF (8)
 #define STABSIZE (12)
 
-/* A hash table used for header files with N_BINCL entries.  */
-
-struct stab_link_includes_table
-{
-  struct bfd_hash_table root;
-};
-
 /* A linked list of totals that we have found for a particular header
-   file.  */
+   file.  A total is a unique identifier for a particular BINCL...EINCL
+   sequence of STABs that can be used to identify duplicate sequences.
+   It consists of three fields, 'sum_chars' which is the sum of all the
+   STABS characters; 'num_chars' which is the number of these charactes
+   and 'symb' which is a buffer of all the symbols in the sequence.  This
+   buffer is only checked as a last resort.  */
 
 struct stab_link_includes_totals
 {
   struct stab_link_includes_totals *next;
-  bfd_vma total;
+  bfd_vma sum_chars;  /* Accumulated sum of STABS characters.  */
+  bfd_vma num_chars;  /* Number of STABS characters.  */
+  const char* symb;   /* The STABS characters themselves.  */
 };
 
 /* An entry in the header file hash table.  */
@@ -73,12 +73,6 @@
   struct stab_link_includes_totals *totals;
 };
 
-/* Look up an entry in an the header file hash table.  */
-
-#define stab_link_includes_lookup(table, string, create, copy) \
-  ((struct stab_link_includes_entry *) \
-   bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
-
 /* This structure is used to hold a list of N_BINCL symbols, some of
    which might be converted into N_EXCL symbols.  */
 
@@ -117,19 +111,6 @@
   bfd_size_type stridxs[1];
 };
 
-/* This structure is used to keep track of stabs in sections
-   information while linking.  */
-
-struct stab_info
-{
-  /* A hash table used to hold stabs strings.  */
-  struct bfd_strtab_hash *strings;
-  /* The header file hash table.  */
-  struct stab_link_includes_table includes;
-  /* The first .stabstr section.  */
-  asection *stabstr;
-};
-
 static struct bfd_hash_entry *stab_link_includes_newfunc
   PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
 
@@ -169,16 +150,15 @@
    pass of the linker.  */
 
 bfd_boolean
-_bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo, pstring_offset)
+_bfd_link_section_stabs (abfd, sinfo, stabsec, stabstrsec, psecinfo, pstring_offset)
      bfd *abfd;
-     PTR *psinfo;
+     struct stab_info *sinfo;
      asection *stabsec;
      asection *stabstrsec;
      PTR *psecinfo;
      bfd_size_type *pstring_offset;
 {
   bfd_boolean first;
-  struct stab_info *sinfo;
   bfd_size_type count, amt;
   struct stab_section_info *secinfo;
   bfd_byte *stabbuf = NULL;
@@ -187,14 +167,14 @@
   bfd_size_type stroff, next_stroff, skip;
   bfd_size_type *pstridx;
 
-  if (stabsec->_raw_size == 0
-      || stabstrsec->_raw_size == 0)
+  if (stabsec->size == 0
+      || stabstrsec->size == 0)
     {
       /* This file does not contain stabs debugging information.  */
       return TRUE;
     }
 
-  if (stabsec->_raw_size % STABSIZE != 0)
+  if (stabsec->size % STABSIZE != 0)
     {
       /* Something is wrong with the format of these stab symbols.
 	 Don't try to optimize them.  */
@@ -220,34 +200,30 @@
 
   first = FALSE;
 
-  if (*psinfo == NULL)
+  if (sinfo->stabstr == NULL)
     {
       /* Initialize the stabs information we need to keep track of.  */
       first = TRUE;
-      amt = sizeof (struct stab_info);
-      *psinfo = (PTR) bfd_alloc (abfd, amt);
-      if (*psinfo == NULL)
-	goto error_return;
-      sinfo = (struct stab_info *) *psinfo;
       sinfo->strings = _bfd_stringtab_init ();
       if (sinfo->strings == NULL)
 	goto error_return;
       /* Make sure the first byte is zero.  */
       (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE);
-      if (! bfd_hash_table_init_n (&sinfo->includes.root,
+      if (! bfd_hash_table_init_n (&sinfo->includes,
 				   stab_link_includes_newfunc,
 				   251))
 	goto error_return;
       sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr");
-      sinfo->stabstr->flags |= SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING;
+      if (sinfo->stabstr == NULL)
+	goto error_return;
+      sinfo->stabstr->flags |= (SEC_HAS_CONTENTS | SEC_READONLY
+				| SEC_DEBUGGING | SEC_LINKER_CREATED);
     }
 
-  sinfo = (struct stab_info *) *psinfo;
-
   /* Initialize the information we are going to store for this .stab
      section.  */
 
-  count = stabsec->_raw_size / STABSIZE;
+  count = stabsec->size / STABSIZE;
 
   amt = sizeof (struct stab_section_info);
   amt += (count - 1) * sizeof (bfd_size_type);
@@ -257,20 +233,14 @@
 
   secinfo = (struct stab_section_info *) *psecinfo;
   secinfo->excls = NULL;
+  stabsec->rawsize = stabsec->size;
   secinfo->cumulative_skips = NULL;
   memset (secinfo->stridxs, 0, (size_t) count * sizeof (bfd_size_type));
 
   /* Read the stabs information from abfd.  */
 
-  stabbuf = (bfd_byte *) bfd_malloc (stabsec->_raw_size);
-  stabstrbuf = (bfd_byte *) bfd_malloc (stabstrsec->_raw_size);
-  if (stabbuf == NULL || stabstrbuf == NULL)
-    goto error_return;
-
-  if (! bfd_get_section_contents (abfd, stabsec, stabbuf, (bfd_vma) 0,
-				  stabsec->_raw_size)
-      || ! bfd_get_section_contents (abfd, stabstrsec, stabstrbuf, (bfd_vma) 0,
-				     stabstrsec->_raw_size))
+  if (!bfd_malloc_and_get_section (abfd, stabsec, &stabbuf)
+      || !bfd_malloc_and_get_section (abfd, stabstrsec, &stabstrbuf))
     goto error_return;
 
   /* Look through the stabs symbols, work out the new string indices,
@@ -284,7 +254,7 @@
   next_stroff = pstring_offset ? *pstring_offset : 0;
   skip = 0;
 
-  symend = stabbuf + stabsec->_raw_size;
+  symend = stabbuf + stabsec->size;
   for (sym = stabbuf, pstridx = secinfo->stridxs;
        sym < symend;
        sym += STABSIZE, ++pstridx)
@@ -320,7 +290,7 @@
 
       /* Store the string in the hash table, and record the index.  */
       symstroff = stroff + bfd_get_32 (abfd, sym + STRDXOFF);
-      if (symstroff >= stabstrsec->_raw_size)
+      if (symstroff >= stabstrsec->size)
 	{
 	  (*_bfd_error_handler)
 	    (_("%s(%s+0x%lx): Stabs entry has invalid string index."),
@@ -340,15 +310,21 @@
 	 first number after an open parenthesis).  */
       if (type == (int) N_BINCL)
 	{
-	  bfd_vma val;
+	  bfd_vma sum_chars;
+	  bfd_vma num_chars;
+	  bfd_vma buf_len = 0;
+	  char * symb;
+	  char * symb_rover;
 	  int nest;
-	  bfd_byte *incl_sym;
-	  struct stab_link_includes_entry *incl_entry;
-	  struct stab_link_includes_totals *t;
-	  struct stab_excl_list *ne;
+	  bfd_byte * incl_sym;
+	  struct stab_link_includes_entry * incl_entry;
+	  struct stab_link_includes_totals * t;
+	  struct stab_excl_list * ne;
 
-	  val = 0;
+	  symb = symb_rover = NULL;
+	  sum_chars = num_chars = 0;
 	  nest = 0;
+
 	  for (incl_sym = sym + STABSIZE;
 	       incl_sym < symend;
 	       incl_sym += STABSIZE)
@@ -377,7 +353,17 @@
 			 + bfd_get_32 (abfd, incl_sym + STRDXOFF));
 		  for (; *str != '\0'; str++)
 		    {
-		      val += *str;
+		      if (num_chars >= buf_len)
+			{
+			  buf_len += 32 * 1024;
+			  symb = bfd_realloc (symb, buf_len);
+			  if (symb == NULL)
+			    goto error_return;
+			  symb_rover = symb + num_chars;
+			}
+		      * symb_rover ++ = * str;
+		      sum_chars += *str;
+		      num_chars ++;
 		      if (*str == '(')
 			{
 			  /* Skip the file number.  */
@@ -390,15 +376,19 @@
 		}
 	    }
 
+	  BFD_ASSERT (num_chars == (bfd_vma) (symb_rover - symb));
+
 	  /* If we have already included a header file with the same
 	     value, then replaced this one with an N_EXCL symbol.  */
-	  incl_entry = stab_link_includes_lookup (&sinfo->includes, string,
-						  TRUE, TRUE);
+	  incl_entry = (struct stab_link_includes_entry * )
+	    bfd_hash_lookup (&sinfo->includes, string, TRUE, TRUE);
 	  if (incl_entry == NULL)
 	    goto error_return;
 
 	  for (t = incl_entry->totals; t != NULL; t = t->next)
-	    if (t->total == val)
+	    if (t->sum_chars == sum_chars
+		&& t->num_chars == num_chars
+		&& memcmp (t->symb, symb, num_chars) == 0)
 	      break;
 
 	  /* Record this symbol, so that we can set the value
@@ -408,7 +398,7 @@
 	  if (ne == NULL)
 	    goto error_return;
 	  ne->offset = sym - stabbuf;
-	  ne->val = val;
+	  ne->val = sum_chars;
 	  ne->type = (int) N_BINCL;
 	  ne->next = secinfo->excls;
 	  secinfo->excls = ne;
@@ -418,10 +408,12 @@
 	      /* This is the first time we have seen this header file
 		 with this set of stabs strings.  */
 	      t = ((struct stab_link_includes_totals *)
-		   bfd_hash_allocate (&sinfo->includes.root, sizeof *t));
+		   bfd_hash_allocate (&sinfo->includes, sizeof *t));
 	      if (t == NULL)
 		goto error_return;
-	      t->total = val;
+	      t->sum_chars = sum_chars;
+	      t->num_chars = num_chars;
+	      t->symb = bfd_realloc (symb, num_chars); /* Trim data down.  */
 	      t->next = incl_entry->totals;
 	      incl_entry->totals = t;
 	    }
@@ -433,6 +425,9 @@
 		 pass to change the type to N_EXCL.  */
 	      ne->type = (int) N_EXCL;
 
+	      /* Free off superfluous symbols.  */
+	      free (symb);
+
 	      /* Mark the skipped symbols.  */
 
 	      nest = 0;
@@ -456,6 +451,9 @@
 		    }
 		  else if (incl_type == (int) N_BINCL)
 		    ++nest;
+		  else if (incl_type == (int) N_EXCL)
+		    /* Keep existing exclusion marks.  */
+		    continue;   
 		  else if (nest == 0)
 		    {
 		      *incl_pstridx = (bfd_size_type) -1;
@@ -478,11 +476,11 @@
      from the link.  We record the size of the strtab in the first
      .stabstr section we saw, and make sure we don't set SEC_EXCLUDE
      for that section.  */
-  stabsec->_cooked_size = (count - skip) * STABSIZE;
-  if (stabsec->_cooked_size == 0)
+  stabsec->size = (count - skip) * STABSIZE;
+  if (stabsec->size == 0)
     stabsec->flags |= SEC_EXCLUDE;
   stabstrsec->flags |= SEC_EXCLUDE;
-  sinfo->stabstr->_cooked_size = _bfd_stringtab_size (sinfo->strings);
+  sinfo->stabstr->size = _bfd_stringtab_size (sinfo->strings);
 
   /* Calculate the `cumulative_skips' array now that stabs have been
      deleted for this section.  */
@@ -520,7 +518,6 @@
     free (stabstrbuf);
   return FALSE;
 }
-
 
 /* This function is called for each input file before the stab
    section is relocated.  It discards stab entries for discarded
@@ -545,13 +542,13 @@
   bfd_size_type *pstridx;
   int deleting;
 
-  if (stabsec->_raw_size == 0)
+  if (stabsec->size == 0)
     {
       /* This file does not contain stabs debugging information.  */
       return FALSE;
     }
 
-  if (stabsec->_raw_size % STABSIZE != 0)
+  if (stabsec->size % STABSIZE != 0)
     {
       /* Something is wrong with the format of these stab symbols.
 	 Don't try to optimize them.  */
@@ -572,17 +569,12 @@
   if (psecinfo == NULL)
     return FALSE;
 
-  count = stabsec->_raw_size / STABSIZE;
+  count = stabsec->rawsize / STABSIZE;
   secinfo = (struct stab_section_info *) psecinfo;
 
   /* Read the stabs information from abfd.  */
 
-  stabbuf = (bfd_byte *) bfd_malloc (stabsec->_raw_size);
-  if (stabbuf == NULL)
-    goto error_return;
-
-  if (! bfd_get_section_contents (abfd, stabsec, stabbuf, (bfd_vma) 0,
-				  stabsec->_raw_size))
+  if (!bfd_malloc_and_get_section (abfd, stabsec, &stabbuf))
     goto error_return;
 
   /* Look through the stabs symbols and discard any information for
@@ -591,7 +583,7 @@
   skip = 0;
   deleting = -1;
 
-  symend = stabbuf + stabsec->_raw_size;
+  symend = stabbuf + stabsec->rawsize;
   for (sym = stabbuf, pstridx = secinfo->stridxs;
        sym < symend;
        sym += STABSIZE, ++pstridx)
@@ -649,8 +641,8 @@
   stabbuf = NULL;
 
   /* Shrink the stabsec as needed.  */
-  stabsec->_cooked_size -= skip * STABSIZE;
-  if (stabsec->_cooked_size == 0)
+  stabsec->size -= skip * STABSIZE;
+  if (stabsec->size == 0)
     stabsec->flags |= SEC_EXCLUDE;
 
   /* Recalculate the `cumulative_skips' array now that stabs have been
@@ -695,34 +687,31 @@
    contents.  */
 
 bfd_boolean
-_bfd_write_section_stabs (output_bfd, psinfo, stabsec, psecinfo, contents)
+_bfd_write_section_stabs (output_bfd, sinfo, stabsec, psecinfo, contents)
      bfd *output_bfd;
-     PTR *psinfo;
+     struct stab_info *sinfo;
      asection *stabsec;
      PTR *psecinfo;
      bfd_byte *contents;
 {
-  struct stab_info *sinfo;
   struct stab_section_info *secinfo;
   struct stab_excl_list *e;
   bfd_byte *sym, *tosym, *symend;
   bfd_size_type *pstridx;
 
-  sinfo = (struct stab_info *) *psinfo;
   secinfo = (struct stab_section_info *) *psecinfo;
 
   if (secinfo == NULL)
     return bfd_set_section_contents (output_bfd, stabsec->output_section,
-				     contents,
-				     (file_ptr) stabsec->output_offset,
-				     stabsec->_raw_size);
+				     contents, stabsec->output_offset,
+				     stabsec->size);
 
   /* Handle each N_BINCL entry.  */
   for (e = secinfo->excls; e != NULL; e = e->next)
     {
       bfd_byte *excl_sym;
 
-      BFD_ASSERT (e->offset < stabsec->_raw_size);
+      BFD_ASSERT (e->offset < stabsec->rawsize);
       excl_sym = contents + e->offset;
       bfd_put_32 (output_bfd, e->val, excl_sym + VALOFF);
       excl_sym[TYPEOFF] = e->type;
@@ -731,7 +720,7 @@
   /* Copy over all the stabs symbols, omitting the ones we don't want,
      and correcting the string indices for those we do want.  */
   tosym = contents;
-  symend = contents + stabsec->_raw_size;
+  symend = contents + stabsec->rawsize;
   for (sym = contents, pstridx = secinfo->stridxs;
        sym < symend;
        sym += STABSIZE, ++pstridx)
@@ -752,7 +741,7 @@
 	      bfd_put_32 (output_bfd, _bfd_stringtab_size (sinfo->strings),
 			  tosym + VALOFF);
 	      bfd_put_16 (output_bfd,
-			  stabsec->output_section->_raw_size / STABSIZE - 1,
+			  stabsec->output_section->size / STABSIZE - 1,
 			  tosym + DESCOFF);
 	    }
 
@@ -760,27 +749,20 @@
 	}
     }
 
-  BFD_ASSERT ((bfd_size_type) (tosym - contents) == stabsec->_cooked_size);
+  BFD_ASSERT ((bfd_size_type) (tosym - contents) == stabsec->size);
 
   return bfd_set_section_contents (output_bfd, stabsec->output_section,
 				   contents, (file_ptr) stabsec->output_offset,
-				   stabsec->_cooked_size);
+				   stabsec->size);
 }
 
 /* Write out the .stabstr section.  */
 
 bfd_boolean
-_bfd_write_stab_strings (output_bfd, psinfo)
+_bfd_write_stab_strings (output_bfd, sinfo)
      bfd *output_bfd;
-     PTR *psinfo;
+     struct stab_info *sinfo;
 {
-  struct stab_info *sinfo;
-
-  sinfo = (struct stab_info *) *psinfo;
-
-  if (sinfo == NULL)
-    return TRUE;
-
   if (bfd_is_abs_section (sinfo->stabstr->output_section))
     {
       /* The section was discarded from the link.  */
@@ -789,7 +771,7 @@
 
   BFD_ASSERT ((sinfo->stabstr->output_offset
 	       + _bfd_stringtab_size (sinfo->strings))
-	      <= sinfo->stabstr->output_section->_raw_size);
+	      <= sinfo->stabstr->output_section->size);
 
   if (bfd_seek (output_bfd,
 		(file_ptr) (sinfo->stabstr->output_section->filepos
@@ -802,7 +784,7 @@
 
   /* We no longer need the stabs information.  */
   _bfd_stringtab_free (sinfo->strings);
-  bfd_hash_table_free (&sinfo->includes.root);
+  bfd_hash_table_free (&sinfo->includes);
 
   return TRUE;
 }
@@ -812,22 +794,20 @@
    or -1 if the address refers to a stab which has been removed.  */
 
 bfd_vma
-_bfd_stab_section_offset (output_bfd, psinfo, stabsec, psecinfo, offset)
-     bfd *output_bfd ATTRIBUTE_UNUSED;
-     PTR *psinfo ATTRIBUTE_UNUSED;
+_bfd_stab_section_offset (stabsec, psecinfo, offset)
      asection *stabsec;
-     PTR *psecinfo;
+     PTR psecinfo;
      bfd_vma offset;
 {
   struct stab_section_info *secinfo;
 
-  secinfo = (struct stab_section_info *) *psecinfo;
+  secinfo = (struct stab_section_info *) psecinfo;
 
   if (secinfo == NULL)
     return offset;
 
-  if (offset >= stabsec->_raw_size)
-    return offset - (stabsec->_cooked_size - stabsec->_raw_size);
+  if (offset >= stabsec->rawsize)
+    return offset - stabsec->rawsize + stabsec->size;
 
   if (secinfo->cumulative_skips)
     {
diff --git a/bfd/sunos.c b/bfd/sunos.c
index 5b1b18b..e06bcaf 100644
--- a/bfd/sunos.c
+++ b/bfd/sunos.c
@@ -1,6 +1,6 @@
 /* BFD backend for SunOS binaries.
    Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+   2002, 2003, 2004 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -73,6 +73,7 @@
 
 #define MY_get_dynamic_symtab_upper_bound sunos_get_dynamic_symtab_upper_bound
 #define MY_canonicalize_dynamic_symtab sunos_canonicalize_dynamic_symtab
+#define MY_get_synthetic_symtab _bfd_nodynamic_get_synthetic_symtab
 #define MY_get_dynamic_reloc_upper_bound sunos_get_dynamic_reloc_upper_bound
 #define MY_canonicalize_dynamic_reloc sunos_canonicalize_dynamic_reloc
 #define MY_bfd_link_hash_table_create sunos_link_hash_table_create
@@ -196,7 +197,7 @@
   else
     dynsec = obj_datasec (abfd);
   dynoff -= bfd_get_section_vma (abfd, dynsec);
-  if (dynoff > bfd_section_size (abfd, dynsec))
+  if (dynoff > dynsec->size)
     return TRUE;
 
   /* This executable appears to be dynamically linked in a way that we
@@ -853,8 +854,8 @@
       dynobj = sunos_hash_table (info)->dynobj;
 
       s = bfd_get_section_by_name (dynobj, ".got");
-      if (s->_raw_size == 0)
-	s->_raw_size = BYTES_IN_WORD;
+      if (s->size == 0)
+	s->size = BYTES_IN_WORD;
 
       sunos_hash_table (info)->dynamic_sections_needed = TRUE;
       sunos_hash_table (info)->got_needed = TRUE;
@@ -1377,7 +1378,7 @@
 	 so that 13 bit relocations have a greater chance of working.  */
       s = bfd_get_section_by_name (dynobj, ".got");
       BFD_ASSERT (s != NULL);
-      if (s->_raw_size >= 0x1000)
+      if (s->size >= 0x1000)
 	h->root.root.u.def.value = 0x1000;
       else
 	h->root.root.u.def.value = 0;
@@ -1394,7 +1395,7 @@
       /* The .dynamic section is always the same size.  */
       s = *sdynptr;
       BFD_ASSERT (s != NULL);
-      s->_raw_size = (sizeof (struct external_sun4_dynamic)
+      s->size = (sizeof (struct external_sun4_dynamic)
 		      + EXTERNAL_SUN4_DYNAMIC_DEBUGGER_SIZE
 		      + sizeof (struct external_sun4_dynamic_link));
 
@@ -1408,9 +1409,9 @@
 	 sunos_scan_dynamic_symbol.  */
       s = bfd_get_section_by_name (dynobj, ".dynsym");
       BFD_ASSERT (s != NULL);
-      s->_raw_size = dynsymcount * sizeof (struct external_nlist);
-      s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size);
-      if (s->contents == NULL && s->_raw_size != 0)
+      s->size = dynsymcount * sizeof (struct external_nlist);
+      s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->size);
+      if (s->contents == NULL && s->size != 0)
 	return FALSE;
 
       /* The number of buckets is just the number of symbols divided
@@ -1435,7 +1436,7 @@
 	return FALSE;
       for (i = 0; i < bucketcount; i++)
 	PUT_WORD (output_bfd, (bfd_vma) -1, s->contents + i * HASH_ENTRY_SIZE);
-      s->_raw_size = bucketcount * HASH_ENTRY_SIZE;
+      s->size = bucketcount * HASH_ENTRY_SIZE;
 
       sunos_hash_table (info)->bucketcount = bucketcount;
 
@@ -1453,19 +1454,19 @@
 	 important, but it can't hurt much.  */
       s = bfd_get_section_by_name (dynobj, ".dynstr");
       BFD_ASSERT (s != NULL);
-      if ((s->_raw_size & 7) != 0)
+      if ((s->size & 7) != 0)
 	{
 	  bfd_size_type add;
 	  bfd_byte *contents;
 
-	  add = 8 - (s->_raw_size & 7);
+	  add = 8 - (s->size & 7);
 	  contents = (bfd_byte *) bfd_realloc (s->contents,
-					       s->_raw_size + add);
+					       s->size + add);
 	  if (contents == NULL)
 	    return FALSE;
-	  memset (contents + s->_raw_size, 0, (size_t) add);
+	  memset (contents + s->size, 0, (size_t) add);
 	  s->contents = contents;
-	  s->_raw_size += add;
+	  s->size += add;
 	}
     }
 
@@ -1473,9 +1474,9 @@
      table and the dynamic relocs, allocate storage for them.  */
   s = bfd_get_section_by_name (dynobj, ".plt");
   BFD_ASSERT (s != NULL);
-  if (s->_raw_size != 0)
+  if (s->size != 0)
     {
-      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
+      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size);
       if (s->contents == NULL)
 	return FALSE;
 
@@ -1496,9 +1497,9 @@
     }
 
   s = bfd_get_section_by_name (dynobj, ".dynrel");
-  if (s->_raw_size != 0)
+  if (s->size != 0)
     {
-      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
+      s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size);
       if (s->contents == NULL)
 	return FALSE;
     }
@@ -1508,7 +1509,7 @@
 
   /* Make space for the global offset table.  */
   s = bfd_get_section_by_name (dynobj, ".got");
-  s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size);
+  s->contents = (bfd_byte *) bfd_alloc (dynobj, s->size);
   if (s->contents == NULL)
     return FALSE;
 
@@ -1682,8 +1683,8 @@
 
 	  sgot = bfd_get_section_by_name (dynobj, ".got");
 	  BFD_ASSERT (sgot != NULL);
-	  if (sgot->_raw_size == 0)
-	    sgot->_raw_size = BYTES_IN_WORD;
+	  if (sgot->size == 0)
+	    sgot->size = BYTES_IN_WORD;
 	  sunos_hash_table (info)->got_needed = TRUE;
 	}
 
@@ -1702,7 +1703,7 @@
 	{
 	  /* Presumably this symbol was marked as being undefined by
 	     an earlier reloc.  */
-	  srel->_raw_size += RELOC_STD_SIZE;
+	  srel->size += RELOC_STD_SIZE;
 	}
       else if ((h->root.root.u.def.section->flags & SEC_CODE) == 0)
 	{
@@ -1711,7 +1712,7 @@
 	  /* This reloc is not in the .text section.  It must be
 	     copied into the dynamic relocs.  We mark the symbol as
 	     being undefined.  */
-	  srel->_raw_size += RELOC_STD_SIZE;
+	  srel->size += RELOC_STD_SIZE;
 	  sub = h->root.root.u.def.section->owner;
 	  h->root.root.type = bfd_link_hash_undefined;
 	  h->root.root.u.undef.abfd = sub;
@@ -1725,21 +1726,21 @@
 	     be handled correctly.  */
 	  if (h->plt_offset == 0)
 	    {
-	      if (splt->_raw_size == 0)
-		splt->_raw_size = M68K_PLT_ENTRY_SIZE;
-	      h->plt_offset = splt->_raw_size;
+	      if (splt->size == 0)
+		splt->size = M68K_PLT_ENTRY_SIZE;
+	      h->plt_offset = splt->size;
 
 	      if ((h->flags & SUNOS_DEF_REGULAR) == 0)
 		{
 		  h->root.root.u.def.section = splt;
-		  h->root.root.u.def.value = splt->_raw_size;
+		  h->root.root.u.def.value = splt->size;
 		}
 
-	      splt->_raw_size += M68K_PLT_ENTRY_SIZE;
+	      splt->size += M68K_PLT_ENTRY_SIZE;
 
 	      /* We may also need a dynamic reloc entry.  */
 	      if ((h->flags & SUNOS_DEF_REGULAR) == 0)
-		srel->_raw_size += RELOC_STD_SIZE;
+		srel->size += RELOC_STD_SIZE;
 	    }
 	}
     }
@@ -1836,8 +1837,8 @@
 	      BFD_ASSERT (splt != NULL && sgot != NULL && srel != NULL);
 
 	      /* Make sure we have an initial entry in the .got table.  */
-	      if (sgot->_raw_size == 0)
-		sgot->_raw_size = BYTES_IN_WORD;
+	      if (sgot->size == 0)
+		sgot->size = BYTES_IN_WORD;
 	      sunos_hash_table (info)->got_needed = TRUE;
 	    }
 
@@ -1846,7 +1847,7 @@
 	      if (h->got_offset != 0)
 		continue;
 
-	      h->got_offset = sgot->_raw_size;
+	      h->got_offset = sgot->size;
 	    }
 	  else
 	    {
@@ -1870,10 +1871,10 @@
 	      if (adata (abfd).local_got_offsets[r_index] != 0)
 		continue;
 
-	      adata (abfd).local_got_offsets[r_index] = sgot->_raw_size;
+	      adata (abfd).local_got_offsets[r_index] = sgot->size;
 	    }
 
-	  sgot->_raw_size += BYTES_IN_WORD;
+	  sgot->size += BYTES_IN_WORD;
 
 	  /* If we are making a shared library, or if the symbol is
 	     defined by a dynamic object, we will need a dynamic reloc
@@ -1882,7 +1883,7 @@
 	      || (h != NULL
 		  && (h->flags & SUNOS_DEF_DYNAMIC) != 0
 		  && (h->flags & SUNOS_DEF_REGULAR) == 0))
-	    srel->_raw_size += RELOC_EXT_SIZE;
+	    srel->size += RELOC_EXT_SIZE;
 
 	  continue;
 	}
@@ -1907,7 +1908,7 @@
 		  BFD_ASSERT (splt != NULL && sgot != NULL && srel != NULL);
 		}
 
-	      srel->_raw_size += RELOC_EXT_SIZE;
+	      srel->size += RELOC_EXT_SIZE;
 	    }
 
 	  continue;
@@ -1954,8 +1955,8 @@
 	  BFD_ASSERT (splt != NULL && sgot != NULL && srel != NULL);
 
 	  /* Make sure we have an initial entry in the .got table.  */
-	  if (sgot->_raw_size == 0)
-	    sgot->_raw_size = BYTES_IN_WORD;
+	  if (sgot->size == 0)
+	    sgot->size = BYTES_IN_WORD;
 	  sunos_hash_table (info)->got_needed = TRUE;
 	}
 
@@ -1979,7 +1980,7 @@
 	{
 	  /* Presumably this symbol was marked as being undefined by
 	     an earlier reloc.  */
-	  srel->_raw_size += RELOC_EXT_SIZE;
+	  srel->size += RELOC_EXT_SIZE;
 	}
       else if (r_type != RELOC_JMP_TBL
 	       && (h->root.root.u.def.section->flags & SEC_CODE) == 0)
@@ -1989,7 +1990,7 @@
 	  /* This reloc is not in the .text section.  It must be
 	     copied into the dynamic relocs.  We mark the symbol as
 	     being undefined.  */
-	  srel->_raw_size += RELOC_EXT_SIZE;
+	  srel->size += RELOC_EXT_SIZE;
 	  if ((h->flags & SUNOS_DEF_REGULAR) == 0)
 	    {
 	      sub = h->root.root.u.def.section->owner;
@@ -2006,31 +2007,31 @@
 	     be handled correctly.  */
 	  if (h->plt_offset == 0)
 	    {
-	      if (splt->_raw_size == 0)
-		splt->_raw_size = SPARC_PLT_ENTRY_SIZE;
-	      h->plt_offset = splt->_raw_size;
+	      if (splt->size == 0)
+		splt->size = SPARC_PLT_ENTRY_SIZE;
+	      h->plt_offset = splt->size;
 
 	      if ((h->flags & SUNOS_DEF_REGULAR) == 0)
 		{
 		  if (h->root.root.type == bfd_link_hash_undefined)
 		    h->root.root.type = bfd_link_hash_defined;
 		  h->root.root.u.def.section = splt;
-		  h->root.root.u.def.value = splt->_raw_size;
+		  h->root.root.u.def.value = splt->size;
 		}
 
-	      splt->_raw_size += SPARC_PLT_ENTRY_SIZE;
+	      splt->size += SPARC_PLT_ENTRY_SIZE;
 
 	      /* We will also need a dynamic reloc entry, unless this
 		 is a JMP_TBL reloc produced by linking PIC compiled
 		 code, and we are not making a shared library.  */
 	      if (info->shared || (h->flags & SUNOS_DEF_REGULAR) == 0)
-		srel->_raw_size += RELOC_EXT_SIZE;
+		srel->size += RELOC_EXT_SIZE;
 	    }
 
 	  /* If we are creating a shared library, we need to copy over
 	     any reloc other than a jump table reloc.  */
 	  if (info->shared && r_type != RELOC_JMP_TBL)
-	    srel->_raw_size += RELOC_EXT_SIZE;
+	    srel->size += RELOC_EXT_SIZE;
 	}
     }
 
@@ -2119,14 +2120,14 @@
       s = bfd_get_section_by_name (dynobj, ".dynstr");
       BFD_ASSERT (s != NULL);
       contents = (bfd_byte *) bfd_realloc (s->contents,
-					   s->_raw_size + len + 1);
+					   s->size + len + 1);
       if (contents == NULL)
 	return FALSE;
       s->contents = contents;
 
-      h->dynstr_index = s->_raw_size;
-      strcpy ((char *) contents + s->_raw_size, h->root.root.root.string);
-      s->_raw_size += len + 1;
+      h->dynstr_index = s->size;
+      strcpy ((char *) contents + s->size, h->root.root.root.string);
+      s->size += len + 1;
 
       /* Add it to the dynamic hash table.  */
       name = (unsigned char *) h->root.root.root.string;
@@ -2149,11 +2150,11 @@
 			   (s->contents
 			    + hash * HASH_ENTRY_SIZE
 			    + BYTES_IN_WORD));
-	  PUT_WORD (dynobj, s->_raw_size / HASH_ENTRY_SIZE,
+	  PUT_WORD (dynobj, s->size / HASH_ENTRY_SIZE,
 		    s->contents + hash * HASH_ENTRY_SIZE + BYTES_IN_WORD);
-	  PUT_WORD (dynobj, h->dynindx, s->contents + s->_raw_size);
-	  PUT_WORD (dynobj, next, s->contents + s->_raw_size + BYTES_IN_WORD);
-	  s->_raw_size += HASH_ENTRY_SIZE;
+	  PUT_WORD (dynobj, h->dynindx, s->contents + s->size);
+	  PUT_WORD (dynobj, next, s->contents + s->size + BYTES_IN_WORD);
+	  s->size += HASH_ENTRY_SIZE;
 	}
     }
 
@@ -2254,7 +2255,7 @@
 	{
 	  BFD_ASSERT (h->dynindx >= 0);
 	  BFD_ASSERT (s->reloc_count * obj_reloc_entry_size (dynobj)
-		      < s->_raw_size);
+		      < s->size);
 	  p = s->contents + s->reloc_count * obj_reloc_entry_size (output_bfd);
 	  if (obj_reloc_entry_size (output_bfd) == RELOC_STD_SIZE)
 	    {
@@ -2561,7 +2562,7 @@
 	      s = bfd_get_section_by_name (dynobj, ".dynrel");
 	      BFD_ASSERT (s != NULL);
 	      BFD_ASSERT (s->reloc_count * obj_reloc_entry_size (dynobj)
-			  < s->_raw_size);
+			  < s->size);
 
 	      p = (s->contents
 		   + s->reloc_count * obj_reloc_entry_size (dynobj));
@@ -2690,7 +2691,7 @@
 
   s = bfd_get_section_by_name (dynobj, ".dynrel");
   BFD_ASSERT (s != NULL);
-  BFD_ASSERT (s->reloc_count * obj_reloc_entry_size (dynobj) < s->_raw_size);
+  BFD_ASSERT (s->reloc_count * obj_reloc_entry_size (dynobj) < s->size);
 
   p = s->contents + s->reloc_count * obj_reloc_entry_size (dynobj);
 
@@ -2796,7 +2797,7 @@
      real addresses.  Now that we know the section location, we can
      fill in the final values.  */
   s = bfd_get_section_by_name (dynobj, ".need");
-  if (s != NULL && s->_raw_size != 0)
+  if (s != NULL && s->size != 0)
     {
       file_ptr filepos;
       bfd_byte *p;
@@ -2820,7 +2821,7 @@
      dynamic information, unless this is a shared library.  */
   s = bfd_get_section_by_name (dynobj, ".got");
   BFD_ASSERT (s != NULL);
-  if (info->shared || sdyn->_raw_size == 0)
+  if (info->shared || sdyn->size == 0)
     PUT_WORD (dynobj, 0, s->contents);
   else
     PUT_WORD (dynobj, sdyn->output_section->vma + sdyn->output_offset,
@@ -2836,12 +2837,12 @@
 	  if (! bfd_set_section_contents (abfd, o->output_section,
 					  o->contents,
 					  (file_ptr) o->output_offset,
-					  o->_raw_size))
+					  o->size))
 	    return FALSE;
 	}
     }
 
-  if (sdyn->_raw_size > 0)
+  if (sdyn->size > 0)
     {
       struct external_sun4_dynamic esd;
       struct external_sun4_dynamic_link esdl;
@@ -2867,14 +2868,14 @@
       PUT_WORD (dynobj, (bfd_vma) 0, esdl.ld_loaded);
 
       s = bfd_get_section_by_name (dynobj, ".need");
-      if (s == NULL || s->_raw_size == 0)
+      if (s == NULL || s->size == 0)
 	PUT_WORD (dynobj, (bfd_vma) 0, esdl.ld_need);
       else
 	PUT_WORD (dynobj, s->output_section->filepos + s->output_offset,
 		  esdl.ld_need);
 
       s = bfd_get_section_by_name (dynobj, ".rules");
-      if (s == NULL || s->_raw_size == 0)
+      if (s == NULL || s->size == 0)
 	PUT_WORD (dynobj, (bfd_vma) 0, esdl.ld_rules);
       else
 	PUT_WORD (dynobj, s->output_section->filepos + s->output_offset,
@@ -2889,12 +2890,12 @@
       BFD_ASSERT (s != NULL);
       PUT_WORD (dynobj, s->output_section->vma + s->output_offset,
 		esdl.ld_plt);
-      PUT_WORD (dynobj, s->_raw_size, esdl.ld_plt_sz);
+      PUT_WORD (dynobj, s->size, esdl.ld_plt_sz);
 
       s = bfd_get_section_by_name (dynobj, ".dynrel");
       BFD_ASSERT (s != NULL);
       BFD_ASSERT (s->reloc_count * obj_reloc_entry_size (dynobj)
-		  == s->_raw_size);
+		  == s->size);
       PUT_WORD (dynobj, s->output_section->filepos + s->output_offset,
 		esdl.ld_rel);
 
@@ -2917,13 +2918,13 @@
       BFD_ASSERT (s != NULL);
       PUT_WORD (dynobj, s->output_section->filepos + s->output_offset,
 		esdl.ld_symbols);
-      PUT_WORD (dynobj, s->_raw_size, esdl.ld_symb_size);
+      PUT_WORD (dynobj, s->size, esdl.ld_symb_size);
 
       /* The size of the text area is the size of the .text section
 	 rounded up to a page boundary.  FIXME: Should the page size be
 	 conditional on something?  */
       PUT_WORD (dynobj,
-		BFD_ALIGN (obj_textsec (abfd)->_raw_size, 0x2000),
+		BFD_ALIGN (obj_textsec (abfd)->size, 0x2000),
 		esdl.ld_text);
 
       pos = sdyn->output_offset;
diff --git a/bfd/syms.c b/bfd/syms.c
index c07f48b..6b615a2 100644
--- a/bfd/syms.c
+++ b/bfd/syms.c
@@ -1,6 +1,6 @@
 /* Generic symbol-table support for the BFD library.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -934,8 +934,12 @@
 	  return TRUE;
 	}
 
-      stabsize = info->stabsec->_raw_size;
-      strsize = info->strsec->_raw_size;
+      stabsize = (info->stabsec->rawsize
+		  ? info->stabsec->rawsize
+		  : info->stabsec->size);
+      strsize = (info->strsec->rawsize
+		 ? info->strsec->rawsize
+		 : info->strsec->size);
     }
   else
     {
@@ -965,8 +969,12 @@
 	  return TRUE;
 	}
 
-      stabsize = info->stabsec->_raw_size;
-      strsize = info->strsec->_raw_size;
+      stabsize = (info->stabsec->rawsize
+		  ? info->stabsec->rawsize
+		  : info->stabsec->size);
+      strsize = (info->strsec->rawsize
+		 ? info->strsec->rawsize
+		 : info->strsec->size);
 
       info->stabs = bfd_alloc (abfd, stabsize);
       info->strs = bfd_alloc (abfd, strsize);
@@ -974,9 +982,9 @@
 	return FALSE;
 
       if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs,
-				      (bfd_vma) 0, stabsize)
+				      0, stabsize)
 	  || ! bfd_get_section_contents (abfd, info->strsec, info->strs,
-					 (bfd_vma) 0, strsize))
+					 0, strsize))
 	return FALSE;
 
       /* If this is a relocatable object file, we have to relocate
diff --git a/bfd/targets.c b/bfd/targets.c
index 9d81c56..0719d4f 100644
--- a/bfd/targets.c
+++ b/bfd/targets.c
@@ -265,6 +265,7 @@
 .  NAME##_bfd_merge_private_bfd_data, \
 .  NAME##_bfd_copy_private_section_data, \
 .  NAME##_bfd_copy_private_symbol_data, \
+.  NAME##_bfd_copy_private_header_data, \
 .  NAME##_bfd_set_private_flags, \
 .  NAME##_bfd_print_private_bfd_data
 .
@@ -282,6 +283,10 @@
 .     to another.  *}
 .  bfd_boolean (*_bfd_copy_private_symbol_data)
 .    (bfd *, asymbol *, bfd *, asymbol *);
+.  {* Called to copy BFD private header data from one object file
+.     to another.  *}
+.  bfd_boolean (*_bfd_copy_private_header_data)
+.    (bfd *, bfd *);
 .  {* Called to set private backend flags.  *}
 .  bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
 .
@@ -406,6 +411,7 @@
 .  NAME##_bfd_link_split_section, \
 .  NAME##_bfd_gc_sections, \
 .  NAME##_bfd_merge_sections, \
+.  NAME##_bfd_is_group_section, \
 .  NAME##_bfd_discard_group
 .
 .  int         (*_bfd_sizeof_headers) (bfd *, bfd_boolean);
@@ -443,6 +449,9 @@
 .  {* Attempt to merge SEC_MERGE sections.  *}
 .  bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
 .
+.  {* Is this section a member of a group?  *}
+.  bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
+.
 .  {* Discard members of a group.  *}
 .  bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
 .
@@ -450,6 +459,7 @@
 .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
 .  NAME##_get_dynamic_symtab_upper_bound, \
 .  NAME##_canonicalize_dynamic_symtab, \
+.  NAME##_get_synthetic_symtab, \
 .  NAME##_get_dynamic_reloc_upper_bound, \
 .  NAME##_canonicalize_dynamic_reloc
 .
@@ -458,6 +468,9 @@
 .  {* Read in the dynamic symbols.  *}
 .  long        (*_bfd_canonicalize_dynamic_symtab)
 .    (bfd *, struct bfd_symbol **);
+.  {* Create synthetized symbols.  *}
+.  long        (*_bfd_get_synthetic_symtab)
+.    (bfd *, struct bfd_symbol **, struct bfd_symbol **);
 .  {* Get the amount of memory required to hold the dynamic relocs.  *}
 .  long        (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
 .  {* Read in the dynamic relocs.  *}
@@ -517,12 +530,15 @@
 extern const bfd_target bfd_elf32_bigarm_oabi_vec;
 extern const bfd_target bfd_elf32_bigarm_vec;
 extern const bfd_target bfd_elf32_bigmips_vec;
+extern const bfd_target bfd_elf32_cr16c_vec;
 extern const bfd_target bfd_elf32_cris_vec;
+extern const bfd_target bfd_elf32_crx_vec;
 extern const bfd_target bfd_elf32_d10v_vec;
 extern const bfd_target bfd_elf32_d30v_vec;
 extern const bfd_target bfd_elf32_dlx_big_vec;
 extern const bfd_target bfd_elf32_fr30_vec;
 extern const bfd_target bfd_elf32_frv_vec;
+extern const bfd_target bfd_elf32_frvfdpic_vec;
 extern const bfd_target bfd_elf32_h8300_vec;
 extern const bfd_target bfd_elf32_hppa_linux_vec;
 extern const bfd_target bfd_elf32_hppa_vec;
@@ -574,6 +590,7 @@
 extern const bfd_target bfd_elf32_sh_vec;
 extern const bfd_target bfd_elf32_shblin_vec;
 extern const bfd_target bfd_elf32_shl_vec;
+extern const bfd_target bfd_elf32_shl_symbian_vec;
 extern const bfd_target bfd_elf32_shlin_vec;
 extern const bfd_target bfd_elf32_shlnbsd_vec;
 extern const bfd_target bfd_elf32_shnbsd_vec;
@@ -658,6 +675,7 @@
 extern const bfd_target m68ksysvcoff_vec;
 extern const bfd_target m88kbcs_vec;
 extern const bfd_target m88kmach3_vec;
+extern const bfd_target m88kopenbsd_vec;
 extern const bfd_target mach_o_be_vec;
 extern const bfd_target mach_o_le_vec;
 extern const bfd_target mach_o_fat_vec;
@@ -807,12 +825,15 @@
 	&bfd_elf32_bigarm_oabi_vec,
 	&bfd_elf32_bigarm_vec,
 	&bfd_elf32_bigmips_vec,
+	&bfd_elf32_cr16c_vec,
 	&bfd_elf32_cris_vec,
+	&bfd_elf32_crx_vec,
 	&bfd_elf32_d10v_vec,
 	&bfd_elf32_d30v_vec,
 	&bfd_elf32_dlx_big_vec,
 	&bfd_elf32_fr30_vec,
 	&bfd_elf32_frv_vec,
+	&bfd_elf32_frvfdpic_vec,
 	&bfd_elf32_h8300_vec,
 	&bfd_elf32_hppa_linux_vec,
 	&bfd_elf32_hppa_vec,
@@ -862,6 +883,7 @@
         &bfd_elf32_sh_vec,
         &bfd_elf32_shblin_vec,
         &bfd_elf32_shl_vec,
+        &bfd_elf32_shl_symbian_vec,
         &bfd_elf32_shlin_vec,
 	&bfd_elf32_shlnbsd_vec,
 	&bfd_elf32_shnbsd_vec,
@@ -980,6 +1002,7 @@
 	&m68ksysvcoff_vec,
 	&m88kbcs_vec,
 	&m88kmach3_vec,
+	&m88kopenbsd_vec,
 	&mach_o_be_vec,
 	&mach_o_le_vec,
 	&mach_o_fat_vec,
diff --git a/bfd/tekhex.c b/bfd/tekhex.c
index f828fe7..b5ec803 100644
--- a/bfd/tekhex.c
+++ b/bfd/tekhex.c
@@ -1,6 +1,6 @@
 /* BFD backend for Extended Tektronix Hex Format  objects.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
+   2003, 2004 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.
@@ -429,7 +429,7 @@
 	    case '1':		/* section range */
 	      src++;
 	      section->vma = getvalue (&src);
-	      section->_raw_size = getvalue (&src) - section->vma;
+	      section->size = getvalue (&src) - section->vma;
 	      section->flags = SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC;
 	      break;
 	    case '0':
@@ -688,7 +688,7 @@
 	  if (s->flags & SEC_LOAD)
 	    {
 	      for (vma = s->vma & ~(bfd_vma) CHUNK_MASK;
-		   vma < s->vma + s->_raw_size;
+		   vma < s->vma + s->size;
 		   vma += CHUNK_MASK)
 		find_chunk (abfd, vma);
 	    }
@@ -862,7 +862,7 @@
       writesym (&dst, s->name);
       *dst++ = '1';
       writevalue (&dst, s->vma);
-      writevalue (&dst, s->vma + s->_raw_size);
+      writevalue (&dst, s->vma + s->size);
       out (abfd, '3', buffer, dst);
     }
 
@@ -1001,6 +1001,7 @@
 #define tekhex_bfd_relax_section bfd_generic_relax_section
 #define tekhex_bfd_gc_sections bfd_generic_gc_sections
 #define tekhex_bfd_merge_sections bfd_generic_merge_sections
+#define tekhex_bfd_is_group_section bfd_generic_is_group_section
 #define tekhex_bfd_discard_group bfd_generic_discard_group
 #define tekhex_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define tekhex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
diff --git a/bfd/trad-core.c b/bfd/trad-core.c
index f8c03d7..dda2e81 100644
--- a/bfd/trad-core.c
+++ b/bfd/trad-core.c
@@ -111,8 +111,7 @@
   {
     FILE *stream = bfd_cache_lookup (abfd);
     struct stat statbuf;
-    if (stream == NULL)
-      return 0;
+
     if (fstat (fileno (stream), &statbuf) < 0)
       {
 	bfd_set_error (bfd_error_system_call);
@@ -174,13 +173,13 @@
   core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS;
   core_regsec (abfd)->flags = SEC_HAS_CONTENTS;
 
-  core_datasec (abfd)->_raw_size =  NBPG * u.u_dsize
+  core_datasec (abfd)->size =  NBPG * u.u_dsize
 #ifdef TRAD_CORE_DSIZE_INCLUDES_TSIZE
     - NBPG * u.u_tsize
 #endif
       ;
-  core_stacksec (abfd)->_raw_size = NBPG * u.u_ssize;
-  core_regsec (abfd)->_raw_size = NBPG * UPAGES; /* Larger than sizeof struct u */
+  core_stacksec (abfd)->size = NBPG * u.u_ssize;
+  core_regsec (abfd)->size = NBPG * UPAGES; /* Larger than sizeof struct u */
 
   /* What a hack... we'd like to steal it from the exec file,
      since the upage does not seem to provide it.  FIXME.  */
diff --git a/bfd/versados.c b/bfd/versados.c
index 19df300..e454cf3 100644
--- a/bfd/versados.c
+++ b/bfd/versados.c
@@ -1,5 +1,5 @@
 /* BFD back-end for VERSAdos-E objects.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003
+   Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
 
@@ -320,7 +320,7 @@
 	case ESD_STD_REL_SEC:
 	case ESD_SHRT_REL_SEC:
 	  {
-	    sec->_raw_size = get_4 (&ptr);
+	    sec->size = get_4 (&ptr);
 	    sec->flags |= SEC_ALLOC;
 	  }
 	  break;
@@ -470,7 +470,7 @@
       else
 	{
 	  need_contents = 1;
-	  if (dst_idx < esdid->section->_raw_size)
+	  if (dst_idx < esdid->section->size)
 	    if (pass == 2)
 	      {
 		/* absolute code, comes in 16 bit lumps */
@@ -485,7 +485,7 @@
 
   if (!contents && need_contents)
     {
-      bfd_size_type size = esdid->section->_raw_size;
+      bfd_size_type size = esdid->section->size;
       esdid->contents = (unsigned char *) bfd_alloc (abfd, size);
     }
 }
@@ -872,6 +872,7 @@
 #define versados_bfd_relax_section bfd_generic_relax_section
 #define versados_bfd_gc_sections bfd_generic_gc_sections
 #define versados_bfd_merge_sections bfd_generic_merge_sections
+#define versados_bfd_is_group_section bfd_generic_is_group_section
 #define versados_bfd_discard_group bfd_generic_discard_group
 #define versados_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define versados_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
diff --git a/bfd/version.h b/bfd/version.h
index 2b59970..41b3ef5 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20040324
+#define BFD_VERSION_DATE 20040709
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING @bfd_version_string@
diff --git a/bfd/vms-gsd.c b/bfd/vms-gsd.c
index 660c06c..5a107e1 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, 1999, 2000, 2001, 2002
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004
    Free Software Foundation, Inc.
 
    go and read the openVMS linker manual (esp. appendix B)
@@ -358,9 +358,9 @@
 		  return -1;
 		}
 	      old_flags = bfd_getl16 (vms_rec + 2);
-	      section->_raw_size = bfd_getl32 (vms_rec + 4);  /* allocation */
+	      section->size = bfd_getl32 (vms_rec + 4);  /* allocation */
 	      new_flags = vms_secflag_by_name (abfd, vax_section_flags, name,
-					       section->_raw_size > 0);
+					       section->size > 0);
 	      if (old_flags & EGPS_S_V_REL)
 		new_flags |= SEC_RELOC;
 	      if (old_flags & GPS_S_M_OVR)
@@ -377,7 +377,7 @@
 	      if ((base_addr % align_addr) != 0)
 		base_addr += (align_addr - (base_addr % align_addr));
 	      section->vma = (bfd_vma)base_addr;
-	      base_addr += section->_raw_size;
+	      base_addr += section->size;
 
 	      /* global section is common symbol  */
 
@@ -401,21 +401,21 @@
 	      if (old_section != 0)
 		{
 		  section->contents = old_section->contents;
-		  if (section->_raw_size < old_section->_raw_size)
+		  if (section->size < old_section->size)
 		    {
 		      (*_bfd_error_handler)
 			(_("Size mismatch section %s=%lx, %s=%lx"),
 			 old_section->name,
-			 (unsigned long) old_section->_raw_size,
+			 (unsigned long) old_section->size,
 			 section->name,
-			 (unsigned long) section->_raw_size);
+			 (unsigned long) section->size);
 		      return -1;
 		    }
-		  else if (section->_raw_size > old_section->_raw_size)
+		  else if (section->size > old_section->size)
 		    {
 		      section->contents = ((unsigned char *)
 					   bfd_realloc (old_section->contents,
-							section->_raw_size));
+							section->size));
 		      if (section->contents == NULL)
 			{
 			  bfd_set_error (bfd_error_no_memory);
@@ -426,19 +426,18 @@
 	      else
 		{
 		  section->contents = ((unsigned char *)
-				       bfd_zmalloc (section->_raw_size));
+				       bfd_zmalloc (section->size));
 		  if (section->contents == NULL)
 		    {
 		      bfd_set_error (bfd_error_no_memory);
 		      return -1;
 		    }
 		}
-	      section->_cooked_size = section->_raw_size;
 #if VMS_DEBUG
 	      vms_debug (4, "gsd psc %d (%s, flags %04x=%s) ",
 			 section->index, name, old_flags, flag2str (gpsflagdesc, old_flags));
 	      vms_debug (4, "%d bytes at 0x%08lx (mem %p)\n",
-			 section->_raw_size, section->vma, section->contents);
+			 section->size, section->vma, section->contents);
 #endif
 
 	      gsd_size = vms_rec[8] + 9;
@@ -603,9 +602,9 @@
 	    if (!section)
 	      return -1;
 	    old_flags = bfd_getl16 (vms_rec + 6);
-	    section->_raw_size = bfd_getl32 (vms_rec + 8);	/* allocation */
+	    section->size = bfd_getl32 (vms_rec + 8);	/* allocation */
 	    new_flags = vms_secflag_by_name (abfd, evax_section_flags, name,
-					     section->_raw_size > 0);
+					     section->size > 0);
 	    if (old_flags & EGPS_S_V_REL)
 	      new_flags |= SEC_RELOC;
 	    if (!bfd_set_section_flags (abfd, section, new_flags))
@@ -615,17 +614,16 @@
 	    if ((base_addr % align_addr) != 0)
 	      base_addr += (align_addr - (base_addr % align_addr));
 	    section->vma = (bfd_vma)base_addr;
-	    base_addr += section->_raw_size;
+	    base_addr += section->size;
 	    section->contents = ((unsigned char *)
-				 bfd_zmalloc (section->_raw_size));
+				 bfd_zmalloc (section->size));
 	    if (section->contents == NULL)
 	      return -1;
-	    section->_cooked_size = section->_raw_size;
 #if VMS_DEBUG
 	    vms_debug(4, "egsd psc %d (%s, flags %04x=%s) ",
 		       section->index, name, old_flags, flag2str(gpsflagdesc, old_flags));
 	    vms_debug(4, "%d bytes at 0x%08lx (mem %p)\n",
-		       section->_raw_size, section->vma, section->contents);
+		       section->size, section->vma, section->contents);
 #endif
 	  }
 	  break;
@@ -758,7 +756,7 @@
   while (section != 0)
     {
 #if VMS_DEBUG
-  vms_debug (3, "Section #%d %s, %d bytes\n", section->index, section->name, (int)section->_raw_size);
+  vms_debug (3, "Section #%d %s, %d bytes\n", section->index, section->name, (int)section->size);
 #endif
 
 	/* 13 bytes egsd, max 31 chars name -> should be 44 bytes */
@@ -824,10 +822,10 @@
       else
 	{
 	  new_flags = vms_esecflag_by_name (evax_section_flags, sname,
-					    section->_raw_size > 0);
+					    section->size > 0);
 	}
       _bfd_vms_output_short (abfd, new_flags);
-      _bfd_vms_output_long (abfd, (unsigned long) section->_raw_size);
+      _bfd_vms_output_long (abfd, (unsigned long) section->size);
       _bfd_vms_output_counted (abfd, sname);
       _bfd_vms_output_flush (abfd);
 
diff --git a/bfd/vms-misc.c b/bfd/vms-misc.c
index d0a24c7..4b3fecc 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, 1999, 2000, 2001, 2002, 2003
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    Written by Klaus K"ampf (kkaempf@rmi.de)
@@ -595,11 +595,11 @@
 				      (bfd_size_type) sizeof (vms_section));
   if (newptr == (vms_section *) NULL)
     return NULL;
-  newptr->contents = (unsigned char *) bfd_alloc (abfd, section->_raw_size);
+  newptr->contents = (unsigned char *) bfd_alloc (abfd, section->size);
   if (newptr->contents == (unsigned char *) NULL)
     return NULL;
   newptr->offset = 0;
-  newptr->size = section->_raw_size;
+  newptr->size = section->size;
   newptr->next = 0;
   PRIV (vms_section_table)[section->index] = newptr;
   return newptr;
diff --git a/bfd/vms-tir.c b/bfd/vms-tir.c
index bd748ca..aa3e536 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, 1999, 2000, 2001, 2002
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004
    Free Software Foundation, Inc.
 
    TIR record handling functions
@@ -93,7 +93,7 @@
   bfd_size_type offset;
 
   offset = PRIV (image_ptr) - PRIV (image_section)->contents;
-  if (offset + size > PRIV (image_section)->_raw_size)
+  if (offset + size > PRIV (image_section)->size)
     {
       PRIV (image_section)->contents
 	= bfd_realloc (PRIV (image_section)->contents, offset + size);
@@ -102,7 +102,7 @@
 	  (*_bfd_error_handler) (_("No Mem !"));
 	  return -1;
 	}
-      PRIV (image_section)->_raw_size = offset + size;
+      PRIV (image_section)->size = offset + size;
       PRIV (image_ptr) = PRIV (image_section)->contents + offset;
     }
 
@@ -951,10 +951,9 @@
       return 0;
     }
 
-  section->_raw_size = 0;
+  section->size = 0;
   section->vma = 0;
   section->contents = 0;
-  section->_cooked_size = 0;
   section->name = name;
   section->index = idx;
 
@@ -2031,7 +2030,7 @@
 #if VMS_DEBUG
       _bfd_vms_debug (4, "writing %d. section '%s' (%d bytes)\n",
 		      section->index, section->name,
-		      (int) (section->_raw_size));
+		      (int) (section->size));
 #endif
 
       if (section->flags & SEC_RELOC)
diff --git a/bfd/vms.c b/bfd/vms.c
index a55b94b..9d160e9 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, 1999, 2000, 2001, 2002, 2003
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    Written by Klaus K"ampf (kkaempf@rmi.de)
@@ -154,6 +154,7 @@
   PARAMS ((bfd *abfd));
 static long vms_canonicalize_dynamic_symtab
   PARAMS ((bfd *abfd, asymbol **symbols));
+#define vms_get_synthetic_symtab _bfd_nodynamic_get_synthetic_symtab
 static long vms_get_dynamic_reloc_upper_bound
   PARAMS ((bfd *abfd));
 static long vms_canonicalize_dynamic_reloc
@@ -165,7 +166,10 @@
 
 #define vms_make_empty_symbol _bfd_generic_make_empty_symbol
 #define vms_bfd_link_just_syms _bfd_generic_link_just_syms
+#define vms_bfd_is_group_section bfd_generic_is_group_section
 #define vms_bfd_discard_group bfd_generic_discard_group
+#define vms_bfd_copy_private_header_data \
+  _bfd_generic_bfd_copy_private_header_data
 
 /*===========================================================================*/
 
@@ -1666,7 +1670,7 @@
 #if VMS_DEBUG
   vms_debug (1, "vms_set_section_contents(%p, sec %s, loc %p, off %ld, count %d)\n",
 					abfd, section->name, location, (long int)offset, (int)count);
-  vms_debug (2, "secraw %d, seccooked %d\n", (int)section->_raw_size, (int)section->_cooked_size);
+  vms_debug (2, "size %d\n", (int) section->size);
 #endif
   return _bfd_save_vms_section(abfd, section, location, offset, count);
 }
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index ccd82be..2d195ca 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -1,5 +1,5 @@
 /* POWER/PowerPC XCOFF linker support.
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>, Cygnus Support.
 
@@ -171,15 +171,14 @@
 
   if (coff_section_data (abfd, sec)->contents == NULL)
     {
-      coff_section_data (abfd, sec)->contents = ((bfd_byte *)
-						 bfd_malloc (sec->_raw_size));
-      if (coff_section_data (abfd, sec)->contents == NULL)
-	return FALSE;
-
-      if (! bfd_get_section_contents (abfd, sec,
-				      coff_section_data (abfd, sec)->contents,
-				      (file_ptr) 0, sec->_raw_size))
-	return FALSE;
+      bfd_byte *contents;
+      if (!bfd_malloc_and_get_section (abfd, sec, &contents))
+	{
+	  if (contents != NULL)
+	    free (contents);
+	  return FALSE;
+	}
+      coff_section_data (abfd, sec)->contents = contents;
     }
 
   return TRUE;
@@ -1514,7 +1513,7 @@
 	    if (! bfd_is_abs_section (enclosing)
 		&& ((bfd_vma) sym.n_value < enclosing->vma
 		    || ((bfd_vma) sym.n_value + aux.x_csect.x_scnlen.l
-			> enclosing->vma + enclosing->_raw_size)))
+			> enclosing->vma + enclosing->size)))
 	      {
 		(*_bfd_error_handler)
 		  (_("%s: csect `%s' not in enclosing section"),
@@ -1526,7 +1525,7 @@
 	    csect->filepos = (enclosing->filepos
 			      + sym.n_value
 			      - enclosing->vma);
-	    csect->_raw_size = aux.x_csect.x_scnlen.l;
+	    csect->size = aux.x_csect.x_scnlen.l;
 	    csect->flags |= SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS;
 	    csect->alignment_power = SMTYP_ALIGN (aux.x_csect.x_smtyp);
 
@@ -1563,7 +1562,7 @@
 				      + relindx * bfd_coff_relsz (abfd));
 		while (relindx < enclosing->reloc_count
 		       && *rel_csect == NULL
-		       && rel->r_vaddr < csect->vma + csect->_raw_size)
+		       && rel->r_vaddr < csect->vma + csect->size)
 		  {
 
 		    *rel_csect = csect;
@@ -1664,7 +1663,7 @@
 	  if (csect == NULL)
 	    goto error_return;
 	  csect->vma = sym.n_value;
-	  csect->_raw_size = aux.x_csect.x_scnlen.l;
+	  csect->size = aux.x_csect.x_scnlen.l;
 	  csect->flags |= SEC_ALLOC;
 	  csect->alignment_power = SMTYP_ALIGN (aux.x_csect.x_smtyp);
 	  /* There are a number of other fields and section flags
@@ -1690,7 +1689,7 @@
 	  if (sym.n_sclass == C_EXT)
 	    {
 	      csect->flags |= SEC_IS_COMMON;
-	      csect->_raw_size = 0;
+	      csect->size = 0;
 	      section = csect;
 	      value = aux.x_csect.x_scnlen.l;
 	    }
@@ -1895,7 +1894,7 @@
 		  || (*sym_hash)->root.u.c.p->section != csect)
 		{
 		  /* We don't need the common csect we just created.  */
-		  csect->_raw_size = 0;
+		  csect->size = 0;
 		}
 	      else
 		{
@@ -1937,7 +1936,7 @@
 	 the .debug section, since we need to read it below in
 	 bfd_xcoff_size_dynamic_sections.  */
       if (strcmp (bfd_get_section_name (abfd, o), ".debug") != 0)
-	o->_raw_size = 0;
+	o->size = 0;
       o->lineno_count = 0;
 
       if ((o->flags & SEC_RELOC) != 0)
@@ -2511,7 +2510,7 @@
 		o->flags |= SEC_MARK;
 	      else
 		{
-		  o->_raw_size = 0;
+		  o->size = 0;
 		  o->reloc_count = 0;
 		  o->lineno_count = 0;
 		}
@@ -3035,8 +3034,8 @@
   /* We now know the final size of the .loader section.  Allocate
      space for it.  */
   lsec = xcoff_hash_table (info)->loader_section;
-  lsec->_raw_size = stoff + ldhdr->l_stlen;
-  lsec->contents = (bfd_byte *) bfd_zalloc (output_bfd, lsec->_raw_size);
+  lsec->size = stoff + ldhdr->l_stlen;
+  lsec->contents = (bfd_byte *) bfd_zalloc (output_bfd, lsec->size);
   if (lsec->contents == NULL)
     goto error_return;
 
@@ -3085,23 +3084,23 @@
 
   /* Allocate space for the magic sections.  */
   sec = xcoff_hash_table (info)->linkage_section;
-  if (sec->_raw_size > 0)
+  if (sec->size > 0)
     {
-      sec->contents = (bfd_byte *) bfd_zalloc (output_bfd, sec->_raw_size);
+      sec->contents = (bfd_byte *) bfd_zalloc (output_bfd, sec->size);
       if (sec->contents == NULL)
 	goto error_return;
     }
   sec = xcoff_hash_table (info)->toc_section;
-  if (sec->_raw_size > 0)
+  if (sec->size > 0)
     {
-      sec->contents = (bfd_byte *) bfd_zalloc (output_bfd, sec->_raw_size);
+      sec->contents = (bfd_byte *) bfd_zalloc (output_bfd, sec->size);
       if (sec->contents == NULL)
 	goto error_return;
     }
   sec = xcoff_hash_table (info)->descriptor_section;
-  if (sec->_raw_size > 0)
+  if (sec->size > 0)
     {
-      sec->contents = (bfd_byte *) bfd_zalloc (output_bfd, sec->_raw_size);
+      sec->contents = (bfd_byte *) bfd_zalloc (output_bfd, sec->size);
       if (sec->contents == NULL)
 	goto error_return;
     }
@@ -3122,14 +3121,14 @@
       if (sub->xvec != info->hash->creator)
 	continue;
       subdeb = bfd_get_section_by_name (sub, ".debug");
-      if (subdeb == NULL || subdeb->_raw_size == 0)
+      if (subdeb == NULL || subdeb->size == 0)
 	continue;
 
       if (info->strip == strip_all
 	  || info->strip == strip_debugger
 	  || info->discard == discard_all)
 	{
-	  subdeb->_raw_size = 0;
+	  subdeb->size = 0;
 	  continue;
 	}
 
@@ -3148,11 +3147,7 @@
 	 bfd_alloc, because I expect that, when linking many files
 	 together, many of the strings will be the same.  Storing the
 	 strings in the hash table should save space in this case.  */
-      debug_contents = (bfd_byte *) bfd_malloc (subdeb->_raw_size);
-      if (debug_contents == NULL)
-	goto error_return;
-      if (! bfd_get_section_contents (sub, subdeb, (PTR) debug_contents,
-				      (file_ptr) 0, subdeb->_raw_size))
+      if (!bfd_malloc_and_get_section (sub, subdeb, &debug_contents))
 	goto error_return;
 
       csectpp = xcoff_data (sub)->csects;
@@ -3200,7 +3195,7 @@
 
       /* Clear the size of subdeb, so that it is not included directly
 	 in the output file.  */
-      subdeb->_raw_size = 0;
+      subdeb->size = 0;
 
       if (! info->keep_memory)
 	{
@@ -3210,7 +3205,7 @@
     }
 
   if (info->strip != strip_all)
-    xcoff_hash_table (info)->debug_section->_raw_size =
+    xcoff_hash_table (info)->debug_section->size =
       _bfd_stringtab_size (debug_strtab);
 
   return TRUE;
@@ -3369,10 +3364,10 @@
       sec = xcoff_hash_table (ldinfo->info)->linkage_section;
       h->root.type = bfd_link_hash_defined;
       h->root.u.def.section = sec;
-      h->root.u.def.value = sec->_raw_size;
+      h->root.u.def.value = sec->size;
       h->smclas = XMC_GL;
       h->flags |= XCOFF_DEF_REGULAR;
-      sec->_raw_size += bfd_xcoff_glink_code_size(ldinfo->output_bfd);
+      sec->size += bfd_xcoff_glink_code_size(ldinfo->output_bfd);
 
       /* The global linkage code requires a TOC entry for the
 	 descriptor.  */
@@ -3396,8 +3391,8 @@
 	    return FALSE;
 
 	  hds->toc_section = xcoff_hash_table (ldinfo->info)->toc_section;
-	  hds->u.toc_offset = hds->toc_section->_raw_size;
-	  hds->toc_section->_raw_size += byte_size;
+	  hds->u.toc_offset = hds->toc_section->size;
+	  hds->toc_section->size += byte_size;
 	  ++xcoff_hash_table (ldinfo->info)->ldrel_count;
 	  ++hds->toc_section->reloc_count;
 	  hds->indx = -2;
@@ -3432,13 +3427,13 @@
 	  sec = xcoff_hash_table (ldinfo->info)->descriptor_section;
 	  h->root.type = bfd_link_hash_defined;
 	  h->root.u.def.section = sec;
-	  h->root.u.def.value = sec->_raw_size;
+	  h->root.u.def.value = sec->size;
 	  h->smclas = XMC_DS;
 	  h->flags |= XCOFF_DEF_REGULAR;
 
 	  /* The size of the function descriptor depends if this is an
 	     xcoff32 (12) or xcoff64 (24).  */
-	  sec->_raw_size +=
+	  sec->size +=
 	    bfd_xcoff_function_descriptor_size(ldinfo->output_bfd);
 
 	  /* A function descriptor uses two relocs: one for the
@@ -3465,10 +3460,10 @@
   if (h->root.type == bfd_link_hash_common
       && (! xcoff_hash_table (ldinfo->info)->gc
 	  || (h->flags & XCOFF_MARK) != 0)
-      && h->root.u.c.p->section->_raw_size == 0)
+      && h->root.u.c.p->section->size == 0)
     {
       BFD_ASSERT (bfd_is_com_section (h->root.u.c.p->section));
-      h->root.u.c.p->section->_raw_size = h->root.u.c.size;
+      h->root.u.c.p->section->size = h->root.u.c.size;
     }
 
   /* We need to add a symbol to the .loader section if it is mentioned
@@ -3618,8 +3613,10 @@
 
 	      o->reloc_count += sec->reloc_count;
 
-	      if (sec->_raw_size > max_contents_size)
-		max_contents_size = sec->_raw_size;
+	      if (sec->rawsize > max_contents_size)
+		max_contents_size = sec->rawsize;
+	      if (sec->size > max_contents_size)
+		max_contents_size = sec->size;
 	      if (sec->lineno_count > max_lineno_count)
 		max_lineno_count = sec->lineno_count;
 	      if (coff_section_data (sec->owner, sec) != NULL
@@ -3722,11 +3719,11 @@
 		{
 		  bfd_vma pageoff;
 
-		  BFD_ASSERT (o->_raw_size == 0);
+		  BFD_ASSERT (o->size == 0);
 		  pageoff = sofar & (file_align - 1);
 		  if (pageoff != 0)
 		    {
-		      o->_raw_size = file_align - pageoff;
+		      o->size = file_align - pageoff;
 		      sofar += file_align - pageoff;
 		      o->flags |= SEC_HAS_CONTENTS;
 		    }
@@ -3734,7 +3731,7 @@
 	      else
 		{
 		  if ((o->flags & SEC_HAS_CONTENTS) != 0)
-		    sofar += BFD_ALIGN (o->_raw_size,
+		    sofar += BFD_ALIGN (o->size,
 					1 << o->alignment_power);
 		}
 	    }
@@ -4083,27 +4080,27 @@
 		  + xcoff_hash_table (info)->ldhdr.l_impoff));
   o = xcoff_hash_table (info)->loader_section;
   if (! bfd_set_section_contents (abfd, o->output_section, o->contents,
-				  (file_ptr) o->output_offset, o->_raw_size))
+				  (file_ptr) o->output_offset, o->size))
     goto error_return;
 
   /* Write out the magic sections.  */
   o = xcoff_hash_table (info)->linkage_section;
-  if (o->_raw_size > 0
+  if (o->size > 0
       && ! bfd_set_section_contents (abfd, o->output_section, o->contents,
 				     (file_ptr) o->output_offset,
-				     o->_raw_size))
+				     o->size))
     goto error_return;
   o = xcoff_hash_table (info)->toc_section;
-  if (o->_raw_size > 0
+  if (o->size > 0
       && ! bfd_set_section_contents (abfd, o->output_section, o->contents,
 				     (file_ptr) o->output_offset,
-				     o->_raw_size))
+				     o->size))
     goto error_return;
   o = xcoff_hash_table (info)->descriptor_section;
-  if (o->_raw_size > 0
+  if (o->size > 0
       && ! bfd_set_section_contents (abfd, o->output_section, o->contents,
 				     (file_ptr) o->output_offset,
-				     o->_raw_size))
+				     o->size))
     goto error_return;
 
   /* Write out the string table.  */
@@ -4128,7 +4125,7 @@
       struct bfd_strtab_hash *debug_strtab;
 
       debug_strtab = xcoff_hash_table (info)->debug_strtab;
-      BFD_ASSERT (o->output_section->_raw_size - o->output_offset
+      BFD_ASSERT (o->output_section->size - o->output_offset
 		  >= _bfd_stringtab_size (debug_strtab));
       pos = o->output_section->filepos + o->output_offset;
       if (bfd_seek (abfd, pos, SEEK_SET) != 0)
@@ -4423,7 +4420,7 @@
 		 output section, as it does in the default linker
 		 script.  */
 	      tocend = ((*csectpp)->output_section->vma
-			+ (*csectpp)->output_section->_raw_size);
+			+ (*csectpp)->output_section->size);
 	      for (inp = finfo->info->input_bfds;
 		   inp != NULL;
 		   inp = inp->link_next)
@@ -4435,7 +4432,7 @@
 			bfd_vma new_toc_end;
 			new_toc_end = (o->output_section->vma
 				       + o->output_offset
-				       + o->_cooked_size);
+				       + o->size);
 			if (new_toc_end > tocend)
 			  tocend = new_toc_end;
 		      }
@@ -5053,7 +5050,7 @@
 	}
 
       if ((o->flags & SEC_HAS_CONTENTS) == 0
-	  || o->_raw_size == 0
+	  || o->size == 0
 	  || (o->flags & SEC_IN_MEMORY) != 0)
 	continue;
 
@@ -5062,12 +5059,13 @@
       if (coff_section_data (input_bfd, o) != NULL
 	  && coff_section_data (input_bfd, o)->contents != NULL)
 	contents = coff_section_data (input_bfd, o)->contents;
-      else {
-	if (! bfd_get_section_contents (input_bfd, o, finfo->contents,
-					(file_ptr) 0, o->_raw_size))
-	  return FALSE;
-	contents = finfo->contents;
-      }
+      else
+	{
+	  bfd_size_type sz = o->rawsize ? o->rawsize : o->size;
+	  if (!bfd_get_section_contents (input_bfd, o, finfo->contents, 0, sz))
+	    return FALSE;
+	  contents = finfo->contents;
+	}
 
       if ((o->flags & SEC_RELOC) != 0)
 	{
@@ -5352,9 +5350,7 @@
       /* Write out the modified section contents.  */
       if (! bfd_set_section_contents (output_bfd, o->output_section,
 				      contents, (file_ptr) o->output_offset,
-				      (o->_cooked_size != 0
-				       ? o->_cooked_size
-				       : o->_raw_size)))
+				      o->size))
 	return FALSE;
     }
 
diff --git a/bfd/xsym.c b/bfd/xsym.c
index a4058dd..aa44e97 100644
--- a/bfd/xsym.c
+++ b/bfd/xsym.c
@@ -1,5 +1,5 @@
 /* xSYM symbol-file support for BFD.
-   Copyright 1999, 2000, 2001, 2002, 2003
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -42,6 +42,7 @@
 #define bfd_sym_bfd_relax_section bfd_generic_relax_section
 #define bfd_sym_bfd_gc_sections bfd_generic_gc_sections
 #define bfd_sym_bfd_merge_sections bfd_generic_merge_sections
+#define bfd_sym_bfd_is_group_section bfd_generic_is_group_section
 #define bfd_sym_bfd_discard_group bfd_generic_discard_group
 #define bfd_sym_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define bfd_sym_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
@@ -2345,7 +2346,7 @@
 
   bfdsec->vma = 0;
   bfdsec->lma = 0;
-  bfdsec->_raw_size = 0;
+  bfdsec->size = 0;
   bfdsec->filepos = 0;
   bfdsec->alignment_power = 0;
 
diff --git a/config-ml.in b/config-ml.in
index b2e4ea9..34874ce 100644
--- a/config-ml.in
+++ b/config-ml.in
@@ -1,7 +1,7 @@
 # Configure fragment invoked in the post-target section for subdirs
 # wanting multilib support.
 #
-# Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
 #   Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
@@ -546,6 +546,8 @@
 		flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
 		if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
 				CFLAGS="$(CFLAGS) $${flags}" \
+				FFLAGS="$(FFLAGS) $${flags}" \
+				ADAFLAGS="$(ADAFLAGS) $${flags}" \
 				prefix="$(prefix)" \
 				exec_prefix="$(exec_prefix)" \
 				GCJFLAGS="$(GCJFLAGS) $${flags}" \
@@ -777,11 +779,12 @@
         break
       fi
     done
-    ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" GCJ="${GCJ_}$flags"'
+    ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags"'
 
     if [ "${with_target_subdir}" = "." ]; then
 	CC_=$CC' '
 	CXX_=$CXX' '
+	F77_=$F77' '
 	GCJ_=$GCJ' '
     else
 	# Create a regular expression that matches any string as long
@@ -811,6 +814,18 @@
 	  esac
 	done
 
+	F77_=
+	for arg in ${F77}; do
+	  case $arg in
+	  -[BIL]"${ML_POPDIR}"/*)
+	    F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+	  "${ML_POPDIR}"/*)
+	    F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
+	  *)
+	    F77_="${F77_}${arg} " ;;
+	  esac
+	done
+
 	GCJ_=
 	for arg in ${GCJ}; do
 	  case $arg in
diff --git a/config/ChangeLog b/config/ChangeLog
index 7a970b7..6711da5 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,19 @@
+2004-06-09  Paolo Bonzini  <bonzini@gnu.org>
+
+	* acx.m4 (ACX_PROG_LN): From gcc, modified to
+	accept a parameter.
+
+2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
+
+	* acx.m4 (ACX_HEADER_STDBOOL, ACX_HEADER_STRING):
+	From gcc.
+
+2004-04-16  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* acx.m4 (ACX_PROG_GNAT): Check if ${CC} produces object file for
+	Ada compilation.
+	Fix acx_cv_cc_gcc_supports_ada spelling.
+
 2004-03-08  Paolo Bonzini  <bonzini@gnu.org>
 
 	PR ada/14131
diff --git a/config/acx.m4 b/config/acx.m4
index ab7f98a..09bac1c 100644
--- a/config/acx.m4
+++ b/config/acx.m4
@@ -177,16 +177,108 @@
 # has not been installed.  This is fixed in 2.95.4, 3.0.2, and 3.1.
 # Therefore we must check for the error message as well as an
 # unsuccessful exit.
+# Other compilers, like HP Tru64 UNIX cc, exit successfully when
+# given a .adb file, but produce no object file.  So we must check
+# if an object file was really produced to guard against this.
 errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
-if test x"$errors" = x; then
+if test x"$errors" = x && test -f conftest.$ac_objext; then
   acx_cv_cc_gcc_supports_ada=yes
   break
 fi
 rm -f conftest.*])
 
-if test x$GNATBIND != xno && test x$acx_cv_gcc_supports_ada != xno; then
+if test x$GNATBIND != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
   have_gnat=yes
 else
   have_gnat=no
 fi
 ])
+
+dnl 'make compare' can be significantly faster, if cmp itself can
+dnl skip bytes instead of using tail.  The test being performed is
+dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
+dnl but we need to sink errors and handle broken shells.  We also test
+dnl for the parameter format "cmp file1 file2 skip1 skip2" which is
+dnl accepted by cmp on some systems.
+AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL],
+[AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip,
+[ echo abfoo >t1
+  echo cdfoo >t2
+  gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
+  if cmp t1 t2 2 2 > /dev/null 2>&1; then
+    if cmp t1 t2 1 1 > /dev/null 2>&1; then
+      :
+    else
+      gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
+    fi
+  fi
+  if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
+    if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
+      :
+    else
+      gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
+    fi
+  fi
+  rm t1 t2
+])
+do_compare="$gcc_cv_prog_cmp_skip"
+AC_SUBST(do_compare)
+])
+
+dnl See whether we can include both string.h and strings.h.
+AC_DEFUN([ACX_HEADER_STRING],
+[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
+  gcc_cv_header_string,
+[AC_TRY_COMPILE([#include <string.h>
+#include <strings.h>], , gcc_cv_header_string=yes, gcc_cv_header_string=no)])
+if test $gcc_cv_header_string = yes; then
+  AC_DEFINE(STRING_WITH_STRINGS, 1, [Define if you can safely include both <string.h> and <strings.h>.])
+fi
+])
+
+dnl See if stdbool.h properly defines bool and true/false.
+dnl Check whether _Bool is built-in.
+AC_DEFUN([ACX_HEADER_STDBOOL],
+[AC_CACHE_CHECK([for working stdbool.h],
+  ac_cv_header_stdbool_h,
+[AC_TRY_COMPILE([#include <stdbool.h>],
+[bool foo = false;],
+ac_cv_header_stdbool_h=yes, ac_cv_header_stdbool_h=no)])
+if test $ac_cv_header_stdbool_h = yes; then
+  AC_DEFINE(HAVE_STDBOOL_H, 1,
+  [Define if you have a working <stdbool.h> header file.])
+fi
+AC_CACHE_CHECK(for built-in _Bool, gcc_cv_c__bool,
+[AC_TRY_COMPILE(,
+[_Bool foo;],
+gcc_cv_c__bool=yes, gcc_cv_c__bool=no)
+])
+if test $gcc_cv_c__bool = yes; then
+  AC_DEFINE(HAVE__BOOL, 1, [Define if the \`_Bool' type is built-in.])
+fi
+])
+
+dnl See if hard links work and if not, try to substitute $1 or simple copy.
+AC_DEFUN([ACX_PROG_LN],
+[AC_MSG_CHECKING(whether ln works)
+AC_CACHE_VAL(acx_cv_prog_LN,
+[rm -f conftestdata_t
+echo >conftestdata_f
+if ln conftestdata_f conftestdata_t 2>/dev/null
+then
+  acx_cv_prog_LN=ln
+else
+  acx_cv_prog_LN=no
+fi
+rm -f conftestdata_f conftestdata_t
+])dnl
+if test $acx_cv_prog_LN = no; then
+  LN="ifelse([$1],,cp,[$1])"
+  AC_MSG_RESULT([no, using $LN])
+else
+  LN="$acx_cv_prog_LN"
+  AC_MSG_RESULT(yes)
+fi
+AC_SUBST(LN)dnl
+])
+
diff --git a/configure b/configure
index a884c32..a4446b1 100755
--- a/configure
+++ b/configure
@@ -12,8 +12,16 @@
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
 ac_help="$ac_help
+  --without-libbanshee   Don't build with libbanshee"
+ac_help="$ac_help
   --enable-libada        Builds libada directory"
 ac_help="$ac_help
+  --with-gmp-dir=PATH     Specify source directory for GMP library"
+ac_help="$ac_help
+  --with-gmp=PATH         Specify directory for installed GMP library"
+ac_help="$ac_help
+  --enable-bootstrap     Enable bootstrapping [no]"
+ac_help="$ac_help
   --enable-serial-[{host,target,build}-]configure
                           Force sequential configuration of
                           sub-packages for the host, target or build
@@ -40,6 +48,7 @@
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -154,6 +163,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
@@ -324,6 +334,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=*)
@@ -489,12 +504,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
@@ -581,7 +600,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:585: checking host system type" >&5
+echo "configure:604: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -602,7 +621,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:606: checking target system type" >&5
+echo "configure:625: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -620,7 +639,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:624: checking build system type" >&5
+echo "configure:643: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -675,7 +694,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:679: checking for a BSD compatible install" >&5
+echo "configure:698: 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
@@ -727,57 +746,50 @@
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
+echo $ac_n "checking whether ln works""... $ac_c" 1>&6
+echo "configure:751: checking whether ln works" >&5
+if eval "test \"`echo '$''{'acx_cv_prog_LN'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftestdata_t
+echo >conftestdata_f
+if ln conftestdata_f conftestdata_t 2>/dev/null
+then
+  acx_cv_prog_LN=ln
+else
+  acx_cv_prog_LN=no
+fi
+rm -f conftestdata_f conftestdata_t
 
-# Autoconf M4 include file defining utility macros for complex Canadian
-# cross builds.
+fi
+if test $acx_cv_prog_LN = no; then
+  LN="cp"
+  echo "$ac_t""no, using $LN" 1>&6
+else
+  LN="$acx_cv_prog_LN"
+  echo "$ac_t""yes" 1>&6
+fi
 
- 
- 
- 
- 
-
-####
-# _NCN_TOOL_PREFIXES:  Some stuff that oughtta be done in AC_CANONICAL_SYSTEM 
-# or AC_INIT.
-# These demand that AC_CANONICAL_SYSTEM be called beforehand.
- 
-####
-# NCN_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
-# Like AC_CHECK_TOOL, but tries a prefix of the target, not the host.
-# Code is pretty much lifted from autoconf2.53.
-
- 
-
-####
-# NCN_STRICT_CHECK_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
-# Like AC_CHECK_TOOL, but requires the prefix if build!=host.
-
- 
-
-####
-# NCN_STRICT_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path])
-# Like NCN_CHECK_TARGET_TOOL, but requires the prefix if build!=target.
-
- 
-###
-# AC_PROG_CPP_WERROR
-# Used for autoconf 2.5x to force AC_PREPROC_IFELSE to reject code which
-# triggers warnings from the preprocessor.  Will be in autoconf 2.58.
-# For now, using this also overrides header checks to use only the
-# preprocessor (matches 2.13 behavior; matching 2.58's behavior is a
-# bit harder from here).
-# Eventually autoconf will default to checking headers with the compiler
-# instead, and we'll have to do this differently.
-
-# AC_PROG_CPP_WERROR
-
-# Test for GNAT.
-# We require the gnatbind program, and a compiler driver that
-# understands Ada.  We use the user's CC setting, already found.
-#
-# Sets the shell variable have_gnat to yes or no as appropriate, and
-# substitutes GNATBIND.
-
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:775: 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
+  rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+  rm -f conftestdata
+  ac_cv_prog_LN_S="ln -s"
+else
+  ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
 
 
 ### we might need to use some other shell than /bin/sh for running subshells
@@ -876,9 +888,17 @@
 # Double entries in build_configdirs, configdirs, or target_configdirs may
 # cause circular dependencies and break everything horribly.
 
+# these library is used by various programs built for the build
+# environment
+#
+build_libs="build-libiberty"
+
+# these tools are built for the build environment
+build_tools="build-texinfo build-byacc build-flex build-bison build-m4"
+
 # these libraries are used by various programs built for the host environment
 #
-host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib"
+host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib libbanshee libcpp"
 
 # these tools are built for the host environment
 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@@ -901,7 +921,8 @@
 		target-libgloss \
 		target-newlib \
 		target-libstdc++-v3 \
-		target-libf2c \
+		target-libmudflap \
+		target-libgfortran \
 		${libgcj} \
 		target-libobjc \
 		target-libada"
@@ -922,20 +943,14 @@
 ## is important because configure will choke if they ever get through.
 ## ${configdirs} is directories we build using the host tools.
 ## ${target_configdirs} is directories we build using the target tools.
-#
 configdirs=`echo ${host_libs} ${host_tools}`
 target_configdirs=`echo ${target_libraries} ${target_tools}`
 
 # Only make build modules if build != host.
-# This should be done more generally, but at the moment it doesn't matter.
 if test ${host_alias} != ${build_alias} ; then
-  # This is the only build module.
-  build_modules=libiberty
-else
-  build_modules=
+  build_configdirs=`echo ${build_libs} ${build_tools}`
 fi
 
-
 ################################################################################
 
 srcname="gnu development package"
@@ -1080,6 +1095,22 @@
     ;;
 esac
 
+# Check whether --with-libbanshee or --without-libbanshee was given.
+if test "${with_libbanshee+set}" = set; then
+  withval="$with_libbanshee"
+  :
+fi
+
+case ${with_libbanshee} in
+  no)
+    noconfigdirs="$noconfigdirs libbanshee" ;;
+  yes|"")
+    with_libbanshee=yes
+    ;;
+  *)
+    { echo "configure: error: --with-libbanshee can only be empty, "yes" or "no" (empty defaults to "yes"." 1>&2; exit 1; }
+esac
+
 # Check whether --enable-libada or --disable-libada was given.
 if test "${enable_libada+set}" = set; then
   enableval="$enable_libada"
@@ -1108,6 +1139,18 @@
   ;;
 esac
 
+
+# Allow --disable-libmudflap to exclude target-libmudflap
+case $enable_libmudflap in
+yes | "")
+    # By default it's enabled
+    ;;
+no)
+    noconfigdirs="$noconfigdirs target-libmudflap"
+    ;;
+esac
+
+
 case "${target}" in
   *-*-chorusos)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
@@ -1123,9 +1166,25 @@
   *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
+  *-*-freebsd* | *-*-kfreebsd*-gnu)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
+	&& test -f /usr/local/include/gmp.h; then
+      with_gmp=/usr/local
+    fi
+
+    # Skip some stuff that's unsupported on some FreeBSD configurations.
+    case "${target}" in
+      i*86-*-*) ;;
+      alpha*-*-*) ;;
+      *)
+	noconfigdirs="$noconfigdirs ${libgcj}"
+	;;
+    esac
+    ;;
   *-*-kaos*)
     # Remove unsupported stuff on all kaOS configurations.
-    skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-libf2c target-librx"
+    skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-librx"
     skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf"
     skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib"
     noconfigdirs="$noconfigdirs target-libgloss"
@@ -1148,12 +1207,6 @@
     ;;
   *-*-rtems*)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
-    case ${target} in
-	h8300*-*-* | h8500-*-*)
-	  noconfigdirs="$noconfigdirs target-libf2c"
-          ;;
-        *) ;;
-    esac
     ;;
   *-*-uclinux*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}"
@@ -1174,9 +1227,6 @@
     # newlib is not 64 bit ready
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
-  alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    ;;
   alpha*-*-*)
     # newlib is not 64 bit ready
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
@@ -1257,10 +1307,10 @@
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
   h8300*-*-*)
-    noconfigdirs="$noconfigdirs target-libgloss ${libgcj} target-libf2c"
+    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
   h8500-*-*)
-    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
     ;;
   hppa*64*-*-linux* | parisc*64*-*-linux*)
     # In this case, it's because the hppa64-linux target is for
@@ -1295,9 +1345,6 @@
   i[3456789]86-*-coff | i[3456789]86-*-elf)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
-  i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    ;;
   i[3456789]86-*-linux*)
     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
     # not build java stuff by default.
@@ -1331,8 +1378,13 @@
   *-*-cygwin*)
     target_configdirs="$target_configdirs target-libtermcap target-winsup"
     noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
-    # always build newlib.
-    skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
+    # always build newlib if winsup directory is present.
+    if test -d "$srcdir/winsup"
+    then
+      skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
+    else
+      echo "Warning: winsup is missing so newlib can't be built."
+    fi
 
     # Can't build gdb for Cygwin if not native.
     case "${host}" in
@@ -1389,7 +1441,7 @@
     ;;
   powerpc-*-aix*)
     # copied from rs6000-*-* entry
-    noconfigdirs="$noconfigdirs gprof target-libada target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
     ;;
   powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
     target_configdirs="$target_configdirs target-winsup"
@@ -1411,7 +1463,7 @@
     noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
     ;;
   rs6000-*-aix*)
-    noconfigdirs="$noconfigdirs gprof target-libada target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
     ;;
   rs6000-*-*)
     noconfigdirs="$noconfigdirs gprof ${libgcj}"
@@ -1420,8 +1472,7 @@
     noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
     ;;
   mips*-*-irix5*)
-    # The GNU linker does not support shared libraries.
-    noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
     ;;
   mips*-*-irix6*)
     # Linking libjava exceeds command-line length limits on at least
@@ -1698,7 +1749,6 @@
   # 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.
 
-  BISON=${BISON-bison}
   CC=${CC-${host_alias}-gcc}
   CFLAGS=${CFLAGS-"-g -O2"}
   CXX=${CXX-${host_alias}-c++}
@@ -1708,49 +1758,9 @@
   CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
   GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
   GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
+  BUILD_DIR_PREFIX=${build_subdir}
   BUILD_PREFIX=${build_alias}-
   BUILD_PREFIX_1=${build_alias}-
-  MAKEINFO=${MAKEINFO-makeinfo}
-
-  if test -z "${YACC}" ; then
-    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-    for dir in $PATH; do
-      test -z "$dir" && dir=.
-      if test -f $dir/bison; then
-	YACC="bison -y"
-	break
-      fi
-      if test -f $dir/byacc; then
-	YACC=byacc
-	break
-      fi
-      if test -f $dir/yacc; then
-	YACC=yacc
-	break
-      fi
-    done
-    IFS="$save_ifs"
-    if test -z "${YACC}" ; then
-      YACC="bison -y"
-    fi
-  fi
-
-  if test -z "${LEX}" ; then
-    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-    for dir in $PATH; do
-      test -z "$dir" && dir=.
-      if test -f $dir/flex; then
-	LEX=flex
-	break
-      fi
-      if test -f $dir/lex; then
-	LEX=lex
-	break
-      fi
-    done
-    IFS="$save_ifs"
-    LEX=${LEX-flex}
-  fi
 
 else
   # Set reasonable default values for some tools even if not Canadian.
@@ -1761,100 +1771,16 @@
   # in Makefile.in, so can still be overridden by fragments.
   # This is all going to change when we autoconfiscate...
 
-  BISON="\$(USUAL_BISON)"
   CC_FOR_BUILD="\$(CC)"
   GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)"
+  BUILD_DIR_PREFIX=
   BUILD_PREFIX=
   BUILD_PREFIX_1=loser-
-  MAKEINFO="\$(USUAL_MAKEINFO)"
-  LEX="\$(USUAL_LEX)"
-  YACC="\$(USUAL_YACC)"
 
-  # If CC is still not set, try to get gcc.
-  cc_prog_is_gcc=
-  if test -z "${CC}" ; then
-    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-    for dir in $PATH; do
-      test -z "$dir" && dir=.
-      if test -f $dir/gcc; then
-	CC="gcc"
-	cc_prog_is_gcc=yes
-	echo 'void f(){}' > conftest.c
-	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
-	  CFLAGS=${CFLAGS-"-g -O2"}
-	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
-	else
-	  CFLAGS=${CFLAGS-"-O2"}
-	  CXXFLAGS=${CXXFLAGS-"-O2"}
-	fi
-	rm -f conftest*
-	break
-      fi
-    done
-    IFS="$save_ifs"
-    CC=${CC-cc}
-  else
-    # Determine if we are using gcc.
-    cat > conftest.c <<EOF
-#ifdef __GNUC__
-  yes;
-#endif
-EOF
-    if ${CC} -E conftest.c | grep yes >/dev/null 2>&1; then
-      cc_prog_is_gcc=yes
-    fi
-    rm -f conftest.c
-    if test -z "${CFLAGS}"; then
-      # Here CC is set but CFLAGS is not.  Use a quick hack to use -O2 if CC
-      # is set to a version of gcc.
-      if test "$cc_prog_is_gcc" = yes; then
-	echo 'void f(){}' > conftest.c
-	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
-	  CFLAGS=${CFLAGS-"-g -O2"}
-	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
-	else
-	  CFLAGS=${CFLAGS-"-O2"}
-	  CXXFLAGS=${CXXFLAGS-"-O2"}
-	fi
-	rm -f conftest*
-      fi
-    fi
-  fi
-
-  # We must set the default linker to the linker used by gcc for the correct
-  # operation of libtool.  If LD is not defined and we are using gcc, try to
-  # set the LD default to the ld used by gcc.
-  if test -z "$LD"; then
-    if test "$cc_prog_is_gcc" = yes; then
-      case $build in
-      *-*-mingw*)
-	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
-      *)
-	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
-      esac
-      case $gcc_prog_ld in
-      # Accept absolute paths.
-      [\\/]* | [A-Za-z]:[\\/]*)
-        LD="$gcc_prog_ld" ;;
-      esac
-    fi
-  fi
-
-  CXX=${CXX-"c++"}
-  CFLAGS=${CFLAGS-"-g"}
-  CXXFLAGS=${CXXFLAGS-"-g -O2"}
-fi
-
-if test $host != $build; then
-  ac_tool_prefix=${host_alias}-
-else
-  ac_tool_prefix=
-fi
-
-# Extract the first word of "gcc", so it can be a program name with args.
+  # 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:1858: checking for $ac_word" >&5
+echo "configure:1784: 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
@@ -1884,7 +1810,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:1888: checking for $ac_word" >&5
+echo "configure:1814: 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
@@ -1935,7 +1861,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:1939: checking for $ac_word" >&5
+echo "configure:1865: 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
@@ -1967,7 +1893,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1971: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1897: 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.
@@ -1978,12 +1904,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1982 "configure"
+#line 1908 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1913: \"$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
@@ -2009,12 +1935,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:2013: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1939: 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:2018: checking whether we are using GNU C" >&5
+echo "configure:1944: 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
@@ -2023,7 +1949,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2027: \"$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:1953: \"$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
@@ -2042,7 +1968,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2046: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1972: 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
@@ -2074,11 +2000,42 @@
 fi
 
 
+  # We must set the default linker to the linker used by gcc for the correct
+  # operation of libtool.  If LD is not defined and we are using gcc, try to
+  # set the LD default to the ld used by gcc.
+  if test -z "$LD"; then
+    if test "$GCC" = yes; then
+      case $build in
+      *-*-mingw*)
+	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
+      *)
+	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
+      esac
+      case $gcc_prog_ld in
+      # Accept absolute paths.
+      [\\/]* | [A-Za-z]:[\\/]*)
+        LD="$gcc_prog_ld" ;;
+      esac
+    fi
+  fi
+
+  CXX=${CXX-"c++"}
+  CFLAGS=${CFLAGS-"-g"}
+  CXXFLAGS=${CXXFLAGS-"-g -O2"}
+fi
+
+if test $host != $build; then
+  ac_tool_prefix=${host_alias}-
+else
+  ac_tool_prefix=
+fi
+
+
 
 # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2082: checking for $ac_word" >&5
+echo "configure:2039: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2110,7 +2067,7 @@
   # Extract the first word of "gnatbind", so it can be a program name with args.
 set dummy gnatbind; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2114: checking for $ac_word" >&5
+echo "configure:2071: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2143,7 +2100,7 @@
 fi
 
 echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6
-echo "configure:2147: checking whether compiler driver understands Ada" >&5
+echo "configure:2104: checking whether compiler driver understands Ada" >&5
 if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2156,8 +2113,11 @@
 # has not been installed.  This is fixed in 2.95.4, 3.0.2, and 3.1.
 # Therefore we must check for the error message as well as an
 # unsuccessful exit.
+# Other compilers, like HP Tru64 UNIX cc, exit successfully when
+# given a .adb file, but produce no object file.  So we must check
+# if an object file was really produced to guard against this.
 errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
-if test x"$errors" = x; then
+if test x"$errors" = x && test -f conftest.$ac_objext; then
   acx_cv_cc_gcc_supports_ada=yes
   break
 fi
@@ -2166,12 +2126,140 @@
 
 echo "$ac_t""$acx_cv_cc_gcc_supports_ada" 1>&6
 
-if test x$GNATBIND != xno && test x$acx_cv_gcc_supports_ada != xno; then
+if test x$GNATBIND != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
   have_gnat=yes
 else
   have_gnat=no
 fi
 
+echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6
+echo "configure:2137: checking how to compare bootstrapped objects" >&5
+if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+   echo abfoo >t1
+  echo cdfoo >t2
+  gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
+  if cmp t1 t2 2 2 > /dev/null 2>&1; then
+    if cmp t1 t2 1 1 > /dev/null 2>&1; then
+      :
+    else
+      gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
+    fi
+  fi
+  if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
+    if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
+      :
+    else
+      gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
+    fi
+  fi
+  rm t1 t2
+
+fi
+
+echo "$ac_t""$gcc_cv_prog_cmp_skip" 1>&6
+do_compare="$gcc_cv_prog_cmp_skip"
+
+
+
+# Check for GMP
+gmplibs=
+gmpinc=
+have_gmp=yes
+# Specify a location for gmp
+# Check whether --with-gmp-dir or --without-gmp-dir was given.
+if test "${with_gmp_dir+set}" = set; then
+  withval="$with_gmp_dir"
+  :
+fi
+
+
+if test "x$with_gmp_dir" != x && test -f "$with_gmp_dir/gmp.h"; then
+  gmpinc="-I$with_gmp_dir"
+  if test -f "$with_gmp_dir/.libs/libgmp.a"; then
+    gmplibs="$with_gmp_dir/.libs/libgmp.a"
+  elif test -f "$with_gmp_dir/_libs/libgmp.a"; then
+    gmplibs="$with_gmp_dir/_libs/libgmp.a"
+  fi
+  # One of the later tests will catch the error if neither library is present.
+fi
+
+# Check whether --with-gmp or --without-gmp was given.
+if test "${with_gmp+set}" = set; then
+  withval="$with_gmp"
+  :
+fi
+
+
+if test "x$with_gmp" != x && test -d "$with_gmp"; then
+  gmplibs="-L$with_gmp/lib -lgmp"
+  gmpinc="-I$with_gmp/include"
+fi
+
+# Use system gmp if nothing else specified
+if test "x$gmplibs" = x; then
+  gmplibs="-lgmp"
+fi
+
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $gmpinc"
+# Check GMP actually works
+echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6
+echo "configure:2210: checking for correct version of gmp.h" >&5
+cat > conftest.$ac_ext <<EOF
+#line 2212 "configure"
+#include "confdefs.h"
+#include "gmp.h"
+int main() {
+
+#if __GNU_MP_VERSION < 3
+choke me
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:2223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6; have_gmp=no
+fi
+rm -f conftest*
+
+if test x"$have_gmp" = xyes; then
+  echo $ac_n "checking for mpf_init in -lgmp""... $ac_c" 1>&6
+echo "configure:2236: checking for mpf_init in -lgmp" >&5
+
+  saved_LIBS="$LIBS"
+  LIBS="$LIBS $gmplibs"
+  cat > conftest.$ac_ext <<EOF
+#line 2241 "configure"
+#include "confdefs.h"
+#include <gmp.h>
+int main() {
+mpf_t n; mpf_init(n);
+; return 0; }
+EOF
+if { (eval echo configure:2248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  echo "$ac_t""yes" 1>&6
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  echo "$ac_t""no" 1>&6; have_gmp=no
+fi
+rm -f conftest*
+  LIBS="$saved_LIBS"
+  CFLAGS="$saved_CFLAGS"
+fi
+
+
+
 
 # By default, C is the only stage 1 language.
 stage1_languages=c
@@ -2245,6 +2333,7 @@
         lang_dirs=
         boot_language=
         build_by_default=
+	need_gmp=
         . ${lang_frag}
         # This is quite sensitive to the ordering of the case statement arms.
         case ,${enable_languages},:${language}:${have_gnat}:${build_by_default} in
@@ -2273,7 +2362,13 @@
             add_this_lang=no
             ;;
         esac
-        case $add_this_lang in
+
+	# Disable language that need GMP if it isn't available.
+	if test  x"$need_gmp" = xyes && test x"$have_gmp" = xno; then
+	  add_this_lang=no
+	fi
+        
+	case $add_this_lang in
 	  no)
             # Remove language-dependent dirs.
             eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
@@ -2355,6 +2450,15 @@
 # Quietly strip out all directories which aren't configurable in this tree.
 # This relies on all configurable subdirectories being autoconfiscated, which
 # is now the case.
+build_configdirs_all="$build_configdirs"
+build_configdirs=
+for i in ${build_configdirs_all} ; do
+  j=`echo $i | sed -e s/build-//g` 
+  if test -f ${srcdir}/$j/configure ; then
+    build_configdirs="${build_configdirs} $i"
+  fi
+done
+
 configdirs_all="$configdirs"
 configdirs=
 for i in ${configdirs_all} ; do
@@ -2362,6 +2466,7 @@
     configdirs="${configdirs} $i"
   fi
 done
+
 target_configdirs_all="$target_configdirs"
 target_configdirs=
 for i in ${target_configdirs_all} ; do
@@ -2388,7 +2493,7 @@
 	  appdirs=""
 	  break
 	fi
-	if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
+	if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then
 	  appdirs=""
 	  break
 	fi
@@ -2574,6 +2679,9 @@
   extra_host_args="$extra_host_args --with-newlib"
 fi
 
+if test x${with_libbanshee} = xyes && echo " ${configdirs} " | grep " libbanshee " >/dev/null 2>&1; then
+  extra_host_args="$extra_host_args --with-libbanshee"
+fi
 
 # Default to using --with-stabs for certain targets.
 if test x${with_stabs} = x ; then
@@ -2600,113 +2708,219 @@
 tooldir='${exec_prefix}'/${target_alias}
 build_tooldir=${tooldir}
 
-# Generate default definitions for YACC, M4, LEX.  These are used if the
-# Makefile can't locate these programs in objdir.
+# Generate default definitions for YACC, M4, LEX and other programs that run
+# on the build machine.  These are used if the Makefile can't locate these
+# programs in objdir.
 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
-for ac_prog in 'bison -y' byacc yacc
+for ac_prog in bison
 do
 # 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:2612: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_YACC'+set}'`\" = set"; then
+echo "configure:2721: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_BISON'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$DEFAULT_YACC"; then
-  ac_cv_prog_DEFAULT_YACC="$DEFAULT_YACC" # Let the user override the test.
+  if test -n "$CONFIGURED_BISON"; then
+  ac_cv_prog_CONFIGURED_BISON="$CONFIGURED_BISON" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_DEFAULT_YACC="$ac_prog"
+      ac_cv_prog_CONFIGURED_BISON="$ac_prog"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-DEFAULT_YACC="$ac_cv_prog_DEFAULT_YACC"
-if test -n "$DEFAULT_YACC"; then
-  echo "$ac_t""$DEFAULT_YACC" 1>&6
+CONFIGURED_BISON="$ac_cv_prog_CONFIGURED_BISON"
+if test -n "$CONFIGURED_BISON"; then
+  echo "$ac_t""$CONFIGURED_BISON" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
-test -n "$DEFAULT_YACC" && break
+test -n "$CONFIGURED_BISON" && break
 done
-test -n "$DEFAULT_YACC" || DEFAULT_YACC="$MISSING bison"
+test -n "$CONFIGURED_BISON" || CONFIGURED_BISON="$MISSING bison"
+
+for ac_prog in 'bison -y' byacc yacc
+do
+# 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:2756: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_YACC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CONFIGURED_YACC"; then
+  ac_cv_prog_CONFIGURED_YACC="$CONFIGURED_YACC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CONFIGURED_YACC="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CONFIGURED_YACC="$ac_cv_prog_CONFIGURED_YACC"
+if test -n "$CONFIGURED_YACC"; then
+  echo "$ac_t""$CONFIGURED_YACC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CONFIGURED_YACC" && break
+done
+test -n "$CONFIGURED_YACC" || CONFIGURED_YACC="$MISSING bison -y"
 
 for ac_prog in gm4 gnum4 m4
 do
 # 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:2647: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_M4'+set}'`\" = set"; then
+echo "configure:2791: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_M4'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$DEFAULT_M4"; then
-  ac_cv_prog_DEFAULT_M4="$DEFAULT_M4" # Let the user override the test.
+  if test -n "$CONFIGURED_M4"; then
+  ac_cv_prog_CONFIGURED_M4="$CONFIGURED_M4" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_DEFAULT_M4="$ac_prog"
+      ac_cv_prog_CONFIGURED_M4="$ac_prog"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-DEFAULT_M4="$ac_cv_prog_DEFAULT_M4"
-if test -n "$DEFAULT_M4"; then
-  echo "$ac_t""$DEFAULT_M4" 1>&6
+CONFIGURED_M4="$ac_cv_prog_CONFIGURED_M4"
+if test -n "$CONFIGURED_M4"; then
+  echo "$ac_t""$CONFIGURED_M4" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
-test -n "$DEFAULT_M4" && break
+test -n "$CONFIGURED_M4" && break
 done
-test -n "$DEFAULT_M4" || DEFAULT_M4="$MISSING m4"
+test -n "$CONFIGURED_M4" || CONFIGURED_M4="$MISSING m4"
+
+for ac_prog in flex
+do
+# 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:2826: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_FLEX'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CONFIGURED_FLEX"; then
+  ac_cv_prog_CONFIGURED_FLEX="$CONFIGURED_FLEX" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CONFIGURED_FLEX="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CONFIGURED_FLEX="$ac_cv_prog_CONFIGURED_FLEX"
+if test -n "$CONFIGURED_FLEX"; then
+  echo "$ac_t""$CONFIGURED_FLEX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CONFIGURED_FLEX" && break
+done
+test -n "$CONFIGURED_FLEX" || CONFIGURED_FLEX="$MISSING flex"
 
 for ac_prog in flex lex
 do
 # 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:2682: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_DEFAULT_LEX'+set}'`\" = set"; then
+echo "configure:2861: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LEX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$DEFAULT_LEX"; then
-  ac_cv_prog_DEFAULT_LEX="$DEFAULT_LEX" # Let the user override the test.
+  if test -n "$CONFIGURED_LEX"; then
+  ac_cv_prog_CONFIGURED_LEX="$CONFIGURED_LEX" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_DEFAULT_LEX="$ac_prog"
+      ac_cv_prog_CONFIGURED_LEX="$ac_prog"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-DEFAULT_LEX="$ac_cv_prog_DEFAULT_LEX"
-if test -n "$DEFAULT_LEX"; then
-  echo "$ac_t""$DEFAULT_LEX" 1>&6
+CONFIGURED_LEX="$ac_cv_prog_CONFIGURED_LEX"
+if test -n "$CONFIGURED_LEX"; then
+  echo "$ac_t""$CONFIGURED_LEX" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
-test -n "$DEFAULT_LEX" && break
+test -n "$CONFIGURED_LEX" && break
 done
-test -n "$DEFAULT_LEX" || DEFAULT_LEX="$MISSING flex"
+test -n "$CONFIGURED_LEX" || CONFIGURED_LEX="$MISSING flex"
+
+for ac_prog in makeinfo
+do
+# 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:2896: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_MAKEINFO'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CONFIGURED_MAKEINFO"; then
+  ac_cv_prog_CONFIGURED_MAKEINFO="$CONFIGURED_MAKEINFO" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CONFIGURED_MAKEINFO="$ac_prog"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CONFIGURED_MAKEINFO="$ac_cv_prog_CONFIGURED_MAKEINFO"
+if test -n "$CONFIGURED_MAKEINFO"; then
+  echo "$ac_t""$CONFIGURED_MAKEINFO" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+test -n "$CONFIGURED_MAKEINFO" && break
+done
+test -n "$CONFIGURED_MAKEINFO" || CONFIGURED_MAKEINFO="$MISSING makeinfo"
 
 
 # Create a .gdbinit file which runs the one in srcdir
@@ -2790,17 +3004,7 @@
 # Record target_configdirs and the configure arguments for target and
 # build configuration in Makefile.
 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
-
-# This is the final value for target_configdirs.  configdirs already
-# has its final value, as does build_modules.  It's time to create some 
-# lists of valid targets.
-
-all_build_modules=
-configure_build_modules=
-for module in ${build_modules} ; do
-  all_build_modules=all-build-${module}
-  configure_build_modules=configure-build-${module}
-done
+build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'`
 
 # Determine whether gdb needs tk/tcl or not.
 # Use 'maybe' since enable_gdbtk might be true even if tk isn't available
@@ -2828,31 +3032,60 @@
     ;;
 esac
 
-# Create the 'maybe dependencies'.  This uses a temporary file.
+# Strip out unwanted targets.
 
 # While at that, we remove Makefiles if we were started for recursive
 # configuration, so that the top-level Makefile reconfigures them,
 # like we used to do when configure itself was recursive.
-rm -f maybedep.tmp
-echo '# maybedep.tmp' > maybedep.tmp
 
-# Make-targets which may need maybe dependencies.
-mts="configure all install check clean distclean dvi info install-info"
-mts="${mts} installcheck mostlyclean maintainer-clean TAGS"
+# Loop over modules.  $extrasub must be used with care, limiting as
+# much as possible the usage of range addresses.  That's because autoconf
+# splits the sed script to overcome limits in the number of commands,
+# and relying on carefully-timed sed passes may turn out to be very hard
+# to maintain later.  In this particular case, you just have to be careful
+# not to nest @if/@endif pairs, because configure will not warn you at all.
 
-# Loop over modules and make-targets.
-for module in ${build_modules} ; do
+# Check whether --enable-bootstrap or --disable-bootstrap was given.
+if test "${enable_bootstrap+set}" = set; then
+  enableval="$enable_bootstrap"
+  :
+else
+  enable_bootstrap=no
+fi
+
+if test -d ${srcdir}/gcc; then
+  case "$host:$target:$enable_bootstrap" in
+    $build:$build:yes | *:no) ;;
+    *:yes) { echo "configure: error: cannot bootstrap a cross-compiler" 1>&2; exit 1; } ;;
+    *) { echo "configure: error: invalid option for --enable-bootstrap" 1>&2; exit 1; } ;;
+  esac
+else
+  if test $enable_bootstrap = yes; then
+    { echo "configure: error: cannot bootstrap without a compiler" 1>&2; exit 1; }
+  fi
+fi
+
+case "$enable_bootstrap" in
+  yes)
+    default_target=bootstrap
+    bootstrap_suffix=bootstrap ;;
+  no)
+    default_target=all
+    bootstrap_suffix=no-bootstrap ;;
+esac
+
+
+for module in ${build_configdirs} ; do
   if test -z "${no_recursion}" \
      && test -f ${build_subdir}/${module}/Makefile; then
     echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
     rm -f ${build_subdir}/${module}/Makefile
   fi
-  for mt in ${mts} ; do
-    case ${mt} in
-      install) ;; # No installing build modules.
-      *) echo "maybe-${mt}-build-${module}: ${mt}-build-${module}" >> maybedep.tmp ;;
-    esac
-  done
+  extrasub="$extrasub
+/^@if build-$module\$/d
+/^@endif build-$module\$/d
+/^@if build-$module-$bootstrap_suffix\$/d
+/^@endif build-$module-$bootstrap_suffix\$/d"
 done
 for module in ${configdirs} ; do
   if test -z "${no_recursion}" \
@@ -2860,9 +3093,11 @@
     echo 1>&2 "*** removing ${module}/Makefile to force reconfigure"
     rm -f ${module}/Makefile
   fi
-  for mt in ${mts} ; do
-    echo "maybe-${mt}-${module}: ${mt}-${module}" >> maybedep.tmp
-  done
+  extrasub="$extrasub
+/^@if $module\$/d
+/^@endif $module\$/d
+/^@if $module-$bootstrap_suffix\$/d
+/^@endif $module-$bootstrap_suffix\$/d"
 done
 for module in ${target_configdirs} ; do
   if test -z "${no_recursion}" \
@@ -2870,12 +3105,15 @@
     echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
     rm -f ${target_subdir}/${module}/Makefile
   fi
-  for mt in ${mts} ; do
-    echo "maybe-${mt}-target-${module}: ${mt}-target-${module}" >> maybedep.tmp
-  done
+  extrasub="$extrasub
+/^@if target-$module\$/d
+/^@endif target-$module\$/d
+/^@if target-$module-$bootstrap_suffix\$/d
+/^@endif target-$module-$bootstrap_suffix\$/d"
 done
-maybe_dependencies=maybedep.tmp
 
+extrasub="$extrasub
+/^@if /,/^@endif /d"
 
 # Create the serialization dependencies.  This uses a temporary file.
 
@@ -2939,21 +3177,21 @@
 # at the end of the argument list.
 # These will be expanded by make, so quote '$'.
 cat <<\EOF_SED > conftestsed
-s/ --no[^ ]* / /
-s/ --c[a-z-]*[= ][^ ]* / /
-s/ --sr[a-z-]*[= ][^ ]* / /
-s/ --ho[a-z-]*[= ][^ ]* / /
-s/ --bu[a-z-]*[= ][^ ]* / /
-s/ --t[a-z-]*[= ][^ ]* / /
-s/ --program-[pst][a-z-]*[= ][^ ]* / /
-s/ -cache-file[= ][^ ]* / /
-s/ -srcdir[= ][^ ]* / /
-s/ -host[= ][^ ]* / /
-s/ -build[= ][^ ]* / /
-s/ -target[= ][^ ]* / /
-s/ -program-prefix[= ][^ ]* / /
-s/ -program-suffix[= ][^ ]* / /
-s/ -program-transform-name[= ][^ ]* / /
+s/ --no[^ ]*/ /g
+s/ --c[a-z-]*[= ][^ ]*//g
+s/ --sr[a-z-]*[= ][^ ]*//g
+s/ --ho[a-z-]*[= ][^ ]*//g
+s/ --bu[a-z-]*[= ][^ ]*//g
+s/ --t[a-z-]*[= ][^ ]*//g
+s/ --program-[pst][a-z-]*[= ][^ ]*//g
+s/ -cache-file[= ][^ ]*//g
+s/ -srcdir[= ][^ ]*//g
+s/ -host[= ][^ ]*//g
+s/ -build[= ][^ ]*//g
+s/ -target[= ][^ ]*//g
+s/ -program-prefix[= ][^ ]*//g
+s/ -program-suffix[= ][^ ]*//g
+s/ -program-transform-name[= ][^ ]*//g
 s/ [^' -][^ ]* / /
 s/^ *//;s/ *$//
 s,\$,$$,g
@@ -3141,6 +3379,20 @@
 fi
 GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)'
 
+if test "x${GFORTRAN_FOR_TARGET+set}" = xset; then
+  :
+elif test -d ${srcdir}/gcc; then
+  GFORTRAN_FOR_TARGET='$$r/gcc/gfortran -B$$r/gcc/'
+elif test "$host" = "$target"; then
+  GFORTRAN_FOR_TARGET='gfortran'
+else
+  GFORTRAN_FOR_TARGET=`echo gfortran | sed "${program_transform_name}"`
+fi
+case $GFORTRAN_FOR_TARGET in
+*' $(FLAGS_FOR_TARGET)') ;;
+*) GFORTRAN_FOR_TARGET=$GFORTRAN_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
+esac
+
 # Don't use libstdc++-v3's flags to configure/build itself.
 libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
 raw_libstdcxx_flags='-L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
@@ -3182,6 +3434,7 @@
 # Wrap CC_FOR_TARGET and friends, for certain types of builds.
 CC_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}"
 GCJ_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}"
+GFORTRAN_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${GFORTRAN_FOR_TARGET}"
 CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}"
 RAW_CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}"
 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}"
@@ -3210,8 +3463,8 @@
 
 
 
-# Build module lists & subconfigure args.
 
+# Build module lists & subconfigure args.
 
 
 
@@ -3227,10 +3480,6 @@
 
 
 
-
-
-
-
 # Host tools.
 ncn_tool_prefix=
 test -n "$host_alias" && ncn_tool_prefix=$host_alias-
@@ -3241,7 +3490,7 @@
   # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3245: checking for $ac_word" >&5
+echo "configure:3494: 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
@@ -3274,7 +3523,7 @@
     # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3278: checking for $ac_word" >&5
+echo "configure:3527: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3313,7 +3562,7 @@
   # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3317: checking for $ac_word" >&5
+echo "configure:3566: 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
@@ -3346,7 +3595,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:3350: checking for $ac_word" >&5
+echo "configure:3599: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3385,7 +3634,7 @@
   # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3389: checking for $ac_word" >&5
+echo "configure:3638: 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
@@ -3418,7 +3667,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:3422: checking for $ac_word" >&5
+echo "configure:3671: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3457,7 +3706,7 @@
   # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3461: checking for $ac_word" >&5
+echo "configure:3710: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3490,7 +3739,7 @@
     # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3494: checking for $ac_word" >&5
+echo "configure:3743: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3529,7 +3778,7 @@
   # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3533: checking for $ac_word" >&5
+echo "configure:3782: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3562,7 +3811,7 @@
     # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3566: checking for $ac_word" >&5
+echo "configure:3815: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3601,7 +3850,7 @@
   # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3605: checking for $ac_word" >&5
+echo "configure:3854: 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
@@ -3634,7 +3883,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:3638: checking for $ac_word" >&5
+echo "configure:3887: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3673,7 +3922,7 @@
   # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3677: checking for $ac_word" >&5
+echo "configure:3926: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3706,7 +3955,7 @@
     # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3710: checking for $ac_word" >&5
+echo "configure:3959: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3745,7 +3994,7 @@
   # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}objcopy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3749: checking for $ac_word" >&5
+echo "configure:3998: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3778,7 +4027,7 @@
     # Extract the first word of "objcopy", so it can be a program name with args.
 set dummy objcopy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3782: checking for $ac_word" >&5
+echo "configure:4031: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3817,7 +4066,7 @@
   # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3821: checking for $ac_word" >&5
+echo "configure:4070: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3850,7 +4099,7 @@
     # Extract the first word of "objdump", so it can be a program name with args.
 set dummy objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3854: checking for $ac_word" >&5
+echo "configure:4103: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3891,512 +4140,509 @@
 
 
 
-
-
-
 # Target tools.
  if test -n "$ncn_target_tool_prefix"; then
   # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3903: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4149: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$AR_FOR_TARGET"; then
-  ac_cv_prog_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test.
+  if test -n "$CONFIGURED_AR_FOR_TARGET"; then
+  ac_cv_prog_CONFIGURED_AR_FOR_TARGET="$CONFIGURED_AR_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_AR_FOR_TARGET="${ncn_target_tool_prefix}ar"
+      ac_cv_prog_CONFIGURED_AR_FOR_TARGET="${ncn_target_tool_prefix}ar"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET"
-if test -n "$AR_FOR_TARGET"; then
-  echo "$ac_t""$AR_FOR_TARGET" 1>&6
+CONFIGURED_AR_FOR_TARGET="$ac_cv_prog_CONFIGURED_AR_FOR_TARGET"
+if test -n "$CONFIGURED_AR_FOR_TARGET"; then
+  echo "$ac_t""$CONFIGURED_AR_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
 fi
-if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then
+if test -z "$ac_cv_prog_CONFIGURED_AR_FOR_TARGET" ; then
   if test $build = $target ; then
-    ncn_cv_AR_FOR_TARGET=$AR_FOR_TARGET
+    ncn_cv_CONFIGURED_AR_FOR_TARGET=$CONFIGURED_AR_FOR_TARGET
     # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3936: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4182: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$ncn_cv_AR_FOR_TARGET"; then
-  ac_cv_prog_ncn_cv_AR_FOR_TARGET="$ncn_cv_AR_FOR_TARGET" # Let the user override the test.
+  if test -n "$ncn_cv_CONFIGURED_AR_FOR_TARGET"; then
+  ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET="$ncn_cv_CONFIGURED_AR_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_ncn_cv_AR_FOR_TARGET="ar"
+      ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET="ar"
       break
     fi
   done
   IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_ncn_cv_AR_FOR_TARGET" && ac_cv_prog_ncn_cv_AR_FOR_TARGET="ar"
+  test -z "$ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET" && ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET="ar"
 fi
 fi
-ncn_cv_AR_FOR_TARGET="$ac_cv_prog_ncn_cv_AR_FOR_TARGET"
-if test -n "$ncn_cv_AR_FOR_TARGET"; then
-  echo "$ac_t""$ncn_cv_AR_FOR_TARGET" 1>&6
+ncn_cv_CONFIGURED_AR_FOR_TARGET="$ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET"
+if test -n "$ncn_cv_CONFIGURED_AR_FOR_TARGET"; then
+  echo "$ac_t""$ncn_cv_CONFIGURED_AR_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
  
-    AR_FOR_TARGET=$ncn_cv_AR_FOR_TARGET
+    CONFIGURED_AR_FOR_TARGET=$ncn_cv_CONFIGURED_AR_FOR_TARGET
   else
-    AR_FOR_TARGET="${ncn_target_tool_prefix}ar"
+    CONFIGURED_AR_FOR_TARGET="${ncn_target_tool_prefix}ar"
   fi
 else
-  AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET"
+  CONFIGURED_AR_FOR_TARGET="$ac_cv_prog_CONFIGURED_AR_FOR_TARGET"
 fi
 
  if test -n "$ncn_target_tool_prefix"; then
   # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3975: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4221: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$AS_FOR_TARGET"; then
-  ac_cv_prog_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test.
+  if test -n "$CONFIGURED_AS_FOR_TARGET"; then
+  ac_cv_prog_CONFIGURED_AS_FOR_TARGET="$CONFIGURED_AS_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_AS_FOR_TARGET="${ncn_target_tool_prefix}as"
+      ac_cv_prog_CONFIGURED_AS_FOR_TARGET="${ncn_target_tool_prefix}as"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET"
-if test -n "$AS_FOR_TARGET"; then
-  echo "$ac_t""$AS_FOR_TARGET" 1>&6
+CONFIGURED_AS_FOR_TARGET="$ac_cv_prog_CONFIGURED_AS_FOR_TARGET"
+if test -n "$CONFIGURED_AS_FOR_TARGET"; then
+  echo "$ac_t""$CONFIGURED_AS_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
 fi
-if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then
+if test -z "$ac_cv_prog_CONFIGURED_AS_FOR_TARGET" ; then
   if test $build = $target ; then
-    ncn_cv_AS_FOR_TARGET=$AS_FOR_TARGET
+    ncn_cv_CONFIGURED_AS_FOR_TARGET=$CONFIGURED_AS_FOR_TARGET
     # 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:4008: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4254: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$ncn_cv_AS_FOR_TARGET"; then
-  ac_cv_prog_ncn_cv_AS_FOR_TARGET="$ncn_cv_AS_FOR_TARGET" # Let the user override the test.
+  if test -n "$ncn_cv_CONFIGURED_AS_FOR_TARGET"; then
+  ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET="$ncn_cv_CONFIGURED_AS_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_ncn_cv_AS_FOR_TARGET="as"
+      ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET="as"
       break
     fi
   done
   IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_ncn_cv_AS_FOR_TARGET" && ac_cv_prog_ncn_cv_AS_FOR_TARGET="as"
+  test -z "$ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET" && ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET="as"
 fi
 fi
-ncn_cv_AS_FOR_TARGET="$ac_cv_prog_ncn_cv_AS_FOR_TARGET"
-if test -n "$ncn_cv_AS_FOR_TARGET"; then
-  echo "$ac_t""$ncn_cv_AS_FOR_TARGET" 1>&6
+ncn_cv_CONFIGURED_AS_FOR_TARGET="$ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET"
+if test -n "$ncn_cv_CONFIGURED_AS_FOR_TARGET"; then
+  echo "$ac_t""$ncn_cv_CONFIGURED_AS_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
  
-    AS_FOR_TARGET=$ncn_cv_AS_FOR_TARGET
+    CONFIGURED_AS_FOR_TARGET=$ncn_cv_CONFIGURED_AS_FOR_TARGET
   else
-    AS_FOR_TARGET="${ncn_target_tool_prefix}as"
+    CONFIGURED_AS_FOR_TARGET="${ncn_target_tool_prefix}as"
   fi
 else
-  AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET"
+  CONFIGURED_AS_FOR_TARGET="$ac_cv_prog_CONFIGURED_AS_FOR_TARGET"
 fi
 
  if test -n "$ncn_target_tool_prefix"; then
   # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4047: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4293: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$DLLTOOL_FOR_TARGET"; then
-  ac_cv_prog_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test.
+  if test -n "$CONFIGURED_DLLTOOL_FOR_TARGET"; then
+  ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET="$CONFIGURED_DLLTOOL_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}dlltool"
+      ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}dlltool"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET"
-if test -n "$DLLTOOL_FOR_TARGET"; then
-  echo "$ac_t""$DLLTOOL_FOR_TARGET" 1>&6
+CONFIGURED_DLLTOOL_FOR_TARGET="$ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET"
+if test -n "$CONFIGURED_DLLTOOL_FOR_TARGET"; then
+  echo "$ac_t""$CONFIGURED_DLLTOOL_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
 fi
-if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then
+if test -z "$ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET" ; then
   if test $build = $target ; then
-    ncn_cv_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET
+    ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET=$CONFIGURED_DLLTOOL_FOR_TARGET
     # 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:4080: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4326: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$ncn_cv_DLLTOOL_FOR_TARGET"; then
-  ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET="$ncn_cv_DLLTOOL_FOR_TARGET" # Let the user override the test.
+  if test -n "$ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET"; then
+  ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET="$ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET="dlltool"
+      ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET="dlltool"
       break
     fi
   done
   IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET" && ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET="dlltool"
+  test -z "$ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET" && ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET="dlltool"
 fi
 fi
-ncn_cv_DLLTOOL_FOR_TARGET="$ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET"
-if test -n "$ncn_cv_DLLTOOL_FOR_TARGET"; then
-  echo "$ac_t""$ncn_cv_DLLTOOL_FOR_TARGET" 1>&6
+ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET="$ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET"
+if test -n "$ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET"; then
+  echo "$ac_t""$ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
  
-    DLLTOOL_FOR_TARGET=$ncn_cv_DLLTOOL_FOR_TARGET
+    CONFIGURED_DLLTOOL_FOR_TARGET=$ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET
   else
-    DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}dlltool"
+    CONFIGURED_DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}dlltool"
   fi
 else
-  DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET"
+  CONFIGURED_DLLTOOL_FOR_TARGET="$ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET"
 fi
 
  if test -n "$ncn_target_tool_prefix"; then
   # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4119: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4365: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$LD_FOR_TARGET"; then
-  ac_cv_prog_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test.
+  if test -n "$CONFIGURED_LD_FOR_TARGET"; then
+  ac_cv_prog_CONFIGURED_LD_FOR_TARGET="$CONFIGURED_LD_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_LD_FOR_TARGET="${ncn_target_tool_prefix}ld"
+      ac_cv_prog_CONFIGURED_LD_FOR_TARGET="${ncn_target_tool_prefix}ld"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET"
-if test -n "$LD_FOR_TARGET"; then
-  echo "$ac_t""$LD_FOR_TARGET" 1>&6
+CONFIGURED_LD_FOR_TARGET="$ac_cv_prog_CONFIGURED_LD_FOR_TARGET"
+if test -n "$CONFIGURED_LD_FOR_TARGET"; then
+  echo "$ac_t""$CONFIGURED_LD_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
 fi
-if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then
+if test -z "$ac_cv_prog_CONFIGURED_LD_FOR_TARGET" ; then
   if test $build = $target ; then
-    ncn_cv_LD_FOR_TARGET=$LD_FOR_TARGET
+    ncn_cv_CONFIGURED_LD_FOR_TARGET=$CONFIGURED_LD_FOR_TARGET
     # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4152: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4398: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$ncn_cv_LD_FOR_TARGET"; then
-  ac_cv_prog_ncn_cv_LD_FOR_TARGET="$ncn_cv_LD_FOR_TARGET" # Let the user override the test.
+  if test -n "$ncn_cv_CONFIGURED_LD_FOR_TARGET"; then
+  ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET="$ncn_cv_CONFIGURED_LD_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_ncn_cv_LD_FOR_TARGET="ld"
+      ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET="ld"
       break
     fi
   done
   IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_ncn_cv_LD_FOR_TARGET" && ac_cv_prog_ncn_cv_LD_FOR_TARGET="ld"
+  test -z "$ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET" && ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET="ld"
 fi
 fi
-ncn_cv_LD_FOR_TARGET="$ac_cv_prog_ncn_cv_LD_FOR_TARGET"
-if test -n "$ncn_cv_LD_FOR_TARGET"; then
-  echo "$ac_t""$ncn_cv_LD_FOR_TARGET" 1>&6
+ncn_cv_CONFIGURED_LD_FOR_TARGET="$ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET"
+if test -n "$ncn_cv_CONFIGURED_LD_FOR_TARGET"; then
+  echo "$ac_t""$ncn_cv_CONFIGURED_LD_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
  
-    LD_FOR_TARGET=$ncn_cv_LD_FOR_TARGET
+    CONFIGURED_LD_FOR_TARGET=$ncn_cv_CONFIGURED_LD_FOR_TARGET
   else
-    LD_FOR_TARGET="${ncn_target_tool_prefix}ld"
+    CONFIGURED_LD_FOR_TARGET="${ncn_target_tool_prefix}ld"
   fi
 else
-  LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET"
+  CONFIGURED_LD_FOR_TARGET="$ac_cv_prog_CONFIGURED_LD_FOR_TARGET"
 fi
 
  if test -n "$ncn_target_tool_prefix"; then
   # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4191: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4437: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$NM_FOR_TARGET"; then
-  ac_cv_prog_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test.
+  if test -n "$CONFIGURED_NM_FOR_TARGET"; then
+  ac_cv_prog_CONFIGURED_NM_FOR_TARGET="$CONFIGURED_NM_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_NM_FOR_TARGET="${ncn_target_tool_prefix}nm"
+      ac_cv_prog_CONFIGURED_NM_FOR_TARGET="${ncn_target_tool_prefix}nm"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET"
-if test -n "$NM_FOR_TARGET"; then
-  echo "$ac_t""$NM_FOR_TARGET" 1>&6
+CONFIGURED_NM_FOR_TARGET="$ac_cv_prog_CONFIGURED_NM_FOR_TARGET"
+if test -n "$CONFIGURED_NM_FOR_TARGET"; then
+  echo "$ac_t""$CONFIGURED_NM_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
 fi
-if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then
+if test -z "$ac_cv_prog_CONFIGURED_NM_FOR_TARGET" ; then
   if test $build = $target ; then
-    ncn_cv_NM_FOR_TARGET=$NM_FOR_TARGET
+    ncn_cv_CONFIGURED_NM_FOR_TARGET=$CONFIGURED_NM_FOR_TARGET
     # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4224: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4470: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$ncn_cv_NM_FOR_TARGET"; then
-  ac_cv_prog_ncn_cv_NM_FOR_TARGET="$ncn_cv_NM_FOR_TARGET" # Let the user override the test.
+  if test -n "$ncn_cv_CONFIGURED_NM_FOR_TARGET"; then
+  ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET="$ncn_cv_CONFIGURED_NM_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_ncn_cv_NM_FOR_TARGET="nm"
+      ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET="nm"
       break
     fi
   done
   IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_ncn_cv_NM_FOR_TARGET" && ac_cv_prog_ncn_cv_NM_FOR_TARGET="nm"
+  test -z "$ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET" && ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET="nm"
 fi
 fi
-ncn_cv_NM_FOR_TARGET="$ac_cv_prog_ncn_cv_NM_FOR_TARGET"
-if test -n "$ncn_cv_NM_FOR_TARGET"; then
-  echo "$ac_t""$ncn_cv_NM_FOR_TARGET" 1>&6
+ncn_cv_CONFIGURED_NM_FOR_TARGET="$ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET"
+if test -n "$ncn_cv_CONFIGURED_NM_FOR_TARGET"; then
+  echo "$ac_t""$ncn_cv_CONFIGURED_NM_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
  
-    NM_FOR_TARGET=$ncn_cv_NM_FOR_TARGET
+    CONFIGURED_NM_FOR_TARGET=$ncn_cv_CONFIGURED_NM_FOR_TARGET
   else
-    NM_FOR_TARGET="${ncn_target_tool_prefix}nm"
+    CONFIGURED_NM_FOR_TARGET="${ncn_target_tool_prefix}nm"
   fi
 else
-  NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET"
+  CONFIGURED_NM_FOR_TARGET="$ac_cv_prog_CONFIGURED_NM_FOR_TARGET"
 fi
 
  if test -n "$ncn_target_tool_prefix"; then
   # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4263: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4509: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$RANLIB_FOR_TARGET"; then
-  ac_cv_prog_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test.
+  if test -n "$CONFIGURED_RANLIB_FOR_TARGET"; then
+  ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET="$CONFIGURED_RANLIB_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_RANLIB_FOR_TARGET="${ncn_target_tool_prefix}ranlib"
+      ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET="${ncn_target_tool_prefix}ranlib"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET"
-if test -n "$RANLIB_FOR_TARGET"; then
-  echo "$ac_t""$RANLIB_FOR_TARGET" 1>&6
+CONFIGURED_RANLIB_FOR_TARGET="$ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET"
+if test -n "$CONFIGURED_RANLIB_FOR_TARGET"; then
+  echo "$ac_t""$CONFIGURED_RANLIB_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
 fi
-if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then
+if test -z "$ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET" ; then
   if test $build = $target ; then
-    ncn_cv_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET
+    ncn_cv_CONFIGURED_RANLIB_FOR_TARGET=$CONFIGURED_RANLIB_FOR_TARGET
     # 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:4296: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4542: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$ncn_cv_RANLIB_FOR_TARGET"; then
-  ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET="$ncn_cv_RANLIB_FOR_TARGET" # Let the user override the test.
+  if test -n "$ncn_cv_CONFIGURED_RANLIB_FOR_TARGET"; then
+  ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET="$ncn_cv_CONFIGURED_RANLIB_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET="ranlib"
+      ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET="ranlib"
       break
     fi
   done
   IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET" && ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET=":"
+  test -z "$ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET" && ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET=":"
 fi
 fi
-ncn_cv_RANLIB_FOR_TARGET="$ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET"
-if test -n "$ncn_cv_RANLIB_FOR_TARGET"; then
-  echo "$ac_t""$ncn_cv_RANLIB_FOR_TARGET" 1>&6
+ncn_cv_CONFIGURED_RANLIB_FOR_TARGET="$ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET"
+if test -n "$ncn_cv_CONFIGURED_RANLIB_FOR_TARGET"; then
+  echo "$ac_t""$ncn_cv_CONFIGURED_RANLIB_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
  
-    RANLIB_FOR_TARGET=$ncn_cv_RANLIB_FOR_TARGET
+    CONFIGURED_RANLIB_FOR_TARGET=$ncn_cv_CONFIGURED_RANLIB_FOR_TARGET
   else
-    RANLIB_FOR_TARGET=":"
+    CONFIGURED_RANLIB_FOR_TARGET=":"
   fi
 else
-  RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET"
+  CONFIGURED_RANLIB_FOR_TARGET="$ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET"
 fi
 
  if test -n "$ncn_target_tool_prefix"; then
   # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4335: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4581: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$WINDRES_FOR_TARGET"; then
-  ac_cv_prog_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test.
+  if test -n "$CONFIGURED_WINDRES_FOR_TARGET"; then
+  ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET="$CONFIGURED_WINDRES_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_WINDRES_FOR_TARGET="${ncn_target_tool_prefix}windres"
+      ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET="${ncn_target_tool_prefix}windres"
       break
     fi
   done
   IFS="$ac_save_ifs"
 fi
 fi
-WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET"
-if test -n "$WINDRES_FOR_TARGET"; then
-  echo "$ac_t""$WINDRES_FOR_TARGET" 1>&6
+CONFIGURED_WINDRES_FOR_TARGET="$ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET"
+if test -n "$CONFIGURED_WINDRES_FOR_TARGET"; then
+  echo "$ac_t""$CONFIGURED_WINDRES_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
 
 fi
-if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then
+if test -z "$ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET" ; then
   if test $build = $target ; then
-    ncn_cv_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET
+    ncn_cv_CONFIGURED_WINDRES_FOR_TARGET=$CONFIGURED_WINDRES_FOR_TARGET
     # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4368: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then
+echo "configure:4614: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  if test -n "$ncn_cv_WINDRES_FOR_TARGET"; then
-  ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET="$ncn_cv_WINDRES_FOR_TARGET" # Let the user override the test.
+  if test -n "$ncn_cv_CONFIGURED_WINDRES_FOR_TARGET"; then
+  ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET="$ncn_cv_CONFIGURED_WINDRES_FOR_TARGET" # Let the user override the test.
 else
   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
   ac_dummy="$PATH"
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET="windres"
+      ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET="windres"
       break
     fi
   done
   IFS="$ac_save_ifs"
-  test -z "$ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET" && ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET="windres"
+  test -z "$ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET" && ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET="windres"
 fi
 fi
-ncn_cv_WINDRES_FOR_TARGET="$ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET"
-if test -n "$ncn_cv_WINDRES_FOR_TARGET"; then
-  echo "$ac_t""$ncn_cv_WINDRES_FOR_TARGET" 1>&6
+ncn_cv_CONFIGURED_WINDRES_FOR_TARGET="$ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET"
+if test -n "$ncn_cv_CONFIGURED_WINDRES_FOR_TARGET"; then
+  echo "$ac_t""$ncn_cv_CONFIGURED_WINDRES_FOR_TARGET" 1>&6
 else
   echo "$ac_t""no" 1>&6
 fi
  
-    WINDRES_FOR_TARGET=$ncn_cv_WINDRES_FOR_TARGET
+    CONFIGURED_WINDRES_FOR_TARGET=$ncn_cv_CONFIGURED_WINDRES_FOR_TARGET
   else
-    WINDRES_FOR_TARGET="${ncn_target_tool_prefix}windres"
+    CONFIGURED_WINDRES_FOR_TARGET="${ncn_target_tool_prefix}windres"
   fi
 else
-  WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET"
+  CONFIGURED_WINDRES_FOR_TARGET="$ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET"
 fi
 
 
@@ -4409,6 +4655,7 @@
 
 
 
+
 # Fix up target tools.
 if test "x${build}" = "x${host}" ; then
   # In this case, the newly built tools can and should be used,
@@ -4424,14 +4671,31 @@
   NM_FOR_TARGET="\$(USUAL_NM_FOR_TARGET)"
   RANLIB_FOR_TARGET="\$(USUAL_RANLIB_FOR_TARGET)"
   WINDRES_FOR_TARGET="\$(USUAL_WINDRES_FOR_TARGET)"
+else
+  # Just use the ones we found.
+  AR_FOR_TARGET="\$(CONFIGURED_AR_FOR_TARGET)"
+  AS_FOR_TARGET="\$(CONFIGURED_AS_FOR_TARGET)"
+  DLLTOOL_FOR_TARGET="\$(CONFIGURED_DLLTOOL_FOR_TARGET)"
+  LD_FOR_TARGET="\$(CONFIGURED_LD_FOR_TARGET)"
+  NM_FOR_TARGET="\$(CONFIGURED_NM_FOR_TARGET)"
+  RANLIB_FOR_TARGET="\$(CONFIGURED_RANLIB_FOR_TARGET)"
+  WINDRES_FOR_TARGET="\$(CONFIGURED_WINDRES_FOR_TARGET)"  
 fi
+
+
+
+
+
+
+
+
 # Certain tools may need extra flags.
 AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
 RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
 NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4435: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4699: 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"
@@ -4474,6 +4738,42 @@
 esac
 
 
+# It makes debugging easier if we create as symlinks the stage directories
+# gcc for stageN-gcc and stage-prev for stage(N-1).  In case this is not
+# possible, however, we can resort to mv.
+echo $ac_n "checking if symbolic links between directories work""... $ac_c" 1>&6
+echo "configure:4746: checking if symbolic links between directories work" >&5
+if eval "test \"`echo '$''{'gcc_cv_prog_ln_s_dir'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "${LN_S}" = "ln -s" \
+   && mkdir confdir.s1 \
+   && ln -s confdir.s1 confdir.s2 \
+   && echo timestamp1 > confdir.s1/conftest.1 \
+   && cmp confdir.s1/conftest.1 confdir.s2/conftest.1 \
+   && echo timestamp2 > confdir.s2/conftest.2 \
+   && cmp confdir.s1/conftest.2 confdir.s1/conftest.2 \
+   && rm -f confdir.s2; then
+  gcc_cv_prog_ln_s_dir=yes
+else
+  gcc_cv_prog_ln_s_dir=yes
+fi
+rm -rf confdir.s1 confdir.s2
+fi
+
+echo "$ac_t""$gcc_cv_prog_ln_s_dir" 1>&6
+
+case ${gcc_cv_prog_ln_s_dir} in
+  yes)
+    CREATE_LINK_TO_DIR='ln -s $$1 $$2'
+    UNDO_LINK_TO_DIR='rm -f $$1' ;;
+  *)
+    CREATE_LINK_TO_DIR='mv $$1 $$2'
+    UNDO_LINK_TO_DIR='mv $$1 $$2' ;;
+esac
+
+
+
 # Enable -Werror in bootstrap stage2 and later.
 # Change the default to "no" on release branches.
 # Check whether --enable-werror or --disable-werror was given.
@@ -4484,9 +4784,9 @@
   enable_werror=yes
 fi
 
-case ${enable_error} in
-  yes) WERROR=-Werror ;;
-  *) WERROR= ;;
+case ${enable_werror} in
+  yes) stage2_werror_flag="--enable-werror-always" ;;
+  *) stage2_werror_flag="" ;;
 esac
 
 
@@ -4653,18 +4953,25 @@
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
 s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@LN@%$LN%g
+s%@LN_S@%$LN_S%g
 s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g
 s%@build_subdir@%$build_subdir%g
 s%@host_subdir@%$host_subdir%g
 s%@target_subdir@%$target_subdir%g
 s%@CC@%$CC%g
 s%@GNATBIND@%$GNATBIND%g
+s%@do_compare@%$do_compare%g
+s%@gmplibs@%$gmplibs%g
+s%@gmpinc@%$gmpinc%g
 s%@stage1_languages@%$stage1_languages%g
-s%@DEFAULT_YACC@%$DEFAULT_YACC%g
-s%@DEFAULT_M4@%$DEFAULT_M4%g
-s%@DEFAULT_LEX@%$DEFAULT_LEX%g
-/@maybe_dependencies@/r $maybe_dependencies
-s%@maybe_dependencies@%%g
+s%@CONFIGURED_BISON@%$CONFIGURED_BISON%g
+s%@CONFIGURED_YACC@%$CONFIGURED_YACC%g
+s%@CONFIGURED_M4@%$CONFIGURED_M4%g
+s%@CONFIGURED_FLEX@%$CONFIGURED_FLEX%g
+s%@CONFIGURED_LEX@%$CONFIGURED_LEX%g
+s%@CONFIGURED_MAKEINFO@%$CONFIGURED_MAKEINFO%g
+s%@default_target@%$default_target%g
 /@serialization_dependencies@/r $serialization_dependencies
 s%@serialization_dependencies@%%g
 /@host_makefile_frag@/r $host_makefile_frag
@@ -4677,6 +4984,7 @@
 s%@ospace_frag@%%g
 s%@SET_LIB_PATH@%$SET_LIB_PATH%g
 s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
+s%@BUILD_DIR_PREFIX@%$BUILD_DIR_PREFIX%g
 s%@BUILD_PREFIX@%$BUILD_PREFIX%g
 s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g
 s%@gcc_version_trigger@%$gcc_version_trigger%g
@@ -4687,17 +4995,12 @@
 s%@gxx_include_dir@%$gxx_include_dir%g
 s%@libstdcxx_incdir@%$libstdcxx_incdir%g
 s%@build_configargs@%$build_configargs%g
-s%@configure_build_modules@%$configure_build_modules%g
-s%@all_build_modules@%$all_build_modules%g
+s%@build_configdirs@%$build_configdirs%g
 s%@host_configargs@%$host_configargs%g
 s%@configdirs@%$configdirs%g
 s%@target_configargs@%$target_configargs%g
 s%@target_configdirs@%$target_configdirs%g
-s%@BISON@%$BISON%g
 s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
-s%@LEX@%$LEX%g
-s%@MAKEINFO@%$MAKEINFO%g
-s%@YACC@%$YACC%g
 s%@config_shell@%$config_shell%g
 s%@AR@%$AR%g
 s%@ncn_cv_AR@%$ncn_cv_AR%g
@@ -4719,33 +5022,43 @@
 s%@ncn_cv_OBJDUMP@%$ncn_cv_OBJDUMP%g
 s%@CXX@%$CXX%g
 s%@CFLAGS_FOR_BUILD@%$CFLAGS_FOR_BUILD%g
-s%@AR_FOR_TARGET@%$AR_FOR_TARGET%g
-s%@ncn_cv_AR_FOR_TARGET@%$ncn_cv_AR_FOR_TARGET%g
-s%@AS_FOR_TARGET@%$AS_FOR_TARGET%g
-s%@ncn_cv_AS_FOR_TARGET@%$ncn_cv_AS_FOR_TARGET%g
-s%@DLLTOOL_FOR_TARGET@%$DLLTOOL_FOR_TARGET%g
-s%@ncn_cv_DLLTOOL_FOR_TARGET@%$ncn_cv_DLLTOOL_FOR_TARGET%g
-s%@LD_FOR_TARGET@%$LD_FOR_TARGET%g
-s%@ncn_cv_LD_FOR_TARGET@%$ncn_cv_LD_FOR_TARGET%g
-s%@NM_FOR_TARGET@%$NM_FOR_TARGET%g
-s%@ncn_cv_NM_FOR_TARGET@%$ncn_cv_NM_FOR_TARGET%g
-s%@RANLIB_FOR_TARGET@%$RANLIB_FOR_TARGET%g
-s%@ncn_cv_RANLIB_FOR_TARGET@%$ncn_cv_RANLIB_FOR_TARGET%g
-s%@WINDRES_FOR_TARGET@%$WINDRES_FOR_TARGET%g
-s%@ncn_cv_WINDRES_FOR_TARGET@%$ncn_cv_WINDRES_FOR_TARGET%g
+s%@CONFIGURED_AR_FOR_TARGET@%$CONFIGURED_AR_FOR_TARGET%g
+s%@ncn_cv_CONFIGURED_AR_FOR_TARGET@%$ncn_cv_CONFIGURED_AR_FOR_TARGET%g
+s%@CONFIGURED_AS_FOR_TARGET@%$CONFIGURED_AS_FOR_TARGET%g
+s%@ncn_cv_CONFIGURED_AS_FOR_TARGET@%$ncn_cv_CONFIGURED_AS_FOR_TARGET%g
+s%@CONFIGURED_DLLTOOL_FOR_TARGET@%$CONFIGURED_DLLTOOL_FOR_TARGET%g
+s%@ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET@%$ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET%g
+s%@CONFIGURED_LD_FOR_TARGET@%$CONFIGURED_LD_FOR_TARGET%g
+s%@ncn_cv_CONFIGURED_LD_FOR_TARGET@%$ncn_cv_CONFIGURED_LD_FOR_TARGET%g
+s%@CONFIGURED_NM_FOR_TARGET@%$CONFIGURED_NM_FOR_TARGET%g
+s%@ncn_cv_CONFIGURED_NM_FOR_TARGET@%$ncn_cv_CONFIGURED_NM_FOR_TARGET%g
+s%@CONFIGURED_RANLIB_FOR_TARGET@%$CONFIGURED_RANLIB_FOR_TARGET%g
+s%@ncn_cv_CONFIGURED_RANLIB_FOR_TARGET@%$ncn_cv_CONFIGURED_RANLIB_FOR_TARGET%g
+s%@CONFIGURED_WINDRES_FOR_TARGET@%$CONFIGURED_WINDRES_FOR_TARGET%g
+s%@ncn_cv_CONFIGURED_WINDRES_FOR_TARGET@%$ncn_cv_CONFIGURED_WINDRES_FOR_TARGET%g
 s%@GCC_FOR_TARGET@%$GCC_FOR_TARGET%g
 s%@FLAGS_FOR_TARGET@%$FLAGS_FOR_TARGET%g
 s%@CC_FOR_TARGET@%$CC_FOR_TARGET%g
 s%@GCJ_FOR_TARGET@%$GCJ_FOR_TARGET%g
+s%@GFORTRAN_FOR_TARGET@%$GFORTRAN_FOR_TARGET%g
 s%@CXX_FOR_TARGET@%$CXX_FOR_TARGET%g
 s%@RAW_CXX_FOR_TARGET@%$RAW_CXX_FOR_TARGET%g
 s%@CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%$CXX_FOR_TARGET_FOR_RECURSIVE_MAKE%g
 s%@RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%$RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE%g
+s%@AR_FOR_TARGET@%$AR_FOR_TARGET%g
+s%@AS_FOR_TARGET@%$AS_FOR_TARGET%g
+s%@DLLTOOL_FOR_TARGET@%$DLLTOOL_FOR_TARGET%g
+s%@LD_FOR_TARGET@%$LD_FOR_TARGET%g
+s%@NM_FOR_TARGET@%$NM_FOR_TARGET%g
+s%@RANLIB_FOR_TARGET@%$RANLIB_FOR_TARGET%g
+s%@WINDRES_FOR_TARGET@%$WINDRES_FOR_TARGET%g
 s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g
 s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g
 s%@MAINT@%$MAINT%g
 s%@stage1_cflags@%$stage1_cflags%g
-s%@WERROR@%$WERROR%g
+s%@CREATE_LINK_TO_DIR@%$CREATE_LINK_TO_DIR%g
+s%@UNDO_LINK_TO_DIR@%$UNDO_LINK_TO_DIR%g
+s%@stage2_werror_flag@%$stage2_werror_flag%g
 
 CEOF
 EOF
diff --git a/configure.in b/configure.in
index 0a9f05f..a66e946 100644
--- a/configure.in
+++ b/configure.in
@@ -18,6 +18,8 @@
 ##############################################################################
 ### WARNING: this file contains embedded tabs.  Do not run untabify on this file.
 
+sinclude(config/acx.m4)
+
 AC_INIT(move-if-change)
 AC_PREREQ(2.13)
 AC_CANONICAL_SYSTEM
@@ -25,8 +27,8 @@
 
 # Get 'install' or 'install-sh' and its variants.
 AC_PROG_INSTALL
-
-sinclude(config/acx.m4)
+ACX_PROG_LN
+AC_PROG_LN_S
 
 ### we might need to use some other shell than /bin/sh for running subshells
 ### If we are on Windows, search for the shell.  This will permit people
@@ -124,9 +126,17 @@
 # Double entries in build_configdirs, configdirs, or target_configdirs may
 # cause circular dependencies and break everything horribly.
 
+# these library is used by various programs built for the build
+# environment
+#
+build_libs="build-libiberty"
+
+# these tools are built for the build environment
+build_tools="build-texinfo build-byacc build-flex build-bison build-m4"
+
 # these libraries are used by various programs built for the host environment
 #
-host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib"
+host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib libbanshee libcpp"
 
 # these tools are built for the host environment
 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@@ -149,7 +159,8 @@
 		target-libgloss \
 		target-newlib \
 		target-libstdc++-v3 \
-		target-libf2c \
+		target-libmudflap \
+		target-libgfortran \
 		${libgcj} \
 		target-libobjc \
 		target-libada"
@@ -170,20 +181,14 @@
 ## is important because configure will choke if they ever get through.
 ## ${configdirs} is directories we build using the host tools.
 ## ${target_configdirs} is directories we build using the target tools.
-#
 configdirs=`echo ${host_libs} ${host_tools}`
 target_configdirs=`echo ${target_libraries} ${target_tools}`
 
 # Only make build modules if build != host.
-# This should be done more generally, but at the moment it doesn't matter.
 if test ${host_alias} != ${build_alias} ; then
-  # This is the only build module.
-  build_modules=libiberty
-else
-  build_modules=
+  build_configdirs=`echo ${build_libs} ${build_tools}`
 fi
 
-
 ################################################################################
 
 srcname="gnu development package"
@@ -307,6 +312,18 @@
     ;;
 esac
 
+AC_ARG_WITH(libbanshee,
+[  --without-libbanshee   Don't build with libbanshee])
+case ${with_libbanshee} in
+  no)
+    noconfigdirs="$noconfigdirs libbanshee" ;;
+  yes|"")
+    with_libbanshee=yes
+    ;;
+  *)
+    AC_MSG_ERROR([--with-libbanshee can only be empty, "yes" or "no" (empty defaults to "yes".])
+esac
+
 AC_ARG_ENABLE(libada,
 [  --enable-libada        Builds libada directory],
 ENABLE_LIBADA=$enableval,
@@ -331,6 +348,18 @@
   ;;
 esac
 
+
+# Allow --disable-libmudflap to exclude target-libmudflap
+case $enable_libmudflap in
+yes | "")
+    # By default it's enabled
+    ;;
+no)
+    noconfigdirs="$noconfigdirs target-libmudflap"
+    ;;
+esac
+
+
 case "${target}" in
   *-*-chorusos)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
@@ -346,9 +375,25 @@
   *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
+  *-*-freebsd* | *-*-kfreebsd*-gnu)
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+    if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
+	&& test -f /usr/local/include/gmp.h; then
+      with_gmp=/usr/local
+    fi
+
+    # Skip some stuff that's unsupported on some FreeBSD configurations.
+    case "${target}" in
+      i*86-*-*) ;;
+      alpha*-*-*) ;;
+      *)
+	noconfigdirs="$noconfigdirs ${libgcj}"
+	;;
+    esac
+    ;;
   *-*-kaos*)
     # Remove unsupported stuff on all kaOS configurations.
-    skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-libf2c target-librx"
+    skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-librx"
     skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf"
     skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib"
     noconfigdirs="$noconfigdirs target-libgloss"
@@ -371,12 +416,6 @@
     ;;
   *-*-rtems*)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
-    case ${target} in
-	h8300*-*-* | h8500-*-*)
-	  noconfigdirs="$noconfigdirs target-libf2c"
-          ;;
-        *) ;;
-    esac
     ;;
   *-*-uclinux*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}"
@@ -397,9 +436,6 @@
     # newlib is not 64 bit ready
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
-  alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    ;;
   alpha*-*-*)
     # newlib is not 64 bit ready
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
@@ -480,10 +516,10 @@
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
   h8300*-*-*)
-    noconfigdirs="$noconfigdirs target-libgloss ${libgcj} target-libf2c"
+    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
   h8500-*-*)
-    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
     ;;
   hppa*64*-*-linux* | parisc*64*-*-linux*)
     # In this case, it's because the hppa64-linux target is for
@@ -518,9 +554,6 @@
   i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
-  i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu)
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
-    ;;
   i[[3456789]]86-*-linux*)
     # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
     # not build java stuff by default.
@@ -554,8 +587,13 @@
   *-*-cygwin*)
     target_configdirs="$target_configdirs target-libtermcap target-winsup"
     noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
-    # always build newlib.
-    skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
+    # always build newlib if winsup directory is present.
+    if test -d "$srcdir/winsup"
+    then
+      skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
+    else
+      echo "Warning: winsup is missing so newlib can't be built."
+    fi
 
     # Can't build gdb for Cygwin if not native.
     case "${host}" in
@@ -612,7 +650,7 @@
     ;;
   powerpc-*-aix*)
     # copied from rs6000-*-* entry
-    noconfigdirs="$noconfigdirs gprof target-libada target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
     ;;
   powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
     target_configdirs="$target_configdirs target-winsup"
@@ -634,7 +672,7 @@
     noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}"
     ;;
   rs6000-*-aix*)
-    noconfigdirs="$noconfigdirs gprof target-libada target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
     ;;
   rs6000-*-*)
     noconfigdirs="$noconfigdirs gprof ${libgcj}"
@@ -643,8 +681,7 @@
     noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
     ;;
   mips*-*-irix5*)
-    # The GNU linker does not support shared libraries.
-    noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
     ;;
   mips*-*-irix6*)
     # Linking libjava exceeds command-line length limits on at least
@@ -921,7 +958,6 @@
   # 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.
 
-  BISON=${BISON-bison}
   CC=${CC-${host_alias}-gcc}
   CFLAGS=${CFLAGS-"-g -O2"}
   CXX=${CXX-${host_alias}-c++}
@@ -931,49 +967,9 @@
   CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++}
   GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj}
   GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}}
+  BUILD_DIR_PREFIX=${build_subdir}
   BUILD_PREFIX=${build_alias}-
   BUILD_PREFIX_1=${build_alias}-
-  MAKEINFO=${MAKEINFO-makeinfo}
-
-  if test -z "${YACC}" ; then
-    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-    for dir in $PATH; do
-      test -z "$dir" && dir=.
-      if test -f $dir/bison; then
-	YACC="bison -y"
-	break
-      fi
-      if test -f $dir/byacc; then
-	YACC=byacc
-	break
-      fi
-      if test -f $dir/yacc; then
-	YACC=yacc
-	break
-      fi
-    done
-    IFS="$save_ifs"
-    if test -z "${YACC}" ; then
-      YACC="bison -y"
-    fi
-  fi
-
-  if test -z "${LEX}" ; then
-    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-    for dir in $PATH; do
-      test -z "$dir" && dir=.
-      if test -f $dir/flex; then
-	LEX=flex
-	break
-      fi
-      if test -f $dir/lex; then
-	LEX=lex
-	break
-      fi
-    done
-    IFS="$save_ifs"
-    LEX=${LEX-flex}
-  fi
 
 else
   # Set reasonable default values for some tools even if not Canadian.
@@ -984,71 +980,19 @@
   # in Makefile.in, so can still be overridden by fragments.
   # This is all going to change when we autoconfiscate...
 
-  BISON="\$(USUAL_BISON)"
   CC_FOR_BUILD="\$(CC)"
   GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)"
+  BUILD_DIR_PREFIX=
   BUILD_PREFIX=
   BUILD_PREFIX_1=loser-
-  MAKEINFO="\$(USUAL_MAKEINFO)"
-  LEX="\$(USUAL_LEX)"
-  YACC="\$(USUAL_YACC)"
 
-  # If CC is still not set, try to get gcc.
-  cc_prog_is_gcc=
-  if test -z "${CC}" ; then
-    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}:"
-    for dir in $PATH; do
-      test -z "$dir" && dir=.
-      if test -f $dir/gcc; then
-	CC="gcc"
-	cc_prog_is_gcc=yes
-	echo 'void f(){}' > conftest.c
-	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
-	  CFLAGS=${CFLAGS-"-g -O2"}
-	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
-	else
-	  CFLAGS=${CFLAGS-"-O2"}
-	  CXXFLAGS=${CXXFLAGS-"-O2"}
-	fi
-	rm -f conftest*
-	break
-      fi
-    done
-    IFS="$save_ifs"
-    CC=${CC-cc}
-  else
-    # Determine if we are using gcc.
-    cat > conftest.c <<EOF
-#ifdef __GNUC__
-  yes;
-#endif
-EOF
-    if ${CC} -E conftest.c | grep yes >/dev/null 2>&1; then
-      cc_prog_is_gcc=yes
-    fi
-    rm -f conftest.c
-    if test -z "${CFLAGS}"; then
-      # Here CC is set but CFLAGS is not.  Use a quick hack to use -O2 if CC
-      # is set to a version of gcc.
-      if test "$cc_prog_is_gcc" = yes; then
-	echo 'void f(){}' > conftest.c
-	if test -z "`${CC} -g -c conftest.c 2>&1`"; then
-	  CFLAGS=${CFLAGS-"-g -O2"}
-	  CXXFLAGS=${CXXFLAGS-"-g -O2"}
-	else
-	  CFLAGS=${CFLAGS-"-O2"}
-	  CXXFLAGS=${CXXFLAGS-"-O2"}
-	fi
-	rm -f conftest*
-      fi
-    fi
-  fi
+  AC_PROG_CC
 
   # We must set the default linker to the linker used by gcc for the correct
   # operation of libtool.  If LD is not defined and we are using gcc, try to
   # set the LD default to the ld used by gcc.
   if test -z "$LD"; then
-    if test "$cc_prog_is_gcc" = yes; then
+    if test "$GCC" = yes; then
       case $build in
       *-*-mingw*)
 	gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
@@ -1069,6 +1013,61 @@
 fi
 
 ACX_PROG_GNAT
+ACX_PROG_CMP_IGNORE_INITIAL
+
+# Check for GMP
+gmplibs=
+gmpinc=
+have_gmp=yes
+# Specify a location for gmp
+AC_ARG_WITH(gmp-dir, [  --with-gmp-dir=PATH     Specify source directory for GMP library])
+
+if test "x$with_gmp_dir" != x && test -f "$with_gmp_dir/gmp.h"; then
+  gmpinc="-I$with_gmp_dir"
+  if test -f "$with_gmp_dir/.libs/libgmp.a"; then
+    gmplibs="$with_gmp_dir/.libs/libgmp.a"
+  elif test -f "$with_gmp_dir/_libs/libgmp.a"; then
+    gmplibs="$with_gmp_dir/_libs/libgmp.a"
+  fi
+  # One of the later tests will catch the error if neither library is present.
+fi
+
+AC_ARG_WITH(gmp, [  --with-gmp=PATH         Specify directory for installed GMP library])
+
+if test "x$with_gmp" != x && test -d "$with_gmp"; then
+  gmplibs="-L$with_gmp/lib -lgmp"
+  gmpinc="-I$with_gmp/include"
+fi
+
+# Use system gmp if nothing else specified
+if test "x$gmplibs" = x; then
+  gmplibs="-lgmp"
+fi
+
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $gmpinc"
+# Check GMP actually works
+AC_MSG_CHECKING([for correct version of gmp.h])
+AC_TRY_COMPILE([#include "gmp.h"],[
+#if __GNU_MP_VERSION < 3
+choke me
+#endif
+], [AC_MSG_RESULT([yes])],
+  [AC_MSG_RESULT([no]); have_gmp=no])
+
+if test x"$have_gmp" = xyes; then
+  AC_MSG_CHECKING([for mpf_init in -lgmp])
+
+  saved_LIBS="$LIBS"
+  LIBS="$LIBS $gmplibs"
+  AC_TRY_LINK([#include <gmp.h>], [mpf_t n; mpf_init(n);],
+    [AC_MSG_RESULT([yes])],  [AC_MSG_RESULT([no]); have_gmp=no])
+  LIBS="$saved_LIBS"
+  CFLAGS="$saved_CFLAGS"
+fi
+
+AC_SUBST(gmplibs)
+AC_SUBST(gmpinc)
 
 # By default, C is the only stage 1 language.
 stage1_languages=c
@@ -1142,6 +1141,7 @@
         lang_dirs=
         boot_language=
         build_by_default=
+	need_gmp=
         . ${lang_frag}
         # This is quite sensitive to the ordering of the case statement arms.
         case ,${enable_languages},:${language}:${have_gnat}:${build_by_default} in
@@ -1170,7 +1170,13 @@
             add_this_lang=no
             ;;
         esac
-        case $add_this_lang in
+
+	# Disable language that need GMP if it isn't available.
+	if test  x"$need_gmp" = xyes && test x"$have_gmp" = xno; then
+	  add_this_lang=no
+	fi
+        
+	case $add_this_lang in
 	  no)
             # Remove language-dependent dirs.
             eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
@@ -1252,6 +1258,15 @@
 # Quietly strip out all directories which aren't configurable in this tree.
 # This relies on all configurable subdirectories being autoconfiscated, which
 # is now the case.
+build_configdirs_all="$build_configdirs"
+build_configdirs=
+for i in ${build_configdirs_all} ; do
+  j=`echo $i | sed -e s/build-//g` 
+  if test -f ${srcdir}/$j/configure ; then
+    build_configdirs="${build_configdirs} $i"
+  fi
+done
+
 configdirs_all="$configdirs"
 configdirs=
 for i in ${configdirs_all} ; do
@@ -1259,6 +1274,7 @@
     configdirs="${configdirs} $i"
   fi
 done
+
 target_configdirs_all="$target_configdirs"
 target_configdirs=
 for i in ${target_configdirs_all} ; do
@@ -1285,7 +1301,7 @@
 	  appdirs=""
 	  break
 	fi
-	if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
+	if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then
 	  appdirs=""
 	  break
 	fi
@@ -1471,6 +1487,9 @@
   extra_host_args="$extra_host_args --with-newlib"
 fi
 
+if test x${with_libbanshee} = xyes && echo " ${configdirs} " | grep " libbanshee " >/dev/null 2>&1; then
+  extra_host_args="$extra_host_args --with-libbanshee"
+fi
 
 # Default to using --with-stabs for certain targets.
 if test x${with_stabs} = x ; then
@@ -1497,12 +1516,16 @@
 tooldir='${exec_prefix}'/${target_alias}
 build_tooldir=${tooldir}
 
-# Generate default definitions for YACC, M4, LEX.  These are used if the
-# Makefile can't locate these programs in objdir.
+# Generate default definitions for YACC, M4, LEX and other programs that run
+# on the build machine.  These are used if the Makefile can't locate these
+# programs in objdir.
 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
-AC_CHECK_PROGS([DEFAULT_YACC], ['bison -y' byacc yacc], [$MISSING bison])
-AC_CHECK_PROGS([DEFAULT_M4], [gm4 gnum4 m4], [$MISSING m4])
-AC_CHECK_PROGS([DEFAULT_LEX], [flex lex], [$MISSING flex])
+AC_CHECK_PROGS([CONFIGURED_BISON], [bison], [$MISSING bison])
+AC_CHECK_PROGS([CONFIGURED_YACC], ['bison -y' byacc yacc], [$MISSING bison -y])
+AC_CHECK_PROGS([CONFIGURED_M4], [gm4 gnum4 m4], [$MISSING m4])
+AC_CHECK_PROGS([CONFIGURED_FLEX], [flex], [$MISSING flex])
+AC_CHECK_PROGS([CONFIGURED_LEX], [flex lex], [$MISSING flex])
+AC_CHECK_PROGS([CONFIGURED_MAKEINFO], makeinfo, [$MISSING makeinfo])
 
 # Create a .gdbinit file which runs the one in srcdir
 # and tells GDB to look there for source files.
@@ -1585,17 +1608,7 @@
 # Record target_configdirs and the configure arguments for target and
 # build configuration in Makefile.
 target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
-
-# This is the final value for target_configdirs.  configdirs already
-# has its final value, as does build_modules.  It's time to create some 
-# lists of valid targets.
-
-all_build_modules=
-configure_build_modules=
-for module in ${build_modules} ; do
-  all_build_modules=all-build-${module}
-  configure_build_modules=configure-build-${module}
-done
+build_configdirs=`echo "${build_configdirs}" | sed -e 's/build-//g'`
 
 # Determine whether gdb needs tk/tcl or not.
 # Use 'maybe' since enable_gdbtk might be true even if tk isn't available
@@ -1623,31 +1636,55 @@
     ;;
 esac
 
-# Create the 'maybe dependencies'.  This uses a temporary file.
+# Strip out unwanted targets.
 
 # While at that, we remove Makefiles if we were started for recursive
 # configuration, so that the top-level Makefile reconfigures them,
 # like we used to do when configure itself was recursive.
-rm -f maybedep.tmp
-echo '# maybedep.tmp' > maybedep.tmp
 
-# Make-targets which may need maybe dependencies.
-mts="configure all install check clean distclean dvi info install-info"
-mts="${mts} installcheck mostlyclean maintainer-clean TAGS"
+# Loop over modules.  $extrasub must be used with care, limiting as
+# much as possible the usage of range addresses.  That's because autoconf
+# splits the sed script to overcome limits in the number of commands,
+# and relying on carefully-timed sed passes may turn out to be very hard
+# to maintain later.  In this particular case, you just have to be careful
+# not to nest @if/@endif pairs, because configure will not warn you at all.
 
-# Loop over modules and make-targets.
-for module in ${build_modules} ; do
+AC_ARG_ENABLE([bootstrap],
+[  --enable-bootstrap     Enable bootstrapping [no]],,
+enable_bootstrap=no)
+if test -d ${srcdir}/gcc; then
+  case "$host:$target:$enable_bootstrap" in
+    $build:$build:yes | *:no) ;;
+    *:yes) AC_MSG_ERROR([cannot bootstrap a cross-compiler]) ;;
+    *) AC_MSG_ERROR([invalid option for --enable-bootstrap]) ;;
+  esac
+else
+  if test $enable_bootstrap = yes; then
+    AC_MSG_ERROR([cannot bootstrap without a compiler])
+  fi
+fi
+
+case "$enable_bootstrap" in
+  yes)
+    default_target=bootstrap
+    bootstrap_suffix=bootstrap ;;
+  no)
+    default_target=all
+    bootstrap_suffix=no-bootstrap ;;
+esac
+AC_SUBST(default_target)
+
+for module in ${build_configdirs} ; do
   if test -z "${no_recursion}" \
      && test -f ${build_subdir}/${module}/Makefile; then
     echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
     rm -f ${build_subdir}/${module}/Makefile
   fi
-  for mt in ${mts} ; do
-    case ${mt} in
-      install) ;; # No installing build modules.
-      *) echo "maybe-${mt}-build-${module}: ${mt}-build-${module}" >> maybedep.tmp ;;
-    esac
-  done
+  extrasub="$extrasub
+/^@if build-$module\$/d
+/^@endif build-$module\$/d
+/^@if build-$module-$bootstrap_suffix\$/d
+/^@endif build-$module-$bootstrap_suffix\$/d"
 done
 for module in ${configdirs} ; do
   if test -z "${no_recursion}" \
@@ -1655,9 +1692,11 @@
     echo 1>&2 "*** removing ${module}/Makefile to force reconfigure"
     rm -f ${module}/Makefile
   fi
-  for mt in ${mts} ; do
-    echo "maybe-${mt}-${module}: ${mt}-${module}" >> maybedep.tmp
-  done
+  extrasub="$extrasub
+/^@if $module\$/d
+/^@endif $module\$/d
+/^@if $module-$bootstrap_suffix\$/d
+/^@endif $module-$bootstrap_suffix\$/d"
 done
 for module in ${target_configdirs} ; do
   if test -z "${no_recursion}" \
@@ -1665,12 +1704,15 @@
     echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
     rm -f ${target_subdir}/${module}/Makefile
   fi
-  for mt in ${mts} ; do
-    echo "maybe-${mt}-target-${module}: ${mt}-target-${module}" >> maybedep.tmp
-  done
+  extrasub="$extrasub
+/^@if target-$module\$/d
+/^@endif target-$module\$/d
+/^@if target-$module-$bootstrap_suffix\$/d
+/^@endif target-$module-$bootstrap_suffix\$/d"
 done
-maybe_dependencies=maybedep.tmp
-AC_SUBST_FILE(maybe_dependencies)
+
+extrasub="$extrasub
+/^@if /,/^@endif /d"
 
 # Create the serialization dependencies.  This uses a temporary file.
 
@@ -1733,21 +1775,21 @@
 # at the end of the argument list.
 # These will be expanded by make, so quote '$'.
 cat <<\EOF_SED > conftestsed
-s/ --no[[^ ]]* / /
-s/ --c[[a-z-]]*[[= ]][[^ ]]* / /
-s/ --sr[[a-z-]]*[[= ]][[^ ]]* / /
-s/ --ho[[a-z-]]*[[= ]][[^ ]]* / /
-s/ --bu[[a-z-]]*[[= ]][[^ ]]* / /
-s/ --t[[a-z-]]*[[= ]][[^ ]]* / /
-s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* / /
-s/ -cache-file[[= ]][[^ ]]* / /
-s/ -srcdir[[= ]][[^ ]]* / /
-s/ -host[[= ]][[^ ]]* / /
-s/ -build[[= ]][[^ ]]* / /
-s/ -target[[= ]][[^ ]]* / /
-s/ -program-prefix[[= ]][[^ ]]* / /
-s/ -program-suffix[[= ]][[^ ]]* / /
-s/ -program-transform-name[[= ]][[^ ]]* / /
+s/ --no[[^ ]]*/ /g
+s/ --c[[a-z-]]*[[= ]][[^ ]]*//g
+s/ --sr[[a-z-]]*[[= ]][[^ ]]*//g
+s/ --ho[[a-z-]]*[[= ]][[^ ]]*//g
+s/ --bu[[a-z-]]*[[= ]][[^ ]]*//g
+s/ --t[[a-z-]]*[[= ]][[^ ]]*//g
+s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]*//g
+s/ -cache-file[[= ]][[^ ]]*//g
+s/ -srcdir[[= ]][[^ ]]*//g
+s/ -host[[= ]][[^ ]]*//g
+s/ -build[[= ]][[^ ]]*//g
+s/ -target[[= ]][[^ ]]*//g
+s/ -program-prefix[[= ]][[^ ]]*//g
+s/ -program-suffix[[= ]][[^ ]]*//g
+s/ -program-transform-name[[= ]][[^ ]]*//g
 s/ [[^' -][^ ]*] / /
 s/^ *//;s/ *$//
 s,\$,$$,g
@@ -1935,6 +1977,20 @@
 fi
 GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)'
 
+if test "x${GFORTRAN_FOR_TARGET+set}" = xset; then
+  :
+elif test -d ${srcdir}/gcc; then
+  GFORTRAN_FOR_TARGET='$$r/gcc/gfortran -B$$r/gcc/'
+elif test "$host" = "$target"; then
+  GFORTRAN_FOR_TARGET='gfortran'
+else
+  GFORTRAN_FOR_TARGET=`echo gfortran | sed "${program_transform_name}"`
+fi
+case $GFORTRAN_FOR_TARGET in
+*' $(FLAGS_FOR_TARGET)') ;;
+*) GFORTRAN_FOR_TARGET=$GFORTRAN_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;;
+esac
+
 # Don't use libstdc++-v3's flags to configure/build itself.
 libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
 raw_libstdcxx_flags='-L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
@@ -1976,6 +2032,7 @@
 # Wrap CC_FOR_TARGET and friends, for certain types of builds.
 CC_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}"
 GCJ_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}"
+GFORTRAN_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${GFORTRAN_FOR_TARGET}"
 CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}"
 RAW_CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}"
 CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}"
@@ -1994,6 +2051,7 @@
 # Miscellanea: directories, flags, etc.
 AC_SUBST(SET_LIB_PATH)
 AC_SUBST(RPATH_ENVVAR)
+AC_SUBST(BUILD_DIR_PREFIX)
 AC_SUBST(BUILD_PREFIX)
 AC_SUBST(BUILD_PREFIX_1)
 AC_SUBST(gcc_version_trigger)
@@ -2006,8 +2064,7 @@
 
 # Build module lists & subconfigure args.
 AC_SUBST(build_configargs)
-AC_SUBST(configure_build_modules)
-AC_SUBST(all_build_modules)
+AC_SUBST(build_configdirs)
 
 # Host module lists & subconfigure args.
 AC_SUBST(host_configargs)
@@ -2018,11 +2075,7 @@
 AC_SUBST(target_configdirs)
 
 # Build tools.
-AC_SUBST(BISON)
 AC_SUBST(CC_FOR_BUILD)
-AC_SUBST(LEX)
-AC_SUBST(MAKEINFO)
-AC_SUBST(YACC)
 AC_SUBST(config_shell)
 
 # Host tools.
@@ -2040,23 +2093,21 @@
 AC_SUBST(CFLAGS)
 AC_SUBST(CFLAGS_FOR_BUILD)
 AC_SUBST(CXXFLAGS)
-AC_SUBST(DEFAULT_YACC)
-AC_SUBST(DEFAULT_LEX)
-AC_SUBST(DEFAULT_M4)
 
 # Target tools.
-NCN_STRICT_CHECK_TARGET_TOOL(AR_FOR_TARGET, ar)
-NCN_STRICT_CHECK_TARGET_TOOL(AS_FOR_TARGET, as)
-NCN_STRICT_CHECK_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
-NCN_STRICT_CHECK_TARGET_TOOL(LD_FOR_TARGET, ld)
-NCN_STRICT_CHECK_TARGET_TOOL(NM_FOR_TARGET, nm)
-NCN_STRICT_CHECK_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib, :)
-NCN_STRICT_CHECK_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
+NCN_STRICT_CHECK_TARGET_TOOL(CONFIGURED_AR_FOR_TARGET, ar)
+NCN_STRICT_CHECK_TARGET_TOOL(CONFIGURED_AS_FOR_TARGET, as)
+NCN_STRICT_CHECK_TARGET_TOOL(CONFIGURED_DLLTOOL_FOR_TARGET, dlltool)
+NCN_STRICT_CHECK_TARGET_TOOL(CONFIGURED_LD_FOR_TARGET, ld)
+NCN_STRICT_CHECK_TARGET_TOOL(CONFIGURED_NM_FOR_TARGET, nm)
+NCN_STRICT_CHECK_TARGET_TOOL(CONFIGURED_RANLIB_FOR_TARGET, ranlib, :)
+NCN_STRICT_CHECK_TARGET_TOOL(CONFIGURED_WINDRES_FOR_TARGET, windres)
 
 AC_SUBST(GCC_FOR_TARGET)
 AC_SUBST(FLAGS_FOR_TARGET)
 AC_SUBST(CC_FOR_TARGET)
 AC_SUBST(GCJ_FOR_TARGET)
+AC_SUBST(GFORTRAN_FOR_TARGET)
 AC_SUBST(CXX_FOR_TARGET)
 AC_SUBST(RAW_CXX_FOR_TARGET)
 AC_SUBST(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)
@@ -2077,7 +2128,24 @@
   NM_FOR_TARGET="\$(USUAL_NM_FOR_TARGET)"
   RANLIB_FOR_TARGET="\$(USUAL_RANLIB_FOR_TARGET)"
   WINDRES_FOR_TARGET="\$(USUAL_WINDRES_FOR_TARGET)"
+else
+  # Just use the ones we found.
+  AR_FOR_TARGET="\$(CONFIGURED_AR_FOR_TARGET)"
+  AS_FOR_TARGET="\$(CONFIGURED_AS_FOR_TARGET)"
+  DLLTOOL_FOR_TARGET="\$(CONFIGURED_DLLTOOL_FOR_TARGET)"
+  LD_FOR_TARGET="\$(CONFIGURED_LD_FOR_TARGET)"
+  NM_FOR_TARGET="\$(CONFIGURED_NM_FOR_TARGET)"
+  RANLIB_FOR_TARGET="\$(CONFIGURED_RANLIB_FOR_TARGET)"
+  WINDRES_FOR_TARGET="\$(CONFIGURED_WINDRES_FOR_TARGET)"  
 fi
+AC_SUBST(AR_FOR_TARGET)
+AC_SUBST(AS_FOR_TARGET)
+AC_SUBST(DLLTOOL_FOR_TARGET)
+AC_SUBST(LD_FOR_TARGET)
+AC_SUBST(NM_FOR_TARGET)
+AC_SUBST(RANLIB_FOR_TARGET)
+AC_SUBST(WINDRES_FOR_TARGET)
+
 # Certain tools may need extra flags.
 AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
 RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
@@ -2124,15 +2192,45 @@
 esac
 AC_SUBST(stage1_cflags)
 
+# It makes debugging easier if we create as symlinks the stage directories
+# gcc for stageN-gcc and stage-prev for stage(N-1).  In case this is not
+# possible, however, we can resort to mv.
+AC_CACHE_CHECK([if symbolic links between directories work],
+[gcc_cv_prog_ln_s_dir],
+[if test "${LN_S}" = "ln -s" \
+   && mkdir confdir.s1 \
+   && ln -s confdir.s1 confdir.s2 \
+   && echo timestamp1 > confdir.s1/conftest.1 \
+   && cmp confdir.s1/conftest.1 confdir.s2/conftest.1 \
+   && echo timestamp2 > confdir.s2/conftest.2 \
+   && cmp confdir.s1/conftest.2 confdir.s1/conftest.2 \
+   && rm -f confdir.s2; then
+  gcc_cv_prog_ln_s_dir=yes
+else
+  gcc_cv_prog_ln_s_dir=yes
+fi
+rm -rf confdir.s1 confdir.s2])
+
+case ${gcc_cv_prog_ln_s_dir} in
+  yes)
+    CREATE_LINK_TO_DIR='ln -s $$1 $$2'
+    UNDO_LINK_TO_DIR='rm -f $$1' ;;
+  *)
+    CREATE_LINK_TO_DIR='mv $$1 $$2'
+    UNDO_LINK_TO_DIR='mv $$1 $$2' ;;
+esac
+AC_SUBST(CREATE_LINK_TO_DIR)
+AC_SUBST(UNDO_LINK_TO_DIR)
+
 # Enable -Werror in bootstrap stage2 and later.
 # Change the default to "no" on release branches.
 AC_ARG_ENABLE(werror,
 [  --enable-werror         enable -Werror in bootstrap stage2 and later], [],
 [enable_werror=yes])
-case ${enable_error} in
-  yes) WERROR=-Werror ;;
-  *) WERROR= ;;
+case ${enable_werror} in
+  yes) stage2_werror_flag="--enable-werror-always" ;;
+  *) stage2_werror_flag="" ;;
 esac
-AC_SUBST(WERROR)
+AC_SUBST(stage2_werror_flag)
 
 AC_OUTPUT(Makefile)
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index ce4468b..3ef3440 100644
--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,11 @@
+2004-05-15  Nick Clifton  <nickc@redhat.com>
+
+	* iq2000.opc (iq2000_cgen_insn_supported): Make 'insn' argument const.
+
+2004-03-30  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
+
+	* m32r.opc (parse_hi16): Fixed shigh(0xffff8000) bug.
+
 2004-03-01  Richard Sandiford  <rsandifo@redhat.com>
 
 	* frv.cpu (define-arch frv): Add fr450 mach.
diff --git a/cpu/iq2000.opc b/cpu/iq2000.opc
index 06600ec..3b7620f 100644
--- a/cpu/iq2000.opc
+++ b/cpu/iq2000.opc
@@ -52,7 +52,7 @@
    instructions have same mnemonics but different functionality. */
 #define CGEN_VALIDATE_INSN_SUPPORTED
 
-extern int iq2000_cgen_insn_supported (CGEN_CPU_DESC cd, CGEN_INSN *insn);
+extern int iq2000_cgen_insn_supported (CGEN_CPU_DESC cd, const CGEN_INSN *insn);
 
 /* -- asm.c */
 static const char * parse_mimm PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
@@ -60,11 +60,11 @@
 static const char * parse_hi16 PARAMS ((CGEN_CPU_DESC, const char **, int, unsigned long *));
 static const char * parse_lo16 PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
 
-/* Special check to ensure that instruction exists for given machine */
+/* Special check to ensure that instruction exists for given machine.  */
 int
 iq2000_cgen_insn_supported (cd, insn)
      CGEN_CPU_DESC cd;
-     CGEN_INSN *insn;
+     const CGEN_INSN *insn;
 {
   int machs = cd->machs;
 
diff --git a/cpu/m32r.opc b/cpu/m32r.opc
index 6764223..78bd0fa 100644
--- a/cpu/m32r.opc
+++ b/cpu/m32r.opc
@@ -1,6 +1,6 @@
 /* M32R opcode support.  -*- C -*-
 
-   Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
 
    Contributed by Red Hat Inc; developed under contract from
    Mitsubishi Electric Corporation.
@@ -23,9 +23,7 @@
 
    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.
-
-*/
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 /* This file is an addendum to m32r.cpu.  Heavy use of C code isn't
    appropriate in .cpu files, so it resides here.  This especially applies
@@ -40,8 +38,7 @@
    <arch>-opc.c additions use: "-- opc.c"
    <arch>-asm.c additions use: "-- asm.c"
    <arch>-dis.c additions use: "-- dis.c"
-   <arch>-ibd.h additions use: "-- ibd.h"
-*/
+   <arch>-ibd.h additions use: "-- ibd.h"  */
 
 /* -- opc.h */
 
@@ -153,7 +150,10 @@
       ++*strp;
       if (errmsg == NULL
 	  && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
-	value = (value >> 16) + (value & 0x8000 ? 1 : 0);
+        {
+          value = value + (value & 0x8000 ? 0x10000 : 0);
+          value >>= 16;
+        }
       *valuep = value;
       return errmsg;
     }
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9eb7815..76c89d9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,4088 @@
+2004-07-09  Paul N. Hilfinger  <Hilfinger@gnat.com>
+
+	Remove ARI problems:
+	
+	* ada-exp.y (write_var_from_sym): Reformat to put operator at
+	beginning of line.
+
+	* ada-lang.c (MAX_OF_SIZE): Rename max_of_size.
+	Add comment.
+	Add comment concerning MAX_OF_TYPE and MIN_OF_TYPE.
+	(MIN_OF_SIZE): Rename min_of_size.  Add comment.
+	(UMAX_OF_SIZE): Renmae umax_of_size.  Add comment.
+	(UMIN_OF_SIZE): Remove.
+	(max_of_type): New function to replace orphan macro in gdbtypes.h
+	(min_of_type): Ditto.
+	(discrete_type_high_bound): Use max_of_type.
+	(discrete_type_low_bound): Use min_of_type.
+	(possible_user_operator_p): Move operator to beginning of line.
+	(ada_is_variant_part): Ditto.
+	(ensure_lval): Rewrite to avoid deprecated operations.
+	(ada_finish_decode_line_1): Use gdbarch_convert_from_func_ptr_addr
+	rather than adding DEPRECATED_FUNCTION_START_OFFSET.
+	(ada_enum_name): Remove assignments in 'if' statements.
+	(build_ada_types): Add gdbarch parameter.
+	(_initialize_ada_language): Replace deprecated_register_gdbarch_swap
+	with gdbarch_data_register_post_init.
+	Use add_setshow_uinteger_cmd rather than add_set_cmd and 
+	add_show_from_set.
+
+	* ada-valprint.c (inspect_it): Remove declaration.
+	(repeat_count_threshold): Remove declaration.
+	(ada_print_floating): Remove assignments in 'if' statements.
+	(print_str): Move operator to beginning of line.
+	
+2004-07-08  Jim Blandy  <jimb@redhat.com>
+
+	* rs6000-tdep.c (registers_powerpc_nofp): Unused; deleted.
+
+2004-07-08  Bob Rossi  <bob@brasko.net>
+
+	* symtab.c (lookup_symtab): check return value of symtab_to_fullname
+
+2004-07-06  Jeff Johnston <jjohnstn@redhat.com>
+
+	* language.h (struct_language_defn): Add new function pointer:
+	la_class_name_from_physname.  Also add new prototype for
+	language_class_name_from_physname.
+	* language.c (language_class_name_from_physname): New function.
+	(unk_lang_class_name): Ditto.
+	(unknown_language_defn, auto_language_defn): Change
+	to add unk_lang_class_name function pointer for
+	la_class_name_from_physname.
+	(local_language_defn): Ditto.
+	* dwarf2read.c (guess_structure_name): Change to call
+	language_class_name_from_physname.
+	(determine_class_name): Ditto.
+	* cp-support.c (class_name_from_physname): Renamed.
+	(cp_class_name_from_physname): New name of function.
+	* cp-support.h: Ditto.
+	* c-lang.c (c_language_defn): Change to add NULL
+	for class_name_from_physname function pointer.
+	(cplus_language_defn): Change to add cp_class_name_from_physname.
+	* jv-lang.c (java_class_name_physname): New function.
+	(java_find_last_component): New static routine.
+	(java_language_defn): Add java_class_name_from_physname pointer.
+	* ada-lang.c (ada_language_defn): Change to add NULL
+	for class_name_from_physname function pointer.
+	* f-lang.c (f_language_defn): Ditto.
+	* m2-lang.c (m2_language_defn): Ditto.
+	* objc-lang.c (objc_language_defn): Ditto.
+	* p-lang.c (pascal_language_defn): Ditto.
+	* scm-lang.c (scm_language_defn): Ditto. 
+
+2004-07-06  Andrew Cagney  <cagney@gnu.org>
+
+	Patch from Bart Robinson.
+	* corelow.c (core_open): Add variable "flags", or in O_LARGEFILE.
+	(O_LARGEFILE): Define to 0, if not defined.
+
+2004-07-03  Mark Kettenis  <kettenis@gnu.org>
+
+	* m68kbsd-nat.c: Include "gdbcore.h", <sys/types.h>,
+	<machine/pcb.h> and "bsd-kvm.h".
+	(PCB_REGS_FP, PCB_REGS_SP): Define if not already defined.
+	(m68kbsd_supply_pcb): New function.
+	(_initialize_m68kbsd_nat): New prototype and function.
+	* Makefile.in (m68kbsd-nat.o): Update dependencies.
+	* config/m68k/nbsdelf.mh (NATDEPFILES): Add bsd-kvm.o.
+	(LOADLIBES): New variable.
+	* config/m68k/obsd.mh (NATDEPFILES): Add bsd-kvm.o.
+	(LOADLIBES): New variable.
+
+	* bsd-kvm.c (bsd_kvm_cmdlist): Remove unecessary initialization.
+
+2004-07-03  Mark Kettenis  <kettenis@gnu.org>
+
+	* bsd-kvm.c: Include "cli/cli-cmds.h", "command.h", "value.h" and
+	<sys/proc.h>.
+	(bsd_kvm_cmdlist): New variable.
+	(bsd_kvm_cmd, bsd_kvm_proc_cmd, bsd_kvm_pcb_cmd): New functions.
+	(bsd_kvm_add_target): Register "kvm" command prefix, "kvm pcb"
+	command and "kvm proc" command.
+	* Makefile.in (bsd-kvm.o): Update dependencies.
+
+2004-07-02  Mark Kettenis  <kettenis@gnu.org>
+
+	* osabi.c: Update copyright year.
+	(generic_elf_osabi_sniffer): Tweak comment.  Look for OS-specific
+	notes if EI_OSABI is set to ELFOSABI_HPUX.
+
+2004-07-01  Michael Snyder  <msnyder@redhat.com>
+
+	* win32-nat.c (core_dll_symbols_add): Re-indent a small section
+	that seems to have gotten whacked out of line.
+
+2004-07-01  Mark Kettenis  <kettenis@gnu.org>
+
+	* dbxread.c (process_one_symbol) [PCC_SOL_BROKEN]: Remove dead
+	code.
+
+2004-07-01  Paul N. Hilfinger  <Hilfinger@gnat.com>
+
+	* ada-lang.c (decode_packed_array): Minor change to comment.
+	(ada_value_slice_ptr): New function. 
+	(ada_value_slice): New function. 
+	(ada_evaluate_subexp): Remove XVS-suffix code from subscripting
+	test.  Don't know why it is there.
+	Change slice code to use ada_value_slice_ptr and ada_value_slice, and
+	to avoid dereferencing huge arrays from which one is slicing.  
+	(empty_array): Correct to return an array rather than
+	a subrange value.
+	* ada-valprint.c (print_optional_low_bound): Don't print lower bound
+	on empty arrays (let'em use 'FIRST instead).
+
+2004-07-01  Paul N. Hilfinger  <Hilfinger@gnat.com>
+
+	Address complaints from gdb_ari.sh:
+	
+	* ada-exp.y: Include gdb_string.h rather than string.h.
+	(convert_char_literal): Reformat declaration.
+	* ada-lang.h: Include opaque struct declaration for struct frame_info.
+	* ada-lex.l: Change use of free to xfree (the macro would do so
+	anyway, but this is harmless).
+	Include gdb_string.h rather than string.h.
+	* ada-valprint.c (ada_val_print_stub): Change PTR => void*.
+	
+	* ada-lang.c (parse): Remove K&Rism in parameter list.
+	(is_name_suffix): Correct Linux => GNU/Linux in comment.
+	
+2004-06-30  Mark Kettenis  <kettenis@gnu.org>
+
+	* dbxread.c (process_one_symbol) [SUN_FIXED_LBRAC_BUG]: Remove
+	dead code.
+
+2004-06-30  Mark Kettenis  <kettenis@gnu.org>
+
+	* alphabsd-nat.c: Update copyright year.
+	(getregs_supplies): Use ALPHA_PC_REGNUM instead of PC_REGNUM.
+
+2004-06-29  Joel Brobecker  <brobecker@gnat.com>
+
+	* i386-cygwin-tdep.c (i386_cygwin_skip_trampoline_code): New function.
+	(i386_cygwin_in_solib_call_trampoline): New function.
+	(i386_cygwin_init_abi): Initialize the in_solib_call_trampoline
+	and skip_trampoline_code gdbarch methods.
+
+2004-06-29  Jim Blandy  <jimb@redhat.com>
+
+	* Makefile.in (gdb_callback_h): Renamed from callback_h to the
+	name actually used in the dependency lists.
+
+2004-06-29  Randolph Chung  <tausq@debian.org>
+
+	* NEWS (New native configurations): Mention GNU/Linux/hppa.
+
+2004-06-29  Corinna Vinschen  <vinschen@redhat.com>
+
+	* win32-nat.c (child_pid_to_exec_file): New function.
+	(init_child_ops): Add child_pid_to_exec_file as to_pid_to_exec_file
+	functionality.
+
+2004-06-28  Andrew Cagney  <cagney@gnu.org>
+
+	* defs.h (xstrvprintf): Declare.
+	* utils.c (xstrvprintf): New function.
+	(internal_vproblem, xstrprintf, xasprintf) 
+	(vfprintf_maybe_filtered, vfprintf_unfiltered): Use xstrvprintf.
+	* serial.c (serial_printf): Ditto.
+	* complaints.c (vcomplaint): Ditto.
+
+2004-06-29  Corinna Vinschen  <vinschen@redhat.com>
+
+	* infcmd.c (attach_command): Move call to target_terminal_inferior
+	behind loading symbol table.
+
+2004-06-28  Andrew Cagney  <cagney@gnu.org>
+
+	* rdi-share/ardi.c (angel_RDI_ExecuteOrStep): Revert 2004-06-24
+	change - add back extern deprecated_ui_loop_hook declaration.
+
+2004-06-28  Andrew Cagney  <cagney@gnu.org>
+
+	* xcoffsolib.c (xcoff_solib_address): Replace xasprintf with
+	xstrprintf.
+	* varobj.c (varobj_gen_name, create_child, c_name_of_child)
+	(c_value_of_variable): Ditto.
+	* utils.c (internal_vproblem): Ditto.
+	* solib-aix5.c (build_so_list_from_mapfile): Ditto.
+	* remote.c (add_packet_config_cmd): Ditto.
+	* remote-rdp.c (rdp_set_command_line): Ditto.
+	* regcache.c (regcache_dump): Ditto.
+	* frv-tdep.c (new_variant, new_variant): Ditto.
+	* fbsd-proc.c (child_pid_to_exec_file): Ditto.
+	(fbsd_find_memory_regions): Ditto.
+	* breakpoint.c (create_thread_event_breakpoint) 
+	(create_breakpoints): Ditto.
+	* aix-thread.c (aix_thread_pid_to_str): Ditto.
+	* ada-lang.c (is_package_name): Ditto.  Also delete xmalloc call.
+
+2004-06-28  Joel Brobecker  <brobecker@gnat.com>
+
+	* ada-lang.c: Re-indent file, with some massaging to help indent
+	a bit when the result is otherwise really too ugly.
+
+2004-06-27  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* frame.h (struct frame_id): Change bit field type of stack_addr_p, 
+	code_addr_p and special_addr_p to 'unsigned int'.
+
+2004-06-27  Mark Kettenis  <kettenis@gnu.org>
+
+	* i386v4-nat.c: Update copyright year and tweak comment.
+	(regmap): Remove trailing comma.
+	(supply_gregset): Rename local variable i to regnum.  Call
+	regcache_raw_supply instead of supply_register.
+	(fill_gregset): Rename argument regno to regnum.  Call
+	regcache_raw_collect instead of regcache_collect.
+
+2004-06-27  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* frame.h (struct frame_id): New fields stack_addr_p, code_addr_p
+	and special_addr_p.
+	(frame_id_build, frame_id_build_special): Update comments.
+	(frame_id_build_wild): New prototype.
+	* frame.c (frame_id_build, frame_id_build_special): Fill in new
+	struct frame_id fields.
+	(frame_id_build_wild): New function.
+	(frame_id_eq, frame_id_inner): Use new struct frame_id fields.
+
+2004-06-27  Mark Kettenis  <kettenis@gnu.org>
+
+	* config/djgpp/fnchange.lst: Add entries for hppabsd-nat.c and
+	hppabsd-tdep.c.
+
+2004-06-27  Joel Brobecker  <brobecker@gnat.com>
+
+	* ada-lang.c: Minor reformatting to conform to GNU coding standards.
+
+2004-06-27  Joel Brobecker  <brobecker@gnat.com>
+
+	* ada-lang.c: Re-indent file.
+
+2004-06-27  Joel Brobecker  <brobecker@gnat.com>
+
+	* ada-lang.c (symtab_symbol_info): Remove unused declaration.
+	(no_symtab_msg): Likewise.
+
+2004-06-27  Andreas Schwab  <schwab@suse.de>
+
+	* source.c: Fix whitespace.
+
+2004-06-27  Mark Kettenis  <kettenis@gnu.org>
+
+	* configure.in: Include <sys/param.h> for td_pcb test.
+	* configure: Regenerated.
+
+	* i386nbsd-nat.c: New file.
+	* Makefile.in (ALLDEPFILES): Add i386nbsd-nat.c, i386nbsd-tdep.c,
+	i386obsd-nat.c and i386obsd-tdep.c.
+	(i386nbsd-nat.o): New dependency.
+	* config/i386/obsd.mh (NATDEPFILES): Add i386nbsd-nat.o and
+	bsd-kvm.o.
+	(LOADLIBES): New variable.
+	* config/i386/nbsdelf.mh (NATDEPFILES): Add i386nbsd-nat.o and
+	bsd-kvm.o.
+	(LOADLIBES): New variable.
+
+	* config/i386/fbsd64.mh (NATDEPFILES): Add bsd-kvm.o.
+	(LOADLIBES): New variable.
+
+	* bsd-kvm.c (bsd_kvm_fetch_registers): Directly return after
+	fetching from BSD_KVM_PADDR.  Correctly lookup address for
+	"_thread0".
+
+	* amd64fbsd-nat.c: Include <sys/types.h, <machine/pcb.h> and
+	"bsd-kvm.h".
+	(amd64fbsd_supply_pcb): New funcion.
+	(_initialize_amd64fbsd_nat): Enable libkvm interface.
+
+2004-06-27    <david@streamline-computing.com>
+
+	Partial fix for PR cli/1056.
+	* valarith.c: Check for zero in division and remainder 
+	evaluation.
+
+2004-06-27  Mark Kettenis  <kettenis@gnu.org>
+
+	* i387-tdep.c: Remove excessive whitespace.
+
+2004-06-26  Andrew Cagney  <cagney@gnu.org>
+
+	* gdb-events.sh (deprecated_set_gdb_event_hooks): Deprecated.
+	* gdb-events.h, gdb-events.c: Re-generate.
+	* tui/tui-hooks.c (tui_install_hooks): Update.
+	(tui_remove_hooks): Update.
+	* mi/mi-cmd-break.c (mi_cmd_break_insert): Update.
+
+2004-06-26  Mark Kettenis  <kettenis@gnu.org>
+
+	* amd64fbsd-nat.c: Don't include <sys/procfs.h> and "gregset.h".
+	(gregset_t, fpregset_t): Remove typedefs.
+	(REG_OFFSET): Rename argument.
+	(amd64bsd_r_reg_offset): Rename from reg_offset.
+	(supply_gregset, fill_gregset, supply_fpregset, fill_fpregset):
+	Remove functions.
+	(_initialize_amd64fbsd_nat): Use amd64fbsd64_r_reg_offset instead
+	of reg_offset.
+	* Makefile.in (amd64fbsd-nat.o): Update dependencies.
+
+	* amd64-nat.c (amd64_supply_native_gregset): Fix comment.
+
+	* vax-tdep.c: Tweak comment.
+
+	Add OpenBSD/hppa support.
+	* NEWS (New native configurations): Mention OpenBSD/hppa.
+	* hppabsd-nat.c, hppabsd-tdep.c, config/pa/obsd.mh,
+	config/pa/obsd.mt, config/pa/nm-obsd.h, config/pa/tm-bsd.h: New
+	files.
+	* Makefile.in (ALLDEPFILES): Add hppabsd-nat.c and hppabsd-tdep.c.
+	(hppabsd-nat.o, hppabsd-tdep.c): New dependencies.
+	* configure.host: Add hppa*-*-openbsd*.
+	* configure.tgt: Add hppa*-*-openbsd*.
+
+2004-06-25  Andrew Cagney  <cagney@gnu.org>
+
+	* defs.h (deprecated_ui_loop_hook): Deprecated.
+	* wince.c (child_wait): Update.
+	* win32-nat.c (child_wait): Update.
+	* v850ice.c (v850ice_wait): Update.
+	* top.c (deprecated_ui_loop_hook): Update.
+	* serial.h: Update.
+	* ser-unix.c (do_hardwire_readchar, do_hardwire_readchar) 
+	(do_unix_readchar): Update.
+	* ser-tcp.c (net_open): Update.
+	* remote-sim.c (gdb_os_poll_quit): Update.
+	* rdi-share/ardi.c (angel_RDI_ExecuteOrStep): Update.
+
+2004-06-24  Andrew Cagney  <cagney@gnu.org>
+
+	* defs.h (deprecated_pre_add_symbol_hook)
+	(deprecated_post_add_symbol_hook): Deprecated.
+	* symfile.c (symbol_file_add_with_addrs_or_offsets) 
+	(symbol_file_add_with_addrs_or_offsets): Update references.
+
+2004-06-24  Andrew Cagney  <cagney@gnu.org>
+
+	* defs.h (post_add_symbol_hook, pre_add_symbol_hook)
+	(ui_loop_hook, selected_frame_level_changed_hook): Declare.
+	* wince.c (ui_loop_hook): Delete extern declaration.
+	* win32-nat.c (ui_loop_hook): Delete extern declaration..
+	* v850ice.c (ui_loop_hook): Delete extern declaration..
+	* ser-unix.c (ui_loop_hook): Delete extern declaration..
+	* ser-tcp.c (ui_loop_hook): Delete extern declaration..
+	* remote-sim.c (ui_loop_hook): Delete extern declaration..
+	* rdi-share/ardi.c (angel_RDI_ExecuteOrStep): Delete extern.
+	ui_loop_hook declaration.
+
+2004-06-24  Andrew Cagney  <cagney@gnu.org>
+
+	* objfiles.h (struct entry_info): Delete entry_func_lowpc and
+	entry_func_highpc fields.
+	* objfiles.c (init_entry_point_info): Do not clear
+	entry_func_lowpc and entry_func_highpc.
+	(objfile_relocate): Do not relocate entry_func_lowpc and
+	entry_func_highpc.
+	* dwarfread.c (read_func_scope): Do not set entry_func_lowpc and
+	entry_func_highpc.
+	* dwarf2read.c (read_func_scope): Do not set entry_func_lowpc and
+	entry_func_highpc.
+	* blockframe.c (legacy_frame_chain_valid): Replace tests against
+	entry_func_lowpc and entry_func_highpc with call to
+	inside_entry_func.
+
+2004-06-24  Mark Kettenis  <kettenis@gnu.org>
+
+	* sparc64-tdep.c (sparc64_store_arguments): Fix passing
+	quad-precision floating point arguments in registers.
+
+2004-06-24  Mark Kettenis  <kettenis@gnu.org>
+
+	From Michael Mueller <m.mueller99@kay-mueller.de>:
+	* sparc64-tdep.c (sparc64_frame_base_address): Take BIAS into
+	account.
+
+2004-06-22  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* infrun.c (handle_inferior_event): Initialize stopped_by_watchpoint
+	to -1.
+	* breakpoint.c (bpstat_stop_status): Move check for ignoring
+	untriggered watchpoints to a separate if clause.  Update function
+	comment regarding STOPPED_BY_WATCHPOINT argument.
+
+2004-06-22  Jim Blandy  <jimb@redhat.com>
+
+	* gdbarch.sh: Doc fix.
+
+2004-06-21  Martin Hunt  <hunt@redhat.com>
+	Kevin Buettner <kevinb@redhat.com>
+
+        * config/mips/tm-mips.h (SP_REGNUM): Delete define.
+	* mips-tdep.h (MIPS_SP_REGNUM): Define.
+	* mips-tdep.c (mips_gdbarch_init): Set SP_REGNUM via call
+	to set_gdbarch_sp_regnum().  Use cooked register number.
+        (SP_REGNUM): Replace all occurrences with MIPS_SP_REGNUM.
+
+2004-06-21  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbarch.sh: When the macro field is empty, do not generate a
+	macro definition.  When the macro field is "=", generate the macro
+	name from the upper-case function name.
+	(NUM_REGS, NUM_PSEUDO_REGS, SP_REGNUM, PC_REGNUM, PS_REGNUM)
+	(FP0_REGNUM, STAB_REG_TO_REGNUM, ECOFF_REG_TO_REGNUM)
+	(DWARF_REG_TO_REGNUM, SDB_REG_TO_REGNUM, DWARF2_REG_TO_REGNUM)
+	(REGISTER_NAME, DEPRECATED_REGISTER_VIRTUAL_TYPE)
+	(DEPRECATED_REGISTER_BYTES, DEPRECATED_REGISTER_BYTE)
+	(DEPRECATED_REGISTER_RAW_SIZE, DEPRECATED_REGISTER_VIRTUAL_SIZE)
+	(DEPRECATED_SAVE_DUMMY_FRAME_TOS, DEPRECATED_FP_REGNUM)
+	(DEPRECATED_TARGET_READ_FP, DEPRECATED_PUSH_ARGUMENTS)
+	(DEPRECATED_PUSH_RETURN_ADDRESS, DEPRECATED_DUMMY_WRITE_SP)
+	(DEPRECATED_REGISTER_SIZE, CALL_DUMMY_LOCATION)
+	(DEPRECATED_DO_REGISTERS_INFO, REGISTER_SIM_REGNO)
+	(REGISTER_BYTES_OK, CANNOT_FETCH_REGISTER, CANNOT_STORE_REGISTER)
+	(GET_LONGJMP_TARGET, DEPRECATED_INIT_FRAME_PC)
+	(BELIEVE_PCC_PROMOTION, DEPRECATED_GET_SAVED_REGISTER)
+	(CONVERT_REGISTER_P, REGISTER_TO_VALUE, VALUE_TO_REGISTER)
+	(POINTER_TO_ADDRESS, ADDRESS_TO_POINTER, INTEGER_TO_ADDRESS)
+	(DEPRECATED_POP_FRAME, DEPRECATED_STORE_STRUCT_RETURN)
+	(EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE)
+	(DEPRECATED_EXTRACT_RETURN_VALUE, DEPRECATED_STORE_RETURN_VALUE)
+	(DEPRECATED_USE_STRUCT_CONVENTION)
+	(DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
+	(DEPRECATED_FRAME_INIT_SAVED_REGS)
+	(DEPRECATED_INIT_EXTRA_FRAME_INFO, SKIP_PROLOGUE, INNER_THAN)
+	(BREAKPOINT_FROM_PC, MEMORY_INSERT_BREAKPOINT)
+	(MEMORY_REMOVE_BREAKPOINT, DECR_PC_AFTER_BREAK)
+	(DEPRECATED_FUNCTION_START_OFFSET, FRAME_ARGS_SKIP)
+	(DEPRECATED_FRAMELESS_FUNCTION_INVOCATION, DEPRECATED_FRAME_CHAIN)
+	(DEPRECATED_FRAME_CHAIN_VALID, DEPRECATED_FRAME_SAVED_PC)
+	(DEPRECATED_FRAME_ARGS_ADDRESS, DEPRECATED_FRAME_LOCALS_ADDRESS)
+	(DEPRECATED_SAVED_PC_AFTER_CALL, FRAME_NUM_ARGS)
+	(DEPRECATED_STACK_ALIGN, DEPRECATED_REG_STRUCT_HAS_ADDR)
+	(FRAME_RED_ZONE_SIZE, ADDR_BITS_REMOVE, SMASH_TEXT_ADDRESS)
+	(SOFTWARE_SINGLE_STEP, SKIP_TRAMPOLINE_CODE)
+	(IN_SOLIB_CALL_TRAMPOLINE, IN_SOLIB_RETURN_TRAMPOLINE)
+	(ELF_MAKE_MSYMBOL_SPECIAL, COFF_MAKE_MSYMBOL_SPECIAL)
+	(NAME_OF_MALLOC, CANNOT_STEP_BREAKPOINT)
+	(HAVE_NONSTEPPABLE_WATCHPOINT, ADDRESS_CLASS_TYPE_FLAGS)
+	(FETCH_POINTER_ARGUMENT): Replace the macro name with "=".
+
+2004-06-21  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbarch.sh: For gdbarch_dump, print the "function" rather than
+	macro name, and the function rather than macro value.  Only wrap
+	macro print statements in #ifdef.  Move format logic to where it
+	is needed.
+	* gdbarch.c: Re-generate.
+	
+	* gdbarch.sh (read): Delete "print_p" and "description", add
+	"garbage_at_eol".  Check for non-empty garbage at end-of-line.
+	Delete references to print_p.
+	(TARGET_ARCHITECTURE): Delete print predicate.
+	* gdbarch.c: Re-generate.
+	
+	* gdbarch.sh: Check that multi-arch methods do not provide a
+	macro.
+	(register_type, unwind_dummy_id, push_dummy_call, push_dummy_code)
+	(print_registers_info, print_float_info, print_vector_info)
+	(adjust_breakpoint_address, remote_translate_xfer_address)
+	(construct_inferior_arguments, skip_solib_resolver, unwind_pc)
+	(address_class_type_flags_to_name, unwind_sp): Remove the macro
+	name from the multi-arch definition.
+	
+2004-06-20  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbarch.sh: Sort by the function, instead of macro name.
+	* gdbarch.c: Re-generate.
+	
+2004-06-20  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbarch.sh: Use the function, instead of macro name in
+	errors and the log file.
+	(return_value): Remove stray ":" in spec.
+
+	* gdbarch.sh (RETURN_VALUE): Default to legacy_return_value.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* Makefile.in (arch-utils.o): Update dependencies.
+	* values.c (using_struct_return): Move code calling
+	USE_STRUCT_CONVENTION to legacy_return_value, simplify.
+	* stack.c (return_command): Move code calling STORE_RETURN_VALUE
+	to legacy_return_value, simplify.
+	* infcmd.c (print_return_value): Move code calling
+	DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS and EXTRACT_RETURN_VALUE
+	to legacy_return_value, simplify.
+	* infcall.c (call_function_by_hand): Move code calling
+	EXTRACT_RETURN_VALUE to legacy_return_value, simplify.
+	* arch-utils.c: Update copyright.  Include "gdbcore.h".
+	(legacy_return_value): New function.
+	* arch-utils.h: Update copyright.
+	(legacy_return_value): Declare.
+	
+2004-06-20  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbarch.sh (DEPRECATED_USE_STRUCT_CONVENTION): Deprecated.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* values.c (using_struct_return): Update call.
+	* mcore-tdep.c: Update comment.
+	* infcall.c (call_function_by_hand): Update comment.
+	* xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
+	* arch-utils.h (always_use_struct_convention): Update.
+	* v850-tdep.c (v850_gdbarch_init): Update.
+	* sh64-tdep.c (sh64_gdbarch_init): Update.
+	* sh-tdep.c (sh_gdbarch_init): Update.
+	* rs6000-tdep.c (rs6000_gdbarch_init): Update.
+	* mips-tdep.c (mips_gdbarch_init): Update.
+	* mcore-tdep.c (mcore_gdbarch_init): Update.
+	* m32r-tdep.c (m32r_gdbarch_init): Update.
+	* ia64-tdep.c (ia64_gdbarch_init): Update.
+	* h8300-tdep.c (h8300_gdbarch_init): Update.
+	* frv-tdep.c (frv_gdbarch_init): Update.
+	* cris-tdep.c (cris_gdbarch_init): Update.
+	* arm-tdep.c (arm_gdbarch_init): Update.
+	* alpha-tdep.c (alpha_gdbarch_init): Update.
+
+2004-06-18  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* PROBLEMS: Add more specific information, and a work-around,
+	for PR gdb/1458.
+
+2004-06-18  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbarch.sh (DEPRECATED_FUNCTION_START_OFFSET): Deprecated.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* ada-lang.c (ada_finish_decode_line_1): Update.
+	* infrun.c (handle_inferior_event): Update.
+	* infcall.c (find_function_addr): Update.
+	* linespec.c (minsym_found): Update.
+	* symtab.c (find_function_start_sal, skip_prologue_using_sal):
+	Update.
+	* blockframe.c (legacy_frameless_look_for_prologue): Update.
+	* cli/cli-cmds.c (disassemble_command): Update.
+	* vax-tdep.c (vax_gdbarch_init): Update.
+
+2004-06-18  Mark Kettenis  <kettenis@gnu.org>
+
+	* i386-tdep.c (i386_collect_fpregset): Fix comment.
+
+2004-06-17  Andrew Cagney  <cagney@gnu.org>
+
+	GDB 6.1.1 released from the GDB 6.1 branch.
+	* NEWS: Merge in 6.1.1 NEWS from 6.1 branch.
+	* PROBLEMS: Ditto.
+
+2004-06-16  Daniel Jacobowitz  <dan@debian.org>
+
+	PR gdb/1658
+	* dwarf2read.c (dwarf_decode_lines): Read the length of the extended
+	operation as a uleb128.  Found by Michael Coulter.
+
+2004-06-16  Paul N. Hilfinger  <Hilfinger@gnat.com>
+	
+	* ada-tasks.c: Rename build_task_list to ada_build_task_list, and
+	make it non-static.
+	* ada-lang.h (task_control_block): declaration moved from ada-task.c
+	to ada-lang.h; this is needed to be able to implement the kill command
+	in multi-task mode.
+	(task_ptid): Ditto.
+	(task_entry): Ditto.
+	(task_list): Ditto.
+	(ada_build_task_list): Ditto.
+	
+	* ada-lang.c: Conditionalize routines and data structures related 
+	to breakpoints, exceptions, completion, and symbol caching on 
+	GNAT_GDB, since these are not yet used in the submitted public sources.
+	(ada_main_name): Editorial: Move definition out of exception-related 
+	code.
+
+2004-06-15  Andrew Cagney  <cagney@gnu.org>
+
+	* mips-tdep.c (non_heuristic_proc_desc): Delete call to
+	deprecated_pc_in_call_dummy.
+
+2004-06-15  Alan Modra  <amodra@bigpond.net.au>
+
+	* dsrec.c (load_srec, make_srec): Use bfd_get_section_size instead of
+	bfd_get_section_size_before_reloc or _raw_size.
+	* dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
+	* dwarf2read.c (dwarf2_locate_sections): Likewise.
+	(dwarf2_read_section): Likewise.
+	* elfread.c (elf_locate_sections): Likewise.
+	* gcore.c (derive_heap_segment): Likewise.
+	* mipsread.c (read_alphacoff_dynamic_symtab): Likewise.
+	* remote-e7000.c (e7000_load): Likewise.
+	* remote-m32r-sdi.c (m32r_load): Likewise.
+	* remote-mips.c (mips_load_srec): Likewise.
+	(pmon_load_fast): Likewise.
+	* remote.c (compare_sections_command): Likewise.
+	* symfile.c (add_section_size_callback): Likewise.
+	(load_section_callback): Likewise.
+	(pc_in_unmapped_range): Likewise.
+	(pc_in_mapped_range): Likewise.
+	(sections_overlap): Likewise.
+	(list_overlays_command): Likewise.
+	(simple_overlay_update_1): Likewise.
+	(simple_overlay_update): Likewise.
+	* tracepoint.c (remote_set_transparent_ranges): Likewise.
+	* win32-nat.c (core_section_load_dll_symbols): Likewise.
+
+2004-06-14  Randolph Chung  <tausq@debian.org>
+
+	* Makefile.in (hppa-hpux-tdep.o): Update dependency.
+	* hppa-hpux-tdep.c (hp_cxx_exception_support_initialized): Make 
+	static.
+	(hppa_hpux_inferior_created): New function.
+	(hppa_hpux_init_abi): Register observer.
+	* symfile.c (hp_cxx_exception_support_initialized)
+	(RESET_HP_UX_GLOBALS): Remove HPUXHPPA specific hacks.
+	(symbol_file_add_main_1, symbol_file_clear): Likewise.
+
+2004-06-14  Randolph Chung  <tausq@debian.org>
+
+	* MAINTAINERS (Write After Approval): Alphabetize my entry
+	correctly.
+
+2004-06-14  Andrew Cagney  <cagney@gnu.org>
+
+	* MAINTAINERS (testsuite): List Michael Chastain as the lead
+	testsuite maintainer.
+
+2004-06-13  Andrew Cagney  <cagney@gnu.org>
+
+	* infcmd.c (print_return_value): Fix logic, allow
+	DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS when struct_return.
+
+	* gdbarch.sh: For predicates, do not check GDB_MULTI_ARCH when
+	defining any macros.
+	* gdbarch.h: Re-generate.
+
+	* gdbarch.sh: Delete "level" attribute.  Only check for a macro
+	redefinition when multi-arch greater than GDB_MULTI_ARCH_PARTIAL.
+	* gdbarch.h: Re-generate.
+
+	* values.c (generic_use_struct_convention): Don't check gcc_p.
+
+	* gdbarch.sh (DEPRECATED_MAX_REGISTER_RAW_SIZE)
+	(DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE): Delete.
+	* gdbarch.h, gdbarch.c: Regenerate.
+	* ns32k-tdep.h (NS32K_MAX_REGISTER_RAW_SIZE) 
+	(NS32K_MAX_REGISTER_VIRTUAL_SIZE): Delete macros.
+	* xstormy16-tdep.c (xstormy16_gdbarch_init): Do not set
+	deprecated_max_register_raw_size and
+	deprecated_max_register_virtual_size.
+	* v850-tdep.c (v850_gdbarch_init): Ditto.
+	* ns32k-tdep.c (ns32k_gdbarch_init): Ditto.
+	* mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
+	* mcore-tdep.c (mcore_gdbarch_init): Ditto.
+	* cris-tdep.c (cris_gdbarch_init): Ditto.
+
+	* gdbarch.sh (RETURN_VALUE_ON_STACK): Delete method.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* m68hc11-tdep.c (m68hc11_return_value_on_stack): Delete function.
+	(m68hc11_use_struct_convention): Delete function.
+	(m68hc11_extract_struct_value_address): Delete function.
+	(m68hc11_return_value): New function.
+	(m68hc11_gdbarch_init): Instead of store_return_value,
+	extract_return_value, return_value_on_stack,
+	deprecated_extract_struct_value_address and use_struct_convention,
+	set return_value.
+	* values.c (using_struct_return): Do not call
+	RETURN_VALUE_ON_STACK.
+	* arch-utils.h (generic_return_value_on_stack_not): Delete
+	declaration.
+	* arch-utils.c (generic_return_value_on_stack_not): Delete
+	function.
+	
+2004-06-12  Andrew Cagney  <cagney@gnu.org>
+
+	* values.c (register_value_being_returned): Delete function.
+	* infcmd.c (legacy_return_value): Delete function.
+	* infcall.c (call_function_by_hand): Inline
+	"register_value_being_returned", simplify.
+	* values.c (using_struct_return): Update comment, refer to
+	print_return_value instead of register_value_being_returned.
+	* infcmd.c (print_return_value): Inline calls to
+	register_value_being_returned and legacy_return_value.  Simplify.
+
+2004-06-11  Randolph Chung  <tausq@debian.org>
+
+	* somread.c (som_symtab_read): Exclude gcc local symbols.
+
+2004-06-11  Randolph Chung  <tausq@debian.org>
+
+	* infrun.c (handle_inferior_event): Handle the case when a
+	trampoline ends up in the runtime resolver, and if the trampoline
+	has no name.  Rearrange the code so that all the trampoline
+	processing happens before other step-out-of-range handling.
+
+2004-06-11  Martin Hunt  <hunt@redhat.com>
+
+	* mips-tdep.c (mips_gdbarch_init): Recognize vr4120
+	has no fpu.
+
+2004-06-10  Andrew Cagney  <cagney@gnu.org>
+
+	* blockframe.c (legacy_inside_entry_func): Delete.
+	(legacy_frame_chain_valid): Inline call to
+	legacy_inside_entry_func, simplify.
+
+2004-06-10  Bob Rossi  <bob@brasko.net>
+
+	* dbxread.c (read_dbx_symtab): Set pst->dirname when known.
+	* dwarf2read.c (partial_die_info): Add dirname field.
+	(dwarf2_build_psymtabs_hard): Set pst->dirname when known.
+	(read_partial_die): Save away DW_AT_comp_dir.
+	* defs.h (symtab_to_filename): Removed.
+	* source.c (find_and_open_source): Added.
+	(open_source_file): Just calls find_and_open_source.
+	(symtab_to_filename): Removed.
+	(symtab_to_fullname, psymtab_to_fullname): Added.
+	* source.h (psymtab_to_fullname,symtab_to_fullname): Added.
+	* symtab.c (lookup_symtab): Call symtab_to_fullname instead of
+	symtab_to_filename.
+	* symtab.h (partial_symtab): Add dirname field.
+	* mi/mi-cmd-file.c (FILENAME,FULLNAME): Added.
+	(mi_cmd_file_list_exec_source_file): Call new function
+	symtab_to_fullname to find fullname.
+	(mi_cmd_file_list_exec_source_files): Added.
+	* mi/mi-cmds.c (mi_cmd_mi_cmds): Add -file-list-exec-source-files.
+	* mi/mi-cmds.h (mi_cmd_file_list_exec_source_files): Added.
+
+2004-06-10  Andrew Cagney  <cagney@gnu.org>
+
+	* avr-tdep.c (avr_gdbarch_init): Do not set use_struct_convention
+	to generic_use_struct_convention, the default value.
+
+	* mn10300-tdep.c (mn10300_type_align): Call internal_error instead
+	of abort.
+
+	* ns32k-tdep.c (ns32k_push_arguments): New function.
+	(ns32k_gdbarch_init): Set deprecated_push_arguments.
+	* infcall.c (call_function_by_hand): Call error instead of
+	legacy_push_arguments.
+	* value.h (legacy_push_arguments): Delete declaration.
+	* valops.c (legacy_push_arguments): Delete function.
+	(value_push): Delete function.
+
+2004-06-10  Brian Ford  <ford@vss.fsi.com>
+
+	* coffread.c (coff_symfile_read): Prevent mixed debugging formats
+	from corrupting/reinitializing the psymtab.  Support DWARF 2 frame
+	info.
+	* dbxread.c (elfstab_build_psymtabs): Remove bogus comment.
+
+2004-06-10  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbarch.sh (DEPRECATED_PC_IN_CALL_DUMMY): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* frame.h (deprecated_pc_in_call_dummy): Delete "sp" and "fp"
+	parameters.
+	* dummy-frame.c (deprecated_pc_in_call_dummy): Update.
+	* arm-tdep.c (arm_pc_is_thumb_dummy): Call
+	deprecated_pc_in_call_dummy instead of
+	DEPRECATED_PC_IN_CALL_DUMMY.
+	(arm_skip_prologue): Ditto.
+	* xstormy16-tdep.c (xstormy16_pop_frame, xstormy16_scan_prologue)
+	(xstormy16_frame_saved_pc, xstormy16_frame_chain): Ditto.
+	* v850-tdep.c (v850_find_callers_reg, v850_frame_chain)
+	(v850_pop_frame, v850_frame_saved_pc, v850_frame_init_saved_regs):
+	Ditto.
+	* sh64-tdep.c (sh64_frame_chain, sh64_get_saved_pr) 
+	(sh64_init_extra_frame_info, sh64_get_saved_register) 
+	(sh64_pop_frame): Ditto.
+	* mips-tdep.c (non_heuristic_proc_desc): Ditto.
+	* mcore-tdep.c (mcore_find_callers_reg, mcore_frame_saved_pc) 
+	(mcore_pop_frame, mcore_init_extra_frame_info): Ditto.
+	* h8300-tdep.c (h8300_frame_chain, h8300_frame_saved_pc) 
+	(h8300_pop_frame): Ditto.
+	* blockframe.c (legacy_inside_entry_func) 
+	(legacy_frame_chain_valid): Ditto.
+	* frame.c (frame_type_from_pc, legacy_get_prev_frame): Update call
+	to deprecated_pc_in_call_dummy.
+	
+2004-06-09  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbarch.sh (REGISTER_TO_VALUE, VALUE_TO_REGISTER): Do not
+	provide a default value.
+	(CONVERT_REGISTER_P): Default to generic_convert_register_p.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* arch-utils.c (generic_convert_register_p): Rename
+	legacy_convert_register_p
+	(legacy_register_to_value, legacy_value_to_register): Delete
+	functions.
+	* arch-utils.h (generic_convert_register_p): Rename
+	legacy_convert_register_p.
+	(legacy_register_to_value, legacy_value_to_register): Delete
+	declarations.
+
+	* gdbarch.sh (DEPRECATED_REGISTER_CONVERT_TO_RAW)
+	(DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL)
+	(DEPRECATED_REGISTER_CONVERTIBLE): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* infcmd.c (default_print_registers_info): Simplify.
+	* findvar.c (value_of_register): Simplify.
+	* mi/mi-main.c (get_register): Simplify.
+	* arch-utils.c (legacy_convert_register_p): Always return 0.
+	(legacy_register_to_value, legacy_value_to_register): Always call
+	internal_error.
+
+	* infptrace.c (child_xfer_memory) [CLEAR_INSN_CACHE]: Delete
+	#ifdef CLEAR_INSN_CACHE code.
+	* target.c (generic_mourn_inferior) [CLEAR_DEFERRED_STORES]:
+	Delete #ifdef CLEAR_DEFERRED_STORES code.
+
+	* solib-svr4.c [HANDLE_SVR4_EXEC_EMULATORS]: Delete #ifdef code.
+
+	* config/ia64/tm-linux.h (TARGET_ELF64): Delete macro, Update
+	copyright.
+	* config/ia64/tm-aix.h (TARGET_ELF64): Ditto.
+
+	* config/mips/mipsv4.mh: Delete file.
+
+	* config/pa/tm-hppa64.h (HPREAD_ADJUST_STACK_ADDRESS): Delete
+	unreferenced macro.
+	(hpread_adjust_stack_address): Delete declaration.
+
+2004-06-08  Andrew Cagney  <cagney@gnu.org>
+
+	* infptrace.c [ATTACH_DETACH]: Remove #ifdef wrappers.
+	(attach, detach): When neither PT_ATTACH / PT_DETACH nor
+	PTRACE_ATTACH / PTRACE_DETACH available call error.
+	(PT_ATTACH, PT_DETACH): Move definition to attach / detach.
+	* infttrace.c (update_thread_state_after_attach, attach, detach):
+	Remove #ifdef wrappers.
+	* inftarg.c (child_attach, child_detach): Remove #ifdef wrappers.
+	* gnu-nat.c [ATTACH_DETACH]: Remove #ifdef wrappers.
+	* config/nm-bsd.h (ATTACH_DETACH): Delete.
+	* config/nm-sysv4.h (ATTACH_DETACH): Delete.
+	* config/nm-nbsd.h (ATTACH_DETACH): Delete.
+	* config/nm-linux.h (ATTACH_DETACH): Delete.
+	* config/rs6000/nm-rs6000.h (ATTACH_DETACH): Delete.
+	* config/pa/nm-hppah.h (ATTACH_DETACH): Delete.
+	* config/i386/nm-i386sco5.h (ATTACH_DETACH): Delete.
+	* config/i386/nm-i386sco4.h (ATTACH_DETACH): Delete.
+	* config/i386/nm-i386gnu.h (ATTACH_DETACH): Delete.
+
+2004-06-08  Corinna Vinschen  <vinschen@redhat.com>
+
+	* configure.in: Set $configdir to the right OS specific value.
+	Use value when setting $tcldir and $tkdir.
+	* configure: Regenerate.
+
+2004-06-06  Paul Brook  <paul@codesourcery.com>
+
+	* gdb/dwarf2-frame.c (decode_frame_entry_1): Decode version 3 CIE
+	records.
+
+2004-06-08  Paul N. Hilfinger  <Hilfinger@gnat.com>
+
+	* ada-lang.c (lookup_symbol_in_language): New function to allow
+	re-use of another language's symbol lookup code.  (Placed here
+	temporarily while Ada support is being integrated into the public
+	tree).  
+	(restore_language): New auxiliary function for 
+	lookup_symbol_in_language.
+	* ada-lang.h (lookup_symbol_in_language): Declare (Placed here
+	temporarily while Ada support is being integrated into the public
+	tree).
+	
+2004-06-08  Alexandre Oliva  <aoliva@redhat.com>
+
+	* Makefile.in (check//%): New.
+
+	* mn10300-tdep.c (mn10300_extract_return_value): Rewrite.
+	(mn10300_store_return_value): Rewrite.
+	(mn10300_type_align): New.
+	(mn10300_use_struct_convention): Rewrite.
+	(mn10300_return_value): New, using all of the above.
+	(mn10300_pop_frame_regular): Add saved_regs_size.
+	(mn10300_gdbarch_init): Remove deprecated rewritten entry points.
+
+	* mn10300-tdep.c (mn10300_analyze_prologue): Don't compute saved
+	regs if PC is on movm.
+
+2004-06-07  Jim Blandy  <jimb@redhat.com>
+
+	Add native Linux support for the PowerPC E500.
+	* ppc-tdep.h (struct gdbarch_tdep): New member: 'ppc_gprs_pseudo_p'.
+	* rs6000-tdep.c (rs6000_gdbarch_init): Initialize it to false on
+	all architectures except the E500.
+	* ppc-linux-nat.c: (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): New
+	#definitions.
+	(struct gdb_evrregset_t): New type.
+	(have_ptrace_getsetevrregs): New variable.
+	(get_spe_registers, read_spliced_spe_reg, fetch_spe_register, 
+	fetch_spe_registers): New functions.
+	(fetch_register): Call fetch_spe_register as appropriate.
+	Assert that we're only passed raw register numbers.
+	(fetch_ppc_registers): Call fetch_spe_registers as appropriate.
+	Don't fetch gprs if they're pseudoregisters.
+	(set_spe_registers, write_spliced_spe_reg, store_spe_register,
+	store_spe_registers): New functions.
+	(store_register): Call store_spe_register as appropriate.
+	Assert that we're only passed raw register numbers.
+	(store_ppc_registers): Call store_spe_registers as appropriate.
+	Don't store gprs if they're pseudoregisters.
+	
+2004-06-07  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* thread-db.c (thread_get_info_callback): Fill in the thread_info
+	struct if one exists, even if we are dealing with a zombie thread.
+
+2004-06-07  Andrew Cagney  <cagney@gnu.org>
+
+	* target.h (PC_REQUIRES_RUN_BEFORE_USE): Delete definition.
+	* config/pa/tm-hppa.h (DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE):
+	Rename PC_REQUIRES_RUN_BEFORE_USE.
+	* breakpoint.c (breakpoint_sals_to_pc): Update.  Wrap reference in
+	#ifdef.
+
+2004-06-07  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_frame_cache): Handle the cases when we start
+	unwinding after sp has been saved to the stack but before the end
+	of the prologue, and after the fp has been modified but before it has
+	been saved to the stack.
+	(hppa_frame_base_address, hppa_frame_base, hppa_frame_base_sniffer): 
+	Remove superfluous definitions.
+	(hppa_gdbarch_init): Remove superfluous frame base sniffer.
+
+2004-06-07  Guy Martin  <gmsoft@gentoo.org>
+
+	Committed by Randolph Chung.
+	* hppa-linux-nat.c: Include the correct version of the header file
+	depending on the kernel version.
+
+2004-06-06  Randolph Chung  <tausq@debian.org>
+
+	* infrun.c (trap_expected_after_continue): Remove HP_OS_BUG workaround.
+	(proceed, init_wait_for_inferior, handle_inferior_event): Likewise.
+
+2004-06-06  Randolph Chung  <tausq@debian.org>
+
+	* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline) 
+	(hppa_hpux_skip_trampoline_code): Don't cache symbol values.
+	* hppa-linux-tdep.c (hppa_linux_in_dyncall): Likewise.
+	* hppa-tdep.c (hppa_symbol_address): New function definition.
+	* hppa-tdep.h (hppa_symbol_address): New function declaration.
+
+2004-06-06  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.h (struct value): Forward declaration.
+	(gdbarch_tdep): Define tdep find_global_pointer method.
+	* hppa-tdep.c (hppa32_push_dummy_call): Find the global pointer
+	associated with the function we are trying to call, and write it
+	to the gp register.
+	(hppa32_convert_from_funct_ptr_addr): New function.
+	(hppa_find_global_pointer): New function.
+	(hppa_gdbarch_init): Set default find_global_pointer method; set
+	convert_from_func_ptr_addr method.
+	* hppa-linux-tdep.c (hppa_linux_find_global_pointer): New function.
+	(hppa_linux_init_abi): Set find_global_pointer method.
+	* Makefile.in (hppa-linux-tdep.o): Add value.h dependency.
+
+2004-06-06  Randolph Chung  <tausq@debian.org>
+
+	* gdbarch.sh (PUSH_DUMMY_CALL): Change CORE_ADDR func_addr argument
+	to struct value *function.
+	* gdbarch.c: Regenerate.
+	* gdbarch.h: Likewise.
+	* infcall.c (call_function_by_hand): Pass entire function value
+	to push_dummy_call.
+
+	* Makefile.in (alpha-tdep.o, frv-tdep.o, ia64-tdep.o, mips-tdep.o)
+	(ppc-sysv-tdep.o, rs6000-tdep.o): Update dependencies.
+	* alpha-tdep.c (alpha_push_dummy_call): Update call signature.
+	* amd64-tdep.c (amd64_push_dummy_call): Likewise.
+	* arm-tdep.c (arm_push_dummy_call): Likewise.
+	* avr-tdep.c (avr_push_dummy_call): Likewise.
+	* cris-tdep.c (cris_push_dummy_call): Likewise.
+	* d10v-tdep.c (d10v_push_dummy_call): Likewise.
+	* frv-tdep.c (frv_push_dummy_call): Likewise.
+	* h8300-tdep.c (h8300_push_dummy_call): Likewise.
+	* hppa-tdep.c (hppa32_push_dummy_call)
+	(hppa64_push_dummy_call): Likewise.
+	* i386-tdep.c (i386_push_dummy_call): Likewise.
+	* ia64-tdep.c (ia64_push_dummy_call): Likewise.
+	* m32r-tdep.c (m32r_push_dummy_call): Likewise.
+	* m68hc11-tdep.c (m68hc11_push_dummy_call): Likewise.
+	* m68k-tdep.c (m68k_push_dummy_call): Likewise.
+	* m88k-tdep.c (m88k_push_dummy_call): Likewise.
+	* mips-tdep.c (mips_eabi_push_dummy_call, mips_n32n64_push_dummy_call)
+	(mips_o32_push_dummy_call, mips_o64_push_dummy_call): Likewise.
+	* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call)
+	(ppc64_sysv_abi_push_dummy_call): Likewise.
+	* ppc-tdep.h (ppc_sysv_abi_push_dummy_call)
+	(ppc64_sysv_abi_push_dummy_call): Likewise.
+	* rs6000-tdep.c (rs6000_push_dummy_call): Likewise.
+	* s390-tdep.c (s390_push_dummy_call): Likewise.
+	* sh-tdep.c (sh_push_dummy_call_fpu)
+	(sh_push_dummy_call_nofpu): Likewise.
+	* sparc-tdep.c (sparc32_push_dummy_call): Likewise.
+	* sparc64-tdep.c (sparc64_push_dummy_call): Likewise.
+	* vax-tdep.c (vax_push_dummy_call): Likewise.
+
+2004-06-04  Jim Blandy  <jimb@redhat.com>
+
+	* ppc-linux-nat.c (fetch_register): Don't forget to pass the
+	gdbarch argument to register_size.
+
+	* rs6000-tdep.c (rs6000_store_return_value): Use
+	regcache_cooked_write_part instead of
+	deprecated_write_register_bytes.
+	(rs6000_gdbarch_init): Register it for gdbarch_store_return_value,
+	not gdbarch_deprecated_store_return_value.
+
+	* ppc-linux-nat.c (store_register, fetch_register): Remove
+	incorrect assertions.  Simplify and generalize handling of
+	transfers whose sizes are not multiples of, or less than, sizeof
+	(PTRACE_XFER_TYPE).
+
+2004-06-04  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* infrun.c (handle_inferior_event): Don't treat an invalid ptid
+	as a new thread event.
+	* thread-db.c (thread_get_info_callback): If the thread is a
+	zombie, return TD_THR_ZOMBIE.
+	(thread_from_lwp): If thread_get_info_callback returns
+	TD_THR_ZOMBIE, check if the thread is still on the thread list
+	and return a -1 ptid if not found.
+	(thread_db_wait): If thread_from_lwp returns a -1 ptid, then
+	change the status to TARGET_WAITKIND_SPURIOUS.
+
+2004-06-03  Corinna Vinschen  <vinschen@redhat.com>
+
+	* sh-tdep.c (sh3e_sh4_store_return_value): Correctly store
+	double values in little endian mode.
+
+2004-06-02  Albert Chin-A-Young  <china@thewrittenword.com>
+
+	Committed by Andrew Cagney.
+	* gdb/dictionary.c, gdb/gdbtypes.h: Remove trailing comma
+	after last enum constant to avoid error from IBM C
+	compiler.
+
+2004-06-02  Jim Blandy  <jimb@redhat.com>
+
+	* ppc-linux-nat.c (store_register, fetch_register): Rename 'mess'
+	to 'message', and make it local to the lone block that uses it.
+
+	* ppc-linux-nat.c (store_register): Remove unused local 'offset'.
+
+2004-06-02  Paul N. Hilfinger  <hilfinger@gnat.com>
+
+	* ada-exp.y: Synchronize with current ACT sources.
+	* ada-lang.c: Ditto.
+	* ada-lang.h: Ditto.
+	* ada-lex.l: Ditto.
+	* ada-tasks.c: Ditto.
+	* ada-typeprint.c: Ditto.
+	* ada-valprint.c: Ditto.
+	
+2004-06-01  Jim Blandy  <jimb@redhat.com>
+
+	* ppc-tdep.h: Delete unused 'regoff' member.
+	* rs6000-tdep.c (rs6000_gdbarch_init): Don't initialize it.
+
+2004-06-01  Michael Chastain  <mec.gnu@mindspring.com>
+
+	Fix PR symtab/1661.
+	* hpread.c (hpread_pxdb_needed): Call memset after alloca.
+	(hpread_read_struct_type): Likewise.
+
+2004-06-01  Andrew Cagney  <cagney@gnu.org>
+
+	* mi/mi-cmd-env.c (env_execute_cli_command): Use xstrprintf
+	instead of xasprintf.
+	* mi/mi-main.c (mi_error_last_message, mi_cmd_exec_interrupt) 
+	(mi_cmd_thread_select, mi_cmd_thread_list_ids) 
+	(mi_cmd_data_list_register_names) 
+	(mi_cmd_data_list_changed_registers) 
+	(mi_cmd_data_list_register_values) 
+	(get_register, mi_cmd_data_write_register_values) 
+	(mi_cmd_data_write_register_values) 
+	(mi_cmd_data_assign, mi_cmd_data_evaluate_expression) 
+	(mi_cmd_target_download, mi_cmd_target_select) 
+	(mi_cmd_data_read_memory, mi_cmd_data_write_memory) 
+	(mi_execute_cli_command, mi_execute_async_cli_command) 
+	(mi_execute_async_cli_command): Ditto.
+	* mi/mi-interp.c (mi_cmd_interpreter_exec) Ditto.
+	* mi/mi-cmd-var.c (mi_cmd_var_create): Ditto.
+
+	* mi/mi-cmds.h (mi_error_last_message): Delete declaration.
+	* mi/mi-interp.c (mi_cmd_interpreter_exec): Call
+	error_last_message instead of mi_error_last_message.
+	* mi/mi-main.c (mi_error_last_message): Delete function.
+
+	* mi/mi-main.c (mi_cmd_data_read_memory): Add missing return for
+	"invalid number of columns" error.  Delete redundant "out of
+	memory" check.
+
+2004-05-31  Mark Kettenis  <kettenis@gnu.org>
+
+	* i386bsd-nat.c: Don't include <sys/procfs.h>.
+	(gregset_t, fpregset_t): Remove typedefs.
+	(CANNOT_FETCH_REGISTER, CANNOT_STORE_REGISTER): Remove macros.
+	(REG_OFFSET): Rename argument.
+	(i386bsd_r_reg_offset): Rename from reg_offset.
+	(REG_ADDR): Remove macro.
+	(cannot_fetch_register, supply_gregset, fill_gregset): Remove
+	functions.
+	(i386bsd_supply_gregset, i386bsd_collect_gregset): New functions.
+	(fetch_inferior_registers): Use `struct reg' and `struct fpreg'
+	instead of gregset_t and fpregset_t.  Use i386bsd_supply_gregset
+	instead of supply_gregset.
+	(store_inferior_registers): Use `struct reg' and `struct fpreg'
+	instead of gregset_t and fpregset_t.  Use i386bsd_collect_gregset
+	instead of fill_gregset.
+	(register_u_addr): Use i386_r_reg_offset instead of REG_ADDR.
+
+	* i386bsd-nat.c: Don't include "gregset.h".
+	(supply_gregset, fill_gregset): Make static.
+	(supply_fpregset, fill_fpregset): Remove.
+	* Makefile.in (i386bsd-nat.o): Update dependencies.
+
+2004-05-30  Mark Kettenis  <kettenis@gnu.org>
+
+	* fbsd-proc.c: Include "regcache.h", "regset.h" and
+	"gdb_assert.h".  Con't include "gregset.h".
+	(fbsd_make_corefile_notes): Use regset-based core file support
+	instead off fill_gregset and fill_fpregset.
+	* Makefile.in (fbsd-proc.o): Update dependencies.
+
+	* m88k-tdep.c (m88k_analyze_prologue): Fix handling of branch
+	instructions.
+	(m88k_frame_prev_register): Simplify code a bit.
+
+	* amd64-tdep.c (amd64_supply_fpregset): Adjust comment.
+	(amd64_collect_fpregset): New function.
+	(amd64_regset_from_core_section): Use amd64_collect_fpregset.
+
+	* hppa-tdep.h (hppa_regnum): Add HPPA_R31_REGNUM.
+
+	* i386-tdep.c (i386_supply_gregset): Adjust comment.
+	(i386_collect_gregset): New function.
+	(i386_supply_fpregset): Adjust comment.
+	(i386_collect_fpregset): New function.
+	(i386_regset_from_core_section): Use i386_collect_gregset and
+	i386_collect_fpregset.
+
+	* hppa-tdep.c (hppa_frame_prev_register_helper): Reimplement to
+	handle VALUEP being null.
+
+	* regset.h (collect_regset_ftype): Unconstify fourth argument.
+
+2004-05-29  Mark Kettenis  <kettenis@gnu.org>
+
+	* MAINTAINERS: Undelete m88k.  Add myself as maintainer.
+
+	* amd64obsd-tdep.c (amd64obsd_sigtramp_p): Adjust for new
+	assembler in OpenBSD 3.5-current.
+	(amd64obsd_sigcontext_addr): Likewise.
+
+2004-05-28  Jim Blandy  <jimb@redhat.com>
+
+	* rs6000-tdep.c: Use the modern gdbarch methods for handling the
+	register set, so our regcache isn't declared "legacy" and our E500
+	pseudoregister read and write functions aren't ignored.
+	(rs6000_register_byte, rs6000_register_raw_size,
+	rs6000_register_virtual_type, rs6000_register_convertible,
+	rs6000_register_convert_to_virtual,
+	rs6000_register_convert_to_raw): Deleted.
+	(rs6000_register_type, rs6000_convert_register_p,
+	rs6000_register_to_value, rs6000_value_to_register): New
+	functions.
+	(rs6000_gdbarch_init): Don't register
+	gdbarch_deprecated_register_size,
+	gdbarch_deprecated_register_bytes,
+	gdbarch_deprecated_register_byte,
+	gdbarch_deprecated_register_raw_size,
+	gdbarch_deprecated_register_virtual_type,
+	gdbarch_deprecated_register_convertible,
+	gdbarch_deprecated_register_convert_to_virtual, or
+	gdbarch_deprecated_register_convert_to_raw methods.  Instead,
+	register gdbarch_register_type, gdbarch_convert_register_p,
+	gdbarch_register_to_value, and gdbarch_value_to_register methods.
+
+2004-05-26  Jim Blandy  <jimb@redhat.com>
+
+	* rs6000-tdep.c (rs6000_dwarf2_stab_reg_to_regnum): Deleted.
+        (rs6000_stab_reg_to_regnum, rs6000_dwarf2_reg_to_regnum): New
+	functions, updated to match the register numberings used in GCC.
+	(rs6000_gdbarch_init): Register rs6000_stab_reg_to_regnum and
+	rs6000_dwarf2_reg_to_regnum as register number conversions
+	functions for STABS and Dwarf2.
+
+2004-05-26  Randolph Chung  <tausq@debian.org>
+
+	* infttrace.h (target_waitkind): Forward declare type instead of pulling
+	in header file.
+
+2004-05-25  Joel Brobecker  <brobecker@gnat.com>
+
+	* NEWS: Document new "start" command.
+
+2004-05-25  Randolph Chung  <tausq@debian.org>
+
+	* hppa-linux-tdep.c (hppa_linux_init_abi): sizeof(long double) == 8 on
+	hppa-linux.
+
+2004-05-25  Randolph Chung  <tausq@debian.org>
+
+	* hppa-hpux-tdep.c (offsetof): Define.
+	(hppa_hpux_pc_in_sigtramp, hppa32_hpux_frame_saved_pc_in_sigtramp)
+	(hppa32_hpux_frame_base_before_sigtramp)
+	(hppa32_hpux_frame_find_saved_regs_in_sigtramp)
+	(hppa64_hpux_frame_saved_pc_in_sigtramp)
+	(hppa64_hpux_frame_base_before_sigtramp)
+	(hppa64_hpux_frame_find_saved_regs_in_sigtramp): Remove unused 
+	functions.
+	(struct hppa_hpux_sigtramp_unwind_cache, hppa_hpux_tramp_reg)
+	(hppa_hpux_sigtramp_frame_unwind_cache)
+	(hppa_hpux_sigtramp_frame_this_id)
+	(hppa_hpux_sigtramp_frame_prev_register)
+	(hppa_hpux_sigtramp_frame_unwind)
+	(hppa_hpux_sigtramp_unwind_sniffer): New signal trampoline unwinder.
+	(hppa_hpux_init_abi): Register sigtramp unwinder.
+	* Makefile.in (hppa-hpux-tdep.o): Update dependencies.
+
+2004-05-25  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_fallback_frame_cache): Handle stack adjustment,
+	and multiple stack unwinds.
+	(hppa_stub_unwind_sniffer): Handle unwind from pc == 0.
+
+2004-05-25  Andrew Cagney  <cagney@gnu.org>
+
+	* symfile.h (symbol_file_add_from_memory): Delete declaration.
+	* symfile-mem.h: Delete file.
+	* symfile-mem.c: Do not include "symfile-mem.h".
+	(symbol_file_add_from_memory): Make static. Use "struct bfd" and
+	"struct bfd_section".  When an error do not bother returning NULL.
+	(add_symbol_file_from_memory_command): Use "struct bfd" and
+	"struct bfd_section".
+	* Makefile.in (symfile_mem_h): Delete.
+	(symfile-mem.o): Update dependencies.
+
+2004-05-25  Nick Roberts  <nickrob@gnu.org>
+
+	* gdb-mi.el: New file.
+
+2004-05-25  Andrew Cagney  <cagney@gnu.org>
+
+	* inftarg.c: Include "observer.h".
+	(child_attach, child_create_inferior): Notify inferior_created.
+	* corelow.c: Include "observer.h".
+	(core_open): Notify inferior_created.
+	* Makefile.in (inftarg.o, corelow.o): Update dependencies.
+
+2004-05-25  Andrew Cagney  <cagney@gnu.org>
+
+	* target.h (struct target_ops): Add from_tty to
+	to_create_inferior.
+	(target_create_inferior, find_default_create_inferior): Update.
+	* infcmd.c (run_command): Update.
+	* wince.c (child_create_inferior): Update.
+	* win32-nat.c (child_create_inferior): Update.
+	* uw-thread.c (uw_thread_create_inferior): Update.
+	* thread-db.c (thread_db_create_inferior): Update.
+	* target.c (debug_to_create_inferior) 
+	(find_default_create_inferior): Update.
+	(maybe_kill_then_create_inferior): Update.
+	* sol-thread.c (sol_thread_create_inferior): Update.
+	* remote.c (extended_remote_async_create_inferior) 
+	(extended_remote_create_inferior): Update.
+	* remote-vx.c (vx_create_inferior): Update.
+	* remote-st.c (st2000_create_inferior): Update.
+	* remote-sim.c (gdbsim_create_inferior): Update.
+	* remote-sds.c (sds_create_inferior): Update.
+	* remote-rdp.c (remote_rdp_create_inferior): Update.
+	* remote-rdi.c (arm_rdi_create_inferior): Update.
+	* remote-m32r-sdi.c (m32r_create_inferior): Update.
+	* remote-e7000.c (e7000_create_inferior): Update.
+	* procfs.c (procfs_create_inferior): Update.
+	* ocd.c (ocd_create_inferior): Update.
+	* ocd.h (ocd_create_inferior): Update.
+	* nto-procfs.c (procfs_create_inferior): Update.
+	* monitor.c (monitor_create_inferior): Update.
+	* lin-lwp.c (lin_lwp_create_inferior): Update.
+	* inftarg.c (child_create_inferior): Update.
+	* hpux-thread.c (hpux_thread_create_inferior): Update.
+	* gnu-nat.c (gnu_create_inferior): Update.
+
+2004-05-25  Andrew Cagney  <cagney@gnu.com>
+
+	* MAINTAINERS: Update e-mail address.
+
+2004-05-24  Randolph Chung  <tausq@debian.org>
+
+	* thread.c (info_threads_command, thread_apply_all_command)
+	(thread_apply_command, thread_command, do_captured_thread_select):
+	Remove HPUXHPPA-specific code.
+
+2004-05-24  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (SR4EXPORT_LDIL_OFFSET, SR4EXPORT_LDO_OFFSET): Remove
+	unused symbols.
+	* hppa-tdep.h (HPPA_INSTRUCTION_SIZE): Remove, since there are no more
+	references.
+
+2004-05-24  Joel Brobecker  <brobecker@gnat.com>
+
+	* infcmd.c (kill_if_already_running): New function, extracted
+	from run_command().
+	(run_command): Replace extracted code by call to
+	kill_if_already_running().
+	(start_command): New function.
+	(_initialize_infcmd): Add "start" command.
+
+2004-05-24  Mark Kettenis  <kettenis@gnu.org>
+
+	Add OpenBSD/m88k support.
+	* NEWS (New native configurations): Mention OpenBSD/m88k.
+	* m88k-tdep.c, m88k-tdep.h, m88kbsd-nat.c, config/m88k/nm-obsd.h,
+	config/m88k/obsd.mh, config/m88k/obsd.mt: New files.
+	* Makefile.in (m88k_tdep_h): New variable.
+	(ALLDEPFILES): Add m88k-tdep.c and m88kbsd-nat.c.
+	(m88kbsd-nat.o, m88k-tdep.o): New dependencies.
+	* configure.host: Add m88*-*-openbsd*.
+	* configure.tgt: Add m88*-*-openbsd*.
+
+2004-05-24  Jim Blandy  <jimb@redhat.com>
+
+	* MAINTAINERS (tracing bytecode stuff): Allow global maintainers
+	to approve changes.
+
+2004-05-24  Kevin Buettner  <kevinb@redhat.com>
+
+	* symtab.c (fixup_section): Search section table when lookup by
+	name fails.
+
+2004-05-24  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c: Fix handling of 8-byte structures; they should not 
+	be "small_struct".
+
+2004-05-24  Mark Kettenis  <kettenis@gnu.org>
+
+	* m68kbsd-nat.c (m68kbsd_collect_gregset): Specify correct
+	register number in regcache_raw_collect call.
+	(m68kbsd_collect_fpregset): Likewise.
+	* vaxbsd-nat.c (vaxbsd_collect_gregset): Likewise.
+
+	* regset.h (struct regset): Add back `regset' member.
+
+2004-05-23  Mark Kettenis  <kettenis@gnu.org>
+
+	* configure.in: Check for td_pcb in `struct thread'.
+	* configure, config.in: Regenerated.
+
+	* dpx2-nat.c: Remove file.
+	* Makefile.in (ALLDEPFILES): Remove dpx2-nat.c.
+	(dpx2-nat.o): Remove dependencies.
+
+	* amd64obsd-nat.c: Include "gdbcore.h", "regcache.h",
+	<sys/types.h>, <machine/frame.h>, <machine/pcb.h> and "bsd-kvm.h".
+	(amd64obsd_supply_pcb): New function.
+	(_initialize_amd64obsd_nat): Enable libkvm interface.
+	* Makefile.in (amd64obsd-nat.o): Update dependencies.
+	* config/i386/obsd64.mh (NATDEPFILES): Add bsd-kvm.o
+	(LOADLIBES): New variable.
+
+	* sparcnbsd-nat.c: Include "gdbcore.h", "regcache.h",
+	<sys/types.h>, <machine/pcb.h> and "bsd-kvm.h".
+	(sparc32nbsd_supply_pcb): New function.
+	(_initialize_sparcnbsd_nat): Enable libkvm interface.
+	* Makefile.in (sparcnbsd-nat.o): Update dependencies.
+	* config/sparc/nbsdelf.mh (NATDEPFILES): Add bsd-kvm.o.
+	(LOADLIBES): New variable.
+
+2004-05-22  Mark Kettenis  <kettenis@gnu.org>
+
+	* bsd-kvm.c, bsd-kvm.h: New files.
+	* i386fbsd-nat.c: Include <sys/types.h>, <machine/pcb.h> and
+	"bsd-kvm.h".
+	(i386fbsd_supply_pcb): New function.
+	* Makefile.in (ALLDEPFILES): Add bsd-kvm.c.
+	(i386fbsd-nat.o): Update dependencies.
+	(bsd_kvm_h): New variable.
+	(bsd-kvm.o): New dependency.
+	* config/i386/fbsd.mh (NATDEPFILES): Add bsd-kvm.o.
+	(LOADLIBES): New variable.
+
+	* regset.c: Tweak comment.
+	(regset_alloc): Remove descr argument.  Use GDBARCH_OBSTACK_ZALLOC
+	macro.
+	* regset.h: Update copyright year.
+	(struct regset): Remove `descr' member, add `gdbarch' member.
+	(regset_alloc): Adjust prototype and comment.
+	* i386-tdep.c (i386_supply_gregset): Get TDEP from REGSET->arch.
+	(i386_supply_fpregset): Likewise.
+	(i386_regset_from_core_section): Update call to regset_alloc.
+	* i386obsd-tdep.c (i386obsd_aout_supply_regset): Get TDEP from
+	REGSET->arch.
+	(i386obsd_aout_regset_from_core_section): Update call to
+	regset_alloc.
+	* i386nbsd-tdep.c (i386nbsd_aout_supply_regset): Get TDEP from
+	REGSET->arch.
+	(i386nbsd_aout_regset_from_core_section): Update call to
+	regset_alloc.
+	* amd64-tdep.c (amd64_supply_fpregset): Get TDEP from
+	REGSET->arch.
+	(amd64_regset_from_core_section): Update call to regset_alloc.
+	* amd64obsd-tdep.c (amd64obsd_supply_regset): Get TDEP from
+	REGSET->arch.
+	(amd64obsd_regset_from_core_section): Update call to regset_alloc.
+	* sparcnbsd-tdep.c (sparc32nbsd_supply_gregset): Directly pass
+	&sparc32nbsd_gregset in sparc32_supply_gregset call.
+	(sparc32nbsd_init_abi): Update call to regset_alloc.
+	* sparc64obsd-tdep.c (sparc64obsd_supply_gregset): Directly pass
+	&sparc64obsd_core_gregset in sparc64_supply_gregset call.
+	(sparc64obsd_init_abi): Update call to regset_alloc.
+	* sparc64nbsd-tdep.c (sparc64nbsd_supply_gregset): Directly pass
+	&sparc64nbsd_gregset in sparc64_supply_gregset call.
+	(sparc64nbsd_init_abi): Update call to regset_alloc.
+	* sparc64fbsd-tdep.c (sparc64fbsd_supply_gregset): Directly pass
+	&sparc64fbsd_gregset in sparc64_supply_gregset call.
+	(sparc64fbsd_init_abi): Update call to regset_alloc.
+
+2004-05-22  Jim Blandy  <jimb@redhat.com>
+
+	* ppc-tdep.h (spe_register_p): New declaration.
+	(struct gdbarch_tdep): New members: ppc_acc_regnum and
+	ppc_spefscr_regnum.
+	* rs6000-tdep.c (spe_register_p): New function.
+	(rs6000_dwarf2_stab_reg_to_regnum): Recognize numbers for acc and
+	spefscr.
+	(rs6000_gdbarch_init): Initialize the new members of the tdep
+	structure.
+
+2004-05-21  Jim Blandy  <jimb@redhat.com>
+
+	* ppc-linux-nat.c (fetch_register): Move code back to be next
+	to the comment that describes it.  (Moved code, instead of
+	comment, for symmetry with store_register.)
+
+	Allocate regset structures in the gdbarch's obstack, not using
+	xmalloc.
+	* regset.c (regset_alloc): Renamed from regset_xmalloc.
+	Add 'arch' argument.  Allocate the regset on arch's obstack, not
+	using xmalloc.
+	* regset.h (regset_alloc): Update declaration.
+	* am64-tdep.c (amd64_regset_from_core_section): Update call; pass
+	gdbarch argument.
+	* amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same.
+	* i386-tdep.c (i386_regset_from_core_section): Same.
+	* i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same.
+	* i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same.
+	* sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same.
+	* sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same.
+	* sparc64obsd-tdep.c (sparc64obsd_init_abi): Same.
+	* sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
+
+2004-05-21  Joel Brobecker  <brobecker@gnat.com>
+
+	* config/djgpp/fnchange.lst: Undo previous change, was useless.
+
+2004-05-21  Jim Blandy  <jimb@redhat.com>
+
+	* dwarf2expr.c (execute_stack_op): Add 'break' statements after
+	cases for DW_OP_div and DW_OP_shr.  (Thanks to Reva Cuthbertson.)
+
+2004-05-20  Jim Blandy  <jimb@redhat.com>
+
+	* rs6000-tdep.c (rs6000_push_dummy_call): Formatting fixes.
+
+2004-05-20  Mark Kettenis  <kettenis@gnu.org>
+
+	* regset.h: Make prototype const-correct.
+	* regset.c (regset_xmalloc): Make const-correct.
+
+2004-05-20  Paul N. Hilfinger  <hilfinger@gnat.com>
+
+	* symtab.h (SYMBOL_SEARCH_NAME): New definition.
+	(SYMBOL_MATCHES_SEARCH_NAME): New definition.
+	(symbol_search_name): Declare.
+	
+	* dictionary.c (iter_name_first_hashed): Match on SYMBOL_SEARCH_NAME.
+	(iter_name_next_hashed): Ditto.
+	(iter_name_next_linear): Ditto.
+	(insert_symbol_hashed): Hash on SYMBOL_SEARCH_NAME.
+
+	* symtab.c (lookup_partial_symbol): Assume symbols ordered by 
+	search name, using SYMBOL_SEARCH_NAME and SYMBOL_MATCHES_SEARCH_NAME.
+	(symbol_search_name): New function.
+	
+	* symfile.c (compare_psymbols): Order by SYMBOL_SEARCH_NAME.
+	
+	* minsyms.c (build_minimal_symbol_hash_tables): Change
+	test for adding to demangled hash table to check for difference
+	between SYMBOL_SEARCH_NAME and SYMBOL_LINKAGE_NAME.
+	
+2004-05-19  Jim Blandy  <jimb@redhat.com>
+
+	Use a constructor function to create regset structures.
+	* regset.h (supply_regset_ftype, collect_regset_ftype): New typedefs.
+	(struct regset): Use supply_regset_ftype.  Add new
+        'collect_regset' member.
+	(regset_xmalloc): New declaration.
+	* regset.c: New file.
+	* am64-tdep.c (amd64_regset_from_core_section): Use
+	regset_xmalloc to construct regset structures.
+	* amd64obsd-tdep.c (amd64obsd_regset_from_core_section): Same.
+	* i386-tdep.c (i386_regset_from_core_section): Same.
+	* i386nbsd-tdep.c (i386nbsd_aout_regset_from_core_section): Same.
+	* i386obsd-tdep.c (i386obsd_aout_regset_from_core_section): Same.
+	* sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Same.
+	* sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Same.
+	* sparc64obsd-tdep.c (sparc64obsd_init_abi): Same.
+	* sparcnbsd-tdep.c (sparc32nbsd_init_abi): Same.
+	* Makefile.in (COMMON_OBS): Add regset.o.
+	(regset.o): New rule.
+
+2004-05-19  Joel Brobecker  <brobecker@gnat.com>
+
+	* config/djgpp/fnchange.lst: Add entries for pthread_cond_wait.exp
+	and pthread_cond_wait.c.
+
+2004-05-18  Jim Blandy  <jimb@redhat.com>
+
+	* rs6000-tdep.c (rs6000_gdbarch_init): Initialize tdep fields
+	before the mach-specific switch, and then let the individual cases
+	override the defaults, rather than leaving them uninitialized
+	until the switch and then setting them in each case.
+
+2004-05-18  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_frame_cache): Check for validity of r31 for
+	millicode functions.
+
+2004-05-18  Randolph Chung  <tausq@debian.org>
+
+	* somsolib.c (som_solib_remove_inferior_hook): Make all the size
+	references to dld_flags_buffer consistent.
+
+2004-05-18  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_frame_cache): If a frame pointer is available, use
+	it for unwinding the stack.
+
+2004-05-18  Randolph Chung  <tausq@debian.org>
+
+	* config/pa/tm-linux.h (IN_SOLIB_CALL_TRAMPOLINE, SKIP_TRAMPOLINE_CODE)
+	Undefine these so we can overide them using gdbarch.
+
+2004-05-18  Randolph Chung <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_stub_frame_unwind_cache): Don't do export stub
+	handling for 64-bit HPUX (elf).
+
+2004-05-18  Daniel Jacobowitz  <dan@debian.org>
+
+	* alpha-tdep.c (alpha_gdbarch_init): Use LL suffix for large
+	constants.
+	* amd64-tdep.c (amd64_skip_prologue): Likewise.
+	* ia64-tdep.c (examine_prologue): Likewise.
+	* ns32k-tdep.c (ns32k_fix_call_dummy): Remove unused function.
+	* v850-tdep.c (v850_fix_call_dummy): Likewise.
+
+2004-05-18  Mark Kettenis  <kettenis@gnu.org>
+
+	* vax-tdep.c (vax_return_value): Implement
+	RETURN_VALUE_ABI_RETURNS_ADDRESS.
+
+2004-05-17  Mark Kettenis  <kettenis@gnu.org>
+
+	* vax-tdep.c (vax_return_value): Fix typo.
+
+2004-05-17  Andrew Cagney  <cagney@redhat.com>
+
+	* MAINTAINERS: Mark Salter was also responsible for
+	testsuite/config/
+
+	* NEWS: Mention signal fixes.
+
+2004-05-17  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_stub_frame_unwind_cache): For HPUX stub unwinding,
+	check to see if we are unwinding an export stub.  Export stubs clobber
+	the %rp in the call path and stores the original rp in a stack slot.
+
+2004-05-17  Jim Blandy  <jimb@redhat.com>
+
+	* MAINTAINERS: Update address for J.T. Conklin.
+
+2004-05-17  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c: Remove superfluous #include's.
+	* Makefile.in (hppa-tdep.o): Update dependencies.
+
+2004-05-17  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (THREAD_INITIAL_FRAME_SYMBOL): Delete unused symbol.
+	(THREAD_INITIAL_FRAME_SYM_LEN): Likewise.
+	(unwind_command, hppa_alignof, prologue_inst_adjust_sp)
+	(is_branch, inst_saves_gr, inst_saves_fr, compare_unwind_entries)
+	(read_unwind_info, internalize_unwinds, record_text_segment_lowaddr):
+	Remove static function declarations.
+
+2004-05-17  Mark Kettenis  <kettenis@gnu.org>
+
+	* alphabsd-nat.c: Update copyright year.
+	(getregs_supplies): Replace PC_REGNUM with ALPHA_PC_REGNUM.
+
+	* m68k-tdep.h (m68k_regnum): Add M68K_D2_REGNUM, M68K_D7_REGNUM
+	and M68K_A2_REGNUM.
+
+	* m68k-tdep.c (m68k_svr4_return_value): Implement
+	RETURN_VALUE_ABI_RETURNS_ADDRESS.
+
+2004-05-16  Mark Kettenis  <kettenis@gnu.org>
+
+	* sol-thread.c Update copyright year.  Fix various coding
+	standards violations.  Tweak a few comments.
+	(td_err_string, td_state_string, thread_to_lwp, lwp_to_thread):
+	Delete prototypes.
+
+2004-05-15  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.h (hppa_frame_prev_register_helper): Pass save_regs
+	as pointer instead of array reference since HPUX compiler does
+	not accept unsized array arguments.
+	* somsolib.c (dld_flags_buffer): Use constant array size.
+
+2004-05-15  Mark Kettenis  <kettenis@gnu.org>
+
+	* amd64obsd-tdep.c (amd64obsd_sigtramp_p): Replace hexadecimal
+	offset with decimal offset.
+	(amd64obsd_sigcontext_addr): Return correct address for entire
+	signal trampoline.
+
+	* vax-tdep.c (vax_frame_num_args): Use get_frame_base_address
+	instead of get_frame_base.
+
+	* i386bsd-nat.c (supply_gregset): Use regcache_raw_supply.
+	(fill_gregset): Use regcache_raw_collect.
+
+	* config/djgpp/fnchange.lst: Add entries for ppcobsd-nat.c and
+	ppcobsd-tdep.c.
+
+	* config/sparc/tm-nbsd64.h: Remove file.
+	* config/tm-sunos.h: Remove file.
+
+2004-05-15  Joel Brobecker  <brobecker@gnat.com>
+
+	* rs6000-tdep.c (store_param_on_stack_p): New function,
+	an improved version of some code extracted from skip_prologue().
+	(skip_prologue): Use store_param_on_stack_p() to detect
+	instructions saving a parameter on the stack. Detect when r0
+	is used to save a parameter.
+	Do not mark "li rx, SIMM" instructions as part of the prologue,
+	unless the following instruction is also part of the prologue.
+
+2004-05-14  Andrew Cagney  <cagney@redhat.com>
+
+	* infrun.c (handle_inferior_event): Simplify
+	STEP_OVER_UNDEBUGGABLE.
+
+	* infrun.c (handle_step_into_function): Delete function.
+	(handle_inferior_event): Inline calls to
+	handle_step_into_function.
+
+2004-05-14  Jerome Guitton  <guitton@rome.act-europe.fr>
+
+	* rs6000-nat.c: Fix a comment.
+
+2004-05-12  David Anderson <davea@sgi.com>
+
+	Committed by Jim Blandy <jimb@redhat.com>:
+	* regcache.c (struct regcache_descr): fix comment spelling.
+
+2004-05-13  J. Brobecker  <brobecker@gnat.com>
+
+	* aix-thread.c: s/ppc_floating_point_p/ppc_floating_point_unit_p/.
+	Fixes a link link failure.
+
+2004-05-13  J. Brobecker  <brobecker@gnat.com>
+
+	* aix-thread.c (store_regs_kernel_thread): Fix a little obvious
+	error that was causing the build to fail.
+
+2004-05-13  J. Brobecker  <brobecker@gnat.com>
+
+	* aix-thread.c: #include "gdb_string.h". Needed for memset and memcopy.
+	* Makefile.in (aix-thread.o): Add dependency on gdb_string.h.
+
+2004-05-13  Andrew Cagney  <cagney@redhat.com>
+
+	* infrun.c (handle_inferior_event): Check for
+	STEP_OVER_UNDEBUGGABLE after signal trampolines and function
+	calls.  Update comments.
+
+2004-05-13  Jim Blandy  <jimb@redhat.com>
+
+	* aix-thread.c (pdc_read_regs, supply_gprs64, supply_fprs)
+	(fetch_regs_user_thread, fetch_regs_kernel_thread)
+	(store_regs_user_thread, store_regs_kernel_thread): Use
+	ppc_num_gprs and ppc_num_fprs instead of '32' and '31'.
+	* ppc-linux-nat.c (fill_gregset): Same.
+	* ppc-linux-tdep.c (ppc_linux_supply_gregset) 
+	(ppc_linux_sigtramp_cache): Same.
+	* ppcnbsd-tdep.c (ppcnbsd_supply_reg, ppcnbsd_fill_reg) 
+	(ppcnbsd_sigtramp_cache_init): Same.
+	* rs6000-nat.c (fetch_core_registers): Same.
+	* rs6000-tdep.c (ppc_supply_gregset, ppc_collect_gregset) 
+	(rs6000_frame_cache): Same.
+
+	* aix-thread.c (supply_gprs64, fetch_regs_user_thread)
+	(store_regs_user_thread): Use tdep->ppc_gp0_regnum, instead
+	of assuming that the gprs are numbered starting with zero.
+	* ppc-linux-nat.c (fill_gregset): Same.
+	* ppc-linux-tdep.c (ppc_linux_supply_gregset): Same.
+	* ppcnbsd-nat.c (getregs_supplies): Same.
+	* ppcnbsd-tdep.c (ppcnbsd_supply_reg, ppcnbsd_fill_reg): Same.
+	* rs6000-nat.c (fetch_core_registers): Same.
+	* rs6000-tdep.c (ppc_supply_gregset, ppc_collect_gregset): Same.
+
+2004-05-07  Michael Snyder  <msnyder@redhat.com>
+
+	* tracepoint.c (scope_info): Add handling for LOC_COMPUTED,
+	LOC_COMPUTED_ARG, and LOC_INDIRECT.
+
+2004-05-13  Andrew Cagney  <cagney@redhat.com>
+
+	* infrun.c (handle_inferior_event): Use frame_unwind_id.
+
+2004-05-13  Bryce McKinlay  <mckinlay@redhat.com>
+
+	* dwarf2loc.c (find_location_expression): Use ANOFFSET to adjust
+	base_address for shared libraries.
+
+2004-05-13  Bryce McKinlay  <mckinlay@redhat.com>
+
+	* MAINTAINERS (write after approval): Add myself.	
+
+2004-05-13  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* breakpoint.c (bpstat_stop_status): Add new argument
+	STOPPED_BY_WATCHPOINT.  Use it instead of testing
+	target_stopped_data_address agaist 0 to check whether
+	or not we stopped due to a hardware watchpoint.
+	* breakpoint.h (bpstat_stop_status): Adapt prototype.
+	* infrun.c (handle_inferior_event): Call bpstat_stop_status
+	with new argument.
+
+2004-05-12  Jim Blandy  <jimb@redhat.com>
+
+	* configure.in: When checking whether we should use the -bbigtoc
+	option, don't forget to restore the original value of LDFLAGS.
+	* configure: Regenerated.
+
+2004-05-12  Andrew Cagney  <cagney@redhat.com>
+
+	* thread.c (load_infrun_state): Delete step_sp.
+	* infrun.c (context_switch): Ditto.
+	* inferior.h (step_sp): Ditto.
+	* infcmd.c (step_sp, step_1, step_once, until_next_command): Ditto.
+	* gdbthread.h (struct thread_info, save_infrun_state)
+	(restore_infrun_state): Ditto.
+
+2004-05-12  Ulrich Weigand  <uweigand@de.ibm.com>
+
+	* MAINTAINERS (write after approval): Add myself.
+
+2004-05-12  Andrew Cagney  <cagney@redhat.com>
+
+	* infrun.c (adjust_pc_after_break): Rewrite decr logic,
+	eliminate reference to step_sp.
+	(struct execution_control_state, init_execution_control_state)
+	(handle_inferior_event, keep_going): Delete update_step_sp and
+	step_sp.
+	* infcmd.c (step_sp): Note that variable is unused.
+
+2004-05-11  Andrew Cagney  <cagney@redhat.com>
+
+	* infrun.c (step_over_function): Delete function.
+	(handle_step_into_function): Use insert_step_resume_breakpoint.
+	(insert_step_resume_breakpoint): Fix assertion.
+
+2004-05-11  Nick Roberts  <nickrob@gnu.org>
+
+	* utils.c (defaulted_query): Just use the normal query input type
+	when printing the annotations.
+
+2004-05-11  Andrew Cagney  <cagney@redhat.com>
+
+	* infrun.c (handle_inferior_event): Simplify code handling
+	step-into or return-from a signal trampoline.
+
+2004-05-11  Andrew Cagney  <cagney@redhat.com>
+
+	* ppcnbsd-tdep.c: Include "gdb_assert.h".
+	* Makefile.in (ppcnbsd-tdep.o): Update dependencies.
+
+2004-05-10  Jim Blandy  <jimb@redhat.com>
+
+	* ppc-bdm.c (bdm_ppc_fetch_registers): Replace utterly broken code
+	with a call to internal_error.
+
+	* ppc-tdep.h (struct gdbarch_tdep): Change definition of
+	ppc_fp0_regnum and ppc_fpscr_regnum: if they are -1, then this
+	processor variant lacks those registers.
+	(ppc_floating_point_unit_p): Change description to make it clear
+	that this returns info about the ISA, not the ABI.
+	* rs6000-tdep.c (ppc_floating_point_unit_p): Decide whether to
+	return true or false by checking tdep->ppc_fp0_regnum and
+	tdep->ppc_fpscr_regnum.  The original code replicated the BFD
+	arch/mach switching done in rs6000_gdbarch_init; it's better to
+	keep that logic there, and just check the results here.
+	(rs6000_gdbarch_init): On the E500, set tdep->ppc_fp0_regnum and
+	tdep->ppc_fpscr_regnum to -1 to indicate that we have no
+	floating-point registers.
+	(ppc_supply_fpregset, ppc_collect_fpregset)
+	(rs6000_push_dummy_call, rs6000_extract_return_value)
+	(rs6000_store_return_value): Assert that we have floating-point
+	registers.
+	(rs6000_dwarf2_stab_reg_to_regnum): Add FIXME.
+	(rs6000_frame_cache): Don't note the locations at which
+	floating-point registers were saved if we have no fprs.
+	* aix-thread.c (supply_fprs, fill_fprs): Assert that we have FP
+	registers.
+	(fetch_regs_user_thread, fetch_regs_kernel_thread)
+	(store_regs_user_thread, store_regs_kernel_thread): Only call
+	supply_fprs / fill_fprs if we actually have floating-point
+	registers.
+	(special_register_p): Check ppc_fpscr_regnum before matching
+	against it.
+	(supply_sprs64, supply_sprs32, fill_sprs64, fill_sprs32): Don't
+	supply / collect fpscr if we don't have it.
+	* ppc-bdm.c: #include "gdb_assert.h".
+	(bdm_ppc_fetch_registers, bdm_ppc_store_registers): Assert that we
+	have floating-point registers, since I can't test this code on
+	FP-free systems to adapt it.
+	* ppc-linux-nat.c (ppc_register_u_addr): Don't match against the
+	fpscr and floating point register numbers if they don't exist.
+	(fetch_register): Assert that we have floating-point registers
+	before we reach the code that handles them.
+	(store_register): Same.  And use tdep instead of calling
+	gdbarch_tdep again.
+	(fill_fpregset): Don't try to collect FP registers and fpscr if we
+	don't have them.
+	(ppc_linux_sigtramp_cache): Don't record the saved locations of
+	fprs and fpscr if we don't have them.
+	(ppc_linux_supply_fpregset): Don't supply fp regs and fpscr if we
+	don't have them.
+	* ppcnbsd-nat.c: #include "gdb_assert.h".
+	(getfpregs_supplies): Assert that we have floating-point registers.
+	* ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg): Same.
+	* ppcobsd-tdep.c: #include "gdb_assert.h".
+	(ppcobsd_supply_gregset, ppcobsd_collect_gregset): Assert that we
+	have floating-point registers.
+	* rs6000-nat.c (regmap): Don't match against the fpscr and
+	floating point register numbers if they don't exist.
+	(fetch_inferior_registers, store_inferior_registers,
+	fetch_core_registers): Only fetch / store / supply the
+	floating-point registers and the fpscr if we have them.
+	* Makefile.in (ppc-bdm.o, ppc-linux-nat.o, ppcnbsd-nat.o)
+	(ppcobsd-tdep.o): Update dependencies.
+	
+2004-05-10  Andrew Cagney  <cagney@redhat.com>
+
+	* infrun.c (through_sigtramp_breakpoint): Delete variable.
+	(context_switch): Do not switch through_sigtramp_breakpoint.
+	* gdbthread.h (save_infrun_state, load_infrun_state)
+	(struct thread_info): Delete through_sigtramp_breakpoint parameter
+	and structure member.
+	* thread.c (load_infrun_state, save_infrun_state): Update.
+
+2004-05-10  Mark Kettenis  <kettenis@gnu.org>
+
+	* m68kbsd-tdep.c (m68kbsd_elf_init_abi): Call m68k_svr4_init_abi.
+
+2004-05-10  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
+
+	* acinclude.m4: Quote macro names being defined by AC_DEFUN 
+	throughout.
+	* aclocal.m4: Regenerate.
+
+2004-05-10  Nathan J. Williams  <nathanw@wasabisystems.com>
+
+	* alphanbsd-tdep.c: Fix include of "gdb_string.h".
+
+2004-05-10  Andrew Cagney  <cagney@redhat.com>
+
+	* infrun.c (check_sigtramp2): Delete function.
+	(handle_inferior_event): When single stepping, and taking a
+	signal, set a breakpoint at the signal return address.  Delete
+	redundant calls to check_sigtramp2.
+	(insert_step_resume_breakpoint): New function.
+	(through_sigtramp_breakpoint, handle_inferior_event)
+	(follow_exec, wait_for_inferior, fetch_inferior_event)
+	(currently_stepping, keep_going): Delete most uses of
+	through_sigtramp_breakpoint, not that it should be deleted.
+	(delete_breakpoint_current_contents): Delete function.
+
+2004-05-10  Randolph Chung  <tausq@debian.org>
+
+	* config/pa/linux.mt (TM_FILE): Use new tm-linux.h for hppa-linux
+	target.
+	* config/pa/tm-linux.h: New file.
+
+2004-05-10  Daniel Jacobowitz  <drow@mvista.com>
+
+	* cli/cli-setshow.c (cmd_show_list): Check for "show" in the middle
+	of prefixes.  Don't print the prefix twice in the CLI.
+
+2004-05-10  Jim Blandy  <jimb@redhat.com>
+
+	* rs6000-tdep.c (ppc_collect_gregset): When regnum == -1, do
+	collect all the gprs.
+
+	* rs6000-tdep.c (ppc_collect_gregset): Correct off-by-one error in
+	loop collecting gprs.
+
+2004-05-09  Andrew Cagney  <cagney@redhat.com>
+
+	* remote-vx.c (net_step): Delete step-range code.
+	* remote.c (remote_resume, init_all_packet_configs)
+	(set_remote_protocol_E_packet_cmd)
+	(show_remote_protocol_E_packet_cmd)
+	(remote_protocol_E, show_remote_cmd, _initialize_remote)
+	(remote_protocol_e, set_remote_protocol_e_packet_cmd)
+	(show_remote_protocol_e_packet_cmd): Ditto.
+
+2004-05-09  Mark Kettenis  <kettenis@gnu.org>
+
+	* hppa-tdep.h (enum hppa_regnum): Name enum, add HPPA_R1_REGNUM.
+
+	* hppa-tdep.h: Update copyright year.
+	(struct trad_frame_saved_reg): Add opaque declaration.
+
+	* amd64-tdep.c (amd64_return_value): Implement
+	RETURN_VALUE_ABI_RETURNS_ADDRESS.
+
+	* m68k-tdep.c (m68k_convert_register_p, m68k_register_to_value)
+	(m68k_value_to_register): New functions.
+	(m68k_gdbarch_init): Set convert_register_p, register_to_value and
+	value_to_register.
+
+	* defs.h (enum return_value_convention): Add
+	RETURN_VALUE_ABI_RETURNS_ADDRESS and
+	RETURN_VALUE_ABI_PRESERVES_ADDRESS.
+	* infcmd.c (legacy_return_value): New function.
+	(print_return_value): Rwerite to implement
+	RETURN_VALUE_ABI_RETURNS_ADDRESS.
+	* values.c (using_struct_return): Check for inequality to
+	RETURN_VALUE_REGISTER_CONVENTION instead of equality to
+	RETURN_VALUE_STRUCT_CONVENTION.
+	* i386-tdep.c (i386_return_value): Implement
+	RETURN_VALUE_ABI_RETURNS_ADDRESS.
+
+	* vax-tdep.c: Tweak comments.  Reorder include files.  Don't
+	include "symtab.h", "opcode/vax.h" and "inferior.h".
+	(vax_skip_prologue): Replace calls to read_memory_integer by calls
+	to read_memory_unsigned_integer.
+	(vax_gdbarch_init): Reorder.
+	(_initialize_vax_tdep): Spell out prototype.
+	* Makefile.in (vax-tdep.o): Update dependencies.
+
+2004-05-08  Andrew Cagney  <cagney@redhat.com>
+
+	* infrun.c (resume): Delete call to DO_DEFERRED_STORES.
+	* target.c (target_detach, target_disconnect): Ditto.
+
+	* infcall.c (call_function_by_hand): When no
+	DEPRECATED_SAVE_DUMMY_FRAME_TOS call generic_save_dummy_frame_tos.
+	* rs6000-tdep.c (rs6000_gdbarch_init): Do not set
+	DEPRECATED_SAVE_DUMMY_FRAME_TOS.
+	* mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
+	* mcore-tdep.c (mcore_gdbarch_init): Ditto.
+	
+	* gdbarch.sh (DEPRECATED_FIX_CALL_DUMMY): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* ns32k-tdep.c (ns32k_gdbarch_init): Do not set
+	deprecated_fix_call_dummy.
+	* v850-tdep.c (v850_gdbarch_init): Ditto.
+	* infcall.c (call_function_by_hand): Do not call
+	DEPRECATED_FIX_CALL_DUMMY.
+
+	* gdbarch.sh (DEPRECATED_CALL_DUMMY_WORDS)
+	(DEPRECATED_SIZEOF_CALL_DUMMY_WORDS): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* arm-linux-tdep.c (arm_linux_call_dummy_words)
+	(arm_linux_init_abi): Do not set deprecated_call_dummy_words or
+	deprecated_sizeof_call_dummy_words.
+	* arm-tdep.c (arm_call_dummy_words, arm_gdbarch_init): Ditto.
+	* xstormy16-tdep.c (xstormy16_gdbarch_init): Ditto.
+	* v850-tdep.c (v850_gdbarch_init): Ditto.
+	* sh64-tdep.c (sh64_gdbarch_init): Ditto.
+	* ns32k-tdep.c (ns32k_call_dummy_words, ns32k_gdbarch_init): Ditto.
+	* mn10300-tdep.c (mn10300_gdbarch_init): Ditto.
+	* mcore-tdep.c (mcore_gdbarch_init): Ditto.
+	* arch-utils.h (legacy_call_dummy_words)
+	(legacy_sizeof_call_dummy_words): Delete declarations.
+	* arch-utils.c (legacy_call_dummy_words)
+	(legacy_sizeof_call_dummy_words): Delete variables.
+
+	* gdbarch.sh (DEPRECATED_PUSH_DUMMY_FRAME): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* inferior.h (PUSH_DUMMY_FRAME): Delete macro.
+	* infcall.c (call_function_by_hand): Eliminate call to
+	DEPRECATED_PUSH_DUMMY_FRAME.
+	* ns32k-tdep.c (ns32k_gdbarch_init): Do not set deprecated
+	push_dummy_frame.
+	(ns32k_push_dummy_frame): Delete function.
+
+	* ns32k-tdep.c (ns32k_gdbarch_init): Do not set
+	deprecated_call_dummy_breakpoint_offset or
+	deprecated_call_dummy_start_offset.
+	* dummy-frame.c, arm-tdep.c: Update comments.
+	* gdbarch.sh (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
+	(DEPRECATED_CALL_DUMMY_START_OFFSET): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	
+	* infcall.c (legacy_push_dummy_code): Delete function.
+	(push_dummy_code): Delete call.
+
+	* gdbarch.sh (DEPRECATED_USE_GENERIC_DUMMY_FRAMES): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* blockframe.c (legacy_frame_chain_valid): Simplify by eliminating
+	DEPRECATED_USE_GENERIC_DUMMY_FRAMES.
+	* infcall.c (legacy_push_dummy_code, call_function_by_hand): Ditto.
+	* frame.c (frame_type_from_pc, legacy_get_prev_frame): Ditto.
+
+	* breakpoint.h (deprecated_frame_in_dummy): Delete declaration.
+	(struct frame_info): Delete opaque declaration.
+	* breakpoint.c (deprecated_frame_in_dummy): Delete function.
+	* frame.c (get_frame_type): Delete call.
+
+	* ns32k-tdep.c (ns32k_gdbarch_init): Do not set deprecated
+	pc_in_call_dummy.
+	* inferior.h (deprecated_pc_in_call_dummy_on_stack): Delete.
+	* blockframe.c (deprecated_pc_in_call_dummy_on_stack): Delete.
+
+2004-05-08  Mark Kettenis  <kettenis@gnu.org>
+
+	* alphanbsd-tdep.c: Include "gdb_string.h".
+	* armnbsd-tdep.c: Update copyright year.
+	Include "gdb_string.h".
+	* Makefile.in (alphanbsd-tdep.o, armnbsd-tdep.o): Update
+	dependencies.
+
+	* delta68-nat.c: Remove file.
+	* m68k-tdep.c (delta68_in_sigtramp, delta68_frame_args_address)
+	(delta68_frame_saved_pc, delta68_frame_num_args): Remove functions.
+	* Makefile.in (ALLDEPFILES): Remove delta68-nat.c.
+	(delta68-nat.o): Remove dependency.
+
+	* m68k-tdep.c (m68k_frameless_function_invocation): Remove
+	function.
+	(m68k_gdbarch_init): Don't set
+	deprecated_frameless_function_invocation.
+
+2004-05-07  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (skip_prologue_hard_way, hppa_frame_cache): Use 
+	read_memory_nobpt for code reading when doing frame unwinding.
+	* hppa-linux-tdep.c (insns_match_pattern): Likewise.
+
+2004-05-07  Randolph Chung  <tausq@debian.org>
+
+	* hppa-linux-tdep.c (hppa_linux_sigtramp_find_sigcontext): Pass in pc
+	instead of sp, handle sigaltstack case.
+	(hppa_linux_sigtramp_frame_unwind_cache): Adjust calls to 
+	hppa_linux_sigtramp_find_sigcontext, and set base to the frame of the
+	signal handler and not that of the caller.
+	(hppa_linux_sigtramp_unwind_sniffer): Adjust calls to
+	hppa_linux_sigtramp_find_sigcontext.
+
+2004-05-07  Randolph Chung  <tausq@debian.org>
+
+	* Makefile.in (ALLDEPFILES): Add hppa-linux-tdep.c and
+	hppa-linux-nat.c.
+	(hppa-linux-tdep.o, hppa-linux-nat.o): Define rules.
+	* hppa-linux-nat.c (fetch_register, store_register): Define.
+	(fetch_inferior_registers, store_inferior_registers): Define.
+	(supply_gregset): Add comment and clean up some unneeded code.
+	(fill_gregset): Add comment and fix so that it saves registers in
+	the right place in the gregset.
+	(fill_fpregset): Fix buffer overrun problem.
+	* config/pa/nm-linux.h (FETCH_INFERIOR_REGISTERS): Define.
+
+2004-05-07  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_frame_prev_register_helper): New function to 
+	do common handling of the pcoqt register.
+	(hppa_frame_prev_register, hppa_stub_frame_prev_register): Convert
+	to use helper function.
+	(hppa_frame_unwind_sniffer): Only use if unwind entry is present.
+	(hppa_fallback_frame_cache, hppa_fallback_frame_this_id)
+	(hppa_fallback_frame_prev_register, hppa_fallback_frame_unwind): New
+	generic fallback unwinder when all else fails.
+	(hppa_gdbarch_init): Add fallback sniffer.
+	* hppa-tdep.h (hppa_frame_prev_register_helper): Prototype.
+	* hppa-linux-tdep.c (hppa_linux_sigtramp_frame_prev_register): Convert
+	to use helper function.
+
+2004-05-08  Joel Brobecker  <brobecker@gnat.com>
+
+	* config/djgpp/fnchange.lst: Add translation rules for
+	gdb.arch/powerpc-aix-prologue.c and gdb.arch/powerpc-aix-prologue.exp.
+
+2004-05-08  Mark Kettenis  <kettenis@gnu.org>
+
+	* frame.c (get_prev_frame_1): Work around GCC bug.
+	* frame.h: Add comment about GCC bug.
+
+2004-05-07  Andrew Cagney  <cagney@redhat.com>
+
+	* observer.c: Include "commands.h" and "gdbcmd.h".
+	(observer_debug, _initialize_observer): Add the
+	command "set/show debug observer".
+	* observer.sh: When observer debugging, log notify calls.
+	* Makefile.in (observer.o): Update dependencies.
+
+2004-05-07  Jason Molenda  (jmolenda@apple.com)
+
+	* cli/cli-decode.c: Fix "SHOW_DOR" comment typeos.
+
+2004-05-07  Jim Blandy  <jimb@redhat.com>
+
+	* aix-thread.c (fetch_regs_kernel_thread, fill_gprs64,
+	fill_gprs32, store_regs_kernel_thread): Use tdep->ppc_gp0_regnum
+	to recognize gpr regnums, instead of assuming that
+	tdep->ppc_fp0_regnum marks the end of the general-purpose
+	registers.
+
+	* ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Assert that
+	the given architecture has floating-point registers. 
+
+2004-05-07  Andrew Cagney  <cagney@redhat.com>
+
+	* gdbarch.sh (DEPRECATED_USE_GENERIC_DUMMY_FRAMES): Replace with
+	macro defined to 1.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* ns32k-tdep.c (ns32k_gdbarch_init): Do not set
+	deprecated_use_generic_dummy_frames.
+
+2004-05-07  Brian Ford  <ford@vss.fsi.com>
+
+	* NEWS: Mention Cygwin DWARF 2 support.
+
+2004-05-07  Andrew Cagney  <cagney@redhat.com>
+
+	* objfiles.h (struct entry_info): Delete unused fields
+	deprecated_entry_file_lowpc and deprecated_entry_file_highpc.
+	* objfiles.c (init_entry_point_info, objfile_relocate): Update.
+	* mipsread.c (mipscoff_symfile_read): Update.
+	* mdebugread.c (parse_partial_symbols): Update.
+	* dwarfread.c (read_file_scope): Update.
+	* dwarf2read.c (read_file_scope): Update.
+	* dbxread.c (read_dbx_symtab, read_dbx_symtab): Update.
+	* coffread.c (complete_symtab): Update.
+
+2004-05-07  Mark Kettenis  <kettenis@gnu.org>
+
+	* infcall.c (_initialize_infcall): Fix typo.
+
+2004-05-07  Andrew Cagney  <cagney@redhat.com>
+
+	* cli/cli-decode.c (add_setshow_zinteger_cmd): New function.
+	* command.h (add_setshow_zinteger_cmd): Declare.
+
+2004-05-06  Randolph Chung  <tausq@debian.org>
+
+	* config/pa/tm-hppa.h (RO_REGNUM, FLAGS_REGNUM, RP_REGNUM)
+	(HPPA_FP_REGNUM, HPPA_SP_REGNUM, SAR_REGNUM, IPSW_REGNUM)
+	(PCOQ_HEAD_REGNUM, PCSQ_HEAD_REGNUM, PCOQ_TAIL_REGNUM, PCSQ_TAIL_REGNUM)
+	(EIEM_REGNUM, IIR_REGNUM, ISR_REGNUM, IOR_REGNUM, SR4_REGNUM)
+	(RCR_REGNUM, PID0_REGNUM, PID1_REGNUM, PID2_REGNUM, PID3_REGNUM)
+	(CCR_REGNUM, TR0_REGNUM, CR27_REGNUM, HPPA_FP0_REGNUM, FP4_REGNUM)
+	(ARG0_REGNUM, ARG1_REGNUM, ARG2_REGNUM, ARG3_REGNUM): Move *_REGNUM 
+	definitions ...
+	* hppa-tdep.h: ... to here, with HPPA_ prefix.
+	* Makefile.in (hppah-nat.o): Add $(hppa_tdep_h)
+	* hppa-hpux-tdep.c (hppa32_hpux_frame_find_saved_regs_in_sig)
+	(hppa64_hpux_frame_find_saved_regs_in_sig)
+	(child_get_current_exception_event): Add HPPA_ prefix to *_REGNUM usage.
+	* hppa-linux-nat.c (GR_REGNUM, TR_REGNUM, greg_map): Likewise.
+	* hppa-linux-tdep.c (hppa_dwarf_reg_to_regnum)
+	(hppa_linux_target_write_pc, hppa_linux_sigtramp_frame_unwind_cache)
+	(hppa_linux_sigtramp_frame_prev_register): Likewise.
+	* hppa-tdep.c (hppa32_return_value, hppa64_return_value)
+	(hppa32_push_dummy_call, hppa64_push_dummy_call, hppa64_frame_align)
+	(hppa_target_read_pc, hppa_target_write_pc, hppa_frame_cache)
+	(hppa_frame_prev_register, hppa_stub_frame_unwind_cache)
+	(hppa_stub_frame_prev_register, hppa_unwind_dummy_id)
+	(hppa_skip_permanent_breakpoint, hppa_instruction_nullified)
+	(hppa32_register_type, hppa_cannot_store_register)
+	(hppa_fetch_pointer_argument, hppa_pseudo_register_read): Likewise.
+	* hppah-nat.c (store_inferior_registers, fetch_register): Likewise.
+	* hpread.c (hpread_process_one_debug_symbol): Likewise.
+	* pa64solib.c (pa64_solib_have_load_event)
+	(pa64_solib_have_unload_event, pa64_solib_loaded_library_pathname)
+	(pa64_solib_unloaded_library_pathname): Likewise.
+	* somsolib.c (som_solib_have_load_event, som_solib_have_unload_event)
+	(som_solib_library_pathname): Likewise.
+
+2004-05-05  Jim Ingham  <jingham@apple.com>
+	
+	* breakpoint.c (create_breakpoints): Copy the ignore count and
+	thread id over from the pended breakpoint to the actual
+	breakpoint.
+	
+2004-05-05  Andrew Cagney  <cagney@redhat.com>
+
+	* gdbarch.sh (PARM_BOUNDARY): Delete.
+	gdbarch.h, gdbarch.c: Re-generate.
+	* valops.c (PARM_BOUNDARY): Delete macro.
+	(value_push): Delete PARM_BOUNDARY code.
+	* m68k-tdep.c (m68k_gdbarch_init): Do not set parm_boundary.
+
+2004-05-04  Jim Blandy  <jimb@redhat.com>
+
+	* ppc-linux-nat.c (fetch_ppc_registers, store_ppc_registers):
+	Don't assume that the gprs, fprs, and UISA sprs are
+	contiguous, start at register number zero, and end with fpscr.
+	Instead, use the numbers from the tdep structure.
+
+	* config/rs6000/tm-rs6000.h (FP0_REGNUM): Document that this
+	should no longer be used in code specific to the RS6000 and its
+	derivatives.
+	* ppc-tdep.h (struct gdbarch_tdep): Add 'ppc_fp0_regnum' member.
+	* rs6000-tdep.c (rs6000_gdbarch_init): Initialize
+	tdep->ppc_fp0_regnum.
+	(ppc_supply_fpregset, ppc_collect_fpregset)
+	(rs6000_push_dummy_call, rs6000_extract_return_value)
+	(rs6000_dwarf2_stab_reg_to_regnum, rs6000_store_return_value)
+	(rs6000_frame_cache): Use tdep->ppc_fp0_regnum instead of
+	FP0_REGNUM. 
+	* aix-thread.c (supply_fprs, fetch_regs_kernel_thread)
+	(fill_gprs64, fill_gprs32, fill_fprs, store_regs_kernel_thread):
+	Same.
+	* ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_fetch_registers,
+	bdm_ppc_store_registers): Same.
+	* ppc-linux-nat.c (ppc_register_u_addr, fetch_register) 
+	(store_register, fill_fpregset): Same.
+	* ppc-linux-tdep.c (ppc_linux_sigtramp_cache) 
+	(ppc_linux_supply_fpregset): Same.
+	* ppcnbsd-nat.c (getfpregs_supplies): Same.
+	* ppcnbsd-tdep.c (ppcnbsd_supply_fpreg, ppcnbsd_fill_fpreg):
+	Same.
+	* ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call,
+	do_ppc_sysv_return_value, ppc64_sysv_abi_push_dummy_call,
+	ppc64_sysv_abi_return_value): Same.
+	* rs6000-nat.c (regmap, fetch_inferior_registers) 
+	(store_inferior_registers, fetch_core_registers): Same.
+
+2004-05-01  Mark Kettenis  <kettenis@gnu.org>
+
+	* m68knbsd-nat.c: Remove file.
+	* m68knbsd-tdep.c: Remove file.
+	* Makefile.in: (m68knbsd-nat.o, m68knbsd-tdep.o): Remove
+	dependencies.
+	* configure.host: Add m68k-*-netbsdelf*.
+	* configure.tgt (m68k-*-netbsd*): Set gdb_target to nbsd.
+	* config/m68k/nbsdaout.mh (NATDEPFILES): Add m68kbsd-nat.o,
+	solib.o and solib-sunos.o.  Remove m68knbsd-nat.o, corelow.o.
+	(XM_FILE): Remove.
+	* config/m68k/nbsdelf.mh: New file.
+	* config/m68k/nbsd.mt: New file.
+	* config/m68k/nbsdaout.mt: Remove file.
+	* config/m68k/tm-nbsd.h: Don't include <sys/param.h>,
+	<machine/vmparam.h> and "m68k/tm-m68k.h".  Include "solib.h".
+	(BPT_VECTOR, STACK_END_ADDR): Remove defines.
+	(DEPRECATED_SIGTRAMP_START, DEPRECATED_SIGTRAMP_END): Likewise.
+	(use_struct_convention): Remove prototype.
+	(USE_STRUCT_CONVENTION): Remove define.
+	* config/m68k/xm-nbsd.h: Remove file.
+
+2004-05-04  Michael Snyder  <msnyder@redhat.com>
+
+	* m68k-tdep.c (m68k_gdbarch_init): Default to using 
+	reg_struct_return method (as gcc usually does for cross targets).
+
+2004-05-04  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+	Committed by Andrew Cagney.
+	* s390-tdep.c (s390_sigtramp_frame_unwind_cache): Account for
+	alignment padding when accessing ucontext struct members.
+
+2004-05-04  Jim Blandy  <jimb@redhat.com>
+
+	* config/ppc-tdep.h (struct gdbarch_tdep): Delete
+	'ppc_gplast_regnum' member.
+	(ppc_num_gprs): New enum constant.
+	* ppc-linux-nat.c (ppc_register_u_addr): Use tdep->ppc_gp0_regnum
+	and ppc_num_gprs instead of tdep->ppc_gplast_regnum.
+	* rs6000-nat.c (regmap, fetch_inferior_registers,
+	store_inferior_registers): Same.
+	* rs6000-tdep.c (e500_pseudo_register_read)
+	(e500_pseudo_register_write): Same.
+	(rs6000_gdbarch_init): Don't initialize tdep->ppc_gplast_regnum.
+
+	* config/rs6000/tm-rs6000.h (FPLAST_REGNUM): Delete #definition.
+	* ppc-tdep.h (ppc_num_fprs): New enum constant.
+	* aix-thread.c (fetch_regs_kernel_thread, fill_fprs,
+	store_regs_kernel_thread): Use FP0_REGNUM + ppc_num_fprs, not
+	FPLAST_REGNUM.
+	* ppc-bdm.c (bdm_ppc_fetch_registers, bdm_ppc_store_registers):
+	Same.
+	* ppc-linux-nat.c (ppc_register_u_addr): Same.
+	* rs6000-nat.c (regmap, fetch_inferior_registers) 
+	(store_inferior_registers): Same.
+
+	* aix-thread.c (fill_fprs): Fix off-by-one error comparing regno
+	with FPLAST_REGNUM.
+
+2004-05-03  Joel Brobecker  <brobecker@gnat.com>
+
+	* dwarf2read.c (dwarf2_create_include_psymtab): Fix build
+	failure detected by recent versions of GCC.
+	(psymtab_to_symtab_1): No longer use the PST_PRIVATE macro
+	to be consistent with the usage in dwarf2_create_include_psymtab.
+
+2004-05-03  Michael Snyder  <msnyder@redhat.com>
+
+	* mips-tdep.c (mips_gdbarch_init): Fix typo in comment.
+	(heuristic_proc_start): Whitespace cleanup.
+
+2004-05-04  Mark Kettenis  <kettenis@gnu.org>
+
+	* sun3-nat.c: Remove file.
+	* Makefile.in (tm-sun3.h tm-altos.h tm-sun2.h tm-3b1.h): Remove
+	dependencies.
+	(ALLDEPFILES): Remove sun3-nat.c.
+	(sun3-nat.o): Remove dependencies.
+
+	* i386-interix-nat.c, i386-interix-tdep.c,
+	config/i386/nm-interix.h, config/i386/interix.mh,
+	config/i386/interix.mt: Remove files.
+	* Makefile.in (i386-interix-nat.o, i386-interix-tdep.o): Remove
+	dependencies.
+
+2004-05-03  Mark Kettenis  <kettenis@gnu.org>
+
+	* m68k-tdep.h (struct gdbarch_tdep): Add member
+	struct_value_regnum.
+	(m68k_svr4_init_abi): New prototype.
+	* m68k-tdep.c: Include "floatformat.h".  Add comment about all the
+	different calling conventions.
+	(m68k_extract_return_value): Remove code dealing with single-field
+	structs.
+	(m68k_store_return_value): Remove code dealing with single-field
+	structs.  Correctly store return values of 5, 6, 7 or 8 bytes.
+	(m68k_extract_struct_value_address): Remove function.
+	(m68k_svr4_extract_return_value,m68k_svr4_store_return_value)
+	(m68k_reg_struct_return_p, m68k_return_value)
+	(m68k_svr4_return_value): New functions.
+	(m68k_use_struct_convention): Remove function.
+	(m68k_push_dummy_call): Use new struct_value_regnum member of
+	`struct gdbarch_tdep' instead of hardcoded register number to
+	store STRUCT_ADDR.
+	(m68k_svr4_init_abi): New function.
+	(m68k_gdbarch_init): Don't set extract_return_value,
+	store_return_values, deprecated_extract_struct_value_address and
+	use_struct_convention.  Set return_value instead.  Initialize new
+	struct_value_regnum member of `struct gdbarch_tdep'.
+	* m68klinux-tdep.c: Update copyright year.
+	(m68k_linux_extract_return_value, m68k_linux_store_return_value)
+	(m68k_linux_extract_struct_value_address): Remove function.
+	(m68k_linux_init_abi): Don't set extract_return_value,
+	store_return_values, deprecated_extract_struct_value_address and
+	use_struct_convention.  Call m68k_svr4_init_abi but override the
+	new struct_value_regnum member of `struct gdbarch_tdep'.
+	* Makefile.in (m68k-tdep.o): Update dependencies.
+
+2004-05-03  J. Brobecker  <brobecker@gnat.com>
+
+	* dwarf2read.c (line_header): Add new included_p field in
+	field file_names.
+	(partial_die_info): New field has_stmt_list. New field line_offset.
+	(dwarf2_create_include_psymtab): New function.
+	(dwarf2_build_include_psymtabs): New function.
+	(add_file_name): Add forward declaration. Initialize new field.
+	(dwarf_decode_lines): Add new parameter. Enhance this procedure
+	to be able to determine the list of files included by the
+	given unit, and build their associated psymtabs.
+	(dwarf2_build_psymtabs_hard): Build the psymtabs for the included
+	files as well.
+	(psymtab_to_symtab_1): Build the symtabs of all dependencies as well.
+	(read_file_scope): Update call to dwarf_decode_lines.
+	(read_partial_die): Handle DW_AT_stmt_list attributes.
+
+2004-05-02  Michael Chastain  <mec.gnu@mindspring.com>
+
+	Unfix PR gdb/1626.
+	* configure.in: Revert special case for osf5.*.
+	* configure: Regenerate.
+
+2004-05-02  Jim Blandy  <jimb@redhat.com>
+
+	Move the symbol-file-from-memory functions into their own file.
+	* symfile-mem.c, symfile-mem.h: New files.
+	* symfile.c (symbol_file_add_from_bfd): New function.
+	(symbol_file_add): Call symbol_file_add_from_bfd.
+	(symbol_file_add_from_memory, add_symbol_file_from_memory_command):
+	Moved to symfile-mem.c.
+	(_initialize_symfile): Move definition of
+	add-symbol-file-from-memory command to symfile-mem.c.
+	* symfile.h (symbol_file_add_from_bfd): New declaration.
+	* config/i386/linux.mt (TDEPFILES): Add symfile-mem.o.
+ 	* config/powerpc/linux.mt (TDEPFILES): Same.
+	* Makefile.in (SFILES): Add symfile-mem.c.
+	(symfile_mem_h): New variable.
+	(HFILES_NO_SRCDIR): Add symfile-mem.h.
+	(symfile-mem.o): New rule.
+
+2004-05-01  Andrew Cagney  <cagney@redhat.com>
+
+	* breakpoint.c (insert_bp_location): Use get_frame_id, and
+	frame_find_by_id instead of frame_relative_level.
+	(do_enable_breakpoint): Ditto.
+	* thread.c: Update copyright.
+	(info_threads_command): Ditto, simplify.
+
+	* frame.c (deprecated_generic_get_saved_register): Delete
+	function, moved to "xstormy16-tdep.c".
+	* xstormy16-tdep.c (xstormy16_get_saved_register): Inline
+	deprecated_generic_get_saved_register from "frame.c".
+	(xstormy16_frame_saved_register): Call
+	xstormy16_get_saved_register.
+	* dummy-frame.c (deprecated_find_dummy_frame_regcache): Make
+	static.
+	* dummy-frame.h (deprecated_find_dummy_frame_regcache): Delete.
+	* frame.h (deprecated_generic_get_saved_register): Delete.
+
+2004-05-01  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* dwarfread.c: Update documentation on the state of dwarf-1.
+
+2004-05-01  Andrew Cagney  <cagney@redhat.com>
+
+	* stack.c (select_frame_command): Delete call to
+	frame_relative_level.
+	(print_frame, set_backtrace_limit_command, backtrace_limit_info):
+	Delete #if0 code.
+	(frame_info): Do not print FRAMELESS.
+	(print_block_frame_labels): Replace DEPRECATED_STREQ.
+	(catch_info): Delete #if0 code.
+
+	* frame.c (create_sentinel_frame): Set type to SENTINEL_FRAME.
+	* dummy-frame.c (dummy_frame_this_id): Use get_frame_type, instead
+	of frame_relative_level.
+	* sentinel-frame.c (sentinel_frame_unwinder): Set unwinder's type
+	to SENTINEL_FRAME.
+	* frame.h (enum frame_type): Add SENTINEL_FRAME.
+	* s390-tdep.c (s390_prologue_frame_unwind_cache): Delete calls to
+	frame_relative_level.
+
+	* frame.h (deprecated_set_frame_type): Delete declaration.
+	* frame.c (deprecated_set_frame_type): Delete function, update
+	comments.
+
+	* gdbarch.sh (DEPRECATED_PC_IN_SIGTRAMP): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* shnbsd-tdep.c (shnbsd_init_abi): Do not set pc_in_sigtramp.
+	(shnbsd_pc_in_sigtramp): Delete.
+	* i386-interix-tdep.c (i386_interix_init_abi): Do not set
+	pc_in_sigtramp.
+	* hppa-hpux-tdep.c (hppa_hpux_init_abi): Do not set
+	pc_in_sigtramp.
+	* frame.h: Update comments.
+	* ppc-linux-tdep.c: Update comments.
+	* breakpoint.c (bpstat_what): Update comments.
+
+	* Makefile.in (m68klinux-tdep.o, m68klinux-nat.o): Fix
+	m68klinux-tdep.o's dependencies, were previously added to
+	m68klinux-nat.o.
+
+	* alpha-tdep.c (alpha_sigtramp_frame_sniffer): Use pc_in_sigtramp.
+	* alpha-tdep.h (struct gdbarch_tdep): Add pc_in_sigtramp.
+	* alphafbsd-tdep.c (alphafbsd_init_abi): Update.
+	* alpha-osf1-tdep.c (alpha_osf1_init_abi): Update.
+	* alpha-linux-tdep.c (alpha_linux_init_abi): Update.
+
+	* Makefile.in (m68klinux-nat.o): Update dependencies.
+	* m68klinux-tdep.c: Include "trad-frame.h" and "frame-unwind.h".
+	(m68k_linux_sigtramp_frame_cache)
+	(m68k_linux_sigtramp_frame_this_id)
+	(m68k_linux_sigtramp_frame_prev_register)
+	(m68k_linux_sigtramp_frame_unwind)
+	(m68k_linux_sigtramp_frame_sniffer)
+	(struct m68k_linux_sigtramp_info, m68k_linux_init_abi): Code from
+	m68k-tdep.h and m68k-tdep.c, add "linux" to function and variable
+	names, use trad-frame.h.
+	* m68k-tdep.h (struct gdbarch_tdep): Delete get_sigtramp_info.
+	(struct m68k_sigtramp_info): Delete.
+	* m68k-tdep.c (m68k_sigtramp_frame_cache)
+	(m68k_sigtramp_frame_this_id, m68k_sigtramp_frame_prev_register)
+	(m68k_sigtramp_frame_unwind, m68k_sigtramp_frame_sniffer)
+	(m68k_gdbarch_init): Delete all the sigtramp code, moved to
+	"m68klinux-tdep.c".
+
+	* infrun.c (check_sigtramp2): Delete check for
+	DEPRECATED_PC_IN_SIGTRAMP and INNER_THAN.
+
+2004-05-01  Mark Kettenis  <kettenis@gnu.org>
+
+	* m68k-tdep.h (m68kbsd_fpreg_offset): New prototype.
+
+2004-05-01  Andrew Cagney  <cagney@redhat.com>
+
+	* frv-linux-tdep.c: Include "trad-frame.h" and "frame-unwind.h".
+	(frv_linux_sigtramp_frame_cache)
+	(frv_linux_sigtramp_frame_this_id)
+	(frv_linux_sigtramp_frame_prev_register)
+	(frv_linux_sigtramp_frame_unwind)
+	(frv_linux_sigtramp_frame_sniffer): Copied from frv-tdep.c,
+	include "linux" in function and variable names, directly call
+	frv_linux_pc_in_sigtramp and frv_linux_sigcontext_reg_addr, use
+	the latest trad-frame code.
+	(frv_linux_init_abi): Append frv_linux_sigtramp_frame_sniffer, do
+	not set frv_sigcontext_reg_addr or deprecated_pc_in_sigtramp
+	* Makefile.in (frv-linux-tdep.o): Update dependencies.
+	* frv-tdep.h (frv_set_sigcontext_reg_addr): Delete declaration.
+	* frv-tdep.c (frv_sigtramp_frame_cache)
+	(frv_sigtramp_frame_this_id, frv_sigtramp_frame_prev_register)
+	(frv_sigtramp_frame_unwind, frv_sigtramp_frame_sniffer): Moved to
+	frv-linux-tdep.c.
+	(frv_gdbarch_init): Do not append a sigtramp sniffer.
+	(struct gdbarch_tdep): Delete sigcontext_reg_addr.
+	(frv_set_sigcontext_reg_addr): Delete function.
+
+	* gdbarch.sh (DEPRECATED_SIGTRAMP_START)
+	(DEPRECATED_SIGTRAMP_END): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* arch-utils.c (legacy_pc_in_sigtramp): Simplify.
+	* config/vax/tm-vaxbsd.h: Update copyright.
+	(DEPRECATED_SIGTRAMP_START, DEPRECATED_SIGTRAMP_END): Delete.
+	(DEPRECATED_IN_SIGTRAMP): Define.
+	* config/m68k/tm-nbsd.h: Update copyright.
+	(DEPRECATED_SIGTRAMP_START, DEPRECATED_SIGTRAMP_END): Delete.
+	(DEPRECATED_IN_SIGTRAMP): Define.
+
+2004-05-01  Mark Kettenis  <kettenis@gnu.org>
+
+	* dwarf2-frame.c (read_encoded_value): Handle DW_EH_PE_funcrel
+	encondings.  Fixes PR gdb/1628.
+
+	* dwarf2-frame.c (execute_cfa_program): Complain if we encounter a
+	DW_CFA_restore state without a matching DW_CFA_remember_state
+	instead of aborting.  Fixes PR backtrace/1589.
+
+2004-04-30  Joel Brobecker  <brobecker@gnat.com>
+
+	* MAINTAINERS: Add self as AIX maintainer.
+	Update my e-mail address in write-after-approval section.
+
+2004-04-30  Andrew Cagney  <cagney@redhat.com>
+
+	* frame.c (frame_type_from_pc): Delete call to PC_IN_SIGTRAMP.
+	(legacy_get_prev_frame): Ditto.
+
+	* mips-tdep.c (mips_pc_in_sigtramp): Delete.
+	(mips_gdbarch_init): Do not set pc_in_sigtramp.
+	* mipsread.c (sigtramp_address): Delete extern variable.
+	(mipscoff_new_init): Delete reference.
+	* mdebugread.c (sigtramp_address, sigtramp_end): Delete variables.
+	(fixup_sigtramp): Delete function.
+	* config/mips/tm-mips.h (sigtramp_address, sigtramp_end)
+	(fixup_sigtramp): Delete declarations.
+
+	* ppcnbsd-tdep.c (ppcnbsd_init_abi): Do not set
+	deprecated_pc_in_sigtramp.
+	(ppcnbsd_pc_in_sigtramp): Delete function.
+
+2004-05-01  Mark Kettenis  <kettenis@gnu.org>
+
+	* config/m68k/nm-nbsd.h: Tweak comments.
+	* config/m68k/nm-nbsdaout.h: Likewise.
+
+2004-04-30  Andrew Cagney  <cagney@redhat.com>
+
+	* arm-tdep.c (arm_sigtramp_unwind_sniffer): Call
+	legacy_pc_in_sigtramp.
+	* ia64-tdep.c (ia64_sigtramp_frame_sniffer): Ditto.
+
+2004-05-01  Mark Kettenis  <kettenis@gnu.org>
+
+	Add OpenBSD/m68k support.
+	* NEWS (New native configurations): Mention OpenBSD/m68k.
+	* m68kbsd-tdep.c: New file.
+	* m68kbsd-nat.c: New file.
+	* Makefile.in (ALLDEPFILES): Add m68kbsd-nat.c and m68kbsd-tdep.c.
+	(m68kbsd-nat.o, m68kbsd-tdep.o): New dependencies.
+	* configure.host: Add m68k-*-openbsd.
+	* configure.tgt: Add m68k-*-openbsd.
+	* config/m68k/tm-obsd.h: New file.
+	* config/m68k/obsd.mt: New file.
+	* config/m68k/obsd.mh: New file.
+	* config/djgpp/fnchange.lst: Add entries for m68kbsd-nat.c and
+	m68kbsd-tdep.c.
+
+2004-04-30  Andrew Cagney  <cagney@redhat.com>
+
+	* mipsnbsd-tdep.c (mipsnbsd_pc_in_sigtramp): Delete function.
+	(mipsnbsd_init_abi): Do not set pc_in_sigtramp.
+
+2004-04-30  Mark Kettenis  <kettenis@gnu.org>
+
+	* m68k-tdep.c (REMOTE_BPT_VECTOR): Remove define.
+	* config/m68k/tm-nbsd.h (REMOTE_BPT_VECTOR): Remove define.
+
+2004-04-30  Brian Ford  <ford@vss.fsi.com>
+
+	Revert 2004-04-16 change.
+	* i386-tdep.c (i386_gdbarch_init): Fix comment typos.
+	(i386_coff_init_abi): Remove.
+	* i386-tdep.h (i386_coff_init_abi): Remove.
+	* i386-cygwin-tdep.c (i386_cygwin_init_abi): Remove call to above.
+
+2004-04-30  Andrew Cagney  <cagney@redhat.com>
+
+	* blockframe.c (find_pc_partial_function): Delete use of
+	DEPRECATED_PC_IN_SIGTRAMP, DEPRECATED_SIGTRAMP_START and
+	DEPRECATED_SIGTRAMP_END.
+
+	* config/mips/tm-linux.h (DEPRECATED_IN_SIGTRAMP): Delete.
+	* config/mips/tm-irix6.h (DEPRECATED_IN_SIGTRAMP): Delete.
+	* config/mips/tm-nbsd.h: Delete undef DEPRECATED_IN_SIGTRAMP.
+	* config/mips/tm-irix5.h (DEPRECATED_IN_SIGTRAMP): Delete.
+	* config/arm/tm-embed.h (DEPRECATED_IN_SIGTRAMP): Delete.
+
+	* defs.h (deprecated_inside_entry_file): Delete declaration.
+	* blockframe.c (deprecated_inside_entry_file): Delete function.
+	(legacy_frame_chain_valid): Delete call.
+	* sh64-tdep.c (sh64_frame_chain): Delete call.
+	* objfiles.h: Update comments.
+	* i386-interix-tdep.c (i386_interix_frame_chain_valid): Delete
+	call.
+	* frame.c (get_prev_frame): Delete call, update comments.
+
+2004-04-30  Brian Ford  <ford@vss.fsi.com>
+
+	* MAINTAINERS (Write After Approval): Add myself.
+
+2004-04-30  Andrew Cagney  <cagney@redhat.com>
+
+	* gdbarch.sh (BELIEVE_PCC_PROMOTION_TYPE): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* stabsread.c (define_symbol): Delete BELIEVE_PCC_PROMOTION_TYPE
+	code.
+
+2004-04-30  Andrew Cagney  <cagney@redhat.com>
+
+	* gdb-events.sh (selected_thread_changed)
+	(selected_frame_level_changed, target_changed): Delete.
+	* gdb-events.h, gdb-events.c: Re-generate.
+	* valops.c (value_assign): Update.
+	* stack.c (select_frame_command, up_silently_base)
+	(down_silently_base): Update.
+
+2004-04-29  Andrew Cagney  <cagney@redhat.com>
+
+	* mips-tdep.c (mips_register_type): Re-write, handle 32-bit ABI
+	registers correctly.
+	(print_gp_register_row, mips32_heuristic_proc_desc)
+	(mips_n32n64_push_dummy_call, mips_o32_push_dummy_call)
+	(mips_o64_push_dummy_call, mips_eabi_push_dummy_call): Eliminate
+	references to mips_isa_regsize.
+
+2004-04-29  Andrew Cagney  <cagney@redhat.com>
+
+	* mips-tdep.c (struct gdbarch_tdep): Delete
+	mips_fp_register_double.
+	(FP_REGISTER_DOUBLE): Delete macro, replace with test for
+	mips_abi_regsize.
+	(mips_gdbarch_init): Do not set mips_fp_register_double.
+	(mips_dump_tdep): Do not print FP_REGISTER_DOUBLE.
+
+2004-04-29  Joel Brobecker  <brobecker@gnat.com>
+
+	Committed by Andrew Cagney.
+        * infrun.c (handle_inferior_event): Rely on frame IDs to detect
+        function calls.
+
+2004-04-29  Andrew Cagney  <cagney@redhat.com>
+
+	* mips-tdep.c (mips_abi_regsize): Replace tdep parameter with
+	gdbarch, use mips_abi, update callers.
+	(mips_stack_argsize): Replace tdep parameter with gdbarch, use
+	mips_abi_regsize, update callers.
+	(struct gdbarch_tdep): Delete mips_default_stack_argsize and
+	mips_default_abi_regsize.
+	(mips_gdbarch_init): Do not set mips_default_stack_argsize and
+	mips_default_abi_regsize.
+
+2004-04-29  Andrew Cagney  <cagney@redhat.com>
+
+	* mips-tdep.c (mips_abi_regsize): Rename mips_saved_regsize.
+	(mips_abi_regsize_string): Rename mips_saved_regsize_string.
+	(struct gdbarch_tdep): Rename mips_default_saved_regsize to
+	mips_default_abi_regsize.
+	(mips_isa_regsize): Rename mips_regisze.
+	* mipsnbsd-tdep.c: Update.
+	* mips-linux-tdep.c: Update.
+	* irix5-nat.c: Update.
+	* mips-tdep.h (mips_isa_regsize): Update.
+
+	* gdb-events.sh (WITH_GDB_EVENTS): Delete macro and references.
+	Delete all disabled code.
+	* gdb-events.h, gdb-events.c: Re-generate.
+	
+2004-04-19  Jerome Guitton  <guitton@gnat.com>
+	    Mark Kettenis  <kettenis@gnu.org>
+
+	* i386-tdep.c (i386_skip_prologue): follow the last jump only if
+	the function begins with a branch instruction.
+
+2004-04-29  Mark Kettenis  <kettenis@gnu.org>
+
+	* i386-tdep.c: Fix spelling mistakes.
+
+2004-04-28  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+	    Andrew Cagney  <cagney@redhat.com>
+
+	* configure.in (mips-sgi-irix5*): Define _KMEMUSER for
+	<sys/proc.h>.
+	* acconfig.h: Provide default _KMEMUSER value.
+	* config.in, configure: Re-generate.
+	* NEWS: Mention fix.
+
+2004-04-24  Randolph Chung  <tausq@debian.org>
+
+	* configure.host (hppa*-*-linux*): New target.
+	* configure.tgt (hppa*-*-linux*): Likewise.
+	* hppa-tdep.c (hppa_gdbarch_init): Set cannot_fetch_register, move
+	gdbarch_init_osabi() call earlier so that osabi-specific frame
+	unwinders can be registered first.
+	* config/djgpp/fnchange.lst: Add entries for hppa-linux-tdep.c and
+	hppa-linux-nat.c.
+	* config/pa/tm-hppa.h (ISR_REGNUM, PID0_REGNUM, PID1_REGNUM)
+	(PID2_REGNUM, PID3_REGNUM): Add definitions of some register numbers.
+	* config/pa/linux.mh: New file.
+	* config/pa/linux.mt: New file.
+	* config/pa/nm-linux.h: New file.
+	* config/pa/xm-linux.h: New file.
+	* hppa-linux-nat.c: New file.
+	* hppa-linux-tdep.c: New file.
+
+2004-04-28  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa32_return_value): Handle both 4- and 8-byte fp
+	return values.
+	(hppa32_push_dummy_call): Fix small struct and floating point argument 
+	passing, and make sure the stack frame is properly aligned.
+
+2004-04-28  Andrew Cagney  <cagney@redhat.com>
+
+	* stack.c (print_stack_frame): Fix description.
+
+	* NEWS: Mention gdb/gdbserver/configure execute permission
+	changed.  PR server/519.
+
+2004-04-28  Andrew Cagney  <cagney@redhat.com>
+
+	* stack.c (print_stack_frame_stub): Delete declaration.
+	(struct print_stack_frame_args, print_stack_frame)
+	(print_frame_info, print_frame): Replace "source" with print what.
+	Replace "print" with "print_level".  Replace "args" with
+	"print_args".
+	* frame.h (show_and_print_stack_frame, print_stack_frame)
+	(print_frame_info): Update declarations.
+	* stack.c (select_and_print_frame, frame_command)
+	(current_frame_command, up_command, down_command): Update calls -
+	use get_selected_frame, pass "enum print_what" for source, do not
+	call frame_relative_level.
+	* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Ditto.
+	* remote-rdp.c (remote_rdp_open): Ditto.
+	* remote-mips.c (common_open): Ditto.
+	* remote-e7000.c (e7000_start_remote): Ditto.
+	* ocd.c (ocd_start_remote): Ditto.
+	* mi/mi-main.c (mi_cmd_exec_return): Ditto.
+	* infrun.c (normal_stop): Ditto.
+	* inflow.c (kill_command): Ditto.
+	* infcmd.c (finish_command): Ditto.
+	* corelow.c (core_open): Ditto.
+	* tracepoint.c (finish_tfind_command): Ditto.
+	* thread.c (info_threads_command, info_threads_command) 
+	(restore_current_thread, do_captured_thread_select): Ditto.
+	* ada-tasks.c (task_command): Ditto.
+
+2004-04-26  Orjan Friberg <orjanf@axis.com>
+
+	* frame.c: Include "observer.h".
+	(frame_observer_target_changed): New function.
+	(_initialize_frame): Attach target_changed observer.
+	* regcache.c: Include "observer.h".
+	(regcache_observer_target_changed): New function.
+	(_initialize_regcache): Attach target_changed observer.
+	* valops.c: Include "observer.h".
+	(value_assign): Notify target_changed event when modifying register.
+	* Makefile.in (frame.o, regcache.o, valops.o): Add $(observer_h).
+
+2004-04-26  Orjan Friberg <orjanf@axis.com>
+
+	From Paul Koning <pkoning@equallogic.com>:
+	* breakpoint.c (free_valchain): New function.
+	(insert_bp_location, delete_breakpoint): Use free_valchain.
+	(remove_breakpoint): Do not remove the valchain.
+	(bpstat_stop_status): If not stopped by watchpoint, skip
+	watchpoints when generating stop status list.
+	* infrun.c (handle_inferior_event): Make
+	stepped_after_stopped_by_watchpoint a global variable.
+	* remote.c (remote_stopped_data_address): Return watch data
+	address rather than zero if stepped_after_stopped_by_watchpoint is
+	set.
+
+2004-04-25  Michael Chastain  <mec.gnu@mindspring.com>
+
+	Fix PR gdb/1626.
+	* configure.in: Check for curses after termcap.
+	On osf5.*, do not check for ncurses.
+	* configure: Regenerate.
+
+2004-04-25  Mark Kettenis  <kettenis@gnu.org>
+
+	* ppcobsd-nat.c: Include "ppc-tdep.h".
+	* Makefile.in (ppcobsd-nat.o): Update dependencies.
+
+	* stack.c (return_command): Use CHECK_TYPEDEF on the return type.
+	Fixes PR tdep/1623 and PR tdep/1624.
+
+2004-04-24  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* xmodem.h, xmodem.c: Remove files.
+	* Makefile.in: Remove references to xmodem.h, xmodem.c.
+
+2004-04-23  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_stub_unwind_cache, hppa_stub_frame_unwind_cache)
+	(hppa_stub_frame_this_id, hppa_stub_frame_prev_register)
+	(hppa_stub_frame_unwind, hppa_stub_unwind_sniffer): New stub unwinder
+	for handling stackless frames.
+	(hppa_gdbarch_init): Link in hppa_stub_unwind_sniffer. 
+
+2004-04-23  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_frame_cache): Handle the case when frame unwind
+	starts at a pc before the frame is created.
+
+2004-04-23  Joel Brobecker  <brobecker@gnat.com>
+
+	* ChangeLog-2002: Fix year in one of the ChangeLog entries.
+
+2004-04-23  Jerome Guitton  <guitton@gnat.fr>
+
+	* rs6000-tdep.c (rs6000_extract_return_value): When extracting a float,
+	use convert_typed_floating to get the appropriate format.
+
+2004-04-22  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.h (find_unwind_entry, hppa_get_field, hppa_extract_5_load)
+	(hppa_extract_5R_store, hppa_extract_5r_store, hppa_extract_17)
+	(hppa_extract_21, hppa_extract_14, hppa_low_sign_extend)
+	(hppa_sign_extend): Add prototype.
+	* hppa-tdep.c (get_field, extract_5_load, extract_5R_store)
+	(extract_5r_store, extract_17, extract_21, extract_14, low_sign_extend)
+	(sign_extend): Rename with hppa_ prefix and make non-static.  Other
+	hppa targets will also use these functions.
+	(find_unwind_entry): Remove prototype (moved to hppa-tdep.h).
+	(hppa_in_solib_call_trampoline, hppa_in_solib_return_trampoline)
+	(hppa_skip_trampoline_code): Move to hppa-hpux-tdep.c
+	(hppa_gdbarch_init): Remove gdbarch setting of 
+	skip_trampoline_code, in_solib_call_trampoline and
+	in_solib_return_trampoline.
+	* hppa-hpux-tdep.c (hppa32_hpux_in_solib_call_trampoline)
+	(hppa64_hpux_in_solib_call_trampoline): New functions, split from
+	hppa_in_solib_call_trampoline.
+	(hppa_hpux_in_solib_return_trampoline, hppa_hpux_skip_trampoline_code):
+	Moved from hppa-tdep.c.
+ 	(hppa_hpux_init_abi): Set gdbarch for skip_trampoline_code, 
+	in_solib_call_trampoline and in_solib_return_trampoline.
+
+2004-04-22  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_debug): New variable.
+	(find_unwind_entry, hppa_frame_cache): Add debug output.
+	(_initialize_hppa_tdep): Add command to set debug flag.
+
+2004-04-22  Andrew Cagney  <cagney@redhat.com>
+
+	* ppcnbsd-tdep.c: Update copyright.  Include "tramp-frame.h" and
+	"trad-frame.h".
+	(ppcnbsd_sigtramp_cache_init, ppcnbsd_sigtramp): Implement a NetBSD
+	signal trampoline unwinder.
+	(ppcnbsd_init_abi): Register ppcnbsd_sigtramp.
+
+2004-04-22  Mark Kettenis  <kettenis@gnu.org>
+
+	Add OpenBSD/powerpc support.
+	* NEWS (New native configurations): Mention OpenBSD/powerpc.
+	* ppc-tdep.h (struct ppc_reg_offsets): New structure.
+	(ppc_supply_gregset, ppc_supply_fpregset, ppc_collect_gregset)
+	(ppc_collect_fpregset): New prototypes.
+	* ppcobsd-nat.c: New file.
+	* ppcobsd-tdep.c: New file.
+	* ppcobsd-tdep.h: New file.
+	* rs6000-tdep.c: Include "regset.h".
+	(ppc_supply_reg, ppc_collect_reg, ppc_supply_gregset)
+	(ppc_supply_fpregset, ppc_collect_gregset, ppc_collect_fpregset):
+	New functions.
+	* Makefile.in (ALLDEPFILES): Add pccobsd-nat.c and ppcobsd-tdep.c.
+	(ppcobsd-nat.o, ppcobsd-tdep.o): New dependencies.
+	(rs6000-tdep.o): Update dependencies.
+	* configure.host: Add powerpc-*-openbsd.
+	* configure.tgt: Add powerpc-*-openbsd.
+	* config/powerpc/obsd.mh: New file.
+	* config/powerpc/nm-obsd.h: New file.
+	* config/powerpc/obsd.mt: New file.
+
+2004-04-22  Andrew Cagney  <cagney@redhat.com>
+
+	* frame.h (show_frame_info): Delete declaration.
+
+	* arm-tdep.c (arm_prologue_this_id): Delete redundant cycle test.
+	* m68hc11-tdep.c (m68hc11_frame_this_id): Ditto.
+	* m32r-tdep.c (m32r_frame_this_id): Ditto.
+	* frv-tdep.c (frv_frame_this_id): Ditto.
+	* avr-tdep.c (avr_frame_this_id): Ditto.
+
+2004-04-22  Elena Zannoni  <ezannoni@redhat.com>
+
+	* MAINTAINERS: Drop maintenance of gdb.stabs, and linespec.c.
+
+2004-04-22  Jim Blandy  <jimb@redhat.com>
+
+	* ppc-linux-nat.c (ppc_register_u_addr): Don't assume that r0 is
+	register number zero.
+
+2004-04-21  Michael Snyder  <msnyder@redhat.com>
+
+	* mips-tdep.c (heuristic_proc_start): 
+	Warning() already prefixes "Warning: ".
+
+2004-04-21  Andrew Cagney  <cagney@redhat.com>
+
+	* annotate.h (deprecated_annotate_starting_hook)
+	(deprecated_annotate_stopped_hook)
+	(deprecated_annotate_exited_hook)
+	(deprecated_annotate_signal_hook)
+	(deprecated_annotate_signalled_hook): Deprecate.
+	* tracepoint.h (deprecated_create_tracepoint_hook)
+	(deprecated_delete_tracepoint_hook)
+	(deprecated_modify_tracepoint_hook)
+	(deprecated_trace_find_hook)
+	(deprecated_trace_start_stop_hook): Deprecate.
+	* target.h (deprecated_target_new_objfile_hook): Deprecate.
+	* remote.h (deprecated_target_resume_hook)
+	(deprecated_target_wait_loop_hook): Deprecate.
+	* gdbcore.h (deprecated_exec_file_display_hook)
+	(deprecated_file_changed_hook): Deprecate.
+	* frame.h (deprecated_selected_frame_level_changed_hook): Deprecate.
+	* defs.h (deprecated_modify_breakpoint_hook)
+	(deprecated_command_loop_hook, deprecated_show_load_progress)
+	(deprecated_print_frame_info_listing_hook)
+	(deprecated_query_hook, deprecated_warning_hook)
+	(deprecated_flush_hook, deprecated_create_breakpoint_hook)
+	(deprecated_delete_breakpoint_hook)
+	(deprecated_interactive_hook, deprecated_registers_changed_hook)
+	(deprecated_readline_begin_hook, deprecated_readline_hook)
+	(deprecated_readline_end_hook, deprecated_register_changed_hook)
+	(deprecated_memory_changed_hook, deprecated_init_ui_hook)
+	(deprecated_context_hook, deprecated_target_wait_hook)
+	(deprecated_attach_hook, deprecated_detach_hook)
+	(deprecated_call_command_hook, deprecated_set_hook)
+	(deprecated_error_hook, deprecated_error_begin_hook)
+	(deprecated_ui_load_progress_hook): Deprecate.
+	* valops.c, uw-thread.c, utils.c, tui/tui-io.c: Update.
+	* tui/tui-hooks.c, tracepoint.c, top.c, thread-db.c: Update.
+	* target.c, symfile.c, stack.c, sol-thread.c, rs6000-nat.c: Update.
+	* remote.c, remote-mips.c, regcache.c, mi/mi-interp.c: Update.
+	* main.c, interps.c, infcmd.c, hpux-thread.c, frame.c: Update.
+	* exec.c, dsrec.c, d10v-tdep.c, corefile.c, complaints.c: Update.
+	* cli/cli-script.c, cli/cli-setshow.c, breakpoint.c: Update.
+	* annotate.c, aix-thread.c: Update.
+
+2004-04-21  Andrew Cagney  <cagney@redhat.com>
+
+	* Makefile.in (vaxnbsd-tdep.o): Update dependencies.
+	* vaxnbsd-tdep.c: Include "gdb_string.h".
+
+	* symfile.c (symbol_file_add_from_memory): #if 0 function.
+	(add_symbol_file_from_memory_command): #if 0 function body, call
+	error instead.
+
+2004-04-21  Andrew Cagney  <cagney@redhat.com>
+
+	* gdbcore.h: Update copyright.
+	(deprecated_add_core_fns): Rename add_core_fns.
+	* win32-nat.c (_initialize_core_win32): Update.
+	* sun3-nat.c (_initialize_core_sun3): Update.
+	* shnbsd-tdep.c (_initialize_shnbsd_tdep): Update.
+	* rs6000-nat.c (_initialize_core_rs6000): Update.
+	* ppcnbsd-tdep.c (_initialize_ppcnbsd_tdep): Update.
+	* nto-tdep.c (_initialize_nto_tdep): Update.
+	* ns32knbsd-nat.c (_initialize_ns32knbsd_nat): Update.
+	* mipsnbsd-tdep.c (_initialize_mipsnbsd_tdep): Update.
+	* mips-nat.c (_initialize_core_mips): Update.
+	* mips-linux-tdep.c (_initialize_mips_linux_tdep): Update.
+	* m68knbsd-nat.c (_initialize_m68knbsd_nat): Update.
+	* m68klinux-nat.c (_initialize_m68k_linux_nat): Update.
+	* lynx-nat.c (_initialize_core_lynx): Update.
+	* irix5-nat.c (_initialize_core_irix5): Update.
+	* i386-interix-nat.c (_initialize_core_interix): Update.
+	* cris-tdep.c (_initialize_cris_tdep): Update.
+	* corelow.c (deprecated_add_core_fns): Update.
+	* core-regset.c (_initialize_core_regset): Update.
+	* core-aout.c (_initialize_core_aout): Update.
+	* armnbsd-nat.c (_initialize_arm_netbsd_nat): Update.
+	* alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Update.
+	* alpha-nat.c (_initialize_core_alpha): Update.
+
+2004-04-21  Jim Blandy  <jimb@redhat.com>
+
+	* rs6000-tdep.c (registers_e500, registers_7400): Doc fixes.
+
+2004-04-19  Daniel Jacobowitz  <drow@mvista.com>
+
+	* dwarf2read.c (dwarf2_tmp_obstack, dwarf2_free_tmp_obstack):
+	Delete.
+	(dwarf_alloc_block): Take a CU argument.  Use the comp_unit_obstack.
+	(read_attribute_value): Update calls to dwarf_alloc_block.
+	(dwarf2_build_psymtabs_hard): Don't initialize or clean up
+	dwarf2_tmp_obstack.
+	(psymtab_to_symtab_1): Likewise.  Clean up using
+	free_stack_comp_unit.
+	(add_to_cu_func_list): Use the comp_unit_obstack.
+
+2004-04-19  Joel Brobecker  <brobecker@gnat.com>
+
+	* dwarf2read.c (dwarf2_flag_true_p): New function.
+	(die_is_declaration): Use the function above. Add some comments.
+
+2004-04-19  Mark Kettenis  <kettenis@gnu.org>
+
+	* sparcnbsd-tdep.c (_initialize_sparnbsd_tdep): Specify
+	architecture when registering sparcnbsd_core_osabi_sniffer.
+	Adjust comment.
+
+2004-04-18  Mark Kettenis  <kettenis@gnu.org>
+
+	* infcall.c (find_function_addr): Add FUNCTION_START_OFFSET to
+	return value.
+
+	Based on a patch from Brian Ford <ford@vss.fsi.com>:
+	* i386-tdep.c: Correct register numbering scheme comments
+	throughout.
+	(i386_stab_reg_to_regnum): Rename to i386_dbx_reg_to_regnum.
+	(i386_dwarf_reg_to_regnum): Rename to i386_svr4_reg_to_regnum.
+	(i386_coff_init_abi, i386_elf_init_abi): Accomodate renames above.
+	(i386_gdb_arch_init): Likewise.
+
+	* Makefile.in (ALLDEPFILES): List ppc-sysv-tdep.c, ppcnbsd-nat.c
+	and ppcnbsd-tdep.c instead of ppc-sysv-tdep.o, ppcnbsd-nat.o and
+	ppcnbsd-tdep.o.
+
+	* m68k-tdep.h: Tweak comments.
+	* m68k-tdep.c: Tweak comment.
+
+2004-04-17  Randolph Chung  <tausq@debian.org>
+
+	* Makefile.in (hppa-hpux-tdep.o): Add $(hppa_tdep_h).
+	* hppa-hpux-tdep.c (hppa-tdep.h): Include.
+ 	(hppa_hpux_som_init_abi): Set is_elf to 0.
+ 	(hppa_hpux_elf_init_abi): Set is_elf to 1.
+	* hppa-tdep.c (low_text_segment_address): Remove global.
+	(record_text_segment_lowaddr): Pass in low address as parameter. Use
+	section offset to calculate segment address.
+	(internalize_unwinds): Define low_text_segment_address as local and
+	pass to record_text_segment_lowaddr for ELF targets.
+	(hppa_gdbarch_init): Zero fill tdep structure.
+	(hppa_dump_tdep): Print tdep structure.
+	* hppa-tdep.h (gdbarch_tdep): Add is_elf member to tdep structure.
+
+2004-04-17  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_pseudo_register_read): Define.
+	(hppa_gdbarch_init): Set pseudo_register_read.
+	* config/pa/tm-hppa.h (DEPRECATED_CLEAN_UP_REGISTER_VALUE): Remove.
+	* regcache.c (supply_register): Remove check for
+	DEPRECATED_CLEAN_UP_REGISTER_VALUE since we've removed the last user.
+
+2004-04-17  Randolph Chung  <tausq@debian.org>
+
+	* Makefile.in (hpread.o, pa64solib.o, somsolib.o): Add $(hppa_tdep_h)
+	* hppa-tdep.h (INSTRUCTION_SIZE): Move from tm-hppa.h.
+	(hpread_adjust_stack_address): Move to hpread.c.
+	* hppa-tdep.h (unwind_table_entry, unwind_stub_types, obj_unwind_info,
+	obj_private_struct): Move from tm-hppa.h.
+	* hpread.c (hppa-tdep.h): Include.
+	(hpread_adjust_stack_address): Move from hppa-tdep.c.
+	(hpread_read_function_type, hpread_read_doc_function_type)
+	(hpread_process_one_debug_symbol): Call hpread_adjust_stack_address 
+	directly.
+	* pa64solib.c (hppa-tdep.h): Include.
+	* somsolib.c (hppa-tdep.h): Include.
+	* config/pa/tm-hppa.h (frame_info, frame_saved_regs, value, type,
+	inferior_status): Remove unused forward declarations.
+	(INSTRUCTION_SIZE): Move to hppa-tdep.c.
+	(unwind_table_entry, unwind_stub_types, obj_unwind_info, 
+	obj_private_struct): Move to hppa-tdep.h.
+	(HPREAD_ADJUST_STACK_ADDRESS): Remove.
+
+2004-04-17  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_reg_struct_has_addr, hppa_skip_prologue)
+	(hppa_skip_trampoline_code, hppa_in_solib_call_trampoline)
+	(hppa_in_solib_return_trampoline, hppa_cannot_store_register)
+	(hppa_smash_text_address, hppa_target_read_pc, hppa_target_write_pc):
+	Remove forward declaration and make static.
+	(hppa_reg_struct_has_addr): Remove.
+
+2004-04-16  Joel Brobecker  <brobecker@gnat.com>
+
+	* observer.sh: Move comments in sed command to first column.
+
+2004-04-16  Jason Molenda  (jmolenda@apple.com)
+
+	* frame.c: Minor typeo corrections in comments.
+
+2004-04-16  Joel Brobecker  <brobecker@gnat.com>
+
+	* observer.c (observer_test_first_notification_function): Update
+	function profile.
+	(observer_test_second_notification_function): Likewise.
+	(observer_test_third_notification_function): Likewise.
+
+2004-04-16  Mark Kettenis  <kettenis@gnu.org>
+
+	From Brian Ford <ford@vss.fsi.com>:
+	* i386-tdep.c (i386_coff_init_abi): New function.
+	* i386-tdep.h (i386_coff_init_abi): New prototype.	
+	* i386-cygwin-tdep.c (i386_cygwin_init_abi): Call it.  Use correct
+	register number translation functions for DWARF and DWARF 2.
+
+2004-04-16  Joel Brobecker  <brobecker@gnat.com>
+
+        * dwarf2read.c: Back out my previous change, it was incorrect.
+
+2004-04-16  Daniel Jacobowitz  <drow@mvista.com>
+
+	* dwarf2read.c: Include "hashtab.h".
+	(struct dwarf2_cu): Add partial_dies, comp_unit_obstack,
+	has_namespace_info.
+	(struct partial_die_info): Add comments.  Use bitfields to reduce
+	memory footprint.  Add scope, scope_set, has_specification,
+	spec_offset, die_parent, die_child, and die_sibling.
+	(peek_die_abbrev): Add prototype.
+	(partial_read_comp_unit_head): New function, broken out from
+	dwarf2_build_psymtabs_hard.
+	(dwarf2_build_psymtabs_hard): Remove unused variable abbrev_ptr.
+	Use partial_read_comp_unit_head.  Initialize the CU and
+	comp_unit_obstack.  Update calls to read_partial_die and
+	scan_partial_symbols.  Use free_stack_comp_unit and
+	load_partial_dies.
+	(scan_partial_symbols): Change PDI to a pointer.  Use the child and
+	sibling pointers to walk partial DIEs.  Call fixup_partial_die.
+	Update calls to helper functions.  Remove NAMESPACE argument.
+	Update comments.
+	(partial_die_parent_scope, partial_die_full_name): New functions.
+	(add_partial_symbol): Remove namespace argument.  Update call to
+	pdi_needs_namespace.  Use partial_die_full_name.  Handle
+	DW_TAG_namespace.  Check has_namespace_info flag.
+	(pdi_needs_namespace): Remove NAMESPACE argument.  Just check the
+	tag.  Handle namespaces.
+	(add_partial_namespace, add_partial_enumeration): Simplify.
+	(guess_structure_name): New function, derived from
+	add_partial_structure.
+	(add_partial_structure): Remove.
+	(determine_class_name): Update comment.
+	(dwarf2_read_abbrevs): Set has_namespace_info flag.
+	(is_type_tag_for_partial, load_partial_dies): New functions.
+	(read_partial_die): Pass abbrev and abbrev_len as arguments.
+	Record specifications instead of following them immediately.
+	(find_partial_die_in_comp_unit, find_partial_die)
+	(fixup_partial_die, free_stack_comp_unit)
+	(hashtab_obstack_allocate, dummy_obstack_deallocate)
+	(partial_die_hash, partial_die_eq): New functions.
+	* Makefile.in (hashtab_h): Define.
+	(dwarf2read.o): Update dependencies.
+	(observer_inc, observer_h): Move to the correct section.
+
+2004-04-15  Joel Brobecker  <brobecker@gnat.com>
+
+	* dwarf2read.c (dwarf2_attribute_true_p): New function.
+	(die_is_declaration): Use the function above. Add comment.
+
+2004-04-15  Joel Brobecker  <brobecker@gnat.com>
+
+	* dwarf2read.c (read_structure_scope): Identify stub types
+	using die_is_declaration() only.
+
+2004-04-15  Roland McGrath  <roland@redhat.com>
+
+	* symfile.c (symbol_file_add_with_addrs_or_offsets): Take ABFD as
+	argument instead of NAME.
+	(symbol_file_add, reread_separate_symbols): Call symfile_bfd_open
+	in call to symbol_file_add_with_addrs_or_offsets.
+	(build_addr_info): New function, helper for ...
+	(symbol_file_add_from_memory): New function.
+	(add_symbol_file_from_memory_command): New function using that.
+	(_initialize_symfile): Register it for add-symbol-file-from-memory.
+	(pre_add_symbol_hook): Add const to argument type.
+	* symfile.h (symbol_file_add_from_memory): Declare it.
+
+2004-04-15  Mark Kettenis  <kettenis@gnu.org>
+
+	* NEWS (New native configurations): Mention OpenBSD/vax.
+	* configure.host: Add vax-*-openbsd*.
+	* config/vax/obsd.mh: New file.
+	* config/vax/nm-obsd.h: New file.
+
+	* vax-tdep.c: Include "regset.h".
+	(vax_supply_gregset): New function.
+	(vax_gregset): New variable.
+	(vax_regset_from_core_section): New function.
+	(vax_gdbarch_init): Set regset_from_core_section.
+	* Makefile.in (vax-tdep.o): Update dependencies.
+
+2004-04-15  Andrew Cagney  <cagney@redhat.com>
+
+	* observer.c (normal_stop_subject, observer_notify_normal_stop)
+	(observer_normal_stop_notification_stub)
+	(observer_attach_normal_stop, observer_detach_normal_stop):
+	Delete, replaced by #include "observer.inc".
+	* infrun.c (normal_stop): Pass "stop_bpstat" to
+	observer_notify_normal_stop.
+	* Makefile.in (observer_inc): Define.
+	(observer.o): Update dependencies.
+	(observer.h, observer.inc): New rules.
+	* observer.h: Delete file.
+	* observer.sh: New file.
+
+2004-04-15  Mark Kettenis  <kettenis@gnu.org>
+
+	* vax-tdep.c (vax_frame_cache): Fix typo.
+
+2004-04-14  Mark Kettenis  <kettenis@gnu.org>
+
+	* NEWS (New native configurations): Mention NetBSD/vax.
+	* configure.host: Add vax-*-netbsdelf* and vax-*-netbsd*.
+	* config/vax/nbsdelf.mh: New file.
+	* config/vax/nbsdaout.mh: New file.
+	* config/vax/nm-nbsd.h: New file.
+	* config/vax/nm-nbsdaout.h: New file.
+
+	* vaxnbsd-tdep.c: New file.
+	* Makefile.in (vaxnbsd-tdep.o): New dependency.
+	* configure.tgt: Add vax-*-netbsd* and vax-*-openbsd*.
+	* config/vax/nbsd.mt: New file.
+	* config/vax/tm-nbsd.h: New file.
+
+	* Makefile.in (vaxbsd-nat.o): New dependency.
+
+	* vax-tdep.h (vax_regnum): Add VAX_R0_REGNUM and VAX_R1_REGNUM.
+	* vax-tdep.c (vax_store_arguments): Remove struct_return and
+	struct_addr arguments.  Don't push return value address.
+	(vax_push_dummy_call): Don't pass STRUCT_RETURN and STRUCT_ADDR as
+	arguments to vax_store_arguments.  Store return value address in
+	R1.
+	(vax_store_struct_return, vax_extract_return_value)
+	(vax_store_return_value): Remove functions.
+	(vax_return_value): New function.
+	(vax_gdbarch_init): Set return value.  Don't set
+	deprecated_store_struct_return, deprecated_extract_struct_return
+	and deprecated_store_return_value.
+
+2004-04-14  Andreas Schwab  <schwab@suse.de>
+
+	* ia64-tdep.c (ia64_libunwind_frame_prev_register): Handle null
+	value buffer.
+	* libunwind-frame.c (libunwind_frame_prev_register): Likewise.
+
+2004-04-14  Mark Kettenis  <kettenis@gnu.org>
+
+	* vax-tdep.c (vax_store_arguments, vax_push_dummy_call)
+	(vax_unwind_dummy_id): New functions.
+	(vax_push_dummy_frame, vax_pop_frame): Remove functions.
+	(vax_call_dummy_words, sizeof_vax_call_dummy_words): Remove
+	variables.
+	(vax_fix_call_dummy): Remove function.
+	(vax_gdbarch_init): Set push_dummy_call and unwind_dummy_id.
+	Don't set deprecated_push_dummy_frame, deprecated_pop_frame,
+	call_dummy_location, deprecated_call_dummy_words,
+	deprecated_sizeof_call_dummy_words,
+	deprecated_call_dummy_breakpoint_offset,
+	deprecated_use_generic_dummy_frames, deprecated_pc_in_call_dummy,
+	and deprecated_dummy_write_sp.
+
+2004-04-13  David Carlton  <carlton@kealia.com>
+
+	* MAINTAINERS: Move myself to "paper trail" section.
+
+2004-04-12  Mark Kettenis  <kettenis@gnu.org>
+
+	* vax-tdep.c: Include "frame-base.h", "frame-unwind.h" and
+	"trad-frame.h".
+	(vax_frame_init_saved_regs): Remove function.
+	(vax_sigtramp_saved_pc): Remove function.
+	(vax_frame_saved_pc): Remove function.
+	(vax_frame_args_address): Remove function.
+	(vax_frame_num_args): Rewrite.
+	(vax_frame_chain): Remove function.
+	(vax_push_dummy_frame): Replace DEPRECATED_FP_REGNUM with
+	VAX_FP_REGNUM.
+	(vax_pop_frame): Likewise.
+	(vax_saved_pc_after_call): Remove function.
+	(struct vax_frame_cache): New structure.
+	(vax_frame_cache): New function.
+	(vax_frame_this_id): New function.
+	(vax_frame_prev_register): New function.
+	(vax_frame_unwind): New variable.
+	(vax_frame_sniffer): New function.
+	(vax_frame_base_address): New function.
+	(vax_frame_args_address): New function.
+	(vax_frame_base): New variable.
+	(vax_unwind_pc): New function.
+	(vax_gdbarch_init): Don't set deprecated_init_frame_pc,
+	deprecated_fp_regnum, deprecated_saved_pc_after_call,
+	deprecated_frame_chain, deprecated_frame_saved_pc,
+	deprecated_frame_args_address and
+	deprecated_frame_init_saved_regs.
+	* Makefile.in (vax-tdep.o): Update dependencies.
+
+	* vaxbsd-nat.c: New file.
+
+	* vax-tdep.h: Update copyright year.  Adjust comments.
+	(VAX_REGISTER_SIZE, VAX_REGISTER_BYTES, VAX_MAX_REGISTER_RAW_SIZE,
+	VAX_MAX_REGISTER_VIRTUAL_SIZE): Remove macros.
+	(vax_regnum): New enum.  Replacing...
+	(VAX_AP_REGNUM, VAX_FP_REGNUM, VAX_SP_REGNUM, VAX_PC_REGNUM)
+	(VAX_PS_REGNUM): ... these removed macros.
+	* vax-tdep.c (vax_register_name): Remove prototype.
+	(vax_register_name): Reorganize somewhat.  Use ARRAY_SIZE.
+	(vax_register_byte, vax_register_raw_size,
+	vax_register_virtual_size, vax_register_virtual_type): Remove
+	functions.
+	(vax_register_type): New function.
+	(vax_breakpoint_from_pc): Reorganize.
+	(vax_gdbarch_init): Set register_type.  Don't set
+	deprecated_register_size, deprecated_register_bytes,
+	deprecated_register_byte, deprecated_register_raw_size,
+	deprecated_max_register_raw_size,
+	deprecated_register_virtual_size,
+	deprecated_max_register_virtual_size and
+	deprecated_register_virtual_type.  Add comment on stack direction.
+
+2004-04-11  Mark Kettenis  <kettenis@gnu.org>
+
+	* amd64-tdep.h (amd64_regnum): Add AMD64_CS_REGNUM,
+	AMD64_SS_REGNUM, AMD64_DS_REGNUM, AMD64_ES_REGNUM,
+	AMD64_FS_REGNUM and AMD64_GS_REGNUM.
+
+2004-04-10  Randolph Chung  <tausq@debian.org>
+
+	* MAINTAINERS (write after approval): Add myself.
+
+2004-04-07  Randolph Chung  <tausq@debian.org>
+
+	* hppa-tdep.c (hppa_inner_than): Remove.
+	(is_pa_2): Remove unused static variable.
+	(hppa_gdbarch_init): Use core_addr_greaterthan instead of own version.
+
+2004-03-10  Paul N. Hilfinger  <Hilfinger@gnat.com>
+
+	* language.h (language_defn): Add new la_post_parser field.
+	* parser-defs.h (null_post_parser): New declaration (default for
+	la_post_parser).
+
+	* parse.c (parse_exp_1): Move code to parse_exp_in_context and
+	insert call to that function.
+	(parse_exp_in_context): New function, including code formerly in
+	parse_exp_1.  Calls language-dependent post-parser after
+	prefixification.
+	(parse_expression_in_context): New exported function.
+	(null_post_parser): New definition.
+	* expression.h (parse_expression_in_context): Add declaration.
+
+	* p-lang.c (pascal_language_defn): Add trivial post-parser.
+	* c-lang.c (c_language_defn): Ditto.
+	(cplus_language_defn): Ditto.
+	(asm_language_defn): Ditto.
+	(minimal_language_defn): Ditto.
+	* f-lang.c (f_language_defn): Ditto.
+	* jv-lang.c (java_language_defn): Ditto.
+	* language.c (unknown_language_defn): Ditto.
+	(auto_language_defn): Ditto.
+	(local_language_defn): Ditto.
+	* m2-lang.c (m2_language_defn): Ditto.
+	* scm-lang.c (scm_language_defn): Ditto.
+	* obj-lang.c (objc_language_defn): Ditto.
+
+2004-04-10  Mark Kettenis  <kettenis@gnu.org>
+
+	* amd64nbsd-tdep.c (amd64nbsd_sigcontext_addr): Remove function.
+	(amd64nbsd_mcontext_addr): New function.
+	(amd64nbsd_init_abi): Initialize TDEP->sigcontext_addr as
+	amd64nbsd_mcontext_addr.  Directly initialize TDEP->sc_reg_offset
+	with amd64nbsd_r_reg_offset, instead of building it on the fly.
+
+	* corelow.c (core_xfer_partial): Fix coding standards violation.
+	Add support for TARGET_OBJECT_WCOOKIE.
+
+	* sparc-linux-tdep.c (sparc32_linux_init_abi): Don't set
+	deprecated_pc_in_sigtramp.
+	* sparc-sol2-tdep.c (sparc32_sol2_init_abi): Likewise.
+	* sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Likewise.
+	* sparc64fbsd-tdep.c (sparc64fbsd_init_abi): Likewise.
+	* sparc64nbsd-tdep.c (sparc64nbsd_init_abi): Likewise.
+	* sparc64obsd-tdep.c (sparc64obsd_init_abi): Likewise.
+	* sparcnbsd-tdep.c (sparc32nbsd_init_abi): Likewise.
+	* sparcobsd-tdep.c (sparc32obsd_init_abi): Likewise.
+
+	* amd64-linux-tdep.c, amd64nbsd-tdep.c, amd64obsd-tdep.c,
+	i386-linux-tdep.c, i386-tdep.c, i386nbsd-tdep.c, i386obsd-tdep.c:
+	Fix typo.
+
+	* amd64-tdep.c (amd64_supply_fxsave): Only fiddle with
+	I387_FISEG_REGNUM and I387_FOSEG_REGNUM in 64-bit mode.
+	(amd64_collect_fxsave): Likewise.
+
+	* i386-sol2-tdep.c: Include "gdb_string.h".
+	(i386_sol2_sigtramp_p): Recognize signal trampoline based on its
+	name.
+	* Makefile.in (i386-sol2-tdep.o): Update dependencies.
+
+2004-04-10  Mark Kettenis  <kettenis@gnu.org>
+
+	* i386-sol2-tdep.c: Include "solib-svr4.h".
+	(i386_sol2_init_abi): Set solib_svr4_fetch_link_map_offsets.
+	* Makefile.in (i386-sol2-tdep.o): Update dependencies.
+	* config/i386/tm-i386sol2.h: Include :solib.h".
+	* config/i386/i386sol2.mh (NATDEPFILES): Remove solib.o,
+	solib-svr4.o and solib-legacy.o.
+	* config/i386/i386sol2.mt (TDEPFILES): Add solib.o and
+	solib-svr4.o.
+
+2004-04-09  Mark Kettenis  <kettenis@gnu.org>
+
+	* amd64-linux-nat.c (fetch_inferior_registers): Correctly check
+	whether a register is supplied by PTRACE_GETFPREGS.
+	(store_inferior_registers): Likewise.
+	* amd64bsd-nat.c (fetch_inferior_registers): Correctly check
+	whether a register is supplied by PT_GETFPREGS.
+	(store_inferior_registers): Likewise.
+
+	* config/i386/linux.mt (TDEPFILES): Remove solib-legacy.o.
+	* config/i386/linux64.mt (TDEPFILES): Likewise.
+
+	* i386-linux-nat.c: Update copyrigth year.  Tweak comment.
+
+	* amd64-tdep.c (amd64_sigtramp_frame_sniffer): Rewrite to use new
+	sigtramp_p member of `struct gdbarch_tdep'.  Also check whether
+	the program counter is in the range specified by `struct
+	gdbarch_tdep'.
+	* amd64-linux-tdep.c: Include "symtab.h".
+	(amd64_linux_pc_in_sigtramp): Remove function.
+	(amd64_linux_sigtramp_p): New function.
+	(amd64_linux_init_abi): Initialize TDEP->sigtramp_p.  Don't set
+	deprecated_pc_in_sigtramp.
+	* amd64nbsd-tdep.c: Include "symtab.h".
+	(amd64nbsd_sigtramp_p): New function.
+	(amd64nbsd_init_abi): Initialize TDEP->sigtramp_p.  Don't set
+	deprecated_pc_in_sigtramp.
+	* amd64obsd-tdep.c: Include "symtab.h" and "objfiles.h".  Add a
+	few comments.
+	(amd64obsd_pc_in_sigtramp): Remove function.
+	(amd64obsd_sigtramp_p): New function.
+	(amd64obsd_init_abi): Initialize TDEP->sigtramp_p.  Don't set
+	deprecated_pc_in_sigtramp.
+	* i386-tdep.h (struct gdbarch_tdep): Add sigtramp_p member.
+	(i386bsd_pc_ins_sigtramp): Remove prototype.
+	(i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove prototypes.
+	* i386-tdep.c (i386_sigtramp_frame_sniffer): Rewrite to use new
+	sigtramp_p member of `struct gdbarch_tdep'.  Also check whether
+	the program counter is in the range specified by `struct
+	gdbarch_tdep'.
+	(i386_pc_in_sigtramp, i386_svr4_pc_in_sigtramp): Remove functions.
+	(i386_sigtramp_p, i386_svr4_sigtramp_p): New functions.
+	(i386_go32_pc_in_sigtramp): Remove function.
+	(i386_svr4_init_abi): Don't set deprecated_pc_in_sigtramp.
+	Initialize TDEP->sigtramp_p.
+	(i386_go32_init_abi): Initialize TDEP->sigtramp_p to NULL.
+	(i386_gdbarch_init): Initialize TDEP->sigtramp_p.  Don't set
+	deprecated_pc_in_sigtramp.
+	* i386-linux-tdep.c: Adjust comments.
+	(i386_linux_pc_in_sigtramp): Remove function.
+	(i386_linux_sigtramp_p): New function.
+	(i386_linux_init_abi): Initialize TDEP->sigtramp_p.  Don't set
+	deprecated_pc_in_sigtramp.
+	* i386-nto-tdep.c: Update copyright year.
+	(i386nto_pc_in_sigtramp): Remove function.
+	(i386nto_sigtramp_p): New function.
+	(i386nto_sigcontext_addr): Use I386_ESP_REGNUM instead of
+	SP_REGNUM.
+	(i386nto_init_abi): Initialize TDEP->sigtramp_p.  Don't set
+	deprecated_pc_in_sigtramp.
+	* i386-sol2-tdep.c: Update copyright year.
+	(i386_sol2_pc_in_sigtramp): Remove function.
+	(i386_sol2_sigtramp_p): New function.
+	(i386_sol2_init_abi): Initialize TDEP->sigtramp_p.  Don't set
+	deprecated_pc_in_sigtramp.
+	* i386bsd-tdep.c (i386bsd_pc_in_sigtramp): Remove function.
+	(i386bsd_sigtramp_start, i386bsd_sigtramp_end): Remove functions.
+	(i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp,
+	deprecated_sigtramp_start and deprecated_sigtramp_end.
+	* i386nbsd-tdep.c: Include "frame.h" and "symtab.h".
+	(i386nbsd_pc_in_sigtramp): Remove function.
+	(i386nbsd_sigtramp_p): New function.
+	(i386nbsd_init_abi): Don't set deprecated_pc_in_sigtramp,
+	deprecated_sigtramp_start, deprecated_sigtramp_end.  Initialize
+	TDEP->sigtramp_start, TDEP->sigtramp_end and TDEP->sigtramp_p.
+	* i386obsd-tdep.c: Include "frame.h", "symtab.h" and "objfiles.h".
+	(i386obsd_pc_in_sigtramp): Remove function.
+	(i386obsd_sigtramp_p): New function.
+	(i386obsd_sigtramp_start, i386obsd_sigtramp_end): Remove
+	functions.
+	(i386bsd_init_abi): Don't set deprecated_pc_in_sigtramp,
+	deprecated_sigtramp_start, deprecated_sigtramp_end.  Initialize
+	TDEP->sigtramp_p.
+	* Makefile.in (amd64-linux-tdep.o, amd64nbsd-tdep.o,
+	amd64obsd-tdep.o, i386nbsd-tdep.o, i386obsd-tdep.o): Update
+	dependencies.
+
+	* config/i386/i386aout.mt: Remove file.
+
+	* configure.tgt: Remove i[34567]86-*-go32*,
+	i[34567]86-*-msdosdjgpp*, i[34567]86-*-sco*, i[34567]86-*-sysv*
+	and i[34567]86-*-isc*.  Set gdb_target to i386 for
+	i[34567]86-*-netware* and i[34567]86-*-*.
+	* config/i386/i386.mt: New file.
+	* config/i386/embed.mt: Remove file.
+	* config/i386/go32.mt: Remove file.
+	* config/i386/i386nw.mt: Remove file.
+	* config/i386/i386v.mt: Remove file.
+	* config/i386/tm-go32.h: Remove file.
+
+	* tui/tui-hooks.c: Include "readline/readline.h" after
+	"gdb_curses.h" instead of before.
+	* tui/tui-io.c: Likewise.
+
+	* tui/tui.c: Fix typo in comment.
+
+	* sparc64-tdep.c (sparc_address_from_register): Remove function.
+
+2004-04-08  Andrew Cagney  <cagney@redhat.com>
+
+	* breakpoint.h (deprecated_exception_catchpoints_are_fragile)
+	(deprecated_exception_support_initialized): Declare.
+	* hppa-hpux-tdep.c (initialize_hp_cxx_exception_support)
+	(initialize_hp_cxx_exception_support)
+	(child_enable_exception_callback): Update.
+	* breakpoint.c (deprecated_exception_catchpoints_are_fragile)
+	(deprecated_exception_support_initialized): Rename
+	deprecated_exception_catchpoints_are_fragile and
+	deprecated_exception_support_initialized.
+	(breakpoint_init_inferior, breakpoint_init_inferior): Update.
+
+	* symtab.c (deprecated_hp_som_som_object_present): Rename
+	hp_som_som_object_present.
+	* symtab.h (deprecated_hp_som_som_object_present): Declare.
+	* symfile.c (hp_som_som_object_present, RESET_HP_UX_GLOBALS):
+	Update.  Delete extern declaration.
+	* valops.c (hp_som_som_object_present): Ditto.
+	* parse.c (deprecated_hp_som_som_object_present)
+	(parse_nested_classes_for_hpacc): Ditto.
+	* hpread.c (hp_som_som_object_present, hpread_expand_symtab): Ditto.
+	* hppa-hpux-tdep.c (hp_som_som_object_present)
+	(initialize_hp_cxx_exception_support): Ditto.
+	* eval.c (hp_som_som_object_present, evaluate_subexp_standard): Ditto.
+	* cp-valprint.c (hp_som_som_object_present)
+	(cp_print_class_method): Ditto.
+	* c-typeprint.c (hp_som_som_object_present):
+	(c_type_print_base): Ditto.
+	* c-exp.y (hp_som_som_object_present): Ditto.
+
+2004-04-08  Andrew Cagney  <cagney@redhat.com>
+
+	* frame-unwind.c (struct frame_unwind_table, frame_unwind_init)
+	(frame_unwind_prepend_unwinder, frame_unwind_append_sniffer)
+	(frame_unwind_find_by_frame): Re-implement the unwind code so
+	that it can both prepend and append sniffers.  Replace
+	frame_unwind_register_unwinder with frame_unwind_prepend_unwinder.
+	* tramp-frame.c (tramp_frame_append): Use
+	frame_unwind_prepend_unwinder.
+	* frame-unwind.h (frame_unwind_prepend_unwinder): Replace
+	frame_unwind_register_unwinder.
+	* tramp-frame.h (tramp_frame_prepend_unwinder): Rename
+	tramp_frame_append.
+	* tramp-frame.c (tramp_frame_prepend_unwinder): Update.
+	* mips-linux-tdep.c (mips_linux_init_abi, mips_linux_init_abi)
+	(mips_linux_init_abi): Update.
+
+2004-04-08  Kevin Buettner  <kevinb@redhat.com>
+
+	* ppc-linux-tdep.c (ELF_NREG, ELF_NFPREG, ELF_NVRREG)
+	(ELF_FPREGSET_SIZE):  Delete constants formerly used in core
+	file support.
+
+2004-04-07  Kevin Buettner  <kevinb@redhat.com>
+
+	* ia64-tdep.c (elf.h): Don't include.
+	(elf/ia64.h) [HAVE_LIBUNWIND_IA64_H]: Include.
+
+2004-04-07  Jason Molenda  (jmolenda@apple.com)
+
+	* frame.h: Typeo corrections in comments.
+
+2004-04-07  Jim Blandy  <jimb@redhat.com>
+
+	* i386-tdep.c (i386_stab_reg_to_regnum): Correct numbering for
+	%esp and %ebp
+
+2004-04-07  Mark Kettenis  <kettenis@gnu.org>
+
+	* config/sparc/linux.mt (TDEPFILES): Remove solib-legacy.o.
+	* config/sparc/linux64.mt (TDEPFILES): Likewise.
+	* config/sparc/sol2.mt (TDEPFILES): Add solib.o and solib-svr4.o.
+	* config/sparc/sol2.mh (NATDEPFILES): Remove solib.o, solib-svr4.o
+	and solib-legacy.o.
+	* config/sparc/sol2-64.mt (TDEPFILES): Add solib.o and
+	solib-svr4.o.
+	* config/sparc/tm-sol2.h: Update copyright year.  Include
+	"solib.h".
+
+	* sparc-sol2-tdep.c: Update copyright year.  Include
+	"solib-svr4.h".
+	(sparc32_sol2_init_abi): Set solib_svr4_fetch_link_map_offsets.
+	* sparc64-sol2-tdep.c: Include "solib-svr4.h".
+	(sparc64_sol2_init_abi): Set solib_svr4_fetch_link_map_offsets.
+	* Makefile.in (sparc-sol2-tdep.o, sparc64-sol2-tdep.o): Update
+	dependencies.
+
+2004-04-06  Andrew Cagney  <cagney@redhat.com>
+
+	* infttrace.c: Include "infttrace.h".
+	* infttrace.h: Include "target.h".
+	* Makefile.in (infttrace_h): Update.
+	(infttrace.o): Update.
+
+2004-04-06  Andrew Cagney  <cagney@redhat.com>
+
+	* hppah-nat.c (hpux_has_forked, hpux_has_vforked)
+	(hpux_has_execd, hpux_has_syscall_event): Include "infttrace.h",
+	move extern declarations from here ...
+	* infttrace.h: ... to here.
+	* Makefile.in (hppah-nat.o): Update dependencies.
+
+	* hppa-tdep.c (hppa_breakpoint_from_pc): Make static.
+	(hppa_gdbarch_init): Set gdbarch_breakpoint_from_pc
+	* config/pa/tm-hppa.h (BREAKPOINT_FROM_PC, BREAKPOINT32):
+	(hppa_breakpoint_from_pc): Delete.
+
+	* MAINTAINERS: Mark hppa-elf as buildable with -Werror.
+
+2004-04-05  Andrew Cagney  <cagney@redhat.com>
+
+	* hppa-tdep.c: Do not include <sys/types.h>, <sys/param.h>,
+	<signal.h>, <sys/ptrace.h>, #include "a.out.encap.h",
+	<sys/file.h>.
+
+2004-04-06  Randolph Chung  <tausq@debian.org>
+
+	Committed by Andrew Cagney (mechanical change).
+	* hppa-tdep.c: (args_for_find_stub, hp_som_som_object_present,
+	exception_catchpoints_are_fragile, find_stub_with_shl_get,
+	cover_find_stub_with_shl_get, initialize_hp_cxx_exception_support,
+	child_enable_exception_callback, current_ex_event,
+	null_symtab_and_line, child_get_current_exception_event,
+	HP_ACC_EH_notify_hook, HP_ACC_EH_set_hook_value,
+	HP_ACC_EH_notify_callback, HP_ACC_EH_break, HP_ACC_EH_catch_throw,
+	HP_ACC_EH_catch_catch, __eh_notification, hp_cxx_exception_support,
+	hp_cxx_exception_support_initialized, eh_notify_hook_addr,
+	eh_notify_callback_addr, eh_break_addr, eh_catch_catch_addr,
+	eh_catch_throw_addr, break_callback_sal, setup_d_pid_in_inferior):
+	Move hpux-specific definitions ...
+	* hppa-hpux-tdep.c: ... to here.
+
+2004-04-05  Andrew Cagney  <cagney@redhat.com>
+
+	* hppa-tdep.c (hppa_frame_cache): Pass the frame's func to
+	skip_prologue_using_sal.
+
+2004-04-05  Andrew Cagney  <cagney@redhat.com>
+
+	* config/i386/tm-i386.h: Delete file.
+	* config/i386/tm-vxworks.h: Update copyright, do not include
+	"tm-i386.h".
+	* config/i386/tm-nto.h, config/i386/tm-linux.h: Ditto.
+	* config/i386/tm-i386sol2.h, config/i386/tm-i386lynx.h: Ditto.
+	* config/i386/tm-go32.h, config/i386/tm-cygwin.h: Ditto.
+	* config/i386/ncr3000.mt (TM_FILE): Delete.
+	* config/i386/interix.mt (TM_FILE): Delete.
+	* config/i386/i386v.mt (TM_FILE): Delete.
+	* config/i386/i386nw.mt (TM_FILE): Delete.
+	* config/i386/i386gnu.mt (TM_FILE): Delete.
+	* config/i386/i386aout.mt (TM_FILE): Delete.
+	* config/i386/embed.mt (TM_FILE): Delete.
+
+2004-04-05  Kevin Buettner  <kevinb@redhat.com>
+
+	* frv-tdep.h (fsr0_regnum, acc0_regnum, acc7_regnum, accg0123_regnum)
+	(accg4567_regnum, msr0_regnum, msr1_regnum, gner0_regnum)
+	(gner1_regnum, fner0_regnum, fner1_regnum, accg0_regnum)
+	(accg7_regnum): New constants.
+	(last_spr_regnum, last_pseudo_regnum): Update.
+	* frv-tdep.c (new_variant): Initialize names for fsr0, acc0-acc7,
+	accg0-accg7, msr0, msr1, gner0, gner1, fner0, and fner1.
+	(frv_pseudo_register_read, frv_pseudo_register_write): Add support
+	for accg registers.
+	(frv_register_sim_regno): Update spr_map[].
+
+2004-04-04  Andrew Cagney  <cagney@redhat.com>
+
+	* config/mips/xm-riscos.h: Delete.
+	* config/mips/xm-mipsv4.h, config/mips/xm-mips.h: Delete.
+	* config/mips/tm-mipsv4.h, config/mips/riscos.mh: Delete.
+	* config/mips/nm-riscos.h, config/mips/nm-news-mips.h: Delete.
+	* config/mips/nm-mips.h, config/mips/news-mips.mh: Delete.
+	* config/mips/news-mips.mh, config/m68k/tm-m68kv4.h: Delete.
+	* config/mips/decstation.mh, config/mips/littlemips.mh: Delete.
+	* config/mips/mipsv4.mt, config/m68k/tm-sun3.h: Delete.
+	* config/m68k/xm-sun3os4.h, config/m68k/xm-sun3.h: Delete.
+	* config/m68k/xm-sun2.h, config/m68k/xm-m68kv4.h: Delete.
+	* config/m68k/xm-dpx2.h, config/m68k/xm-delta68.h: Delete.
+	* config/m68k/xm-3b1.h, config/m68k/tm-sun3os4.h: Delete.
+	* config/m68k/tm-m68klynx.h, config/m68k/tm-dpx2.h: Delete.
+	* config/m68k/tm-delta68.h, config/m68k/tm-3b1.h: Delete.
+	* config/m68k/sun3os4.mt, config/m68k/nm-sysv4.h: Delete.
+	* config/m68k/nm-sun3.h, config/m68k/sun3os4.mh: Delete.
+	* config/m68k/sun2os3.mh, config/m68k/nm-sun2.h: Delete.
+	* config/m68k/nm-m68klynx.h, config/m68k/sun3os3.mt: Delete.
+	* config/m68k/nm-dpx2.h, config/m68k/sun2os3.mt: Delete.
+	* config/m68k/dpx2.mh, config/m68k/sun3os3.mh: Delete.
+	* config/m68k/sun2os4.mh, config/m68k/nm-delta68.h: Delete.
+	* config/m68k/m68kv4.mt, config/m68k/m68klynx.mt: Delete.
+	* config/m68k/3b1.mt, config/m68k/m68klynx.mh: Delete.
+	* config/m68k/m68kv4.mh, config/m68k/sun2os4.mt: Delete.
+	* config/m68k/tm-sun2os4.h, config/m68k/3b1.mh: Delete.
+	* config/m68k/dpx2.mt, config/m68k/delta68.mt: Delete.
+	* config/m68k/tm-sun2.h, config/m68k/delta68.mh: Delete.
+
+	* configure.tgt: Remove m68000-*-sunos3*, m68000-*-sunos4*,
+	m68*-bull-sysv*, m68*-att-*, m68*-motorola-*, m68*-*-lynxos*,
+	m68*-*-sunos3*, m68*-*-sunos4*, m68*-*-sysv4*, mips*-*-sysv4*.
+	* configure.host: Remove m680[01]0-sun-sunos3*,
+	m680[01]0-sun-sunos4*, m68*-att-*, m68*-bull*-sysv*,
+	m68*-*-lynxos*, m68*-*-sysv4*, m68*-motorola-*, m68*-sun-sunos3*,
+	m68*-sun-sunos4*, m68*-sun-*, mips-dec-*, mips-little-*,
+	mips-sony-*, mips-*-mach3*, mips-*-sysv4*, mips-*-sysv*,
+	mips-*-riscos*.
+	* NEWS: Mention removed systems.
+
+2004-04-04  Andrew Cagney  <cagney@redhat.com>
+
+	GDB 6.1 release created from 6.1 branch.
+
+2004-04-04  Andrew Cagney  <cagney@redhat.com>
+
+	* gnu-nat.c (gnu_wait): Use memcpy instead of bcopy.
+	* remote-vxmips.c (vx_read_register, vx_write_register): Ditto.
+	* remote-vx68.c (vx_read_register, vx_write_register): Ditto.
+
+	* config/vax/xm-vax.h (FAULT_CODE_ORIGIN, INIT_STACK): Delete.
+	* config/alpha/xm-alphaosf.h (NO_SIGINTERRUPT): Delete.
+	* config/alpha/xm-alphalinux.h (NO_SIGINTERRUPT): Delete.
+
+2004-04-03  Jim Blandy  <jimb@redhat.com>
+
+	* MAINTAINERS: Chris Faylor has changed employers; add him to
+	"paper trail" section, and update his E-mail address.
+
+2004-04-03  Andrew Cagney  <cagney@redhat.com>
+
+	* frame-unwind.c (frame_unwind_find_by_frame): Delete check for
+	generic dummy frames.
+	* dummy-frame.c: Update copyright.
+	(dummy_frame_sniffer): Delete check for generic dummy frames.
+
+	* config/pa/tm-hppa.h (REG_PARM_STACK_SPACE): Delete.
+	* config/pa/tm-hppa64.h (PA20W_CALLING_CONVENTIONS)
+	(REG_PARM_STACK_SPACE): Delete.
+	* hppa-tdep.c (hppa64_push_dummy_call, hppa32_push_dummy_call):
+	Inline reference to REG_PARM_STACK_SPACE.
+
+	* config/pa/tm-hppah.h (FRAME_SAVED_PC_IN_SIGTRAMP)
+	(FRAME_FIND_SAVED_REGS_IN_SIGTRAMP)
+	(hppa32_hpux_frame_find_saved_regs_in_sigtramp)
+	(FRAME_BASE_BEFORE_SIGTRAMP)
+	(hppa32_hpux_frame_base_before_sigtramp)
+	(hppa32_hpux_frame_saved_pc_in_sigtramp): Delete.
+	* config/pa/tm-hppa64.h (hppa64_hpux_frame_saved_pc_in_sigtramp)
+	(hppa64_hpux_frame_find_saved_regs_in_sigtramp)
+	(FRAME_FIND_SAVED_REGS_IN_SIGTRAMP)
+	(FRAME_BASE_BEFORE_SIGTRAMP)
+	(hppa64_hpux_frame_base_before_sigtramp)
+	(FRAME_SAVED_PC_IN_SIGTRAMP): Delete.
+
+2004-04-03  Andrew Cagney  <cagney@redhat.com>
+
+	* PROBLEMS: Mention that GDB doesn't build on HP/UX 11.00.
+
+2004-04-02  Andrew Cagney  <cagney@redhat.com>
+
+	* sh64-tdep.c (sh64_init_extra_frame_info): Replace
+	DEPRECATED_CALL_DUMMY_LENGTH with 0, simplify.
+	* dummy-frame.h: Delete out-of-date comments.
+	* gdbarch.sh (DEPRECATED_CALL_DUMMY_LENGTH): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+
+2004-04-02  Joel Brobecker  <brobecker@gnat.com>
+
+	Committed by Andrew Cagney <cagney@redhat.com>.
+        * alpha-tdep.c (alpha_heuristic_frame_unwind_cache): Do not take
+        into account an instruction saving a register if we have already
+        seen an earlier instruction saving that same register.
+
+2004-04-02  Andrew Cagney  <cagney@redhat.com>
+
+	* gdbarch.sh (DEPRECATED_INIT_FRAME_PC_FIRST): Delete.
+	* gdbarch.h, gdbarch.c: Re-generate.
+	* frame.c (legacy_get_prev_frame): Delete references to
+	DEPRECATED_INIT_FRAME_PC_FIRST.
+
+	* infrun.c (pc_in_sigtramp): Delete function.
+	(check_sigtramp2): Inline call to pc_in_sigtramp, use
+	get_frame_type.
+
+2004-04-02  Andrew Cagney  <cagney@redhat.com>
+
+	* infrun.c (handle_step_into_function): Delete code conditional on
+	legacy_frame_p.
+	(handle_inferior_event, step_over_function): Ditto.
+
+2004-04-02  Andrew Cagney  <cagney@redhat.com>
+
+	* frame.c (get_prev_frame_1): Exclude signal trampolines from the
+	"previous frame inner to this frame" test.
+
+2004-04-02  Andrew Cagney  <cagney@redhat.com>
+
+	* frame.c (safe_frame_unwind_memory): New function.
+	* frame.h (safe_frame_unwind_memory): Declare.  Update description
+	of /safe_/ methods.
+	* tramp-frame.c (tramp_frame_start): Re-order parmeters, add
+	"next_frame".  Use safe_frame_unwind_memory.
+	(tramp_frame_sniffer): Update call to tramp_frame_start.
+
+2004-04-01  Daniel Jacobowitz  <drow@mvista.com>
+
+	* dwarf2read.c (dwarf2_objfile_data_key): New.
+	(struct dwarf2_per_objfile, dwarf2_per_objfile): New.
+	(dwarf_info_size, dwarf_abbrev_size, dwarf_line_size)
+	(dwarf_pubnames_size, dwarf_aranges_size, dwarf_loc_size)
+	(dwarf_macinfo_size, dwarf_str_size, dwarf_ranges_size)
+	(dwarf_frame_size, dwarf_eh_frame_size, dwarf_info_buffer)
+	(dwarf_abbrev_buffer, dwarf_line_buffer, dwarf_str_buffer)
+	(dwarf_macinfo_buffer, dwarf_ranges_buffer, dwarf_loc_buffer):
+	Remove variables.
+	(struct dwarf2_pinfo): Remove per-objfile members.  Update comments.
+	(DWARF_ABBREV_SIZE, DWARF_LINE_SIZE)
+	(DWARF_LOC_SIZE, DWARF_MACINFO_SIZE, DWARF_STR_SIZE)
+	(DWARF_RANGES_SIZE, DWARF_INFO_BUFFER)
+	(DWARF_ABBREV_BUFFER, DWARF_LINE_BUFFER, DWARF_STR_BUFFER)
+	(DWARF_MACINFO_BUFFER, DWARF_RANGES_BUFFER, DWARF_LOC_BUFFER):
+	Remove macros.
+	(dwarf2_has_info): Take an objfile argument.  Allocate per-objfile
+	data.
+	(dwarf2_locate_sections, dwarf2_build_psymtabs)
+	(dwarf2_build_psymtabs_easy, dwarf2_build_psymtabs_hard)
+	(skip_one_die, dwarf2_get_pc_bounds, dwarf2_read_abbrevs)
+	(read_partial_die, read_full_die, read_indirect_string)
+	(dwarf_decode_line_header, dwarf_decode_macros)
+	(dwarf2_symbol_mark_computed): Remove use of removed macros.
+	Update uses of removed variables.
+	(psymtab_to_symtab_1): Restore per-objfile data pointer.  Remove use
+	of removed macros.
+	(_initialize_dwarf2_read): New function.
+	* symfile.h (dwarf2_has_info): Update prototype.
+	* coffread.c (coff_symfile_read): Update call to dwarf2_has_info.
+	* elfread.c (elf_symfile_read): Likewise.
+
+2004-04-01  Jim Blandy  <jimb@redhat.com>
+
+	* rs6000-tdep.c (rs6000_dwarf2_stab_reg_to_regnum): New, unified
+	function for register numbers on all the rs6000-derived targets.
+	(rs6000_gdbarch_init): Don't register a separate
+	gdbarch_dwarf2_reg_to_regnum function for the E500.  Use
+	rs6000_dwarf2_stab_reg_to_regnum for both Dwarf 2 and stabs on all
+	variants.
+
+	* i386-tdep.c: Add FIXME regarding STABS vs. Dwarf 2 register
+	numbering.
+
+2004-04-01  Paul N. Hilfinger  <Hilfinger@gnat.com>
+
+	* valarith.c: Update copyright notice.
+	(value_add): Handle range types.
+	(value_sub): Ditto.
+	(value_equal): Ditto.
+	(value_less): Ditto.
+	(value_neg): Ditto.
+	(value_complement): Ditto.
+	(value_binop): Simplify slightly by using is_integral_type and
+	eliminiating unnecessary COERCE_ENUMs.
+
+2004-03-31  Andrew Cagney  <cagney@redhat.com>
+
+	* frame.h (frame_unwind_id): Declare.
+	* frame.c (frame_unwind_id): New function.
+	(get_prev_frame_1): New function.
+	(frame_debug_got_null_frame): New function.
+	(get_prev_frame): Use frame_debug_got_null_frame.  Move unwind
+	code proper to prev_frame, update description.
+	* infrun.c (step_over_function): Use frame_unwind_id.
+
+2004-04-31  J. Brobecker  <brobecker@gnat.com>
+
+	* hppa-tdep.c (hppa32_push_dummy_call): Set the Stack Pointer.
+	(hppa64_push_dummy_call): Likewise.
+
+2004-03-30  Jim Blandy  <jimb@redhat.com>
+
+	From Ulrich Weigand:
+ 	* utils.c (query): Do not use a va_list variable multiple times.
+
+2004-03-29  Daniel Jacobowitz  <drow@mvista.com>
+
+	* Makefile.in (linux_nat_h): Update dependencies.
+	* configure.in: Check for <gnu/libc-version.h>.
+	* configure: Regenerate.
+	* config.in: Regenerate.
+	* linux-nat.h: Include "target.h".  Add waitstatus field to
+	struct lwp_info.
+	* lin-lwp.c (add_lwp): Initialize waitstatus.kind.
+	(lin_lwp_attach_lwp): Don't attach to LWPs we have already attached
+	to.
+	(lin_lwp_handle_extended): New function.  Handle clone events.
+	(wait_lwp): Use lin_lwp_handle_extended.  Update comment about
+	thread exit events.
+	(child_wait): Handle clone events.
+	(lin_lwp_wait: Use lin_lwp_handle_extended and handle clone events.
+	* linux-nat.c (linux_enable_event_reporting): Turn on
+	PTRACE_O_TRACECLONE.
+	(linux_handle_extended_wait): Handle clone events.
+	* thread-db.c: Include <gnu/libc-version.h>.
+	(struct private_thread_info): Add dying flag.
+	(enable_thread_event_reporting): Enable TD_DEATH for glibc 2.2 and
+	higher.
+	(attach_thread): Update comments.  Handle dying threads.
+	(detach_thread): Set the dying flag.
+	(check_event): Always call attach_thread.
+
+2004-03-29  Daniel Jacobowitz  <drow@mvista.com>
+
+	* mips-tdep.c (mips_pdr_data): New.
+	(non_heuristic_proc_desc): Use objfile_data and set_objfile_data.
+	(_initialize_mips_tdep): Initialize mips_pdr_data.
+
+2004-03-29  Corinna Vinschen  <vinschen@redhat.com>
+
+	* minsyms.c (install_minimal_symbols): Move dropping leading
+	char from linkage name from here...
+	(prim_record_minimal_symbol_and_info): ...to here.  Simplify
+	test for "__gnu_compiled*" symbols.
+
+2004-03-28  Jim Blandy  <jimb@redhat.com>
+
+	* rs6000-tdep.c (skip_prologue): Recognize moves from argument
+	registers to temp register r0 and byte stores as prologue
+	instructions.
+
+2004-03-28  Andrew Cagney  <cagney@redhat.com>
+
+	* PROBLEMS (Stack backtraces): Rewrite.  Remove reference to
+	arm*-*-*.
+
+2004-03-28  Stephane Carrez  <stcarrez@nerim.fr>
+
+	* tui/tui-regs.c (tui_show_registers): Make sure the TUI is active
+	and switch the layout to force a display of register window.
+
+2004-02-26  J. Brobecker  <brobecker@gnat.com>
+
+	* amd64-tdep.c (amd64_classify): make RANGE_TYPE objects be part
+	of the INTEGER class.
+
+2004-03-26  Jim Blandy  <jimb@redhat.com>
+
+	* ppc-linux-tdep.c (ppc_linux_init_abi): Long doubles are eight
+	bytes long on PPC GNU/Linux.
+
+2004-03-26  David Carlton  <carlton@kealia.com>
+
+	* PROBLEMS: Refer to gdb/1588 instead of gdb/826.
+
+2004-03-25  Andrew Cagney  <cagney@redhat.com>
+
+	* PROBLEMS: Add general section titles, remove references to
+	specific releases.
+
+2004-03-25  Daniel Jacobowitz  <drow@mvista.com>
+
+	* arm-linux-tdep.c (ARM_LINUX_JB_ELEMENT_SIZE): Define to
+	INT_REGISTER_SIZE.
+	(arm_linux_push_arguments): Use TARGET_DOUBLE_BIT instead of
+	FP_REGISTER_VIRTUAL_SIZE.
+	* arm-tdep.c (arm_make_sigtramp_cache): Use register_size instead
+	of DEPRECATED_REGISTER_RAW_SIZE.
+	(arm_register_type): Add gdbarch argument.
+	(arm_register_raw_size, arm_register_virtual_size): Delete.
+	(arm_register_byte, arm_extract_return_value)
+	(arm_store_return_value, arm_get_longjmp_target): Update references
+	to INT_REGISTER_RAW_SIZE and FP_REGISTER_RAW_SIZE.
+	(arm_gdbarch_init): Likewise.  Don't set
+	deprecated_register_raw_size, deprecated_register_virtual_size,
+	deprecated_max_register_raw_size,
+	deprecated_max_register_virtual_size, or
+	deprecated_max_register_virtual_type.  Do set register_type.
+	* arm-tdep.h (ARM_MAX_REGISTER_RAW_SIZE)
+	(ARM_MAX_REGISTER_VIRTUAL_SIZE, INT_REGISTER_VIRTUAL_SIZE)
+	(FP_REGISTER_VIRTUAL_SIZE): Delete.
+	(INT_REGISTER_RAW_SIZE): Rename to INT_REGISTER_SIZE.
+	(FP_REGISTER_RAW_SIZE): Rename to FP_REGISTER_SIZE.
+	* arm-linux-tdep.c (ARM_NBSD_JB_ELEMENT_SIZE): Define to
+	INT_REGISTER_SIZE.
+	* remote-rdp.c (remote_rdp_fetch_register): Use MAX_REGISTER_SIZE.
+	(remote_rdp_store_register): Likewise.
+
+2004-03-24  Daniel Jacobowitz  <drow@mvista.com>
+
+	* Makefile.in (mips-linux-tdep.o): Update dependencies.
+	* mips-tdep.c (mips_gdbarch_init): Move frame predicates
+	to after osabi initialization.
+	* mips-linux-tdep.c: Include "trad-frame.h" and "tramp-frame.h".
+	(mips_linux_o32_sigframe_init, mips_linux_n32n64_sigframe_init): New
+	functions.
+	(mips_linux_o32_sigframe, mips_linux_o32_rt_sigframe)
+	(mips_linux_n32_rt_sigframe, mips_linux_n64_rt_sigframe): New
+	variables.
+	(mips_linux_init_abi): Append signal trampoline unwinders.
+
+2004-03-24  Andrew Cagney  <cagney@redhat.com>
+
+	* tramp-frame.h (TRAMP_SENTINEL_INSN): Define, document.
+	* tramp-frame.c: Include "gdb_assert.h".
+	(tramp_frame_start): Use TRAMP_SENTINEL_INSN.  Use ULONGEST and
+	correct sizeof.
+	(tramp_frame_append): Validate the tramp frame's instructions.
+	* Makefile.in (tramp-frame.o): Update dependencies.
+
+2004-03-23  Andrew Cagney  <cagney@redhat.com>
+
+	* trad-frame.h (trad_frame_set_reg_addr): Declare.
+
 2004-03-23  Andrew Cagney  <cagney@redhat.com>
 
 	* MAINTAINERS (Past Maintainers): Add Mark Salter and Fernando
@@ -19,9 +4104,9 @@
 	* i386obsd-tdep.c (i386obsd_init_abi): Update.
 	* i386nbsd-tdep.c (i386nbsd_init_abi): Update.
 	* i386bsd-tdep.c (i386bsd_init_abi): Update.
-	* config/vax/tm-vaxbsd.h (DEPRECATED_SIGTRAMP_END) 
+	* config/vax/tm-vaxbsd.h (DEPRECATED_SIGTRAMP_END)
 	(DEPRECATED_SIGTRAMP_START): Update.
-	* config/m68k/tm-nbsd.h (DEPRECATED_SIGTRAMP_END) 
+	* config/m68k/tm-nbsd.h (DEPRECATED_SIGTRAMP_END)
 	(DEPRECATED_SIGTRAMP_START): Update.
 	* blockframe.c (find_pc_sect_partial_function): Update.
 	* arch-utils.c (legacy_pc_in_sigtramp): Update.
@@ -78,7 +4163,7 @@
 	* sparc64obsd-tdep.c (sparc64obsd_init_abi): Update.
 	* sparcnbsd-tdep.c (sparc32nbsd_init_abi): Update.
 	* sparcobsd-tdep.c (sparc32obsd_init_abi): Update.
-	
+
 2004-03-23  Andrew Cagney  <cagney@redhat.com>
 
 	* tramp-frame.h, tramp-frame.h: New files.
@@ -99,7 +4184,7 @@
 	(trad_frame_cache_zalloc): New function.
 	(trad_frame_set_id, trad_frame_get_id): New functions.
 	(trad_frame_set_reg_addr, trad_frame_get_register): New functions.
-	
+
 2004-03-22  Andrew Cagney  <cagney@redhat.com>
 
 	* s390-tdep.c (struct s390_stub_unwind_cache): Rename
@@ -159,7 +4244,7 @@
 	(legacy_get_prev_frame): Ditto.
 	* inferior.h: Delete reference to generic_pc_in_call_dummy in
 	comment.
-	
+
 2004-03-21  Andrew Cagney  <cagney@redhat.com>
 
 	* inferior.h (deprecated_pc_in_call_dummy_at_entry_point): Delete
@@ -382,6 +4467,7 @@
 	(determine_prefix): Look at TYPE_TAG_NAME and call
 	determine_class_name when appropriate.
 	(determine_prefix_aux, class_name): Delete.
+	(read_namespace): Set die->type.
 
 2004-03-15  Kevin Buettner  <kevinb@redhat.com>
 
@@ -433,7 +4519,7 @@
 	(dwarf2_frame_set_init_reg): Use gdbarch_data.
 	(dwarf2_frame_init_reg): Use gdbarch_data.
 	(_initialize_dwarf2_frame): Use gdbarch_data_register_pre_init.
-	* solib-svr4.c (set_solib_svr4_fetch_link_map_offsets) 
+	* solib-svr4.c (set_solib_svr4_fetch_link_map_offsets)
 	(_initialize_svr4_solib): Update.
 	* user-regs.c (_initialize_user_regs): Update.
 	* reggroups.c (_initialize_reggroup): Update.
@@ -451,7 +4537,7 @@
 	* frame-base.c (frame_base_table): Update.
 	* remote.c (_initialize_remote): Update.
 	* gdb_obstack.h (OBSTACK_ZALLOC, OBSTACK_CALLOC): Define.
-	
+
 2004-03-15  Andrew Cagney  <cagney@redhat.com>
 
 	* cris-tdep.c (bfd_lookup_symbol): Delete unused function.
@@ -520,7 +4606,7 @@
 2004-03-14  Daniel Jacobowitz  <drow@mvista.com>
 
 	* dwarf2read.c (read_structure_type): Rename from
-	read_structure_scope.  Don't create a symbol or call process_die. 
+	read_structure_scope.  Don't create a symbol or call process_die.
 	Return immediately if die->type is set.  Call read_type_die before
 	dwarf2_add_member_fn.
 	(process_structure_scope): New function.
@@ -766,27 +4852,27 @@
 	* config/pa/tm-hppa.h (DEPRECATED_DO_REGISTERS_INFO)
 	(pa_do_registers_info): Delete.
 	* hppa-tdep.c (pa_do_registers_info, pa_do_strcat_registers_info)
-	(pa_print_registers, pa_print_fp_reg, pa_strcat_registers) 
+	(pa_print_registers, pa_print_fp_reg, pa_strcat_registers)
 	(pa_strcat_fp_reg, pa_register_look_aside): Delete.
 
 	* infcall.c (legacy_push_dummy_code): Delete #ifdef
 	GDB_TARGET_IS_HPPA code.
 	* config/pa/tm-hppa.h (DEPRECATED_FIX_CALL_DUMMY)
-	(hppa_fix_call_dummy, DEPRECATED_CALL_DUMMY_HAS_COMPLETED) 
+	(hppa_fix_call_dummy, DEPRECATED_CALL_DUMMY_HAS_COMPLETED)
 	(DEPRECATED_DUMMY_WRITE_SP, CALL_DUMMY): Delete.
 	* config/pa/tm-hppa64.h (CALL_DUMMY): Delete.
-	* hppa-tdep.c (hppa_frame_chain, hppa_frame_chain_valid) 
-	(hppa_push_dummy_frame, hppa_pop_frame, hppa_push_arguments) 
-	(hppa_fix_call_dummy, hppa64_stack_align, hppa_frame_saved_pc) 
+	* hppa-tdep.c (hppa_frame_chain, hppa_frame_chain_valid)
+	(hppa_push_dummy_frame, hppa_pop_frame, hppa_push_arguments)
+	(hppa_fix_call_dummy, hppa64_stack_align, hppa_frame_saved_pc)
 	(hppa_init_extra_frame_info, hppa_saved_pc_after_call)
-	(hppa64_call_dummy_breakpoint_offset, hppa_frame_init_saved_regs) 
-	(hppa_frameless_function_invocation, hppa64_store_return_value) 
-	(hppa_store_struct_return, hppa64_extract_return_value) 
+	(hppa64_call_dummy_breakpoint_offset, hppa_frame_init_saved_regs)
+	(hppa_frameless_function_invocation, hppa64_store_return_value)
+	(hppa_store_struct_return, hppa64_extract_return_value)
 	(hppa64_use_struct_convention, hppa_frame_find_saved_regs)
-	(hppa32_call_dummy_length, hppa64_call_dummy_length) 
+	(hppa32_call_dummy_length, hppa64_call_dummy_length)
 	(find_dummy_frame_regs, FUNC_LDIL_OFFSET, FUNC_LDO_OFFSET)
-	(find_proc_framesize, deposit_21, restore_pc_queue) 
-	(find_return_regnum, pc_in_interrupt_handler, deposit_14) 
+	(find_proc_framesize, deposit_21, restore_pc_queue)
+	(find_return_regnum, pc_in_interrupt_handler, deposit_14)
 	(rp_saved, pc_in_linker_stub): Delete.
 
 	Unconditionally enable 64-bit frame and ABI code.
@@ -858,8 +4944,8 @@
 2004-03-04  Orjan Friberg  <orjanf@axis.com>
 
 	* cris-tdep.c (cris_scan_prologue): Save the frame pointer's offset
-	when the frame pointer is pushed.  Don't set the frame pointer's 
-	address on the stack unless it's actually located there.  
+	when the frame pointer is pushed.  Don't set the frame pointer's
+	address on the stack unless it's actually located there.
 	Set the SRP's address on the stack correctly when the PC is still in
 	the prologue.
 	(cris_return_value): New function.
@@ -1025,7 +5111,7 @@
 	(cris_unwind_sp, cris_store_return_value, cris_extract_return_value)
 	(cris_reg_struct_has_addr): New functions.
 	(cris_examine, cris_frame_init_saved_regs, cris_frame_chain)
-	(cris_frame_saved_pc, cris_saved_pc_after_call, 
+	(cris_frame_saved_pc, cris_saved_pc_after_call,
 	(cris_store_struct_return, cris_frameless_function_invocation)
 	(cris_pop_frame, cris_skip_prologue_main)
 	(cris_abi_original_store_return_value)
@@ -1038,18 +5124,18 @@
 	(cris_push_return_address, cris_abi_update): Remove.
 	(_initialize_cris_tdep): Remove ABI command.
 	(cris_dump_tdep): Ditto.
-	(cris_gdbarch_init): Remove ABI command.  
+	(cris_gdbarch_init): Remove ABI command.
 	Set store_return_value, extract_return_value, push_dummy_code,
 	push_dummy_call, frame_align, unwind_pc, unwind_sp, unwind_dummy_id,
 	frame_unwind_append_sniffer, frame_base_set_default.
 	Clear deprecated init_frame_pc, push_arguments, store_return_value,
 	extract_return_value, fp_regnum, pc_in_call_dummy, call_dummy_words,
 	sizeof_call_dummy_words, get_saved_register, push_return_address,
-	pop_frame, store_struct_return, frame_init_saved_regs, 
+	pop_frame, store_struct_return, frame_init_saved_regs,
 	init_extra_frame_info, frameless_function_invocation, frame_chain,
 	frame_saved_pc, saved_pc_after_call, save_dummy_frame_tos,
 	dummy_write_sp.
-	
+
 2004-02-26  Jeff Johnston  <jjohnstn@redhat.com>
 
 	* valprint.h (print_hex_chars, print_char_chars): New prototypes.
@@ -1121,7 +5207,7 @@
 	"x86-64-tdep.h".
 	* amd64obsd-nat.c: Include "amd64-tdep.h" instead of
 	"x86-64-tdep.h".
-	* configure.host: (x86_64-*-linux*): Set gdb_target to linux64. 
+	* configure.host: (x86_64-*-linux*): Set gdb_target to linux64.
 	* configure.tgt (x86_64-*-linux*): Set gdb_target to linux64.
 	* Makefile.in (amd64_linux_tdep_h): Renamed from
 	x86_64_linux_tdep_h.
@@ -3307,7 +7393,7 @@
 	variable `funcaddr'.  Fix some coding-standards problems.
 
 	* sparc-tdep.c (sparc_regset_from_core_section): Check whether
-	SECT_SIZE is large enough, not wheter it's exactly the right size.
+	SECT_SIZE is large enough, not whether it's exactly the right size.
 	(sparc32_gdbarch_init): Initialize TDEP->sizeof_gregset and
 	TDEP->fpregset to zero.
 
diff --git a/gdb/ChangeLog-2002 b/gdb/ChangeLog-2002
index ad2cfda..e5c1419 100644
--- a/gdb/ChangeLog-2002
+++ b/gdb/ChangeLog-2002
@@ -14494,7 +14494,7 @@
 	* rs6000-tdep.c (rs6000_register_virtual_type): Change type of
 	AltiVec register to new builtin type.
 
-2001-01-15  Daniel Jacobowitz  <drow@mvista.com>
+2002-01-15  Daniel Jacobowitz  <drow@mvista.com>
 
 	* stabsread.c (read_type): Pass dbx_lookup_type (typenums)
 	to make_cv_type.
diff --git a/gdb/MAINTAINERS b/gdb/MAINTAINERS
index 53b3a11..083a532 100644
--- a/gdb/MAINTAINERS
+++ b/gdb/MAINTAINERS
@@ -6,8 +6,8 @@
 
 Jim Blandy			jimb@redhat.com
 Kevin Buettner			kevinb@redhat.com
-Andrew Cagney			ac131313@redhat.com
-J.T. Conklin			jtc@redback.com
+Andrew Cagney			cagney@gnu.org
+J.T. Conklin			jtc@acorntoolworks.com
 Fred Fish			fnf@ninemoons.com
 Daniel Jacobowitz		dan@debian.org
 Mark Kettenis           	kettenis@gnu.org
@@ -104,7 +104,8 @@
 	m68k		--target=m68k-elf ,-Werror
 			Maintenance only
 
-	m88k		Deleted.
+	m88k		--target=m88k-openbsd ,-Werror
+			Mark Kettenis		kettenis@gnu.org
 
 	mcore		--target=mcore-elf ,-Werror
 			Maintenance only
@@ -120,7 +121,7 @@
 	ns32k		--target=ns32k-netbsd ,-Werror
 			Maintenance only
 
-	pa		(--target=hppa-elf broken)
+	pa		--target=hppa-elf ,-Werror
 			Maintenance only
 
 	powerpc		--target=powerpc-eabi ,-Werror
@@ -179,11 +180,12 @@
 
 AIX			Peter Schauer		Peter.Schauer@regent.e-technik.tu-muenchen.de
 			Kevin Buettner		kevinb@redhat.com
+			Joel Brobecker		brobecker@gnat.com
 
 djgpp native		Eli Zaretskii		eliz@gnu.org
 			DJ Delorie		dj@redhat.com
 MS Windows (NT, '00, 9x, Me, XP) host & native
-			Chris Faylor		cgf@redhat.com
+			Chris Faylor		cgf@alum.bu.edu
 GNU/Linux/x86 native & host
 			Mark Kettenis		kettenis@gnu.org
 GNU/Linux PPC native	Kevin Buettner		kevinb@redhat.com
@@ -225,11 +227,11 @@
   coff reader		Philippe De Muyter	phdm@macqel.be
   xcoff reader		Any maintainer can modify this; please send tricky
 			ones to Kevin Buettner <kevinb@redhat.com>
-  linespec		Elena Zannoni		ezannoni@redhat.com
   HP/UX readers		Any [past] maintainer can modify this.
 			Please send tricky ones to the symtabs maintainers.
 
 tracing bytecode stuff  Jim Blandy              jimb@redhat.com
+                        (Global Maintainers)
 tracing			Michael Snyder		msnyder@redhat.com
 threads			Michael Snyder		msnyder@redhat.com
 			Mark Kettenis		kettenis@gnu.org
@@ -248,14 +250,16 @@
 sds protocol		(vacant)
 rdi/adp protocol	(vacant)
 documentation		Eli Zaretskii		eliz@gnu.org
-testsuite		(Global Maintainers)
-  config                Mark Salter             msalter@redhat.com
+testsuite		Michael Chastain	mec.gnu@mindspring.com
+			(Global Maintainers)			
+  lib/, config/, gdb.base/, ...
+			Michael Chastain	mec.gnu@mindspring.com
+			(Global Maintainers)			
   gdbtk (gdb.gdbtk)     Keith Seitz             keiths@redhat.com
   c++ (gdb.cp) 		Michael Chastain	mec.gnu@mindspring.com
-			David Carlton		carlton@kealia.com
+			David Carlton		carlton@bactrian.org
   mi tests (gdb.mi)     Elena Zannoni           ezannoni@redhat.com
                         Andrew Cagney           cagney@redhat.com
-  stabs (gdb.stabs)     Elena Zannoni           ezannoni@redhat.com
   threads (gdb.threads) Michael Snyder          msnyder@redhat.com
   trace (gdb.trace)     Michael Snyder          msnyder@redhat.com
   hp tests (gdb.hp)	(vacant)
@@ -312,15 +316,16 @@
 Jim Blandy					jimb@redhat.com
 Philip Blundell					philb@gnu.org
 Per Bothner					per@bothner.com
-Joel Brobecker					brobecker@act-europe.fr
+Joel Brobecker					brobecker@gnat.com
 Dave Brolley					brolley@redhat.com
 Paul Brook					paul@codesourcery.com
 Kevin Buettner					kevinb@redhat.com
-Andrew Cagney					ac131313@redhat.com
-David Carlton					carlton@kealia.com
+Andrew Cagney					cagney@gnu.org
+David Carlton					carlton@bactrian.org
 Stephane Carrez					stcarrez@nerim.fr
 Michael Chastain				mec.gnu@mindspring.com
 Eric Christopher				echristo@redhat.com
+Randolph Chung					tausq@debian.org
 Nick Clifton					nickc@redhat.com
 Brendan Conoboy					blc@redhat.com
 DJ Delorie					dj@redhat.com
@@ -331,11 +336,11 @@
 Richard Earnshaw				rearnsha@arm.com
 Frank Ch. Eigler				fche@redhat.com
 Ben Elliston					bje@gnu.org
+Brian Ford					ford@vss.fsi.com
 Raoul Gough					RaoulGough@yahoo.co.uk
 Anthony Green			 		green@redhat.com
 Matthew Green					mrg@eterna.com.au
 Jerome Guitton					guitton@act-europe.fr
-Chris Faylor					cgf@redhat.com
 Adam Fedor					fedor@gnu.org
 Fred Fish					fnf@ninemoons.com
 Orjan Friberg					orjanf@axis.com
@@ -364,6 +369,7 @@
 Glen McCready					gkm@redhat.com
 Greg McGary					greg@mcgary.org
 Roland McGrath					roland@redhat.com
+Bryce McKinlay					mckinlay@redhat.com
 Jason Merrill					jason@redhat.com
 David S. Miller					davem@redhat.com
 Mark Mitchell					mark@codesourcery.com
@@ -403,6 +409,7 @@
 Corinna Vinschen				vinschen@redhat.com
 Keith Walker					keith.walker@arm.com
 Kris Warkentin					kewarken@qnx.com
+Ulrich Weigand					uweigand@de.ibm.com
 Nathan Williams					nathanw@wasabisystems.com
 Jim Wilson					wilson@specifixinc.com
 Elena Zannoni					ezannoni@redhat.com
@@ -423,13 +430,15 @@
 Per Bothner (Java)				per at bothner dot com
 Anthony Green (Java)				green at redhat dot com
 Fernando Nasser (testsuite/, mi, cli)           fnasser at redhat dot com
-Mark Salter (testsuite/lib/)                    msalter at redhat dot com
+Mark Salter (testsuite/lib+config)		msalter at redhat dot com
 
 
 
 Folks that have been caught up in a paper trail:
 
+Chris Faylor					cgf@alum.bu.edu
 Jim Kingdon					jkingdon@engr.sgi.com
+David Carlton					carlton@bactrian.org
 
 --
 
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index e2105e5..e8dc635 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -538,7 +538,8 @@
 	scm-exp.c scm-lang.c scm-valprint.c \
 	sentinel-frame.c \
 	serial.c ser-unix.c source.c \
-	stabsread.c stack.c std-regs.c symfile.c symmisc.c symtab.c \
+	stabsread.c stack.c std-regs.c symfile.c symfile-mem.c symmisc.c \
+	symtab.c \
 	target.c thread.c top.c tracepoint.c \
 	trad-frame.c \
 	tramp-frame.c \
@@ -560,7 +561,6 @@
 getopt_h =	$(INCLUDE_DIR)/getopt.h
 floatformat_h =	$(INCLUDE_DIR)/floatformat.h
 bfd_h =		$(BFD_DIR)/bfd.h
-callback_h =	$(INCLUDE_DIR)/gdb/callback.h
 coff_sym_h =	$(INCLUDE_DIR)/coff/sym.h
 coff_symconst_h =	$(INCLUDE_DIR)/coff/symconst.h
 coff_ecoff_h =	$(INCLUDE_DIR)/coff/ecoff.h
@@ -582,11 +582,13 @@
 readline_history_h =	$(READLINE_SRC)/history.h
 frv_desc_h =	$(OPCODES_SRC)/frv-desc.h
 sh_opc_h = 	$(OPCODES_SRC)/sh-opc.h
+gdb_callback_h = $(INCLUDE_DIR)/gdb/callback.h
 gdb_sim_arm_h =	$(INCLUDE_DIR)/gdb/sim-arm.h
 gdb_sim_d10v_h = $(INCLUDE_DIR)/gdb/sim-d10v.h
 gdb_sim_frv_h = $(INCLUDE_DIR)/gdb/sim-frv.h
 gdb_sim_sh_h =	$(INCLUDE_DIR)/gdb/sim-sh.h
 splay_tree_h =  $(INCLUDE_DIR)/splay-tree.h
+hashtab_h =	$(INCLUDE_DIR)/hashtab.h
 
 #
 # $BUILD/ headers
@@ -598,6 +600,8 @@
 msg_reply_S_h = msg_reply_S.h
 msg_U_h = msg_U.h
 notify_S_h = notify_S.h
+observer_h = observer.h
+observer_inc = observer.inc
 process_reply_S_h = process_reply_S.h
 
 #
@@ -627,6 +631,7 @@
 bfd_target_h = bfd-target.h
 block_h = block.h
 breakpoint_h = breakpoint.h $(frame_h) $(value_h) $(gdb_events_h)
+bsd_kvm_h = bsd-kvm.h
 buildsym_h = buildsym.h
 call_cmds_h = call-cmds.h
 charset_h = charset.h
@@ -692,16 +697,17 @@
 inferior_h = inferior.h $(breakpoint_h) $(target_h) $(frame_h)
 inf_loop_h = inf-loop.h
 inflow_h = inflow.h $(terminal_h)
-infttrace_h = infttrace.h
+infttrace_h = infttrace.h $(target_h)
 interps_h = interps.h
 jv_lang_h = jv-lang.h
 kod_h = kod.h
 language_h = language.h
 libunwind_frame_h = libunwind-frame.h $(libunwind_h)
 linespec_h = linespec.h
-linux_nat_h = linux-nat.h
+linux_nat_h = linux-nat.h $(target_h)
 m2_lang_h = m2-lang.h
 m68k_tdep_h = m68k-tdep.h
+m88k_tdep_h = m88k-tdep.h
 macroexp_h = macroexp.h
 macroscope_h = macroscope.h $(macrotab_h) $(symtab_h)
 macrotab_h = macrotab.h
@@ -716,7 +722,6 @@
 nto_tdep_h = nto-tdep.h $(defs_h) $(solist_h)
 objc_lang_h = objc-lang.h
 objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h)
-observer_h = observer.h
 ocd_h = ocd.h
 osabi_h = osabi.h
 pa64solib_h = pa64solib.h
@@ -772,7 +777,6 @@
 wince_stub_h = wince-stub.h
 wrapper_h = wrapper.h $(gdb_h)
 xcoffsolib_h = xcoffsolib.h
-xmodem_h = xmodem.h
 
 #
 # gdb/cli/ headers
@@ -826,7 +830,8 @@
 	environ.h $(gdbcmd_h) gdb.h gdbcore.h \
 	gdb-stabs.h $(inferior_h) language.h minimon.h monitor.h \
 	objfiles.h parser-defs.h serial.h solib.h \
-	symfile.h stabsread.h target.h terminal.h typeprint.h xcoffsolib.h \
+	symfile.h symfile-mem.h stabsread.h target.h terminal.h typeprint.h \
+	xcoffsolib.h \
 	macrotab.h macroexp.h macroscope.h \
 	c-lang.h f-lang.h \
 	jv-lang.h \
@@ -906,7 +911,7 @@
 	frame-base.o \
 	gnu-v2-abi.o gnu-v3-abi.o hpacc-abi.o cp-abi.o cp-support.o \
 	cp-namespace.o \
-	reggroups.o \
+	reggroups.o regset.o \
 	trad-frame.o \
 	tramp-frame.o
 
@@ -951,6 +956,34 @@
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS) check; \
 	else true; fi
 
+# The idea is to parallelize testing of multilibs, for example:
+#   make -j3 check//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
+# will run 3 concurrent sessions of check, eventually testing all 10
+# combinations.  GNU make is required for the % pattern to work, as is
+# a shell that expands alternations within braces.  If GNU make is not
+# used, this rule will harmlessly fail to match.
+check//%: force
+	@if [ -f testsuite/config.status ]; then \
+	  rootme=`pwd`; export rootme; \
+	  rootsrc=`cd $(srcdir); pwd`; export rootsrc; \
+	  target=`echo "$@" | sed 's,//.*,,'`; \
+	  variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
+	  vardots=`echo "$$variant" | sed 's,/,.,g'`; \
+	  testdir=testsuite.$$vardots; \
+	  if [ ! -f $$testdir/Makefile ]; then \
+	    (cd testsuite && find . -name config.status) | \
+	    sed s,/config.status$$,, | sort | while read subdir; do \
+	      $(SHELL) $(srcdir)/../mkinstalldirs $$testdir/$$subdir && \
+	      (cd $$testdir/$$subdir && \
+	       $(SHELL) $$rootme/testsuite/$$subdir/config.status \
+		 --recheck && \
+	       $(SHELL) ./config.status); done; \
+	  else :; fi && cd $$testdir && \
+	  $(MAKE) $(TARGET_FLAGS_TO_PASS) \
+	    RUNTESTFLAGS="--target_board=$$variant $(RUNTESTFLAGS)" \
+	    "$$target"; \
+	else true; fi
+
 info dvi install-info clean-info html install-html: force
 	@$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
 
@@ -1153,8 +1186,6 @@
 # for some machines.
 # But these rules don't do what we want; we want to hack the foo.o: tm.h
 # dependency to do the right thing.
-tm-sun3.h tm-altos.h: tm-m68k.h
-tm-sun2.h tm-3b1.h: tm-m68k.h
 xm-vaxult.h: xm-vax.h
 xm-vaxbsd.h: xm-vax.h
 
@@ -1281,6 +1312,11 @@
 	mv version.c-tmp version.c
 version.o: version.c $(version_h)
 
+observer.h: observer.sh doc/observer.texi
+	${srcdir}/observer.sh h ${srcdir}/doc/observer.texi observer.h
+
+observer.inc: observer.sh doc/observer.texi
+	${srcdir}/observer.sh inc ${srcdir}/doc/observer.texi observer.inc
 
 lint: $(LINTFILES)
 	$(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
@@ -1315,16 +1351,20 @@
 	arm-linux-nat.c arm-linux-tdep.c arm-tdep.c \
 	armnbsd-nat.c armnbsd-tdep.c \
 	avr-tdep.c \
+	bsd-kvm.c \
 	coff-solib.c \
 	core-regset.c core-aout.c corelow.c \
-	dcache.c delta68-nat.c dpx2-nat.c exec.c fork-child.c \
+	dcache.c exec.c fork-child.c \
 	glibc-tdep.c \
 	go32-nat.c h8300-tdep.c \
 	hppa-tdep.c hppa-hpux-tdep.c \
 	hppah-nat.c hpread.c \
+	hppa-linux-tdep.c hppa-linux-nat.c \
+	hppabsd-nat.c hppabsd-tdep.c \
 	i386-tdep.c i386v-nat.c i386-linux-nat.c \
 	i386v4-nat.c i386ly-tdep.c i386-cygwin-tdep.c \
 	i386bsd-nat.c i386bsd-tdep.c i386fbsd-nat.c i386fbsd-tdep.c \
+	i386nbsd-nat.c i386nbsd-tdep.c i386obsd-nat.c i386obsd-tdep.c \
 	i387-tdep.c \
 	i386-linux-tdep.c i386-nat.c \
 	i386gnu-nat.c i386gnu-tdep.c \
@@ -1334,6 +1374,8 @@
 	lynx-nat.c m3-nat.c \
 	m68hc11-tdep.c \
 	m68k-tdep.c \
+	m68kbsd-nat.c m68kbsd-tdep.c \
+	m88k-tdep.c m88kbsd-nat.c \
 	mcore-tdep.c \
 	mips-linux-nat.c mips-linux-tdep.c \
 	mips-nat.c \
@@ -1343,8 +1385,9 @@
 	nbsd-tdep.c \
 	ns32k-tdep.c solib-osf.c \
 	somread.c somsolib.c $(HPREAD_SOURCE) \
-	ppc-sysv-tdep.o ppc-linux-nat.c ppc-linux-tdep.c \
-	ppcnbsd-nat.o ppcnbsd-tdep.o \
+	ppc-sysv-tdep.c ppc-linux-nat.c ppc-linux-tdep.c \
+	ppcnbsd-nat.c ppcnbsd-tdep.c \
+	ppcobsd-nat.c ppcobsd-tdep.c \
 	procfs.c \
 	remote-e7000.c \
 	remote-hms.c remote-m32r-sdi.c remote-mips.c \
@@ -1362,7 +1405,6 @@
 	sparc64-tdep.c sparc64fbsd-nat.c sparc64fbsd-tdep.c \
 	sparc64nbsd-nat.c sparc64nbsd-tdep.c sparc64obsd-tdep.c \
 	sparcnbsd-nat.c sparcnbsd-tdep.c sparcobsd-tdep.c \
-	sun3-nat.c \
 	symm-tdep.c symm-nat.c \
 	vax-tdep.c \
 	vx-share/xdr_ld.c vx-share/xdr_ptrace.c vx-share/xdr_rdb.c \
@@ -1496,7 +1538,7 @@
 	$(annotate_h) $(ada_lang_h) $(c_lang_h) $(infcall_h)
 aix-thread.o: aix-thread.c $(defs_h) $(gdb_assert_h) $(gdbthread_h) \
 	$(target_h) $(inferior_h) $(regcache_h) $(gdbcmd_h) $(language_h) \
-	$(ppc_tdep_h)
+	$(ppc_tdep_h) $(gdb_string_h)
 alphabsd-nat.o: alphabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
 	$(alpha_tdep_h) $(alphabsd_tdep_h) $(gregset_h)
 alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(alpha_tdep_h) \
@@ -1511,8 +1553,8 @@
 alpha-nat.o: alpha-nat.c $(defs_h) $(gdb_string_h) $(inferior_h) \
 	$(gdbcore_h) $(target_h) $(regcache_h) $(alpha_tdep_h) $(gregset_h)
 alphanbsd-tdep.o: alphanbsd-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
-	$(regcache_h) $(value_h) $(osabi_h) $(solib_svr4_h) $(alpha_tdep_h) \
-	$(alphabsd_tdep_h) $(nbsd_tdep_h)
+	$(regcache_h) $(value_h) $(osabi_h) $(gdb_string_h) $(alpha_tdep_h) \
+	$(alphabsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h)
 alpha-osf1-tdep.o: alpha-osf1-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \
 	$(value_h) $(osabi_h) $(gdb_string_h) $(objfiles_h) $(alpha_tdep_h)
 alpha-tdep.o: alpha-tdep.c $(defs_h) $(doublest_h) $(frame_h) \
@@ -1520,11 +1562,11 @@
 	$(symtab_h) $(value_h) $(gdbcmd_h) $(gdbcore_h) $(dis_asm_h) \
 	$(symfile_h) $(objfiles_h) $(gdb_string_h) $(linespec_h) \
 	$(regcache_h) $(reggroups_h) $(arch_utils_h) $(osabi_h) $(block_h) \
-	$(elf_bfd_h) $(alpha_tdep_h)
+	$(elf_bfd_h) $(infcall_h) $(alpha_tdep_h)
 amd64bsd-nat.o: amd64bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
 	$(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h)
 amd64fbsd-nat.o: amd64fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
-	$(gdb_assert_h) $(gregset_h) $(amd64_tdep_h) $(amd64_nat_h)
+	$(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h)
 amd64fbsd-tdep.o: amd64fbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
 	$(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) \
 	$(amd64_tdep_h) $(solib_svr4_h)
@@ -1533,20 +1575,21 @@
 	$(gdb_proc_service_h) $(gregset_h) $(amd64_tdep_h) \
 	$(i386_linux_tdep_h) $(amd64_nat_h)
 amd64-linux-tdep.o: amd64-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \
-	$(regcache_h) $(osabi_h) $(gdb_string_h) $(amd64_tdep_h) \
-	$(solib_svr4_h)
+	$(regcache_h) $(osabi_h) $(symtab_h) $(gdb_string_h) \
+	$(amd64_tdep_h) $(solib_svr4_h)
 amd64-nat.o: amd64-nat.c $(defs_h) $(gdbarch_h) $(regcache_h) \
 	$(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(amd64_tdep_h)
 amd64nbsd-nat.o: amd64nbsd-nat.c $(defs_h) $(gdb_assert_h) $(amd64_tdep_h) \
 	$(amd64_nat_h)
 amd64nbsd-tdep.o: amd64nbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
-	$(gdbcore_h) $(osabi_h) $(gdb_assert_h) $(amd64_tdep_h) \
+	$(gdbcore_h) $(osabi_h) $(symtab_h) $(gdb_assert_h) $(amd64_tdep_h) \
 	$(nbsd_tdep_h) $(solib_svr4_h)
-amd64obsd-nat.o: amd64obsd-nat.c $(defs_h) $(gdb_assert_h) $(amd64_tdep_h) \
-	$(amd64_nat_h)
+amd64obsd-nat.o: amd64obsd-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \
+	$(gdb_assert_h) $(amd64_tdep_h) $(amd64_nat_h) $(bsd_kvm_h)
 amd64obsd-tdep.o: amd64obsd-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \
-	$(osabi_h) $(regset_h) $(target_h) $(gdb_assert_h) $(gdb_string_h) \
-	$(amd64_tdep_h) $(i387_tdep_h) $(solib_svr4_h)
+	$(symtab_h) $(objfiles_h) $(osabi_h) $(regset_h) $(target_h) \
+	$(gdb_assert_h) $(gdb_string_h) $(amd64_tdep_h) $(i387_tdep_h) \
+	$(solib_svr4_h)
 amd64-tdep.o: amd64-tdep.c $(defs_h) $(arch_utils_h) $(block_h) \
 	$(dummy_frame_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \
 	$(inferior_h) $(gdbcmd_h) $(gdbcore_h) $(objfiles_h) $(regcache_h) \
@@ -1557,7 +1600,7 @@
 arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(buildsym_h) \
 	$(gdbcmd_h) $(inferior_h) $(gdb_string_h) $(regcache_h) \
 	$(gdb_assert_h) $(sim_regno_h) $(osabi_h) $(version_h) \
-	$(floatformat_h)
+	$(floatformat_h) $(gdbcore_h)
 arm-linux-nat.o: arm-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
 	$(gdb_string_h) $(regcache_h) $(arm_tdep_h) $(gregset_h)
 arm-linux-tdep.o: arm-linux-tdep.c $(defs_h) $(target_h) $(value_h) \
@@ -1566,8 +1609,8 @@
 	$(glibc_tdep_h)
 armnbsd-nat.o: armnbsd-nat.c $(defs_h) $(arm_tdep_h) $(inferior_h) \
 	$(regcache_h) $(gdbcore_h)
-armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) $(osabi_h) $(arm_tdep_h) \
-	$(nbsd_tdep_h) $(solib_svr4_h)
+armnbsd-tdep.o: armnbsd-tdep.c $(defs_h) $(osabi_h) $(gdb_string_h) \
+	$(arm_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h)
 arm-tdep.o: arm-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(gdbcmd_h) \
 	$(gdbcore_h) $(gdb_string_h) $(dis_asm_h) $(regcache_h) \
 	$(doublest_h) $(value_h) $(arch_utils_h) $(osabi_h) \
@@ -1603,6 +1646,9 @@
 	$(objfiles_h) $(source_h) $(linespec_h) $(completer_h) $(gdb_h) \
 	$(ui_out_h) $(cli_script_h) $(gdb_assert_h) $(block_h) \
 	$(gdb_events_h)
+bsd-kvm.o: bsd-kvm.c $(defs_h) $(cli_cmds.h) $(command_h) $(value_h) \
+	$(frame_h) $(regcache_h) $(target_h) $(gdb_assert_h) $(readline_h) \
+	$(bsd_kvm_h)
 buildsym.o: buildsym.c $(defs_h) $(bfd_h) $(gdb_obstack_h) $(symtab_h) \
 	$(symfile_h) $(objfiles_h) $(gdbtypes_h) $(gdb_assert_h) \
 	$(complaints_h) $(gdb_string_h) $(expression_h) $(language_h) \
@@ -1642,7 +1688,7 @@
 corelow.o: corelow.c $(defs_h) $(arch_utils_h) $(gdb_string_h) $(frame_h) \
 	$(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \
 	$(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \
-	$(exec_h) $(readline_h) $(gdb_assert_h)
+	$(exec_h) $(readline_h) $(gdb_assert_h) $(observer_h)
 core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \
 	$(inferior_h) $(target_h) $(gdb_string_h) $(gregset_h)
 cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \
@@ -1688,7 +1734,6 @@
 	$(cp_abi_h) $(gdb_assert_h) $(aout_aout64_h) $(aout_stab_gnu_h)
 dcache.o: dcache.c $(defs_h) $(dcache_h) $(gdbcmd_h) $(gdb_string_h) \
 	$(gdbcore_h) $(target_h)
-delta68-nat.o: delta68-nat.c $(defs_h)
 demangle.o: demangle.c $(defs_h) $(command_h) $(gdbcmd_h) $(demangle_h) \
 	$(gdb_string_h)
 dictionary.o: dictionary.c $(defs_h) $(gdb_obstack_h) $(symtab_h) \
@@ -1699,7 +1744,6 @@
 	$(gdb_string_h) $(disasm_h) $(gdbcore_h) $(dis_asm_h)
 doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \
 	$(gdb_assert_h) $(gdb_string_h) $(gdbtypes_h)
-dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h)
 dsrec.o: dsrec.c $(defs_h) $(serial_h) $(srec_h) $(gdb_assert_h) \
 	$(gdb_string_h)
 dummy-frame.o: dummy-frame.c $(defs_h) $(dummy_frame_h) $(regcache_h) \
@@ -1722,7 +1766,7 @@
 	$(objfiles_h) $(elf_dwarf2_h) $(buildsym_h) $(demangle_h) \
 	$(expression_h) $(filenames_h) $(macrotab_h) $(language_h) \
 	$(complaints_h) $(bcache_h) $(dwarf2expr_h) $(dwarf2loc_h) \
-	$(cp_support_h) $(gdb_string_h) $(gdb_assert_h)
+	$(cp_support_h) $(gdb_string_h) $(gdb_assert_h) $(hashtab_h)
 dwarfread.o: dwarfread.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(objfiles_h) \
 	$(elf_dwarf_h) $(buildsym_h) $(demangle_h) $(expression_h) \
 	$(language_h) $(complaints_h) $(gdb_string_h)
@@ -1747,7 +1791,8 @@
 	$(value_h) $(language_h) $(parser_defs_h) $(user_regs_h) $(target_h) \
 	$(gdb_string_h) $(block_h)
 fbsd-proc.o: fbsd-proc.c $(defs_h) $(gdbcore_h) $(inferior_h) \
-	$(gdb_string_h) $(elf_bfd_h) $(gregset_h)
+	$(regcache_h) $(regset_h) $(gdb_assert_h) $(gdb_string_h) \
+	$(elf_bfd_h)
 f-exp.o: f-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(value_h) \
 	$(parser_defs_h) $(language_h) $(f_lang_h) $(bfd_h) $(symfile_h) \
 	$(objfiles_h) $(block_h)
@@ -1767,16 +1812,17 @@
 	$(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(user_regs_h) \
 	$(gdb_obstack_h) $(dummy_frame_h) $(sentinel_frame_h) $(gdbcore_h) \
 	$(annotate_h) $(language_h) $(frame_unwind_h) $(frame_base_h) \
-	$(command_h) $(gdbcmd_h)
+	$(command_h) $(gdbcmd_h) $(observer_h)
 frame-unwind.o: frame-unwind.c $(defs_h) $(frame_h) $(frame_unwind_h) \
 	$(gdb_assert_h) $(dummy_frame_h) $(gdb_obstack_h)
 frv-linux-tdep.o: frv-linux-tdep.c $(defs_h) $(target_h) $(frame_h) \
-	$(osabi_h) $(elf_bfd_h) $(elf_frv_h) $(frv_tdep_h)
+	$(osabi_h) $(elf_bfd_h) $(elf_frv_h) $(frv_tdep_h) \
+	$(trad_frame_h) $(frame_unwind_h)
 frv-tdep.o: frv-tdep.c $(defs_h) $(gdb_string_h) $(inferior_h) $(gdbcore_h) \
 	$(arch_utils_h) $(regcache_h) $(frame_h) $(frame_unwind_h) \
 	$(frame_base_h) $(trad_frame_h) $(dis_asm_h) $(gdb_assert_h) \
 	$(sim_regno_h) $(gdb_sim_frv_h) $(opcodes_frv_desc_h) $(symtab_h) \
-	$(elf_bfd_h) $(elf_frv_h) $(osabi_h) $(frv_tdep_h)
+	$(elf_bfd_h) $(elf_frv_h) $(osabi_h) $(infcall_h) $(frv_tdep_h)
 f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
 	$(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
 	$(f_lang_h) $(gdb_string_h)
@@ -1816,42 +1862,48 @@
 hpacc-abi.o: hpacc-abi.c $(defs_h) $(value_h) $(gdb_regex_h) $(gdb_string_h) \
 	$(gdbtypes_h) $(gdbcore_h) $(cp_abi_h)
 hppah-nat.o: hppah-nat.c $(defs_h) $(inferior_h) $(target_h) $(gdbcore_h) \
-	$(gdb_wait_h) $(regcache_h) $(gdb_string_h)
-hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
-	$(osabi_h) $(gdb_string_h) $(frame_h)
-hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \
-	$(value_h) $(regcache_h) $(completer_h) $(language_h) $(osabi_h) \
-	$(gdb_assert_h) $(infttrace_h) $(arch_utils_h) $(symtab_h) \
-	$(infcall_h) $(dis_asm_h) $(trad_frame_h) $(frame_unwind_h) \
-	$(frame_base_h) $(a_out_encap_h) $(gdb_stat_h) $(gdb_wait_h) \
-	$(gdbcore_h) $(gdbcmd_h) $(target_h) $(symfile_h) $(objfiles_h) \
+	$(gdb_wait_h) $(regcache_h) $(gdb_string_h) $(infttrace_h) \
 	$(hppa_tdep_h)
+hppa-hpux-tdep.o: hppa-hpux-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
+	$(osabi_h) $(gdb_string_h) $(frame_h) $(frame_unwind_h) \
+	$(trad_frame_h) $(symtab_h) $(objfiles_h) $(inferior_h) $(infcall_h) \
+	$(observer_h) $(hppa_tdep_h)
+hppa-tdep.o: hppa-tdep.c $(defs_h) $(frame_h) $(bfd_h) $(inferior_h) \
+	$(regcache_h) $(completer_h) $(osabi_h) $(gdb_assert_h) \
+	$(arch_utils_h) $(symtab_h) $(dis_asm_h) $(trad_frame_h) \
+	$(frame_unwind_h) $(frame_base_h) $(gdbcore_h) $(gdbcmd_h) \
+	$(symfile_h) $(objfiles_h) $(hppa_tdep_h)
+hppa-linux-tdep.o: hppa-linux-tdep.c $(defs_h) $(gdbcore_h) $(osabi_h) \
+	$(target_h) $(objfiles_h) $(solib_svr4_h) $(glibc_tdep_h) \
+	$(frame_unwind_h) $(trad_frame_h) $(dwarf2_frame_h) $(hppa_tdep_h) \
+	$(elf_common_h) $(value_h)
+hppa-linux-nat.o: hppa-linux-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \
+	$(gdb_string_h) $(inferior_h)
+hppabsd-nat.o: hppabsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+	$(hppa_tdep_h)
+hppabsd-tdep.o: hppabsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \
+	$(regcache_h) $(regset_h) $(gdb_assert_h) $(gdb_string_h) \
+	$(hppa_tdep_h) $(solib_svr4_h)
 hpread.o: hpread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(hp_symtab_h) \
 	$(syms_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \
 	$(complaints_h) $(gdb_stabs_h) $(gdbtypes_h) $(demangle_h) \
-	$(somsolib_h) $(gdb_assert_h) $(gdb_string_h)
+	$(somsolib_h) $(gdb_assert_h) $(gdb_string_h) $(hppa_tdep_h)
 hpux-thread.o: hpux-thread.c $(defs_h) $(gdbthread_h) $(target_h) \
 	$(inferior_h) $(regcache_h) $(gdb_stat_h) $(gdbcore_h)
 i386bsd-nat.o: i386bsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
-	$(gdb_assert_h) $(gregset_h) $(i386_tdep_h) $(i387_tdep_h)
+	$(gdb_assert_h) $(i386_tdep_h) $(i387_tdep_h)
 i386bsd-tdep.o: i386bsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
 	$(gdbcore_h) $(regcache_h) $(osabi_h) $(gdb_string_h) $(i386_tdep_h)
 i386-cygwin-tdep.o: i386-cygwin-tdep.c $(defs_h) $(osabi_h) $(gdb_string_h) \
 	$(i386_tdep_h)
 i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
-	$(i386_tdep_h)
+	$(i386_tdep_h) $(bsd_kvm_h)
 i386fbsd-tdep.o: i386fbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \
 	$(i386_tdep_h) $(i387_tdep_h) $(solib_svr4_h)
 i386gnu-nat.o: i386gnu-nat.c $(defs_h) $(inferior_h) $(floatformat_h) \
 	$(regcache_h) $(gdb_assert_h) $(i386_tdep_h) $(gnu_nat_h) \
 	$(i387_tdep_h) $(gregset_h)
 i386gnu-tdep.o: i386gnu-tdep.c $(defs_h) $(osabi_h) $(i386_tdep_h)
-i386-interix-nat.o: i386-interix-nat.c $(defs_h) $(gdb_string_h) \
-	$(gdbcore_h) $(gregset_h) $(regcache_h)
-i386-interix-tdep.o: i386-interix-tdep.c $(defs_h) $(arch_utils_h) \
-	$(frame_h) $(gdb_string_h) $(gdb_stabs_h) $(gdbcore_h) $(gdbtypes_h) \
-	$(i386_tdep_h) $(inferior_h) $(libbfd_h) $(objfiles_h) $(osabi_h) \
-	$(regcache_h)
 i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
 	$(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
 	$(gregset_h) $(i387_tdep_h) $(i386_tdep_h) $(i386_linux_tdep_h) \
@@ -1863,18 +1915,22 @@
 i386ly-tdep.o: i386ly-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
 	$(regcache_h) $(target_h) $(osabi_h) $(i386_tdep_h)
 i386-nat.o: i386-nat.c $(defs_h) $(breakpoint_h) $(command_h) $(gdbcmd_h)
-i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
-	$(regcache_h) $(regset_h) $(osabi_h) $(gdb_assert_h) $(gdb_string_h) \
-	$(i386_tdep_h) $(i387_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h)
+i386nbsd-nat.o: i386nbsd-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \
+	$(i386_tdep_h) $(bsd_kvm_h)
+i386nbsd-tdep.o: i386nbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
+	$(gdbcore_h) $(regcache_h) $(regset_h) $(osabi_h) $(symtab_h) \
+	$(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(i387_tdep_h) \
+	$(nbsd_tdep_h) $(solib_svr4_h)
 i386-nto-tdep.o: i386-nto-tdep.c $(gdb_string_h) $(gdb_assert_h) $(defs_h) \
 	$(frame_h) $(target_h) $(regcache_h) $(solib_svr4_h) $(i386_tdep_h) \
 	$(nto_tdep_h) $(osabi_h) $(i387_tdep_h)
 i386obsd-nat.o: i386obsd-nat.c $(defs_h) $(i386_tdep_h)
-i386obsd-tdep.o: i386obsd-tdep.c $(defs_h) $(arch_utils_h) $(gdbcore_h) \
-	$(regcache_h) $(regset_h) $(osabi_h) $(target_h) $(gdb_assert_h) \
-	$(gdb_string_h) $(i386_tdep_h) $(i387_tdep_h) $(solib_svr4_h)
+i386obsd-tdep.o: i386obsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \
+	$(gdbcore_h) $(regcache_h) $(regset_h) $(symtab_h) $(objfiles_h) \
+	$(osabi_h) $(target_h) $(gdb_assert_h) $(gdb_string_h) \
+	$(i386_tdep_h) $(i387_tdep_h) $(solib_svr4_h)
 i386-sol2-tdep.o: i386-sol2-tdep.c $(defs_h) $(value_h) $(osabi_h) \
-	$(i386_tdep_h)
+	$(gdb_string_h) $(i386_tdep_h) $(solib_svr4_h)
 i386-stub.o: i386-stub.c
 i386-tdep.o: i386-tdep.c $(defs_h) $(arch_utils_h) $(command_h) \
 	$(dummy_frame_h) $(dwarf2_frame_h) $(doublest_h) $(floatformat_h) \
@@ -1903,7 +1959,7 @@
 	$(arch_utils_h) $(floatformat_h) $(regcache_h) $(reggroups_h) \
 	$(frame_h) $(frame_base_h) $(frame_unwind_h) $(doublest_h) \
 	$(value_h) $(gdb_assert_h) $(objfiles_h) $(elf_common_h) \
-	$(elf_bfd_h) $(elf_h) $(dis_asm_h) $(ia64_tdep_h) \
+	$(elf_bfd_h) $(elf_h) $(dis_asm_h) $(infcall_h) $(ia64_tdep_h) \
 	$(libunwind_frame_h) $(libunwind_ia64_h)
 infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \
 	$(inferior_h) $(gdb_assert_h) $(block_h) $(gdbcore_h) $(language_h) \
@@ -1928,10 +1984,11 @@
 	$(symfile_h) $(top_h) $(inf_loop_h) $(regcache_h) $(value_h) \
 	$(observer_h) $(language_h) $(gdb_assert_h)
 inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
-	$(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h)
+	$(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) $(inflow_h) \
+	$(observer_h)
 infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
 	$(gdb_string_h) $(gdb_wait_h) $(command_h) $(gdbthread_h) \
-	$(gdbcore_h)
+	$(gdbcore_h) $(infttrace_h)
 interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \
 	$(event_top_h) $(interps_h) $(completer_h) $(gdb_string_h) \
 	$(gdb_events_h) $(gdb_assert_h) $(top_h)
@@ -2006,16 +2063,24 @@
 m68klinux-tdep.o: m68klinux-tdep.c $(defs_h) $(gdbcore_h) $(doublest_h) \
 	$(floatformat_h) $(frame_h) $(target_h) $(gdb_string_h) \
 	$(gdbtypes_h) $(osabi_h) $(regcache_h) $(objfiles_h) $(symtab_h) \
-	$(m68k_tdep_h)
-m68knbsd-nat.o: m68knbsd-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
-	$(regcache_h)
-m68knbsd-tdep.o: m68knbsd-tdep.c $(defs_h) $(gdbtypes_h) $(regcache_h)
+	$(m68k_tdep_h) $(trad_frame_h) $(frame_unwind_h)
+m68kbsd-nat.o: m68kbsd-nat.c $(defs_h) $(gdbcore_h) $(inferior_h) \
+	$(regcache_h) $(gdb_assert_h) $(m68k_tdep_h) $(bsd_kvm_h)
+m68kbsd-tdep.o: m68kbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \
+	$(regcache_h) $(regset_h) $(gdb_assert_h) $(gdb_string_h) \
+	$(m68k_tdep_h) $(solib_svr4_h)
 m68k-stub.o: m68k-stub.c
 m68k-tdep.o: m68k-tdep.c $(defs_h) $(dwarf2_frame_h) $(frame_h) \
-	$(frame_base_h) $(frame_unwind_h) $(symtab_h) $(gdbcore_h) \
-	$(value_h) $(gdb_string_h) $(gdb_assert_h) $(inferior_h) \
-	$(regcache_h) $(arch_utils_h) $(osabi_h) $(dis_asm_h) $(m68k_tdep_h) \
-	$(gregset_h)
+	$(frame_base_h) $(frame_unwind_h) $(floatformat_h) $(symtab_h)\
+	$(gdbcore_h) $(value_h) $(gdb_string_h) $(gdb_assert_h)	\
+	$(inferior_h) $(regcache_h) $(arch_utils_h) $(osabi_h) $(dis_asm_h) \
+	$(m68k_tdep_h) $(gregset_h)
+m88kbsd-nat.o: m88kbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+	$(gdb_assert_h) $(m88k_tdep_h)
+m88k-tdep.o: m88k-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) $(frame_h) \
+	$(frame_base_h) $(frame_unwind_h) $(gdbcore_h) $(gdbtypes_h) \
+	$(regcache_h) $(regset_h) $(symtab_h) $(trad_frame_h) $(value_h) \
+	$(gdb_string_h) $(gdb_string_h) $(m88k_tdep_h)
 macrocmd.o: macrocmd.c $(defs_h) $(macrotab_h) $(macroexp_h) $(macroscope_h) \
 	$(command_h) $(gdbcmd_h)
 macroexp.o: macroexp.c $(defs_h) $(gdb_obstack_h) $(bcache_h) $(macrotab_h) \
@@ -2052,7 +2117,7 @@
 mips-linux-nat.o: mips-linux-nat.c $(defs_h) $(mips_tdep_h)
 mips-linux-tdep.o: mips-linux-tdep.c $(defs_h) $(gdbcore_h) $(target_h) \
 	$(solib_svr4_h) $(osabi_h) $(mips_tdep_h) $(gdb_string_h) \
-	$(gdb_assert_h) $(frame_h)
+	$(gdb_assert_h) $(frame_h) $(trad_frame_h) $(tramp_frame_h)
 mips-nat.o: mips-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h)
 mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
 	$(mipsnbsd_tdep_h)
@@ -2069,7 +2134,7 @@
 	$(target_h) $(arch_utils_h) $(regcache_h) $(osabi_h) $(mips_tdep_h) \
 	$(block_h) $(reggroups_h) $(opcode_mips_h) $(elf_mips_h) \
 	$(elf_bfd_h) $(symcat_h) $(sim_regno_h) $(dis_asm_h) \
-	$(frame_unwind_h) $(frame_base_h) $(trad_frame_h)
+	$(frame_unwind_h) $(frame_base_h) $(trad_frame_h) $(infcall_h)
 mipsv4-nat.o: mipsv4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \
 	$(regcache_h) $(gregset_h)
 mn10300-tdep.o: mn10300-tdep.c $(defs_h) $(frame_h) $(inferior_h) \
@@ -2109,7 +2174,8 @@
 	$(objfiles_h) $(gdb_stabs_h) $(target_h) $(bcache_h) $(gdb_assert_h) \
 	$(gdb_stat_h) $(gdb_obstack_h) $(gdb_string_h) $(hashtab_h) \
 	$(breakpoint_h) $(block_h) $(dictionary_h)
-observer.o: observer.c $(defs_h) $(observer_h)
+observer.o: observer.c $(defs_h) $(observer_h) $(observer_inc) \
+	$(command_h) $(gdbcmd_h)
 ocd.o: ocd.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) $(inferior_h) \
 	$(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) \
 	$(gdb_stabs_h) $(serial_h) $(ocd_h) $(regcache_h)
@@ -2118,7 +2184,7 @@
 pa64solib.o: pa64solib.c $(defs_h) $(frame_h) $(bfd_h) $(libhppa_h) \
 	$(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \
 	$(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \
-	$(regcache_h) $(exec_h)
+	$(regcache_h) $(exec_h) $(hppa_tdep_h)
 parse.o: parse.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
 	$(frame_h) $(expression_h) $(value_h) $(command_h) $(language_h) \
 	$(parser_defs_h) $(gdbcmd_h) $(symfile_h) $(inferior_h) \
@@ -2132,24 +2198,29 @@
 ppc-bdm.o: ppc-bdm.c $(defs_h) $(gdbcore_h) $(gdb_string_h) $(frame_h) \
 	$(inferior_h) $(bfd_h) $(symfile_h) $(target_h) $(gdbcmd_h) \
 	$(objfiles_h) $(gdb_stabs_h) $(serial_h) $(ocd_h) $(ppc_tdep_h) \
-	$(regcache_h)
+	$(regcache_h) $(gdb_assert_h)
 ppcbug-rom.o: ppcbug-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
 	$(serial_h) $(regcache_h)
 ppc-linux-nat.o: ppc-linux-nat.c $(defs_h) $(gdb_string_h) $(frame_h) \
-	$(inferior_h) $(gdbcore_h) $(regcache_h) $(gdb_wait_h) $(gregset_h) \
-	$(ppc_tdep_h)
+	$(inferior_h) $(gdbcore_h) $(regcache_h) $(gdb_assert_h) \
+	$(gdb_wait_h) $(gregset_h) $(ppc_tdep_h)
 ppc-linux-tdep.o: ppc-linux-tdep.c $(defs_h) $(frame_h) $(inferior_h) \
 	$(symtab_h) $(target_h) $(gdbcore_h) $(gdbcmd_h) $(symfile_h) \
 	$(objfiles_h) $(regcache_h) $(value_h) $(osabi_h) $(regset_h) \
 	$(solib_svr4_h) $(ppc_tdep_h) $(trad_frame_h) $(frame_unwind_h)
 ppcnbsd-nat.o: ppcnbsd-nat.c $(defs_h) $(inferior_h) $(ppc_tdep_h) \
-	$(ppcnbsd_tdep_h)
+	$(ppcnbsd_tdep_h) $(gdb_assert_h)
 ppcnbsd-tdep.o: ppcnbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
 	$(target_h) $(breakpoint_h) $(value_h) $(osabi_h) $(ppc_tdep_h) \
-	$(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h)
+	$(ppcnbsd_tdep_h) $(nbsd_tdep_h) $(solib_svr4_h) $(gdb_assert)
+ppcobsd-nat.o: ppcobsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
+	$(ppc_tdep_h) $(ppcobsd_tdep_h)
+ppcobsd-tdep.o: ppcobsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \
+	$(regcache_h) $(regset_h) $(gdb_assert_h) $(gdb_string_h) \
+        $(ppc_tdep_h) $(ppcobsd_tdep_h) $(solib_svr4_h)
 ppc-sysv-tdep.o: ppc-sysv-tdep.c $(defs_h) $(gdbcore_h) $(inferior_h) \
 	$(regcache_h) $(value_h) $(gdb_string_h) $(gdb_assert_h) \
-	$(ppc_tdep_h) $(target_h) $(objfiles_h)
+	$(ppc_tdep_h) $(target_h) $(objfiles_h) $(infcall_h)
 printcmd.o: printcmd.c $(defs_h) $(gdb_string_h) $(frame_h) $(symtab_h) \
 	$(gdbtypes_h) $(value_h) $(language_h) $(expression_h) $(gdbcore_h) \
 	$(gdbcmd_h) $(target_h) $(breakpoint_h) $(demangle_h) $(valprint_h) \
@@ -2175,9 +2246,10 @@
 	$(language_h) $(target_h) $(annotate_h) $(p_lang_h) $(cp_abi_h)
 regcache.o: regcache.c $(defs_h) $(inferior_h) $(target_h) $(gdbarch_h) \
 	$(gdbcmd_h) $(regcache_h) $(reggroups_h) $(gdb_assert_h) \
-	$(gdb_string_h) $(gdbcmd_h)
+	$(gdb_string_h) $(gdbcmd_h) $(observer_h)
 reggroups.o: reggroups.c $(defs_h) $(reggroups_h) $(gdbtypes_h) \
 	$(gdb_assert_h) $(regcache_h) $(command_h) $(gdbcmd_h)
+regset.o: regset.c $(defs_h) $(regset_h) $(gdb_assert_h)
 remote.o: remote.c $(defs_h) $(gdb_string_h) $(inferior_h) $(bfd_h) \
 	$(symfile_h) $(target_h) $(gdbcmd_h) $(objfiles_h) $(gdb_stabs_h) \
 	$(gdbthread_h) $(remote_h) $(regcache_h) $(value_h) $(gdb_assert_h) \
@@ -2244,11 +2316,11 @@
 	$(ppc_tdep_h) $(exec_h) $(gdb_stat_h)
 rs6000-tdep.o: rs6000-tdep.c $(defs_h) $(frame_h) $(inferior_h) $(symtab_h) \
 	$(target_h) $(gdbcore_h) $(gdbcmd_h) $(objfiles_h) $(arch_utils_h) \
-	$(regcache_h) $(doublest_h) $(value_h) $(parser_defs_h) $(osabi_h) \
-	$(libbfd_h) $(coff_internal_h) $(libcoff_h) $(coff_xcoff_h) \
-	$(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) $(ppc_tdep_h) \
-	$(gdb_assert_h) $(dis_asm_h) $(trad_frame_h) $(frame_unwind_h) \
-	$(frame_base_h)
+	$(regcache_h) $(regset_g) $(doublest_h) $(value_h) $(parser_defs_h) \
+	$(osabi_h) $(libbfd_h) $(coff_internal_h) $(libcoff_h) \
+	$(coff_xcoff_h) $(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) \
+	$(ppc_tdep_h) $(gdb_assert_h) $(dis_asm_h) $(trad_frame_h) \
+	$(frame_unwind_h) $(frame_base_h) $(infcall_h)
 s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) $(inferior_h) \
 	$(s390_tdep_h)
 s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
@@ -2328,7 +2400,7 @@
 somsolib.o: somsolib.c $(defs_h) $(frame_h) $(bfd_h) $(som_h) $(libhppa_h) \
 	$(gdbcore_h) $(symtab_h) $(breakpoint_h) $(symfile_h) $(objfiles_h) \
 	$(inferior_h) $(gdb_stabs_h) $(gdb_stat_h) $(gdbcmd_h) $(language_h) \
-	$(regcache_h) $(gdb_assert_h) $(exec_h)
+	$(regcache_h) $(gdb_assert_h) $(exec_h) $(hppa_tdep_h)
 source.o: source.c $(defs_h) $(symtab_h) $(expression_h) $(language_h) \
 	$(command_h) $(source_h) $(gdbcmd_h) $(frame_h) $(value_h) \
 	$(gdb_string_h) $(gdb_stat_h) $(gdbcore_h) $(gdb_regex_h) \
@@ -2357,7 +2429,7 @@
 	$(trad_frame_h) $(gdb_assert_h) $(sparc64_tdep_h) $(nbsd_tdep_h)
 sparc64-sol2-tdep.o: sparc64-sol2-tdep.c $(defs_h) $(frame_h) \
 	$(frame_unwind_h) $(gdbarch_h) $(symtab_h) $(objfiles_h) $(osabi_h) \
-	$(trad_frame_h) $(gdb_assert_h) $(sparc64_tdep_h)
+	$(trad_frame_h) $(gdb_assert_h) $(sparc64_tdep_h) $(solib_svr4_h)
 sparc64-tdep.o: sparc64-tdep.c $(defs_h) $(arch_utils_h) $(floatformat_h) \
 	$(frame_h) $(frame_base_h) $(frame_unwind_h) $(gdbcore_h) \
 	$(gdbtypes_h) $(inferior_h) $(symtab_h) $(objfiles_h) $(osabi_h) \
@@ -2370,7 +2442,8 @@
 sparc-nat.o: sparc-nat.c $(defs_h) $(inferior_h) $(regcache_h) $(target_h) \
 	$(gdb_assert_h) $(gdb_string_h) $(gdb_wait_h) $(sparc_tdep_h) \
 	$(sparc_nat_h)
-sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(sparc_tdep_h) $(sparc_nat_h)
+sparcnbsd-nat.o: sparcnbsd-nat.c $(defs_h) $(gdbcore_h) $(regcache_h) \
+	$(sparc_tdep_h) $(sparc_nat_h) $(bsd_kvm_h)
 sparcnbsd-tdep.o: sparcnbsd-tdep.c $(defs_h) $(floatformat_h) $(frame_h) \
 	$(frame_unwind_h) $(gdbcore_h) $(osabi_h) $(regcache_h) $(regset_h) \
 	$(solib_svr4_h) $(symtab_h) $(trad_frame_h) $(gdb_assert_h) \
@@ -2383,7 +2456,7 @@
 sparc-sol2-tdep.o: sparc-sol2-tdep.c $(defs_h) $(frame_h) $(frame_unwind_h) \
 	$(gdbcore_h) $(symtab_h) $(objfiles_h) $(osabi_h) $(regcache_h) \
 	$(target_h) $(trad_frame_h) $(gdb_assert_h) $(gdb_string_h) \
-	$(sparc_tdep_h)
+	$(sparc_tdep_h) $(solib_svr4_h)
 sparc-stub.o: sparc-stub.c
 sparc-tdep.o: sparc-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) \
 	$(floatformat_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \
@@ -2405,7 +2478,6 @@
 std-regs.o: std-regs.c $(defs_h) $(user_regs_h) $(frame_h) $(gdbtypes_h) \
 	$(value_h) $(gdb_string_h)
 stop-gdb.o: stop-gdb.c $(defs_h)
-sun3-nat.o: sun3-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h)
 symfile.o: symfile.c $(defs_h) $(bfdlink_h) $(symtab_h) $(gdbtypes_h) \
 	$(gdbcore_h) $(frame_h) $(target_h) $(value_h) $(symfile_h) \
 	$(objfiles_h) $(source_h) $(gdbcmd_h) $(breakpoint_h) $(language_h) \
@@ -2413,6 +2485,8 @@
 	$(gdb_stabs_h) $(gdb_obstack_h) $(completer_h) $(bcache_h) \
 	$(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \
 	$(gdb_string_h) $(gdb_stat_h)
+symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \
+	$(objfiles_h) $(gdbcmd_h) $(target_h) $(value_h) $(symfile_h)
 symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \
 	$(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \
 	$(gdb_obstack_h) $(language_h) $(bcache_h) $(block_h) $(gdb_regex_h) \
@@ -2478,7 +2552,7 @@
 	$(inferior_h) $(gdbcore_h) $(target_h) $(demangle_h) $(language_h) \
 	$(gdbcmd_h) $(regcache_h) $(cp_abi_h) $(block_h) $(infcall_h) \
 	$(dictionary_h) $(cp_support_h) $(gdb_string_h) $(gdb_assert_h) \
-	$(cp_support_h)
+	$(cp_support_h) $(observer_h)
 valprint.o: valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
 	$(value_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(language_h) \
 	$(annotate_h) $(valprint_h) $(floatformat_h) $(doublest_h)
@@ -2488,9 +2562,13 @@
 	$(gdb_assert_h) $(regcache_h) $(block_h)
 varobj.o: varobj.c $(defs_h) $(value_h) $(expression_h) $(frame_h) \
 	$(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_string_h) $(varobj_h)
-vax-tdep.o: vax-tdep.c $(defs_h) $(symtab_h) $(opcode_vax_h) $(gdbcore_h) \
-	$(inferior_h) $(regcache_h) $(frame_h) $(value_h) $(arch_utils_h) \
-	$(gdb_string_h) $(osabi_h) $(dis_asm_h) $(vax_tdep_h)
+vax-tdep.o: vax-tdep.c $(defs_h) $(arch_utils_h) $(dis_asm_h) $(frame_h) \
+	$(frame_base_h) $(frame_unwind_h) $(gdbcore_h) $(osabi_h) \
+	$(regcache_h) $(regset_h) $(value_h) $(trad_frame_h) \
+	$(gdb_string_h) $(vax_tdep_h)
+vaxbsd-nat.o: vaxbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) $(vax_tdep_h)
+vaxnbsd-tdep.o: vaxnbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \
+	$(vax_tdep_h) $(solib_svr4_h) $(gdb_string_h)
 win32-nat.o: win32-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
 	$(gdbcore_h) $(command_h) $(completer_h) $(regcache_h) $(top_h) \
 	$(buildsym_h) $(symfile_h) $(objfiles_h) $(gdb_string_h) \
@@ -2508,7 +2586,6 @@
 	$(complaints_h) $(gdb_stabs_h) $(aout_stab_gnu_h)
 xcoffsolib.o: xcoffsolib.c $(defs_h) $(bfd_h) $(xcoffsolib_h) $(inferior_h) \
 	$(gdbcmd_h) $(symfile_h) $(frame_h) $(gdb_regex_h)
-xmodem.o: xmodem.c $(defs_h) $(serial_h) $(target_h) $(xmodem_h)
 xstormy16-tdep.o: xstormy16-tdep.c $(defs_h) $(value_h) $(inferior_h) \
 	$(arch_utils_h) $(regcache_h) $(gdbcore_h) $(objfiles_h) \
 	$(dis_asm_h)
diff --git a/gdb/NEWS b/gdb/NEWS
index 5d4ef06..6e651a7 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,103 @@
 
 *** Changes since GDB 6.1:
 
+* New ``start'' command.
+
+This command runs the program until the begining of the main procedure.
+
+* Signal trampoline code overhauled
+
+Many generic problems with GDB's signal handling code have been fixed.
+These include: backtraces through non-contiguous stacks; recognition
+of sa_sigaction signal trampolines; backtrace from a NULL pointer
+call; backtrace through a signal trampoline; step into and out of
+signal handlers; and single-stepping in the signal trampoline.
+
+These fixes were tested on i386 GNU/Linux systems that include a 2.4
+kernel.
+
+* Cygwin support for DWARF 2 added.
+
+* New native configurations
+
+GNU/Linux/hppa					hppa*-*-linux*
+OpenBSD/hppa					hppa*-*-openbsd*
+OpenBSD/m68k					m68*-*-openbsd*
+OpenBSD/m88k					m88*-*-openbsd*
+OpenBSD/powerpc					powerpc-*-openbsd*
+NetBSD/vax					vax-*-netbsd*
+OpenBSD/vax					vax-*-openbsd*
+
+* REMOVED configurations and files
+
+Sun 3, running SunOS 3				m68*-*-sunos3*
+Sun 3, running SunOS 4				m68*-*-sunos4*
+Sun 2, running SunOS 3				m68000-*-sunos3*
+Sun 2, running SunOS 4				m68000-*-sunos4*
+Motorola 680x0 running LynxOS			m68*-*-lynxos*
+AT&T 3b1/Unix pc				m68*-att-*
+Bull DPX2 (68k, System V release 3)		m68*-bull-sysv*
+decstation					mips-dec-* mips-little-*
+riscos						mips-*-riscos* mips-*-sysv*
+sonymips					mips-sony-*
+sysv					mips*-*-sysv4* (IRIX 5/6 not included)
+
+*** Changes in GDB 6.1.1:
+
+* TUI (Text-mode User Interface) built-in (also included in GDB 6.1)
+
+The TUI (Text-mode User Interface) is now built as part of a default
+GDB configuration.  It is enabled by either selecting the TUI with the
+command line option "-i=tui" or by running the separate "gdbtui"
+program.  For more information on the TUI, see the manual "Debugging
+with GDB".
+
+* Pending breakpoint support (also included in GDB 6.1)
+
+Support has been added to allow you to specify breakpoints in shared
+libraries that have not yet been loaded.  If a breakpoint location
+cannot be found, and the "breakpoint pending" option is set to auto,
+GDB queries you if you wish to make the breakpoint pending on a future
+shared-library load.  If and when GDB resolves the breakpoint symbol,
+the pending breakpoint is removed as one or more regular breakpoints
+are created.
+
+Pending breakpoints are very useful for GCJ Java debugging.
+
+* Fixed ISO-C build problems
+
+The files bfd/elf-bfd.h, gdb/dictionary.c and gdb/types.c contained
+non ISO-C code that stopped them being built using a more strict ISO-C
+compiler (e.g., IBM's C compiler).
+
+* Fixed build problem on IRIX 5
+
+Due to header problems with <sys/proc.h>, the file gdb/proc-api.c
+wasn't able to compile compile on an IRIX 5 system.
+
+* Added execute permission to gdb/gdbserver/configure
+
+The shell script gdb/testsuite/gdb.stabs/configure lacked execute
+permission.  This bug would cause configure to fail on a number of
+systems (Solaris, IRIX).  Ref: server/519.
+
+* Fixed build problem on hpux2.0w-hp-hpux11.00 using the HP ANSI C compiler
+
+Older HPUX ANSI C compilers did not accept variable array sizes.  somsolib.c
+has been updated to use constant array sizes.
+
+* Fixed a panic in the DWARF Call Frame Info code on Solaris 2.7
+
+GCC 3.3.2, on Solaris 2.7, includes the DW_EH_PE_funcrel encoding in
+its generated DWARF Call Frame Info.  This encoding was causing GDB to
+panic, that panic has been fixed.  Ref: gdb/1628.
+
+* Fixed a problem when examining parameters in shared library code.
+
+When examining parameters in optimized shared library code generated
+by a mainline GCC, GDB would incorrectly report ``Variable "..." is
+not available''.  GDB now correctly displays the variable's value.
+
 *** Changes in GDB 6.1:
 
 * Removed --with-mmalloc
diff --git a/gdb/PROBLEMS b/gdb/PROBLEMS
index 5455f22..c143bb3 100644
--- a/gdb/PROBLEMS
+++ b/gdb/PROBLEMS
@@ -1,25 +1,45 @@
 
-			Known problems in GDB 6.1
+			Known problems in GDB 6.1.1
 
 		See also: http://www.gnu.org/software/gdb/bugs/
 
-mips*-*-*
-powerpc*-*-*
-sparc*-*-*
 
-GDB's SPARC, MIPS and PowerPC targets, in 6.0, have not been updated
-to use the new frame mechanism.
+*** Build problems
 
-People encountering problems with these targets should consult GDB's
-web pages and mailing lists (http://www.gnu.org/software/gdb/) to see
-if there is an update.
+build/1458: compile failed on hpux11
 
-*** Regressions since gdb 6.0
+GDB has build problems on HP/UX 11 with some versions of the HP
+Ansi C compiler.  (GCC works fine).
 
-gdb/826: variables in C++ namespaces have to be enclosed in quotes
+The problem happens when compiling intl/bindtextdom.c.
+The error is:
 
-When referring to a variable in C++ code that is inside a
-namespace, you have to put it inside single quotes.
+  cc: "gettextP.h", line 50: error 1000: Unexpected symbol: "SWAP".
+  cc: panic 2017: Cannot recover from earlier errors, terminating.
+  *** Error exit code 1
+
+This is a problem with the 'inline' keyword in gettextP.h.
+The workaround is to disable 'inline' before building gdb:
+
+  export ac_cv_c_inline=no
+
+This problem happens only with some versions of the HP Ansi C compiler.
+Versions A.11.01.25171.GP and B.11.11.28706.GP have both been observed
+to work; version B.11.11.04 gets the build error and needs the
+workaround.
+
+This problem might also happen with other C compilers.
+
+*** Misc
+
+gdb/1560: Control-C does not always interrupt GDB.
+
+When GDB is busy processing a command which takes a long time to
+complete, hitting Control-C does not have the expected effect.
+The command execution is not aborted, and the "QUIT" message confirming
+the abortion is displayed only after the command has been completed.
+
+*** C++ support
 
 gdb/931: GDB could be more generous when reading types C++ templates on input
 
@@ -27,11 +47,6 @@
 typed in a certain way (e.g. "const char*" as opposed to "const char *"
 or "char const *" or "char const*").
 
-gdb/1505: [regression] gdb prints a bad backtrace for a thread
-
-When backtracing a thread, gdb doesn't stop until it hits garbage.
-This is sensitive to the operating system and thread library.
-
 gdb/1512: no canonical way to output names of C++ types
 
 We currently don't have any canonical way to output names of C++ types.
@@ -50,14 +65,17 @@
 function, not to variables defined with types that are defined somewhere
 outside any function (which most types are).
 
-gdb/1560: Control-C does not always interrupt GDB.
+gdb/1588: names of c++ nested types in casts must be enclosed in quotes
 
-When GDB is busy processing a command which takes a long time to
-complete, hitting Control-C does not have the expected effect.
-The command execution is not aborted, and the "QUIT" message confirming
-the abortion is displayed only after the command has been completed.
-
-*** Regressions since gdb 5.3
+You must type
+  (gdb) print ('Foo::Bar') x
+or
+  (gdb) print ('Foo::Bar' *) y
+instead of
+  (gdb) print (Foo::Bar) x
+or
+  (gdb) print (Foo::Bar *) y
+respectively.
 
 gdb/1091: Constructor breakpoints ignored
 gdb/1193: g++ 3.3 creates multiple constructors: gdb 5.3 can't set breakpoints
@@ -76,3 +94,38 @@
 function with a hidden parameter, but gcc 3.x conforms to a multi-vendor
 ABI for C++ which requires multiple object code functions.
 
+*** Stack backtraces
+
+GDB's core code base has been updated to use a new backtrace
+mechanism.  This mechanism makes it possible to support new features
+such DWARF 2 Call Frame Information (which in turn makes possible
+backtraces through optimized code).
+
+Since this code is new, it is known to still have a few problems:
+
+gdb/1505: [regression] gdb prints a bad backtrace for a thread
+
+When backtracing a thread, gdb does not stop when it reaches the
+outermost frame, instead continuing until it hits garbage.  This is
+sensitive to the operating system and thread library.
+
+hppa*-*-*
+mips*-*-*
+
+The MIPS and HPPA backtrace code has only very recently been updated
+to use GDB's new frame mechanism.  At present there are still a few
+problems, in particular backtraces through signal handlers do not
+work.
+
+People encountering problems with these architectures should consult
+GDB's web pages and mailing lists (http://www.gnu.org/software/gdb/)
+to see if there are updates.
+
+powerpc*-*-*
+
+PowerPC architecture support, in 6.1, does not use the new frame code.
+
+Fortunately, PowerPC architecture support, in GDB's mainline sources,
+have been updated.  People encountering problems should consider
+downloading a more current snapshot of GDB
+(http://www.gnu.org/software/gdb/current/).
diff --git a/gdb/acconfig.h b/gdb/acconfig.h
index 87560c7..02dcb70 100644
--- a/gdb/acconfig.h
+++ b/gdb/acconfig.h
@@ -165,3 +165,9 @@
 
 /* nativefile */
 #undef GDB_NM_FILE
+
+/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl.  Works
+   around a <sys/proc.h> problem on IRIX 5.  */
+#ifndef _KMEMUSER
+#undef _KMEMUSER
+#endif
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index a85ce02..319070a 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -8,7 +8,7 @@
 sinclude(../config/acinclude.m4)
 
 dnl CYGNUS LOCAL: This gets the right posix flag for gcc
-AC_DEFUN(CY_AC_TCL_LYNX_POSIX,
+AC_DEFUN([CY_AC_TCL_LYNX_POSIX],
 [AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])
 AC_MSG_CHECKING([if running LynxOS])
 AC_CACHE_VAL(ac_cv_os_lynx,
@@ -48,7 +48,7 @@
 # makes configure think it's cross compiling. If --target wasn't used, then
 # we can't configure, so something is wrong. We don't use the cache
 # here cause if somebody fixes their compiler install, we want this to work.
-AC_DEFUN(CY_AC_C_WORKS,
+AC_DEFUN([CY_AC_C_WORKS],
 [# If we cannot compile and link a trivial program, we can't expect anything to work
 AC_MSG_CHECKING(whether the compiler ($CC) actually works)
 AC_TRY_COMPILE(, [/* don't need anything here */],
@@ -67,7 +67,7 @@
 AC_MSG_RESULT(yes)
 ])
 
-AC_DEFUN(CY_AC_PATH_TCLH, [
+AC_DEFUN([CY_AC_PATH_TCLH], [
 #
 # Ok, lets find the tcl source trees so we can use the headers
 # Warning: transition of version 9 to 10 will break this algorithm
@@ -156,7 +156,7 @@
 ])
 
 
-AC_DEFUN(CY_AC_PATH_TCLCONFIG, [
+AC_DEFUN([CY_AC_PATH_TCLCONFIG], [
 #
 # Ok, lets find the tcl configuration
 # First, look for one uninstalled.  
@@ -229,7 +229,7 @@
 
 # Defined as a separate macro so we don't have to cache the values
 # from PATH_TCLCONFIG (because this can also be cached).
-AC_DEFUN(CY_AC_LOAD_TCLCONFIG, [
+AC_DEFUN([CY_AC_LOAD_TCLCONFIG], [
     . $TCLCONFIG
 
     AC_SUBST(TCL_VERSION)
@@ -285,7 +285,7 @@
 #  - Symbols in tkConfig.sh are different than tclConfig.sh
 #  - Acceptable for Tk to be missing but not Tcl.
 
-AC_DEFUN(CY_AC_PATH_TKH, [
+AC_DEFUN([CY_AC_PATH_TKH], [
 #
 # Ok, lets find the tk source trees so we can use the headers
 # If the directory (presumably symlink) named "tk" exists, use that one
@@ -379,7 +379,7 @@
 ])
 
 
-AC_DEFUN(CY_AC_PATH_TKCONFIG, [
+AC_DEFUN([CY_AC_PATH_TKCONFIG], [
 #
 # Ok, lets find the tk configuration
 # First, look for one uninstalled.  
@@ -453,7 +453,7 @@
 
 # Defined as a separate macro so we don't have to cache the values
 # from PATH_TKCONFIG (because this can also be cached).
-AC_DEFUN(CY_AC_LOAD_TKCONFIG, [
+AC_DEFUN([CY_AC_LOAD_TKCONFIG], [
     if test -f "$TKCONFIG" ; then
       . $TKCONFIG
     fi
@@ -484,7 +484,7 @@
 
 # check for Itcl headers. 
 
-AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [
+AC_DEFUN([CY_AC_PATH_ITCLCONFIG], [
 #
 # Ok, lets find the itcl configuration
 # First, look for one uninstalled.  
@@ -557,7 +557,7 @@
 
 # Defined as a separate macro so we don't have to cache the values
 # from PATH_ITCLCONFIG (because this can also be cached).
-AC_DEFUN(CY_AC_LOAD_ITCLCONFIG, [
+AC_DEFUN([CY_AC_LOAD_ITCLCONFIG], [
     if test -f "$ITCLCONFIG" ; then
       . $ITCLCONFIG
     fi
@@ -586,7 +586,7 @@
 
 # check for Itcl headers. 
 
-AC_DEFUN(CY_AC_PATH_ITCLH, [
+AC_DEFUN([CY_AC_PATH_ITCLH], [
 AC_MSG_CHECKING(for Itcl private headers. srcdir=${srcdir})
 if test x"${ac_cv_c_itclh}" = x ; then
   for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
@@ -610,7 +610,7 @@
 ])
 
 
-AC_DEFUN(CY_AC_PATH_ITKCONFIG, [
+AC_DEFUN([CY_AC_PATH_ITKCONFIG], [
 #
 # Ok, lets find the itk configuration
 # First, look for one uninstalled.  
@@ -684,7 +684,7 @@
 
 # Defined as a separate macro so we don't have to cache the values
 # from PATH_ITKCONFIG (because this can also be cached).
-AC_DEFUN(CY_AC_LOAD_ITKCONFIG, [
+AC_DEFUN([CY_AC_LOAD_ITKCONFIG], [
     if test -f "$ITKCONFIG" ; then
       . $ITKCONFIG
     fi
@@ -711,7 +711,7 @@
     AC_SUBST(ITK_LIB_SPEC)
 ])
 
-AC_DEFUN(CY_AC_PATH_ITKH, [
+AC_DEFUN([CY_AC_PATH_ITKH], [
 AC_MSG_CHECKING(for Itk private headers. srcdir=${srcdir})
 if test x"${ac_cv_c_itkh}" = x ; then
   for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
@@ -949,7 +949,7 @@
 dnl in a different context somewhere else.
 dnl gcc_AC_CHECK_DECL(SYMBOL,
 dnl 	[ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]])
-AC_DEFUN(gcc_AC_CHECK_DECL,
+AC_DEFUN([gcc_AC_CHECK_DECL],
 [AC_MSG_CHECKING([whether $1 is declared])
 AC_CACHE_VAL(gcc_cv_have_decl_$1,
 [AC_TRY_COMPILE([$4],
@@ -967,7 +967,7 @@
 dnl Arrange to define HAVE_DECL_<FUNCTION> to 0 or 1 as appropriate.
 dnl gcc_AC_CHECK_DECLS(SYMBOLS,
 dnl 	[ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]])
-AC_DEFUN(gcc_AC_CHECK_DECLS,
+AC_DEFUN([gcc_AC_CHECK_DECLS],
 [for ac_func in $1
 do
 changequote(, )dnl
diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
index 40399a6..22bbb45 100644
--- a/gdb/aclocal.m4
+++ b/gdb/aclocal.m4
@@ -20,7 +20,7 @@
 sinclude(../config/acinclude.m4)
 
 dnl CYGNUS LOCAL: This gets the right posix flag for gcc
-AC_DEFUN(CY_AC_TCL_LYNX_POSIX,
+AC_DEFUN([CY_AC_TCL_LYNX_POSIX],
 [AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])
 AC_MSG_CHECKING([if running LynxOS])
 AC_CACHE_VAL(ac_cv_os_lynx,
@@ -60,7 +60,7 @@
 # makes configure think it's cross compiling. If --target wasn't used, then
 # we can't configure, so something is wrong. We don't use the cache
 # here cause if somebody fixes their compiler install, we want this to work.
-AC_DEFUN(CY_AC_C_WORKS,
+AC_DEFUN([CY_AC_C_WORKS],
 [# If we cannot compile and link a trivial program, we can't expect anything to work
 AC_MSG_CHECKING(whether the compiler ($CC) actually works)
 AC_TRY_COMPILE(, [/* don't need anything here */],
@@ -79,7 +79,7 @@
 AC_MSG_RESULT(yes)
 ])
 
-AC_DEFUN(CY_AC_PATH_TCLH, [
+AC_DEFUN([CY_AC_PATH_TCLH], [
 #
 # Ok, lets find the tcl source trees so we can use the headers
 # Warning: transition of version 9 to 10 will break this algorithm
@@ -168,7 +168,7 @@
 ])
 
 
-AC_DEFUN(CY_AC_PATH_TCLCONFIG, [
+AC_DEFUN([CY_AC_PATH_TCLCONFIG], [
 #
 # Ok, lets find the tcl configuration
 # First, look for one uninstalled.  
@@ -241,7 +241,7 @@
 
 # Defined as a separate macro so we don't have to cache the values
 # from PATH_TCLCONFIG (because this can also be cached).
-AC_DEFUN(CY_AC_LOAD_TCLCONFIG, [
+AC_DEFUN([CY_AC_LOAD_TCLCONFIG], [
     . $TCLCONFIG
 
     AC_SUBST(TCL_VERSION)
@@ -297,7 +297,7 @@
 #  - Symbols in tkConfig.sh are different than tclConfig.sh
 #  - Acceptable for Tk to be missing but not Tcl.
 
-AC_DEFUN(CY_AC_PATH_TKH, [
+AC_DEFUN([CY_AC_PATH_TKH], [
 #
 # Ok, lets find the tk source trees so we can use the headers
 # If the directory (presumably symlink) named "tk" exists, use that one
@@ -391,7 +391,7 @@
 ])
 
 
-AC_DEFUN(CY_AC_PATH_TKCONFIG, [
+AC_DEFUN([CY_AC_PATH_TKCONFIG], [
 #
 # Ok, lets find the tk configuration
 # First, look for one uninstalled.  
@@ -465,7 +465,7 @@
 
 # Defined as a separate macro so we don't have to cache the values
 # from PATH_TKCONFIG (because this can also be cached).
-AC_DEFUN(CY_AC_LOAD_TKCONFIG, [
+AC_DEFUN([CY_AC_LOAD_TKCONFIG], [
     if test -f "$TKCONFIG" ; then
       . $TKCONFIG
     fi
@@ -496,7 +496,7 @@
 
 # check for Itcl headers. 
 
-AC_DEFUN(CY_AC_PATH_ITCLCONFIG, [
+AC_DEFUN([CY_AC_PATH_ITCLCONFIG], [
 #
 # Ok, lets find the itcl configuration
 # First, look for one uninstalled.  
@@ -569,7 +569,7 @@
 
 # Defined as a separate macro so we don't have to cache the values
 # from PATH_ITCLCONFIG (because this can also be cached).
-AC_DEFUN(CY_AC_LOAD_ITCLCONFIG, [
+AC_DEFUN([CY_AC_LOAD_ITCLCONFIG], [
     if test -f "$ITCLCONFIG" ; then
       . $ITCLCONFIG
     fi
@@ -598,7 +598,7 @@
 
 # check for Itcl headers. 
 
-AC_DEFUN(CY_AC_PATH_ITCLH, [
+AC_DEFUN([CY_AC_PATH_ITCLH], [
 AC_MSG_CHECKING(for Itcl private headers. srcdir=${srcdir})
 if test x"${ac_cv_c_itclh}" = x ; then
   for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
@@ -622,7 +622,7 @@
 ])
 
 
-AC_DEFUN(CY_AC_PATH_ITKCONFIG, [
+AC_DEFUN([CY_AC_PATH_ITKCONFIG], [
 #
 # Ok, lets find the itk configuration
 # First, look for one uninstalled.  
@@ -696,7 +696,7 @@
 
 # Defined as a separate macro so we don't have to cache the values
 # from PATH_ITKCONFIG (because this can also be cached).
-AC_DEFUN(CY_AC_LOAD_ITKCONFIG, [
+AC_DEFUN([CY_AC_LOAD_ITKCONFIG], [
     if test -f "$ITKCONFIG" ; then
       . $ITKCONFIG
     fi
@@ -723,7 +723,7 @@
     AC_SUBST(ITK_LIB_SPEC)
 ])
 
-AC_DEFUN(CY_AC_PATH_ITKH, [
+AC_DEFUN([CY_AC_PATH_ITKH], [
 AC_MSG_CHECKING(for Itk private headers. srcdir=${srcdir})
 if test x"${ac_cv_c_itkh}" = x ; then
   for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
@@ -957,7 +957,7 @@
 dnl in a different context somewhere else.
 dnl gcc_AC_CHECK_DECL(SYMBOL,
 dnl 	[ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]])
-AC_DEFUN(gcc_AC_CHECK_DECL,
+AC_DEFUN([gcc_AC_CHECK_DECL],
 [AC_MSG_CHECKING([whether $1 is declared])
 AC_CACHE_VAL(gcc_cv_have_decl_$1,
 [AC_TRY_COMPILE([$4],
@@ -975,7 +975,7 @@
 dnl Arrange to define HAVE_DECL_<FUNCTION> to 0 or 1 as appropriate.
 dnl gcc_AC_CHECK_DECLS(SYMBOLS,
 dnl 	[ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]])
-AC_DEFUN(gcc_AC_CHECK_DECLS,
+AC_DEFUN([gcc_AC_CHECK_DECLS],
 [for ac_func in $1
 do
 changequote(, )dnl
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index f4cbb37..9e91817 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -1,6 +1,6 @@
 /* YACC parser for Ada expressions, for GDB.
-   Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1997, 2000, 2003
-   Free Software Foundation, Inc.
+   Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1997, 2000, 2003, 
+   2004 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -34,11 +34,11 @@
    with include files (<malloc.h> and <stdlib.h> for example) just became
    too messy, particularly when such includes can be inserted at random
    times by the parser generator.  */
-   
+
 %{
 
 #include "defs.h"
-#include <string.h>
+#include "gdb_string.h"
 #include <ctype.h>
 #include "expression.h"
 #include "value.h"
@@ -56,9 +56,9 @@
    yacc generated parsers in gdb.  These are only the variables
    produced by yacc.  If other parser generators (bison, byacc, etc) produce
    additional global names that conflict at link time, then those parser
-   generators need to be fixed instead of adding those names to this list. */
+   generators need to be fixed instead of adding those names to this list.  */
 
-/* NOTE: This is clumsy, especially since BISON and FLEX provide --prefix  
+/* NOTE: This is clumsy, especially since BISON and FLEX provide --prefix
    options.  I presume we are maintaining it to accommodate systems
    without BISON?  (PNH) */
 
@@ -69,13 +69,13 @@
 #define	yylval	ada_lval
 #define	yychar	ada_char
 #define	yydebug	ada_debug
-#define	yypact	ada_pact	
-#define	yyr1	ada_r1			
-#define	yyr2	ada_r2			
-#define	yydef	ada_def		
-#define	yychk	ada_chk		
-#define	yypgo	ada_pgo		
-#define	yyact	ada_act		
+#define	yypact	ada_pact
+#define	yyr1	ada_r1
+#define	yyr2	ada_r2
+#define	yydef	ada_def
+#define	yychk	ada_chk
+#define	yypgo	ada_pgo
+#define	yyact	ada_act
 #define	yyexca	ada_exca
 #define yyerrflag ada_errflag
 #define yynerrs	ada_nerrs
@@ -101,15 +101,15 @@
 #define YYFPRINTF parser_fprintf
 
 struct name_info {
-  struct symbol* sym;
-  struct minimal_symbol* msym;
-  struct block* block;
+  struct symbol *sym;
+  struct minimal_symbol *msym;
+  struct block *block;
   struct stoken stoken;
 };
 
 /* If expression is in the context of TYPE'(...), then TYPE, else
- * NULL. */
-static struct type* type_qualifier;
+ * NULL.  */
+static struct type *type_qualifier;
 
 int yyparse (void);
 
@@ -119,19 +119,14 @@
 
 static struct stoken string_to_operator (struct stoken);
 
-static void write_attribute_call0 (enum ada_attribute);
+static void write_int (LONGEST, struct type *);
 
-static void write_attribute_call1 (enum ada_attribute, LONGEST);
+static void write_object_renaming (struct block *, struct symbol *, int);
 
-static void write_attribute_calln (enum ada_attribute, int);
+static void write_var_from_name (struct block *, struct name_info);
 
-static void write_object_renaming (struct block*, struct symbol*);
-
-static void write_var_from_name (struct block*, struct name_info);
-
-static LONGEST
-convert_char_literal (struct type*, LONGEST);
-%} 
+static LONGEST convert_char_literal (struct type *, LONGEST);
+%}
 
 %union
   {
@@ -169,9 +164,9 @@
    Contexts where this distinction is not important can use the
    nonterminal "name", which matches either NAME or TYPENAME.  */
 
-%token <sval> STRING 
+%token <sval> STRING
 %token <ssym> NAME DOT_ID OBJECT_RENAMING
-%type <bval> block 
+%type <bval> block
 %type <lval> arglist tick_arglist
 
 %type <tval> save_qualifier
@@ -180,9 +175,7 @@
 
 /* Special type cases, put in to allow the parser to distinguish different
    legal basetypes.  */
-%token <lval> LAST REGNAME
-
-%token <ivar> INTERNAL_VARIABLE
+%token <sval> SPECIAL_VARIABLE
 
 %nonassoc ASSIGN
 %left _AND_ OR XOR THEN ELSE
@@ -192,9 +185,9 @@
 %left UNARY
 %left '*' '/' MOD REM
 %right STARSTAR ABS NOT
- /* The following are right-associative only so that reductions at this 
-    precedence have lower precedence than '.' and '('. The syntax still 
-    forces a.b.c, e.g., to be LEFT-associated. */
+ /* The following are right-associative only so that reductions at this
+    precedence have lower precedence than '.' and '('.  The syntax still
+    forces a.b.c, e.g., to be LEFT-associated.  */
 %right TICK_ACCESS TICK_ADDRESS TICK_FIRST TICK_LAST TICK_LENGTH
 %right TICK_MAX TICK_MIN TICK_MODULUS
 %right TICK_POS TICK_RANGE TICK_SIZE TICK_TAG TICK_VAL
@@ -225,7 +218,7 @@
 simple_exp :	simple_exp DOT_ID
 			{ write_exp_elt_opcode (STRUCTOP_STRUCT);
 			  write_exp_string ($2.stoken);
-			  write_exp_elt_opcode (STRUCTOP_STRUCT); 
+			  write_exp_elt_opcode (STRUCTOP_STRUCT);
 			  }
 	;
 
@@ -241,17 +234,15 @@
 			{
 			  write_exp_elt_opcode (UNOP_CAST);
 			  write_exp_elt_type ($1);
-			  write_exp_elt_opcode (UNOP_CAST); 
+			  write_exp_elt_opcode (UNOP_CAST);
 			}
 	;
 
 simple_exp :	type '\'' save_qualifier { type_qualifier = $1; } '(' exp ')'
 			{
-			  /*			  write_exp_elt_opcode (UNOP_QUAL); */
-			  /* FIXME: UNOP_QUAL should be defined in expression.h */
+			  write_exp_elt_opcode (UNOP_QUAL);
 			  write_exp_elt_type ($1);
-			  /* write_exp_elt_opcode (UNOP_QUAL); */
-			  /* FIXME: UNOP_QUAL should be defined in expression.h */
+			  write_exp_elt_opcode (UNOP_QUAL);
 			  type_qualifier = $3;
 			}
 	;
@@ -267,34 +258,16 @@
 simple_exp :	'(' exp1 ')'	{ }
 	;
 
-simple_exp :	variable	
+simple_exp :	variable
 	;
 
-simple_exp:	REGNAME /* GDB extension */
-			{ write_exp_elt_opcode (OP_REGISTER);
-			  write_exp_elt_longcst ((LONGEST) $1);
-			  write_exp_elt_opcode (OP_REGISTER); 
-			}
+simple_exp:	SPECIAL_VARIABLE /* Various GDB extensions */
+			{ write_dollar_variable ($1); }
 	;
 
-simple_exp:	INTERNAL_VARIABLE /* GDB extension */
-			{ write_exp_elt_opcode (OP_INTERNALVAR);
-			  write_exp_elt_intern ($1);
-			  write_exp_elt_opcode (OP_INTERNALVAR); 
-			}
-	;
-
-
 exp	: 	simple_exp
 	;
 
-simple_exp:	LAST
-			{ write_exp_elt_opcode (OP_LAST);
-			  write_exp_elt_longcst ((LONGEST) $1);
-			  write_exp_elt_opcode (OP_LAST); 
-			 }
-	;
-
 exp	: 	exp ASSIGN exp   /* Extension for convenience */
 			{ write_exp_elt_opcode (BINOP_ASSIGN); }
 	;
@@ -332,7 +305,7 @@
 		/* GDB extension */
 			{ write_exp_elt_opcode (UNOP_MEMVAL);
 			  write_exp_elt_type ($2);
-			  write_exp_elt_opcode (UNOP_MEMVAL); 
+			  write_exp_elt_opcode (UNOP_MEMVAL);
 			}
 	;
 
@@ -387,42 +360,32 @@
 	;
 
 exp	:	exp IN exp DOTDOT exp
-                        { /*write_exp_elt_opcode (TERNOP_MBR); */ }
-                          /* FIXME: TERNOP_MBR should be defined in
-			     expression.h */
+			{ write_exp_elt_opcode (TERNOP_IN_RANGE); }
         |       exp IN exp TICK_RANGE tick_arglist
-                        { /*write_exp_elt_opcode (BINOP_MBR); */
-			  /* FIXME: BINOP_MBR should be defined in expression.h */
+			{ write_exp_elt_opcode (BINOP_IN_BOUNDS);
 			  write_exp_elt_longcst ((LONGEST) $5);
-			  /*write_exp_elt_opcode (BINOP_MBR); */
+			  write_exp_elt_opcode (BINOP_IN_BOUNDS);
 			}
  	|	exp IN TYPENAME		%prec TICK_ACCESS
-                        { /*write_exp_elt_opcode (UNOP_MBR); */
-			  /* FIXME: UNOP_QUAL should be defined in expression.h */			  
+			{ write_exp_elt_opcode (UNOP_IN_RANGE);
 		          write_exp_elt_type ($3);
-			  /*		          write_exp_elt_opcode (UNOP_MBR); */
-			  /* FIXME: UNOP_MBR should be defined in expression.h */			  
+		          write_exp_elt_opcode (UNOP_IN_RANGE);
 			}
 	|	exp NOT IN exp DOTDOT exp
-                        { /*write_exp_elt_opcode (TERNOP_MBR); */
-			  /* FIXME: TERNOP_MBR should be defined in expression.h */			  			  
-		          write_exp_elt_opcode (UNOP_LOGICAL_NOT); 
+			{ write_exp_elt_opcode (TERNOP_IN_RANGE);
+		          write_exp_elt_opcode (UNOP_LOGICAL_NOT);
 			}
         |       exp NOT IN exp TICK_RANGE tick_arglist
-                        { /* write_exp_elt_opcode (BINOP_MBR); */
-			  /* FIXME: BINOP_MBR should be defined in expression.h */
+			{ write_exp_elt_opcode (BINOP_IN_BOUNDS);
 			  write_exp_elt_longcst ((LONGEST) $6);
-			  /*write_exp_elt_opcode (BINOP_MBR);*/
-			  /* FIXME: BINOP_MBR should be defined in expression.h */			  
-		          write_exp_elt_opcode (UNOP_LOGICAL_NOT); 
+			  write_exp_elt_opcode (BINOP_IN_BOUNDS);
+		          write_exp_elt_opcode (UNOP_LOGICAL_NOT);
 			}
  	|	exp NOT IN TYPENAME	%prec TICK_ACCESS
-                        { /*write_exp_elt_opcode (UNOP_MBR);*/
-			  /* FIXME: UNOP_MBR should be defined in expression.h */			  
+			{ write_exp_elt_opcode (UNOP_IN_RANGE);
 		          write_exp_elt_type ($4);
-			  /*		          write_exp_elt_opcode (UNOP_MBR);*/
-			  /* FIXME: UNOP_MBR should be defined in expression.h */			  			  
-		          write_exp_elt_opcode (UNOP_LOGICAL_NOT); 
+		          write_exp_elt_opcode (UNOP_IN_RANGE);
+		          write_exp_elt_opcode (UNOP_LOGICAL_NOT);
 			}
 	;
 
@@ -438,7 +401,7 @@
 			{ write_exp_elt_opcode (BINOP_GTR); }
 	;
 
-exp     :	exp _AND_ exp  /* Fix for Ada elementwise AND. */
+exp     :	exp _AND_ exp  /* Fix for Ada elementwise AND.  */
 			{ write_exp_elt_opcode (BINOP_BITWISE_AND); }
         ;
 
@@ -450,7 +413,7 @@
 			{ write_exp_elt_opcode (BINOP_BITWISE_IOR); }
         ;
 
-exp     :       exp OR ELSE exp        
+exp     :       exp OR ELSE exp
 			{ write_exp_elt_opcode (BINOP_LOGICAL_OR); }
         ;
 
@@ -467,31 +430,37 @@
 			  write_exp_elt_opcode (UNOP_CAST);
 			}
 	|	simple_exp TICK_FIRST tick_arglist
-			{ write_attribute_call1 (ATR_FIRST, $3); }
+			{ write_int ($3, builtin_type_int);
+			  write_exp_elt_opcode (OP_ATR_FIRST); }
 	|	simple_exp TICK_LAST tick_arglist
-			{ write_attribute_call1 (ATR_LAST, $3); }
+			{ write_int ($3, builtin_type_int);
+			  write_exp_elt_opcode (OP_ATR_LAST); }
 	| 	simple_exp TICK_LENGTH tick_arglist
-			{ write_attribute_call1 (ATR_LENGTH, $3); }
-        |       simple_exp TICK_SIZE 
-			{ write_attribute_call0 (ATR_SIZE); }
+			{ write_int ($3, builtin_type_int);
+			  write_exp_elt_opcode (OP_ATR_LENGTH); }
+        |       simple_exp TICK_SIZE
+			{ write_exp_elt_opcode (OP_ATR_SIZE); }
 	|	simple_exp TICK_TAG
-			{ write_attribute_call0 (ATR_TAG); }
+			{ write_exp_elt_opcode (OP_ATR_TAG); }
         |       opt_type_prefix TICK_MIN '(' exp ',' exp ')'
-			{ write_attribute_calln (ATR_MIN, 2); }
+			{ write_exp_elt_opcode (OP_ATR_MIN); }
         |       opt_type_prefix TICK_MAX '(' exp ',' exp ')'
-			{ write_attribute_calln (ATR_MAX, 2); }
+			{ write_exp_elt_opcode (OP_ATR_MAX); }
 	| 	opt_type_prefix TICK_POS '(' exp ')'
-			{ write_attribute_calln (ATR_POS, 1); }
+			{ write_exp_elt_opcode (OP_ATR_POS); }
 	|	type_prefix TICK_FIRST tick_arglist
-			{ write_attribute_call1 (ATR_FIRST, $3); }
+			{ write_int ($3, builtin_type_int);
+			  write_exp_elt_opcode (OP_ATR_FIRST); }
 	|	type_prefix TICK_LAST tick_arglist
-			{ write_attribute_call1 (ATR_LAST, $3); }
+			{ write_int ($3, builtin_type_int);
+			  write_exp_elt_opcode (OP_ATR_LAST); }
 	| 	type_prefix TICK_LENGTH tick_arglist
-			{ write_attribute_call1 (ATR_LENGTH, $3); }
+			{ write_int ($3, builtin_type_int);
+			  write_exp_elt_opcode (OP_ATR_LENGTH); }
 	|	type_prefix TICK_VAL '(' exp ')'
-			{ write_attribute_calln (ATR_VAL, 1); }
-	|	type_prefix TICK_MODULUS 
-			{ write_attribute_call0 (ATR_MODULUS); }
+			{ write_exp_elt_opcode (OP_ATR_VAL); }
+	|	type_prefix TICK_MODULUS
+			{ write_exp_elt_opcode (OP_ATR_MODULUS); }
 	;
 
 tick_arglist :			%prec '('
@@ -509,74 +478,42 @@
 
 opt_type_prefix :
 		type_prefix
-	| 	/* EMPTY */     
+	| 	/* EMPTY */
 			{ write_exp_elt_opcode (OP_TYPE);
 			  write_exp_elt_type (builtin_type_void);
 			  write_exp_elt_opcode (OP_TYPE); }
 	;
-		
+
 
 exp	:	INT
-			{ write_exp_elt_opcode (OP_LONG);
-			  write_exp_elt_type ($1.type);
-			  write_exp_elt_longcst ((LONGEST)($1.val));
-			  write_exp_elt_opcode (OP_LONG); 
-			}
+			{ write_int ((LONGEST) $1.val, $1.type); }
 	;
 
 exp	:	CHARLIT
-			{ write_exp_elt_opcode (OP_LONG);
-			  if (type_qualifier == NULL) 
-			    write_exp_elt_type ($1.type);
-			  else
-			    write_exp_elt_type (type_qualifier);
-			  write_exp_elt_longcst 
-			    (convert_char_literal (type_qualifier, $1.val));
-			  write_exp_elt_opcode (OP_LONG); 
-			}
+                  { write_int (convert_char_literal (type_qualifier, $1.val),
+			       (type_qualifier == NULL) 
+			       ? $1.type : type_qualifier);
+		  }
 	;
-			      
+
 exp	:	FLOAT
 			{ write_exp_elt_opcode (OP_DOUBLE);
 			  write_exp_elt_type ($1.type);
 			  write_exp_elt_dblcst ($1.dval);
-			  write_exp_elt_opcode (OP_DOUBLE); 
+			  write_exp_elt_opcode (OP_DOUBLE);
 			}
 	;
 
 exp	:	NULL_PTR
-			{ write_exp_elt_opcode (OP_LONG);
-			  write_exp_elt_type (builtin_type_int);
-			  write_exp_elt_longcst ((LONGEST)(0));
-			  write_exp_elt_opcode (OP_LONG); 
-			 }
+			{ write_int (0, builtin_type_int); }
 	;
 
 exp	:	STRING
-			{ /* Ada strings are converted into array constants 
-			     a lower bound of 1.  Thus, the array upper bound 
-			     is the string length. */
-			  char *sp = $1.ptr; int count;
-			  if ($1.length == 0) 
-			    { /* One dummy character for the type */
-			      write_exp_elt_opcode (OP_LONG);
-			      write_exp_elt_type (builtin_type_ada_char);
-			      write_exp_elt_longcst ((LONGEST)(0));
-			      write_exp_elt_opcode (OP_LONG);
-			    }
-			  for (count = $1.length; count > 0; count -= 1)
-			    {
-			      write_exp_elt_opcode (OP_LONG);
-			      write_exp_elt_type (builtin_type_ada_char);
-			      write_exp_elt_longcst ((LONGEST)(*sp));
-			      sp += 1;
-			      write_exp_elt_opcode (OP_LONG);
-			    }
-			  write_exp_elt_opcode (OP_ARRAY);
-			  write_exp_elt_longcst ((LONGEST) 1);
-			  write_exp_elt_longcst ((LONGEST) ($1.length));
-			  write_exp_elt_opcode (OP_ARRAY); 
-			 }
+			{ 
+			  write_exp_elt_opcode (OP_STRING);
+			  write_exp_string ($1);
+			  write_exp_elt_opcode (OP_STRING);
+			}
 	;
 
 exp	: 	NEW TYPENAME
@@ -586,9 +523,12 @@
 variable:	NAME   		{ write_var_from_name (NULL, $1); }
 	|	block NAME  	/* GDB extension */
                                 { write_var_from_name ($1, $2); }
-	|	OBJECT_RENAMING { write_object_renaming (NULL, $1.sym); }
-	|	block OBJECT_RENAMING 
-				{ write_object_renaming ($1, $2.sym); }
+	|	OBJECT_RENAMING 
+		    { write_object_renaming (NULL, $1.sym, 
+				             MAX_RENAMING_CHAIN_LENGTH); }
+	|	block OBJECT_RENAMING
+		    { write_object_renaming ($1, $2.sym, 
+					     MAX_RENAMING_CHAIN_LENGTH); }
 	;
 
 any_name :	NAME 		{ }
@@ -605,14 +545,14 @@
 
 type	:	TYPENAME	{ $$ = $1; }
 	|	block TYPENAME  { $$ = $2; }
-	| 	TYPENAME TICK_ACCESS 
+	| 	TYPENAME TICK_ACCESS
 				{ $$ = lookup_pointer_type ($1); }
 	|	block TYPENAME TICK_ACCESS
 				{ $$ = lookup_pointer_type ($2); }
         ;
 
 /* Some extensions borrowed from C, for the benefit of those who find they
-   can't get used to Ada notation in GDB. */
+   can't get used to Ada notation in GDB.  */
 
 exp	:	'*' exp		%prec '.'
 			{ write_exp_elt_opcode (UNOP_IND); }
@@ -642,49 +582,51 @@
 #define yytext ada_yytext
 #define yywrap ada_yywrap
 
+static struct obstack temp_parse_space;
+
 /* The following kludge was found necessary to prevent conflicts between */
 /* defs.h and non-standard stdlib.h files.  */
 #define qsort __qsort__dummy
 #include "ada-lex.c"
 
 int
-ada_parse ()
+ada_parse (void)
 {
-  lexer_init (yyin);		/* (Re-)initialize lexer. */
+  lexer_init (yyin);		/* (Re-)initialize lexer.  */
   left_block_context = NULL;
   type_qualifier = NULL;
-  
+  obstack_free (&temp_parse_space, NULL);
+  obstack_init (&temp_parse_space);
+
   return _ada_parse ();
 }
 
 void
-yyerror (msg)
-     char *msg;
+yyerror (char *msg)
 {
   error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
 }
 
-/* The operator name corresponding to operator symbol STRING (adds 
+/* The operator name corresponding to operator symbol STRING (adds
    quotes and maps to lower-case).  Destroys the previous contents of
    the array pointed to by STRING.ptr.  Error if STRING does not match
    a valid Ada operator.  Assumes that STRING.ptr points to a
    null-terminated string and that, if STRING is a valid operator
    symbol, the array pointed to by STRING.ptr contains at least
-   STRING.length+3 characters. */ 
+   STRING.length+3 characters.  */
 
 static struct stoken
-string_to_operator (string)
-     struct stoken string;
+string_to_operator (struct stoken string)
 {
   int i;
 
-  for (i = 0; ada_opname_table[i].mangled != NULL; i += 1)
+  for (i = 0; ada_opname_table[i].encoded != NULL; i += 1)
     {
-      if (string.length == strlen (ada_opname_table[i].demangled)-2
-	  && strncasecmp (string.ptr, ada_opname_table[i].demangled+1,
+      if (string.length == strlen (ada_opname_table[i].decoded)-2
+	  && strncasecmp (string.ptr, ada_opname_table[i].decoded+1,
 			  string.length) == 0)
 	{
-	  strncpy (string.ptr, ada_opname_table[i].demangled,
+	  strncpy (string.ptr, ada_opname_table[i].decoded,
 		   string.length+2);
 	  string.length += 2;
 	  return string;
@@ -694,136 +636,105 @@
 }
 
 /* Emit expression to access an instance of SYM, in block BLOCK (if
- * non-NULL), and with :: qualification ORIG_LEFT_CONTEXT. */
+ * non-NULL), and with :: qualification ORIG_LEFT_CONTEXT.  */
 static void
-write_var_from_sym (orig_left_context, block, sym)
-     struct block* orig_left_context;
-     struct block* block;
-     struct symbol* sym;
+write_var_from_sym (struct block *orig_left_context,
+		    struct block *block,
+		    struct symbol *sym)
 {
   if (orig_left_context == NULL && symbol_read_needs_frame (sym))
     {
-      if (innermost_block == 0 ||
-	  contained_in (block, innermost_block))
+      if (innermost_block == 0
+	  || contained_in (block, innermost_block))
 	innermost_block = block;
     }
 
   write_exp_elt_opcode (OP_VAR_VALUE);
-  /* We want to use the selected frame, not another more inner frame
-     which happens to be in the same block */
-  write_exp_elt_block (NULL);
+  write_exp_elt_block (block);
   write_exp_elt_sym (sym);
   write_exp_elt_opcode (OP_VAR_VALUE);
 }
 
-/* Emit expression to access an instance of NAME. */
+/* Emit expression to access an instance of NAME in :: context
+ * ORIG_LEFT_CONTEXT.  If no unique symbol for NAME has been found,
+ * output a dummy symbol (good to the next call of ada_parse) for NAME
+ * in the UNDEF_DOMAIN, for later resolution by ada_resolve.  */
 static void
-write_var_from_name (orig_left_context, name)
-     struct block* orig_left_context;
-     struct name_info name;
+write_var_from_name (struct block *orig_left_context,
+		     struct name_info name)
 {
   if (name.msym != NULL)
     {
-      write_exp_msymbol (name.msym, 
+      write_exp_msymbol (name.msym,
 			 lookup_function_type (builtin_type_int),
 			 builtin_type_int);
     }
-  else if (name.sym == NULL) 
+  else if (name.sym == NULL)
     {
-      /* Multiple matches: record name and starting block for later 
-         resolution by ada_resolve. */
-      /*      write_exp_elt_opcode (OP_UNRESOLVED_VALUE); */
-      /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */      
+      /* Multiple matches: record name and starting block for later
+         resolution by ada_resolve.  */
+      char *encoded_name = ada_encode (name.stoken.ptr);
+      struct symbol *sym =
+	obstack_alloc (&temp_parse_space, sizeof (struct symbol));
+      memset (sym, 0, sizeof (struct symbol));
+      SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN;
+      SYMBOL_LINKAGE_NAME (sym)
+	= obsavestring (encoded_name, strlen (encoded_name), &temp_parse_space);
+      SYMBOL_LANGUAGE (sym) = language_ada;
+
+      write_exp_elt_opcode (OP_VAR_VALUE);
       write_exp_elt_block (name.block);
-      /*      write_exp_elt_name (name.stoken.ptr); */
-      /* FIXME: write_exp_elt_name should be defined in defs.h, located in parse.c */      
-      /*      write_exp_elt_opcode (OP_UNRESOLVED_VALUE); */
-      /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */      
+      write_exp_elt_sym (sym);
+      write_exp_elt_opcode (OP_VAR_VALUE);
     }
   else
     write_var_from_sym (orig_left_context, name.block, name.sym);
 }
 
-/* Write a call on parameterless attribute ATR.  */
+/* Write integer constant ARG of type TYPE.  */
 
 static void
-write_attribute_call0 (atr)
-     enum ada_attribute atr;
-{
-  /*  write_exp_elt_opcode (OP_ATTRIBUTE); */
-  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */      
-  write_exp_elt_longcst ((LONGEST) 0);
-  write_exp_elt_longcst ((LONGEST) atr);
-  /*  write_exp_elt_opcode (OP_ATTRIBUTE); */
-  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */      
-}
-
-/* Write a call on an attribute ATR with one constant integer
- * parameter. */
-
-static void
-write_attribute_call1 (atr, arg)
-     enum ada_attribute atr;
-     LONGEST arg;
+write_int (LONGEST arg, struct type *type)
 {
   write_exp_elt_opcode (OP_LONG);
-  write_exp_elt_type (builtin_type_int);
+  write_exp_elt_type (type);
   write_exp_elt_longcst (arg);
   write_exp_elt_opcode (OP_LONG);
-  /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
-  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
-  write_exp_elt_longcst ((LONGEST) 1);
-  write_exp_elt_longcst ((LONGEST) atr);
-  /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
-  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */        
-}  
+}
 
-/* Write a call on an attribute ATR with N parameters, whose code must have
- * been generated previously. */
-
-static void
-write_attribute_calln (atr, n)
-     enum ada_attribute atr;
-     int n;
-{
-  /*write_exp_elt_opcode (OP_ATTRIBUTE);*/
-  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */      
-  write_exp_elt_longcst ((LONGEST) n);
-  write_exp_elt_longcst ((LONGEST) atr);
-  /*  write_exp_elt_opcode (OP_ATTRIBUTE);*/
-  /* FIXME: OP_ATTRIBUTE should be defined in expression.h */        
-}  
-
-/* Emit expression corresponding to the renamed object designated by 
+/* Emit expression corresponding to the renamed object designated by
  * the type RENAMING, which must be the referent of an object renaming
- * type, in the context of ORIG_LEFT_CONTEXT (?). */
+ * type, in the context of ORIG_LEFT_CONTEXT.  MAX_DEPTH is the maximum
+ * number of cascaded renamings to allow.  */
 static void
-write_object_renaming (orig_left_context, renaming)
-     struct block* orig_left_context;
-     struct symbol* renaming;
+write_object_renaming (struct block *orig_left_context, 
+		       struct symbol *renaming, int max_depth)
 {
-  const char* qualification = DEPRECATED_SYMBOL_NAME (renaming);
-  const char* simple_tail;
-  const char* expr = TYPE_FIELD_NAME (SYMBOL_TYPE (renaming), 0);
-  const char* suffix;
-  char* name;
-  struct symbol* sym;
+  const char *qualification = SYMBOL_LINKAGE_NAME (renaming);
+  const char *simple_tail;
+  const char *expr = TYPE_FIELD_NAME (SYMBOL_TYPE (renaming), 0);
+  const char *suffix;
+  char *name;
+  struct symbol *sym;
   enum { SIMPLE_INDEX, LOWER_BOUND, UPPER_BOUND } slice_state;
 
+  if (max_depth <= 0)
+    error ("Could not find renamed symbol");
+
   /* if orig_left_context is null, then use the currently selected
-     block, otherwise we might fail our symbol lookup below */
+     block; otherwise we might fail our symbol lookup below.  */
   if (orig_left_context == NULL)
     orig_left_context = get_selected_block (NULL);
 
-  for (simple_tail = qualification + strlen (qualification); 
+  for (simple_tail = qualification + strlen (qualification);
        simple_tail != qualification; simple_tail -= 1)
     {
       if (*simple_tail == '.')
 	{
 	  simple_tail += 1;
 	  break;
-	} 
-      else if (DEPRECATED_STREQN (simple_tail, "__", 2))
+	}
+      else if (strncmp (simple_tail, "__", 2) == 0)
 	{
 	  simple_tail += 2;
 	  break;
@@ -834,72 +745,72 @@
   if (suffix == NULL)
     goto BadEncoding;
 
-  name = (char*) malloc (suffix - expr + 1);
-  /*  add_name_string_cleanup (name); */
-  /* FIXME: add_name_string_cleanup should be defined in
-     parser-defs.h, implemented in parse.c */    
+  name = (char *) obstack_alloc (&temp_parse_space, suffix - expr + 1);
   strncpy (name, expr, suffix-expr);
   name[suffix-expr] = '\000';
   sym = lookup_symbol (name, orig_left_context, VAR_DOMAIN, 0, NULL);
-  /*  if (sym == NULL) 
-    error ("Could not find renamed variable: %s", ada_demangle (name));
-  */
-  /* FIXME: ada_demangle should be defined in defs.h, implemented in ada-lang.c */  
-  write_var_from_sym (orig_left_context, block_found, sym);
+  if (sym == NULL)
+    error ("Could not find renamed variable: %s", ada_decode (name));
+  if (ada_is_object_renaming (sym))
+    write_object_renaming (orig_left_context, sym, max_depth-1);
+  else
+    write_var_from_sym (orig_left_context, block_found, sym);
 
   suffix += 5;
   slice_state = SIMPLE_INDEX;
-  while (*suffix == 'X') 
+  while (*suffix == 'X')
     {
       suffix += 1;
 
       switch (*suffix) {
+      case 'A':
+        suffix += 1;
+        write_exp_elt_opcode (UNOP_IND);
+        break;
       case 'L':
 	slice_state = LOWER_BOUND;
       case 'S':
 	suffix += 1;
-	if (isdigit (*suffix)) 
+	if (isdigit (*suffix))
 	  {
-	    char* next;
+	    char *next;
 	    long val = strtol (suffix, &next, 10);
-	    if (next == suffix) 
+	    if (next == suffix)
 	      goto BadEncoding;
 	    suffix = next;
 	    write_exp_elt_opcode (OP_LONG);
 	    write_exp_elt_type (builtin_type_ada_int);
 	    write_exp_elt_longcst ((LONGEST) val);
 	    write_exp_elt_opcode (OP_LONG);
-	  } 
+	  }
 	else
 	  {
-	    const char* end;
-	    char* index_name;
+	    const char *end;
+	    char *index_name;
 	    int index_len;
-	    struct symbol* index_sym;
+	    struct symbol *index_sym;
 
 	    end = strchr (suffix, 'X');
-	    if (end == NULL) 
+	    if (end == NULL)
 	      end = suffix + strlen (suffix);
-	    
+
 	    index_len = simple_tail - qualification + 2 + (suffix - end) + 1;
-	    index_name = (char*) malloc (index_len);
+	    index_name
+	      = (char *) obstack_alloc (&temp_parse_space, index_len);
 	    memset (index_name, '\000', index_len);
-	    /*	    add_name_string_cleanup (index_name);*/
-	    /* FIXME: add_name_string_cleanup should be defined in
-	       parser-defs.h, implemented in parse.c */    	    
 	    strncpy (index_name, qualification, simple_tail - qualification);
 	    index_name[simple_tail - qualification] = '\000';
 	    strncat (index_name, suffix, suffix-end);
 	    suffix = end;
 
-	    index_sym = 
+	    index_sym =
 	      lookup_symbol (index_name, NULL, VAR_DOMAIN, 0, NULL);
 	    if (index_sym == NULL)
 	      error ("Could not find %s", index_name);
 	    write_var_from_sym (NULL, block_found, sym);
 	  }
 	if (slice_state == SIMPLE_INDEX)
-	  { 
+	  {
 	    write_exp_elt_opcode (OP_FUNCALL);
 	    write_exp_elt_longcst ((LONGEST) 1);
 	    write_exp_elt_opcode (OP_FUNCALL);
@@ -916,25 +827,25 @@
       case 'R':
 	{
 	  struct stoken field_name;
-	  const char* end;
+	  const char *end;
 	  suffix += 1;
-	  
+
 	  if (slice_state != SIMPLE_INDEX)
 	    goto BadEncoding;
 	  end = strchr (suffix, 'X');
-	  if (end == NULL) 
+	  if (end == NULL)
 	    end = suffix + strlen (suffix);
 	  field_name.length = end - suffix;
-	  field_name.ptr = (char*) malloc (end - suffix + 1);
+	  field_name.ptr = (char *) malloc (end - suffix + 1);
 	  strncpy (field_name.ptr, suffix, end - suffix);
 	  field_name.ptr[end - suffix] = '\000';
 	  suffix = end;
 	  write_exp_elt_opcode (STRUCTOP_STRUCT);
 	  write_exp_string (field_name);
-	  write_exp_elt_opcode (STRUCTOP_STRUCT); 	  
+	  write_exp_elt_opcode (STRUCTOP_STRUCT);
 	  break;
 	}
-	  
+
       default:
 	goto BadEncoding;
       }
@@ -944,15 +855,15 @@
 
  BadEncoding:
   error ("Internal error in encoding of renaming declaration: %s",
-	 DEPRECATED_SYMBOL_NAME (renaming));
+	 SYMBOL_LINKAGE_NAME (renaming));
 }
 
 /* Convert the character literal whose ASCII value would be VAL to the
    appropriate value of type TYPE, if there is a translation.
-   Otherwise return VAL.  Hence, in an enumeration type ('A', 'B'), 
-   the literal 'A' (VAL == 65), returns 0. */
+   Otherwise return VAL.  Hence, in an enumeration type ('A', 'B'),
+   the literal 'A' (VAL == 65), returns 0.  */
 static LONGEST
-convert_char_literal (struct type* type, LONGEST val)
+convert_char_literal (struct type *type, LONGEST val)
 {
   char name[7];
   int f;
@@ -960,10 +871,16 @@
   if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM)
     return val;
   sprintf (name, "QU%02x", (int) val);
-  for (f = 0; f < TYPE_NFIELDS (type); f += 1) 
+  for (f = 0; f < TYPE_NFIELDS (type); f += 1)
     {
-      if (DEPRECATED_STREQ (name, TYPE_FIELD_NAME (type, f)))
+      if (strcmp (name, TYPE_FIELD_NAME (type, f)) == 0)
 	return TYPE_FIELD_BITPOS (type, f);
     }
   return val;
 }
+
+void
+_initialize_ada_exp (void)
+{
+  obstack_init (&temp_parse_space);
+}
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index b97321b..2520b8e 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -1,5 +1,5 @@
 /* Ada language support routines for GDB, the GNU debugger.  Copyright
-   1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003, 2004
+   1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003, 2004.
    Free Software Foundation, Inc.
 
 This file is part of GDB.
@@ -18,12 +18,27 @@
 along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+
+/* Sections of code marked 
+
+     #ifdef GNAT_GDB 
+     ...
+     #endif
+
+   indicate sections that are used in sources distributed by 
+   ACT, Inc., but not yet integrated into the public tree (where
+   GNAT_GDB is not defined).  They are retained here nevertheless 
+   to minimize the problems of maintaining different versions 
+   of the source and to make the full source available. */
+
+#include "defs.h"
 #include <stdio.h>
 #include "gdb_string.h"
 #include <ctype.h>
 #include <stdarg.h>
 #include "demangle.h"
-#include "defs.h"
+#include "gdb_regex.h"
+#include "frame.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "gdbcmd.h"
@@ -36,15 +51,51 @@
 #include "objfiles.h"
 #include "breakpoint.h"
 #include "gdbcore.h"
+#include "hashtab.h"
+#include "gdb_obstack.h"
 #include "ada-lang.h"
+#include "completer.h"
+#include "gdb_stat.h"
+#ifdef UI_OUT
 #include "ui-out.h"
+#endif
 #include "block.h"
 #include "infcall.h"
 #include "dictionary.h"
 
-struct cleanup *unresolved_names;
+#ifndef ADA_RETAIN_DOTS
+#define ADA_RETAIN_DOTS 0
+#endif
 
-void extract_string (CORE_ADDR addr, char *buf);
+/* Define whether or not the C operator '/' truncates towards zero for
+   differently signed operands (truncation direction is undefined in C). 
+   Copied from valarith.c.  */
+
+#ifndef TRUNCATION_TOWARDS_ZERO
+#define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2)
+#endif
+
+#ifdef GNAT_GDB
+/* A structure that contains a vector of strings.
+   The main purpose of this type is to group the vector and its
+   associated parameters in one structure.  This makes it easier
+   to handle and pass around.  */
+
+struct string_vector
+{
+  char **array; /* The vector itself.  */
+  int index;    /* Index of the next available element in the array.  */
+  size_t size;  /* The number of entries allocated in the array.  */
+};
+
+static struct string_vector xnew_string_vector (int initial_size);
+static void string_vector_append (struct string_vector *sv, char *str);
+#endif /* GNAT_GDB */
+
+static const char *ada_unqualified_name (const char *decoded_name);
+static char *add_angle_brackets (const char *str);
+static void extract_string (CORE_ADDR addr, char *buf);
+static char *function_name_from_pc (CORE_ADDR pc);
 
 static struct type *ada_create_fundamental_type (struct objfile *, int);
 
@@ -82,38 +133,45 @@
 
 static int ada_args_match (struct symbol *, struct value **, int);
 
-static struct value *place_on_stack (struct value *, CORE_ADDR *);
+static struct value *ensure_lval (struct value *, CORE_ADDR *);
 
 static struct value *convert_actual (struct value *, struct type *,
-				     CORE_ADDR *);
+                                     CORE_ADDR *);
 
 static struct value *make_array_descriptor (struct type *, struct value *,
-					    CORE_ADDR *);
+                                            CORE_ADDR *);
 
-static void ada_add_block_symbols (struct block *, const char *,
-				   domain_enum, struct objfile *, int);
+static void ada_add_block_symbols (struct obstack *,
+                                   struct block *, const char *,
+                                   domain_enum, struct objfile *,
+                                   struct symtab *, int);
 
-static void fill_in_ada_prototype (struct symbol *);
+static int is_nonfunction (struct ada_symbol_info *, int);
 
-static int is_nonfunction (struct symbol **, int);
+static void add_defn_to_vec (struct obstack *, struct symbol *,
+                             struct block *, struct symtab *);
 
-static void add_defn_to_vec (struct symbol *, struct block *);
+static int num_defns_collected (struct obstack *);
+
+static struct ada_symbol_info *defns_collected (struct obstack *, int);
 
 static struct partial_symbol *ada_lookup_partial_symbol (struct partial_symtab
-							 *, const char *, int,
-							 domain_enum, int);
+                                                         *, const char *, int,
+                                                         domain_enum, int);
 
 static struct symtab *symtab_for_sym (struct symbol *);
 
-static struct value *ada_resolve_subexp (struct expression **, int *, int,
-					 struct type *);
+static struct value *resolve_subexp (struct expression **, int *, int,
+                                     struct type *);
 
 static void replace_operator_with_call (struct expression **, int, int, int,
-					struct symbol *, struct block *);
+                                        struct symbol *, struct block *);
 
 static int possible_user_operator_p (enum exp_opcode, struct value **);
 
-static const char *ada_op_name (enum exp_opcode);
+static char *ada_op_name (enum exp_opcode);
+
+static const char *ada_decoded_op_name (enum exp_opcode);
 
 static int numeric_type_p (struct type *);
 
@@ -123,11 +181,14 @@
 
 static int discrete_type_p (struct type *);
 
+static struct type *ada_lookup_struct_elt_type (struct type *, char *,
+                                                int, int, int *);
+
 static char *extended_canonical_line_spec (struct symtab_and_line,
-					   const char *);
+                                           const char *);
 
 static struct value *evaluate_subexp (struct type *, struct expression *,
-				      int *, enum noside);
+                                      int *, enum noside);
 
 static struct value *evaluate_subexp_type (struct expression *, int *);
 
@@ -136,10 +197,12 @@
 static int is_dynamic_field (struct type *, int);
 
 static struct type *to_fixed_variant_branch_type (struct type *, char *,
-						  CORE_ADDR, struct value *);
+                                                  CORE_ADDR, struct value *);
+
+static struct type *to_fixed_array_type (struct type *, struct value *, int);
 
 static struct type *to_fixed_range_type (char *, struct value *,
-					 struct objfile *);
+                                         struct objfile *);
 
 static struct type *to_static_fixed_type (struct type *);
 
@@ -152,10 +215,10 @@
 static struct value *decode_packed_array (struct value *);
 
 static struct value *value_subscript_packed (struct value *, int,
-					     struct value **);
+                                             struct value **);
 
-static struct value *coerce_unspec_val_to_type (struct value *, long,
-						struct type *);
+static struct value *coerce_unspec_val_to_type (struct value *,
+                                                struct type *);
 
 static struct value *get_var_value (char *, char *);
 
@@ -167,71 +230,225 @@
 
 static int wild_match (const char *, int, const char *);
 
-static struct symtabs_and_lines find_sal_from_funcs_and_line (const char *,
-							      int,
-							      struct symbol
-							      **, int);
+static struct symtabs_and_lines
+find_sal_from_funcs_and_line (const char *, int,
+                              struct ada_symbol_info *, int);
 
-static int find_line_in_linetable (struct linetable *, int, struct symbol **,
-				   int, int *);
+static int find_line_in_linetable (struct linetable *, int,
+                                   struct ada_symbol_info *, int, int *);
 
 static int find_next_line_in_linetable (struct linetable *, int, int, int);
 
-static struct symtabs_and_lines all_sals_for_line (const char *, int,
-						   char ***);
-
 static void read_all_symtabs (const char *);
 
 static int is_plausible_func_for_line (struct symbol *, int);
 
 static struct value *ada_coerce_ref (struct value *);
 
+static LONGEST pos_atr (struct value *);
+
 static struct value *value_pos_atr (struct value *);
 
 static struct value *value_val_atr (struct type *, struct value *);
 
-static struct symbol *standard_lookup (const char *, domain_enum);
+static struct symbol *standard_lookup (const char *, const struct block *,
+                                       domain_enum);
 
-extern void markTimeStart (int index);
-extern void markTimeStop (int index);
+static struct value *ada_search_struct_field (char *, struct value *, int,
+                                              struct type *);
+
+static struct value *ada_value_primitive_field (struct value *, int, int,
+                                                struct type *);
+
+static int find_struct_field (char *, struct type *, int,
+                              struct type **, int *, int *, int *);
+
+static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR,
+                                                struct value *);
+
+static struct value *ada_to_fixed_value (struct value *);
+
+static void adjust_pc_past_prologue (CORE_ADDR *);
+
+static int ada_resolve_function (struct ada_symbol_info *, int,
+                                 struct value **, int, const char *,
+                                 struct type *);
+
+static struct value *ada_coerce_to_simple_array (struct value *);
+
+static int ada_is_direct_array_type (struct type *);
+
+static void error_breakpoint_runtime_sym_not_found (const char *err_desc);
+
+static int is_runtime_sym_defined (const char *name, int allow_tramp);
 
 
 
-/* Maximum-sized dynamic type. */
+/* Maximum-sized dynamic type.  */
 static unsigned int varsize_limit;
 
-static const char *ada_completer_word_break_characters =
+/* FIXME: brobecker/2003-09-17: No longer a const because it is
+   returned by a function that does not return a const char *.  */
+static char *ada_completer_word_break_characters =
+#ifdef VMS
+  " \t\n!@#%^&*()+=|~`}{[]\";:?/,-";
+#else
   " \t\n!@#$%^&*()+=|~`}{[]\";:?/,-";
+#endif
 
-/* The name of the symbol to use to get the name of the main subprogram */
-#define ADA_MAIN_PROGRAM_SYMBOL_NAME "__gnat_ada_main_program_name"
+/* The name of the symbol to use to get the name of the main subprogram.  */
+static const char ADA_MAIN_PROGRAM_SYMBOL_NAME[]
+  = "__gnat_ada_main_program_name";
 
-				/* Utilities */
+/* The name of the runtime function called when an exception is raised.  */
+static const char raise_sym_name[] = "__gnat_raise_nodefer_with_msg";
 
-/* extract_string
- *
- * read the string located at ADDR from the inferior and store the
- * result into BUF
- */
-void
+/* The name of the runtime function called when an unhandled exception
+   is raised.  */
+static const char raise_unhandled_sym_name[] = "__gnat_unhandled_exception";
+
+/* The name of the runtime function called when an assert failure is
+   raised.  */
+static const char raise_assert_sym_name[] =
+  "system__assertions__raise_assert_failure";
+
+/* When GDB stops on an unhandled exception, GDB will go up the stack until
+   if finds a frame corresponding to this function, in order to extract the
+   name of the exception that has been raised from one of the parameters.  */
+static const char process_raise_exception_name[] =
+  "ada__exceptions__process_raise_exception";
+
+/* A string that reflects the longest exception expression rewrite,
+   aside from the exception name.  */
+static const char longest_exception_template[] =
+  "'__gnat_raise_nodefer_with_msg' if long_integer(e) = long_integer(&)";
+
+/* Limit on the number of warnings to raise per expression evaluation.  */
+static int warning_limit = 2;
+
+/* Number of warning messages issued; reset to 0 by cleanups after
+   expression evaluation.  */
+static int warnings_issued = 0;
+
+static const char *known_runtime_file_name_patterns[] = {
+  ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS NULL
+};
+
+static const char *known_auxiliary_function_name_patterns[] = {
+  ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS NULL
+};
+
+/* Space for allocating results of ada_lookup_symbol_list.  */
+static struct obstack symbol_list_obstack;
+
+                        /* Utilities */
+
+#ifdef GNAT_GDB
+
+/* Create a new empty string_vector struct with an initial size of
+   INITIAL_SIZE.  */
+
+static struct string_vector
+xnew_string_vector (int initial_size)
+{
+  struct string_vector result;
+
+  result.array = (char **) xmalloc ((initial_size + 1) * sizeof (char *));
+  result.index = 0;
+  result.size = initial_size;
+
+  return result;
+}
+
+/* Add STR at the end of the given string vector SV.  If SV is already
+   full, its size is automatically increased (doubled).  */
+
+static void
+string_vector_append (struct string_vector *sv, char *str)
+{
+  if (sv->index >= sv->size)
+    GROW_VECT (sv->array, sv->size, sv->size * 2);
+
+  sv->array[sv->index] = str;
+  sv->index++;
+}
+
+/* Given DECODED_NAME a string holding a symbol name in its
+   decoded form (ie using the Ada dotted notation), returns
+   its unqualified name.  */
+
+static const char *
+ada_unqualified_name (const char *decoded_name)
+{
+  const char *result = strrchr (decoded_name, '.');
+
+  if (result != NULL)
+    result++;                   /* Skip the dot...  */
+  else
+    result = decoded_name;
+
+  return result;
+}
+
+/* Return a string starting with '<', followed by STR, and '>'.
+   The result is good until the next call.  */
+
+static char *
+add_angle_brackets (const char *str)
+{
+  static char *result = NULL;
+
+  xfree (result);
+  result = (char *) xmalloc ((strlen (str) + 3) * sizeof (char));
+
+  sprintf (result, "<%s>", str);
+  return result;
+}
+
+#endif /* GNAT_GDB */
+
+static char *
+ada_get_gdb_completer_word_break_characters (void)
+{
+  return ada_completer_word_break_characters;
+}
+
+/* Read the string located at ADDR from the inferior and store the
+   result into BUF.  */
+
+static void
 extract_string (CORE_ADDR addr, char *buf)
 {
   int char_index = 0;
 
-  /* Loop, reading one byte at a time, until we reach the '\000' 
-     end-of-string marker */
+  /* Loop, reading one byte at a time, until we reach the '\000'
+     end-of-string marker.  */
   do
     {
       target_read_memory (addr + char_index * sizeof (char),
-			  buf + char_index * sizeof (char), sizeof (char));
+                          buf + char_index * sizeof (char), sizeof (char));
       char_index++;
     }
   while (buf[char_index - 1] != '\000');
 }
 
+/* Return the name of the function owning the instruction located at PC.
+   Return NULL if no such function could be found.  */
+
+static char *
+function_name_from_pc (CORE_ADDR pc)
+{
+  char *func_name;
+
+  if (!find_pc_partial_function (pc, &func_name, NULL, NULL))
+    return NULL;
+
+  return func_name;
+}
+
 /* Assuming *OLD_VECT points to an array of *SIZE objects of size
    ELEMENT_SIZE, grow it to contain at least MIN_SIZE objects,
-   updating *OLD_VECT and *SIZE as necessary. */
+   updating *OLD_VECT and *SIZE as necessary.  */
 
 void
 grow_vect (void **old_vect, size_t * size, size_t min_size, int element_size)
@@ -240,27 +457,51 @@
     {
       *size *= 2;
       if (*size < min_size)
-	*size = min_size;
+        *size = min_size;
       *old_vect = xrealloc (*old_vect, *size * element_size);
     }
 }
 
 /* True (non-zero) iff TARGET matches FIELD_NAME up to any trailing
-   suffix of FIELD_NAME beginning "___" */
+   suffix of FIELD_NAME beginning "___".  */
 
 static int
 field_name_match (const char *field_name, const char *target)
 {
   int len = strlen (target);
   return
-    DEPRECATED_STREQN (field_name, target, len)
-    && (field_name[len] == '\0'
-	|| (DEPRECATED_STREQN (field_name + len, "___", 3)
-	    && !DEPRECATED_STREQ (field_name + strlen (field_name) - 6, "___XVN")));
+    (strncmp (field_name, target, len) == 0
+     && (field_name[len] == '\0'
+         || (strncmp (field_name + len, "___", 3) == 0
+             && strcmp (field_name + strlen (field_name) - 6,
+                        "___XVN") != 0)));
 }
 
 
-/* The length of the prefix of NAME prior to any "___" suffix. */
+/* Assuming TYPE is a TYPE_CODE_STRUCT, find the field whose name matches
+   FIELD_NAME, and return its index.  This function also handles fields
+   whose name have ___ suffixes because the compiler sometimes alters
+   their name by adding such a suffix to represent fields with certain
+   constraints.  If the field could not be found, return a negative
+   number if MAYBE_MISSING is set.  Otherwise raise an error.  */
+
+int
+ada_get_field_index (const struct type *type, const char *field_name,
+                     int maybe_missing)
+{
+  int fieldno;
+  for (fieldno = 0; fieldno < TYPE_NFIELDS (type); fieldno++)
+    if (field_name_match (TYPE_FIELD_NAME (type, fieldno), field_name))
+      return fieldno;
+
+  if (!maybe_missing)
+    error ("Unable to find field %s in struct %s.  Aborting",
+           field_name, TYPE_NAME (type));
+
+  return -1;
+}
+
+/* The length of the prefix of NAME prior to any "___" suffix.  */
 
 int
 ada_name_prefix_len (const char *name)
@@ -271,13 +512,15 @@
     {
       const char *p = strstr (name, "___");
       if (p == NULL)
-	return strlen (name);
+        return strlen (name);
       else
-	return p - name;
+        return p - name;
     }
 }
 
-/* SUFFIX is a suffix of STR. False if STR is null. */
+/* Return non-zero if SUFFIX is a suffix of STR.
+   Return zero if STR is null.  */
+
 static int
 is_suffix (const char *str, const char *suffix)
 {
@@ -286,15 +529,16 @@
     return 0;
   len1 = strlen (str);
   len2 = strlen (suffix);
-  return (len1 >= len2 && DEPRECATED_STREQ (str + len1 - len2, suffix));
+  return (len1 >= len2 && strcmp (str + len1 - len2, suffix) == 0);
 }
 
 /* Create a value of type TYPE whose contents come from VALADDR, if it
- * is non-null, and whose memory address (in the inferior) is
- * ADDRESS. */
+   is non-null, and whose memory address (in the inferior) is
+   ADDRESS.  */
+
 struct value *
 value_from_contents_and_address (struct type *type, char *valaddr,
-				 CORE_ADDR address)
+                                 CORE_ADDR address)
 {
   struct value *v = allocate_value (type);
   if (valaddr == NULL)
@@ -307,31 +551,35 @@
   return v;
 }
 
-/* The contents of value VAL, beginning at offset OFFSET, treated as a
-   value of type TYPE.  The result is an lval in memory if VAL is. */
+/* The contents of value VAL, treated as a value of type TYPE.  The
+   result is an lval in memory if VAL is.  */
 
 static struct value *
-coerce_unspec_val_to_type (struct value *val, long offset, struct type *type)
+coerce_unspec_val_to_type (struct value *val, struct type *type)
 {
   CHECK_TYPEDEF (type);
-  if (VALUE_LVAL (val) == lval_memory)
-    return value_at_lazy (type,
-			  VALUE_ADDRESS (val) + VALUE_OFFSET (val) + offset,
-			  NULL);
+  if (VALUE_TYPE (val) == type)
+    return val;
   else
     {
-      struct value *result = allocate_value (type);
-      VALUE_LVAL (result) = not_lval;
-      if (VALUE_ADDRESS (val) == 0)
-	memcpy (VALUE_CONTENTS_RAW (result), VALUE_CONTENTS (val) + offset,
-		TYPE_LENGTH (type) > TYPE_LENGTH (VALUE_TYPE (val))
-		? TYPE_LENGTH (VALUE_TYPE (val)) : TYPE_LENGTH (type));
+      struct value *result;
+
+      /* Make sure that the object size is not unreasonable before
+         trying to allocate some memory for it.  */
+      if (TYPE_LENGTH (type) > varsize_limit)
+        error ("object size is larger than varsize-limit");
+
+      result = allocate_value (type);
+      VALUE_LVAL (result) = VALUE_LVAL (val);
+      VALUE_BITSIZE (result) = VALUE_BITSIZE (val);
+      VALUE_BITPOS (result) = VALUE_BITPOS (val);
+      VALUE_ADDRESS (result) = VALUE_ADDRESS (val) + VALUE_OFFSET (val);
+      if (VALUE_LAZY (val)
+          || TYPE_LENGTH (type) > TYPE_LENGTH (VALUE_TYPE (val)))
+        VALUE_LAZY (result) = 1;
       else
-	{
-	  VALUE_ADDRESS (result) =
-	    VALUE_ADDRESS (val) + VALUE_OFFSET (val) + offset;
-	  VALUE_LAZY (result) = 1;
-	}
+        memcpy (VALUE_CONTENTS_RAW (result), VALUE_CONTENTS (val),
+                TYPE_LENGTH (type));
       return result;
     }
 }
@@ -354,59 +602,182 @@
     return address + offset;
 }
 
-/* Perform execute_command on the result of concatenating all
-   arguments up to NULL. */
+/* Issue a warning (as for the definition of warning in utils.c, but
+   with exactly one argument rather than ...), unless the limit on the
+   number of warnings has passed during the evaluation of the current
+   expression.  */
 static void
-do_command (const char *arg, ...)
+lim_warning (const char *format, long arg)
 {
-  int len;
-  char *cmd;
-  const char *s;
-  va_list ap;
+  warnings_issued += 1;
+  if (warnings_issued <= warning_limit)
+    warning (format, arg);
+}
 
-  va_start (ap, arg);
-  len = 0;
-  s = arg;
-  cmd = "";
-  for (; s != NULL; s = va_arg (ap, const char *))
+static const char *
+ada_translate_error_message (const char *string)
+{
+  if (strcmp (string, "Invalid cast.") == 0)
+    return "Invalid type conversion.";
+  else
+    return string;
+}
+
+/* Note: would have used MAX_OF_TYPE and MIN_OF_TYPE macros from
+   gdbtypes.h, but some of the necessary definitions in that file
+   seem to have gone missing. */
+
+/* Maximum value of a SIZE-byte signed integer type. */
+static LONGEST
+max_of_size (int size)
+{
+  LONGEST top_bit = (LONGEST) 1 << (size * 8 - 2);
+  return top_bit | (top_bit - 1);
+}
+
+/* Minimum value of a SIZE-byte signed integer type. */
+static LONGEST
+min_of_size (int size)
+{
+  return -max_of_size (size) - 1;
+}
+
+/* Maximum value of a SIZE-byte unsigned integer type. */
+static ULONGEST
+umax_of_size (int size)
+{
+  ULONGEST top_bit = (ULONGEST) 1 << (size * 8 - 1);
+  return top_bit | (top_bit - 1);
+}
+
+/* Maximum value of integral type T, as a signed quantity. */
+static LONGEST
+max_of_type (struct type *t)
+{
+  if (TYPE_UNSIGNED (t))
+    return (LONGEST) umax_of_size (TYPE_LENGTH (t));
+  else
+    return max_of_size (TYPE_LENGTH (t));
+}
+
+/* Minimum value of integral type T, as a signed quantity. */
+static LONGEST
+min_of_type (struct type *t)
+{
+  if (TYPE_UNSIGNED (t)) 
+    return 0;
+  else
+    return min_of_size (TYPE_LENGTH (t));
+}
+
+/* The largest value in the domain of TYPE, a discrete type, as an integer.  */
+static struct value *
+discrete_type_high_bound (struct type *type)
+{
+  switch (TYPE_CODE (type))
     {
-      char *cmd1;
-      len += strlen (s);
-      cmd1 = alloca (len + 1);
-      strcpy (cmd1, cmd);
-      strcat (cmd1, s);
-      cmd = cmd1;
+    case TYPE_CODE_RANGE:
+      return value_from_longest (TYPE_TARGET_TYPE (type),
+                                 TYPE_HIGH_BOUND (type));
+    case TYPE_CODE_ENUM:
+      return
+        value_from_longest (type,
+                            TYPE_FIELD_BITPOS (type,
+                                               TYPE_NFIELDS (type) - 1));
+    case TYPE_CODE_INT:
+      return value_from_longest (type, max_of_type (type));
+    default:
+      error ("Unexpected type in discrete_type_high_bound.");
     }
-  va_end (ap);
-  execute_command (cmd, 0);
+}
+
+/* The largest value in the domain of TYPE, a discrete type, as an integer.  */
+static struct value *
+discrete_type_low_bound (struct type *type)
+{
+  switch (TYPE_CODE (type))
+    {
+    case TYPE_CODE_RANGE:
+      return value_from_longest (TYPE_TARGET_TYPE (type),
+                                 TYPE_LOW_BOUND (type));
+    case TYPE_CODE_ENUM:
+      return value_from_longest (type, TYPE_FIELD_BITPOS (type, 0));
+    case TYPE_CODE_INT:
+      return value_from_longest (type, min_of_type (type));
+    default:
+      error ("Unexpected type in discrete_type_low_bound.");
+    }
+}
+
+/* The identity on non-range types.  For range types, the underlying
+   non-range scalar type.  */
+
+static struct type *
+base_type (struct type *type)
+{
+  while (type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE)
+    {
+      if (type == TYPE_TARGET_TYPE (type) || TYPE_TARGET_TYPE (type) == NULL)
+        return type;
+      type = TYPE_TARGET_TYPE (type);
+    }
+  return type;
 }
 
 
-				/* Language Selection */
+                                /* Language Selection */
 
 /* If the main program is in Ada, return language_ada, otherwise return LANG
    (the main program is in Ada iif the adainit symbol is found).
 
-   MAIN_PST is not used. */
+   MAIN_PST is not used.  */
 
 enum language
 ada_update_initial_language (enum language lang,
-			     struct partial_symtab *main_pst)
+                             struct partial_symtab *main_pst)
 {
   if (lookup_minimal_symbol ("adainit", (const char *) NULL,
-			     (struct objfile *) NULL) != NULL)
-    /*    return language_ada; */
-    /* FIXME: language_ada should be defined in defs.h */
-    return language_unknown;
+                             (struct objfile *) NULL) != NULL)
+    return language_ada;
 
   return lang;
 }
+
+/* If the main procedure is written in Ada, then return its name.
+   The result is good until the next call.  Return NULL if the main
+   procedure doesn't appear to be in Ada.  */
+
+char *
+ada_main_name (void)
+{
+  struct minimal_symbol *msym;
+  CORE_ADDR main_program_name_addr;
+  static char main_program_name[1024];
+  /* For Ada, the name of the main procedure is stored in a specific
+     string constant, generated by the binder.  Look for that symbol,
+     extract its address, and then read that string.  If we didn't find
+     that string, then most probably the main procedure is not written
+     in Ada.  */
+  msym = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL);
+
+  if (msym != NULL)
+    {
+      main_program_name_addr = SYMBOL_VALUE_ADDRESS (msym);
+      if (main_program_name_addr == 0)
+        error ("Invalid address for Ada main program name.");
+
+      extract_string (main_program_name_addr, main_program_name);
+      return main_program_name;
+    }
+
+  /* The main procedure doesn't seem to be in Ada.  */
+  return NULL;
+}
 
+                                /* Symbols */
 
-				/* Symbols */
-
-/* Table of Ada operators and their GNAT-mangled names.  Last entry is pair 
-   of NULLs. */
+/* Table of Ada operators and their GNAT-encoded names.  Last entry is pair
+   of NULLs.  */
 
 const struct ada_opname_map ada_opname_table[] = {
   {"Oadd", "\"+\"", BINOP_ADD},
@@ -433,11 +804,12 @@
   {NULL, NULL}
 };
 
-/* True if STR should be suppressed in info listings. */
+/* Return non-zero if STR should be suppressed in info listings.  */
+
 static int
 is_suppressed_name (const char *str)
 {
-  if (DEPRECATED_STREQN (str, "_ada_", 5))
+  if (strncmp (str, "_ada_", 5) == 0)
     str += 5;
   if (str[0] == '_' || str[0] == '\000')
     return 1;
@@ -446,81 +818,83 @@
       const char *p;
       const char *suffix = strstr (str, "___");
       if (suffix != NULL && suffix[3] != 'X')
-	return 1;
+        return 1;
       if (suffix == NULL)
-	suffix = str + strlen (str);
+        suffix = str + strlen (str);
       for (p = suffix - 1; p != str; p -= 1)
-	if (isupper (*p))
-	  {
-	    int i;
-	    if (p[0] == 'X' && p[-1] != '_')
-	      goto OK;
-	    if (*p != 'O')
-	      return 1;
-	    for (i = 0; ada_opname_table[i].mangled != NULL; i += 1)
-	      if (DEPRECATED_STREQN (ada_opname_table[i].mangled, p,
-			  strlen (ada_opname_table[i].mangled)))
-		goto OK;
-	    return 1;
-	  OK:;
-	  }
+        if (isupper (*p))
+          {
+            int i;
+            if (p[0] == 'X' && p[-1] != '_')
+              goto OK;
+            if (*p != 'O')
+              return 1;
+            for (i = 0; ada_opname_table[i].encoded != NULL; i += 1)
+              if (strncmp (ada_opname_table[i].encoded, p,
+                           strlen (ada_opname_table[i].encoded)) == 0)
+                goto OK;
+            return 1;
+          OK:;
+          }
       return 0;
     }
 }
 
-/* The "mangled" form of DEMANGLED, according to GNAT conventions.
- * The result is valid until the next call to ada_mangle. */
+/* The "encoded" form of DECODED, according to GNAT conventions.
+   The result is valid until the next call to ada_encode.  */
+
 char *
-ada_mangle (const char *demangled)
+ada_encode (const char *decoded)
 {
-  static char *mangling_buffer = NULL;
-  static size_t mangling_buffer_size = 0;
+  static char *encoding_buffer = NULL;
+  static size_t encoding_buffer_size = 0;
   const char *p;
   int k;
 
-  if (demangled == NULL)
+  if (decoded == NULL)
     return NULL;
 
-  GROW_VECT (mangling_buffer, mangling_buffer_size,
-	     2 * strlen (demangled) + 10);
+  GROW_VECT (encoding_buffer, encoding_buffer_size,
+             2 * strlen (decoded) + 10);
 
   k = 0;
-  for (p = demangled; *p != '\0'; p += 1)
+  for (p = decoded; *p != '\0'; p += 1)
     {
-      if (*p == '.')
-	{
-	  mangling_buffer[k] = mangling_buffer[k + 1] = '_';
-	  k += 2;
-	}
+      if (!ADA_RETAIN_DOTS && *p == '.')
+        {
+          encoding_buffer[k] = encoding_buffer[k + 1] = '_';
+          k += 2;
+        }
       else if (*p == '"')
-	{
-	  const struct ada_opname_map *mapping;
+        {
+          const struct ada_opname_map *mapping;
 
-	  for (mapping = ada_opname_table;
-	       mapping->mangled != NULL &&
-	       !DEPRECATED_STREQN (mapping->demangled, p, strlen (mapping->demangled));
-	       p += 1)
-	    ;
-	  if (mapping->mangled == NULL)
-	    error ("invalid Ada operator name: %s", p);
-	  strcpy (mangling_buffer + k, mapping->mangled);
-	  k += strlen (mapping->mangled);
-	  break;
-	}
+          for (mapping = ada_opname_table;
+               mapping->encoded != NULL
+               && strncmp (mapping->decoded, p,
+                           strlen (mapping->decoded)) != 0; mapping += 1)
+            ;
+          if (mapping->encoded == NULL)
+            error ("invalid Ada operator name: %s", p);
+          strcpy (encoding_buffer + k, mapping->encoded);
+          k += strlen (mapping->encoded);
+          break;
+        }
       else
-	{
-	  mangling_buffer[k] = *p;
-	  k += 1;
-	}
+        {
+          encoding_buffer[k] = *p;
+          k += 1;
+        }
     }
 
-  mangling_buffer[k] = '\0';
-  return mangling_buffer;
+  encoding_buffer[k] = '\0';
+  return encoding_buffer;
 }
 
 /* Return NAME folded to lower case, or, if surrounded by single
- * quotes, unfolded, but with the quotes stripped away.  Result good
- * to next call. */
+   quotes, unfolded, but with the quotes stripped away.  Result good
+   to next call.  */
+
 char *
 ada_fold_name (const char *name)
 {
@@ -539,148 +913,242 @@
     {
       int i;
       for (i = 0; i <= len; i += 1)
-	fold_buffer[i] = tolower (name[i]);
+        fold_buffer[i] = tolower (name[i]);
     }
 
   return fold_buffer;
 }
 
-/* Demangle: 
-     1. Discard final __{DIGIT}+ or ${DIGIT}+
+/* decode:
+     0. Discard trailing .{DIGIT}+ or trailing ___{DIGIT}+
+        These are suffixes introduced by GNAT5 to nested subprogram
+        names, and do not serve any purpose for the debugger.
+     1. Discard final __{DIGIT}+ or $({DIGIT}+(__{DIGIT}+)*)
      2. Convert other instances of embedded "__" to `.'.
      3. Discard leading _ada_.
      4. Convert operator names to the appropriate quoted symbols.
-     5. Remove everything after first ___ if it is followed by 
+     5. Remove everything after first ___ if it is followed by
         'X'.
      6. Replace TK__ with __, and a trailing B or TKB with nothing.
      7. Put symbols that should be suppressed in <...> brackets.
      8. Remove trailing X[bn]* suffix (indicating names in package bodies).
-   The resulting string is valid until the next call of ada_demangle.
-  */
 
-char *
-ada_demangle (const char *mangled)
+   The resulting string is valid until the next call of ada_decode.
+   If the string is unchanged by demangling, the original string pointer
+   is returned.  */
+
+const char *
+ada_decode (const char *encoded)
 {
   int i, j;
   int len0;
   const char *p;
-  char *demangled;
+  char *decoded;
   int at_start_name;
-  static char *demangling_buffer = NULL;
-  static size_t demangling_buffer_size = 0;
+  static char *decoding_buffer = NULL;
+  static size_t decoding_buffer_size = 0;
 
-  if (DEPRECATED_STREQN (mangled, "_ada_", 5))
-    mangled += 5;
+  if (strncmp (encoded, "_ada_", 5) == 0)
+    encoded += 5;
 
-  if (mangled[0] == '_' || mangled[0] == '<')
+  if (encoded[0] == '_' || encoded[0] == '<')
     goto Suppress;
 
-  p = strstr (mangled, "___");
-  if (p == NULL)
-    len0 = strlen (mangled);
-  else
+  /* Remove trailing .{DIGIT}+ or ___{DIGIT}+.  */
+  len0 = strlen (encoded);
+  if (len0 > 1 && isdigit (encoded[len0 - 1]))
+    {
+      i = len0 - 2;
+      while (i > 0 && isdigit (encoded[i]))
+        i--;
+      if (i >= 0 && encoded[i] == '.')
+        len0 = i;
+      else if (i >= 2 && strncmp (encoded + i - 2, "___", 3) == 0)
+        len0 = i - 2;
+    }
+
+  /* Remove the ___X.* suffix if present.  Do not forget to verify that
+     the suffix is located before the current "end" of ENCODED.  We want
+     to avoid re-matching parts of ENCODED that have previously been
+     marked as discarded (by decrementing LEN0).  */
+  p = strstr (encoded, "___");
+  if (p != NULL && p - encoded < len0 - 3)
     {
       if (p[3] == 'X')
-	len0 = p - mangled;
+        len0 = p - encoded;
       else
-	goto Suppress;
+        goto Suppress;
     }
-  if (len0 > 3 && DEPRECATED_STREQ (mangled + len0 - 3, "TKB"))
+
+  if (len0 > 3 && strncmp (encoded + len0 - 3, "TKB", 3) == 0)
     len0 -= 3;
-  if (len0 > 1 && DEPRECATED_STREQ (mangled + len0 - 1, "B"))
+
+  if (len0 > 1 && strncmp (encoded + len0 - 1, "B", 1) == 0)
     len0 -= 1;
 
-  /* Make demangled big enough for possible expansion by operator name. */
-  GROW_VECT (demangling_buffer, demangling_buffer_size, 2 * len0 + 1);
-  demangled = demangling_buffer;
+  /* Make decoded big enough for possible expansion by operator name.  */
+  GROW_VECT (decoding_buffer, decoding_buffer_size, 2 * len0 + 1);
+  decoded = decoding_buffer;
 
-  if (isdigit (mangled[len0 - 1]))
+  if (len0 > 1 && isdigit (encoded[len0 - 1]))
     {
-      for (i = len0 - 2; i >= 0 && isdigit (mangled[i]); i -= 1)
-	;
-      if (i > 1 && mangled[i] == '_' && mangled[i - 1] == '_')
-	len0 = i - 1;
-      else if (mangled[i] == '$')
-	len0 = i;
+      i = len0 - 2;
+      while ((i >= 0 && isdigit (encoded[i]))
+             || (i >= 1 && encoded[i] == '_' && isdigit (encoded[i - 1])))
+        i -= 1;
+      if (i > 1 && encoded[i] == '_' && encoded[i - 1] == '_')
+        len0 = i - 1;
+      else if (encoded[i] == '$')
+        len0 = i;
     }
 
-  for (i = 0, j = 0; i < len0 && !isalpha (mangled[i]); i += 1, j += 1)
-    demangled[j] = mangled[i];
+  for (i = 0, j = 0; i < len0 && !isalpha (encoded[i]); i += 1, j += 1)
+    decoded[j] = encoded[i];
 
   at_start_name = 1;
   while (i < len0)
     {
-      if (at_start_name && mangled[i] == 'O')
-	{
-	  int k;
-	  for (k = 0; ada_opname_table[k].mangled != NULL; k += 1)
-	    {
-	      int op_len = strlen (ada_opname_table[k].mangled);
-	      if (DEPRECATED_STREQN
-		  (ada_opname_table[k].mangled + 1, mangled + i + 1,
-		   op_len - 1) && !isalnum (mangled[i + op_len]))
-		{
-		  strcpy (demangled + j, ada_opname_table[k].demangled);
-		  at_start_name = 0;
-		  i += op_len;
-		  j += strlen (ada_opname_table[k].demangled);
-		  break;
-		}
-	    }
-	  if (ada_opname_table[k].mangled != NULL)
-	    continue;
-	}
+      if (at_start_name && encoded[i] == 'O')
+        {
+          int k;
+          for (k = 0; ada_opname_table[k].encoded != NULL; k += 1)
+            {
+              int op_len = strlen (ada_opname_table[k].encoded);
+              if ((strncmp (ada_opname_table[k].encoded + 1, encoded + i + 1,
+                            op_len - 1) == 0)
+                  && !isalnum (encoded[i + op_len]))
+                {
+                  strcpy (decoded + j, ada_opname_table[k].decoded);
+                  at_start_name = 0;
+                  i += op_len;
+                  j += strlen (ada_opname_table[k].decoded);
+                  break;
+                }
+            }
+          if (ada_opname_table[k].encoded != NULL)
+            continue;
+        }
       at_start_name = 0;
 
-      if (i < len0 - 4 && DEPRECATED_STREQN (mangled + i, "TK__", 4))
-	i += 2;
-      if (mangled[i] == 'X' && i != 0 && isalnum (mangled[i - 1]))
-	{
-	  do
-	    i += 1;
-	  while (i < len0 && (mangled[i] == 'b' || mangled[i] == 'n'));
-	  if (i < len0)
-	    goto Suppress;
-	}
-      else if (i < len0 - 2 && mangled[i] == '_' && mangled[i + 1] == '_')
-	{
-	  demangled[j] = '.';
-	  at_start_name = 1;
-	  i += 2;
-	  j += 1;
-	}
+      if (i < len0 - 4 && strncmp (encoded + i, "TK__", 4) == 0)
+        i += 2;
+      if (encoded[i] == 'X' && i != 0 && isalnum (encoded[i - 1]))
+        {
+          do
+            i += 1;
+          while (i < len0 && (encoded[i] == 'b' || encoded[i] == 'n'));
+          if (i < len0)
+            goto Suppress;
+        }
+      else if (!ADA_RETAIN_DOTS
+               && i < len0 - 2 && encoded[i] == '_' && encoded[i + 1] == '_')
+        {
+          decoded[j] = '.';
+          at_start_name = 1;
+          i += 2;
+          j += 1;
+        }
       else
-	{
-	  demangled[j] = mangled[i];
-	  i += 1;
-	  j += 1;
-	}
+        {
+          decoded[j] = encoded[i];
+          i += 1;
+          j += 1;
+        }
     }
-  demangled[j] = '\000';
+  decoded[j] = '\000';
 
-  for (i = 0; demangled[i] != '\0'; i += 1)
-    if (isupper (demangled[i]) || demangled[i] == ' ')
+  for (i = 0; decoded[i] != '\0'; i += 1)
+    if (isupper (decoded[i]) || decoded[i] == ' ')
       goto Suppress;
 
-  return demangled;
+  if (strcmp (decoded, encoded) == 0)
+    return encoded;
+  else
+    return decoded;
 
 Suppress:
-  GROW_VECT (demangling_buffer, demangling_buffer_size, strlen (mangled) + 3);
-  demangled = demangling_buffer;
-  if (mangled[0] == '<')
-    strcpy (demangled, mangled);
+  GROW_VECT (decoding_buffer, decoding_buffer_size, strlen (encoded) + 3);
+  decoded = decoding_buffer;
+  if (encoded[0] == '<')
+    strcpy (decoded, encoded);
   else
-    sprintf (demangled, "<%s>", mangled);
-  return demangled;
+    sprintf (decoded, "<%s>", encoded);
+  return decoded;
 
 }
 
+/* Table for keeping permanent unique copies of decoded names.  Once
+   allocated, names in this table are never released.  While this is a
+   storage leak, it should not be significant unless there are massive
+   changes in the set of decoded names in successive versions of a 
+   symbol table loaded during a single session.  */
+static struct htab *decoded_names_store;
+
+/* Returns the decoded name of GSYMBOL, as for ada_decode, caching it
+   in the language-specific part of GSYMBOL, if it has not been
+   previously computed.  Tries to save the decoded name in the same
+   obstack as GSYMBOL, if possible, and otherwise on the heap (so that,
+   in any case, the decoded symbol has a lifetime at least that of
+   GSYMBOL).  
+   The GSYMBOL parameter is "mutable" in the C++ sense: logically
+   const, but nevertheless modified to a semantically equivalent form
+   when a decoded name is cached in it.
+*/
+
+char *
+ada_decode_symbol (const struct general_symbol_info *gsymbol)
+{
+  char **resultp =
+    (char **) &gsymbol->language_specific.cplus_specific.demangled_name;
+  if (*resultp == NULL)
+    {
+      const char *decoded = ada_decode (gsymbol->name);
+      if (gsymbol->bfd_section != NULL)
+        {
+          bfd *obfd = gsymbol->bfd_section->owner;
+          if (obfd != NULL)
+            {
+              struct objfile *objf;
+              ALL_OBJFILES (objf)
+              {
+                if (obfd == objf->obfd)
+                  {
+                    *resultp = obsavestring (decoded, strlen (decoded),
+                                             &objf->objfile_obstack);
+                    break;
+                  }
+              }
+            }
+        }
+      /* Sometimes, we can't find a corresponding objfile, in which
+         case, we put the result on the heap.  Since we only decode
+         when needed, we hope this usually does not cause a
+         significant memory leak (FIXME).  */
+      if (*resultp == NULL)
+        {
+          char **slot = (char **) htab_find_slot (decoded_names_store,
+                                                  decoded, INSERT);
+          if (*slot == NULL)
+            *slot = xstrdup (decoded);
+          *resultp = *slot;
+        }
+    }
+
+  return *resultp;
+}
+
+char *
+ada_la_decode (const char *encoded, int options)
+{
+  return xstrdup (ada_decode (encoded));
+}
+
 /* Returns non-zero iff SYM_NAME matches NAME, ignoring any trailing
- * suffixes that encode debugging information or leading _ada_ on
- * SYM_NAME (see is_name_suffix commentary for the debugging
- * information that is ignored).  If WILD, then NAME need only match a
- * suffix of SYM_NAME minus the same suffixes. Also returns 0 if
- * either argument is NULL. */
+   suffixes that encode debugging information or leading _ada_ on
+   SYM_NAME (see is_name_suffix commentary for the debugging
+   information that is ignored).  If WILD, then NAME need only match a
+   suffix of SYM_NAME minus the same suffixes.  Also returns 0 if
+   either argument is NULL.  */
 
 int
 ada_match_name (const char *sym_name, const char *name, int wild)
@@ -692,16 +1160,16 @@
   else
     {
       int len_name = strlen (name);
-      return (DEPRECATED_STREQN (sym_name, name, len_name)
-	      && is_name_suffix (sym_name + len_name))
-	|| (DEPRECATED_STREQN (sym_name, "_ada_", 5)
-	    && DEPRECATED_STREQN (sym_name + 5, name, len_name)
-	    && is_name_suffix (sym_name + len_name + 5));
+      return (strncmp (sym_name, name, len_name) == 0
+              && is_name_suffix (sym_name + len_name))
+        || (strncmp (sym_name, "_ada_", 5) == 0
+            && strncmp (sym_name + 5, name, len_name) == 0
+            && is_name_suffix (sym_name + len_name + 5));
     }
 }
 
-/* True (non-zero) iff in Ada mode, the symbol SYM should be
-   suppressed in info listings. */
+/* True (non-zero) iff, in Ada mode, the symbol SYM should be
+   suppressed in info listings.  */
 
 int
 ada_suppress_symbol_printing (struct symbol *sym)
@@ -709,14 +1177,13 @@
   if (SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN)
     return 1;
   else
-    return is_suppressed_name (DEPRECATED_SYMBOL_NAME (sym));
+    return is_suppressed_name (SYMBOL_LINKAGE_NAME (sym));
 }
 
 
-				/* Arrays */
+                                /* Arrays */
 
-/* Names of MAX_ADA_DIMENS bounds in P_BOUNDS fields of 
-   array descriptors.  */
+/* Names of MAX_ADA_DIMENS bounds in P_BOUNDS fields of array descriptors.  */
 
 static char *bound_name[] = {
   "LB0", "UB0", "LB1", "UB1", "LB2", "UB2", "LB3", "UB3",
@@ -725,36 +1192,39 @@
 
 /* Maximum number of array dimensions we are prepared to handle.  */
 
-#define MAX_ADA_DIMENS (sizeof(bound_name) / (2*sizeof(char*)))
+#define MAX_ADA_DIMENS (sizeof(bound_name) / (2*sizeof(char *)))
 
-/* Like modify_field, but allows bitpos > wordlength. */
+/* Like modify_field, but allows bitpos > wordlength.  */
 
 static void
 modify_general_field (char *addr, LONGEST fieldval, int bitpos, int bitsize)
 {
-  modify_field (addr + sizeof (LONGEST) * bitpos / (8 * sizeof (LONGEST)),
-		fieldval, bitpos % (8 * sizeof (LONGEST)), bitsize);
+  modify_field (addr + bitpos / 8, fieldval, bitpos % 8, bitsize);
 }
 
 
-/* The desc_* routines return primitive portions of array descriptors 
-   (fat pointers). */
+/* The desc_* routines return primitive portions of array descriptors
+   (fat pointers).  */
 
 /* The descriptor or array type, if any, indicated by TYPE; removes
-   level of indirection, if needed. */
+   level of indirection, if needed.  */
+
 static struct type *
 desc_base_type (struct type *type)
 {
   if (type == NULL)
     return NULL;
   CHECK_TYPEDEF (type);
-  if (type != NULL && TYPE_CODE (type) == TYPE_CODE_PTR)
+  if (type != NULL
+      && (TYPE_CODE (type) == TYPE_CODE_PTR
+          || TYPE_CODE (type) == TYPE_CODE_REF))
     return check_typedef (TYPE_TARGET_TYPE (type));
   else
     return type;
 }
 
-/* True iff TYPE indicates a "thin" array pointer type. */
+/* True iff TYPE indicates a "thin" array pointer type.  */
+
 static int
 is_thin_pntr (struct type *type)
 {
@@ -763,7 +1233,8 @@
     || is_suffix (ada_type_name (desc_base_type (type)), "___XUT___XVE");
 }
 
-/* The descriptor type for thin pointer type TYPE. */
+/* The descriptor type for thin pointer type TYPE.  */
+
 static struct type *
 thin_descriptor_type (struct type *type)
 {
@@ -776,36 +1247,39 @@
     {
       struct type *alt_type = ada_find_parallel_type (base_type, "___XVE");
       if (alt_type == NULL)
-	return base_type;
+        return base_type;
       else
-	return alt_type;
+        return alt_type;
     }
 }
 
-/* A pointer to the array data for thin-pointer value VAL. */
+/* A pointer to the array data for thin-pointer value VAL.  */
+
 static struct value *
 thin_data_pntr (struct value *val)
 {
   struct type *type = VALUE_TYPE (val);
   if (TYPE_CODE (type) == TYPE_CODE_PTR)
     return value_cast (desc_data_type (thin_descriptor_type (type)),
-		       value_copy (val));
+                       value_copy (val));
   else
     return value_from_longest (desc_data_type (thin_descriptor_type (type)),
-			       VALUE_ADDRESS (val) + VALUE_OFFSET (val));
+                               VALUE_ADDRESS (val) + VALUE_OFFSET (val));
 }
 
-/* True iff TYPE indicates a "thick" array pointer type. */
+/* True iff TYPE indicates a "thick" array pointer type.  */
+
 static int
 is_thick_pntr (struct type *type)
 {
   type = desc_base_type (type);
   return (type != NULL && TYPE_CODE (type) == TYPE_CODE_STRUCT
-	  && lookup_struct_elt_type (type, "P_BOUNDS", 1) != NULL);
+          && lookup_struct_elt_type (type, "P_BOUNDS", 1) != NULL);
 }
 
-/* If TYPE is the type of an array descriptor (fat or thin pointer) or a 
-   pointer to one, the type of its bounds data; otherwise, NULL. */
+/* If TYPE is the type of an array descriptor (fat or thin pointer) or a
+   pointer to one, the type of its bounds data; otherwise, NULL.  */
+
 static struct type *
 desc_bounds_type (struct type *type)
 {
@@ -819,22 +1293,23 @@
     {
       type = thin_descriptor_type (type);
       if (type == NULL)
-	return NULL;
+        return NULL;
       r = lookup_struct_elt_type (type, "BOUNDS", 1);
       if (r != NULL)
-	return check_typedef (r);
+        return check_typedef (r);
     }
   else if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
     {
       r = lookup_struct_elt_type (type, "P_BOUNDS", 1);
       if (r != NULL)
-	return check_typedef (TYPE_TARGET_TYPE (check_typedef (r)));
+        return check_typedef (TYPE_TARGET_TYPE (check_typedef (r)));
     }
   return NULL;
 }
 
 /* If ARR is an array descriptor (fat or thin pointer), or pointer to
-   one, a pointer to its bounds data.   Otherwise NULL. */
+   one, a pointer to its bounds data.   Otherwise NULL.  */
+
 static struct value *
 desc_bounds (struct value *arr)
 {
@@ -842,34 +1317,35 @@
   if (is_thin_pntr (type))
     {
       struct type *bounds_type =
-	desc_bounds_type (thin_descriptor_type (type));
+        desc_bounds_type (thin_descriptor_type (type));
       LONGEST addr;
 
       if (desc_bounds_type == NULL)
-	error ("Bad GNAT array descriptor");
+        error ("Bad GNAT array descriptor");
 
       /* NOTE: The following calculation is not really kosher, but
          since desc_type is an XVE-encoded type (and shouldn't be),
-         the correct calculation is a real pain. FIXME (and fix GCC). */
+         the correct calculation is a real pain.  FIXME (and fix GCC).  */
       if (TYPE_CODE (type) == TYPE_CODE_PTR)
-	addr = value_as_long (arr);
+        addr = value_as_long (arr);
       else
-	addr = VALUE_ADDRESS (arr) + VALUE_OFFSET (arr);
+        addr = VALUE_ADDRESS (arr) + VALUE_OFFSET (arr);
 
       return
-	value_from_longest (lookup_pointer_type (bounds_type),
-			    addr - TYPE_LENGTH (bounds_type));
+        value_from_longest (lookup_pointer_type (bounds_type),
+                            addr - TYPE_LENGTH (bounds_type));
     }
 
   else if (is_thick_pntr (type))
     return value_struct_elt (&arr, NULL, "P_BOUNDS", NULL,
-			     "Bad GNAT array descriptor");
+                             "Bad GNAT array descriptor");
   else
     return NULL;
 }
 
-/* If TYPE is the type of an array-descriptor (fat pointer), the bit
-   position of the field containing the address of the bounds data. */
+/* If TYPE is the type of an array-descriptor (fat pointer),  the bit
+   position of the field containing the address of the bounds data.  */
+
 static int
 fat_pntr_bounds_bitpos (struct type *type)
 {
@@ -877,7 +1353,8 @@
 }
 
 /* If TYPE is the type of an array-descriptor (fat pointer), the bit
-   size of the field containing the address of the bounds data. */
+   size of the field containing the address of the bounds data.  */
+
 static int
 fat_pntr_bounds_bitsize (struct type *type)
 {
@@ -889,16 +1366,17 @@
     return 8 * TYPE_LENGTH (check_typedef (TYPE_FIELD_TYPE (type, 1)));
 }
 
-/* If TYPE is the type of an array descriptor (fat or thin pointer) or a 
+/* If TYPE is the type of an array descriptor (fat or thin pointer) or a
    pointer to one, the type of its array data (a
-   pointer-to-array-with-no-bounds type); otherwise,  NULL.  Use
-   ada_type_of_array to get an array type with bounds data. */
+   pointer-to-array-with-no-bounds type); otherwise, NULL.  Use
+   ada_type_of_array to get an array type with bounds data.  */
+
 static struct type *
 desc_data_type (struct type *type)
 {
   type = desc_base_type (type);
 
-  /* NOTE: The following is bogus; see comment in desc_bounds. */
+  /* NOTE: The following is bogus; see comment in desc_bounds.  */
   if (is_thin_pntr (type))
     return lookup_pointer_type
       (desc_base_type (TYPE_FIELD_TYPE (thin_descriptor_type (type), 1)));
@@ -910,6 +1388,7 @@
 
 /* If ARR is an array descriptor (fat or thin pointer), a pointer to
    its array data.  */
+
 static struct value *
 desc_data (struct value *arr)
 {
@@ -918,14 +1397,15 @@
     return thin_data_pntr (arr);
   else if (is_thick_pntr (type))
     return value_struct_elt (&arr, NULL, "P_ARRAY", NULL,
-			     "Bad GNAT array descriptor");
+                             "Bad GNAT array descriptor");
   else
     return NULL;
 }
 
 
 /* If TYPE is the type of an array-descriptor (fat pointer), the bit
-   position of the field containing the address of the data. */
+   position of the field containing the address of the data.  */
+
 static int
 fat_pntr_data_bitpos (struct type *type)
 {
@@ -933,7 +1413,8 @@
 }
 
 /* If TYPE is the type of an array-descriptor (fat pointer), the bit
-   size of the field containing the address of the data. */
+   size of the field containing the address of the data.  */
+
 static int
 fat_pntr_data_bitsize (struct type *type)
 {
@@ -945,19 +1426,21 @@
     return TARGET_CHAR_BIT * TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0));
 }
 
-/* If BOUNDS is an array-bounds structure (or pointer to one), return 
+/* If BOUNDS is an array-bounds structure (or pointer to one), return
    the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
-   bound, if WHICH is 1.  The first bound is I=1. */
+   bound, if WHICH is 1.  The first bound is I=1.  */
+
 static struct value *
 desc_one_bound (struct value *bounds, int i, int which)
 {
   return value_struct_elt (&bounds, NULL, bound_name[2 * i + which - 2], NULL,
-			   "Bad GNAT array descriptor bounds");
+                           "Bad GNAT array descriptor bounds");
 }
 
 /* If BOUNDS is an array-bounds structure type, return the bit position
    of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
-   bound, if WHICH is 1.  The first bound is I=1. */
+   bound, if WHICH is 1.  The first bound is I=1.  */
+
 static int
 desc_bound_bitpos (struct type *type, int i, int which)
 {
@@ -966,7 +1449,8 @@
 
 /* If BOUNDS is an array-bounds structure type, return the bit field size
    of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper
-   bound, if WHICH is 1.  The first bound is I=1. */
+   bound, if WHICH is 1.  The first bound is I=1.  */
+
 static int
 desc_bound_bitsize (struct type *type, int i, int which)
 {
@@ -979,7 +1463,8 @@
 }
 
 /* If TYPE is the type of an array-bounds structure, the type of its
-   Ith bound (numbering from 1). Otherwise, NULL. */
+   Ith bound (numbering from 1).  Otherwise, NULL.  */
+
 static struct type *
 desc_index_type (struct type *type, int i)
 {
@@ -991,8 +1476,9 @@
     return NULL;
 }
 
-/* The number of index positions in the array-bounds type TYPE.  0
-   if TYPE is NULL. */
+/* The number of index positions in the array-bounds type TYPE.
+   Return 0 if TYPE is NULL.  */
+
 static int
 desc_arity (struct type *type)
 {
@@ -1003,22 +1489,37 @@
   return 0;
 }
 
+/* Non-zero iff TYPE is a simple array type (not a pointer to one) or 
+   an array descriptor type (representing an unconstrained array
+   type).  */
 
-/* Non-zero iff type is a simple array type (or pointer to one). */
-int
-ada_is_simple_array (struct type *type)
+static int
+ada_is_direct_array_type (struct type *type)
 {
   if (type == NULL)
     return 0;
   CHECK_TYPEDEF (type);
   return (TYPE_CODE (type) == TYPE_CODE_ARRAY
-	  || (TYPE_CODE (type) == TYPE_CODE_PTR
-	      && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY));
+          || ada_is_array_descriptor_type (type));
 }
 
-/* Non-zero iff type belongs to a GNAT array descriptor. */
+/* Non-zero iff TYPE is a simple array type or pointer to one.  */
+
 int
-ada_is_array_descriptor (struct type *type)
+ada_is_simple_array_type (struct type *type)
+{
+  if (type == NULL)
+    return 0;
+  CHECK_TYPEDEF (type);
+  return (TYPE_CODE (type) == TYPE_CODE_ARRAY
+          || (TYPE_CODE (type) == TYPE_CODE_PTR
+              && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY));
+}
+
+/* Non-zero iff TYPE belongs to a GNAT array descriptor.  */
+
+int
+ada_is_array_descriptor_type (struct type *type)
 {
   struct type *data_type = desc_data_type (type);
 
@@ -1028,17 +1529,17 @@
   return
     data_type != NULL
     && ((TYPE_CODE (data_type) == TYPE_CODE_PTR
-	 && TYPE_TARGET_TYPE (data_type) != NULL
-	 && TYPE_CODE (TYPE_TARGET_TYPE (data_type)) == TYPE_CODE_ARRAY)
-	||
-	TYPE_CODE (data_type) == TYPE_CODE_ARRAY)
+         && TYPE_TARGET_TYPE (data_type) != NULL
+         && TYPE_CODE (TYPE_TARGET_TYPE (data_type)) == TYPE_CODE_ARRAY)
+        || TYPE_CODE (data_type) == TYPE_CODE_ARRAY)
     && desc_arity (desc_bounds_type (type)) > 0;
 }
 
 /* Non-zero iff type is a partially mal-formed GNAT array
-   descriptor.  (FIXME: This is to compensate for some problems with 
+   descriptor.  FIXME: This is to compensate for some problems with
    debugging output from GNAT.  Re-examine periodically to see if it
-   is still needed. */
+   is still needed.  */
+
 int
 ada_is_bogus_array_descriptor (struct type *type)
 {
@@ -1046,17 +1547,17 @@
     type != NULL
     && TYPE_CODE (type) == TYPE_CODE_STRUCT
     && (lookup_struct_elt_type (type, "P_BOUNDS", 1) != NULL
-	|| lookup_struct_elt_type (type, "P_ARRAY", 1) != NULL)
-    && !ada_is_array_descriptor (type);
+        || lookup_struct_elt_type (type, "P_ARRAY", 1) != NULL)
+    && !ada_is_array_descriptor_type (type);
 }
 
 
-/* If ARR has a record type in the form of a standard GNAT array descriptor, 
+/* If ARR has a record type in the form of a standard GNAT array descriptor,
    (fat pointer) returns the type of the array data described---specifically,
-   a pointer-to-array type.  If BOUNDS is non-zero, the bounds data are filled 
+   a pointer-to-array type.  If BOUNDS is non-zero, the bounds data are filled
    in from the descriptor; otherwise, they are left unspecified.  If
-   the ARR denotes a null array descriptor and BOUNDS is non-zero, 
-   returns NULL.  The result is simply the type of ARR if ARR is not 
+   the ARR denotes a null array descriptor and BOUNDS is non-zero,
+   returns NULL.  The result is simply the type of ARR if ARR is not
    a descriptor.  */
 struct type *
 ada_type_of_array (struct value *arr, int bounds)
@@ -1064,7 +1565,7 @@
   if (ada_is_packed_array_type (VALUE_TYPE (arr)))
     return decode_packed_array_type (VALUE_TYPE (arr));
 
-  if (!ada_is_array_descriptor (VALUE_TYPE (arr)))
+  if (!ada_is_array_descriptor_type (VALUE_TYPE (arr)))
     return VALUE_TYPE (arr);
 
   if (!bounds)
@@ -1081,41 +1582,42 @@
       arity = ada_array_arity (VALUE_TYPE (arr));
 
       if (elt_type == NULL || arity == 0)
-	return check_typedef (VALUE_TYPE (arr));
+        return check_typedef (VALUE_TYPE (arr));
 
       descriptor = desc_bounds (arr);
       if (value_as_long (descriptor) == 0)
-	return NULL;
+        return NULL;
       while (arity > 0)
-	{
-	  struct type *range_type = alloc_type (objf);
-	  struct type *array_type = alloc_type (objf);
-	  struct value *low = desc_one_bound (descriptor, arity, 0);
-	  struct value *high = desc_one_bound (descriptor, arity, 1);
-	  arity -= 1;
+        {
+          struct type *range_type = alloc_type (objf);
+          struct type *array_type = alloc_type (objf);
+          struct value *low = desc_one_bound (descriptor, arity, 0);
+          struct value *high = desc_one_bound (descriptor, arity, 1);
+          arity -= 1;
 
-	  create_range_type (range_type, VALUE_TYPE (low),
-			     (int) value_as_long (low),
-			     (int) value_as_long (high));
-	  elt_type = create_array_type (array_type, elt_type, range_type);
-	}
+          create_range_type (range_type, VALUE_TYPE (low),
+                             (int) value_as_long (low),
+                             (int) value_as_long (high));
+          elt_type = create_array_type (array_type, elt_type, range_type);
+        }
 
       return lookup_pointer_type (elt_type);
     }
 }
 
 /* If ARR does not represent an array, returns ARR unchanged.
-   Otherwise, returns either a standard GDB array with bounds set 
-   appropriately or, if ARR is a non-null fat pointer, a pointer to a standard 
-   GDB array.  Returns NULL if ARR is a null fat pointer. */
+   Otherwise, returns either a standard GDB array with bounds set
+   appropriately or, if ARR is a non-null fat pointer, a pointer to a standard
+   GDB array.  Returns NULL if ARR is a null fat pointer.  */
+
 struct value *
 ada_coerce_to_simple_array_ptr (struct value *arr)
 {
-  if (ada_is_array_descriptor (VALUE_TYPE (arr)))
+  if (ada_is_array_descriptor_type (VALUE_TYPE (arr)))
     {
       struct type *arrType = ada_type_of_array (arr, 1);
       if (arrType == NULL)
-	return NULL;
+        return NULL;
       return value_cast (arrType, value_copy (desc_data (arr)));
     }
   else if (ada_is_packed_array_type (VALUE_TYPE (arr)))
@@ -1126,15 +1628,16 @@
 
 /* If ARR does not represent an array, returns ARR unchanged.
    Otherwise, returns a standard GDB array describing ARR (which may
-   be ARR itself if it already is in the proper form). */
-struct value *
+   be ARR itself if it already is in the proper form).  */
+
+static struct value *
 ada_coerce_to_simple_array (struct value *arr)
 {
-  if (ada_is_array_descriptor (VALUE_TYPE (arr)))
+  if (ada_is_array_descriptor_type (VALUE_TYPE (arr)))
     {
       struct value *arrVal = ada_coerce_to_simple_array_ptr (arr);
       if (arrVal == NULL)
-	error ("Bounds unavailable for null array pointer.");
+        error ("Bounds unavailable for null array pointer.");
       return value_ind (arrVal);
     }
   else if (ada_is_packed_array_type (VALUE_TYPE (arr)))
@@ -1145,7 +1648,8 @@
 
 /* If TYPE represents a GNAT array type, return it translated to an
    ordinary GDB array type (possibly with BITSIZE fields indicating
-   packing). For other types, is the identity. */
+   packing).  For other types, is the identity.  */
+
 struct type *
 ada_coerce_to_simple_array_type (struct type *type)
 {
@@ -1154,16 +1658,18 @@
   struct type *result;
   VALUE_TYPE (dummy) = type;
   result = ada_type_of_array (dummy, 0);
-  value_free_to_mark (dummy);
+  value_free_to_mark (mark);
   return result;
 }
 
-/* Non-zero iff TYPE represents a standard GNAT packed-array type. */
+/* Non-zero iff TYPE represents a standard GNAT packed-array type.  */
+
 int
 ada_is_packed_array_type (struct type *type)
 {
   if (type == NULL)
     return 0;
+  type = desc_base_type (type);
   CHECK_TYPEDEF (type);
   return
     ada_type_name (type) != NULL
@@ -1176,8 +1682,9 @@
    elements' elements, etc.) is *ELT_BITS, return an identical type,
    but with the bit sizes of its elements (and those of any
    constituent arrays) recorded in the BITSIZE components of its
-   TYPE_FIELD_BITSIZE values, and with *ELT_BITS set to its total size 
-   in bits. */
+   TYPE_FIELD_BITSIZE values, and with *ELT_BITS set to its total size
+   in bits.  */
+
 static struct type *
 packed_array_type (struct type *type, long *elt_bits)
 {
@@ -1191,13 +1698,13 @@
 
   new_type = alloc_type (TYPE_OBJFILE (type));
   new_elt_type = packed_array_type (check_typedef (TYPE_TARGET_TYPE (type)),
-				    elt_bits);
+                                    elt_bits);
   create_array_type (new_type, new_elt_type, TYPE_FIELD_TYPE (type, 0));
   TYPE_FIELD_BITSIZE (new_type, 0) = *elt_bits;
   TYPE_NAME (new_type) = ada_type_name (type);
 
   if (get_discrete_bounds (TYPE_FIELD_TYPE (type, 0),
-			   &low_bound, &high_bound) < 0)
+                           &low_bound, &high_bound) < 0)
     low_bound = high_bound = 0;
   if (high_bound < low_bound)
     *elt_bits = TYPE_LENGTH (new_type) = 0;
@@ -1205,20 +1712,19 @@
     {
       *elt_bits *= (high_bound - low_bound + 1);
       TYPE_LENGTH (new_type) =
-	(*elt_bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
+        (*elt_bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
     }
 
-  /*  TYPE_FLAGS (new_type) |= TYPE_FLAG_FIXED_INSTANCE; */
-  /* FIXME:  TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
+  TYPE_FLAGS (new_type) |= TYPE_FLAG_FIXED_INSTANCE;
   return new_type;
 }
 
-/* The array type encoded by TYPE, where ada_is_packed_array_type (TYPE).
- */
+/* The array type encoded by TYPE, where ada_is_packed_array_type (TYPE).  */
+
 static struct type *
 decode_packed_array_type (struct type *type)
 {
-  struct symbol **syms;
+  struct symbol *sym;
   struct block **blocks;
   const char *raw_name = ada_type_name (check_typedef (type));
   char *name = (char *) alloca (strlen (raw_name) + 1);
@@ -1227,62 +1733,63 @@
   long bits;
   int i, n;
 
+  type = desc_base_type (type);
+
   memcpy (name, raw_name, tail - raw_name);
   name[tail - raw_name] = '\000';
 
-  /* NOTE: Use ada_lookup_symbol_list because of bug in some versions
-   * of gcc (Solaris, e.g.). FIXME when compiler is fixed. */
-  n = ada_lookup_symbol_list (name, get_selected_block (NULL),
-			      VAR_DOMAIN, &syms, &blocks);
-  for (i = 0; i < n; i += 1)
-    if (syms[i] != NULL && SYMBOL_CLASS (syms[i]) == LOC_TYPEDEF
-	&& DEPRECATED_STREQ (name, ada_type_name (SYMBOL_TYPE (syms[i]))))
-      break;
-  if (i >= n)
+  sym = standard_lookup (name, get_selected_block (0), VAR_DOMAIN);
+  if (sym == NULL || SYMBOL_TYPE (sym) == NULL)
     {
-      warning ("could not find bounds information on packed array");
+      lim_warning ("could not find bounds information on packed array", 0);
       return NULL;
     }
-  shadow_type = SYMBOL_TYPE (syms[i]);
+  shadow_type = SYMBOL_TYPE (sym);
 
   if (TYPE_CODE (shadow_type) != TYPE_CODE_ARRAY)
     {
-      warning ("could not understand bounds information on packed array");
+      lim_warning ("could not understand bounds information on packed array",
+                   0);
       return NULL;
     }
 
   if (sscanf (tail + sizeof ("___XP") - 1, "%ld", &bits) != 1)
     {
-      warning ("could not understand bit size information on packed array");
+      lim_warning
+        ("could not understand bit size information on packed array", 0);
       return NULL;
     }
 
   return packed_array_type (shadow_type, &bits);
 }
 
-/* Given that ARR is a struct value* indicating a GNAT packed array,
+/* Given that ARR is a struct value *indicating a GNAT packed array,
    returns a simple array that denotes that array.  Its type is a
    standard GDB array type except that the BITSIZEs of the array
    target types are set to the number of bits in each element, and the
-   type length is set appropriately. */
+   type length is set appropriately.  */
 
 static struct value *
 decode_packed_array (struct value *arr)
 {
-  struct type *type = decode_packed_array_type (VALUE_TYPE (arr));
+  struct type *type;
 
+  arr = ada_coerce_ref (arr);
+  if (TYPE_CODE (VALUE_TYPE (arr)) == TYPE_CODE_PTR)
+    arr = ada_value_ind (arr);
+
+  type = decode_packed_array_type (VALUE_TYPE (arr));
   if (type == NULL)
     {
       error ("can't unpack array");
       return NULL;
     }
-  else
-    return coerce_unspec_val_to_type (arr, 0, type);
+  return coerce_unspec_val_to_type (arr, type);
 }
 
 
 /* The value of the element of packed array ARR at the ARITY indices
-   given in IND.   ARR must be a simple array. */
+   given in IND.   ARR must be a simple array.  */
 
 static struct value *
 value_subscript_packed (struct value *arr, int arity, struct value **ind)
@@ -1299,34 +1806,34 @@
   for (i = 0; i < arity; i += 1)
     {
       if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY
-	  || TYPE_FIELD_BITSIZE (elt_type, 0) == 0)
-	error
-	  ("attempt to do packed indexing of something other than a packed array");
+          || TYPE_FIELD_BITSIZE (elt_type, 0) == 0)
+        error
+          ("attempt to do packed indexing of something other than a packed array");
       else
-	{
-	  struct type *range_type = TYPE_INDEX_TYPE (elt_type);
-	  LONGEST lowerbound, upperbound;
-	  LONGEST idx;
+        {
+          struct type *range_type = TYPE_INDEX_TYPE (elt_type);
+          LONGEST lowerbound, upperbound;
+          LONGEST idx;
 
-	  if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
-	    {
-	      warning ("don't know bounds of array");
-	      lowerbound = upperbound = 0;
-	    }
+          if (get_discrete_bounds (range_type, &lowerbound, &upperbound) < 0)
+            {
+              lim_warning ("don't know bounds of array", 0);
+              lowerbound = upperbound = 0;
+            }
 
-	  idx = value_as_long (value_pos_atr (ind[i]));
-	  if (idx < lowerbound || idx > upperbound)
-	    warning ("packed array index %ld out of bounds", (long) idx);
-	  bits = TYPE_FIELD_BITSIZE (elt_type, 0);
-	  elt_total_bit_offset += (idx - lowerbound) * bits;
-	  elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type));
-	}
+          idx = value_as_long (value_pos_atr (ind[i]));
+          if (idx < lowerbound || idx > upperbound)
+            lim_warning ("packed array index %ld out of bounds", (long) idx);
+          bits = TYPE_FIELD_BITSIZE (elt_type, 0);
+          elt_total_bit_offset += (idx - lowerbound) * bits;
+          elt_type = check_typedef (TYPE_TARGET_TYPE (elt_type));
+        }
     }
   elt_off = elt_total_bit_offset / HOST_CHAR_BIT;
   bit_off = elt_total_bit_offset % HOST_CHAR_BIT;
 
   v = ada_value_primitive_packed_val (arr, NULL, elt_off, bit_off,
-				      bits, elt_type);
+                                      bits, elt_type);
   if (VALUE_LVAL (arr) == lval_internalvar)
     VALUE_LVAL (v) = lval_internalvar_component;
   else
@@ -1334,7 +1841,7 @@
   return v;
 }
 
-/* Non-zero iff TYPE includes negative integer values. */
+/* Non-zero iff TYPE includes negative integer values.  */
 
 static int
 has_negatives (struct type *type)
@@ -1354,32 +1861,32 @@
 /* Create a new value of type TYPE from the contents of OBJ starting
    at byte OFFSET, and bit offset BIT_OFFSET within that byte,
    proceeding for BIT_SIZE bits.  If OBJ is an lval in memory, then
-   assigning through the result will set the field fetched from. OBJ
-   may also be NULL, in which case, VALADDR+OFFSET must address the
-   start of storage containing the packed value.  The value returned 
-   in this case is never an lval.   
-   Assumes 0 <= BIT_OFFSET < HOST_CHAR_BIT. */
+   assigning through the result will set the field fetched from.  
+   VALADDR is ignored unless OBJ is NULL, in which case,
+   VALADDR+OFFSET must address the start of storage containing the 
+   packed value.  The value returned  in this case is never an lval.
+   Assumes 0 <= BIT_OFFSET < HOST_CHAR_BIT.  */
 
 struct value *
 ada_value_primitive_packed_val (struct value *obj, char *valaddr, long offset,
-				int bit_offset, int bit_size,
-				struct type *type)
+                                int bit_offset, int bit_size,
+                                struct type *type)
 {
   struct value *v;
-  int src,			/* Index into the source area. */
-    targ,			/* Index into the target area. */
-    i, srcBitsLeft,		/* Number of source bits left to move. */
-    nsrc, ntarg,		/* Number of source and target bytes. */
-    unusedLS,			/* Number of bits in next significant
-				 * byte of source that are unused. */
-    accumSize;			/* Number of meaningful bits in accum */
-  unsigned char *bytes;		/* First byte containing data to unpack. */
+  int src,                      /* Index into the source area */
+    targ,                       /* Index into the target area */
+    srcBitsLeft,                /* Number of source bits left to move */
+    nsrc, ntarg,                /* Number of source and target bytes */
+    unusedLS,                   /* Number of bits in next significant
+                                   byte of source that are unused */
+    accumSize;                  /* Number of meaningful bits in accum */
+  unsigned char *bytes;         /* First byte containing data to unpack */
   unsigned char *unpacked;
-  unsigned long accum;		/* Staging area for bits being transferred */
+  unsigned long accum;          /* Staging area for bits being transferred */
   unsigned char sign;
   int len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8;
-  /* Transmit bytes from least to most significant; delta is the
-   * direction the indices move. */
+  /* Transmit bytes from least to most significant; delta is the direction
+     the indices move.  */
   int delta = BITS_BIG_ENDIAN ? -1 : 1;
 
   CHECK_TYPEDEF (type);
@@ -1392,7 +1899,7 @@
   else if (VALUE_LAZY (obj))
     {
       v = value_at (type,
-		    VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset, NULL);
+                    VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset, NULL);
       bytes = (unsigned char *) alloca (len);
       read_memory (VALUE_ADDRESS (v), bytes, len);
     }
@@ -1406,15 +1913,15 @@
     {
       VALUE_LVAL (v) = VALUE_LVAL (obj);
       if (VALUE_LVAL (obj) == lval_internalvar)
-	VALUE_LVAL (v) = lval_internalvar_component;
+        VALUE_LVAL (v) = lval_internalvar_component;
       VALUE_ADDRESS (v) = VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset;
       VALUE_BITPOS (v) = bit_offset + VALUE_BITPOS (obj);
       VALUE_BITSIZE (v) = bit_size;
       if (VALUE_BITPOS (v) >= HOST_CHAR_BIT)
-	{
-	  VALUE_ADDRESS (v) += 1;
-	  VALUE_BITPOS (v) -= HOST_CHAR_BIT;
-	}
+        {
+          VALUE_ADDRESS (v) += 1;
+          VALUE_BITPOS (v) -= HOST_CHAR_BIT;
+        }
     }
   else
     VALUE_BITSIZE (v) = bit_size;
@@ -1432,31 +1939,31 @@
   else if (BITS_BIG_ENDIAN)
     {
       src = len - 1;
-      if (has_negatives (type) &&
-	  ((bytes[0] << bit_offset) & (1 << (HOST_CHAR_BIT - 1))))
-	sign = ~0;
+      if (has_negatives (type)
+          && ((bytes[0] << bit_offset) & (1 << (HOST_CHAR_BIT - 1))))
+        sign = ~0;
 
       unusedLS =
-	(HOST_CHAR_BIT - (bit_size + bit_offset) % HOST_CHAR_BIT)
-	% HOST_CHAR_BIT;
+        (HOST_CHAR_BIT - (bit_size + bit_offset) % HOST_CHAR_BIT)
+        % HOST_CHAR_BIT;
 
       switch (TYPE_CODE (type))
-	{
-	case TYPE_CODE_ARRAY:
-	case TYPE_CODE_UNION:
-	case TYPE_CODE_STRUCT:
-	  /* Non-scalar values must be aligned at a byte boundary. */
-	  accumSize =
-	    (HOST_CHAR_BIT - bit_size % HOST_CHAR_BIT) % HOST_CHAR_BIT;
-	  /* And are placed at the beginning (most-significant) bytes
-	   * of the target. */
-	  targ = src;
-	  break;
-	default:
-	  accumSize = 0;
-	  targ = TYPE_LENGTH (type) - 1;
-	  break;
-	}
+        {
+        case TYPE_CODE_ARRAY:
+        case TYPE_CODE_UNION:
+        case TYPE_CODE_STRUCT:
+          /* Non-scalar values must be aligned at a byte boundary...  */
+          accumSize =
+            (HOST_CHAR_BIT - bit_size % HOST_CHAR_BIT) % HOST_CHAR_BIT;
+          /* ... And are placed at the beginning (most-significant) bytes
+             of the target.  */
+          targ = src;
+          break;
+        default:
+          accumSize = 0;
+          targ = TYPE_LENGTH (type) - 1;
+          break;
+        }
     }
   else
     {
@@ -1467,30 +1974,30 @@
       accumSize = 0;
 
       if (has_negatives (type) && (bytes[len - 1] & (1 << sign_bit_offset)))
-	sign = ~0;
+        sign = ~0;
     }
 
   accum = 0;
   while (nsrc > 0)
     {
       /* Mask for removing bits of the next source byte that are not
-       * part of the value. */
+         part of the value.  */
       unsigned int unusedMSMask =
-	(1 << (srcBitsLeft >= HOST_CHAR_BIT ? HOST_CHAR_BIT : srcBitsLeft)) -
-	1;
-      /* Sign-extend bits for this byte. */
+        (1 << (srcBitsLeft >= HOST_CHAR_BIT ? HOST_CHAR_BIT : srcBitsLeft)) -
+        1;
+      /* Sign-extend bits for this byte.  */
       unsigned int signMask = sign & ~unusedMSMask;
       accum |=
-	(((bytes[src] >> unusedLS) & unusedMSMask) | signMask) << accumSize;
+        (((bytes[src] >> unusedLS) & unusedMSMask) | signMask) << accumSize;
       accumSize += HOST_CHAR_BIT - unusedLS;
       if (accumSize >= HOST_CHAR_BIT)
-	{
-	  unpacked[targ] = accum & ~(~0L << HOST_CHAR_BIT);
-	  accumSize -= HOST_CHAR_BIT;
-	  accum >>= HOST_CHAR_BIT;
-	  ntarg -= 1;
-	  targ += delta;
-	}
+        {
+          unpacked[targ] = accum & ~(~0L << HOST_CHAR_BIT);
+          accumSize -= HOST_CHAR_BIT;
+          accum >>= HOST_CHAR_BIT;
+          ntarg -= 1;
+          targ += delta;
+        }
       srcBitsLeft -= HOST_CHAR_BIT - unusedLS;
       unusedLS = 0;
       nsrc -= 1;
@@ -1511,7 +2018,7 @@
 
 /* Move N bits from SOURCE, starting at bit offset SRC_OFFSET to
    TARGET, starting at bit offset TARG_OFFSET.  SOURCE and TARGET must
-   not overlap. */
+   not overlap.  */
 static void
 move_bits (char *target, int targ_offset, char *source, int src_offset, int n)
 {
@@ -1529,24 +2036,24 @@
       accum_bits = HOST_CHAR_BIT - src_offset;
 
       while (n > 0)
-	{
-	  int unused_right;
-	  accum = (accum << HOST_CHAR_BIT) + (unsigned char) *source;
-	  accum_bits += HOST_CHAR_BIT;
-	  source += 1;
-	  chunk_size = HOST_CHAR_BIT - targ_offset;
-	  if (chunk_size > n)
-	    chunk_size = n;
-	  unused_right = HOST_CHAR_BIT - (chunk_size + targ_offset);
-	  mask = ((1 << chunk_size) - 1) << unused_right;
-	  *target =
-	    (*target & ~mask)
-	    | ((accum >> (accum_bits - chunk_size - unused_right)) & mask);
-	  n -= chunk_size;
-	  accum_bits -= chunk_size;
-	  target += 1;
-	  targ_offset = 0;
-	}
+        {
+          int unused_right;
+          accum = (accum << HOST_CHAR_BIT) + (unsigned char) *source;
+          accum_bits += HOST_CHAR_BIT;
+          source += 1;
+          chunk_size = HOST_CHAR_BIT - targ_offset;
+          if (chunk_size > n)
+            chunk_size = n;
+          unused_right = HOST_CHAR_BIT - (chunk_size + targ_offset);
+          mask = ((1 << chunk_size) - 1) << unused_right;
+          *target =
+            (*target & ~mask)
+            | ((accum >> (accum_bits - chunk_size - unused_right)) & mask);
+          n -= chunk_size;
+          accum_bits -= chunk_size;
+          target += 1;
+          targ_offset = 0;
+        }
     }
   else
     {
@@ -1555,21 +2062,21 @@
       accum_bits = HOST_CHAR_BIT - src_offset;
 
       while (n > 0)
-	{
-	  accum = accum + ((unsigned char) *source << accum_bits);
-	  accum_bits += HOST_CHAR_BIT;
-	  source += 1;
-	  chunk_size = HOST_CHAR_BIT - targ_offset;
-	  if (chunk_size > n)
-	    chunk_size = n;
-	  mask = ((1 << chunk_size) - 1) << targ_offset;
-	  *target = (*target & ~mask) | ((accum << targ_offset) & mask);
-	  n -= chunk_size;
-	  accum_bits -= chunk_size;
-	  accum >>= chunk_size;
-	  target += 1;
-	  targ_offset = 0;
-	}
+        {
+          accum = accum + ((unsigned char) *source << accum_bits);
+          accum_bits += HOST_CHAR_BIT;
+          source += 1;
+          chunk_size = HOST_CHAR_BIT - targ_offset;
+          if (chunk_size > n)
+            chunk_size = n;
+          mask = ((1 << chunk_size) - 1) << targ_offset;
+          *target = (*target & ~mask) | ((accum << targ_offset) & mask);
+          n -= chunk_size;
+          accum_bits -= chunk_size;
+          accum >>= chunk_size;
+          target += 1;
+          targ_offset = 0;
+        }
     }
 }
 
@@ -1577,7 +2084,7 @@
 /* Store the contents of FROMVAL into the location of TOVAL.
    Return a new value with the location of TOVAL and contents of
    FROMVAL.   Handles assignment into packed fields that have
-   floating-point or non-scalar types. */
+   floating-point or non-scalar types.  */
 
 static struct value *
 ada_value_assign (struct value *toval, struct value *fromval)
@@ -1593,31 +2100,31 @@
   if (VALUE_LVAL (toval) == lval_memory
       && bits > 0
       && (TYPE_CODE (type) == TYPE_CODE_FLT
-	  || TYPE_CODE (type) == TYPE_CODE_STRUCT))
+          || TYPE_CODE (type) == TYPE_CODE_STRUCT))
     {
       int len =
-	(VALUE_BITPOS (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
+        (VALUE_BITPOS (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
       char *buffer = (char *) alloca (len);
       struct value *val;
 
       if (TYPE_CODE (type) == TYPE_CODE_FLT)
-	fromval = value_cast (type, fromval);
+        fromval = value_cast (type, fromval);
 
       read_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval), buffer, len);
       if (BITS_BIG_ENDIAN)
-	move_bits (buffer, VALUE_BITPOS (toval),
-		   VALUE_CONTENTS (fromval),
-		   TYPE_LENGTH (VALUE_TYPE (fromval)) * TARGET_CHAR_BIT -
-		   bits, bits);
+        move_bits (buffer, VALUE_BITPOS (toval),
+                   VALUE_CONTENTS (fromval),
+                   TYPE_LENGTH (VALUE_TYPE (fromval)) * TARGET_CHAR_BIT -
+                   bits, bits);
       else
-	move_bits (buffer, VALUE_BITPOS (toval), VALUE_CONTENTS (fromval),
-		   0, bits);
+        move_bits (buffer, VALUE_BITPOS (toval), VALUE_CONTENTS (fromval),
+                   0, bits);
       write_memory (VALUE_ADDRESS (toval) + VALUE_OFFSET (toval), buffer,
-		    len);
+                    len);
 
       val = value_copy (toval);
       memcpy (VALUE_CONTENTS_RAW (val), VALUE_CONTENTS (fromval),
-	      TYPE_LENGTH (type));
+              TYPE_LENGTH (type));
       VALUE_TYPE (val) = type;
 
       return val;
@@ -1627,8 +2134,8 @@
 }
 
 
-/* The value of the element of array ARR at the ARITY indices given in IND. 
-   ARR may be either a simple array, GNAT array descriptor, or pointer 
+/* The value of the element of array ARR at the ARITY indices given in IND.
+   ARR may be either a simple array, GNAT array descriptor, or pointer
    thereto.  */
 
 struct value *
@@ -1648,7 +2155,7 @@
   for (k = 0; k < arity; k += 1)
     {
       if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY)
-	error ("too many subscripts (%d expected)", k);
+        error ("too many subscripts (%d expected)", k);
       elt = value_subscript (elt, value_pos_atr (ind[k]));
     }
   return elt;
@@ -1656,11 +2163,11 @@
 
 /* Assuming ARR is a pointer to a standard GDB array of type TYPE, the
    value of the element of *ARR at the ARITY indices given in
-   IND. Does not read the entire array into memory. */
+   IND.  Does not read the entire array into memory.  */
 
 struct value *
 ada_value_ptr_subscript (struct value *arr, struct type *type, int arity,
-			 struct value **ind)
+                         struct value **ind)
 {
   int k;
 
@@ -1670,14 +2177,13 @@
       struct value *idx;
 
       if (TYPE_CODE (type) != TYPE_CODE_ARRAY)
-	error ("too many subscripts (%d expected)", k);
+        error ("too many subscripts (%d expected)", k);
       arr = value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
-			value_copy (arr));
+                        value_copy (arr));
       get_discrete_bounds (TYPE_INDEX_TYPE (type), &lwb, &upb);
-      if (lwb == 0)
-	idx = ind[k];
-      else
-	idx = value_sub (ind[k], value_from_longest (builtin_type_int, lwb));
+      idx = value_pos_atr (ind[k]);
+      if (lwb != 0)
+        idx = value_sub (idx, value_from_longest (builtin_type_int, lwb));
       arr = value_add (arr, idx);
       type = TYPE_TARGET_TYPE (type);
     }
@@ -1685,10 +2191,41 @@
   return value_ind (arr);
 }
 
+/* Given that ARRAY_PTR is a pointer or reference to an array of type TYPE (the
+   actual type of ARRAY_PTR is ignored), returns a reference to
+   the Ada slice of HIGH-LOW+1 elements starting at index LOW.  The lower
+   bound of this array is LOW, as per Ada rules. */
+static struct value *
+ada_value_slice_ptr (struct value *array_ptr, struct type *type, 
+                     int low, int high)
+{
+  CORE_ADDR base = value_as_address (array_ptr) 
+    + ((low - TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type)))
+       * TYPE_LENGTH (TYPE_TARGET_TYPE (type)));
+  struct type *index_type = 
+    create_range_type (NULL, TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (type)), 
+                       low, high);
+  struct type *slice_type = 
+    create_array_type (NULL, TYPE_TARGET_TYPE (type), index_type);
+  return value_from_pointer (lookup_reference_type (slice_type), base);
+}
+
+
+static struct value *
+ada_value_slice (struct value *array, int low, int high)
+{
+  struct type *type = VALUE_TYPE (array);
+  struct type *index_type = 
+    create_range_type (NULL, TYPE_INDEX_TYPE (type), low, high);
+  struct type *slice_type = 
+    create_array_type (NULL, TYPE_TARGET_TYPE (type), index_type);
+  return value_cast (slice_type, value_slice (array, low, high-low+1));
+}
+
 /* If type is a record type in the form of a standard GNAT array
    descriptor, returns the number of dimensions for type.  If arr is a
    simple array, returns the number of "array of"s that prefix its
-   type designation. Otherwise, returns 0. */
+   type designation.  Otherwise, returns 0.  */
 
 int
 ada_array_arity (struct type *type)
@@ -1706,8 +2243,8 @@
   else
     while (TYPE_CODE (type) == TYPE_CODE_ARRAY)
       {
-	arity += 1;
-	type = check_typedef (TYPE_TARGET_TYPE (type));
+        arity += 1;
+        type = check_typedef (TYPE_TARGET_TYPE (type));
       }
 
   return arity;
@@ -1716,7 +2253,7 @@
 /* If TYPE is a record type in the form of a standard GNAT array
    descriptor or a simple array type, returns the element type for
    TYPE after indexing by NINDICES indices, or by all indices if
-   NINDICES is -1. Otherwise, returns NULL. */
+   NINDICES is -1.  Otherwise, returns NULL.  */
 
 struct type *
 ada_array_element_type (struct type *type, int nindices)
@@ -1732,51 +2269,59 @@
 
       k = ada_array_arity (type);
       if (k == 0)
-	return NULL;
+        return NULL;
 
-      /* Initially p_array_type = elt_type(*)[]...(k times)...[] */
+      /* Initially p_array_type = elt_type(*)[]...(k times)...[].  */
       if (nindices >= 0 && k > nindices)
-	k = nindices;
+        k = nindices;
       p_array_type = TYPE_TARGET_TYPE (p_array_type);
       while (k > 0 && p_array_type != NULL)
-	{
-	  p_array_type = check_typedef (TYPE_TARGET_TYPE (p_array_type));
-	  k -= 1;
-	}
+        {
+          p_array_type = check_typedef (TYPE_TARGET_TYPE (p_array_type));
+          k -= 1;
+        }
       return p_array_type;
     }
   else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
     {
       while (nindices != 0 && TYPE_CODE (type) == TYPE_CODE_ARRAY)
-	{
-	  type = TYPE_TARGET_TYPE (type);
-	  nindices -= 1;
-	}
+        {
+          type = TYPE_TARGET_TYPE (type);
+          nindices -= 1;
+        }
       return type;
     }
 
   return NULL;
 }
 
-/* The type of nth index in arrays of given type (n numbering from 1).  Does 
-   not examine memory. */
+/* The type of nth index in arrays of given type (n numbering from 1).
+   Does not examine memory.  */
 
 struct type *
 ada_index_type (struct type *type, int n)
 {
+  struct type *result_type;
+
   type = desc_base_type (type);
 
   if (n > ada_array_arity (type))
     return NULL;
 
-  if (ada_is_simple_array (type))
+  if (ada_is_simple_array_type (type))
     {
       int i;
 
       for (i = 1; i < n; i += 1)
-	type = TYPE_TARGET_TYPE (type);
+        type = TYPE_TARGET_TYPE (type);
+      result_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0));
+      /* FIXME: The stabs type r(0,0);bound;bound in an array type
+         has a target type of TYPE_CODE_UNDEF.  We compensate here, but
+         perhaps stabsread.c would make more sense.  */
+      if (result_type == NULL || TYPE_CODE (result_type) == TYPE_CODE_UNDEF)
+        result_type = builtin_type_int;
 
-      return TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 0));
+      return result_type;
     }
   else
     return desc_index_type (desc_bounds_type (type), n);
@@ -1784,14 +2329,14 @@
 
 /* Given that arr is an array type, returns the lower bound of the
    Nth index (numbering from 1) if WHICH is 0, and the upper bound if
-   WHICH is 1. This returns bounds 0 .. -1 if ARR_TYPE is an
-   array-descriptor type.  If TYPEP is non-null, *TYPEP is set to the 
-   bounds type.  It works for other arrays with bounds supplied by 
-   run-time quantities other than discriminants. */
+   WHICH is 1.  This returns bounds 0 .. -1 if ARR_TYPE is an
+   array-descriptor type.  If TYPEP is non-null, *TYPEP is set to the
+   bounds type.  It works for other arrays with bounds supplied by
+   run-time quantities other than discriminants.  */
 
 LONGEST
 ada_array_bound_from_type (struct type * arr_type, int n, int which,
-			   struct type ** typep)
+                           struct type ** typep)
 {
   struct type *type;
   struct type *index_type_desc;
@@ -1799,10 +2344,10 @@
   if (ada_is_packed_array_type (arr_type))
     arr_type = decode_packed_array_type (arr_type);
 
-  if (arr_type == NULL || !ada_is_simple_array (arr_type))
+  if (arr_type == NULL || !ada_is_simple_array_type (arr_type))
     {
       if (typep != NULL)
-	*typep = builtin_type_int;
+        *typep = builtin_type_int;
       return (LONGEST) - which;
     }
 
@@ -1818,40 +2363,40 @@
       struct type *index_type;
 
       while (n > 1)
-	{
-	  type = TYPE_TARGET_TYPE (type);
-	  n -= 1;
-	}
+        {
+          type = TYPE_TARGET_TYPE (type);
+          n -= 1;
+        }
 
       range_type = TYPE_INDEX_TYPE (type);
       index_type = TYPE_TARGET_TYPE (range_type);
       if (TYPE_CODE (index_type) == TYPE_CODE_UNDEF)
-	index_type = builtin_type_long;
+        index_type = builtin_type_long;
       if (typep != NULL)
-	*typep = index_type;
+        *typep = index_type;
       return
-	(LONGEST) (which == 0
-		   ? TYPE_LOW_BOUND (range_type)
-		   : TYPE_HIGH_BOUND (range_type));
+        (LONGEST) (which == 0
+                   ? TYPE_LOW_BOUND (range_type)
+                   : TYPE_HIGH_BOUND (range_type));
     }
   else
     {
       struct type *index_type =
-	to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, n - 1),
-			     NULL, TYPE_OBJFILE (arr_type));
+        to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, n - 1),
+                             NULL, TYPE_OBJFILE (arr_type));
       if (typep != NULL)
-	*typep = TYPE_TARGET_TYPE (index_type);
+        *typep = TYPE_TARGET_TYPE (index_type);
       return
-	(LONGEST) (which == 0
-		   ? TYPE_LOW_BOUND (index_type)
-		   : TYPE_HIGH_BOUND (index_type));
+        (LONGEST) (which == 0
+                   ? TYPE_LOW_BOUND (index_type)
+                   : TYPE_HIGH_BOUND (index_type));
     }
 }
 
 /* Given that arr is an array value, returns the lower bound of the
    nth index (numbering from 1) if which is 0, and the upper bound if
-   which is 1. This routine will also work for arrays with bounds
-   supplied by run-time quantities other than discriminants. */
+   which is 1.  This routine will also work for arrays with bounds
+   supplied by run-time quantities other than discriminants.  */
 
 struct value *
 ada_array_bound (struct value *arr, int n, int which)
@@ -1860,7 +2405,7 @@
 
   if (ada_is_packed_array_type (arr_type))
     return ada_array_bound (decode_packed_array (arr), n, which);
-  else if (ada_is_simple_array (arr_type))
+  else if (ada_is_simple_array_type (arr_type))
     {
       struct type *type;
       LONGEST v = ada_array_bound_from_type (arr_type, n, which, &type);
@@ -1872,411 +2417,400 @@
 
 /* Given that arr is an array value, returns the length of the
    nth index.  This routine will also work for arrays with bounds
-   supplied by run-time quantities other than discriminants. Does not
-   work for arrays indexed by enumeration types with representation
-   clauses at the moment. */
+   supplied by run-time quantities other than discriminants.
+   Does not work for arrays indexed by enumeration types with representation
+   clauses at the moment.  */
 
 struct value *
 ada_array_length (struct value *arr, int n)
 {
   struct type *arr_type = check_typedef (VALUE_TYPE (arr));
-  struct type *index_type_desc;
 
   if (ada_is_packed_array_type (arr_type))
     return ada_array_length (decode_packed_array (arr), n);
 
-  if (ada_is_simple_array (arr_type))
+  if (ada_is_simple_array_type (arr_type))
     {
       struct type *type;
       LONGEST v =
-	ada_array_bound_from_type (arr_type, n, 1, &type) -
-	ada_array_bound_from_type (arr_type, n, 0, NULL) + 1;
+        ada_array_bound_from_type (arr_type, n, 1, &type) -
+        ada_array_bound_from_type (arr_type, n, 0, NULL) + 1;
       return value_from_longest (type, v);
     }
   else
     return
       value_from_longest (builtin_type_ada_int,
-			  value_as_long (desc_one_bound (desc_bounds (arr),
-							 n, 1))
-			  - value_as_long (desc_one_bound (desc_bounds (arr),
-							   n, 0)) + 1);
+                          value_as_long (desc_one_bound (desc_bounds (arr),
+                                                         n, 1))
+                          - value_as_long (desc_one_bound (desc_bounds (arr),
+                                                           n, 0)) + 1);
+}
+
+/* An empty array whose type is that of ARR_TYPE (an array type),
+   with bounds LOW to LOW-1.  */
+
+static struct value *
+empty_array (struct type *arr_type, int low)
+{
+  struct type *index_type = 
+    create_range_type (NULL, TYPE_TARGET_TYPE (TYPE_INDEX_TYPE (arr_type)),
+                       low, low - 1);
+  struct type *elt_type = ada_array_element_type (arr_type, 1);
+  return allocate_value (create_array_type (NULL, elt_type, index_type));
 }
 
 
-				/* Name resolution */
+                                /* Name resolution */
 
-/* The "demangled" name for the user-definable Ada operator corresponding
-   to op. */
+/* The "decoded" name for the user-definable Ada operator corresponding
+   to OP.  */
 
 static const char *
-ada_op_name (enum exp_opcode op)
+ada_decoded_op_name (enum exp_opcode op)
 {
   int i;
 
-  for (i = 0; ada_opname_table[i].mangled != NULL; i += 1)
+  for (i = 0; ada_opname_table[i].encoded != NULL; i += 1)
     {
       if (ada_opname_table[i].op == op)
-	return ada_opname_table[i].demangled;
+        return ada_opname_table[i].decoded;
     }
   error ("Could not find operator name for opcode");
 }
 
 
-/* Same as evaluate_type (*EXP), but resolves ambiguous symbol 
-   references (OP_UNRESOLVED_VALUES) and converts operators that are 
-   user-defined into appropriate function calls.  If CONTEXT_TYPE is 
+/* Same as evaluate_type (*EXP), but resolves ambiguous symbol
+   references (marked by OP_VAR_VALUE nodes in which the symbol has an
+   undefined namespace) and converts operators that are
+   user-defined into appropriate function calls.  If CONTEXT_TYPE is
    non-null, it provides a preferred result type [at the moment, only
    type void has any effect---causing procedures to be preferred over
    functions in calls].  A null CONTEXT_TYPE indicates that a non-void
-   return type is preferred.  The variable unresolved_names contains a list
-   of character strings referenced by expout that should be freed.  
-   May change (expand) *EXP.  */
+   return type is preferred.  May change (expand) *EXP.  */
 
-void
-ada_resolve (struct expression **expp, struct type *context_type)
+static void
+resolve (struct expression **expp, int void_context_p)
 {
   int pc;
   pc = 0;
-  ada_resolve_subexp (expp, &pc, 1, context_type);
+  resolve_subexp (expp, &pc, 1, void_context_p ? builtin_type_void : NULL);
 }
 
-/* Resolve the operator of the subexpression beginning at 
-   position *POS of *EXPP. "Resolving" consists of replacing
-   OP_UNRESOLVED_VALUE with an appropriate OP_VAR_VALUE, replacing
-   built-in operators with function calls to user-defined operators,
-   where appropriate, and (when DEPROCEDURE_P is non-zero), converting
-   function-valued variables into parameterless calls.  May expand
-   EXP. The CONTEXT_TYPE functions as in ada_resolve, above. */
+/* Resolve the operator of the subexpression beginning at
+   position *POS of *EXPP.  "Resolving" consists of replacing
+   the symbols that have undefined namespaces in OP_VAR_VALUE nodes
+   with their resolutions, replacing built-in operators with
+   function calls to user-defined operators, where appropriate, and,
+   when DEPROCEDURE_P is non-zero, converting function-valued variables
+   into parameterless calls.  May expand *EXPP.  The CONTEXT_TYPE functions
+   are as in ada_resolve, above.  */
 
 static struct value *
-ada_resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
-		    struct type *context_type)
+resolve_subexp (struct expression **expp, int *pos, int deprocedure_p,
+                struct type *context_type)
 {
   int pc = *pos;
   int i;
-  struct expression *exp;	/* Convenience: == *expp */
+  struct expression *exp;       /* Convenience: == *expp.  */
   enum exp_opcode op = (*expp)->elts[pc].opcode;
-  struct value **argvec;	/* Vector of operand types (alloca'ed). */
-  int nargs;			/* Number of operands */
+  struct value **argvec;        /* Vector of operand types (alloca'ed).  */
+  int nargs;                    /* Number of operands.  */
 
   argvec = NULL;
   nargs = 0;
   exp = *expp;
 
-  /* Pass one: resolve operands, saving their types and updating *pos. */
+  /* Pass one: resolve operands, saving their types and updating *pos.  */
   switch (op)
     {
-    case OP_VAR_VALUE:
-      /*    case OP_UNRESOLVED_VALUE: */
-      /* FIXME:  OP_UNRESOLVED_VALUE should be defined in expression.h */
+    case OP_FUNCALL:
+      if (exp->elts[pc + 3].opcode == OP_VAR_VALUE
+          && SYMBOL_DOMAIN (exp->elts[pc + 5].symbol) == UNDEF_DOMAIN)
+        *pos += 7;
+      else
+        {
+          *pos += 3;
+          resolve_subexp (expp, pos, 0, NULL);
+        }
+      nargs = longest_to_int (exp->elts[pc + 1].longconst);
+      break;
+
+    case UNOP_QUAL:
+      *pos += 3;
+      resolve_subexp (expp, pos, 1, exp->elts[pc + 1].type);
+      break;
+
+    case UNOP_ADDR:
+      *pos += 1;
+      resolve_subexp (expp, pos, 0, NULL);
+      break;
+
+    case OP_ATR_MODULUS:
       *pos += 4;
       break;
 
-    case OP_FUNCALL:
-      nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1;
-      /* FIXME:  OP_UNRESOLVED_VALUE should be defined in expression.h */
-      /*      if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE)        
-         {
-         *pos += 7;
-
-         argvec = (struct value* *) alloca (sizeof (struct value*) * (nargs + 1));
-         for (i = 0; i < nargs-1; i += 1)
-         argvec[i] = ada_resolve_subexp (expp, pos, 1, NULL);
-         argvec[i] = NULL;
-         }
-         else
-         {
-         *pos += 3;
-         ada_resolve_subexp (expp, pos, 0, NULL);
-         for (i = 1; i < nargs; i += 1)
-         ada_resolve_subexp (expp, pos, 1, NULL);
-         }
-       */
-      exp = *expp;
+    case OP_ATR_SIZE:
+    case OP_ATR_TAG:
+      *pos += 1;
+      nargs = 1;
       break;
 
-      /* FIXME:  UNOP_QUAL should be defined in expression.h */
-      /*    case UNOP_QUAL:
-         nargs = 1;
-         *pos += 3;
-         ada_resolve_subexp (expp, pos, 1, exp->elts[pc + 1].type);
-         exp = *expp;
-         break;
-       */
-      /* FIXME:  OP_ATTRIBUTE should be defined in expression.h */
-      /*    case OP_ATTRIBUTE:
-         nargs = longest_to_int (exp->elts[pc + 1].longconst) + 1;
-         *pos += 4;
-         for (i = 0; i < nargs; i += 1)
-         ada_resolve_subexp (expp, pos, 1, NULL);
-         exp = *expp;
-         break;
-       */
-    case UNOP_ADDR:
-      nargs = 1;
+    case OP_ATR_FIRST:
+    case OP_ATR_LAST:
+    case OP_ATR_LENGTH:
+    case OP_ATR_POS:
+    case OP_ATR_VAL:
       *pos += 1;
-      ada_resolve_subexp (expp, pos, 0, NULL);
-      exp = *expp;
+      nargs = 2;
+      break;
+
+    case OP_ATR_MIN:
+    case OP_ATR_MAX:
+      *pos += 1;
+      nargs = 3;
       break;
 
     case BINOP_ASSIGN:
       {
-	struct value *arg1;
-	nargs = 2;
-	*pos += 1;
-	arg1 = ada_resolve_subexp (expp, pos, 0, NULL);
-	if (arg1 == NULL)
-	  ada_resolve_subexp (expp, pos, 1, NULL);
-	else
-	  ada_resolve_subexp (expp, pos, 1, VALUE_TYPE (arg1));
-	break;
+        struct value *arg1;
+
+        *pos += 1;
+        arg1 = resolve_subexp (expp, pos, 0, NULL);
+        if (arg1 == NULL)
+          resolve_subexp (expp, pos, 1, NULL);
+        else
+          resolve_subexp (expp, pos, 1, VALUE_TYPE (arg1));
+        break;
       }
 
-    default:
-      switch (op)
-	{
-	default:
-	  error ("Unexpected operator during name resolution");
-	case UNOP_CAST:
-	  /*    case UNOP_MBR:
-	     nargs = 1;
-	     *pos += 3;
-	     break;
-	   */
-	case BINOP_ADD:
-	case BINOP_SUB:
-	case BINOP_MUL:
-	case BINOP_DIV:
-	case BINOP_REM:
-	case BINOP_MOD:
-	case BINOP_EXP:
-	case BINOP_CONCAT:
-	case BINOP_LOGICAL_AND:
-	case BINOP_LOGICAL_OR:
-	case BINOP_BITWISE_AND:
-	case BINOP_BITWISE_IOR:
-	case BINOP_BITWISE_XOR:
-
-	case BINOP_EQUAL:
-	case BINOP_NOTEQUAL:
-	case BINOP_LESS:
-	case BINOP_GTR:
-	case BINOP_LEQ:
-	case BINOP_GEQ:
-
-	case BINOP_REPEAT:
-	case BINOP_SUBSCRIPT:
-	case BINOP_COMMA:
-	  nargs = 2;
-	  *pos += 1;
-	  break;
-
-	case UNOP_NEG:
-	case UNOP_PLUS:
-	case UNOP_LOGICAL_NOT:
-	case UNOP_ABS:
-	case UNOP_IND:
-	  nargs = 1;
-	  *pos += 1;
-	  break;
-
-	case OP_LONG:
-	case OP_DOUBLE:
-	case OP_VAR_VALUE:
-	  *pos += 4;
-	  break;
-
-	case OP_TYPE:
-	case OP_BOOL:
-	case OP_LAST:
-	case OP_REGISTER:
-	case OP_INTERNALVAR:
-	  *pos += 3;
-	  break;
-
-	case UNOP_MEMVAL:
-	  *pos += 3;
-	  nargs = 1;
-	  break;
-
-	case STRUCTOP_STRUCT:
-	case STRUCTOP_PTR:
-	  nargs = 1;
-	  *pos += 4 + BYTES_TO_EXP_ELEM (exp->elts[pc + 1].longconst + 1);
-	  break;
-
-	case OP_ARRAY:
-	  *pos += 4;
-	  nargs = longest_to_int (exp->elts[pc + 2].longconst) + 1;
-	  nargs -= longest_to_int (exp->elts[pc + 1].longconst);
-	  /* A null array contains one dummy element to give the type. */
-	  /*      if (nargs == 0)
-	     nargs = 1;
-	     break; */
-
-	case TERNOP_SLICE:
-	  /* FIXME: TERNOP_MBR should be defined in expression.h */
-	  /*    case TERNOP_MBR:
-	     *pos += 1;
-	     nargs = 3;
-	     break;
-	   */
-	  /* FIXME: BINOP_MBR should be defined in expression.h */
-	  /*    case BINOP_MBR:
-	     *pos += 3;
-	     nargs = 2;
-	     break; */
-	}
-
-      argvec =
-	(struct value * *) alloca (sizeof (struct value *) * (nargs + 1));
-      for (i = 0; i < nargs; i += 1)
-	argvec[i] = ada_resolve_subexp (expp, pos, 1, NULL);
-      argvec[i] = NULL;
-      exp = *expp;
+    case UNOP_CAST:
+    case UNOP_IN_RANGE:
+      *pos += 3;
+      nargs = 1;
       break;
+
+    case BINOP_ADD:
+    case BINOP_SUB:
+    case BINOP_MUL:
+    case BINOP_DIV:
+    case BINOP_REM:
+    case BINOP_MOD:
+    case BINOP_EXP:
+    case BINOP_CONCAT:
+    case BINOP_LOGICAL_AND:
+    case BINOP_LOGICAL_OR:
+    case BINOP_BITWISE_AND:
+    case BINOP_BITWISE_IOR:
+    case BINOP_BITWISE_XOR:
+
+    case BINOP_EQUAL:
+    case BINOP_NOTEQUAL:
+    case BINOP_LESS:
+    case BINOP_GTR:
+    case BINOP_LEQ:
+    case BINOP_GEQ:
+
+    case BINOP_REPEAT:
+    case BINOP_SUBSCRIPT:
+    case BINOP_COMMA:
+      *pos += 1;
+      nargs = 2;
+      break;
+
+    case UNOP_NEG:
+    case UNOP_PLUS:
+    case UNOP_LOGICAL_NOT:
+    case UNOP_ABS:
+    case UNOP_IND:
+      *pos += 1;
+      nargs = 1;
+      break;
+
+    case OP_LONG:
+    case OP_DOUBLE:
+    case OP_VAR_VALUE:
+      *pos += 4;
+      break;
+
+    case OP_TYPE:
+    case OP_BOOL:
+    case OP_LAST:
+    case OP_REGISTER:
+    case OP_INTERNALVAR:
+      *pos += 3;
+      break;
+
+    case UNOP_MEMVAL:
+      *pos += 3;
+      nargs = 1;
+      break;
+
+    case STRUCTOP_STRUCT:
+      *pos += 4 + BYTES_TO_EXP_ELEM (exp->elts[pc + 1].longconst + 1);
+      nargs = 1;
+      break;
+
+    case OP_STRING:
+      (*pos) += 3 
+        + BYTES_TO_EXP_ELEM (longest_to_int (exp->elts[pc + 1].longconst) 
+                             + 1);
+      break;
+
+    case TERNOP_SLICE:
+    case TERNOP_IN_RANGE:
+      *pos += 1;
+      nargs = 3;
+      break;
+
+    case BINOP_IN_BOUNDS:
+      *pos += 3;
+      nargs = 2;
+      break;
+
+    default:
+      error ("Unexpected operator during name resolution");
     }
 
-  /* Pass two: perform any resolution on principal operator. */
+  argvec = (struct value * *) alloca (sizeof (struct value *) * (nargs + 1));
+  for (i = 0; i < nargs; i += 1)
+    argvec[i] = resolve_subexp (expp, pos, 1, NULL);
+  argvec[i] = NULL;
+  exp = *expp;
+
+  /* Pass two: perform any resolution on principal operator.  */
   switch (op)
     {
     default:
       break;
 
-      /* FIXME:  OP_UNRESOLVED_VALUE should be defined in expression.h */
-      /*    case OP_UNRESOLVED_VALUE:
-         {
-         struct symbol** candidate_syms;
-         struct block** candidate_blocks;
-         int n_candidates;
-
-         n_candidates = ada_lookup_symbol_list (exp->elts[pc + 2].name,
-         exp->elts[pc + 1].block,
-         VAR_DOMAIN,
-         &candidate_syms,
-         &candidate_blocks);
-
-         if (n_candidates > 1) 
-         { */
-      /* Types tend to get re-introduced locally, so if there
-         are any local symbols that are not types, first filter
-   out all types. *//*
-   int j;
-   for (j = 0; j < n_candidates; j += 1) 
-   switch (SYMBOL_CLASS (candidate_syms[j])) 
-   {
-   case LOC_REGISTER:
-   case LOC_ARG:
-   case LOC_REF_ARG:
-   case LOC_REGPARM:
-   case LOC_REGPARM_ADDR:
-   case LOC_LOCAL:
-   case LOC_LOCAL_ARG:
-   case LOC_BASEREG:
-   case LOC_BASEREG_ARG:
-   case LOC_COMPUTED:
-   case LOC_COMPUTED_ARG:
-   goto FoundNonType;
-   default:
-   break;
-   }
-   FoundNonType:
-   if (j < n_candidates) 
-   {
-   j = 0;
-   while (j < n_candidates) 
-   {
-   if (SYMBOL_CLASS (candidate_syms[j]) == LOC_TYPEDEF)
-   {
-   candidate_syms[j] = candidate_syms[n_candidates-1];
-   candidate_blocks[j] = candidate_blocks[n_candidates-1];
-   n_candidates -= 1;
-   }
-   else
-   j += 1;
-   }
-   }
-   }
-
-   if (n_candidates == 0)
-   error ("No definition found for %s", 
-   ada_demangle (exp->elts[pc + 2].name));
-   else if (n_candidates == 1)
-   i = 0;
-   else if (deprocedure_p 
-   && ! is_nonfunction (candidate_syms, n_candidates))
-   {
-   i = ada_resolve_function (candidate_syms, candidate_blocks,
-   n_candidates, NULL, 0,
-   exp->elts[pc + 2].name, context_type);
-   if (i < 0) 
-   error ("Could not find a match for %s", 
-   ada_demangle (exp->elts[pc + 2].name));
-   }
-   else 
-   {
-   printf_filtered ("Multiple matches for %s\n", 
-   ada_demangle (exp->elts[pc+2].name));
-   user_select_syms (candidate_syms, candidate_blocks, 
-   n_candidates, 1);
-   i = 0;
-   }
-
-   exp->elts[pc].opcode = exp->elts[pc + 3].opcode = OP_VAR_VALUE;
-   exp->elts[pc + 1].block = candidate_blocks[i];
-   exp->elts[pc + 2].symbol = candidate_syms[i];
-   if (innermost_block == NULL ||
-   contained_in (candidate_blocks[i], innermost_block))
-   innermost_block = candidate_blocks[i];
-   } */
-      /* FALL THROUGH */
-
     case OP_VAR_VALUE:
-      if (deprocedure_p &&
-	  TYPE_CODE (SYMBOL_TYPE (exp->elts[pc + 2].symbol)) ==
-	  TYPE_CODE_FUNC)
-	{
-	  replace_operator_with_call (expp, pc, 0, 0,
-				      exp->elts[pc + 2].symbol,
-				      exp->elts[pc + 1].block);
-	  exp = *expp;
-	}
+      if (SYMBOL_DOMAIN (exp->elts[pc + 2].symbol) == UNDEF_DOMAIN)
+        {
+          struct ada_symbol_info *candidates;
+          int n_candidates;
+
+          n_candidates =
+            ada_lookup_symbol_list (SYMBOL_LINKAGE_NAME
+                                    (exp->elts[pc + 2].symbol),
+                                    exp->elts[pc + 1].block, VAR_DOMAIN,
+                                    &candidates);
+
+          if (n_candidates > 1)
+            {
+              /* Types tend to get re-introduced locally, so if there
+                 are any local symbols that are not types, first filter
+                 out all types.  */
+              int j;
+              for (j = 0; j < n_candidates; j += 1)
+                switch (SYMBOL_CLASS (candidates[j].sym))
+                  {
+                  case LOC_REGISTER:
+                  case LOC_ARG:
+                  case LOC_REF_ARG:
+                  case LOC_REGPARM:
+                  case LOC_REGPARM_ADDR:
+                  case LOC_LOCAL:
+                  case LOC_LOCAL_ARG:
+                  case LOC_BASEREG:
+                  case LOC_BASEREG_ARG:
+                  case LOC_COMPUTED:
+                  case LOC_COMPUTED_ARG:
+                    goto FoundNonType;
+                  default:
+                    break;
+                  }
+            FoundNonType:
+              if (j < n_candidates)
+                {
+                  j = 0;
+                  while (j < n_candidates)
+                    {
+                      if (SYMBOL_CLASS (candidates[j].sym) == LOC_TYPEDEF)
+                        {
+                          candidates[j] = candidates[n_candidates - 1];
+                          n_candidates -= 1;
+                        }
+                      else
+                        j += 1;
+                    }
+                }
+            }
+
+          if (n_candidates == 0)
+            error ("No definition found for %s",
+                   SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol));
+          else if (n_candidates == 1)
+            i = 0;
+          else if (deprocedure_p
+                   && !is_nonfunction (candidates, n_candidates))
+            {
+              i = ada_resolve_function
+                (candidates, n_candidates, NULL, 0,
+                 SYMBOL_LINKAGE_NAME (exp->elts[pc + 2].symbol),
+                 context_type);
+              if (i < 0)
+                error ("Could not find a match for %s",
+                       SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol));
+            }
+          else
+            {
+              printf_filtered ("Multiple matches for %s\n",
+                               SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol));
+              user_select_syms (candidates, n_candidates, 1);
+              i = 0;
+            }
+
+          exp->elts[pc + 1].block = candidates[i].block;
+          exp->elts[pc + 2].symbol = candidates[i].sym;
+          if (innermost_block == NULL
+              || contained_in (candidates[i].block, innermost_block))
+            innermost_block = candidates[i].block;
+        }
+
+      if (deprocedure_p
+          && (TYPE_CODE (SYMBOL_TYPE (exp->elts[pc + 2].symbol))
+              == TYPE_CODE_FUNC))
+        {
+          replace_operator_with_call (expp, pc, 0, 0,
+                                      exp->elts[pc + 2].symbol,
+                                      exp->elts[pc + 1].block);
+          exp = *expp;
+        }
       break;
 
     case OP_FUNCALL:
       {
-	/* FIXME:  OP_UNRESOLVED_VALUE should be defined in expression.h */
-	/*      if (exp->elts[pc+3].opcode == OP_UNRESOLVED_VALUE)      
-	   {
-	   struct symbol** candidate_syms;
-	   struct block** candidate_blocks;
-	   int n_candidates;
+        if (exp->elts[pc + 3].opcode == OP_VAR_VALUE
+            && SYMBOL_DOMAIN (exp->elts[pc + 5].symbol) == UNDEF_DOMAIN)
+          {
+            struct ada_symbol_info *candidates;
+            int n_candidates;
 
-	   n_candidates = ada_lookup_symbol_list (exp->elts[pc + 5].name,
-	   exp->elts[pc + 4].block,
-	   VAR_DOMAIN,
-	   &candidate_syms,
-	   &candidate_blocks);
-	   if (n_candidates == 1)
-	   i = 0;
-	   else
-	   {
-	   i = ada_resolve_function (candidate_syms, candidate_blocks,
-	   n_candidates, argvec, nargs-1,
-	   exp->elts[pc + 5].name, context_type);
-	   if (i < 0) 
-	   error ("Could not find a match for %s", 
-	   ada_demangle (exp->elts[pc + 5].name));
-	   }
+            n_candidates =
+              ada_lookup_symbol_list (SYMBOL_LINKAGE_NAME
+                                      (exp->elts[pc + 5].symbol),
+                                      exp->elts[pc + 4].block, VAR_DOMAIN,
+                                      &candidates);
+            if (n_candidates == 1)
+              i = 0;
+            else
+              {
+                i = ada_resolve_function
+                  (candidates, n_candidates,
+                   argvec, nargs,
+                   SYMBOL_LINKAGE_NAME (exp->elts[pc + 5].symbol),
+                   context_type);
+                if (i < 0)
+                  error ("Could not find a match for %s",
+                         SYMBOL_PRINT_NAME (exp->elts[pc + 5].symbol));
+              }
 
-	   exp->elts[pc + 3].opcode = exp->elts[pc + 6].opcode = OP_VAR_VALUE;
-	   exp->elts[pc + 4].block = candidate_blocks[i];
-	   exp->elts[pc + 5].symbol = candidate_syms[i];
-	   if (innermost_block == NULL ||
-	   contained_in (candidate_blocks[i], innermost_block))
-	   innermost_block = candidate_blocks[i];
-	   } */
-
+            exp->elts[pc + 4].block = candidates[i].block;
+            exp->elts[pc + 5].symbol = candidates[i].sym;
+            if (innermost_block == NULL
+                || contained_in (candidates[i].block, innermost_block))
+              innermost_block = candidates[i].block;
+          }
       }
       break;
     case BINOP_ADD:
@@ -2301,27 +2835,27 @@
     case UNOP_LOGICAL_NOT:
     case UNOP_ABS:
       if (possible_user_operator_p (op, argvec))
-	{
-	  struct symbol **candidate_syms;
-	  struct block **candidate_blocks;
-	  int n_candidates;
+        {
+          struct ada_symbol_info *candidates;
+          int n_candidates;
 
-	  n_candidates =
-	    ada_lookup_symbol_list (ada_mangle (ada_op_name (op)),
-				    (struct block *) NULL, VAR_DOMAIN,
-				    &candidate_syms, &candidate_blocks);
-	  i =
-	    ada_resolve_function (candidate_syms, candidate_blocks,
-				  n_candidates, argvec, nargs,
-				  ada_op_name (op), NULL);
-	  if (i < 0)
-	    break;
+          n_candidates =
+            ada_lookup_symbol_list (ada_encode (ada_decoded_op_name (op)),
+                                    (struct block *) NULL, VAR_DOMAIN,
+                                    &candidates);
+          i = ada_resolve_function (candidates, n_candidates, argvec, nargs,
+                                    ada_decoded_op_name (op), NULL);
+          if (i < 0)
+            break;
 
-	  replace_operator_with_call (expp, pc, nargs, 1,
-				      candidate_syms[i], candidate_blocks[i]);
-	  exp = *expp;
-	}
+          replace_operator_with_call (expp, pc, nargs, 1,
+                                      candidates[i].sym, candidates[i].block);
+          exp = *expp;
+        }
       break;
+
+    case OP_TYPE:
+      return NULL;
     }
 
   *pos = pc;
@@ -2329,10 +2863,11 @@
 }
 
 /* Return non-zero if formal type FTYPE matches actual type ATYPE.  If
-   MAY_DEREF is non-zero, the formal may be a pointer and the actual 
-   a non-pointer. */
+   MAY_DEREF is non-zero, the formal may be a pointer and the actual
+   a non-pointer.   A type of 'void' (which is never a valid expression type)
+   by convention matches anything. */
 /* The term "match" here is rather loose.  The match is heuristic and
-   liberal.  FIXME: TOO liberal, in fact. */
+   liberal.  FIXME: TOO liberal, in fact.  */
 
 static int
 ada_type_match (struct type *ftype, struct type *atype, int may_deref)
@@ -2355,35 +2890,35 @@
       return 1;
     case TYPE_CODE_PTR:
       if (TYPE_CODE (atype) == TYPE_CODE_PTR)
-	return ada_type_match (TYPE_TARGET_TYPE (ftype),
-			       TYPE_TARGET_TYPE (atype), 0);
+        return ada_type_match (TYPE_TARGET_TYPE (ftype),
+                               TYPE_TARGET_TYPE (atype), 0);
       else
-	return (may_deref &&
-		ada_type_match (TYPE_TARGET_TYPE (ftype), atype, 0));
+        return (may_deref
+                && ada_type_match (TYPE_TARGET_TYPE (ftype), atype, 0));
     case TYPE_CODE_INT:
     case TYPE_CODE_ENUM:
     case TYPE_CODE_RANGE:
       switch (TYPE_CODE (atype))
-	{
-	case TYPE_CODE_INT:
-	case TYPE_CODE_ENUM:
-	case TYPE_CODE_RANGE:
-	  return 1;
-	default:
-	  return 0;
-	}
+        {
+        case TYPE_CODE_INT:
+        case TYPE_CODE_ENUM:
+        case TYPE_CODE_RANGE:
+          return 1;
+        default:
+          return 0;
+        }
 
     case TYPE_CODE_ARRAY:
       return (TYPE_CODE (atype) == TYPE_CODE_ARRAY
-	      || ada_is_array_descriptor (atype));
+              || ada_is_array_descriptor_type (atype));
 
     case TYPE_CODE_STRUCT:
-      if (ada_is_array_descriptor (ftype))
-	return (TYPE_CODE (atype) == TYPE_CODE_ARRAY
-		|| ada_is_array_descriptor (atype));
+      if (ada_is_array_descriptor_type (ftype))
+        return (TYPE_CODE (atype) == TYPE_CODE_ARRAY
+                || ada_is_array_descriptor_type (atype));
       else
-	return (TYPE_CODE (atype) == TYPE_CODE_STRUCT
-		&& !ada_is_array_descriptor (atype));
+        return (TYPE_CODE (atype) == TYPE_CODE_STRUCT
+                && !ada_is_array_descriptor_type (atype));
 
     case TYPE_CODE_UNION:
     case TYPE_CODE_FLT:
@@ -2394,7 +2929,7 @@
 /* Return non-zero if the formals of FUNC "sufficiently match" the
    vector of actual argument types ACTUALS of size N_ACTUALS.  FUNC
    may also be an enumeral, in which case it is treated as a 0-
-   argument function. */
+   argument function.  */
 
 static int
 ada_args_match (struct symbol *func, struct value **actuals, int n_actuals)
@@ -2402,8 +2937,8 @@
   int i;
   struct type *func_type = SYMBOL_TYPE (func);
 
-  if (SYMBOL_CLASS (func) == LOC_CONST &&
-      TYPE_CODE (func_type) == TYPE_CODE_ENUM)
+  if (SYMBOL_CLASS (func) == LOC_CONST
+      && TYPE_CODE (func_type) == TYPE_CODE_ENUM)
     return (n_actuals == 0);
   else if (func_type == NULL || TYPE_CODE (func_type) != TYPE_CODE_FUNC)
     return 0;
@@ -2413,12 +2948,16 @@
 
   for (i = 0; i < n_actuals; i += 1)
     {
-      struct type *ftype = check_typedef (TYPE_FIELD_TYPE (func_type, i));
-      struct type *atype = check_typedef (VALUE_TYPE (actuals[i]));
+      if (actuals[i] == NULL)
+        return 0;
+      else
+        {
+          struct type *ftype = check_typedef (TYPE_FIELD_TYPE (func_type, i));
+          struct type *atype = check_typedef (VALUE_TYPE (actuals[i]));
 
-      if (!ada_type_match (TYPE_FIELD_TYPE (func_type, i),
-			   VALUE_TYPE (actuals[i]), 1))
-	return 0;
+          if (!ada_type_match (ftype, atype, 1))
+            return 0;
+        }
     }
   return 1;
 }
@@ -2436,16 +2975,14 @@
   if (func_type == NULL)
     return 1;
 
-  /* FIXME: base_type should be declared in gdbtypes.h, implemented in valarith.c */
-  /*  if (TYPE_CODE (func_type) == TYPE_CODE_FUNC)
-     return_type = base_type (TYPE_TARGET_TYPE (func_type));
-     else 
-     return_type = base_type (func_type); */
+  if (TYPE_CODE (func_type) == TYPE_CODE_FUNC)
+    return_type = base_type (TYPE_TARGET_TYPE (func_type));
+  else
+    return_type = base_type (func_type);
   if (return_type == NULL)
     return 1;
 
-  /* FIXME: base_type should be declared in gdbtypes.h, implemented in valarith.c */
-  /*  context_type = base_type (context_type); */
+  context_type = base_type (context_type);
 
   if (TYPE_CODE (return_type) == TYPE_CODE_ENUM)
     return context_type == NULL || return_type == context_type;
@@ -2456,24 +2993,25 @@
 }
 
 
-/* Return the index in SYMS[0..NSYMS-1] of symbol for the 
+/* Returns the index in SYMS[0..NSYMS-1] that contains  the symbol for the
    function (if any) that matches the types of the NARGS arguments in
-   ARGS.  If CONTEXT_TYPE is non-null, and there is at least one match
-   that returns type CONTEXT_TYPE, then eliminate other matches.  If
-   CONTEXT_TYPE is null, prefer a non-void-returning function.
+   ARGS.  If CONTEXT_TYPE is non-null and there is at least one match
+   that returns that type, then eliminate matches that don't.  If
+   CONTEXT_TYPE is void and there is at least one match that does not
+   return void, eliminate all matches that do.
+
    Asks the user if there is more than one match remaining.  Returns -1
    if there is no such symbol or none is selected.  NAME is used
-   solely for messages.   May re-arrange and modify SYMS in
-   the process; the index returned is for the modified vector.  BLOCKS
-   is modified in parallel to SYMS. */
+   solely for messages.  May re-arrange and modify SYMS in
+   the process; the index returned is for the modified vector.  */
 
-int
-ada_resolve_function (struct symbol *syms[], struct block *blocks[],
-		      int nsyms, struct value **args, int nargs,
-		      const char *name, struct type *context_type)
+static int
+ada_resolve_function (struct ada_symbol_info syms[],
+                      int nsyms, struct value **args, int nargs,
+                      const char *name, struct type *context_type)
 {
   int k;
-  int m;			/* Number of hits */
+  int m;                        /* Number of hits */
   struct type *fallback;
   struct type *return_type;
 
@@ -2487,22 +3025,20 @@
   while (1)
     {
       for (k = 0; k < nsyms; k += 1)
-	{
-	  struct type *type = check_typedef (SYMBOL_TYPE (syms[k]));
+        {
+          struct type *type = check_typedef (SYMBOL_TYPE (syms[k].sym));
 
-	  if (ada_args_match (syms[k], args, nargs)
-	      && return_match (SYMBOL_TYPE (syms[k]), return_type))
-	    {
-	      syms[m] = syms[k];
-	      if (blocks != NULL)
-		blocks[m] = blocks[k];
-	      m += 1;
-	    }
-	}
+          if (ada_args_match (syms[k].sym, args, nargs)
+              && return_match (type, return_type))
+            {
+              syms[m] = syms[k];
+              m += 1;
+            }
+        }
       if (m > 0 || return_type == fallback)
-	break;
+        break;
       else
-	return_type = fallback;
+        return_type = fallback;
     }
 
   if (m == 0)
@@ -2510,19 +3046,20 @@
   else if (m > 1)
     {
       printf_filtered ("Multiple matches for %s\n", name);
-      user_select_syms (syms, blocks, m, 1);
+      user_select_syms (syms, m, 1);
       return 0;
     }
   return 0;
 }
 
-/* Returns true (non-zero) iff demangled name N0 should appear before N1 */
-/* in a listing of choices during disambiguation (see sort_choices, below). */
-/* The idea is that overloadings of a subprogram name from the */
-/* same package should sort in their source order.  We settle for ordering */
-/* such symbols by their trailing number (__N  or $N). */
+/* Returns true (non-zero) iff decoded name N0 should appear before N1
+   in a listing of choices during disambiguation (see sort_choices, below).
+   The idea is that overloadings of a subprogram name from the
+   same package should sort in their source order.  We settle for ordering
+   such symbols by their trailing number (__N  or $N).  */
+
 static int
-mangled_ordered_before (char *N0, char *N1)
+encoded_ordered_before (char *N0, char *N1)
 {
   if (N1 == NULL)
     return 0;
@@ -2532,65 +3069,59 @@
     {
       int k0, k1;
       for (k0 = strlen (N0) - 1; k0 > 0 && isdigit (N0[k0]); k0 -= 1)
-	;
+        ;
       for (k1 = strlen (N1) - 1; k1 > 0 && isdigit (N1[k1]); k1 -= 1)
-	;
+        ;
       if ((N0[k0] == '_' || N0[k0] == '$') && N0[k0 + 1] != '\000'
-	  && (N1[k1] == '_' || N1[k1] == '$') && N1[k1 + 1] != '\000')
-	{
-	  int n0, n1;
-	  n0 = k0;
-	  while (N0[n0] == '_' && n0 > 0 && N0[n0 - 1] == '_')
-	    n0 -= 1;
-	  n1 = k1;
-	  while (N1[n1] == '_' && n1 > 0 && N1[n1 - 1] == '_')
-	    n1 -= 1;
-	  if (n0 == n1 && DEPRECATED_STREQN (N0, N1, n0))
-	    return (atoi (N0 + k0 + 1) < atoi (N1 + k1 + 1));
-	}
+          && (N1[k1] == '_' || N1[k1] == '$') && N1[k1 + 1] != '\000')
+        {
+          int n0, n1;
+          n0 = k0;
+          while (N0[n0] == '_' && n0 > 0 && N0[n0 - 1] == '_')
+            n0 -= 1;
+          n1 = k1;
+          while (N1[n1] == '_' && n1 > 0 && N1[n1 - 1] == '_')
+            n1 -= 1;
+          if (n0 == n1 && strncmp (N0, N1, n0) == 0)
+            return (atoi (N0 + k0 + 1) < atoi (N1 + k1 + 1));
+        }
       return (strcmp (N0, N1) < 0);
     }
 }
 
-/* Sort SYMS[0..NSYMS-1] to put the choices in a canonical order by their */
-/* mangled names, rearranging BLOCKS[0..NSYMS-1] according to the same */
-/* permutation. */
+/* Sort SYMS[0..NSYMS-1] to put the choices in a canonical order by the
+   encoded names.  */
+
 static void
-sort_choices (struct symbol *syms[], struct block *blocks[], int nsyms)
+sort_choices (struct ada_symbol_info syms[], int nsyms)
 {
-  int i, j;
+  int i;
   for (i = 1; i < nsyms; i += 1)
     {
-      struct symbol *sym = syms[i];
-      struct block *block = blocks[i];
+      struct ada_symbol_info sym = syms[i];
       int j;
 
       for (j = i - 1; j >= 0; j -= 1)
-	{
-	  if (mangled_ordered_before (DEPRECATED_SYMBOL_NAME (syms[j]),
-				      DEPRECATED_SYMBOL_NAME (sym)))
-	    break;
-	  syms[j + 1] = syms[j];
-	  blocks[j + 1] = blocks[j];
-	}
+        {
+          if (encoded_ordered_before (SYMBOL_LINKAGE_NAME (syms[j].sym),
+                                      SYMBOL_LINKAGE_NAME (sym.sym)))
+            break;
+          syms[j + 1] = syms[j];
+        }
       syms[j + 1] = sym;
-      blocks[j + 1] = block;
     }
 }
 
-/* Given a list of NSYMS symbols in SYMS and corresponding blocks in */
-/* BLOCKS, select up to MAX_RESULTS>0 by asking the user (if */
-/* necessary), returning the number selected, and setting the first */
-/* elements of SYMS and BLOCKS to the selected symbols and */
-/* corresponding blocks.  Error if no symbols selected.   BLOCKS may */
-/* be NULL, in which case it is ignored. */
+/* Given a list of NSYMS symbols in SYMS, select up to MAX_RESULTS>0 
+   by asking the user (if necessary), returning the number selected, 
+   and setting the first elements of SYMS items.  Error if no symbols
+   selected.  */
 
 /* NOTE: Adapted from decode_line_2 in symtab.c, with which it ought
-   to be re-integrated one of these days. */
+   to be re-integrated one of these days.  */
 
 int
-user_select_syms (struct symbol *syms[], struct block *blocks[], int nsyms,
-		  int max_results)
+user_select_syms (struct ada_symbol_info *syms, int nsyms, int max_results)
 {
   int i;
   int *chosen = (int *) alloca (sizeof (int) * nsyms);
@@ -2606,94 +3137,91 @@
   if (max_results > 1)
     printf_unfiltered ("[1] all\n");
 
-  sort_choices (syms, blocks, nsyms);
+  sort_choices (syms, nsyms);
 
   for (i = 0; i < nsyms; i += 1)
     {
-      if (syms[i] == NULL)
-	continue;
+      if (syms[i].sym == NULL)
+        continue;
 
-      if (SYMBOL_CLASS (syms[i]) == LOC_BLOCK)
-	{
-	  struct symtab_and_line sal = find_function_start_sal (syms[i], 1);
-	  printf_unfiltered ("[%d] %s at %s:%d\n",
-			     i + first_choice,
-			     SYMBOL_PRINT_NAME (syms[i]),
-			     sal.symtab == NULL
-			     ? "<no source file available>"
-			     : sal.symtab->filename, sal.line);
-	  continue;
-	}
+      if (SYMBOL_CLASS (syms[i].sym) == LOC_BLOCK)
+        {
+          struct symtab_and_line sal =
+            find_function_start_sal (syms[i].sym, 1);
+          printf_unfiltered ("[%d] %s at %s:%d\n", i + first_choice,
+                             SYMBOL_PRINT_NAME (syms[i].sym),
+                             (sal.symtab == NULL
+                              ? "<no source file available>"
+                              : sal.symtab->filename), sal.line);
+          continue;
+        }
       else
-	{
-	  int is_enumeral =
-	    (SYMBOL_CLASS (syms[i]) == LOC_CONST
-	     && SYMBOL_TYPE (syms[i]) != NULL
-	     && TYPE_CODE (SYMBOL_TYPE (syms[i])) == TYPE_CODE_ENUM);
-	  struct symtab *symtab = symtab_for_sym (syms[i]);
+        {
+          int is_enumeral =
+            (SYMBOL_CLASS (syms[i].sym) == LOC_CONST
+             && SYMBOL_TYPE (syms[i].sym) != NULL
+             && TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) == TYPE_CODE_ENUM);
+          struct symtab *symtab = symtab_for_sym (syms[i].sym);
 
-	  if (SYMBOL_LINE (syms[i]) != 0 && symtab != NULL)
-	    printf_unfiltered ("[%d] %s at %s:%d\n",
-			       i + first_choice,
-			       SYMBOL_PRINT_NAME (syms[i]),
-			       symtab->filename, SYMBOL_LINE (syms[i]));
-	  else if (is_enumeral && TYPE_NAME (SYMBOL_TYPE (syms[i])) != NULL)
-	    {
-	      printf_unfiltered ("[%d] ", i + first_choice);
-	      ada_print_type (SYMBOL_TYPE (syms[i]), NULL, gdb_stdout, -1, 0);
-	      printf_unfiltered ("'(%s) (enumeral)\n",
-				 SYMBOL_PRINT_NAME (syms[i]));
-	    }
-	  else if (symtab != NULL)
-	    printf_unfiltered (is_enumeral
-			       ? "[%d] %s in %s (enumeral)\n"
-			       : "[%d] %s at %s:?\n",
-			       i + first_choice,
-			       SYMBOL_PRINT_NAME (syms[i]),
-			       symtab->filename);
-	  else
-	    printf_unfiltered (is_enumeral
-			       ? "[%d] %s (enumeral)\n"
-			       : "[%d] %s at ?\n",
-			       i + first_choice,
-			       SYMBOL_PRINT_NAME (syms[i]));
-	}
+          if (SYMBOL_LINE (syms[i].sym) != 0 && symtab != NULL)
+            printf_unfiltered ("[%d] %s at %s:%d\n",
+                               i + first_choice,
+                               SYMBOL_PRINT_NAME (syms[i].sym),
+                               symtab->filename, SYMBOL_LINE (syms[i].sym));
+          else if (is_enumeral
+                   && TYPE_NAME (SYMBOL_TYPE (syms[i].sym)) != NULL)
+            {
+              printf_unfiltered ("[%d] ", i + first_choice);
+              ada_print_type (SYMBOL_TYPE (syms[i].sym), NULL,
+                              gdb_stdout, -1, 0);
+              printf_unfiltered ("'(%s) (enumeral)\n",
+                                 SYMBOL_PRINT_NAME (syms[i].sym));
+            }
+          else if (symtab != NULL)
+            printf_unfiltered (is_enumeral
+                               ? "[%d] %s in %s (enumeral)\n"
+                               : "[%d] %s at %s:?\n",
+                               i + first_choice,
+                               SYMBOL_PRINT_NAME (syms[i].sym),
+                               symtab->filename);
+          else
+            printf_unfiltered (is_enumeral
+                               ? "[%d] %s (enumeral)\n"
+                               : "[%d] %s at ?\n",
+                               i + first_choice,
+                               SYMBOL_PRINT_NAME (syms[i].sym));
+        }
     }
 
   n_chosen = get_selections (chosen, nsyms, max_results, max_results > 1,
-			     "overload-choice");
+                             "overload-choice");
 
   for (i = 0; i < n_chosen; i += 1)
-    {
-      syms[i] = syms[chosen[i]];
-      if (blocks != NULL)
-	blocks[i] = blocks[chosen[i]];
-    }
+    syms[i] = syms[chosen[i]];
 
   return n_chosen;
 }
 
 /* Read and validate a set of numeric choices from the user in the
-   range 0 .. N_CHOICES-1. Place the results in increasing
+   range 0 .. N_CHOICES-1.  Place the results in increasing
    order in CHOICES[0 .. N-1], and return N.
 
    The user types choices as a sequence of numbers on one line
    separated by blanks, encoding them as follows:
 
-     + A choice of 0 means to cancel the selection, throwing an error.  
+     + A choice of 0 means to cancel the selection, throwing an error.
      + If IS_ALL_CHOICE, a choice of 1 selects the entire set 0 .. N_CHOICES-1.
      + The user chooses k by typing k+IS_ALL_CHOICE+1.
 
-   The user is not allowed to choose more than MAX_RESULTS values. 
+   The user is not allowed to choose more than MAX_RESULTS values.
 
    ANNOTATION_SUFFIX, if present, is used to annotate the input
-   prompts (for use with the -f switch). */
+   prompts (for use with the -f switch).  */
 
 int
 get_selections (int *choices, int n_choices, int max_results,
-		int is_all_choice, char *annotation_suffix)
+                int is_all_choice, char *annotation_suffix)
 {
-  int i;
   char *args;
   const char *prompt;
   int n_chosen;
@@ -2713,50 +3241,50 @@
 
   n_chosen = 0;
 
-  /* Set choices[0 .. n_chosen-1] to the users' choices in ascending 
-     order, as given in args.   Choices are validated. */
+  /* Set choices[0 .. n_chosen-1] to the users' choices in ascending
+     order, as given in args.  Choices are validated.  */
   while (1)
     {
       char *args2;
       int choice, j;
 
       while (isspace (*args))
-	args += 1;
+        args += 1;
       if (*args == '\0' && n_chosen == 0)
-	error_no_arg ("one or more choice numbers");
+        error_no_arg ("one or more choice numbers");
       else if (*args == '\0')
-	break;
+        break;
 
       choice = strtol (args, &args2, 10);
       if (args == args2 || choice < 0
-	  || choice > n_choices + first_choice - 1)
-	error ("Argument must be choice number");
+          || choice > n_choices + first_choice - 1)
+        error ("Argument must be choice number");
       args = args2;
 
       if (choice == 0)
-	error ("cancelled");
+        error ("cancelled");
 
       if (choice < first_choice)
-	{
-	  n_chosen = n_choices;
-	  for (j = 0; j < n_choices; j += 1)
-	    choices[j] = j;
-	  break;
-	}
+        {
+          n_chosen = n_choices;
+          for (j = 0; j < n_choices; j += 1)
+            choices[j] = j;
+          break;
+        }
       choice -= first_choice;
 
       for (j = n_chosen - 1; j >= 0 && choice < choices[j]; j -= 1)
-	{
-	}
+        {
+        }
 
       if (j < 0 || choice != choices[j])
-	{
-	  int k;
-	  for (k = n_chosen - 1; k > j; k -= 1)
-	    choices[k + 1] = choices[k];
-	  choices[j + 1] = choice;
-	  n_chosen += 1;
-	}
+        {
+          int k;
+          for (k = n_chosen - 1; k > j; k -= 1)
+            choices[k + 1] = choices[k];
+          choices[j + 1] = choice;
+          n_chosen += 1;
+        }
     }
 
   if (n_chosen > max_results)
@@ -2765,27 +3293,27 @@
   return n_chosen;
 }
 
-/* Replace the operator of length OPLEN at position PC in *EXPP with a call */
-/* on the function identified by SYM and BLOCK, and taking NARGS */
-/* arguments.  Update *EXPP as needed to hold more space. */
+/* Replace the operator of length OPLEN at position PC in *EXPP with a call
+   on the function identified by SYM and BLOCK, and taking NARGS
+   arguments.  Update *EXPP as needed to hold more space.  */
 
 static void
 replace_operator_with_call (struct expression **expp, int pc, int nargs,
-			    int oplen, struct symbol *sym,
-			    struct block *block)
+                            int oplen, struct symbol *sym,
+                            struct block *block)
 {
   /* A new expression, with 6 more elements (3 for funcall, 4 for function
-     symbol, -oplen for operator being replaced). */
+     symbol, -oplen for operator being replaced).  */
   struct expression *newexp = (struct expression *)
     xmalloc (sizeof (struct expression)
-	     + EXP_ELEM_TO_BYTES ((*expp)->nelts + 7 - oplen));
+             + EXP_ELEM_TO_BYTES ((*expp)->nelts + 7 - oplen));
   struct expression *exp = *expp;
 
   newexp->nelts = exp->nelts + 7 - oplen;
   newexp->language_defn = exp->language_defn;
   memcpy (newexp->elts, exp->elts, EXP_ELEM_TO_BYTES (pc));
   memcpy (newexp->elts + pc + 7, exp->elts + pc + oplen,
-	  EXP_ELEM_TO_BYTES (exp->nelts - pc - oplen));
+          EXP_ELEM_TO_BYTES (exp->nelts - pc - oplen));
 
   newexp->elts[pc].opcode = newexp->elts[pc + 2].opcode = OP_FUNCALL;
   newexp->elts[pc + 1].longconst = (LONGEST) nargs;
@@ -2800,8 +3328,8 @@
 
 /* Type-class predicates */
 
-/* True iff TYPE is numeric (i.e., an INT, RANGE (of numeric type), or */
-/* FLOAT.) */
+/* True iff TYPE is numeric (i.e., an INT, RANGE (of numeric type),
+   or FLOAT).  */
 
 static int
 numeric_type_p (struct type *type)
@@ -2811,20 +3339,20 @@
   else
     {
       switch (TYPE_CODE (type))
-	{
-	case TYPE_CODE_INT:
-	case TYPE_CODE_FLT:
-	  return 1;
-	case TYPE_CODE_RANGE:
-	  return (type == TYPE_TARGET_TYPE (type)
-		  || numeric_type_p (TYPE_TARGET_TYPE (type)));
-	default:
-	  return 0;
-	}
+        {
+        case TYPE_CODE_INT:
+        case TYPE_CODE_FLT:
+          return 1;
+        case TYPE_CODE_RANGE:
+          return (type == TYPE_TARGET_TYPE (type)
+                  || numeric_type_p (TYPE_TARGET_TYPE (type)));
+        default:
+          return 0;
+        }
     }
 }
 
-/* True iff TYPE is integral (an INT or RANGE of INTs). */
+/* True iff TYPE is integral (an INT or RANGE of INTs).  */
 
 static int
 integer_type_p (struct type *type)
@@ -2834,19 +3362,19 @@
   else
     {
       switch (TYPE_CODE (type))
-	{
-	case TYPE_CODE_INT:
-	  return 1;
-	case TYPE_CODE_RANGE:
-	  return (type == TYPE_TARGET_TYPE (type)
-		  || integer_type_p (TYPE_TARGET_TYPE (type)));
-	default:
-	  return 0;
-	}
+        {
+        case TYPE_CODE_INT:
+          return 1;
+        case TYPE_CODE_RANGE:
+          return (type == TYPE_TARGET_TYPE (type)
+                  || integer_type_p (TYPE_TARGET_TYPE (type)));
+        default:
+          return 0;
+        }
     }
 }
 
-/* True iff TYPE is scalar (INT, RANGE, FLOAT, ENUM). */
+/* True iff TYPE is scalar (INT, RANGE, FLOAT, ENUM).  */
 
 static int
 scalar_type_p (struct type *type)
@@ -2856,19 +3384,19 @@
   else
     {
       switch (TYPE_CODE (type))
-	{
-	case TYPE_CODE_INT:
-	case TYPE_CODE_RANGE:
-	case TYPE_CODE_ENUM:
-	case TYPE_CODE_FLT:
-	  return 1;
-	default:
-	  return 0;
-	}
+        {
+        case TYPE_CODE_INT:
+        case TYPE_CODE_RANGE:
+        case TYPE_CODE_ENUM:
+        case TYPE_CODE_FLT:
+          return 1;
+        default:
+          return 0;
+        }
     }
 }
 
-/* True iff TYPE is discrete (INT, RANGE, ENUM). */
+/* True iff TYPE is discrete (INT, RANGE, ENUM).  */
 
 static int
 discrete_type_p (struct type *type)
@@ -2878,28 +3406,32 @@
   else
     {
       switch (TYPE_CODE (type))
-	{
-	case TYPE_CODE_INT:
-	case TYPE_CODE_RANGE:
-	case TYPE_CODE_ENUM:
-	  return 1;
-	default:
-	  return 0;
-	}
+        {
+        case TYPE_CODE_INT:
+        case TYPE_CODE_RANGE:
+        case TYPE_CODE_ENUM:
+          return 1;
+        default:
+          return 0;
+        }
     }
 }
 
-/* Returns non-zero if OP with operatands in the vector ARGS could be
-   a user-defined function. Errs on the side of pre-defined operators
-   (i.e., result 0). */
+/* Returns non-zero if OP with operands in the vector ARGS could be
+   a user-defined function.  Errs on the side of pre-defined operators
+   (i.e., result 0).  */
 
 static int
 possible_user_operator_p (enum exp_opcode op, struct value *args[])
 {
-  struct type *type0 = check_typedef (VALUE_TYPE (args[0]));
+  struct type *type0 =
+    (args[0] == NULL) ? NULL : check_typedef (VALUE_TYPE (args[0]));
   struct type *type1 =
     (args[1] == NULL) ? NULL : check_typedef (VALUE_TYPE (args[1]));
 
+  if (type0 == NULL)
+    return 0;
+
   switch (op)
     {
     default:
@@ -2927,13 +3459,14 @@
       return (!(scalar_type_p (type0) && scalar_type_p (type1)));
 
     case BINOP_CONCAT:
-      return ((TYPE_CODE (type0) != TYPE_CODE_ARRAY &&
-	       (TYPE_CODE (type0) != TYPE_CODE_PTR ||
-		TYPE_CODE (TYPE_TARGET_TYPE (type0))
-		!= TYPE_CODE_ARRAY))
-	      || (TYPE_CODE (type1) != TYPE_CODE_ARRAY &&
-		  (TYPE_CODE (type1) != TYPE_CODE_PTR ||
-		   TYPE_CODE (TYPE_TARGET_TYPE (type1)) != TYPE_CODE_ARRAY)));
+      return
+        ((TYPE_CODE (type0) != TYPE_CODE_ARRAY
+          && (TYPE_CODE (type0) != TYPE_CODE_PTR
+              || TYPE_CODE (TYPE_TARGET_TYPE (type0)) != TYPE_CODE_ARRAY))
+         || (TYPE_CODE (type1) != TYPE_CODE_ARRAY
+             && (TYPE_CODE (type1) != TYPE_CODE_PTR
+                 || (TYPE_CODE (TYPE_TARGET_TYPE (type1)) 
+		     != TYPE_CODE_ARRAY))));
 
     case BINOP_EXP:
       return (!(numeric_type_p (type0) && integer_type_p (type1)));
@@ -2947,16 +3480,17 @@
     }
 }
 
-				/* Renaming */
+                                /* Renaming */
 
-/** NOTE: In the following, we assume that a renaming type's name may
- *  have an ___XD suffix.  It would be nice if this went away at some
- *  point. */
+/* NOTE: In the following, we assume that a renaming type's name may
+   have an ___XD suffix.  It would be nice if this went away at some
+   point.  */
 
 /* If TYPE encodes a renaming, returns the renaming suffix, which
- * is XR for an object renaming, XRP for a procedure renaming, XRE for
- * an exception renaming, and XRS for a subprogram renaming.  Returns
- * NULL if NAME encodes none of these. */
+   is XR for an object renaming, XRP for a procedure renaming, XRE for
+   an exception renaming, and XRS for a subprogram renaming.  Returns
+   NULL if NAME encodes none of these.  */
+
 const char *
 ada_renaming_type (struct type *type)
 {
@@ -2965,16 +3499,17 @@
       const char *name = type_name_no_tag (type);
       const char *suffix = (name == NULL) ? NULL : strstr (name, "___XR");
       if (suffix == NULL
-	  || (suffix[5] != '\000' && strchr ("PES_", suffix[5]) == NULL))
-	return NULL;
+          || (suffix[5] != '\000' && strchr ("PES_", suffix[5]) == NULL))
+        return NULL;
       else
-	return suffix + 3;
+        return suffix + 3;
     }
   else
     return NULL;
 }
 
-/* Return non-zero iff SYM encodes an object renaming. */
+/* Return non-zero iff SYM encodes an object renaming.  */
+
 int
 ada_is_object_renaming (struct symbol *sym)
 {
@@ -2984,9 +3519,10 @@
 }
 
 /* Assuming that SYM encodes a non-object renaming, returns the original
- * name of the renamed entity.   The name is good until the end of
- * parsing. */
-const char *
+   name of the renamed entity.  The name is good until the end of
+   parsing.  */
+
+char *
 ada_simple_renamed_entity (struct symbol *sym)
 {
   struct type *type;
@@ -3004,38 +3540,52 @@
     error ("Improperly encoded renaming.");
 
   result = xmalloc (len + 1);
-  /* FIXME: add_name_string_cleanup should be defined in parse.c */
-  /*  add_name_string_cleanup (result); */
   strncpy (result, raw_name, len);
   result[len] = '\000';
   return result;
 }
 
 
-				/* Evaluation: Function Calls */
+                                /* Evaluation: Function Calls */
 
-/* Copy VAL onto the stack, using and updating *SP as the stack 
-   pointer. Return VAL as an lvalue. */
+/* Return an lvalue containing the value VAL.  This is the identity on
+   lvalues, and otherwise has the side-effect of pushing a copy of VAL 
+   on the stack, using and updating *SP as the stack pointer, and 
+   returning an lvalue whose VALUE_ADDRESS points to the copy.  */
 
 static struct value *
-place_on_stack (struct value *val, CORE_ADDR *sp)
+ensure_lval (struct value *val, CORE_ADDR *sp)
 {
-  CORE_ADDR old_sp = *sp;
+  if (! VALUE_LVAL (val))
+    {
+      int len = TYPE_LENGTH (check_typedef (VALUE_TYPE (val)));
 
-#ifdef DEPRECATED_STACK_ALIGN
-  *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val),
-		    DEPRECATED_STACK_ALIGN (TYPE_LENGTH
-				 (check_typedef (VALUE_TYPE (val)))));
-#else
-  *sp = push_bytes (*sp, VALUE_CONTENTS_RAW (val),
-		    TYPE_LENGTH (check_typedef (VALUE_TYPE (val))));
-#endif
+      /* The following is taken from the structure-return code in
+	 call_function_by_hand. FIXME: Therefore, some refactoring seems 
+	 indicated. */
+      if (INNER_THAN (1, 2))
+	{
+	  /* Stack grows downward.  Align SP and VALUE_ADDRESS (val) after
+	     reserving sufficient space. */
+	  *sp -= len;
+	  if (gdbarch_frame_align_p (current_gdbarch))
+	    *sp = gdbarch_frame_align (current_gdbarch, *sp);
+	  VALUE_ADDRESS (val) = *sp;
+	}
+      else
+	{
+	  /* Stack grows upward.  Align the frame, allocate space, and
+	     then again, re-align the frame. */
+	  if (gdbarch_frame_align_p (current_gdbarch))
+	    *sp = gdbarch_frame_align (current_gdbarch, *sp);
+	  VALUE_ADDRESS (val) = *sp;
+	  *sp += len;
+	  if (gdbarch_frame_align_p (current_gdbarch))
+	    *sp = gdbarch_frame_align (current_gdbarch, *sp);
+	}
 
-  VALUE_LVAL (val) = lval_memory;
-  if (INNER_THAN (1, 2))
-    VALUE_ADDRESS (val) = *sp;
-  else
-    VALUE_ADDRESS (val) = old_sp;
+      write_memory (VALUE_ADDRESS (val), VALUE_CONTENTS_RAW (val), len);
+    }
 
   return val;
 }
@@ -3043,11 +3593,11 @@
 /* Return the value ACTUAL, converted to be an appropriate value for a
    formal of type FORMAL_TYPE.  Use *SP as a stack pointer for
    allocating any necessary descriptors (fat pointers), or copies of
-   values not residing in memory, updating it as needed. */
+   values not residing in memory, updating it as needed.  */
 
 static struct value *
 convert_actual (struct value *actual, struct type *formal_type0,
-		CORE_ADDR *sp)
+                CORE_ADDR *sp)
 {
   struct type *actual_type = check_typedef (VALUE_TYPE (actual));
   struct type *formal_type = check_typedef (formal_type0);
@@ -3058,28 +3608,28 @@
     TYPE_CODE (actual_type) == TYPE_CODE_PTR
     ? check_typedef (TYPE_TARGET_TYPE (actual_type)) : actual_type;
 
-  if (ada_is_array_descriptor (formal_target)
+  if (ada_is_array_descriptor_type (formal_target)
       && TYPE_CODE (actual_target) == TYPE_CODE_ARRAY)
     return make_array_descriptor (formal_type, actual, sp);
   else if (TYPE_CODE (formal_type) == TYPE_CODE_PTR)
     {
       if (TYPE_CODE (formal_target) == TYPE_CODE_ARRAY
-	  && ada_is_array_descriptor (actual_target))
-	return desc_data (actual);
+          && ada_is_array_descriptor_type (actual_target))
+        return desc_data (actual);
       else if (TYPE_CODE (actual_type) != TYPE_CODE_PTR)
-	{
-	  if (VALUE_LVAL (actual) != lval_memory)
-	    {
-	      struct value *val;
-	      actual_type = check_typedef (VALUE_TYPE (actual));
-	      val = allocate_value (actual_type);
-	      memcpy ((char *) VALUE_CONTENTS_RAW (val),
-		      (char *) VALUE_CONTENTS (actual),
-		      TYPE_LENGTH (actual_type));
-	      actual = place_on_stack (val, sp);
-	    }
-	  return value_addr (actual);
-	}
+        {
+          if (VALUE_LVAL (actual) != lval_memory)
+            {
+              struct value *val;
+              actual_type = check_typedef (VALUE_TYPE (actual));
+              val = allocate_value (actual_type);
+              memcpy ((char *) VALUE_CONTENTS_RAW (val),
+                      (char *) VALUE_CONTENTS (actual),
+                      TYPE_LENGTH (actual_type));
+              actual = ensure_lval (val, sp);
+            }
+          return value_addr (actual);
+        }
     }
   else if (TYPE_CODE (actual_type) == TYPE_CODE_PTR)
     return ada_value_ind (actual);
@@ -3088,11 +3638,11 @@
 }
 
 
-/* Push a descriptor of type TYPE for array value ARR on the stack at 
-   *SP, updating *SP to reflect the new descriptor.  Return either 
+/* Push a descriptor of type TYPE for array value ARR on the stack at
+   *SP, updating *SP to reflect the new descriptor.  Return either
    an lvalue representing the new descriptor, or (if TYPE is a pointer-
-   to-descriptor type rather than a descriptor type), a struct value*
-   representing a pointer to this descriptor. */
+   to-descriptor type rather than a descriptor type), a struct value *
+   representing a pointer to this descriptor.  */
 
 static struct value *
 make_array_descriptor (struct type *type, struct value *arr, CORE_ADDR *sp)
@@ -3101,33 +3651,33 @@
   struct type *desc_type = desc_base_type (type);
   struct value *descriptor = allocate_value (desc_type);
   struct value *bounds = allocate_value (bounds_type);
-  CORE_ADDR bounds_addr;
   int i;
 
   for (i = ada_array_arity (check_typedef (VALUE_TYPE (arr))); i > 0; i -= 1)
     {
       modify_general_field (VALUE_CONTENTS (bounds),
-			    value_as_long (ada_array_bound (arr, i, 0)),
-			    desc_bound_bitpos (bounds_type, i, 0),
-			    desc_bound_bitsize (bounds_type, i, 0));
+                            value_as_long (ada_array_bound (arr, i, 0)),
+                            desc_bound_bitpos (bounds_type, i, 0),
+                            desc_bound_bitsize (bounds_type, i, 0));
       modify_general_field (VALUE_CONTENTS (bounds),
-			    value_as_long (ada_array_bound (arr, i, 1)),
-			    desc_bound_bitpos (bounds_type, i, 1),
-			    desc_bound_bitsize (bounds_type, i, 1));
+                            value_as_long (ada_array_bound (arr, i, 1)),
+                            desc_bound_bitpos (bounds_type, i, 1),
+                            desc_bound_bitsize (bounds_type, i, 1));
     }
 
-  bounds = place_on_stack (bounds, sp);
+  bounds = ensure_lval (bounds, sp);
 
   modify_general_field (VALUE_CONTENTS (descriptor),
-			arr,
-			fat_pntr_data_bitpos (desc_type),
-			fat_pntr_data_bitsize (desc_type));
-  modify_general_field (VALUE_CONTENTS (descriptor),
-			VALUE_ADDRESS (bounds),
-			fat_pntr_bounds_bitpos (desc_type),
-			fat_pntr_bounds_bitsize (desc_type));
+                        VALUE_ADDRESS (ensure_lval (arr, sp)),
+                        fat_pntr_data_bitpos (desc_type),
+                        fat_pntr_data_bitsize (desc_type));
 
-  descriptor = place_on_stack (descriptor, sp);
+  modify_general_field (VALUE_CONTENTS (descriptor),
+                        VALUE_ADDRESS (bounds),
+                        fat_pntr_bounds_bitpos (desc_type),
+                        fat_pntr_bounds_bitsize (desc_type));
+
+  descriptor = ensure_lval (descriptor, sp);
 
   if (TYPE_CODE (type) == TYPE_CODE_PTR)
     return value_addr (descriptor);
@@ -3136,17 +3686,17 @@
 }
 
 
-/* Assuming a dummy frame has been established on the target, perform any 
+/* Assuming a dummy frame has been established on the target, perform any
    conversions needed for calling function FUNC on the NARGS actual
-   parameters in ARGS, other than standard C conversions.   Does
+   parameters in ARGS, other than standard C conversions.  Does
    nothing if FUNC does not have Ada-style prototype data, or if NARGS
-   does not match the number of arguments expected.   Use *SP as a
+   does not match the number of arguments expected.  Use *SP as a
    stack pointer for additional data that must be pushed, updating its
-   value as needed. */
+   value as needed.  */
 
 void
 ada_convert_actuals (struct value *func, int nargs, struct value *args[],
-		     CORE_ADDR *sp)
+                     CORE_ADDR *sp)
 {
   int i;
 
@@ -3159,52 +3709,162 @@
       convert_actual (args[i], TYPE_FIELD_TYPE (VALUE_TYPE (func), i), sp);
 }
 
+                                /* Experimental Symbol Cache Module */
 
-				/* Symbol Lookup */
+/* This module may well have been OBE, due to improvements in the 
+   symbol-table module.  So until proven otherwise, it is disabled in
+   the submitted public code, and may be removed from all sources
+   in the future. */
 
+#ifdef GNAT_GDB
 
-/* The vectors of symbols and blocks ultimately returned from */
-/* ada_lookup_symbol_list. */
+/* This section implements a simple, fixed-sized hash table for those
+   Ada-mode symbols that get looked up in the course of executing the user's
+   commands.  The size is fixed on the grounds that there are not
+   likely to be all that many symbols looked up during any given
+   session, regardless of the size of the symbol table.  If we decide
+   to go to a resizable table, let's just use the stuff from libiberty
+   instead.  */
 
-/* Current size of defn_symbols and defn_blocks */
-static size_t defn_vector_size = 0;
+#define HASH_SIZE 1009
 
-/* Current number of symbols found. */
-static int ndefns = 0;
+struct cache_entry
+{
+  const char *name;
+  domain_enum namespace;
+  struct symbol *sym;
+  struct symtab *symtab;
+  struct block *block;
+  struct cache_entry *next;
+};
 
-static struct symbol **defn_symbols = NULL;
-static struct block **defn_blocks = NULL;
+static struct obstack cache_space;
 
-/* Return the result of a standard (literal, C-like) lookup of NAME in 
- * given DOMAIN. */
+static struct cache_entry *cache[HASH_SIZE];
+
+/* Clear all entries from the symbol cache.  */
+
+void
+clear_ada_sym_cache (void)
+{
+  obstack_free (&cache_space, NULL);
+  obstack_init (&cache_space);
+  memset (cache, '\000', sizeof (cache));
+}
+
+static struct cache_entry **
+find_entry (const char *name, domain_enum namespace)
+{
+  int h = msymbol_hash (name) % HASH_SIZE;
+  struct cache_entry **e;
+  for (e = &cache[h]; *e != NULL; e = &(*e)->next)
+    {
+      if (namespace == (*e)->namespace && strcmp (name, (*e)->name) == 0)
+        return e;
+    }
+  return NULL;
+}
+
+/* Return (in SYM) the last cached definition for global or static symbol NAME
+   in namespace DOMAIN.  Returns 1 if entry found, 0 otherwise.
+   If SYMTAB is non-NULL, store the symbol
+   table in which the symbol was found there, or NULL if not found.
+   *BLOCK is set to the block in which NAME is found.  */
+
+static int
+lookup_cached_symbol (const char *name, domain_enum namespace,
+                      struct symbol **sym, struct block **block,
+                      struct symtab **symtab)
+{
+  struct cache_entry **e = find_entry (name, namespace);
+  if (e == NULL)
+    return 0;
+  if (sym != NULL)
+    *sym = (*e)->sym;
+  if (block != NULL)
+    *block = (*e)->block;
+  if (symtab != NULL)
+    *symtab = (*e)->symtab;
+  return 1;
+}
+
+/* Set the cached definition of NAME in DOMAIN to SYM in block
+   BLOCK and symbol table SYMTAB.  */
+
+static void
+cache_symbol (const char *name, domain_enum namespace, struct symbol *sym,
+              struct block *block, struct symtab *symtab)
+{
+  int h = msymbol_hash (name) % HASH_SIZE;
+  char *copy;
+  struct cache_entry *e =
+    (struct cache_entry *) obstack_alloc (&cache_space, sizeof (*e));
+  e->next = cache[h];
+  cache[h] = e;
+  e->name = copy = obstack_alloc (&cache_space, strlen (name) + 1);
+  strcpy (copy, name);
+  e->sym = sym;
+  e->namespace = namespace;
+  e->symtab = symtab;
+  e->block = block;
+}
+
+#else
+static int
+lookup_cached_symbol (const char *name, domain_enum namespace,
+                      struct symbol **sym, struct block **block,
+                      struct symtab **symtab)
+{
+  return 0;
+}
+
+static void
+cache_symbol (const char *name, domain_enum namespace, struct symbol *sym,
+              struct block *block, struct symtab *symtab)
+{
+}
+#endif /* GNAT_GDB */
+
+                                /* Symbol Lookup */
+
+/* Return the result of a standard (literal, C-like) lookup of NAME in
+   given DOMAIN, visible from lexical block BLOCK.  */
 
 static struct symbol *
-standard_lookup (const char *name, domain_enum domain)
+standard_lookup (const char *name, const struct block *block,
+                 domain_enum domain)
 {
   struct symbol *sym;
-  sym = lookup_symbol (name, (struct block *) NULL, domain, 0, NULL);
+  struct symtab *symtab;
+
+  if (lookup_cached_symbol (name, domain, &sym, NULL, NULL))
+    return sym;
+  sym =
+    lookup_symbol_in_language (name, block, domain, language_c, 0, &symtab);
+  cache_symbol (name, domain, sym, block_found, symtab);
   return sym;
 }
 
 
-/* Non-zero iff there is at least one non-function/non-enumeral symbol */
-/* in SYMS[0..N-1].  We treat enumerals as functions, since they */
-/* contend in overloading in the same way. */
+/* Non-zero iff there is at least one non-function/non-enumeral symbol
+   in the symbol fields of SYMS[0..N-1].  We treat enumerals as functions, 
+   since they contend in overloading in the same way.  */
 static int
-is_nonfunction (struct symbol *syms[], int n)
+is_nonfunction (struct ada_symbol_info syms[], int n)
 {
   int i;
 
   for (i = 0; i < n; i += 1)
-    if (TYPE_CODE (SYMBOL_TYPE (syms[i])) != TYPE_CODE_FUNC
-	&& TYPE_CODE (SYMBOL_TYPE (syms[i])) != TYPE_CODE_ENUM)
+    if (TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) != TYPE_CODE_FUNC
+        && (TYPE_CODE (SYMBOL_TYPE (syms[i].sym)) != TYPE_CODE_ENUM
+            || SYMBOL_CLASS (syms[i].sym) != LOC_CONST))
       return 1;
 
   return 0;
 }
 
 /* If true (non-zero), then TYPE0 and TYPE1 represent equivalent
-   struct types.  Otherwise, they may not. */
+   struct types.  Otherwise, they may not.  */
 
 static int
 equiv_types (struct type *type0, struct type *type1)
@@ -3217,14 +3877,14 @@
   if ((TYPE_CODE (type0) == TYPE_CODE_STRUCT
        || TYPE_CODE (type0) == TYPE_CODE_ENUM)
       && ada_type_name (type0) != NULL && ada_type_name (type1) != NULL
-      && DEPRECATED_STREQ (ada_type_name (type0), ada_type_name (type1)))
+      && strcmp (ada_type_name (type0), ada_type_name (type1)) == 0)
     return 1;
 
   return 0;
 }
 
 /* True iff SYM0 represents the same entity as SYM1, or one that is
-   no more defined than that of SYM1. */
+   no more defined than that of SYM1.  */
 
 static int
 lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
@@ -3241,65 +3901,91 @@
       return 1;
     case LOC_TYPEDEF:
       {
-	struct type *type0 = SYMBOL_TYPE (sym0);
-	struct type *type1 = SYMBOL_TYPE (sym1);
-	char *name0 = DEPRECATED_SYMBOL_NAME (sym0);
-	char *name1 = DEPRECATED_SYMBOL_NAME (sym1);
-	int len0 = strlen (name0);
-	return
-	  TYPE_CODE (type0) == TYPE_CODE (type1)
-	  && (equiv_types (type0, type1)
-	      || (len0 < strlen (name1) && DEPRECATED_STREQN (name0, name1, len0)
-		  && DEPRECATED_STREQN (name1 + len0, "___XV", 5)));
+        struct type *type0 = SYMBOL_TYPE (sym0);
+        struct type *type1 = SYMBOL_TYPE (sym1);
+        char *name0 = SYMBOL_LINKAGE_NAME (sym0);
+        char *name1 = SYMBOL_LINKAGE_NAME (sym1);
+        int len0 = strlen (name0);
+        return
+          TYPE_CODE (type0) == TYPE_CODE (type1)
+          && (equiv_types (type0, type1)
+              || (len0 < strlen (name1) && strncmp (name0, name1, len0) == 0
+                  && strncmp (name1 + len0, "___XV", 5) == 0));
       }
     case LOC_CONST:
       return SYMBOL_VALUE (sym0) == SYMBOL_VALUE (sym1)
-	&& equiv_types (SYMBOL_TYPE (sym0), SYMBOL_TYPE (sym1));
+        && equiv_types (SYMBOL_TYPE (sym0), SYMBOL_TYPE (sym1));
     default:
       return 0;
     }
 }
 
-/* Append SYM to the end of defn_symbols, and BLOCK to the end of
-   defn_blocks, updating ndefns, and expanding defn_symbols and
-   defn_blocks as needed.   Do not include SYM if it is a duplicate.  */
+/* Append (SYM,BLOCK,SYMTAB) to the end of the array of struct ada_symbol_info
+   records in OBSTACKP.  Do nothing if SYM is a duplicate.  */
 
 static void
-add_defn_to_vec (struct symbol *sym, struct block *block)
+add_defn_to_vec (struct obstack *obstackp,
+                 struct symbol *sym,
+                 struct block *block, struct symtab *symtab)
 {
   int i;
   size_t tmp;
+  struct ada_symbol_info *prevDefns = defns_collected (obstackp, 0);
 
   if (SYMBOL_TYPE (sym) != NULL)
     CHECK_TYPEDEF (SYMBOL_TYPE (sym));
-  for (i = 0; i < ndefns; i += 1)
+  for (i = num_defns_collected (obstackp) - 1; i >= 0; i -= 1)
     {
-      if (lesseq_defined_than (sym, defn_symbols[i]))
-	return;
-      else if (lesseq_defined_than (defn_symbols[i], sym))
-	{
-	  defn_symbols[i] = sym;
-	  defn_blocks[i] = block;
-	  return;
-	}
+      if (lesseq_defined_than (sym, prevDefns[i].sym))
+        return;
+      else if (lesseq_defined_than (prevDefns[i].sym, sym))
+        {
+          prevDefns[i].sym = sym;
+          prevDefns[i].block = block;
+          prevDefns[i].symtab = symtab;
+          return;
+        }
     }
 
-  tmp = defn_vector_size;
-  GROW_VECT (defn_symbols, tmp, ndefns + 2);
-  GROW_VECT (defn_blocks, defn_vector_size, ndefns + 2);
+  {
+    struct ada_symbol_info info;
 
-  defn_symbols[ndefns] = sym;
-  defn_blocks[ndefns] = block;
-  ndefns += 1;
+    info.sym = sym;
+    info.block = block;
+    info.symtab = symtab;
+    obstack_grow (obstackp, &info, sizeof (struct ada_symbol_info));
+  }
 }
 
-/* Look, in partial_symtab PST, for symbol NAME in given domain.
-   Check the global symbols if GLOBAL, the static symbols if not.  Do
-   wild-card match if WILD. */
+/* Number of ada_symbol_info structures currently collected in 
+   current vector in *OBSTACKP.  */
+
+static int
+num_defns_collected (struct obstack *obstackp)
+{
+  return obstack_object_size (obstackp) / sizeof (struct ada_symbol_info);
+}
+
+/* Vector of ada_symbol_info structures currently collected in current 
+   vector in *OBSTACKP.  If FINISH, close off the vector and return
+   its final address.  */
+
+static struct ada_symbol_info *
+defns_collected (struct obstack *obstackp, int finish)
+{
+  if (finish)
+    return obstack_finish (obstackp);
+  else
+    return (struct ada_symbol_info *) obstack_base (obstackp);
+}
+
+/* Look, in partial_symtab PST, for symbol NAME in given namespace.
+   Check the global symbols if GLOBAL, the static symbols if not.
+   Do wild-card match if WILD.  */
 
 static struct partial_symbol *
 ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name,
-			   int global, domain_enum domain, int wild)
+                           int global, domain_enum namespace, int wild)
 {
   struct partial_symbol **start;
   int name_len = strlen (name);
@@ -3312,121 +3998,123 @@
     }
 
   start = (global ?
-	   pst->objfile->global_psymbols.list + pst->globals_offset :
-	   pst->objfile->static_psymbols.list + pst->statics_offset);
+           pst->objfile->global_psymbols.list + pst->globals_offset :
+           pst->objfile->static_psymbols.list + pst->statics_offset);
 
   if (wild)
     {
       for (i = 0; i < length; i += 1)
-	{
-	  struct partial_symbol *psym = start[i];
+        {
+          struct partial_symbol *psym = start[i];
 
-	  if (SYMBOL_DOMAIN (psym) == domain &&
-	      wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (psym)))
-	    return psym;
-	}
+          if (SYMBOL_DOMAIN (psym) == namespace
+              && wild_match (name, name_len, SYMBOL_LINKAGE_NAME (psym)))
+            return psym;
+        }
       return NULL;
     }
   else
     {
       if (global)
-	{
-	  int U;
-	  i = 0;
-	  U = length - 1;
-	  while (U - i > 4)
-	    {
-	      int M = (U + i) >> 1;
-	      struct partial_symbol *psym = start[M];
-	      if (DEPRECATED_SYMBOL_NAME (psym)[0] < name[0])
-		i = M + 1;
-	      else if (DEPRECATED_SYMBOL_NAME (psym)[0] > name[0])
-		U = M - 1;
-	      else if (strcmp (DEPRECATED_SYMBOL_NAME (psym), name) < 0)
-		i = M + 1;
-	      else
-		U = M;
-	    }
-	}
+        {
+          int U;
+          i = 0;
+          U = length - 1;
+          while (U - i > 4)
+            {
+              int M = (U + i) >> 1;
+              struct partial_symbol *psym = start[M];
+              if (SYMBOL_LINKAGE_NAME (psym)[0] < name[0])
+                i = M + 1;
+              else if (SYMBOL_LINKAGE_NAME (psym)[0] > name[0])
+                U = M - 1;
+              else if (strcmp (SYMBOL_LINKAGE_NAME (psym), name) < 0)
+                i = M + 1;
+              else
+                U = M;
+            }
+        }
       else
-	i = 0;
+        i = 0;
 
       while (i < length)
-	{
-	  struct partial_symbol *psym = start[i];
+        {
+          struct partial_symbol *psym = start[i];
 
-	  if (SYMBOL_DOMAIN (psym) == domain)
-	    {
-	      int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (psym), name_len);
+          if (SYMBOL_DOMAIN (psym) == namespace)
+            {
+              int cmp = strncmp (name, SYMBOL_LINKAGE_NAME (psym), name_len);
 
-	      if (cmp < 0)
-		{
-		  if (global)
-		    break;
-		}
-	      else if (cmp == 0
-		       && is_name_suffix (DEPRECATED_SYMBOL_NAME (psym) + name_len))
-		return psym;
-	    }
-	  i += 1;
-	}
+              if (cmp < 0)
+                {
+                  if (global)
+                    break;
+                }
+              else if (cmp == 0
+                       && is_name_suffix (SYMBOL_LINKAGE_NAME (psym)
+                                          + name_len))
+                return psym;
+            }
+          i += 1;
+        }
 
       if (global)
-	{
-	  int U;
-	  i = 0;
-	  U = length - 1;
-	  while (U - i > 4)
-	    {
-	      int M = (U + i) >> 1;
-	      struct partial_symbol *psym = start[M];
-	      if (DEPRECATED_SYMBOL_NAME (psym)[0] < '_')
-		i = M + 1;
-	      else if (DEPRECATED_SYMBOL_NAME (psym)[0] > '_')
-		U = M - 1;
-	      else if (strcmp (DEPRECATED_SYMBOL_NAME (psym), "_ada_") < 0)
-		i = M + 1;
-	      else
-		U = M;
-	    }
-	}
+        {
+          int U;
+          i = 0;
+          U = length - 1;
+          while (U - i > 4)
+            {
+              int M = (U + i) >> 1;
+              struct partial_symbol *psym = start[M];
+              if (SYMBOL_LINKAGE_NAME (psym)[0] < '_')
+                i = M + 1;
+              else if (SYMBOL_LINKAGE_NAME (psym)[0] > '_')
+                U = M - 1;
+              else if (strcmp (SYMBOL_LINKAGE_NAME (psym), "_ada_") < 0)
+                i = M + 1;
+              else
+                U = M;
+            }
+        }
       else
-	i = 0;
+        i = 0;
 
       while (i < length)
-	{
-	  struct partial_symbol *psym = start[i];
+        {
+          struct partial_symbol *psym = start[i];
 
-	  if (SYMBOL_DOMAIN (psym) == domain)
-	    {
-	      int cmp;
+          if (SYMBOL_DOMAIN (psym) == namespace)
+            {
+              int cmp;
 
-	      cmp = (int) '_' - (int) DEPRECATED_SYMBOL_NAME (psym)[0];
-	      if (cmp == 0)
-		{
-		  cmp = strncmp ("_ada_", DEPRECATED_SYMBOL_NAME (psym), 5);
-		  if (cmp == 0)
-		    cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (psym) + 5, name_len);
-		}
+              cmp = (int) '_' - (int) SYMBOL_LINKAGE_NAME (psym)[0];
+              if (cmp == 0)
+                {
+                  cmp = strncmp ("_ada_", SYMBOL_LINKAGE_NAME (psym), 5);
+                  if (cmp == 0)
+                    cmp = strncmp (name, SYMBOL_LINKAGE_NAME (psym) + 5,
+                                   name_len);
+                }
 
-	      if (cmp < 0)
-		{
-		  if (global)
-		    break;
-		}
-	      else if (cmp == 0
-		       && is_name_suffix (DEPRECATED_SYMBOL_NAME (psym) + name_len + 5))
-		return psym;
-	    }
-	  i += 1;
-	}
-
+              if (cmp < 0)
+                {
+                  if (global)
+                    break;
+                }
+              else if (cmp == 0
+                       && is_name_suffix (SYMBOL_LINKAGE_NAME (psym)
+                                          + name_len + 5))
+                return psym;
+            }
+          i += 1;
+        }
     }
   return NULL;
 }
 
-
 /* Find a symbol table containing symbol SYM or NULL if none.  */
+
 static struct symtab *
 symtab_for_sym (struct symbol *sym)
 {
@@ -3448,15 +4136,15 @@
       case LOC_LABEL:
       case LOC_BLOCK:
       case LOC_CONST_BYTES:
-	b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
-	ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
-	  return s;
-	b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
-	ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
-	  return s;
-	break;
+        b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
+        ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
+          return s;
+        b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
+        ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
+          return s;
+        break;
       default:
-	break;
+        break;
       }
     switch (SYMBOL_CLASS (sym))
       {
@@ -3472,160 +4160,212 @@
       case LOC_BASEREG_ARG:
       case LOC_COMPUTED:
       case LOC_COMPUTED_ARG:
-	for (j = FIRST_LOCAL_BLOCK;
-	     j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1)
-	  {
-	    b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), j);
-	    ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
-	      return s;
-	  }
-	break;
+        for (j = FIRST_LOCAL_BLOCK;
+             j < BLOCKVECTOR_NBLOCKS (BLOCKVECTOR (s)); j += 1)
+          {
+            b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), j);
+            ALL_BLOCK_SYMBOLS (b, iter, tmp_sym) if (sym == tmp_sym)
+              return s;
+          }
+        break;
       default:
-	break;
+        break;
       }
   }
   return NULL;
 }
 
-/* Return a minimal symbol matching NAME according to Ada demangling 
-   rules. Returns NULL if there is no such minimal symbol. */
+/* Return a minimal symbol matching NAME according to Ada decoding
+   rules.  Returns NULL if there is no such minimal symbol.  Names 
+   prefixed with "standard__" are handled specially: "standard__" is 
+   first stripped off, and only static and global symbols are searched.  */
 
 struct minimal_symbol *
-ada_lookup_minimal_symbol (const char *name)
+ada_lookup_simple_minsym (const char *name)
 {
   struct objfile *objfile;
   struct minimal_symbol *msymbol;
-  int wild_match = (strstr (name, "__") == NULL);
+  int wild_match;
+
+  if (strncmp (name, "standard__", sizeof ("standard__") - 1) == 0)
+    {
+      name += sizeof ("standard__") - 1;
+      wild_match = 0;
+    }
+  else
+    wild_match = (strstr (name, "__") == NULL);
 
   ALL_MSYMBOLS (objfile, msymbol)
   {
-    if (ada_match_name (DEPRECATED_SYMBOL_NAME (msymbol), name, wild_match)
-	&& MSYMBOL_TYPE (msymbol) != mst_solib_trampoline)
+    if (ada_match_name (SYMBOL_LINKAGE_NAME (msymbol), name, wild_match)
+        && MSYMBOL_TYPE (msymbol) != mst_solib_trampoline)
       return msymbol;
   }
 
   return NULL;
 }
 
-/* For all subprograms that statically enclose the subprogram of the
- * selected frame, add symbols matching identifier NAME in DOMAIN
- * and their blocks to vectors *defn_symbols and *defn_blocks, as for
- * ada_add_block_symbols (q.v.).   If WILD, treat as NAME with a
- * wildcard prefix.  At the moment, this function uses a heuristic to
- * find the frames of enclosing subprograms: it treats the
- * pointer-sized value at location 0 from the local-variable base of a
- * frame as a static link, and then searches up the call stack for a
- * frame with that same local-variable base. */
-static void
-add_symbols_from_enclosing_procs (const char *name, domain_enum domain,
-				  int wild_match)
+/* Return up minimal symbol for NAME, folded and encoded according to 
+   Ada conventions, or NULL if none.  The last two arguments are ignored.  */
+
+static struct minimal_symbol *
+ada_lookup_minimal_symbol (const char *name, const char *sfile,
+                           struct objfile *objf)
 {
-#ifdef i386
+  return ada_lookup_simple_minsym (ada_encode (name));
+}
+
+/* For all subprograms that statically enclose the subprogram of the
+   selected frame, add symbols matching identifier NAME in DOMAIN
+   and their blocks to the list of data in OBSTACKP, as for
+   ada_add_block_symbols (q.v.).   If WILD, treat as NAME with a
+   wildcard prefix.  */
+
+static void
+add_symbols_from_enclosing_procs (struct obstack *obstackp,
+                                  const char *name, domain_enum namespace,
+                                  int wild_match)
+{
+#ifdef HAVE_ADD_SYMBOLS_FROM_ENCLOSING_PROCS
+  /* Use a heuristic to find the frames of enclosing subprograms: treat the
+     pointer-sized value at location 0 from the local-variable base of a
+     frame as a static link, and then search up the call stack for a
+     frame with that same local-variable base.  */
   static struct symbol static_link_sym;
   static struct symbol *static_link;
+  struct value *target_link_val;
 
   struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
   struct frame_info *frame;
-  struct frame_info *target_frame;
+
+  if (!target_has_stack)
+    return;
 
   if (static_link == NULL)
     {
       /* Initialize the local variable symbol that stands for the
-       * static link (when it exists). */
+         static link (when there is one).  */
       static_link = &static_link_sym;
-      DEPRECATED_SYMBOL_NAME (static_link) = "";
+      SYMBOL_LINKAGE_NAME (static_link) = "";
       SYMBOL_LANGUAGE (static_link) = language_unknown;
       SYMBOL_CLASS (static_link) = LOC_LOCAL;
       SYMBOL_DOMAIN (static_link) = VAR_DOMAIN;
       SYMBOL_TYPE (static_link) = lookup_pointer_type (builtin_type_void);
       SYMBOL_VALUE (static_link) =
-	-(long) TYPE_LENGTH (SYMBOL_TYPE (static_link));
+        -(long) TYPE_LENGTH (SYMBOL_TYPE (static_link));
     }
 
-  frame = deprecated_selected_frame;
-  while (frame != NULL && ndefns == 0)
+  frame = get_selected_frame ();
+  if (frame == NULL || inside_main_func (get_frame_address_in_block (frame)))
+    return;
+
+  target_link_val = read_var_value (static_link, frame);
+  while (target_link_val != NULL
+         && num_defns_collected (obstackp) == 0
+         && frame_relative_level (frame) <= MAX_ENCLOSING_FRAME_LEVELS)
     {
-      struct block *block;
-      struct value *target_link_val = read_var_value (static_link, frame);
-      CORE_ADDR target_link;
+      CORE_ADDR target_link = value_as_address (target_link_val);
 
-      if (target_link_val == NULL)
-	break;
-      QUIT;
-
-      target_link = target_link_val;
-      do
-	{
-	  QUIT;
-	  frame = get_prev_frame (frame);
-	}
-      while (frame != NULL && DEPRECATED_FRAME_LOCALS_ADDRESS (frame) != target_link);
-
+      frame = get_prev_frame (frame);
       if (frame == NULL)
-	break;
+        break;
 
-      block = get_frame_block (frame, 0);
-      while (block != NULL && block_function (block) != NULL && ndefns == 0)
-	{
-	  ada_add_block_symbols (block, name, domain, NULL, wild_match);
+      if (get_frame_locals_address (frame) == target_link)
+        {
+          struct block *block;
 
-	  block = BLOCK_SUPERBLOCK (block);
-	}
+          QUIT;
+
+          block = get_frame_block (frame, 0);
+          while (block != NULL && block_function (block) != NULL
+                 && num_defns_collected (obstackp) == 0)
+            {
+              QUIT;
+
+              ada_add_block_symbols (obstackp, block, name, namespace,
+                                     NULL, NULL, wild_match);
+
+              block = BLOCK_SUPERBLOCK (block);
+            }
+        }
     }
 
   do_cleanups (old_chain);
 #endif
 }
 
+/* FIXME: The next two routines belong in symtab.c */
+
+static void
+restore_language (void *lang)
+{
+  set_language ((enum language) lang);
+}
+
+/* As for lookup_symbol, but performed as if the current language 
+   were LANG. */
+
+struct symbol *
+lookup_symbol_in_language (const char *name, const struct block *block,
+                           domain_enum domain, enum language lang,
+                           int *is_a_field_of_this, struct symtab **symtab)
+{
+  struct cleanup *old_chain
+    = make_cleanup (restore_language, (void *) current_language->la_language);
+  struct symbol *result;
+  set_language (lang);
+  result = lookup_symbol (name, block, domain, is_a_field_of_this, symtab);
+  do_cleanups (old_chain);
+  return result;
+}
+
 /* True if TYPE is definitely an artificial type supplied to a symbol
- * for which no debugging information was given in the symbol file. */
+   for which no debugging information was given in the symbol file.  */
+
 static int
 is_nondebugging_type (struct type *type)
 {
   char *name = ada_type_name (type);
-  return (name != NULL && DEPRECATED_STREQ (name, "<variable, no debug info>"));
+  return (name != NULL && strcmp (name, "<variable, no debug info>") == 0);
 }
 
-/* Remove any non-debugging symbols in SYMS[0 .. NSYMS-1] that definitely 
- * duplicate other symbols in the list.  (The only case I know of where
- * this happens is when object files containing stabs-in-ecoff are
- * linked with files containing ordinary ecoff debugging symbols (or no
- * debugging symbols)). Modifies SYMS to squeeze out deleted symbols,
- * and applies the same modification to BLOCKS to maintain the
- * correspondence between SYMS[i] and BLOCKS[i].  Returns the number
- * of symbols in the modified list. */
+/* Remove any non-debugging symbols in SYMS[0 .. NSYMS-1] that definitely
+   duplicate other symbols in the list (The only case I know of where
+   this happens is when object files containing stabs-in-ecoff are
+   linked with files containing ordinary ecoff debugging symbols (or no
+   debugging symbols)).  Modifies SYMS to squeeze out deleted entries.
+   Returns the number of items in the modified list.  */
+
 static int
-remove_extra_symbols (struct symbol **syms, struct block **blocks, int nsyms)
+remove_extra_symbols (struct ada_symbol_info *syms, int nsyms)
 {
   int i, j;
 
   i = 0;
   while (i < nsyms)
     {
-      if (DEPRECATED_SYMBOL_NAME (syms[i]) != NULL
-	  && SYMBOL_CLASS (syms[i]) == LOC_STATIC
-	  && is_nondebugging_type (SYMBOL_TYPE (syms[i])))
-	{
-	  for (j = 0; j < nsyms; j += 1)
-	    {
-	      if (i != j
-		  && DEPRECATED_SYMBOL_NAME (syms[j]) != NULL
-		  && DEPRECATED_STREQ (DEPRECATED_SYMBOL_NAME (syms[i]), DEPRECATED_SYMBOL_NAME (syms[j]))
-		  && SYMBOL_CLASS (syms[i]) == SYMBOL_CLASS (syms[j])
-		  && SYMBOL_VALUE_ADDRESS (syms[i])
-		  == SYMBOL_VALUE_ADDRESS (syms[j]))
-		{
-		  int k;
-		  for (k = i + 1; k < nsyms; k += 1)
-		    {
-		      syms[k - 1] = syms[k];
-		      blocks[k - 1] = blocks[k];
-		    }
-		  nsyms -= 1;
-		  goto NextSymbol;
-		}
-	    }
-	}
+      if (SYMBOL_LINKAGE_NAME (syms[i].sym) != NULL
+          && SYMBOL_CLASS (syms[i].sym) == LOC_STATIC
+          && is_nondebugging_type (SYMBOL_TYPE (syms[i].sym)))
+        {
+          for (j = 0; j < nsyms; j += 1)
+            {
+              if (i != j
+                  && SYMBOL_LINKAGE_NAME (syms[j].sym) != NULL
+                  && strcmp (SYMBOL_LINKAGE_NAME (syms[i].sym),
+                             SYMBOL_LINKAGE_NAME (syms[j].sym)) == 0
+                  && SYMBOL_CLASS (syms[i].sym) == SYMBOL_CLASS (syms[j].sym)
+                  && SYMBOL_VALUE_ADDRESS (syms[i].sym)
+                  == SYMBOL_VALUE_ADDRESS (syms[j].sym))
+                {
+                  int k;
+                  for (k = i + 1; k < nsyms; k += 1)
+                    syms[k - 1] = syms[k];
+                  nsyms -= 1;
+                  goto NextSymbol;
+                }
+            }
+        }
       i += 1;
     NextSymbol:
       ;
@@ -3633,63 +4373,262 @@
   return nsyms;
 }
 
-/* Find symbols in DOMAIN matching NAME, in BLOCK0 and enclosing 
-   scope and in global scopes, returning the number of matches.  Sets 
-   *SYMS to point to a vector of matching symbols, with *BLOCKS
-   pointing to the vector of corresponding blocks in which those
-   symbols reside.  These two vectors are transient---good only to the
-   next call of ada_lookup_symbol_list.  Any non-function/non-enumeral symbol
-   match within the nest of blocks whose innermost member is BLOCK0,
-   is the outermost match returned (no other matches in that or
-   enclosing blocks is returned).  If there are any matches in or
-   surrounding BLOCK0, then these alone are returned. */
+/* Given a type that corresponds to a renaming entity, use the type name
+   to extract the scope (package name or function name, fully qualified,
+   and following the GNAT encoding convention) where this renaming has been
+   defined.  The string returned needs to be deallocated after use.  */
+
+static char *
+xget_renaming_scope (struct type *renaming_type)
+{
+  /* The renaming types adhere to the following convention:
+     <scope>__<rename>___<XR extension>. 
+     So, to extract the scope, we search for the "___XR" extension,
+     and then backtrack until we find the first "__".  */
+
+  const char *name = type_name_no_tag (renaming_type);
+  char *suffix = strstr (name, "___XR");
+  char *last;
+  int scope_len;
+  char *scope;
+
+  /* Now, backtrack a bit until we find the first "__".  Start looking
+     at suffix - 3, as the <rename> part is at least one character long.  */
+
+  for (last = suffix - 3; last > name; last--)
+    if (last[0] == '_' && last[1] == '_')
+      break;
+
+  /* Make a copy of scope and return it.  */
+
+  scope_len = last - name;
+  scope = (char *) xmalloc ((scope_len + 1) * sizeof (char));
+
+  strncpy (scope, name, scope_len);
+  scope[scope_len] = '\0';
+
+  return scope;
+}
+
+/* Return nonzero if NAME corresponds to a package name.  */
+
+static int
+is_package_name (const char *name)
+{
+  /* Here, We take advantage of the fact that no symbols are generated
+     for packages, while symbols are generated for each function.
+     So the condition for NAME represent a package becomes equivalent
+     to NAME not existing in our list of symbols.  There is only one
+     small complication with library-level functions (see below).  */
+
+  char *fun_name;
+
+  /* If it is a function that has not been defined at library level,
+     then we should be able to look it up in the symbols.  */
+  if (standard_lookup (name, NULL, VAR_DOMAIN) != NULL)
+    return 0;
+
+  /* Library-level function names start with "_ada_".  See if function
+     "_ada_" followed by NAME can be found.  */
+
+  /* Do a quick check that NAME does not contain "__", since library-level
+     functions names can not contain "__" in them.  */
+  if (strstr (name, "__") != NULL)
+    return 0;
+
+  fun_name = xstrprintf ("_ada_%s", name);
+
+  return (standard_lookup (fun_name, NULL, VAR_DOMAIN) == NULL);
+}
+
+/* Return nonzero if SYM corresponds to a renaming entity that is
+   visible from FUNCTION_NAME.  */
+
+static int
+renaming_is_visible (const struct symbol *sym, char *function_name)
+{
+  char *scope = xget_renaming_scope (SYMBOL_TYPE (sym));
+
+  make_cleanup (xfree, scope);
+
+  /* If the rename has been defined in a package, then it is visible.  */
+  if (is_package_name (scope))
+    return 1;
+
+  /* Check that the rename is in the current function scope by checking
+     that its name starts with SCOPE.  */
+
+  /* If the function name starts with "_ada_", it means that it is
+     a library-level function.  Strip this prefix before doing the
+     comparison, as the encoding for the renaming does not contain
+     this prefix.  */
+  if (strncmp (function_name, "_ada_", 5) == 0)
+    function_name += 5;
+
+  return (strncmp (function_name, scope, strlen (scope)) == 0);
+}
+
+/* Iterates over the SYMS list and remove any entry that corresponds to
+   a renaming entity that is not visible from the function associated
+   with CURRENT_BLOCK. 
+   
+   Rationale:
+   GNAT emits a type following a specified encoding for each renaming
+   entity.  Unfortunately, STABS currently does not support the definition
+   of types that are local to a given lexical block, so all renamings types
+   are emitted at library level.  As a consequence, if an application
+   contains two renaming entities using the same name, and a user tries to
+   print the value of one of these entities, the result of the ada symbol
+   lookup will also contain the wrong renaming type.
+
+   This function partially covers for this limitation by attempting to
+   remove from the SYMS list renaming symbols that should be visible
+   from CURRENT_BLOCK.  However, there does not seem be a 100% reliable
+   method with the current information available.  The implementation
+   below has a couple of limitations (FIXME: brobecker-2003-05-12):  
+   
+      - When the user tries to print a rename in a function while there
+        is another rename entity defined in a package:  Normally, the
+        rename in the function has precedence over the rename in the
+        package, so the latter should be removed from the list.  This is
+        currently not the case.
+        
+      - This function will incorrectly remove valid renames if
+        the CURRENT_BLOCK corresponds to a function which symbol name
+        has been changed by an "Export" pragma.  As a consequence,
+        the user will be unable to print such rename entities.  */
+
+static int
+remove_out_of_scope_renamings (struct ada_symbol_info *syms,
+                               int nsyms, struct block *current_block)
+{
+  struct symbol *current_function;
+  char *current_function_name;
+  int i;
+
+  /* Extract the function name associated to CURRENT_BLOCK.
+     Abort if unable to do so.  */
+
+  if (current_block == NULL)
+    return nsyms;
+
+  current_function = block_function (current_block);
+  if (current_function == NULL)
+    return nsyms;
+
+  current_function_name = SYMBOL_LINKAGE_NAME (current_function);
+  if (current_function_name == NULL)
+    return nsyms;
+
+  /* Check each of the symbols, and remove it from the list if it is
+     a type corresponding to a renaming that is out of the scope of
+     the current block.  */
+
+  i = 0;
+  while (i < nsyms)
+    {
+      if (ada_is_object_renaming (syms[i].sym)
+          && !renaming_is_visible (syms[i].sym, current_function_name))
+        {
+          int j;
+          for (j = i + 1; j < nsyms; j++)
+            syms[j - 1] = syms[j];
+          nsyms -= 1;
+        }
+      else
+        i += 1;
+    }
+
+  return nsyms;
+}
+
+/* Find symbols in DOMAIN matching NAME0, in BLOCK0 and enclosing
+   scope and in global scopes, returning the number of matches.  Sets
+   *RESULTS to point to a vector of (SYM,BLOCK,SYMTAB) triples,
+   indicating the symbols found and the blocks and symbol tables (if
+   any) in which they were found.  This vector are transient---good only to 
+   the next call of ada_lookup_symbol_list.  Any non-function/non-enumeral 
+   symbol match within the nest of blocks whose innermost member is BLOCK0,
+   is the one match returned (no other matches in that or
+     enclosing blocks is returned).  If there are any matches in or
+   surrounding BLOCK0, then these alone are returned.  Otherwise, the
+   search extends to global and file-scope (static) symbol tables.
+   Names prefixed with "standard__" are handled specially: "standard__" 
+   is first stripped off, and only static and global symbols are searched.  */
 
 int
-ada_lookup_symbol_list (const char *name, struct block *block0,
-			domain_enum domain, struct symbol ***syms,
-			struct block ***blocks)
+ada_lookup_symbol_list (const char *name0, const struct block *block0,
+                        domain_enum namespace,
+                        struct ada_symbol_info **results)
 {
   struct symbol *sym;
   struct symtab *s;
   struct partial_symtab *ps;
   struct blockvector *bv;
   struct objfile *objfile;
-  struct block *b;
   struct block *block;
+  const char *name;
   struct minimal_symbol *msymbol;
-  int wild_match = (strstr (name, "__") == NULL);
+  int wild_match;
   int cacheIfUnique;
+  int block_depth;
+  int ndefns;
 
-#ifdef TIMING
-  markTimeStart (0);
-#endif
+  obstack_free (&symbol_list_obstack, NULL);
+  obstack_init (&symbol_list_obstack);
 
-  ndefns = 0;
   cacheIfUnique = 0;
 
   /* Search specified block and its superiors.  */
 
-  block = block0;
+  wild_match = (strstr (name0, "__") == NULL);
+  name = name0;
+  block = (struct block *) block0;      /* FIXME: No cast ought to be
+                                           needed, but adding const will
+                                           have a cascade effect.  */
+  if (strncmp (name0, "standard__", sizeof ("standard__") - 1) == 0)
+    {
+      wild_match = 0;
+      block = NULL;
+      name = name0 + sizeof ("standard__") - 1;
+    }
+
+  block_depth = 0;
   while (block != NULL)
     {
-      ada_add_block_symbols (block, name, domain, NULL, wild_match);
+      block_depth += 1;
+      ada_add_block_symbols (&symbol_list_obstack, block, name,
+                             namespace, NULL, NULL, wild_match);
 
-      /* If we found a non-function match, assume that's the one. */
-      if (is_nonfunction (defn_symbols, ndefns))
-	goto done;
+      /* If we found a non-function match, assume that's the one.  */
+      if (is_nonfunction (defns_collected (&symbol_list_obstack, 0),
+                          num_defns_collected (&symbol_list_obstack)))
+        goto done;
 
       block = BLOCK_SUPERBLOCK (block);
     }
 
-  /* If we found ANY matches in the specified BLOCK, we're done. */
+  /* If no luck so far, try to find NAME as a local symbol in some lexically
+     enclosing subprogram.  */
+  if (num_defns_collected (&symbol_list_obstack) == 0 && block_depth > 2)
+    add_symbols_from_enclosing_procs (&symbol_list_obstack,
+                                      name, namespace, wild_match);
 
-  if (ndefns > 0)
+  /* If we found ANY matches among non-global symbols, we're done.  */
+
+  if (num_defns_collected (&symbol_list_obstack) > 0)
     goto done;
 
   cacheIfUnique = 1;
+  if (lookup_cached_symbol (name0, namespace, &sym, &block, &s))
+    {
+      if (sym != NULL)
+        add_defn_to_vec (&symbol_list_obstack, sym, block, s);
+      goto done;
+    }
 
   /* Now add symbols from all global blocks: symbol tables, minimal symbol
-     tables, and psymtab's */
+     tables, and psymtab's.  */
 
   ALL_SYMTABS (objfile, s)
   {
@@ -3698,41 +4637,43 @@
       continue;
     bv = BLOCKVECTOR (s);
     block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-    ada_add_block_symbols (block, name, domain, objfile, wild_match);
+    ada_add_block_symbols (&symbol_list_obstack, block, name, namespace,
+                           objfile, s, wild_match);
   }
 
-  if (domain == VAR_DOMAIN)
+  if (namespace == VAR_DOMAIN)
     {
       ALL_MSYMBOLS (objfile, msymbol)
       {
-	if (ada_match_name (DEPRECATED_SYMBOL_NAME (msymbol), name, wild_match))
-	  {
-	    switch (MSYMBOL_TYPE (msymbol))
-	      {
-	      case mst_solib_trampoline:
-		break;
-	      default:
-		s = find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol));
-		if (s != NULL)
-		  {
-		    int old_ndefns = ndefns;
-		    QUIT;
-		    bv = BLOCKVECTOR (s);
-		    block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-		    ada_add_block_symbols (block,
-					   DEPRECATED_SYMBOL_NAME (msymbol),
-					   domain, objfile, wild_match);
-		    if (ndefns == old_ndefns)
-		      {
-			block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-			ada_add_block_symbols (block,
-					       DEPRECATED_SYMBOL_NAME (msymbol),
-					       domain, objfile,
-					       wild_match);
-		      }
-		  }
-	      }
-	  }
+        if (ada_match_name (SYMBOL_LINKAGE_NAME (msymbol), name, wild_match))
+          {
+            switch (MSYMBOL_TYPE (msymbol))
+              {
+              case mst_solib_trampoline:
+                break;
+              default:
+                s = find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol));
+                if (s != NULL)
+                  {
+                    int ndefns0 = num_defns_collected (&symbol_list_obstack);
+                    QUIT;
+                    bv = BLOCKVECTOR (s);
+                    block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+                    ada_add_block_symbols (&symbol_list_obstack, block,
+                                           SYMBOL_LINKAGE_NAME (msymbol),
+                                           namespace, objfile, s, wild_match);
+
+                    if (num_defns_collected (&symbol_list_obstack) == ndefns0)
+                      {
+                        block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+                        ada_add_block_symbols (&symbol_list_obstack, block,
+                                               SYMBOL_LINKAGE_NAME (msymbol),
+                                               namespace, objfile, s,
+                                               wild_match);
+                      }
+                  }
+              }
+          }
       }
     }
 
@@ -3740,220 +4681,376 @@
   {
     QUIT;
     if (!ps->readin
-	&& ada_lookup_partial_symbol (ps, name, 1, domain, wild_match))
+        && ada_lookup_partial_symbol (ps, name, 1, namespace, wild_match))
       {
-	s = PSYMTAB_TO_SYMTAB (ps);
-	if (!s->primary)
-	  continue;
-	bv = BLOCKVECTOR (s);
-	block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
-	ada_add_block_symbols (block, name, domain, objfile, wild_match);
+        s = PSYMTAB_TO_SYMTAB (ps);
+        if (!s->primary)
+          continue;
+        bv = BLOCKVECTOR (s);
+        block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+        ada_add_block_symbols (&symbol_list_obstack, block, name,
+                               namespace, objfile, s, wild_match);
       }
   }
 
-  /* Now add symbols from all per-file blocks if we've gotten no hits.  
+  /* Now add symbols from all per-file blocks if we've gotten no hits
      (Not strictly correct, but perhaps better than an error).
-     Do the symtabs first, then check the psymtabs */
+     Do the symtabs first, then check the psymtabs.  */
 
-  if (ndefns == 0)
+  if (num_defns_collected (&symbol_list_obstack) == 0)
     {
 
       ALL_SYMTABS (objfile, s)
       {
-	QUIT;
-	if (!s->primary)
-	  continue;
-	bv = BLOCKVECTOR (s);
-	block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-	ada_add_block_symbols (block, name, domain, objfile, wild_match);
+        QUIT;
+        if (!s->primary)
+          continue;
+        bv = BLOCKVECTOR (s);
+        block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+        ada_add_block_symbols (&symbol_list_obstack, block, name, namespace,
+                               objfile, s, wild_match);
       }
 
       ALL_PSYMTABS (objfile, ps)
       {
-	QUIT;
-	if (!ps->readin
-	    && ada_lookup_partial_symbol (ps, name, 0, domain, wild_match))
-	  {
-	    s = PSYMTAB_TO_SYMTAB (ps);
-	    bv = BLOCKVECTOR (s);
-	    if (!s->primary)
-	      continue;
-	    block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
-	    ada_add_block_symbols (block, name, domain,
-				   objfile, wild_match);
-	  }
+        QUIT;
+        if (!ps->readin
+            && ada_lookup_partial_symbol (ps, name, 0, namespace, wild_match))
+          {
+            s = PSYMTAB_TO_SYMTAB (ps);
+            bv = BLOCKVECTOR (s);
+            if (!s->primary)
+              continue;
+            block = BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+            ada_add_block_symbols (&symbol_list_obstack, block, name,
+                                   namespace, objfile, s, wild_match);
+          }
       }
     }
 
-  /* Finally, we try to find NAME as a local symbol in some lexically
-     enclosing block.  We do this last, expecting this case to be
-     rare. */
-  if (ndefns == 0)
-    {
-      add_symbols_from_enclosing_procs (name, domain, wild_match);
-      if (ndefns > 0)
-	goto done;
-    }
-
 done:
-  ndefns = remove_extra_symbols (defn_symbols, defn_blocks, ndefns);
+  ndefns = num_defns_collected (&symbol_list_obstack);
+  *results = defns_collected (&symbol_list_obstack, 1);
 
+  ndefns = remove_extra_symbols (*results, ndefns);
 
-  *syms = defn_symbols;
-  *blocks = defn_blocks;
-#ifdef TIMING
-  markTimeStop (0);
-#endif
+  if (ndefns == 0)
+    cache_symbol (name0, namespace, NULL, NULL, NULL);
+
+  if (ndefns == 1 && cacheIfUnique)
+    cache_symbol (name0, namespace, (*results)[0].sym, (*results)[0].block,
+                  (*results)[0].symtab);
+
+  ndefns = remove_out_of_scope_renamings (*results, ndefns,
+                                          (struct block *) block0);
+
   return ndefns;
 }
 
-/* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing 
- * scope and in global scopes, or NULL if none.  NAME is folded to
- * lower case first, unless it is surrounded in single quotes. 
- * Otherwise, the result is as for ada_lookup_symbol_list, but is 
- * disambiguated by user query if needed. */
+/* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing
+   scope and in global scopes, or NULL if none.  NAME is folded and
+   encoded first.  Otherwise, the result is as for ada_lookup_symbol_list,
+   but is disambiguated by user query if needed.  *IS_A_FIELD_OF_THIS is
+   set to 0 and *SYMTAB is set to the symbol table in which the symbol
+   was found (in both cases, these assignments occur only if the
+   pointers are non-null).  */
+
 
 struct symbol *
-ada_lookup_symbol (const char *name, struct block *block0,
-		   domain_enum domain)
+ada_lookup_symbol (const char *name, const struct block *block0,
+                   domain_enum namespace, int *is_a_field_of_this,
+                   struct symtab **symtab)
 {
-  struct symbol **candidate_syms;
-  struct block **candidate_blocks;
+  struct ada_symbol_info *candidates;
   int n_candidates;
 
-  n_candidates = ada_lookup_symbol_list (name,
-					 block0, domain,
-					 &candidate_syms, &candidate_blocks);
+  n_candidates = ada_lookup_symbol_list (ada_encode (ada_fold_name (name)),
+                                         block0, namespace, &candidates);
 
   if (n_candidates == 0)
     return NULL;
   else if (n_candidates != 1)
-    user_select_syms (candidate_syms, candidate_blocks, n_candidates, 1);
+    user_select_syms (candidates, n_candidates, 1);
 
-  return candidate_syms[0];
+  if (is_a_field_of_this != NULL)
+    *is_a_field_of_this = 0;
+
+  if (symtab != NULL)
+    {
+      *symtab = candidates[0].symtab;
+      if (*symtab == NULL && candidates[0].block != NULL)
+        {
+          struct objfile *objfile;
+          struct symtab *s;
+          struct block *b;
+          struct blockvector *bv;
+
+          /* Search the list of symtabs for one which contains the
+             address of the start of this block.  */
+          ALL_SYMTABS (objfile, s)
+          {
+            bv = BLOCKVECTOR (s);
+            b = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+            if (BLOCK_START (b) <= BLOCK_START (candidates[0].block)
+                && BLOCK_END (b) > BLOCK_START (candidates[0].block))
+              {
+                *symtab = s;
+                return fixup_symbol_section (candidates[0].sym, objfile);
+              }
+            return fixup_symbol_section (candidates[0].sym, NULL);
+          }
+        }
+    }
+  return candidates[0].sym;
+}
+
+static struct symbol *
+ada_lookup_symbol_nonlocal (const char *name,
+                            const char *linkage_name,
+                            const struct block *block,
+                            const domain_enum domain, struct symtab **symtab)
+{
+  if (linkage_name == NULL)
+    linkage_name = name;
+  return ada_lookup_symbol (linkage_name, block_static_block (block), domain,
+                            NULL, symtab);
 }
 
 
-/* True iff STR is a possible encoded suffix of a normal Ada name 
- * that is to be ignored for matching purposes.  Suffixes of parallel
- * names (e.g., XVE) are not included here.  Currently, the possible suffixes 
- * are given by the regular expression:
- *        (X[nb]*)?(__[0-9]+|\$[0-9]+|___(LJM|X([FDBUP].*|R[^T]?)))?$
- * 
+/* True iff STR is a possible encoded suffix of a normal Ada name
+   that is to be ignored for matching purposes.  Suffixes of parallel
+   names (e.g., XVE) are not included here.  Currently, the possible suffixes
+   are given by either of the regular expression:
+
+   (__[0-9]+)?\.[0-9]+  [nested subprogram suffix, on platforms such 
+                         as GNU/Linux]
+   ___[0-9]+            [nested subprogram suffix, on platforms such as HP/UX]
+   (X[nb]*)?((\$|__)[0-9](_?[0-9]+)|___(LJM|X([FDBUP].*|R[^T]?)))?$
  */
+
 static int
 is_name_suffix (const char *str)
 {
   int k;
+  const char *matching;
+  const int len = strlen (str);
+
+  /* (__[0-9]+)?\.[0-9]+ */
+  matching = str;
+  if (len > 3 && str[0] == '_' && str[1] == '_' && isdigit (str[2]))
+    {
+      matching += 3;
+      while (isdigit (matching[0]))
+        matching += 1;
+      if (matching[0] == '\0')
+        return 1;
+    }
+
+  if (matching[0] == '.')
+    {
+      matching += 1;
+      while (isdigit (matching[0]))
+        matching += 1;
+      if (matching[0] == '\0')
+        return 1;
+    }
+
+  /* ___[0-9]+ */
+  if (len > 3 && str[0] == '_' && str[1] == '_' && str[2] == '_')
+    {
+      matching = str + 3;
+      while (isdigit (matching[0]))
+        matching += 1;
+      if (matching[0] == '\0')
+        return 1;
+    }
+
+  /* ??? We should not modify STR directly, as we are doing below.  This
+     is fine in this case, but may become problematic later if we find
+     that this alternative did not work, and want to try matching
+     another one from the begining of STR.  Since we modified it, we
+     won't be able to find the begining of the string anymore!  */
   if (str[0] == 'X')
     {
       str += 1;
       while (str[0] != '_' && str[0] != '\0')
-	{
-	  if (str[0] != 'n' && str[0] != 'b')
-	    return 0;
-	  str += 1;
-	}
+        {
+          if (str[0] != 'n' && str[0] != 'b')
+            return 0;
+          str += 1;
+        }
     }
   if (str[0] == '\000')
     return 1;
   if (str[0] == '_')
     {
       if (str[1] != '_' || str[2] == '\000')
-	return 0;
+        return 0;
       if (str[2] == '_')
-	{
-	  if (DEPRECATED_STREQ (str + 3, "LJM"))
-	    return 1;
-	  if (str[3] != 'X')
-	    return 0;
-	  if (str[4] == 'F' || str[4] == 'D' || str[4] == 'B' ||
-	      str[4] == 'U' || str[4] == 'P')
-	    return 1;
-	  if (str[4] == 'R' && str[5] != 'T')
-	    return 1;
-	  return 0;
-	}
-      for (k = 2; str[k] != '\0'; k += 1)
-	if (!isdigit (str[k]))
-	  return 0;
+        {
+          if (strcmp (str + 3, "LJM") == 0)
+            return 1;
+          if (str[3] != 'X')
+            return 0;
+          if (str[4] == 'F' || str[4] == 'D' || str[4] == 'B'
+              || str[4] == 'U' || str[4] == 'P')
+            return 1;
+          if (str[4] == 'R' && str[5] != 'T')
+            return 1;
+          return 0;
+        }
+      if (!isdigit (str[2]))
+        return 0;
+      for (k = 3; str[k] != '\0'; k += 1)
+        if (!isdigit (str[k]) && str[k] != '_')
+          return 0;
       return 1;
     }
-  if (str[0] == '$' && str[1] != '\000')
+  if (str[0] == '$' && isdigit (str[1]))
     {
-      for (k = 1; str[k] != '\0'; k += 1)
-	if (!isdigit (str[k]))
-	  return 0;
+      for (k = 2; str[k] != '\0'; k += 1)
+        if (!isdigit (str[k]) && str[k] != '_')
+          return 0;
       return 1;
     }
   return 0;
 }
 
-/* True if NAME represents a name of the form A1.A2....An, n>=1 and 
- * PATN[0..PATN_LEN-1] = Ak.Ak+1.....An for some k >= 1.  Ignores
- * informational suffixes of NAME (i.e., for which is_name_suffix is
- * true). */
+/* Return nonzero if the given string starts with a dot ('.')
+   followed by zero or more digits.  
+   
+   Note: brobecker/2003-11-10: A forward declaration has not been
+   added at the begining of this file yet, because this function
+   is only used to work around a problem found during wild matching
+   when trying to match minimal symbol names against symbol names
+   obtained from dwarf-2 data.  This function is therefore currently
+   only used in wild_match() and is likely to be deleted when the
+   problem in dwarf-2 is fixed.  */
+
 static int
-wild_match (const char *patn, int patn_len, const char *name)
+is_dot_digits_suffix (const char *str)
+{
+  if (str[0] != '.')
+    return 0;
+
+  str++;
+  while (isdigit (str[0]))
+    str++;
+  return (str[0] == '\0');
+}
+
+/* True if NAME represents a name of the form A1.A2....An, n>=1 and
+   PATN[0..PATN_LEN-1] = Ak.Ak+1.....An for some k >= 1.  Ignores
+   informational suffixes of NAME (i.e., for which is_name_suffix is
+   true).  */
+
+static int
+wild_match (const char *patn0, int patn_len, const char *name0)
 {
   int name_len;
-  int s, e;
+  char *name;
+  char *patn;
+
+  /* FIXME: brobecker/2003-11-10: For some reason, the symbol name
+     stored in the symbol table for nested function names is sometimes
+     different from the name of the associated entity stored in
+     the dwarf-2 data: This is the case for nested subprograms, where
+     the minimal symbol name contains a trailing ".[:digit:]+" suffix,
+     while the symbol name from the dwarf-2 data does not.
+
+     Although the DWARF-2 standard documents that entity names stored
+     in the dwarf-2 data should be identical to the name as seen in
+     the source code, GNAT takes a different approach as we already use
+     a special encoding mechanism to convey the information so that
+     a C debugger can still use the information generated to debug
+     Ada programs.  A corollary is that the symbol names in the dwarf-2
+     data should match the names found in the symbol table.  I therefore
+     consider this issue as a compiler defect.
+
+     Until the compiler is properly fixed, we work-around the problem
+     by ignoring such suffixes during the match.  We do so by making
+     a copy of PATN0 and NAME0, and then by stripping such a suffix
+     if present.  We then perform the match on the resulting strings.  */
+  {
+    char *dot;
+    name_len = strlen (name0);
+
+    name = (char *) alloca ((name_len + 1) * sizeof (char));
+    strcpy (name, name0);
+    dot = strrchr (name, '.');
+    if (dot != NULL && is_dot_digits_suffix (dot))
+      *dot = '\0';
+
+    patn = (char *) alloca ((patn_len + 1) * sizeof (char));
+    strncpy (patn, patn0, patn_len);
+    patn[patn_len] = '\0';
+    dot = strrchr (patn, '.');
+    if (dot != NULL && is_dot_digits_suffix (dot))
+      {
+        *dot = '\0';
+        patn_len = dot - patn;
+      }
+  }
+
+  /* Now perform the wild match.  */
 
   name_len = strlen (name);
-  if (name_len >= patn_len + 5 && DEPRECATED_STREQN (name, "_ada_", 5)
-      && DEPRECATED_STREQN (patn, name + 5, patn_len)
+  if (name_len >= patn_len + 5 && strncmp (name, "_ada_", 5) == 0
+      && strncmp (patn, name + 5, patn_len) == 0
       && is_name_suffix (name + patn_len + 5))
     return 1;
 
   while (name_len >= patn_len)
     {
-      if (DEPRECATED_STREQN (patn, name, patn_len) && is_name_suffix (name + patn_len))
-	return 1;
+      if (strncmp (patn, name, patn_len) == 0
+          && is_name_suffix (name + patn_len))
+        return 1;
       do
-	{
-	  name += 1;
-	  name_len -= 1;
-	}
+        {
+          name += 1;
+          name_len -= 1;
+        }
       while (name_len > 0
-	     && name[0] != '.' && (name[0] != '_' || name[1] != '_'));
+             && name[0] != '.' && (name[0] != '_' || name[1] != '_'));
       if (name_len <= 0)
-	return 0;
+        return 0;
       if (name[0] == '_')
-	{
-	  if (!islower (name[2]))
-	    return 0;
-	  name += 2;
-	  name_len -= 2;
-	}
+        {
+          if (!islower (name[2]))
+            return 0;
+          name += 2;
+          name_len -= 2;
+        }
       else
-	{
-	  if (!islower (name[1]))
-	    return 0;
-	  name += 1;
-	  name_len -= 1;
-	}
+        {
+          if (!islower (name[1]))
+            return 0;
+          name += 1;
+          name_len -= 1;
+        }
     }
 
   return 0;
 }
 
 
-/* Add symbols from BLOCK matching identifier NAME in DOMAIN to 
-   vector *defn_symbols, updating *defn_symbols (if necessary), *SZ (the size of
-   the vector *defn_symbols), and *ndefns (the number of symbols
-   currently stored in *defn_symbols).  If WILD, treat as NAME with a
-   wildcard prefix. OBJFILE is the section containing BLOCK. */
+/* Add symbols from BLOCK matching identifier NAME in DOMAIN to
+   vector *defn_symbols, updating the list of symbols in OBSTACKP 
+   (if necessary).  If WILD, treat as NAME with a wildcard prefix. 
+   OBJFILE is the section containing BLOCK.
+   SYMTAB is recorded with each symbol added.  */
 
 static void
-ada_add_block_symbols (struct block *block, const char *name,
-		       domain_enum domain, struct objfile *objfile,
-		       int wild)
+ada_add_block_symbols (struct obstack *obstackp,
+                       struct block *block, const char *name,
+                       domain_enum domain, struct objfile *objfile,
+                       struct symtab *symtab, int wild)
 {
   struct dict_iterator iter;
   int name_len = strlen (name);
-  /* A matching argument symbol, if any. */
+  /* A matching argument symbol, if any.  */
   struct symbol *arg_sym;
-  /* Set true when we find a matching non-argument symbol */
+  /* Set true when we find a matching non-argument symbol.  */
   int found_sym;
   struct symbol *sym;
 
@@ -3964,71 +5061,72 @@
       struct symbol *sym;
       ALL_BLOCK_SYMBOLS (block, iter, sym)
       {
-	if (SYMBOL_DOMAIN (sym) == domain &&
-	    wild_match (name, name_len, DEPRECATED_SYMBOL_NAME (sym)))
-	  {
-	    switch (SYMBOL_CLASS (sym))
-	      {
-	      case LOC_ARG:
-	      case LOC_LOCAL_ARG:
-	      case LOC_REF_ARG:
-	      case LOC_REGPARM:
-	      case LOC_REGPARM_ADDR:
-	      case LOC_BASEREG_ARG:
-	      case LOC_COMPUTED_ARG:
-		arg_sym = sym;
-		break;
-	      case LOC_UNRESOLVED:
-		continue;
-	      default:
-		found_sym = 1;
-		fill_in_ada_prototype (sym);
-		add_defn_to_vec (fixup_symbol_section (sym, objfile), block);
-		break;
-	      }
-	  }
+        if (SYMBOL_DOMAIN (sym) == domain
+            && wild_match (name, name_len, SYMBOL_LINKAGE_NAME (sym)))
+          {
+            switch (SYMBOL_CLASS (sym))
+              {
+              case LOC_ARG:
+              case LOC_LOCAL_ARG:
+              case LOC_REF_ARG:
+              case LOC_REGPARM:
+              case LOC_REGPARM_ADDR:
+              case LOC_BASEREG_ARG:
+              case LOC_COMPUTED_ARG:
+                arg_sym = sym;
+                break;
+              case LOC_UNRESOLVED:
+                continue;
+              default:
+                found_sym = 1;
+                add_defn_to_vec (obstackp,
+                                 fixup_symbol_section (sym, objfile),
+                                 block, symtab);
+                break;
+              }
+          }
       }
     }
   else
     {
       ALL_BLOCK_SYMBOLS (block, iter, sym)
-	  {
-	    if (SYMBOL_DOMAIN (sym) == domain)
-	      {
-		int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym), name_len);
-
-		if (cmp == 0
-		    && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len))
-		  {
-		    switch (SYMBOL_CLASS (sym))
-		      {
-		      case LOC_ARG:
-		      case LOC_LOCAL_ARG:
-		      case LOC_REF_ARG:
-		      case LOC_REGPARM:
-		      case LOC_REGPARM_ADDR:
-		      case LOC_BASEREG_ARG:
-		      case LOC_COMPUTED_ARG:
-			arg_sym = sym;
-			break;
-		      case LOC_UNRESOLVED:
-			break;
-		      default:
-			found_sym = 1;
-			fill_in_ada_prototype (sym);
-			add_defn_to_vec (fixup_symbol_section (sym, objfile),
-					 block);
-			break;
-		      }
-		  }
-	      }
-	  }
+      {
+        if (SYMBOL_DOMAIN (sym) == domain)
+          {
+            int cmp = strncmp (name, SYMBOL_LINKAGE_NAME (sym), name_len);
+            if (cmp == 0
+                && is_name_suffix (SYMBOL_LINKAGE_NAME (sym) + name_len))
+              {
+                switch (SYMBOL_CLASS (sym))
+                  {
+                  case LOC_ARG:
+                  case LOC_LOCAL_ARG:
+                  case LOC_REF_ARG:
+                  case LOC_REGPARM:
+                  case LOC_REGPARM_ADDR:
+                  case LOC_BASEREG_ARG:
+                  case LOC_COMPUTED_ARG:
+                    arg_sym = sym;
+                    break;
+                  case LOC_UNRESOLVED:
+                    break;
+                  default:
+                    found_sym = 1;
+                    add_defn_to_vec (obstackp,
+                                     fixup_symbol_section (sym, objfile),
+                                     block, symtab);
+                    break;
+                  }
+              }
+          }
+      }
     }
 
   if (!found_sym && arg_sym != NULL)
     {
-      fill_in_ada_prototype (arg_sym);
-      add_defn_to_vec (fixup_symbol_section (arg_sym, objfile), block);
+      add_defn_to_vec (obstackp,
+                       fixup_symbol_section (arg_sym, objfile),
+                       block, symtab);
     }
 
   if (!wild)
@@ -4037,167 +5135,361 @@
       found_sym = 0;
 
       ALL_BLOCK_SYMBOLS (block, iter, sym)
-	  {
-	    if (SYMBOL_DOMAIN (sym) == domain)
-	      {
-		int cmp;
+      {
+        if (SYMBOL_DOMAIN (sym) == domain)
+          {
+            int cmp;
 
-		cmp = (int) '_' - (int) DEPRECATED_SYMBOL_NAME (sym)[0];
-		if (cmp == 0)
-		  {
-		    cmp = strncmp ("_ada_", DEPRECATED_SYMBOL_NAME (sym), 5);
-		    if (cmp == 0)
-		      cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym) + 5, name_len);
-		  }
+            cmp = (int) '_' - (int) SYMBOL_LINKAGE_NAME (sym)[0];
+            if (cmp == 0)
+              {
+                cmp = strncmp ("_ada_", SYMBOL_LINKAGE_NAME (sym), 5);
+                if (cmp == 0)
+                  cmp = strncmp (name, SYMBOL_LINKAGE_NAME (sym) + 5,
+                                 name_len);
+              }
 
-		if (cmp == 0
-		    && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len + 5))
-		  {
-		    switch (SYMBOL_CLASS (sym))
-		      {
-		      case LOC_ARG:
-		      case LOC_LOCAL_ARG:
-		      case LOC_REF_ARG:
-		      case LOC_REGPARM:
-		      case LOC_REGPARM_ADDR:
-		      case LOC_BASEREG_ARG:
-		      case LOC_COMPUTED_ARG:
-			arg_sym = sym;
-			break;
-		      case LOC_UNRESOLVED:
-			break;
-		      default:
-			found_sym = 1;
-			fill_in_ada_prototype (sym);
-			add_defn_to_vec (fixup_symbol_section (sym, objfile),
-					 block);
-			break;
-		      }
-		  }
-	      }
-	  }
+            if (cmp == 0
+                && is_name_suffix (SYMBOL_LINKAGE_NAME (sym) + name_len + 5))
+              {
+                switch (SYMBOL_CLASS (sym))
+                  {
+                  case LOC_ARG:
+                  case LOC_LOCAL_ARG:
+                  case LOC_REF_ARG:
+                  case LOC_REGPARM:
+                  case LOC_REGPARM_ADDR:
+                  case LOC_BASEREG_ARG:
+                  case LOC_COMPUTED_ARG:
+                    arg_sym = sym;
+                    break;
+                  case LOC_UNRESOLVED:
+                    break;
+                  default:
+                    found_sym = 1;
+                    add_defn_to_vec (obstackp,
+                                     fixup_symbol_section (sym, objfile),
+                                     block, symtab);
+                    break;
+                  }
+              }
+          }
+      end_loop2:;
+      }
 
       /* NOTE: This really shouldn't be needed for _ada_ symbols.
-         They aren't parameters, right? */
+         They aren't parameters, right?  */
       if (!found_sym && arg_sym != NULL)
-	{
-	  fill_in_ada_prototype (arg_sym);
-	  add_defn_to_vec (fixup_symbol_section (arg_sym, objfile), block);
-	}
+        {
+          add_defn_to_vec (obstackp,
+                           fixup_symbol_section (arg_sym, objfile),
+                           block, symtab);
+        }
     }
 }
 
+#ifdef GNAT_GDB
 
-				/* Function Types */
+                                /* Symbol Completion */
 
-/* Assuming that SYM is the symbol for a function, fill in its type 
-   with prototype information, if it is not already there.  */
+/* If SYM_NAME is a completion candidate for TEXT, return this symbol
+   name in a form that's appropriate for the completion.  The result
+   does not need to be deallocated, but is only good until the next call.
+
+   TEXT_LEN is equal to the length of TEXT.
+   Perform a wild match if WILD_MATCH is set.
+   ENCODED should be set if TEXT represents the start of a symbol name
+   in its encoded form.  */
+
+static const char *
+symbol_completion_match (const char *sym_name,
+                         const char *text, int text_len,
+                         int wild_match, int encoded)
+{
+  char *result;
+  const int verbatim_match = (text[0] == '<');
+  int match = 0;
+
+  if (verbatim_match)
+    {
+      /* Strip the leading angle bracket.  */
+      text = text + 1;
+      text_len--;
+    }
+
+  /* First, test against the fully qualified name of the symbol.  */
+
+  if (strncmp (sym_name, text, text_len) == 0)
+    match = 1;
+
+  if (match && !encoded)
+    {
+      /* One needed check before declaring a positive match is to verify
+         that iff we are doing a verbatim match, the decoded version
+         of the symbol name starts with '<'.  Otherwise, this symbol name
+         is not a suitable completion.  */
+      const char *sym_name_copy = sym_name;
+      int has_angle_bracket;
+
+      sym_name = ada_decode (sym_name);
+      has_angle_bracket = (sym_name[0] == '<');
+      match = (has_angle_bracket == verbatim_match);
+      sym_name = sym_name_copy;
+    }
+
+  if (match && !verbatim_match)
+    {
+      /* When doing non-verbatim match, another check that needs to
+         be done is to verify that the potentially matching symbol name
+         does not include capital letters, because the ada-mode would
+         not be able to understand these symbol names without the
+         angle bracket notation.  */
+      const char *tmp;
+
+      for (tmp = sym_name; *tmp != '\0' && !isupper (*tmp); tmp++);
+      if (*tmp != '\0')
+        match = 0;
+    }
+
+  /* Second: Try wild matching...  */
+
+  if (!match && wild_match)
+    {
+      /* Since we are doing wild matching, this means that TEXT
+         may represent an unqualified symbol name.  We therefore must
+         also compare TEXT against the unqualified name of the symbol.  */
+      sym_name = ada_unqualified_name (ada_decode (sym_name));
+
+      if (strncmp (sym_name, text, text_len) == 0)
+        match = 1;
+    }
+
+  /* Finally: If we found a mach, prepare the result to return.  */
+
+  if (!match)
+    return NULL;
+
+  if (verbatim_match)
+    sym_name = add_angle_brackets (sym_name);
+
+  if (!encoded)
+    sym_name = ada_decode (sym_name);
+
+  return sym_name;
+}
+
+/* A companion function to ada_make_symbol_completion_list().
+   Check if SYM_NAME represents a symbol which name would be suitable
+   to complete TEXT (TEXT_LEN is the length of TEXT), in which case
+   it is appended at the end of the given string vector SV.
+
+   ORIG_TEXT is the string original string from the user command
+   that needs to be completed.  WORD is the entire command on which
+   completion should be performed.  These two parameters are used to
+   determine which part of the symbol name should be added to the
+   completion vector.
+   if WILD_MATCH is set, then wild matching is performed.
+   ENCODED should be set if TEXT represents a symbol name in its
+   encoded formed (in which case the completion should also be
+   encoded).  */
 
 static void
-fill_in_ada_prototype (struct symbol *func)
+symbol_completion_add (struct string_vector *sv,
+                       const char *sym_name,
+                       const char *text, int text_len,
+                       const char *orig_text, const char *word,
+                       int wild_match, int encoded)
 {
-  struct block *b;
-  int nargs, nsyms;
-  struct dict_iterator iter;
-  struct type *ftype;
-  struct type *rtype;
-  size_t max_fields;
-  struct symbol *sym;
+  const char *match = symbol_completion_match (sym_name, text, text_len,
+                                               wild_match, encoded);
+  char *completion;
 
-  if (func == NULL
-      || TYPE_CODE (SYMBOL_TYPE (func)) != TYPE_CODE_FUNC
-      || TYPE_FIELDS (SYMBOL_TYPE (func)) != NULL)
+  if (match == NULL)
     return;
 
-  /* We make each function type unique, so that each may have its own */
-  /* parameter types.  This particular way of doing so wastes space: */
-  /* it would be nicer to build the argument types while the original */
-  /* function type is being built (FIXME). */
-  rtype = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (func)));
-  ftype = alloc_type (TYPE_OBJFILE (SYMBOL_TYPE (func)));
-  make_function_type (rtype, &ftype);
-  SYMBOL_TYPE (func) = ftype;
+  /* We found a match, so add the appropriate completion to the given
+     string vector.  */
 
-  b = SYMBOL_BLOCK_VALUE (func);
-
-  nargs = 0;
-  max_fields = 8;
-  TYPE_FIELDS (ftype) =
-    (struct field *) xmalloc (sizeof (struct field) * max_fields);
-  ALL_BLOCK_SYMBOLS (b, iter, sym)
-  {
-    GROW_VECT (TYPE_FIELDS (ftype), max_fields, nargs + 1);
-
-    switch (SYMBOL_CLASS (sym))
-      {
-      case LOC_REF_ARG:
-      case LOC_REGPARM_ADDR:
-	TYPE_FIELD_BITPOS (ftype, nargs) = nargs;
-	TYPE_FIELD_BITSIZE (ftype, nargs) = 0;
-	TYPE_FIELD_STATIC_KIND (ftype, nargs) = 0;
-	TYPE_FIELD_TYPE (ftype, nargs) =
-	  lookup_pointer_type (check_typedef (SYMBOL_TYPE (sym)));
-	TYPE_FIELD_NAME (ftype, nargs) = DEPRECATED_SYMBOL_NAME (sym);
-	nargs += 1;
-
-	break;
-
-      case LOC_ARG:
-      case LOC_REGPARM:
-      case LOC_LOCAL_ARG:
-      case LOC_BASEREG_ARG:
-      case LOC_COMPUTED_ARG:
-	TYPE_FIELD_BITPOS (ftype, nargs) = nargs;
-	TYPE_FIELD_BITSIZE (ftype, nargs) = 0;
-	TYPE_FIELD_STATIC_KIND (ftype, nargs) = 0;
-	TYPE_FIELD_TYPE (ftype, nargs) = check_typedef (SYMBOL_TYPE (sym));
-	TYPE_FIELD_NAME (ftype, nargs) = DEPRECATED_SYMBOL_NAME (sym);
-	nargs += 1;
-
-	break;
-
-      default:
-	break;
-      }
-  }
-
-  /* Re-allocate fields vector; if there are no fields, make the */
-  /* fields pointer non-null anyway, to mark that this function type */
-  /* has been filled in. */
-
-  TYPE_NFIELDS (ftype) = nargs;
-  if (nargs == 0)
+  if (word == orig_text)
     {
-      static struct field dummy_field = { 0, 0, 0, 0 };
-      xfree (TYPE_FIELDS (ftype));
-      TYPE_FIELDS (ftype) = &dummy_field;
+      completion = xmalloc (strlen (match) + 5);
+      strcpy (completion, match);
+    }
+  else if (word > orig_text)
+    {
+      /* Return some portion of sym_name.  */
+      completion = xmalloc (strlen (match) + 5);
+      strcpy (completion, match + (word - orig_text));
     }
   else
     {
-      struct field *fields =
-	(struct field *) TYPE_ALLOC (ftype, nargs * sizeof (struct field));
-      memcpy ((char *) fields,
-	      (char *) TYPE_FIELDS (ftype), nargs * sizeof (struct field));
-      xfree (TYPE_FIELDS (ftype));
-      TYPE_FIELDS (ftype) = fields;
+      /* Return some of ORIG_TEXT plus sym_name.  */
+      completion = xmalloc (strlen (match) + (orig_text - word) + 5);
+      strncpy (completion, word, orig_text - word);
+      completion[orig_text - word] = '\0';
+      strcat (completion, match);
     }
+
+  string_vector_append (sv, completion);
 }
+
+/* Return a list of possible symbol names completing TEXT0.  The list
+   is NULL terminated.  WORD is the entire command on which completion
+   is made.  */
+
+char **
+ada_make_symbol_completion_list (const char *text0, const char *word)
+{
+  /* Note: This function is almost a copy of make_symbol_completion_list(),
+     except it has been adapted for Ada.  It is somewhat of a shame to
+     duplicate so much code, but we don't really have the infrastructure
+     yet to develop a language-aware version of he symbol completer...  */
+  char *text;
+  int text_len;
+  int wild_match;
+  int encoded;
+  struct string_vector result = xnew_string_vector (128);
+  struct symbol *sym;
+  struct symtab *s;
+  struct partial_symtab *ps;
+  struct minimal_symbol *msymbol;
+  struct objfile *objfile;
+  struct block *b, *surrounding_static_block = 0;
+  int i;
+  struct dict_iterator iter;
+
+  if (text0[0] == '<')
+    {
+      text = xstrdup (text0);
+      make_cleanup (xfree, text);
+      text_len = strlen (text);
+      wild_match = 0;
+      encoded = 1;
+    }
+  else
+    {
+      text = xstrdup (ada_encode (text0));
+      make_cleanup (xfree, text);
+      text_len = strlen (text);
+      for (i = 0; i < text_len; i++)
+        text[i] = tolower (text[i]);
+
+      /* FIXME: brobecker/2003-09-17: When we get rid of ADA_RETAIN_DOTS,
+         we can restrict the wild_match check to searching "__" only.  */
+      wild_match = (strstr (text0, "__") == NULL
+                    && strchr (text0, '.') == NULL);
+      encoded = (strstr (text0, "__") != NULL);
+    }
+
+  /* First, look at the partial symtab symbols.  */
+  ALL_PSYMTABS (objfile, ps)
+  {
+    struct partial_symbol **psym;
+
+    /* If the psymtab's been read in we'll get it when we search
+       through the blockvector.  */
+    if (ps->readin)
+      continue;
+
+    for (psym = objfile->global_psymbols.list + ps->globals_offset;
+         psym < (objfile->global_psymbols.list + ps->globals_offset
+                 + ps->n_global_syms); psym++)
+      {
+        QUIT;
+        symbol_completion_add (&result, SYMBOL_LINKAGE_NAME (*psym),
+                               text, text_len, text0, word,
+                               wild_match, encoded);
+      }
+
+    for (psym = objfile->static_psymbols.list + ps->statics_offset;
+         psym < (objfile->static_psymbols.list + ps->statics_offset
+                 + ps->n_static_syms); psym++)
+      {
+        QUIT;
+        symbol_completion_add (&result, SYMBOL_LINKAGE_NAME (*psym),
+                               text, text_len, text0, word,
+                               wild_match, encoded);
+      }
+  }
+
+  /* At this point scan through the misc symbol vectors and add each
+     symbol you find to the list.  Eventually we want to ignore
+     anything that isn't a text symbol (everything else will be
+     handled by the psymtab code above).  */
+
+  ALL_MSYMBOLS (objfile, msymbol)
+  {
+    QUIT;
+    symbol_completion_add (&result, SYMBOL_LINKAGE_NAME (msymbol),
+                           text, text_len, text0, word, wild_match, encoded);
+  }
+
+  /* Search upwards from currently selected frame (so that we can
+     complete on local vars.  */
+
+  for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b))
+    {
+      if (!BLOCK_SUPERBLOCK (b))
+        surrounding_static_block = b;   /* For elmin of dups */
+
+      ALL_BLOCK_SYMBOLS (b, iter, sym)
+      {
+        symbol_completion_add (&result, SYMBOL_LINKAGE_NAME (sym),
+                               text, text_len, text0, word,
+                               wild_match, encoded);
+      }
+    }
+
+  /* Go through the symtabs and check the externs and statics for
+     symbols which match.  */
+
+  ALL_SYMTABS (objfile, s)
+  {
+    QUIT;
+    b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK);
+    ALL_BLOCK_SYMBOLS (b, iter, sym)
+    {
+      symbol_completion_add (&result, SYMBOL_LINKAGE_NAME (sym),
+                             text, text_len, text0, word,
+                             wild_match, encoded);
+    }
+  }
+
+  ALL_SYMTABS (objfile, s)
+  {
+    QUIT;
+    b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK);
+    /* Don't do this block twice.  */
+    if (b == surrounding_static_block)
+      continue;
+    ALL_BLOCK_SYMBOLS (b, iter, sym)
+    {
+      symbol_completion_add (&result, SYMBOL_LINKAGE_NAME (sym),
+                             text, text_len, text0, word,
+                             wild_match, encoded);
+    }
+  }
+
+  /* Append the closing NULL entry.  */
+  string_vector_append (&result, NULL);
+
+  return (result.array);
+}
+
+#endif /* GNAT_GDB */
 
-
-				/* Breakpoint-related */
-
-char no_symtab_msg[] =
-  "No symbol table is loaded.  Use the \"file\" command.";
+#ifdef GNAT_GDB
+                                /* Breakpoint-related */
 
 /* Assuming that LINE is pointing at the beginning of an argument to
    'break', return a pointer to the delimiter for the initial segment
-   of that name.  This is the first ':', ' ', or end of LINE. 
-*/
+   of that name.  This is the first ':', ' ', or end of LINE.  */
+
 char *
 ada_start_decode_line_1 (char *line)
 {
-  /* [NOTE: strpbrk would be more elegant, but I am reluctant to be
-     the first to use such a library function in GDB code.] */
+  /* NOTE: strpbrk would be more elegant, but I am reluctant to be
+     the first to use such a library function in GDB code.  */
   char *p;
   for (p = line; *p != '\000' && *p != ' ' && *p != ':'; p += 1)
     ;
@@ -4208,33 +5500,32 @@
    command), following any initial file name specification.
 
    Return all symbol table/line specfications (sals) consistent with the
-   information in *SPEC and FILE_TABLE in the
-   following sense: 
+   information in *SPEC and FILE_TABLE in the following sense:
      + FILE_TABLE is null, or the sal refers to a line in the file
        named by FILE_TABLE.
      + If *SPEC points to an argument with a trailing ':LINENUM',
-       then the sal refers to that line (or one following it as closely as 
+       then the sal refers to that line (or one following it as closely as
        possible).
-     + If *SPEC does not start with '*', the sal is in a function with 
+     + If *SPEC does not start with '*', the sal is in a function with
        that name.
 
    Returns with 0 elements if no matching non-minimal symbols found.
 
    If *SPEC begins with a function name of the form <NAME>, then NAME
    is taken as a literal name; otherwise the function name is subject
-   to the usual mangling.
+   to the usual encoding.
 
    *SPEC is updated to point after the function/line number specification.
 
    FUNFIRSTLINE is non-zero if we desire the first line of real code
-   in each function (this is ignored in the presence of a LINENUM spec.).
+   in each function.
 
    If CANONICAL is non-NULL, and if any of the sals require a
    'canonical line spec', then *CANONICAL is set to point to an array
    of strings, corresponding to and equal in length to the returned
-   list of sals, such that (*CANONICAL)[i] is non-null and contains a 
-   canonical line spec for the ith returned sal, if needed.  If no 
-   canonical line specs are required and CANONICAL is non-null, 
+   list of sals, such that (*CANONICAL)[i] is non-null and contains a
+   canonical line spec for the ith returned sal, if needed.  If no
+   canonical line specs are required and CANONICAL is non-null,
    *CANONICAL is set to NULL.
 
    A 'canonical line spec' is simply a name (in the format of the
@@ -4242,43 +5533,48 @@
    with no further contextual information or user selection.  It is
    needed whenever the file name, function name, and line number
    information supplied is insufficient for this unique
-   identification.  Currently overloaded functions, the name '*', 
+   identification.  Currently overloaded functions, the name '*',
    or static functions without a filename yield a canonical line spec.
    The array and the line spec strings are allocated on the heap; it
-   is the caller's responsibility to free them.   */
+   is the caller's responsibility to free them.  */
 
 struct symtabs_and_lines
 ada_finish_decode_line_1 (char **spec, struct symtab *file_table,
-			  int funfirstline, char ***canonical)
+                          int funfirstline, char ***canonical)
 {
-  struct symbol **symbols;
-  struct block **blocks;
-  struct block *block;
+  struct ada_symbol_info *symbols;
+  const struct block *block;
   int n_matches, i, line_num;
   struct symtabs_and_lines selected;
   struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
   char *name;
+  int is_quoted;
 
   int len;
   char *lower_name;
   char *unquoted_name;
 
   if (file_table == NULL)
-    block = get_selected_block (NULL);
+    block = block_static_block (get_selected_block (0));
   else
     block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (file_table), STATIC_BLOCK);
 
   if (canonical != NULL)
     *canonical = (char **) NULL;
 
+  is_quoted = (**spec && strchr (get_gdb_completer_quote_characters (),
+                                 **spec) != NULL);
+
   name = *spec;
   if (**spec == '*')
     *spec += 1;
   else
     {
-      while (**spec != '\000' &&
-	     !strchr (ada_completer_word_break_characters, **spec))
-	*spec += 1;
+      if (is_quoted)
+        *spec = skip_quoted (*spec);
+      while (**spec != '\000'
+             && !strchr (ada_completer_word_break_characters, **spec))
+        *spec += 1;
     }
   len = *spec - name;
 
@@ -4287,15 +5583,16 @@
     {
       line_num = strtol (*spec + 1, spec, 10);
       while (**spec == ' ' || **spec == '\t')
-	*spec += 1;
+        *spec += 1;
     }
 
   if (name[0] == '*')
     {
       if (line_num == -1)
-	error ("Wild-card function with no line number or file name.");
+        error ("Wild-card function with no line number or file name.");
 
-      return all_sals_for_line (file_table->filename, line_num, canonical);
+      return ada_sals_for_line (file_table->filename, line_num,
+                                funfirstline, canonical, 0);
     }
 
   if (name[0] == '\'')
@@ -4318,17 +5615,17 @@
       unquoted_name[len] = '\000';
       lower_name = (char *) alloca (len + 1);
       for (i = 0; i < len; i += 1)
-	lower_name[i] = tolower (name[i]);
+        lower_name[i] = tolower (name[i]);
       lower_name[len] = '\000';
     }
 
   n_matches = 0;
   if (lower_name != NULL)
-    n_matches = ada_lookup_symbol_list (ada_mangle (lower_name), block,
-					VAR_DOMAIN, &symbols, &blocks);
+    n_matches = ada_lookup_symbol_list (ada_encode (lower_name), block,
+                                        VAR_DOMAIN, &symbols);
   if (n_matches == 0)
     n_matches = ada_lookup_symbol_list (unquoted_name, block,
-					VAR_DOMAIN, &symbols, &blocks);
+                                        VAR_DOMAIN, &symbols);
   if (n_matches == 0 && line_num >= 0)
     error ("No line number information found for %s.", unquoted_name);
   else if (n_matches == 0)
@@ -4337,7 +5634,7 @@
       /* FIXME: See comment in symtab.c::decode_line_1 */
 #undef volatile
       volatile struct symtab_and_line val;
-#define volatile		/*nothing */
+#define volatile                /*nothing */
 #else
       struct symtab_and_line val;
 #endif
@@ -4347,43 +5644,47 @@
 
       msymbol = NULL;
       if (lower_name != NULL)
-	msymbol = ada_lookup_minimal_symbol (ada_mangle (lower_name));
+        msymbol = ada_lookup_simple_minsym (ada_encode (lower_name));
       if (msymbol == NULL)
-	msymbol = ada_lookup_minimal_symbol (unquoted_name);
+        msymbol = ada_lookup_simple_minsym (unquoted_name);
       if (msymbol != NULL)
-	{
-	  val.pc = SYMBOL_VALUE_ADDRESS (msymbol);
-	  val.section = SYMBOL_BFD_SECTION (msymbol);
-	  if (funfirstline)
-	    {
-	      val.pc += FUNCTION_START_OFFSET;
-	      SKIP_PROLOGUE (val.pc);
-	    }
-	  selected.sals = (struct symtab_and_line *)
-	    xmalloc (sizeof (struct symtab_and_line));
-	  selected.sals[0] = val;
-	  selected.nelts = 1;
-	  return selected;
-	}
+        {
+          val.pc = SYMBOL_VALUE_ADDRESS (msymbol);
+          val.section = SYMBOL_BFD_SECTION (msymbol);
+          if (funfirstline)
+            {
+              val.pc = gdbarch_convert_from_func_ptr_addr (current_gdbarch,
+							   val.pc,
+							   &current_target);
+              SKIP_PROLOGUE (val.pc);
+            }
+          selected.sals = (struct symtab_and_line *)
+            xmalloc (sizeof (struct symtab_and_line));
+          selected.sals[0] = val;
+          selected.nelts = 1;
+          return selected;
+        }
 
-      if (!have_full_symbols () &&
-	  !have_partial_symbols () && !have_minimal_symbols ())
-	error (no_symtab_msg);
+      if (!have_full_symbols ()
+          && !have_partial_symbols () && !have_minimal_symbols ())
+        error ("No symbol table is loaded.  Use the \"file\" command.");
 
       error ("Function \"%s\" not defined.", unquoted_name);
-      return selected;		/* for lint */
+      return selected;          /* for lint */
     }
 
   if (line_num >= 0)
     {
-      return
-	find_sal_from_funcs_and_line (file_table->filename, line_num,
-				      symbols, n_matches);
+      struct symtabs_and_lines best_sal =
+        find_sal_from_funcs_and_line (file_table->filename, line_num,
+                                      symbols, n_matches);
+      if (funfirstline)
+        adjust_pc_past_prologue (&best_sal.sals[0].pc);
+      return best_sal;
     }
   else
     {
-      selected.nelts =
-	user_select_syms (symbols, blocks, n_matches, n_matches);
+      selected.nelts = user_select_syms (symbols, n_matches, n_matches);
     }
 
   selected.sals = (struct symtab_and_line *)
@@ -4394,23 +5695,25 @@
   i = 0;
   while (i < selected.nelts)
     {
-      if (SYMBOL_CLASS (symbols[i]) == LOC_BLOCK)
-	selected.sals[i] = find_function_start_sal (symbols[i], funfirstline);
-      else if (SYMBOL_LINE (symbols[i]) != 0)
-	{
-	  selected.sals[i].symtab = symtab_for_sym (symbols[i]);
-	  selected.sals[i].line = SYMBOL_LINE (symbols[i]);
-	}
+      if (SYMBOL_CLASS (symbols[i].sym) == LOC_BLOCK)
+        selected.sals[i]
+          = find_function_start_sal (symbols[i].sym, funfirstline);
+      else if (SYMBOL_LINE (symbols[i].sym) != 0)
+        {
+          selected.sals[i].symtab =
+            symbols[i].symtab
+            ? symbols[i].symtab : symtab_for_sym (symbols[i].sym);
+          selected.sals[i].line = SYMBOL_LINE (symbols[i].sym);
+        }
       else if (line_num >= 0)
-	{
-	  /* Ignore this choice */
-	  symbols[i] = symbols[selected.nelts - 1];
-	  blocks[i] = blocks[selected.nelts - 1];
-	  selected.nelts -= 1;
-	  continue;
-	}
+        {
+          /* Ignore this choice */
+          symbols[i] = symbols[selected.nelts - 1];
+          selected.nelts -= 1;
+          continue;
+        }
       else
-	error ("Line number not known for symbol \"%s\"", unquoted_name);
+        error ("Line number not known for symbol \"%s\"", unquoted_name);
       i += 1;
     }
 
@@ -4418,9 +5721,9 @@
     {
       *canonical = (char **) xmalloc (sizeof (char *) * selected.nelts);
       for (i = 0; i < selected.nelts; i += 1)
-	(*canonical)[i] =
-	  extended_canonical_line_spec (selected.sals[i],
-					SYMBOL_PRINT_NAME (symbols[i]));
+        (*canonical)[i] =
+          extended_canonical_line_spec (selected.sals[i],
+                                        SYMBOL_PRINT_NAME (symbols[i].sym));
     }
 
   discard_cleanups (old_chain);
@@ -4428,11 +5731,12 @@
 }
 
 /* The (single) sal corresponding to line LINE_NUM in a symbol table
-   with file name FILENAME that occurs in one of the functions listed 
-   in SYMBOLS[0 .. NSYMS-1]. */
+   with file name FILENAME that occurs in one of the functions listed
+   in the symbol fields of SYMBOLS[0 .. NSYMS-1].  */
+
 static struct symtabs_and_lines
 find_sal_from_funcs_and_line (const char *filename, int line_num,
-			      struct symbol **symbols, int nsyms)
+                              struct ada_symbol_info *symbols, int nsyms)
 {
   struct symtabs_and_lines sals;
   int best_index, best;
@@ -4454,26 +5758,26 @@
 
     QUIT;
 
-    if (!DEPRECATED_STREQ (filename, s->filename))
+    if (strcmp (filename, s->filename) != 0)
       continue;
     l = LINETABLE (s);
     ind = find_line_in_linetable (l, line_num, symbols, nsyms, &exact);
     if (ind >= 0)
       {
-	if (exact)
-	  {
-	    best_index = ind;
-	    best_linetable = l;
-	    best_symtab = s;
-	    goto done;
-	  }
-	if (best == 0 || l->item[ind].line < best)
-	  {
-	    best = l->item[ind].line;
-	    best_index = ind;
-	    best_linetable = l;
-	    best_symtab = s;
-	  }
+        if (exact)
+          {
+            best_index = ind;
+            best_linetable = l;
+            best_symtab = s;
+            goto done;
+          }
+        if (best == 0 || l->item[ind].line < best)
+          {
+            best = l->item[ind].line;
+            best_index = ind;
+            best_linetable = l;
+            best_symtab = s;
+          }
       }
   }
 
@@ -4495,11 +5799,14 @@
 }
 
 /* Return the index in LINETABLE of the best match for LINE_NUM whose
-   pc falls within one of the functions denoted by SYMBOLS[0..NSYMS-1].  
-   Set *EXACTP to the 1 if the match is exact, and 0 otherwise. */
+   pc falls within one of the functions denoted by the symbol fields
+   of SYMBOLS[0..NSYMS-1].  Set *EXACTP to 1 if the match is exact, 
+   and 0 otherwise.  */
+
 static int
 find_line_in_linetable (struct linetable *linetable, int line_num,
-			struct symbol **symbols, int nsyms, int *exactp)
+                        struct ada_symbol_info *symbols, int nsyms,
+                        int *exactp)
 {
   int i, len, best_index, best;
 
@@ -4513,27 +5820,28 @@
       struct linetable_entry *item = &(linetable->item[i]);
 
       for (k = 0; k < nsyms; k += 1)
-	{
-	  if (symbols[k] != NULL && SYMBOL_CLASS (symbols[k]) == LOC_BLOCK
-	      && item->pc >= BLOCK_START (SYMBOL_BLOCK_VALUE (symbols[k]))
-	      && item->pc < BLOCK_END (SYMBOL_BLOCK_VALUE (symbols[k])))
-	    goto candidate;
-	}
+        {
+          if (symbols[k].sym != NULL
+              && SYMBOL_CLASS (symbols[k].sym) == LOC_BLOCK
+              && item->pc >= BLOCK_START (SYMBOL_BLOCK_VALUE (symbols[k].sym))
+              && item->pc < BLOCK_END (SYMBOL_BLOCK_VALUE (symbols[k].sym)))
+            goto candidate;
+        }
       continue;
 
     candidate:
 
       if (item->line == line_num)
-	{
-	  *exactp = 1;
-	  return i;
-	}
+        {
+          *exactp = 1;
+          return i;
+        }
 
       if (item->line > line_num && (best == 0 || item->line < best))
-	{
-	  best = item->line;
-	  best_index = i;
-	}
+        {
+          best = item->line;
+          best_index = i;
+        }
     }
 
   *exactp = 0;
@@ -4542,7 +5850,8 @@
 
 /* Find the smallest k >= LINE_NUM such that k is a line number in
    LINETABLE, and k falls strictly within a named function that begins at
-   or before LINE_NUM.  Return -1 if there is no such k. */
+   or before LINE_NUM.  Return -1 if there is no such k.  */
+
 static int
 nearest_line_number_in_linetable (struct linetable *linetable, int line_num)
 {
@@ -4556,37 +5865,36 @@
   best = INT_MAX;
   while (i < len)
     {
-      int k;
       struct linetable_entry *item = &(linetable->item[i]);
 
       if (item->line >= line_num && item->line < best)
-	{
-	  char *func_name;
-	  CORE_ADDR start, end;
+        {
+          char *func_name;
+          CORE_ADDR start, end;
 
-	  func_name = NULL;
-	  find_pc_partial_function (item->pc, &func_name, &start, &end);
+          func_name = NULL;
+          find_pc_partial_function (item->pc, &func_name, &start, &end);
 
-	  if (func_name != NULL && item->pc < end)
-	    {
-	      if (item->line == line_num)
-		return line_num;
-	      else
-		{
-		  struct symbol *sym =
-		    standard_lookup (func_name, VAR_DOMAIN);
-		  if (is_plausible_func_for_line (sym, line_num))
-		    best = item->line;
-		  else
-		    {
-		      do
-			i += 1;
-		      while (i < len && linetable->item[i].pc < end);
-		      continue;
-		    }
-		}
-	    }
-	}
+          if (func_name != NULL && item->pc < end)
+            {
+              if (item->line == line_num)
+                return line_num;
+              else
+                {
+                  struct symbol *sym =
+                    standard_lookup (func_name, NULL, VAR_DOMAIN);
+                  if (is_plausible_func_for_line (sym, line_num))
+                    best = item->line;
+                  else
+                    {
+                      do
+                        i += 1;
+                      while (i < len && linetable->item[i].pc < end);
+                      continue;
+                    }
+                }
+            }
+        }
 
       i += 1;
     }
@@ -4595,17 +5903,17 @@
 }
 
 
-/* Return the next higher index, k, into LINETABLE such that k > IND, 
+/* Return the next higher index, k, into LINETABLE such that k > IND,
    entry k in LINETABLE has a line number equal to LINE_NUM, k
-   corresponds to a PC that is in a function different from that 
+   corresponds to a PC that is in a function different from that
    corresponding to IND, and falls strictly within a named function
-   that begins at a line at or preceding STARTING_LINE.  
-   Return -1 if there is no such k.  
-   IND == -1 corresponds to no function. */
+   that begins at a line at or preceding STARTING_LINE.
+   Return -1 if there is no such k.
+   IND == -1 corresponds to no function.  */
 
 static int
 find_next_line_in_linetable (struct linetable *linetable, int line_num,
-			     int starting_line, int ind)
+                             int starting_line, int ind)
 {
   int i, len;
 
@@ -4618,13 +5926,13 @@
       CORE_ADDR start, end;
 
       if (find_pc_partial_function (linetable->item[ind].pc,
-				    (char **) NULL, &start, &end))
-	{
-	  while (ind < len && linetable->item[ind].pc < end)
-	    ind += 1;
-	}
+                                    (char **) NULL, &start, &end))
+        {
+          while (ind < len && linetable->item[ind].pc < end)
+            ind += 1;
+        }
       else
-	ind += 1;
+        ind += 1;
     }
   else
     ind = 0;
@@ -4632,33 +5940,32 @@
   i = ind;
   while (i < len)
     {
-      int k;
       struct linetable_entry *item = &(linetable->item[i]);
 
       if (item->line >= line_num)
-	{
-	  char *func_name;
-	  CORE_ADDR start, end;
+        {
+          char *func_name;
+          CORE_ADDR start, end;
 
-	  func_name = NULL;
-	  find_pc_partial_function (item->pc, &func_name, &start, &end);
+          func_name = NULL;
+          find_pc_partial_function (item->pc, &func_name, &start, &end);
 
-	  if (func_name != NULL && item->pc < end)
-	    {
-	      if (item->line == line_num)
-		{
-		  struct symbol *sym =
-		    standard_lookup (func_name, VAR_DOMAIN);
-		  if (is_plausible_func_for_line (sym, starting_line))
-		    return i;
-		  else
-		    {
-		      while ((i + 1) < len && linetable->item[i + 1].pc < end)
-			i += 1;
-		    }
-		}
-	    }
-	}
+          if (func_name != NULL && item->pc < end)
+            {
+              if (item->line == line_num)
+                {
+                  struct symbol *sym =
+                    standard_lookup (func_name, NULL, VAR_DOMAIN);
+                  if (is_plausible_func_for_line (sym, starting_line))
+                    return i;
+                  else
+                    {
+                      while ((i + 1) < len && linetable->item[i + 1].pc < end)
+                        i += 1;
+                    }
+                }
+            }
+        }
       i += 1;
     }
 
@@ -4666,7 +5973,8 @@
 }
 
 /* True iff function symbol SYM starts somewhere at or before line #
-   LINE_NUM. */
+   LINE_NUM.  */
+
 static int
 is_plausible_func_for_line (struct symbol *sym, int line_num)
 {
@@ -4680,68 +5988,9 @@
   return (start_sal.line != 0 && line_num >= start_sal.line);
 }
 
-static void
-debug_print_lines (struct linetable *lt)
-{
-  int i;
-
-  if (lt == NULL)
-    return;
-
-  fprintf (stderr, "\t");
-  for (i = 0; i < lt->nitems; i += 1)
-    fprintf (stderr, "(%d->%p) ", lt->item[i].line, (void *) lt->item[i].pc);
-  fprintf (stderr, "\n");
-}
-
-static void
-debug_print_block (struct block *b)
-{
-  struct dict_iterator iter;
-  struct symbol *sym;
-
-  fprintf (stderr, "Block: %p; [0x%lx, 0x%lx]",
-	   b, BLOCK_START (b), BLOCK_END (b));
-  if (BLOCK_FUNCTION (b) != NULL)
-    fprintf (stderr, " Function: %s", DEPRECATED_SYMBOL_NAME (BLOCK_FUNCTION (b)));
-  fprintf (stderr, "\n");
-  fprintf (stderr, "\t    Superblock: %p\n", BLOCK_SUPERBLOCK (b));
-  fprintf (stderr, "\t    Symbols:");
-  ALL_BLOCK_SYMBOLS (b, iter, sym)
-  {
-    fprintf (stderr, " %s", DEPRECATED_SYMBOL_NAME (sym));
-  }
-  fprintf (stderr, "\n");
-}
-
-static void
-debug_print_blocks (struct blockvector *bv)
-{
-  int i;
-
-  if (bv == NULL)
-    return;
-  for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i += 1)
-    {
-      fprintf (stderr, "%6d. ", i);
-      debug_print_block (BLOCKVECTOR_BLOCK (bv, i));
-    }
-}
-
-static void
-debug_print_symtab (struct symtab *s)
-{
-  fprintf (stderr, "Symtab %p\n    File: %s; Dir: %s\n", s,
-	   s->filename, s->dirname);
-  fprintf (stderr, "    Blockvector: %p, Primary: %d\n",
-	   BLOCKVECTOR (s), s->primary);
-  debug_print_blocks (BLOCKVECTOR (s));
-  fprintf (stderr, "    Line table: %p\n", LINETABLE (s));
-  debug_print_lines (LINETABLE (s));
-}
-
 /* Read in all symbol tables corresponding to partial symbol tables
-   with file name FILENAME. */
+   with file name FILENAME.  */
+
 static void
 read_all_symtabs (const char *filename)
 {
@@ -4752,16 +6001,24 @@
   {
     QUIT;
 
-    if (DEPRECATED_STREQ (filename, ps->filename))
+    if (strcmp (filename, ps->filename) == 0)
       PSYMTAB_TO_SYMTAB (ps);
   }
 }
 
 /* All sals corresponding to line LINE_NUM in a symbol table from file
-   FILENAME, as filtered by the user.  If CANONICAL is not null, set
-   it to a corresponding array of canonical line specs. */
-static struct symtabs_and_lines
-all_sals_for_line (const char *filename, int line_num, char ***canonical)
+   FILENAME, as filtered by the user.  Filter out any lines that
+   reside in functions with "suppressed" names (not corresponding to
+   explicit Ada functions), if there is at least one in a function
+   with a non-suppressed name.  If CANONICAL is not null, set
+   it to a corresponding array of canonical line specs.
+   If ONE_LOCATION_ONLY is set and several matches are found for
+   the given location, then automatically select the first match found
+   instead of asking the user which instance should be returned.  */
+
+struct symtabs_and_lines
+ada_sals_for_line (const char *filename, int line_num,
+                   int funfirstline, char ***canonical, int one_location_only)
 {
   struct symtabs_and_lines result;
   struct objfile *objfile;
@@ -4783,7 +6040,7 @@
 
     QUIT;
 
-    if (!DEPRECATED_STREQ (s->filename, filename))
+    if (strcmp (s->filename, filename) != 0)
       continue;
 
     target_line_num =
@@ -4794,82 +6051,119 @@
     ind = -1;
     while (1)
       {
-	ind =
-	  find_next_line_in_linetable (LINETABLE (s),
-				       target_line_num, line_num, ind);
+        ind =
+          find_next_line_in_linetable (LINETABLE (s),
+                                       target_line_num, line_num, ind);
 
-	if (ind < 0)
-	  break;
+        if (ind < 0)
+          break;
 
-	GROW_VECT (result.sals, len, result.nelts + 1);
-	init_sal (&result.sals[result.nelts]);
-	result.sals[result.nelts].line = LINETABLE (s)->item[ind].line;
-	result.sals[result.nelts].pc = LINETABLE (s)->item[ind].pc;
-	result.sals[result.nelts].symtab = s;
-	result.nelts += 1;
+        GROW_VECT (result.sals, len, result.nelts + 1);
+        init_sal (&result.sals[result.nelts]);
+        result.sals[result.nelts].line = line_num;
+        result.sals[result.nelts].pc = LINETABLE (s)->item[ind].pc;
+        result.sals[result.nelts].symtab = s;
+
+        if (funfirstline)
+          adjust_pc_past_prologue (&result.sals[result.nelts].pc);
+
+        result.nelts += 1;
       }
   }
 
   if (canonical != NULL || result.nelts > 1)
     {
-      int k;
+      int k, j, n;
       char **func_names = (char **) alloca (result.nelts * sizeof (char *));
       int first_choice = (result.nelts > 1) ? 2 : 1;
-      int n;
       int *choices = (int *) alloca (result.nelts * sizeof (int));
 
       for (k = 0; k < result.nelts; k += 1)
-	{
-	  find_pc_partial_function (result.sals[k].pc, &func_names[k],
-				    (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
-	  if (func_names[k] == NULL)
-	    error ("Could not find function for one or more breakpoints.");
-	}
+        {
+          find_pc_partial_function (result.sals[k].pc, &func_names[k],
+                                    (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
+          if (func_names[k] == NULL)
+            error ("Could not find function for one or more breakpoints.");
+        }
+
+      /* Remove suppressed names, unless all are suppressed.  */
+      for (j = 0; j < result.nelts; j += 1)
+        if (!is_suppressed_name (func_names[j]))
+          {
+            /* At least one name is unsuppressed, so remove all
+               suppressed names.  */
+            for (k = n = 0; k < result.nelts; k += 1)
+              if (!is_suppressed_name (func_names[k]))
+                {
+                  func_names[n] = func_names[k];
+                  result.sals[n] = result.sals[k];
+                  n += 1;
+                }
+            result.nelts = n;
+            break;
+          }
 
       if (result.nelts > 1)
-	{
-	  printf_unfiltered ("[0] cancel\n");
-	  if (result.nelts > 1)
-	    printf_unfiltered ("[1] all\n");
-	  for (k = 0; k < result.nelts; k += 1)
-	    printf_unfiltered ("[%d] %s\n", k + first_choice,
-			       ada_demangle (func_names[k]));
+        {
+          if (one_location_only)
+            {
+              /* Automatically select the first of all possible choices.  */
+              n = 1;
+              choices[0] = 0;
+            }
+          else
+            {
+              printf_unfiltered ("[0] cancel\n");
+              if (result.nelts > 1)
+                printf_unfiltered ("[1] all\n");
+              for (k = 0; k < result.nelts; k += 1)
+                printf_unfiltered ("[%d] %s\n", k + first_choice,
+                                   ada_decode (func_names[k]));
 
-	  n = get_selections (choices, result.nelts, result.nelts,
-			      result.nelts > 1, "instance-choice");
+              n = get_selections (choices, result.nelts, result.nelts,
+                                  result.nelts > 1, "instance-choice");
+            }
 
-	  for (k = 0; k < n; k += 1)
-	    {
-	      result.sals[k] = result.sals[choices[k]];
-	      func_names[k] = func_names[choices[k]];
-	    }
-	  result.nelts = n;
-	}
+          for (k = 0; k < n; k += 1)
+            {
+              result.sals[k] = result.sals[choices[k]];
+              func_names[k] = func_names[choices[k]];
+            }
+          result.nelts = n;
+        }
 
-      if (canonical != NULL)
-	{
-	  *canonical = (char **) xmalloc (result.nelts * sizeof (char **));
-	  make_cleanup (xfree, *canonical);
-	  for (k = 0; k < result.nelts; k += 1)
-	    {
-	      (*canonical)[k] =
-		extended_canonical_line_spec (result.sals[k], func_names[k]);
-	      if ((*canonical)[k] == NULL)
-		error ("Could not locate one or more breakpoints.");
-	      make_cleanup (xfree, (*canonical)[k]);
-	    }
-	}
+      if (canonical != NULL && result.nelts == 0)
+        *canonical = NULL;
+      else if (canonical != NULL)
+        {
+          *canonical = (char **) xmalloc (result.nelts * sizeof (char **));
+          make_cleanup (xfree, *canonical);
+          for (k = 0; k < result.nelts; k += 1)
+            {
+              (*canonical)[k] =
+                extended_canonical_line_spec (result.sals[k], func_names[k]);
+              if ((*canonical)[k] == NULL)
+                error ("Could not locate one or more breakpoints.");
+              make_cleanup (xfree, (*canonical)[k]);
+            }
+        }
     }
 
-  discard_cleanups (old_chain);
+  if (result.nelts == 0)
+    {
+      do_cleanups (old_chain);
+      result.sals = NULL;
+    }
+  else
+    discard_cleanups (old_chain);
   return result;
 }
 
 
 /* A canonical line specification of the form FILE:NAME:LINENUM for
    symbol table and line data SAL.  NULL if insufficient
-   information. The caller is responsible for releasing any space
-   allocated. */
+   information.  The caller is responsible for releasing any space
+   allocated.  */
 
 static char *
 extended_canonical_line_spec (struct symtab_and_line sal, const char *name)
@@ -4880,161 +6174,260 @@
     return NULL;
 
   r = (char *) xmalloc (strlen (name) + strlen (sal.symtab->filename)
-			+ sizeof (sal.line) * 3 + 3);
+                        + sizeof (sal.line) * 3 + 3);
   sprintf (r, "%s:'%s':%d", sal.symtab->filename, name, sal.line);
   return r;
 }
 
-#if 0
-int begin_bnum = -1;
-#endif
-int begin_annotate_level = 0;
+/* Return type of Ada breakpoint associated with bp_stat:
+   0 if not an Ada-specific breakpoint, 1 for break on specific exception,
+   2 for break on unhandled exception, 3 for assert.  */
 
-static void
-begin_cleanup (void *dummy)
+static int
+ada_exception_breakpoint_type (bpstat bs)
 {
-  begin_annotate_level = 0;
+  return ((!bs || !bs->breakpoint_at) ? 0
+          : bs->breakpoint_at->break_on_exception);
 }
 
-static void
-begin_command (char *args, int from_tty)
+/* True iff FRAME is very likely to be that of a function that is
+   part of the runtime system.  This is all very heuristic, but is
+   intended to be used as advice as to what frames are uninteresting
+   to most users.  */
+
+static int
+is_known_support_routine (struct frame_info *frame)
 {
-  struct minimal_symbol *msym;
-  CORE_ADDR main_program_name_addr;
-  char main_program_name[1024];
-  struct cleanup *old_chain = make_cleanup (begin_cleanup, NULL);
-  begin_annotate_level = 2;
+  struct frame_info *next_frame = get_next_frame (frame);
+  /* If frame is not innermost, that normally means that frame->pc
+     points to *after* the call instruction, and we want to get the line
+     containing the call, never the next line.  But if the next frame is
+     a signal_handler_caller or a dummy frame, then the next frame was
+     not entered as the result of a call, and we want to get the line
+     containing frame->pc.  */
+  const int pc_is_after_call =
+    next_frame != NULL
+    && get_frame_type (next_frame) != SIGTRAMP_FRAME
+    && get_frame_type (next_frame) != DUMMY_FRAME;
+  struct symtab_and_line sal
+    = find_pc_line (get_frame_pc (frame), pc_is_after_call);
+  char *func_name;
+  int i;
+  struct stat st;
 
-  /* Check that there is a program to debug */
-  if (!have_full_symbols () && !have_partial_symbols ())
-    error ("No symbol table is loaded.  Use the \"file\" command.");
+  /* The heuristic:
+     1. The symtab is null (indicating no debugging symbols)
+     2. The symtab's filename does not exist.
+     3. The object file's name is one of the standard libraries.
+     4. The symtab's file name has the form of an Ada library source file.
+     5. The function at frame's PC has a GNAT-compiler-generated name.  */
 
-  /* Check that we are debugging an Ada program */
-  /*  if (ada_update_initial_language (language_unknown, NULL) != language_ada)
-     error ("Cannot find the Ada initialization procedure.  Is this an Ada main program?");
-   */
-  /* FIXME: language_ada should be defined in defs.h */
+  if (sal.symtab == NULL)
+    return 1;
 
-  /* Get the address of the name of the main procedure */
-  msym = lookup_minimal_symbol (ADA_MAIN_PROGRAM_SYMBOL_NAME, NULL, NULL);
+  /* On some systems (e.g. VxWorks), the kernel contains debugging
+     symbols; in this case, the filename referenced by these symbols
+     does not exists.  */
 
-  if (msym != NULL)
+  if (stat (sal.symtab->filename, &st))
+    return 1;
+
+  for (i = 0; known_runtime_file_name_patterns[i] != NULL; i += 1)
     {
-      main_program_name_addr = SYMBOL_VALUE_ADDRESS (msym);
-      if (main_program_name_addr == 0)
-	error ("Invalid address for Ada main program name.");
-
-      /* Read the name of the main procedure */
-      extract_string (main_program_name_addr, main_program_name);
-
-      /* Put a temporary breakpoint in the Ada main program and run */
-      do_command ("tbreak ", main_program_name, 0);
-      do_command ("run ", args, 0);
+      re_comp (known_runtime_file_name_patterns[i]);
+      if (re_exec (sal.symtab->filename))
+        return 1;
     }
+  if (sal.symtab->objfile != NULL)
+    {
+      for (i = 0; known_runtime_file_name_patterns[i] != NULL; i += 1)
+        {
+          re_comp (known_runtime_file_name_patterns[i]);
+          if (re_exec (sal.symtab->objfile->name))
+            return 1;
+        }
+    }
+
+  /* If the frame PC points after the call instruction, then we need to
+     decrement it in order to search for the function associated to this
+     PC.  Otherwise, if the associated call was the last instruction of
+     the function, we might either find the wrong function or even fail
+     during the function name lookup.  */
+  if (pc_is_after_call)
+    func_name = function_name_from_pc (get_frame_pc (frame) - 1);
   else
-    {
-      /* If we could not find the symbol containing the name of the
-         main program, that means that the compiler that was used to build
-         was not recent enough. In that case, we fallback to the previous
-         mechanism, which is a little bit less reliable, but has proved to work
-         in most cases. The only cases where it will fail is when the user
-         has set some breakpoints which will be hit before the end of the
-         begin command processing (eg in the initialization code).
+    func_name = function_name_from_pc (get_frame_pc (frame));
 
-         The begining of the main Ada subprogram is located by breaking
-         on the adainit procedure. Since we know that the binder generates
-         the call to this procedure exactly 2 calls before the call to the
-         Ada main subprogram, it is then easy to put a breakpoint on this
-         Ada main subprogram once we hit adainit.
-       */
-      do_command ("tbreak adainit", 0);
-      do_command ("run ", args, 0);
-      do_command ("up", 0);
-      do_command ("tbreak +2", 0);
-      do_command ("continue", 0);
-      do_command ("step", 0);
+  if (func_name == NULL)
+    return 1;
+
+  for (i = 0; known_auxiliary_function_name_patterns[i] != NULL; i += 1)
+    {
+      re_comp (known_auxiliary_function_name_patterns[i]);
+      if (re_exec (func_name))
+        return 1;
     }
 
-  do_cleanups (old_chain);
+  return 0;
 }
 
-int
-is_ada_runtime_file (char *filename)
-{
-  return (DEPRECATED_STREQN (filename, "s-", 2) ||
-	  DEPRECATED_STREQN (filename, "a-", 2) ||
-	  DEPRECATED_STREQN (filename, "g-", 2) || DEPRECATED_STREQN (filename, "i-", 2));
-}
-
-/* find the first frame that contains debugging information and that is not
-   part of the Ada run-time, starting from fi and moving upward. */
-
-int
-find_printable_frame (struct frame_info *fi, int level)
-{
-  struct symtab_and_line sal;
-
-  for (; fi != NULL; level += 1, fi = get_prev_frame (fi))
-    {
-      find_frame_sal (fi, &sal);
-      if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename))
-	{
-#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
-	  /* libpthread.so contains some debugging information that prevents us
-	     from finding the right frame */
-
-	  if (sal.symtab->objfile &&
-	      DEPRECATED_STREQ (sal.symtab->objfile->name, "/usr/shlib/libpthread.so"))
-	    continue;
-#endif
-	  deprecated_selected_frame = fi;
-	  break;
-	}
-    }
-
-  return level;
-}
+/* Find the first frame that contains debugging information and that is not
+   part of the Ada run-time, starting from FI and moving upward.  */
 
 void
-ada_report_exception_break (struct breakpoint *b)
+ada_find_printable_frame (struct frame_info *fi)
 {
-  /* FIXME: break_on_exception should be defined in breakpoint.h */
-  /*  if (b->break_on_exception == 1)
-     {
-     /* Assume that cond has 16 elements, the 15th
-   being the exception *//*
-   if (b->cond && b->cond->nelts == 16)
-   {
-   ui_out_text (uiout, "on ");
-   ui_out_field_string (uiout, "exception",
-   SYMBOL_NAME (b->cond->elts[14].symbol));
-   }
-   else
-   ui_out_text (uiout, "on all exceptions");
-   }
-   else if (b->break_on_exception == 2)
-   ui_out_text (uiout, "on unhandled exception");
-   else if (b->break_on_exception == 3)
-   ui_out_text (uiout, "on assert failure");
-   #else
-   if (b->break_on_exception == 1)
-   { */
-  /* Assume that cond has 16 elements, the 15th
-   being the exception *//*
-   if (b->cond && b->cond->nelts == 16)
-   {
-   fputs_filtered ("on ", gdb_stdout);
-   fputs_filtered (SYMBOL_NAME
-   (b->cond->elts[14].symbol), gdb_stdout);
-   }
-   else
-   fputs_filtered ("on all exceptions", gdb_stdout);
-   }
-   else if (b->break_on_exception == 2)
-   fputs_filtered ("on unhandled exception", gdb_stdout);
-   else if (b->break_on_exception == 3)
-   fputs_filtered ("on assert failure", gdb_stdout);
- */
+  for (; fi != NULL; fi = get_prev_frame (fi))
+    {
+      if (!is_known_support_routine (fi))
+        {
+          select_frame (fi);
+          break;
+        }
+    }
+
+}
+
+/* Name found for exception associated with last bpstat sent to
+   ada_adjust_exception_stop.  Set to the null string if that bpstat
+   did not correspond to an Ada exception or no name could be found.  */
+
+static char last_exception_name[256];
+
+/* If BS indicates a stop in an Ada exception, try to go up to a frame
+   that will be meaningful to the user, and save the name of the last
+   exception (truncated, if necessary) in last_exception_name.  */
+
+void
+ada_adjust_exception_stop (bpstat bs)
+{
+  CORE_ADDR addr;
+  struct frame_info *fi;
+  int frame_level;
+  char *selected_frame_func;
+
+  addr = 0;
+  last_exception_name[0] = '\0';
+  fi = get_selected_frame ();
+  selected_frame_func = function_name_from_pc (get_frame_pc (fi));
+
+  switch (ada_exception_breakpoint_type (bs))
+    {
+    default:
+      return;
+    case 1:
+      break;
+    case 2:
+      /* Unhandled exceptions.  Select the frame corresponding to
+         ada.exceptions.process_raise_exception.  This frame is at
+         least 2 levels up, so we simply skip the first 2 frames
+         without checking the name of their associated function.  */
+      for (frame_level = 0; frame_level < 2; frame_level += 1)
+        if (fi != NULL)
+          fi = get_prev_frame (fi);
+      while (fi != NULL)
+        {
+          const char *func_name = function_name_from_pc (get_frame_pc (fi));
+          if (func_name != NULL
+              && strcmp (func_name, process_raise_exception_name) == 0)
+            break;              /* We found the frame we were looking for...  */
+          fi = get_prev_frame (fi);
+        }
+      if (fi == NULL)
+        break;
+      select_frame (fi);
+      break;
+    }
+
+  addr = parse_and_eval_address ("e.full_name");
+
+  if (addr != 0)
+    read_memory (addr, last_exception_name, sizeof (last_exception_name) - 1);
+  last_exception_name[sizeof (last_exception_name) - 1] = '\0';
+  ada_find_printable_frame (get_selected_frame ());
+}
+
+/* Output Ada exception name (if any) associated with last call to
+   ada_adjust_exception_stop.  */
+
+void
+ada_print_exception_stop (bpstat bs)
+{
+  if (last_exception_name[0] != '\000')
+    {
+      ui_out_text (uiout, last_exception_name);
+      ui_out_text (uiout, " at ");
+    }
+}
+
+/* Parses the CONDITION string associated with a breakpoint exception
+   to get the name of the exception on which the breakpoint has been
+   set.  The returned string needs to be deallocated after use.  */
+
+static char *
+exception_name_from_cond (const char *condition)
+{
+  char *start, *end, *exception_name;
+  int exception_name_len;
+
+  start = strrchr (condition, '&') + 1;
+  end = strchr (start, ')') - 1;
+  exception_name_len = end - start + 1;
+
+  exception_name =
+    (char *) xmalloc ((exception_name_len + 1) * sizeof (char));
+  sprintf (exception_name, "%.*s", exception_name_len, start);
+
+  return exception_name;
+}
+
+/* Print Ada-specific exception information about B, other than task
+   clause.  Return non-zero iff B was an Ada exception breakpoint.  */
+
+int
+ada_print_exception_breakpoint_nontask (struct breakpoint *b)
+{
+  if (b->break_on_exception == 1)
+    {
+      if (b->cond_string)       /* the breakpoint is on a specific exception.  */
+        {
+          char *exception_name = exception_name_from_cond (b->cond_string);
+
+          make_cleanup (xfree, exception_name);
+
+          ui_out_text (uiout, "on ");
+          if (ui_out_is_mi_like_p (uiout))
+            ui_out_field_string (uiout, "exception", exception_name);
+          else
+            {
+              ui_out_text (uiout, "exception ");
+              ui_out_text (uiout, exception_name);
+              ui_out_text (uiout, " ");
+            }
+        }
+      else
+        ui_out_text (uiout, "on all exceptions");
+    }
+  else if (b->break_on_exception == 2)
+    ui_out_text (uiout, "on unhandled exception");
+  else if (b->break_on_exception == 3)
+    ui_out_text (uiout, "on assert failure");
+  else
+    return 0;
+  return 1;
+}
+
+/* Print task identifier for breakpoint B, if it is an Ada-specific
+   breakpoint with non-zero tasking information.  */
+
+void
+ada_print_exception_breakpoint_task (struct breakpoint *b)
+{
+  if (b->task != 0)
+    {
+      ui_out_text (uiout, " task ");
+      ui_out_field_int (uiout, "task", b->task);
+    }
 }
 
 int
@@ -5043,91 +6436,149 @@
   char *type_name = type_name_no_tag (SYMBOL_TYPE (sym));
 
   return (SYMBOL_CLASS (sym) != LOC_TYPEDEF
-	  && SYMBOL_CLASS (sym) != LOC_BLOCK
-	  && SYMBOL_CLASS (sym) != LOC_CONST
-	  && type_name != NULL && DEPRECATED_STREQ (type_name, "exception"));
+          && SYMBOL_CLASS (sym) != LOC_BLOCK
+          && SYMBOL_CLASS (sym) != LOC_CONST
+          && type_name != NULL && strcmp (type_name, "exception") == 0);
 }
 
 int
 ada_maybe_exception_partial_symbol (struct partial_symbol *sym)
 {
   return (SYMBOL_CLASS (sym) != LOC_TYPEDEF
-	  && SYMBOL_CLASS (sym) != LOC_BLOCK
-	  && SYMBOL_CLASS (sym) != LOC_CONST);
+          && SYMBOL_CLASS (sym) != LOC_BLOCK
+          && SYMBOL_CLASS (sym) != LOC_CONST);
+}
+
+/* Cause the appropriate error if no appropriate runtime symbol is
+   found to set a breakpoint, using ERR_DESC to describe the
+   breakpoint.  */
+
+static void
+error_breakpoint_runtime_sym_not_found (const char *err_desc)
+{
+  /* If we are not debugging an Ada program, we can not put exception
+     breakpoints!  */
+
+  if (ada_update_initial_language (language_unknown, NULL) != language_ada)
+    error ("Unable to break on %s.  Is this an Ada main program?", err_desc);
+
+  /* If the symbol does not exist, then check that the program is
+     already started, to make sure that shared libraries have been
+     loaded.  If it is not started, this may mean that the symbol is
+     in a shared library.  */
+
+  if (ptid_get_pid (inferior_ptid) == 0)
+    error ("Unable to break on %s. Try to start the program first.",
+           err_desc);
+
+  /* At this point, we know that we are debugging an Ada program and
+     that the inferior has been started, but we still are not able to
+     find the run-time symbols. That can mean that we are in
+     configurable run time mode, or that a-except as been optimized
+     out by the linker...  In any case, at this point it is not worth
+     supporting this feature.  */
+
+  error ("Cannot break on %s in this configuration.", err_desc);
+}
+
+/* Test if NAME is currently defined, and that either ALLOW_TRAMP or
+   the symbol is not a shared-library trampoline.  Return the result of
+   the test.  */
+
+static int
+is_runtime_sym_defined (const char *name, int allow_tramp)
+{
+  struct minimal_symbol *msym;
+
+  msym = lookup_minimal_symbol (name, NULL, NULL);
+  return (msym != NULL && msym->type != mst_unknown
+          && (allow_tramp || msym->type != mst_solib_trampoline));
 }
 
 /* If ARG points to an Ada exception or assert breakpoint, rewrite
-   into equivalent form.  Return resulting argument string. Set
+   into equivalent form.  Return resulting argument string.  Set
    *BREAK_ON_EXCEPTIONP to 1 for ordinary break on exception, 2 for
-   break on unhandled, 3 for assert, 0 otherwise. */
+   break on unhandled, 3 for assert, 0 otherwise.  */
+
 char *
 ada_breakpoint_rewrite (char *arg, int *break_on_exceptionp)
 {
   if (arg == NULL)
     return arg;
   *break_on_exceptionp = 0;
-  /* FIXME: language_ada should be defined in defs.h */
-  /*  if (current_language->la_language == language_ada
-     && DEPRECATED_STREQN (arg, "exception", 9) &&
-     (arg[9] == ' ' || arg[9] == '\t' || arg[9] == '\0'))
-     {
-     char *tok, *end_tok;
-     int toklen;
+  if (current_language->la_language == language_ada
+      && strncmp (arg, "exception", 9) == 0
+      && (arg[9] == ' ' || arg[9] == '\t' || arg[9] == '\0'))
+    {
+      char *tok, *end_tok;
+      int toklen;
+      int has_exception_propagation =
+        is_runtime_sym_defined (raise_sym_name, 1);
 
-     *break_on_exceptionp = 1;
+      *break_on_exceptionp = 1;
 
-     tok = arg+9;
-     while (*tok == ' ' || *tok == '\t')
-     tok += 1;
+      tok = arg + 9;
+      while (*tok == ' ' || *tok == '\t')
+        tok += 1;
 
-     end_tok = tok;
+      end_tok = tok;
 
-     while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000')
-     end_tok += 1;
+      while (*end_tok != ' ' && *end_tok != '\t' && *end_tok != '\000')
+        end_tok += 1;
 
-     toklen = end_tok - tok;
+      toklen = end_tok - tok;
 
-     arg = (char*) xmalloc (sizeof ("__gnat_raise_nodefer_with_msg if "
-     "long_integer(e) = long_integer(&)")
-     + toklen + 1);
-     make_cleanup (xfree, arg);
-     if (toklen == 0)
-     strcpy (arg, "__gnat_raise_nodefer_with_msg");
-     else if (DEPRECATED_STREQN (tok, "unhandled", toklen))
-     {
-     *break_on_exceptionp = 2;
-     strcpy (arg, "__gnat_unhandled_exception");
-     }
-     else
-     {
-     sprintf (arg, "__gnat_raise_nodefer_with_msg if "
-     "long_integer(e) = long_integer(&%.*s)", 
-     toklen, tok);
-     }
-     }
-     else if (current_language->la_language == language_ada
-     && DEPRECATED_STREQN (arg, "assert", 6) &&
-     (arg[6] == ' ' || arg[6] == '\t' || arg[6] == '\0'))
-     {
-     char *tok = arg + 6;
+      arg = (char *) xmalloc (sizeof (longest_exception_template) + toklen);
+      make_cleanup (xfree, arg);
+      if (toklen == 0)
+        {
+          if (has_exception_propagation)
+            sprintf (arg, "'%s'", raise_sym_name);
+          else
+            error_breakpoint_runtime_sym_not_found ("exception");
+        }
+      else if (strncmp (tok, "unhandled", toklen) == 0)
+        {
+          if (is_runtime_sym_defined (raise_unhandled_sym_name, 1))
+            sprintf (arg, "'%s'", raise_unhandled_sym_name);
+          else
+            error_breakpoint_runtime_sym_not_found ("exception");
 
-     *break_on_exceptionp = 3;
+          *break_on_exceptionp = 2;
+        }
+      else
+        {
+          if (is_runtime_sym_defined (raise_sym_name, 0))
+            sprintf (arg, "'%s' if long_integer(e) = long_integer(&%.*s)",
+                     raise_sym_name, toklen, tok);
+          else
+            error_breakpoint_runtime_sym_not_found ("specific exception");
+        }
+    }
+  else if (current_language->la_language == language_ada
+           && strncmp (arg, "assert", 6) == 0
+           && (arg[6] == ' ' || arg[6] == '\t' || arg[6] == '\0'))
+    {
+      char *tok = arg + 6;
 
-     arg = (char*) 
-     xmalloc (sizeof ("system__assertions__raise_assert_failure")
-     + strlen (tok) + 1);
-     make_cleanup (xfree, arg);
-     sprintf (arg, "system__assertions__raise_assert_failure%s", tok);
-     }
-   */
+      if (!is_runtime_sym_defined (raise_assert_sym_name, 1))
+        error_breakpoint_runtime_sym_not_found ("failed assertion");
+
+      *break_on_exceptionp = 3;
+
+      arg =
+        (char *) xmalloc (sizeof (raise_assert_sym_name) + strlen (tok) + 2);
+      make_cleanup (xfree, arg);
+      sprintf (arg, "'%s'%s", raise_assert_sym_name, tok);
+    }
   return arg;
 }
+#endif
 
-
-				/* Field Access */
+                                /* Field Access */
 
 /* True if field number FIELD_NUM in struct or union type TYPE is supposed
-   to be invisible to users. */
+   to be invisible to users.  */
 
 int
 ada_is_ignored_field (struct type *type, int field_num)
@@ -5138,30 +6589,43 @@
     {
       const char *name = TYPE_FIELD_NAME (type, field_num);
       return (name == NULL
-	      || (name[0] == '_' && !DEPRECATED_STREQN (name, "_parent", 7)));
+              || (name[0] == '_' && strncmp (name, "_parent", 7) != 0));
     }
 }
 
-/* True iff structure type TYPE has a tag field. */
+/* True iff TYPE has a tag field.  If REFOK, then TYPE may also be a
+   pointer or reference type whose ultimate target has a tag field. */
 
 int
-ada_is_tagged_type (struct type *type)
+ada_is_tagged_type (struct type *type, int refok)
 {
-  if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT)
-    return 0;
-
-  return (ada_lookup_struct_elt_type (type, "_tag", 1, NULL) != NULL);
+  return (ada_lookup_struct_elt_type (type, "_tag", refok, 1, NULL) != NULL);
 }
 
-/* The type of the tag on VAL. */
+/* True iff TYPE represents the type of X'Tag */
+
+int
+ada_is_tag_type (struct type *type)
+{
+  if (type == NULL || TYPE_CODE (type) != TYPE_CODE_PTR)
+    return 0;
+  else
+    {
+      const char *name = ada_type_name (TYPE_TARGET_TYPE (type));
+      return (name != NULL
+              && strcmp (name, "ada__tags__dispatch_table") == 0);
+    }
+}
+
+/* The type of the tag on VAL.  */
 
 struct type *
 ada_tag_type (struct value *val)
 {
-  return ada_lookup_struct_elt_type (VALUE_TYPE (val), "_tag", 0, NULL);
+  return ada_lookup_struct_elt_type (VALUE_TYPE (val), "_tag", 1, 0, NULL);
 }
 
-/* The value of the tag on VAL. */
+/* The value of the tag on VAL.  */
 
 struct value *
 ada_value_tag (struct value *val)
@@ -5169,7 +6633,85 @@
   return ada_value_struct_elt (val, "_tag", "record");
 }
 
-/* The parent type of TYPE, or NULL if none. */
+/* The value of the tag on the object of type TYPE whose contents are
+   saved at VALADDR, if it is non-null, or is at memory address
+   ADDRESS. */
+
+static struct value *
+value_tag_from_contents_and_address (struct type *type, char *valaddr,
+                                     CORE_ADDR address)
+{
+  int tag_byte_offset, dummy1, dummy2;
+  struct type *tag_type;
+  if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset,
+                         &dummy1, &dummy2))
+    {
+      char *valaddr1 = (valaddr == NULL) ? NULL : valaddr + tag_byte_offset;
+      CORE_ADDR address1 = (address == 0) ? 0 : address + tag_byte_offset;
+
+      return value_from_contents_and_address (tag_type, valaddr1, address1);
+    }
+  return NULL;
+}
+
+static struct type *
+type_from_tag (struct value *tag)
+{
+  const char *type_name = ada_tag_name (tag);
+  if (type_name != NULL)
+    return ada_find_any_type (ada_encode (type_name));
+  return NULL;
+}
+
+struct tag_args
+{
+  struct value *tag;
+  char *name;
+};
+
+/* Wrapper function used by ada_tag_name.  Given a struct tag_args*
+   value ARGS, sets ARGS->name to the tag name of ARGS->tag.  
+   The value stored in ARGS->name is valid until the next call to 
+   ada_tag_name_1.  */
+
+static int
+ada_tag_name_1 (void *args0)
+{
+  struct tag_args *args = (struct tag_args *) args0;
+  static char name[1024];
+  char *p;
+  struct value *val;
+  args->name = NULL;
+  val = ada_value_struct_elt (args->tag, "tsd", NULL);
+  if (val == NULL)
+    return 0;
+  val = ada_value_struct_elt (val, "expanded_name", NULL);
+  if (val == NULL)
+    return 0;
+  read_memory_string (value_as_address (val), name, sizeof (name) - 1);
+  for (p = name; *p != '\0'; p += 1)
+    if (isalpha (*p))
+      *p = tolower (*p);
+  args->name = name;
+  return 0;
+}
+
+/* The type name of the dynamic type denoted by the 'tag value TAG, as
+ * a C string.  */
+
+const char *
+ada_tag_name (struct value *tag)
+{
+  struct tag_args args;
+  if (!ada_is_tag_type (VALUE_TYPE (tag)))
+    return NULL;
+  args.tag = tag;
+  args.name = NULL;
+  catch_errors (ada_tag_name_1, &args, NULL, RETURN_MASK_ALL);
+  return args.name;
+}
+
+/* The parent type of TYPE, or NULL if none.  */
 
 struct type *
 ada_parent_type (struct type *type)
@@ -5188,66 +6730,69 @@
   return NULL;
 }
 
-/* True iff field number FIELD_NUM of structure type TYPE contains the 
-   parent-type (inherited) fields of a derived type.  Assumes TYPE is 
-   a structure type with at least FIELD_NUM+1 fields. */
+/* True iff field number FIELD_NUM of structure type TYPE contains the
+   parent-type (inherited) fields of a derived type.  Assumes TYPE is
+   a structure type with at least FIELD_NUM+1 fields.  */
 
 int
 ada_is_parent_field (struct type *type, int field_num)
 {
   const char *name = TYPE_FIELD_NAME (check_typedef (type), field_num);
-  return (name != NULL &&
-	  (DEPRECATED_STREQN (name, "PARENT", 6) || DEPRECATED_STREQN (name, "_parent", 7)));
+  return (name != NULL
+          && (strncmp (name, "PARENT", 6) == 0
+              || strncmp (name, "_parent", 7) == 0));
 }
 
-/* True iff field number FIELD_NUM of structure type TYPE is a 
+/* True iff field number FIELD_NUM of structure type TYPE is a
    transparent wrapper field (which should be silently traversed when doing
-   field selection and flattened when printing).  Assumes TYPE is a 
+   field selection and flattened when printing).  Assumes TYPE is a
    structure type with at least FIELD_NUM+1 fields.  Such fields are always
-   structures. */
+   structures.  */
 
 int
 ada_is_wrapper_field (struct type *type, int field_num)
 {
   const char *name = TYPE_FIELD_NAME (type, field_num);
   return (name != NULL
-	  && (DEPRECATED_STREQN (name, "PARENT", 6) || DEPRECATED_STREQ (name, "REP")
-	      || DEPRECATED_STREQN (name, "_parent", 7)
-	      || name[0] == 'S' || name[0] == 'R' || name[0] == 'O'));
+          && (strncmp (name, "PARENT", 6) == 0
+              || strcmp (name, "REP") == 0
+              || strncmp (name, "_parent", 7) == 0
+              || name[0] == 'S' || name[0] == 'R' || name[0] == 'O'));
 }
 
-/* True iff field number FIELD_NUM of structure or union type TYPE 
-   is a variant wrapper.  Assumes TYPE is a structure type with at least 
-   FIELD_NUM+1 fields. */
+/* True iff field number FIELD_NUM of structure or union type TYPE
+   is a variant wrapper.  Assumes TYPE is a structure type with at least
+   FIELD_NUM+1 fields.  */
 
 int
 ada_is_variant_part (struct type *type, int field_num)
 {
   struct type *field_type = TYPE_FIELD_TYPE (type, field_num);
   return (TYPE_CODE (field_type) == TYPE_CODE_UNION
-	  || (is_dynamic_field (type, field_num)
-	      && TYPE_CODE (TYPE_TARGET_TYPE (field_type)) ==
-	      TYPE_CODE_UNION));
+          || (is_dynamic_field (type, field_num)
+              && (TYPE_CODE (TYPE_TARGET_TYPE (field_type)) 
+		  == TYPE_CODE_UNION)));
 }
 
 /* Assuming that VAR_TYPE is a variant wrapper (type of the variant part)
-   whose discriminants are contained in the record type OUTER_TYPE, 
+   whose discriminants are contained in the record type OUTER_TYPE,
    returns the type of the controlling discriminant for the variant.  */
 
 struct type *
 ada_variant_discrim_type (struct type *var_type, struct type *outer_type)
 {
   char *name = ada_variant_discrim_name (var_type);
-  struct type *type = ada_lookup_struct_elt_type (outer_type, name, 1, NULL);
+  struct type *type =
+    ada_lookup_struct_elt_type (outer_type, name, 1, 1, NULL);
   if (type == NULL)
     return builtin_type_int;
   else
     return type;
 }
 
-/* Assuming that TYPE is the type of a variant wrapper, and FIELD_NUM is a 
+/* Assuming that TYPE is the type of a variant wrapper, and FIELD_NUM is a
    valid field number within it, returns 1 iff field FIELD_NUM of TYPE
-   represents a 'when others' clause; otherwise 0. */
+   represents a 'when others' clause; otherwise 0.  */
 
 int
 ada_is_others_clause (struct type *type, int field_num)
@@ -5257,8 +6802,8 @@
 }
 
 /* Assuming that TYPE0 is the type of the variant part of a record,
-   returns the name of the discriminant controlling the variant.  The
-   value is valid until the next call to ada_variant_discrim_name. */
+   returns the name of the discriminant controlling the variant.
+   The value is valid until the next call to ada_variant_discrim_name.  */
 
 char *
 ada_variant_discrim_name (struct type *type0)
@@ -5283,8 +6828,8 @@
   for (discrim_end = name + strlen (name) - 6; discrim_end != name;
        discrim_end -= 1)
     {
-      if (DEPRECATED_STREQN (discrim_end, "___XVN", 6))
-	break;
+      if (strncmp (discrim_end, "___XVN", 6) == 0)
+        break;
     }
   if (discrim_end == name)
     return "";
@@ -5293,10 +6838,11 @@
        discrim_start -= 1)
     {
       if (discrim_start == name + 1)
-	return "";
-      if ((discrim_start > name + 3 && DEPRECATED_STREQN (discrim_start - 3, "___", 3))
-	  || discrim_start[-1] == '.')
-	break;
+        return "";
+      if ((discrim_start > name + 3
+           && strncmp (discrim_start - 3, "___", 3) == 0)
+          || discrim_start[-1] == '.')
+        break;
     }
 
   GROW_VECT (result, result_len, discrim_end - discrim_start + 1);
@@ -5305,13 +6851,13 @@
   return result;
 }
 
-/* Scan STR for a subtype-encoded number, beginning at position K. Put the 
-   position of the character just past the number scanned in *NEW_K, 
-   if NEW_K!=NULL. Put the scanned number in *R, if R!=NULL.  Return 1 
-   if there was a valid number at the given position, and 0 otherwise.  A 
-   "subtype-encoded" number consists of the absolute value in decimal, 
-   followed by the letter 'm' to indicate a negative number.  Assumes 0m 
-   does not occur. */
+/* Scan STR for a subtype-encoded number, beginning at position K.
+   Put the position of the character just past the number scanned in
+   *NEW_K, if NEW_K!=NULL.  Put the scanned number in *R, if R!=NULL.
+   Return 1 if there was a valid number at the given position, and 0
+   otherwise.  A "subtype-encoded" number consists of the absolute value
+   in decimal, followed by the letter 'm' to indicate a negative number.
+   Assumes 0m does not occur.  */
 
 int
 ada_scan_number (const char str[], int k, LONGEST * R, int *new_k)
@@ -5321,9 +6867,9 @@
   if (!isdigit (str[k]))
     return 0;
 
-  /* Do it the hard way so as not to make any assumption about 
+  /* Do it the hard way so as not to make any assumption about
      the relationship of unsigned long (%lu scan format code) and
-     LONGEST. */
+     LONGEST.  */
   RU = 0;
   while (isdigit (str[k]))
     {
@@ -5334,26 +6880,26 @@
   if (str[k] == 'm')
     {
       if (R != NULL)
-	*R = (-(LONGEST) (RU - 1)) - 1;
+        *R = (-(LONGEST) (RU - 1)) - 1;
       k += 1;
     }
   else if (R != NULL)
     *R = (LONGEST) RU;
 
-  /* NOTE on the above: Technically, C does not say what the results of 
+  /* NOTE on the above: Technically, C does not say what the results of
      - (LONGEST) RU or (LONGEST) -RU are for RU == largest positive
      number representable as a LONGEST (although either would probably work
      in most implementations).  When RU>0, the locution in the then branch
-     above is always equivalent to the negative of RU. */
+     above is always equivalent to the negative of RU.  */
 
   if (new_k != NULL)
     *new_k = k;
   return 1;
 }
 
-/* Assuming that TYPE is a variant part wrapper type (a VARIANTS field), 
-   and FIELD_NUM is a valid field number within it, returns 1 iff VAL is 
-   in the range encoded by field FIELD_NUM of TYPE; otherwise 0. */
+/* Assuming that TYPE is a variant part wrapper type (a VARIANTS field),
+   and FIELD_NUM is a valid field number within it, returns 1 iff VAL is
+   in the range encoded by field FIELD_NUM of TYPE; otherwise 0.  */
 
 int
 ada_in_variant (LONGEST val, struct type *type, int field_num)
@@ -5365,53 +6911,53 @@
   while (1)
     {
       switch (name[p])
-	{
-	case '\0':
-	  return 0;
-	case 'S':
-	  {
-	    LONGEST W;
-	    if (!ada_scan_number (name, p + 1, &W, &p))
-	      return 0;
-	    if (val == W)
-	      return 1;
-	    break;
-	  }
-	case 'R':
-	  {
-	    LONGEST L, U;
-	    if (!ada_scan_number (name, p + 1, &L, &p)
-		|| name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p))
-	      return 0;
-	    if (val >= L && val <= U)
-	      return 1;
-	    break;
-	  }
-	case 'O':
-	  return 1;
-	default:
-	  return 0;
-	}
+        {
+        case '\0':
+          return 0;
+        case 'S':
+          {
+            LONGEST W;
+            if (!ada_scan_number (name, p + 1, &W, &p))
+              return 0;
+            if (val == W)
+              return 1;
+            break;
+          }
+        case 'R':
+          {
+            LONGEST L, U;
+            if (!ada_scan_number (name, p + 1, &L, &p)
+                || name[p] != 'T' || !ada_scan_number (name, p + 1, &U, &p))
+              return 0;
+            if (val >= L && val <= U)
+              return 1;
+            break;
+          }
+        case 'O':
+          return 1;
+        default:
+          return 0;
+        }
     }
 }
 
-/* Given a value ARG1 (offset by OFFSET bytes)
-   of a struct or union type ARG_TYPE,
-   extract and return the value of one of its (non-static) fields.
-   FIELDNO says which field.   Differs from value_primitive_field only
-   in that it can handle packed values of arbitrary type. */
+/* FIXME: Lots of redundancy below.  Try to consolidate. */
 
-struct value *
+/* Given a value ARG1 (offset by OFFSET bytes) of a struct or union type
+   ARG_TYPE, extract and return the value of one of its (non-static)
+   fields.  FIELDNO says which field.   Differs from value_primitive_field
+   only in that it can handle packed values of arbitrary type.  */
+
+static struct value *
 ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
-			   struct type *arg_type)
+                           struct type *arg_type)
 {
-  struct value *v;
   struct type *type;
 
   CHECK_TYPEDEF (arg_type);
   type = TYPE_FIELD_TYPE (arg_type, fieldno);
 
-  /* Handle packed fields */
+  /* Handle packed fields.  */
 
   if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0)
     {
@@ -5419,23 +6965,86 @@
       int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
 
       return ada_value_primitive_packed_val (arg1, VALUE_CONTENTS (arg1),
-					     offset + bit_pos / 8,
-					     bit_pos % 8, bit_size, type);
+                                             offset + bit_pos / 8,
+                                             bit_pos % 8, bit_size, type);
     }
   else
     return value_primitive_field (arg1, offset, fieldno, arg_type);
 }
 
+/* Find field with name NAME in object of type TYPE.  If found, return 1
+   after setting *FIELD_TYPE_P to the field's type, *BYTE_OFFSET_P to 
+   OFFSET + the byte offset of the field within an object of that type, 
+   *BIT_OFFSET_P to the bit offset modulo byte size of the field, and
+   *BIT_SIZE_P to its size in bits if the field is packed, and 0 otherwise.
+   Looks inside wrappers for the field.  Returns 0 if field not
+   found. */
+static int
+find_struct_field (char *name, struct type *type, int offset,
+                   struct type **field_type_p,
+                   int *byte_offset_p, int *bit_offset_p, int *bit_size_p)
+{
+  int i;
 
-/* Look for a field NAME in ARG. Adjust the address of ARG by OFFSET bytes,
+  CHECK_TYPEDEF (type);
+  *field_type_p = NULL;
+  *byte_offset_p = *bit_offset_p = *bit_size_p = 0;
+
+  for (i = TYPE_NFIELDS (type) - 1; i >= 0; i -= 1)
+    {
+      int bit_pos = TYPE_FIELD_BITPOS (type, i);
+      int fld_offset = offset + bit_pos / 8;
+      char *t_field_name = TYPE_FIELD_NAME (type, i);
+
+      if (t_field_name == NULL)
+        continue;
+
+      else if (field_name_match (t_field_name, name))
+        {
+          int bit_size = TYPE_FIELD_BITSIZE (type, i);
+          *field_type_p = TYPE_FIELD_TYPE (type, i);
+          *byte_offset_p = fld_offset;
+          *bit_offset_p = bit_pos % 8;
+          *bit_size_p = bit_size;
+          return 1;
+        }
+      else if (ada_is_wrapper_field (type, i))
+        {
+          if (find_struct_field (name, TYPE_FIELD_TYPE (type, i), fld_offset,
+                                 field_type_p, byte_offset_p, bit_offset_p,
+                                 bit_size_p))
+            return 1;
+        }
+      else if (ada_is_variant_part (type, i))
+        {
+          int j;
+          struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
+
+          for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1)
+            {
+              if (find_struct_field (name, TYPE_FIELD_TYPE (field_type, j),
+                                     fld_offset
+                                     + TYPE_FIELD_BITPOS (field_type, j) / 8,
+                                     field_type_p, byte_offset_p,
+                                     bit_offset_p, bit_size_p))
+                return 1;
+            }
+        }
+    }
+  return 0;
+}
+
+
+
+/* Look for a field NAME in ARG.  Adjust the address of ARG by OFFSET bytes,
    and search in it assuming it has (class) type TYPE.
    If found, return value, else return NULL.
 
-   Searches recursively through wrapper fields (e.g., '_parent'). */
+   Searches recursively through wrapper fields (e.g., '_parent').  */
 
-struct value *
+static struct value *
 ada_search_struct_field (char *name, struct value *arg, int offset,
-			 struct type *type)
+                         struct type *type)
 {
   int i;
   CHECK_TYPEDEF (type);
@@ -5445,128 +7054,203 @@
       char *t_field_name = TYPE_FIELD_NAME (type, i);
 
       if (t_field_name == NULL)
-	continue;
+        continue;
 
       else if (field_name_match (t_field_name, name))
-	return ada_value_primitive_field (arg, offset, i, type);
+        return ada_value_primitive_field (arg, offset, i, type);
 
       else if (ada_is_wrapper_field (type, i))
-	{
-	  struct value *v = ada_search_struct_field (name, arg,
-						     offset +
-						     TYPE_FIELD_BITPOS (type,
-									i) /
-						     8,
-						     TYPE_FIELD_TYPE (type,
-								      i));
-	  if (v != NULL)
-	    return v;
-	}
+        {
+          struct value *v =     /* Do not let indent join lines here. */
+            ada_search_struct_field (name, arg,
+                                     offset + TYPE_FIELD_BITPOS (type, i) / 8,
+                                     TYPE_FIELD_TYPE (type, i));
+          if (v != NULL)
+            return v;
+        }
 
       else if (ada_is_variant_part (type, i))
-	{
-	  int j;
-	  struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
-	  int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
+        {
+          int j;
+          struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
+          int var_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8;
 
-	  for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1)
-	    {
-	      struct value *v = ada_search_struct_field (name, arg,
-							 var_offset
-							 +
-							 TYPE_FIELD_BITPOS
-							 (field_type, j) / 8,
-							 TYPE_FIELD_TYPE
-							 (field_type, j));
-	      if (v != NULL)
-		return v;
-	    }
-	}
+          for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1)
+            {
+              struct value *v = ada_search_struct_field /* Force line break.  */
+                (name, arg,
+                 var_offset + TYPE_FIELD_BITPOS (field_type, j) / 8,
+                 TYPE_FIELD_TYPE (field_type, j));
+              if (v != NULL)
+                return v;
+            }
+        }
     }
   return NULL;
 }
 
-/* Given ARG, a value of type (pointer to a)* structure/union,
-   extract the component named NAME from the ultimate target structure/union
-   and return it as a value with its appropriate type.
+/* Given ARG, a value of type (pointer or reference to a)*
+   structure/union, extract the component named NAME from the ultimate
+   target structure/union and return it as a value with its
+   appropriate type.  If ARG is a pointer or reference and the field
+   is not packed, returns a reference to the field, otherwise the
+   value of the field (an lvalue if ARG is an lvalue).     
 
-   The routine searches for NAME among all members of the structure itself 
-   and (recursively) among all members of any wrapper members 
+   The routine searches for NAME among all members of the structure itself
+   and (recursively) among all members of any wrapper members
    (e.g., '_parent').
 
-   ERR is a name (for use in error messages) that identifies the class 
-   of entity that ARG is supposed to be. */
+   ERR is a name (for use in error messages) that identifies the class
+   of entity that ARG is supposed to be.  ERR may be null, indicating
+   that on error, the function simply returns NULL, and does not
+   throw an error.  (FIXME: True only if ARG is a pointer or reference
+   at the moment). */
 
 struct value *
 ada_value_struct_elt (struct value *arg, char *name, char *err)
 {
-  struct type *t;
+  struct type *t, *t1;
   struct value *v;
 
-  arg = ada_coerce_ref (arg);
-  t = check_typedef (VALUE_TYPE (arg));
-
-  /* Follow pointers until we get to a non-pointer.  */
-
-  while (TYPE_CODE (t) == TYPE_CODE_PTR || TYPE_CODE (t) == TYPE_CODE_REF)
+  v = NULL;
+  t1 = t = check_typedef (VALUE_TYPE (arg));
+  if (TYPE_CODE (t) == TYPE_CODE_REF)
     {
-      arg = ada_value_ind (arg);
-      t = check_typedef (VALUE_TYPE (arg));
+      t1 = TYPE_TARGET_TYPE (t);
+      if (t1 == NULL)
+        {
+          if (err == NULL)
+            return NULL;
+          else
+            error ("Bad value type in a %s.", err);
+        }
+      CHECK_TYPEDEF (t1);
+      if (TYPE_CODE (t1) == TYPE_CODE_PTR)
+        {
+          COERCE_REF (arg);
+          t = t1;
+        }
     }
 
-  if (TYPE_CODE (t) != TYPE_CODE_STRUCT && TYPE_CODE (t) != TYPE_CODE_UNION)
-    error ("Attempt to extract a component of a value that is not a %s.",
-	   err);
+  while (TYPE_CODE (t) == TYPE_CODE_PTR)
+    {
+      t1 = TYPE_TARGET_TYPE (t);
+      if (t1 == NULL)
+        {
+          if (err == NULL)
+            return NULL;
+          else
+            error ("Bad value type in a %s.", err);
+        }
+      CHECK_TYPEDEF (t1);
+      if (TYPE_CODE (t1) == TYPE_CODE_PTR)
+        {
+          arg = value_ind (arg);
+          t = t1;
+        }
+      else
+        break;
+    }
 
-  v = ada_search_struct_field (name, arg, 0, t);
-  if (v == NULL)
+  if (TYPE_CODE (t1) != TYPE_CODE_STRUCT && TYPE_CODE (t1) != TYPE_CODE_UNION)
+    {
+      if (err == NULL)
+        return NULL;
+      else
+        error ("Attempt to extract a component of a value that is not a %s.",
+               err);
+    }
+
+  if (t1 == t)
+    v = ada_search_struct_field (name, arg, 0, t);
+  else
+    {
+      int bit_offset, bit_size, byte_offset;
+      struct type *field_type;
+      CORE_ADDR address;
+
+      if (TYPE_CODE (t) == TYPE_CODE_PTR)
+        address = value_as_address (arg);
+      else
+        address = unpack_pointer (t, VALUE_CONTENTS (arg));
+
+      t1 = ada_to_fixed_type (ada_get_base_type (t1), NULL, address, NULL);
+      if (find_struct_field (name, t1, 0,
+                             &field_type, &byte_offset, &bit_offset,
+                             &bit_size))
+        {
+          if (bit_size != 0)
+            {
+              arg = ada_value_ind (arg);
+              v = ada_value_primitive_packed_val (arg, NULL, byte_offset,
+                                                  bit_offset, bit_size,
+                                                  field_type);
+            }
+          else
+            v = value_from_pointer (lookup_reference_type (field_type),
+                                    address + byte_offset);
+        }
+    }
+
+  if (v == NULL && err != NULL)
     error ("There is no member named %s.", name);
 
   return v;
 }
 
 /* Given a type TYPE, look up the type of the component of type named NAME.
-   If DISPP is non-null, add its byte displacement from the beginning of a 
-   structure (pointed to by a value) of type TYPE to *DISPP (does not 
+   If DISPP is non-null, add its byte displacement from the beginning of a
+   structure (pointed to by a value) of type TYPE to *DISPP (does not
    work for packed fields).
 
    Matches any field whose name has NAME as a prefix, possibly
-   followed by "___". 
+   followed by "___".
 
-   TYPE can be either a struct or union, or a pointer or reference to 
-   a struct or union.  If it is a pointer or reference, its target 
-   type is automatically used.
+   TYPE can be either a struct or union. If REFOK, TYPE may also 
+   be a (pointer or reference)+ to a struct or union, and the
+   ultimate target type will be searched.
 
    Looks recursively into variant clauses and parent types.
 
-   If NOERR is nonzero, return NULL if NAME is not suitably defined. */
+   If NOERR is nonzero, return NULL if NAME is not suitably defined or
+   TYPE is not a type of the right kind.  */
 
-struct type *
-ada_lookup_struct_elt_type (struct type *type, char *name, int noerr,
-			    int *dispp)
+static struct type *
+ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
+                            int noerr, int *dispp)
 {
   int i;
 
   if (name == NULL)
     goto BadName;
 
-  while (1)
-    {
-      CHECK_TYPEDEF (type);
-      if (TYPE_CODE (type) != TYPE_CODE_PTR
-	  && TYPE_CODE (type) != TYPE_CODE_REF)
-	break;
-      type = TYPE_TARGET_TYPE (type);
-    }
+  if (refok && type != NULL)
+    while (1)
+      {
+        CHECK_TYPEDEF (type);
+        if (TYPE_CODE (type) != TYPE_CODE_PTR
+            && TYPE_CODE (type) != TYPE_CODE_REF)
+          break;
+        type = TYPE_TARGET_TYPE (type);
+      }
 
-  if (TYPE_CODE (type) != TYPE_CODE_STRUCT &&
-      TYPE_CODE (type) != TYPE_CODE_UNION)
+  if (type == NULL
+      || (TYPE_CODE (type) != TYPE_CODE_STRUCT
+          && TYPE_CODE (type) != TYPE_CODE_UNION))
     {
-      target_terminal_ours ();
-      gdb_flush (gdb_stdout);
-      fprintf_unfiltered (gdb_stderr, "Type ");
-      type_print (type, "", gdb_stderr, -1);
-      error (" is not a structure or union type");
+      if (noerr)
+        return NULL;
+      else
+        {
+          target_terminal_ours ();
+          gdb_flush (gdb_stdout);
+          fprintf_unfiltered (gdb_stderr, "Type ");
+          if (type == NULL)
+            fprintf_unfiltered (gdb_stderr, "(null)");
+          else
+            type_print (type, "", gdb_stderr, -1);
+          error (" is not a structure or union type");
+        }
     }
 
   type = to_static_fixed_type (type);
@@ -5578,46 +7262,46 @@
       int disp;
 
       if (t_field_name == NULL)
-	continue;
+        continue;
 
       else if (field_name_match (t_field_name, name))
-	{
-	  if (dispp != NULL)
-	    *dispp += TYPE_FIELD_BITPOS (type, i) / 8;
-	  return check_typedef (TYPE_FIELD_TYPE (type, i));
-	}
+        {
+          if (dispp != NULL)
+            *dispp += TYPE_FIELD_BITPOS (type, i) / 8;
+          return check_typedef (TYPE_FIELD_TYPE (type, i));
+        }
 
       else if (ada_is_wrapper_field (type, i))
-	{
-	  disp = 0;
-	  t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (type, i), name,
-					  1, &disp);
-	  if (t != NULL)
-	    {
-	      if (dispp != NULL)
-		*dispp += disp + TYPE_FIELD_BITPOS (type, i) / 8;
-	      return t;
-	    }
-	}
+        {
+          disp = 0;
+          t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (type, i), name,
+                                          0, 1, &disp);
+          if (t != NULL)
+            {
+              if (dispp != NULL)
+                *dispp += disp + TYPE_FIELD_BITPOS (type, i) / 8;
+              return t;
+            }
+        }
 
       else if (ada_is_variant_part (type, i))
-	{
-	  int j;
-	  struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
+        {
+          int j;
+          struct type *field_type = check_typedef (TYPE_FIELD_TYPE (type, i));
 
-	  for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1)
-	    {
-	      disp = 0;
-	      t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (field_type, j),
-					      name, 1, &disp);
-	      if (t != NULL)
-		{
-		  if (dispp != NULL)
-		    *dispp += disp + TYPE_FIELD_BITPOS (type, i) / 8;
-		  return t;
-		}
-	    }
-	}
+          for (j = TYPE_NFIELDS (field_type) - 1; j >= 0; j -= 1)
+            {
+              disp = 0;
+              t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (field_type, j),
+                                              name, 0, 1, &disp);
+              if (t != NULL)
+                {
+                  if (dispp != NULL)
+                    *dispp += disp + TYPE_FIELD_BITPOS (type, i) / 8;
+                  return t;
+                }
+            }
+        }
 
     }
 
@@ -5637,12 +7321,12 @@
 
 /* Assuming that VAR_TYPE is the type of a variant part of a record (a union),
    within a value of type OUTER_TYPE that is stored in GDB at
-   OUTER_VALADDR, determine which variant clause (field number in VAR_TYPE, 
-   numbering from 0) is applicable.  Returns -1 if none are. */
+   OUTER_VALADDR, determine which variant clause (field number in VAR_TYPE,
+   numbering from 0) is applicable.  Returns -1 if none are.  */
 
 int
 ada_which_variant_applies (struct type *var_type, struct type *outer_type,
-			   char *outer_valaddr)
+                           char *outer_valaddr)
 {
   int others_clause;
   int i;
@@ -5653,7 +7337,7 @@
 
   disp = 0;
   discrim_type =
-    ada_lookup_struct_elt_type (outer_type, discrim_name, 1, &disp);
+    ada_lookup_struct_elt_type (outer_type, discrim_name, 1, 1, &disp);
   if (discrim_type == NULL)
     return -1;
   discrim_val = unpack_long (discrim_type, outer_valaddr + disp);
@@ -5662,9 +7346,9 @@
   for (i = 0; i < TYPE_NFIELDS (var_type); i += 1)
     {
       if (ada_is_others_clause (var_type, i))
-	others_clause = i;
+        others_clause = i;
       else if (ada_in_variant (discrim_val, var_type, i))
-	return i;
+        return i;
     }
 
   return others_clause;
@@ -5672,13 +7356,13 @@
 
 
 
-				/* Dynamic-Sized Records */
+                                /* Dynamic-Sized Records */
 
 /* Strategy: The type ostensibly attached to a value with dynamic size
    (i.e., a size that is not statically recorded in the debugging
    data) does not accurately reflect the size or layout of the value.
    Our strategy is to convert these values to values with accurate,
-   conventional types that are constructed on the fly. */
+   conventional types that are constructed on the fly.  */
 
 /* There is a subtle and tricky problem here.  In general, we cannot
    determine the size of dynamic records without its data.  However,
@@ -5687,7 +7371,7 @@
    of the type at the time of its allocation in order to reserve space
    for GDB's internal copy of the data.  That's why the
    'to_fixed_xxx_type' routines take (target) addresses as parameters,
-   rather than struct value*s.  
+   rather than struct value*s.
 
    However, GDB's internal history variables ($1, $2, etc.) are
    struct value*s containing internal copies of the data that are not, in
@@ -5705,22 +7389,22 @@
    address, target address) triple as arguments to represent a value.
    The host address, if non-null, is supposed to contain an internal
    copy of the relevant data; otherwise, the program is to consult the
-   target at the target address. */
+   target at the target address.  */
 
 /* Assuming that VAL0 represents a pointer value, the result of
    dereferencing it.  Differs from value_ind in its treatment of
-   dynamic-sized types. */
+   dynamic-sized types.  */
 
 struct value *
 ada_value_ind (struct value *val0)
 {
   struct value *val = unwrap_value (value_ind (val0));
-  return ada_to_fixed_value (VALUE_TYPE (val), 0,
-			     VALUE_ADDRESS (val) + VALUE_OFFSET (val), val);
+  return ada_to_fixed_value (val);
 }
 
 /* The value resulting from dereferencing any "reference to"
- * qualifiers on VAL0. */
+   qualifiers on VAL0.  */
+
 static struct value *
 ada_coerce_ref (struct value *val0)
 {
@@ -5729,16 +7413,14 @@
       struct value *val = val0;
       COERCE_REF (val);
       val = unwrap_value (val);
-      return ada_to_fixed_value (VALUE_TYPE (val), 0,
-				 VALUE_ADDRESS (val) + VALUE_OFFSET (val),
-				 val);
+      return ada_to_fixed_value (val);
     }
   else
     return val0;
 }
 
 /* Return OFF rounded upward if necessary to a multiple of
-   ALIGNMENT (a power of 2). */
+   ALIGNMENT (a power of 2).  */
 
 static unsigned int
 align_value (unsigned int off, unsigned int alignment)
@@ -5746,22 +7428,7 @@
   return (off + alignment - 1) & ~(alignment - 1);
 }
 
-/* Return the additional bit offset required by field F of template
-   type TYPE. */
-
-static unsigned int
-field_offset (struct type *type, int f)
-{
-  int n = TYPE_FIELD_BITPOS (type, f);
-  /* Kludge (temporary?) to fix problem with dwarf output. */
-  if (n < 0)
-    return (unsigned int) n & 0xffff;
-  else
-    return n;
-}
-
-
-/* Return the bit alignment required for field #F of template type TYPE. */
+/* Return the bit alignment required for field #F of template type TYPE.  */
 
 static unsigned int
 field_alignment (struct type *type, int f)
@@ -5770,41 +7437,96 @@
   int len = (name == NULL) ? 0 : strlen (name);
   int align_offset;
 
-  if (len < 8 || !isdigit (name[len - 1]))
-    return TARGET_CHAR_BIT;
+  if (!isdigit (name[len - 1]))
+    return 1;
 
   if (isdigit (name[len - 2]))
     align_offset = len - 2;
   else
     align_offset = len - 1;
 
-  if (align_offset < 7 || !DEPRECATED_STREQN ("___XV", name + align_offset - 6, 5))
+  if (align_offset < 7 || strncmp ("___XV", name + align_offset - 6, 5) != 0)
     return TARGET_CHAR_BIT;
 
   return atoi (name + align_offset) * TARGET_CHAR_BIT;
 }
 
-/* Find a type named NAME.  Ignores ambiguity.  */
-struct type *
-ada_find_any_type (const char *name)
+/* Find a symbol named NAME.  Ignores ambiguity.  */
+
+struct symbol *
+ada_find_any_symbol (const char *name)
 {
   struct symbol *sym;
 
-  sym = standard_lookup (name, VAR_DOMAIN);
+  sym = standard_lookup (name, get_selected_block (NULL), VAR_DOMAIN);
   if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
-    return SYMBOL_TYPE (sym);
+    return sym;
 
-  sym = standard_lookup (name, STRUCT_DOMAIN);
+  sym = standard_lookup (name, NULL, STRUCT_DOMAIN);
+  return sym;
+}
+
+/* Find a type named NAME.  Ignores ambiguity.  */
+
+struct type *
+ada_find_any_type (const char *name)
+{
+  struct symbol *sym = ada_find_any_symbol (name);
+
   if (sym != NULL)
     return SYMBOL_TYPE (sym);
 
   return NULL;
 }
 
+/* Given a symbol NAME and its associated BLOCK, search all symbols
+   for its ___XR counterpart, which is the ``renaming'' symbol
+   associated to NAME.  Return this symbol if found, return
+   NULL otherwise.  */
+
+struct symbol *
+ada_find_renaming_symbol (const char *name, struct block *block)
+{
+  const struct symbol *function_sym = block_function (block);
+  char *rename;
+
+  if (function_sym != NULL)
+    {
+      /* If the symbol is defined inside a function, NAME is not fully
+         qualified.  This means we need to prepend the function name
+         as well as adding the ``___XR'' suffix to build the name of
+         the associated renaming symbol.  */
+      char *function_name = SYMBOL_LINKAGE_NAME (function_sym);
+      const int function_name_len = strlen (function_name);
+      const int rename_len = function_name_len + 2      /*  "__" */
+        + strlen (name) + 6 /* "___XR\0" */ ;
+
+      /* Library-level functions are a special case, as GNAT adds
+         a ``_ada_'' prefix to the function name to avoid namespace
+         pollution.  However, the renaming symbol themselves do not
+         have this prefix, so we need to skip this prefix if present.  */
+      if (function_name_len > 5 /* "_ada_" */
+          && strstr (function_name, "_ada_") == function_name)
+        function_name = function_name + 5;
+
+      rename = (char *) alloca (rename_len * sizeof (char));
+      sprintf (rename, "%s__%s___XR", function_name, name);
+    }
+  else
+    {
+      const int rename_len = strlen (name) + 6;
+      rename = (char *) alloca (rename_len * sizeof (char));
+      sprintf (rename, "%s___XR", name);
+    }
+
+  return ada_find_any_symbol (rename);
+}
+
 /* Because of GNAT encoding conventions, several GDB symbols may match a
-   given type name. If the type denoted by TYPE0 is to be preferred to
+   given type name.  If the type denoted by TYPE0 is to be preferred to
    that of TYPE1 for purposes of type printing, return non-zero;
-   otherwise return 0. */
+   otherwise return 0.  */
+
 int
 ada_prefer_type (struct type *type0, struct type *type1)
 {
@@ -5816,19 +7538,22 @@
     return 1;
   else if (TYPE_CODE (type0) == TYPE_CODE_VOID)
     return 0;
+  else if (TYPE_NAME (type1) == NULL && TYPE_NAME (type0) != NULL)
+    return 1;
   else if (ada_is_packed_array_type (type0))
     return 1;
-  else if (ada_is_array_descriptor (type0)
-	   && !ada_is_array_descriptor (type1))
+  else if (ada_is_array_descriptor_type (type0)
+           && !ada_is_array_descriptor_type (type1))
     return 1;
   else if (ada_renaming_type (type0) != NULL
-	   && ada_renaming_type (type1) == NULL)
+           && ada_renaming_type (type1) == NULL)
     return 1;
   return 0;
 }
 
 /* The name of TYPE, which is either its TYPE_NAME, or, if that is
-   null, its TYPE_TAG_NAME.  Null if TYPE is null. */
+   null, its TYPE_TAG_NAME.  Null if TYPE is null.  */
+
 char *
 ada_type_name (struct type *type)
 {
@@ -5841,16 +7566,13 @@
 }
 
 /* Find a parallel type to TYPE whose name is formed by appending
-   SUFFIX to the name of TYPE. */
+   SUFFIX to the name of TYPE.  */
 
 struct type *
 ada_find_parallel_type (struct type *type, const char *suffix)
 {
   static char *name;
   static size_t name_len = 0;
-  struct symbol **syms;
-  struct block **blocks;
-  int nsyms;
   int len;
   char *typename = ada_type_name (type);
 
@@ -5869,7 +7591,7 @@
 
 
 /* If TYPE is a variable-size record type, return the corresponding template
-   type describing its fields.  Otherwise, return NULL. */
+   type describing its fields.  Otherwise, return NULL.  */
 
 static struct type *
 dynamic_template_type (struct type *type)
@@ -5882,15 +7604,15 @@
   else
     {
       int len = strlen (ada_type_name (type));
-      if (len > 6 && DEPRECATED_STREQ (ada_type_name (type) + len - 6, "___XVE"))
-	return type;
+      if (len > 6 && strcmp (ada_type_name (type) + len - 6, "___XVE") == 0)
+        return type;
       else
-	return ada_find_parallel_type (type, "___XVE");
+        return ada_find_parallel_type (type, "___XVE");
     }
 }
 
 /* Assuming that TEMPL_TYPE is a union or struct type, returns
-   non-zero iff field FIELD_NUM of TEMPL_TYPE has dynamic size. */
+   non-zero iff field FIELD_NUM of TEMPL_TYPE has dynamic size.  */
 
 static int
 is_dynamic_field (struct type *templ_type, int field_num)
@@ -5901,21 +7623,27 @@
     && strstr (name, "___XVL") != NULL;
 }
 
-/* Assuming that TYPE is a struct type, returns non-zero iff TYPE
-   contains a variant part. */
+/* The index of the variant field of TYPE, or -1 if TYPE does not
+   represent a variant record type.  */
 
 static int
-contains_variant_part (struct type *type)
+variant_field_index (struct type *type)
 {
   int f;
 
-  if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT
-      || TYPE_NFIELDS (type) <= 0)
-    return 0;
-  return ada_is_variant_part (type, TYPE_NFIELDS (type) - 1);
+  if (type == NULL || TYPE_CODE (type) != TYPE_CODE_STRUCT)
+    return -1;
+
+  for (f = 0; f < TYPE_NFIELDS (type); f += 1)
+    {
+      if (ada_is_variant_part (type, f))
+        return f;
+    }
+  return -1;
 }
 
-/* A record type with no fields, . */
+/* A record type with no fields.  */
+
 static struct type *
 empty_record (struct objfile *objfile)
 {
@@ -5931,29 +7659,50 @@
 }
 
 /* An ordinary record type (with fixed-length fields) that describes
-   the value of type TYPE at VALADDR or ADDRESS (see comments at 
-   the beginning of this section) VAL according to GNAT conventions.  
-   DVAL0 should describe the (portion of a) record that contains any 
+   the value of type TYPE at VALADDR or ADDRESS (see comments at
+   the beginning of this section) VAL according to GNAT conventions.
+   DVAL0 should describe the (portion of a) record that contains any
    necessary discriminants.  It should be NULL if VALUE_TYPE (VAL) is
    an outer-level type (i.e., as opposed to a branch of a variant.)  A
    variant field (unless unchecked) is replaced by a particular branch
-   of the variant. */
-/* NOTE: Limitations: For now, we assume that dynamic fields and
- * variants occupy whole numbers of bytes.  However, they need not be
- * byte-aligned.  */
+   of the variant.
 
-static struct type *
-template_to_fixed_record_type (struct type *type, char *valaddr,
-			       CORE_ADDR address, struct value *dval0)
+   If not KEEP_DYNAMIC_FIELDS, then all fields whose position or
+   length are not statically known are discarded.  As a consequence,
+   VALADDR, ADDRESS and DVAL0 are ignored.
+
+   NOTE: Limitations: For now, we assume that dynamic fields and
+   variants occupy whole numbers of bytes.  However, they need not be
+   byte-aligned.  */
+
+struct type *
+ada_template_to_fixed_record_type_1 (struct type *type, char *valaddr,
+                                     CORE_ADDR address, struct value *dval0,
+                                     int keep_dynamic_fields)
 {
   struct value *mark = value_mark ();
   struct value *dval;
   struct type *rtype;
   int nfields, bit_len;
+  int variant_field;
   long off;
+  int fld_bit_len, bit_incr;
   int f;
 
-  nfields = TYPE_NFIELDS (type);
+  /* Compute the number of fields in this record type that are going
+     to be processed: unless keep_dynamic_fields, this includes only
+     fields whose position and length are static will be processed.  */
+  if (keep_dynamic_fields)
+    nfields = TYPE_NFIELDS (type);
+  else
+    {
+      nfields = 0;
+      while (nfields < TYPE_NFIELDS (type)
+             && !ada_is_variant_part (type, nfields)
+             && !is_dynamic_field (type, nfields))
+        nfields++;
+    }
+
   rtype = alloc_type (TYPE_OBJFILE (type));
   TYPE_CODE (rtype) = TYPE_CODE_STRUCT;
   INIT_CPLUS_SPECIFIC (rtype);
@@ -5963,83 +7712,100 @@
   memset (TYPE_FIELDS (rtype), 0, sizeof (struct field) * nfields);
   TYPE_NAME (rtype) = ada_type_name (type);
   TYPE_TAG_NAME (rtype) = NULL;
-  /* FIXME: TYPE_FLAG_FIXED_INSTANCE should be defined in
-     gdbtypes.h */
-  /*  TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE; */
+  TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE;
 
   off = 0;
   bit_len = 0;
+  variant_field = -1;
+
   for (f = 0; f < nfields; f += 1)
     {
-      int fld_bit_len, bit_incr;
       off =
-	align_value (off,
-		     field_alignment (type, f)) + TYPE_FIELD_BITPOS (type, f);
-      /* NOTE: used to use field_offset above, but that causes
-       * problems with really negative bit positions.  So, let's
-       * rediscover why we needed field_offset and fix it properly. */
+        align_value (off,
+                     field_alignment (type, f)) + TYPE_FIELD_BITPOS (type, f);
       TYPE_FIELD_BITPOS (rtype, f) = off;
       TYPE_FIELD_BITSIZE (rtype, f) = 0;
-      TYPE_FIELD_STATIC_KIND (rtype, f) = 0;
 
       if (ada_is_variant_part (type, f))
-	{
-	  struct type *branch_type;
-
-	  if (dval0 == NULL)
-	    dval = value_from_contents_and_address (rtype, valaddr, address);
-	  else
-	    dval = dval0;
-
-	  branch_type =
-	    to_fixed_variant_branch_type
-	    (TYPE_FIELD_TYPE (type, f),
-	     cond_offset_host (valaddr, off / TARGET_CHAR_BIT),
-	     cond_offset_target (address, off / TARGET_CHAR_BIT), dval);
-	  if (branch_type == NULL)
-	    TYPE_NFIELDS (rtype) -= 1;
-	  else
-	    {
-	      TYPE_FIELD_TYPE (rtype, f) = branch_type;
-	      TYPE_FIELD_NAME (rtype, f) = "S";
-	    }
-	  bit_incr = 0;
-	  fld_bit_len =
-	    TYPE_LENGTH (TYPE_FIELD_TYPE (rtype, f)) * TARGET_CHAR_BIT;
-	}
+        {
+          variant_field = f;
+          fld_bit_len = bit_incr = 0;
+        }
       else if (is_dynamic_field (type, f))
-	{
-	  if (dval0 == NULL)
-	    dval = value_from_contents_and_address (rtype, valaddr, address);
-	  else
-	    dval = dval0;
+        {
+          if (dval0 == NULL)
+            dval = value_from_contents_and_address (rtype, valaddr, address);
+          else
+            dval = dval0;
 
-	  TYPE_FIELD_TYPE (rtype, f) =
-	    ada_to_fixed_type
-	    (ada_get_base_type
-	     (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, f))),
-	     cond_offset_host (valaddr, off / TARGET_CHAR_BIT),
-	     cond_offset_target (address, off / TARGET_CHAR_BIT), dval);
-	  TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f);
-	  bit_incr = fld_bit_len =
-	    TYPE_LENGTH (TYPE_FIELD_TYPE (rtype, f)) * TARGET_CHAR_BIT;
-	}
+          TYPE_FIELD_TYPE (rtype, f) =
+            ada_to_fixed_type
+            (ada_get_base_type
+             (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, f))),
+             cond_offset_host (valaddr, off / TARGET_CHAR_BIT),
+             cond_offset_target (address, off / TARGET_CHAR_BIT), dval);
+          TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f);
+          bit_incr = fld_bit_len =
+            TYPE_LENGTH (TYPE_FIELD_TYPE (rtype, f)) * TARGET_CHAR_BIT;
+        }
       else
-	{
-	  TYPE_FIELD_TYPE (rtype, f) = TYPE_FIELD_TYPE (type, f);
-	  TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f);
-	  if (TYPE_FIELD_BITSIZE (type, f) > 0)
-	    bit_incr = fld_bit_len =
-	      TYPE_FIELD_BITSIZE (rtype, f) = TYPE_FIELD_BITSIZE (type, f);
-	  else
-	    bit_incr = fld_bit_len =
-	      TYPE_LENGTH (TYPE_FIELD_TYPE (type, f)) * TARGET_CHAR_BIT;
-	}
+        {
+          TYPE_FIELD_TYPE (rtype, f) = TYPE_FIELD_TYPE (type, f);
+          TYPE_FIELD_NAME (rtype, f) = TYPE_FIELD_NAME (type, f);
+          if (TYPE_FIELD_BITSIZE (type, f) > 0)
+            bit_incr = fld_bit_len =
+              TYPE_FIELD_BITSIZE (rtype, f) = TYPE_FIELD_BITSIZE (type, f);
+          else
+            bit_incr = fld_bit_len =
+              TYPE_LENGTH (TYPE_FIELD_TYPE (type, f)) * TARGET_CHAR_BIT;
+        }
       if (off + fld_bit_len > bit_len)
-	bit_len = off + fld_bit_len;
+        bit_len = off + fld_bit_len;
       off += bit_incr;
-      TYPE_LENGTH (rtype) = bit_len / TARGET_CHAR_BIT;
+      TYPE_LENGTH (rtype) =
+        align_value (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT;
     }
+
+  /* We handle the variant part, if any, at the end because of certain
+     odd cases in which it is re-ordered so as NOT the last field of
+     the record.  This can happen in the presence of representation
+     clauses.  */
+  if (variant_field >= 0)
+    {
+      struct type *branch_type;
+
+      off = TYPE_FIELD_BITPOS (rtype, variant_field);
+
+      if (dval0 == NULL)
+        dval = value_from_contents_and_address (rtype, valaddr, address);
+      else
+        dval = dval0;
+
+      branch_type =
+        to_fixed_variant_branch_type
+        (TYPE_FIELD_TYPE (type, variant_field),
+         cond_offset_host (valaddr, off / TARGET_CHAR_BIT),
+         cond_offset_target (address, off / TARGET_CHAR_BIT), dval);
+      if (branch_type == NULL)
+        {
+          for (f = variant_field + 1; f < TYPE_NFIELDS (rtype); f += 1)
+            TYPE_FIELDS (rtype)[f - 1] = TYPE_FIELDS (rtype)[f];
+          TYPE_NFIELDS (rtype) -= 1;
+        }
+      else
+        {
+          TYPE_FIELD_TYPE (rtype, variant_field) = branch_type;
+          TYPE_FIELD_NAME (rtype, variant_field) = "S";
+          fld_bit_len =
+            TYPE_LENGTH (TYPE_FIELD_TYPE (rtype, variant_field)) *
+            TARGET_CHAR_BIT;
+          if (off + fld_bit_len > bit_len)
+            bit_len = off + fld_bit_len;
+          TYPE_LENGTH (rtype) =
+            align_value (bit_len, TARGET_CHAR_BIT) / TARGET_CHAR_BIT;
+        }
+    }
+
   TYPE_LENGTH (rtype) = align_value (TYPE_LENGTH (rtype), TYPE_LENGTH (type));
 
   value_free_to_mark (mark);
@@ -6048,148 +7814,177 @@
   return rtype;
 }
 
-/* As for template_to_fixed_record_type, but uses no run-time values.
-   As a result, this type can only be approximate, but that's OK,
-   since it is used only for type determinations.   Works on both
-   structs and unions.
-   Representation note: to save space, we memoize the result of this
-   function in the TYPE_TARGET_TYPE of the template type. */
+/* As for ada_template_to_fixed_record_type_1 with KEEP_DYNAMIC_FIELDS
+   of 1.  */
 
 static struct type *
-template_to_static_fixed_type (struct type *templ_type)
+template_to_fixed_record_type (struct type *type, char *valaddr,
+                               CORE_ADDR address, struct value *dval0)
+{
+  return ada_template_to_fixed_record_type_1 (type, valaddr,
+                                              address, dval0, 1);
+}
+
+/* An ordinary record type in which ___XVL-convention fields and
+   ___XVU- and ___XVN-convention field types in TYPE0 are replaced with
+   static approximations, containing all possible fields.  Uses
+   no runtime values.  Useless for use in values, but that's OK,
+   since the results are used only for type determinations.   Works on both
+   structs and unions.  Representation note: to save space, we memorize
+   the result of this function in the TYPE_TARGET_TYPE of the
+   template type.  */
+
+static struct type *
+template_to_static_fixed_type (struct type *type0)
 {
   struct type *type;
   int nfields;
   int f;
 
-  if (TYPE_TARGET_TYPE (templ_type) != NULL)
-    return TYPE_TARGET_TYPE (templ_type);
+  if (TYPE_TARGET_TYPE (type0) != NULL)
+    return TYPE_TARGET_TYPE (type0);
 
-  nfields = TYPE_NFIELDS (templ_type);
-  TYPE_TARGET_TYPE (templ_type) = type =
-    alloc_type (TYPE_OBJFILE (templ_type));
-  TYPE_CODE (type) = TYPE_CODE (templ_type);
-  INIT_CPLUS_SPECIFIC (type);
-  TYPE_NFIELDS (type) = nfields;
-  TYPE_FIELDS (type) = (struct field *)
-    TYPE_ALLOC (type, nfields * sizeof (struct field));
-  memset (TYPE_FIELDS (type), 0, sizeof (struct field) * nfields);
-  TYPE_NAME (type) = ada_type_name (templ_type);
-  TYPE_TAG_NAME (type) = NULL;
-  /* FIXME:  TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
-  /*  TYPE_FLAGS (type) |= TYPE_FLAG_FIXED_INSTANCE; */
-  TYPE_LENGTH (type) = 0;
+  nfields = TYPE_NFIELDS (type0);
+  type = type0;
 
   for (f = 0; f < nfields; f += 1)
     {
-      TYPE_FIELD_BITPOS (type, f) = 0;
-      TYPE_FIELD_BITSIZE (type, f) = 0;
-      TYPE_FIELD_STATIC_KIND (type, f) = 0;
+      struct type *field_type = CHECK_TYPEDEF (TYPE_FIELD_TYPE (type0, f));
+      struct type *new_type;
 
-      if (is_dynamic_field (templ_type, f))
-	{
-	  TYPE_FIELD_TYPE (type, f) =
-	    to_static_fixed_type (TYPE_TARGET_TYPE
-				  (TYPE_FIELD_TYPE (templ_type, f)));
-	  TYPE_FIELD_NAME (type, f) = TYPE_FIELD_NAME (templ_type, f);
-	}
+      if (is_dynamic_field (type0, f))
+        new_type = to_static_fixed_type (TYPE_TARGET_TYPE (field_type));
       else
-	{
-	  TYPE_FIELD_TYPE (type, f) =
-	    check_typedef (TYPE_FIELD_TYPE (templ_type, f));
-	  TYPE_FIELD_NAME (type, f) = TYPE_FIELD_NAME (templ_type, f);
-	}
+        new_type = to_static_fixed_type (field_type);
+      if (type == type0 && new_type != field_type)
+        {
+          TYPE_TARGET_TYPE (type0) = type = alloc_type (TYPE_OBJFILE (type0));
+          TYPE_CODE (type) = TYPE_CODE (type0);
+          INIT_CPLUS_SPECIFIC (type);
+          TYPE_NFIELDS (type) = nfields;
+          TYPE_FIELDS (type) = (struct field *)
+            TYPE_ALLOC (type, nfields * sizeof (struct field));
+          memcpy (TYPE_FIELDS (type), TYPE_FIELDS (type0),
+                  sizeof (struct field) * nfields);
+          TYPE_NAME (type) = ada_type_name (type0);
+          TYPE_TAG_NAME (type) = NULL;
+          TYPE_FLAGS (type) |= TYPE_FLAG_FIXED_INSTANCE;
+          TYPE_LENGTH (type) = 0;
+        }
+      TYPE_FIELD_TYPE (type, f) = new_type;
+      TYPE_FIELD_NAME (type, f) = TYPE_FIELD_NAME (type0, f);
     }
-
   return type;
 }
 
-/* A revision of TYPE0 -- a non-dynamic-sized record with a variant
-   part -- in which the variant part is replaced with the appropriate
-   branch. */
+/* Given an object of type TYPE whose contents are at VALADDR and
+   whose address in memory is ADDRESS, returns a revision of TYPE --
+   a non-dynamic-sized record with a variant part -- in which
+   the variant part is replaced with the appropriate branch.  Looks
+   for discriminant values in DVAL0, which can be NULL if the record
+   contains the necessary discriminant values.  */
+
 static struct type *
 to_record_with_fixed_variant_part (struct type *type, char *valaddr,
-				   CORE_ADDR address, struct value *dval)
+                                   CORE_ADDR address, struct value *dval0)
 {
   struct value *mark = value_mark ();
+  struct value *dval;
   struct type *rtype;
   struct type *branch_type;
   int nfields = TYPE_NFIELDS (type);
+  int variant_field = variant_field_index (type);
 
-  if (dval == NULL)
+  if (variant_field == -1)
     return type;
 
+  if (dval0 == NULL)
+    dval = value_from_contents_and_address (type, valaddr, address);
+  else
+    dval = dval0;
+
   rtype = alloc_type (TYPE_OBJFILE (type));
   TYPE_CODE (rtype) = TYPE_CODE_STRUCT;
-  INIT_CPLUS_SPECIFIC (type);
-  TYPE_NFIELDS (rtype) = TYPE_NFIELDS (type);
+  INIT_CPLUS_SPECIFIC (rtype);
+  TYPE_NFIELDS (rtype) = nfields;
   TYPE_FIELDS (rtype) =
     (struct field *) TYPE_ALLOC (rtype, nfields * sizeof (struct field));
   memcpy (TYPE_FIELDS (rtype), TYPE_FIELDS (type),
-	  sizeof (struct field) * nfields);
+          sizeof (struct field) * nfields);
   TYPE_NAME (rtype) = ada_type_name (type);
   TYPE_TAG_NAME (rtype) = NULL;
-  /* FIXME:  TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
-  /*  TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE; */
+  TYPE_FLAGS (rtype) |= TYPE_FLAG_FIXED_INSTANCE;
   TYPE_LENGTH (rtype) = TYPE_LENGTH (type);
 
-  branch_type =
-    to_fixed_variant_branch_type
-    (TYPE_FIELD_TYPE (type, nfields - 1),
+  branch_type = to_fixed_variant_branch_type
+    (TYPE_FIELD_TYPE (type, variant_field),
      cond_offset_host (valaddr,
-		       TYPE_FIELD_BITPOS (type,
-					  nfields - 1) / TARGET_CHAR_BIT),
+                       TYPE_FIELD_BITPOS (type, variant_field)
+                       / TARGET_CHAR_BIT),
      cond_offset_target (address,
-			 TYPE_FIELD_BITPOS (type,
-					    nfields - 1) / TARGET_CHAR_BIT),
-     dval);
+                         TYPE_FIELD_BITPOS (type, variant_field)
+                         / TARGET_CHAR_BIT), dval);
   if (branch_type == NULL)
     {
+      int f;
+      for (f = variant_field + 1; f < nfields; f += 1)
+        TYPE_FIELDS (rtype)[f - 1] = TYPE_FIELDS (rtype)[f];
       TYPE_NFIELDS (rtype) -= 1;
-      TYPE_LENGTH (rtype) -=
-	TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1));
     }
   else
     {
-      TYPE_FIELD_TYPE (rtype, nfields - 1) = branch_type;
-      TYPE_FIELD_NAME (rtype, nfields - 1) = "S";
-      TYPE_FIELD_BITSIZE (rtype, nfields - 1) = 0;
-      TYPE_FIELD_STATIC_KIND (rtype, nfields - 1) = 0;
+      TYPE_FIELD_TYPE (rtype, variant_field) = branch_type;
+      TYPE_FIELD_NAME (rtype, variant_field) = "S";
+      TYPE_FIELD_BITSIZE (rtype, variant_field) = 0;
       TYPE_LENGTH (rtype) += TYPE_LENGTH (branch_type);
-      -TYPE_LENGTH (TYPE_FIELD_TYPE (type, nfields - 1));
     }
+  TYPE_LENGTH (rtype) -= TYPE_LENGTH (TYPE_FIELD_TYPE (type, variant_field));
 
+  value_free_to_mark (mark);
   return rtype;
 }
 
 /* An ordinary record type (with fixed-length fields) that describes
    the value at (TYPE0, VALADDR, ADDRESS) [see explanation at
    beginning of this section].   Any necessary discriminants' values
-   should be in DVAL, a record value; it should be NULL if the object
-   at ADDR itself contains any necessary  discriminant values.  A
-   variant field (unless unchecked) is replaced by a particular branch
-   of the variant. */
+   should be in DVAL, a record value; it may be NULL if the object
+   at ADDR itself contains any necessary discriminant values.
+   Additionally, VALADDR and ADDRESS may also be NULL if no discriminant
+   values from the record are needed.  Except in the case that DVAL,
+   VALADDR, and ADDRESS are all 0 or NULL, a variant field (unless
+   unchecked) is replaced by a particular branch of the variant.
+
+   NOTE: the case in which DVAL and VALADDR are NULL and ADDRESS is 0
+   is questionable and may be removed.  It can arise during the
+   processing of an unconstrained-array-of-record type where all the
+   variant branches have exactly the same size.  This is because in
+   such cases, the compiler does not bother to use the XVS convention
+   when encoding the record.  I am currently dubious of this
+   shortcut and suspect the compiler should be altered.  FIXME.  */
 
 static struct type *
-to_fixed_record_type (struct type *type0, char *valaddr, CORE_ADDR address,
-		      struct value *dval)
+to_fixed_record_type (struct type *type0, char *valaddr,
+                      CORE_ADDR address, struct value *dval)
 {
   struct type *templ_type;
 
-  /* FIXME:  TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
-  /*  if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE)
-     return type0;
-   */
+  if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE)
+    return type0;
+
   templ_type = dynamic_template_type (type0);
 
   if (templ_type != NULL)
     return template_to_fixed_record_type (templ_type, valaddr, address, dval);
-  else if (contains_variant_part (type0))
-    return to_record_with_fixed_variant_part (type0, valaddr, address, dval);
+  else if (variant_field_index (type0) >= 0)
+    {
+      if (dval == NULL && valaddr == NULL && address == 0)
+        return type0;
+      return to_record_with_fixed_variant_part (type0, valaddr, address,
+                                                dval);
+    }
   else
     {
-      /* FIXME:  TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
-      /*      TYPE_FLAGS (type0) |= TYPE_FLAG_FIXED_INSTANCE; */
+      TYPE_FLAGS (type0) |= TYPE_FLAG_FIXED_INSTANCE;
       return type0;
     }
 
@@ -6200,11 +7995,11 @@
    union type.  Any necessary discriminants' values should be in DVAL,
    a record value.  That is, this routine selects the appropriate
    branch of the union at ADDR according to the discriminant value
-   indicated in the union's type name. */
+   indicated in the union's type name.  */
 
 static struct type *
 to_fixed_variant_branch_type (struct type *var_type0, char *valaddr,
-			      CORE_ADDR address, struct value *dval)
+                              CORE_ADDR address, struct value *dval)
 {
   int which;
   struct type *templ_type;
@@ -6222,16 +8017,15 @@
 
   which =
     ada_which_variant_applies (var_type,
-			       VALUE_TYPE (dval), VALUE_CONTENTS (dval));
+                               VALUE_TYPE (dval), VALUE_CONTENTS (dval));
 
   if (which < 0)
     return empty_record (TYPE_OBJFILE (var_type));
   else if (is_dynamic_field (var_type, which))
-    return
-      to_fixed_record_type
+    return to_fixed_record_type
       (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (var_type, which)),
        valaddr, address, dval);
-  else if (contains_variant_part (TYPE_FIELD_TYPE (var_type, which)))
+  else if (variant_field_index (TYPE_FIELD_TYPE (var_type, which)) >= 0)
     return
       to_fixed_record_type
       (TYPE_FIELD_TYPE (var_type, which), valaddr, address, dval);
@@ -6245,35 +8039,33 @@
    contains no dynamic components (that is, no components whose sizes
    are determined by run-time quantities).  Unless IGNORE_TOO_BIG is
    true, gives an error message if the resulting type's size is over
-   varsize_limit.
-*/
+   varsize_limit.  */
 
 static struct type *
 to_fixed_array_type (struct type *type0, struct value *dval,
-		     int ignore_too_big)
+                     int ignore_too_big)
 {
   struct type *index_type_desc;
   struct type *result;
 
-  /* FIXME:  TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
-/*  if (ada_is_packed_array_type (type0)  /* revisit? *//*
-   || (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE))
-   return type0; */
+  if (ada_is_packed_array_type (type0)  /* revisit? */
+      || (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE))
+    return type0;
 
   index_type_desc = ada_find_parallel_type (type0, "___XA");
   if (index_type_desc == NULL)
     {
       struct type *elt_type0 = check_typedef (TYPE_TARGET_TYPE (type0));
       /* NOTE: elt_type---the fixed version of elt_type0---should never
-       * depend on the contents of the array in properly constructed
-       * debugging data. */
+         depend on the contents of the array in properly constructed
+         debugging data.  */
       struct type *elt_type = ada_to_fixed_type (elt_type0, 0, 0, dval);
 
       if (elt_type0 == elt_type)
-	result = type0;
+        result = type0;
       else
-	result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
-				    elt_type, TYPE_INDEX_TYPE (type0));
+        result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
+                                    elt_type, TYPE_INDEX_TYPE (type0));
     }
   else
     {
@@ -6282,26 +8074,25 @@
 
       elt_type0 = type0;
       for (i = TYPE_NFIELDS (index_type_desc); i > 0; i -= 1)
-	elt_type0 = TYPE_TARGET_TYPE (elt_type0);
+        elt_type0 = TYPE_TARGET_TYPE (elt_type0);
 
       /* NOTE: result---the fixed version of elt_type0---should never
-       * depend on the contents of the array in properly constructed
-       * debugging data. */
+         depend on the contents of the array in properly constructed
+         debugging data.  */
       result = ada_to_fixed_type (check_typedef (elt_type0), 0, 0, dval);
       for (i = TYPE_NFIELDS (index_type_desc) - 1; i >= 0; i -= 1)
-	{
-	  struct type *range_type =
-	    to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, i),
-				 dval, TYPE_OBJFILE (type0));
-	  result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
-				      result, range_type);
-	}
+        {
+          struct type *range_type =
+            to_fixed_range_type (TYPE_FIELD_NAME (index_type_desc, i),
+                                 dval, TYPE_OBJFILE (type0));
+          result = create_array_type (alloc_type (TYPE_OBJFILE (type0)),
+                                      result, range_type);
+        }
       if (!ignore_too_big && TYPE_LENGTH (result) > varsize_limit)
-	error ("array type with dynamic size is larger than varsize-limit");
+        error ("array type with dynamic size is larger than varsize-limit");
     }
 
-/* FIXME:  TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
-/*  TYPE_FLAGS (result) |= TYPE_FLAG_FIXED_INSTANCE; */
+  TYPE_FLAGS (result) |= TYPE_FLAG_FIXED_INSTANCE;
   return result;
 }
 
@@ -6309,11 +8100,12 @@
 /* A standard type (containing no dynamically sized components)
    corresponding to TYPE for the value (TYPE, VALADDR, ADDRESS)
    DVAL describes a record containing any discriminants used in TYPE0,
-   and may be NULL if there are none. */
+   and may be NULL if there are none, or if the object of type TYPE at
+   ADDRESS or in VALADDR contains these discriminants.  */
 
 struct type *
-ada_to_fixed_type (struct type *type, char *valaddr, CORE_ADDR address,
-		   struct value *dval)
+ada_to_fixed_type (struct type *type, char *valaddr,
+                   CORE_ADDR address, struct value *dval)
 {
   CHECK_TYPEDEF (type);
   switch (TYPE_CODE (type))
@@ -6321,19 +8113,31 @@
     default:
       return type;
     case TYPE_CODE_STRUCT:
-      return to_fixed_record_type (type, valaddr, address, NULL);
+      {
+        struct type *static_type = to_static_fixed_type (type);
+        if (ada_is_tagged_type (static_type, 0))
+          {
+            struct type *real_type =
+              type_from_tag (value_tag_from_contents_and_address (static_type,
+                                                                  valaddr,
+                                                                  address));
+            if (real_type != NULL)
+              type = real_type;
+          }
+        return to_fixed_record_type (type, valaddr, address, NULL);
+      }
     case TYPE_CODE_ARRAY:
-      return to_fixed_array_type (type, dval, 0);
+      return to_fixed_array_type (type, dval, 1);
     case TYPE_CODE_UNION:
       if (dval == NULL)
-	return type;
+        return type;
       else
-	return to_fixed_variant_branch_type (type, valaddr, address, dval);
+        return to_fixed_variant_branch_type (type, valaddr, address, dval);
     }
 }
 
 /* A standard (static-sized) type corresponding as well as possible to
-   TYPE0, but based on no runtime data. */
+   TYPE0, but based on no runtime data.  */
 
 static struct type *
 to_static_fixed_type (struct type *type0)
@@ -6343,10 +8147,9 @@
   if (type0 == NULL)
     return NULL;
 
-  /* FIXME:  TYPE_FLAG_FIXED_INSTANCE should be defined in gdbtypes.h */
-  /*  if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE)
-     return type0;
-   */
+  if (TYPE_FLAGS (type0) & TYPE_FLAG_FIXED_INSTANCE)
+    return type0;
+
   CHECK_TYPEDEF (type0);
 
   switch (TYPE_CODE (type0))
@@ -6356,17 +8159,20 @@
     case TYPE_CODE_STRUCT:
       type = dynamic_template_type (type0);
       if (type != NULL)
-	return template_to_static_fixed_type (type);
-      return type0;
+        return template_to_static_fixed_type (type);
+      else
+        return template_to_static_fixed_type (type0);
     case TYPE_CODE_UNION:
       type = ada_find_parallel_type (type0, "___XVU");
       if (type != NULL)
-	return template_to_static_fixed_type (type);
-      return type0;
+        return template_to_static_fixed_type (type);
+      else
+        return template_to_static_fixed_type (type0);
     }
 }
 
-/* A static approximation of TYPE with all type wrappers removed. */
+/* A static approximation of TYPE with all type wrappers removed.  */
+
 static struct type *
 static_unwrap_type (struct type *type)
 {
@@ -6374,7 +8180,7 @@
     {
       struct type *type1 = TYPE_FIELD_TYPE (check_typedef (type), 0);
       if (ada_type_name (type1) == NULL)
-	TYPE_NAME (type1) = ada_type_name (type);
+        TYPE_NAME (type1) = ada_type_name (type);
 
       return static_unwrap_type (type1);
     }
@@ -6382,25 +8188,26 @@
     {
       struct type *raw_real_type = ada_get_base_type (type);
       if (raw_real_type == type)
-	return type;
+        return type;
       else
-	return to_static_fixed_type (raw_real_type);
+        return to_static_fixed_type (raw_real_type);
     }
 }
 
 /* In some cases, incomplete and private types require
-   cross-references that are not resolved as records (for example, 
+   cross-references that are not resolved as records (for example,
       type Foo;
       type FooP is access Foo;
       V: FooP;
       type Foo is array ...;
-   ). In these cases, since there is no mechanism for producing 
+   ).  In these cases, since there is no mechanism for producing
    cross-references to such types, we instead substitute for FooP a
    stub enumeration type that is nowhere resolved, and whose tag is
-   the name of the actual type.  Call these types "non-record stubs". */
+   the name of the actual type.  Call these types "non-record stubs".  */
 
 /* A type equivalent to TYPE that is not a non-record stub, if one
-   exists, otherwise TYPE. */
+   exists, otherwise TYPE.  */
+
 struct type *
 ada_completed_type (struct type *type)
 {
@@ -6421,23 +8228,53 @@
    type TYPE0, but with a standard (static-sized) type that correctly
    describes it.  If VAL0 is not NULL and TYPE0 already is a standard
    type, then return VAL0 [this feature is simply to avoid redundant
-   creation of struct values]. */
+   creation of struct values].  */
 
-struct value *
-ada_to_fixed_value (struct type *type0, char *valaddr, CORE_ADDR address,
-		    struct value *val0)
+static struct value *
+ada_to_fixed_value_create (struct type *type0, CORE_ADDR address,
+                           struct value *val0)
 {
-  struct type *type = ada_to_fixed_type (type0, valaddr, address, NULL);
+  struct type *type = ada_to_fixed_type (type0, 0, address, NULL);
   if (type == type0 && val0 != NULL)
     return val0;
   else
-    return value_from_contents_and_address (type, valaddr, address);
+    return value_from_contents_and_address (type, 0, address);
 }
 
-/* A value representing VAL, but with a standard (static-sized) type 
+/* A value representing VAL, but with a standard (static-sized) type
+   that correctly describes it.  Does not necessarily create a new
+   value.  */
+
+static struct value *
+ada_to_fixed_value (struct value *val)
+{
+  return ada_to_fixed_value_create (VALUE_TYPE (val),
+                                    VALUE_ADDRESS (val) + VALUE_OFFSET (val),
+                                    val);
+}
+
+/* If the PC is pointing inside a function prologue, then re-adjust it
+   past this prologue.  */
+
+static void
+adjust_pc_past_prologue (CORE_ADDR *pc)
+{
+  struct symbol *func_sym = find_pc_function (*pc);
+
+  if (func_sym)
+    {
+      const struct symtab_and_line sal =
+        find_function_start_sal (func_sym, 1);
+
+      if (*pc <= sal.pc)
+        *pc = sal.pc;
+    }
+}
+
+/* A value representing VAL, but with a standard (static-sized) type
    chosen to approximate the real type of VAL as well as possible, but
    without consulting any runtime values.  For Ada dynamic-sized
-   types, therefore, the type of the result is likely to be inaccurate. */
+   types, therefore, the type of the result is likely to be inaccurate.  */
 
 struct value *
 ada_to_static_fixed_value (struct value *val)
@@ -6447,17 +8284,14 @@
   if (type == VALUE_TYPE (val))
     return val;
   else
-    return coerce_unspec_val_to_type (val, 0, type);
+    return coerce_unspec_val_to_type (val, type);
 }
 
 
-
-
-
 /* Attributes */
 
-/* Table mapping attribute numbers to names */
-/* NOTE: Keep up to date with enum ada_attribute definition in ada-lang.h */
+/* Table mapping attribute numbers to names.
+   NOTE: Keep up to date with enum ada_attribute definition in ada-lang.h.  */
 
 static const char *attribute_names[] = {
   "<?>",
@@ -6466,28 +8300,29 @@
   "last",
   "length",
   "image",
-  "img",
   "max",
   "min",
-  "pos" "tag",
+  "modulus",
+  "pos",
+  "size",
+  "tag",
   "val",
-
   0
 };
 
 const char *
-ada_attribute_name (int n)
+ada_attribute_name (enum exp_opcode n)
 {
-  if (n > 0 && n < (int) ATR_END)
-    return attribute_names[n];
+  if (n >= OP_ATR_FIRST && n <= (int) OP_ATR_VAL)
+    return attribute_names[n - OP_ATR_FIRST + 1];
   else
     return attribute_names[0];
 }
 
-/* Evaluate the 'POS attribute applied to ARG. */
+/* Evaluate the 'POS attribute applied to ARG.  */
 
-static struct value *
-value_pos_atr (struct value *arg)
+static LONGEST
+pos_atr (struct value *arg)
 {
   struct type *type = VALUE_TYPE (arg);
 
@@ -6500,17 +8335,23 @@
       LONGEST v = value_as_long (arg);
 
       for (i = 0; i < TYPE_NFIELDS (type); i += 1)
-	{
-	  if (v == TYPE_FIELD_BITPOS (type, i))
-	    return value_from_longest (builtin_type_ada_int, i);
-	}
+        {
+          if (v == TYPE_FIELD_BITPOS (type, i))
+            return i;
+        }
       error ("enumeration value is invalid: can't find 'POS");
     }
   else
-    return value_from_longest (builtin_type_ada_int, value_as_long (arg));
+    return value_as_long (arg);
 }
 
-/* Evaluate the TYPE'VAL attribute applied to ARG. */
+static struct value *
+value_pos_atr (struct value *arg)
+{
+  return value_from_longest (builtin_type_ada_int, pos_atr (arg));
+}
+
+/* Evaluate the TYPE'VAL attribute applied to ARG.  */
 
 static struct value *
 value_val_atr (struct type *type, struct value *arg)
@@ -6524,7 +8365,7 @@
     {
       long pos = value_as_long (arg);
       if (pos < 0 || pos >= TYPE_NFIELDS (type))
-	error ("argument to 'VAL out of range");
+        error ("argument to 'VAL out of range");
       return value_from_longest (type, TYPE_FIELD_BITPOS (type, pos));
     }
   else
@@ -6532,11 +8373,11 @@
 }
 
 
-				/* Evaluation */
+                                /* Evaluation */
 
-/* True if TYPE appears to be an Ada character type.  
- * [At the moment, this is true only for Character and Wide_Character;
- * It is a heuristic test that could stand improvement]. */
+/* True if TYPE appears to be an Ada character type.
+   [At the moment, this is true only for Character and Wide_Character;
+   It is a heuristic test that could stand improvement].  */
 
 int
 ada_is_character_type (struct type *type)
@@ -6545,13 +8386,14 @@
   return
     name != NULL
     && (TYPE_CODE (type) == TYPE_CODE_CHAR
-	|| TYPE_CODE (type) == TYPE_CODE_INT
-	|| TYPE_CODE (type) == TYPE_CODE_RANGE)
-    && (DEPRECATED_STREQ (name, "character") || DEPRECATED_STREQ (name, "wide_character")
-	|| DEPRECATED_STREQ (name, "unsigned char"));
+        || TYPE_CODE (type) == TYPE_CODE_INT
+        || TYPE_CODE (type) == TYPE_CODE_RANGE)
+    && (strcmp (name, "character") == 0
+        || strcmp (name, "wide_character") == 0
+        || strcmp (name, "unsigned char") == 0);
 }
 
-/* True if TYPE appears to be an Ada string type. */
+/* True if TYPE appears to be an Ada string type.  */
 
 int
 ada_is_string_type (struct type *type)
@@ -6559,7 +8401,8 @@
   CHECK_TYPEDEF (type);
   if (type != NULL
       && TYPE_CODE (type) != TYPE_CODE_PTR
-      && (ada_is_simple_array (type) || ada_is_array_descriptor (type))
+      && (ada_is_simple_array_type (type)
+          || ada_is_array_descriptor_type (type))
       && ada_array_arity (type) == 1)
     {
       struct type *elttype = ada_array_element_type (type, 1);
@@ -6573,26 +8416,25 @@
 
 /* True if TYPE is a struct type introduced by the compiler to force the
    alignment of a value.  Such types have a single field with a
-   distinctive name. */
+   distinctive name.  */
 
 int
 ada_is_aligner_type (struct type *type)
 {
   CHECK_TYPEDEF (type);
   return (TYPE_CODE (type) == TYPE_CODE_STRUCT
-	  && TYPE_NFIELDS (type) == 1
-	  && DEPRECATED_STREQ (TYPE_FIELD_NAME (type, 0), "F"));
+          && TYPE_NFIELDS (type) == 1
+          && strcmp (TYPE_FIELD_NAME (type, 0), "F") == 0);
 }
 
 /* If there is an ___XVS-convention type parallel to SUBTYPE, return
-   the parallel type. */
+   the parallel type.  */
 
 struct type *
 ada_get_base_type (struct type *raw_type)
 {
   struct type *real_type_namer;
   struct type *raw_real_type;
-  struct type *real_type;
 
   if (raw_type == NULL || TYPE_CODE (raw_type) != TYPE_CODE_STRUCT)
     return raw_type;
@@ -6610,7 +8452,7 @@
     return raw_real_type;
 }
 
-/* The type of value designated by TYPE, with all aligners removed. */
+/* The type of value designated by TYPE, with all aligners removed.  */
 
 struct type *
 ada_aligned_type (struct type *type)
@@ -6623,82 +8465,113 @@
 
 
 /* The address of the aligned value in an object at address VALADDR
-   having type TYPE.  Assumes ada_is_aligner_type (TYPE). */
+   having type TYPE.  Assumes ada_is_aligner_type (TYPE).  */
 
 char *
 ada_aligned_value_addr (struct type *type, char *valaddr)
 {
   if (ada_is_aligner_type (type))
     return ada_aligned_value_addr (TYPE_FIELD_TYPE (type, 0),
-				   valaddr +
-				   TYPE_FIELD_BITPOS (type,
-						      0) / TARGET_CHAR_BIT);
+                                   valaddr +
+                                   TYPE_FIELD_BITPOS (type,
+                                                      0) / TARGET_CHAR_BIT);
   else
     return valaddr;
 }
 
+
+
 /* The printed representation of an enumeration literal with encoded
-   name NAME. The value is good to the next call of ada_enum_name. */
+   name NAME.  The value is good to the next call of ada_enum_name.  */
 const char *
 ada_enum_name (const char *name)
 {
+  static char *result;
+  static size_t result_len = 0;
   char *tmp;
 
-  while (1)
+  /* First, unqualify the enumeration name:
+     1. Search for the last '.' character.  If we find one, then skip
+     all the preceeding characters, the unqualified name starts
+     right after that dot.
+     2. Otherwise, we may be debugging on a target where the compiler
+     translates dots into "__".  Search forward for double underscores,
+     but stop searching when we hit an overloading suffix, which is
+     of the form "__" followed by digits.  */
+
+  tmp = strrchr (name, '.');
+  if (tmp != NULL)
+    name = tmp + 1;
+  else
     {
-      if ((tmp = strstr (name, "__")) != NULL)
-	name = tmp + 2;
-      else if ((tmp = strchr (name, '.')) != NULL)
-	name = tmp + 1;
-      else
-	break;
+      while ((tmp = strstr (name, "__")) != NULL)
+        {
+          if (isdigit (tmp[2]))
+            break;
+          else
+            name = tmp + 2;
+        }
     }
 
   if (name[0] == 'Q')
     {
-      static char result[16];
       int v;
       if (name[1] == 'U' || name[1] == 'W')
-	{
-	  if (sscanf (name + 2, "%x", &v) != 1)
-	    return name;
-	}
+        {
+          if (sscanf (name + 2, "%x", &v) != 1)
+            return name;
+        }
       else
-	return name;
+        return name;
 
+      GROW_VECT (result, result_len, 16);
       if (isascii (v) && isprint (v))
-	sprintf (result, "'%c'", v);
+        sprintf (result, "'%c'", v);
       else if (name[1] == 'U')
-	sprintf (result, "[\"%02x\"]", v);
+        sprintf (result, "[\"%02x\"]", v);
       else
-	sprintf (result, "[\"%04x\"]", v);
+        sprintf (result, "[\"%04x\"]", v);
 
       return result;
     }
   else
-    return name;
+    {
+      tmp = strstr (name, "__");
+      if (tmp == NULL)
+	tmp = strstr (name, "$");
+      if (tmp != NULL)
+        {
+          GROW_VECT (result, result_len, tmp - name + 1);
+          strncpy (result, name, tmp - name);
+          result[tmp - name] = '\0';
+          return result;
+        }
+
+      return name;
+    }
 }
 
 static struct value *
 evaluate_subexp (struct type *expect_type, struct expression *exp, int *pos,
-		 enum noside noside)
+                 enum noside noside)
 {
-  return (*exp->language_defn->evaluate_exp) (expect_type, exp, pos, noside);
+  return (*exp->language_defn->la_exp_desc->evaluate_exp)
+    (expect_type, exp, pos, noside);
 }
 
 /* Evaluate the subexpression of EXP starting at *POS as for
    evaluate_type, updating *POS to point just past the evaluated
-   expression. */
+   expression.  */
 
 static struct value *
 evaluate_subexp_type (struct expression *exp, int *pos)
 {
-  return (*exp->language_defn->evaluate_exp)
+  return (*exp->language_defn->la_exp_desc->evaluate_exp)
     (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
 }
 
 /* If VAL is wrapped in an aligner or subtype wrapper, return the
-   value it wraps. */
+   value it wraps.  */
 
 static struct value *
 unwrap_value (struct value *val)
@@ -6707,26 +8580,26 @@
   if (ada_is_aligner_type (type))
     {
       struct value *v = value_struct_elt (&val, NULL, "F",
-					  NULL, "internal structure");
+                                          NULL, "internal structure");
       struct type *val_type = check_typedef (VALUE_TYPE (v));
       if (ada_type_name (val_type) == NULL)
-	TYPE_NAME (val_type) = ada_type_name (type);
+        TYPE_NAME (val_type) = ada_type_name (type);
 
       return unwrap_value (v);
     }
   else
     {
       struct type *raw_real_type =
-	ada_completed_type (ada_get_base_type (type));
+        ada_completed_type (ada_get_base_type (type));
 
       if (type == raw_real_type)
-	return val;
+        return val;
 
       return
-	coerce_unspec_val_to_type
-	(val, 0, ada_to_fixed_type (raw_real_type, 0,
-				    VALUE_ADDRESS (val) + VALUE_OFFSET (val),
-				    NULL));
+        coerce_unspec_val_to_type
+        (val, ada_to_fixed_type (raw_real_type, 0,
+                                 VALUE_ADDRESS (val) + VALUE_OFFSET (val),
+                                 NULL));
     }
 }
 
@@ -6739,12 +8612,12 @@
     return arg;
   else if (ada_is_fixed_point_type (VALUE_TYPE (arg)))
     val = ada_float_to_fixed (type,
-			      ada_fixed_to_float (VALUE_TYPE (arg),
-						  value_as_long (arg)));
+                              ada_fixed_to_float (VALUE_TYPE (arg),
+                                                  value_as_long (arg)));
   else
     {
       DOUBLEST argd =
-	value_as_double (value_cast (builtin_type_double, value_copy (arg)));
+        value_as_double (value_cast (builtin_type_double, value_copy (arg)));
       val = ada_float_to_fixed (type, argd);
     }
 
@@ -6755,12 +8628,13 @@
 cast_from_fixed_to_double (struct value *arg)
 {
   DOUBLEST val = ada_fixed_to_float (VALUE_TYPE (arg),
-				     value_as_long (arg));
+                                     value_as_long (arg));
   return value_from_double (builtin_type_double, val);
 }
 
-/* Coerce VAL as necessary for assignment to an lval of type TYPE, and 
- * return the converted value. */
+/* Coerce VAL as necessary for assignment to an lval of type TYPE, and
+   return the converted value.  */
+
 static struct value *
 coerce_for_assign (struct type *type, struct value *val)
 {
@@ -6782,20 +8656,98 @@
       && TYPE_CODE (type) == TYPE_CODE_ARRAY)
     {
       if (TYPE_LENGTH (type2) != TYPE_LENGTH (type)
-	  || TYPE_LENGTH (TYPE_TARGET_TYPE (type2))
-	  != TYPE_LENGTH (TYPE_TARGET_TYPE (type2)))
-	error ("Incompatible types in assignment");
+          || TYPE_LENGTH (TYPE_TARGET_TYPE (type2))
+          != TYPE_LENGTH (TYPE_TARGET_TYPE (type2)))
+        error ("Incompatible types in assignment");
       VALUE_TYPE (val) = type;
     }
   return val;
 }
 
+static struct value *
+ada_value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
+{
+  struct value *val;
+  struct type *type1, *type2;
+  LONGEST v, v1, v2;
+
+  COERCE_REF (arg1);
+  COERCE_REF (arg2);
+  type1 = base_type (check_typedef (VALUE_TYPE (arg1)));
+  type2 = base_type (check_typedef (VALUE_TYPE (arg2)));
+
+  if (TYPE_CODE (type1) != TYPE_CODE_INT
+      || TYPE_CODE (type2) != TYPE_CODE_INT)
+    return value_binop (arg1, arg2, op);
+
+  switch (op)
+    {
+    case BINOP_MOD:
+    case BINOP_DIV:
+    case BINOP_REM:
+      break;
+    default:
+      return value_binop (arg1, arg2, op);
+    }
+
+  v2 = value_as_long (arg2);
+  if (v2 == 0)
+    error ("second operand of %s must not be zero.", op_string (op));
+
+  if (TYPE_UNSIGNED (type1) || op == BINOP_MOD)
+    return value_binop (arg1, arg2, op);
+
+  v1 = value_as_long (arg1);
+  switch (op)
+    {
+    case BINOP_DIV:
+      v = v1 / v2;
+      if (!TRUNCATION_TOWARDS_ZERO && v1 * (v1 % v2) < 0)
+        v += v > 0 ? -1 : 1;
+      break;
+    case BINOP_REM:
+      v = v1 % v2;
+      if (v * v1 < 0)
+        v -= v2;
+      break;
+    default:
+      /* Should not reach this point.  */
+      v = 0;
+    }
+
+  val = allocate_value (type1);
+  store_unsigned_integer (VALUE_CONTENTS_RAW (val),
+                          TYPE_LENGTH (VALUE_TYPE (val)), v);
+  return val;
+}
+
+static int
+ada_value_equal (struct value *arg1, struct value *arg2)
+{
+  if (ada_is_direct_array_type (VALUE_TYPE (arg1))
+      || ada_is_direct_array_type (VALUE_TYPE (arg2)))
+    {
+      arg1 = ada_coerce_to_simple_array (arg1);
+      arg2 = ada_coerce_to_simple_array (arg2);
+      if (TYPE_CODE (VALUE_TYPE (arg1)) != TYPE_CODE_ARRAY
+          || TYPE_CODE (VALUE_TYPE (arg2)) != TYPE_CODE_ARRAY)
+        error ("Attempt to compare array with non-array");
+      /* FIXME: The following works only for types whose
+         representations use all bits (no padding or undefined bits)
+         and do not have user-defined equality.  */
+      return
+        TYPE_LENGTH (VALUE_TYPE (arg1)) == TYPE_LENGTH (VALUE_TYPE (arg2))
+        && memcmp (VALUE_CONTENTS (arg1), VALUE_CONTENTS (arg2),
+                   TYPE_LENGTH (VALUE_TYPE (arg1))) == 0;
+    }
+  return value_equal (arg1, arg2);
+}
+
 struct value *
 ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
-		     int *pos, enum noside noside)
+                     int *pos, enum noside noside)
 {
   enum exp_opcode op;
-  enum ada_attribute atr;
   int tem, tem2, tem3;
   int pc;
   struct value *arg1 = NULL, *arg2 = NULL, *arg3;
@@ -6812,752 +8764,702 @@
     default:
       *pos -= 1;
       return
-	unwrap_value (evaluate_subexp_standard
-		      (expect_type, exp, pos, noside));
+        unwrap_value (evaluate_subexp_standard
+                      (expect_type, exp, pos, noside));
+
+    case OP_STRING:
+      {
+        struct value *result;
+        *pos -= 1;
+        result = evaluate_subexp_standard (expect_type, exp, pos, noside);
+        /* The result type will have code OP_STRING, bashed there from 
+           OP_ARRAY.  Bash it back.  */
+        if (TYPE_CODE (VALUE_TYPE (result)) == TYPE_CODE_STRING)
+          TYPE_CODE (VALUE_TYPE (result)) = TYPE_CODE_ARRAY;
+        return result;
+      }
 
     case UNOP_CAST:
       (*pos) += 2;
       type = exp->elts[pc + 1].type;
       arg1 = evaluate_subexp (type, exp, pos, noside);
       if (noside == EVAL_SKIP)
-	goto nosideret;
+        goto nosideret;
       if (type != check_typedef (VALUE_TYPE (arg1)))
-	{
-	  if (ada_is_fixed_point_type (type))
-	    arg1 = cast_to_fixed (type, arg1);
-	  else if (ada_is_fixed_point_type (VALUE_TYPE (arg1)))
-	    arg1 = value_cast (type, cast_from_fixed_to_double (arg1));
-	  else if (VALUE_LVAL (arg1) == lval_memory)
-	    {
-	      /* This is in case of the really obscure (and undocumented,
-	         but apparently expected) case of (Foo) Bar.all, where Bar 
-	         is an integer constant and Foo is a dynamic-sized type.
-	         If we don't do this, ARG1 will simply be relabeled with
-	         TYPE. */
-	      if (noside == EVAL_AVOID_SIDE_EFFECTS)
-		return value_zero (to_static_fixed_type (type), not_lval);
-	      arg1 =
-		ada_to_fixed_value
-		(type, 0, VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1), 0);
-	    }
-	  else
-	    arg1 = value_cast (type, arg1);
-	}
+        {
+          if (ada_is_fixed_point_type (type))
+            arg1 = cast_to_fixed (type, arg1);
+          else if (ada_is_fixed_point_type (VALUE_TYPE (arg1)))
+            arg1 = value_cast (type, cast_from_fixed_to_double (arg1));
+          else if (VALUE_LVAL (arg1) == lval_memory)
+            {
+              /* This is in case of the really obscure (and undocumented,
+                 but apparently expected) case of (Foo) Bar.all, where Bar
+                 is an integer constant and Foo is a dynamic-sized type.
+                 If we don't do this, ARG1 will simply be relabeled with
+                 TYPE.  */
+              if (noside == EVAL_AVOID_SIDE_EFFECTS)
+                return value_zero (to_static_fixed_type (type), not_lval);
+              arg1 =
+                ada_to_fixed_value_create
+                (type, VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1), 0);
+            }
+          else
+            arg1 = value_cast (type, arg1);
+        }
       return arg1;
 
-      /* FIXME:  UNOP_QUAL should be defined in expression.h */
-      /*    case UNOP_QUAL:
-         (*pos) += 2;
-         type = exp->elts[pc + 1].type;
-         return ada_evaluate_subexp (type, exp, pos, noside);
-       */
+    case UNOP_QUAL:
+      (*pos) += 2;
+      type = exp->elts[pc + 1].type;
+      return ada_evaluate_subexp (type, exp, pos, noside);
+
     case BINOP_ASSIGN:
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
       if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS)
-	return arg1;
-      if (binop_user_defined_p (op, arg1, arg2))
-	return value_x_binop (arg1, arg2, op, OP_NULL, EVAL_NORMAL);
+        return arg1;
+      if (ada_is_fixed_point_type (VALUE_TYPE (arg1)))
+        arg2 = cast_to_fixed (VALUE_TYPE (arg1), arg2);
+      else if (ada_is_fixed_point_type (VALUE_TYPE (arg2)))
+        error
+          ("Fixed-point values must be assigned to fixed-point variables");
       else
-	{
-	  if (ada_is_fixed_point_type (VALUE_TYPE (arg1)))
-	    arg2 = cast_to_fixed (VALUE_TYPE (arg1), arg2);
-	  else if (ada_is_fixed_point_type (VALUE_TYPE (arg2)))
-	    error
-	      ("Fixed-point values must be assigned to fixed-point variables");
-	  else
-	    arg2 = coerce_for_assign (VALUE_TYPE (arg1), arg2);
-	  return ada_value_assign (arg1, arg2);
-	}
+        arg2 = coerce_for_assign (VALUE_TYPE (arg1), arg2);
+      return ada_value_assign (arg1, arg2);
 
     case BINOP_ADD:
       arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
       arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
       if (noside == EVAL_SKIP)
-	goto nosideret;
-      if (binop_user_defined_p (op, arg1, arg2))
-	return value_x_binop (arg1, arg2, op, OP_NULL, EVAL_NORMAL);
-      else
-	{
-	  if ((ada_is_fixed_point_type (VALUE_TYPE (arg1))
-	       || ada_is_fixed_point_type (VALUE_TYPE (arg2)))
-	      && VALUE_TYPE (arg1) != VALUE_TYPE (arg2))
-	    error
-	      ("Operands of fixed-point addition must have the same type");
-	  return value_cast (VALUE_TYPE (arg1), value_add (arg1, arg2));
-	}
+        goto nosideret;
+      if ((ada_is_fixed_point_type (VALUE_TYPE (arg1))
+           || ada_is_fixed_point_type (VALUE_TYPE (arg2)))
+          && VALUE_TYPE (arg1) != VALUE_TYPE (arg2))
+        error ("Operands of fixed-point addition must have the same type");
+      return value_cast (VALUE_TYPE (arg1), value_add (arg1, arg2));
 
     case BINOP_SUB:
       arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
       arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
       if (noside == EVAL_SKIP)
-	goto nosideret;
-      if (binop_user_defined_p (op, arg1, arg2))
-	return value_x_binop (arg1, arg2, op, OP_NULL, EVAL_NORMAL);
-      else
-	{
-	  if ((ada_is_fixed_point_type (VALUE_TYPE (arg1))
-	       || ada_is_fixed_point_type (VALUE_TYPE (arg2)))
-	      && VALUE_TYPE (arg1) != VALUE_TYPE (arg2))
-	    error
-	      ("Operands of fixed-point subtraction must have the same type");
-	  return value_cast (VALUE_TYPE (arg1), value_sub (arg1, arg2));
-	}
+        goto nosideret;
+      if ((ada_is_fixed_point_type (VALUE_TYPE (arg1))
+           || ada_is_fixed_point_type (VALUE_TYPE (arg2)))
+          && VALUE_TYPE (arg1) != VALUE_TYPE (arg2))
+        error ("Operands of fixed-point subtraction must have the same type");
+      return value_cast (VALUE_TYPE (arg1), value_sub (arg1, arg2));
 
     case BINOP_MUL:
     case BINOP_DIV:
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       if (noside == EVAL_SKIP)
-	goto nosideret;
-      if (binop_user_defined_p (op, arg1, arg2))
-	return value_x_binop (arg1, arg2, op, OP_NULL, EVAL_NORMAL);
+        goto nosideret;
+      else if (noside == EVAL_AVOID_SIDE_EFFECTS
+               && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD))
+        return value_zero (VALUE_TYPE (arg1), not_lval);
       else
-	if (noside == EVAL_AVOID_SIDE_EFFECTS
-	    && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD))
-	return value_zero (VALUE_TYPE (arg1), not_lval);
+        {
+          if (ada_is_fixed_point_type (VALUE_TYPE (arg1)))
+            arg1 = cast_from_fixed_to_double (arg1);
+          if (ada_is_fixed_point_type (VALUE_TYPE (arg2)))
+            arg2 = cast_from_fixed_to_double (arg2);
+          return ada_value_binop (arg1, arg2, op);
+        }
+
+    case BINOP_REM:
+    case BINOP_MOD:
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      if (noside == EVAL_SKIP)
+        goto nosideret;
+      else if (noside == EVAL_AVOID_SIDE_EFFECTS
+               && (op == BINOP_DIV || op == BINOP_REM || op == BINOP_MOD))
+        return value_zero (VALUE_TYPE (arg1), not_lval);
       else
-	{
-	  if (ada_is_fixed_point_type (VALUE_TYPE (arg1)))
-	    arg1 = cast_from_fixed_to_double (arg1);
-	  if (ada_is_fixed_point_type (VALUE_TYPE (arg2)))
-	    arg2 = cast_from_fixed_to_double (arg2);
-	  return value_binop (arg1, arg2, op);
-	}
+        return ada_value_binop (arg1, arg2, op);
+
+    case BINOP_EQUAL:
+    case BINOP_NOTEQUAL:
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
+      if (noside == EVAL_SKIP)
+        goto nosideret;
+      if (noside == EVAL_AVOID_SIDE_EFFECTS)
+        tem = 0;
+      else
+        tem = ada_value_equal (arg1, arg2);
+      if (op == BINOP_NOTEQUAL)
+        tem = !tem;
+      return value_from_longest (LA_BOOL_TYPE, (LONGEST) tem);
 
     case UNOP_NEG:
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       if (noside == EVAL_SKIP)
-	goto nosideret;
-      if (unop_user_defined_p (op, arg1))
-	return value_x_unop (arg1, op, EVAL_NORMAL);
+        goto nosideret;
       else if (ada_is_fixed_point_type (VALUE_TYPE (arg1)))
-	return value_cast (VALUE_TYPE (arg1), value_neg (arg1));
+        return value_cast (VALUE_TYPE (arg1), value_neg (arg1));
       else
-	return value_neg (arg1);
+        return value_neg (arg1);
 
-      /* FIXME:  OP_UNRESOLVED_VALUE should be defined in expression.h */
-      /*    case OP_UNRESOLVED_VALUE:
-         /* Only encountered when an unresolved symbol occurs in a
-         context other than a function call, in which case, it is
-   illegal. *//*
-   (*pos) += 3;
-   if (noside == EVAL_SKIP)
-   goto nosideret;
-   else 
-   error ("Unexpected unresolved symbol, %s, during evaluation",
-   ada_demangle (exp->elts[pc + 2].name));
- */
     case OP_VAR_VALUE:
       *pos -= 1;
       if (noside == EVAL_SKIP)
-	{
-	  *pos += 4;
-	  goto nosideret;
-	}
+        {
+          *pos += 4;
+          goto nosideret;
+        }
+      else if (SYMBOL_DOMAIN (exp->elts[pc + 2].symbol) == UNDEF_DOMAIN)
+        /* Only encountered when an unresolved symbol occurs in a
+           context other than a function call, in which case, it is
+           illegal.  */
+        error ("Unexpected unresolved symbol, %s, during evaluation",
+               SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol));
       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	{
-	  *pos += 4;
-	  return value_zero
-	    (to_static_fixed_type
-	     (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol))),
-	     not_lval);
-	}
+        {
+          *pos += 4;
+          return value_zero
+            (to_static_fixed_type
+             (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol))),
+             not_lval);
+        }
       else
-	{
-	  arg1 =
-	    unwrap_value (evaluate_subexp_standard
-			  (expect_type, exp, pos, noside));
-	  return ada_to_fixed_value (VALUE_TYPE (arg1), 0,
-				     VALUE_ADDRESS (arg1) +
-				     VALUE_OFFSET (arg1), arg1);
-	}
-
-    case OP_ARRAY:
-      (*pos) += 3;
-      tem2 = longest_to_int (exp->elts[pc + 1].longconst);
-      tem3 = longest_to_int (exp->elts[pc + 2].longconst);
-      nargs = tem3 - tem2 + 1;
-      type = expect_type ? check_typedef (expect_type) : NULL_TYPE;
-
-      argvec =
-	(struct value * *) alloca (sizeof (struct value *) * (nargs + 1));
-      for (tem = 0; tem == 0 || tem < nargs; tem += 1)
-	/* At least one element gets inserted for the type */
-	{
-	  /* Ensure that array expressions are coerced into pointer objects. */
-	  argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside);
-	}
-      if (noside == EVAL_SKIP)
-	goto nosideret;
-      return value_array (tem2, tem3, argvec);
+        {
+          arg1 =
+            unwrap_value (evaluate_subexp_standard
+                          (expect_type, exp, pos, noside));
+          return ada_to_fixed_value (arg1);
+        }
 
     case OP_FUNCALL:
       (*pos) += 2;
 
       /* Allocate arg vector, including space for the function to be
-         called in argvec[0] and a terminating NULL */
+         called in argvec[0] and a terminating NULL.  */
       nargs = longest_to_int (exp->elts[pc + 1].longconst);
       argvec =
-	(struct value * *) alloca (sizeof (struct value *) * (nargs + 2));
+        (struct value **) alloca (sizeof (struct value *) * (nargs + 2));
 
-      /* FIXME: OP_UNRESOLVED_VALUE should be defined in expression.h */
-      /* FIXME: name should be defined in expresion.h */
-      /*      if (exp->elts[*pos].opcode == OP_UNRESOLVED_VALUE)
-         error ("Unexpected unresolved symbol, %s, during evaluation",
-         ada_demangle (exp->elts[pc + 5].name));
-       */
-      if (0)
-	{
-	  error ("unexpected code path, FIXME");
-	}
+      if (exp->elts[*pos].opcode == OP_VAR_VALUE
+          && SYMBOL_DOMAIN (exp->elts[pc + 5].symbol) == UNDEF_DOMAIN)
+        error ("Unexpected unresolved symbol, %s, during evaluation",
+               SYMBOL_PRINT_NAME (exp->elts[pc + 5].symbol));
       else
-	{
-	  for (tem = 0; tem <= nargs; tem += 1)
-	    argvec[tem] = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-	  argvec[tem] = 0;
+        {
+          for (tem = 0; tem <= nargs; tem += 1)
+            argvec[tem] = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+          argvec[tem] = 0;
 
-	  if (noside == EVAL_SKIP)
-	    goto nosideret;
-	}
+          if (noside == EVAL_SKIP)
+            goto nosideret;
+        }
 
-      if (TYPE_CODE (VALUE_TYPE (argvec[0])) == TYPE_CODE_REF)
-	argvec[0] = value_addr (argvec[0]);
-
-      if (ada_is_packed_array_type (VALUE_TYPE (argvec[0])))
-	argvec[0] = ada_coerce_to_simple_array (argvec[0]);
+      if (ada_is_packed_array_type (desc_base_type (VALUE_TYPE (argvec[0]))))
+        argvec[0] = ada_coerce_to_simple_array (argvec[0]);
+      else if (TYPE_CODE (VALUE_TYPE (argvec[0])) == TYPE_CODE_REF
+               || (TYPE_CODE (VALUE_TYPE (argvec[0])) == TYPE_CODE_ARRAY
+                   && VALUE_LVAL (argvec[0]) == lval_memory))
+        argvec[0] = value_addr (argvec[0]);
 
       type = check_typedef (VALUE_TYPE (argvec[0]));
       if (TYPE_CODE (type) == TYPE_CODE_PTR)
-	{
-	  switch (TYPE_CODE (check_typedef (TYPE_TARGET_TYPE (type))))
-	    {
-	    case TYPE_CODE_FUNC:
-	      type = check_typedef (TYPE_TARGET_TYPE (type));
-	      break;
-	    case TYPE_CODE_ARRAY:
-	      break;
-	    case TYPE_CODE_STRUCT:
-	      if (noside != EVAL_AVOID_SIDE_EFFECTS)
-		argvec[0] = ada_value_ind (argvec[0]);
-	      type = check_typedef (TYPE_TARGET_TYPE (type));
-	      break;
-	    default:
-	      error ("cannot subscript or call something of type `%s'",
-		     ada_type_name (VALUE_TYPE (argvec[0])));
-	      break;
-	    }
-	}
+        {
+          switch (TYPE_CODE (check_typedef (TYPE_TARGET_TYPE (type))))
+            {
+            case TYPE_CODE_FUNC:
+              type = check_typedef (TYPE_TARGET_TYPE (type));
+              break;
+            case TYPE_CODE_ARRAY:
+              break;
+            case TYPE_CODE_STRUCT:
+              if (noside != EVAL_AVOID_SIDE_EFFECTS)
+                argvec[0] = ada_value_ind (argvec[0]);
+              type = check_typedef (TYPE_TARGET_TYPE (type));
+              break;
+            default:
+              error ("cannot subscript or call something of type `%s'",
+                     ada_type_name (VALUE_TYPE (argvec[0])));
+              break;
+            }
+        }
 
       switch (TYPE_CODE (type))
-	{
-	case TYPE_CODE_FUNC:
-	  if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	    return allocate_value (TYPE_TARGET_TYPE (type));
-	  return call_function_by_hand (argvec[0], nargs, argvec + 1);
-	case TYPE_CODE_STRUCT:
-	  {
-	    int arity = ada_array_arity (type);
-	    type = ada_array_element_type (type, nargs);
-	    if (type == NULL)
-	      error ("cannot subscript or call a record");
-	    if (arity != nargs)
-	      error ("wrong number of subscripts; expecting %d", arity);
-	    if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	      return allocate_value (ada_aligned_type (type));
-	    return
-	      unwrap_value (ada_value_subscript
-			    (argvec[0], nargs, argvec + 1));
-	  }
-	case TYPE_CODE_ARRAY:
-	  if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	    {
-	      type = ada_array_element_type (type, nargs);
-	      if (type == NULL)
-		error ("element type of array unknown");
-	      else
-		return allocate_value (ada_aligned_type (type));
-	    }
-	  return
-	    unwrap_value (ada_value_subscript
-			  (ada_coerce_to_simple_array (argvec[0]),
-			   nargs, argvec + 1));
-	case TYPE_CODE_PTR:	/* Pointer to array */
-	  type = to_fixed_array_type (TYPE_TARGET_TYPE (type), NULL, 1);
-	  if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	    {
-	      type = ada_array_element_type (type, nargs);
-	      if (type == NULL)
-		error ("element type of array unknown");
-	      else
-		return allocate_value (ada_aligned_type (type));
-	    }
-	  return
-	    unwrap_value (ada_value_ptr_subscript (argvec[0], type,
-						   nargs, argvec + 1));
+        {
+        case TYPE_CODE_FUNC:
+          if (noside == EVAL_AVOID_SIDE_EFFECTS)
+            return allocate_value (TYPE_TARGET_TYPE (type));
+          return call_function_by_hand (argvec[0], nargs, argvec + 1);
+        case TYPE_CODE_STRUCT:
+          {
+            int arity;
 
-	default:
-	  error ("Internal error in evaluate_subexp");
-	}
+            arity = ada_array_arity (type);
+            type = ada_array_element_type (type, nargs);
+            if (type == NULL)
+              error ("cannot subscript or call a record");
+            if (arity != nargs)
+              error ("wrong number of subscripts; expecting %d", arity);
+            if (noside == EVAL_AVOID_SIDE_EFFECTS)
+              return allocate_value (ada_aligned_type (type));
+            return
+              unwrap_value (ada_value_subscript
+                            (argvec[0], nargs, argvec + 1));
+          }
+        case TYPE_CODE_ARRAY:
+          if (noside == EVAL_AVOID_SIDE_EFFECTS)
+            {
+              type = ada_array_element_type (type, nargs);
+              if (type == NULL)
+                error ("element type of array unknown");
+              else
+                return allocate_value (ada_aligned_type (type));
+            }
+          return
+            unwrap_value (ada_value_subscript
+                          (ada_coerce_to_simple_array (argvec[0]),
+                           nargs, argvec + 1));
+        case TYPE_CODE_PTR:     /* Pointer to array */
+          type = to_fixed_array_type (TYPE_TARGET_TYPE (type), NULL, 1);
+          if (noside == EVAL_AVOID_SIDE_EFFECTS)
+            {
+              type = ada_array_element_type (type, nargs);
+              if (type == NULL)
+                error ("element type of array unknown");
+              else
+                return allocate_value (ada_aligned_type (type));
+            }
+          return
+            unwrap_value (ada_value_ptr_subscript (argvec[0], type,
+                                                   nargs, argvec + 1));
+
+        default:
+          error ("Internal error in evaluate_subexp");
+        }
 
     case TERNOP_SLICE:
       {
-	struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-	int lowbound
-	  = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
-	int upper
-	  = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
-	if (noside == EVAL_SKIP)
-	  goto nosideret;
+        struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+        struct value *low_bound_val =
+          evaluate_subexp (NULL_TYPE, exp, pos, noside);
+        LONGEST low_bound = pos_atr (low_bound_val);
+        LONGEST high_bound
+          = pos_atr (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+        if (noside == EVAL_SKIP)
+          goto nosideret;
 
-	/* If this is a reference to an array, then dereference it */
-	if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_REF
-	    && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL
-	    && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) ==
-	    TYPE_CODE_ARRAY
-	    && !ada_is_array_descriptor (check_typedef (VALUE_TYPE (array))))
-	  {
-	    array = ada_coerce_ref (array);
-	  }
+        /* If this is a reference to an aligner type, then remove all
+           the aligners.  */
+        if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_REF
+            && ada_is_aligner_type (TYPE_TARGET_TYPE (VALUE_TYPE (array))))
+          TYPE_TARGET_TYPE (VALUE_TYPE (array)) =
+            ada_aligned_type (TYPE_TARGET_TYPE (VALUE_TYPE (array)));
 
-	if (noside == EVAL_AVOID_SIDE_EFFECTS &&
-	    ada_is_array_descriptor (check_typedef (VALUE_TYPE (array))))
-	  {
-	    /* Try to dereference the array, in case it is an access to array */
-	    struct type *arrType = ada_type_of_array (array, 0);
-	    if (arrType != NULL)
-	      array = value_at_lazy (arrType, 0, NULL);
-	  }
-	if (ada_is_array_descriptor (VALUE_TYPE (array)))
-	  array = ada_coerce_to_simple_array (array);
+        if (ada_is_packed_array_type (VALUE_TYPE (array)))
+          error ("cannot slice a packed array");
 
-	/* If at this point we have a pointer to an array, it means that
-	   it is a pointer to a simple (non-ada) array. We just then
-	   dereference it */
-	if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_PTR
-	    && TYPE_TARGET_TYPE (VALUE_TYPE (array)) != NULL
-	    && TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (array))) ==
-	    TYPE_CODE_ARRAY)
-	  {
-	    array = ada_value_ind (array);
-	  }
+        /* If this is a reference to an array or an array lvalue,
+           convert to a pointer.  */
+        if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_REF
+            || (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_ARRAY
+                && VALUE_LVAL (array) == lval_memory))
+          array = value_addr (array);
 
-	if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	  /* The following will get the bounds wrong, but only in contexts
-	     where the value is not being requested (FIXME?). */
-	  return array;
-	else
-	  return value_slice (array, lowbound, upper - lowbound + 1);
+        if (noside == EVAL_AVOID_SIDE_EFFECTS
+            && ada_is_array_descriptor_type (check_typedef 
+					     (VALUE_TYPE (array))))
+          return empty_array (ada_type_of_array (array, 0), low_bound);
+
+        array = ada_coerce_to_simple_array_ptr (array);
+
+        if (TYPE_CODE (VALUE_TYPE (array)) == TYPE_CODE_PTR)
+          {
+            if (high_bound < low_bound || noside == EVAL_AVOID_SIDE_EFFECTS)
+              return empty_array (TYPE_TARGET_TYPE (VALUE_TYPE (array)),
+                                  low_bound);
+            else
+              {
+                struct type *arr_type0 =
+                  to_fixed_array_type (TYPE_TARGET_TYPE (VALUE_TYPE (array)),
+                                       NULL, 1);
+                return ada_value_slice_ptr (array, arr_type0,
+                                            (int) low_bound, (int) high_bound);
+              }
+          }
+        else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+          return array;
+        else if (high_bound < low_bound)
+          return empty_array (VALUE_TYPE (array), low_bound);
+        else
+          return ada_value_slice (array, (int) low_bound, (int) high_bound);
       }
 
-      /* FIXME: UNOP_MBR should be defined in expression.h */
-      /*    case UNOP_MBR:
-         (*pos) += 2;
-         arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         type = exp->elts[pc + 1].type;
+    case UNOP_IN_RANGE:
+      (*pos) += 2;
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      type = exp->elts[pc + 1].type;
 
-         if (noside == EVAL_SKIP)
-         goto nosideret;
+      if (noside == EVAL_SKIP)
+        goto nosideret;
 
-         switch (TYPE_CODE (type)) 
-         {
-         default:
-         warning ("Membership test incompletely implemented; always returns true");
-         return value_from_longest (builtin_type_int, (LONGEST) 1);
+      switch (TYPE_CODE (type))
+        {
+        default:
+          lim_warning ("Membership test incompletely implemented; "
+                       "always returns true", 0);
+          return value_from_longest (builtin_type_int, (LONGEST) 1);
 
-         case TYPE_CODE_RANGE:
-         arg2 = value_from_longest (builtin_type_int, 
-         (LONGEST) TYPE_LOW_BOUND (type));
-         arg3 = value_from_longest (builtin_type_int, 
-         (LONGEST) TYPE_HIGH_BOUND (type));
-         return 
-         value_from_longest (builtin_type_int,
-         (value_less (arg1,arg3) 
-         || value_equal (arg1,arg3))
-         && (value_less (arg2,arg1)
-         || value_equal (arg2,arg1)));
-         }
-       */
-      /* FIXME: BINOP_MBR should be defined in expression.h */
-      /*    case BINOP_MBR:
-         (*pos) += 2;
-         arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+        case TYPE_CODE_RANGE:
+          arg2 = value_from_longest (builtin_type_int, TYPE_LOW_BOUND (type));
+          arg3 = value_from_longest (builtin_type_int,
+                                     TYPE_HIGH_BOUND (type));
+          return
+            value_from_longest (builtin_type_int,
+                                (value_less (arg1, arg3)
+                                 || value_equal (arg1, arg3))
+                                && (value_less (arg2, arg1)
+                                    || value_equal (arg2, arg1)));
+        }
 
-         if (noside == EVAL_SKIP)
-         goto nosideret;
+    case BINOP_IN_BOUNDS:
+      (*pos) += 2;
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
 
-         if (noside == EVAL_AVOID_SIDE_EFFECTS)
-         return value_zero (builtin_type_int, not_lval);
+      if (noside == EVAL_SKIP)
+        goto nosideret;
 
-         tem = longest_to_int (exp->elts[pc + 1].longconst);
+      if (noside == EVAL_AVOID_SIDE_EFFECTS)
+        return value_zero (builtin_type_int, not_lval);
 
-         if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg2)))
-         error ("invalid dimension number to '%s", "range");
+      tem = longest_to_int (exp->elts[pc + 1].longconst);
 
-         arg3 = ada_array_bound (arg2, tem, 1);
-         arg2 = ada_array_bound (arg2, tem, 0);
+      if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg2)))
+        error ("invalid dimension number to '%s", "range");
 
-         return 
-         value_from_longest (builtin_type_int,
-         (value_less (arg1,arg3) 
-         || value_equal (arg1,arg3))
-         && (value_less (arg2,arg1)
-         || value_equal (arg2,arg1)));
-       */
-      /* FIXME: TERNOP_MBR should be defined in expression.h */
-      /*    case TERNOP_MBR:
-         arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         arg3 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg3 = ada_array_bound (arg2, tem, 1);
+      arg2 = ada_array_bound (arg2, tem, 0);
 
-         if (noside == EVAL_SKIP)
-         goto nosideret;
+      return
+        value_from_longest (builtin_type_int,
+                            (value_less (arg1, arg3)
+                             || value_equal (arg1, arg3))
+                            && (value_less (arg2, arg1)
+                                || value_equal (arg2, arg1)));
 
-         return 
-         value_from_longest (builtin_type_int,
-         (value_less (arg1,arg3) 
-         || value_equal (arg1,arg3))
-         && (value_less (arg2,arg1)
-         || value_equal (arg2,arg1)));
-       */
-      /* FIXME: OP_ATTRIBUTE should be defined in expression.h */
-      /*    case OP_ATTRIBUTE:
-         *pos += 3;
-         atr = (enum ada_attribute) longest_to_int (exp->elts[pc + 2].longconst);
-         switch (atr) 
-         {
-         default:
-         error ("unexpected attribute encountered");
+    case TERNOP_IN_RANGE:
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg3 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
 
-         case ATR_FIRST:
-         case ATR_LAST:
-         case ATR_LENGTH:
-         {
-         struct type* type_arg;
-         if (exp->elts[*pos].opcode == OP_TYPE)
-         {
-         evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-         arg1 = NULL;
-         type_arg = exp->elts[pc + 5].type;
-         }
-         else
-         {
-         arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         type_arg = NULL;
-         }
+      if (noside == EVAL_SKIP)
+        goto nosideret;
 
-         if (exp->elts[*pos].opcode != OP_LONG) 
-         error ("illegal operand to '%s", ada_attribute_name (atr));
-         tem = longest_to_int (exp->elts[*pos+2].longconst);
-         *pos += 4;
+      return
+        value_from_longest (builtin_type_int,
+                            (value_less (arg1, arg3)
+                             || value_equal (arg1, arg3))
+                            && (value_less (arg2, arg1)
+                                || value_equal (arg2, arg1)));
 
-         if (noside == EVAL_SKIP)
-         goto nosideret;
+    case OP_ATR_FIRST:
+    case OP_ATR_LAST:
+    case OP_ATR_LENGTH:
+      {
+        struct type *type_arg;
+        if (exp->elts[*pos].opcode == OP_TYPE)
+          {
+            evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
+            arg1 = NULL;
+            type_arg = exp->elts[pc + 2].type;
+          }
+        else
+          {
+            arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+            type_arg = NULL;
+          }
 
-         if (type_arg == NULL)
-         {
-         arg1 = ada_coerce_ref (arg1);
+        if (exp->elts[*pos].opcode != OP_LONG)
+          error ("illegal operand to '%s", ada_attribute_name (op));
+        tem = longest_to_int (exp->elts[*pos + 2].longconst);
+        *pos += 4;
 
-         if (ada_is_packed_array_type (VALUE_TYPE (arg1)))
-         arg1 = ada_coerce_to_simple_array (arg1);
+        if (noside == EVAL_SKIP)
+          goto nosideret;
 
-         if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg1)))
-         error ("invalid dimension number to '%s", 
-         ada_attribute_name (atr));
+        if (type_arg == NULL)
+          {
+            arg1 = ada_coerce_ref (arg1);
 
-         if (noside == EVAL_AVOID_SIDE_EFFECTS)
-         {
-         type = ada_index_type (VALUE_TYPE (arg1), tem);
-         if (type == NULL) 
-         error ("attempt to take bound of something that is not an array");
-         return allocate_value (type);
-         }
+            if (ada_is_packed_array_type (VALUE_TYPE (arg1)))
+              arg1 = ada_coerce_to_simple_array (arg1);
 
-         switch (atr) 
-         {
-         default: 
-         error ("unexpected attribute encountered");
-         case ATR_FIRST:
-         return ada_array_bound (arg1, tem, 0);
-         case ATR_LAST:
-         return ada_array_bound (arg1, tem, 1);
-         case ATR_LENGTH:
-         return ada_array_length (arg1, tem);
-         }
-         }
-         else if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE
-         || TYPE_CODE (type_arg) == TYPE_CODE_INT) 
-         {
-         struct type* range_type;
-         char* name = ada_type_name (type_arg);
-         if (name == NULL)
-         {
-         if (TYPE_CODE (type_arg) == TYPE_CODE_RANGE) 
-         range_type = type_arg;
-         else
-         error ("unimplemented type attribute");
-         }
-         else 
-         range_type = 
-         to_fixed_range_type (name, NULL, TYPE_OBJFILE (type_arg));
-         switch (atr) 
-         {
-         default: 
-         error ("unexpected attribute encountered");
-         case ATR_FIRST:
-         return value_from_longest (TYPE_TARGET_TYPE (range_type),
-         TYPE_LOW_BOUND (range_type));
-         case ATR_LAST:
-         return value_from_longest (TYPE_TARGET_TYPE (range_type),
-         TYPE_HIGH_BOUND (range_type));
-         }
-         }              
-         else if (TYPE_CODE (type_arg) == TYPE_CODE_ENUM)
-         {
-         switch (atr) 
-         {
-         default: 
-         error ("unexpected attribute encountered");
-         case ATR_FIRST:
-         return value_from_longest 
-         (type_arg, TYPE_FIELD_BITPOS (type_arg, 0));
-         case ATR_LAST:
-         return value_from_longest 
-         (type_arg, 
-         TYPE_FIELD_BITPOS (type_arg,
-         TYPE_NFIELDS (type_arg) - 1));
-         }
-         }
-         else if (TYPE_CODE (type_arg) == TYPE_CODE_FLT)
-         error ("unimplemented type attribute");
-         else 
-         {
-         LONGEST low, high;
+            if (tem < 1 || tem > ada_array_arity (VALUE_TYPE (arg1)))
+              error ("invalid dimension number to '%s",
+                     ada_attribute_name (op));
 
-         if (ada_is_packed_array_type (type_arg))
-         type_arg = decode_packed_array_type (type_arg);
+            if (noside == EVAL_AVOID_SIDE_EFFECTS)
+              {
+                type = ada_index_type (VALUE_TYPE (arg1), tem);
+                if (type == NULL)
+                  error
+                    ("attempt to take bound of something that is not an array");
+                return allocate_value (type);
+              }
 
-         if (tem < 1 || tem > ada_array_arity (type_arg))
-         error ("invalid dimension number to '%s", 
-         ada_attribute_name (atr));
+            switch (op)
+              {
+              default:          /* Should never happen.  */
+                error ("unexpected attribute encountered");
+              case OP_ATR_FIRST:
+                return ada_array_bound (arg1, tem, 0);
+              case OP_ATR_LAST:
+                return ada_array_bound (arg1, tem, 1);
+              case OP_ATR_LENGTH:
+                return ada_array_length (arg1, tem);
+              }
+          }
+        else if (discrete_type_p (type_arg))
+          {
+            struct type *range_type;
+            char *name = ada_type_name (type_arg);
+            range_type = NULL;
+            if (name != NULL && TYPE_CODE (type_arg) != TYPE_CODE_ENUM)
+              range_type =
+                to_fixed_range_type (name, NULL, TYPE_OBJFILE (type_arg));
+            if (range_type == NULL)
+              range_type = type_arg;
+            switch (op)
+              {
+              default:
+                error ("unexpected attribute encountered");
+              case OP_ATR_FIRST:
+                return discrete_type_low_bound (range_type);
+              case OP_ATR_LAST:
+                return discrete_type_high_bound (range_type);
+              case OP_ATR_LENGTH:
+                error ("the 'length attribute applies only to array types");
+              }
+          }
+        else if (TYPE_CODE (type_arg) == TYPE_CODE_FLT)
+          error ("unimplemented type attribute");
+        else
+          {
+            LONGEST low, high;
 
-         if (noside == EVAL_AVOID_SIDE_EFFECTS)
-         {
-         type = ada_index_type (type_arg, tem);
-         if (type == NULL) 
-         error ("attempt to take bound of something that is not an array");
-         return allocate_value (type);
-         }
+            if (ada_is_packed_array_type (type_arg))
+              type_arg = decode_packed_array_type (type_arg);
 
-         switch (atr) 
-         {
-         default: 
-         error ("unexpected attribute encountered");
-         case ATR_FIRST:
-         low = ada_array_bound_from_type (type_arg, tem, 0, &type);
-         return value_from_longest (type, low);
-         case ATR_LAST:
-         high = ada_array_bound_from_type (type_arg, tem, 1, &type);
-         return value_from_longest (type, high);
-         case ATR_LENGTH:
-         low = ada_array_bound_from_type (type_arg, tem, 0, &type);
-         high = ada_array_bound_from_type (type_arg, tem, 1, NULL);
-         return value_from_longest (type, high-low+1);
-         }
-         }
-         }
+            if (tem < 1 || tem > ada_array_arity (type_arg))
+              error ("invalid dimension number to '%s",
+                     ada_attribute_name (op));
 
-         case ATR_TAG:
-         arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         if (noside == EVAL_SKIP)
-         goto nosideret;
+            type = ada_index_type (type_arg, tem);
+            if (type == NULL)
+              error
+                ("attempt to take bound of something that is not an array");
+            if (noside == EVAL_AVOID_SIDE_EFFECTS)
+              return allocate_value (type);
 
-         if (noside == EVAL_AVOID_SIDE_EFFECTS)
-         return         
-         value_zero (ada_tag_type (arg1), not_lval);
+            switch (op)
+              {
+              default:
+                error ("unexpected attribute encountered");
+              case OP_ATR_FIRST:
+                low = ada_array_bound_from_type (type_arg, tem, 0, &type);
+                return value_from_longest (type, low);
+              case OP_ATR_LAST:
+                high = ada_array_bound_from_type (type_arg, tem, 1, &type);
+                return value_from_longest (type, high);
+              case OP_ATR_LENGTH:
+                low = ada_array_bound_from_type (type_arg, tem, 0, &type);
+                high = ada_array_bound_from_type (type_arg, tem, 1, NULL);
+                return value_from_longest (type, high - low + 1);
+              }
+          }
+      }
 
-         return ada_value_tag (arg1);
+    case OP_ATR_TAG:
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      if (noside == EVAL_SKIP)
+        goto nosideret;
 
-         case ATR_MIN:
-         case ATR_MAX:
-         evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-         arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         if (noside == EVAL_SKIP)
-         goto nosideret;
-         else if (noside == EVAL_AVOID_SIDE_EFFECTS)
-         return value_zero (VALUE_TYPE (arg1), not_lval);
-         else
-         return value_binop (arg1, arg2, 
-         atr == ATR_MIN ? BINOP_MIN : BINOP_MAX);
+      if (noside == EVAL_AVOID_SIDE_EFFECTS)
+        return value_zero (ada_tag_type (arg1), not_lval);
 
-         case ATR_MODULUS:
-         {
-         struct type* type_arg = exp->elts[pc + 5].type;
-         evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-         *pos += 4;
+      return ada_value_tag (arg1);
 
-         if (noside == EVAL_SKIP)
-         goto nosideret;
+    case OP_ATR_MIN:
+    case OP_ATR_MAX:
+      evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      if (noside == EVAL_SKIP)
+        goto nosideret;
+      else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+        return value_zero (VALUE_TYPE (arg1), not_lval);
+      else
+        return value_binop (arg1, arg2,
+                            op == OP_ATR_MIN ? BINOP_MIN : BINOP_MAX);
 
-         if (! ada_is_modular_type (type_arg))
-         error ("'modulus must be applied to modular type");
+    case OP_ATR_MODULUS:
+      {
+        struct type *type_arg = exp->elts[pc + 2].type;
+        evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
 
-         return value_from_longest (TYPE_TARGET_TYPE (type_arg),
-         ada_modulus (type_arg));
-         }
+        if (noside == EVAL_SKIP)
+          goto nosideret;
+
+        if (!ada_is_modular_type (type_arg))
+          error ("'modulus must be applied to modular type");
+
+        return value_from_longest (TYPE_TARGET_TYPE (type_arg),
+                                   ada_modulus (type_arg));
+      }
 
 
-         case ATR_POS:
-         evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-         arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         if (noside == EVAL_SKIP)
-         goto nosideret;
-         else if (noside == EVAL_AVOID_SIDE_EFFECTS)
-         return value_zero (builtin_type_ada_int, not_lval);
-         else 
-         return value_pos_atr (arg1);
+    case OP_ATR_POS:
+      evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      if (noside == EVAL_SKIP)
+        goto nosideret;
+      else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+        return value_zero (builtin_type_ada_int, not_lval);
+      else
+        return value_pos_atr (arg1);
 
-         case ATR_SIZE:
-         arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         if (noside == EVAL_SKIP)
-         goto nosideret;
-         else if (noside == EVAL_AVOID_SIDE_EFFECTS)
-         return value_zero (builtin_type_ada_int, not_lval);
-         else
-         return value_from_longest (builtin_type_ada_int,
-         TARGET_CHAR_BIT 
-         * TYPE_LENGTH (VALUE_TYPE (arg1)));
+    case OP_ATR_SIZE:
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      if (noside == EVAL_SKIP)
+        goto nosideret;
+      else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+        return value_zero (builtin_type_ada_int, not_lval);
+      else
+        return value_from_longest (builtin_type_ada_int,
+                                   TARGET_CHAR_BIT
+                                   * TYPE_LENGTH (VALUE_TYPE (arg1)));
 
-         case ATR_VAL:
-         evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
-         arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-         type = exp->elts[pc + 5].type;
-         if (noside == EVAL_SKIP)
-         goto nosideret;
-         else if (noside == EVAL_AVOID_SIDE_EFFECTS)
-         return value_zero (type, not_lval);
-         else 
-         return value_val_atr (type, arg1);
-         } */
+    case OP_ATR_VAL:
+      evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP);
+      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+      type = exp->elts[pc + 2].type;
+      if (noside == EVAL_SKIP)
+        goto nosideret;
+      else if (noside == EVAL_AVOID_SIDE_EFFECTS)
+        return value_zero (type, not_lval);
+      else
+        return value_val_atr (type, arg1);
+
     case BINOP_EXP:
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       if (noside == EVAL_SKIP)
-	goto nosideret;
-      if (binop_user_defined_p (op, arg1, arg2))
-	return unwrap_value (value_x_binop (arg1, arg2, op, OP_NULL,
-					    EVAL_NORMAL));
+        goto nosideret;
       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	return value_zero (VALUE_TYPE (arg1), not_lval);
+        return value_zero (VALUE_TYPE (arg1), not_lval);
       else
-	return value_binop (arg1, arg2, op);
+        return value_binop (arg1, arg2, op);
 
     case UNOP_PLUS:
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       if (noside == EVAL_SKIP)
-	goto nosideret;
-      if (unop_user_defined_p (op, arg1))
-	return unwrap_value (value_x_unop (arg1, op, EVAL_NORMAL));
+        goto nosideret;
       else
-	return arg1;
+        return arg1;
 
     case UNOP_ABS:
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       if (noside == EVAL_SKIP)
-	goto nosideret;
+        goto nosideret;
       if (value_less (arg1, value_zero (VALUE_TYPE (arg1), not_lval)))
-	return value_neg (arg1);
+        return value_neg (arg1);
       else
-	return arg1;
+        return arg1;
 
     case UNOP_IND:
       if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR)
-	expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type));
+        expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type));
       arg1 = evaluate_subexp (expect_type, exp, pos, noside);
       if (noside == EVAL_SKIP)
-	goto nosideret;
+        goto nosideret;
       type = check_typedef (VALUE_TYPE (arg1));
       if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	{
-	  if (ada_is_array_descriptor (type))
-	    /* GDB allows dereferencing GNAT array descriptors. */
-	    {
-	      struct type *arrType = ada_type_of_array (arg1, 0);
-	      if (arrType == NULL)
-		error ("Attempt to dereference null array pointer.");
-	      return value_at_lazy (arrType, 0, NULL);
-	    }
-	  else if (TYPE_CODE (type) == TYPE_CODE_PTR
-		   || TYPE_CODE (type) == TYPE_CODE_REF
-		   /* In C you can dereference an array to get the 1st elt.  */
-		   || TYPE_CODE (type) == TYPE_CODE_ARRAY)
-	    return
-	      value_zero
-	      (to_static_fixed_type
-	       (ada_aligned_type (check_typedef (TYPE_TARGET_TYPE (type)))),
-	       lval_memory);
-	  else if (TYPE_CODE (type) == TYPE_CODE_INT)
-	    /* GDB allows dereferencing an int.  */
-	    return value_zero (builtin_type_int, lval_memory);
-	  else
-	    error ("Attempt to take contents of a non-pointer value.");
-	}
-      arg1 = ada_coerce_ref (arg1);
+        {
+          if (ada_is_array_descriptor_type (type))
+            /* GDB allows dereferencing GNAT array descriptors.  */
+            {
+              struct type *arrType = ada_type_of_array (arg1, 0);
+              if (arrType == NULL)
+                error ("Attempt to dereference null array pointer.");
+              return value_at_lazy (arrType, 0, NULL);
+            }
+          else if (TYPE_CODE (type) == TYPE_CODE_PTR
+                   || TYPE_CODE (type) == TYPE_CODE_REF
+                   /* In C you can dereference an array to get the 1st elt.  */
+                   || TYPE_CODE (type) == TYPE_CODE_ARRAY)
+            return
+              value_zero
+              (to_static_fixed_type
+               (ada_aligned_type (check_typedef (TYPE_TARGET_TYPE (type)))),
+               lval_memory);
+          else if (TYPE_CODE (type) == TYPE_CODE_INT)
+            /* GDB allows dereferencing an int.  */
+            return value_zero (builtin_type_int, lval_memory);
+          else
+            error ("Attempt to take contents of a non-pointer value.");
+        }
+      arg1 = ada_coerce_ref (arg1);     /* FIXME: What is this for?? */
       type = check_typedef (VALUE_TYPE (arg1));
 
-      if (ada_is_array_descriptor (type))
-	/* GDB allows dereferencing GNAT array descriptors. */
-	return ada_coerce_to_simple_array (arg1);
+      if (ada_is_array_descriptor_type (type))
+        /* GDB allows dereferencing GNAT array descriptors.  */
+        return ada_coerce_to_simple_array (arg1);
       else
-	return ada_value_ind (arg1);
+        return ada_value_ind (arg1);
 
     case STRUCTOP_STRUCT:
       tem = longest_to_int (exp->elts[pc + 1].longconst);
       (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
       arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
       if (noside == EVAL_SKIP)
-	goto nosideret;
+        goto nosideret;
       if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	return value_zero (ada_aligned_type
-			   (ada_lookup_struct_elt_type (VALUE_TYPE (arg1),
-							&exp->elts[pc +
-								   2].string,
-							0, NULL)),
-			   lval_memory);
+        {
+          struct type *type1 = VALUE_TYPE (arg1);
+          if (ada_is_tagged_type (type1, 1))
+            {
+              type = ada_lookup_struct_elt_type (type1,
+                                                 &exp->elts[pc + 2].string,
+                                                 1, 1, NULL);
+              if (type == NULL)
+                /* In this case, we assume that the field COULD exist
+                   in some extension of the type.  Return an object of 
+                   "type" void, which will match any formal 
+                   (see ada_type_match). */
+                return value_zero (builtin_type_void, lval_memory);
+            }
+          else
+            type =
+              ada_lookup_struct_elt_type (type1, &exp->elts[pc + 2].string, 1,
+                                          0, NULL);
+
+          return value_zero (ada_aligned_type (type), lval_memory);
+        }
       else
-	return unwrap_value (ada_value_struct_elt (arg1,
-						   &exp->elts[pc + 2].string,
-						   "record"));
+        return
+          ada_to_fixed_value (unwrap_value
+                              (ada_value_struct_elt
+                               (arg1, &exp->elts[pc + 2].string, "record")));
     case OP_TYPE:
-      /* The value is not supposed to be used. This is here to make it
-         easier to accommodate expressions that contain types. */
+      /* The value is not supposed to be used.  This is here to make it
+         easier to accommodate expressions that contain types.  */
       (*pos) += 2;
       if (noside == EVAL_SKIP)
-	goto nosideret;
+        goto nosideret;
       else if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	return allocate_value (builtin_type_void);
+        return allocate_value (builtin_type_void);
       else
-	error ("Attempt to use a type name as an expression");
-
-    case STRUCTOP_PTR:
-      tem = longest_to_int (exp->elts[pc + 1].longconst);
-      (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
-      arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
-      if (noside == EVAL_SKIP)
-	goto nosideret;
-      if (noside == EVAL_AVOID_SIDE_EFFECTS)
-	return value_zero (ada_aligned_type
-			   (ada_lookup_struct_elt_type (VALUE_TYPE (arg1),
-							&exp->elts[pc +
-								   2].string,
-							0, NULL)),
-			   lval_memory);
-      else
-	return unwrap_value (ada_value_struct_elt (arg1,
-						   &exp->elts[pc + 2].string,
-						   "record access"));
+        error ("Attempt to use a type name as an expression");
     }
 
 nosideret:
@@ -7565,11 +9467,11 @@
 }
 
 
-				/* Fixed point */
+                                /* Fixed point */
 
 /* If TYPE encodes an Ada fixed-point type, return the suffix of the
    type name that encodes the 'small and 'delta information.
-   Otherwise, return NULL. */
+   Otherwise, return NULL.  */
 
 static const char *
 fixed_type_info (struct type *type)
@@ -7581,9 +9483,9 @@
     {
       const char *tail = strstr (name, "___XF_");
       if (tail == NULL)
-	return NULL;
+        return NULL;
       else
-	return tail + 5;
+        return tail + 5;
     }
   else if (code == TYPE_CODE_RANGE && TYPE_TARGET_TYPE (type) != type)
     return fixed_type_info (TYPE_TARGET_TYPE (type));
@@ -7591,7 +9493,7 @@
     return NULL;
 }
 
-/* Returns non-zero iff TYPE represents an Ada fixed-point type. */
+/* Returns non-zero iff TYPE represents an Ada fixed-point type.  */
 
 int
 ada_is_fixed_point_type (struct type *type)
@@ -7599,9 +9501,18 @@
   return fixed_type_info (type) != NULL;
 }
 
+/* Return non-zero iff TYPE represents a System.Address type.  */
+
+int
+ada_is_system_address_type (struct type *type)
+{
+  return (TYPE_NAME (type)
+          && strcmp (TYPE_NAME (type), "system__address") == 0);
+}
+
 /* Assuming that TYPE is the representation of an Ada fixed-point
    type, return its delta, or -1 if the type is malformed and the
-   delta cannot be determined. */
+   delta cannot be determined.  */
 
 DOUBLEST
 ada_delta (struct type *type)
@@ -7616,7 +9527,7 @@
 }
 
 /* Assuming that ada_is_fixed_point_type (TYPE), return the scaling
-   factor ('SMALL value) associated with the type. */
+   factor ('SMALL value) associated with the type.  */
 
 static DOUBLEST
 scaling_factor (struct type *type)
@@ -7637,7 +9548,7 @@
 
 
 /* Assuming that X is the representation of a value of fixed-point
-   type TYPE, return its floating-point equivalent. */
+   type TYPE, return its floating-point equivalent.  */
 
 DOUBLEST
 ada_fixed_to_float (struct type *type, LONGEST x)
@@ -7645,8 +9556,8 @@
   return (DOUBLEST) x *scaling_factor (type);
 }
 
-/* The representation of a fixed-point value of type TYPE 
-   corresponding to the value X. */
+/* The representation of a fixed-point value of type TYPE
+   corresponding to the value X.  */
 
 LONGEST
 ada_float_to_fixed (struct type *type, DOUBLEST x)
@@ -7655,10 +9566,11 @@
 }
 
 
-				/* VAX floating formats */
+                                /* VAX floating formats */
 
 /* Non-zero iff TYPE represents one of the special VAX floating-point
-   types. */
+   types.  */
+
 int
 ada_is_vax_floating_type (struct type *type)
 {
@@ -7667,21 +9579,23 @@
   return
     name_len > 6
     && (TYPE_CODE (type) == TYPE_CODE_INT
-	|| TYPE_CODE (type) == TYPE_CODE_RANGE)
-    && DEPRECATED_STREQN (ada_type_name (type) + name_len - 6, "___XF", 5);
+        || TYPE_CODE (type) == TYPE_CODE_RANGE)
+    && strncmp (ada_type_name (type) + name_len - 6, "___XF", 5) == 0;
 }
 
 /* The type of special VAX floating-point type this is, assuming
-   ada_is_vax_floating_point */
+   ada_is_vax_floating_point.  */
+
 int
 ada_vax_float_type_suffix (struct type *type)
 {
   return ada_type_name (type)[strlen (ada_type_name (type)) - 1];
 }
 
-/* A value representing the special debugging function that outputs 
+/* A value representing the special debugging function that outputs
    VAX floating-point values of the type represented by TYPE.  Assumes
-   ada_is_vax_floating_type (TYPE). */
+   ada_is_vax_floating_type (TYPE).  */
+
 struct value *
 ada_vax_float_print_function (struct type *type)
 {
@@ -7699,17 +9613,17 @@
 }
 
 
-				/* Range types */
+                                /* Range types */
 
 /* Scan STR beginning at position K for a discriminant name, and
    return the value of that discriminant field of DVAL in *PX.  If
    PNEW_K is not null, put the position of the character beyond the
    name scanned in *PNEW_K.  Return 1 if successful; return 0 and do
-   not alter *PX and *PNEW_K if unsuccessful. */
+   not alter *PX and *PNEW_K if unsuccessful.  */
 
 static int
 scan_discrim_bound (char *str, int k, struct value *dval, LONGEST * px,
-		    int *pnew_k)
+                    int *pnew_k)
 {
   static char *bound_buffer = NULL;
   static size_t bound_buffer_len = 0;
@@ -7747,47 +9661,47 @@
 
 /* Value of variable named NAME in the current environment.  If
    no such variable found, then if ERR_MSG is null, returns 0, and
-   otherwise causes an error with message ERR_MSG. */
+   otherwise causes an error with message ERR_MSG.  */
+
 static struct value *
 get_var_value (char *name, char *err_msg)
 {
-  struct symbol **syms;
-  struct block **blocks;
+  struct ada_symbol_info *syms;
   int nsyms;
 
-  nsyms =
-    ada_lookup_symbol_list (name, get_selected_block (NULL), VAR_DOMAIN,
-			    &syms, &blocks);
+  nsyms = ada_lookup_symbol_list (name, get_selected_block (0), VAR_DOMAIN,
+                                  &syms);
 
   if (nsyms != 1)
     {
       if (err_msg == NULL)
-	return 0;
+        return 0;
       else
-	error ("%s", err_msg);
+        error ("%s", err_msg);
     }
 
-  return value_of_variable (syms[0], blocks[0]);
+  return value_of_variable (syms[0].sym, syms[0].block);
 }
 
 /* Value of integer variable named NAME in the current environment.  If
-   no such variable found, then if ERR_MSG is null, returns 0, and sets
-   *FLAG to 0.  If successful, sets *FLAG to 1. */
+   no such variable found, returns 0, and sets *FLAG to 0.  If
+   successful, sets *FLAG to 1.  */
+
 LONGEST
-get_int_var_value (char *name, char *err_msg, int *flag)
+get_int_var_value (char *name, int *flag)
 {
-  struct value *var_val = get_var_value (name, err_msg);
+  struct value *var_val = get_var_value (name, 0);
 
   if (var_val == 0)
     {
       if (flag != NULL)
-	*flag = 0;
+        *flag = 0;
       return 0;
     }
   else
     {
       if (flag != NULL)
-	*flag = 1;
+        *flag = 1;
       return value_as_long (var_val);
     }
 }
@@ -7795,18 +9709,17 @@
 
 /* Return a range type whose base type is that of the range type named
    NAME in the current environment, and whose bounds are calculated
-   from NAME according to the GNAT range encoding conventions. 
+   from NAME according to the GNAT range encoding conventions.
    Extract discriminant values, if needed, from DVAL.  If a new type
    must be created, allocate in OBJFILE's space.  The bounds
    information, in general, is encoded in NAME, the base type given in
-   the named range type. */
+   the named range type.  */
 
 static struct type *
 to_fixed_range_type (char *name, struct value *dval, struct objfile *objfile)
 {
   struct type *raw_type = ada_find_any_type (name);
   struct type *base_type;
-  LONGEST low, high;
   char *subtype_info;
 
   if (raw_type == NULL)
@@ -7838,43 +9751,56 @@
       n = 1;
 
       if (*subtype_info == 'L')
-	{
-	  if (!ada_scan_number (bounds_str, n, &L, &n)
-	      && !scan_discrim_bound (bounds_str, n, dval, &L, &n))
-	    return raw_type;
-	  if (bounds_str[n] == '_')
-	    n += 2;
-	  else if (bounds_str[n] == '.')	/* FIXME? SGI Workshop kludge. */
-	    n += 1;
-	  subtype_info += 1;
-	}
+        {
+          if (!ada_scan_number (bounds_str, n, &L, &n)
+              && !scan_discrim_bound (bounds_str, n, dval, &L, &n))
+            return raw_type;
+          if (bounds_str[n] == '_')
+            n += 2;
+          else if (bounds_str[n] == '.')        /* FIXME? SGI Workshop kludge.  */
+            n += 1;
+          subtype_info += 1;
+        }
       else
-	{
-	  strcpy (name_buf + prefix_len, "___L");
-	  L = get_int_var_value (name_buf, "Index bound unknown.", NULL);
-	}
+        {
+          int ok;
+          strcpy (name_buf + prefix_len, "___L");
+          L = get_int_var_value (name_buf, &ok);
+          if (!ok)
+            {
+              lim_warning ("Unknown lower bound, using 1.", 1);
+              L = 1;
+            }
+        }
 
       if (*subtype_info == 'U')
-	{
-	  if (!ada_scan_number (bounds_str, n, &U, &n)
-	      && !scan_discrim_bound (bounds_str, n, dval, &U, &n))
-	    return raw_type;
-	}
+        {
+          if (!ada_scan_number (bounds_str, n, &U, &n)
+              && !scan_discrim_bound (bounds_str, n, dval, &U, &n))
+            return raw_type;
+        }
       else
-	{
-	  strcpy (name_buf + prefix_len, "___U");
-	  U = get_int_var_value (name_buf, "Index bound unknown.", NULL);
-	}
+        {
+          int ok;
+          strcpy (name_buf + prefix_len, "___U");
+          U = get_int_var_value (name_buf, &ok);
+          if (!ok)
+            {
+              lim_warning ("Unknown upper bound, using %ld.", (long) L);
+              U = L;
+            }
+        }
 
       if (objfile == NULL)
-	objfile = TYPE_OBJFILE (base_type);
+        objfile = TYPE_OBJFILE (base_type);
       type = create_range_type (alloc_type (objfile), base_type, L, U);
       TYPE_NAME (type) = name;
       return type;
     }
 }
 
-/* True iff NAME is the name of a range type. */
+/* True iff NAME is the name of a range type.  */
+
 int
 ada_is_range_type_name (const char *name)
 {
@@ -7882,31 +9808,247 @@
 }
 
 
-				/* Modular types */
+                                /* Modular types */
 
-/* True iff TYPE is an Ada modular type. */
+/* True iff TYPE is an Ada modular type.  */
+
 int
 ada_is_modular_type (struct type *type)
 {
-  /* FIXME: base_type should be declared in gdbtypes.h, implemented in
-     valarith.c */
-  struct type *subranged_type;	/* = base_type (type); */
+  struct type *subranged_type = base_type (type);
 
   return (subranged_type != NULL && TYPE_CODE (type) == TYPE_CODE_RANGE
-	  && TYPE_CODE (subranged_type) != TYPE_CODE_ENUM
-	  && TYPE_UNSIGNED (subranged_type));
+          && TYPE_CODE (subranged_type) != TYPE_CODE_ENUM
+          && TYPE_UNSIGNED (subranged_type));
 }
 
-/* Assuming ada_is_modular_type (TYPE), the modulus of TYPE. */
+/* Assuming ada_is_modular_type (TYPE), the modulus of TYPE.  */
+
 LONGEST
 ada_modulus (struct type * type)
 {
   return TYPE_HIGH_BOUND (type) + 1;
 }
 
+                                /* Operators */
+/* Information about operators given special treatment in functions
+   below.  */
+/* Format: OP_DEFN (<operator>, <operator length>, <# args>, <binop>).  */
 
+#define ADA_OPERATORS \
+    OP_DEFN (OP_VAR_VALUE, 4, 0, 0) \
+    OP_DEFN (BINOP_IN_BOUNDS, 3, 2, 0) \
+    OP_DEFN (TERNOP_IN_RANGE, 1, 3, 0) \
+    OP_DEFN (OP_ATR_FIRST, 1, 2, 0) \
+    OP_DEFN (OP_ATR_LAST, 1, 2, 0) \
+    OP_DEFN (OP_ATR_LENGTH, 1, 2, 0) \
+    OP_DEFN (OP_ATR_IMAGE, 1, 2, 0) \
+    OP_DEFN (OP_ATR_MAX, 1, 3, 0) \
+    OP_DEFN (OP_ATR_MIN, 1, 3, 0) \
+    OP_DEFN (OP_ATR_MODULUS, 1, 1, 0) \
+    OP_DEFN (OP_ATR_POS, 1, 2, 0) \
+    OP_DEFN (OP_ATR_SIZE, 1, 1, 0) \
+    OP_DEFN (OP_ATR_TAG, 1, 1, 0) \
+    OP_DEFN (OP_ATR_VAL, 1, 2, 0) \
+    OP_DEFN (UNOP_QUAL, 3, 1, 0) \
+    OP_DEFN (UNOP_IN_RANGE, 3, 1, 0)
 
-				/* Operators */
+static void
+ada_operator_length (struct expression *exp, int pc, int *oplenp, int *argsp)
+{
+  switch (exp->elts[pc - 1].opcode)
+    {
+    default:
+      operator_length_standard (exp, pc, oplenp, argsp);
+      break;
+
+#define OP_DEFN(op, len, args, binop) \
+    case op: *oplenp = len; *argsp = args; break;
+      ADA_OPERATORS;
+#undef OP_DEFN
+    }
+}
+
+static char *
+ada_op_name (enum exp_opcode opcode)
+{
+  switch (opcode)
+    {
+    default:
+      return op_name_standard (opcode);
+#define OP_DEFN(op, len, args, binop) case op: return #op;
+      ADA_OPERATORS;
+#undef OP_DEFN
+    }
+}
+
+/* As for operator_length, but assumes PC is pointing at the first
+   element of the operator, and gives meaningful results only for the 
+   Ada-specific operators.  */
+
+static void
+ada_forward_operator_length (struct expression *exp, int pc,
+                             int *oplenp, int *argsp)
+{
+  switch (exp->elts[pc].opcode)
+    {
+    default:
+      *oplenp = *argsp = 0;
+      break;
+#define OP_DEFN(op, len, args, binop) \
+    case op: *oplenp = len; *argsp = args; break;
+      ADA_OPERATORS;
+#undef OP_DEFN
+    }
+}
+
+static int
+ada_dump_subexp_body (struct expression *exp, struct ui_file *stream, int elt)
+{
+  enum exp_opcode op = exp->elts[elt].opcode;
+  int oplen, nargs;
+  int pc = elt;
+  int i;
+
+  ada_forward_operator_length (exp, elt, &oplen, &nargs);
+
+  switch (op)
+    {
+      /* Ada attributes ('Foo).  */
+    case OP_ATR_FIRST:
+    case OP_ATR_LAST:
+    case OP_ATR_LENGTH:
+    case OP_ATR_IMAGE:
+    case OP_ATR_MAX:
+    case OP_ATR_MIN:
+    case OP_ATR_MODULUS:
+    case OP_ATR_POS:
+    case OP_ATR_SIZE:
+    case OP_ATR_TAG:
+    case OP_ATR_VAL:
+      break;
+
+    case UNOP_IN_RANGE:
+    case UNOP_QUAL:
+      fprintf_filtered (stream, "Type @");
+      gdb_print_host_address (exp->elts[pc + 1].type, stream);
+      fprintf_filtered (stream, " (");
+      type_print (exp->elts[pc + 1].type, NULL, stream, 0);
+      fprintf_filtered (stream, ")");
+      break;
+    case BINOP_IN_BOUNDS:
+      fprintf_filtered (stream, " (%d)", (int) exp->elts[pc + 2].longconst);
+      break;
+    case TERNOP_IN_RANGE:
+      break;
+
+    default:
+      return dump_subexp_body_standard (exp, stream, elt);
+    }
+
+  elt += oplen;
+  for (i = 0; i < nargs; i += 1)
+    elt = dump_subexp (exp, stream, elt);
+
+  return elt;
+}
+
+/* The Ada extension of print_subexp (q.v.).  */
+
+static void
+ada_print_subexp (struct expression *exp, int *pos,
+                  struct ui_file *stream, enum precedence prec)
+{
+  int oplen, nargs;
+  int pc = *pos;
+  enum exp_opcode op = exp->elts[pc].opcode;
+
+  ada_forward_operator_length (exp, pc, &oplen, &nargs);
+
+  switch (op)
+    {
+    default:
+      print_subexp_standard (exp, pos, stream, prec);
+      return;
+
+    case OP_VAR_VALUE:
+      *pos += oplen;
+      fputs_filtered (SYMBOL_NATURAL_NAME (exp->elts[pc + 2].symbol), stream);
+      return;
+
+    case BINOP_IN_BOUNDS:
+      *pos += oplen;
+      print_subexp (exp, pos, stream, PREC_SUFFIX);
+      fputs_filtered (" in ", stream);
+      print_subexp (exp, pos, stream, PREC_SUFFIX);
+      fputs_filtered ("'range", stream);
+      if (exp->elts[pc + 1].longconst > 1)
+        fprintf_filtered (stream, "(%ld)",
+                          (long) exp->elts[pc + 1].longconst);
+      return;
+
+    case TERNOP_IN_RANGE:
+      *pos += oplen;
+      if (prec >= PREC_EQUAL)
+        fputs_filtered ("(", stream);
+      print_subexp (exp, pos, stream, PREC_SUFFIX);
+      fputs_filtered (" in ", stream);
+      print_subexp (exp, pos, stream, PREC_EQUAL);
+      fputs_filtered (" .. ", stream);
+      print_subexp (exp, pos, stream, PREC_EQUAL);
+      if (prec >= PREC_EQUAL)
+        fputs_filtered (")", stream);
+      return;
+
+    case OP_ATR_FIRST:
+    case OP_ATR_LAST:
+    case OP_ATR_LENGTH:
+    case OP_ATR_IMAGE:
+    case OP_ATR_MAX:
+    case OP_ATR_MIN:
+    case OP_ATR_MODULUS:
+    case OP_ATR_POS:
+    case OP_ATR_SIZE:
+    case OP_ATR_TAG:
+    case OP_ATR_VAL:
+      *pos += oplen;
+      if (exp->elts[*pos].opcode == OP_TYPE)
+        {
+          if (TYPE_CODE (exp->elts[*pos + 1].type) != TYPE_CODE_VOID)
+            LA_PRINT_TYPE (exp->elts[*pos + 1].type, "", stream, 0, 0);
+          *pos += 3;
+        }
+      else
+        print_subexp (exp, pos, stream, PREC_SUFFIX);
+      fprintf_filtered (stream, "'%s", ada_attribute_name (op));
+      if (nargs > 1)
+        {
+          int tem;
+          for (tem = 1; tem < nargs; tem += 1)
+            {
+              fputs_filtered ((tem == 1) ? " (" : ", ", stream);
+              print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
+            }
+          fputs_filtered (")", stream);
+        }
+      return;
+
+    case UNOP_QUAL:
+      *pos += oplen;
+      type_print (exp->elts[pc + 1].type, "", stream, 0);
+      fputs_filtered ("'(", stream);
+      print_subexp (exp, pos, stream, PREC_PREFIX);
+      fputs_filtered (")", stream);
+      return;
+
+    case UNOP_IN_RANGE:
+      *pos += oplen;
+      print_subexp (exp, pos, stream, PREC_SUFFIX);
+      fputs_filtered (" in ", stream);
+      LA_PRINT_TYPE (exp->elts[pc + 1].type, "", stream, 1, 0);
+      return;
+    }
+}
 
 /* Table mapping opcodes into strings for printing operators
    and precedences of the operators.  */
@@ -7940,12 +10082,13 @@
   {"not ", UNOP_LOGICAL_NOT, PREC_PREFIX, 0},
   {"not ", UNOP_COMPLEMENT, PREC_PREFIX, 0},
   {"abs ", UNOP_ABS, PREC_PREFIX, 0},
-  {".all", UNOP_IND, PREC_SUFFIX, 1},	/* FIXME: postfix .ALL */
-  {"'access", UNOP_ADDR, PREC_SUFFIX, 1},	/* FIXME: postfix 'ACCESS */
+  {".all", UNOP_IND, PREC_SUFFIX, 1},
+  {"'access", UNOP_ADDR, PREC_SUFFIX, 1},
+  {"'size", OP_ATR_SIZE, PREC_SUFFIX, 1},
   {NULL, 0, 0, 0}
 };
 
-			/* Assorted Types and Interfaces */
+                        /* Assorted Types and Interfaces */
 
 struct type *builtin_type_ada_int;
 struct type *builtin_type_ada_short;
@@ -7961,7 +10104,6 @@
 
 struct type **const (ada_builtin_types[]) =
 {
-
   &builtin_type_ada_int,
     &builtin_type_ada_long,
     &builtin_type_ada_short,
@@ -7971,7 +10113,7 @@
     &builtin_type_ada_long_long,
     &builtin_type_ada_long_double,
     &builtin_type_ada_natural, &builtin_type_ada_positive,
-    /* The following types are carried over from C for convenience. */
+    /* The following types are carried over from C for convenience.  */
 &builtin_type_int,
     &builtin_type_long,
     &builtin_type_short,
@@ -7989,112 +10131,146 @@
     &builtin_type_long_double,
     &builtin_type_complex, &builtin_type_double_complex, 0};
 
-/* Not really used, but needed in the ada_language_defn. */
+/* Not really used, but needed in the ada_language_defn.  */
+
 static void
 emit_char (int c, struct ui_file *stream, int quoter)
 {
   ada_emit_char (c, stream, quoter, 1);
 }
 
+static int
+parse (void)
+{
+  warnings_issued = 0;
+  return ada_parse ();
+}
+
+static const struct exp_descriptor ada_exp_descriptor = {
+  ada_print_subexp,
+  ada_operator_length,
+  ada_op_name,
+  ada_dump_subexp_body,
+  ada_evaluate_subexp
+};
+
 const struct language_defn ada_language_defn = {
-  "ada",			/* Language name */
-  /*  language_ada, */
-  language_unknown,
-  /* FIXME: language_ada should be defined in defs.h */
+  "ada",                        /* Language name */
+  language_ada,
   ada_builtin_types,
   range_check_off,
   type_check_off,
-  case_sensitive_on,		/* Yes, Ada is case-insensitive, but
-				 * that's not quite what this means. */
-  ada_parse,
+  case_sensitive_on,            /* Yes, Ada is case-insensitive, but
+                                   that's not quite what this means.  */
+#ifdef GNAT_GDB
+  ada_lookup_symbol,
+  ada_lookup_minimal_symbol,
+#endif /* GNAT_GDB */
+  &ada_exp_descriptor,
+  parse,
   ada_error,
-  ada_evaluate_subexp,
-  ada_printchar,		/* Print a character constant */
-  ada_printstr,			/* Function to print string constant */
-  emit_char,			/* Function to print single char (not used) */
-  ada_create_fundamental_type,	/* Create fundamental type in this language */
-  ada_print_type,		/* Print a type using appropriate syntax */
-  ada_val_print,		/* Print a value using appropriate syntax */
-  ada_value_print,		/* Print a top-level value */
-  NULL,				/* Language specific skip_trampoline */
-  value_of_this,		/* value_of_this */
-  basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal  */
-  basic_lookup_transparent_type,/* lookup_transparent_type */
-  NULL,				/* Language specific symbol demangler */
-  {"", "", "", ""},		/* Binary format info */
+  resolve,
+  ada_printchar,                /* Print a character constant */
+  ada_printstr,                 /* Function to print string constant */
+  emit_char,                    /* Function to print single char (not used) */
+  ada_create_fundamental_type,  /* Create fundamental type in this language */
+  ada_print_type,               /* Print a type using appropriate syntax */
+  ada_val_print,                /* Print a value using appropriate syntax */
+  ada_value_print,              /* Print a top-level value */
+  NULL,                         /* Language specific skip_trampoline */
+  NULL,                         /* value_of_this */
+  ada_lookup_symbol_nonlocal,   /* Looking up non-local symbols.  */
+  basic_lookup_transparent_type,        /* lookup_transparent_type */
+  ada_la_decode,                /* Language specific symbol demangler */
+  NULL,                         /* Language specific class_name_from_physname */
+  {"", "", "", ""},             /* Binary format info */
 #if 0
-  {"8#%lo#", "8#", "o", "#"},	/* Octal format info */
-  {"%ld", "", "d", ""},		/* Decimal format info */
-  {"16#%lx#", "16#", "x", "#"},	/* Hex format info */
+  {"8#%lo#", "8#", "o", "#"},   /* Octal format info */
+  {"%ld", "", "d", ""},         /* Decimal format info */
+  {"16#%lx#", "16#", "x", "#"}, /* Hex format info */
 #else
-  /* Copied from c-lang.c. */
-  {"0%lo", "0", "o", ""},	/* Octal format info */
-  {"%ld", "", "d", ""},		/* Decimal format info */
-  {"0x%lx", "0x", "x", ""},	/* Hex format info */
+  /* Copied from c-lang.c.  */
+  {"0%lo", "0", "o", ""},       /* Octal format info */
+  {"%ld", "", "d", ""},         /* Decimal format info */
+  {"0x%lx", "0x", "x", ""},     /* Hex format info */
 #endif
-  ada_op_print_tab,		/* expression operators for printing */
-  1,				/* c-style arrays (FIXME?) */
-  0,				/* String lower bound (FIXME?) */
+  ada_op_print_tab,             /* expression operators for printing */
+  0,                            /* c-style arrays */
+  1,                            /* String lower bound */
   &builtin_type_ada_char,
-  default_word_break_characters,
+  ada_get_gdb_completer_word_break_characters,
+#ifdef GNAT_GDB
+  ada_translate_error_message,  /* Substitute Ada-specific terminology
+                                   in errors and warnings.  */
+#endif /* GNAT_GDB */
   LANG_MAGIC
 };
 
-void
-_initialize_ada_language (void)
+static void
+build_ada_types (struct gdbarch *current_gdbarch)
 {
   builtin_type_ada_int =
     init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-	       0, "integer", (struct objfile *) NULL);
+               0, "integer", (struct objfile *) NULL);
   builtin_type_ada_long =
     init_type (TYPE_CODE_INT, TARGET_LONG_BIT / TARGET_CHAR_BIT,
-	       0, "long_integer", (struct objfile *) NULL);
+               0, "long_integer", (struct objfile *) NULL);
   builtin_type_ada_short =
     init_type (TYPE_CODE_INT, TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-	       0, "short_integer", (struct objfile *) NULL);
+               0, "short_integer", (struct objfile *) NULL);
   builtin_type_ada_char =
     init_type (TYPE_CODE_INT, TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-	       0, "character", (struct objfile *) NULL);
+               0, "character", (struct objfile *) NULL);
   builtin_type_ada_float =
     init_type (TYPE_CODE_FLT, TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
-	       0, "float", (struct objfile *) NULL);
+               0, "float", (struct objfile *) NULL);
   builtin_type_ada_double =
     init_type (TYPE_CODE_FLT, TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
-	       0, "long_float", (struct objfile *) NULL);
+               0, "long_float", (struct objfile *) NULL);
   builtin_type_ada_long_long =
     init_type (TYPE_CODE_INT, TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-	       0, "long_long_integer", (struct objfile *) NULL);
+               0, "long_long_integer", (struct objfile *) NULL);
   builtin_type_ada_long_double =
     init_type (TYPE_CODE_FLT, TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
-	       0, "long_long_float", (struct objfile *) NULL);
+               0, "long_long_float", (struct objfile *) NULL);
   builtin_type_ada_natural =
     init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-	       0, "natural", (struct objfile *) NULL);
+               0, "natural", (struct objfile *) NULL);
   builtin_type_ada_positive =
     init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
-	       0, "positive", (struct objfile *) NULL);
+               0, "positive", (struct objfile *) NULL);
 
 
   builtin_type_ada_system_address =
     lookup_pointer_type (init_type (TYPE_CODE_VOID, 1, 0, "void",
-				    (struct objfile *) NULL));
+                                    (struct objfile *) NULL));
   TYPE_NAME (builtin_type_ada_system_address) = "system__address";
-
-  add_language (&ada_language_defn);
-
-  add_show_from_set
-    (add_set_cmd ("varsize-limit", class_support, var_uinteger,
-		  (char *) &varsize_limit,
-		  "Set maximum bytes in dynamic-sized object.",
-		  &setlist), &showlist);
-  varsize_limit = 65536;
-
-  add_com ("begin", class_breakpoint, begin_command,
-	   "Start the debugged program, stopping at the beginning of the\n\
-main program.  You may specify command-line arguments to give it, as for\n\
-the \"run\" command (q.v.).");
 }
 
+void
+_initialize_ada_language (void)
+{
+
+  build_ada_types (current_gdbarch);
+  gdbarch_data_register_post_init (build_ada_types);
+  add_language (&ada_language_defn);
+
+  varsize_limit = 65536;
+#ifdef GNAT_GDB
+  add_setshow_uinteger_cmd ("varsize-limit", class_support,
+			    &varsize_limit, "\
+Set the maximum number of bytes allowed in a dynamic-sized object.", "\
+Show the maximum number of bytes allowed in a dynamic-sized object.",
+			    NULL, NULL, &setlist, &showlist);
+  obstack_init (&cache_space);
+#endif /* GNAT_GDB */
+
+  obstack_init (&symbol_list_obstack);
+
+  decoded_names_store = htab_create_alloc_ex
+    (256, htab_hash_string, (int (*)(const void *, const void *)) streq,
+     NULL, NULL, xmcalloc, xmfree);
+}
 
 /* Create a fundamental Ada type using default reasonable for the current
    target machine.
@@ -8130,104 +10306,104 @@
       /* FIXME:  For now, if we are asked to produce a type not in this
          language, create the equivalent of a C integer type with the
          name "<?type?>".  When all the dust settles from the type
-         reconstruction work, this should probably become an error. */
+         reconstruction work, this should probably become an error.  */
       type = init_type (TYPE_CODE_INT,
-			TARGET_INT_BIT / TARGET_CHAR_BIT,
-			0, "<?type?>", objfile);
+                        TARGET_INT_BIT / TARGET_CHAR_BIT,
+                        0, "<?type?>", objfile);
       warning ("internal error: no Ada fundamental type %d", typeid);
       break;
     case FT_VOID:
       type = init_type (TYPE_CODE_VOID,
-			TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-			0, "void", objfile);
+                        TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+                        0, "void", objfile);
       break;
     case FT_CHAR:
       type = init_type (TYPE_CODE_INT,
-			TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-			0, "character", objfile);
+                        TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+                        0, "character", objfile);
       break;
     case FT_SIGNED_CHAR:
       type = init_type (TYPE_CODE_INT,
-			TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-			0, "signed char", objfile);
+                        TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+                        0, "signed char", objfile);
       break;
     case FT_UNSIGNED_CHAR:
       type = init_type (TYPE_CODE_INT,
-			TARGET_CHAR_BIT / TARGET_CHAR_BIT,
-			TYPE_FLAG_UNSIGNED, "unsigned char", objfile);
+                        TARGET_CHAR_BIT / TARGET_CHAR_BIT,
+                        TYPE_FLAG_UNSIGNED, "unsigned char", objfile);
       break;
     case FT_SHORT:
       type = init_type (TYPE_CODE_INT,
-			TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-			0, "short_integer", objfile);
+                        TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                        0, "short_integer", objfile);
       break;
     case FT_SIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-			TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-			0, "short_integer", objfile);
+                        TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                        0, "short_integer", objfile);
       break;
     case FT_UNSIGNED_SHORT:
       type = init_type (TYPE_CODE_INT,
-			TARGET_SHORT_BIT / TARGET_CHAR_BIT,
-			TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
+                        TARGET_SHORT_BIT / TARGET_CHAR_BIT,
+                        TYPE_FLAG_UNSIGNED, "unsigned short", objfile);
       break;
     case FT_INTEGER:
       type = init_type (TYPE_CODE_INT,
-			TARGET_INT_BIT / TARGET_CHAR_BIT,
-			0, "integer", objfile);
+                        TARGET_INT_BIT / TARGET_CHAR_BIT,
+                        0, "integer", objfile);
       break;
     case FT_SIGNED_INTEGER:
-      type = init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, 0, "integer", objfile);	/* FIXME -fnf */
+      type = init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT, 0, "integer", objfile);        /* FIXME -fnf */
       break;
     case FT_UNSIGNED_INTEGER:
       type = init_type (TYPE_CODE_INT,
-			TARGET_INT_BIT / TARGET_CHAR_BIT,
-			TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
+                        TARGET_INT_BIT / TARGET_CHAR_BIT,
+                        TYPE_FLAG_UNSIGNED, "unsigned int", objfile);
       break;
     case FT_LONG:
       type = init_type (TYPE_CODE_INT,
-			TARGET_LONG_BIT / TARGET_CHAR_BIT,
-			0, "long_integer", objfile);
+                        TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                        0, "long_integer", objfile);
       break;
     case FT_SIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-			TARGET_LONG_BIT / TARGET_CHAR_BIT,
-			0, "long_integer", objfile);
+                        TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                        0, "long_integer", objfile);
       break;
     case FT_UNSIGNED_LONG:
       type = init_type (TYPE_CODE_INT,
-			TARGET_LONG_BIT / TARGET_CHAR_BIT,
-			TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
+                        TARGET_LONG_BIT / TARGET_CHAR_BIT,
+                        TYPE_FLAG_UNSIGNED, "unsigned long", objfile);
       break;
     case FT_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-			TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-			0, "long_long_integer", objfile);
+                        TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                        0, "long_long_integer", objfile);
       break;
     case FT_SIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-			TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-			0, "long_long_integer", objfile);
+                        TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                        0, "long_long_integer", objfile);
       break;
     case FT_UNSIGNED_LONG_LONG:
       type = init_type (TYPE_CODE_INT,
-			TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
-			TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
+                        TARGET_LONG_LONG_BIT / TARGET_CHAR_BIT,
+                        TYPE_FLAG_UNSIGNED, "unsigned long long", objfile);
       break;
     case FT_FLOAT:
       type = init_type (TYPE_CODE_FLT,
-			TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
-			0, "float", objfile);
+                        TARGET_FLOAT_BIT / TARGET_CHAR_BIT,
+                        0, "float", objfile);
       break;
     case FT_DBL_PREC_FLOAT:
       type = init_type (TYPE_CODE_FLT,
-			TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
-			0, "long_float", objfile);
+                        TARGET_DOUBLE_BIT / TARGET_CHAR_BIT,
+                        0, "long_float", objfile);
       break;
     case FT_EXT_PREC_FLOAT:
       type = init_type (TYPE_CODE_FLT,
-			TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
-			0, "long_long_float", objfile);
+                        TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT,
+                        0, "long_long_float", objfile);
       break;
     }
   return (type);
@@ -8239,16 +10415,16 @@
   int i;
   fprintf (stderr, "New symtab: [\n");
   fprintf (stderr, "  Name: %s/%s;\n",
-	   s->dirname ? s->dirname : "?", s->filename ? s->filename : "?");
+           s->dirname ? s->dirname : "?", s->filename ? s->filename : "?");
   fprintf (stderr, "  Format: %s;\n", s->debugformat);
   if (s->linetable != NULL)
     {
       fprintf (stderr, "  Line table (section %d):\n", s->block_line_section);
       for (i = 0; i < s->linetable->nitems; i += 1)
-	{
-	  struct linetable_entry *e = s->linetable->item + i;
-	  fprintf (stderr, "    %4ld: %8lx\n", (long) e->line, (long) e->pc);
-	}
+        {
+          struct linetable_entry *e = s->linetable->item + i;
+          fprintf (stderr, "    %4ld: %8lx\n", (long) e->line, (long) e->pc);
+        }
     }
   fprintf (stderr, "]\n");
 }
diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h
index 54e56bb..12eaf4b 100644
--- a/gdb/ada-lang.h
+++ b/gdb/ada-lang.h
@@ -1,5 +1,6 @@
 /* Ada language support definitions for GDB, the GNU debugger.
-   Copyright 1992, 1997 Free Software Foundation, Inc.
+   Copyright 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -21,132 +22,141 @@
 #define ADA_LANG_H 1
 
 struct partial_symbol;
+struct frame_info;
 
 #include "value.h"
 #include "gdbtypes.h"
+#include "breakpoint.h"
+
+/* Names of specific files known to be part of the runtime
+   system and that might consider (confusing) debugging information.
+   Each name (a basic regular expression string) is followed by a
+   comma.  FIXME: Should be part of a configuration file. */
+#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
+#define ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS \
+   "^[agis]-.*\\.ad[bs]$", \
+   "/usr/shlib/libpthread\\.so",
+#elif defined (__linux__)
+#define ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS \
+   "^[agis]-.*\\.ad[bs]$", \
+   "/lib.*/libpthread\\.so[.0-9]*$", "/lib.*/libpthread\\.a$", \
+   "/lib.*/libc\\.so[.0-9]*$", "/lib.*/libc\\.a$",
+#endif
+
+#if !defined (ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS)
+#define ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS \
+   "^[agis]-.*\\.ad[bs]$",
+#endif
+
+/* Names of compiler-generated auxiliary functions probably of no
+   interest to users. Each name (a basic regular expression string)
+   is followed by a comma. */
+#define ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS \
+   "___clean[.a-zA-Z0-9_]*$",
+
+/* The maximum number of frame levels searched for non-local,
+ * non-global symbols.  This limit exists as a precaution to prevent
+ * infinite search loops when the stack is screwed up. */
+#define MAX_ENCLOSING_FRAME_LEVELS 7
+
+/* Maximum number of steps followed in looking for the ultimate
+   referent of a renaming.  This prevents certain infinite loops that
+   can otherwise result. */
+#define MAX_RENAMING_CHAIN_LENGTH 10
 
 struct block;
 
-/* A macro to reorder the bytes of an address depending on the
-   endiannes of the target.  */
-#define EXTRACT_ADDRESS(x) ((void *) extract_unsigned_integer (&(x), sizeof (x)))
-/* A macro to reorder the bytes of an int depending on the endiannes
-   of the target */
-#define EXTRACT_INT(x) ((int) extract_signed_integer (&(x), sizeof (x)))
-
-/* Chain of cleanups for arguments of OP_UNRESOLVED_VALUE names.  Created in
-   yyparse and freed in ada_resolve. */
-extern struct cleanup *unresolved_names;
-
-/* Corresponding mangled/demangled names and opcodes for Ada user-definable 
+/* Corresponding encoded/decoded names and opcodes for Ada user-definable
    operators. */
 struct ada_opname_map
 {
-  const char *mangled;
-  const char *demangled;
+  const char *encoded;
+  const char *decoded;
   enum exp_opcode op;
 };
 
-/* Table of Ada operators in mangled and demangled forms. */
+/* Table of Ada operators in encoded and decoded forms. */
 /* Defined in ada-lang.c */
 extern const struct ada_opname_map ada_opname_table[];
 
-/* The maximum number of tasks known to the Ada runtime */
-extern const int MAX_NUMBER_OF_KNOWN_TASKS;
+enum ada_operator 
+  {
+    /* X IN A'RANGE(N).  N is an immediate operand, surrounded by 
+       BINOP_IN_BOUNDS before and after.  A is an array, X an index 
+       value.  Evaluates to true iff X is within range of the Nth
+       dimension (1-based) of A.  (A multi-dimensional array
+       type is represented as array of array of ...) */
+    BINOP_IN_BOUNDS = OP_EXTENDED0,
 
-/* Identifiers for Ada attributes that need special processing.  Be sure 
-   to update the table attribute_names in ada-lang.c whenever you change this.
-   */
+    /* X IN L .. U.  True iff L <= X <= U.  */
+    TERNOP_IN_RANGE,
 
-enum ada_attribute
-{
-  /* Invalid attribute for error checking. */
-  ATR_INVALID,
+    /* Ada attributes ('Foo). */
+    OP_ATR_FIRST,
+    OP_ATR_LAST,
+    OP_ATR_LENGTH,
+    OP_ATR_IMAGE,
+    OP_ATR_MAX,
+    OP_ATR_MIN,
+    OP_ATR_MODULUS,
+    OP_ATR_POS,
+    OP_ATR_SIZE,
+    OP_ATR_TAG,
+    OP_ATR_VAL,
 
-  ATR_FIRST,
-  ATR_LAST,
-  ATR_LENGTH,
-  ATR_IMAGE,
-  ATR_IMG,
-  ATR_MAX,
-  ATR_MIN,
-  ATR_MODULUS,
-  ATR_POS,
-  ATR_SIZE,
-  ATR_TAG,
-  ATR_VAL,
+    /* Ada type qualification.  It is encoded as for UNOP_CAST, above, 
+       and denotes the TYPE'(EXPR) construct. */
+    UNOP_QUAL,
 
-  /* Dummy last attribute. */
-  ATR_END
+    /* X IN TYPE.  The `TYPE' argument is immediate, with 
+       UNOP_IN_RANGE before and after it. True iff X is a member of 
+       type TYPE (typically a subrange). */
+    UNOP_IN_RANGE,
+
+    /* End marker */
+    OP_ADA_LAST
+  };
+
+/* A triple, (symbol, block, symtab), representing one instance of a 
+ * symbol-lookup operation. */
+struct ada_symbol_info {
+  struct symbol* sym;
+  struct block* block;
+  struct symtab* symtab;
 };
 
-enum task_states
-{
-  Unactivated,
-  Runnable,
-  Terminated,
-  Activator_Sleep,
-  Acceptor_Sleep,
-  Entry_Caller_Sleep,
-  Async_Select_Sleep,
-  Delay_Sleep,
-  Master_Completion_Sleep,
-  Master_Phase_2_Sleep
-};
+/* Ada task structures.  */
 
-extern char *ada_task_states[];
+/* Ada task control block, as defined in the GNAT runt-time library.  */
 
-typedef struct
+struct task_control_block
 {
-  char *P_ARRAY;
-  int *P_BOUNDS;
-}
-fat_string;
-
-typedef struct entry_call
-{
-  void *self;
-}
- *entry_call_link;
-
-struct task_fields
-{
-  int entry_num;
-#if (defined (VXWORKS_TARGET) || !defined (i386)) \
-    && !(defined (VXWORKS_TARGET) && defined (M68K_TARGET))
-  int pad1;
-#endif
   char state;
-#if (defined (VXWORKS_TARGET) && defined (M68K_TARGET))
-  char pad_8bits;
-#endif
-  void *parent;
+  CORE_ADDR parent;
   int priority;
-  int current_priority;
-  fat_string image;
-  entry_call_link call;
-#if (defined (sun) && defined (__SVR4)) && !defined (VXWORKS_TARGET)
-  int pad2;
-  unsigned thread;
-  unsigned lwp;
-#else
-  void *thread;
-  void *lwp;
-#endif
-}
-#if (defined (VXWORKS_TARGET) && defined (M68K_TARGET))
-__attribute__ ((packed))
-#endif
-  ;
+  char image [32];
+  int image_len;    /* This field is not always present in the ATCB.  */
+  CORE_ADDR call;
+  CORE_ADDR thread;
+  CORE_ADDR lwp;    /* This field is not always present in the ATCB.  */
+};
+
+struct task_ptid
+{
+  int pid;                      /* The Process id */
+  long lwp;                     /* The Light Weight Process id */
+  long tid;                     /* The Thread id */
+};
+typedef struct task_ptid task_ptid_t;
 
 struct task_entry
 {
-  void *task_id;
+  CORE_ADDR task_id;
+  struct task_control_block atcb;
   int task_num;
   int known_tasks_index;
   struct task_entry *next_task;
-  void *thread;
-  void *lwp;
+  task_ptid_t task_ptid;
   int stack_per;
 };
 
@@ -162,33 +172,44 @@
 extern struct type *builtin_type_ada_positive;
 extern struct type *builtin_type_ada_system_address;
 
-/* Assuming V points to an array of S objects,  make sure that it contains at 
+/* The maximum number of tasks known to the Ada runtime.  */
+extern const int MAX_NUMBER_OF_KNOWN_TASKS;
+
+/* task entry list.  */
+extern struct task_entry *task_list;
+
+
+/* Assuming V points to an array of S objects,  make sure that it contains at
    least M objects, updating V and S as necessary. */
 
-#define GROW_VECT(v, s, m) 						\
+#define GROW_VECT(v, s, m)                                              \
    if ((s) < (m)) grow_vect ((void**) &(v), &(s), (m), sizeof(*(v)));
 
 extern void grow_vect (void **, size_t *, size_t, int);
 
-extern int ada_parse (void);	/* Defined in ada-exp.y */
+extern int ada_get_field_index (const struct type *type,
+                                const char *field_name,
+                                int maybe_missing);
 
-extern void ada_error (char *);	/* Defined in ada-exp.y */
+extern int ada_parse (void);    /* Defined in ada-exp.y */
 
-			/* Defined in ada-typeprint.c */
+extern void ada_error (char *); /* Defined in ada-exp.y */
+
+                        /* Defined in ada-typeprint.c */
 extern void ada_print_type (struct type *, char *, struct ui_file *, int,
-			    int);
+                            int);
 
 extern int ada_val_print (struct type *, char *, int, CORE_ADDR,
-			  struct ui_file *, int, int, int,
-			  enum val_prettyprint);
+                          struct ui_file *, int, int, int,
+                          enum val_prettyprint);
 
 extern int ada_value_print (struct value *, struct ui_file *, int,
-			    enum val_prettyprint);
+                            enum val_prettyprint);
 
-				/* Defined in ada-lang.c */
+                                /* Defined in ada-lang.c */
 
 extern struct value *value_from_contents_and_address (struct type *, char *,
-						      CORE_ADDR);
+                                                      CORE_ADDR);
 
 extern void ada_emit_char (int, struct ui_file *, int, int);
 
@@ -197,10 +218,10 @@
 extern void ada_printstr (struct ui_file *, char *, unsigned int, int, int);
 
 extern void ada_convert_actuals (struct value *, int, struct value **,
-				 CORE_ADDR *);
+                                 CORE_ADDR *);
 
 extern struct value *ada_value_subscript (struct value *, int,
-					  struct value **);
+                                          struct value **);
 
 extern struct type *ada_array_element_type (struct type *, int);
 
@@ -208,13 +229,11 @@
 
 struct type *ada_type_of_array (struct value *, int);
 
-extern struct value *ada_coerce_to_simple_array (struct value *);
-
 extern struct value *ada_coerce_to_simple_array_ptr (struct value *);
 
-extern int ada_is_simple_array (struct type *);
+extern int ada_is_simple_array_type (struct type *);
 
-extern int ada_is_array_descriptor (struct type *);
+extern int ada_is_array_descriptor_type (struct type *);
 
 extern int ada_is_bogus_array_descriptor (struct type *);
 
@@ -222,34 +241,43 @@
 
 extern struct value *ada_array_bound (struct value *, int, int);
 
-extern int ada_lookup_symbol_list (const char *, struct block *,
-				   domain_enum, struct symbol ***,
-				   struct block ***);
+extern char *ada_decode_symbol (const struct general_symbol_info*);
+
+extern const char *ada_decode (const char*);
+
+extern enum language ada_update_initial_language (enum language, 
+						  struct partial_symtab*);
+
+extern void clear_ada_sym_cache (void);
+
+extern char **ada_make_symbol_completion_list (const char *text0,
+                                               const char *word);
+
+extern int ada_lookup_symbol_list (const char *, const struct block *,
+                                   domain_enum, struct ada_symbol_info**);
 
 extern char *ada_fold_name (const char *);
 
-extern struct symbol *ada_lookup_symbol (const char *, struct block *,
-					 domain_enum);
+extern struct symbol *ada_lookup_symbol (const char *, const struct block *,
+                                         domain_enum, int *, 
+					 struct symtab **);
 
-extern struct minimal_symbol *ada_lookup_minimal_symbol (const char *);
-
-extern void ada_resolve (struct expression **, struct type *);
-
-extern int ada_resolve_function (struct symbol **, struct block **, int,
-				 struct value **, int, const char *,
-				 struct type *);
+extern struct minimal_symbol *ada_lookup_simple_minsym (const char *);
 
 extern void ada_fill_in_ada_prototype (struct symbol *);
 
-extern int user_select_syms (struct symbol **, struct block **, int, int);
+extern int user_select_syms (struct ada_symbol_info *, int, int);
 
 extern int get_selections (int *, int, int, int, char *);
 
 extern char *ada_start_decode_line_1 (char *);
 
 extern struct symtabs_and_lines ada_finish_decode_line_1 (char **,
-							  struct symtab *,
-							  int, char ***);
+                                                          struct symtab *,
+                                                          int, char ***);
+
+extern struct symtabs_and_lines ada_sals_for_line (const char*, int,
+						   int, char***, int);
 
 extern int ada_scan_number (const char *, int, LONGEST *, int *);
 
@@ -260,8 +288,8 @@
 extern int ada_is_packed_array_type (struct type *);
 
 extern struct value *ada_value_primitive_packed_val (struct value *, char *,
-						     long, int, int,
-						     struct type *);
+                                                     long, int, int,
+                                                     struct type *);
 
 extern struct type *ada_coerce_to_simple_array_type (struct type *);
 
@@ -269,12 +297,16 @@
 
 extern int ada_is_string_type (struct type *);
 
-extern int ada_is_tagged_type (struct type *);
+extern int ada_is_tagged_type (struct type *, int);
+
+extern int ada_is_tag_type (struct type *);
 
 extern struct type *ada_tag_type (struct value *);
 
 extern struct value *ada_value_tag (struct value *);
 
+extern const char *ada_tag_name (struct value *);
+
 extern int ada_is_parent_field (struct type *, int);
 
 extern int ada_is_wrapper_field (struct type *, int);
@@ -289,24 +321,20 @@
 
 extern char *ada_variant_discrim_name (struct type *);
 
-extern struct type *ada_lookup_struct_elt_type (struct type *, char *, int,
-						int *);
-
 extern struct value *ada_value_struct_elt (struct value *, char *, char *);
 
-extern struct value *ada_search_struct_field (char *, struct value *, int,
-					      struct type *);
-
 extern int ada_is_aligner_type (struct type *);
 
 extern struct type *ada_aligned_type (struct type *);
 
 extern char *ada_aligned_value_addr (struct type *, char *);
 
-extern const char *ada_attribute_name (int);
+extern const char *ada_attribute_name (enum exp_opcode);
 
 extern int ada_is_fixed_point_type (struct type *);
 
+extern int ada_is_system_address_type (struct type *);
+
 extern DOUBLEST ada_delta (struct type *);
 
 extern DOUBLEST ada_fixed_to_float (struct type *, LONGEST);
@@ -323,30 +351,37 @@
 
 extern int ada_which_variant_applies (struct type *, struct type *, char *);
 
-extern struct value *ada_to_fixed_value (struct type *, char *, CORE_ADDR,
-					 struct value *);
-
 extern struct type *ada_to_fixed_type (struct type *, char *, CORE_ADDR,
-				       struct value *);
+                                       struct value *);
+
+extern struct type *
+  ada_template_to_fixed_record_type_1 (struct type *type, char *valaddr,
+                                       CORE_ADDR address, struct value *dval0,
+                                       int keep_dynamic_fields);
 
 extern int ada_name_prefix_len (const char *);
 
 extern char *ada_type_name (struct type *);
 
 extern struct type *ada_find_parallel_type (struct type *,
-					    const char *suffix);
+                                            const char *suffix);
 
-extern LONGEST get_int_var_value (char *, char *, int *);
+extern LONGEST get_int_var_value (char *, int *);
+
+extern struct symbol *ada_find_any_symbol (const char *name);
 
 extern struct type *ada_find_any_type (const char *name);
 
+extern struct symbol *ada_find_renaming_symbol (const char *name,
+                                                struct block *block);
+
 extern int ada_prefer_type (struct type *, struct type *);
 
 extern struct type *ada_get_base_type (struct type *);
 
 extern struct type *ada_completed_type (struct type *);
 
-extern char *ada_mangle (const char *);
+extern char *ada_encode (const char *);
 
 extern const char *ada_enum_name (const char *);
 
@@ -364,29 +399,50 @@
 
 extern int ada_is_object_renaming (struct symbol *);
 
-extern const char *ada_simple_renamed_entity (struct symbol *);
+extern char *ada_simple_renamed_entity (struct symbol *);
 
 extern char *ada_breakpoint_rewrite (char *, int *);
 
+extern char *ada_main_name (void);
+
 /* Tasking-related: ada-tasks.c */
 
 extern int valid_task_id (int);
 
-extern int get_current_task (void);
-
 extern void init_task_list (void);
 
-extern void *get_self_id (void);
+extern int ada_is_exception_breakpoint (bpstat bs);
 
-extern int get_current_task (void);
+extern void ada_adjust_exception_stop (bpstat bs);
 
-extern int get_entry_number (void *);
+extern void ada_print_exception_stop (bpstat bs);
 
-extern void ada_report_exception_break (struct breakpoint *);
+extern int ada_get_current_task (ptid_t);
+
+extern int breakpoint_ada_task_match (CORE_ADDR, ptid_t);
+
+extern int ada_print_exception_breakpoint_nontask (struct breakpoint *);
+
+extern void ada_print_exception_breakpoint_task (struct breakpoint *);
 
 extern int ada_maybe_exception_partial_symbol (struct partial_symbol *sym);
 
 extern int ada_is_exception_sym (struct symbol *sym);
 
+extern void ada_find_printable_frame (struct frame_info *fi);
 
+extern void ada_reset_thread_registers (void);
+
+extern int ada_build_task_list (void);
+
+/* Look up a symbol by name using the search conventions of 
+   a specific language (optional block, optional symtab). 
+   FIXME: Should be symtab.h. */
+
+extern struct symbol *lookup_symbol_in_language (const char *, 
+						 const struct block *,
+						 domain_enum, 
+						 enum language,
+						 int *,
+						 struct symtab **);
 #endif
diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index 139e3aa..a7ce816 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -1,5 +1,5 @@
 /* FLEX lexer for Ada expressions, for GDB.
-   Copyright (C) 1994, 1997, 2000
+   Copyright (C) 1994, 1997, 1998, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
 This file is part of GDB.
@@ -45,20 +45,23 @@
 POSEXP  (e"+"?{NUM10})
 
 %{
+#define malloc xmalloc
+#define free xfree
+
 #define NUMERAL_WIDTH 256
 #define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
 
-/* Temporary staging for numeric literals. */
-static char numbuf[NUMERAL_WIDTH]; 
- static void canonicalizeNumeral (char* s1, const char*);
-static int processInt (const char*, const char*, const char*);
-static int processReal (const char*);
-static int processId (const char*, int);
-static int processAttribute (const char*);
-static int find_dot_all (const char*);
+/* Temporary staging for numeric literals.  */
+static char numbuf[NUMERAL_WIDTH];
+ static void canonicalizeNumeral (char *s1, const char *);
+static int processInt (const char *, const char *, const char *);
+static int processReal (const char *);
+static int processId (const char *, int);
+static int processAttribute (const char *);
+static int find_dot_all (const char *);
 
 #undef YY_DECL
-#define YY_DECL static int yylex ( void ) 
+#define YY_DECL static int yylex ( void )
 
 #undef YY_INPUT
 #define YY_INPUT(BUF, RESULT, MAX_SIZE) \
@@ -74,15 +77,15 @@
 static char *tempbuf = NULL;
 static int tempbufsize = 0;
 static int tempbuf_len;
-static struct block* left_block_context;
+static struct block *left_block_context;
 
 static void resize_tempbuf (unsigned int);
 
-static void block_lookup (char*, char*);
+static void block_lookup (char *, char *);
 
-static int name_lookup (char*, char*, int*);
+static int name_lookup (char *, char *, int *, int);
 
-static int find_dot_all (const char*);
+static int find_dot_all (const char *);
 
 %}
 
@@ -94,20 +97,20 @@
 
 "--".*		 { yyterminate(); }
 
-{NUM10}{POSEXP}  { 
-		   canonicalizeNumeral (numbuf, yytext); 
+{NUM10}{POSEXP}  {
+		   canonicalizeNumeral (numbuf, yytext);
 		   return processInt (NULL, numbuf, strrchr(numbuf, 'e')+1);
 		 }
 
-{NUM10}          { 
-		   canonicalizeNumeral (numbuf, yytext); 
+{NUM10}          {
+		   canonicalizeNumeral (numbuf, yytext);
 		   return processInt (NULL, numbuf, NULL);
 		 }
 
 {NUM10}"#"{HEXDIG}({HEXDIG}|_)*"#"{POSEXP} {
 		   canonicalizeNumeral (numbuf, yytext);
     		   return processInt (numbuf,
-				      strchr (numbuf, '#') + 1, 
+				      strchr (numbuf, '#') + 1,
 				      strrchr(numbuf, '#') + 1);
 		 }
 
@@ -123,12 +126,12 @@
 
 
 {NUM10}"."{NUM10}{EXP} {
-		   canonicalizeNumeral (numbuf, yytext); 
+		   canonicalizeNumeral (numbuf, yytext);
 		   return processReal (numbuf);
 		}
 
 {NUM10}"."{NUM10} {
-		   canonicalizeNumeral (numbuf, yytext); 
+		   canonicalizeNumeral (numbuf, yytext);
 		   return processReal (numbuf);
 		}
 
@@ -156,7 +159,7 @@
 
 \"{OPER}\"/{WHITE}*"(" { return processId (yytext, yyleng); }
 
-<INITIAL>\"	{ 
+<INITIAL>\"	{
 		   tempbuf_len = 0;
 		   BEGIN IN_STRING;
 		}
@@ -188,10 +191,10 @@
 		   tempbuf_len += yyleng-4;
 		}
 
-if		{ 
-		  while (*lexptr != 'i' && *lexptr != 'I') 
-		    lexptr -= 1; 
-		  yyrestart(NULL); 
+if		{
+		  while (*lexptr != 'i' && *lexptr != 'I')
+		    lexptr -= 1;
+		  yyrestart(NULL);
 		  return 0;
 		}
 
@@ -234,51 +237,53 @@
 		      yyrestart(NULL);
 		      return 0;
 		    }
-		  else 
+		  else
 		    return ',';
 		}
 
 "("		{ paren_depth += 1; return '('; }
-")"		{ if (paren_depth == 0) 
+")"		{ if (paren_depth == 0)
 		    {
 		      lexptr -= 1;
 		      yyrestart(NULL);
 		      return 0;
 		    }
-		  else 
+		  else
  		    {
-		      paren_depth -= 1; 
+		      paren_depth -= 1;
 		      return ')';
 		    }
 		}
 
 "."{WHITE}*all  { return DOT_ALL; }
 
-"."{WHITE}*{ID} { 
+"."{WHITE}*{ID} {
 	 	  processId (yytext+1, yyleng-1);
-	          return DOT_ID; 
+	          return DOT_ID;
 		}
 
-{ID}({WHITE}*"."{WHITE}*({ID}|\"{OPER}\"))*(" "*"'")?  { 
+{ID}({WHITE}*"."{WHITE}*({ID}|\"{OPER}\"))*(" "*"'")?  {
                   int all_posn = find_dot_all (yytext);
 		  int token_type, segments, k;
 		  int quote_follows;
 
-                  if (all_posn == -1 && yytext[yyleng-1] == '\'') 
+                  if (all_posn == -1 && yytext[yyleng-1] == '\'')
 		    {
 		      quote_follows = 1;
-		      do { 
-			yyless (yyleng-1); 
+		      do {
+			yyless (yyleng-1);
 		      } while (yytext[yyleng-1] == ' ');
 		    }
 		  else
-		    quote_follows = 0;			
-		    
+		    quote_follows = 0;
+
                   if (all_posn >= 0)
 		    yyless (all_posn);
                   processId(yytext, yyleng);
-                  segments = name_lookup (ada_mangle (yylval.ssym.stoken.ptr),
-		                          yylval.ssym.stoken.ptr, &token_type);
+                  segments = name_lookup (ada_encode (yylval.ssym.stoken.ptr),
+		                          yylval.ssym.stoken.ptr, 
+                                          &token_type,
+					  MAX_RENAMING_CHAIN_LENGTH);
 		  left_block_context = NULL;
 		  for (k = yyleng; segments > 0 && k > 0; k -= 1)
                     {
@@ -289,7 +294,7 @@
 		  if (k <= 0)
 		    error ("confused by name %s", yytext);
 		  yyless (k);
-		  if (quote_follows) 
+		  if (quote_follows)
 		    BEGIN BEFORE_QUAL_QUOTE;
 		  return token_type;
                 }
@@ -303,37 +308,21 @@
                   return BLOCKNAME;
 		}
 
-{ID}({WHITE}*"."{WHITE}*({ID}|\"{OPER}\"))*{WHITE}*::  { 
+{ID}({WHITE}*"."{WHITE}*({ID}|\"{OPER}\"))*{WHITE}*::  {
                   processId(yytext, yyleng-2);
-                  block_lookup (ada_mangle (yylval.ssym.stoken.ptr),
+                  block_lookup (ada_encode (yylval.ssym.stoken.ptr),
                                 yylval.ssym.stoken.ptr);
                   return BLOCKNAME;
 		}
 
 [{}@]		{ return yytext[0]; }
 
-"$$"		{ yylval.lval = -1; return LAST; }
-"$$"{DIG}+	{ yylval.lval = -atoi(yytext+2); return LAST; }
-"$"		{ yylval.lval = 0; return LAST; }
-"$"{DIG}+	{ yylval.lval = atoi(yytext+1); return LAST; }
-
-
 	/* REGISTERS AND GDB CONVENIENCE VARIABLES */
 
-"$"({LETTER}|{DIG}|"$")+  {
-    		  int c;
-		  for (c = 0; c < NUM_REGS; c++)
-		    if (REGISTER_NAME (c) &&
-                        strcmp (yytext + 1, REGISTER_NAME (c)) == 0)
-		      {
-			yylval.lval = c;
-			return REGNAME;
-		      }
+"$"({LETTER}|{DIG}|"$")*  {
 		  yylval.sval.ptr = yytext;
 		  yylval.sval.length = yyleng;
-		  yylval.ivar = 
-		    lookup_internalvar (copy_name (yylval.sval) + 1);
-		  return INTERNAL_VARIABLE;
+		  return SPECIAL_VARIABLE;
 		}
 
 	/* CATCH-ALL ERROR CASE */
@@ -342,38 +331,35 @@
 %%
 
 #include <ctype.h>
-#include <string.h>
+#include "gdb_string.h"
 
 /* Initialize the lexer for processing new expression */
 void
-lexer_init (FILE* inp)
+lexer_init (FILE *inp)
 {
   BEGIN INITIAL;
   yyrestart (inp);
 }
 
 
-/* Make sure that tempbuf points at an array at least N characters long. */
+/* Make sure that tempbuf points at an array at least N characters long.  */
 
 static void
-resize_tempbuf (n)
-     unsigned int n;
+resize_tempbuf (unsigned int n)
 {
   if (tempbufsize < n)
     {
       tempbufsize = (n+63) & ~63;
-      tempbuf = (char*) xrealloc (tempbuf, tempbufsize);
+      tempbuf = (char *) xrealloc (tempbuf, tempbufsize);
     }
 }
- 
-/* Copy S2 to S1, removing all underscores, and downcasing all letters. */
+
+/* Copy S2 to S1, removing all underscores, and downcasing all letters.  */
 
 static void
-canonicalizeNumeral (s1,s2)
-     char* s1;
-     const char* s2;
+canonicalizeNumeral (char *s1, const char *s2)
 {
-  for (; *s2 != '\000'; s2 += 1) 
+  for (; *s2 != '\000'; s2 += 1)
     {
       if (*s2 != '_')
 	{
@@ -386,25 +372,22 @@
 
 #define HIGH_BYTE_POSN ((sizeof (ULONGEST) - 1) * HOST_CHAR_BIT)
 
-/* True (non-zero) iff DIGIT is a valid digit in radix BASE, 
+/* True (non-zero) iff DIGIT is a valid digit in radix BASE,
    where 2 <= BASE <= 16.  */
 
 static int
-is_digit_in_base (digit, base)
-     unsigned char digit;
-     int base;
+is_digit_in_base (unsigned char digit, int base)
 {
   if (!isxdigit (digit))
     return 0;
   if (base <= 10)
     return (isdigit (digit) && digit < base + '0');
-  else 
+  else
     return (isdigit (digit) || tolower (digit) < base - 10 + 'a');
 }
 
 static int
-digit_to_int (c)
-     unsigned char c;
+digit_to_int (unsigned char c)
 {
   if (isdigit (c))
     return c - '0';
@@ -412,12 +395,9 @@
     return tolower (c) - 'a' + 10;
 }
 
-/* As for strtoul, but for ULONGEST results. */
+/* As for strtoul, but for ULONGEST results.  */
 ULONGEST
-strtoulst (num, trailer, base)
-     const char *num;
-     const char **trailer;
-     int base;
+strtoulst (const char *num, const char **trailer, int base)
 {
   unsigned int high_part;
   ULONGEST result;
@@ -437,7 +417,7 @@
       result = result*base + digit_to_int (num[i]);
       high_part = high_part*base + (unsigned int) (result >> HIGH_BYTE_POSN);
       result &= ((ULONGEST) 1 << HIGH_BYTE_POSN) - 1;
-      if (high_part > 0xff) 
+      if (high_part > 0xff)
 	{
 	  errno = ERANGE;
 	  result = high_part = 0;
@@ -456,26 +436,23 @@
 /* Interprets the prefix of NUM that consists of digits of the given BASE
    as an integer of that BASE, with the string EXP as an exponent.
    Puts value in yylval, and returns INT, if the string is valid.  Causes
-   an error if the number is improperly formated.   BASE, if NULL, defaults 
-   to "10", and EXP to "1". The EXP does not contain a leading 'e' or 'E'. */
+   an error if the number is improperly formated.   BASE, if NULL, defaults
+   to "10", and EXP to "1".  The EXP does not contain a leading 'e' or 'E'.  */
 
 static int
-processInt (base0, num0, exp0)
-     const char* num0;
-     const char* base0;
-     const char* exp0;
+processInt (const char *base0, const char *num0, const char *exp0)
 {
   ULONGEST result;
   long exp;
   int base;
 
-  char* trailer;
+  char *trailer;
 
   if (base0 == NULL)
     base = 10;
   else
-    {	
-      base = strtol (base0, (char**) NULL, 10);
+    {
+      base = strtol (base0, (char **) NULL, 10);
       if (base < 2 || base > 16)
 	error ("Invalid base: %d.", base);
     }
@@ -483,23 +460,23 @@
   if (exp0 == NULL)
     exp = 0;
   else
-    exp = strtol(exp0, (char**) NULL, 10);
+    exp = strtol(exp0, (char **) NULL, 10);
 
   errno = 0;
-  result = strtoulst (num0, &trailer, base);
+  result = strtoulst (num0, (const char **) &trailer, base);
   if (errno == ERANGE)
     error ("Integer literal out of range");
   if (isxdigit(*trailer))
     error ("Invalid digit `%c' in based literal", *trailer);
 
-  while (exp > 0) 
+  while (exp > 0)
     {
       if (result > (ULONG_MAX / base))
 	error ("Integer literal out of range");
       result *= base;
       exp -= 1;
     }
-    
+
   if ((result >> (TARGET_INT_BIT-1)) == 0)
     yylval.typed_val.type = builtin_type_ada_int;
   else if ((result >> (TARGET_LONG_BIT-1)) == 0)
@@ -507,48 +484,47 @@
   else if (((result >> (TARGET_LONG_BIT-1)) >> 1) == 0)
     {
       /* We have a number representable as an unsigned integer quantity.
-         For consistency with the C treatment, we will treat it as an 
+         For consistency with the C treatment, we will treat it as an
 	 anonymous modular (unsigned) quantity.  Alas, the types are such
-	 that we need to store .val as a signed quantity.  Sorry 
+	 that we need to store .val as a signed quantity.  Sorry
          for the mess, but C doesn't officially guarantee that a simple
          assignment does the trick (no, it doesn't; read the reference manual).
        */
       yylval.typed_val.type = builtin_type_unsigned_long;
       if (result & LONGEST_SIGN)
-	yylval.typed_val.val = 
-	  (LONGEST) (result & ~LONGEST_SIGN) 
+	yylval.typed_val.val =
+	  (LONGEST) (result & ~LONGEST_SIGN)
 	  - (LONGEST_SIGN>>1) - (LONGEST_SIGN>>1);
       else
 	yylval.typed_val.val = (LONGEST) result;
       return INT;
     }
-  else 
+  else
     yylval.typed_val.type = builtin_type_ada_long_long;
 
   yylval.typed_val.val = (LONGEST) result;
   return INT;
 }
 
-static int
-processReal (num0)
-     const char* num0;
-{
-  if (sizeof (DOUBLEST) <= sizeof (float))
-    sscanf (num0, "%g", &yylval.typed_val_float.dval);
-  else if (sizeof (DOUBLEST) <= sizeof (double))
-    sscanf (num0, "%lg", &yylval.typed_val_float.dval);
-  else
-    {
-#ifdef PRINTF_HAS_LONG_DOUBLE
-      sscanf (num0, "%Lg", &yylval.typed_val_float.dval);
+#if defined (PRINTF_HAS_LONG_DOUBLE)
+#  undef PRINTF_HAS_LONG_DOUBLE
+#  define PRINTF_HAS_LONG_DOUBLE 1
 #else
-      /* Scan it into a double, then convert and assign it to the 
-	 long double.  This at least wins with values representable 
-	 in the range of doubles. */
+#  define PRINTF_HAS_LONG_DOUBLE 0
+#endif
+
+static int
+processReal (const char *num0)
+{
+#if defined (PRINTF_HAS_LONG_DOUBLE)
+  if (sizeof (DOUBLEST) > sizeof (double))
+    sscanf (num0, "%Lg", &yylval.typed_val_float.dval);
+  else
+#endif
+    {
       double temp;
       sscanf (num0, "%lg", &temp);
       yylval.typed_val_float.dval = temp;
-#endif
     }
 
   yylval.typed_val_float.type = builtin_type_ada_float;
@@ -561,26 +537,22 @@
 }
 
 static int
-processId (name0, len)
-     const char *name0;
-     int len;
+processId (const char *name0, int len)
 {
-  char* name = xmalloc (len + 11);
+  char *name = obstack_alloc (&temp_parse_space, len + 11);
   int i0, i;
-  
-/*  add_name_string_cleanup (name); */
-/* FIXME: add_name_string_cleanup should be defined in parse.c */
+
   while (len > 0 && isspace (name0[len-1]))
     len -= 1;
   i = i0 = 0;
-  while (i0 < len) 
+  while (i0 < len)
     {
       if (isalnum (name0[i0]))
 	{
 	  name[i] = tolower (name0[i0]);
 	  i += 1; i0 += 1;
 	}
-      else switch (name0[i0]) 
+      else switch (name0[i0])
 	{
 	default:
 	  name[i] = name0[i0];
@@ -617,19 +589,16 @@
   return NAME;
 }
 
-static void 
-block_lookup (name, err_name)
-     char* name;
-     char* err_name;
+static void
+block_lookup (char *name, char *err_name)
 {
-  struct symbol** syms;
-  struct block** blocks;
+  struct ada_symbol_info *syms;
   int nsyms;
   struct symtab *symtab;
   nsyms = ada_lookup_symbol_list (name, left_block_context,
-				  VAR_DOMAIN, &syms, &blocks);
+				  VAR_DOMAIN, &syms);
   if (left_block_context == NULL &&
-      (nsyms == 0 || SYMBOL_CLASS (syms[0]) != LOC_BLOCK))
+      (nsyms == 0 || SYMBOL_CLASS (syms[0].sym) != LOC_BLOCK))
     symtab = lookup_symtab (name);
   else
     symtab = NULL;
@@ -637,72 +606,85 @@
   if (symtab != NULL)
     left_block_context = yylval.bval =
       BLOCKVECTOR_BLOCK (BLOCKVECTOR (symtab), STATIC_BLOCK);
-  else if (nsyms == 0 || SYMBOL_CLASS (syms[0]) != LOC_BLOCK)
+  else if (nsyms == 0 || SYMBOL_CLASS (syms[0].sym) != LOC_BLOCK)
     {
       if (left_block_context == NULL)
 	error ("No file or function \"%s\".", err_name);
       else
 	error ("No function \"%s\" in specified context.", err_name);
     }
-  else 
+  else
     {
-      left_block_context = yylval.bval = SYMBOL_BLOCK_VALUE (syms[0]); 
+      left_block_context = yylval.bval = SYMBOL_BLOCK_VALUE (syms[0].sym);
       if (nsyms > 1)
 	warning ("Function name \"%s\" ambiguous here", err_name);
     }
 }
 
-/* Look up NAME0 (assumed to be mangled) as a name in VAR_DOMAIN,
+/* Look up NAME0 (assumed to be encoded) as a name in VAR_DOMAIN,
    setting *TOKEN_TYPE to NAME or TYPENAME, depending on what is
-   found.  Try first the entire name, then the name without the last 
+   found.  Try first the entire name, then the name without the last
    segment (i.e., after the last .id), etc., and return the number of
-   segments that had to be removed to get a match.  Calls error if no
+   segments that had to be removed to get a match.  Try only the full
+   name if it starts with "standard__".  Calls error if no
    matches are found, using ERR_NAME in any error message.  When
-   exactly one symbol match is found, it is placed in yylval. */
- 
+   exactly one symbol match is found, it is placed in yylval.  When
+   the symbol is a renaming, follow at most DEPTH steps to find the  
+   ultimate definition; cause error if depth exceeded.  */
+
 static int
-name_lookup (name0, err_name, token_type)
-     char* name0;
-     char* err_name;
-     int* token_type;
+name_lookup (char *name0, char *err_name, int *token_type, int depth)
 {
-  struct symbol** syms;
-  struct block** blocks;
-  struct type* type;
+  struct ada_symbol_info *syms;
+  struct type *type;
   int len0 = strlen (name0);
-  char* name = savestring (name0, len0);
+  char *name = obsavestring (name0, len0, &temp_parse_space);
   int nsyms;
   int segments;
- 
-/*  add_name_string_cleanup (name);*/
-/* FIXME: add_name_string_cleanup should be defined in parse.c */
+
+  if (depth <= 0)
+    error ("Could not find renamed symbol \"%s\"", err_name);
+
   yylval.ssym.stoken.ptr = name;
   yylval.ssym.stoken.length = strlen (name);
   for (segments = 0; ; segments += 1)
     {
-      struct type* preferred_type;
+      struct type *preferred_type;
       int i, preferred_index;
 
-      if (left_block_context == NULL) 
-	nsyms = ada_lookup_symbol_list (name, expression_context_block, 
-					VAR_DOMAIN, &syms, &blocks);
+      if (left_block_context == NULL)
+	nsyms = ada_lookup_symbol_list (name, expression_context_block,
+					VAR_DOMAIN, &syms);
       else
-	nsyms = ada_lookup_symbol_list (name, left_block_context, 
-					VAR_DOMAIN, &syms, &blocks);
+	nsyms = ada_lookup_symbol_list (name, left_block_context,
+					VAR_DOMAIN, &syms);
 
-      /* Check for a type definition. */
+
+      /* Check for a type renaming.  */
+
+      if (nsyms == 1 && !ada_is_object_renaming (syms[0].sym))
+        {
+          struct symbol *renaming_sym =
+            ada_find_renaming_symbol (SYMBOL_LINKAGE_NAME (syms[0].sym), 
+				      syms[0].block);
+
+          if (renaming_sym != NULL)
+            syms[0].sym = renaming_sym;
+        }
+
+      /* Check for a type definition.  */
 
       /* Look for a symbol that doesn't denote void.  This is (I think) a */
-      /* temporary kludge to get around problems in GNAT output. */
+      /* temporary kludge to get around problems in GNAT output.  */
       preferred_index = -1; preferred_type = NULL;
       for (i = 0; i < nsyms; i += 1)
-	switch (SYMBOL_CLASS (syms[i])) 
+	switch (SYMBOL_CLASS (syms[i].sym))
 	  {
 	  case LOC_TYPEDEF:
-	    if (ada_prefer_type (SYMBOL_TYPE (syms[i]), preferred_type))
+	    if (ada_prefer_type (SYMBOL_TYPE (syms[i].sym), preferred_type))
 	      {
 		preferred_index = i;
-		preferred_type = SYMBOL_TYPE (syms[i]);
+		preferred_type = SYMBOL_TYPE (syms[i].sym);
 	      }
 	    break;
 	  case LOC_REGISTER:
@@ -714,37 +696,38 @@
 	  case LOC_LOCAL_ARG:
 	  case LOC_BASEREG:
 	  case LOC_BASEREG_ARG:
+          case LOC_COMPUTED:
+          case LOC_COMPUTED_ARG:
 	    goto NotType;
 	  default:
 	    break;
 	  }
       if (preferred_type != NULL)
 	{
-/*	  if (TYPE_CODE (preferred_type) == TYPE_CODE_VOID)
-	    error ("`%s' matches only void type name(s)", 
-		   ada_demangle (name));
-*/
-/* FIXME: ada_demangle should be defined in defs.h, and is located in ada-lang.c */
-/*	  else*/ if (ada_is_object_renaming (syms[preferred_index]))
+	  if (TYPE_CODE (preferred_type) == TYPE_CODE_VOID)
+	    error ("`%s' matches only void type name(s)",
+		   ada_decode (name));
+	  else if (ada_is_object_renaming (syms[preferred_index].sym))
 	    {
-	      yylval.ssym.sym = syms[preferred_index];
+	      yylval.ssym.sym = syms[preferred_index].sym;
 	      *token_type = OBJECT_RENAMING;
 	      return segments;
-	    } 
-	  else if (ada_renaming_type (SYMBOL_TYPE (syms[preferred_index])) 
+	    }
+	  else if (ada_renaming_type (SYMBOL_TYPE (syms[preferred_index].sym))
                    != NULL)
 	    {
 	      int result;
-	      const char* renaming = 
-		ada_simple_renamed_entity (syms[preferred_index]);
-	      char* new_name = xmalloc (strlen (renaming) + len0 
-					- yylval.ssym.stoken.length + 1);
-/*	      add_name_string_cleanup (new_name);*/
-/* FIXME: add_name_string_cleanup should be defined in parse.c */
+	      char *renaming
+		= ada_simple_renamed_entity (syms[preferred_index].sym);
+	      char *new_name
+                = (char *) obstack_alloc (&temp_parse_space,
+                                          strlen (renaming) + len0
+				          - yylval.ssym.stoken.length + 1);
 	      strcpy (new_name, renaming);
+              xfree (renaming);
 	      strcat (new_name, name0 + yylval.ssym.stoken.length);
-	      result = name_lookup (new_name, err_name, token_type);
-	      if (result > segments) 
+	      result = name_lookup (new_name, err_name, token_type, depth - 1);
+	      if (result > segments)
 		error ("Confused by renamed symbol.");
 	      return result;
 	    }
@@ -753,16 +736,29 @@
 	      yylval.tval = preferred_type;
 	      *token_type = TYPENAME;
 	      return 0;
-	    } 
+	    }
 	}
 
       if (segments == 0)
 	{
 	  type = lookup_primitive_typename (name);
-	  if (type == NULL && DEPRECATED_STREQ ("system__address", name))
+	  if (type == NULL && strcmp ("system__address", name) == 0)
 	    type = builtin_type_ada_system_address;
 	  if (type != NULL)
 	    {
+	      /* First check to see if we have a regular definition of this
+		 type that just didn't happen to have been read yet.  */
+	      int ntypes;
+	      struct symbol *sym;
+	      char *expanded_name = 
+		(char *) alloca (strlen (name) + sizeof ("standard__"));
+	      strcpy (expanded_name, "standard__");
+	      strcat (expanded_name, name);
+	      sym = ada_lookup_symbol (expanded_name, NULL,
+				       VAR_DOMAIN, NULL, NULL);
+	      if (sym != NULL && SYMBOL_CLASS (sym) == LOC_TYPEDEF)
+		type = SYMBOL_TYPE (sym);
+					  
 	      yylval.tval = type;
 	      *token_type = TYPENAME;
 	      return 0;
@@ -770,17 +766,17 @@
 	}
 
     NotType:
-      if (nsyms == 1) 
+      if (nsyms == 1)
 	{
 	  *token_type = NAME;
-	  yylval.ssym.sym = syms[0];
+	  yylval.ssym.sym = syms[0].sym;
 	  yylval.ssym.msym = NULL;
-	  yylval.ssym.block = blocks[0];
+	  yylval.ssym.block = syms[0].block;
 	  return segments;
 	}
       else if (nsyms == 0) {
 	int i;
-	yylval.ssym.msym = ada_lookup_minimal_symbol (name);
+	yylval.ssym.msym = ada_lookup_simple_minsym (name);
 	if (yylval.ssym.msym != NULL)
 	  {
 	    yylval.ssym.sym = NULL;
@@ -789,10 +785,14 @@
 	    return segments;
 	  }
 
+	if (segments == 0 
+	    && strncmp (name, "standard__", sizeof ("standard__") - 1) == 0)
+	  error ("No definition of \"%s\" found.", err_name);
+
 	for (i = yylval.ssym.stoken.length - 1; i > 0; i -= 1)
 	  {
             if (name[i] == '.')
-	      { 
+	      {
 		name[i] = '\0';
 		yylval.ssym.stoken.length = i;
 		break;
@@ -805,20 +805,20 @@
 		break;
 	      }
 	  }
-	if (i <= 0) 
+	if (i <= 0)
 	  {
 	    if (!have_full_symbols () && !have_partial_symbols ()
 		&& left_block_context == NULL)
 	      error ("No symbol table is loaded.  Use the \"file\" command.");
 	    if (left_block_context == NULL)
-	      error ("No definition of \"%s\" in current context.", 
+	      error ("No definition of \"%s\" in current context.",
 		     err_name);
 	    else
-	      error ("No definition of \"%s\" in specified context.", 
+	      error ("No definition of \"%s\" in specified context.",
 		     err_name);
 	  }
       }
-      else 
+      else
 	{
 	  *token_type = NAME;
 	  yylval.ssym.sym = NULL;
@@ -833,10 +833,9 @@
 }
 
 /* Returns the position within STR of the '.' in a
-   '.{WHITE}*all' component of a dotted name, or -1 if there is none. */
+   '.{WHITE}*all' component of a dotted name, or -1 if there is none.  */
 static int
-find_dot_all (str)
-     const char* str;
+find_dot_all (const char *str)
 {
   int i;
   for (i = 0; str[i] != '\000'; i += 1)
@@ -844,7 +843,7 @@
       if (str[i] == '.')
 	{
 	  int i0 = i;
-	  do 
+	  do
 	    i += 1;
 	  while (isspace (str[i]));
 	  if (strcmp (str+i, "all") == 0
@@ -853,15 +852,13 @@
 	}
     }
   return -1;
-}    
+}
 
 /* Returns non-zero iff string SUBSEQ matches a subsequence of STR, ignoring
-   case. */
+   case.  */
 
 static int
-subseqMatch (subseq, str)
-     const char* subseq;
-     const char* str;
+subseqMatch (const char *subseq, const char *str)
 {
   if (subseq[0] == '\0')
     return 1;
@@ -872,9 +869,9 @@
   else
     return subseqMatch (subseq, str+1);
 }
-  
 
-static struct { const char* name; int code; } 
+
+static struct { const char *name; int code; }
 attributes[] = {
   { "address", TICK_ADDRESS },
   { "unchecked_access", TICK_ACCESS },
@@ -898,8 +895,7 @@
    abbreviation STR.  */
 
 static int
-processAttribute (str)
-     const char* str;
+processAttribute (const char *str)
 {
   int i, k;
 
@@ -908,11 +904,11 @@
       return attributes[i].code;
 
   for (i = 0, k = -1; attributes[i].code != -1; i += 1)
-    if (subseqMatch (str, attributes[i].name)) 
+    if (subseqMatch (str, attributes[i].name))
       {
 	if (k == -1)
 	  k = i;
-	else 
+	else
 	  error ("ambiguous attribute name: `%s'", str);
       }
   if (k == -1)
@@ -922,7 +918,7 @@
 }
 
 int
-yywrap()
+yywrap(void)
 {
   return 1;
 }
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
deleted file mode 100644
index 0cf4d83..0000000
--- a/gdb/ada-tasks.c
+++ /dev/null
@@ -1,819 +0,0 @@
-/* file ada-tasks.c: Ada tasking control for GDB
-   Copyright 1997 Free Software Foundation, Inc.
-   Contributed by Ada Core Technologies, Inc
-.
-   This file is part of GDB.
-
-   [$Id$]
-   Authors: Roch-Alexandre Nomine Beguin, Arnaud Charlet <charlet@gnat.com>
-
-   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.
-
-*/
-
-#include <ctype.h>
-#include "defs.h"
-#include "command.h"
-#include "value.h"
-#include "language.h"
-#include "inferior.h"
-#include "symtab.h"
-#include "target.h"
-#include "regcache.h"
-#include "gdbcore.h"
-
-#if (defined(__alpha__) && defined(__osf__) && !defined(__alpha_vxworks))
-#include <sys/procfs.h>
-#endif
-
-#if (defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET))
-#include "gregset.h"
-#endif
-
-#include "ada-lang.h"
-
-/* FIXME: move all this conditional compilation in description
-   files or in configure.in */
-
-#if defined (VXWORKS_TARGET)
-#define THREAD_TO_PID(tid,lwpid) (tid)
-
-#elif defined (linux)
-#define THREAD_TO_PID(tid,lwpid) (0)
-
-#elif (defined (sun) && defined (__SVR4))
-#define THREAD_TO_PID thread_to_pid
-
-#elif defined (sgi) || defined (__WIN32__) || defined (hpux)
-#define THREAD_TO_PID(tid,lwpid) ((int)lwpid)
-
-#else
-#define THREAD_TO_PID(tid,lwpid) (0)
-#endif
-
-#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
-#define THREAD_FETCH_REGISTERS dec_thread_fetch_registers
-#define GET_CURRENT_THREAD dec_thread_get_current_thread
-extern int dec_thread_get_registers (gdb_gregset_t *, gdb_fpregset_t *);
-#endif
-
-#if defined (_AIX)
-#define THREAD_FETCH_REGISTERS aix_thread_fetch_registers
-#define GET_CURRENT_THREAD aix_thread_get_current_thread
-#endif
-
-#if defined(VXWORKS_TARGET)
-#define GET_CURRENT_THREAD() ((void*)inferior_pid)
-#define THREAD_FETCH_REGISTERS() (-1)
-
-#elif defined (sun) && defined (__SVR4)
-#define GET_CURRENT_THREAD solaris_thread_get_current_thread
-#define THREAD_FETCH_REGISTERS() (-1)
-extern void *GET_CURRENT_THREAD ();
-
-#elif defined (_AIX) || (defined(__alpha__) && defined(__osf__))
-extern void *GET_CURRENT_THREAD ();
-
-#elif defined (__WIN32__) || defined (hpux)
-#define GET_CURRENT_THREAD() (inferior_pid)
-#define THREAD_FETCH_REGISTERS() (-1)
-
-#else
-#define GET_CURRENT_THREAD() (NULL)
-#define THREAD_FETCH_REGISTERS() (-1)
-#endif
-
-#define KNOWN_TASKS_NAME "system__tasking__debug__known_tasks"
-
-#define READ_MEMORY(addr, var) read_memory (addr, (char*) &var, sizeof (var))
-/* external declarations */
-
-/* Global visible variables */
-
-struct task_entry *task_list = NULL;
-int ada__tasks_check_symbol_table = 1;
-void *pthread_kern_addr = NULL;
-
-#if (defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET))
-gdb_gregset_t gregset_saved;
-gdb_fpregset_t fpregset_saved;
-#endif
-
-/* The maximum number of tasks known to the Ada runtime */
-const int MAX_NUMBER_OF_KNOWN_TASKS = 1000;
-
-/* the current task */
-int current_task = -1, current_task_id = -1, current_task_index;
-void *current_thread, *current_lwp;
-
-char *ada_task_states[] = {
-  "Unactivated",
-  "Runnable",
-  "Terminated",
-  "Child Activation Wait",
-  "Accept Statement",
-  "Waiting on entry call",
-  "Async Select Wait",
-  "Delay Sleep",
-  "Child Termination Wait",
-  "Wait Child in Term Alt",
-  "",
-  "",
-  "",
-  "",
-  "Asynchronous Hold"
-};
-
-/* Global internal types */
-
-static char *ada_long_task_states[] = {
-  "Unactivated",
-  "Runnable",
-  "Terminated",
-  "Waiting for child activation",
-  "Blocked in accept statement",
-  "Waiting on entry call",
-  "Asynchronous Selective Wait",
-  "Delay Sleep",
-  "Waiting for children termination",
-  "Waiting for children in terminate alternative",
-  "",
-  "",
-  "",
-  "",
-  "Asynchronous Hold"
-};
-
-/* Global internal variables */
-
-static int highest_task_num = 0;
-int thread_support = 0;		/* 1 if the thread library in use is supported */
-static int gdbtk_task_initialization = 0;
-
-static int
-add_task_entry (void *p_task_id, int index)
-{
-  struct task_entry *new_task_entry = NULL;
-  struct task_entry *pt;
-
-  highest_task_num++;
-  new_task_entry = xmalloc (sizeof (struct task_entry));
-  new_task_entry->task_num = highest_task_num;
-  new_task_entry->task_id = p_task_id;
-  new_task_entry->known_tasks_index = index;
-  new_task_entry->next_task = NULL;
-  pt = task_list;
-  if (pt)
-    {
-      while (pt->next_task)
-	pt = pt->next_task;
-      pt->next_task = new_task_entry;
-      pt->stack_per = 0;
-    }
-  else
-    task_list = new_task_entry;
-  return new_task_entry->task_num;
-}
-
-int
-get_entry_number (void *p_task_id)
-{
-  struct task_entry *pt;
-
-  pt = task_list;
-  while (pt != NULL)
-    {
-      if (pt->task_id == p_task_id)
-	return pt->task_num;
-      pt = pt->next_task;
-    }
-  return 0;
-}
-
-static struct task_entry *
-get_thread_entry_vptr (void *thread)
-{
-  struct task_entry *pt;
-
-  pt = task_list;
-  while (pt != NULL)
-    {
-      if (pt->thread == thread)
-	return pt;
-      pt = pt->next_task;
-    }
-  return 0;
-}
-
-static struct task_entry *
-get_entry_vptr (int p_task_num)
-{
-  struct task_entry *pt;
-
-  pt = task_list;
-  while (pt)
-    {
-      if (pt->task_num == p_task_num)
-	return pt;
-      pt = pt->next_task;
-    }
-  return NULL;
-}
-
-void
-init_task_list (void)
-{
-  struct task_entry *pt, *old_pt;
-
-  pt = task_list;
-  while (pt)
-    {
-      old_pt = pt;
-      pt = pt->next_task;
-      xfree (old_pt);
-    };
-  task_list = NULL;
-  highest_task_num = 0;
-}
-
-int
-valid_task_id (int task)
-{
-  return get_entry_vptr (task) != NULL;
-}
-
-void *
-get_self_id (void)
-{
-  struct value *val;
-  void *self_id;
-  int result;
-  struct task_entry *ent;
-  extern int do_not_insert_breakpoints;
-
-#if !((defined(sun) && defined(__SVR4)) || defined(VXWORKS_TARGET) || defined(__WIN32__))
-  if (thread_support)
-#endif
-    {
-      ent = get_thread_entry_vptr (GET_CURRENT_THREAD ());
-      return ent ? ent->task_id : 0;
-    }
-
-  /* FIXME: calling a function in the inferior with a multithreaded application
-     is not reliable, so return NULL if there is no safe way to get the current
-     task */
-  return NULL;
-}
-
-int
-get_current_task (void)
-{
-  int result;
-
-  /* FIXME: language_ada should be defined in defs.h */
-  /*  if (current_language->la_language != language_ada) return -1; */
-
-  result = get_entry_number (get_self_id ());
-
-  /* return -1 if not found */
-  return result == 0 ? -1 : result;
-}
-
-/* Print detailed information about specified task */
-
-static void
-info_task (char *arg, int from_tty)
-{
-  void *temp_task;
-  struct task_entry *pt, *pt2;
-  void *self_id, *caller;
-  struct task_fields atcb, atcb2;
-  struct entry_call call;
-  int bounds[2];
-  char image[256];
-  int num;
-
-  /* FIXME: language_ada should be defined in defs.h */
-  /*  if (current_language->la_language != language_ada) 
-     { 
-     printf_filtered ("The current language does not support tasks.\n"); 
-     return; 
-     } 
-   */
-  pt = get_entry_vptr (atoi (arg));
-  if (pt == NULL)
-    {
-      printf_filtered ("Task %s not found.\n", arg);
-      return;
-    }
-
-  temp_task = pt->task_id;
-
-  /* read the atcb in the inferior */
-  READ_MEMORY ((CORE_ADDR) temp_task, atcb);
-
-  /* print the Ada task id */
-  printf_filtered ("Ada Task: %p\n", temp_task);
-
-  /* print the name of the task */
-  if (atcb.image.P_ARRAY != NULL)
-    {
-      READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS), bounds);
-      bounds[1] = EXTRACT_INT (bounds[1]);
-      read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY),
-		   (char *) &image, bounds[1]);
-      printf_filtered ("Name: %.*s\n", bounds[1], image);
-    }
-  else
-    printf_filtered ("<no name>\n");
-
-  /* print the thread id */
-
-  if ((long) pt->thread < 65536)
-    printf_filtered ("Thread: %ld\n", (long int) pt->thread);
-  else
-    printf_filtered ("Thread: %p\n", pt->thread);
-
-  if ((long) pt->lwp != 0)
-    {
-      if ((long) pt->lwp < 65536)
-	printf_filtered ("LWP: %ld\n", (long int) pt->lwp);
-      else
-	printf_filtered ("LWP: %p\n", pt->lwp);
-    }
-
-  /* print the parent gdb task id */
-  num = get_entry_number (EXTRACT_ADDRESS (atcb.parent));
-  if (num != 0)
-    {
-      printf_filtered ("Parent: %d", num);
-      pt2 = get_entry_vptr (num);
-      READ_MEMORY ((CORE_ADDR) pt2->task_id, atcb2);
-
-      /* print the name of the task */
-      if (atcb2.image.P_ARRAY != NULL)
-	{
-	  READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS),
-		       bounds);
-	  bounds[1] = EXTRACT_INT (bounds[1]);
-	  read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY),
-		       (char *) &image, bounds[1]);
-	  printf_filtered (" (%.*s)\n", bounds[1], image);
-	}
-      else
-	printf_filtered ("\n");
-    }
-  else
-    printf_filtered ("No parent\n");
-
-  /* print the base priority of the task */
-  printf_filtered ("Base Priority: %d\n", EXTRACT_INT (atcb.priority));
-
-  /* print the current state of the task */
-
-  /* check if this task is accepting a rendezvous */
-  if (atcb.call == NULL)
-    caller = NULL;
-  else
-    {
-      READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call);
-      caller = EXTRACT_ADDRESS (call.self);
-    }
-
-  if (caller != NULL)
-    {
-      num = get_entry_number (caller);
-      printf_filtered ("Accepting rendezvous with %d", num);
-
-      if (num != 0)
-	{
-	  pt2 = get_entry_vptr (num);
-	  READ_MEMORY ((CORE_ADDR) pt2->task_id, atcb2);
-
-	  /* print the name of the task */
-	  if (atcb2.image.P_ARRAY != NULL)
-	    {
-	      READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_BOUNDS),
-			   bounds);
-	      bounds[1] = EXTRACT_INT (bounds[1]);
-	      read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb2.image.P_ARRAY),
-			   (char *) &image, bounds[1]);
-	      printf_filtered (" (%.*s)\n", bounds[1], image);
-	    }
-	  else
-	    printf_filtered ("\n");
-	}
-      else
-	printf_filtered ("\n");
-    }
-  else
-    printf_filtered ("State: %s\n", ada_long_task_states[atcb.state]);
-}
-
-#if 0
-
-/* A useful function that shows the alignment of all the fields in the
-   tasks_fields structure
- */
-
-print_align (void)
-{
-  struct task_fields tf;
-  void *tf_base = &(tf);
-  void *tf_state = &(tf.state);
-  void *tf_entry_num = &(tf.entry_num);
-  void *tf_parent = &(tf.parent);
-  void *tf_priority = &(tf.priority);
-  void *tf_current_priority = &(tf.current_priority);
-  void *tf_image = &(tf.image);
-  void *tf_call = &(tf.call);
-  void *tf_thread = &(tf.thread);
-  void *tf_lwp = &(tf.lwp);
-  printf_filtered ("\n");
-  printf_filtered ("(tf_base = 0x%x)\n", tf_base);
-  printf_filtered ("task_fields.entry_num        at %3d (0x%x)\n",
-		   tf_entry_num - tf_base, tf_entry_num);
-  printf_filtered ("task_fields.state            at %3d (0x%x)\n",
-		   tf_state - tf_base, tf_state);
-  printf_filtered ("task_fields.parent           at %3d (0x%x)\n",
-		   tf_parent - tf_base, tf_parent);
-  printf_filtered ("task_fields.priority         at %3d (0x%x)\n",
-		   tf_priority - tf_base, tf_priority);
-  printf_filtered ("task_fields.current_priority at %3d (0x%x)\n",
-		   tf_current_priority - tf_base, tf_current_priority);
-  printf_filtered ("task_fields.image            at %3d (0x%x)\n",
-		   tf_image - tf_base, tf_image);
-  printf_filtered ("task_fields.call             at %3d (0x%x)\n",
-		   tf_call - tf_base, tf_call);
-  printf_filtered ("task_fields.thread           at %3d (0x%x)\n",
-		   tf_thread - tf_base, tf_thread);
-  printf_filtered ("task_fields.lwp              at %3d (0x%x)\n",
-		   tf_lwp - tf_base, tf_lwp);
-  printf_filtered ("\n");
-}
-#endif
-
-/* Print information about currently known tasks */
-
-static void
-info_tasks (char *arg, int from_tty)
-{
-  struct value *val;
-  int i, task_number, state;
-  void *temp_task, *temp_tasks[MAX_NUMBER_OF_KNOWN_TASKS];
-  struct task_entry *pt;
-  void *self_id, *caller, *thread_id = NULL;
-  struct task_fields atcb;
-  struct entry_call call;
-  int bounds[2];
-  char image[256];
-  int size;
-  char car;
-
-#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
-  pthreadTeb_t thr;
-  gdb_gregset_t regs;
-#endif
-
-  static struct symbol *sym;
-  static struct minimal_symbol *msym;
-  static void *known_tasks_addr = NULL;
-
-  int init_only = gdbtk_task_initialization;
-  gdbtk_task_initialization = 0;
-
-  task_number = 0;
-
-  if (PIDGET (inferior_ptid) == 0)
-    {
-      printf_filtered ("The program is not being run under gdb. ");
-      printf_filtered ("Use 'run' or 'attach' first.\n");
-      return;
-    }
-
-  if (ada__tasks_check_symbol_table)
-    {
-      thread_support = 0;
-#if (defined(__alpha__) && defined(__osf__) & !defined(VXWORKS_TARGET)) || \
-    defined (_AIX)
-      thread_support = 1;
-#endif
-
-      msym = lookup_minimal_symbol (KNOWN_TASKS_NAME, NULL, NULL);
-      if (msym != NULL)
-	known_tasks_addr = (void *) SYMBOL_VALUE_ADDRESS (msym);
-      else
-#ifndef VXWORKS_TARGET
-	return;
-#else
-	{
-	  if (target_lookup_symbol (KNOWN_TASKS_NAME, &known_tasks_addr) != 0)
-	    return;
-	}
-#endif
-
-      ada__tasks_check_symbol_table = 0;
-    }
-
-  if (known_tasks_addr == NULL)
-    return;
-
-#if !((defined(sun) && defined(__SVR4)) || defined(VXWORKS_TARGET) || defined(__WIN32__) || defined (hpux))
-  if (thread_support)
-#endif
-    thread_id = GET_CURRENT_THREAD ();
-
-  /* then we get a list of tasks created */
-
-  init_task_list ();
-
-  READ_MEMORY ((CORE_ADDR) known_tasks_addr, temp_tasks);
-
-  for (i = 0; i < MAX_NUMBER_OF_KNOWN_TASKS; i++)
-    {
-      temp_task = EXTRACT_ADDRESS (temp_tasks[i]);
-
-      if (temp_task != NULL)
-	{
-	  task_number = get_entry_number (temp_task);
-	  if (task_number == 0)
-	    task_number = add_task_entry (temp_task, i);
-	}
-    }
-
-  /* Return without printing anything if this function was called in
-     order to init GDBTK tasking. */
-
-  if (init_only)
-    return;
-
-  /* print the header */
-
-#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
-  printf_filtered
-    ("  ID       TID P-ID Pri Stack  %% State                  Name\n");
-#else
-  printf_filtered ("  ID       TID P-ID Pri State                  Name\n");
-#endif
-
-  /* Now that we have a list of task id's, we can print them */
-  pt = task_list;
-  while (pt)
-    {
-      temp_task = pt->task_id;
-
-      /* read the atcb in the inferior */
-      READ_MEMORY ((CORE_ADDR) temp_task, atcb);
-
-      /* store the thread id for future use */
-      pt->thread = EXTRACT_ADDRESS (atcb.thread);
-
-#if defined (linux)
-      pt->lwp = (void *) THREAD_TO_PID (atcb.thread, 0);
-#else
-      pt->lwp = EXTRACT_ADDRESS (atcb.lwp);
-#endif
-
-      /* print a star if this task is the current one */
-      if (thread_id)
-#if defined (__WIN32__) || defined (SGI) || defined (hpux)
-	printf_filtered (pt->lwp == thread_id ? "*" : " ");
-#else
-	printf_filtered (pt->thread == thread_id ? "*" : " ");
-#endif
-
-      /* print the gdb task id */
-      printf_filtered ("%3d", pt->task_num);
-
-      /* print the Ada task id */
-#ifndef VXWORKS_TARGET
-      printf_filtered (" %9lx", (long) temp_task);
-#else
-#ifdef TARGET_64
-      printf_filtered (" %#9lx", (unsigned long) pt->thread & 0x3ffffffffff);
-#else
-      printf_filtered (" %#9lx", (long) pt->thread);
-#endif
-#endif
-
-      /* print the parent gdb task id */
-      printf_filtered
-	(" %4d", get_entry_number (EXTRACT_ADDRESS (atcb.parent)));
-
-      /* print the base priority of the task */
-      printf_filtered (" %3d", EXTRACT_INT (atcb.priority));
-
-#if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
-      if (pt->task_num == 1 || atcb.state == Terminated)
-	{
-	  printf_filtered ("  Unknown");
-	  goto next;
-	}
-
-      read_memory ((CORE_ADDR) atcb.thread, &thr, sizeof (thr));
-      current_thread = atcb.thread;
-      regs.regs[SP_REGNUM] = 0;
-      if (dec_thread_get_registers (&regs, NULL) == 0)
-	{
-	  pt->stack_per = (100 * ((long) thr.__stack_base -
-				  regs.regs[SP_REGNUM])) / thr.__stack_size;
-	  /* if the thread is terminated but still there, the
-	     stack_base/size values are erroneous. Try to patch it */
-	  if (pt->stack_per < 0 || pt->stack_per > 100)
-	    pt->stack_per = 0;
-	}
-
-      /* print information about stack space used in the thread */
-      if (thr.__stack_size < 1024 * 1024)
-	{
-	  size = thr.__stack_size / 1024;
-	  car = 'K';
-	}
-      else if (thr.__stack_size < 1024 * 1024 * 1024)
-	{
-	  size = thr.__stack_size / 1024 / 1024;
-	  car = 'M';
-	}
-      else			/* Who knows... */
-	{
-	  size = thr.__stack_size / 1024 / 1024 / 1024;
-	  car = 'G';
-	}
-      printf_filtered (" %4d%c %2d", size, car, pt->stack_per);
-    next:
-#endif
-
-      /* print the current state of the task */
-
-      /* check if this task is accepting a rendezvous */
-      if (atcb.call == NULL)
-	caller = NULL;
-      else
-	{
-	  READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.call), call);
-	  caller = EXTRACT_ADDRESS (call.self);
-	}
-
-      if (caller != NULL)
-	printf_filtered (" Accepting RV with %-4d",
-			 get_entry_number (caller));
-      else
-	{
-	  state = atcb.state;
-#if defined (__WIN32__) || defined (SGI) || defined (hpux)
-	  if (state == Runnable && (thread_id && pt->lwp == thread_id))
-#else
-	  if (state == Runnable && (thread_id && pt->thread == thread_id))
-#endif
-	    /* Replace "Runnable" by "Running" if this is the current task */
-	    printf_filtered (" %-22s", "Running");
-	  else
-	    printf_filtered (" %-22s", ada_task_states[state]);
-	}
-
-      /* finally, print the name of the task */
-      if (atcb.image.P_ARRAY != NULL)
-	{
-	  READ_MEMORY ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_BOUNDS),
-		       bounds);
-	  bounds[1] = EXTRACT_INT (bounds[1]);
-	  read_memory ((CORE_ADDR) EXTRACT_ADDRESS (atcb.image.P_ARRAY),
-		       (char *) &image, bounds[1]);
-	  printf_filtered (" %.*s\n", bounds[1], image);
-	}
-      else
-	printf_filtered (" <no name>\n");
-
-      pt = pt->next_task;
-    }
-}
-
-/* Task list initialization for GDB-Tk.  We basically use info_tasks()
-   to initialize our variables, but abort that function before we
-   actually print anything. */
-
-int
-gdbtk_tcl_tasks_initialize (void)
-{
-  gdbtk_task_initialization = 1;
-  info_tasks ("", gdb_stdout);
-
-  return (task_list != NULL);
-}
-
-static void
-info_tasks_command (char *arg, int from_tty)
-{
-  if (arg == NULL || *arg == '\000')
-    info_tasks (arg, from_tty);
-  else
-    info_task (arg, from_tty);
-}
-
-/* Switch from one thread to another. */
-
-static void
-switch_to_thread (ptid_t ptid)
-{
-  if (ptid_equal (ptid, inferior_ptid))
-    return;
-
-  inferior_ptid = ptid;
-  flush_cached_frames ();
-  registers_changed ();
-  stop_pc = read_pc ();
-  select_frame (get_current_frame ());
-}
-
-/* Switch to a specified task. */
-
-static int
-task_switch (void *tid, void *lwpid)
-{
-  int res = 0, pid;
-
-  if (thread_support)
-    {
-      flush_cached_frames ();
-
-      if (current_task != current_task_id)
-	{
-	  res = THREAD_FETCH_REGISTERS ();
-	}
-      else
-	{
-#if (defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET))
-	  supply_gregset (&gregset_saved);
-	  supply_fpregset (&fpregset_saved);
-#endif
-	}
-
-      if (res == 0)
-	stop_pc = read_pc ();
-      select_frame (get_current_frame ());
-      return res;
-    }
-
-  return -1;
-}
-
-static void
-task_command (char *tidstr, int from_tty)
-{
-  int num;
-  struct task_entry *e;
-
-  if (!tidstr)
-    error ("Please specify a task ID.  Use the \"info tasks\" command to\n"
-	   "see the IDs of currently known tasks.");
-
-  num = atoi (tidstr);
-  e = get_entry_vptr (num);
-
-  if (e == NULL)
-    error ("Task ID %d not known.  Use the \"info tasks\" command to\n"
-	   "see the IDs of currently known tasks.", num);
-
-  if (current_task_id == -1)
-    {
-#if (defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET))
-      fill_gregset (&gregset_saved, -1);
-      fill_fpregset (&fpregset_saved, -1);
-#endif
-      current_task_id = get_current_task ();
-    }
-
-  current_task = num;
-  current_task_index = e->known_tasks_index;
-  current_thread = e->thread;
-  current_lwp = e->lwp;
-  if (task_switch (e->thread, e->lwp) == 0)
-    {
-      /* FIXME: find_printable_frame should be defined in frame.h, and
-         implemented in ada-lang.c */
-      /*      find_printable_frame (deprecated_selected_frame, frame_relative_level (deprecated_selected_frame)); */
-      printf_filtered ("[Switching to task %d]\n", num);
-      print_stack_frame (deprecated_selected_frame,
-			 frame_relative_level (deprecated_selected_frame), 1);
-    }
-  else
-    printf_filtered ("Unable to switch to task %d\n", num);
-}
-
-void
-_initialize_tasks (void)
-{
-  static struct cmd_list_element *task_cmd_list = NULL;
-  extern struct cmd_list_element *cmdlist;
-
-  add_info ("tasks", info_tasks_command,
-	    "Without argument: list all known Ada tasks, with status information.\n"
-	    "info tasks n: print detailed information of task n.\n");
-
-  add_prefix_cmd ("task", class_run, task_command,
-		  "Use this command to switch between tasks.\n\
- The new task ID must be currently known.", &task_cmd_list, "task ", 1, &cmdlist);
-}
diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c
index 1939354..fb9c690 100644
--- a/gdb/ada-typeprint.c
+++ b/gdb/ada-typeprint.c
@@ -1,6 +1,6 @@
 /* Support for printing Ada types for GDB, the GNU debugger.
-   Copyright 1986, 1988, 1989, 1991, 1997, 2003 Free Software
-   Foundation, Inc.
+   Copyright 1986, 1988, 1989, 1991, 1997, 1998, 1999, 2000, 
+   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -63,11 +63,11 @@
 static char *name_buffer;
 static int name_buffer_len;
 
-/* The (demangled) Ada name of TYPE. This value persists until the
-   next call. */
+/* The (decoded) Ada name of TYPE.  This value persists until the
+   next call.  */
 
 static char *
-demangled_type_name (struct type *type)
+decoded_type_name (struct type *type)
 {
   if (ada_type_name (type) == NULL)
     return NULL;
@@ -116,9 +116,9 @@
 }
 
 
-/* Print a description of a type in the format of a 
+/* Print a description of a type in the format of a
    typedef for the current language.
-   NEW is the new name for a type TYPE. */
+   NEW is the new name for a type TYPE.  */
 
 void
 ada_typedef_print (struct type *type, struct symbol *new,
@@ -130,7 +130,7 @@
   type_print (type, "", stream, 1);
 }
 
-/* Print range type TYPE on STREAM. */
+/* Print range type TYPE on STREAM.  */
 
 static void
 print_range (struct type *type, struct ui_file *stream)
@@ -155,9 +155,9 @@
 
   if (TYPE_NFIELDS (type) < 2)
     {
-      /* A range needs at least 2 bounds to be printed. If there are less
+      /* A range needs at least 2 bounds to be printed.  If there are less
          than 2, just print the type name instead of the range itself.
-         This check handles cases such as characters, for example. 
+         This check handles cases such as characters, for example.
 
          Note that if the name is not defined, then we don't print anything.
        */
@@ -180,7 +180,7 @@
 }
 
 /* Print the number or discriminant bound at BOUNDS+*N on STREAM, and
-   set *N past the bound and its delimiter, if any. */
+   set *N past the bound and its delimiter, if any.  */
 
 static void
 print_range_bound (struct type *type, char *bounds, int *n,
@@ -189,6 +189,19 @@
   LONGEST B;
   if (ada_scan_number (bounds, *n, &B, n))
     {
+      /* STABS decodes all range types which bounds are 0 .. -1 as
+         unsigned integers (ie. the type code is TYPE_CODE_INT, not
+         TYPE_CODE_RANGE).  Unfortunately, ada_print_scalar() relies
+         on the unsigned flag to determine whether the bound should
+         be printed as a signed or an unsigned value.  This causes
+         the upper bound of the 0 .. -1 range types to be printed as
+         a very large unsigned number instead of -1.
+         To workaround this stabs deficiency, we replace the TYPE by
+         builtin_type_long when we detect that the bound is negative,
+         and the type is a TYPE_CODE_INT.  The bound is negative when
+         'm' is the last character of the number scanned in BOUNDS.  */
+      if (bounds[*n - 1] == 'm' && TYPE_CODE (type) == TYPE_CODE_INT)
+	type = builtin_type_long;
       ada_print_scalar (type, B, stream);
       if (bounds[*n] == '_')
 	*n += 2;
@@ -213,7 +226,7 @@
 
 /* Assuming NAME[0 .. NAME_LEN-1] is the name of a range type, print
    the value (if found) of the bound indicated by SUFFIX ("___L" or
-   "___U") according to the ___XD conventions. */
+   "___U") according to the ___XD conventions.  */
 
 static void
 print_dynamic_range_bound (struct type *type, const char *name, int name_len,
@@ -228,21 +241,20 @@
   strncpy (name_buf, name, name_len);
   strcpy (name_buf + name_len, suffix);
 
-  B = get_int_var_value (name_buf, 0, &OK);
+  B = get_int_var_value (name_buf, &OK);
   if (OK)
     ada_print_scalar (type, B, stream);
   else
     fprintf_filtered (stream, "?");
 }
 
-/* Print the range type named NAME. */
+/* Print the range type named NAME.  */
 
 static void
 print_range_type_named (char *name, struct ui_file *stream)
 {
   struct type *raw_type = ada_find_any_type (name);
   struct type *base_type;
-  LONGEST low, high;
   char *subtype_info;
 
   if (raw_type == NULL)
@@ -269,24 +281,24 @@
 
       if (*subtype_info == 'L')
 	{
-	  print_range_bound (raw_type, bounds_str, &n, stream);
+	  print_range_bound (base_type, bounds_str, &n, stream);
 	  subtype_info += 1;
 	}
       else
-	print_dynamic_range_bound (raw_type, name, prefix_len, "___L",
+	print_dynamic_range_bound (base_type, name, prefix_len, "___L",
 				   stream);
 
       fprintf_filtered (stream, " .. ");
 
       if (*subtype_info == 'U')
-	print_range_bound (raw_type, bounds_str, &n, stream);
+	print_range_bound (base_type, bounds_str, &n, stream);
       else
-	print_dynamic_range_bound (raw_type, name, prefix_len, "___U",
+	print_dynamic_range_bound (base_type, name, prefix_len, "___U",
 				   stream);
     }
 }
 
-/* Print enumerated type TYPE on STREAM. */
+/* Print enumerated type TYPE on STREAM.  */
 
 static void
 print_enum_type (struct type *type, struct ui_file *stream)
@@ -315,7 +327,7 @@
   fprintf_filtered (stream, ")");
 }
 
-/* Print representation of Ada fixed-point type TYPE on STREAM. */
+/* Print representation of Ada fixed-point type TYPE on STREAM.  */
 
 static void
 print_fixed_point_type (struct type *type, struct ui_file *stream)
@@ -333,7 +345,7 @@
     }
 }
 
-/* Print representation of special VAX floating-point type TYPE on STREAM. */
+/* Print representation of special VAX floating-point type TYPE on STREAM.  */
 
 static void
 print_vax_floating_point_type (struct type *type, struct ui_file *stream)
@@ -342,10 +354,10 @@
 		    ada_vax_float_type_suffix (type));
 }
 
-/* Print simple (constrained) array type TYPE on STREAM.  LEVEL is the 
-   recursion (indentation) level, in case the element type itself has 
+/* Print simple (constrained) array type TYPE on STREAM.  LEVEL is the
+   recursion (indentation) level, in case the element type itself has
    nested structure, and SHOW is the number of levels of internal
-   structure to show (see ada_print_type). */
+   structure to show (see ada_print_type).  */
 
 static void
 print_array_type (struct type *type, struct ui_file *stream, int show,
@@ -364,7 +376,12 @@
     {
       if (ada_is_packed_array_type (type))
 	type = ada_coerce_to_simple_array_type (type);
-      if (ada_is_simple_array (type))
+      if (type == NULL)
+        {
+          fprintf_filtered (stream, "<undecipherable array type>");
+          return;
+        }
+      if (ada_is_simple_array_type (type))
 	{
 	  struct type *range_desc_type =
 	    ada_find_parallel_type (type, "___XA");
@@ -417,7 +434,7 @@
 }
 
 /* Print the choices encoded by field FIELD_NUM of variant-part TYPE on
-   STREAM, assuming the VAL_TYPE is the type of the values. */
+   STREAM, assuming the VAL_TYPE is the type of the values.  */
 
 static void
 print_choices (struct type *type, int field_num, struct ui_file *stream,
@@ -429,7 +446,7 @@
 
   have_output = 0;
 
-  /* Skip over leading 'V': NOTE soon to be obsolete. */
+  /* Skip over leading 'V': NOTE soon to be obsolete.  */
   if (name[0] == 'V')
     {
       if (!ada_scan_number (name, 1, NULL, &p))
@@ -486,14 +503,14 @@
 
 }
 
-/* Assuming that field FIELD_NUM of TYPE is a VARIANTS field whose 
-   discriminant is contained in OUTER_TYPE, print its variants on STREAM.  
+/* Assuming that field FIELD_NUM of TYPE is a VARIANTS field whose
+   discriminant is contained in OUTER_TYPE, print its variants on STREAM.
    LEVEL is the recursion
    (indentation) level, in case any of the fields themselves have
    nested structure, and SHOW is the number of levels of internal structure
-   to show (see ada_print_type). For this purpose, fields nested in a
+   to show (see ada_print_type).  For this purpose, fields nested in a
    variant part are taken to be at the same level as the fields
-   immediately outside the variant part. */
+   immediately outside the variant part.  */
 
 static void
 print_variant_clauses (struct type *type, int field_num,
@@ -501,7 +518,7 @@
 		       int show, int level)
 {
   int i;
-  struct type *var_type;
+  struct type *var_type, *par_type;
   struct type *discr_type;
 
   var_type = TYPE_FIELD_TYPE (type, field_num);
@@ -510,14 +527,14 @@
   if (TYPE_CODE (var_type) == TYPE_CODE_PTR)
     {
       var_type = TYPE_TARGET_TYPE (var_type);
-      if (TYPE_FLAGS (var_type) & TYPE_FLAG_STUB)
-	{
-	  var_type = ada_find_parallel_type (var_type, "___XVU");
-	  if (var_type == NULL)
-	    return;
-	}
+      if (var_type == NULL || TYPE_CODE (var_type) != TYPE_CODE_UNION)
+	return;
     }
 
+  par_type = ada_find_parallel_type (var_type, "___XVU");
+  if (par_type != NULL)
+    var_type = par_type;
+
   for (i = 0; i < TYPE_NFIELDS (var_type); i += 1)
     {
       fprintf_filtered (stream, "\n%*swhen ", level + 4, "");
@@ -529,13 +546,13 @@
     }
 }
 
-/* Assuming that field FIELD_NUM of TYPE is a variant part whose 
+/* Assuming that field FIELD_NUM of TYPE is a variant part whose
    discriminants are contained in OUTER_TYPE, print a description of it
-   on STREAM.  LEVEL is the recursion (indentation) level, in case any of 
-   the fields themselves have nested structure, and SHOW is the number of 
-   levels of internal structure to show (see ada_print_type). For this 
-   purpose, fields nested in a variant part are taken to be at the same 
-   level as the fields immediately outside the variant part. */
+   on STREAM.  LEVEL is the recursion (indentation) level, in case any of
+   the fields themselves have nested structure, and SHOW is the number of
+   levels of internal structure to show (see ada_print_type).  For this
+   purpose, fields nested in a variant part are taken to be at the same
+   level as the fields immediately outside the variant part.  */
 
 static void
 print_variant_part (struct type *type, int field_num, struct type *outer_type,
@@ -549,14 +566,14 @@
   fprintf_filtered (stream, "\n%*send case;", level + 4, "");
 }
 
-/* Print a description on STREAM of the fields in record type TYPE, whose 
-   discriminants are in OUTER_TYPE.  LEVEL is the recursion (indentation) 
-   level, in case any of the fields themselves have nested structure, 
-   and SHOW is the number of levels of internal structure to show 
-   (see ada_print_type).  Does not print parent type information of TYPE. 
-   Returns 0 if no fields printed, -1 for an incomplete type, else > 0. 
+/* Print a description on STREAM of the fields in record type TYPE, whose
+   discriminants are in OUTER_TYPE.  LEVEL is the recursion (indentation)
+   level, in case any of the fields themselves have nested structure,
+   and SHOW is the number of levels of internal structure to show
+   (see ada_print_type).  Does not print parent type information of TYPE.
+   Returns 0 if no fields printed, -1 for an incomplete type, else > 0.
    Prints each field beginning on a new line, but does not put a new line at
-   end. */
+   end.  */
 
 static int
 print_record_field_types (struct type *type, struct type *outer_type,
@@ -598,9 +615,9 @@
   return flds;
 }
 
-/* Print record type TYPE on STREAM.  LEVEL is the recursion (indentation) 
-   level, in case the element type itself has nested structure, and SHOW is 
-   the number of levels of internal structure to show (see ada_print_type). */
+/* Print record type TYPE on STREAM.  LEVEL is the recursion (indentation)
+   level, in case the element type itself has nested structure, and SHOW is
+   the number of levels of internal structure to show (see ada_print_type).  */
 
 static void
 print_record_type (struct type *type0, struct ui_file *stream, int show,
@@ -609,19 +626,15 @@
   struct type *parent_type;
   struct type *type;
 
-  type = type0;
-  if (TYPE_FLAGS (type) & TYPE_FLAG_STUB)
-    {
-      struct type *type1 = ada_find_parallel_type (type, "___XVE");
-      if (type1 != NULL)
-	type = type1;
-    }
+  type = ada_find_parallel_type (type0, "___XVE");
+  if (type == NULL)
+    type = type0;
 
   parent_type = ada_parent_type (type);
   if (ada_type_name (parent_type) != NULL)
     fprintf_filtered (stream, "new %s with ",
-		      demangled_type_name (parent_type));
-  else if (parent_type == NULL && ada_is_tagged_type (type))
+		      decoded_type_name (parent_type));
+  else if (parent_type == NULL && ada_is_tagged_type (type, 0))
     fprintf_filtered (stream, "tagged ");
 
   fprintf_filtered (stream, "record");
@@ -648,9 +661,9 @@
 }
 
 /* Print the unchecked union type TYPE in something resembling Ada
-   format on STREAM. LEVEL is the recursion (indentation) level
+   format on STREAM.  LEVEL is the recursion (indentation) level
    in case the element type itself has nested structure, and SHOW is the
-   number of levels of internal structure to show (see ada_print_type). */
+   number of levels of internal structure to show (see ada_print_type).  */
 static void
 print_unchecked_union_type (struct type *type, struct ui_file *stream,
 			    int show, int level)
@@ -685,7 +698,7 @@
 
 
 /* Print function or procedure type TYPE on STREAM.  Make it a header
-   for function or procedure NAME if NAME is not null. */
+   for function or procedure NAME if NAME is not null.  */
 
 static void
 print_func_type (struct type *type, struct ui_file *stream, char *name)
@@ -728,23 +741,21 @@
    Output goes to STREAM (via stdio).
    If VARSTRING is a non-empty string, print as an Ada variable/field
        declaration.
-   SHOW+1 is the maximum number of levels of internal type structure 
+   SHOW+1 is the maximum number of levels of internal type structure
       to show (this applies to record types, enumerated types, and
       array types).
    SHOW is the number of levels of internal type structure to show
-      when there is a type name for the SHOWth deepest level (0th is 
+      when there is a type name for the SHOWth deepest level (0th is
       outer level).
    When SHOW<0, no inner structure is shown.
-   LEVEL indicates level of recursion (for nested definitions). */
+   LEVEL indicates level of recursion (for nested definitions).  */
 
 void
 ada_print_type (struct type *type0, char *varstring, struct ui_file *stream,
 		int show, int level)
 {
-  enum type_code code;
-  int demangled_args;
   struct type *type = ada_completed_type (ada_get_base_type (type0));
-  char *type_name = demangled_type_name (type);
+  char *type_name = decoded_type_name (type);
   int is_var_decl = (varstring != NULL && varstring[0] != '\0');
 
   if (type == NULL)
@@ -834,7 +845,7 @@
 	  print_enum_type (type, stream);
 	break;
       case TYPE_CODE_STRUCT:
-	if (ada_is_array_descriptor (type))
+	if (ada_is_array_descriptor_type (type))
 	  print_array_type (type, stream, show, level);
 	else if (ada_is_bogus_array_descriptor (type))
 	  fprintf_filtered (stream,
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index f5f4118..3617d76 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -1,5 +1,6 @@
-/* Support for printing Ada values for GDB, the GNU debugger.  
-   Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1997, 2001
+/* Support for printing Ada values for GDB, the GNU debugger.
+   Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1997, 2001,
+   2002, 2003, 2004.
              Free Software Foundation, Inc.
 
 This file is part of GDB.
@@ -20,6 +21,7 @@
 
 #include <ctype.h>
 #include "defs.h"
+#include "gdb_string.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
@@ -32,7 +34,7 @@
 #include "c-lang.h"
 #include "infcall.h"
 
-/* Encapsulates arguments to ada_val_print. */
+/* Encapsulates arguments to ada_val_print.  */
 struct ada_val_print_args
 {
   struct type *type;
@@ -69,9 +71,10 @@
 static int ada_val_print_1 (struct type *, char *, int, CORE_ADDR,
 			    struct ui_file *, int, int, int,
 			    enum val_prettyprint);
+static void ada_print_floating (char *, struct type *, struct ui_file *);
 
 
-/* Make TYPE unsigned if its range of values includes no negatives. */
+/* Make TYPE unsigned if its range of values includes no negatives.  */
 static void
 adjust_type_signedness (struct type *type)
 {
@@ -80,10 +83,10 @@
     TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
 }
 
-/* Assuming TYPE is a simple array type, prints its lower bound on STREAM,
-   if non-standard (i.e., other than 1 for numbers, other than lower bound
-   of index type for enumerated type). Returns 1 if something printed, 
-   otherwise 0. */
+/* Assuming TYPE is a simple, non-empty array type, prints its lower bound 
+   on STREAM, if non-standard (i.e., other than 1 for numbers, other
+   than lower bound of index type for enumerated type).  Returns 1 
+   if something printed, otherwise 0.  */
 
 static int
 print_optional_low_bound (struct ui_file *stream, struct type *type)
@@ -99,6 +102,8 @@
   if (TYPE_CODE (index_type) == TYPE_CODE_RANGE)
     {
       low_bound = TYPE_LOW_BOUND (index_type);
+      if (low_bound > TYPE_HIGH_BOUND (index_type))
+	return 0;
       index_type = TYPE_TARGET_TYPE (index_type);
     }
   else
@@ -127,8 +132,8 @@
 /*  Version of val_print_array_elements for GNAT-style packed arrays.
     Prints elements of packed array of type TYPE at bit offset
     BITOFFSET from VALADDR on STREAM.  Formats according to FORMAT and
-    separates with commas. RECURSE is the recursion (nesting) level.
-    If PRETTY, uses "prettier" format. TYPE must have been decoded (as
+    separates with commas.  RECURSE is the recursion (nesting) level.
+    If PRETTY, uses "prettier" format.  TYPE must have been decoded (as
     by ada_coerce_to_simple_array).  */
 
 static void
@@ -142,11 +147,6 @@
   unsigned len;
   struct type *elttype;
   unsigned eltlen;
-  /* Position of the array element we are examining to see
-     whether it is repeated.  */
-  unsigned int rep1;
-  /* Number of repetitions we have detected so far.  */
-  unsigned int reps;
   unsigned long bitsize = TYPE_FIELD_BITSIZE (type, 0);
   struct value *mark = value_mark ();
 
@@ -252,7 +252,7 @@
 
 /* Print the character C on STREAM as part of the contents of a literal
    string whose delimiter is QUOTER.  TYPE_LEN is the length in bytes
-   (1 or 2) of the character. */
+   (1 or 2) of the character.  */
 
 void
 ada_emit_char (int c, struct ui_file *stream, int quoter, int type_len)
@@ -274,7 +274,7 @@
 }
 
 /* Character #I of STRING, given that TYPE_LEN is the size in bytes (1
-   or 2) of a character. */
+   or 2) of a character.  */
 
 static int
 char_at (char *string, int i, int type_len)
@@ -285,6 +285,71 @@
     return (int) extract_unsigned_integer (string + 2 * i, 2);
 }
 
+/* Wrapper around memcpy to make it legal argument to ui_file_put */
+static void
+ui_memcpy (void *dest, const char *buffer, long len)
+{
+  memcpy (dest, buffer, (size_t) len);
+  ((char *) dest)[len] = '\0';
+}
+
+/* Print a floating-point value of type TYPE, pointed to in GDB by
+   VALADDR, on STREAM.  Use Ada formatting conventions: there must be
+   a decimal point, and at least one digit before and after the
+   point.  We use GNAT format for NaNs and infinities.  */
+static void
+ada_print_floating (char *valaddr, struct type *type, struct ui_file *stream)
+{
+  char buffer[64];
+  char *s, *result;
+  int len;
+  struct ui_file *tmp_stream = mem_fileopen ();
+  struct cleanup *cleanups = make_cleanup_ui_file_delete (tmp_stream);
+
+  print_floating (valaddr, type, tmp_stream);
+  ui_file_put (tmp_stream, ui_memcpy, buffer);
+  do_cleanups (cleanups);
+
+  result = buffer;
+  len = strlen (result);
+
+  /* Modify for Ada rules.  */
+  
+  s = strstr (result, "inf");
+  if (s == NULL)
+    s = strstr (result, "Inf");
+  if (s == NULL)
+    s = strstr (result, "INF");
+  if (s != NULL)
+    strcpy (s, "Inf");
+
+  if (s == NULL)
+    {
+      s = strstr (result, "nan");
+      if (s == NULL)
+	s = strstr (result, "NaN");
+      if (s == NULL)
+	s = strstr (result, "Nan");
+      if (s != NULL)
+	{
+	  s[0] = s[2] = 'N';
+	  if (result[0] == '-')
+	    result += 1;
+	}
+    }
+
+  if (s == NULL && strchr (result, '.') == NULL)
+    {
+      s = strchr (result, 'e');
+      if (s == NULL)
+	fprintf_filtered (stream, "%s.0", result);
+      else
+	fprintf_filtered (stream, "%.*s.0%s", (int) (s-result), result, s);
+      return;
+    }
+  fprintf_filtered (stream, "%s", result);
+}
+
 void
 ada_printchar (int c, struct ui_file *stream)
 {
@@ -294,7 +359,7 @@
 }
 
 /* [From print_type_scalar in typeprint.c].   Print VAL on STREAM in a
-   form appropriate for TYPE. */
+   form appropriate for TYPE.  */
 
 void
 ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
@@ -405,9 +470,9 @@
 
       rep1 = i + 1;
       reps = 1;
-      while (rep1 < length &&
-	     char_at (string, rep1, type_len) == char_at (string, i,
-							  type_len))
+      while (rep1 < length
+	     && char_at (string, rep1, type_len) == char_at (string, i,
+							     type_len))
 	{
 	  rep1 += 1;
 	  reps += 1;
@@ -463,7 +528,7 @@
 
 void
 ada_printstr (struct ui_file *stream, char *string, unsigned int length,
-	      int force_ellipses, int width)
+	      int width, int force_ellipses)
 {
   printstr (stream, string, length, force_ellipses, width);
 }
@@ -471,7 +536,7 @@
 
 /* Print data of type TYPE located at VALADDR (within GDB), which came from
    the inferior at address ADDRESS, onto stdio stream STREAM according to
-   FORMAT (a letter as for the printf % codes or 0 for natural format).  
+   FORMAT (a letter as for the printf % codes or 0 for natural format).
    The data at VALADDR is in target byte order.
 
    If the data is printed as a string, returns the number of string characters
@@ -508,9 +573,9 @@
 }
 
 /* Helper for ada_val_print; used as argument to catch_errors to
-   unmarshal the arguments to ada_val_print_1, which does the work. */
+   unmarshal the arguments to ada_val_print_1, which does the work.  */
 static int
-ada_val_print_stub (void * args0)
+ada_val_print_stub (void *args0)
 {
   struct ada_val_print_args *argsp = (struct ada_val_print_args *) args0;
   return ada_val_print_1 (argsp->type, argsp->valaddr0,
@@ -520,7 +585,7 @@
 }
 
 /* See the comment on ada_val_print.  This function differs in that it
- * does not catch evaluation errors (leaving that to ada_val_print). */
+ * does not catch evaluation errors (leaving that to ada_val_print).  */
 
 static int
 ada_val_print_1 (struct type *type, char *valaddr0, int embedded_offset,
@@ -532,12 +597,11 @@
   struct type *elttype;
   unsigned int eltlen;
   LONGEST val;
-  CORE_ADDR addr;
   char *valaddr = valaddr0 + embedded_offset;
 
   CHECK_TYPEDEF (type);
 
-  if (ada_is_array_descriptor (type) || ada_is_packed_array_type (type))
+  if (ada_is_array_descriptor_type (type) || ada_is_packed_array_type (type))
     {
       int retn;
       struct value *mark = value_mark ();
@@ -567,6 +631,22 @@
       return c_val_print (type, valaddr0, embedded_offset, address, stream,
 			  format, deref_ref, recurse, pretty);
 
+    case TYPE_CODE_PTR:
+      {
+	int ret = c_val_print (type, valaddr0, embedded_offset, address, 
+			       stream, format, deref_ref, recurse, pretty);
+	if (ada_is_tag_type (type))
+	  {
+	    struct value *val = 
+	      value_from_contents_and_address (type, valaddr, address);
+	    const char *name = ada_tag_name (val);
+	    if (name != NULL) 
+	      fprintf_filtered (stream, " (%s)", name);
+	    return 0;
+	}
+	return ret;
+      }
+
     case TYPE_CODE_INT:
     case TYPE_CODE_RANGE:
       if (ada_is_fixed_point_type (type))
@@ -603,7 +683,7 @@
 	      fprintf_filtered (stream, "%s", VALUE_CONTENTS (printable_val));
 	      return 0;
 	    }
-	  /* No special printing function.  Do as best we can. */
+	  /* No special printing function.  Do as best we can.  */
 	}
       else if (TYPE_CODE (type) == TYPE_CODE_RANGE)
 	{
@@ -613,7 +693,7 @@
 	      /* Obscure case of range type that has different length from
 	         its base type.  Perform a conversion, or we will get a
 	         nonsense value.  Actually, we could use the same
-	         code regardless of lengths; I'm just avoiding a cast. */
+	         code regardless of lengths; I'm just avoiding a cast.  */
 	      struct value *v = value_cast (target_type,
 					    value_from_contents_and_address
 					    (type, valaddr, 0));
@@ -633,6 +713,20 @@
 	    {
 	      print_scalar_formatted (valaddr, type, format, 0, stream);
 	    }
+          else if (ada_is_system_address_type (type))
+            {
+              /* FIXME: We want to print System.Address variables using
+                 the same format as for any access type.  But for some
+                 reason GNAT encodes the System.Address type as an int,
+                 so we have to work-around this deficiency by handling
+                 System.Address values as a special case.  */
+              fprintf_filtered (stream, "(");
+              type_print (type, "", stream, -1);
+              fprintf_filtered (stream, ") ");
+              print_address_numeric 
+		(extract_typed_address (valaddr, builtin_type_void_data_ptr),
+                 1, stream);
+            }
 	  else
 	    {
 	      val_print_type_code_int (type, valaddr, stream);
@@ -676,6 +770,14 @@
 	}
       break;
 
+    case TYPE_CODE_FLT:
+      if (format)
+	return c_val_print (type, valaddr0, embedded_offset, address, stream,
+			    format, deref_ref, recurse, pretty);
+      else
+	ada_print_floating (valaddr0 + embedded_offset, type, stream);
+      break;
+
     case TYPE_CODE_UNION:
     case TYPE_CODE_STRUCT:
       if (ada_is_bogus_array_descriptor (type))
@@ -690,66 +792,60 @@
 	}
 
     case TYPE_CODE_ARRAY:
-      if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0)
-	{
-	  elttype = TYPE_TARGET_TYPE (type);
-	  eltlen = TYPE_LENGTH (elttype);
-	  len = TYPE_LENGTH (type) / eltlen;
+      elttype = TYPE_TARGET_TYPE (type);
+      if (elttype == NULL)
+	eltlen = 0;
+      else
+	eltlen = TYPE_LENGTH (elttype);
+      /* FIXME: This doesn't deal with non-empty arrays of
+	 0-length items (not a typical case!) */
+      if (eltlen == 0)
+	len = 0;
+      else
+	len = TYPE_LENGTH (type) / eltlen;
 
 	  /* For an array of chars, print with string syntax.  */
-	  if (ada_is_string_type (type) && (format == 0 || format == 's'))
+      if (ada_is_string_type (type) && (format == 0 || format == 's'))
+	{
+	  if (prettyprint_arrays)
 	    {
-	      if (prettyprint_arrays)
-		{
-		  print_spaces_filtered (2 + 2 * recurse, stream);
-		}
-	      /* If requested, look for the first null char and only print
-	         elements up to it.  */
-	      if (stop_print_at_null)
-		{
-		  int temp_len;
-
-		  /* Look for a NULL char. */
-		  for (temp_len = 0;
-		       temp_len < len && temp_len < print_max
-		       && char_at (valaddr, temp_len, eltlen) != 0;
-		       temp_len += 1);
-		  len = temp_len;
-		}
-
-	      printstr (stream, valaddr, len, 0, eltlen);
+	      print_spaces_filtered (2 + 2 * recurse, stream);
 	    }
-	  else
+	  /* If requested, look for the first null char and only print
+	     elements up to it.  */
+	  if (stop_print_at_null)
 	    {
-	      len = 0;
-	      fprintf_filtered (stream, "(");
-	      print_optional_low_bound (stream, type);
-	      if (TYPE_FIELD_BITSIZE (type, 0) > 0)
-		val_print_packed_array_elements (type, valaddr, 0, stream,
-						 format, recurse, pretty);
-	      else
-		val_print_array_elements (type, valaddr, address, stream,
-					  format, deref_ref, recurse,
-					  pretty, 0);
-	      fprintf_filtered (stream, ")");
+	      int temp_len;
+
+	      /* Look for a NULL char.  */
+	      for (temp_len = 0;
+		   temp_len < len && temp_len < print_max
+		     && char_at (valaddr, temp_len, eltlen) != 0;
+		   temp_len += 1);
+	      len = temp_len;
 	    }
-	  gdb_flush (stream);
-	  return len;
+
+	  printstr (stream, valaddr, len, 0, eltlen);
 	}
+      else
+	{
+	  len = 0;
+	  fprintf_filtered (stream, "(");
+	  print_optional_low_bound (stream, type);
+	  if (TYPE_FIELD_BITSIZE (type, 0) > 0)
+	    val_print_packed_array_elements (type, valaddr, 0, stream,
+					     format, recurse, pretty);
+	  else
+	    val_print_array_elements (type, valaddr, address, stream,
+				      format, deref_ref, recurse,
+				      pretty, 0);
+	  fprintf_filtered (stream, ")");
+	}
+      gdb_flush (stream);
+      return len;
 
     case TYPE_CODE_REF:
       elttype = check_typedef (TYPE_TARGET_TYPE (type));
-      if (addressprint)
-	{
-	  fprintf_filtered (stream, "@");
-	  /* Extract an address, assume that the address is unsigned.  */
-	  print_address_numeric
-	    (extract_unsigned_integer (valaddr,
-				       TARGET_PTR_BIT / HOST_CHAR_BIT),
-	     1, stream);
-	  if (deref_ref)
-	    fputs_filtered (": ", stream);
-	}
       /* De-reference the reference */
       if (deref_ref)
 	{
@@ -777,6 +873,7 @@
 	}
       break;
     }
+  gdb_flush (stream);
   return 0;
 }
 
@@ -811,26 +908,21 @@
   struct value *val =
     value_from_contents_and_address (type, valaddr, address);
 
-  /* If it is a pointer, indicate what it points to. */
-  if (TYPE_CODE (type) == TYPE_CODE_PTR || TYPE_CODE (type) == TYPE_CODE_REF)
+  /* If it is a pointer, indicate what it points to.  */
+  if (TYPE_CODE (type) == TYPE_CODE_PTR)
     {
-      /* Hack:  remove (char *) for char strings.  Their
-         type is indicated by the quoted string anyway. */
-      if (TYPE_CODE (type) == TYPE_CODE_PTR &&
-	  TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == sizeof (char) &&
-	  TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_INT &&
-	  !TYPE_UNSIGNED (TYPE_TARGET_TYPE (type)))
-	{
-	  /* Print nothing */
-	}
-      else
+      /* Hack:  don't print (char *) for char strings.  Their
+         type is indicated by the quoted string anyway.  */
+      if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) != sizeof (char)
+	  || TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_INT 
+	  || TYPE_UNSIGNED (TYPE_TARGET_TYPE (type)))
 	{
 	  fprintf_filtered (stream, "(");
 	  type_print (type, "", stream, -1);
 	  fprintf_filtered (stream, ") ");
 	}
     }
-  else if (ada_is_array_descriptor (type))
+  else if (ada_is_array_descriptor_type (type))
     {
       fprintf_filtered (stream, "(");
       type_print (type, "", stream, -1);
@@ -843,6 +935,23 @@
       fprintf_filtered (stream, ") (...?)");
       return 0;
     }
+
+  if (TYPE_CODE (type) == TYPE_CODE_ARRAY
+      && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == 0
+      && TYPE_CODE (TYPE_INDEX_TYPE (type)) == TYPE_CODE_RANGE)
+    {
+      /* This is an array of zero-length elements, that is an array
+         of null records.  This array needs to be printed by hand,
+         as the standard routine to print arrays relies on the size of
+         the array elements to be nonzero.  This is because it computes
+         the number of elements in the array by dividing the array size
+         by the array element size.  */
+      fprintf_filtered (stream, "(%d .. %d => ())",
+                        TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type)),
+                        TYPE_HIGH_BOUND (TYPE_INDEX_TYPE (type)));
+      return 0;
+    }
+  
   return (val_print (type, VALUE_CONTENTS (val), 0, address,
 		     stream, format, 1, 0, pretty));
 }
@@ -866,18 +975,18 @@
 }
 
 /* Print out fields of value at VALADDR having structure type TYPE.
-  
+
    TYPE, VALADDR, STREAM, FORMAT, RECURSE, and PRETTY have the
-   same meanings as in ada_print_value and ada_val_print.   
+   same meanings as in ada_print_value and ada_val_print.
 
    OUTER_TYPE and OUTER_VALADDR give type and address of enclosing record
    (used to get discriminant values when printing variant parts).
 
-   COMMA_NEEDED is 1 if fields have been printed at the current recursion 
+   COMMA_NEEDED is 1 if fields have been printed at the current recursion
    level, so that a comma is needed before any field printed by this
-   call. 
+   call.
 
-   Returns 1 if COMMA_NEEDED or any fields were printed. */
+   Returns 1 if COMMA_NEEDED or any fields were printed.  */
 
 static int
 print_field_values (struct type *type, char *valaddr, struct ui_file *stream,
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 18ee0b1..e5e8a9a 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -50,6 +50,7 @@
 #include "gdbcmd.h"
 #include "language.h"		/* for local_hex_string() */
 #include "ppc-tdep.h"
+#include "gdb_string.h"
 
 #include <procinfo.h>
 #include <sys/types.h>
@@ -129,7 +130,8 @@
 
 static int arch64;
 
-/* Saved pointer to previous owner of target_new_objfile_hook.  */
+/* Saved pointer to previous owner of
+   deprecated_target_new_objfile_hook.  */
 
 static void (*target_new_objfile_chain)(struct objfile *);
 
@@ -337,9 +339,9 @@
    this is needed, I have implemented what I think it should do,
    however this code is untested.  */
 
-  uint64_t gprs64[32];
-  uint32_t gprs32[32];
-  double fprs[32];
+  uint64_t gprs64[ppc_num_gprs];
+  uint32_t gprs32[ppc_num_gprs];
+  double fprs[ppc_num_fprs];
   struct ptxsprs sprs64;
   struct ptsprs sprs32;
   
@@ -893,7 +895,7 @@
   unpush_target (&aix_thread_ops);
 }
 
-/* target_new_objfile_hook callback.
+/* deprecated_target_new_objfile_hook callback.
 
    If OBJFILE is non-null, check whether a threaded application is
    being debugged, and if so, prepare for thread debugging.
@@ -1000,10 +1002,11 @@
 static void
 supply_gprs64 (uint64_t *vals)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int regno;
 
-  for (regno = 0; regno < 32; regno++)
-    supply_register (regno, (char *) (vals + regno));
+  for (regno = 0; regno < ppc_num_gprs; regno++)
+    supply_register (tdep->ppc_gp0_regnum + regno, (char *) (vals + regno));
 }
 
 /* Record that 32-bit register REGNO contains VAL.  */
@@ -1019,10 +1022,15 @@
 static void
 supply_fprs (double *vals)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int regno;
 
-  for (regno = 0; regno < 32; regno++)
-    supply_register (regno + FP0_REGNUM, (char *) (vals + regno));
+  /* This function should never be called on architectures without
+     floating-point registers.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
+  for (regno = 0; regno < ppc_num_fprs; regno++)
+    supply_register (regno + tdep->ppc_fp0_regnum, (char *) (vals + regno));
 }
 
 /* Predicate to test whether given register number is a "special" register.  */
@@ -1037,7 +1045,7 @@
       || regno == tdep->ppc_lr_regnum
       || regno == tdep->ppc_ctr_regnum
       || regno == tdep->ppc_xer_regnum
-      || regno == tdep->ppc_fpscr_regnum
+      || (tdep->ppc_fpscr_regnum >= 0 && regno == tdep->ppc_fpscr_regnum)
       || (tdep->ppc_mq_regnum >= 0 && regno == tdep->ppc_mq_regnum);
 }
 
@@ -1058,7 +1066,8 @@
   supply_register (tdep->ppc_lr_regnum, (char *) &lr);
   supply_register (tdep->ppc_ctr_regnum, (char *) &ctr);
   supply_register (tdep->ppc_xer_regnum, (char *) &xer);
-  supply_register (tdep->ppc_fpscr_regnum, (char *) &fpscr);
+  if (tdep->ppc_fpscr_regnum >= 0)
+    supply_register (tdep->ppc_fpscr_regnum, (char *) &fpscr);
 }
 
 /* Record that the special registers contain the specified 32-bit
@@ -1077,7 +1086,8 @@
   supply_register (tdep->ppc_lr_regnum, (char *) &lr);
   supply_register (tdep->ppc_ctr_regnum, (char *) &ctr);
   supply_register (tdep->ppc_xer_regnum, (char *) &xer);
-  supply_register (tdep->ppc_fpscr_regnum, (char *) &fpscr);
+  if (tdep->ppc_fpscr_regnum >= 0)
+    supply_register (tdep->ppc_fpscr_regnum, (char *) &fpscr);
 }
 
 /* Fetch all registers from pthread PDTID, which doesn't have a kernel
@@ -1090,6 +1100,7 @@
 static void
 fetch_regs_user_thread (pthdb_pthread_t pdtid)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int status, i;
   pthdb_context_t ctx;
 
@@ -1106,12 +1117,13 @@
   if (arch64)
     supply_gprs64 (ctx.gpr);
   else
-    for (i = 0; i < 32; i++)
-      supply_reg32 (i, ctx.gpr[i]);
+    for (i = 0; i < ppc_num_gprs; i++)
+      supply_reg32 (tdep->ppc_gp0_regnum + i, ctx.gpr[i]);
 
   /* Floating-point registers.  */
 
-  supply_fprs (ctx.fpr);
+  if (ppc_floating_point_unit_p (current_gdbarch))
+    supply_fprs (ctx.fpr);
 
   /* Special registers.  */
 
@@ -1141,9 +1153,10 @@
 static void
 fetch_regs_kernel_thread (int regno, pthdb_tid_t tid)
 {
-  uint64_t gprs64[32];
-  uint32_t gprs32[32];
-  double fprs[32];
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  uint64_t gprs64[ppc_num_gprs];
+  uint32_t gprs32[ppc_num_gprs];
+  double fprs[ppc_num_fprs];
   struct ptxsprs sprs64;
   struct ptsprs sprs32;
   int i;
@@ -1154,7 +1167,9 @@
 	(long) tid, regno, arch64);
 
   /* General-purpose registers.  */
-  if (regno == -1 || regno < FP0_REGNUM)
+  if (regno == -1
+      || (tdep->ppc_gp0_regnum <= regno
+          && regno < tdep->ppc_gp0_regnum + ppc_num_gprs))
     {
       if (arch64)
 	{
@@ -1167,14 +1182,17 @@
 	{
 	  if (!ptrace32 (PTT_READ_GPRS, tid, gprs32, 0, NULL))
 	    memset (gprs32, 0, sizeof (gprs32));
-	  for (i = 0; i < 32; i++)
-	    supply_reg32 (i, gprs32[i]);
+	  for (i = 0; i < ppc_num_gprs; i++)
+	    supply_reg32 (tdep->ppc_gp0_regnum + i, gprs32[i]);
 	}
     }
 
   /* Floating-point registers.  */
 
-  if (regno == -1 || (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM))
+  if (ppc_floating_point_unit_p (current_gdbarch)
+      && (regno == -1
+          || (regno >= tdep->ppc_fp0_regnum
+              && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
     {
       if (!ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL))
 	memset (fprs, 0, sizeof (fprs));
@@ -1238,30 +1256,39 @@
 static void
 fill_gprs64 (uint64_t *vals)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int regno;
 
-  for (regno = 0; regno < FP0_REGNUM; regno++)
-    if (register_cached (regno))
-      regcache_collect (regno, vals + regno);
+  for (regno = 0; regno < ppc_num_gprs; regno++)
+    if (register_cached (tdep->ppc_gp0_regnum + regno))
+      regcache_collect (tdep->ppc_gp0_regnum + regno, vals + regno);
 }
 
 static void 
 fill_gprs32 (uint32_t *vals)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int regno;
 
-  for (regno = 0; regno < FP0_REGNUM; regno++)
-    if (register_cached (regno))
-      regcache_collect (regno, vals + regno);
+  for (regno = 0; regno < ppc_num_gprs; regno++)
+    if (register_cached (tdep->ppc_gp0_regnum + regno))
+      regcache_collect (tdep->ppc_gp0_regnum + regno, vals + regno);
 }
 
 /* Store the floating point registers into a double array.  */
 static void
 fill_fprs (double *vals)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int regno;
 
-  for (regno = FP0_REGNUM; regno < FPLAST_REGNUM; regno++)
+  /* This function should never be called on architectures without
+     floating-point registers.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
+  for (regno = tdep->ppc_fp0_regnum;
+       regno < tdep->ppc_fp0_regnum + ppc_num_fprs;
+       regno++)
     if (register_cached (regno))
       regcache_collect (regno, vals + regno);
 }
@@ -1295,7 +1322,8 @@
     regcache_collect (tdep->ppc_ctr_regnum, ctr);
   if (register_cached (tdep->ppc_xer_regnum))
     regcache_collect (tdep->ppc_xer_regnum, xer);
-  if (register_cached (tdep->ppc_fpscr_regnum))
+  if (tdep->ppc_fpscr_regnum >= 0
+      && register_cached (tdep->ppc_fpscr_regnum))
     regcache_collect (tdep->ppc_fpscr_regnum, fpscr);
 }
 
@@ -1330,7 +1358,8 @@
     regcache_collect (tdep->ppc_ctr_regnum, ctr);
   if (register_cached (tdep->ppc_xer_regnum))
     regcache_collect (tdep->ppc_xer_regnum, xer);
-  if (register_cached (tdep->ppc_fpscr_regnum))
+  if (tdep->ppc_fpscr_regnum >= 0
+      && register_cached (tdep->ppc_fpscr_regnum))
     regcache_collect (tdep->ppc_fpscr_regnum, fpscr);
 }
 
@@ -1343,6 +1372,7 @@
 static void
 store_regs_user_thread (pthdb_pthread_t pdtid)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int status, i;
   pthdb_context_t ctx;
   uint32_t int32;
@@ -1362,23 +1392,24 @@
 
   /* Collect general-purpose register values from the regcache.  */
 
-  for (i = 0; i < 32; i++)
-    if (register_cached (i))
+  for (i = 0; i < ppc_num_gprs; i++)
+    if (register_cached (tdep->ppc_gp0_regnum + i))
       {
 	if (arch64)
 	  {
-	    regcache_collect (i, (void *) &int64);
+	    regcache_collect (tdep->ppc_gp0_regnum + i, (void *) &int64);
 	    ctx.gpr[i] = int64;
 	  }
 	else
 	  {
-	    regcache_collect (i, (void *) &int32);
+	    regcache_collect (tdep->ppc_gp0_regnum + i, (void *) &int32);
 	    ctx.gpr[i] = int32;
 	  }
       }
 
   /* Collect floating-point register values from the regcache.  */
-  fill_fprs (ctx.fpr);
+  if (ppc_floating_point_unit_p (current_gdbarch))
+    fill_fprs (ctx.fpr);
 
   /* Special registers (always kept in ctx as 64 bits).  */
   if (arch64)
@@ -1394,7 +1425,6 @@
 	 happens, GDB needs to be reconfigured so that longs are 32-bits.)  */
       unsigned long tmp_iar, tmp_msr, tmp_cr, tmp_lr, tmp_ctr, tmp_xer,
                     tmp_fpscr;
-      struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
       fill_sprs32 (&tmp_iar, &tmp_msr, &tmp_cr, &tmp_lr, &tmp_ctr, &tmp_xer,
                    &tmp_fpscr);
@@ -1431,13 +1461,13 @@
 static void
 store_regs_kernel_thread (int regno, pthdb_tid_t tid)
 {
-  uint64_t gprs64[32];
-  uint32_t gprs32[32];
-  double fprs[32];
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  uint64_t gprs64[ppc_num_gprs];
+  uint32_t gprs32[ppc_num_gprs];
+  double fprs[ppc_num_fprs];
   struct ptxsprs sprs64;
   struct ptsprs  sprs32;
   int i;
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
   if (debug_aix_thread)
     fprintf_unfiltered (gdb_stdlog, 
@@ -1445,7 +1475,9 @@
                         (long) tid, regno);
 
   /* General-purpose registers.  */
-  if (regno == -1 || regno < FP0_REGNUM)
+  if (regno == -1
+      || (tdep->ppc_gp0_regnum <= regno
+          && regno < tdep->ppc_gp0_regnum + ppc_num_fprs))
     {
       if (arch64)
 	{
@@ -1465,7 +1497,10 @@
 
   /* Floating-point registers.  */
 
-  if (regno == -1 || (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM))
+  if (ppc_floating_point_unit_p (current_gdbarch)
+      && (regno == -1
+          || (regno >= tdep->ppc_fp0_regnum
+              && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
     {
       /* Pre-fetch: some regs may not be in the cache.  */
       ptrace32 (PTT_READ_FPRS, tid, (int *) fprs, 0, NULL);
@@ -1594,10 +1629,10 @@
     return base_target.to_pid_to_str (ptid);
 
   /* Free previous return value; a new one will be allocated by
-     xasprintf().  */
+     xstrprintf().  */
   xfree (ret);
 
-  xasprintf (&ret, "Thread %ld", ptid_get_tid (ptid));
+  ret = xstrprintf ("Thread %ld", ptid_get_tid (ptid));
   return ret;
 }
 
@@ -1695,8 +1730,8 @@
   add_target (&aix_thread_ops);
 
   /* Notice when object files get loaded and unloaded.  */
-  target_new_objfile_chain = target_new_objfile_hook;
-  target_new_objfile_hook = new_objfile;
+  target_new_objfile_chain = deprecated_target_new_objfile_hook;
+  deprecated_target_new_objfile_hook = new_objfile;
 
   add_show_from_set (add_set_cmd ("aix-thread", no_class, var_zinteger,
 				  (char *) &debug_aix_thread, 
diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c
index 344195e..02036ba 100644
--- a/gdb/alpha-linux-tdep.c
+++ b/gdb/alpha-linux-tdep.c
@@ -134,11 +134,10 @@
   /* Hook into the MDEBUG frame unwinder.  */
   alpha_mdebug_init_abi (info, gdbarch);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, alpha_linux_pc_in_sigtramp);
-
   tdep = gdbarch_tdep (gdbarch);
   tdep->dynamic_sigtramp_offset = alpha_linux_sigtramp_offset;
   tdep->sigcontext_addr = alpha_linux_sigcontext_addr;
+  tdep->pc_in_sigtramp = alpha_linux_pc_in_sigtramp;
   tdep->jb_pc = 2;
   tdep->jb_elt_size = 8;
 }
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index 0a78d94..62486cf 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -267,6 +267,6 @@
 void
 _initialize_core_alpha (void)
 {
-  add_core_fns (&alpha_osf_core_fns);
-  add_core_fns (&alpha_elf_core_fns);
+  deprecated_add_core_fns (&alpha_osf_core_fns);
+  deprecated_add_core_fns (&alpha_elf_core_fns);
 }
diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c
index 1fc9889..b5879ad 100644
--- a/gdb/alpha-osf1-tdep.c
+++ b/gdb/alpha-osf1-tdep.c
@@ -54,13 +54,13 @@
   /* Hook into the MDEBUG frame unwinder.  */
   alpha_mdebug_init_abi (info, gdbarch);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, alpha_osf1_pc_in_sigtramp);
   /* The next/step support via procfs on OSF1 is broken when running
      on multi-processor machines. We need to use software single stepping
      instead.  */
   set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
 
   tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
+  tdep->pc_in_sigtramp = alpha_osf1_pc_in_sigtramp;
 
   tdep->jb_pc = 2;
   tdep->jb_elt_size = 8;
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 8777afc..08c9e4a 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -40,6 +40,7 @@
 #include "arch-utils.h"
 #include "osabi.h"
 #include "block.h"
+#include "infcall.h"
 
 #include "elf-bfd.h"
 
@@ -263,7 +264,7 @@
    structure to be returned is passed as a hidden first argument.  */
 
 static CORE_ADDR
-alpha_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		       struct regcache *regcache, CORE_ADDR bp_addr,
 		       int nargs, struct value **args, CORE_ADDR sp,
 		       int struct_return, CORE_ADDR struct_addr)
@@ -281,6 +282,7 @@
   struct alpha_arg *m_arg;
   char arg_reg_buffer[ALPHA_REGISTER_SIZE * ALPHA_NUM_ARG_REGS];
   int required_arg_regs;
+  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   /* The ABI places the address of the called function in T12.  */
   regcache_cooked_write_signed (regcache, ALPHA_T12_REGNUM, func_addr);
@@ -863,14 +865,20 @@
   CORE_ADDR pc = frame_pc_unwind (next_frame);
   char *name;
 
-  /* We shouldn't even bother to try if the OSABI didn't register
-     a sigcontext_addr handler.  */
-  if (!gdbarch_tdep (current_gdbarch)->sigcontext_addr)
+  /* NOTE: cagney/2004-04-30: Do not copy/clone this code.  Instead
+     look at tramp-frame.h and other simplier per-architecture
+     sigtramp unwinders.  */
+
+  /* We shouldn't even bother to try if the OSABI didn't register a
+     sigcontext_addr handler or pc_in_sigtramp hander.  */
+  if (gdbarch_tdep (current_gdbarch)->sigcontext_addr == NULL)
+    return NULL;
+  if (gdbarch_tdep (current_gdbarch)->pc_in_sigtramp == NULL)
     return NULL;
 
   /* Otherwise we should be in a signal frame.  */
   find_pc_partial_function (pc, &name, NULL, NULL);
-  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
+  if (gdbarch_tdep (current_gdbarch)->pc_in_sigtramp (pc, name))
     return &alpha_sigtramp_frame_unwind;
 
   return NULL;
@@ -1029,6 +1037,16 @@
 	    {
 	      reg = (word & 0x03e00000) >> 21;
 
+              /* Ignore this instruction if we have already encountered
+                 an instruction saving the same register earlier in the
+                 function code.  The current instruction does not tell
+                 us where the original value upon function entry is saved.
+                 All it says is that the function we are scanning reused
+                 that register for some computation of its own, and is now
+                 saving its result.  */
+              if (info->saved_regs[reg])
+                continue;
+
 	      if (reg == 31)
 		continue;
 
@@ -1483,7 +1501,7 @@
 
   /* Lowest text address.  This is used by heuristic_proc_start()
      to decide when to stop looking.  */
-  tdep->vm_min_address = (CORE_ADDR) 0x120000000;
+  tdep->vm_min_address = (CORE_ADDR) 0x120000000LL;
 
   tdep->dynamic_sigtramp_offset = NULL;
   tdep->sigcontext_addr = NULL;
@@ -1532,7 +1550,7 @@
 
   /* Call info.  */
 
-  set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, always_use_struct_convention);
   set_gdbarch_extract_return_value (gdbarch, alpha_extract_return_value);
   set_gdbarch_store_return_value (gdbarch, alpha_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, alpha_extract_struct_value_address);
diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h
index 828a3c6..b1b8516 100644
--- a/gdb/alpha-tdep.h
+++ b/gdb/alpha-tdep.h
@@ -83,6 +83,12 @@
      the sigcontext structure for that signal handler.  */
   CORE_ADDR (*sigcontext_addr) (struct frame_info *);
 
+  /* Does the PC fall in a signal trampoline.  */
+  /* NOTE: cagney/2004-04-30: Do not copy/clone this code.  Instead
+     look at tramp-frame.h and other simplier per-architecture
+     sigtramp unwinders.  */
+  int (*pc_in_sigtramp) (CORE_ADDR pc, char *name);
+
   /* Offset of registers in `struct sigcontext'.  */
   int sc_pc_offset;
   int sc_regs_offset;
diff --git a/gdb/alphabsd-nat.c b/gdb/alphabsd-nat.c
index 0781698..d282a72 100644
--- a/gdb/alphabsd-nat.c
+++ b/gdb/alphabsd-nat.c
@@ -1,5 +1,6 @@
 /* Native-dependent code for Alpha BSD's.
-   Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -76,10 +77,9 @@
 getregs_supplies (int regno)
 {
   return ((regno >= ALPHA_V0_REGNUM && regno <= ALPHA_ZERO_REGNUM)
-	  || regno >= PC_REGNUM);
+	  || regno >= ALPHA_PC_REGNUM);
 }
 
-
 /* Fetch register REGNO from the inferior.  If REGNO is -1, do this
    for all registers (including the floating point registers).  */
 
diff --git a/gdb/alphafbsd-tdep.c b/gdb/alphafbsd-tdep.c
index 77bd6ea..8bd4879 100644
--- a/gdb/alphafbsd-tdep.c
+++ b/gdb/alphafbsd-tdep.c
@@ -98,12 +98,11 @@
   /* Hook into the MDEBUG frame unwinder.  */
   alpha_mdebug_init_abi (info, gdbarch);
 
-  set_gdbarch_use_struct_convention (gdbarch, alphafbsd_use_struct_convention);
-
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, alphafbsd_pc_in_sigtramp);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, alphafbsd_use_struct_convention);
 
   tdep->dynamic_sigtramp_offset = alphafbsd_sigtramp_offset;
   tdep->sigcontext_addr = alphafbsd_sigcontext_addr;
+  tdep->pc_in_sigtramp = alphafbsd_pc_in_sigtramp;
   tdep->sc_pc_offset = 288;
   tdep->sc_regs_offset = 24;
   tdep->sc_fpregs_offset = 320;
diff --git a/gdb/alphanbsd-tdep.c b/gdb/alphanbsd-tdep.c
index 6fe9252..97d32ec 100644
--- a/gdb/alphanbsd-tdep.c
+++ b/gdb/alphanbsd-tdep.c
@@ -27,11 +27,12 @@
 #include "value.h"
 #include "osabi.h"
 
-#include "solib-svr4.h"
+#include "gdb_string.h"
 
 #include "alpha-tdep.h"
 #include "alphabsd-tdep.h"
 #include "nbsd-tdep.h"
+#include "solib-svr4.h"
 
 static void
 fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
@@ -205,8 +206,6 @@
   /* Hook into the MDEBUG frame unwinder.  */
   alpha_mdebug_init_abi (info, gdbarch);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, alphanbsd_pc_in_sigtramp);
-
   /* NetBSD/alpha does not provide single step support via ptrace(2); we
      must use software single-stepping.  */
   set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
@@ -215,6 +214,7 @@
                                  nbsd_lp64_solib_svr4_fetch_link_map_offsets);
 
   tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset;
+  tdep->pc_in_sigtramp = alphanbsd_pc_in_sigtramp;
   tdep->sigcontext_addr = alphanbsd_sigcontext_addr;
 
   tdep->jb_pc = 2;
@@ -226,9 +226,7 @@
 {
   gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD_ELF,
                           alphanbsd_init_abi);
-  gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OPENBSD_ELF,
-                          alphanbsd_init_abi);
 
-  add_core_fns (&alphanbsd_core_fns);
-  add_core_fns (&alphanbsd_elfcore_fns);
+  deprecated_add_core_fns (&alphanbsd_core_fns);
+  deprecated_add_core_fns (&alphanbsd_elfcore_fns);
 }
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 72aa73c..ab4725e 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -169,7 +169,7 @@
 	return;
     }
 
-  if (regnum == -1 || regnum >= AMD64_ST0_REGNUM)
+  if (regnum == -1 || !amd64_native_gregset_supplies_p (regnum))
     {
       elf_fpregset_t fpregs;
 
@@ -210,7 +210,7 @@
 	return;
     }
 
-  if (regnum == -1 || regnum >= AMD64_ST0_REGNUM)
+  if (regnum == -1 || !amd64_native_gregset_supplies_p (regnum))
     {
       elf_fpregset_t fpregs;
 
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 843a84e..8365ed3 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -25,6 +25,7 @@
 #include "gdbcore.h"
 #include "regcache.h"
 #include "osabi.h"
+#include "symtab.h"
 
 #include "gdb_string.h"
 
@@ -116,11 +117,17 @@
   return pc;
 }
 
-/* Return whether PC is in a GNU/Linux sigtramp routine.  */
+/* Return whether the frame preceding NEXT_FRAME corresponds to a
+   GNU/Linux sigtramp routine.  */
 
 static int
-amd64_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
+amd64_linux_sigtramp_p (struct frame_info *next_frame)
 {
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
+
   /* If we have NAME, we can optimize the search.  The trampoline is
      named __restore_rt.  However, it isn't dynamically exported from
      the shared C library, so the trampoline may appear to be part of
@@ -203,7 +210,7 @@
 
   amd64_init_abi (info, gdbarch);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, amd64_linux_pc_in_sigtramp);
+  tdep->sigtramp_p = amd64_linux_sigtramp_p;
   tdep->sigcontext_addr = amd64_linux_sigcontext_addr;
   tdep->sc_reg_offset = amd64_linux_sc_reg_offset;
   tdep->sc_num_regs = ARRAY_SIZE (amd64_linux_sc_reg_offset);
diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c
index 31b3603..50a03de 100644
--- a/gdb/amd64-nat.c
+++ b/gdb/amd64-nat.c
@@ -85,7 +85,7 @@
 }
 
 
-/* Supply register REGNUM, whose contents are store in BUF, to
+/* Supply register REGNUM, whose contents are stored in GREGS, to
    REGCACHE.  If REGNUM is -1, supply all appropriate registers.  */
 
 void
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 6d29163..90a4e11 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -371,8 +371,11 @@
   class[0] = class[1] = AMD64_NO_CLASS;
 
   /* Arguments of types (signed and unsigned) _Bool, char, short, int,
-     long, long long, and pointers are in the INTEGER class.  */
+     long, long long, and pointers are in the INTEGER class.  Similarly,
+     range types, used by languages such as Ada, are also in the INTEGER
+     class.  */
   if ((code == TYPE_CODE_INT || code == TYPE_CODE_ENUM
+       || code == TYPE_CODE_RANGE
        || code == TYPE_CODE_PTR || code == TYPE_CODE_REF)
       && (len == 1 || len == 2 || len == 4 || len == 8))
     class[0] = AMD64_INTEGER;
@@ -419,11 +422,28 @@
   amd64_classify (type, class);
 
   /* 2. If the type has class MEMORY, then the caller provides space
-        for the return value and passes the address of this storage in
-        %rdi as if it were the first argument to the function. In
-        effect, this address becomes a hidden first argument.  */
+     for the return value and passes the address of this storage in
+     %rdi as if it were the first argument to the function. In effect,
+     this address becomes a hidden first argument.
+
+     On return %rax will contain the address that has been passed in
+     by the caller in %rdi.  */
   if (class[0] == AMD64_MEMORY)
-    return RETURN_VALUE_STRUCT_CONVENTION;
+    {
+      /* As indicated by the comment above, the ABI guarantees that we
+         can always find the return value just after the function has
+         returned.  */
+
+      if (readbuf)
+	{
+	  ULONGEST addr;
+
+	  regcache_raw_read_unsigned (regcache, AMD64_RAX_REGNUM, &addr);
+	  read_memory (addr, readbuf, TYPE_LENGTH (type));
+	}
+
+      return RETURN_VALUE_ABI_RETURNS_ADDRESS;
+    }
 
   gdb_assert (class[1] != AMD64_MEMORY);
   gdb_assert (len <= 16);
@@ -626,7 +646,7 @@
 }
 
 static CORE_ADDR
-amd64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		       struct regcache *regcache, CORE_ADDR bp_addr,
 		       int nargs, struct value **args,	CORE_ADDR sp,
 		       int struct_return, CORE_ADDR struct_addr)
@@ -761,7 +781,7 @@
   struct amd64_frame_cache cache;
   CORE_ADDR pc;
 
-  pc = amd64_analyze_prologue (start_pc, 0xffffffffffffffff, &cache);
+  pc = amd64_analyze_prologue (start_pc, 0xffffffffffffffffLL, &cache);
   if (cache.frameless_p)
     return start_pc;
 
@@ -964,15 +984,26 @@
 static const struct frame_unwind *
 amd64_sigtramp_frame_sniffer (struct frame_info *next_frame)
 {
-  CORE_ADDR pc = frame_pc_unwind (next_frame);
-  char *name;
+  struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (next_frame));
 
-  find_pc_partial_function (pc, &name, NULL, NULL);
-  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
+  /* We shouldn't even bother if we don't have a sigcontext_addr
+     handler.  */
+  if (tdep->sigcontext_addr == NULL)
+    return NULL;
+
+  if (tdep->sigtramp_p != NULL)
     {
-      gdb_assert (gdbarch_tdep (current_gdbarch)->sigcontext_addr);
+      if (tdep->sigtramp_p (next_frame))
+	return &amd64_sigtramp_frame_unwind;
+    }
 
-      return &amd64_sigtramp_frame_unwind;
+  if (tdep->sigtramp_start != 0)
+    {
+      CORE_ADDR pc = frame_pc_unwind (next_frame);
+
+      gdb_assert (tdep->sigtramp_end != 0);
+      if (pc >= tdep->sigtramp_start && pc < tdep->sigtramp_end)
+	return &amd64_sigtramp_frame_unwind;
     }
 
   return NULL;
@@ -1017,20 +1048,36 @@
 }
 
 
-/* Supply register REGNUM from the floating-point register set REGSET
-   to register cache REGCACHE.  If REGNUM is -1, do this for all
-   registers in REGSET.  */
+/* Supply register REGNUM from the buffer specified by FPREGS and LEN
+   in the floating-point register set REGSET to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 static void
 amd64_supply_fpregset (const struct regset *regset, struct regcache *regcache,
 		       int regnum, const void *fpregs, size_t len)
 {
-  const struct gdbarch_tdep *tdep = regset->descr;
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
 
   gdb_assert (len == tdep->sizeof_fpregset);
   amd64_supply_fxsave (regcache, regnum, fpregs);
 }
 
+/* Collect register REGNUM from the register cache REGCACHE and store
+   it in the buffer specified by FPREGS and LEN as described by the
+   floating-point register set REGSET.  If REGNUM is -1, do this for
+   all registers in REGSET.  */
+
+static void
+amd64_collect_fpregset (const struct regset *regset,
+			const struct regcache *regcache,
+			int regnum, void *fpregs, size_t len)
+{
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+
+  gdb_assert (len == tdep->sizeof_fpregset);
+  amd64_collect_fxsave (regcache, regnum, fpregs);
+}
+
 /* Return the appropriate register set for the core section identified
    by SECT_NAME and SECT_SIZE.  */
 
@@ -1043,11 +1090,8 @@
   if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)
     {
       if (tdep->fpregset == NULL)
-	{
-	  tdep->fpregset = XMALLOC (struct regset);
-	  tdep->fpregset->descr = tdep;
-	  tdep->fpregset->supply_regset = amd64_supply_fpregset;
-	}
+	tdep->fpregset = regset_alloc (gdbarch, amd64_supply_fpregset,
+				       amd64_collect_fpregset);
 
       return tdep->fpregset;
     }
@@ -1157,7 +1201,7 @@
 {
   i387_supply_fxsave (regcache, regnum, fxsave);
 
-  if (fxsave)
+  if (fxsave && gdbarch_ptr_bit (get_regcache_arch (regcache)) == 64)
     {
       const char *regs = fxsave;
 
@@ -1181,8 +1225,11 @@
 
   i387_collect_fxsave (regcache, regnum, fxsave);
 
-  if (regnum == -1 || regnum == I387_FISEG_REGNUM)
-    regcache_raw_collect (regcache, I387_FISEG_REGNUM, regs + 12);
-  if (regnum == -1 || regnum == I387_FOSEG_REGNUM)
-    regcache_raw_collect (regcache, I387_FOSEG_REGNUM, regs + 20);
+  if (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 64)
+    {
+      if (regnum == -1 || regnum == I387_FISEG_REGNUM)
+	regcache_raw_collect (regcache, I387_FISEG_REGNUM, regs + 12);
+      if (regnum == -1 || regnum == I387_FOSEG_REGNUM)
+	regcache_raw_collect (regcache, I387_FOSEG_REGNUM, regs + 20);
+    }
 }
diff --git a/gdb/amd64-tdep.h b/gdb/amd64-tdep.h
index bfc549b..e01be02 100644
--- a/gdb/amd64-tdep.h
+++ b/gdb/amd64-tdep.h
@@ -45,6 +45,12 @@
   AMD64_R15_REGNUM = 15,	/* %r15 */
   AMD64_RIP_REGNUM,		/* %rip */
   AMD64_EFLAGS_REGNUM,		/* %eflags */
+  AMD64_CS_REGNUM,		/* %cs */
+  AMD64_SS_REGNUM,		/* %ss */
+  AMD64_DS_REGNUM,		/* %ds */
+  AMD64_ES_REGNUM,		/* %es */
+  AMD64_FS_REGNUM,		/* %fs */
+  AMD64_GS_REGNUM,		/* %gs */
   AMD64_ST0_REGNUM = 24,	/* %st0 */
   AMD64_XMM0_REGNUM = 40,	/* %xmm0 */
   AMD64_XMM1_REGNUM		/* %xmm1 */
diff --git a/gdb/amd64bsd-nat.c b/gdb/amd64bsd-nat.c
index 777fd69..02f4d58 100644
--- a/gdb/amd64bsd-nat.c
+++ b/gdb/amd64bsd-nat.c
@@ -54,7 +54,7 @@
 	return;
     }
 
-  if (regnum == -1 || regnum >= AMD64_ST0_REGNUM)
+  if (regnum == -1 || !amd64_native_gregset_supplies_p (regnum))
     {
       struct fpreg fpregs;
 
@@ -90,7 +90,7 @@
 	return;
     }
 
-  if (regnum == -1 || regnum >= AMD64_ST0_REGNUM)
+  if (regnum == -1 || !amd64_native_gregset_supplies_p (regnum))
     {
       struct fpreg fpregs;
 
diff --git a/gdb/amd64fbsd-nat.c b/gdb/amd64fbsd-nat.c
index 61ce73c..caeaee9 100644
--- a/gdb/amd64fbsd-nat.c
+++ b/gdb/amd64fbsd-nat.c
@@ -31,30 +31,17 @@
 #include <sys/sysctl.h>
 #include <machine/reg.h>
 
-#ifdef HAVE_SYS_PROCFS_H
-#include <sys/procfs.h>
-#endif
-
-#ifndef HAVE_GREGSET_T
-typedef struct reg gregset_t;
-#endif
-
-#ifndef HAVE_FPREGSET_T
-typedef struct fpreg fpregset_t;
-#endif
-
-#include "gregset.h"
 #include "amd64-tdep.h"
 #include "amd64-nat.h"
 
 
-/* Offset to the gregset_t location where REG is stored.  */
-#define REG_OFFSET(reg) offsetof (gregset_t, reg)
+/* Offset in `struct reg' where MEMBER is stored.  */
+#define REG_OFFSET(member) offsetof (struct reg, member)
 
-/* At reg_offset[REGNUM] you'll find the offset to the gregset_t
-   location where the GDB register REGNUM is stored.  Unsupported
-   registers are marked with `-1'.  */
-static int reg_offset[] =
+/* At amd64fbsd64_r_reg_offset[REGNUM] you'll find the offset in
+   `struct reg' location where the GDB register REGNUM is stored.
+   Unsupported registers are marked with `-1'.  */
+static int amd64fbsd64_r_reg_offset[] =
 {
   REG_OFFSET (r_rax),
   REG_OFFSET (r_rbx),
@@ -104,44 +91,44 @@
 };
 
 
-/* Transfering the registers between GDB, inferiors and core files.  */
+/* Support for debugging kernel virtual memory images.  */
 
-/* Fill GDB's register array with the general-purpose register values
-   in *GREGSETP.  */
+#include <sys/types.h>
+#include <machine/pcb.h>
 
-void
-supply_gregset (gregset_t *gregsetp)
+#include "bsd-kvm.h"
+
+static int
+amd64fbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
 {
-  amd64_supply_native_gregset (current_regcache, gregsetp, -1);
-}
+  /* The following is true for FreeBSD 5.2:
 
-/* Fill register REGNUM (if it is a general-purpose register) in
-   *GREGSETPS with the value in GDB's register array.  If REGNUM is -1,
-   do this for all registers.  */
+     The pcb contains %rip, %rbx, %rsp, %rbp, %r12, %r13, %r14, %r15,
+     %ds, %es, %fs and %gs.  This accounts for all callee-saved
+     registers specified by the psABI and then some.  Here %esp
+     contains the stack pointer at the point just after the call to
+     cpu_switch().  From this information we reconstruct the register
+     state as it would like when we just returned from cpu_switch().  */
 
-void
-fill_gregset (gregset_t *gregsetp, int regnum)
-{
-  amd64_collect_native_gregset (current_regcache, gregsetp, regnum);
-}
+  /* The stack pointer shouldn't be zero.  */
+  if (pcb->pcb_rsp == 0)
+    return 0;
 
-/* Fill GDB's register array with the floating-point register values
-   in *FPREGSETP.  */
+  pcb->pcb_rsp += 8;
+  regcache_raw_supply (regcache, AMD64_RIP_REGNUM, &pcb->pcb_rip);
+  regcache_raw_supply (regcache, AMD64_RBX_REGNUM, &pcb->pcb_rbx);
+  regcache_raw_supply (regcache, AMD64_RSP_REGNUM, &pcb->pcb_rsp);
+  regcache_raw_supply (regcache, AMD64_RBP_REGNUM, &pcb->pcb_rbp);
+  regcache_raw_supply (regcache, 12, &pcb->pcb_r12);
+  regcache_raw_supply (regcache, 13, &pcb->pcb_r13);
+  regcache_raw_supply (regcache, 14, &pcb->pcb_r14);
+  regcache_raw_supply (regcache, 15, &pcb->pcb_r15);
+  regcache_raw_supply (regcache, AMD64_DS_REGNUM, &pcb->pcb_ds);
+  regcache_raw_supply (regcache, AMD64_ES_REGNUM, &pcb->pcb_es);
+  regcache_raw_supply (regcache, AMD64_FS_REGNUM, &pcb->pcb_fs);
+  regcache_raw_supply (regcache, AMD64_GS_REGNUM, &pcb->pcb_gs);
 
-void
-supply_fpregset (fpregset_t *fpregsetp)
-{
-  amd64_supply_fxsave (current_regcache, -1, fpregsetp);
-}
-
-/* Fill register REGNUM (if it is a floating-point register) in
-   *FPREGSETP with the value in GDB's register array.  If REGNUM is -1,
-   do this for all registers.  */
-
-void
-fill_fpregset (fpregset_t *fpregsetp, int regnum)
-{
-  amd64_collect_fxsave (current_regcache, regnum, fpregsetp);
+  return 1;
 }
 
 
@@ -154,7 +141,7 @@
   int offset;
 
   amd64_native_gregset32_reg_offset = amd64fbsd32_r_reg_offset;
-  amd64_native_gregset64_reg_offset = reg_offset;
+  amd64_native_gregset64_reg_offset = amd64fbsd64_r_reg_offset;
 
   /* To support the recognition of signal handlers, i386bsd-tdep.c
      hardcodes some constants.  Inclusion of this file means that we
@@ -232,4 +219,7 @@
 	amd64fbsd_sigtramp_end_addr = ps_strings;
       }
   }
+
+  /* Support debugging kernel virtual memory images.  */
+  bsd_kvm_add_target (amd64fbsd_supply_pcb);
 }
diff --git a/gdb/amd64nbsd-tdep.c b/gdb/amd64nbsd-tdep.c
index cb413f0..ffa9110 100644
--- a/gdb/amd64nbsd-tdep.c
+++ b/gdb/amd64nbsd-tdep.c
@@ -24,6 +24,7 @@
 #include "frame.h"
 #include "gdbcore.h"
 #include "osabi.h"
+#include "symtab.h"
 
 #include "gdb_assert.h"
 
@@ -33,18 +34,34 @@
 
 /* Support for signal handlers.  */
 
-/* Assuming NEXT_FRAME is for a frame following a BSD sigtramp
-   routine, return the address of the associated sigcontext structure.  */
+/* Return whether the frame preceding NEXT_FRAME corresponds to a
+   NetBSD sigtramp routine.  */
+
+static int
+amd64nbsd_sigtramp_p (struct frame_info *next_frame)
+{
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
+  return nbsd_pc_in_sigtramp (pc, name);
+}
+
+/* Assuming NEXT_FRAME is preceded by a frame corresponding to a
+   NetBSD sigtramp routine, return the address of the associated
+   mcontext structure.  */
 
 static CORE_ADDR
-amd64nbsd_sigcontext_addr (struct frame_info *next_frame)
+amd64nbsd_mcontext_addr (struct frame_info *next_frame)
 {
-  CORE_ADDR sp;
+  CORE_ADDR addr;
 
-  /* The stack pointer points at `struct sigcontext' upon entry of a
+  /* The register %r15 points at `struct ucontext' upon entry of a
      signal trampoline.  */
-  sp = frame_unwind_register_unsigned (next_frame, AMD64_RSP_REGNUM);
-  return sp;
+  addr = frame_unwind_register_unsigned (next_frame, AMD64_R15_REGNUM);
+
+  /* The mcontext structure lives as offset 56 in `struct ucontext'.  */
+  return addr + 56;
 }
 
 /* NetBSD 2.0 or later.  */
@@ -85,8 +102,6 @@
 amd64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-  int *sc_reg_offset;
-  int i;
 
   /* Initialize general-purpose register set details first.  */
   tdep->gregset_reg_offset = amd64nbsd_r_reg_offset;
@@ -98,22 +113,10 @@
   tdep->jb_pc_offset = 7 * 8;
 
   /* NetBSD has its own convention for signal trampolines.  */
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, nbsd_pc_in_sigtramp);
-  tdep->sigcontext_addr = amd64nbsd_sigcontext_addr;
-
-  /* Initialize the array with register offsets in `struct
-     sigcontext'.  This `struct sigcontext' has an sc_mcontext member
-     at offset 32, and in <machine/reg.h> we have an explicit comment
-     saying that `struct reg' is the same as mcontext.__gregs.  */
+  tdep->sigtramp_p = amd64nbsd_sigtramp_p;
+  tdep->sigcontext_addr = amd64nbsd_mcontext_addr;
+  tdep->sc_reg_offset = amd64nbsd_r_reg_offset;
   tdep->sc_num_regs = ARRAY_SIZE (amd64nbsd_r_reg_offset);
-  tdep->sc_reg_offset = XCALLOC (tdep->sc_num_regs, int);
-  for (i = 0; i < tdep->sc_num_regs; i++)
-    {
-      if (amd64nbsd_r_reg_offset[i] < 0)
-	tdep->sc_reg_offset[i] = -1;
-      else
-	tdep->sc_reg_offset[i] = 32 + amd64nbsd_r_reg_offset[i];
-    }
 
   /* NetBSD uses SVR4-style shared libraries.  */
   set_solib_svr4_fetch_link_map_offsets
diff --git a/gdb/amd64obsd-nat.c b/gdb/amd64obsd-nat.c
index e8d92fe..0f9b5ef 100644
--- a/gdb/amd64obsd-nat.c
+++ b/gdb/amd64obsd-nat.c
@@ -20,6 +20,8 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
+#include "gdbcore.h"
+#include "regcache.h"
 
 #include "gdb_assert.h"
 
@@ -56,6 +58,76 @@
 };
 
 
+/* Support for debugging kernel virtual memory images.  */
+
+#include <sys/types.h>
+#include <machine/frame.h>
+#include <machine/pcb.h>
+
+#include "bsd-kvm.h"
+
+static int
+amd64obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
+{
+  struct switchframe sf;
+  int regnum;
+
+  /* The following is true for OpenBSD 3.5:
+
+     The pcb contains the stack pointer at the point of the context
+     switch in cpu_switch().  At that point we have a stack frame as
+     described by `struct switchframe', which for OpenBSD 3.5 has the
+     following layout:
+
+     interrupt level
+     %r15
+     %r14
+     %r13
+     %r12
+     %rbp
+     %rbx
+     return address
+
+     Together with %rsp in the pcb, this accounts for all callee-saved
+     registers specified by the psABI.  From this information we
+     reconstruct the register state as it would look when we just
+     returned from cpu_switch().
+
+     For core dumps the pcb is saved by savectx().  In that case the
+     stack frame only contains the return address, and there is no way
+     to recover the other registers.  */
+
+  /* The stack pointer shouldn't be zero.  */
+  if (pcb->pcb_rsp == 0)
+    return 0;
+
+  /* Read the stack frame, and check its validity.  */
+  read_memory (pcb->pcb_rsp, (char *) &sf, sizeof sf);
+  if (sf.sf_rbp == pcb->pcb_rbp)
+    {
+      /* Yes, we have a frame that matches cpu_switch().  */
+      pcb->pcb_rsp += sizeof (struct switchframe);
+      regcache_raw_supply (regcache, 12, &sf.sf_r12);
+      regcache_raw_supply (regcache, 13, &sf.sf_r13);
+      regcache_raw_supply (regcache, 14, &sf.sf_r14);
+      regcache_raw_supply (regcache, 15, &sf.sf_r15);
+      regcache_raw_supply (regcache, AMD64_RBX_REGNUM, &sf.sf_rbx);
+      regcache_raw_supply (regcache, AMD64_RIP_REGNUM, &sf.sf_rip);
+    }
+  else
+    {
+      /* No, the pcb must have been last updated by savectx().  */
+      pcb->pcb_rsp += 8;
+      regcache_raw_supply (regcache, AMD64_RIP_REGNUM, &sf);
+    }
+
+  regcache_raw_supply (regcache, AMD64_RSP_REGNUM, &pcb->pcb_rsp);
+  regcache_raw_supply (regcache, AMD64_RBP_REGNUM, &pcb->pcb_rbp);
+
+  return 1;
+}
+
+
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_amd64obsd_nat (void);
 
@@ -65,4 +137,7 @@
   amd64_native_gregset32_reg_offset = amd64obsd32_r_reg_offset;
   amd64_native_gregset32_num_regs = ARRAY_SIZE (amd64obsd32_r_reg_offset);
   amd64_native_gregset64_reg_offset = amd64obsd_r_reg_offset;
+
+  /* Support debugging kernel virtual memory images.  */
+  bsd_kvm_add_target (amd64obsd_supply_pcb);
 }
diff --git a/gdb/amd64obsd-tdep.c b/gdb/amd64obsd-tdep.c
index 70a9da8..0c742a2 100644
--- a/gdb/amd64obsd-tdep.c
+++ b/gdb/amd64obsd-tdep.c
@@ -22,6 +22,8 @@
 #include "defs.h"
 #include "frame.h"
 #include "gdbcore.h"
+#include "symtab.h"
+#include "objfiles.h"
 #include "osabi.h"
 #include "regset.h"
 #include "target.h"
@@ -40,7 +42,7 @@
 			 struct regcache *regcache, int regnum,
 			 const void *regs, size_t len)
 {
-  const struct gdbarch_tdep *tdep = regset->descr;
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
 
   gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE);
 
@@ -61,11 +63,7 @@
       && sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FXSAVE)
     {
       if (tdep->gregset == NULL)
-	{
-	  tdep->gregset = XMALLOC (struct regset);
-	  tdep->gregset->descr = tdep;
-	  tdep->gregset->supply_regset = amd64obsd_supply_regset;
-	}
+        tdep->gregset = regset_alloc (gdbarch, amd64obsd_supply_regset, NULL);
       return tdep->gregset;
     }
 
@@ -75,11 +73,16 @@
 
 /* Support for signal handlers.  */
 
+/* Default page size.  */
 static const int amd64obsd_page_size = 4096;
 
+/* Return whether the frame preceding NEXT_FRAME corresponds to an
+   OpenBSD sigtramp routine.  */
+
 static int
-amd64obsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
+amd64obsd_sigtramp_p (struct frame_info *next_frame)
 {
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
   CORE_ADDR start_pc = (pc & ~(amd64obsd_page_size - 1));
   const char sigreturn[] =
   {
@@ -87,18 +90,29 @@
     0x67, 0x00, 0x00, 0x00,	/* movq $SYS_sigreturn, %rax */
     0xcd, 0x80			/* int $0x80 */
   };
-  char *buf;
+  char *name, *buf;
 
-  if (name)
+  /* If the function has a valid symbol name, it isn't a
+     trampoline.  */
+  find_pc_partial_function (pc, &name, NULL, NULL);
+  if (name != NULL)
+    return 0;
+
+  /* If the function lives in a valid section (even without a starting
+     point) it isn't a trampoline.  */
+  if (find_pc_section (pc) != NULL)
     return 0;
 
   /* If we can't read the instructions at START_PC, return zero.  */
-  buf = alloca (sizeof sigreturn);
-  if (target_read_memory (start_pc + 0x7, buf, sizeof sigreturn))
+  buf = alloca ((sizeof sigreturn) + 1);
+  if (target_read_memory (start_pc + 6, buf, (sizeof sigreturn) + 1))
     return 0;
 
-  /* Check for sigreturn(2).  */
-  if (memcmp (buf, sigreturn, sizeof sigreturn))
+  /* Check for sigreturn(2).  Depending on how the assembler encoded
+     the `movq %rsp, %rdi' instruction, the code starts at offset 6 or
+     7.  */
+  if (memcmp (buf, sigreturn, sizeof sigreturn)
+      && memcpy (buf + 1, sigreturn, sizeof sigreturn))
     return 0;
 
   return 1;
@@ -110,9 +124,25 @@
 static CORE_ADDR
 amd64obsd_sigcontext_addr (struct frame_info *next_frame)
 {
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  ULONGEST offset = (pc & (amd64obsd_page_size - 1));
+
   /* The %rsp register points at `struct sigcontext' upon entry of a
-     signal trampoline.  */
-  return frame_unwind_register_unsigned (next_frame, AMD64_RSP_REGNUM);
+     signal trampoline.  The relevant part of the trampoline is
+
+        call    *%rax
+        movq    %rsp, %rdi
+        pushq   %rdi
+        movq    $SYS_sigreturn,%rax
+        int     $0x80
+
+     (see /usr/src/sys/arch/amd64/amd64/locore.S).  The `pushq'
+     instruction clobbers %rsp, but its value is saved in `%rdi'.  */
+
+  if (offset > 5)
+    return frame_unwind_register_unsigned (next_frame, AMD64_RDI_REGNUM);
+  else
+    return frame_unwind_register_unsigned (next_frame, AMD64_RSP_REGNUM);
 }
 
 /* OpenBSD 3.5 or later.  */
@@ -195,7 +225,7 @@
 
   tdep->jb_pc_offset = 7 * 8;
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, amd64obsd_pc_in_sigtramp);
+  tdep->sigtramp_p = amd64obsd_sigtramp_p;
   tdep->sigcontext_addr = amd64obsd_sigcontext_addr;
   tdep->sc_reg_offset = amd64obsd_sc_reg_offset;
   tdep->sc_num_regs = ARRAY_SIZE (amd64obsd_sc_reg_offset);
diff --git a/gdb/annotate.c b/gdb/annotate.c
index 0ba9b42..c84c63d 100644
--- a/gdb/annotate.c
+++ b/gdb/annotate.c
@@ -35,11 +35,11 @@
 
 static void breakpoint_changed (struct breakpoint *);
 
-void (*annotate_starting_hook) (void);
-void (*annotate_stopped_hook) (void);
-void (*annotate_signalled_hook) (void);
-void (*annotate_signal_hook) (void);
-void (*annotate_exited_hook) (void);
+void (*deprecated_annotate_starting_hook) (void);
+void (*deprecated_annotate_stopped_hook) (void);
+void (*deprecated_annotate_signalled_hook) (void);
+void (*deprecated_annotate_signal_hook) (void);
+void (*deprecated_annotate_exited_hook) (void);
 
 static int ignore_count_changed = 0;
 
@@ -102,8 +102,8 @@
 annotate_starting (void)
 {
 
-  if (annotate_starting_hook)
-    annotate_starting_hook ();
+  if (deprecated_annotate_starting_hook)
+    deprecated_annotate_starting_hook ();
   else
     {
       if (annotation_level > 1)
@@ -116,8 +116,8 @@
 void
 annotate_stopped (void)
 {
-  if (annotate_stopped_hook)
-    annotate_stopped_hook ();
+  if (deprecated_annotate_stopped_hook)
+    deprecated_annotate_stopped_hook ();
   else
     {
       if (annotation_level > 1)
@@ -133,8 +133,8 @@
 void
 annotate_exited (int exitstatus)
 {
-  if (annotate_exited_hook)
-    annotate_exited_hook ();
+  if (deprecated_annotate_exited_hook)
+    deprecated_annotate_exited_hook ();
   else
     {
       if (annotation_level > 1)
@@ -145,8 +145,8 @@
 void
 annotate_signalled (void)
 {
-  if (annotate_signalled_hook)
-    annotate_signalled_hook ();
+  if (deprecated_annotate_signalled_hook)
+    deprecated_annotate_signalled_hook ();
 
   if (annotation_level > 1)
     printf_filtered ("\n\032\032signalled\n");
@@ -183,8 +183,8 @@
 void
 annotate_signal (void)
 {
-  if (annotate_signal_hook)
-    annotate_signal_hook ();
+  if (deprecated_annotate_signal_hook)
+    deprecated_annotate_signal_hook ();
 
   if (annotation_level > 1)
     printf_filtered ("\n\032\032signal\n");
@@ -579,7 +579,7 @@
 {
   if (annotation_level > 1)
     {
-      delete_breakpoint_hook = breakpoint_changed;
-      modify_breakpoint_hook = breakpoint_changed;
+      deprecated_delete_breakpoint_hook = breakpoint_changed;
+      deprecated_modify_breakpoint_hook = breakpoint_changed;
     }
 }
diff --git a/gdb/annotate.h b/gdb/annotate.h
index ac3cec8..cca14d3 100644
--- a/gdb/annotate.h
+++ b/gdb/annotate.h
@@ -99,8 +99,8 @@
 extern void annotate_elt (void);
 extern void annotate_array_section_end (void);
 
-extern void (*annotate_starting_hook) (void);
-extern void (*annotate_stopped_hook) (void);
-extern void (*annotate_signalled_hook) (void);
-extern void (*annotate_signal_hook) (void);
-extern void (*annotate_exited_hook) (void);
+extern void (*deprecated_annotate_starting_hook) (void);
+extern void (*deprecated_annotate_stopped_hook) (void);
+extern void (*deprecated_annotate_signalled_hook) (void);
+extern void (*deprecated_annotate_signal_hook) (void);
+extern void (*deprecated_annotate_exited_hook) (void);
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index d76a8e4..d7bbe6c 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -1,7 +1,7 @@
 /* Dynamic architecture support for GDB, the GNU debugger.
 
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
-   Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -30,7 +30,7 @@
 #include "regcache.h"
 #include "gdb_assert.h"
 #include "sim-regno.h"
-
+#include "gdbcore.h"
 #include "osabi.h"
 
 #include "version.h"
@@ -60,13 +60,46 @@
   DEPRECATED_STORE_RETURN_VALUE (type, b);
 }
 
-
 int
 always_use_struct_convention (int gcc_p, struct type *value_type)
 {
   return 1;
 }
 
+enum return_value_convention
+legacy_return_value (struct gdbarch *gdbarch, struct type *valtype,
+		     struct regcache *regcache, void *readbuf,
+		     const void *writebuf)
+{
+  /* NOTE: cagney/2004-06-13: The gcc_p parameter to
+     USE_STRUCT_CONVENTION isn't used.  */
+  int struct_return = ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
+			|| TYPE_CODE (valtype) == TYPE_CODE_UNION
+			|| TYPE_CODE (valtype) == TYPE_CODE_ARRAY)
+		       && DEPRECATED_USE_STRUCT_CONVENTION (0, valtype));
+
+  if (writebuf != NULL)
+    {
+      gdb_assert (!struct_return);
+      /* NOTE: cagney/2004-06-13: See stack.c:return_command.  Old
+	 architectures don't expect STORE_RETURN_VALUE to handle small
+	 structures.  Should not be called with such types.  */
+      gdb_assert (TYPE_CODE (valtype) != TYPE_CODE_STRUCT
+		  && TYPE_CODE (valtype) != TYPE_CODE_UNION);
+      STORE_RETURN_VALUE (valtype, regcache, writebuf);
+    }
+
+  if (readbuf != NULL)
+    {
+      gdb_assert (!struct_return);
+      EXTRACT_RETURN_VALUE (valtype, regcache, readbuf);
+    }
+
+  if (struct_return)
+    return RETURN_VALUE_STRUCT_CONVENTION;
+  else
+    return RETURN_VALUE_REGISTER_CONVENTION;
+}
 
 int
 legacy_register_sim_regno (int regnum)
@@ -84,12 +117,6 @@
     return LEGACY_SIM_REGNO_IGNORE;
 }
 
-int
-generic_return_value_on_stack_not (struct type *type)
-{
-  return 0;
-}
-
 CORE_ADDR
 generic_skip_trampoline_code (CORE_ADDR pc)
 {
@@ -120,13 +147,6 @@
   return 0;
 }
 
-#if defined (CALL_DUMMY)
-LONGEST legacy_call_dummy_words[] = CALL_DUMMY;
-#else
-LONGEST legacy_call_dummy_words[1];
-#endif
-int legacy_sizeof_call_dummy_words = sizeof (legacy_call_dummy_words);
-
 void
 generic_remote_translate_xfer_address (struct gdbarch *gdbarch,
 				       struct regcache *regcache,
@@ -298,42 +318,17 @@
 int
 legacy_pc_in_sigtramp (CORE_ADDR pc, char *name)
 {
-#if !defined (DEPRECATED_IN_SIGTRAMP)
-  if (DEPRECATED_SIGTRAMP_START_P ())
-    return ((pc) >= DEPRECATED_SIGTRAMP_START (pc)
-	    && (pc) < DEPRECATED_SIGTRAMP_END (pc));
-  else
-    return name && strcmp ("_sigtramp", name) == 0;
-#else
+#if defined (DEPRECATED_IN_SIGTRAMP)
   return DEPRECATED_IN_SIGTRAMP (pc, name);
+#else
+  return name && strcmp ("_sigtramp", name) == 0;
 #endif
 }
 
 int
-legacy_convert_register_p (int regnum, struct type *type)
+generic_convert_register_p (int regnum, struct type *type)
 {
-  return (DEPRECATED_REGISTER_CONVERTIBLE_P ()
-	  && DEPRECATED_REGISTER_CONVERTIBLE (regnum));
-}
-
-void
-legacy_register_to_value (struct frame_info *frame, int regnum,
-			  struct type *type, void *to)
-{
-  char from[MAX_REGISTER_SIZE];
-  get_frame_register (frame, regnum, from);
-  DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to);
-}
-
-void
-legacy_value_to_register (struct frame_info *frame, int regnum,
-			  struct type *type, const void *tmp)
-{
-  char to[MAX_REGISTER_SIZE];
-  char *from = alloca (TYPE_LENGTH (type));
-  memcpy (from, from, TYPE_LENGTH (type));
-  DEPRECATED_REGISTER_CONVERT_TO_RAW (type, regnum, from, to);
-  put_frame_register (frame, regnum, to);
+  return 0;
 }
 
 int
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index 8f2e601..4d1e48e 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -1,7 +1,7 @@
 /* Dynamic architecture support for GDB, the GNU debugger.
 
-   Copyright 1998, 1999, 2000, 2002, 2003 Free Software Foundation,
-   Inc.
+   Copyright 1998, 1999, 2000, 2002, 2003, 2004 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -32,6 +32,15 @@
 /* gdbarch trace variable */
 extern int gdbarch_debug;
 
+/* An implementation of return_value that props up architectures still
+   using USE_STRUCT_RETURN, EXTRACT_RETURN_VALUE and
+   STORE_RETURN_VALUE.  See also the hacks in "stack.c".  */
+enum return_value_convention legacy_return_value (struct gdbarch *gdbarch,
+						  struct type *valtype,
+						  struct regcache *regcache,
+						  void *readbuf,
+						  const void *writebuf);
+
 /* Implementation of extract return value that grubs around in the
    register cache.  */
 extern gdbarch_extract_return_value_ftype legacy_extract_return_value;
@@ -41,16 +50,7 @@
 
 /* To return any structure or union type by value, store it at the
    address passed as an invisible first argument to the function.  */
-extern gdbarch_use_struct_convention_ftype always_use_struct_convention;
-
-/* Only structures, unions, and arrays are returned using the struct
-   convention.  Note that arrays are never passed by value in the C
-   language family, so that case is irrelevant for C.  */
-extern gdbarch_return_value_on_stack_ftype generic_return_value_on_stack_not;
-
-/* Backward compatible call_dummy_words. */
-extern LONGEST legacy_call_dummy_words[];
-extern int legacy_sizeof_call_dummy_words;
+extern gdbarch_deprecated_use_struct_convention_ftype always_use_struct_convention;
 
 /* Typical remote_translate_xfer_address */
 extern gdbarch_remote_translate_xfer_address_ftype generic_remote_translate_xfer_address;
@@ -117,16 +117,8 @@
 /* Prop up old targets that use various sigtramp macros.  */
 extern int legacy_pc_in_sigtramp (CORE_ADDR pc, char *name);
 
-/* The orginal register_convert*() functions were overloaded.  They
-   were used to both: convert between virtual and raw register formats
-   (something that is discouraged); and to convert a register to the
-   type of a corresponding variable.  These legacy functions preserve
-   that overloaded behavour in existing targets.  */
-extern int legacy_convert_register_p (int regnum, struct type *type);
-extern void legacy_register_to_value (struct frame_info *frame, int regnum,
-				      struct type *type, void *to);
-extern void legacy_value_to_register (struct frame_info *frame, int regnum,
-				      struct type *type, const void *from);
+/* By default, registers are not convertible.  */
+extern int generic_convert_register_p (int regnum, struct type *type);
 
 extern int default_stabs_argument_has_addr (struct gdbarch *gdbarch,
 					    struct type *type);
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 42d4438..98dacca 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -44,22 +44,8 @@
 
 static const char arm_linux_arm_be_breakpoint[] = { 0xef, 0x9f, 0x00, 0x01 };
 
-/* DEPRECATED_CALL_DUMMY_WORDS:
-   This sequence of words is the instructions
-
-   mov  lr, pc
-   mov  pc, r4
-   swi	bkpt_swi
-
-   Note this is 12 bytes.  */
-
-LONGEST arm_linux_call_dummy_words[] =
-{
-  0xe1a0e00f, 0xe1a0f004, 0xef9f001
-};
-
 /* Description of the longjmp buffer.  */
-#define ARM_LINUX_JB_ELEMENT_SIZE	INT_REGISTER_RAW_SIZE
+#define ARM_LINUX_JB_ELEMENT_SIZE	INT_REGISTER_SIZE
 #define ARM_LINUX_JB_PC			21
 
 /* Extract from an array REGBUF containing the (raw) register state
@@ -130,7 +116,7 @@
       /* ANSI C code passes float arguments as integers, K&R code
          passes float arguments as doubles.  Correct for this here.  */
       if (TYPE_CODE_FLT == TYPE_CODE (arg_type) && DEPRECATED_REGISTER_SIZE == len)
-	nstack_size += FP_REGISTER_VIRTUAL_SIZE;
+	nstack_size += TARGET_DOUBLE_BIT / TARGET_CHAR_BIT;
       else
 	nstack_size += len;
     }
@@ -490,9 +476,6 @@
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, arm_linux_svr4_fetch_link_map_offsets);
 
-  set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_linux_call_dummy_words);
-  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (arm_linux_call_dummy_words));
-
   /* The following two overrides shouldn't be needed.  */
   set_gdbarch_deprecated_extract_return_value (gdbarch, arm_linux_extract_return_value);
   set_gdbarch_deprecated_push_arguments (gdbarch, arm_linux_push_arguments);
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 91a200d..9367898 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -191,7 +191,7 @@
 
 /* Flag set by arm_fix_call_dummy that tells whether the calling
    function is a Thumb function.  This flag is checked by
-   arm_pc_is_thumb and arm_call_dummy_breakpoint_offset.  */
+   arm_pc_is_thumb.  */
 
 static int caller_is_thumb;
 
@@ -234,7 +234,7 @@
      frame location (true if we have not pushed large data structures or
      gone too many levels deep) and that our 1024 is not enough to consider
      code regions as part of the stack (true for most practical purposes).  */
-  if (DEPRECATED_PC_IN_CALL_DUMMY (memaddr, sp, sp + 1024))
+  if (deprecated_pc_in_call_dummy (memaddr))
     return caller_is_thumb;
   else
     return 0;
@@ -291,7 +291,7 @@
 	stmdb sp!, {}
 	sub sp, ip, #4.  */
 
-  func_start = (get_frame_func (fi) + FUNCTION_START_OFFSET);
+  func_start = (get_frame_func (fi) + DEPRECATED_FUNCTION_START_OFFSET);
   after_prologue = SKIP_PROLOGUE (func_start);
 
   /* There are some frameless functions whose first two instructions
@@ -407,7 +407,7 @@
   struct symtab_and_line sal;
 
   /* If we're in a dummy frame, don't even try to skip the prologue.  */
-  if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0))
+  if (deprecated_pc_in_call_dummy (pc))
     return pc;
 
   /* See what the symbol table says.  */
@@ -993,15 +993,6 @@
     return;
 
   id = frame_id_build (cache->prev_sp, func);
-
-  /* Check that we're not going round in circles with the same frame
-     ID (but avoid applying the test to sentinel frames which do go
-     round in circles).  */
-  if (frame_relative_level (next_frame) >= 0
-      && get_frame_type (next_frame) == NORMAL_FRAME
-      && frame_id_eq (get_frame_id (next_frame), id))
-    return;
-
   *this_id = id;
 }
 
@@ -1094,7 +1085,7 @@
   cache->framereg = ARM_SP_REGNUM;
   cache->prev_sp
     = read_memory_integer (cache->saved_regs[cache->framereg].addr,
-			   DEPRECATED_REGISTER_RAW_SIZE (cache->framereg));
+			   register_size (current_gdbarch, cache->framereg));
 
   return cache;
 }
@@ -1144,13 +1135,8 @@
 static const struct frame_unwind *
 arm_sigtramp_unwind_sniffer (struct frame_info *next_frame)
 {
-  /* Note: If an ARM DEPRECATED_PC_IN_SIGTRAMP method ever needs to
-     compare against the name of the function, the code below will
-     have to be changed to first fetch the name of the function and
-     then pass this name to DEPRECATED_PC_IN_SIGTRAMP.  */
-
   if (SIGCONTEXT_REGISTER_ADDRESS_P ()
-      && DEPRECATED_PC_IN_SIGTRAMP (frame_pc_unwind (next_frame), (char *) 0))
+      && legacy_pc_in_sigtramp (frame_pc_unwind (next_frame), (char *) 0))
     return &arm_sigtramp_unwind;
 
   return NULL;
@@ -1187,20 +1173,6 @@
   return frame_unwind_register_unsigned (this_frame, ARM_SP_REGNUM);
 }
 
-/* DEPRECATED_CALL_DUMMY_WORDS:
-   This sequence of words is the instructions
-
-   mov  lr,pc
-   mov  pc,r4
-   illegal
-
-   Note this is 12 bytes.  */
-
-static LONGEST arm_call_dummy_words[] =
-{
-  0xe1a0e00f, 0xe1a0f004, 0xe7ffdefe
-};
-
 /* When arguments must be pushed onto the stack, they go on in reverse
    order.  The code below implements a FILO (stack) to do this.  */
 
@@ -1238,7 +1210,7 @@
    we should probably support some of them based on the selected ABI.  */
 
 static CORE_ADDR
-arm_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		     struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
 		     struct value **args, CORE_ADDR sp, int struct_return,
 		     CORE_ADDR struct_addr)
@@ -1396,7 +1368,7 @@
    register N.  */
 
 static struct type *
-arm_register_type (int regnum)
+arm_register_type (struct gdbarch *gdbarch, int regnum)
 {
   if (regnum >= ARM_F0_REGNUM && regnum < ARM_F0_REGNUM + NUM_FREGS)
     {
@@ -1416,44 +1388,16 @@
 arm_register_byte (int regnum)
 {
   if (regnum < ARM_F0_REGNUM)
-    return regnum * INT_REGISTER_RAW_SIZE;
+    return regnum * INT_REGISTER_SIZE;
   else if (regnum < ARM_PS_REGNUM)
-    return (NUM_GREGS * INT_REGISTER_RAW_SIZE
-	    + (regnum - ARM_F0_REGNUM) * FP_REGISTER_RAW_SIZE);
+    return (NUM_GREGS * INT_REGISTER_SIZE
+	    + (regnum - ARM_F0_REGNUM) * FP_REGISTER_SIZE);
   else
-    return (NUM_GREGS * INT_REGISTER_RAW_SIZE
-	    + NUM_FREGS * FP_REGISTER_RAW_SIZE
+    return (NUM_GREGS * INT_REGISTER_SIZE
+	    + NUM_FREGS * FP_REGISTER_SIZE
 	    + (regnum - ARM_FPS_REGNUM) * STATUS_REGISTER_SIZE);
 }
 
-/* Number of bytes of storage in the actual machine representation for
-   register N.  All registers are 4 bytes, except fp0 - fp7, which are
-   12 bytes in length.  */
-
-static int
-arm_register_raw_size (int regnum)
-{
-  if (regnum < ARM_F0_REGNUM)
-    return INT_REGISTER_RAW_SIZE;
-  else if (regnum < ARM_FPS_REGNUM)
-    return FP_REGISTER_RAW_SIZE;
-  else
-    return STATUS_REGISTER_SIZE;
-}
-
-/* Number of bytes of storage in a program's representation
-   for register N.  */
-static int
-arm_register_virtual_size (int regnum)
-{
-  if (regnum < ARM_F0_REGNUM)
-    return INT_REGISTER_VIRTUAL_SIZE;
-  else if (regnum < ARM_FPS_REGNUM)
-    return FP_REGISTER_VIRTUAL_SIZE;
-  else
-    return STATUS_REGISTER_SIZE;
-}
-
 /* Map GDB internal REGNUM onto the Arm simulator register numbers.  */
 static int
 arm_register_sim_regno (int regnum)
@@ -2082,7 +2026,7 @@
 	    /* The value is in register F0 in internal format.  We need to
 	       extract the raw value and then convert it to the desired
 	       internal type.  */
-	    bfd_byte tmpbuf[FP_REGISTER_RAW_SIZE];
+	    bfd_byte tmpbuf[FP_REGISTER_SIZE];
 
 	    regcache_cooked_read (regs, ARM_F0_REGNUM, tmpbuf);
 	    convert_from_extended (floatformat_from_type (type), tmpbuf,
@@ -2095,7 +2039,7 @@
 	  regcache_cooked_read (regs, ARM_A1_REGNUM, valbuf);
 	  if (TYPE_LENGTH (type) > 4)
 	    regcache_cooked_read (regs, ARM_A1_REGNUM + 1,
-				  valbuf + INT_REGISTER_RAW_SIZE);
+				  valbuf + INT_REGISTER_SIZE);
 	  break;
 
 	default:
@@ -2124,11 +2068,11 @@
 	     anything special for small big-endian values.  */
 	  regcache_cooked_read_unsigned (regs, regno++, &tmp);
 	  store_unsigned_integer (valbuf, 
-				  (len > INT_REGISTER_RAW_SIZE
-				   ? INT_REGISTER_RAW_SIZE : len),
+				  (len > INT_REGISTER_SIZE
+				   ? INT_REGISTER_SIZE : len),
 				  tmp);
-	  len -= INT_REGISTER_RAW_SIZE;
-	  valbuf += INT_REGISTER_RAW_SIZE;
+	  len -= INT_REGISTER_SIZE;
+	  valbuf += INT_REGISTER_SIZE;
 	}
     }
   else
@@ -2138,15 +2082,15 @@
          registers with 32-bit load instruction(s).  */
       int len = TYPE_LENGTH (type);
       int regno = ARM_A1_REGNUM;
-      bfd_byte tmpbuf[INT_REGISTER_RAW_SIZE];
+      bfd_byte tmpbuf[INT_REGISTER_SIZE];
 
       while (len > 0)
 	{
 	  regcache_cooked_read (regs, regno++, tmpbuf);
 	  memcpy (valbuf, tmpbuf,
-		  len > INT_REGISTER_RAW_SIZE ? INT_REGISTER_RAW_SIZE : len);
-	  len -= INT_REGISTER_RAW_SIZE;
-	  valbuf += INT_REGISTER_RAW_SIZE;
+		  len > INT_REGISTER_SIZE ? INT_REGISTER_SIZE : len);
+	  len -= INT_REGISTER_SIZE;
+	  valbuf += INT_REGISTER_SIZE;
 	}
     }
 }
@@ -2270,7 +2214,7 @@
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT)
     {
-      char buf[ARM_MAX_REGISTER_RAW_SIZE];
+      char buf[MAX_REGISTER_SIZE];
 
       switch (arm_get_fp_model (current_gdbarch))
 	{
@@ -2285,7 +2229,7 @@
 	  regcache_cooked_write (regs, ARM_A1_REGNUM, valbuf);
 	  if (TYPE_LENGTH (type) > 4)
 	    regcache_cooked_write (regs, ARM_A1_REGNUM + 1, 
-				   valbuf + INT_REGISTER_RAW_SIZE);
+				   valbuf + INT_REGISTER_SIZE);
 	  break;
 
 	default:
@@ -2306,10 +2250,10 @@
 	{
 	  /* Values of one word or less are zero/sign-extended and
 	     returned in r0.  */
-	  bfd_byte tmpbuf[INT_REGISTER_RAW_SIZE];
+	  bfd_byte tmpbuf[INT_REGISTER_SIZE];
 	  LONGEST val = unpack_long (type, valbuf);
 
-	  store_signed_integer (tmpbuf, INT_REGISTER_RAW_SIZE, val);
+	  store_signed_integer (tmpbuf, INT_REGISTER_SIZE, val);
 	  regcache_cooked_write (regs, ARM_A1_REGNUM, tmpbuf);
 	}
       else
@@ -2323,8 +2267,8 @@
 	  while (len > 0)
 	    {
 	      regcache_cooked_write (regs, regno++, valbuf);
-	      len -= INT_REGISTER_RAW_SIZE;
-	      valbuf += INT_REGISTER_RAW_SIZE;
+	      len -= INT_REGISTER_SIZE;
+	      valbuf += INT_REGISTER_SIZE;
 	    }
 	}
     }
@@ -2335,15 +2279,15 @@
          registers with 32-bit load instruction(s).  */
       int len = TYPE_LENGTH (type);
       int regno = ARM_A1_REGNUM;
-      bfd_byte tmpbuf[INT_REGISTER_RAW_SIZE];
+      bfd_byte tmpbuf[INT_REGISTER_SIZE];
 
       while (len > 0)
 	{
 	  memcpy (tmpbuf, valbuf,
-		  len > INT_REGISTER_RAW_SIZE ? INT_REGISTER_RAW_SIZE : len);
+		  len > INT_REGISTER_SIZE ? INT_REGISTER_SIZE : len);
 	  regcache_cooked_write (regs, regno++, tmpbuf);
-	  len -= INT_REGISTER_RAW_SIZE;
-	  valbuf += INT_REGISTER_RAW_SIZE;
+	  len -= INT_REGISTER_SIZE;
+	  valbuf += INT_REGISTER_SIZE;
 	}
     }
 }
@@ -2352,16 +2296,16 @@
 arm_get_longjmp_target (CORE_ADDR *pc)
 {
   CORE_ADDR jb_addr;
-  char buf[INT_REGISTER_RAW_SIZE];
+  char buf[INT_REGISTER_SIZE];
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   
   jb_addr = read_register (ARM_A1_REGNUM);
 
   if (target_read_memory (jb_addr + tdep->jb_pc * tdep->jb_elt_size, buf,
-			  INT_REGISTER_RAW_SIZE))
+			  INT_REGISTER_SIZE))
     return 0;
 
-  *pc = extract_unsigned_integer (buf, INT_REGISTER_RAW_SIZE);
+  *pc = extract_unsigned_integer (buf, INT_REGISTER_SIZE);
   return 1;
 }
 
@@ -2766,9 +2710,6 @@
   tdep->lowest_pc = 0x20;
   tdep->jb_pc = -1;	/* Longjump support not enabled by default.  */
 
-  set_gdbarch_deprecated_call_dummy_words (gdbarch, arm_call_dummy_words);
-  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
-
   set_gdbarch_push_dummy_call (gdbarch, arm_push_dummy_call);
 
   set_gdbarch_write_pc (gdbarch, arm_write_pc);
@@ -2805,15 +2746,11 @@
   set_gdbarch_pc_regnum (gdbarch, ARM_PC_REGNUM);
   set_gdbarch_deprecated_register_byte (gdbarch, arm_register_byte);
   set_gdbarch_deprecated_register_bytes (gdbarch,
-					 (NUM_GREGS * INT_REGISTER_RAW_SIZE
-					  + NUM_FREGS * FP_REGISTER_RAW_SIZE
+					 (NUM_GREGS * INT_REGISTER_SIZE
+					  + NUM_FREGS * FP_REGISTER_SIZE
 					  + NUM_SREGS * STATUS_REGISTER_SIZE));
   set_gdbarch_num_regs (gdbarch, NUM_GREGS + NUM_FREGS + NUM_SREGS);
-  set_gdbarch_deprecated_register_raw_size (gdbarch, arm_register_raw_size);
-  set_gdbarch_deprecated_register_virtual_size (gdbarch, arm_register_virtual_size);
-  set_gdbarch_deprecated_max_register_raw_size (gdbarch, FP_REGISTER_RAW_SIZE);
-  set_gdbarch_deprecated_max_register_virtual_size (gdbarch, FP_REGISTER_VIRTUAL_SIZE);
-  set_gdbarch_deprecated_register_virtual_type (gdbarch, arm_register_type);
+  set_gdbarch_register_type (gdbarch, arm_register_type);
 
   /* Internal <-> external register number maps.  */
   set_gdbarch_register_sim_regno (gdbarch, arm_register_sim_regno);
@@ -2825,7 +2762,7 @@
   /* Returning results.  */
   set_gdbarch_extract_return_value (gdbarch, arm_extract_return_value);
   set_gdbarch_store_return_value (gdbarch, arm_store_return_value);
-  set_gdbarch_use_struct_convention (gdbarch, arm_use_struct_convention);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, arm_use_struct_convention);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, arm_extract_struct_value_address);
 
   /* Single stepping.  */
diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h
index 26f3a83..bb30455 100644
--- a/gdb/arm-tdep.h
+++ b/gdb/arm-tdep.h
@@ -45,24 +45,13 @@
   ARM_LAST_FP_ARG_REGNUM = ARM_F3_REGNUM
 };
 
-/* Used in target-specific code when we need to know the size of the
-   largest type of register we need to handle.  */
-#define ARM_MAX_REGISTER_RAW_SIZE	12
-#define ARM_MAX_REGISTER_VIRTUAL_SIZE	8
-
 /* Size of integer registers.  */
-#define INT_REGISTER_RAW_SIZE		4
-#define INT_REGISTER_VIRTUAL_SIZE	4
+#define INT_REGISTER_SIZE		4
 
 /* Say how long FP registers are.  Used for documentation purposes and
    code readability in this header.  IEEE extended doubles are 80
    bits.  DWORD aligned they use 96 bits.  */
-#define FP_REGISTER_RAW_SIZE	12
-
-/* GCC doesn't support long doubles (extended IEEE values).  The FP
-   register virtual size is therefore 64 bits.  Used for documentation
-   purposes and code readability in this header.  */
-#define FP_REGISTER_VIRTUAL_SIZE	8
+#define FP_REGISTER_SIZE	12
 
 /* Status registers are the same size as general purpose registers.
    Used for documentation purposes and code readability in this
diff --git a/gdb/armnbsd-nat.c b/gdb/armnbsd-nat.c
index 88396c0..0a12174 100644
--- a/gdb/armnbsd-nat.c
+++ b/gdb/armnbsd-nat.c
@@ -459,6 +459,6 @@
 void
 _initialize_arm_netbsd_nat (void)
 {
-  add_core_fns (&arm_netbsd_core_fns);
-  add_core_fns (&arm_netbsd_elfcore_fns);
+  deprecated_add_core_fns (&arm_netbsd_core_fns);
+  deprecated_add_core_fns (&arm_netbsd_elfcore_fns);
 }
diff --git a/gdb/armnbsd-tdep.c b/gdb/armnbsd-tdep.c
index 88cf2e5..38edf9f 100644
--- a/gdb/armnbsd-tdep.c
+++ b/gdb/armnbsd-tdep.c
@@ -1,5 +1,6 @@
 /* Target-specific functions for ARM running under NetBSD.
-   Copyright 2002, 2003 Free Software Foundation, Inc.
+
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,13 +22,15 @@
 #include "defs.h"
 #include "osabi.h"
 
+#include "gdb_string.h"
+
 #include "arm-tdep.h"
 #include "nbsd-tdep.h"
 #include "solib-svr4.h"
 
 /* Description of the longjmp buffer.  */
 #define ARM_NBSD_JB_PC 24
-#define ARM_NBSD_JB_ELEMENT_SIZE INT_REGISTER_RAW_SIZE
+#define ARM_NBSD_JB_ELEMENT_SIZE INT_REGISTER_SIZE
 
 /* For compatibility with previous implemenations of GDB on arm/NetBSD,
    override the default little-endian breakpoint.  */
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index d9c16a5..eabff9c 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -966,16 +966,6 @@
     return;
 
   id = frame_id_build (base, func);
-
-  /* Check that we're not going round in circles with the same frame
-     ID (but avoid applying the test to sentinel frames which do go
-     round in circles).  Can't use frame_id_eq() as that doesn't yet
-     compare the frame's PC value.  */
-  if (frame_relative_level (next_frame) >= 0
-      && get_frame_type (next_frame) != DUMMY_FRAME
-      && frame_id_eq (get_frame_id (next_frame), id))
-    return;
-
   (*this_id) = id;
 }
 
@@ -1156,7 +1146,7 @@
    registers R0 to R2. */
 
 static CORE_ADDR
-avr_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                      struct regcache *regcache, CORE_ADDR bp_addr,
                      int nargs, struct value **args, CORE_ADDR sp,
                      int struct_return, CORE_ADDR struct_addr)
@@ -1302,8 +1292,6 @@
   set_gdbarch_address_to_pointer (gdbarch, avr_address_to_pointer);
   set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address);
 
-  set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention);
-
   set_gdbarch_skip_prologue (gdbarch, avr_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 5fd20f0..eb03225 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -43,34 +43,6 @@
 
 void _initialize_blockframe (void);
 
-/* Is ADDR inside the startup file?  Note that if your machine has a
-   way to detect the bottom of the stack, there is no need to call
-   this function from DEPRECATED_FRAME_CHAIN_VALID; the reason for
-   doing so is that some machines have no way of detecting bottom of
-   stack.
-
-   A PC of zero is always considered to be the bottom of the stack. */
-
-int
-deprecated_inside_entry_file (CORE_ADDR addr)
-{
-  if (addr == 0)
-    return 1;
-  if (symfile_objfile == 0)
-    return 0;
-  if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT
-      || CALL_DUMMY_LOCATION == AT_SYMBOL)
-    {
-      /* Do not stop backtracing if the pc is in the call dummy
-         at the entry point.  */
-      /* FIXME: Won't always work with zeros for the last two arguments */
-      if (DEPRECATED_PC_IN_CALL_DUMMY (addr, 0, 0))
-	return 0;
-    }
-  return (addr >= symfile_objfile->ei.deprecated_entry_file_lowpc &&
-	  addr < symfile_objfile->ei.deprecated_entry_file_highpc);
-}
-
 /* Test whether PC is in the range of addresses that corresponds to
    the "main" function.  */
 
@@ -163,28 +135,6 @@
   return (get_frame_func (this_frame) == entry_point_address ());
 }
 
-/* Similar to inside_entry_func, but accomodating legacy frame code.  */
-
-static int
-legacy_inside_entry_func (CORE_ADDR pc)
-{
-  if (symfile_objfile == 0)
-    return 0;
-
-  if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT)
-    {
-      /* Do not stop backtracing if the program counter is in the call
-         dummy at the entry point.  */
-      /* FIXME: This won't always work with zeros for the last two
-         arguments.  */
-      if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0))
-	return 0;
-    }
-
-  return (symfile_objfile->ei.entry_func_lowpc <= pc
-	  && symfile_objfile->ei.entry_func_highpc > pc);
-}
-
 /* Return nonzero if the function for this frame lacks a prologue.
    Many machines can define DEPRECATED_FRAMELESS_FUNCTION_INVOCATION
    to just call this function.  */
@@ -197,7 +147,7 @@
   func_start = get_frame_func (frame);
   if (func_start)
     {
-      func_start += FUNCTION_START_OFFSET;
+      func_start += DEPRECATED_FUNCTION_START_OFFSET;
       /* NOTE: cagney/2004-02-09: Eliminated per-architecture
          PROLOGUE_FRAMELESS_P call as architectures with custom
          implementations had all been deleted.  Eventually even this
@@ -380,23 +330,6 @@
       && section == cache_pc_function_section)
     goto return_cached_value;
 
-  /* If sigtramp is in the u area, it counts as a function (especially
-     important for step_1).  */
-  /* NOTE: cagney/2004-03-16: Determining if the PC is in a signal
-     trampoline typically depends on the detailed analysis of dynamic
-     information obtained from the inferior yet this function is
-     expected to work using static information obtained from the
-     symbol table.  */
-  if (DEPRECATED_SIGTRAMP_START_P ()
-      && DEPRECATED_PC_IN_SIGTRAMP (mapped_pc, (char *) NULL))
-    {
-      cache_pc_function_low = DEPRECATED_SIGTRAMP_START (mapped_pc);
-      cache_pc_function_high = DEPRECATED_SIGTRAMP_END (mapped_pc);
-      cache_pc_function_name = "<sigtramp>";
-      cache_pc_function_section = section;
-      goto return_cached_value;
-    }
-
   msymbol = lookup_minimal_symbol_by_pc_section (mapped_pc, section);
   pst = find_pc_sect_psymtab (mapped_pc, section);
   if (pst)
@@ -564,33 +497,6 @@
    below is for infrun.c, which may give the macro a pc without that
    subtracted out.  */
 
-/* Is the PC in a call dummy?  SP and FRAME_ADDRESS are the bottom and
-   top of the stack frame which we are checking, where "bottom" and
-   "top" refer to some section of memory which contains the code for
-   the call dummy.  Calls to this macro assume that the contents of
-   SP_REGNUM and DEPRECATED_FP_REGNUM (or the saved values thereof),
-   respectively, are the things to pass.
-
-   This won't work on the 29k, where SP_REGNUM and
-   DEPRECATED_FP_REGNUM don't have that meaning, but the 29k doesn't
-   use ON_STACK.  This could be fixed by generalizing this scheme,
-   perhaps by passing in a frame and adding a few fields, at least on
-   machines which need them for DEPRECATED_PC_IN_CALL_DUMMY.
-
-   Something simpler, like checking for the stack segment, doesn't work,
-   since various programs (threads implementations, gcc nested function
-   stubs, etc) may either allocate stack frames in another segment, or
-   allocate other kinds of code on the stack.  */
-
-int
-deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc, CORE_ADDR sp,
-				      CORE_ADDR frame_address)
-{
-  return (INNER_THAN ((sp), (pc))
-	  && (frame_address != 0)
-	  && INNER_THAN ((pc), (frame_address)));
-}
-
 /* Returns true for a user frame or a call_function_by_hand dummy
    frame, and false for the CRT0 start-up frame.  Purpose is to
    terminate backtrace.  */
@@ -599,8 +505,7 @@
 legacy_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
 {
   /* Don't prune CALL_DUMMY frames.  */
-  if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
-      && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
     return 1;
 
   /* If the new frame pointer is zero, then it isn't valid.  */
@@ -617,17 +522,10 @@
   if (DEPRECATED_FRAME_CHAIN_VALID_P ())
     return DEPRECATED_FRAME_CHAIN_VALID (fp, fi);
 
-  /* If we're already inside the entry function for the main objfile, then it
-     isn't valid.  */
-  if (legacy_inside_entry_func (get_frame_pc (fi)))
+  /* If we're already inside the entry function for the main objfile,
+     then it isn't valid.  */
+  if (inside_entry_func (fi))
     return 0;
 
-  /* If we're inside the entry file, it isn't valid.  */
-  /* NOTE/drow 2002-12-25: should there be a way to disable this check?  It
-     assumes a single small entry file, and the way some debug readers (e.g.
-     dbxread) figure out which object is the entry file is somewhat hokey.  */
-  if (deprecated_inside_entry_file (frame_pc_unwind (fi)))
-      return 0;
-
   return 1;
 }
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 61b7225..018f464 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -266,13 +266,13 @@
 /* Pointer to current exception event record */
 static struct exception_event_record *current_exception_event;
 
-/* Indicator of whether exception catchpoints should be nuked
-   between runs of a program */
-int exception_catchpoints_are_fragile = 0;
+/* Indicator of whether exception catchpoints should be nuked between
+   runs of a program.  */
+int deprecated_exception_catchpoints_are_fragile = 0;
 
 /* Indicator of when exception catchpoints set-up should be
-   reinitialized -- e.g. when program is re-run */
-int exception_support_initialized = 0;
+   reinitialized -- e.g. when program is re-run.  */
+int deprecated_exception_support_initialized = 0;
 
 /* This function returns a pointer to the string representation of the
    pathname of the dynamically-linked library that has just been
@@ -746,6 +746,23 @@
   return 0;
 }
 
+/* Helper routine: free the value chain for a breakpoint (watchpoint).  */
+
+static void free_valchain (struct bp_location *b)
+{
+  struct value *v;
+  struct value *n;
+
+  /* Free the saved value chain.  We will construct a new one
+     the next time the watchpoint is inserted.  */
+  for (v = b->owner->val_chain; v; v = n)
+    {
+      n = v->next;
+      value_free (v);
+    }
+  b->owner->val_chain = NULL;
+}
+
 /* Insert a low-level "breakpoint" of some type.  BPT is the breakpoint.
    Any error messages are printed to TMP_ERROR_STREAM; and DISABLED_BREAKS,
    PROCESS_WARNING, and HW_BREAKPOINT_ERROR are used to report problems.
@@ -893,18 +910,17 @@
 	 must watch.  As soon as a many-to-one mapping is available I'll
 	 convert this.  */
 
-      struct frame_info *saved_frame;
-      int saved_level, within_current_scope;
+      int within_current_scope;
       struct value *mark = value_mark ();
       struct value *v;
+      struct frame_id saved_frame_id;
 
-      /* Save the current frame and level so we can restore it after
+      /* Save the current frame's ID so we can restore it after
 	 evaluating the watchpoint expression on its own frame.  */
       /* FIXME drow/2003-09-09: It would be nice if evaluate_expression
 	 took a frame parameter, so that we didn't have to change the
 	 selected frame.  */
-      saved_frame = deprecated_selected_frame;
-      saved_level = frame_relative_level (deprecated_selected_frame);
+      saved_frame_id = get_frame_id (deprecated_selected_frame);
 
       /* Determine if the watchpoint is within scope.  */
       if (bpt->owner->exp_valid_block == NULL)
@@ -920,6 +936,8 @@
 
       if (within_current_scope)
 	{
+	  free_valchain (bpt);
+
 	  /* Evaluate the expression and cut the chain of values
 	     produced off from the value chain.
 
@@ -999,10 +1017,8 @@
 	  bpt->owner->disposition = disp_del_at_next_stop;
 	}
 
-      /* Restore the frame and level.  */
-      if (saved_frame != deprecated_selected_frame
-	  || saved_level != frame_relative_level (deprecated_selected_frame))
-	select_frame (saved_frame);
+      /* Restore the selected frame.  */
+      select_frame (frame_find_by_id (saved_frame_id));
 
       return val;
     }
@@ -1505,15 +1521,6 @@
       if ((is == mark_uninserted) && (b->inserted))
 	warning ("Could not remove hardware watchpoint %d.",
 		 b->owner->number);
-
-      /* Free the saved value chain.  We will construct a new one
-         the next time the watchpoint is inserted.  */
-      for (v = b->owner->val_chain; v; v = n)
-	{
-	  n = v->next;
-	  value_free (v);
-	}
-      b->owner->val_chain = NULL;
     }
   else if ((b->owner->type == bp_catch_fork ||
 	    b->owner->type == bp_catch_vfork ||
@@ -1636,8 +1643,8 @@
       default:
 	/* Likewise for exception catchpoints in dynamic-linked
 	   executables where required */
-	if (ep_is_exception_catchpoint (b) &&
-	    exception_catchpoints_are_fragile)
+	if (ep_is_exception_catchpoint (b)
+	    && deprecated_exception_catchpoints_are_fragile)
 	  {
 	    warning_needed = 1;
 	    delete_breakpoint (b);
@@ -1646,8 +1653,8 @@
       }
   }
 
-  if (exception_catchpoints_are_fragile)
-    exception_support_initialized = 0;
+  if (deprecated_exception_catchpoints_are_fragile)
+    deprecated_exception_support_initialized = 0;
 
   /* Don't issue the warning unless it's really needed... */
   if (warning_needed && (context != inf_exited))
@@ -1760,37 +1767,6 @@
   return 0;
 }
 
-/* Return nonzero if FRAME is a dummy frame.  We can't use
-   DEPRECATED_PC_IN_CALL_DUMMY because figuring out the saved SP would
-   take too much time, at least using frame_register() on the 68k.
-   This means that for this function to work right a port must use the
-   bp_call_dummy breakpoint.  */
-
-int
-deprecated_frame_in_dummy (struct frame_info *frame)
-{
-  struct breakpoint *b;
-
-  /* This function is used by two files: get_frame_type(), after first
-     checking that !DEPRECATED_USE_GENERIC_DUMMY_FRAMES; and
-     sparc-tdep.c, which doesn't yet use generic dummy frames anyway.  */
-  gdb_assert (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
-
-  ALL_BREAKPOINTS (b)
-  {
-    if (b->type == bp_call_dummy
-	&& frame_id_eq (b->frame_id, get_frame_id (frame))
-    /* We need to check the PC as well as the frame on the sparc,
-       for signals.exp in the testsuite.  */
-	&& (get_frame_pc (frame)
-	    >= (b->loc->address
-		- DEPRECATED_SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * DEPRECATED_REGISTER_SIZE))
-	&& get_frame_pc (frame) <= b->loc->address)
-      return 1;
-  }
-  return 0;
-}
-
 /* breakpoint_thread_match (PC, PTID) returns true if the breakpoint at
    PC is valid for process/thread PTID.  */
 
@@ -2583,7 +2559,9 @@
 }
 
 /* Get a bpstat associated with having just stopped at address
-   BP_ADDR.  */
+   BP_ADDR in thread PTID.  STOPPED_BY_WATCHPOINT is 1 if the
+   target thinks we stopped due to a hardware watchpoint, 0 if we
+   know we did not trigger a hardware watchpoint, and -1 if we do not know.  */
 
 /* Determine whether we stopped at a breakpoint, etc, or whether we
    don't understand this stop.  Result is a chain of bpstat's such that:
@@ -2600,7 +2578,7 @@
    commands, FIXME??? fields.  */
 
 bpstat
-bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
+bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid, int stopped_by_watchpoint)
 {
   struct breakpoint *b, *temp;
   /* True if we've hit a breakpoint (as opposed to a watchpoint).  */
@@ -2635,6 +2613,18 @@
 	  continue;
       }
 
+    /* Continuable hardware watchpoints are treated as non-existent if the 
+       reason we stopped wasn't a hardware watchpoint (we didn't stop on 
+       some data address).  Otherwise gdb won't stop on a break instruction 
+       in the code (not from a breakpoint) when a hardware watchpoint has 
+       been defined.  */
+
+    if ((b->type == bp_hardware_watchpoint
+	 || b->type == bp_read_watchpoint
+	 || b->type == bp_access_watchpoint)
+	&& !stopped_by_watchpoint)
+      continue;
+
     if (b->type == bp_hardware_breakpoint)
       {
 	if (b->loc->address != bp_addr)
@@ -3017,8 +3007,7 @@
 
   /* step_resume entries: a step resume breakpoint overrides another
      breakpoint of signal handling (see comment in wait_for_inferior
-     at first DEPRECATED_PC_IN_SIGTRAMP where we set the step_resume
-     breakpoint).  */
+     at where we set the step_resume breakpoint).  */
   /* We handle the through_sigtramp_breakpoint the same way; having both
      one of those and a step_resume_breakpoint is probably very rare (?).  */
 
@@ -4269,7 +4258,7 @@
   
   b->enable_state = bp_enabled;
   /* addr_string has to be used or breakpoint_re_set will delete me.  */
-  xasprintf (&b->addr_string, "*0x%s", paddr (b->loc->address));
+  b->addr_string = xstrprintf ("*0x%s", paddr (b->loc->address));
 
   return b;
 }
@@ -4723,13 +4712,13 @@
   stb = ui_out_stream_new (uiout);
   old_chain = make_cleanup_ui_out_stream_delete (stb);
 
-  /* FIXME: This is misplaced; mention() is called by things (like hitting a
-     watchpoint) other than breakpoint creation.  It should be possible to
-     clean this up and at the same time replace the random calls to
-     breakpoint_changed with this hook, as has already been done for
-     delete_breakpoint_hook and so on.  */
-  if (create_breakpoint_hook)
-    create_breakpoint_hook (b);
+  /* FIXME: This is misplaced; mention() is called by things (like
+     hitting a watchpoint) other than breakpoint creation.  It should
+     be possible to clean this up and at the same time replace the
+     random calls to breakpoint_changed with this hook, as has already
+     been done for deprecated_delete_breakpoint_hook and so on.  */
+  if (deprecated_create_breakpoint_hook)
+    deprecated_create_breakpoint_hook (b);
   breakpoint_create_event (b->number);
 
   if (b->ops != NULL && b->ops->print_mention != NULL)
@@ -4913,7 +4902,7 @@
 	else
 	  /* addr_string has to be used or breakpoint_re_set will delete
 	     me.  */
-	  xasprintf (&b->addr_string, "*0x%s", paddr (b->loc->address));
+	  b->addr_string = xstrprintf ("*0x%s", paddr (b->loc->address));
 	b->cond_string = cond_string[i];
 	b->ignore_count = ignore_count;
 	b->enable_state = bp_enabled;
@@ -4937,6 +4926,10 @@
 	       be copied too.  */
 	    if (pending_bp->commands)
 	      b->commands = copy_command_lines (pending_bp->commands);
+	    
+	    /* We have to copy over the ignore_count and thread as well.  */
+	    b->ignore_count = pending_bp->ignore_count;
+	    b->thread = pending_bp->thread;
 	  }
 	mention (b);
       }
@@ -5040,7 +5033,8 @@
 
          Give the target a chance to bless sals.sals[i].pc before we
          try to make a breakpoint for it. */
-      if (PC_REQUIRES_RUN_BEFORE_USE (sals->sals[i].pc))
+#ifdef DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE
+      if (DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE (sals->sals[i].pc))
 	{
 	  if (address == NULL)
 	    error ("Cannot break without a running program.");
@@ -5048,6 +5042,7 @@
 	    error ("Cannot break on %s without a running program.", 
 		   address);
 	}
+#endif
     }
 }
 
@@ -6874,13 +6869,15 @@
   if (bpt->type == bp_none)
     return;
 
-  if (delete_breakpoint_hook)
-    delete_breakpoint_hook (bpt);
+  if (deprecated_delete_breakpoint_hook)
+    deprecated_delete_breakpoint_hook (bpt);
   breakpoint_delete_event (bpt->number);
 
   if (bpt->loc->inserted)
     remove_breakpoint (bpt->loc, mark_inserted);
 
+  free_valchain (bpt->loc);
+
   if (breakpoint_chain == bpt)
     breakpoint_chain = bpt->next;
 
@@ -7507,8 +7504,8 @@
 
   check_duplicates (bpt);
 
-  if (modify_breakpoint_hook)
-    modify_breakpoint_hook (bpt);
+  if (deprecated_modify_breakpoint_hook)
+    deprecated_modify_breakpoint_hook (bpt);
   breakpoint_modify_event (bpt->number);
 }
 
@@ -7548,8 +7545,6 @@
 static void
 do_enable_breakpoint (struct breakpoint *bpt, enum bpdisp disposition)
 {
-  struct frame_info *save_selected_frame = NULL;
-  int save_selected_frame_level = -1;
   int target_resources_ok, other_type_used;
   struct value *mark;
 
@@ -7596,6 +7591,9 @@
 	  bpt->type == bp_read_watchpoint || 
 	  bpt->type == bp_access_watchpoint)
 	{
+	  struct frame_id saved_frame_id;
+
+	  saved_frame_id = get_frame_id (get_selected_frame ());
 	  if (bpt->exp_valid_block != NULL)
 	    {
 	      struct frame_info *fr =
@@ -7608,9 +7606,6 @@
 		  bpt->enable_state = bp_disabled;
 		  return;
 		}
-	      
-	      save_selected_frame = deprecated_selected_frame;
-	      save_selected_frame_level = frame_relative_level (deprecated_selected_frame);
 	      select_frame (fr);
 	    }
 	  
@@ -7645,14 +7640,13 @@
 		}
 	    }
 	  
-	  if (save_selected_frame_level >= 0)
-	    select_frame (save_selected_frame);
+	  select_frame (frame_find_by_id (saved_frame_id));
 	  value_free_to_mark (mark);
 	}
     }
 
-  if (modify_breakpoint_hook)
-    modify_breakpoint_hook (bpt);
+  if (deprecated_modify_breakpoint_hook)
+    deprecated_modify_breakpoint_hook (bpt);
   breakpoint_modify_event (bpt->number);
 }
 
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 41bcb0c..67a67e3 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -414,7 +414,8 @@
    is part of the bpstat is copied as well.  */
 extern bpstat bpstat_copy (bpstat);
 
-extern bpstat bpstat_stop_status (CORE_ADDR pc, ptid_t ptid);
+extern bpstat bpstat_stop_status (CORE_ADDR pc, ptid_t ptid, 
+				  int stopped_by_watchpoint);
 
 /* This bpstat_what stuff tells wait_for_inferior what to do with a
    breakpoint (a challenging task).  */
@@ -619,13 +620,6 @@
 
 extern int software_breakpoint_inserted_here_p (CORE_ADDR);
 
-/* FIXME: cagney/2002-11-10: The current [generic] dummy-frame code
-   implements a functional superset of this function.  The only reason
-   it hasn't been removed is because some architectures still don't
-   use the new framework.  Once they have been fixed, this can go.  */
-struct frame_info;
-extern int deprecated_frame_in_dummy (struct frame_info *);
-
 extern int breakpoint_thread_match (CORE_ADDR, ptid_t);
 
 extern void until_break_command (char *, int, int);
@@ -802,4 +796,13 @@
    remove fails. */
 extern int remove_hw_watchpoints (void);
 
+
+/* Indicator of whether exception catchpoints should be nuked between
+   runs of a program.  */
+extern int deprecated_exception_catchpoints_are_fragile;
+
+/* Indicator of when exception catchpoints set-up should be
+   reinitialized -- e.g. when program is re-run.  */
+extern int deprecated_exception_support_initialized;
+
 #endif /* !defined (BREAKPOINT_H) */
diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c
new file mode 100644
index 0000000..79ab095
--- /dev/null
+++ b/gdb/bsd-kvm.c
@@ -0,0 +1,299 @@
+/* BSD Kernel Data Access Library (libkvm) interface.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "cli/cli-cmds.h"
+#include "command.h"
+#include "frame.h"
+#include "regcache.h"
+#include "target.h"
+#include "value.h"
+
+#include "gdb_assert.h"
+#include <fcntl.h>
+#include <kvm.h>
+#include <nlist.h>
+#include "readline/readline.h"
+#include <sys/param.h>
+#include <sys/proc.h>
+#include <sys/user.h>
+
+#include "bsd-kvm.h"
+
+/* Kernel memory interface descriptor.  */
+kvm_t *core_kd;
+
+/* Address of process control block.  */
+struct pcb *bsd_kvm_paddr;
+
+/* Pointer to architecture-specific function that reconstructs the
+   register state from PCB and supplies it to REGCACHE.  */
+int (*bsd_kvm_supply_pcb)(struct regcache *regcache, struct pcb *pcb);
+
+/* Target ops for libkvm interface.  */
+struct target_ops bsd_kvm_ops;
+
+static void
+bsd_kvm_open (char *filename, int from_tty)
+{
+  char errbuf[_POSIX2_LINE_MAX];
+  char *execfile = NULL;
+  kvm_t *temp_kd;
+
+  target_preopen (from_tty);
+
+  if (filename)
+    {
+      char *temp;
+
+      filename = tilde_expand (filename);
+      if (filename[0] != '/')
+	{
+	  temp = concat (current_directory, "/", filename, NULL);
+	  xfree (filename);
+	  filename = temp;
+	}
+    }
+
+  temp_kd = kvm_openfiles (execfile, filename, NULL, O_RDONLY, errbuf);
+  if (temp_kd == NULL)
+    error ("%s", errbuf);
+
+  unpush_target (&bsd_kvm_ops);
+  core_kd = temp_kd;
+  push_target (&bsd_kvm_ops);
+
+  target_fetch_registers (-1);
+
+  flush_cached_frames ();
+  select_frame (get_current_frame ());
+  print_stack_frame (get_selected_frame (), -1, 1);
+}
+
+static void
+bsd_kvm_close (int quitting)
+{
+  if (core_kd)
+    {
+      if (kvm_close (core_kd) == -1)
+	warning ("%s", kvm_geterr(core_kd));
+      core_kd = NULL;
+    }
+}
+
+static int
+bsd_kvm_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len,
+		    int write, struct mem_attrib *attrib,
+		    struct target_ops *ops)
+{
+  if (write)
+    return kvm_write (core_kd, memaddr, myaddr, len);
+  else
+    return kvm_read (core_kd, memaddr, myaddr, len);
+
+  return -1;
+}
+
+/* Fetch process control block at address PADDR.  */
+
+static int
+bsd_kvm_fetch_pcb (struct pcb *paddr)
+{
+  struct pcb pcb;
+
+  if (kvm_read (core_kd, (unsigned long) paddr, &pcb, sizeof pcb) == -1)
+    error ("%s", kvm_geterr (core_kd));
+
+  gdb_assert (bsd_kvm_supply_pcb);
+  return bsd_kvm_supply_pcb (current_regcache, &pcb);
+}
+
+static void
+bsd_kvm_fetch_registers (int regnum)
+{
+  struct nlist nl[2];
+
+  if (bsd_kvm_paddr)
+    {
+      bsd_kvm_fetch_pcb (bsd_kvm_paddr);
+      return;
+    }
+
+  /* On dumping core, BSD kernels store the faulting context (PCB)
+     in the variable "dumppcb".  */
+  memset (nl, 0, sizeof nl);
+  nl[0].n_name = "_dumppcb";
+
+  if (kvm_nlist (core_kd, nl) == -1)
+    error ("%s", kvm_geterr (core_kd));
+
+  if (nl[0].n_value != 0)
+    {
+      /* Found dumppcb. If it contains a valid context, return
+	 immediately.  */
+      if (bsd_kvm_fetch_pcb ((struct pcb *) nl[0].n_value))
+	return;
+    }
+
+  /* Traditional BSD kernels have a process proc0 that should always
+     be present.  The address of proc0's PCB is stored in the variable
+     "proc0paddr".  */
+
+  memset (nl, 0, sizeof nl);
+  nl[0].n_name = "_proc0paddr";
+
+  if (kvm_nlist (core_kd, nl) == -1)
+    error ("%s", kvm_geterr (core_kd));
+
+  if (nl[0].n_value != 0)
+    {
+      struct pcb *paddr;
+
+      /* Found proc0paddr.  */
+      if (kvm_read (core_kd, nl[0].n_value, &paddr, sizeof paddr) == -1)
+	error ("%s", kvm_geterr (core_kd));
+
+      bsd_kvm_fetch_pcb (paddr);
+      return;
+    }
+
+#ifdef HAVE_STRUCT_THREAD_TD_PCB
+  /* In FreeBSD kernels for 5.0-RELEASE and later, the PCB no longer
+     lives in `struct proc' but in `struct thread'.  The `struct
+     thread' for the initial thread for proc0 can be found in the
+     variable "thread0".  */
+
+  memset (nl, 0, sizeof nl);
+  nl[0].n_name = "_thread0";
+
+  if (kvm_nlist (core_kd, nl) == -1)
+    error ("%s", kvm_geterr (core_kd));
+
+  if (nl[0].n_value != 0)
+    {
+      struct pcb *paddr;
+
+      /* Found thread0.  */
+      nl[0].n_value += offsetof (struct thread, td_pcb);
+      if (kvm_read (core_kd, nl[0].n_value, &paddr, sizeof paddr) == -1)
+	error ("%s", kvm_geterr (core_kd));
+
+      bsd_kvm_fetch_pcb (paddr);
+      return;
+    }
+#endif
+
+  error ("Cannot find a valid PCB");
+}
+
+
+/* Kernel memory interface commands.  */
+struct cmd_list_element *bsd_kvm_cmdlist;
+
+static void
+bsd_kvm_cmd (char *arg, int fromtty)
+{
+  /* ??? Should this become an alias for "target kvm"?  */
+}
+
+#ifndef HAVE_STRUCT_THREAD_TD_PCB
+
+static void
+bsd_kvm_proc_cmd (char *arg, int fromtty)
+{
+  CORE_ADDR addr;
+
+  if (arg == NULL)
+    error_no_arg ("proc address");
+
+  if (core_kd == NULL)
+    error ("No kernel memory image.");
+
+  addr = parse_and_eval_address (arg);
+  addr += offsetof (struct proc, p_addr);
+
+  if (kvm_read (core_kd, addr, &bsd_kvm_paddr, sizeof bsd_kvm_paddr) == -1)
+    error ("%s", kvm_geterr (core_kd));
+
+  target_fetch_registers (-1);
+
+  flush_cached_frames ();
+  select_frame (get_current_frame ());
+  print_stack_frame (get_selected_frame (), -1, 1);
+}
+
+#endif
+
+static void
+bsd_kvm_pcb_cmd (char *arg, int fromtty)
+{
+  if (arg == NULL)
+    error_no_arg ("pcb address");
+
+  if (core_kd == NULL)
+    error ("No kernel memory image.");
+
+  bsd_kvm_paddr = (struct pcb *) parse_and_eval_address (arg);
+
+  target_fetch_registers (-1);
+
+  flush_cached_frames ();
+  select_frame (get_current_frame ());
+  print_stack_frame (get_selected_frame (), -1, 1);
+}
+
+/* Add the libkvm interface to the list of all possible targets and
+   register CUPPLY_PCB as the architecture-specific process control
+   block interpreter.  */
+
+void
+bsd_kvm_add_target (int (*supply_pcb)(struct regcache *, struct pcb *))
+{
+  gdb_assert (bsd_kvm_supply_pcb == NULL);
+  bsd_kvm_supply_pcb = supply_pcb;
+
+  bsd_kvm_ops.to_shortname = "kvm";
+  bsd_kvm_ops.to_longname = "Kernel memory interface";
+  bsd_kvm_ops.to_doc = "Use a kernel virtual memory image as a target.\n\
+Optionally specify the filename of a core dump.";
+  bsd_kvm_ops.to_open = bsd_kvm_open;
+  bsd_kvm_ops.to_close = bsd_kvm_close;
+  bsd_kvm_ops.to_fetch_registers = bsd_kvm_fetch_registers;
+  bsd_kvm_ops.to_xfer_memory = bsd_kvm_xfer_memory;
+  bsd_kvm_ops.to_stratum = process_stratum;
+  bsd_kvm_ops.to_has_memory = 1;
+  bsd_kvm_ops.to_has_stack = 1;
+  bsd_kvm_ops.to_has_registers = 1;
+  bsd_kvm_ops.to_magic = OPS_MAGIC;
+
+  add_target (&bsd_kvm_ops);
+  
+  add_prefix_cmd ("kvm", class_obscure, bsd_kvm_cmd, "\
+Generic command for manipulating the kernel memory interface.",
+		  &bsd_kvm_cmdlist, "kvm ", 0, &cmdlist);
+
+#ifndef HAVE_STRUCT_THREAD_TD_PCB
+  add_cmd ("proc", class_obscure, bsd_kvm_proc_cmd,
+	   "Set current context from proc address", &bsd_kvm_cmdlist);
+#endif
+  add_cmd ("pcb", class_obscure, bsd_kvm_pcb_cmd,
+	   "Set current context from pcb address", &bsd_kvm_cmdlist);
+}
diff --git a/gdb/config/sparc/tm-nbsd64.h b/gdb/bsd-kvm.h
similarity index 62%
copy from gdb/config/sparc/tm-nbsd64.h
copy to gdb/bsd-kvm.h
index cc1d6b3..0660776 100644
--- a/gdb/config/sparc/tm-nbsd64.h
+++ b/gdb/bsd-kvm.h
@@ -1,5 +1,6 @@
-/* Macro definitions for UltraSPARC running under NetBSD.
-   Copyright 1994, 2002 Free Software Foundation, Inc.
+/* BSD Kernel Data Access Library (libkvm) interface.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,10 +19,17 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef TM_NBSD64_H
-#define TM_NBSD64_H
+#ifndef BSD_KVM_H
+#define BSD_KVM_H
 
-#include "sparc/tm-sp64.h" /* sets GDB_MULTI_ARCH */
-#include "solib.h"
+struct pcb;
+struct regcache;
 
-#endif /* TM_NBSD64_H */
+/* Add the libkvm interface to the list of all possible targets and
+   register CUPPLY_PCB as the architecture-specific process control
+   block interpreter.  */
+
+extern void
+  bsd_kvm_add_target (int (*supply_pcb)(struct regcache *, struct pcb *));
+
+#endif /* bsd-kvm.h */
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index f11b93e..706b407 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -53,9 +53,6 @@
 #include "block.h"
 #include "cp-support.h"
 
-/* Flag indicating we're dealing with HP-compiled objects */ 
-extern int hp_som_som_object_present;
-
 /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
    as well as gratuitiously global symbol names, so we can have multiple
    yacc generated parsers in gdb.  Note that these are only the variables
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index ba34540..19c08dc 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -546,6 +546,7 @@
   &exp_descriptor_standard,
   c_preprocess_and_parse,
   c_error,
+  null_post_parser,
   c_printchar,			/* Print a character constant */
   c_printstr,			/* Function to print string constant */
   c_emit_char,			/* Print a single char */
@@ -558,6 +559,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   NULL,				/* Language specific symbol demangler */
+  NULL,				/* Language specific class_name_from_physname */
   {"", "", "", ""},		/* Binary format info */
   {"0%lo", "0", "o", ""},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
@@ -604,6 +606,7 @@
   &exp_descriptor_standard,
   c_preprocess_and_parse,
   c_error,
+  null_post_parser,
   c_printchar,			/* Print a character constant */
   c_printstr,			/* Function to print string constant */
   c_emit_char,			/* Print a single char */
@@ -616,6 +619,7 @@
   cp_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   cp_lookup_transparent_type,   /* lookup_transparent_type */
   cplus_demangle,		/* Language specific symbol demangler */
+  cp_class_name_from_physname,  /* Language specific class_name_from_physname */
   {"", "", "", ""},		/* Binary format info */
   {"0%lo", "0", "o", ""},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
@@ -639,6 +643,7 @@
   &exp_descriptor_standard,
   c_preprocess_and_parse,
   c_error,
+  null_post_parser,
   c_printchar,			/* Print a character constant */
   c_printstr,			/* Function to print string constant */
   c_emit_char,			/* Print a single char */
@@ -651,6 +656,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   NULL,				/* Language specific symbol demangler */
+  NULL,				/* Language specific class_name_from_physname */
   {"", "", "", ""},		/* Binary format info */
   {"0%lo", "0", "o", ""},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
@@ -679,6 +685,7 @@
   &exp_descriptor_standard,
   c_preprocess_and_parse,
   c_error,
+  null_post_parser,
   c_printchar,			/* Print a character constant */
   c_printstr,			/* Function to print string constant */
   c_emit_char,			/* Print a single char */
@@ -691,6 +698,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   NULL,				/* Language specific symbol demangler */
+  NULL,				/* Language specific class_name_from_physname */
   {"", "", "", ""},		/* Binary format info */
   {"0%lo", "0", "o", ""},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 2d2ad85..c9a6442 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -38,9 +38,6 @@
 #include "gdb_string.h"
 #include <errno.h>
 
-/* Flag indicating target was compiled by HP compiler */
-extern int hp_som_som_object_present;
-
 static void cp_type_print_method_args (struct type *mtype, char *prefix,
 				       char *varstring, int staticp,
 				       struct ui_file *stream);
@@ -1078,7 +1075,7 @@
     case TYPE_CODE_ENUM:
       c_type_print_modifier (type, stream, 0, 1);
       /* HP C supports sized enums */
-      if (hp_som_som_object_present)
+      if (deprecated_hp_som_som_object_present)
 	switch (TYPE_LENGTH (type))
 	  {
 	  case 1:
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 9378ac8..3dfb303 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -858,7 +858,7 @@
 	/* FIXME: cagney/2004-02-07: This should be an observer.  */
 	low = tui_get_low_disassembly_address (low, pc);
 #endif
-      low += FUNCTION_START_OFFSET;
+      low += DEPRECATED_FUNCTION_START_OFFSET;
     }
   else if (!(space_index = (char *) strchr (arg, ' ')))
     {
@@ -873,7 +873,7 @@
 	/* FIXME: cagney/2004-02-07: This should be an observer.  */
 	low = tui_get_low_disassembly_address (low, pc);
 #endif
-      low += FUNCTION_START_OFFSET;
+      low += DEPRECATED_FUNCTION_START_OFFSET;
     }
   else
     {
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 43f2f25..2b5d68b 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -432,7 +432,7 @@
 /* Add element named NAME to both the set and show command LISTs (the
    list for set/show or some sublist thereof).  CLASS is as in
    add_cmd.  VAR is address of the variable which will contain the
-   value.  SET_DOC and SHOW_DOR are the documentation strings.  */
+   value.  SET_DOC and SHOW_DOC are the documentation strings.  */
 void
 add_setshow_boolean_cmd (char *name,
 			 enum command_class class,
@@ -455,7 +455,7 @@
 /* Add element named NAME to both the set and show command LISTs (the
    list for set/show or some sublist thereof).  CLASS is as in
    add_cmd.  VAR is address of the variable which will contain the
-   value.  SET_DOC and SHOW_DOR are the documentation strings.  */
+   value.  SET_DOC and SHOW_DOC are the documentation strings.  */
 void
 add_setshow_uinteger_cmd (char *name,
 			  enum command_class class,
@@ -472,6 +472,26 @@
 			NULL, NULL);
 }
 
+/* Add element named NAME to both the set and show command LISTs (the
+   list for set/show or some sublist thereof).  CLASS is as in
+   add_cmd.  VAR is address of the variable which will contain the
+   value.  SET_DOC and SHOW_DOC are the documentation strings.  */
+void
+add_setshow_zinteger_cmd (char *name,
+			  enum command_class class,
+			  int *var, char *set_doc, char *show_doc,
+			  cmd_sfunc_ftype *set_func,
+			  cmd_sfunc_ftype *show_func,
+			  struct cmd_list_element **set_list,
+			  struct cmd_list_element **show_list)
+{
+  add_setshow_cmd_full (name, class, var_zinteger, var,
+			set_doc, show_doc,
+			set_func, show_func,
+			set_list, show_list,
+			NULL, NULL);
+}
+
 /* Where SETCMD has already been added, add the corresponding show
    command to LIST and return a pointer to the added command (not
    necessarily the head of LIST).  */
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index ca0c14f..165702d 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -685,7 +685,7 @@
     error ("Control nesting too deep!\n");
 
   /* Set a prompt based on the nesting of the control commands.  */
-  if (instream == stdin || (instream == 0 && readline_hook != NULL))
+  if (instream == stdin || (instream == 0 && deprecated_readline_hook != NULL))
     {
       for (i = 0; i < control_level; i++)
 	control_prompt[i] = ' ';
@@ -893,10 +893,10 @@
   enum misc_command_type val;
 
   control_level = 0;
-  if (readline_begin_hook)
+  if (deprecated_readline_begin_hook)
     {
       /* Note - intentional to merge messages with no newline */
-      (*readline_begin_hook) ("%s  %s\n", prompt_arg, END_MESSAGE);
+      (*deprecated_readline_begin_hook) ("%s  %s\n", prompt_arg, END_MESSAGE);
     }
   else if (from_tty && input_from_terminal_p ())
     {
@@ -962,9 +962,9 @@
 	do_cleanups (old_chain);
     }
 
-  if (readline_end_hook)
+  if (deprecated_readline_end_hook)
     {
-      (*readline_end_hook) ();
+      (*deprecated_readline_end_hook) ();
     }
   return (head);
 }
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index 62fe36f..cf87cf6 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -344,8 +344,8 @@
   else
     error ("gdb internal error: bad cmd_type in do_setshow_command");
   c->func (c, NULL, from_tty);
-  if (c->type == set_cmd && set_hook)
-    set_hook (c);
+  if (c->type == set_cmd && deprecated_set_hook)
+    deprecated_set_hook (c);
 }
 
 /* Show all the settings in a list of show commands.  */
@@ -364,8 +364,10 @@
 	{
 	  struct cleanup *optionlist_chain
 	    = make_cleanup_ui_out_tuple_begin_end (uiout, "optionlist");
-	  ui_out_field_string (uiout, "prefix", list->prefixname + 5);
-	  cmd_show_list (*list->prefixlist, from_tty, list->prefixname + 5);
+	  char *new_prefix = strstr (list->prefixname, "show ") + 5;
+	  if (ui_out_is_mi_like_p (uiout))
+	    ui_out_field_string (uiout, "prefix", new_prefix);
+	  cmd_show_list (*list->prefixlist, from_tty, new_prefix);
 	  /* Close the tuple.  */
 	  do_cleanups (optionlist_chain);
 	}
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 056ba13..821ca44 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -385,13 +385,6 @@
   last_source_file = savestring (name, strlen (name));
   current_source_start_addr = start_addr;
   current_source_end_addr = start_addr + size;
-
-  if (current_objfile->ei.entry_point >= current_source_start_addr &&
-      current_objfile->ei.entry_point < current_source_end_addr)
-    {
-      current_objfile->ei.deprecated_entry_file_lowpc = current_source_start_addr;
-      current_objfile->ei.deprecated_entry_file_highpc = current_source_end_addr;
-    }
 }
 
 /* Finish the symbol definitions for one main source file,
@@ -610,6 +603,15 @@
   /* Free the installed minimal symbol data.  */
   do_cleanups (cleanup_minimal_symbols);
 
+  /* If we are reinitializing, or if we have not loaded syms yet,
+     empty the psymtab.  "mainline" is cleared so the *_read_psymtab
+     functions do not all re-initialize it.  */
+  if (mainline)
+    {
+      init_psymbol_list (objfile, 0);
+      mainline = 0;
+    }
+
   bfd_map_over_sections (abfd, coff_locate_sections, (void *) info);
 
   if (info->stabsects)
@@ -634,12 +636,14 @@
 			       info->stabsects,
 			       info->stabstrsect->filepos, stabstrsize);
     }
-  if (dwarf2_has_info (abfd))
+  if (dwarf2_has_info (objfile))
     {
       /* DWARF2 sections.  */
       dwarf2_build_psymtabs (objfile, mainline);
     }
 
+  dwarf2_build_frame_info (objfile);
+
   do_cleanups (back_to);
 }
 
diff --git a/gdb/command.h b/gdb/command.h
index c4a5f20..d441a7f 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -272,6 +272,16 @@
 				      struct cmd_list_element **set_list,
 				      struct cmd_list_element **show_list);
 
+extern void add_setshow_zinteger_cmd (char *name,
+				      enum command_class class,
+				      int *var,
+				      char *set_doc,
+				      char *show_doc,
+				      cmd_sfunc_ftype *set_func,
+				      cmd_sfunc_ftype *show_func,
+				      struct cmd_list_element **set_list,
+				      struct cmd_list_element **show_list);
+
 extern struct cmd_list_element *add_show_from_set (struct cmd_list_element *,
 						   struct cmd_list_element
 						   **);
diff --git a/gdb/complaints.c b/gdb/complaints.c
index ed24f43..bd869f0 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -186,8 +186,8 @@
 
   if (complaint->file != NULL)
     internal_vwarning (complaint->file, complaint->line, complaint->fmt, args);
-  else if (warning_hook)
-    (*warning_hook) (complaint->fmt, args);
+  else if (deprecated_warning_hook)
+    (*deprecated_warning_hook) (complaint->fmt, args);
   else
     {
       if (complaints->explanation == NULL)
@@ -197,7 +197,7 @@
 	{
 	  char *msg;
 	  struct cleanup *cleanups;
-	  xvasprintf (&msg, complaint->fmt, args);
+	  msg = xstrvprintf (complaint->fmt, args);
 	  cleanups = make_cleanup (xfree, msg);
 	  wrap_here ("");
 	  if (series != SUBSEQUENT_MESSAGE)
diff --git a/gdb/config.in b/gdb/config.in
index 69982fd..c876d29 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -173,6 +173,12 @@
 /* nativefile */
 #undef GDB_NM_FILE
 
+/* Define to 1 so <sys/proc.h> gets a definition of anon_hdl.  Works
+   around a <sys/proc.h> problem on IRIX 5.  */
+#ifndef _KMEMUSER
+#undef _KMEMUSER
+#endif
+
 /* Define if you have the __argz_count function.  */
 #undef HAVE___ARGZ_COUNT
 
@@ -266,6 +272,9 @@
 /* Define if you have the <dirent.h> header file.  */
 #undef HAVE_DIRENT_H
 
+/* Define if you have the <gnu/libc-version.h> header file.  */
+#undef HAVE_GNU_LIBC_VERSION_H
+
 /* Define if you have the <libunwind-ia64.h> header file.  */
 #undef HAVE_LIBUNWIND_IA64_H
 
@@ -453,6 +462,9 @@
 /* Define to 1 if the regex included in libiberty should be used. */
 #undef USE_INCLUDED_REGEX
 
+/* Define to 1 if your system has td_pcb in struct thread. */
+#undef HAVE_STRUCT_THREAD_TD_PCB
+
 /* Define to 1 if your system has struct reg in <machine/reg.h>. */
 #undef HAVE_STRUCT_REG
 
diff --git a/gdb/config/alpha/xm-alphalinux.h b/gdb/config/alpha/xm-alphalinux.h
index f1bc14d..9341670 100644
--- a/gdb/config/alpha/xm-alphalinux.h
+++ b/gdb/config/alpha/xm-alphalinux.h
@@ -19,8 +19,5 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* The alpha has no siginterrupt routine.  */
-#define NO_SIGINTERRUPT
-
 #define HAVE_TERMIOS
 #define USG
diff --git a/gdb/config/alpha/xm-alphaosf.h b/gdb/config/alpha/xm-alphaosf.h
index 67d3cc4..dff1c6e 100644
--- a/gdb/config/alpha/xm-alphaosf.h
+++ b/gdb/config/alpha/xm-alphaosf.h
@@ -18,7 +18,4 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* The alpha has no siginterrupt routine.  */
-#define NO_SIGINTERRUPT
-
 #define HAVE_TERMIOS
diff --git a/gdb/config/arm/tm-embed.h b/gdb/config/arm/tm-embed.h
index 7ad6b68..6a8c87a 100644
--- a/gdb/config/arm/tm-embed.h
+++ b/gdb/config/arm/tm-embed.h
@@ -46,7 +46,4 @@
 extern int arm_in_call_stub (CORE_ADDR pc, char *name);
 extern CORE_ADDR arm_skip_stub (CORE_ADDR pc);
 
-#undef  DEPRECATED_IN_SIGTRAMP
-#define DEPRECATED_IN_SIGTRAMP(pc, name) 0
-
 #endif /* TM_ARMEMBED_H */
diff --git a/gdb/config/djgpp/fnchange.lst b/gdb/config/djgpp/fnchange.lst
index 1d9e393..0d0046c 100644
--- a/gdb/config/djgpp/fnchange.lst
+++ b/gdb/config/djgpp/fnchange.lst
@@ -120,6 +120,8 @@
 @V@/gdb/gdbtk/library/ChangeLog-2000 @V@/gdb/gdbtk/library/ChangeLog.000
 @V@/gdb/gdbtk/plugins/intel-pentium/intel-pentium.tcl.in @V@/gdb/gdbtk/plugins/intel-pentium/intel-pentium.t-in
 @V@/gdb/gdbtk/plugins/rhabout/rhabout.tcl.in @V@/gdb/gdbtk/plugins/rhabout/rhabout.t-in
+@V@/gdb/hppabsd-nat.c @V@/gdb/hppab-nat.c
+@V@/gdb/hppabsd-tdep.c @V@/gdb/hppab-tdep.c
 @V@/gdb/i386-interix-nat.c @V@/gdb/i386ix-nat.c
 @V@/gdb/i386-interix-tdep.c @V@/gdb/i386ix-tdep.c
 @V@/gdb/i386-linux-tdep.c @V@/gdb/i386lx-tdep.c
@@ -141,6 +143,8 @@
 @V@/gdb/m2-exp.tab.c @V@/gdb/m2-exp_tab.c
 @V@/gdb/m68klinux-nat.c @V@/gdb/m68kl-nat.c
 @V@/gdb/m68klinux-tdep.c @V@/gdb/m68kl-tdep.c
+@V@/gdb/m68kbsd-nat.c @V@/gdb/m68bsd-nat.c
+@V@/gdb/m68kbsd-tdep.c @V@/gdb/m68bsd-tdep.c
 @V@/gdb/m68knbsd-nat.c @V@/gdb/m6nbsd-nat.c
 @V@/gdb/m68knbsd-tdep.c @V@/gdb/m6nbsd-tdep.c
 @V@/gdb/mips-linux-nat.c @V@/gdb/mipslnxnat.c
@@ -156,6 +160,8 @@
 @V@/gdb/ppc-linux-nat.c @V@/gdb/ppc-lx-nat.c
 @V@/gdb/ppcnbsd-nat.c @V@/gdb/ppcnb-nat.c
 @V@/gdb/ppcnbsd-tdep.c @V@/gdb/ppcnb-tdep.c
+@V@/gdb/ppcobsd-nat.c @V@/gdb/ppcob-nat.c
+@V@/gdb/ppcobsd-tdep.c @V@/gdb/ppcob-tdep.c
 @V@/gdb/regformats/reg-i386-linux.dat @V@/gdb/regformats/r-i386-lnx.dat
 @V@/gdb/regformats/reg-s390x.dat @V@/gdb/regformats/r-s390x.dat
 @V@/gdb/remote-e7000.c @V@/gdb/rmt-e7000.c
@@ -188,6 +194,8 @@
 @V@/gdb/testsuite/gdb.arch/altivec-abi.exp @V@/gdb/testsuite/gdb.arch/av-abi.exp
 @V@/gdb/testsuite/gdb.arch/altivec-regs.c @V@/gdb/testsuite/gdb.arch/av-regs.c
 @V@/gdb/testsuite/gdb.arch/altivec-regs.exp @V@/gdb/testsuite/gdb.arch/av-regs.exp
+@V@/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp @V@/gdb/testsuite/gdb.arch/ppcaprol.exp
+@V@/gdb/testsuite/gdb.arch/powerpc-aix-prologue.c @V@/gdb/testsuite/gdb.arch/ppcaprol.c
 @V@/gdb/testsuite/gdb.base/coremaker2.c @V@/gdb/testsuite/gdb.base/core2maker.c
 @V@/gdb/testsuite/gdb.cp/m-static1.cc @V@/gdb/testsuite/gdb.cp/m-stat1.cc
 @V@/gdb/testsuite/gdb.cp/namespace1.cc @V@/gdb/testsuite/gdb.cp/namesp1.cc
@@ -232,6 +240,8 @@
 @V@/gdb/testsuite/gdb.mi/mi2-var-display.exp @V@/gdb/testsuite/gdb.mi/mi2vardisplay.exp
 @V@/gdb/amd64-linux-tdep.c @V@/gdb/amd64-ltdep.c
 @V@/gdb/amd64-linux-nat.c @V@/gdb/amd64-lnat.c
+@V@/gdb/hppa-linux-tdep.c @V@/gdb/palnxtdep.c
+@V@/gdb/hppa-linux-nat.c @V@/gdb/palnxnat.c
 @V@/include/ChangeLog-9103 @V@/include/ChangeLog.9103
 @V@/include/coff/ChangeLog-9103 @V@/include/coff/ChangeLog.9103
 @V@/include/elf/ChangeLog-9103 @V@/include/elf/ChangeLog.9103
diff --git a/gdb/config/i386/embed.mt b/gdb/config/i386/embed.mt
deleted file mode 100644
index 6925a83..0000000
--- a/gdb/config/i386/embed.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Embedded Intel 386 
-TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/fbsd.mh b/gdb/config/i386/fbsd.mh
index 2d0500e..8800b21 100644
--- a/gdb/config/i386/fbsd.mh
+++ b/gdb/config/i386/fbsd.mh
@@ -1,5 +1,8 @@
 # Host: FreeBSD/i386
 NATDEPFILES= fork-child.o infptrace.o inftarg.o \
-	i386-nat.o i386bsd-nat.o i386fbsd-nat.o gcore.o fbsd-proc.o
+	i386-nat.o i386bsd-nat.o i386fbsd-nat.o \
+	gcore.o fbsd-proc.o bsd-kvm.o
 NAT_FILE= nm-fbsd.h
 XM_FILE= xm-i386.h
+
+LOADLIBES= -lkvm
diff --git a/gdb/config/i386/fbsd64.mh b/gdb/config/i386/fbsd64.mh
index 6c30e30..6bdeeda 100644
--- a/gdb/config/i386/fbsd64.mh
+++ b/gdb/config/i386/fbsd64.mh
@@ -1,5 +1,8 @@
 # Host: FreeBSD/amd64
 NATDEPFILES= fork-child.o infptrace.o inftarg.o \
-	amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o gcore.o fbsd-proc.o
+	amd64-nat.o amd64bsd-nat.o amd64fbsd-nat.o \
+	gcore.o fbsd-proc.o bsd-kvm.o
 NAT_FILE= nm-fbsd64.h
 XM_FILE= xm-i386.h
+
+LOADLIBES= -lkvm
diff --git a/gdb/config/i386/go32.mt b/gdb/config/i386/go32.mt
deleted file mode 100644
index 9b82c64..0000000
--- a/gdb/config/i386/go32.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Intel 386 running DJGPP
-TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-go32.h
diff --git a/gdb/config/i386/i386.mt b/gdb/config/i386/i386.mt
new file mode 100644
index 0000000..d2eab6d
--- /dev/null
+++ b/gdb/config/i386/i386.mt
@@ -0,0 +1,2 @@
+# Target: i386
+TDEPFILES= i386-tdep.o i387-tdep.o
diff --git a/gdb/config/i386/i386aout.mt b/gdb/config/i386/i386aout.mt
deleted file mode 100644
index 2a33369..0000000
--- a/gdb/config/i386/i386aout.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Intel 386 with a.out
-TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/i386gnu.mt b/gdb/config/i386/i386gnu.mt
index 2029e99..220b64a 100644
--- a/gdb/config/i386/i386gnu.mt
+++ b/gdb/config/i386/i386gnu.mt
@@ -1,3 +1,2 @@
 # Target: Intel 386 running the GNU Hurd
 TDEPFILES= i386-tdep.o i387-tdep.o i386gnu-tdep.o
-TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/i386nw.mt b/gdb/config/i386/i386nw.mt
deleted file mode 100644
index 9eafe7d..0000000
--- a/gdb/config/i386/i386nw.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Intel 386 running NetWare
-TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/i386sol2.mh b/gdb/config/i386/i386sol2.mh
index 1245ca7..750b9f0 100644
--- a/gdb/config/i386/i386sol2.mh
+++ b/gdb/config/i386/i386sol2.mh
@@ -1,8 +1,5 @@
-# Host: Intel 386 running Solaris 2 (SVR4)
-
-XM_FILE= xm-i386.h
-
-NAT_FILE= nm-i386sol2.h
+# Host: Solaris x86
 NATDEPFILES= fork-child.o i386v4-nat.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o gcore.o \
-        solib.o solib-svr4.o solib-legacy.o
+	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o gcore.o
+NAT_FILE= nm-i386sol2.h
+XM_FILE= xm-i386.h
diff --git a/gdb/config/i386/i386sol2.mt b/gdb/config/i386/i386sol2.mt
index 863f615..1ced287 100644
--- a/gdb/config/i386/i386sol2.mt
+++ b/gdb/config/i386/i386sol2.mt
@@ -1,3 +1,4 @@
-# Target: Intel 386 running Solaris 2 (SVR4)
-TDEPFILES= i386-tdep.o i387-tdep.o i386-sol2-tdep.o corelow.o
+# Target: Solaris x86
+TDEPFILES= i386-tdep.o i387-tdep.o i386-sol2-tdep.o \
+	corelow.o solib.o solib-svr4.o
 TM_FILE= tm-i386sol2.h
diff --git a/gdb/config/i386/i386v.mt b/gdb/config/i386/i386v.mt
deleted file mode 100644
index 1ee5305..0000000
--- a/gdb/config/i386/i386v.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Intel 386 running System V
-TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/interix.mh b/gdb/config/i386/interix.mh
deleted file mode 100644
index c294dd5..0000000
--- a/gdb/config/i386/interix.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: Intel 386 running Interix
-XDEPFILES= 
-NATDEPFILES= corelow.o core-regset.o fork-child.o i386-interix-nat.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
-NAT_FILE= nm-interix.h
-XM_FILE= xm-interix.h
diff --git a/gdb/config/i386/interix.mt b/gdb/config/i386/interix.mt
deleted file mode 100644
index 8d60962..0000000
--- a/gdb/config/i386/interix.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Intel 386 running Interix
-TDEPFILES= i386-tdep.o i387-tdep.o i386-interix-tdep.o solib.o solib-pei.o
-TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/linux.mt b/gdb/config/i386/linux.mt
index 9e068a4..522453f 100644
--- a/gdb/config/i386/linux.mt
+++ b/gdb/config/i386/linux.mt
@@ -1,4 +1,4 @@
 # Target: Intel 386 running GNU/Linux
 TDEPFILES= i386-tdep.o i386-linux-tdep.o glibc-tdep.o i387-tdep.o \
-	solib.o solib-svr4.o solib-legacy.o
+	solib.o solib-svr4.o symfile-mem.o
 TM_FILE= tm-linux.h
diff --git a/gdb/config/i386/linux64.mt b/gdb/config/i386/linux64.mt
index f642e31..d082253 100644
--- a/gdb/config/i386/linux64.mt
+++ b/gdb/config/i386/linux64.mt
@@ -1,5 +1,5 @@
 # Target: GNU/Linux x86-64
 TDEPFILES= amd64-tdep.o amd64-linux-tdep.o \
 	i386-tdep.o i387-tdep.o i386-linux-tdep.o glibc-tdep.o \
-	solib.o solib-svr4.o solib-legacy.o corelow.o
+	solib.o solib-svr4.o corelow.o
 TM_FILE=tm-linux64.h
diff --git a/gdb/config/i386/nbsdelf.mh b/gdb/config/i386/nbsdelf.mh
index 0d313dd..b888569 100644
--- a/gdb/config/i386/nbsdelf.mh
+++ b/gdb/config/i386/nbsdelf.mh
@@ -1,4 +1,7 @@
 # Host: NetBSD/i386 ELF
-NATDEPFILES= fork-child.o infptrace.o inftarg.o i386bsd-nat.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+	i386bsd-nat.o i386nbsd-nat.o bsd-kvm.o
 NAT_FILE= nm-nbsd.h
 XM_FILE= xm-nbsd.h
+
+LOADLIBES= -lkvm
diff --git a/gdb/config/i386/ncr3000.mt b/gdb/config/i386/ncr3000.mt
index 4773dae..20a0728 100644
--- a/gdb/config/i386/ncr3000.mt
+++ b/gdb/config/i386/ncr3000.mt
@@ -1,3 +1,2 @@
 # Target: Intel 386 running SVR4
 TDEPFILES= i386-tdep.o i387-tdep.o solib.o solib-svr4.o solib-legacy.o
-TM_FILE= tm-i386.h
diff --git a/gdb/config/i386/nm-i386gnu.h b/gdb/config/i386/nm-i386gnu.h
index 4fef763..1f3cdb5 100644
--- a/gdb/config/i386/nm-i386gnu.h
+++ b/gdb/config/i386/nm-i386gnu.h
@@ -32,7 +32,4 @@
 #define THREAD_STATE_CLEAR_TRACED(state) \
   	((((struct i386_thread_state *) (state))->efl &= ~0x100), 1)
 
-/* We can attach and detach.  */
-#define ATTACH_DETACH 1
-
 #endif /* nm-i386gnu.h */
diff --git a/gdb/config/i386/nm-i386sco4.h b/gdb/config/i386/nm-i386sco4.h
index 6947f3f..39d7d50 100644
--- a/gdb/config/i386/nm-i386sco4.h
+++ b/gdb/config/i386/nm-i386sco4.h
@@ -25,8 +25,6 @@
 
 #include "i386/nm-i386sco.h"
 
-#define ATTACH_DETACH
-
 /* SCO, in its wisdom, does not provide <sys/ptrace.h>.  infptrace.c
    does not have defaults for these values.  */
 #define PTRACE_ATTACH 10
diff --git a/gdb/config/i386/nm-i386sco5.h b/gdb/config/i386/nm-i386sco5.h
index 65f3176..5c656b0 100644
--- a/gdb/config/i386/nm-i386sco5.h
+++ b/gdb/config/i386/nm-i386sco5.h
@@ -51,9 +51,6 @@
 #define KERNEL_U_SIZE kernel_u_size ()
 extern int kernel_u_size (void);
 
-/* We can attach and detach.  */
-#define ATTACH_DETACH
-
 /* Hardware-assisted breakpoints and watchpoints.  */
 
 /* We can also do hardware watchpoints.  */
diff --git a/gdb/config/i386/nm-interix.h b/gdb/config/i386/nm-interix.h
deleted file mode 100644
index b8b003a..0000000
--- a/gdb/config/i386/nm-interix.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Native-dependent definitions for Intel 386 running Interix, for GDB.
-   Copyright 1986, 1987, 1989, 1992, 1996 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#ifndef NM_INTERIX_H
-#define NM_INTERIX_H
-
-/* Be shared lib aware.  */
-#include "solib.h"
-
-/* submodes of USE_PROC_FS.  */
-#define UNIXWARE
-
-/* It's ALMOST coff; bfd does the same thing. Mostly used in coffread.c.  */
-#define COFF_IMAGE_WITH_PE
-
-/* Turn on our own child_pid_to_exec_file.  */
-#define CHILD_PID_TO_EXEC_FILE
-
-#endif /* NM_INTERIX_H */
diff --git a/gdb/config/i386/obsd.mh b/gdb/config/i386/obsd.mh
index 50a4fb7..c1f3c50 100644
--- a/gdb/config/i386/obsd.mh
+++ b/gdb/config/i386/obsd.mh
@@ -1,4 +1,8 @@
 # Host: OpenBSD/i386 ELF
-NATDEPFILES= fork-child.o infptrace.o inftarg.o i386bsd-nat.o i386obsd-nat.o
+NATDEPFILES= fork-child.o infptrace.o inftarg.o \
+	i386bsd-nat.o i386obsd-nat.o i386nbsd-nat.o bsd-kvm.o
 NAT_FILE= nm-obsd.h
 XM_FILE= xm-i386.h
+
+LOADLIBES= -lkvm
+
diff --git a/gdb/config/i386/obsd64.mh b/gdb/config/i386/obsd64.mh
index 99ccfa2..3e0a0e7 100644
--- a/gdb/config/i386/obsd64.mh
+++ b/gdb/config/i386/obsd64.mh
@@ -1,5 +1,7 @@
 # Host: OpenBSD/amd64
 NATDEPFILES= fork-child.o infptrace.o inftarg.o \
-	amd64-nat.o amd64bsd-nat.o amd64obsd-nat.o
+	amd64-nat.o amd64bsd-nat.o amd64obsd-nat.o bsd-kvm.o
 NAT_FILE= nm-nbsd.h
 XM_FILE= xm-i386.h
+
+LOADLIBES= -lkvm
diff --git a/gdb/config/i386/tm-cygwin.h b/gdb/config/i386/tm-cygwin.h
index e7b49de..52ec275 100644
--- a/gdb/config/i386/tm-cygwin.h
+++ b/gdb/config/i386/tm-cygwin.h
@@ -1,6 +1,7 @@
 /* Macro definitions for i386 running under the win32 API Unix.
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-   Free Software Foundation, Inc.
+
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004 Free
+   Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -19,8 +20,6 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include "i386/tm-i386.h"
-
 #define ATTACH_NO_WAIT
 #define SOLIB_ADD(filename, from_tty, targ, readsyms) child_solib_add(filename, from_tty, targ, readsyms)
 #define PC_SOLIB(addr) solib_address (addr)
diff --git a/gdb/config/i386/tm-go32.h b/gdb/config/i386/tm-go32.h
deleted file mode 100644
index 85e0888..0000000
--- a/gdb/config/i386/tm-go32.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Target-dependent definitions for Intel x86 running DJGPP.
-   Copyright 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#ifndef TM_GO32_H
-#define TM_GO32_H
-
-#undef HAVE_SSE_REGS	/* FIXME! go32-nat.c needs to support XMMi registers */
-
-#include "i386/tm-i386.h"
-
-#endif /* TM_GO32_H */
diff --git a/gdb/config/i386/tm-i386lynx.h b/gdb/config/i386/tm-i386lynx.h
index 03fe4ff..fbb7f81 100644
--- a/gdb/config/i386/tm-i386lynx.h
+++ b/gdb/config/i386/tm-i386lynx.h
@@ -1,5 +1,6 @@
 /* Macro definitions for Intel 386 running under LynxOS.
-   Copyright 1993, 1995, 2002 Free Software Foundation, Inc.
+
+   Copyright 1993, 1995, 2002, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -23,7 +24,4 @@
 
 #include "config/tm-lynx.h"
 
-/* Most definitions from sysv could be used. */
-#include "i386/tm-i386.h"
-
 #endif /* TM_I386LYNX_H */
diff --git a/gdb/config/i386/tm-i386sol2.h b/gdb/config/i386/tm-i386sol2.h
index 921df26..3dfbbbb 100644
--- a/gdb/config/i386/tm-i386sol2.h
+++ b/gdb/config/i386/tm-i386sol2.h
@@ -1,5 +1,6 @@
 /* Macro definitions for GDB on an Intel i386 running Solaris 2.
-   Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+
+   Copyright 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,7 +22,7 @@
 #ifndef TM_I386SOL2_H
 #define TM_I386SOL2_H 1
 
-#include "i386/tm-i386.h"
+#include "solib.h"
 
 /* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
    and for SunPRO 3.0, N_FUN symbols too.  */
@@ -31,4 +32,4 @@
 #define STATIC_TRANSFORM_NAME(x) sunpro_static_transform_name (x)
 #define IS_STATIC_TRANSFORM_NAME(name) ((name)[0] == '.')
 
-#endif /* ifndef TM_I386SOL2_H */
+#endif /* tm-i386sol2.h */
diff --git a/gdb/config/i386/tm-linux.h b/gdb/config/i386/tm-linux.h
index 83440a8..1c8bbaf 100644
--- a/gdb/config/i386/tm-linux.h
+++ b/gdb/config/i386/tm-linux.h
@@ -1,7 +1,7 @@
 /* Definitions to target GDB to GNU/Linux on 386.
 
-   Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free
-   Software Foundation, Inc.
+   Copyright 1992, 1993, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
+   2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -23,7 +23,6 @@
 #ifndef TM_LINUX_H
 #define TM_LINUX_H
 
-#include "i386/tm-i386.h"
 #include "config/tm-linux.h"
 
 /* The following works around a problem with /usr/include/sys/procfs.h  */
diff --git a/gdb/config/i386/tm-nto.h b/gdb/config/i386/tm-nto.h
index ff5eb78..670acc8 100644
--- a/gdb/config/i386/tm-nto.h
+++ b/gdb/config/i386/tm-nto.h
@@ -1,6 +1,6 @@
 /* QNX Neutrino target header.
  
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This code was donated by QNX Software Systems Ltd.
 
@@ -24,9 +24,7 @@
 #ifndef TM_NTO_H
 #define TM_NTO_H 1
 
-/* Pick up most of what we need from the generic i386 target include file.  */
-#include "i386/tm-i386.h"
-#include "tm-nto.h"
+#include "config/tm-nto.h"
 
 #include "solib.h"
 
diff --git a/gdb/config/i386/tm-vxworks.h b/gdb/config/i386/tm-vxworks.h
index f9b6be4..c0a042e 100644
--- a/gdb/config/i386/tm-vxworks.h
+++ b/gdb/config/i386/tm-vxworks.h
@@ -1,6 +1,7 @@
-/* Target machine description for VxWorks on the 80[3456]86,
-   for GDB, the GNU debugger.
-   Copyright 1999 Free Software Foundation, Inc.
+/* Target machine description for VxWorks on the 80[3456]86, for GDB,
+   the GNU debugger.
+
+   Copyright 1999, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,7 +23,6 @@
 #ifndef TM_VXWORKS_H
 #define TM_VXWORKS_H
 
-#include "i386/tm-i386.h"
 #include "config/tm-vxworks.h"
 
 #endif /* ifndef TM_VXWORKS_H */
diff --git a/gdb/config/ia64/tm-aix.h b/gdb/config/ia64/tm-aix.h
index 186cd93..aabe088 100644
--- a/gdb/config/ia64/tm-aix.h
+++ b/gdb/config/ia64/tm-aix.h
@@ -1,5 +1,6 @@
 /* Definitions to target GDB to GNU/Linux on IA-64 running AIX.
-   Copyright 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 2000, 2001, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,8 +25,6 @@
 #include "ia64/tm-ia64.h"
 #include "config/tm-sysv4.h"
 
-#define TARGET_ELF64
-
 extern int ia64_aix_in_sigtramp (CORE_ADDR pc, char *func_name);
 #define DEPRECATED_IN_SIGTRAMP(pc,func_name) ia64_aix_in_sigtramp (pc, func_name)
 
diff --git a/gdb/config/ia64/tm-linux.h b/gdb/config/ia64/tm-linux.h
index 4aa6d85..f040f94 100644
--- a/gdb/config/ia64/tm-linux.h
+++ b/gdb/config/ia64/tm-linux.h
@@ -1,5 +1,6 @@
 /* Definitions to target GDB to GNU/Linux on IA-64 Linux.
-   Copyright 1992, 1993, 2000 Free Software Foundation, Inc.
+
+   Copyright 1992, 1993, 2000, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -26,8 +27,6 @@
 #include "ia64/tm-ia64.h"
 #include "config/tm-linux.h"
 
-#define TARGET_ELF64
-
 extern int ia64_linux_in_sigtramp (CORE_ADDR pc, char *func_name);
 #define DEPRECATED_IN_SIGTRAMP(pc,func_name) ia64_linux_in_sigtramp (pc, func_name)
 
diff --git a/gdb/config/m68k/3b1.mh b/gdb/config/m68k/3b1.mh
deleted file mode 100644
index 1ebba27..0000000
--- a/gdb/config/m68k/3b1.mh
+++ /dev/null
@@ -1,12 +0,0 @@
-# OBSOLETE # Host: AT&T 3b1/Unix pc
-# OBSOLETE # I don't think cc has been tried.  -traditional for <sys/ioctl.h>
-# OBSOLETE # (not sure whether necessary).
-# OBSOLETE CC= gcc -traditional
-# OBSOLETE # GCC runs out of virtual memory.
-# OBSOLETE # A separate CC for pinsn routines is no longer supported, though.
-# OBSOLETE # FIXME -- someone unlucky enough to have a 3B1, let bug-gcc@prep.ai.mit.edu
-# OBSOLETE # know what works and what fails on the 3B1.
-# OBSOLETE #PINSN_CC= cc
-# OBSOLETE 
-# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o
-# OBSOLETE XM_FILE= xm-3b1.h
diff --git a/gdb/config/m68k/3b1.mt b/gdb/config/m68k/3b1.mt
deleted file mode 100644
index 7459187..0000000
--- a/gdb/config/m68k/3b1.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# OBSOLETE # Target: AT&T 3b1/Unix pc
-# OBSOLETE TDEPFILES= m68k-tdep.o
-# OBSOLETE TM_FILE= tm-3b1.h
diff --git a/gdb/config/m68k/delta68.mh b/gdb/config/m68k/delta68.mh
deleted file mode 100644
index cfa14ba..0000000
--- a/gdb/config/m68k/delta68.mh
+++ /dev/null
@@ -1,5 +0,0 @@
-# OBSOLETE # Host: Motorola Delta Series sysV68 R3V7.1
-# OBSOLETE 
-# OBSOLETE XM_FILE= xm-delta68.h
-# OBSOLETE NAT_FILE= nm-delta68.h
-# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o delta68-nat.o
diff --git a/gdb/config/m68k/delta68.mt b/gdb/config/m68k/delta68.mt
deleted file mode 100644
index 743a92a..0000000
--- a/gdb/config/m68k/delta68.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# OBSOLETE # Motorola Delta Series sysV68 R3V7.1
-# OBSOLETE TDEPFILES= m68k-tdep.o
-# OBSOLETE TM_FILE= tm-delta68.h
diff --git a/gdb/config/m68k/dpx2.mh b/gdb/config/m68k/dpx2.mh
deleted file mode 100644
index e9c5b68..0000000
--- a/gdb/config/m68k/dpx2.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# OBSOLETE # Host: Bull DPX2 (68k, System V release 3)
-# OBSOLETE 
-# OBSOLETE XM_FILE= xm-dpx2.h
-# OBSOLETE 
-# OBSOLETE NAT_FILE= nm-dpx2.h
-# OBSOLETE NATDEPFILES= infptrace.o corelow.o core-aout.o inftarg.o dpx2-nat.o fork-child.o
diff --git a/gdb/config/m68k/dpx2.mt b/gdb/config/m68k/dpx2.mt
deleted file mode 100644
index 7cecda6..0000000
--- a/gdb/config/m68k/dpx2.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# OBSOLETE # Target: Bull DPX2 (68k, System V release 3)
-# OBSOLETE TDEPFILES= m68k-tdep.o
-# OBSOLETE TM_FILE= tm-dpx2.h
diff --git a/gdb/config/m68k/m68klynx.mh b/gdb/config/m68k/m68klynx.mh
deleted file mode 100644
index c76dcce..0000000
--- a/gdb/config/m68k/m68klynx.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# OBSOLETE # Host: Motorola 680x0 running LynxOS
-# OBSOLETE 
-# OBSOLETE XM_CLIBS= -lbsd
-# OBSOLETE 
-# OBSOLETE NAT_FILE= nm-m68klynx.h
-# OBSOLETE NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o lynx-nat.o
diff --git a/gdb/config/m68k/m68klynx.mt b/gdb/config/m68k/m68klynx.mt
deleted file mode 100644
index e3a3c79..0000000
--- a/gdb/config/m68k/m68klynx.mt
+++ /dev/null
@@ -1,4 +0,0 @@
-# OBSOLETE # Target: Motorola 680x0 running LynxOS
-# OBSOLETE TDEPFILES= coff-solib.o m68k-tdep.o
-# OBSOLETE # m68kly-tdep.o
-# OBSOLETE TM_FILE= tm-m68klynx.h
diff --git a/gdb/config/m68k/m68kv4.mh b/gdb/config/m68k/m68kv4.mh
deleted file mode 100644
index 23c64fa..0000000
--- a/gdb/config/m68k/m68kv4.mh
+++ /dev/null
@@ -1,7 +0,0 @@
-# OBSOLETE # Host: Motorola 680x0 running SVR4 (Commodore Amiga amix or Atari TT ASV)
-# OBSOLETE 
-# OBSOLETE XM_FILE= xm-m68kv4.h
-# OBSOLETE 
-# OBSOLETE NAT_FILE= nm-sysv4.h
-# OBSOLETE NATDEPFILES= corelow.o core-regset.o solib.o solib-svr4.o solib-legacy.o \
-# OBSOLETE 	fork-child.o procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
diff --git a/gdb/config/m68k/m68kv4.mt b/gdb/config/m68k/m68kv4.mt
deleted file mode 100644
index 0a9ad08..0000000
--- a/gdb/config/m68k/m68kv4.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# OBSOLETE # Target: Motorola 680x0 running SVR4 (Commodore Amiga amix or Atari TT ASV)
-# OBSOLETE TDEPFILES= m68k-tdep.o
-# OBSOLETE TM_FILE= tm-m68kv4.h
diff --git a/gdb/config/m68k/nbsd.mt b/gdb/config/m68k/nbsd.mt
new file mode 100644
index 0000000..1c77253
--- /dev/null
+++ b/gdb/config/m68k/nbsd.mt
@@ -0,0 +1,3 @@
+# Target: NetBSD/m68k
+TDEPFILES= m68k-tdep.o m68kbsd-tdep.o corelow.o solib.o solib-svr4.o
+TM_FILE= tm-nbsd.h
diff --git a/gdb/config/m68k/nbsdaout.mh b/gdb/config/m68k/nbsdaout.mh
index 7ce279b..90a43d7 100644
--- a/gdb/config/m68k/nbsdaout.mh
+++ b/gdb/config/m68k/nbsdaout.mh
@@ -1,5 +1,4 @@
-# Host: Motorola m68k running NetBSD
-NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o m68knbsd-nat.o \
+# Host: NetBSD/m68k a.out
+NATDEPFILES= m68kbsd-nat.o fork-child.o infptrace.o inftarg.o \
 	solib.o solib-sunos.o
-XM_FILE= xm-nbsd.h
 NAT_FILE= nm-nbsdaout.h
diff --git a/gdb/config/m68k/nbsdaout.mt b/gdb/config/m68k/nbsdaout.mt
deleted file mode 100644
index b6ac5a0..0000000
--- a/gdb/config/m68k/nbsdaout.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Target: Motorola m68k running NetBSD
-TDEPFILES= m68k-tdep.o m68knbsd-tdep.o
-TM_FILE= tm-nbsd.h
diff --git a/gdb/config/m68k/nbsdelf.mh b/gdb/config/m68k/nbsdelf.mh
new file mode 100644
index 0000000..1823f32
--- /dev/null
+++ b/gdb/config/m68k/nbsdelf.mh
@@ -0,0 +1,5 @@
+# Host: NetBSD/m68k ELF
+NATDEPFILES= m68kbsd-nat.o bsd-kvm.o fork-child.o infptrace.o inftarg.o
+NAT_FILE= nm-nbsd.h
+
+LOADLIBES= -lkvm
\ No newline at end of file
diff --git a/gdb/config/m68k/nm-delta68.h b/gdb/config/m68k/nm-delta68.h
deleted file mode 100644
index e27bb69..0000000
--- a/gdb/config/m68k/nm-delta68.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// OBSOLETE /* Macro definitions for a Motorola Delta Series sysV68 R3V7.1.
-// OBSOLETE    Copyright 1993, 1998 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE 
-// OBSOLETE #define KERNEL_U_SIZE kernel_u_size()
diff --git a/gdb/config/m68k/nm-dpx2.h b/gdb/config/m68k/nm-dpx2.h
deleted file mode 100644
index f6cce8a..0000000
--- a/gdb/config/m68k/nm-dpx2.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// OBSOLETE /* Native support for a Bull DPX2.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1993, 2000 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* KERNEL_U_ADDR is determined upon startup in dpx2-xdep.c. */
-// OBSOLETE 
-// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \
-// OBSOLETE 	(addr) = dpx2_register_u_addr ((blockend),(regno));
-// OBSOLETE 
-// OBSOLETE extern int dpx2_register_u_addr (int, int);
-// OBSOLETE 
-// OBSOLETE /* Kernel is a bit tenacious about sharing text segments, disallowing bpts.  */
-// OBSOLETE #define	ONE_PROCESS_WRITETEXT
diff --git a/gdb/config/m68k/nm-m68klynx.h b/gdb/config/m68k/nm-m68klynx.h
deleted file mode 100644
index 88b1260..0000000
--- a/gdb/config/m68k/nm-m68klynx.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// OBSOLETE /* Native-dependent definitions for Motorola 680x0 running LynxOS.
-// OBSOLETE    Copyright 1993 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #ifndef NM_M68KLYNX_H
-// OBSOLETE #define NM_M68KLYNX_H
-// OBSOLETE 
-// OBSOLETE #include "config/nm-lynx.h"
-// OBSOLETE 
-// OBSOLETE #endif /* NM_M68KLYNX_H */
diff --git a/gdb/config/m68k/nm-nbsd.h b/gdb/config/m68k/nm-nbsd.h
index 72c9889..616daf1 100644
--- a/gdb/config/m68k/nm-nbsd.h
+++ b/gdb/config/m68k/nm-nbsd.h
@@ -1,5 +1,6 @@
-/* Native-dependent definitions for Motorola m68k running NetBSD, for GDB.
-   Copyright 1996 Free Software Foundation, Inc.
+/* Native-dependent definitions for NetBSD/m68k.
+
+   Copyright 1996, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,7 +22,7 @@
 #ifndef NM_NBSD_H
 #define NM_NBSD_H
 
-/* Get generic NetBSD native definitions. */
+/* Get generic NetBSD native definitions.  */
 #include "config/nm-nbsd.h"
 
-#endif /* NM_NBSD_H */
+#endif /* nm-nbsd.h */
diff --git a/gdb/config/m68k/nm-nbsdaout.h b/gdb/config/m68k/nm-nbsdaout.h
index cb755f0..fc8b7ee 100644
--- a/gdb/config/m68k/nm-nbsdaout.h
+++ b/gdb/config/m68k/nm-nbsdaout.h
@@ -1,5 +1,6 @@
-/* Native-dependent definitions for Motorola m68k running NetBSD, for GDB.
-   Copyright 1996, 2002 Free Software Foundation, Inc.
+/* Native-dependent definitions for NetBSD/m68k a.out.
+
+   Copyright 1996, 2002, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -23,7 +24,7 @@
 
 #include "m68k/nm-nbsd.h"
 
-/* Get generic NetBSD a.out native definitions. */
+/* Get generic NetBSD a.out native definitions.  */
 #include "config/nm-nbsdaout.h"
 
-#endif /* NM_NBSDAOUT_H */
+#endif /* nm-nbsdaout.h */
diff --git a/gdb/config/m68k/nm-sun2.h b/gdb/config/m68k/nm-sun2.h
deleted file mode 100644
index cce4a3e..0000000
--- a/gdb/config/m68k/nm-sun2.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// OBSOLETE /* Parameters for execution on a Sun2, for GDB, the GNU debugger.
-// OBSOLETE    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* Do implement the attach and detach commands.  */
-// OBSOLETE 
-// OBSOLETE #define ATTACH_DETACH
-// OBSOLETE 
-// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
-// OBSOLETE #define FETCH_INFERIOR_REGISTERS
-// OBSOLETE 
-// OBSOLETE /* This is a piece of magic that is given a register number REGNO
-// OBSOLETE    and as BLOCKEND the address in the system of the end of the user structure
-// OBSOLETE    and stores in ADDR the address in the kernel or core dump
-// OBSOLETE    of that register.  */
-// OBSOLETE 
-// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno)		\
-// OBSOLETE { addr = blockend + regno * 4; }
diff --git a/gdb/config/m68k/nm-sun3.h b/gdb/config/m68k/nm-sun3.h
deleted file mode 100644
index 9e50707b..0000000
--- a/gdb/config/m68k/nm-sun3.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// OBSOLETE /* Native-only definitions for Sun-3 for GDB, the GNU debugger.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1991, 1992, 1996
-// OBSOLETE    Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #include "regcache.h"
-// OBSOLETE 
-// OBSOLETE /* Do implement the attach and detach commands.  */
-// OBSOLETE 
-// OBSOLETE #define ATTACH_DETACH
-// OBSOLETE 
-// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
-// OBSOLETE 
-// OBSOLETE #define FETCH_INFERIOR_REGISTERS
-// OBSOLETE 
-// OBSOLETE /* We have to grab the regs since we store all regs at once.  */
-// OBSOLETE 
-// OBSOLETE #define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES)
diff --git a/gdb/config/m68k/nm-sysv4.h b/gdb/config/m68k/nm-sysv4.h
deleted file mode 100644
index 6e3a452..0000000
--- a/gdb/config/m68k/nm-sysv4.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// OBSOLETE /* Native-dependent definitions for Motorola 680x0 running SVR4.
-// OBSOLETE    Copyright 1994 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* Include the generic SVR4 definitions.  */
-// OBSOLETE 
-// OBSOLETE #include "config/nm-sysv4.h"
diff --git a/gdb/config/m68k/obsd.mh b/gdb/config/m68k/obsd.mh
new file mode 100644
index 0000000..54e4e9d
--- /dev/null
+++ b/gdb/config/m68k/obsd.mh
@@ -0,0 +1,6 @@
+# Host: OpenBSD/m68k
+NATDEPFILES= m68kbsd-nat.o bsd-kvm.o fork-child.o infptrace.o inftarg.o \
+	solib.o solib-sunos.o
+NAT_FILE= nm-nbsdaout.h
+
+LOADLIBES= -lkvm
diff --git a/gdb/config/m68k/obsd.mt b/gdb/config/m68k/obsd.mt
new file mode 100644
index 0000000..7021c7f
--- /dev/null
+++ b/gdb/config/m68k/obsd.mt
@@ -0,0 +1,3 @@
+# Target: OpenBSD/m68k
+TDEPFILES= m68k-tdep.o m68kbsd-tdep.o corelow.o solib.o solib-svr4.o
+TM_FILE= tm-obsd.h
diff --git a/gdb/config/m68k/sun2os3.mh b/gdb/config/m68k/sun2os3.mh
deleted file mode 100644
index 2243a28..0000000
--- a/gdb/config/m68k/sun2os3.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# OBSOLETE # Host: Sun 2, running SunOS 3
-# OBSOLETE XM_FILE= xm-sun2.h
-# OBSOLETE NAT_FILE= nm-sun2.h
-# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o sun3-nat.o
diff --git a/gdb/config/m68k/sun2os3.mt b/gdb/config/m68k/sun2os3.mt
deleted file mode 100644
index 343bccd..0000000
--- a/gdb/config/m68k/sun2os3.mt
+++ /dev/null
@@ -1,7 +0,0 @@
-# OBSOLETE # Target: Sun 2, running SunOS 3
-# OBSOLETE # The system-supplied assembler re-orders the symbols so that gdb
-# OBSOLETE # can't find "gcc_compiled.".
-# OBSOLETE #msg If you compile your program with GCC, use the GNU assembler.
-# OBSOLETE #msg
-# OBSOLETE TDEPFILES= m68k-tdep.o
-# OBSOLETE TM_FILE= tm-sun2.h
diff --git a/gdb/config/m68k/sun2os4.mh b/gdb/config/m68k/sun2os4.mh
deleted file mode 100644
index ab9c720..0000000
--- a/gdb/config/m68k/sun2os4.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# OBSOLETE # Host: Sun 2, running SunOS 4
-# OBSOLETE XM_FILE= xm-sun2.h
-# OBSOLETE NAT_FILE= nm-sun2.h
-# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o sun3-nat.o
diff --git a/gdb/config/m68k/sun2os4.mt b/gdb/config/m68k/sun2os4.mt
deleted file mode 100644
index 30ff4e3..0000000
--- a/gdb/config/m68k/sun2os4.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# OBSOLETE # Target: Sun 2, running SunOS 4
-# OBSOLETE TDEPFILES= solib.o solib-sunos.o m68k-tdep.o
-# OBSOLETE TM_FILE= tm-sun2os4.h
diff --git a/gdb/config/m68k/sun3os3.mh b/gdb/config/m68k/sun3os3.mh
deleted file mode 100644
index e7c820f..0000000
--- a/gdb/config/m68k/sun3os3.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# OBSOLETE # Host: Sun 3, running SunOS 3
-# OBSOLETE XM_FILE= xm-sun3.h
-# OBSOLETE NAT_FILE= nm-sun3.h
-# OBSOLETE NATDEPFILES= fork-child.o inftarg.o infptrace.o corelow.o sun3-nat.o
diff --git a/gdb/config/m68k/sun3os3.mt b/gdb/config/m68k/sun3os3.mt
deleted file mode 100644
index 4ea0d27..0000000
--- a/gdb/config/m68k/sun3os3.mt
+++ /dev/null
@@ -1,8 +0,0 @@
-# OBSOLETE # Target: Sun 3, running SunOS 3
-# OBSOLETE # The system-supplied assembler re-orders the symbols so that gdb
-# OBSOLETE # can't find "gcc_compiled.".
-# OBSOLETE #msg If you compile your program with GCC, use the GNU assembler.
-# OBSOLETE #msg
-# OBSOLETE 
-# OBSOLETE TDEPFILES= m68k-tdep.o
-# OBSOLETE TM_FILE= tm-sun3.h
diff --git a/gdb/config/m68k/sun3os4.mh b/gdb/config/m68k/sun3os4.mh
deleted file mode 100644
index dc3f9af..0000000
--- a/gdb/config/m68k/sun3os4.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# OBSOLETE # Host: Sun 3, running SunOS 4
-# OBSOLETE XM_FILE= xm-sun3os4.h
-# OBSOLETE NAT_FILE= nm-sun3.h
-# OBSOLETE NATDEPFILES= fork-child.o inftarg.o infptrace.o corelow.o sun3-nat.o
diff --git a/gdb/config/m68k/sun3os4.mt b/gdb/config/m68k/sun3os4.mt
deleted file mode 100644
index decf0b3..0000000
--- a/gdb/config/m68k/sun3os4.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# OBSOLETE # Target: Sun 3, running SunOS 4, as a target system
-# OBSOLETE TDEPFILES= solib.o solib-sunos.o m68k-tdep.o
-# OBSOLETE TM_FILE= tm-sun3os4.h
diff --git a/gdb/config/m68k/tm-3b1.h b/gdb/config/m68k/tm-3b1.h
deleted file mode 100644
index df845bd..0000000
--- a/gdb/config/m68k/tm-3b1.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// OBSOLETE /* Parameters for targeting GDB to a 3b1.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* The child target can't deal with floating registers.  */
-// OBSOLETE #define CANNOT_STORE_REGISTER(regno) ((regno) >= FP0_REGNUM)
-// OBSOLETE 
-// OBSOLETE /* Define BPT_VECTOR if it is different than the default.
-// OBSOLETE    This is the vector number used by traps to indicate a breakpoint. */
-// OBSOLETE 
-// OBSOLETE #define BPT_VECTOR 0x1
-// OBSOLETE 
-// OBSOLETE /* Address of end of stack space.  */
-// OBSOLETE 
-// OBSOLETE #define STACK_END_ADDR 0x300000
-// OBSOLETE 
-// OBSOLETE #include "m68k/tm-m68k.h"
diff --git a/gdb/config/m68k/tm-delta68.h b/gdb/config/m68k/tm-delta68.h
deleted file mode 100644
index c041060..0000000
--- a/gdb/config/m68k/tm-delta68.h
+++ /dev/null
@@ -1,109 +0,0 @@
-// OBSOLETE /* Target definitions for delta68.
-// OBSOLETE    Copyright 1993, 1994, 1998, 1999, 2000 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE struct frame_info;
-// OBSOLETE 
-// OBSOLETE #include "regcache.h"
-// OBSOLETE 
-// OBSOLETE /* Define BPT_VECTOR if it is different than the default.
-// OBSOLETE    This is the vector number used by traps to indicate a breakpoint. */
-// OBSOLETE 
-// OBSOLETE #define BPT_VECTOR 0x1
-// OBSOLETE 
-// OBSOLETE #define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled%"
-// OBSOLETE #define GCC2_COMPILED_FLAG_SYMBOL "gcc2_compiled%"
-// OBSOLETE 
-// OBSOLETE /* Amount PC must be decremented by after a breakpoint.
-// OBSOLETE    On the Delta, the kernel decrements it for us.  */
-// OBSOLETE 
-// OBSOLETE #define DECR_PC_AFTER_BREAK 0
-// OBSOLETE 
-// OBSOLETE /* Not sure what happens if we try to store this register, but
-// OBSOLETE    phdm@info.ucl.ac.be says we need this define.  */
-// OBSOLETE 
-// OBSOLETE #define CANNOT_STORE_REGISTER(regno)	(regno == FPI_REGNUM)
-// OBSOLETE 
-// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state
-// OBSOLETE    a function return value of type TYPE, and copy that, in virtual format,
-// OBSOLETE    into VALBUF.  */
-// OBSOLETE 
-// OBSOLETE /* When it returns a float/double value, use fp0 in sysV68.  */
-// OBSOLETE /* When it returns a pointer value, use a0 in sysV68.  */
-// OBSOLETE 
-// OBSOLETE #define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF)		\
-// OBSOLETE   if (TYPE_CODE (TYPE) == TYPE_CODE_FLT)				\
-// OBSOLETE     DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, TYPE,			\
-// OBSOLETE 				 &REGBUF[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],	\
-// OBSOLETE 				 VALBUF);				\
-// OBSOLETE   else									\
-// OBSOLETE     memcpy ((VALBUF),							\
-// OBSOLETE 	    (char *) ((REGBUF) +					\
-// OBSOLETE 		      (TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 :	\
-// OBSOLETE 		       (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)))), \
-// OBSOLETE 	    TYPE_LENGTH(TYPE))
-// OBSOLETE 
-// OBSOLETE /* Write into appropriate registers a function return value
-// OBSOLETE    of type TYPE, given in virtual format.  */
-// OBSOLETE 
-// OBSOLETE /* When it returns a float/double value, use fp0 in sysV68.  */
-// OBSOLETE /* When it returns a pointer value, use a0 in sysV68.  */
-// OBSOLETE 
-// OBSOLETE #define DEPRECATED_STORE_RETURN_VALUE(TYPE,VALBUF) \
-// OBSOLETE   if (TYPE_CODE (TYPE) == TYPE_CODE_FLT)				\
-// OBSOLETE       {									\
-// OBSOLETE 	char raw_buf[DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM)];			\
-// OBSOLETE 	DEPRECATED_REGISTER_CONVERT_TO_RAW (TYPE, FP0_REGNUM, VALBUF, raw_buf);	\
-// OBSOLETE 	deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP0_REGNUM),		\
-// OBSOLETE 			      raw_buf, DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM)); \
-// OBSOLETE       }									\
-// OBSOLETE   else									\
-// OBSOLETE     deprecated_write_register_bytes ((TYPE_CODE(TYPE) == TYPE_CODE_PTR ? 8 * 4 : 0), \
-// OBSOLETE 			  VALBUF, TYPE_LENGTH (TYPE))
-// OBSOLETE 
-// OBSOLETE /* Return number of args passed to a frame.
-// OBSOLETE    Can return -1, meaning no way to tell.  */
-// OBSOLETE 
-// OBSOLETE extern int delta68_frame_num_args (struct frame_info *fi);
-// OBSOLETE #define FRAME_NUM_ARGS(fi) (delta68_frame_num_args ((fi)))
-// OBSOLETE 
-// OBSOLETE /* On M68040 versions of sysV68 R3V7.1, ptrace(PT_WRITE_I) does not clear
-// OBSOLETE    the processor's instruction cache as it should.  */
-// OBSOLETE #define CLEAR_INSN_CACHE()	clear_insn_cache()
-// OBSOLETE 
-// OBSOLETE #include "m68k/tm-m68k.h"
-// OBSOLETE 
-// OBSOLETE /* Extract from an array REGBUF containing the (raw) register state
-// OBSOLETE    the address in which a function should return its structure value,
-// OBSOLETE    as a CORE_ADDR (or an expression that can be used as one).  */
-// OBSOLETE 
-// OBSOLETE #undef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
-// OBSOLETE #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF)\
-// OBSOLETE 	(*(CORE_ADDR *)((char*)(REGBUF) + 8 * 4))
-// OBSOLETE 
-// OBSOLETE extern int delta68_in_sigtramp (CORE_ADDR pc, char *name);
-// OBSOLETE #define IN_SIGTRAMP(pc,name) delta68_in_sigtramp (pc, name)
-// OBSOLETE 
-// OBSOLETE extern CORE_ADDR delta68_frame_saved_pc (struct frame_info *fi);
-// OBSOLETE #undef DEPRECATED_FRAME_SAVED_PC
-// OBSOLETE #define DEPRECATED_FRAME_SAVED_PC(fi) delta68_frame_saved_pc (fi)
-// OBSOLETE 
-// OBSOLETE extern CORE_ADDR delta68_frame_args_address (struct frame_info *fi);
-// OBSOLETE #undef DEPRECATED_FRAME_ARGS_ADDRESS
-// OBSOLETE #define DEPRECATED_FRAME_ARGS_ADDRESS(fi) delta68_frame_args_address (fi)
diff --git a/gdb/config/m68k/tm-dpx2.h b/gdb/config/m68k/tm-dpx2.h
deleted file mode 100644
index f641ad3..0000000
--- a/gdb/config/m68k/tm-dpx2.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// OBSOLETE /* Parameters for targeting to a Bull DPX2.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1991, 1993, 1994
-// OBSOLETE    Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* Define BPT_VECTOR if it is different than the default.
-// OBSOLETE    This is the vector number used by traps to indicate a breakpoint. */
-// OBSOLETE 
-// OBSOLETE #define BPT_VECTOR 0xe
-// OBSOLETE 
-// OBSOLETE /* Need to get function ends by adding this to epilogue address from .bf
-// OBSOLETE    record, not using x_fsize field.  */
-// OBSOLETE #define FUNCTION_EPILOGUE_SIZE 4
-// OBSOLETE 
-// OBSOLETE /* The child target can't deal with writing floating registers.  */
-// OBSOLETE #define CANNOT_STORE_REGISTER(regno) ((regno) >= FP0_REGNUM)
-// OBSOLETE 
-// OBSOLETE #include <sys/types.h>
-// OBSOLETE #include "m68k/tm-m68k.h"
diff --git a/gdb/config/m68k/tm-m68klynx.h b/gdb/config/m68k/tm-m68klynx.h
deleted file mode 100644
index e82fbee..0000000
--- a/gdb/config/m68k/tm-m68klynx.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// OBSOLETE /* Macro definitions for Motorola 680x0 running under LynxOS.
-// OBSOLETE    Copyright 1993 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #ifndef TM_M68KLYNX_H
-// OBSOLETE #define TM_M68KLYNX_H
-// OBSOLETE 
-// OBSOLETE #include "config/tm-lynx.h"
-// OBSOLETE 
-// OBSOLETE /* If PC-2 contains this instruction, then we know what we are in a system
-// OBSOLETE    call stub, and the return PC is is at SP+4, instead of SP. */
-// OBSOLETE 
-// OBSOLETE #define SYSCALL_TRAP 0x4e4a	/* trap #10 */
-// OBSOLETE #define SYSCALL_TRAP_OFFSET 2	/* PC is after trap instruction */
-// OBSOLETE 
-// OBSOLETE /* Use the generic 68k definitions. */
-// OBSOLETE 
-// OBSOLETE #include "m68k/tm-m68k.h"
-// OBSOLETE 
-// OBSOLETE /* Disable dumbshit alternate breakpoint mechanism needed by 68k stub. */
-// OBSOLETE #undef DEPRECATED_REMOTE_BREAKPOINT
-// OBSOLETE 
-// OBSOLETE #endif /* TM_M68KLYNX_H */
diff --git a/gdb/config/m68k/tm-m68kv4.h b/gdb/config/m68k/tm-m68kv4.h
deleted file mode 100644
index 95696b6..0000000
--- a/gdb/config/m68k/tm-m68kv4.h
+++ /dev/null
@@ -1,67 +0,0 @@
-// OBSOLETE /* Target definitions for GDB on a Motorola 680x0 running SVR4.
-// OBSOLETE    (Commodore Amiga with amix or Atari TT with ASV)
-// OBSOLETE    Copyright 1991, 1994, 1995, 1996, 1998, 1999, 2000, 2003
-// OBSOLETE    Free Software Foundation, Inc.
-// OBSOLETE    Written by Fred Fish at Cygnus Support (fnf@cygint)
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* Define BPT_VECTOR if it is different than the default.
-// OBSOLETE    This is the vector number used by traps to indicate a breakpoint. */
-// OBSOLETE 
-// OBSOLETE #define BPT_VECTOR 0x1
-// OBSOLETE 
-// OBSOLETE /* How much to decrement the PC after a trap.  Depends on kernel. */
-// OBSOLETE 
-// OBSOLETE #define DECR_PC_AFTER_BREAK 0	/* No decrement required */
-// OBSOLETE 
-// OBSOLETE #include "config/tm-sysv4.h"
-// OBSOLETE #include "m68k/tm-m68k.h"
-// OBSOLETE 
-// OBSOLETE /* Offsets (in target ints) into jmp_buf.  Not defined in any system header
-// OBSOLETE    file, so we have to step through setjmp/longjmp with a debugger and figure
-// OBSOLETE    them out.  As a double check, note that <setjmp> defines _JBLEN as 13,
-// OBSOLETE    which matches the number of elements we see saved by setjmp(). */
-// OBSOLETE 
-// OBSOLETE #define JB_ELEMENT_SIZE sizeof(int)	/* jmp_buf[_JBLEN] is array of ints */
-// OBSOLETE 
-// OBSOLETE #define JB_D2	0
-// OBSOLETE #define JB_D3	1
-// OBSOLETE #define JB_D4	2
-// OBSOLETE #define JB_D5	3
-// OBSOLETE #define JB_D6	4
-// OBSOLETE #define JB_D7	5
-// OBSOLETE #define JB_A1	6
-// OBSOLETE #define JB_A2	7
-// OBSOLETE #define JB_A3	8
-// OBSOLETE #define JB_A4	9
-// OBSOLETE #define JB_A5	10
-// OBSOLETE #define JB_A6	11
-// OBSOLETE #define JB_A7	12
-// OBSOLETE 
-// OBSOLETE #define JB_PC	JB_A1		/* Setjmp()'s return PC saved in A1 */
-// OBSOLETE 
-// OBSOLETE /* Figure out where the longjmp will land.  Slurp the args out of the stack.
-// OBSOLETE    We expect the first arg to be a pointer to the jmp_buf structure from which
-// OBSOLETE    we extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
-// OBSOLETE    This routine returns true on success */
-// OBSOLETE 
-// OBSOLETE #define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR)
-// OBSOLETE 
-// OBSOLETE /* Convert a DWARF register number to a gdb REGNUM.  */
-// OBSOLETE #define DWARF_REG_TO_REGNUM(num) ((num) < 16 ? (num) : (num)+FP0_REGNUM-16)
diff --git a/gdb/config/m68k/tm-nbsd.h b/gdb/config/m68k/tm-nbsd.h
index 05deff7..6215cf6 100644
--- a/gdb/config/m68k/tm-nbsd.h
+++ b/gdb/config/m68k/tm-nbsd.h
@@ -1,5 +1,6 @@
-/* Macro definitions for m68k running under NetBSD.
-   Copyright 1994, 1996, 2001 Free Software Foundation, Inc.
+/* Target-dependent definitions for NetBSD/m68k.
+
+   Copyright 1994, 1996, 2001, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,29 +22,6 @@
 #ifndef TM_NBSD_H
 #define TM_NBSD_H
 
-#include <sys/param.h>
-#include <machine/vmparam.h>
+#include "solib.h"
 
-/* Define BPT_VECTOR if it is different than the default.
-   This is the vector number used by traps to indicate a breakpoint. */
-#define BPT_VECTOR		0xf
-#define REMOTE_BPT_VECTOR	0xf
-
-/* Address of end of stack space.  */
-#define STACK_END_ADDR USRSTACK
-
-/* For NetBSD, sigtramp is 32 bytes before STACK_END_ADDR.  */
-#define DEPRECATED_SIGTRAMP_START(pc) (STACK_END_ADDR - 32)
-#define DEPRECATED_SIGTRAMP_END(pc) (STACK_END_ADDR)
-
-#include "m68k/tm-m68k.h"
-
-/* Return non-zero if we are in a shared library trampoline code stub. */
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
-  (name && !strcmp(name, "_DYNAMIC"))
-
-extern use_struct_convention_fn m68knbsd_use_struct_convention;
-#define USE_STRUCT_CONVENTION(gcc_p, type) \
-        m68knbsd_use_struct_convention(gcc_p, type)
-
-#endif /* TM_NBSD_H */
+#endif /* tm-nbsd.h */
diff --git a/gdb/config/m68k/xm-nbsd.h b/gdb/config/m68k/tm-obsd.h
similarity index 79%
rename from gdb/config/m68k/xm-nbsd.h
rename to gdb/config/m68k/tm-obsd.h
index 6c735fa..993b49e 100644
--- a/gdb/config/m68k/xm-nbsd.h
+++ b/gdb/config/m68k/tm-obsd.h
@@ -1,5 +1,6 @@
-/* Parameters for execution on a Motorola m68k running NetBSD, for GDB.
-   Copyright 1996 Free Software Foundation, Inc.
+/* Target-dependent definitions for OpenBSD/m68k.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,5 +19,9 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* Get generic NetBSD host definitions. */
-#include "config/xm-nbsd.h"
+#ifndef TM_OBSD_H
+#define TM_OBSD_H
+
+#include "solib.h"
+
+#endif /* tm-obsd.h */
diff --git a/gdb/config/m68k/tm-sun2.h b/gdb/config/m68k/tm-sun2.h
deleted file mode 100644
index 199530a..0000000
--- a/gdb/config/m68k/tm-sun2.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// OBSOLETE /* Parameters for execution on a Sun, for GDB, the GNU debugger.
-// OBSOLETE    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* The child target can't deal with floating registers.  */
-// OBSOLETE #define CANNOT_STORE_REGISTER(regno) ((regno) >= FP0_REGNUM)
-// OBSOLETE 
-// OBSOLETE #include "m68k/tm-m68k.h"
diff --git a/gdb/config/m68k/tm-sun2os4.h b/gdb/config/m68k/tm-sun2os4.h
deleted file mode 100644
index 83beb6c..0000000
--- a/gdb/config/m68k/tm-sun2os4.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// OBSOLETE /* Copyright (C) 1990, Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #include "m68k/tm-sun2.h"
-// OBSOLETE #include "config/tm-sunos.h"
diff --git a/gdb/config/m68k/tm-sun3.h b/gdb/config/m68k/tm-sun3.h
deleted file mode 100644
index f51666d..0000000
--- a/gdb/config/m68k/tm-sun3.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// OBSOLETE /* Parameters for execution on a Sun, for GDB, the GNU debugger.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1996, 2000
-// OBSOLETE    Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #ifndef TM_SUN3_H
-// OBSOLETE #define TM_SUN3_H
-// OBSOLETE 
-// OBSOLETE /* Sun3 status includes fpflags, which shows whether the FPU has been used
-// OBSOLETE    by the process, and whether the FPU was done with an instruction or 
-// OBSOLETE    was interrupted in the middle of a long instruction.  See
-// OBSOLETE    <machine/reg.h>.  */
-// OBSOLETE /*                      a&d, pc,sr, fp, fpstat, fpflags   */
-// OBSOLETE 
-// OBSOLETE #define DEPRECATED_REGISTER_BYTES (16*4 + 8 + 8*12 + 3*4 + 4)
-// OBSOLETE 
-// OBSOLETE #define NUM_REGS 31
-// OBSOLETE 
-// OBSOLETE #define REGISTER_BYTES_OK(b) \
-// OBSOLETE      ((b) == DEPRECATED_REGISTER_BYTES \
-// OBSOLETE       || (b) == REGISTER_BYTES_FP \
-// OBSOLETE       || (b) == REGISTER_BYTES_NOFP)
-// OBSOLETE 
-// OBSOLETE /* If PC contains this instruction, then we know what we are in a system
-// OBSOLETE    call stub, and the return PC is is at SP+4, instead of SP. */
-// OBSOLETE 
-// OBSOLETE #define SYSCALL_TRAP 0x4e40	/* trap #0 */
-// OBSOLETE #define SYSCALL_TRAP_OFFSET 0	/* PC points at trap instruction */
-// OBSOLETE 
-// OBSOLETE #include "m68k/tm-m68k.h"
-// OBSOLETE 
-// OBSOLETE /* Disable alternate breakpoint mechanism needed by 68k stub. */
-// OBSOLETE #undef DEPRECATED_REMOTE_BREAKPOINT
-// OBSOLETE 
-// OBSOLETE /* Offsets (in target ints) into jmp_buf.  Not defined by Sun, but at least
-// OBSOLETE    documented in a comment in <machine/setjmp.h>! */
-// OBSOLETE 
-// OBSOLETE #define JB_ELEMENT_SIZE 4
-// OBSOLETE 
-// OBSOLETE #define JB_ONSSTACK 0
-// OBSOLETE #define JB_SIGMASK 1
-// OBSOLETE #define JB_SP 2
-// OBSOLETE #define JB_PC 3
-// OBSOLETE #define JB_PSL 4
-// OBSOLETE #define JB_D2 5
-// OBSOLETE #define JB_D3 6
-// OBSOLETE #define JB_D4 7
-// OBSOLETE #define JB_D5 8
-// OBSOLETE #define JB_D6 9
-// OBSOLETE #define JB_D7 10
-// OBSOLETE #define JB_A2 11
-// OBSOLETE #define JB_A3 12
-// OBSOLETE #define JB_A4 13
-// OBSOLETE #define JB_A5 14
-// OBSOLETE #define JB_A6 15
-// OBSOLETE 
-// OBSOLETE /* Figure out where the longjmp will land.  Slurp the args out of the stack.
-// OBSOLETE    We expect the first arg to be a pointer to the jmp_buf structure from which
-// OBSOLETE    we extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
-// OBSOLETE    This routine returns true on success */
-// OBSOLETE 
-// OBSOLETE #define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR)
-// OBSOLETE 
-// OBSOLETE /* If sun3 pcc says that a parameter is a short, it's a short.  */
-// OBSOLETE #define BELIEVE_PCC_PROMOTION_TYPE 1
-// OBSOLETE 
-// OBSOLETE /* Can't define BELIEVE_PCC_PROMOTION for SunOS /bin/cc of SunOS 4.1.1.
-// OBSOLETE    Apparently Sun fixed this for the sparc but not the sun3.  */
-// OBSOLETE 
-// OBSOLETE /* The code which tries to deal with this bug is never harmful on a sun3.  */
-// OBSOLETE #define SUN_FIXED_LBRAC_BUG (0)
-// OBSOLETE 
-// OBSOLETE #endif /* TM_SUN3_H */
diff --git a/gdb/config/m68k/tm-sun3os4.h b/gdb/config/m68k/tm-sun3os4.h
deleted file mode 100644
index 7e1ffb2..0000000
--- a/gdb/config/m68k/tm-sun3os4.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// OBSOLETE /* Target machine parameters for Sun-3 under SunOS 4.x, for GDB.
-// OBSOLETE    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #include "m68k/tm-sun3.h"
-// OBSOLETE #include "config/tm-sunos.h"
diff --git a/gdb/config/m68k/xm-3b1.h b/gdb/config/m68k/xm-3b1.h
deleted file mode 100644
index 7257b69..0000000
--- a/gdb/config/m68k/xm-3b1.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// OBSOLETE /* Parameters for execution on a 3b1.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1999 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #define HAVE_TERMIO
-// OBSOLETE #define USG
-// OBSOLETE 
-// OBSOLETE /* This is the amount to subtract from u.u_ar0
-// OBSOLETE    to get the offset in the core file of the register values.  */
-// OBSOLETE 
-// OBSOLETE #define KERNEL_U_ADDR 0x70000
-// OBSOLETE 
-// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno)		\
-// OBSOLETE { addr = blockend + regno * 4; }
-// OBSOLETE 
-// OBSOLETE /* Interface definitions for kernel debugger KDB.  */
-// OBSOLETE 
-// OBSOLETE /* Map machine fault codes into signal numbers.
-// OBSOLETE    First subtract 0, divide by 4, then index in a table.
-// OBSOLETE    Faults for which the entry in this table is 0
-// OBSOLETE    are not handled by KDB; the program's own trap handler
-// OBSOLETE    gets to handle then.  */
-// OBSOLETE 
-// OBSOLETE #define FAULT_CODE_ORIGIN 0
-// OBSOLETE #define FAULT_CODE_UNITS 4
-// OBSOLETE #define FAULT_TABLE    \
-// OBSOLETE { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
-// OBSOLETE   0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
-// OBSOLETE   0, 0, 0, 0, 0, 0, 0, 0, \
-// OBSOLETE   SIGILL }
-// OBSOLETE 
-// OBSOLETE /* Start running with a stack stretching from BEG to END.
-// OBSOLETE    BEG and END should be symbols meaningful to the assembler.
-// OBSOLETE    This is used only for kdb.  */
-// OBSOLETE 
-// OBSOLETE #define INIT_STACK(beg, end)  \
-// OBSOLETE { asm (".globl end");         \
-// OBSOLETE   asm ("movel $ end, sp");      \
-// OBSOLETE   asm ("clrl fp"); }
-// OBSOLETE 
-// OBSOLETE /* Push the frame pointer register on the stack.  */
-// OBSOLETE #define PUSH_FRAME_PTR        \
-// OBSOLETE   asm ("movel fp, -(sp)");
-// OBSOLETE 
-// OBSOLETE /* Copy the top-of-stack to the frame pointer register.  */
-// OBSOLETE #define POP_FRAME_PTR  \
-// OBSOLETE   asm ("movl (sp), fp");
-// OBSOLETE 
-// OBSOLETE /* After KDB is entered by a fault, push all registers
-// OBSOLETE    that GDB thinks about (all NUM_REGS of them),
-// OBSOLETE    so that they appear in order of ascending GDB register number.
-// OBSOLETE    The fault code will be on the stack beyond the last register.  */
-// OBSOLETE 
-// OBSOLETE #define PUSH_REGISTERS        \
-// OBSOLETE { asm ("clrw -(sp)");	      \
-// OBSOLETE   asm ("pea 10(sp)");	      \
-// OBSOLETE   asm ("movem $ 0xfffe,-(sp)"); }
-// OBSOLETE 
-// OBSOLETE /* Assuming the registers (including processor status) have been
-// OBSOLETE    pushed on the stack in order of ascending GDB register number,
-// OBSOLETE    restore them and return to the address in the saved PC register.  */
-// OBSOLETE 
-// OBSOLETE #define POP_REGISTERS          \
-// OBSOLETE { asm ("subil $8,28(sp)");     \
-// OBSOLETE   asm ("movem (sp),$ 0xffff"); \
-// OBSOLETE   asm ("rte"); }
diff --git a/gdb/config/m68k/xm-delta68.h b/gdb/config/m68k/xm-delta68.h
deleted file mode 100644
index 9b8f0af..0000000
--- a/gdb/config/m68k/xm-delta68.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// OBSOLETE /* Macro definitions for a Delta.
-// OBSOLETE    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* I'm running gdb 4.9 under sysV68 R3V7.1.
-// OBSOLETE 
-// OBSOLETE    On some machines, gdb crashes when it's starting up while calling the
-// OBSOLETE    vendor's termio tgetent() routine.  It always works when run under
-// OBSOLETE    itself (actually, under 3.2, it's not an infinitely recursive bug.)
-// OBSOLETE    After some poking around, it appears that depending on the environment
-// OBSOLETE    size, or whether you're running YP, or the phase of the moon or something,
-// OBSOLETE    the stack is not always long-aligned when main() is called, and tgetent()
-// OBSOLETE    takes strong offense at that.  On some machines this bug never appears, but
-// OBSOLETE    on those where it does, it occurs quite reliably.  */
-// OBSOLETE #define ALIGN_STACK_ON_STARTUP
-// OBSOLETE 
-// OBSOLETE #define USG
-// OBSOLETE 
-// OBSOLETE #define HAVE_TERMIO
diff --git a/gdb/config/m68k/xm-dpx2.h b/gdb/config/m68k/xm-dpx2.h
deleted file mode 100644
index 0a42203..0000000
--- a/gdb/config/m68k/xm-dpx2.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// OBSOLETE /* Parameters for execution on a Bull DPX2.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1993 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #define HAVE_TERMIOS
-// OBSOLETE #define USG
diff --git a/gdb/config/m68k/xm-m68kv4.h b/gdb/config/m68k/xm-m68kv4.h
deleted file mode 100644
index 044371c..0000000
--- a/gdb/config/m68k/xm-m68kv4.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// OBSOLETE /* Host definitions for GDB on a Motorola 680x0 running SVR4.
-// OBSOLETE    (Commodore Amiga with amix or Atari TT with ASV)
-// OBSOLETE    Copyright 1991, 1992, 1994, 1996 Free Software Foundation, Inc.
-// OBSOLETE    Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* Pick up most of what we need from the generic m68k host include file. */
-// OBSOLETE 
-// OBSOLETE #include "m68k/xm-m68k.h"
-// OBSOLETE 
-// OBSOLETE /* Pick up more stuff from the generic SVR4 host include file. */
-// OBSOLETE 
-// OBSOLETE #include "config/xm-sysv4.h"
diff --git a/gdb/config/m68k/xm-sun2.h b/gdb/config/m68k/xm-sun2.h
deleted file mode 100644
index f17ad3c..0000000
--- a/gdb/config/m68k/xm-sun2.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// OBSOLETE /* Parameters for execution on a Sun, for GDB, the GNU debugger.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1996 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* This is the amount to subtract from u.u_ar0
-// OBSOLETE    to get the offset in the core file of the register values.  */
-// OBSOLETE 
-// OBSOLETE #define KERNEL_U_ADDR 0x2800
-// OBSOLETE 
-// OBSOLETE 
-// OBSOLETE /* Interface definitions for kernel debugger KDB.  */
-// OBSOLETE 
-// OBSOLETE /* Map machine fault codes into signal numbers.
-// OBSOLETE    First subtract 0, divide by 4, then index in a table.
-// OBSOLETE    Faults for which the entry in this table is 0
-// OBSOLETE    are not handled by KDB; the program's own trap handler
-// OBSOLETE    gets to handle then.  */
-// OBSOLETE 
-// OBSOLETE #define FAULT_CODE_ORIGIN 0
-// OBSOLETE #define FAULT_CODE_UNITS 4
-// OBSOLETE #define FAULT_TABLE    \
-// OBSOLETE { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
-// OBSOLETE   0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
-// OBSOLETE   0, 0, 0, 0, 0, 0, 0, 0, \
-// OBSOLETE   SIGILL }
-// OBSOLETE 
-// OBSOLETE /* Start running with a stack stretching from BEG to END.
-// OBSOLETE    BEG and END should be symbols meaningful to the assembler.
-// OBSOLETE    This is used only for kdb.  */
-// OBSOLETE 
-// OBSOLETE #define INIT_STACK(beg, end)  \
-// OBSOLETE { asm (".globl end");         \
-// OBSOLETE   asm ("movel $ end, sp");      \
-// OBSOLETE   asm ("clrl fp"); }
-// OBSOLETE 
-// OBSOLETE /* Push the frame pointer register on the stack.  */
-// OBSOLETE #define PUSH_FRAME_PTR        \
-// OBSOLETE   asm ("movel fp, -(sp)");
-// OBSOLETE 
-// OBSOLETE /* Copy the top-of-stack to the frame pointer register.  */
-// OBSOLETE #define POP_FRAME_PTR  \
-// OBSOLETE   asm ("movl (sp), fp");
-// OBSOLETE 
-// OBSOLETE /* After KDB is entered by a fault, push all registers
-// OBSOLETE    that GDB thinks about (all NUM_REGS of them),
-// OBSOLETE    so that they appear in order of ascending GDB register number.
-// OBSOLETE    The fault code will be on the stack beyond the last register.  */
-// OBSOLETE 
-// OBSOLETE #define PUSH_REGISTERS        \
-// OBSOLETE { asm ("clrw -(sp)");	      \
-// OBSOLETE   asm ("pea 10(sp)");	      \
-// OBSOLETE   asm ("movem $ 0xfffe,-(sp)"); }
-// OBSOLETE 
-// OBSOLETE /* Assuming the registers (including processor status) have been
-// OBSOLETE    pushed on the stack in order of ascending GDB register number,
-// OBSOLETE    restore them and return to the address in the saved PC register.  */
-// OBSOLETE 
-// OBSOLETE #define POP_REGISTERS          \
-// OBSOLETE { asm ("subil $8,28(sp)");     \
-// OBSOLETE   asm ("movem (sp),$ 0xffff"); \
-// OBSOLETE   asm ("rte"); }
diff --git a/gdb/config/m68k/xm-sun3.h b/gdb/config/m68k/xm-sun3.h
deleted file mode 100644
index 5f04e02..0000000
--- a/gdb/config/m68k/xm-sun3.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// OBSOLETE /* Parameters for execution on a Sun, for GDB, the GNU debugger.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1996 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* Interface definitions for kernel debugger KDB.  */
-// OBSOLETE 
-// OBSOLETE /* Map machine fault codes into signal numbers.
-// OBSOLETE    First subtract 0, divide by 4, then index in a table.
-// OBSOLETE    Faults for which the entry in this table is 0
-// OBSOLETE    are not handled by KDB; the program's own trap handler
-// OBSOLETE    gets to handle then.  */
-// OBSOLETE 
-// OBSOLETE #define FAULT_CODE_ORIGIN 0
-// OBSOLETE #define FAULT_CODE_UNITS 4
-// OBSOLETE #define FAULT_TABLE    \
-// OBSOLETE { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
-// OBSOLETE   0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
-// OBSOLETE   0, 0, 0, 0, 0, 0, 0, 0, \
-// OBSOLETE   SIGILL }
-// OBSOLETE 
-// OBSOLETE /* Start running with a stack stretching from BEG to END.
-// OBSOLETE    BEG and END should be symbols meaningful to the assembler.
-// OBSOLETE    This is used only for kdb.  */
-// OBSOLETE 
-// OBSOLETE #define INIT_STACK(beg, end)  \
-// OBSOLETE { asm (".globl end");         \
-// OBSOLETE   asm ("movel #end, sp");      \
-// OBSOLETE   asm ("movel #0,a6"); }
-// OBSOLETE 
-// OBSOLETE /* Push the frame pointer register on the stack.  */
-// OBSOLETE #define PUSH_FRAME_PTR        \
-// OBSOLETE   asm ("movel a6,sp@-");
-// OBSOLETE 
-// OBSOLETE /* Copy the top-of-stack to the frame pointer register.  */
-// OBSOLETE #define POP_FRAME_PTR  \
-// OBSOLETE   asm ("movl sp@,a6");
-// OBSOLETE 
-// OBSOLETE /* After KDB is entered by a fault, push all registers
-// OBSOLETE    that GDB thinks about (all NUM_REGS of them),
-// OBSOLETE    so that they appear in order of ascending GDB register number.
-// OBSOLETE    The fault code will be on the stack beyond the last register.  */
-// OBSOLETE 
-// OBSOLETE #define PUSH_REGISTERS        \
-// OBSOLETE { asm ("clrw -(sp)");	      \
-// OBSOLETE   asm ("pea sp@(10)");	      \
-// OBSOLETE   asm ("movem #0xfffe,sp@-"); }
-// OBSOLETE 
-// OBSOLETE /* Assuming the registers (including processor status) have been
-// OBSOLETE    pushed on the stack in order of ascending GDB register number,
-// OBSOLETE    restore them and return to the address in the saved PC register.  */
-// OBSOLETE 
-// OBSOLETE #define POP_REGISTERS          \
-// OBSOLETE { asm ("subil #8,sp@(28)");     \
-// OBSOLETE   asm ("movem sp@,#0xffff"); \
-// OBSOLETE   asm ("rte"); }
diff --git a/gdb/config/m68k/xm-sun3os4.h b/gdb/config/m68k/xm-sun3os4.h
deleted file mode 100644
index 5062071..0000000
--- a/gdb/config/m68k/xm-sun3os4.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// OBSOLETE /* Macro definitions for a sun 3 running os 4.
-// OBSOLETE    Copyright 1989, 1996, 1998 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #include "m68k/xm-sun3.h"
-// OBSOLETE #define FPU
diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/m88k/nm-obsd.h
similarity index 76%
copy from gdb/config/i386/tm-i386.h
copy to gdb/config/m88k/nm-obsd.h
index e2bd81f..6d81f58 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/config/m88k/nm-obsd.h
@@ -1,6 +1,6 @@
-/* Macro definitions for GDB on an Intel i[345]86.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+/* Native-dependent definitions for OpenBSD/m88k.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -19,7 +19,10 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef TM_I386_H
-#define TM_I386_H 1
+#ifndef NM_OBSD_H
+#define NM_OBSD_H
 
-#endif /* ifndef TM_I386_H */
+/* Get generic BSD native definitions.  */
+#include "config/nm-bsd.h"
+
+#endif /* nm-obsd.h */
diff --git a/gdb/config/m88k/obsd.mh b/gdb/config/m88k/obsd.mh
new file mode 100644
index 0000000..de60ab4
--- /dev/null
+++ b/gdb/config/m88k/obsd.mh
@@ -0,0 +1,3 @@
+# Host: OpenBSD/m88k
+NATDEPFILES= m88kbsd-nat.o fork-child.o infptrace.o inftarg.o
+NAT_FILE= nm-obsd.h
diff --git a/gdb/config/m88k/obsd.mt b/gdb/config/m88k/obsd.mt
new file mode 100644
index 0000000..36e61bb
--- /dev/null
+++ b/gdb/config/m88k/obsd.mt
@@ -0,0 +1,2 @@
+# Target: OpenBSD/m88k
+TDEPFILES= m88k-tdep.o corelow.o
diff --git a/gdb/config/mips/decstation.mh b/gdb/config/mips/decstation.mh
deleted file mode 100644
index 63de3da..0000000
--- a/gdb/config/mips/decstation.mh
+++ /dev/null
@@ -1,4 +0,0 @@
-# OBSOLETE # Host: Little-endian MIPS machine such as DECstation.
-# OBSOLETE XM_FILE= xm-mips.h
-# OBSOLETE NAT_FILE= nm-mips.h
-# OBSOLETE NATDEPFILES= infptrace.o inftarg.o corelow.o mips-nat.o fork-child.o
diff --git a/gdb/config/mips/littlemips.mh b/gdb/config/mips/littlemips.mh
deleted file mode 100644
index 30c40ad..0000000
--- a/gdb/config/mips/littlemips.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# OBSOLETE # Host: Little-endian MIPS machine such as DECstation.
-# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o core-aout.o
-# OBSOLETE XM_FILE= xm-mips.h
diff --git a/gdb/config/mips/mipsv4.mh b/gdb/config/mips/mipsv4.mh
deleted file mode 100644
index 1a6104b..0000000
--- a/gdb/config/mips/mipsv4.mh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Host: Mips running SVR4
-XM_FILE= xm-mipsv4.h
-NAT_FILE= ../nm-sysv4.h
-NATDEPFILES= fork-child.o mipsv4-nat.o corelow.o core-regset.o \
-	solib.o solib-svr4.o solib-legacy.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
diff --git a/gdb/config/mips/mipsv4.mt b/gdb/config/mips/mipsv4.mt
deleted file mode 100644
index 13320c20..0000000
--- a/gdb/config/mips/mipsv4.mt
+++ /dev/null
@@ -1,3 +0,0 @@
-# OBSOLETE # Target: MIPS running SVR4
-# OBSOLETE TDEPFILES= mips-tdep.o
-# OBSOLETE TM_FILE= tm-mipsv4.h
diff --git a/gdb/config/mips/news-mips.mh b/gdb/config/mips/news-mips.mh
deleted file mode 100644
index f2c7f89..0000000
--- a/gdb/config/mips/news-mips.mh
+++ /dev/null
@@ -1,3 +0,0 @@
-# OBSOLETE # Host: Big-endian MIPS machine such as Sony News
-# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o mips-nat.o
-# OBSOLETE NAT_FILE= nm-news-mips.h
diff --git a/gdb/config/mips/nm-mips.h b/gdb/config/mips/nm-mips.h
deleted file mode 100644
index f20ddf1..0000000
--- a/gdb/config/mips/nm-mips.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// OBSOLETE /* Native definitions for GDB on DECstations, Sony News. and MIPS Riscos systems
-// OBSOLETE    Copyright 1986, 1987, 1989, 1992, 1995, 1996, 2000
-// OBSOLETE    Free Software Foundation, Inc.
-// OBSOLETE    Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
-// OBSOLETE    and by Alessandro Forin(af@cs.cmu.edu) at CMU
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
-// OBSOLETE #define FETCH_INFERIOR_REGISTERS
-// OBSOLETE 
-// OBSOLETE /* Figure out where the longjmp will land.  We expect that we have just entered
-// OBSOLETE    longjmp and haven't yet setup the stack frame, so the args are still in the
-// OBSOLETE    argument regs.  a0 (CALL_ARG0) points at the jmp_buf structure from which we
-// OBSOLETE    extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
-// OBSOLETE    This routine returns true on success */
-// OBSOLETE 
-// OBSOLETE #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
-// OBSOLETE extern int get_longjmp_target (CORE_ADDR *);
diff --git a/gdb/config/mips/nm-news-mips.h b/gdb/config/mips/nm-news-mips.h
deleted file mode 100644
index 15d9b7b..0000000
--- a/gdb/config/mips/nm-news-mips.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// OBSOLETE /* Definitions to make GDB run on a mips box under 4.3bsd.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1993, 1996 Free Software Foundation, Inc.
-// OBSOLETE    Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
-// OBSOLETE    and by Alessandro Forin(af@cs.cmu.edu) at CMU
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #ifndef NM_NEWS_MIPS_H
-// OBSOLETE #define NM_NEWS_MIPS_H 1
-// OBSOLETE 
-// OBSOLETE /* Needed for RISC NEWS core files.  */
-// OBSOLETE #include <machine/machparam.h>
-// OBSOLETE #include <sys/types.h>
-// OBSOLETE #define KERNEL_U_ADDR UADDR
-// OBSOLETE 
-// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) 		\
-// OBSOLETE 	if (regno < 38) addr = (NBPG*UPAGES) + (regno - 38)*sizeof(int);\
-// OBSOLETE 	else addr = 0;		/* ..somewhere in the pcb */
-// OBSOLETE 
-// OBSOLETE /* Kernel is a bit tenacious about sharing text segments, disallowing bpts.  */
-// OBSOLETE #define	ONE_PROCESS_WRITETEXT
-// OBSOLETE 
-// OBSOLETE #include "mips/nm-mips.h"
-// OBSOLETE 
-// OBSOLETE /* Apparently not in <sys/types.h> */
-// OBSOLETE typedef int pid_t;
-// OBSOLETE 
-// OBSOLETE #endif /* NM_NEWS_MIPS_H */
diff --git a/gdb/config/mips/nm-riscos.h b/gdb/config/mips/nm-riscos.h
deleted file mode 100644
index dba51b2..0000000
--- a/gdb/config/mips/nm-riscos.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// OBSOLETE /* This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE /* MIPS running RISC/os 4.52C.  */
-// OBSOLETE 
-// OBSOLETE #define PCB_OFFSET(FIELD) ((int)&((struct user*)0)->u_pcb.FIELD)
-// OBSOLETE 
-// OBSOLETE /* RISC/os 5.0 defines this in machparam.h.  */
-// OBSOLETE #include <bsd43/machine/machparam.h>
-// OBSOLETE #define NBPG BSD43_NBPG
-// OBSOLETE #define UPAGES BSD43_UPAGES
-// OBSOLETE 
-// OBSOLETE /* Where is this used?  I don't see any uses in mips-nat.c, and I don't think
-// OBSOLETE    the uses in infptrace.c are used if FETCH_INFERIOR_REGISTERS is defined.
-// OBSOLETE    Does the compiler react badly to "extern CORE_ADDR kernel_u_addr" (even
-// OBSOLETE    if never referenced)?  */
-// OBSOLETE #define KERNEL_U_ADDR BSD43_UADDR
-// OBSOLETE 
-// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) 		\
-// OBSOLETE 	      if (regno < FP0_REGNUM) \
-// OBSOLETE 		  addr =  UPAGES*NBPG-EF_SIZE+4*((regno)+EF_AT-1); \
-// OBSOLETE 	      else if (regno < PC_REGNUM) \
-// OBSOLETE 		  addr = PCB_OFFSET(pcb_fpregs[0]) + 4*(regno-FP0_REGNUM); \
-// OBSOLETE               else if (regno == PS_REGNUM) \
-// OBSOLETE                   addr = UPAGES*NBPG-EF_SIZE+4*EF_SR; \
-// OBSOLETE               else if (regno == mips_regnum (current_gdbarch)->badvaddr) \
-// OBSOLETE   		  addr = UPAGES*NBPG-EF_SIZE+4*EF_BADVADDR; \
-// OBSOLETE 	      else if (regno == mips_regnum (current_gdbarch)->lo) \
-// OBSOLETE 		  addr = UPAGES*NBPG-EF_SIZE+4*EF_MDLO; \
-// OBSOLETE 	      else if (regno == mips_regnum (current_gdbarch)->hi) \
-// OBSOLETE 		  addr = UPAGES*NBPG-EF_SIZE+4*EF_MDHI; \
-// OBSOLETE 	      else if (regno == mips_regnum (current_gdbarch)->cause) \
-// OBSOLETE 		  addr = UPAGES*NBPG-EF_SIZE+4*EF_CAUSE; \
-// OBSOLETE 	      else if (regno == mips_regnum (current_gdbarch)->pc) \
-// OBSOLETE 		  addr = UPAGES*NBPG-EF_SIZE+4*EF_EPC; \
-// OBSOLETE               else if (regno < mips_regnum (current_gdbarch)->fp_control_status) \
-// OBSOLETE 		  addr = PCB_OFFSET(pcb_fpregs[0]) + 4*(regno-FP0_REGNUM); \
-// OBSOLETE 	      else if (regno == mips_regnum (current_gdbarch)->fp_control_status) \
-// OBSOLETE 		  addr = PCB_OFFSET(pcb_fpc_csr); \
-// OBSOLETE 	      else if (regno == mips_regnum (current_gdbarch)->fp_implementation_revision) \
-// OBSOLETE 		  addr = PCB_OFFSET(pcb_fpc_eir); \
-// OBSOLETE               else \
-// OBSOLETE                   addr = 0;
-// OBSOLETE 
-// OBSOLETE #include "mips/nm-mips.h"
-// OBSOLETE 
-// OBSOLETE /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
-// OBSOLETE #define FETCH_INFERIOR_REGISTERS
diff --git a/gdb/config/mips/riscos.mh b/gdb/config/mips/riscos.mh
deleted file mode 100644
index 0a1c31c..0000000
--- a/gdb/config/mips/riscos.mh
+++ /dev/null
@@ -1,16 +0,0 @@
-# OBSOLETE # Host: MIPS running RISC/os
-# OBSOLETE 
-# OBSOLETE XM_FILE= xm-riscos.h
-# OBSOLETE 
-# OBSOLETE NAT_FILE= nm-riscos.h
-# OBSOLETE NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o mips-nat.o
-# OBSOLETE 
-# OBSOLETE MH_CFLAGS=-Wf,-XNh10000
-# OBSOLETE 
-# OBSOLETE # ptrace(2) apparently has problems in the BSD environment.  No workaround is
-# OBSOLETE # known except to select the sysv environment.  Could we use /proc instead?
-# OBSOLETE # These "sysv environments" and "bsd environments" often end up being a pain.
-# OBSOLETE #
-# OBSOLETE # This is not part of CFLAGS because perhaps not all C compilers have this
-# OBSOLETE # option.
-# OBSOLETE CC= cc -systype sysv
diff --git a/gdb/config/mips/tm-irix5.h b/gdb/config/mips/tm-irix5.h
index ff40d66..5e90580 100644
--- a/gdb/config/mips/tm-irix5.h
+++ b/gdb/config/mips/tm-irix5.h
@@ -29,10 +29,6 @@
 #define SIGFRAME_REGSAVE_OFF	(SIGFRAME_BASE + 3 * 4)
 #define SIGFRAME_FPREGSAVE_OFF	(SIGFRAME_BASE + 3 * 4 + 32 * 4 + 4)
 
-/* The signal handler trampoline is called _sigtramp.  */
-#undef DEPRECATED_IN_SIGTRAMP
-#define DEPRECATED_IN_SIGTRAMP(pc, name) ((name) && DEPRECATED_STREQ ("_sigtramp", name))
-
 /* Irix 5 saves a full 64 bits for each register.  We skip 2 * 4 to
    get to the saved PC (the register mask and status register are both
    32 bits) and then another 4 to get to the lower 32 bits.  We skip
diff --git a/gdb/config/mips/tm-irix6.h b/gdb/config/mips/tm-irix6.h
index 88abf80..8b61f0e 100644
--- a/gdb/config/mips/tm-irix6.h
+++ b/gdb/config/mips/tm-irix6.h
@@ -22,10 +22,6 @@
 #include "mips/tm-mips.h"
 #include "solib.h"
 
-/* The signal handler trampoline is called _sigtramp.  */
-#undef DEPRECATED_IN_SIGTRAMP
-#define DEPRECATED_IN_SIGTRAMP(pc, name) ((name) && DEPRECATED_STREQ ("_sigtramp", name))
-
 /* Offsets for register values in _sigtramp frame.
    sigcontext is immediately above the _sigtramp frame on Irix.  */
 #undef SIGFRAME_BASE
diff --git a/gdb/config/mips/tm-linux.h b/gdb/config/mips/tm-linux.h
index 4227cd3..7b10e4e 100644
--- a/gdb/config/mips/tm-linux.h
+++ b/gdb/config/mips/tm-linux.h
@@ -44,11 +44,6 @@
 #define SOFTWARE_SINGLE_STEP_P() 1
 #define SOFTWARE_SINGLE_STEP(sig,bp_p) mips_software_single_step (sig, bp_p)
 
-/* FIXME: This still needs to be implemented.  */
-
-#undef  DEPRECATED_IN_SIGTRAMP
-#define DEPRECATED_IN_SIGTRAMP(pc, name)	(0)
-
 #undef IN_SOLIB_DYNSYM_RESOLVE_CODE
 #define IN_SOLIB_DYNSYM_RESOLVE_CODE(PC) mips_linux_in_dynsym_resolve_code (PC)
 int mips_linux_in_dynsym_resolve_code (CORE_ADDR pc);
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h
index be0d6b7..018877c 100644
--- a/gdb/config/mips/tm-mips.h
+++ b/gdb/config/mips/tm-mips.h
@@ -56,7 +56,6 @@
 #define V0_REGNUM 2		/* Function integer return value */
 #define A0_REGNUM 4		/* Loc of first arg during a subr call */
 #define T9_REGNUM 25		/* Contains address of callee in PIC */
-#define SP_REGNUM 29		/* Contains address of top of stack */
 #define RA_REGNUM 31		/* Contains return address value */
 #define PS_REGNUM 32		/* Contains processor status */
 #define	UNUSED_REGNUM 73	/* Never used, FIXME */
@@ -99,10 +98,6 @@
 #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
 extern struct frame_info *setup_arbitrary_frame (int, CORE_ADDR *);
 
-/* These are defined in mdebugread.c and are used in mips-tdep.c  */
-extern CORE_ADDR sigtramp_address, sigtramp_end;
-extern void fixup_sigtramp (void);
-
 /* Functions for dealing with MIPS16 call and return stubs.  */
 #define IGNORE_HELPER_CALL(pc)			mips_ignore_helper (pc)
 extern int mips_ignore_helper (CORE_ADDR pc);
diff --git a/gdb/config/mips/tm-mipsv4.h b/gdb/config/mips/tm-mipsv4.h
deleted file mode 100644
index 9460741..0000000
--- a/gdb/config/mips/tm-mipsv4.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// OBSOLETE /* Target machine description for MIPS running SVR4, for GDB.
-// OBSOLETE    Copyright 1994, 1995, 1998, 1999, 2000 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #include "mips/tm-mips.h"
-// OBSOLETE #include "config/tm-sysv4.h"
-// OBSOLETE 
-// OBSOLETE /* The signal handler trampoline is called _sigtramp.  */
-// OBSOLETE #undef IN_SIGTRAMP
-// OBSOLETE #define IN_SIGTRAMP(pc, name) ((name) && DEPRECATED_STREQ ("_sigtramp", name))
-// OBSOLETE 
-// OBSOLETE /* On entry to the signal handler trampoline, an ucontext is already
-// OBSOLETE    pushed on the stack. We can get at the saved registers via the
-// OBSOLETE    mcontext which is contained within the ucontext.  */
-// OBSOLETE #define SIGFRAME_BASE	0
-// OBSOLETE #define SIGFRAME_REGSAVE_OFF	(SIGFRAME_BASE + 40)
-// OBSOLETE #define SIGFRAME_PC_OFF		(SIGFRAME_BASE + 40 + 35 * 4)
-// OBSOLETE #define SIGFRAME_FPREGSAVE_OFF	(SIGFRAME_BASE + 40 + 36 * 4)
-// OBSOLETE 
-// OBSOLETE /* Convert a DWARF register number to a gdb REGNUM.  */
-// OBSOLETE #define DWARF_REG_TO_REGNUM(num) ((num) < 32 ? (num) : (num)+FP0_REGNUM-32)
diff --git a/gdb/config/mips/tm-nbsd.h b/gdb/config/mips/tm-nbsd.h
index eb8e292..c7e45fc 100644
--- a/gdb/config/mips/tm-nbsd.h
+++ b/gdb/config/mips/tm-nbsd.h
@@ -31,7 +31,4 @@
 #undef SKIP_TRAMPOLINE_CODE
 #undef IGNORE_HELPER_CALL
 
-/* XXX undef a bunch of stuff we want to use multi-arch */
-#undef DEPRECATED_IN_SIGTRAMP
-
 #endif /* TM_NBSD_H */
diff --git a/gdb/config/mips/xm-mips.h b/gdb/config/mips/xm-mips.h
deleted file mode 100644
index bc3aa6e..0000000
--- a/gdb/config/mips/xm-mips.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// OBSOLETE /* Definitions to make GDB run on a mips box under 4.3bsd.
-// OBSOLETE    Copyright 1986, 1987, 1989, 1993, 1994, 1995, 1996, 1998
-// OBSOLETE    Free Software Foundation, Inc.
-// OBSOLETE    Contributed by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin
-// OBSOLETE    and by Alessandro Forin(af@cs.cmu.edu) at CMU
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #ifdef ultrix
-// OBSOLETE /* Needed for DECstation core files.  */
-// OBSOLETE #include <machine/param.h>
-// OBSOLETE #define KERNEL_U_ADDR UADDR
-// OBSOLETE 
-// OBSOLETE /* Native Ultrix cc has broken long long support.  */
-// OBSOLETE #ifndef __GNUC__
-// OBSOLETE #undef CC_HAS_LONG_LONG
-// OBSOLETE #endif
-// OBSOLETE #endif
-// OBSOLETE 
-// OBSOLETE #if ! defined (__GNUC__) && ! defined (offsetof)
-// OBSOLETE #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
-// OBSOLETE #endif
-// OBSOLETE 
-// OBSOLETE /* Only used for core files on DECstations.
-// OBSOLETE    First four registers at u.u_ar0 are saved arguments, and
-// OBSOLETE    there is no r0 saved.   Float registers are saved
-// OBSOLETE    in u_pcb.pcb_fpregs, not relative to u.u_ar0.  */
-// OBSOLETE 
-// OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) 		\
-// OBSOLETE 	{ \
-// OBSOLETE 	  if (regno < FP0_REGNUM) \
-// OBSOLETE 	    addr = blockend + sizeof(int) * (4 + regno - 1); \
-// OBSOLETE 	  else \
-// OBSOLETE 	    addr = offsetof (struct user, u_pcb.pcb_fpregs[0]) + \
-// OBSOLETE 		   sizeof (int) * (regno - FP0_REGNUM); \
-// OBSOLETE 	}
-// OBSOLETE 
-// OBSOLETE /* Kernel is a bit tenacious about sharing text segments, disallowing bpts.  */
-// OBSOLETE #define	ONE_PROCESS_WRITETEXT
-// OBSOLETE 
-// OBSOLETE /* HAVE_SGTTY also works, last we tried.
-// OBSOLETE 
-// OBSOLETE    But we have termios, at least as of Ultrix 4.2A, so use it.  */
-// OBSOLETE #define HAVE_TERMIOS
diff --git a/gdb/config/mips/xm-mipsv4.h b/gdb/config/mips/xm-mipsv4.h
deleted file mode 100644
index 1f39e31..0000000
--- a/gdb/config/mips/xm-mipsv4.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// OBSOLETE /* Definitions for MIPS running SVR4 hosting support.
-// OBSOLETE 
-// OBSOLETE    Copyright 1994 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #include "config/xm-sysv4.h"
diff --git a/gdb/config/mips/xm-riscos.h b/gdb/config/mips/xm-riscos.h
deleted file mode 100644
index d8a6533..0000000
--- a/gdb/config/mips/xm-riscos.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// OBSOLETE /* Copyright 1993, 1994, 1995 Free Software Foundation, Inc.
-// OBSOLETE 
-// OBSOLETE    This file is part of GDB.
-// OBSOLETE 
-// OBSOLETE    This program is free software; you can redistribute it and/or modify
-// OBSOLETE    it under the terms of the GNU General Public License as published by
-// OBSOLETE    the Free Software Foundation; either version 2 of the License, or
-// OBSOLETE    (at your option) any later version.
-// OBSOLETE 
-// OBSOLETE    This program is distributed in the hope that it will be useful,
-// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of
-// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// OBSOLETE    GNU General Public License for more details.
-// OBSOLETE 
-// OBSOLETE    You should have received a copy of the GNU General Public License
-// OBSOLETE    along with this program; if not, write to the Free Software
-// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,
-// OBSOLETE    Boston, MA 02111-1307, USA.  */
-// OBSOLETE 
-// OBSOLETE #define HAVE_TERMIO
-// OBSOLETE 
-// OBSOLETE #define USG 1
-// OBSOLETE 
-// OBSOLETE /* setjmp.h requires uid_t.  */
-// OBSOLETE #include <sys/types.h>
diff --git a/gdb/config/nm-bsd.h b/gdb/config/nm-bsd.h
index b44dd5e..ca349a4 100644
--- a/gdb/config/nm-bsd.h
+++ b/gdb/config/nm-bsd.h
@@ -24,6 +24,3 @@
 
 /* Override copies of {fetch,store}_inferior_registers in `infptrace.c'.  */
 #define FETCH_INFERIOR_REGISTERS
-
-/* We can attach and detach.  */
-#define ATTACH_DETACH
diff --git a/gdb/config/nm-linux.h b/gdb/config/nm-linux.h
index 950e5af..0817c0a 100644
--- a/gdb/config/nm-linux.h
+++ b/gdb/config/nm-linux.h
@@ -24,9 +24,6 @@
 /* GNU/Linux is SVR4-ish but its /proc file system isn't.  */
 #undef USE_PROC_FS
 
-/* Tell GDB that we can attach and detach other processes.  */
-#define ATTACH_DETACH
-
 /* Since we're building a native debugger, we can include <signal.h>
    to find the range of real-time signals.  */
 
diff --git a/gdb/config/nm-nbsd.h b/gdb/config/nm-nbsd.h
index 5078c56..e895abc 100644
--- a/gdb/config/nm-nbsd.h
+++ b/gdb/config/nm-nbsd.h
@@ -22,6 +22,4 @@
 
 #define FETCH_INFERIOR_REGISTERS
 
-#define ATTACH_DETACH
-
 #include "solib.h"		/* Support for shared libraries. */
diff --git a/gdb/config/nm-sysv4.h b/gdb/config/nm-sysv4.h
index 4b4f098..efd2cf6 100644
--- a/gdb/config/nm-sysv4.h
+++ b/gdb/config/nm-sysv4.h
@@ -27,8 +27,3 @@
 /* SVR4 has /proc support, so use it instead of ptrace. */
 
 #define USE_PROC_FS
-
-/* SVR4 machines can easily do attach and detach via /proc (procfs.c)
-   support */
-
-#define ATTACH_DETACH
diff --git a/gdb/config/pa/linux.mh b/gdb/config/pa/linux.mh
new file mode 100644
index 0000000..232a4ad
--- /dev/null
+++ b/gdb/config/pa/linux.mh
@@ -0,0 +1,9 @@
+# Host: Hewlett-Packard PA-RISC machine, running Linux
+XDEPFILES=
+XM_FILE= xm-linux.h
+NAT_FILE= nm-linux.h
+NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o gcore.o \
+	core-regset.o hppa-linux-nat.o linux-proc.o \
+	proc-service.o thread-db.o lin-lwp.o linux-nat.o
+
+LOADLIBES = -ldl -rdynamic
diff --git a/gdb/config/pa/linux.mt b/gdb/config/pa/linux.mt
new file mode 100644
index 0000000..e764107
--- /dev/null
+++ b/gdb/config/pa/linux.mt
@@ -0,0 +1,3 @@
+# Target: HP PA-RISC running Linux
+TDEPFILES= hppa-tdep.o hppa-linux-tdep.o glibc-tdep.o solib.o solib-svr4.o
+TM_FILE=tm-linux.h
diff --git a/gdb/config/pa/nm-hppah.h b/gdb/config/pa/nm-hppah.h
index bf4fd3c..3b0b30d 100644
--- a/gdb/config/pa/nm-hppah.h
+++ b/gdb/config/pa/nm-hppah.h
@@ -91,15 +91,6 @@
 #define PT_WRITE_I	PT_WIUSER
 #define PT_WRITE_D	PT_WDUSER
 
-/* attach/detach works to some extent under BSD and HPUX.  So long
-   as the process you're attaching to isn't blocked waiting on io,
-   blocked waiting on a signal, or in a system call things work 
-   fine.  (The problems in those cases are related to the fact that
-   the kernel can't provide complete register information for the
-   target process...  Which really pisses off GDB.)  */
-
-#define ATTACH_DETACH
-
 /* In infptrace or infttrace.c: */
 
 /* Starting with HP-UX 10.30, support is provided (in the form of
diff --git a/gdb/config/sparc/tm-nbsd64.h b/gdb/config/pa/nm-linux.h
similarity index 69%
copy from gdb/config/sparc/tm-nbsd64.h
copy to gdb/config/pa/nm-linux.h
index cc1d6b3..08b7915 100644
--- a/gdb/config/sparc/tm-nbsd64.h
+++ b/gdb/config/pa/nm-linux.h
@@ -1,5 +1,5 @@
-/* Macro definitions for UltraSPARC running under NetBSD.
-   Copyright 1994, 2002 Free Software Foundation, Inc.
+/* Native support for GNU/Linux, for GDB, the GNU debugger.
+   Copyright (C) 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,10 +18,15 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef TM_NBSD64_H
-#define TM_NBSD64_H
+#ifndef PA_NM_LINUX_H
+#define PA_NM_LINUX_H
 
-#include "sparc/tm-sp64.h" /* sets GDB_MULTI_ARCH */
-#include "solib.h"
+#include "config/nm-linux.h"
 
-#endif /* TM_NBSD64_H */
+#define U_REGS_OFFSET 0
+
+/* Override copies of {fetch,store}_inferior_registers in `infptrace.c'.  */
+#define FETCH_INFERIOR_REGISTERS
+
+#endif
+
diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/pa/nm-obsd.h
similarity index 76%
copy from gdb/config/i386/tm-i386.h
copy to gdb/config/pa/nm-obsd.h
index e2bd81f..ba91594 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/config/pa/nm-obsd.h
@@ -1,6 +1,6 @@
-/* Macro definitions for GDB on an Intel i[345]86.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+/* Native-dependent definitions for OpenBSD/hppa.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -19,7 +19,10 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef TM_I386_H
-#define TM_I386_H 1
+#ifndef NM_OBSD_H
+#define NM_OBSD_H
 
-#endif /* ifndef TM_I386_H */
+/* Get generic BSD native definitions.  */
+#include "config/nm-bsd.h"
+
+#endif /* nm-obsd.h */
diff --git a/gdb/config/pa/obsd.mh b/gdb/config/pa/obsd.mh
new file mode 100644
index 0000000..bc94246
--- /dev/null
+++ b/gdb/config/pa/obsd.mh
@@ -0,0 +1,3 @@
+# Host: OpenBSD/hppa
+NATDEPFILES= fork-child.o infptrace.o inftarg.o hppabsd-nat.o
+NAT_FILE= nm-obsd.h
diff --git a/gdb/config/pa/obsd.mt b/gdb/config/pa/obsd.mt
new file mode 100644
index 0000000..1b1df18
--- /dev/null
+++ b/gdb/config/pa/obsd.mt
@@ -0,0 +1,3 @@
+# Target: OpenBSD/hppa
+TDEPFILES= hppa-tdep.o hppabsd-tdep.o corelow.o solib.o solib-svr4.o
+TM_FILE= tm-bsd.h
diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/pa/tm-bsd.h
similarity index 77%
rename from gdb/config/i386/tm-i386.h
rename to gdb/config/pa/tm-bsd.h
index e2bd81f..ebd5e9f 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/config/pa/tm-bsd.h
@@ -1,6 +1,6 @@
-/* Macro definitions for GDB on an Intel i[345]86.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+/* Target-dependent definitions for HP PA-RISC BSD's.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -19,7 +19,10 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef TM_I386_H
-#define TM_I386_H 1
+#ifndef TM_BSD_H
+#define TM_BSD_H
 
-#endif /* ifndef TM_I386_H */
+/* Shared library support.  */
+#include "solib.h"
+
+#endif /* tm-bsd.h */
diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h
index 1a78c6c..225d5ba 100644
--- a/gdb/config/pa/tm-hppa.h
+++ b/gdb/config/pa/tm-hppa.h
@@ -28,70 +28,8 @@
 
 #define GDB_MULTI_ARCH 1
 
-/* Hack, get around problem with including "arch-utils.h".  */
-struct frame_info;
-
-/* Forward declarations of some types we use in prototypes */
-
-struct frame_info;
-struct frame_saved_regs;
-struct value;
-struct type;
-struct inferior_status;
-
-/* Sequence of bytes for breakpoint instruction.  */
-
-const unsigned char *hppa_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr);
-#define BREAKPOINT_FROM_PC(PCPTR,LENPTR) hppa_breakpoint_from_pc ((PCPTR), (LENPTR))
-#define BREAKPOINT32 0x10004
-
 extern int hppa_pc_requires_run_before_use (CORE_ADDR pc);
-#define PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc)
-
-/* Register numbers of various important registers.
-   Note that some of these values are "real" register numbers,
-   and correspond to the general registers of the machine,
-   and some are "phony" register numbers which are too large
-   to be actual register numbers as far as the user is concerned
-   but do serve to get the desired values when passed to read_register.  */
-
-#define R0_REGNUM 0		/* Doesn't actually exist, used as base for
-				   other r registers.  */
-#define FLAGS_REGNUM 0		/* Various status flags */
-#define RP_REGNUM 2		/* return pointer */
-#define HPPA_FP_REGNUM 3	/* The ABI's frame pointer, when used */
-#define HPPA_SP_REGNUM 30	/* Stack pointer.  */
-#define SAR_REGNUM 32		/* Shift Amount Register */
-#define IPSW_REGNUM 41		/* Interrupt Processor Status Word */
-#define PCOQ_HEAD_REGNUM 33	/* instruction offset queue head */
-#define PCSQ_HEAD_REGNUM 34	/* instruction space queue head */
-#define PCOQ_TAIL_REGNUM 35	/* instruction offset queue tail */
-#define PCSQ_TAIL_REGNUM 36	/* instruction space queue tail */
-#define EIEM_REGNUM 37		/* External Interrupt Enable Mask */
-#define IIR_REGNUM 38		/* Interrupt Instruction Register */
-#define IOR_REGNUM 40		/* Interrupt Offset Register */
-#define SR4_REGNUM 43		/* space register 4 */
-#define RCR_REGNUM 51		/* Recover Counter (also known as cr0) */
-#define CCR_REGNUM 54		/* Coprocessor Configuration Register */
-#define TR0_REGNUM 57		/* Temporary Registers (cr24 -> cr31) */
-#define CR27_REGNUM 60		/* Base register for thread-local storage, cr27 */
-#define HPPA_FP0_REGNUM 64	/* First floating-point.  */
-#define FP4_REGNUM 72
-
-#define ARG0_REGNUM 26		/* The first argument of a callee. */
-#define ARG1_REGNUM 25		/* The second argument of a callee. */
-#define ARG2_REGNUM 24		/* The third argument of a callee. */
-#define ARG3_REGNUM 23		/* The fourth argument of a callee. */
-
-/* When fetching register values from an inferior or a core file,
-   clean them up using this macro.  BUF is a char pointer to
-   the raw value of the register in the registers[] array.  */
-
-#define	DEPRECATED_CLEAN_UP_REGISTER_VALUE(regno, buf) \
-  do {	\
-    if ((regno) == PCOQ_HEAD_REGNUM || (regno) == PCOQ_TAIL_REGNUM) \
-      (buf)[sizeof(CORE_ADDR) -1] &= ~0x3; \
-  } while (0)
+#define DEPRECATED_PC_REQUIRES_RUN_BEFORE_USE(pc) hppa_pc_requires_run_before_use (pc)
 
 /* PA specific macro to see if the current instruction is nullified. */
 #ifndef INSTRUCTION_NULLIFIED
@@ -99,115 +37,6 @@
 #define INSTRUCTION_NULLIFIED hppa_instruction_nullified ()
 #endif
 
-#define INSTRUCTION_SIZE 4
-
-#define REG_PARM_STACK_SPACE 16
-
-/*
- * Unwind table and descriptor.
- */
-
-struct unwind_table_entry
-  {
-    CORE_ADDR region_start;
-    CORE_ADDR region_end;
-
-    unsigned int Cannot_unwind:1;	/* 0 */
-    unsigned int Millicode:1;	/* 1 */
-    unsigned int Millicode_save_sr0:1;	/* 2 */
-    unsigned int Region_description:2;	/* 3..4 */
-    unsigned int reserved1:1;	/* 5 */
-    unsigned int Entry_SR:1;	/* 6 */
-    unsigned int Entry_FR:4;	/* number saved *//* 7..10 */
-    unsigned int Entry_GR:5;	/* number saved *//* 11..15 */
-    unsigned int Args_stored:1;	/* 16 */
-    unsigned int Variable_Frame:1;	/* 17 */
-    unsigned int Separate_Package_Body:1;	/* 18 */
-    unsigned int Frame_Extension_Millicode:1;	/* 19 */
-    unsigned int Stack_Overflow_Check:1;	/* 20 */
-    unsigned int Two_Instruction_SP_Increment:1;	/* 21 */
-    unsigned int Ada_Region:1;	/* 22 */
-    unsigned int cxx_info:1;	/* 23 */
-    unsigned int cxx_try_catch:1;	/* 24 */
-    unsigned int sched_entry_seq:1;	/* 25 */
-    unsigned int reserved2:1;	/* 26 */
-    unsigned int Save_SP:1;	/* 27 */
-    unsigned int Save_RP:1;	/* 28 */
-    unsigned int Save_MRP_in_frame:1;	/* 29 */
-    unsigned int extn_ptr_defined:1;	/* 30 */
-    unsigned int Cleanup_defined:1;	/* 31 */
-
-    unsigned int MPE_XL_interrupt_marker:1;	/* 0 */
-    unsigned int HP_UX_interrupt_marker:1;	/* 1 */
-    unsigned int Large_frame:1;	/* 2 */
-    unsigned int Pseudo_SP_Set:1;	/* 3 */
-    unsigned int reserved4:1;	/* 4 */
-    unsigned int Total_frame_size:27;	/* 5..31 */
-
-    /* This is *NOT* part of an actual unwind_descriptor in an object
-       file.  It is *ONLY* part of the "internalized" descriptors that
-       we create from those in a file.
-     */
-    struct
-      {
-	unsigned int stub_type:4;	/* 0..3 */
-	unsigned int padding:28;	/* 4..31 */
-      }
-    stub_unwind;
-  };
-
-/* HP linkers also generate unwinds for various linker-generated stubs.
-   GDB reads in the stubs from the $UNWIND_END$ subspace, then 
-   "converts" them into normal unwind entries using some of the reserved
-   fields to store the stub type.  */
-
-/* The gaps represent linker stubs used in MPE and space for future
-   expansion.  */
-enum unwind_stub_types
-  {
-    LONG_BRANCH = 1,
-    PARAMETER_RELOCATION = 2,
-    EXPORT = 10,
-    IMPORT = 11,
-    IMPORT_SHLIB = 12,
-  };
-
-/* We use the objfile->obj_private pointer for two things:
-
- * 1.  An unwind table;
- *
- * 2.  A pointer to any associated shared library object.
- *
- * #defines are used to help refer to these objects.
- */
-
-/* Info about the unwind table associated with an object file.
-
- * This is hung off of the "objfile->obj_private" pointer, and
- * is allocated in the objfile's psymbol obstack.  This allows
- * us to have unique unwind info for each executable and shared
- * library that we are debugging.
- */
-struct obj_unwind_info
-  {
-    struct unwind_table_entry *table;	/* Pointer to unwind info */
-    struct unwind_table_entry *cache;	/* Pointer to last entry we found */
-    int last;			/* Index of last entry */
-  };
-
-typedef struct obj_private_struct
-  {
-    struct obj_unwind_info *unwind_info;	/* a pointer */
-    struct so_list *so_info;	/* a pointer  */
-    CORE_ADDR dp;
-  }
-obj_private_data_t;
-
-/* For a number of horrible reasons we may have to adjust the location
-   of variables on the stack.  Ugh.  */
-#define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR)
-extern int hpread_adjust_stack_address (CORE_ADDR);
-
 /* Here's how to step off a permanent breakpoint.  */
 #define SKIP_PERMANENT_BREAKPOINT (hppa_skip_permanent_breakpoint)
 extern void hppa_skip_permanent_breakpoint (void);
diff --git a/gdb/config/pa/tm-hppa64.h b/gdb/config/pa/tm-hppa64.h
index 79fd15c..7a257d4 100644
--- a/gdb/config/pa/tm-hppa64.h
+++ b/gdb/config/pa/tm-hppa64.h
@@ -48,44 +48,11 @@
 #define SR5_REGNUM 48
 
 
-/* For a number of horrible reasons we may have to adjust the location
-   of variables on the stack.  Ugh.  jimb: why? */
-#define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR)
-
-extern int hpread_adjust_stack_address (CORE_ADDR);
-
-
 /* jimb: omitted dynamic linking stuff here */
 
-/* The PA64 ABI reserves 64 bytes of stack space for outgoing register
-   parameters.  */
-#undef REG_PARM_STACK_SPACE
-#define REG_PARM_STACK_SPACE 64
-
-/* Use the 64-bit calling conventions designed for the PA2.0 in wide mode.  */
-#define PA20W_CALLING_CONVENTIONS
-
 #undef FUNC_LDIL_OFFSET
 #undef FUNC_LDO_OFFSET
 #undef SR4EXPORT_LDIL_OFFSET
 #undef SR4EXPORT_LDO_OFFSET
 
-#undef FRAME_SAVED_PC_IN_SIGTRAMP
-extern void hppa64_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
-                                                    CORE_ADDR *tmp);
-#define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \
-  hppa64_hpux_frame_saved_pc_in_sigtramp (FRAME, TMP)
-
-#undef FRAME_BASE_BEFORE_SIGTRAMP
-extern void hppa64_hpux_frame_base_before_sigtramp (struct frame_info *fi,
-                                                    CORE_ADDR *tmp);
-#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
-  hppa64_hpux_frame_base_before_sigtramp (FRAME, TMP)
-
-#undef FRAME_FIND_SAVED_REGS_IN_SIGTRAMP
-extern void hppa64_hpux_frame_find_saved_regs_in_sigtramp
-              (struct frame_info *fi, CORE_ADDR *fsr);
-#define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \
-  hppa64_hpux_frame_find_saved_regs_in_sigtramp (FRAME, FSR)
-
 /* jimb: omitted purify call support */
diff --git a/gdb/config/pa/tm-hppah.h b/gdb/config/pa/tm-hppah.h
index 0d0dde3..d330d46 100644
--- a/gdb/config/pa/tm-hppah.h
+++ b/gdb/config/pa/tm-hppah.h
@@ -36,21 +36,6 @@
 #include "somsolib.h"
 #endif
 
-extern void hppa32_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
-                                                  CORE_ADDR *tmp);
-#define FRAME_SAVED_PC_IN_SIGTRAMP(FRAME, TMP) \
-  hppa32_hpux_frame_saved_pc_in_sigtramp (FRAME, TMP)
-
-extern void hppa32_hpux_frame_base_before_sigtramp (struct frame_info *fi,
-                                                  CORE_ADDR *tmp);
-#define FRAME_BASE_BEFORE_SIGTRAMP(FRAME, TMP) \
-  hppa32_hpux_frame_base_before_sigtramp (FRAME, TMP)
-
-extern void hppa32_hpux_frame_find_saved_regs_in_sigtramp
-              (struct frame_info *fi, CORE_ADDR *fsr);
-#define FRAME_FIND_SAVED_REGS_IN_SIGTRAMP(FRAME, FSR) \
-  hppa32_hpux_frame_find_saved_regs_in_sigtramp (FRAME, FSR)
-
 /* For HP-UX on PA-RISC we have an implementation
    for the exception handling target op (in hppa-tdep.c) */
 #define CHILD_ENABLE_EXCEPTION_CALLBACK
diff --git a/gdb/config/sparc/tm-nbsd64.h b/gdb/config/pa/tm-linux.h
similarity index 71%
copy from gdb/config/sparc/tm-nbsd64.h
copy to gdb/config/pa/tm-linux.h
index cc1d6b3..e8b31c5 100644
--- a/gdb/config/sparc/tm-nbsd64.h
+++ b/gdb/config/pa/tm-linux.h
@@ -1,5 +1,5 @@
-/* Macro definitions for UltraSPARC running under NetBSD.
-   Copyright 1994, 2002 Free Software Foundation, Inc.
+/* Definitions to target GDB to GNU/Linux on hppa-linux.
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,10 +18,13 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef TM_NBSD64_H
-#define TM_NBSD64_H
+#ifndef TM_LINUX_H
+#define TM_LINUX_H
 
-#include "sparc/tm-sp64.h" /* sets GDB_MULTI_ARCH */
-#include "solib.h"
+#include "pa/tm-hppa.h"
+#include "config/tm-linux.h"
 
-#endif /* TM_NBSD64_H */
+#undef IN_SOLIB_CALL_TRAMPOLINE
+#undef SKIP_TRAMPOLINE_CODE
+
+#endif /* #ifndef TM_LINUX_H */
diff --git a/gdb/config/sparc/tm-nbsd64.h b/gdb/config/pa/xm-linux.h
similarity index 66%
copy from gdb/config/sparc/tm-nbsd64.h
copy to gdb/config/pa/xm-linux.h
index cc1d6b3..ceb6ed2 100644
--- a/gdb/config/sparc/tm-nbsd64.h
+++ b/gdb/config/pa/xm-linux.h
@@ -1,5 +1,6 @@
-/* Macro definitions for UltraSPARC running under NetBSD.
-   Copyright 1994, 2002 Free Software Foundation, Inc.
+/* Host-dependent definitions for the hppa-linux.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,10 +19,13 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef TM_NBSD64_H
-#define TM_NBSD64_H
+#ifndef XM_HPPA_LINUX_H
+#define XM_HPPA_LINUX_H
 
-#include "sparc/tm-sp64.h" /* sets GDB_MULTI_ARCH */
-#include "solib.h"
+#include "floatformat.h"
 
-#endif /* TM_NBSD64_H */
+#define HOST_FLOAT_FORMAT &floatformat_ieee_single_big
+#define HOST_DOUBLE_FORMAT &floatformat_ieee_double_big
+#define HOST_LONG_DOUBLE_FORMAT &floatformat_ieee_double_big
+
+#endif /* xm-linux.h */
diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/powerpc/nm-obsd.h
similarity index 75%
copy from gdb/config/i386/tm-i386.h
copy to gdb/config/powerpc/nm-obsd.h
index e2bd81f..e59834f 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/config/powerpc/nm-obsd.h
@@ -1,6 +1,6 @@
-/* Macro definitions for GDB on an Intel i[345]86.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+/* Native-dependent definitions for OpenBSD/powerpc.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -19,7 +19,10 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef TM_I386_H
-#define TM_I386_H 1
+#ifndef NM_OBSD_H
+#define NM_OBSD_H
 
-#endif /* ifndef TM_I386_H */
+/* Get generic BSD native definitions.  */
+#include "config/nm-bsd.h"
+
+#endif /* nm-obsd.h */
diff --git a/gdb/config/powerpc/obsd.mh b/gdb/config/powerpc/obsd.mh
new file mode 100644
index 0000000..a20575a
--- /dev/null
+++ b/gdb/config/powerpc/obsd.mh
@@ -0,0 +1,3 @@
+# Host: OpenBSD/powerpc
+NATDEPFILES= ppcobsd-nat.o fork-child.o infptrace.o inftarg.o
+NAT_FILE= nm-obsd.h
diff --git a/gdb/config/powerpc/obsd.mt b/gdb/config/powerpc/obsd.mt
new file mode 100644
index 0000000..4441832
--- /dev/null
+++ b/gdb/config/powerpc/obsd.mt
@@ -0,0 +1,4 @@
+# Target: OpenBSD/powerpc
+TDEPFILES= rs6000-tdep.o ppc-sysv-tdep.o ppcobsd-tdep.o \
+	corelow.o solib.o solib-svr4.o
+TM_FILE= tm-nbsd.h
diff --git a/gdb/config/rs6000/nm-rs6000.h b/gdb/config/rs6000/nm-rs6000.h
index 34bc0fe..ee5f918 100644
--- a/gdb/config/rs6000/nm-rs6000.h
+++ b/gdb/config/rs6000/nm-rs6000.h
@@ -19,10 +19,6 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* Do implement the attach and detach commands.  */
-
-#define ATTACH_DETACH
-
 /* Override copies of {fetch,store}_inferior_registers in infptrace.c.  */
 
 #define FETCH_INFERIOR_REGISTERS
diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h
index 4422fcb..59af62b 100644
--- a/gdb/config/rs6000/tm-rs6000.h
+++ b/gdb/config/rs6000/tm-rs6000.h
@@ -71,8 +71,11 @@
    to be actual register numbers as far as the user is concerned
    but do serve to get the desired values when passed to read_register.  */
 
+/* Don't use this in code specific to the RS6000 and its descendants;
+   use tdep->ppc_fp0_regnum instead.  FP0_REGNUM will be deprecated
+   soon, but we still need to define it here for the uses in
+   architecture-independent code.  */
 #define FP0_REGNUM 32		/* Floating point register 0 */
-#define FPLAST_REGNUM 63	/* Last floating point register */
 
 /* Notice when a new child process is started. */
 
diff --git a/gdb/config/sparc/linux.mt b/gdb/config/sparc/linux.mt
index e053f30..442983b 100644
--- a/gdb/config/sparc/linux.mt
+++ b/gdb/config/sparc/linux.mt
@@ -1,4 +1,4 @@
 # Target: GNU/Linux SPARC
 TDEPFILES= sparc-tdep.o sparc-sol2-tdep.o sparc-linux-tdep.o \
-	solib.o solib-svr4.o solib-legacy.o
+	solib.o solib-svr4.o
 TM_FILE= tm-linux.h
diff --git a/gdb/config/sparc/linux64.mt b/gdb/config/sparc/linux64.mt
index 4121314..ba7c22e 100644
--- a/gdb/config/sparc/linux64.mt
+++ b/gdb/config/sparc/linux64.mt
@@ -1,5 +1,5 @@
 # Target: GNU/Linux UltraSPARC
 TDEPFILES= sparc64-tdep.o sparc64-sol2-tdep.o sparc64-linux-tdep.o \
 	sparc-tdep.o sparc-sol2-tdep.o sparc-linux-tdep.o \
-	solib.o solib-svr4.o solib-legacy.o
+	solib.o solib-svr4.o
 TM_FILE= tm-linux.h
diff --git a/gdb/config/sparc/nbsdelf.mh b/gdb/config/sparc/nbsdelf.mh
index 45309ec..611a6a4 100644
--- a/gdb/config/sparc/nbsdelf.mh
+++ b/gdb/config/sparc/nbsdelf.mh
@@ -1,4 +1,6 @@
 # Host: NetBSD/sparc ELF
-NATDEPFILES= sparc-nat.o sparcnbsd-nat.o \
+NATDEPFILES= sparc-nat.o sparcnbsd-nat.o bsd-kvm.o \
 	fork-child.o infptrace.o inftarg.o
 NAT_FILE= nm-nbsd.h
+
+LOADLIBES= -lkvm
diff --git a/gdb/config/sparc/sol2-64.mt b/gdb/config/sparc/sol2-64.mt
index 92f8489..ec92e1f 100644
--- a/gdb/config/sparc/sol2-64.mt
+++ b/gdb/config/sparc/sol2-64.mt
@@ -1,3 +1,4 @@
 # Target: Solaris UltraSPARC
-TDEPFILES= sparc64-tdep.o sparc64-sol2-tdep.o sparc-tdep.o sparc-sol2-tdep.o
+TDEPFILES= sparc64-tdep.o sparc64-sol2-tdep.o sparc-tdep.o sparc-sol2-tdep.o \
+	solib.o solib-svr4.o
 TM_FILE= tm-sol2.h
diff --git a/gdb/config/sparc/sol2.mh b/gdb/config/sparc/sol2.mh
index 735b9ee..44a0601 100644
--- a/gdb/config/sparc/sol2.mh
+++ b/gdb/config/sparc/sol2.mh
@@ -2,5 +2,4 @@
 NAT_FILE= nm-sol2.h
 NATDEPFILES= sparc-sol2-nat.o \
 	corelow.o core-regset.o fork-child.o gcore.o \
-	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o \
-	solib.o solib-svr4.o solib-legacy.o
+	procfs.o proc-api.o proc-events.o proc-flags.o proc-why.o
diff --git a/gdb/config/sparc/sol2.mt b/gdb/config/sparc/sol2.mt
index 4037956..11fd4b8 100644
--- a/gdb/config/sparc/sol2.mt
+++ b/gdb/config/sparc/sol2.mt
@@ -1,3 +1,3 @@
 # Target: Solaris SPARC
-TDEPFILES= sparc-tdep.o sparc-sol2-tdep.o
+TDEPFILES= sparc-tdep.o sparc-sol2-tdep.o solib.o solib-svr4.o
 TM_FILE= tm-sol2.h
diff --git a/gdb/config/sparc/tm-sol2.h b/gdb/config/sparc/tm-sol2.h
index d111c1a..37dc285 100644
--- a/gdb/config/sparc/tm-sol2.h
+++ b/gdb/config/sparc/tm-sol2.h
@@ -1,6 +1,6 @@
 /* Target-dependent definitions for Solaris SPARC.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -23,6 +23,9 @@
 
 #define GDB_MULTI_ARCH GDB_MULTI_ARCH_TM
 
+/* Shared library support.  */
+#include "solib.h"
+
 /* The Sun compilers (Sun ONE Studio, Forte Developer, Sun WorkShop,
    SunPRO) compiler puts out 0 instead of the address in N_SO stabs.
    Starting with SunPRO 3.0, the compiler does this for N_FUN stabs
diff --git a/gdb/config/tm-sunos.h b/gdb/config/tm-sunos.h
deleted file mode 100644
index c8db07e..0000000
--- a/gdb/config/tm-sunos.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Target machine sub-description for SunOS version 4.
-   This is included by other tm-*.h files to specify SunOS-specific stuff.
-   Copyright 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include "solib.h"		/* Support for shared libraries. */
-
-/* Return non-zero if we are in a shared library trampoline code stub. */
-
-#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) \
-  lookup_solib_trampoline_symbol_by_pc (pc)
-
-/* If PC is in a shared library trampoline code, return the PC
-   where the function itself actually starts.  If not, return 0.  */
-
-#define SKIP_TRAMPOLINE_CODE(pc)  find_solib_trampoline_target (pc)
diff --git a/gdb/config/vax/nbsd.mt b/gdb/config/vax/nbsd.mt
new file mode 100644
index 0000000..fb7f8ef
--- /dev/null
+++ b/gdb/config/vax/nbsd.mt
@@ -0,0 +1,3 @@
+# Target: NetBSD/vax
+TDEPFILES= vax-tdep.o vaxnbsd-tdep.o corelow.o solib.o solib-svr4.o
+TM_FILE= tm-nbsd.h
diff --git a/gdb/config/vax/nbsdaout.mh b/gdb/config/vax/nbsdaout.mh
new file mode 100644
index 0000000..ad31e39
--- /dev/null
+++ b/gdb/config/vax/nbsdaout.mh
@@ -0,0 +1,4 @@
+# Host: NetBSD/vax a.out
+NATDEPFILES= vaxbsd-nat.o fork-child.o infptrace.o inftarg.o \
+	solib.o solib-sunos.o
+NAT_FILE= nm-nbsdaout.h
diff --git a/gdb/config/vax/nbsdelf.mh b/gdb/config/vax/nbsdelf.mh
new file mode 100644
index 0000000..899bff8
--- /dev/null
+++ b/gdb/config/vax/nbsdelf.mh
@@ -0,0 +1,3 @@
+# Host: NetBSD/vax ELF
+NATDEPFILES= vaxbsd-nat.o fork-child.o infptrace.o inftarg.o
+NAT_FILE= nm-nbsd.h
diff --git a/gdb/config/m68k/xm-nbsd.h b/gdb/config/vax/nm-nbsd.h
similarity index 76%
copy from gdb/config/m68k/xm-nbsd.h
copy to gdb/config/vax/nm-nbsd.h
index 6c735fa..a946865 100644
--- a/gdb/config/m68k/xm-nbsd.h
+++ b/gdb/config/vax/nm-nbsd.h
@@ -1,5 +1,6 @@
-/* Parameters for execution on a Motorola m68k running NetBSD, for GDB.
-   Copyright 1996 Free Software Foundation, Inc.
+/* Native-dependent definitions for NetBSD/vax.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,5 +19,10 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* Get generic NetBSD host definitions. */
-#include "config/xm-nbsd.h"
+#ifndef NM_NBSD_H
+#define NM_NBSD_H
+
+/* Get generic NetBSD native definitions.  */
+#include "config/nm-nbsd.h"
+
+#endif /* nm-nbsd.h */
diff --git a/gdb/config/sparc/tm-nbsd64.h b/gdb/config/vax/nm-nbsdaout.h
similarity index 72%
rename from gdb/config/sparc/tm-nbsd64.h
rename to gdb/config/vax/nm-nbsdaout.h
index cc1d6b3..f611b9a 100644
--- a/gdb/config/sparc/tm-nbsd64.h
+++ b/gdb/config/vax/nm-nbsdaout.h
@@ -1,5 +1,6 @@
-/* Macro definitions for UltraSPARC running under NetBSD.
-   Copyright 1994, 2002 Free Software Foundation, Inc.
+/* Native-dependent definitions for NetBSD/vax a.out.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,10 +19,12 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef TM_NBSD64_H
-#define TM_NBSD64_H
+#ifndef NM_NBSDAOUT_H
+#define NM_NBSDAOUT_H
 
-#include "sparc/tm-sp64.h" /* sets GDB_MULTI_ARCH */
-#include "solib.h"
+#include "vax/nm-nbsd.h"
 
-#endif /* TM_NBSD64_H */
+/* Get generic NetBSD a.out native definitions.  */
+#include "config/nm-nbsdaout.h"
+
+#endif /* nm-nbsdaout.h */
diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/vax/nm-obsd.h
similarity index 76%
copy from gdb/config/i386/tm-i386.h
copy to gdb/config/vax/nm-obsd.h
index e2bd81f..ac44636 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/config/vax/nm-obsd.h
@@ -1,6 +1,6 @@
-/* Macro definitions for GDB on an Intel i[345]86.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+/* Native-dependent definitions for OpenBSD/vax.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -19,7 +19,10 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef TM_I386_H
-#define TM_I386_H 1
+#ifndef NM_OBSD_H
+#define NM_OBSD_H
 
-#endif /* ifndef TM_I386_H */
+/* Get generic BSD native definitions.  */
+#include "config/nm-bsd.h"
+
+#endif /* nm-obsd.h */
diff --git a/gdb/config/vax/obsd.mh b/gdb/config/vax/obsd.mh
new file mode 100644
index 0000000..cad1832
--- /dev/null
+++ b/gdb/config/vax/obsd.mh
@@ -0,0 +1,3 @@
+# Host: OpenBSD/vax
+NATDEPFILES= vaxbsd-nat.o fork-child.o infptrace.o inftarg.o
+NAT_FILE= nm-obsd.h
diff --git a/gdb/config/m68k/xm-nbsd.h b/gdb/config/vax/tm-nbsd.h
similarity index 79%
copy from gdb/config/m68k/xm-nbsd.h
copy to gdb/config/vax/tm-nbsd.h
index 6c735fa..f840c79 100644
--- a/gdb/config/m68k/xm-nbsd.h
+++ b/gdb/config/vax/tm-nbsd.h
@@ -1,5 +1,6 @@
-/* Parameters for execution on a Motorola m68k running NetBSD, for GDB.
-   Copyright 1996 Free Software Foundation, Inc.
+/* Target-dependent definitions for NetBSD/vax.
+
+   Copyright 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,5 +19,9 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-/* Get generic NetBSD host definitions. */
-#include "config/xm-nbsd.h"
+#ifndef TM_NBSD_H
+#define TM_NBSD_H
+
+#include "solib.h"
+
+#endif /* tm-nbsd.h */
diff --git a/gdb/config/vax/tm-vaxbsd.h b/gdb/config/vax/tm-vaxbsd.h
index 16f08d4..d9c9746 100644
--- a/gdb/config/vax/tm-vaxbsd.h
+++ b/gdb/config/vax/tm-vaxbsd.h
@@ -1,6 +1,7 @@
 /* Definitions to make GDB run on a vax under 4.2bsd.
-   Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2002
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1987, 1989, 1991, 1993, 1994, 1996, 1998, 1999,
+   2000, 2002, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -29,7 +30,7 @@
 /* On the VAX, sigtramp is in the u area.  Can't check the exact
    addresses because for cross-debugging we don't have VAX include
    files around.  This should be close enough.  */
-#define DEPRECATED_SIGTRAMP_START(pc)	STACK_END_ADDR
-#define DEPRECATED_SIGTRAMP_END(pc)	0x80000000
+#define DEPRECATED_IN_SIGTRAMP(PC,FUNC_NAME) \
+((PC) >= (STACK_END_ADDR) && (PC) < (0x80000000))
 
 #endif /* TM_VAXBSD_H */
diff --git a/gdb/config/vax/xm-vax.h b/gdb/config/vax/xm-vax.h
index 9924f26..d1057a8 100644
--- a/gdb/config/vax/xm-vax.h
+++ b/gdb/config/vax/xm-vax.h
@@ -34,22 +34,12 @@
    are not handled by KDB; the program's own trap handler
    gets to handle then.  */
 
-#define FAULT_CODE_ORIGIN 0
 #define FAULT_CODE_UNITS 4
 #define FAULT_TABLE    \
 { 0, SIGKILL, SIGSEGV, 0, 0, 0, 0, 0, \
   0, 0, SIGTRAP, SIGTRAP, 0, 0, 0, 0, \
   0, 0, 0, 0, 0, 0, 0, 0}
 
-/* Start running with a stack stretching from BEG to END.
-   BEG and END should be symbols meaningful to the assembler.
-   This is used only for kdb.  */
-
-#define INIT_STACK(beg, end)  \
-{ asm (".globl end");         \
-  asm ("movl $ end, sp");      \
-  asm ("clrl fp"); }
-
 /* Push the frame pointer register on the stack.  */
 #define PUSH_FRAME_PTR        \
   asm ("pushl fp");
diff --git a/gdb/configure b/gdb/configure
index e4de4c9..7bce8d6 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -3031,146 +3031,6 @@
   fi
 fi
 
-# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
-# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
-# Makefile fragments.  That's why we need to have `Hcurses' before
-# `curses'.  I don't see why we should use HP curses if a more
-# standard curses is available, except that according to HP's
-# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
-# HP-UX 10.10 and 10.20.
-
-
-echo $ac_n "checking for library containing initscr""... $ac_c" 1>&6
-echo "configure:3045: checking for library containing initscr" >&5
-if eval "test \"`echo '$''{'ac_cv_search_initscr'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_func_search_save_LIBS="$LIBS"
-ac_cv_search_initscr="no"
-cat > conftest.$ac_ext <<EOF
-#line 3052 "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 initscr();
-
-int main() {
-initscr()
-; return 0; }
-EOF
-if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_search_initscr="none required"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-test "$ac_cv_search_initscr" = "no" && for i in ncurses Hcurses curses pdcurses; do
-LIBS="-l$i  $ac_func_search_save_LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3074 "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 initscr();
-
-int main() {
-initscr()
-; return 0; }
-EOF
-if { (eval echo configure:3085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_search_initscr="-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_initscr" 1>&6
-if test "$ac_cv_search_initscr" != "no"; then
-  test "$ac_cv_search_initscr" = "none required" || LIBS="$ac_cv_search_initscr $LIBS"
-  
-else :
-  echo "configure: warning: no curses library found" 1>&2
-fi
-
-# Check whether the wborder function is provided by the curses
-# library detected above.  In certain implementations such as
-# the HP/UX Hcurses for instance, this function is provided by an
-# additional library.  So if we did not find this function inside
-# the curses library, try some alternate libraries we know might
-# provide it.
-
-echo $ac_n "checking for library containing wborder""... $ac_c" 1>&6
-echo "configure:3114: checking for library containing wborder" >&5
-if eval "test \"`echo '$''{'ac_cv_search_wborder'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_func_search_save_LIBS="$LIBS"
-ac_cv_search_wborder="no"
-cat > conftest.$ac_ext <<EOF
-#line 3121 "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 wborder();
-
-int main() {
-wborder()
-; return 0; }
-EOF
-if { (eval echo configure:3132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_search_wborder="none required"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-fi
-rm -f conftest*
-test "$ac_cv_search_wborder" = "no" && for i in cur_colr; do
-LIBS="-l$i  $ac_func_search_save_LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3143 "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 wborder();
-
-int main() {
-wborder()
-; return 0; }
-EOF
-if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  ac_cv_search_wborder="-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_wborder" 1>&6
-if test "$ac_cv_search_wborder" != "no"; then
-  test "$ac_cv_search_wborder" = "none required" || LIBS="$ac_cv_search_wborder $LIBS"
-  
-else :
-  echo "configure: warning: wborder function not found, tui will be disabled" 1>&2
-fi
-
 # Enable TUI.
 # Check whether --enable-tui or --disable-tui was given.
 if test "${enable_tui+set}" = set; then
@@ -3241,17 +3101,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3245: checking for $ac_hdr" >&5
+echo "configure:3105: 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 3250 "configure"
+#line 3110 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3115: \"$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*
@@ -3281,17 +3141,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3285: checking for $ac_hdr" >&5
+echo "configure:3145: 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 3290 "configure"
+#line 3150 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3155: \"$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*
@@ -3329,17 +3189,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3333: checking for $ac_hdr" >&5
+echo "configure:3193: 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 3338 "configure"
+#line 3198 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3203: \"$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*
@@ -3369,17 +3229,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3373: checking for $ac_hdr" >&5
+echo "configure:3233: 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 3378 "configure"
+#line 3238 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3243: \"$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*
@@ -3432,12 +3292,12 @@
 for ac_func in monstartup _mcleanup
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3436: checking for $ac_func" >&5
+echo "configure:3296: 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 3441 "configure"
+#line 3301 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3460,7 +3320,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3324: \"$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
@@ -3485,12 +3345,12 @@
 done
 
 echo $ac_n "checking for _etext""... $ac_c" 1>&6
-echo "configure:3489: checking for _etext" >&5
+echo "configure:3349: checking for _etext" >&5
 if eval "test \"`echo '$''{'ac_cv_var__etext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3494 "configure"
+#line 3354 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 extern char _etext;
@@ -3499,7 +3359,7 @@
 free (&_etext);
 ; return 0; }
 EOF
-if { (eval echo configure:3503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_var__etext=yes
 else
@@ -3527,19 +3387,19 @@
   CFLAGS="$CFLAGS $PROFILE_CFLAGS"
 
   echo $ac_n "checking whether $CC supports -pg""... $ac_c" 1>&6
-echo "configure:3531: checking whether $CC supports -pg" >&5
+echo "configure:3391: checking whether $CC supports -pg" >&5
 if eval "test \"`echo '$''{'ac_cv_cc_supports_pg'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3536 "configure"
+#line 3396 "configure"
 #include "confdefs.h"
 
 int main() {
 int x;
 ; return 0; }
 EOF
-if { (eval echo configure:3543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cc_supports_pg=yes
 else
@@ -3569,7 +3429,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:3573: checking for $ac_word" >&5
+echo "configure:3433: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3610,7 +3470,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:3614: checking for a BSD compatible install" >&5
+echo "configure:3474: 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
@@ -3663,7 +3523,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:3667: checking whether ln -s works" >&5
+echo "configure:3527: 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
@@ -3686,7 +3546,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:3690: checking for $ac_word" >&5
+echo "configure:3550: 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
@@ -3718,7 +3578,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:3722: checking for $ac_word" >&5
+echo "configure:3582: 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
@@ -3752,7 +3612,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:3756: checking for $ac_word" >&5
+echo "configure:3616: 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
@@ -3784,7 +3644,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:3788: checking for $ac_word" >&5
+echo "configure:3648: 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
@@ -3816,7 +3676,7 @@
 # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ac_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3820: checking for $ac_word" >&5
+echo "configure:3680: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3850,7 +3710,7 @@
 # Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args.
 set dummy ${ac_tool_prefix}mig; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3854: checking for $ac_word" >&5
+echo "configure:3714: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3886,7 +3746,7 @@
 
 # We might need to link with -lm; most simulators need it.
 echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:3890: checking for main in -lm" >&5
+echo "configure:3750: checking for main in -lm" >&5
 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3894,14 +3754,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3898 "configure"
+#line 3758 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3765: \"$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
@@ -3934,12 +3794,12 @@
 # libw that some versions of the GNU linker cannot hanle (GNU ld 2.9.1
 # is known to have this problem).  Therefore we avoid libw if we can.
 echo $ac_n "checking for wctype""... $ac_c" 1>&6
-echo "configure:3938: checking for wctype" >&5
+echo "configure:3798: checking for wctype" >&5
 if eval "test \"`echo '$''{'ac_cv_func_wctype'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3943 "configure"
+#line 3803 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char wctype(); below.  */
@@ -3962,7 +3822,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_wctype=yes"
 else
@@ -3980,7 +3840,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for wctype in -lw""... $ac_c" 1>&6
-echo "configure:3984: checking for wctype in -lw" >&5
+echo "configure:3844: checking for wctype in -lw" >&5
 ac_lib_var=`echo w'_'wctype | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3988,7 +3848,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lw  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3992 "configure"
+#line 3852 "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
@@ -3999,7 +3859,7 @@
 wctype()
 ; return 0; }
 EOF
-if { (eval echo configure:4003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3863: \"$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
@@ -4032,14 +3892,14 @@
 # Some systems (e.g. Solaris) have `gethostbyname' in libnsl.
 
 echo $ac_n "checking for library containing gethostbyname""... $ac_c" 1>&6
-echo "configure:4036: checking for library containing gethostbyname" >&5
+echo "configure:3896: checking for library containing gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_search_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_gethostbyname="no"
 cat > conftest.$ac_ext <<EOF
-#line 4043 "configure"
+#line 3903 "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
@@ -4050,7 +3910,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_gethostbyname="none required"
 else
@@ -4061,7 +3921,7 @@
 test "$ac_cv_search_gethostbyname" = "no" && for i in nsl; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4065 "configure"
+#line 3925 "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
@@ -4072,7 +3932,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_gethostbyname="-l$i"
 break
@@ -4096,14 +3956,14 @@
 # Some systems (e.g. Solaris) have `socketpair' in libsocket.
 
 echo $ac_n "checking for library containing socketpair""... $ac_c" 1>&6
-echo "configure:4100: checking for library containing socketpair" >&5
+echo "configure:3960: checking for library containing socketpair" >&5
 if eval "test \"`echo '$''{'ac_cv_search_socketpair'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_socketpair="no"
 cat > conftest.$ac_ext <<EOF
-#line 4107 "configure"
+#line 3967 "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
@@ -4114,7 +3974,7 @@
 socketpair()
 ; return 0; }
 EOF
-if { (eval echo configure:4118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_socketpair="none required"
 else
@@ -4125,7 +3985,7 @@
 test "$ac_cv_search_socketpair" = "no" && for i in socket; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4129 "configure"
+#line 3989 "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
@@ -4136,7 +3996,7 @@
 socketpair()
 ; return 0; }
 EOF
-if { (eval echo configure:4140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_socketpair="-l$i"
 break
@@ -4175,14 +4035,14 @@
     # ??? Why?
     
 echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6
-echo "configure:4179: checking for library containing tgetent" >&5
+echo "configure:4039: checking for library containing tgetent" >&5
 if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_tgetent="no"
 cat > conftest.$ac_ext <<EOF
-#line 4186 "configure"
+#line 4046 "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
@@ -4193,7 +4053,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:4197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_tgetent="none required"
 else
@@ -4204,7 +4064,7 @@
 test "$ac_cv_search_tgetent" = "no" && for i in tinfo ncurses curses termcap; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4208 "configure"
+#line 4068 "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
@@ -4215,7 +4075,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:4219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_tgetent="-l$i"
 break
@@ -4242,14 +4102,14 @@
 # Readline doesn't, so I think we're safe with leaving them out.
 
 echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6
-echo "configure:4246: checking for library containing tgetent" >&5
+echo "configure:4106: checking for library containing tgetent" >&5
 if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_tgetent="no"
 cat > conftest.$ac_ext <<EOF
-#line 4253 "configure"
+#line 4113 "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
@@ -4260,7 +4120,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_tgetent="none required"
 else
@@ -4271,7 +4131,7 @@
 test "$ac_cv_search_tgetent" = "no" && for i in termcap tinfo ncurses Hcurses curses; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4275 "configure"
+#line 4135 "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
@@ -4282,7 +4142,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:4286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_tgetent="-l$i"
 break
@@ -4307,6 +4167,152 @@
   { echo "configure: error: no termcap library found" 1>&2; exit 1; }
 fi
 
+# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
+# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
+# Makefile fragments.  That's why we need to have `Hcurses' before
+# `curses'.  I don't see why we should use HP curses if a more
+# standard curses is available, except that according to HP's
+# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
+# HP-UX 10.10 and 10.20.
+
+# FIXME: ncurses does not work on native alphaev68-dec-osf5.1,
+# and probably other platforms.  AC_SEARCH_LIBS finds the library
+# in a place such as /usr/local/lib/libncurses.a, but does not
+# do anything to look for the matching include files.
+# -- chastain 2004-05-01
+
+
+echo $ac_n "checking for library containing initscr""... $ac_c" 1>&6
+echo "configure:4187: checking for library containing initscr" >&5
+if eval "test \"`echo '$''{'ac_cv_search_initscr'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_initscr="no"
+cat > conftest.$ac_ext <<EOF
+#line 4194 "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 initscr();
+
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:4205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_initscr="none required"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+test "$ac_cv_search_initscr" = "no" && for i in ncurses Hcurses curses pdcurses; do
+LIBS="-l$i  $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4216 "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 initscr();
+
+int main() {
+initscr()
+; return 0; }
+EOF
+if { (eval echo configure:4227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_initscr="-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_initscr" 1>&6
+if test "$ac_cv_search_initscr" != "no"; then
+  test "$ac_cv_search_initscr" = "none required" || LIBS="$ac_cv_search_initscr $LIBS"
+  
+else :
+  echo "configure: warning: no curses library found" 1>&2
+fi
+
+# Check whether the wborder function is provided by the curses
+# library detected above.  In certain implementations such as
+# the HP/UX Hcurses for instance, this function is provided by an
+# additional library.  So if we did not find this function inside
+# the curses library, try some alternate libraries we know might
+# provide it.
+
+echo $ac_n "checking for library containing wborder""... $ac_c" 1>&6
+echo "configure:4256: checking for library containing wborder" >&5
+if eval "test \"`echo '$''{'ac_cv_search_wborder'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_wborder="no"
+cat > conftest.$ac_ext <<EOF
+#line 4263 "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 wborder();
+
+int main() {
+wborder()
+; return 0; }
+EOF
+if { (eval echo configure:4274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_wborder="none required"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+test "$ac_cv_search_wborder" = "no" && for i in cur_colr; do
+LIBS="-l$i  $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4285 "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 wborder();
+
+int main() {
+wborder()
+; return 0; }
+EOF
+if { (eval echo configure:4296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  ac_cv_search_wborder="-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_wborder" 1>&6
+if test "$ac_cv_search_wborder" != "no"; then
+  test "$ac_cv_search_wborder" = "none required" || LIBS="$ac_cv_search_wborder $LIBS"
+  
+else :
+  echo "configure: warning: wborder function not found, tui will be disabled" 1>&2
+fi
+
 # ------------------------- #
 # Checks for header files.  #
 # ------------------------- #
@@ -4316,12 +4322,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:4320: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4326: 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 4325 "configure"
+#line 4331 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4329,7 +4335,7 @@
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4354,7 +4360,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:4358: checking for opendir in -ldir" >&5
+echo "configure:4364: 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
@@ -4362,7 +4368,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4366 "configure"
+#line 4372 "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
@@ -4373,7 +4379,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4383: \"$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
@@ -4395,7 +4401,7 @@
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4399: checking for opendir in -lx" >&5
+echo "configure:4405: 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
@@ -4403,7 +4409,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4407 "configure"
+#line 4413 "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
@@ -4414,7 +4420,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4418: \"$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_lib_$ac_lib_var=yes"
 else
@@ -4437,12 +4443,12 @@
 fi
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:4441: checking whether stat file-mode macros are broken" >&5
+echo "configure:4447: checking whether stat file-mode macros are broken" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4446 "configure"
+#line 4452 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -4493,12 +4499,12 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4497: checking for ANSI C header files" >&5
+echo "configure:4503: 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 4502 "configure"
+#line 4508 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4506,7 +4512,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4516: \"$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*
@@ -4523,7 +4529,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 4527 "configure"
+#line 4533 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -4541,7 +4547,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 4545 "configure"
+#line 4551 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -4562,7 +4568,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 4566 "configure"
+#line 4572 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -4573,7 +4579,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:4577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -4600,17 +4606,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4604: checking for $ac_hdr" >&5
+echo "configure:4610: 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 4609 "configure"
+#line 4615 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4620: \"$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*
@@ -4640,17 +4646,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4644: checking for $ac_hdr" >&5
+echo "configure:4650: 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 4649 "configure"
+#line 4655 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4660: \"$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*
@@ -4680,17 +4686,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4684: checking for $ac_hdr" >&5
+echo "configure:4690: 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 4689 "configure"
+#line 4695 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4694: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4700: \"$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*
@@ -4720,17 +4726,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4724: checking for $ac_hdr" >&5
+echo "configure:4730: 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 4729 "configure"
+#line 4735 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4740: \"$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*
@@ -4756,21 +4762,21 @@
 fi
 done
 
-for ac_hdr in proc_service.h thread_db.h
+for ac_hdr in proc_service.h thread_db.h gnu/libc-version.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4764: checking for $ac_hdr" >&5
+echo "configure:4770: 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 4769 "configure"
+#line 4775 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4780: \"$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*
@@ -4800,17 +4806,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4804: checking for $ac_hdr" >&5
+echo "configure:4810: 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 4809 "configure"
+#line 4815 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4820: \"$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*
@@ -4840,17 +4846,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4844: checking for $ac_hdr" >&5
+echo "configure:4850: 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 4849 "configure"
+#line 4855 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4860: \"$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*
@@ -4880,17 +4886,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4884: checking for $ac_hdr" >&5
+echo "configure:4890: 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 4889 "configure"
+#line 4895 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4900: \"$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*
@@ -4920,17 +4926,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4924: checking for $ac_hdr" >&5
+echo "configure:4930: 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 4929 "configure"
+#line 4935 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4940: \"$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*
@@ -4960,17 +4966,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4964: checking for $ac_hdr" >&5
+echo "configure:4970: 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 4969 "configure"
+#line 4975 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4980: \"$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*
@@ -5000,17 +5006,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5004: checking for $ac_hdr" >&5
+echo "configure:5010: 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 5009 "configure"
+#line 5015 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5020: \"$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*
@@ -5040,17 +5046,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5044: checking for $ac_hdr" >&5
+echo "configure:5050: 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 5049 "configure"
+#line 5055 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5060: \"$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*
@@ -5080,17 +5086,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5084: checking for $ac_hdr" >&5
+echo "configure:5090: 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 5089 "configure"
+#line 5095 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5094: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5100: \"$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*
@@ -5120,17 +5126,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5124: checking for $ac_hdr" >&5
+echo "configure:5130: 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 5129 "configure"
+#line 5135 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5140: \"$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*
@@ -5160,17 +5166,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5164: checking for $ac_hdr" >&5
+echo "configure:5170: 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 5169 "configure"
+#line 5175 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5180: \"$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*
@@ -5200,17 +5206,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5204: checking for $ac_hdr" >&5
+echo "configure:5210: 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 5209 "configure"
+#line 5215 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5220: \"$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*
@@ -5240,17 +5246,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5244: checking for $ac_hdr" >&5
+echo "configure:5250: 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 5249 "configure"
+#line 5255 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5260: \"$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*
@@ -5280,17 +5286,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5284: checking for $ac_hdr" >&5
+echo "configure:5290: 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 5289 "configure"
+#line 5295 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5300: \"$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*
@@ -5320,17 +5326,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5324: checking for $ac_hdr" >&5
+echo "configure:5330: 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 5329 "configure"
+#line 5335 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5340: \"$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*
@@ -5360,17 +5366,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5364: checking for $ac_hdr" >&5
+echo "configure:5370: 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 5369 "configure"
+#line 5375 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5380: \"$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*
@@ -5400,17 +5406,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5404: checking for $ac_hdr" >&5
+echo "configure:5410: 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 5409 "configure"
+#line 5415 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5420: \"$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*
@@ -5440,17 +5446,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5444: checking for $ac_hdr" >&5
+echo "configure:5450: 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 5449 "configure"
+#line 5455 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5454: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5460: \"$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*
@@ -5480,17 +5486,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5484: checking for $ac_hdr" >&5
+echo "configure:5490: 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 5489 "configure"
+#line 5495 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5500: \"$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*
@@ -5520,17 +5526,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5524: checking for $ac_hdr" >&5
+echo "configure:5530: 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 5529 "configure"
+#line 5535 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5540: \"$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*
@@ -5573,17 +5579,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5577: checking for $ac_hdr" >&5
+echo "configure:5583: 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 5582 "configure"
+#line 5588 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5593: \"$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*
@@ -5616,17 +5622,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5620: checking for $ac_hdr" >&5
+echo "configure:5626: 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 5625 "configure"
+#line 5631 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5630: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5636: \"$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*
@@ -5654,12 +5660,12 @@
 
 
 echo $ac_n "checking for member st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:5658: checking for member st_blocks in struct stat" >&5
+echo "configure:5664: checking for member st_blocks in struct stat" >&5
 if eval "test \"`echo '$''{'gdb_cv_have_struct_stat_with_st_blocks_member'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5663 "configure"
+#line 5669 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -5667,7 +5673,7 @@
 struct stat st; (void) st.st_blocks;
 ; return 0; }
 EOF
-if { (eval echo configure:5671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_struct_stat_with_st_blocks_member=yes
 else
@@ -5694,12 +5700,12 @@
 do
   ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
 echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:5698: checking whether $ac_func is declared" >&5
+echo "configure:5704: checking whether $ac_func is declared" >&5
 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5703 "configure"
+#line 5709 "configure"
 #include "confdefs.h"
 #undef $ac_tr_decl
 #define $ac_tr_decl 1
@@ -5711,7 +5717,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:5715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "gcc_cv_have_decl_$ac_func=yes"
 else
@@ -5748,12 +5754,12 @@
 # ------------------ #
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:5752: checking return type of signal handlers" >&5
+echo "configure:5758: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5757 "configure"
+#line 5763 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -5770,7 +5776,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:5774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -5794,12 +5800,12 @@
 # ------------------------------------- #
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5798: checking for working const" >&5
+echo "configure:5804: 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 5803 "configure"
+#line 5809 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -5848,7 +5854,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:5852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -5869,21 +5875,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:5873: checking for inline" >&5
+echo "configure:5879: 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 5880 "configure"
+#line 5886 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:5887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -5916,19 +5922,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:5920: checking for working alloca.h" >&5
+echo "configure:5926: 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 5925 "configure"
+#line 5931 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:5932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5938: \"$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
@@ -5949,12 +5955,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:5953: checking for alloca" >&5
+echo "configure:5959: 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 5958 "configure"
+#line 5964 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -5982,7 +5988,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:5986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5992: \"$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
@@ -6014,12 +6020,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:6018: checking whether alloca needs Cray hooks" >&5
+echo "configure:6024: 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 6023 "configure"
+#line 6029 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -6044,12 +6050,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:6048: checking for $ac_func" >&5
+echo "configure:6054: 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 6053 "configure"
+#line 6059 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6072,7 +6078,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6082: \"$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
@@ -6099,7 +6105,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:6103: checking stack direction for C alloca" >&5
+echo "configure:6109: 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
@@ -6107,7 +6113,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 6111 "configure"
+#line 6117 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -6126,7 +6132,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:6130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6136: \"$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
@@ -6151,17 +6157,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6155: checking for $ac_hdr" >&5
+echo "configure:6161: 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 6160 "configure"
+#line 6166 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6171: \"$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*
@@ -6190,12 +6196,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6194: checking for $ac_func" >&5
+echo "configure:6200: 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 6199 "configure"
+#line 6205 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6218,7 +6224,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6228: \"$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
@@ -6243,7 +6249,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6247: checking for working mmap" >&5
+echo "configure:6253: 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
@@ -6251,7 +6257,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 6255 "configure"
+#line 6261 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6391,7 +6397,7 @@
 }
 
 EOF
-if { (eval echo configure:6395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6401: \"$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
@@ -6414,12 +6420,12 @@
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:6418: checking for pid_t" >&5
+echo "configure:6424: checking for pid_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6423 "configure"
+#line 6429 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6448,17 +6454,17 @@
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:6452: checking for vfork.h" >&5
+echo "configure:6458: checking for vfork.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 6457 "configure"
+#line 6463 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6468: \"$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*
@@ -6483,18 +6489,18 @@
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:6487: checking for working vfork" >&5
+echo "configure:6493: checking for working vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$cross_compiling" = yes; then
   echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:6493: checking for vfork" >&5
+echo "configure:6499: checking for vfork" >&5
 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6498 "configure"
+#line 6504 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vfork(); below.  */
@@ -6517,7 +6523,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_vfork=yes"
 else
@@ -6539,7 +6545,7 @@
 ac_cv_func_vfork_works=$ac_cv_func_vfork
 else
   cat > conftest.$ac_ext <<EOF
-#line 6543 "configure"
+#line 6549 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -6634,7 +6640,7 @@
   }
 }
 EOF
-if { (eval echo configure:6638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_vfork_works=yes
 else
@@ -6659,12 +6665,12 @@
 for ac_func in canonicalize_file_name realpath
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6663: checking for $ac_func" >&5
+echo "configure:6669: 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 6668 "configure"
+#line 6674 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6687,7 +6693,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6697: \"$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
@@ -6714,12 +6720,12 @@
 for ac_func in poll
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6718: checking for $ac_func" >&5
+echo "configure:6724: 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 6723 "configure"
+#line 6729 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6742,7 +6748,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6752: \"$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
@@ -6769,12 +6775,12 @@
 for ac_func in pread64
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6773: checking for $ac_func" >&5
+echo "configure:6779: 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 6778 "configure"
+#line 6784 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6797,7 +6803,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6807: \"$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
@@ -6824,12 +6830,12 @@
 for ac_func in sbrk
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6828: checking for $ac_func" >&5
+echo "configure:6834: 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 6833 "configure"
+#line 6839 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6852,7 +6858,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6862: \"$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
@@ -6879,12 +6885,12 @@
 for ac_func in setpgid setpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6883: checking for $ac_func" >&5
+echo "configure:6889: 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 6888 "configure"
+#line 6894 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6907,7 +6913,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6917: \"$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
@@ -6934,12 +6940,12 @@
 for ac_func in sigaction sigprocmask sigsetmask
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6938: checking for $ac_func" >&5
+echo "configure:6944: 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 6943 "configure"
+#line 6949 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6962,7 +6968,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:6966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6972: \"$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
@@ -6989,12 +6995,12 @@
 for ac_func in socketpair
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6993: checking for $ac_func" >&5
+echo "configure:6999: 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 6998 "configure"
+#line 7004 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7017,7 +7023,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7027: \"$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
@@ -7044,12 +7050,12 @@
 for ac_func in syscall
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7048: checking for $ac_func" >&5
+echo "configure:7054: 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 7053 "configure"
+#line 7059 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7072,7 +7078,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7082: \"$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
@@ -7099,7 +7105,7 @@
 
 if test "$cross_compiling" = no; then
   echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:7103: checking whether setpgrp takes no argument" >&5
+echo "configure:7109: checking whether setpgrp takes no argument" >&5
 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7107,7 +7113,7 @@
   { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 7111 "configure"
+#line 7117 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_UNISTD_H
@@ -7127,7 +7133,7 @@
 }
 
 EOF
-if { (eval echo configure:7131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_setpgrp_void=no
 else
@@ -7152,12 +7158,12 @@
 
 else
   echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:7156: checking whether setpgrp takes no argument" >&5
+echo "configure:7162: checking whether setpgrp takes no argument" >&5
 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7161 "configure"
+#line 7167 "configure"
 #include "confdefs.h"
 
 #include <unistd.h>
@@ -7171,7 +7177,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:7175: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_func_setpgrp_void=no
 else
@@ -7195,12 +7201,12 @@
 # Check if sigsetjmp is available.  Using AC_CHECK_FUNCS won't do
 # since sigsetjmp might only be defined as a macro.
 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:7199: checking for sigsetjmp" >&5
+echo "configure:7205: checking for sigsetjmp" >&5
 if eval "test \"`echo '$''{'gdb_cv_func_sigsetjmp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7204 "configure"
+#line 7210 "configure"
 #include "confdefs.h"
 
 #include <setjmp.h>
@@ -7209,7 +7215,7 @@
 sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);
 ; return 0; }
 EOF
-if { (eval echo configure:7213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_func_sigsetjmp=yes
 else
@@ -7235,12 +7241,12 @@
 # However, if the system regex is GNU regex, then default to *not*
 # using the included regex.
 echo $ac_n "checking for GNU regex""... $ac_c" 1>&6
-echo "configure:7239: checking for GNU regex" >&5
+echo "configure:7245: checking for GNU regex" >&5
 if eval "test \"`echo '$''{'gdb_cv_have_gnu_regex'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7244 "configure"
+#line 7250 "configure"
 #include "confdefs.h"
 #include <gnu-versions.h>
 int main() {
@@ -7250,7 +7256,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:7254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7260: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_gnu_regex=yes
 else
@@ -7282,14 +7288,49 @@
 
 fi
 
+# See if <sys/proc.h> defines `struct thread' with a td_pcb member.
+echo $ac_n "checking for td_pcb in struct thread""... $ac_c" 1>&6
+echo "configure:7294: checking for td_pcb in struct thread" >&5
+if eval "test \"`echo '$''{'gdb_cv_struct_thread_td_pcb'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 7299 "configure"
+#include "confdefs.h"
+#include <sys/param.h>
+#include <sys/proc.h>
+int main() {
+struct thread td; td.td_pcb;
+; return 0; }
+EOF
+if { (eval echo configure:7307: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  gdb_cv_struct_thread_td_pcb=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  gdb_cv_struct_thread_td_pcb=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$gdb_cv_struct_thread_td_pcb" 1>&6
+if test $gdb_cv_struct_thread_td_pcb = yes; then
+  cat >> confdefs.h <<\EOF
+#define HAVE_STRUCT_THREAD_TD_PCB 1
+EOF
+
+fi
+
 # See if <machine/reg.h> degines `struct reg'.
 echo $ac_n "checking for struct reg in machine/reg.h""... $ac_c" 1>&6
-echo "configure:7288: checking for struct reg in machine/reg.h" >&5
+echo "configure:7329: checking for struct reg in machine/reg.h" >&5
 if eval "test \"`echo '$''{'gdb_cv_struct_reg'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7293 "configure"
+#line 7334 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <machine/reg.h>
@@ -7297,7 +7338,7 @@
 struct reg r;
 ; return 0; }
 EOF
-if { (eval echo configure:7301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_struct_reg=yes
 else
@@ -7320,19 +7361,19 @@
 # See if <machine/reg.h> supports the %fs and %gs i386 segment registers.
 # Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'.
 echo $ac_n "checking for r_fs in struct reg""... $ac_c" 1>&6
-echo "configure:7324: checking for r_fs in struct reg" >&5
+echo "configure:7365: checking for r_fs in struct reg" >&5
 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_fs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7329 "configure"
+#line 7370 "configure"
 #include "confdefs.h"
 #include <machine/reg.h>
 int main() {
 struct reg r; r.r_fs;
 ; return 0; }
 EOF
-if { (eval echo configure:7336: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_struct_reg_r_fs=yes
 else
@@ -7352,19 +7393,19 @@
 
 fi
 echo $ac_n "checking for r_gs in struct reg""... $ac_c" 1>&6
-echo "configure:7356: checking for r_gs in struct reg" >&5
+echo "configure:7397: checking for r_gs in struct reg" >&5
 if eval "test \"`echo '$''{'gdb_cv_struct_reg_r_gs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7361 "configure"
+#line 7402 "configure"
 #include "confdefs.h"
 #include <machine/reg.h>
 int main() {
 struct reg r; r.r_gs;
 ; return 0; }
 EOF
-if { (eval echo configure:7368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_struct_reg_r_gs=yes
 else
@@ -7386,19 +7427,19 @@
 
 # See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
 echo $ac_n "checking for PTRACE_GETREGS""... $ac_c" 1>&6
-echo "configure:7390: checking for PTRACE_GETREGS" >&5
+echo "configure:7431: checking for PTRACE_GETREGS" >&5
 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getregs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7395 "configure"
+#line 7436 "configure"
 #include "confdefs.h"
 #include <sys/ptrace.h>
 int main() {
 PTRACE_GETREGS;
 ; return 0; }
 EOF
-if { (eval echo configure:7402: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_ptrace_getregs=yes
 else
@@ -7420,19 +7461,19 @@
 
 # See if <sys/ptrace.h> provides the PTRACE_GETFPXREGS request.
 echo $ac_n "checking for PTRACE_GETFPXREGS""... $ac_c" 1>&6
-echo "configure:7424: checking for PTRACE_GETFPXREGS" >&5
+echo "configure:7465: checking for PTRACE_GETFPXREGS" >&5
 if eval "test \"`echo '$''{'gdb_cv_have_ptrace_getfpxregs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7429 "configure"
+#line 7470 "configure"
 #include "confdefs.h"
 #include <sys/ptrace.h>
 int main() {
 PTRACE_GETFPXREGS;
 ; return 0; }
 EOF
-if { (eval echo configure:7436: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_ptrace_getfpxregs=yes
 else
@@ -7454,12 +7495,12 @@
 
 # See if <sys/ptrace.h> provides the PT_GETDBREGS request.
 echo $ac_n "checking for PT_GETDBREGS""... $ac_c" 1>&6
-echo "configure:7458: checking for PT_GETDBREGS" >&5
+echo "configure:7499: checking for PT_GETDBREGS" >&5
 if eval "test \"`echo '$''{'gdb_cv_have_pt_getdbregs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7463 "configure"
+#line 7504 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/ptrace.h>
@@ -7467,7 +7508,7 @@
 PT_GETDBREGS;
 ; return 0; }
 EOF
-if { (eval echo configure:7471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_pt_getdbregs=yes
 else
@@ -7489,12 +7530,12 @@
 
 # See if <sys/ptrace.h> provides the PT_GETXMMREGS request.
 echo $ac_n "checking for PT_GETXMMREGS""... $ac_c" 1>&6
-echo "configure:7493: checking for PT_GETXMMREGS" >&5
+echo "configure:7534: checking for PT_GETXMMREGS" >&5
 if eval "test \"`echo '$''{'gdb_cv_have_pt_getxmmregs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7498 "configure"
+#line 7539 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/ptrace.h>
@@ -7502,7 +7543,7 @@
 PT_GETXMMREGS;
 ; return 0; }
 EOF
-if { (eval echo configure:7506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_pt_getxmmregs=yes
 else
@@ -7525,19 +7566,19 @@
 # See if stdint.h provides the uintptr_t type.
 # Autoconf 2.5X has an improved AC_CHECK_TYPE which will simplify this.
 echo $ac_n "checking for uintptr_t in stdint.h""... $ac_c" 1>&6
-echo "configure:7529: checking for uintptr_t in stdint.h" >&5
+echo "configure:7570: checking for uintptr_t in stdint.h" >&5
 if eval "test \"`echo '$''{'gdb_cv_have_uintptr_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7534 "configure"
+#line 7575 "configure"
 #include "confdefs.h"
 #include <stdint.h>
 int main() {
 uintptr_t foo = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:7541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_uintptr_t=yes
 else
@@ -7558,12 +7599,12 @@
 fi
 
 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:7562: checking whether malloc must be declared" >&5
+echo "configure:7603: 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 7567 "configure"
+#line 7608 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7584,7 +7625,7 @@
 char *(*pfn) = (char *(*)) malloc
 ; return 0; }
 EOF
-if { (eval echo configure:7588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7629: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_malloc=no
 else
@@ -7605,12 +7646,12 @@
 fi
 
 echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:7609: checking whether realloc must be declared" >&5
+echo "configure:7650: 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 7614 "configure"
+#line 7655 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7631,7 +7672,7 @@
 char *(*pfn) = (char *(*)) realloc
 ; return 0; }
 EOF
-if { (eval echo configure:7635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_realloc=no
 else
@@ -7652,12 +7693,12 @@
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:7656: checking whether free must be declared" >&5
+echo "configure:7697: 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 7661 "configure"
+#line 7702 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7678,7 +7719,7 @@
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:7682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7723: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -7699,12 +7740,12 @@
 fi
 
 echo $ac_n "checking whether strerror must be declared""... $ac_c" 1>&6
-echo "configure:7703: checking whether strerror must be declared" >&5
+echo "configure:7744: checking whether strerror must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strerror'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7708 "configure"
+#line 7749 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7725,7 +7766,7 @@
 char *(*pfn) = (char *(*)) strerror
 ; return 0; }
 EOF
-if { (eval echo configure:7729: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strerror=no
 else
@@ -7746,12 +7787,12 @@
 fi
 
 echo $ac_n "checking whether strdup must be declared""... $ac_c" 1>&6
-echo "configure:7750: checking whether strdup must be declared" >&5
+echo "configure:7791: checking whether strdup must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strdup'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7755 "configure"
+#line 7796 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7772,7 +7813,7 @@
 char *(*pfn) = (char *(*)) strdup
 ; return 0; }
 EOF
-if { (eval echo configure:7776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strdup=no
 else
@@ -7793,12 +7834,12 @@
 fi
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:7797: checking whether strstr must be declared" >&5
+echo "configure:7838: 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 7802 "configure"
+#line 7843 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7819,7 +7860,7 @@
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:7823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -7840,12 +7881,12 @@
 fi
 
 echo $ac_n "checking whether canonicalize_file_name must be declared""... $ac_c" 1>&6
-echo "configure:7844: checking whether canonicalize_file_name must be declared" >&5
+echo "configure:7885: checking whether canonicalize_file_name must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_canonicalize_file_name'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7849 "configure"
+#line 7890 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -7866,7 +7907,7 @@
 char *(*pfn) = (char *(*)) canonicalize_file_name
 ; return 0; }
 EOF
-if { (eval echo configure:7870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_canonicalize_file_name=no
 else
@@ -7892,9 +7933,9 @@
 # could be expunged. --jsm 1999-03-22
 
 echo $ac_n "checking for HPUX save_state structure""... $ac_c" 1>&6
-echo "configure:7896: checking for HPUX save_state structure" >&5
+echo "configure:7937: checking for HPUX save_state structure" >&5
 cat > conftest.$ac_ext <<EOF
-#line 7898 "configure"
+#line 7939 "configure"
 #include "confdefs.h"
 #include <machine/save_state.h>
 EOF
@@ -7909,7 +7950,7 @@
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 7913 "configure"
+#line 7954 "configure"
 #include "confdefs.h"
 #include <machine/save_state.h>
 EOF
@@ -7974,17 +8015,24 @@
 EOF
 
       ;;
+  mips-sgi-irix5*)
+      # Work around <sys/proc.h> needing _KMEMUSER problem on IRIX 5.
+      cat >> confdefs.h <<\EOF
+#define _KMEMUSER 1
+EOF
+
+      ;;
   esac
 fi
 
 if test "$ac_cv_header_sys_procfs_h" = yes; then
   echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:7983: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:8031: 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 7988 "configure"
+#line 8036 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -7993,7 +8041,7 @@
 pstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:7997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pstatus_t=yes
 else
@@ -8015,12 +8063,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
 
   echo $ac_n "checking for prrun_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8019: checking for prrun_t in sys/procfs.h" >&5
+echo "configure:8067: checking for prrun_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prrun_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8024 "configure"
+#line 8072 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8029,7 +8077,7 @@
 prrun_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8033: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prrun_t=yes
 else
@@ -8051,12 +8099,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prrun_t" 1>&6
 
   echo $ac_n "checking for gregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8055: checking for gregset_t in sys/procfs.h" >&5
+echo "configure:8103: checking for gregset_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_gregset_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8060 "configure"
+#line 8108 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8065,7 +8113,7 @@
 gregset_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8069: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_gregset_t=yes
 else
@@ -8087,12 +8135,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_gregset_t" 1>&6
 
   echo $ac_n "checking for fpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8091: checking for fpregset_t in sys/procfs.h" >&5
+echo "configure:8139: checking for fpregset_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_fpregset_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8096 "configure"
+#line 8144 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8101,7 +8149,7 @@
 fpregset_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_fpregset_t=yes
 else
@@ -8123,12 +8171,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_fpregset_t" 1>&6
 
   echo $ac_n "checking for prgregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8127: checking for prgregset_t in sys/procfs.h" >&5
+echo "configure:8175: checking for prgregset_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8132 "configure"
+#line 8180 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8137,7 +8185,7 @@
 prgregset_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prgregset_t=yes
 else
@@ -8159,12 +8207,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset_t" 1>&6
 
   echo $ac_n "checking for prfpregset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8163: checking for prfpregset_t in sys/procfs.h" >&5
+echo "configure:8211: checking for prfpregset_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8168 "configure"
+#line 8216 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8173,7 +8221,7 @@
 prfpregset_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prfpregset_t=yes
 else
@@ -8195,12 +8243,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset_t" 1>&6
 
   echo $ac_n "checking for prgregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8199: checking for prgregset32_t in sys/procfs.h" >&5
+echo "configure:8247: checking for prgregset32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prgregset32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8204 "configure"
+#line 8252 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8209,7 +8257,7 @@
 prgregset32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8261: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prgregset32_t=yes
 else
@@ -8231,12 +8279,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prgregset32_t" 1>&6
 
   echo $ac_n "checking for prfpregset32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8235: checking for prfpregset32_t in sys/procfs.h" >&5
+echo "configure:8283: checking for prfpregset32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prfpregset32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8240 "configure"
+#line 8288 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8245,7 +8293,7 @@
 prfpregset32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prfpregset32_t=yes
 else
@@ -8267,12 +8315,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prfpregset32_t" 1>&6
 
   echo $ac_n "checking for lwpid_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8271: checking for lwpid_t in sys/procfs.h" >&5
+echo "configure:8319: checking for lwpid_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpid_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8276 "configure"
+#line 8324 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8281,7 +8329,7 @@
 lwpid_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_lwpid_t=yes
 else
@@ -8303,12 +8351,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpid_t" 1>&6
 
   echo $ac_n "checking for psaddr_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8307: checking for psaddr_t in sys/procfs.h" >&5
+echo "configure:8355: checking for psaddr_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psaddr_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8312 "configure"
+#line 8360 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8317,7 +8365,7 @@
 psaddr_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_psaddr_t=yes
 else
@@ -8339,12 +8387,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_psaddr_t" 1>&6
 
   echo $ac_n "checking for prsysent_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8343: checking for prsysent_t in sys/procfs.h" >&5
+echo "configure:8391: checking for prsysent_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prsysent_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8348 "configure"
+#line 8396 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8353,7 +8401,7 @@
 prsysent_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prsysent_t=yes
 else
@@ -8375,12 +8423,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prsysent_t" 1>&6
 
   echo $ac_n "checking for pr_sigset_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8379: checking for pr_sigset_t in sys/procfs.h" >&5
+echo "configure:8427: checking for pr_sigset_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigset_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8384 "configure"
+#line 8432 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8389,7 +8437,7 @@
 pr_sigset_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pr_sigset_t=yes
 else
@@ -8411,12 +8459,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigset_t" 1>&6
 
   echo $ac_n "checking for pr_sigaction64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8415: checking for pr_sigaction64_t in sys/procfs.h" >&5
+echo "configure:8463: checking for pr_sigaction64_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_sigaction64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8420 "configure"
+#line 8468 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8425,7 +8473,7 @@
 pr_sigaction64_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pr_sigaction64_t=yes
 else
@@ -8447,12 +8495,12 @@
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pr_sigaction64_t" 1>&6
 
   echo $ac_n "checking for pr_siginfo64_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8451: checking for pr_siginfo64_t in sys/procfs.h" >&5
+echo "configure:8499: checking for pr_siginfo64_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pr_siginfo64_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8456 "configure"
+#line 8504 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -8461,7 +8509,7 @@
 pr_siginfo64_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:8465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pr_siginfo64_t=yes
 else
@@ -8488,7 +8536,7 @@
         
   if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then
     echo $ac_n "checking whether prfpregset_t type is broken""... $ac_c" 1>&6
-echo "configure:8492: checking whether prfpregset_t type is broken" >&5
+echo "configure:8540: checking whether prfpregset_t type is broken" >&5
     if eval "test \"`echo '$''{'gdb_cv_prfpregset_t_broken'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8496,7 +8544,7 @@
   gdb_cv_prfpregset_t_broken=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 8500 "configure"
+#line 8548 "configure"
 #include "confdefs.h"
 #include <sys/procfs.h>
        int main ()
@@ -8506,7 +8554,7 @@
          return 0;
        }
 EOF
-if { (eval echo configure:8510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   gdb_cv_prfpregset_t_broken=no
 else
@@ -8531,12 +8579,12 @@
 
   
   echo $ac_n "checking for PIOCSET ioctl entry in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:8535: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
+echo "configure:8583: checking for PIOCSET ioctl entry in sys/procfs.h" >&5
   if eval "test \"`echo '$''{'gdb_cv_have_procfs_piocset'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8540 "configure"
+#line 8588 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 #include <sys/types.h>
@@ -8549,7 +8597,7 @@
   
 ; return 0; }
 EOF
-if { (eval echo configure:8553: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_procfs_piocset=yes
 else
@@ -8573,19 +8621,19 @@
 if test ${host} = ${target} ; then
     
   echo $ac_n "checking for member l_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:8577: checking for member l_addr in struct link_map" >&5
+echo "configure:8625: checking for member l_addr in struct link_map" >&5
   if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_l_members'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8582 "configure"
+#line 8630 "configure"
 #include "confdefs.h"
 #include <link.h>
 int main() {
 struct link_map lm; (void) lm.l_addr;
 ; return 0; }
 EOF
-if { (eval echo configure:8589: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_struct_link_map_with_l_members=yes
 else
@@ -8607,12 +8655,12 @@
 
     
   echo $ac_n "checking for member lm_addr in struct link_map""... $ac_c" 1>&6
-echo "configure:8611: checking for member lm_addr in struct link_map" >&5
+echo "configure:8659: checking for member lm_addr in struct link_map" >&5
   if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map_with_lm_members'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8616 "configure"
+#line 8664 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <link.h>
@@ -8620,7 +8668,7 @@
 struct link_map lm; (void) lm.lm_addr;
 ; return 0; }
 EOF
-if { (eval echo configure:8624: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_struct_link_map_with_lm_members=yes
 else
@@ -8642,12 +8690,12 @@
 
     
   echo $ac_n "checking for member som_addr in struct so_map""... $ac_c" 1>&6
-echo "configure:8646: checking for member som_addr in struct so_map" >&5
+echo "configure:8694: checking for member som_addr in struct so_map" >&5
   if eval "test \"`echo '$''{'gdb_cv_have_struct_so_map_with_som_members'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8651 "configure"
+#line 8699 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_NLIST_H
@@ -8658,7 +8706,7 @@
 struct so_map lm; (void) lm.som_addr;
 ; return 0; }
 EOF
-if { (eval echo configure:8662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_struct_so_map_with_som_members=yes
 else
@@ -8680,12 +8728,12 @@
 
     
   echo $ac_n "checking for struct link_map32 in sys/link.h""... $ac_c" 1>&6
-echo "configure:8684: checking for struct link_map32 in sys/link.h" >&5
+echo "configure:8732: checking for struct link_map32 in sys/link.h" >&5
   if eval "test \"`echo '$''{'gdb_cv_have_struct_link_map32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8689 "configure"
+#line 8737 "configure"
 #include "confdefs.h"
 #define _SYSCALL32
 #include <sys/link.h>
@@ -8693,7 +8741,7 @@
 struct link_map32 l;
 ; return 0; }
 EOF
-if { (eval echo configure:8697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_struct_link_map32=yes
 else
@@ -8720,12 +8768,12 @@
 
 
 echo $ac_n "checking for long long support in compiler""... $ac_c" 1>&6
-echo "configure:8724: checking for long long support in compiler" >&5
+echo "configure:8772: checking for long long support in compiler" >&5
 if eval "test \"`echo '$''{'gdb_cv_c_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8729 "configure"
+#line 8777 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -8735,7 +8783,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:8739: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_c_long_long=yes
 else
@@ -8757,7 +8805,7 @@
 
 
 echo $ac_n "checking for long long support in printf""... $ac_c" 1>&6
-echo "configure:8761: checking for long long support in printf" >&5
+echo "configure:8809: checking for long long support in printf" >&5
 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8765,7 +8813,7 @@
   gdb_cv_printf_has_long_long=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 8769 "configure"
+#line 8817 "configure"
 #include "confdefs.h"
 
 int main () {
@@ -8779,7 +8827,7 @@
   return (strcmp ("0x0123456789abcdef", buf));
 }
 EOF
-if { (eval echo configure:8783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   gdb_cv_printf_has_long_long=yes
 else
@@ -8803,19 +8851,19 @@
 
 
 echo $ac_n "checking for long double support in compiler""... $ac_c" 1>&6
-echo "configure:8807: checking for long double support in compiler" >&5
+echo "configure:8855: checking for long double support in compiler" >&5
 if eval "test \"`echo '$''{'ac_cv_c_long_double'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8812 "configure"
+#line 8860 "configure"
 #include "confdefs.h"
 
 int main() {
 long double foo;
 ; return 0; }
 EOF
-if { (eval echo configure:8819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_long_double=yes
 else
@@ -8837,7 +8885,7 @@
 
 
 echo $ac_n "checking for long double support in printf""... $ac_c" 1>&6
-echo "configure:8841: checking for long double support in printf" >&5
+echo "configure:8889: checking for long double support in printf" >&5
 if eval "test \"`echo '$''{'gdb_cv_printf_has_long_double'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8845,7 +8893,7 @@
   gdb_cv_printf_has_long_double=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 8849 "configure"
+#line 8897 "configure"
 #include "confdefs.h"
 
 int main () {
@@ -8855,7 +8903,7 @@
   return (strncmp ("3.14159", buf, 7));
 }
 EOF
-if { (eval echo configure:8859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   gdb_cv_printf_has_long_double=yes
 else
@@ -8879,7 +8927,7 @@
 
 
 echo $ac_n "checking for long double support in scanf""... $ac_c" 1>&6
-echo "configure:8883: checking for long double support in scanf" >&5
+echo "configure:8931: checking for long double support in scanf" >&5
 if eval "test \"`echo '$''{'gdb_cv_scanf_has_long_double'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8887,7 +8935,7 @@
   gdb_cv_scanf_has_long_double=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 8891 "configure"
+#line 8939 "configure"
 #include "confdefs.h"
 
 int main () {
@@ -8897,7 +8945,7 @@
   return !(f > 3.14159 && f < 3.14160);
 }
 EOF
-if { (eval echo configure:8901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   gdb_cv_scanf_has_long_double=yes
 else
@@ -8922,7 +8970,7 @@
 case ${host_os} in
 aix*)
   echo $ac_n "checking for -bbigtoc option""... $ac_c" 1>&6
-echo "configure:8926: checking for -bbigtoc option" >&5
+echo "configure:8974: checking for -bbigtoc option" >&5
 if eval "test \"`echo '$''{'gdb_cv_bigtoc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8936,14 +8984,14 @@
 
     LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
     cat > conftest.$ac_ext <<EOF
-#line 8940 "configure"
+#line 8988 "configure"
 #include "confdefs.h"
 
 int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:8947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -8952,6 +9000,7 @@
   gdb_cv_bigtoc=
 fi
 rm -f conftest*
+    LDFLAGS="${SAVE_LDFLAGS}"
   
 fi
 
@@ -8966,7 +9015,7 @@
    case ${host_os} in
    hpux*)
       echo $ac_n "checking for HPUX/OSF thread support""... $ac_c" 1>&6
-echo "configure:8970: checking for HPUX/OSF thread support" >&5
+echo "configure:9019: checking for HPUX/OSF thread support" >&5
       if test -f /usr/include/dce/cma_config.h ; then
          if test "$GCC" = "yes" ; then
             echo "$ac_t""yes" 1>&6
@@ -8989,7 +9038,7 @@
       # because version 0 (present on Solaris 2.4 or earlier) doesn't have
       # the same API.
       echo $ac_n "checking for Solaris thread debugging library""... $ac_c" 1>&6
-echo "configure:8993: checking for Solaris thread debugging library" >&5
+echo "configure:9042: checking for Solaris thread debugging library" >&5
       if test -f /usr/lib/libthread_db.so.1 ; then
          echo "$ac_t""yes" 1>&6
          cat >> confdefs.h <<\EOF
@@ -8999,7 +9048,7 @@
          CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
          CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
          echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:9003: checking for dlopen in -ldl" >&5
+echo "configure:9052: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9007,7 +9056,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9011 "configure"
+#line 9060 "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
@@ -9018,7 +9067,7 @@
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:9022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9071: \"$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
@@ -9050,17 +9099,17 @@
             # all symbols visible in the dynamic symbol table.
             hold_ldflags=$LDFLAGS
             echo $ac_n "checking for the ld -export-dynamic flag""... $ac_c" 1>&6
-echo "configure:9054: checking for the ld -export-dynamic flag" >&5
+echo "configure:9103: checking for the ld -export-dynamic flag" >&5
             LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
             cat > conftest.$ac_ext <<EOF
-#line 9057 "configure"
+#line 9106 "configure"
 #include "confdefs.h"
 
 int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:9064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   found=yes
 else
@@ -9079,13 +9128,13 @@
 	 # Sun randomly tweaked the prototypes in <proc_service.h>
 	 # at one point.
 	 echo $ac_n "checking if <proc_service.h> is old""... $ac_c" 1>&6
-echo "configure:9083: checking if <proc_service.h> is old" >&5
+echo "configure:9132: checking if <proc_service.h> is old" >&5
 	 if eval "test \"`echo '$''{'gdb_cv_proc_service_is_old'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 	    cat > conftest.$ac_ext <<EOF
-#line 9089 "configure"
+#line 9138 "configure"
 #include "confdefs.h"
 
 		#include <proc_service.h>
@@ -9096,7 +9145,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:9100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_proc_service_is_old=no
 else
@@ -9122,12 +9171,12 @@
       ;;
    aix*)
       echo $ac_n "checking for AiX thread debugging library""... $ac_c" 1>&6
-echo "configure:9126: checking for AiX thread debugging library" >&5
+echo "configure:9175: checking for AiX thread debugging library" >&5
       if eval "test \"`echo '$''{'gdb_cv_have_aix_thread_debug'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9131 "configure"
+#line 9180 "configure"
 #include "confdefs.h"
 #include <sys/pthdebug.h>
 int main() {
@@ -9136,7 +9185,7 @@
                                     #endif
 ; return 0; }
 EOF
-if { (eval echo configure:9140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_have_aix_thread_debug=yes
 else
@@ -9161,19 +9210,19 @@
 
 if test "x$ac_cv_header_thread_db_h" = "xyes"; then
    echo $ac_n "checking whether <thread_db.h> has TD_NOTALLOC""... $ac_c" 1>&6
-echo "configure:9165: checking whether <thread_db.h> has TD_NOTALLOC" >&5
+echo "configure:9214: checking whether <thread_db.h> has TD_NOTALLOC" >&5
 if eval "test \"`echo '$''{'gdb_cv_thread_db_h_has_td_notalloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9170 "configure"
+#line 9219 "configure"
 #include "confdefs.h"
 #include <thread_db.h>
 int main() {
 int i = TD_NOTALLOC;
 ; return 0; }
 EOF
-if { (eval echo configure:9177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_thread_db_h_has_td_notalloc=yes
 else
@@ -9198,19 +9247,19 @@
 
 if test "x$ac_cv_header_sys_syscall_h" = "xyes"; then
    echo $ac_n "checking whether <sys/syscall.h> has __NR_tkill""... $ac_c" 1>&6
-echo "configure:9202: checking whether <sys/syscall.h> has __NR_tkill" >&5
+echo "configure:9251: checking whether <sys/syscall.h> has __NR_tkill" >&5
 if eval "test \"`echo '$''{'gdb_cv_sys_syscall_h_has_tkill'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9207 "configure"
+#line 9256 "configure"
 #include "confdefs.h"
 #include <sys/syscall.h>
 int main() {
 int i = __NR_tkill;
 ; return 0; }
 EOF
-if { (eval echo configure:9214: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   gdb_cv_sys_syscall_h_has_tkill=yes
 else
@@ -9322,7 +9371,7 @@
 if test "x${build_warnings}" != x -a "x$GCC" = xyes
 then
     echo $ac_n "checking compiler warning flags""... $ac_c" 1>&6
-echo "configure:9326: checking compiler warning flags" >&5
+echo "configure:9375: checking compiler warning flags" >&5
     # Separate out the -Werror flag as some files just cannot be
     # compiled with it enabled.
     for w in ${build_warnings}; do
@@ -9332,14 +9381,14 @@
 	    saved_CFLAGS="$CFLAGS"
 	    CFLAGS="$CFLAGS $w"
 	    cat > conftest.$ac_ext <<EOF
-#line 9336 "configure"
+#line 9385 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:9343: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   WARN_CFLAGS="${WARN_CFLAGS} $w"
 else
@@ -9357,12 +9406,12 @@
 
 # In the Cygwin environment, we need some additional flags.
 echo $ac_n "checking for cygwin""... $ac_c" 1>&6
-echo "configure:9361: checking for cygwin" >&5
+echo "configure:9410: checking for cygwin" >&5
 if eval "test \"`echo '$''{'gdb_cv_os_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9366 "configure"
+#line 9415 "configure"
 #include "confdefs.h"
 
 #if defined (__CYGWIN__) || defined (__CYGWIN32__)
@@ -9411,7 +9460,14 @@
 
 
 
-configdir="unix"
+case "${host}" in
+*-*-cygwin*)
+    configdir="win"
+    ;;
+*)
+    configdir="unix"
+    ;;
+esac
 
 GDBTKLIBS=
 if test "${enable_gdbtk}" = "yes"; then
@@ -9440,7 +9496,7 @@
 fi
 
   echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6
-echo "configure:9444: checking for Tcl configuration" >&5
+echo "configure:9500: checking for Tcl configuration" >&5
   if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9549,7 +9605,7 @@
 fi
 
   echo $ac_n "checking for Tk configuration""... $ac_c" 1>&6
-echo "configure:9553: checking for Tk configuration" >&5
+echo "configure:9609: checking for Tk configuration" >&5
   if eval "test \"`echo '$''{'ac_cv_c_tkconfig'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9616,14 +9672,7 @@
 
 	# now look for Tcl library stuff
 
-	case "${host}" in
-	*-*-cygwin*)
-	    tcldir=../tcl/win/
-	    ;;
-	*)
-	    tcldir=../tcl/unix/
-	    ;;
-	esac
+	tcldir="../tcl/${configdir}/"
 
 	TCL_DEPS="${tcldir}${TCL_LIB_FILE}"
 
@@ -9658,7 +9707,7 @@
 
 no_tcl=true
 echo $ac_n "checking for Tcl private headers. dir=${configdir}""... $ac_c" 1>&6
-echo "configure:9662: checking for Tcl private headers. dir=${configdir}" >&5
+echo "configure:9711: checking for Tcl private headers. dir=${configdir}" >&5
 # Check whether --with-tclinclude or --without-tclinclude was given.
 if test "${with_tclinclude+set}" = set; then
   withval="$with_tclinclude"
@@ -9724,17 +9773,17 @@
 if test x"${ac_cv_c_tclh}" = x ; then
    ac_safe=`echo "tclInt.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for tclInt.h""... $ac_c" 1>&6
-echo "configure:9728: checking for tclInt.h" >&5
+echo "configure:9777: checking for tclInt.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 9733 "configure"
+#line 9782 "configure"
 #include "confdefs.h"
 #include <tclInt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9787: \"$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*
@@ -9794,7 +9843,7 @@
 #
 no_tk=true
 echo $ac_n "checking for Tk private headers""... $ac_c" 1>&6
-echo "configure:9798: checking for Tk private headers" >&5
+echo "configure:9847: checking for Tk private headers" >&5
 # Check whether --with-tkinclude or --without-tkinclude was given.
 if test "${with_tkinclude+set}" = set; then
   withval="$with_tkinclude"
@@ -9860,17 +9909,17 @@
 if test x"${ac_cv_c_tkh}" = x ; then
    ac_safe=`echo "tk.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for tk.h""... $ac_c" 1>&6
-echo "configure:9864: checking for tk.h" >&5
+echo "configure:9913: checking for tk.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 9869 "configure"
+#line 9918 "configure"
 #include "confdefs.h"
 #include <tk.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9923: \"$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*
@@ -9916,7 +9965,7 @@
 
 	   
 echo $ac_n "checking for Itcl private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:9920: checking for Itcl private headers. srcdir=${srcdir}" >&5
+echo "configure:9969: checking for Itcl private headers. srcdir=${srcdir}" >&5
 if test x"${ac_cv_c_itclh}" = x ; then
   for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
     if test -f $i/generic/itcl.h ; then
@@ -9939,7 +9988,7 @@
 
 	   
 echo $ac_n "checking for Itk private headers. srcdir=${srcdir}""... $ac_c" 1>&6
-echo "configure:9943: checking for Itk private headers. srcdir=${srcdir}" >&5
+echo "configure:9992: checking for Itk private headers. srcdir=${srcdir}" >&5
 if test x"${ac_cv_c_itkh}" = x ; then
   for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
     if test -f $i/generic/itk.h ; then
@@ -9964,14 +10013,7 @@
 
 	   # now look for Tk library stuff
 
-	   case "${host}" in
-	   *-*-cygwin*)
-	       tkdir=../tk/win/
-	       ;;
-	   *)
-	       tkdir=../tk/unix/
-	       ;;
-	   esac
+	   tkdir="../tk/${configdir}/"
 
 	   TK_DEPS="${tkdir}${TK_LIB_FILE}"
 
@@ -9994,7 +10036,7 @@
 fi
 
   echo $ac_n "checking for Itcl configuration""... $ac_c" 1>&6
-echo "configure:9998: checking for Itcl configuration" >&5
+echo "configure:10040: checking for Itcl configuration" >&5
   if eval "test \"`echo '$''{'ac_cv_c_itclconfig'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10097,7 +10139,7 @@
 fi
 
   echo $ac_n "checking for Itk configuration""... $ac_c" 1>&6
-echo "configure:10101: checking for Itk configuration" >&5
+echo "configure:10143: checking for Itk configuration" >&5
   if eval "test \"`echo '$''{'ac_cv_c_itkconfig'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10239,7 +10281,7 @@
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:10243: checking for X" >&5
+echo "configure:10285: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -10301,12 +10343,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 10305 "configure"
+#line 10347 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:10352: \"$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*
@@ -10375,14 +10417,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 10379 "configure"
+#line 10421 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:10386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -10594,7 +10636,7 @@
 # We only build gdbserver automatically if host and target are the same.
 if test "x$target" = "x$host"; then
   echo $ac_n "checking whether gdbserver is supported on this host""... $ac_c" 1>&6
-echo "configure:10598: checking whether gdbserver is supported on this host" >&5
+echo "configure:10640: checking whether gdbserver is supported on this host" >&5
   if test "x$build_gdbserver" = xyes; then
     configdirs="$configdirs gdbserver"
     echo "$ac_t""yes" 1>&6
@@ -10658,12 +10700,12 @@
 
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:10662: checking for Cygwin environment" >&5
+echo "configure:10704: 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 10667 "configure"
+#line 10709 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -10674,7 +10716,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:10678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -10691,19 +10733,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:10695: checking for mingw32 environment" >&5
+echo "configure:10737: 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 10700 "configure"
+#line 10742 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:10707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -10722,7 +10764,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:10726: checking for executable suffix" >&5
+echo "configure:10768: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10732,10 +10774,10 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:10736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:10778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
-      *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+      *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;;
       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
       esac
     done
@@ -10774,7 +10816,7 @@
 
 
   echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:10778: checking for iconv" >&5
+echo "configure:10820: checking for iconv" >&5
 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10782,7 +10824,7 @@
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
     cat > conftest.$ac_ext <<EOF
-#line 10786 "configure"
+#line 10828 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -10792,7 +10834,7 @@
        iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:10796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_func_iconv=yes
 else
@@ -10804,7 +10846,7 @@
       am_save_LIBS="$LIBS"
       LIBS="$LIBS -liconv"
       cat > conftest.$ac_ext <<EOF
-#line 10808 "configure"
+#line 10850 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -10814,7 +10856,7 @@
          iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:10818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_lib_iconv=yes
         am_cv_func_iconv=yes
@@ -10835,13 +10877,13 @@
 EOF
 
     echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:10839: checking for iconv declaration" >&5
+echo "configure:10881: checking for iconv declaration" >&5
     if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
       cat > conftest.$ac_ext <<EOF
-#line 10845 "configure"
+#line 10887 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -10860,7 +10902,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:10864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10906: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_proto_iconv_arg1=""
 else
diff --git a/gdb/configure.host b/gdb/configure.host
index d652e1f..a2a8d5d 100644
--- a/gdb/configure.host
+++ b/gdb/configure.host
@@ -15,6 +15,7 @@
 hppa*)			gdb_host_cpu=pa ;;
 i[34567]86*)		gdb_host_cpu=i386 ;;
 m68*)			gdb_host_cpu=m68k ;;
+m88*)			gdb_host_cpu=m88k ;;
 mips*)			gdb_host_cpu=mips ;;
 powerpc*)		gdb_host_cpu=powerpc ;;
 sparcv9 | sparc64)	gdb_host_cpu=sparc ;;
@@ -48,6 +49,8 @@
 hppa*64*-*-hpux11*)	gdb_host=hpux11w ;;
 hppa*-*-hpux11*)	gdb_host=hpux11 ;;
 hppa*-*-hpux*)		gdb_host=hppahpux ;;
+hppa*-*-linux*)		gdb_host=linux ;;
+hppa*-*-openbsd*)	gdb_host=obsd ;;
 
 i[34567]86-ncr-*)	gdb_host=ncr3000 ;;
 i[34567]86-*-dgux*)	gdb_host=i386v4 ;;
@@ -82,31 +85,17 @@
 ia64-*-aix*)		gdb_host=aix ;;
 ia64-*-linux*)		gdb_host=linux ;;
 
-# OBSOLETE m680[01]0-sun-sunos3*)	gdb_host=sun2os3 ;;
-# OBSOLETE m680[01]0-sun-sunos4*)	gdb_host=sun2os4 ;;
-
-# OBSOLETE m68*-att-*)		gdb_host=3b1 ;;
-# OBSOLETE m68*-bull*-sysv*)	gdb_host=dpx2 ;;
 m68*-*-linux*)		gdb_host=linux ;;
-# OBSOLETE m68*-*-lynxos*)		gdb_host=m68klynx ;;
+m68*-*-netbsdelf*)	gdb_host=nbsdelf ;;
 m68*-*-netbsd*)		gdb_host=nbsdaout ;;
-# OBSOLETE m68*-*-sysv4*)		gdb_host=m68kv4 ;;
-# OBSOLETE m68*-motorola-*)	gdb_host=delta68 ;;
-# OBSOLETE m68*-sun-sunos3*)	gdb_host=sun3os3 ;;
-# OBSOLETE m68*-sun-sunos4*)	gdb_host=sun3os4 ;;
-# OBSOLETE m68*-sun-*)		gdb_host=sun3os4 ;;
+m68*-*-openbsd*)	gdb_host=obsd ;;
 
-# OBSOLETE mips-dec-*)		gdb_host=decstation ;;
-# OBSOLETE mips-little-*)		gdb_host=littlemips ;;
+m88*-*-openbsd*)	gdb_host=obsd ;;
+
 mips-sgi-irix5*)	gdb_host=irix5 ;;
 mips-sgi-irix6*)	gdb_host=irix6 ;;
-# OBSOLETE mips-sony-*)		gdb_host=news-mips ;;
 mips*-*-linux*)		gdb_host=linux ;;
 mips*-*-netbsd*)	gdb_host=nbsd ;;
-# OBSOLETE mips-*-mach3*)		gdb_host=mipsm3 ;;
-# OBSOLETE mips-*-sysv4*)		gdb_host=mipsv4 ;;
-# OBSOLETE mips-*-sysv*)		gdb_host=riscos ;;
-# OBSOLETE mips-*-riscos*)		gdb_host=riscos ;;
 
 ns32k-*-netbsd*)	gdb_host=nbsdaout ;;
 
@@ -116,6 +105,7 @@
 powerpc-*-aix*)		gdb_host=aix432 ;;
 powerpc-*-linux*)	gdb_host=linux ;;
 powerpc-*-netbsd*)	gdb_host=nbsd ;;
+powerpc-*-openbsd*)	gdb_host=obsd ;;
 
 powerpc64-*-linux*)     gdb_host=ppc64-linux ;;
 
@@ -140,6 +130,9 @@
 			gdb_host=sol2
 			;;
 
+vax-*-netbsdelf*)	gdb_host=nbsdelf ;;
+vax-*-netbsd*)		gdb_host=nbsdaout ;;
+vax-*-openbsd*)		gdb_host=obsd ;;
 vax-*-bsd*)		gdb_host=vaxbsd ;;
 vax-*-ultrix2*)		gdb_host=vaxult2 ;;
 vax-*-ultrix*)		gdb_host=vaxult ;;
diff --git a/gdb/configure.in b/gdb/configure.in
index 07a289f..3daa12b 100644
--- a/gdb/configure.in
+++ b/gdb/configure.in
@@ -135,26 +135,6 @@
   fi
 fi
 
-# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
-# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
-# Makefile fragments.  That's why we need to have `Hcurses' before
-# `curses'.  I don't see why we should use HP curses if a more
-# standard curses is available, except that according to HP's
-# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
-# HP-UX 10.10 and 10.20.
-
-AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses pdcurses], [],
-    [AC_MSG_WARN([no curses library found])])
-
-# Check whether the wborder function is provided by the curses
-# library detected above.  In certain implementations such as
-# the HP/UX Hcurses for instance, this function is provided by an
-# additional library.  So if we did not find this function inside
-# the curses library, try some alternate libraries we know might
-# provide it.
-AC_SEARCH_LIBS(wborder, [cur_colr], [],
-    [AC_MSG_WARN([wborder function not found, tui will be disabled])])
-
 # Enable TUI.
 AC_ARG_ENABLE(tui,
 [  --enable-tui            enable full-screen terminal user interface (TUI)],
@@ -331,6 +311,32 @@
   AC_MSG_ERROR([no termcap library found])
 fi
 
+# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
+# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
+# Makefile fragments.  That's why we need to have `Hcurses' before
+# `curses'.  I don't see why we should use HP curses if a more
+# standard curses is available, except that according to HP's
+# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
+# HP-UX 10.10 and 10.20.
+
+# FIXME: ncurses does not work on native alphaev68-dec-osf5.1,
+# and probably other platforms.  AC_SEARCH_LIBS finds the library
+# in a place such as /usr/local/lib/libncurses.a, but does not
+# do anything to look for the matching include files.
+# -- chastain 2004-05-01
+
+AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses pdcurses], [],
+  [AC_MSG_WARN([no curses library found])])
+
+# Check whether the wborder function is provided by the curses
+# library detected above.  In certain implementations such as
+# the HP/UX Hcurses for instance, this function is provided by an
+# additional library.  So if we did not find this function inside
+# the curses library, try some alternate libraries we know might
+# provide it.
+AC_SEARCH_LIBS(wborder, [cur_colr], [],
+    [AC_MSG_WARN([wborder function not found, tui will be disabled])])
+
 # ------------------------- #
 # Checks for header files.  #
 # ------------------------- #
@@ -342,7 +348,7 @@
 AC_CHECK_HEADERS(machine/reg.h)
 AC_CHECK_HEADERS(nlist.h)
 AC_CHECK_HEADERS(poll.h sys/poll.h)
-AC_CHECK_HEADERS(proc_service.h thread_db.h)
+AC_CHECK_HEADERS(proc_service.h thread_db.h gnu/libc-version.h)
 AC_CHECK_HEADERS(stddef.h)
 AC_CHECK_HEADERS(stdlib.h)
 AC_CHECK_HEADERS(stdint.h)
@@ -488,6 +494,16 @@
     [Define to 1 if the regex included in libiberty should be used.])
 fi
 
+# See if <sys/proc.h> defines `struct thread' with a td_pcb member.
+AC_CACHE_CHECK([for td_pcb in struct thread], gdb_cv_struct_thread_td_pcb,
+[AC_TRY_COMPILE([#include <sys/param.h>
+#include <sys/proc.h>], [struct thread td; td.td_pcb;],
+gdb_cv_struct_thread_td_pcb=yes, gdb_cv_struct_thread_td_pcb=no)])
+if test $gdb_cv_struct_thread_td_pcb = yes; then
+  AC_DEFINE(HAVE_STRUCT_THREAD_TD_PCB, 1,
+            [Define to 1 if your system has td_pcb in struct thread.])
+fi
+
 # See if <machine/reg.h> degines `struct reg'.
 AC_CACHE_CHECK([for struct reg in machine/reg.h], gdb_cv_struct_reg,
 [AC_TRY_COMPILE([#include <sys/types.h>
@@ -622,6 +638,10 @@
   *-*-solaris2.[[6789]])
       AC_DEFINE(NEW_PROC_API)
       ;;
+  mips-sgi-irix5*)
+      # Work around <sys/proc.h> needing _KMEMUSER problem on IRIX 5.
+      AC_DEFINE([_KMEMUSER], 1)
+      ;;
   esac
 fi
 
@@ -852,6 +872,7 @@
 
     LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc
     AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=])
+    LDFLAGS="${SAVE_LDFLAGS}"
   ])
   CONFIG_LDFLAGS="${CONFIG_LDFLAGS} ${gdb_cv_bigtoc}"
   ;;
@@ -1114,7 +1135,14 @@
 AC_SUBST(WIN32LIBS)
 AC_SUBST(WIN32LDAPP)
 
-configdir="unix"
+case "${host}" in
+*-*-cygwin*)
+    configdir="win"
+    ;;
+*)
+    configdir="unix"
+    ;;
+esac
 
 GDBTKLIBS=
 if test "${enable_gdbtk}" = "yes"; then
@@ -1133,14 +1161,7 @@
 
 	# now look for Tcl library stuff
 
-	case "${host}" in
-	*-*-cygwin*)
-	    tcldir=../tcl/win/
-	    ;;
-	*)
-	    tcldir=../tcl/unix/
-	    ;;
-	esac
+	tcldir="../tcl/${configdir}/"
 
 	TCL_DEPS="${tcldir}${TCL_LIB_FILE}"
 
@@ -1156,14 +1177,7 @@
 
 	   # now look for Tk library stuff
 
-	   case "${host}" in
-	   *-*-cygwin*)
-	       tkdir=../tk/win/
-	       ;;
-	   *)
-	       tkdir=../tk/unix/
-	       ;;
-	   esac
+	   tkdir="../tk/${configdir}/"
 
 	   TK_DEPS="${tkdir}${TK_LIB_FILE}"
 
diff --git a/gdb/configure.tgt b/gdb/configure.tgt
index c13bb71..9d3063e 100644
--- a/gdb/configure.tgt
+++ b/gdb/configure.tgt
@@ -19,6 +19,7 @@
 i[34567]86*)		gdb_target_cpu=i386 ;;
 m68hc11*|m6811*)	gdb_target_cpu=m68hc11 ;;
 m68*)			gdb_target_cpu=m68k ;;
+m88*)			gdb_target_cpu=m88k ;;
 mips*)			gdb_target_cpu=mips ;;
 powerpc*)		gdb_target_cpu=powerpc ;;
 sparc*)			gdb_target_cpu=sparc ;;
@@ -74,29 +75,26 @@
 hppa*64*-*-hpux11*)	gdb_target=hppa64 ;;
 hppa*-*-hpux*)		gdb_target=hppahpux ;;
 hppa*-*-hiux*)		gdb_target=hppahpux ;;
+hppa*-*-linux*)		gdb_target=linux ;;
+hppa*-*-openbsd*)	gdb_target=obsd ;;
 hppa*-*-*)		gdb_target=hppa ;;
 
 i[34567]86-ncr-*)	gdb_target=ncr3000 ;;
 i[34567]86-*-netbsd* | i[34567]86-*-knetbsd*-gnu)
 			gdb_target=nbsd ;;
 i[34567]86-*-openbsd*)	gdb_target=obsd ;;
-i[34567]86-*-go32*)	gdb_target=i386aout ;;
-i[34567]86-*-msdosdjgpp*) gdb_target=go32 ;;
 i[34567]86-*-nto*)	gdb_target=nto ;;
 i[34567]86-*-lynxos*)	gdb_target=i386lynx ;;
 i[34567]86-*-solaris*)	gdb_target=i386sol2 ;;
-i[34567]86-*-sco*)	gdb_target=i386v ;;
-i[34567]86-*-sysv*)	gdb_target=i386v ;;
 i[34567]86-*-linux*)	gdb_target=linux
 			build_gdbserver=yes
 			;;
-i[34567]86-*-isc*)	gdb_target=i386v ;;
 i[34567]86-*-gnu*)	gdb_target=i386gnu ;;
-i[34567]86-*-netware*)	gdb_target=i386nw
-		configdirs="${configdirs} nlm" ;;
+i[34567]86-*-netware*)	gdb_target=i386
+			configdirs="${configdirs} nlm" ;;
 i[34567]86-*-cygwin*)	gdb_target=cygwin  ;;
 i[34567]86-*-vxworks*)	gdb_target=vxworks ;;
-i[34567]86-*-*)		gdb_target=embed ;;
+i[34567]86-*-*)		gdb_target=i386 ;;
 
 ia64-*-aix*)		gdb_target=aix ;;
 ia64-*-linux*)		gdb_target=linux
@@ -108,13 +106,7 @@
 
 m68hc11*-*-*|m6811*-*-*)	gdb_target=m68hc11 ;;
 
-# OBSOLETE m68000-*-sunos3*)	gdb_target=sun2os3 ;;
-# OBSOLETE m68000-*-sunos4*)	gdb_target=sun2os4 ;;
-
-# OBSOLETE m68*-bull-sysv*)	gdb_target=dpx2 ;;
-# OBSOLETE m68*-att-*)		gdb_target=3b1 ;;
 m68*-cisco*-*)		gdb_target=cisco ;;
-# OBSOLETE m68*-motorola-*)	gdb_target=delta68 ;;
 m68*-netx-*)		gdb_target=vxworks68 ;;
 m68*-tandem-*)		gdb_target=st2000 ;;
 m68*-*-aout*)		gdb_target=monitor ;;
@@ -123,15 +115,14 @@
 m68*-*-linux*)		gdb_target=linux
 			build_gdbserver=yes
 			;;
-# OBSOLETE m68*-*-lynxos*)		gdb_target=m68klynx ;;
-m68*-*-netbsd*)		gdb_target=nbsdaout ;;
+m68*-*-netbsd*)		gdb_target=nbsd ;;
+m68*-*-openbsd*)	gdb_target=obsd ;;
 m68*-*-os68k*)		gdb_target=os68k ;;
-# OBSOLETE m68*-*-sunos3*)		gdb_target=sun3os3 ;;
-# OBSOLETE m68*-*-sunos4*)		gdb_target=sun3os4 ;;
-# OBSOLETE m68*-*-sysv4*)		gdb_target=m68kv4 ;;
 m68*-*-uclinux*)	gdb_target=monitor ;;
 m68*-*-vxworks*)	gdb_target=vxworks68 ;;
 
+m88*-*-openbsd*)	gdb_target=obsd ;;
+
 mcore*-*-*)		gdb_target=mcore ;;
 
 mips*-*-pe)		gdb_target=wince ;;
@@ -141,7 +132,6 @@
 			build_gdbserver=yes
 			;;
 mips*-*-netbsd*)	gdb_target=nbsd ;;
-# OBSOLETE mips*-*-sysv4*)		gdb_target=mipsv4 ;;
 mips*-*-vxworks*)       gdb_target=vxmips ;;
 mips*-*-*)		gdb_target=embed ;;
 
@@ -150,6 +140,7 @@
 ns32k-*-netbsd*)	gdb_target=nbsdaout ;;
 
 powerpc-*-netbsd*)	gdb_target=nbsd ;;
+powerpc-*-openbsd*)	gdb_target=obsd ;;
 powerpc-*-aix*)		gdb_target=aix ;;
 powerpc-*-linux*)	gdb_target=linux
 			build_gdbserver=yes
@@ -201,6 +192,8 @@
 
 xstormy16-*-*)          gdb_target=xstormy16 ;;
 
+vax-*-netbsd*)		gdb_target=nbsd ;;
+vax-*-openbsd*)		gdb_target=nbsd ;;
 vax-*-*)		gdb_target=vax ;;
 
 v850*-*-*)		gdb_target=v850
diff --git a/gdb/core-aout.c b/gdb/core-aout.c
index 0329302..7702d78 100644
--- a/gdb/core-aout.c
+++ b/gdb/core-aout.c
@@ -142,5 +142,5 @@
 void
 _initialize_core_aout (void)
 {
-  add_core_fns (&aout_core_fns);
+  deprecated_add_core_fns (&aout_core_fns);
 }
diff --git a/gdb/core-regset.c b/gdb/core-regset.c
index 0600837..529c51f 100644
--- a/gdb/core-regset.c
+++ b/gdb/core-regset.c
@@ -115,5 +115,5 @@
 void
 _initialize_core_regset (void)
 {
-  add_core_fns (&regset_core_fns);
+  deprecated_add_core_fns (&regset_core_fns);
 }
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 572b448..0ca469b 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -41,17 +41,18 @@
 extern void _initialize_core (void);
 static void call_extra_exec_file_hooks (char *filename);
 
-/* You can have any number of hooks for `exec_file_command' command to call.
-   If there's only one hook, it is set in exec_file_display hook.
-   If there are two or more hooks, they are set in exec_file_extra_hooks[],
-   and exec_file_display_hook is set to a function that calls all of them.
-   This extra complexity is needed to preserve compatibility with
-   old code that assumed that only one hook could be set, and which called
-   exec_file_display_hook directly.  */
+/* You can have any number of hooks for `exec_file_command' command to
+   call.  If there's only one hook, it is set in exec_file_display
+   hook.  If there are two or more hooks, they are set in
+   exec_file_extra_hooks[], and deprecated_exec_file_display_hook is
+   set to a function that calls all of them.  This extra complexity is
+   needed to preserve compatibility with old code that assumed that
+   only one hook could be set, and which called
+   deprecated_exec_file_display_hook directly.  */
 
 typedef void (*hook_type) (char *);
 
-hook_type exec_file_display_hook;	/* the original hook */
+hook_type deprecated_exec_file_display_hook;	/* the original hook */
 static hook_type *exec_file_extra_hooks;	/* array of additional hooks */
 static int exec_file_hook_count = 0;	/* size of array */
 
@@ -100,7 +101,7 @@
 {
   hook_type *new_array;
 
-  if (exec_file_display_hook != NULL)
+  if (deprecated_exec_file_display_hook != NULL)
     {
       /* There's already a hook installed.  Arrange to have both it
        * and the subsequent hooks called. */
@@ -108,8 +109,8 @@
 	{
 	  /* If this is the first extra hook, initialize the hook array. */
 	  exec_file_extra_hooks = (hook_type *) xmalloc (sizeof (hook_type));
-	  exec_file_extra_hooks[0] = exec_file_display_hook;
-	  exec_file_display_hook = call_extra_exec_file_hooks;
+	  exec_file_extra_hooks[0] = deprecated_exec_file_display_hook;
+	  deprecated_exec_file_display_hook = call_extra_exec_file_hooks;
 	  exec_file_hook_count = 1;
 	}
 
@@ -124,7 +125,7 @@
       exec_file_extra_hooks[exec_file_hook_count - 1] = hook;
     }
   else
-    exec_file_display_hook = hook;
+    deprecated_exec_file_display_hook = hook;
 }
 
 /* The exec file must be closed before running an inferior.
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 403cfa3..a9d2132 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -43,16 +43,20 @@
 #include "symfile.h"
 #include "exec.h"
 #include "readline/readline.h"
-
+#include "observer.h"
 #include "gdb_assert.h"
 
 #ifndef O_BINARY
 #define O_BINARY 0
 #endif
 
-/* List of all available core_fns.  On gdb startup, each core file register
-   reader calls add_core_fns() to register information on each core format it
-   is prepared to read. */
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
+/* List of all available core_fns.  On gdb startup, each core file
+   register reader calls deprecated_add_core_fns() to register
+   information on each core format it is prepared to read.  */
 
 static struct core_fns *core_file_fns = NULL;
 
@@ -104,7 +108,7 @@
    handle. */
 
 void
-add_core_fns (struct core_fns *cf)
+deprecated_add_core_fns (struct core_fns *cf)
 {
   cf->next = core_file_fns;
   core_file_fns = cf;
@@ -280,6 +284,7 @@
   bfd *temp_bfd;
   int ontop;
   int scratch_chan;
+  int flags;
 
   target_preopen (from_tty);
   if (!filename)
@@ -299,7 +304,12 @@
 
   old_chain = make_cleanup (xfree, filename);
 
-  scratch_chan = open (filename, O_BINARY | ( write_files ? O_RDWR : O_RDONLY ), 0);
+  flags = O_BINARY | O_LARGEFILE;
+  if (write_files)
+    flags |= O_RDWR;
+  else
+    flags |= O_RDONLY;
+  scratch_chan = open (filename, flags, 0);
   if (scratch_chan < 0)
     perror_with_name (filename);
 
@@ -355,6 +365,10 @@
   ontop = !push_target (&core_ops);
   discard_cleanups (old_chain);
 
+  /* This is done first, before anything has a chance to query the
+     inferior for information such as symbols.  */
+  observer_notify_inferior_created (&core_ops, from_tty);
+
   p = bfd_core_file_failing_command (core_bfd);
   if (p)
     printf_filtered ("Core was generated by `%s'.\n", p);
@@ -388,8 +402,7 @@
       /* Now, set up the frame cache, and print the top of stack.  */
       flush_cached_frames ();
       select_frame (get_current_frame ());
-      print_stack_frame (deprecated_selected_frame,
-			 frame_relative_level (deprecated_selected_frame), 1);
+      print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC);
     }
   else
     {
@@ -552,9 +565,9 @@
 	  size -= offset;
 	  if (size > len)
 	    size = len;
-	  if (size > 0 &&
-	      ! bfd_get_section_contents (core_bfd, section, readbuf,
-					  (file_ptr) offset, size))
+	  if (size > 0
+	      && !bfd_get_section_contents (core_bfd, section, readbuf,
+					    (file_ptr) offset, size))
 	    {
 	      warning ("Couldn't read NT_AUXV note in core file.");
 	      return -1;
@@ -564,6 +577,38 @@
 	}
       return -1;
 
+    case TARGET_OBJECT_WCOOKIE:
+      if (readbuf)
+	{
+	  /* When the StackGhost cookie is stored in core file, BFD
+	     represents this with a fake section called ".wcookie".  */
+
+	  struct bfd_section *section;
+	  bfd_size_type size;
+	  char *contents;
+
+	  section = bfd_get_section_by_name (core_bfd, ".wcookie");
+	  if (section == NULL)
+	    return -1;
+
+	  size = bfd_section_size (core_bfd, section);
+	  if (offset >= size)
+	    return 0;
+	  size -= offset;
+	  if (size > len)
+	    size = len;
+	  if (size > 0
+	      && !bfd_get_section_contents (core_bfd, section, readbuf,
+					    (file_ptr) offset, size))
+	    {
+	      warning ("Couldn't read StackGhost cookie in core file.");
+	      return -1;
+	    }
+
+	  return size;
+	}
+      return -1;
+
     default:
       if (ops->beneath != NULL)
 	return ops->beneath->to_xfer_partial (ops->beneath, object, annex,
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 4344545..a182dd9 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -148,7 +148,7 @@
 /* Return the name of the class containing method PHYSNAME.  */
 
 char *
-class_name_from_physname (const char *physname)
+cp_class_name_from_physname (const char *physname)
 {
   char *ret = NULL;
   const char *end;
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index bbf911a..569aeac 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -52,7 +52,7 @@
 
 /* Functions from cp-support.c.  */
 
-extern char *class_name_from_physname (const char *physname);
+extern char *cp_class_name_from_physname (const char *physname);
 
 extern char *method_name_from_physname (const char *physname);
 
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 42a48f5..53e3ce9 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -36,10 +36,6 @@
 #include "cp-abi.h"
 #include "valprint.h"
 
-/* Indication of presence of HP-compiled object files */
-extern int hp_som_som_object_present;	/* defined in symtab.c */
-
-
 int vtblprint;			/* Controls printing of vtbl's */
 int objectprint;		/* Controls looking up an object's derived type
 				   using what we find in its vtables.  */
@@ -115,7 +111,7 @@
       if (sym == 0)
 	{
 	  /* 1997-08-01 Currently unsupported with HP aCC */
-	  if (hp_som_som_object_present)
+	  if (deprecated_hp_som_som_object_present)
 	    {
 	      fputs_filtered ("?? <not supported with HP aCC>", stream);
 	      return;
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 0ebfeda..87d2382 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -511,7 +511,7 @@
 }
 
 static CORE_ADDR
-cris_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		      struct regcache *regcache, CORE_ADDR bp_addr,
 		      int nargs, struct value **args, CORE_ADDR sp,
 		      int struct_return, CORE_ADDR struct_addr)
@@ -3645,7 +3645,7 @@
                "Note that this displays the address after the jump to the "
                "subroutine.", &cmdlist);
   
-  add_core_fns (&cris_elf_core_fns);
+  deprecated_add_core_fns (&cris_elf_core_fns);
   
 }
 
@@ -3795,7 +3795,7 @@
   set_gdbarch_return_value (gdbarch, cris_return_value);
   set_gdbarch_deprecated_reg_struct_has_addr (gdbarch, 
 					      cris_reg_struct_has_addr);
-  set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, always_use_struct_convention);
 
   /* There are 32 registers (some of which may not be implemented).  */
   set_gdbarch_num_regs (gdbarch, 32);
@@ -3857,15 +3857,9 @@
   /* The length of the registers in the actual machine representation.  */
   set_gdbarch_deprecated_register_raw_size (gdbarch, cris_register_size);
   
-  /* The largest value DEPRECATED_REGISTER_RAW_SIZE can have.  */
-  set_gdbarch_deprecated_max_register_raw_size (gdbarch, 32);
-  
   /* The length of the registers in the program's representation.  */
   set_gdbarch_deprecated_register_virtual_size (gdbarch, cris_register_size);
   
-  /* The largest value DEPRECATED_REGISTER_VIRTUAL_SIZE can have.  */
-  set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 32);
-
   set_gdbarch_deprecated_register_virtual_type (gdbarch, cris_register_virtual_type);
   
   /* Dummy frame functions.  */
diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c
index 4b977c6..8bb2aa5 100644
--- a/gdb/d10v-tdep.c
+++ b/gdb/d10v-tdep.c
@@ -953,7 +953,7 @@
 }
 
 static CORE_ADDR
-d10v_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+d10v_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		      struct regcache *regcache, CORE_ADDR bp_addr,
 		      int nargs, struct value **args, CORE_ADDR sp, 
 		      int struct_return, CORE_ADDR struct_addr)
@@ -1542,8 +1542,8 @@
 {
   register_gdbarch_init (bfd_arch_d10v, d10v_gdbarch_init);
 
-  target_resume_hook = d10v_eva_prepare_to_trace;
-  target_wait_loop_hook = d10v_eva_get_trace_data;
+  deprecated_target_resume_hook = d10v_eva_prepare_to_trace;
+  deprecated_target_wait_loop_hook = d10v_eva_get_trace_data;
 
   deprecate_cmd (add_com ("regs", class_vars, show_regs, 
 			  "Print all registers"),
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index efbbf2a..8b1286f 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1358,12 +1358,6 @@
 	      || (namestring[(nsl = strlen (namestring)) - 1] == 'o'
 		  && namestring[nsl - 2] == '.'))
 	  {
-	    if (objfile->ei.entry_point < nlist.n_value &&
-		objfile->ei.entry_point >= last_o_file_start)
-	      {
-		objfile->ei.deprecated_entry_file_lowpc = last_o_file_start;
-		objfile->ei.deprecated_entry_file_highpc = nlist.n_value;
-	      }
 	    if (past_first_source_file && pst
 		/* The gould NP1 uses low values for .o and -l symbols
 		   which are not the address.  */
@@ -1463,6 +1457,7 @@
 	    static int prev_so_symnum = -10;
 	    static int first_so_symnum;
 	    char *p;
+	    static char *dirname_nso;
 	    int prev_textlow_not_set;
 
 	    valu = nlist.n_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
@@ -1520,18 +1515,27 @@
 
 	    p = strrchr (namestring, '/');
 	    if (p && *(p + 1) == '\000')
-	      continue;		/* Simply ignore directory name SOs */
+	      {
+		/* Save the directory name SOs locally, then save it into
+		   the psymtab when it's created below. */
+	        dirname_nso = namestring;
+	        continue;		
+	      }
 
 	    /* Some other compilers (C++ ones in particular) emit useless
 	       SOs for non-existant .c files.  We ignore all subsequent SOs that
 	       immediately follow the first.  */
 
 	    if (!pst)
+	      {
 	      pst = start_psymtab (objfile,
 				   namestring, valu,
 				   first_so_symnum * symbol_size,
 				   objfile->global_psymbols.next,
 				   objfile->static_psymbols.next);
+		pst->dirname = dirname_nso;
+		dirname_nso = NULL;
+	      }
 	    continue;
 	  }
 
@@ -2099,16 +2103,6 @@
     }
 
   /* If there's stuff to be cleaned up, clean it up.  */
-  if (DBX_SYMCOUNT (objfile) > 0	/* We have some syms */
-      /*FIXME, does this have a bug at start address 0? */
-      && last_o_file_start
-      && objfile->ei.entry_point < nlist.n_value
-      && objfile->ei.entry_point >= last_o_file_start)
-    {
-      objfile->ei.deprecated_entry_file_lowpc = last_o_file_start;
-      objfile->ei.deprecated_entry_file_highpc = nlist.n_value;
-    }
-
   if (pst)
     {
       /* Don't set pst->texthigh lower than it already is.  */
@@ -2654,17 +2648,6 @@
 		    struct section_offsets *section_offsets,
 		    struct objfile *objfile)
 {
-#ifdef SUN_FIXED_LBRAC_BUG
-  /* If SUN_FIXED_LBRAC_BUG is defined, then it tells us whether we need
-     to correct the address of N_LBRAC's.  If it is not defined, then
-     we never need to correct the addresses.  */
-
-  /* This records the last pc address we've seen.  We depend on there being
-     an SLINE or FUN or SO before the first LBRAC, since the variable does
-     not get reset in between reads of different symbol files.  */
-  static CORE_ADDR last_pc_address;
-#endif
-
   struct context_stack *new;
   /* This remembers the address of the start of a function.  It is used
      because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries are
@@ -2772,14 +2755,6 @@
 	   N_SO, the linker did not relocate them (sigh).  */
 	valu += last_source_start_addr;
 
-#ifdef SUN_FIXED_LBRAC_BUG
-      if (!SUN_FIXED_LBRAC_BUG && valu < last_pc_address)
-	{
-	  /* Patch current LBRAC pc value to match last handy pc value */
-	  complaint (&symfile_complaints, "bad block start address patched");
-	  valu = last_pc_address;
-	}
-#endif
       new = push_context (desc, valu);
       break;
 
@@ -2893,18 +2868,6 @@
 
       n_opt_found = 0;
 
-#ifdef SUN_FIXED_LBRAC_BUG
-      last_pc_address = valu;	/* Save for SunOS bug circumcision */
-#endif
-
-#ifdef PCC_SOL_BROKEN
-      /* pcc bug, occasionally puts out SO for SOL.  */
-      if (context_stack_depth > 0)
-	{
-	  start_subfile (name, NULL);
-	  break;
-	}
-#endif
       if (last_source_file)
 	{
 	  /* Check if previous symbol was also an N_SO (with some
@@ -2965,9 +2928,6 @@
       /* Relocate for dynamic loading and for ELF acc fn-relative syms.  */
       valu += function_start_offset;
 
-#ifdef SUN_FIXED_LBRAC_BUG
-      last_pc_address = valu;	/* Save for SunOS bug circumcision */
-#endif
       /* If this is the first SLINE note in the function, record it at
 	 the start of the function instead of at the listed location.  */
       if (within_function && sline_found_in_function == 0)
@@ -3127,56 +3087,6 @@
 		}
 #endif
 
-#ifdef SUN_FIXED_LBRAC_BUG
-	      /* The Sun acc compiler, under SunOS4, puts out
-	         functions with N_GSYM or N_STSYM.  The problem is
-	         that the address of the symbol is no good (for N_GSYM
-	         it doesn't even attept an address; for N_STSYM it
-	         puts out an address but then it gets relocated
-	         relative to the data segment, not the text segment).
-	         Currently we can't fix this up later as we do for
-	         some types of symbol in scan_file_globals.
-	         Fortunately we do have a way of finding the address -
-	         we know that the value in last_pc_address is either
-	         the one we want (if we're dealing with the first
-	         function in an object file), or somewhere in the
-	         previous function. This means that we can use the
-	         minimal symbol table to get the address.  */
-
-	      /* Starting with release 3.0, the Sun acc compiler,
-	         under SunOS4, puts out functions with N_FUN and a value
-	         of zero. This gets relocated to the start of the text
-	         segment of the module, which is no good either.
-	         Under SunOS4 we can deal with this as N_SLINE and N_SO
-	         entries contain valid absolute addresses.
-	         Release 3.0 acc also puts out N_OPT entries, which makes
-	         it possible to discern acc from cc or gcc.  */
-
-	      if (type == N_GSYM || type == N_STSYM
-		  || (type == N_FUN
-		      && n_opt_found && !block_address_function_relative))
-		{
-		  struct minimal_symbol *m;
-		  int l = colon_pos - name;
-
-		  m = lookup_minimal_symbol_by_pc (last_pc_address);
-		  if (m && strncmp (DEPRECATED_SYMBOL_NAME (m), name, l) == 0
-		      && DEPRECATED_SYMBOL_NAME (m)[l] == '\0')
-		    /* last_pc_address was in this function */
-		    valu = SYMBOL_VALUE (m);
-		  else if (m && DEPRECATED_SYMBOL_NAME (m + 1)
-			   && strncmp (DEPRECATED_SYMBOL_NAME (m + 1), name, l) == 0
-			   && DEPRECATED_SYMBOL_NAME (m + 1)[l] == '\0')
-		    /* last_pc_address was in last function */
-		    valu = SYMBOL_VALUE (m + 1);
-		  else
-		    /* Not found - use last_pc_address (for finish_block) */
-		    valu = last_pc_address;
-		}
-
-	      last_pc_address = valu;	/* Save for SunOS bug circumcision */
-#endif
-
 	      if (block_address_function_relative)
 		/* For Solaris 2.0 compilers, the block addresses and
 		   N_SLINE's are relative to the start of the
@@ -3392,8 +3302,7 @@
 }
 
 /* Scan and build partial symbols for an ELF symbol file.
-   This ELF file has already been processed to get its minimal symbols,
-   and any DWARF symbols that were in it.
+   This ELF file has already been processed to get its minimal symbols.
 
    This routine is the equivalent of dbx_symfile_init and dbx_symfile_read
    rolled into one.
diff --git a/gdb/defs.h b/gdb/defs.h
index e49f9e0..8ccad52 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -198,7 +198,7 @@
 #else
 #define QUIT { \
   if (quit_flag) quit (); \
-  if (interactive_hook) interactive_hook (); \
+  if (deprecated_interactive_hook) deprecated_interactive_hook (); \
 }
 #endif
 
@@ -250,7 +250,19 @@
      should be stored.  While typically, and historically, used for
      large structs, this is convention is applied to values of many
      different types.  */
-  RETURN_VALUE_STRUCT_CONVENTION
+  RETURN_VALUE_STRUCT_CONVENTION,
+  /* Like the "struct return convention" above, but where the ABI
+     guarantees that the called function stores the address at which
+     the value being returned is stored in a well-defined location,
+     such as a register or memory slot in the stack frame.  Don't use
+     this if the ABI doesn't explicitly guarantees this.  */
+  RETURN_VALUE_ABI_RETURNS_ADDRESS,
+  /* Like the "struct return convention" above, but where the ABI
+     guarantees that the address at which the value being returned is
+     stored will be available in a well-defined location, such as a
+     register or memory slot in the stack frame.  Don't use this if
+     the ABI doesn't explicitly guarantees this.  */
+  RETURN_VALUE_ABI_PRESERVES_ADDRESS,
 };
 
 /* the cleanup list records things that have to be undone
@@ -327,8 +339,6 @@
 
 extern int inside_entry_func (struct frame_info *this_frame);
 
-extern int deprecated_inside_entry_file (CORE_ADDR addr);
-
 extern int inside_main_func (CORE_ADDR pc);
 
 /* From utils.c */
@@ -616,8 +626,6 @@
 
 extern void init_last_source_visited (void);
 
-extern char *symtab_to_filename (struct symtab *);
-
 /* From exec.c */
 
 extern void exec_set_section_offsets (bfd_signed_vma text_off,
@@ -884,8 +892,10 @@
 extern void xasprintf (char **ret, const char *format, ...) ATTR_FORMAT (printf, 2, 3);
 extern void xvasprintf (char **ret, const char *format, va_list ap);
 
-/* Like asprintf, but return the string, throw an error if no memory.  */
+/* Like asprintf and vasprintf, but return the string, throw an error
+   if no memory.  */
 extern char *xstrprintf (const char *format, ...) ATTR_FORMAT (printf, 1, 2);
+extern char *xstrvprintf (const char *format, va_list ap);
 
 extern int parse_escape (char **);
 
@@ -1197,9 +1207,10 @@
 extern char *interpreter_p;
 
 /* If a given interpreter matches INTERPRETER_P then it should update
-   command_loop_hook and init_ui_hook with the per-interpreter
-   implementation. */
-/* FIXME: command_loop_hook and init_ui_hook should be moved here. */
+   deprecated_command_loop_hook and deprecated_init_ui_hook with the
+   per-interpreter implementation.  */
+/* FIXME: deprecated_command_loop_hook and deprecated_init_ui_hook
+   should be moved here. */
 
 struct target_waitstatus;
 struct cmd_list_element;
@@ -1208,46 +1219,51 @@
    event-loop) be enabled? */
 extern int event_loop_p;
 
-extern void (*init_ui_hook) (char *argv0);
-extern void (*command_loop_hook) (void);
-extern void (*show_load_progress) (const char *section,
-				   unsigned long section_sent, 
-				   unsigned long section_size, 
-				   unsigned long total_sent, 
-				   unsigned long total_size);
-extern void (*print_frame_info_listing_hook) (struct symtab * s,
-					      int line, int stopline,
-					      int noerror);
+extern void (*deprecated_pre_add_symbol_hook) (const char *);
+extern void (*deprecated_post_add_symbol_hook) (void);
+extern void (*selected_frame_level_changed_hook) (int);
+extern int (*deprecated_ui_loop_hook) (int signo);
+extern void (*deprecated_init_ui_hook) (char *argv0);
+extern void (*deprecated_command_loop_hook) (void);
+extern void (*deprecated_show_load_progress) (const char *section,
+					      unsigned long section_sent, 
+					      unsigned long section_size, 
+					      unsigned long total_sent, 
+					      unsigned long total_size);
+extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
+							 int line, int stopline,
+							 int noerror);
 extern struct frame_info *parse_frame_specification (char *frame_exp);
-extern int (*query_hook) (const char *, va_list);
-extern void (*warning_hook) (const char *, va_list);
-extern void (*flush_hook) (struct ui_file * stream);
-extern void (*create_breakpoint_hook) (struct breakpoint * b);
-extern void (*delete_breakpoint_hook) (struct breakpoint * bpt);
-extern void (*modify_breakpoint_hook) (struct breakpoint * bpt);
-extern void (*interactive_hook) (void);
-extern void (*registers_changed_hook) (void);
-extern void (*readline_begin_hook) (char *,...);
-extern char *(*readline_hook) (char *);
-extern void (*readline_end_hook) (void);
-extern void (*register_changed_hook) (int regno);
-extern void (*memory_changed_hook) (CORE_ADDR addr, int len);
-extern void (*context_hook) (int);
-extern ptid_t (*target_wait_hook) (ptid_t ptid,
+extern int (*deprecated_query_hook) (const char *, va_list);
+extern void (*deprecated_warning_hook) (const char *, va_list);
+extern void (*deprecated_flush_hook) (struct ui_file * stream);
+extern void (*deprecated_create_breakpoint_hook) (struct breakpoint * b);
+extern void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt);
+extern void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt);
+extern void (*deprecated_interactive_hook) (void);
+extern void (*deprecated_registers_changed_hook) (void);
+extern void (*deprecated_readline_begin_hook) (char *,...);
+extern char *(*deprecated_readline_hook) (char *);
+extern void (*deprecated_readline_end_hook) (void);
+extern void (*deprecated_register_changed_hook) (int regno);
+extern void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len);
+extern void (*deprecated_context_hook) (int);
+extern ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
                                          struct target_waitstatus * status);
 
-extern void (*attach_hook) (void);
-extern void (*detach_hook) (void);
-extern void (*call_command_hook) (struct cmd_list_element * c,
-				  char *cmd, int from_tty);
+extern void (*deprecated_attach_hook) (void);
+extern void (*deprecated_detach_hook) (void);
+extern void (*deprecated_call_command_hook) (struct cmd_list_element * c,
+					     char *cmd, int from_tty);
 
-extern void (*set_hook) (struct cmd_list_element * c);
+extern void (*deprecated_set_hook) (struct cmd_list_element * c);
 
-extern NORETURN void (*error_hook) (void) ATTR_NORETURN;
+extern NORETURN void (*deprecated_error_hook) (void) ATTR_NORETURN;
 
-extern void (*error_begin_hook) (void);
+extern void (*deprecated_error_begin_hook) (void);
 
-extern int (*ui_load_progress_hook) (const char *section, unsigned long num);
+extern int (*deprecated_ui_load_progress_hook) (const char *section,
+						unsigned long num);
 
 
 /* Inhibit window interface if non-zero. */
diff --git a/gdb/delta68-nat.c b/gdb/delta68-nat.c
deleted file mode 100644
index e74a51b..0000000
--- a/gdb/delta68-nat.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Functions specific to running gdb native on a Motorola Delta Series sysV68.
-   Copyright 1993, 1996, 1998, 2000 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include "defs.h"
-#include <sys/signal.h>		/* for MAXSIG in sys/user.h */
-#include <sys/types.h>		/* for ushort in sys/dir.h */
-#include <sys/dir.h>		/* for struct direct in sys/user.h */
-#include <sys/user.h>
-
-#include <nlist.h>
-
-#if !defined (offsetof)
-#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
-#endif
-
-/* Return the address in the core dump or inferior of register REGNO.
-   BLOCKEND is the address of the end of the user structure.  */
-
-CORE_ADDR
-register_addr (int regno, CORE_ADDR blockend)
-{
-  static int sysv68reg[] =
-  {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, -1, 15, 16};
-
-  if (regno >= 0 && regno < sizeof (sysv68reg) / sizeof (sysv68reg[0]))
-    return blockend + sysv68reg[regno] * 4;
-  else if (regno < FPC_REGNUM)
-    return offsetof (struct user, u_fpu.regs.reg[regno - FP0_REGNUM][0]);
-  else if (regno == FPC_REGNUM)
-    return offsetof (struct user, u_fpu.regs.control);
-  else if (regno == FPS_REGNUM)
-    return offsetof (struct user, u_fpu.regs.status);
-  else if (regno == FPI_REGNUM)
-    return offsetof (struct user, u_fpu.regs.iaddr);
-  else
-    {
-      fprintf_unfiltered (gdb_stderr, "\
-Internal error: invalid register number %d in REGISTER_U_ADDR\n",
-			  regno);
-      return blockend;
-    }
-}
-
-CORE_ADDR kernel_u_addr;
-
-/* Read the value of the u area from the kernel.  */
-void
-_initialize_delta68_nat (void)
-{
-  struct nlist nl[2];
-
-  nl[0].n_name = "u";
-  nl[1].n_name = NULL;
-  if (nlist ("/sysV68", nl) == 0 && nl[0].n_scnum != 0)
-    kernel_u_addr = nl[0].n_value;
-  else
-    {
-      perror ("Cannot get kernel u area address");
-      exit (1);
-    }
-}
-
-clear_insn_cache (void)
-{
-#ifdef MCT_TEXT			/* in sys/signal.h on sysV68 R3V7.1 */
-  memctl (0, 4096, MCT_TEXT);
-#endif
-}
-
-kernel_u_size (void)
-{
-  return sizeof (struct user);
-}
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index 3802000..09851ef 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -99,7 +99,7 @@
     /* Symbols are stored in a fixed-size array.  */
     DICT_LINEAR,
     /* Symbols are stored in an expandable array.  */
-    DICT_LINEAR_EXPANDABLE,
+    DICT_LINEAR_EXPANDABLE
   };
 
 /* The virtual function table.  */
@@ -636,7 +636,7 @@
        sym = sym->hash_next)
     {
       /* Warning: the order of arguments to strcmp_iw matters!  */
-      if (strcmp_iw (SYMBOL_NATURAL_NAME (sym), name) == 0)
+      if (strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0)
 	{
 	  break;
 	}
@@ -656,7 +656,7 @@
        next != NULL;
        next = next->hash_next)
     {
-      if (strcmp_iw (SYMBOL_NATURAL_NAME (next), name) == 0)
+      if (strcmp_iw (SYMBOL_SEARCH_NAME (next), name) == 0)
 	break;
     }
 
@@ -674,7 +674,7 @@
   unsigned int hash_index;
   struct symbol **buckets = DICT_HASHED_BUCKETS (dict);
 
-  hash_index = (msymbol_hash_iw (SYMBOL_NATURAL_NAME (sym))
+  hash_index = (msymbol_hash_iw (SYMBOL_SEARCH_NAME (sym))
 		% DICT_HASHED_NBUCKETS (dict));
   sym->hash_next = buckets[hash_index];
   buckets[hash_index] = sym;
@@ -789,7 +789,7 @@
   for (i = DICT_ITERATOR_INDEX (iterator) + 1; i < nsyms; ++i)
     {
       sym = DICT_LINEAR_SYM (dict, i);
-      if (strcmp_iw (SYMBOL_NATURAL_NAME (sym), name) == 0)
+      if (strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0)
 	{
 	  retval = sym;
 	  break;
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 196c1fc..a98ffe0 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,151 @@
+2004-07-09  Eli Zaretskii  <eliz@gnu.org>
+
+	* gdb.texinfo: Fix @kindex entries so that multiple commands that
+	have the same prefix have only their prefix in the index.
+
+2004-07-03  Mark Kettenis  <kettenis@gnu.org>
+
+	* gdb.texinfo (BSD libkvm Interface): New node (section)
+	(Native): Add it to the menu.
+
+2004-07-01  Mark Kettenis  <kettenis@gnu.org>
+
+	* gdbint.texinfo (Target Architecture Definition): Remove
+	PCC_SOL_BROKEN.
+
+2004-06-24  Mark Kettenis  <kettenis@gnu.org>
+
+	* gdbint.texinfo (Target Architecture Definition): Remove
+	SUN_FIXED_LBRAC_BUG.
+
+2004-06-26  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbint.texinfo (Coding): Replace xasprintf with xstrprintf.
+
+2004-06-20  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbint.texinfo (Target Architecture Definition): Deprecate
+	USE_STRUCT_CONVENTION.
+
+2004-06-19  Michael Chastain  <mec.gnu@mindspring.com>
+
+	gdb.texinfo (Bug Reporting): Mention session recording,
+	with the script command or Emacs.
+
+2004-06-18  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbint.texinfo (Target Architecture Definition): Deprecate
+	FUNCTION_START_OFFSET.
+
+2004-06-14  Andrew Cagney  <cagney@gnu.org>
+
+	Based on changes from Karl Berry.
+	* gdb.texinfo: Do not use @sc in a direntry.
+	* stabs.texinfo: Change @dircateogry to "Software development".
+	* gdbint.texinfo, gdb.texinfo, annotate.texinfo: Ditto.
+
+2004-06-13  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbint.texinfo (Target Architecture Definition): Delete
+	description of RETURN_VALUE_ON_STACK.
+
+2004-06-09  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbint.texinfo (Native Debugging): Restore "@table @code"
+	deleted by previous patch.
+
+2004-06-08  Andrew Cagney  <cagney@gnu.org>
+
+	* gdbint.texinfo (Native Debugging): Delete documentation on
+	ATTACH_DETACH.
+
+2004-06-06  Randolph Chung  <tausq@debian.org>
+
+	* gdb.texinfo (push_dummy_call): Use @code{struct value}.
+
+2004-06-06  Randolph Chung  <tausq@debian.org>
+
+	* gdb.texinfo (push_dummy_call): Update argument list to match 
+	the new push_dummy_call method signature.  Describe the function
+	argument.
+
+2004-05-24  Joel Brobecker  <brobecker@gnat.com>
+
+	* gdb.texinfo (Starting): Document new start command.
+
+2004-05-21  Andrew Cagney  <cagney@redhat.com>
+
+	* observer.texi (GDB Observers): Document "inferior_created".
+
+2004-05-08  Andrew Cagney  <cagney@redhat.com>
+
+	* gdbint.texinfo (Target Architecture Definition): Delete
+	description of DO_DEFERRED_STORES.
+
+	* gdbint.texinfo (Target Architecture Definition): Delete
+	references to DEPRECATED_FIX_CALL_DUMMY.
+
+	* gdbint.texinfo (Target Architecture Definition): Delete
+	description of DEPRECATED_CALL_DUMMY_WORDS,
+	DEPRECATED_SIZEOF_CALL_DUMMY_WORDS, and CALL_DUMMY.
+
+	* gdbint.texinfo (Target Architecture Definition): Delete
+	description of DEPRECATED_PUSH_DUMMY_FRAME.
+
+	* gdbint.texinfo (Target Architecture Definition): Delete
+	reference to DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET.
+
+2004-05-07  Andrew Cagney  <cagney@redhat.com>
+
+	* observer.texi (GDB Observers): Add "Debugging" section.  Include
+	cross reference to "set/show debug observer".
+	* gdb.texinfo (Debugging Output): Document "set/show debug
+	observer".
+
+2004-05-01  Andrew Cagney  <cagney@redhat.com>
+
+	* gdbint.texinfo (Target Architecture Definition): Delete
+	description of DEPRECATED_PC_IN_SIGTRAMP.
+
+2004-04-30  Andrew Cagney  <cagney@redhat.com>
+
+	* gdbint.texinfo (Target Architecture Definition): Delete
+	documentation for BELIEVE_PCC_PROMOTION_TYPE, no longer defined.
+
+2004-04-30  Orjan Friberg  <orjanf@axis.com>
+
+	* observer.texi (GDB Observers): Correct spelling.
+
+2004-04-26  Orjan Friberg  <orjanf@axis.com>
+
+	* observer.texi (GDB Observers): Add target_changed event.
+
+2004-04-08  Andrew Cagney  <cagney@redhat.com>
+
+	* observer.texi (GDB Observers): Rework, provide generic observer
+	definitions and then a list of observable events.
+
+2004-04-04  Andrew Cagney  <cagney@redhat.com>
+
+	* gdbint.texinfo (Host Definition): Delete reference to
+	NO_SIGINTERRUPT.
+
+2004-04-02  Andrew Cagney  <cagney@redhat.com>
+
+	* gdbint.texinfo (Target Architecture Definition): Delete
+	reference to DEPRECATED_CALL_DUMMY_LENGTH.
+
+2004-03-28  Stephane Carrez  <stcarrez@nerim.fr>
+
+	* gdb.texinfo (TUI Commands): Document tui reg commands.
+
+2004-03-26  Andrew Cagney  <cagney@redhat.com>
+
+	* gdb.texinfo (TUI): Delete reference to --enable-tui.  Mention
+	"gdbtui".
+	(Mode Options): Mention "gdbtui".  Use "Text" not "Terminal".
+	(Contributors): Mention both Text and Terminal User Interface.
+
 2004-03-23  Andrew Cagney  <cagney@redhat.com>
 
 	* gdbint.texinfo (Target Architecture Definition): Deprecate
diff --git a/gdb/doc/annotate.texinfo b/gdb/doc/annotate.texinfo
index 86b90cc..2fb79d3 100644
--- a/gdb/doc/annotate.texinfo
+++ b/gdb/doc/annotate.texinfo
@@ -4,7 +4,7 @@
 
 @c This is a dir.info fragment to support semi-automated addition of
 @c manuals to an info tree.
-@dircategory Programming & development tools.
+@dircategory Software development
 @direntry
 * Annotate: (annotate).                 The obsolete annotation interface.
 @end direntry
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index dac02de..329971f 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -38,9 +38,9 @@
 
 @c This is a dir.info fragment to support semi-automated addition of
 @c manuals to an info tree.
-@dircategory Programming & development tools.
+@dircategory Software development
 @direntry
-* Gdb: (gdb).                     The @sc{gnu} debugger.
+* Gdb: (gdb).                     The GNU debugger.
 @end direntry
 
 @ifinfo
@@ -445,10 +445,10 @@
 The following people at the Hewlett-Packard Company contributed
 support for the PA-RISC 2.0 architecture, HP-UX 10.20, 10.30, and 11.0
 (narrow mode), HP's implementation of kernel threads, HP's aC@t{++}
-compiler, and the terminal user interface: Ben Krepp, Richard Title,
-John Bishop, Susan Macchia, Kathy Mann, Satish Pai, India Paul, Steve
-Rehrauer, and Elena Zannoni.  Kim Haase provided HP-specific
-information in this manual.
+compiler, and the Text User Interface (nee Terminal User Interface):
+Ben Krepp, Richard Title, John Bishop, Susan Macchia, Kathy Mann,
+Satish Pai, India Paul, Steve Rehrauer, and Elena Zannoni.  Kim Haase
+provided HP-specific information in this manual.
 
 DJ Delorie ported @value{GDBN} to MS-DOS, for the DJGPP project.
 Robert Hoehne made significant contributions to the DJGPP port.
@@ -1112,12 +1112,13 @@
 @c resolve the situation of these eventually
 @item -tui
 @cindex @code{--tui}
-Activate the Terminal User Interface when starting.
-The Terminal User Interface manages several text windows on the terminal,
-showing source, assembly, registers and @value{GDBN} command outputs
-(@pxref{TUI, ,@value{GDBN} Text User Interface}).
-Do not use this option if you run @value{GDBN} from Emacs
-(@pxref{Emacs, ,Using @value{GDBN} under @sc{gnu} Emacs}).
+Activate the @dfn{Text User Interface} when starting.  The Text User
+Interface manages several text windows on the terminal, showing
+source, assembly, registers and @value{GDBN} command outputs
+(@pxref{TUI, ,@value{GDBN} Text User Interface}).  Alternatively, the
+Text User Interface can be enabled by invoking the program
+@samp{gdbtui}.  Do not use this option if you run @value{GDBN} from
+Emacs (@pxref{Emacs, ,Using @value{GDBN} under @sc{gnu} Emacs}).
 
 @c @item -xdb
 @c @cindex @code{--xdb}
@@ -1767,6 +1768,42 @@
 table, and reads it again.  When it does this, @value{GDBN} tries to retain
 your current breakpoints.
 
+@table @code
+@kindex start
+@item start
+@cindex run to main procedure
+The name of the main procedure can vary from language to language.
+With C or C@t{++}, the main procedure name is always @code{main}, but
+other languages such as Ada do not require a specific name for their
+main procedure.  The debugger provides a convenient way to start the
+execution of the program and to stop at the beginning of the main
+procedure, depending on the language used.
+
+The @samp{start} command does the equivalent of setting a temporary
+breakpoint at the beginning of the main procedure and then invoking
+the @samp{run} command.
+
+Some programs contain an elaboration phase where some startup code is
+executed before the main program is called.  This depends on the
+languages used to write your program. In C@t{++} for instance,
+constructors for static and global objects are executed before
+@code{main} is called.  It is therefore possible that the debugger stops
+before reaching the main procedure.  However, the temporary breakpoint
+will remain to halt execution.
+
+Specify the arguments to give to your program as arguments to the
+@samp{start} command.  These arguments will be given verbatim to the
+underlying @samp{run} command.  Note that the same arguments will be
+reused if no argument is provided during subsequent calls to
+@samp{start} or @samp{run}.
+
+It is sometimes necessary to debug the program during elaboration.  In
+these cases, using the @code{start} command would stop the execution of
+your program too late, as the program would have already completed the
+elaboration phase.  Under these circumstances, insert breakpoints in your
+elaboration code before running your program.
+@end table
+
 @node Arguments
 @section Your program's arguments
 
@@ -2161,8 +2198,8 @@
 
 On HP-UX systems:
 
-@cindex thread number
-@cindex thread identifier (GDB)
+@cindex debugging multithreaded programs (on HP-UX)
+@cindex thread identifier (GDB), on HP-UX
 For debugging purposes, @value{GDBN} associates its own thread
 number---a small integer assigned in thread-creation order---with each
 thread in your program.
@@ -2186,7 +2223,7 @@
 when @value{GDBN} notices a new thread.
 
 @table @code
-@kindex info threads
+@kindex info threads (HP-UX)
 @item info threads
 Display a summary of all threads currently in your
 program.  @value{GDBN} displays for each thread (in this order):
@@ -2238,7 +2275,6 @@
 @samp{Switching to} depends on your system's conventions for identifying
 threads.
 
-@kindex thread apply
 @item thread apply [@var{threadno}] [@var{all}]  @var{args}
 The @code{thread apply} command allows you to apply a command to one or
 more threads.  Specify the numbers of the threads that you want affected
@@ -2861,34 +2897,30 @@
 Stop when @var{event} occurs.  @var{event} can be any of the following:
 @table @code
 @item throw
-@kindex catch throw
+@cindex stop on C@t{++} exceptions
 The throwing of a C@t{++} exception.
 
 @item catch
-@kindex catch catch
 The catching of a C@t{++} exception.
 
 @item exec
-@kindex catch exec
+@cindex break on fork/exec
 A call to @code{exec}.  This is currently only available for HP-UX.
 
 @item fork
-@kindex catch fork
 A call to @code{fork}.  This is currently only available for HP-UX.
 
 @item vfork
-@kindex catch vfork
 A call to @code{vfork}.  This is currently only available for HP-UX.
 
 @item load
 @itemx load @var{libname}
-@kindex catch load
+@cindex break on load/unload of shared library
 The dynamic loading of any shared library, or the loading of the library
 @var{libname}.  This is currently only available for HP-UX.
 
 @item unload
 @itemx unload @var{libname}
-@kindex catch unload
 The unloading of any dynamically loaded shared library, or the unloading
 of the library @var{libname}.  This is currently only available for HP-UX.
 @end table
@@ -3001,8 +3033,7 @@
 @node Disabling
 @subsection Disabling breakpoints
 
-@kindex disable breakpoints
-@kindex enable breakpoints
+@cindex enable/disable a breakpoint
 Rather than deleting a breakpoint, watchpoint, or catchpoint, you might
 prefer to @dfn{disable} it.  This makes the breakpoint inoperative as if
 it had been deleted, but remembers the information on the breakpoint so
@@ -3036,7 +3067,6 @@
 watchpoints, and catchpoints:
 
 @table @code
-@kindex disable breakpoints
 @kindex disable
 @kindex dis @r{(@code{disable})}
 @item disable @r{[}breakpoints@r{]} @r{[}@var{range}@dots{}@r{]}
@@ -3046,7 +3076,6 @@
 case the breakpoint is enabled again later.  You may abbreviate
 @code{disable} as @code{dis}.
 
-@kindex enable breakpoints
 @kindex enable
 @item enable @r{[}breakpoints@r{]} @r{[}@var{range}@dots{}@r{]}
 Enable the specified breakpoints (or all defined breakpoints).  They
@@ -4045,7 +4074,6 @@
 
 @kindex where
 @kindex info stack
-@kindex info s @r{(@code{info stack})}
 The names @code{where} and @code{info stack} (abbreviated @code{info s})
 are additional aliases for @code{backtrace}.
 
@@ -4075,11 +4103,6 @@
 value, indicating that your program has stopped at the beginning of the
 code for line @code{993} of @code{builtin.c}.
 
-@kindex set backtrace past-main
-@kindex show backtrace past-main
-@kindex set backtrace limit
-@kindex show backtrace limit
-
 Most programs have a standard user entry point---a place where system
 libraries and startup code transition into user code.  For C this is
 @code{main}.  When @value{GDBN} finds the entry function in a backtrace
@@ -4092,6 +4115,7 @@
 @table @code
 @item set backtrace past-main
 @itemx set backtrace past-main on
+@kindex set backtrace
 Backtraces will continue past the user entry point.
 
 @item set backtrace past-main off
@@ -4099,6 +4123,7 @@
 default.
 
 @item show backtrace past-main
+@kindex show backtrace
 Display the current user entry point backtrace policy.
 
 @item set backtrace limit @var{n}
@@ -5283,9 +5308,10 @@
 These settings are useful for debugging programs in any language:
 
 @table @code
-@kindex set print address
+@kindex set print
 @item set print address
 @itemx set print address on
+@cindex print/don't print memory addresses
 @value{GDBN} prints memory addresses showing the location of stack
 traces, structure values, pointer values, breakpoints, and so forth,
 even when it also displays the contents of those addresses.  The default
@@ -5319,7 +5345,7 @@
 @code{print address off}, you should get the same text for backtraces on
 all machines---whether or not they involve pointer arguments.
 
-@kindex show print address
+@kindex show print
 @item show print address
 Show whether or not addresses are to be printed.
 @end table
@@ -5333,8 +5359,8 @@
 it prints a symbolic address:
 
 @table @code
-@kindex set print symbol-filename
 @item set print symbol-filename on
+@cindex closest symbol and offset for an address
 Tell @value{GDBN} to print the source file name and line number of a
 symbol in the symbolic form of an address.
 
@@ -5342,7 +5368,6 @@
 Do not print source file name and line number of a symbol.  This is the
 default.
 
-@kindex show print symbol-filename
 @item show print symbol-filename
 Show whether or not @value{GDBN} will print the source file name and
 line number of a symbol in the symbolic form of an address.
@@ -5356,14 +5381,13 @@
 printed is reasonably close to the closest earlier symbol:
 
 @table @code
-@kindex set print max-symbolic-offset
 @item set print max-symbolic-offset @var{max-offset}
+@cindex maximum value for offset of closest symbol
 Tell @value{GDBN} to only display the symbolic form of an address if the
 offset between the closest earlier symbol and the address is less than
 @var{max-offset}.  The default is 0, which tells @value{GDBN}
 to always print the symbolic form of an address if any symbol precedes it.
 
-@kindex show print max-symbolic-offset
 @item show print max-symbolic-offset
 Ask how large the maximum offset is that @value{GDBN} prints in a
 symbolic address.
@@ -5393,22 +5417,21 @@
 Other settings control how different kinds of objects are printed:
 
 @table @code
-@kindex set print array
 @item set print array
 @itemx set print array on
+@cindex pretty print arrays
 Pretty print arrays.  This format is more convenient to read,
 but uses more space.  The default is off.
 
 @item set print array off
 Return to compressed format for arrays.
 
-@kindex show print array
 @item show print array
 Show whether compressed or pretty format is selected for displaying
 arrays.
 
-@kindex set print elements
 @item set print elements @var{number-of-elements}
+@cindex number of array elements to print
 Set a limit on how many elements of an array @value{GDBN} will print.
 If @value{GDBN} is printing a large array, it stops printing after it has
 printed the number of elements set by the @code{set print elements} command.
@@ -5416,19 +5439,17 @@
 When @value{GDBN} starts, this limit is set to 200.
 Setting  @var{number-of-elements} to zero means that the printing is unlimited.
 
-@kindex show print elements
 @item show print elements
 Display the number of elements of a large array that @value{GDBN} will print.
 If the number is 0, then the printing is unlimited.
 
-@kindex set print null-stop
 @item set print null-stop
+@cindex @sc{null} elements in arrays
 Cause @value{GDBN} to stop printing the characters of an array when the first
 @sc{null} is encountered.  This is useful when large arrays actually
 contain only short strings.
 The default is off.
 
-@kindex set print pretty
 @item set print pretty on
 Cause @value{GDBN} to print structures in an indented format with one member
 per line, like this:
@@ -5459,12 +5480,12 @@
 @noindent
 This is the default format.
 
-@kindex show print pretty
 @item show print pretty
 Show which format @value{GDBN} is using to print structures.
 
-@kindex set print sevenbit-strings
 @item set print sevenbit-strings on
+@cindex eight-bit characters in strings
+@cindex octal escapes in strings
 Print using only seven-bit characters; if this option is set,
 @value{GDBN} displays any eight-bit characters (in strings or
 character values) using the notation @code{\}@var{nnn}.  This setting is
@@ -5475,19 +5496,17 @@
 Print full eight-bit characters.  This allows the use of more
 international character sets, and is the default.
 
-@kindex show print sevenbit-strings
 @item show print sevenbit-strings
 Show whether or not @value{GDBN} is printing only seven-bit characters.
 
-@kindex set print union
 @item set print union on
+@cindex unions in structures, printing
 Tell @value{GDBN} to print unions which are contained in structures.  This
 is the default setting.
 
 @item set print union off
 Tell @value{GDBN} not to print unions which are contained in structures.
 
-@kindex show print union
 @item show print union
 Ask @value{GDBN} whether or not it will print unions which are contained in
 structures.
@@ -5531,31 +5550,26 @@
 These settings are of interest when debugging C@t{++} programs:
 
 @table @code
-@cindex demangling
-@kindex set print demangle
+@cindex demangling C@t{++} names
 @item set print demangle
 @itemx set print demangle on
 Print C@t{++} names in their source form rather than in the encoded
 (``mangled'') form passed to the assembler and linker for type-safe
 linkage.  The default is on.
 
-@kindex show print demangle
 @item show print demangle
 Show whether C@t{++} names are printed in mangled or demangled form.
 
-@kindex set print asm-demangle
 @item set print asm-demangle
 @itemx set print asm-demangle on
 Print C@t{++} names in their source form rather than their mangled form, even
 in assembler code printouts such as instruction disassemblies.
 The default is off.
 
-@kindex show print asm-demangle
 @item show print asm-demangle
 Show whether C@t{++} names in assembly listings are printed in mangled
 or demangled form.
 
-@kindex set demangle-style
 @cindex C@t{++} symbol decoding style
 @cindex symbol decoding style, C@t{++}
 @item set demangle-style @var{style}
@@ -5585,13 +5599,12 @@
 @end table
 If you omit @var{style}, you will see a list of possible formats.
 
-@kindex show demangle-style
 @item show demangle-style
 Display the encoding style currently in use for decoding C@t{++} symbols.
 
-@kindex set print object
 @item set print object
 @itemx set print object on
+@cindex derived type of an object, printing
 When displaying a pointer to an object, identify the @emph{actual}
 (derived) type of the object rather than the @emph{declared} type, using
 the virtual function table.
@@ -5600,26 +5613,24 @@
 Display only the declared type of objects, without reference to the
 virtual function table.  This is the default setting.
 
-@kindex show print object
 @item show print object
 Show whether actual, or declared, object types are displayed.
 
-@kindex set print static-members
 @item set print static-members
 @itemx set print static-members on
+@cindex static members of C@t{++} objects
 Print static members when displaying a C@t{++} object.  The default is on.
 
 @item set print static-members off
 Do not print static members when displaying a C@t{++} object.
 
-@kindex show print static-members
 @item show print static-members
 Show whether C@t{++} static members are printed, or not.
 
 @c These don't work with HP ANSI C++ yet.
-@kindex set print vtbl
 @item set print vtbl
 @itemx set print vtbl on
+@cindex pretty print C@t{++} virtual function tables
 Pretty print C@t{++} virtual function tables.  The default is off.
 (The @code{vtbl} commands do not work on programs compiled with the HP
 ANSI C@t{++} compiler (@code{aCC}).)
@@ -5627,7 +5638,6 @@
 @item set print vtbl off
 Do not pretty print C@t{++} virtual function tables.
 
-@kindex show print vtbl
 @item show print vtbl
 Show whether C@t{++} virtual function tables are pretty printed, or not.
 @end table
@@ -6438,9 +6448,9 @@
 not parse the result, @var{expression} need not be a valid expression;
 it can be any string of tokens.
 
-@kindex macro expand-once
 @item macro expand-once @var{expression}
 @itemx macro exp1 @var{expression}
+@cindex expand macro once
 @i{(This command is not yet implemented.)}  Show the results of
 expanding those preprocessor macro invocations that appear explicitly in
 @var{expression}.  Macro invocations appearing in that expansion are
@@ -7413,14 +7423,13 @@
 
 @table @code
 @item overlay off
-@kindex overlay off
+@kindex overlay
 Disable @value{GDBN}'s overlay support.  When overlay support is
 disabled, @value{GDBN} assumes that all functions and variables are
 always present at their mapped addresses.  By default, @value{GDBN}'s
 overlay support is disabled.
 
 @item overlay manual
-@kindex overlay manual
 @cindex manual overlay debugging
 Enable @dfn{manual} overlay debugging.  In this mode, @value{GDBN}
 relies on you to tell it which overlays are mapped, and which are not,
@@ -7429,7 +7438,6 @@
 
 @item overlay map-overlay @var{overlay}
 @itemx overlay map @var{overlay}
-@kindex overlay map-overlay
 @cindex map an overlay
 Tell @value{GDBN} that @var{overlay} is now mapped; @var{overlay} must
 be the name of the object file section containing the overlay.  When an
@@ -7440,7 +7448,6 @@
 
 @item overlay unmap-overlay @var{overlay}
 @itemx overlay unmap @var{overlay}
-@kindex overlay unmap-overlay
 @cindex unmap an overlay
 Tell @value{GDBN} that @var{overlay} is no longer mapped; @var{overlay}
 must be the name of the object file section containing the overlay.
@@ -7448,7 +7455,6 @@
 overlay's functions and variables at their load addresses.
 
 @item overlay auto
-@kindex overlay auto
 Enable @dfn{automatic} overlay debugging.  In this mode, @value{GDBN}
 consults a data structure the overlay manager maintains in the inferior
 to see which overlays are mapped.  For details, see @ref{Automatic
@@ -7456,7 +7462,6 @@
 
 @item overlay load-target
 @itemx overlay load
-@kindex overlay load-target
 @cindex reloading the overlay table
 Re-read the overlay table from the inferior.  Normally, @value{GDBN}
 re-reads the table @value{GDBN} automatically each time the inferior
@@ -7793,8 +7798,6 @@
 working language, and also what language source files were written in.
 
 @kindex show language
-@kindex info frame@r{, show the source language}
-@kindex info source@r{, show the source language}
 @table @code
 @item show language
 Display the current working language.  This is the
@@ -7802,12 +7805,14 @@
 build and compute expressions that may involve variables in your program.
 
 @item info frame
+@kindex info frame@r{, show the source language}
 Display the source language for this frame.  This language becomes the
 working language if you use an identifier from this frame.
 @xref{Frame Info, ,Information about a frame}, to identify the other
 information listed here.
 
 @item info source
+@kindex info source@r{, show the source language}
 Display the source language of this source file.
 @xref{Symbols, ,Examining the Symbol Table}, to identify the other
 information listed here.
@@ -7902,7 +7907,6 @@
 
 @value{GDBN} provides some additional commands for controlling the type checker:
 
-@kindex set check@r{, type}
 @kindex set check type
 @kindex show check type
 @table @code
@@ -7963,7 +7967,6 @@
 
 @value{GDBN} provides some additional commands for controlling the range checker:
 
-@kindex set check@r{, range}
 @kindex set check range
 @kindex show check range
 @table @code
@@ -9887,9 +9890,9 @@
 @c (eg rooted in val of env var GDBSYMS) could exist for mappable symbol
 @c files.
 
-@kindex core
 @kindex core-file
 @item core-file @r{[} @var{filename} @r{]}
+@itemx core
 Specify the whereabouts of a core dump file to be used as the ``contents
 of memory''.  Traditionally, core files contain only some parts of the
 address space of the process that generated them; @value{GDBN} can access the
@@ -10307,7 +10310,7 @@
 describe the CRC used in @code{.gnu_debuglink} sections is to give the
 complete code for a function that computes it:
 
-@kindex @code{gnu_debuglink_crc32}
+@kindex gnu_debuglink_crc32
 @smallexample
 unsigned long
 gnu_debuglink_crc32 (unsigned long crc,
@@ -10579,22 +10582,24 @@
 and @code{show gnutarget} displays @samp{The current BDF target is "auto"}.
 @end table
 
+@cindex common targets
 Here are some common targets (available, or not, depending on the GDB
 configuration):
 
 @table @code
-@kindex target exec
+@kindex target
 @item target exec @var{program}
+@cindex executable file target
 An executable file.  @samp{target exec @var{program}} is the same as
 @samp{exec-file @var{program}}.
 
-@kindex target core
 @item target core @var{filename}
+@cindex core dump file target
 A core dump file.  @samp{target core @var{filename}} is the same as
 @samp{core-file @var{filename}}.
 
-@kindex target remote
 @item target remote @var{dev}
+@cindex remote target
 Remote serial target in GDB-specific protocol.  The argument @var{dev}
 specifies what serial device to use for the connection (e.g.
 @file{/dev/ttya}). @xref{Remote, ,Remote debugging}.  @code{target remote}
@@ -10602,8 +10607,8 @@
 some other way of getting the stub to the target system, and you can put
 it somewhere in memory where it won't get clobbered by the download.
 
-@kindex target sim
 @item target sim
+@cindex built-in simulator target
 Builtin CPU simulator.  @value{GDBN} includes simulators for most architectures.
 In general,
 @smallexample
@@ -10624,8 +10629,8 @@
 
 @table @code
 
-@kindex target nrom
 @item target nrom @var{dev}
+@cindex NetROM ROM emulator target
 NetROM ROM emulator.  This target only supports downloading.
 
 @end table
@@ -10674,15 +10679,13 @@
 @value{GDBN}'s idea of processor endian-ness manually.
 
 @table @code
-@kindex set endian big
+@kindex set endian
 @item set endian big
 Instruct @value{GDBN} to assume the target is big-endian.
 
-@kindex set endian little
 @item set endian little
 Instruct @value{GDBN} to assume the target is little-endian.
 
-@kindex set endian auto
 @item set endian auto
 Instruct @value{GDBN} to use the byte order associated with the
 executable.
@@ -11155,14 +11158,14 @@
 
 @table @code
 @item set_debug_traps
-@kindex set_debug_traps
+@findex set_debug_traps
 @cindex remote serial stub, initialization
 This routine arranges for @code{handle_exception} to run when your
 program stops.  You must call this subroutine explicitly near the
 beginning of your program.
 
 @item handle_exception
-@kindex handle_exception
+@findex handle_exception
 @cindex remote serial stub, main routine
 This is the central workhorse, but your program never calls it
 explicitly---the setup code arranges for @code{handle_exception} to
@@ -11210,13 +11213,13 @@
 
 @table @code
 @item int getDebugChar()
-@kindex getDebugChar
+@findex getDebugChar
 Write this subroutine to read a single character from the serial port.
 It may be identical to @code{getchar} for your target system; a
 different name is used to allow you to distinguish the two if you wish.
 
 @item void putDebugChar(int)
-@kindex putDebugChar
+@findex putDebugChar
 Write this subroutine to write a single character to the serial port.
 It may be identical to @code{putchar} for your target system; a
 different name is used to allow you to distinguish the two if you wish.
@@ -11239,7 +11242,7 @@
 
 @table @code
 @item void exceptionHandler (int @var{exception_number}, void *@var{exception_address})
-@kindex exceptionHandler
+@findex exceptionHandler
 Write this function to install @var{exception_address} in the exception
 handling tables.  You need to do this because the stub does not have any
 way of knowing what the exception handling tables on your target system
@@ -11261,7 +11264,7 @@
 help from @code{exceptionHandler}.
 
 @item void flush_i_cache()
-@kindex flush_i_cache
+@findex flush_i_cache
 On @sc{sparc} and @sc{sparclite} only, write this subroutine to flush the
 instruction cache, if any, on your target machine.  If there is no
 instruction cache, this subroutine may be a no-op.
@@ -11275,7 +11278,7 @@
 
 @table @code
 @item void *memset(void *, int, int)
-@kindex memset
+@findex memset
 This is the standard library function @code{memset} that sets an area of
 memory to a known value.  If you have one of the free versions of
 @code{libc.a}, @code{memset} can be found there; otherwise, you must
@@ -11375,6 +11378,7 @@
 
 @menu
 * HP-UX::                       HP-UX
+* BSD libkvm Interface::	Debugging BSD kernel memory images
 * SVR4 Process Information::    SVR4 process information
 * DJGPP Native::                Features specific to the DJGPP port
 * Cygwin Native::		Features specific to the Cygwin port
@@ -11387,6 +11391,46 @@
 begins with a dollar sign, @value{GDBN} searches for a user or system
 name first, before it searches for a convenience variable.
 
+@node BSD libkvm Interface
+@subsection BSD libkvm Interface
+
+@cindex libkvm
+@cindex kernel memory image
+@cindex kernel crash dump
+
+BSD-derived systems (FreeBSD/NetBSD/OpenBSD) have a kernel memory
+interface that provides a uniform interface for accessing kernel virtual
+memory images, including live systems and crash dumps.  @value{GDBN}
+uses this interface to allow you to debug live kernels and kernel crash
+dumps on many native BSD configurations.  This is implemented as a
+special @code{kvm} debugging target.  For debugging a live system, load
+the currently running kernel into @value{GDBN} and connect to the
+@code{kvm} target:
+
+@smallexample
+(@value{GDBP}) @b{target kvm}
+@end smallexample
+
+For debugging crash dumps, provide the file name of the crash dump as an
+argument:
+
+@smallexample
+(@value{GDBP}) @b{target kvm /var/crash/bsd.0}
+@end smallexample
+
+Once connected to the @code{kvm} target, the following commands are
+available:
+
+@table @code
+@kindex kvm
+@item kvm pcb
+Set current context from pcb address.
+
+@item kvm proc
+Set current context from proc address.  This command isn't available on
+modern FreeBSD systems.
+@end table
+
 @node SVR4 Process Information
 @subsection SVR4 process information
 
@@ -11842,7 +11886,7 @@
 this manual was produced; newer releases of VxWorks may use revised
 procedures.
 
-@kindex INCLUDE_RDB
+@findex INCLUDE_RDB
 To use @value{GDBN} with VxWorks, you must rebuild your VxWorks kernel
 to include the remote debugging interface routines in the VxWorks
 library @file{rdb.a}.  To do this, define @code{INCLUDE_RDB} in the
@@ -12502,49 +12546,39 @@
 
 @code{hwatch ($LEA == my_var) && ($LDATA < 50) || ($SEA == my_var) && ($SDATA >= 50)}
 
-@kindex htrace info
+@kindex htrace
 @item htrace info
 Display information about current HW trace configuration.
 
-@kindex htrace trigger
 @item htrace trigger @var{conditional}
 Set starting criteria for HW trace.
 
-@kindex htrace qualifier
 @item htrace qualifier @var{conditional}
 Set acquisition qualifier for HW trace.
 
-@kindex htrace stop
 @item htrace stop @var{conditional}
 Set HW trace stopping criteria.
 
-@kindex htrace record
 @item htrace record [@var{data}]*
 Selects the data to be recorded, when qualifier is met and HW trace was
 triggered.
 
-@kindex htrace enable
 @item htrace enable
-@kindex htrace disable
 @itemx htrace disable
 Enables/disables the HW trace.
 
-@kindex htrace rewind
 @item htrace rewind [@var{filename}]
 Clears currently recorded trace data.
 
 If filename is specified, new trace file is made and any newly collected data
 will be written there.
 
-@kindex htrace print
 @item htrace print [@var{start} [@var{len}]]
 Prints trace buffer, using current record configuration.
 
-@kindex htrace mode continuous
 @item htrace mode continuous
 Set continuous trace mode.
 
-@kindex htrace mode suspend
 @item htrace mode suspend
 Set suspend trace mode.
 
@@ -13037,7 +13071,7 @@
 @cindex history substitution
 @cindex history file
 @kindex set history filename
-@kindex GDBHISTFILE
+@cindex @env{GDBHISTFILE}, environment variable
 @item set history filename @var{fname}
 Set the name of the @value{GDBN} command history file to @var{fname}.
 This is the file where @value{GDBN} reads an initial command history
@@ -13049,7 +13083,7 @@
 is not set.
 
 @cindex history save
-@kindex set history save
+@kindex set history
 @item set history save
 @itemx set history save on
 Record command history in a file, whose name may be specified with the
@@ -13059,7 +13093,6 @@
 Stop recording command history in a file.
 
 @cindex history size
-@kindex set history size
 @item set history size @var{size}
 Set the number of commands which @value{GDBN} keeps in its history list.
 This defaults to the value of the environment variable
@@ -13083,9 +13116,9 @@
 The commands to control history expansion are:
 
 @table @code
-@kindex set history expansion
 @item set history expansion on
 @itemx set history expansion
+@cindex history expansion
 Enable history expansion.  History expansion is off by default.
 
 @item set history expansion off
@@ -13372,80 +13405,79 @@
 
 @node Debugging Output
 @section Optional messages about internal happenings
+@cindex optional debugging messages
+
 @table @code
-@kindex set debug arch
+@kindex set debug
+@cindex gdbarch debugging info
 @item set debug arch
 Turns on or off display of gdbarch debugging info. The default is off
-@kindex show debug arch
+@kindex show debug
 @item show debug arch
 Displays the current state of displaying gdbarch debugging info.
-@kindex set debug event
 @item set debug event
+@cindex event debugging info
 Turns on or off display of @value{GDBN} event debugging info. The
 default is off.
-@kindex show debug event
 @item show debug event
 Displays the current state of displaying @value{GDBN} event debugging
 info.
-@kindex set debug expression
 @item set debug expression
+@cindex expression debugging info
 Turns on or off display of @value{GDBN} expression debugging info. The
 default is off.
-@kindex show debug expression
 @item show debug expression
 Displays the current state of displaying @value{GDBN} expression
 debugging info.
-@kindex set debug frame
 @item set debug frame
+@cindex frame debugging info
 Turns on or off display of @value{GDBN} frame debugging info.  The
 default is off.
-@kindex show debug frame
 @item show debug frame
 Displays the current state of displaying @value{GDBN} frame debugging
 info.
-@kindex set debug overload
+@item set debug observer
+@cindex observer debugging info
+Turns on or off display of @value{GDBN} observer debugging.  This
+includes info such as the notification of observable events.
+@item show debug observer
+Displays the current state of observer debugging.
 @item set debug overload
+@cindex C@t{++} overload debugging info
 Turns on or off display of @value{GDBN} C@t{++} overload debugging
 info. This includes info such as ranking of functions, etc. The default
 is off.
-@kindex show debug overload
 @item show debug overload
 Displays the current state of displaying @value{GDBN} C@t{++} overload
 debugging info.
-@kindex set debug remote
 @cindex packets, reporting on stdout
 @cindex serial connections, debugging
 @item set debug remote
 Turns on or off display of reports on all packets sent back and forth across
 the serial line to the remote machine.  The info is printed on the
 @value{GDBN} standard output stream. The default is off.
-@kindex show debug remote
 @item show debug remote
 Displays the state of display of remote packets.
-@kindex set debug serial
 @item set debug serial
 Turns on or off display of @value{GDBN} serial debugging info. The
 default is off.
-@kindex show debug serial
 @item show debug serial
 Displays the current state of displaying @value{GDBN} serial debugging
 info.
-@kindex set debug target
 @item set debug target
+@cindex target debugging info
 Turns on or off display of @value{GDBN} target debugging info. This info
 includes what is going on at the target level of GDB, as it happens. The
 default is 0.  Set it to 1 to track events, and to 2 to also track the
 value of large memory transfers.  Changes to this flag do not take effect
 until the next time you connect to a target or use the @code{run} command.
-@kindex show debug target
 @item show debug target
 Displays the current state of displaying @value{GDBN} target debugging
 info.
-@kindex set debug varobj
 @item set debug varobj
+@cindex variable object debugging info
 Turns on or off display of @value{GDBN} variable object debugging
 info. The default is off.
-@kindex show debug varobj
 @item show debug varobj
 Displays the current state of displaying @value{GDBN} variable object
 debugging info.
@@ -13574,7 +13606,6 @@
 @cindex hooks, pre-command
 
 @kindex hook
-@kindex hook-
 You may define @dfn{hooks}, which are a special kind of user-defined
 command.  Whenever you run the command @samp{foo}, if the user-defined
 command @samp{hook-foo} exists, it is executed (with no arguments)
@@ -13582,7 +13613,6 @@
 
 @cindex hooks, post-command
 @kindex hookpost
-@kindex hookpost-
 A hook may also be defined which is run after the command you executed.
 Whenever you run the command @samp{foo}, if the user-defined command
 @samp{hookpost-foo} exists, it is executed (with no arguments) after
@@ -13888,6 +13918,7 @@
 @node TUI
 @chapter @value{GDBN} Text User Interface
 @cindex TUI
+@cindex Text User Interface
 
 @menu
 * TUI Overview::                TUI overview
@@ -13897,12 +13928,14 @@
 * TUI Configuration::           TUI configuration variables
 @end menu
 
-The @value{GDBN} Text User Interface, TUI in short,
-is a terminal interface which uses the @code{curses} library
-to show the source file, the assembly output, the program registers
-and @value{GDBN} commands in separate text windows.
-The TUI is available only when @value{GDBN} is configured
-with the @code{--enable-tui} configure option (@pxref{Configure Options}).
+The @value{GDBN} Text User Interface, TUI in short, is a terminal
+interface which uses the @code{curses} library to show the source
+file, the assembly output, the program registers and @value{GDBN}
+commands in separate text windows.
+
+The TUI is enabled by invoking @value{GDBN} using either
+@pindex gdbtui
+@samp{gdbtui} or @samp{gdb -tui}.
 
 @node TUI Overview
 @section TUI overview
@@ -13940,7 +13973,7 @@
 @item register
 This window shows the processor registers.  It detects when
 a register is changed and when this is the case, registers that have
-changed are highlighted.
+changed are highlighted.  
 
 @end table
 
@@ -14200,27 +14233,22 @@
 List and give the size of all displayed windows.
 
 @item layout next
-@kindex layout next
+@kindex layout
 Display the next layout.
 
 @item layout prev
-@kindex layout prev
 Display the previous layout.
 
 @item layout src
-@kindex layout src
 Display the source window only.
 
 @item layout asm
-@kindex layout asm
 Display the assembly window only.
 
 @item layout split
-@kindex layout split
 Display the source and assembly window.
 
 @item layout regs
-@kindex layout regs
 Display the register window together with the source or assembly window.
 
 @item focus next | prev | src | asm | regs | split
@@ -14233,6 +14261,22 @@
 @kindex refresh
 Refresh the screen.  This is similar to using @key{C-L} key.
 
+@item tui reg float
+@kindex tui reg
+Show the floating point registers in the register window.
+
+@item tui reg general
+Show the general registers in the register window.
+
+@item tui reg next
+Show the next register group.  The list of register groups as well as
+their order is target specific.  The predefined register groups are the
+following: @code{general}, @code{float}, @code{system}, @code{vector},
+@code{all}, @code{save}, @code{restore}.
+
+@item tui reg system
+Show the system registers in the register window.
+
 @item update
 @kindex update
 Update the source window and the current execution point.
@@ -16785,14 +16829,24 @@
 
 List the source files for the current executable.
 
+It will always output the filename, but only when GDB can find the absolute
+file name of a source file, will it output the fullname.
+
 @subsubheading @value{GDBN} Command
 
 There's no @value{GDBN} command which directly corresponds to this one.
 @code{gdbtk} has an analogous command @samp{gdb_listfiles}.
 
 @subsubheading Example
-N.A.
-
+@smallexample
+(@value{GDBP})
+-file-list-exec-source-files
+^done,files=[
+@{file=foo.c,fullname=/home/foo.c@},
+@{file=/home/bar.c,fullname=/home/bar.c@},
+@{file=gdb_could_not_find_fullpath.c@}]
+(@value{GDBP})
+@end smallexample
 
 @subheading The @code{-file-list-shared-libraries} Command
 @findex -file-list-shared-libraries
@@ -18887,6 +18941,16 @@
 us.  If you had not told us to expect a crash, then we would not be able
 to draw any conclusion from our observations.
 
+@pindex script
+@cindex recording a session script
+To collect all this information, you can use a session recording program
+such as @command{script}, which is available on many Unix systems.
+Just run your @value{GDBN} session inside @command{script} and then
+include the @file{typescript} file with your bug report.
+
+Another way to record a @value{GDBN} session is to run @value{GDBN}
+inside Emacs and then save the entire buffer to a file.
+
 @item
 If you wish to suggest changes to the @value{GDBN} source, send us context
 diffs.  If you even discuss something in the @value{GDBN} source, refer to
diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo
index 0013a41..76fa057 100644
--- a/gdb/doc/gdbint.texinfo
+++ b/gdb/doc/gdbint.texinfo
@@ -1,7 +1,7 @@
 \input texinfo   @c -*- texinfo -*-
 @setfilename gdbint.info
 @include gdb-cfg.texi
-@dircategory Programming & development tools.
+@dircategory Software development
 @direntry
 * Gdb-Internals: (gdbint).	The GNU debugger's internals.
 @end direntry
@@ -2251,10 +2251,6 @@
 set correctly if compiling with GCC.  This will almost never need to be
 defined.
 
-@item NO_SIGINTERRUPT
-@findex siginterrupt
-Define this to indicate that @code{siginterrupt} is not available.
-
 @item SEEK_CUR
 @itemx SEEK_SET
 Define these to appropriate value for the system @code{lseek}, if not already
@@ -2930,12 +2926,6 @@
 parameter to an @code{int}, but still reports the parameter as its
 original type, rather than the promoted type.
 
-@item BELIEVE_PCC_PROMOTION_TYPE
-@findex BELIEVE_PCC_PROMOTION_TYPE
-Define this if @value{GDBN} should believe the type of a @code{short}
-argument when compiled by @code{pcc}, but look within a full int space to get
-its value.  Only defined for Sun-3 at present.
-
 @item BITS_BIG_ENDIAN
 @findex BITS_BIG_ENDIAN
 Define this if the numbering of bits in the targets does @strong{not} match the
@@ -3041,35 +3031,6 @@
 expectation, @value{GDBN} prints a warning when an adjusted breakpoint
 is initially set and each time that that breakpoint is hit.
 
-@item DEPRECATED_CALL_DUMMY_WORDS
-@findex DEPRECATED_CALL_DUMMY_WORDS
-Pointer to an array of @code{LONGEST} words of data containing
-host-byte-ordered @code{DEPRECATED_REGISTER_SIZE} sized values that
-partially specify the sequence of instructions needed for an inferior
-function call.
-
-Should be deprecated in favor of a macro that uses target-byte-ordered
-data.
-
-This method has been replaced by @code{push_dummy_code}
-(@pxref{push_dummy_code}).
-
-@item DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
-@findex DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
-The size of @code{DEPRECATED_CALL_DUMMY_WORDS}.  This must return a
-positive value.  See also @code{DEPRECATED_CALL_DUMMY_LENGTH}.
-
-This method has been replaced by @code{push_dummy_code}
-(@pxref{push_dummy_code}).
-
-@item CALL_DUMMY
-@findex CALL_DUMMY
-A static initializer for @code{DEPRECATED_CALL_DUMMY_WORDS}.
-Deprecated.
-
-This method has been replaced by @code{push_dummy_code}
-(@pxref{push_dummy_code}).
-
 @item CALL_DUMMY_LOCATION
 @findex CALL_DUMMY_LOCATION
 See the file @file{inferior.h}.
@@ -3090,15 +3051,6 @@
 status words, and other special registers.  If this is not defined,
 @value{GDBN} will assume that all registers may be written.
 
-@item DO_DEFERRED_STORES
-@itemx CLEAR_DEFERRED_STORES
-@findex CLEAR_DEFERRED_STORES
-@findex DO_DEFERRED_STORES
-Define this to execute any deferred stores of registers into the inferior,
-and to cancel any deferred stores.
-
-Currently only implemented correctly for native Sparc configurations?
-
 @item int CONVERT_REGISTER_P(@var{regnum})
 @findex CONVERT_REGISTER_P
 Return non-zero if register @var{regnum} can represent data values in a
@@ -3308,20 +3260,20 @@
 @code{FUNCTION_EPILOGUE_SIZE} to expand into the standard size of a
 function's epilogue.
 
-@item FUNCTION_START_OFFSET
-@findex FUNCTION_START_OFFSET
+@item DEPRECATED_FUNCTION_START_OFFSET
+@findex DEPRECATED_FUNCTION_START_OFFSET
 An integer, giving the offset in bytes from a function's address (as
 used in the values of symbols, function pointers, etc.), and the
 function's first genuine instruction.
 
 This is zero on almost all machines: the function's address is usually
-the address of its first instruction.  However, on the VAX, for example,
-each function starts with two bytes containing a bitmask indicating
-which registers to save upon entry to the function.  The VAX @code{call}
-instructions check this value, and save the appropriate registers
-automatically.  Thus, since the offset from the function's address to
-its first instruction is two bytes, @code{FUNCTION_START_OFFSET} would
-be 2 on the VAX.
+the address of its first instruction.  However, on the VAX, for
+example, each function starts with two bytes containing a bitmask
+indicating which registers to save upon entry to the function.  The
+VAX @code{call} instructions check this value, and save the
+appropriate registers automatically.  Thus, since the offset from the
+function's address to its first instruction is two bytes,
+@code{DEPRECATED_FUNCTION_START_OFFSET} would be 2 on the VAX.
 
 @item GCC_COMPILED_FLAG_SYMBOL
 @itemx GCC2_COMPILED_FLAG_SYMBOL
@@ -3551,43 +3503,6 @@
 Return the appropriate register set for a core file section with name
 @var{sect_name} and size @var{sect_size}.
 
-
-@item RETURN_VALUE_ON_STACK(@var{type})
-@findex RETURN_VALUE_ON_STACK
-@cindex returning structures by value
-@cindex structures, returning by value
-
-Return non-zero if values of type TYPE are returned on the stack, using
-the ``struct convention'' (i.e., the caller provides a pointer to a
-buffer in which the callee should store the return value).  This
-controls how the @samp{finish} command finds a function's return value,
-and whether an inferior function call reserves space on the stack for
-the return value.
-
-The full logic @value{GDBN} uses here is kind of odd.  
-
-@itemize @bullet
-@item
-If the type being returned by value is not a structure, union, or array,
-and @code{RETURN_VALUE_ON_STACK} returns zero, then @value{GDBN}
-concludes the value is not returned using the struct convention.
-
-@item
-Otherwise, @value{GDBN} calls @code{USE_STRUCT_CONVENTION} (see below).
-If that returns non-zero, @value{GDBN} assumes the struct convention is
-in use.
-@end itemize
-
-In other words, to indicate that a given type is returned by value using
-the struct convention, that type must be either a struct, union, array,
-or something @code{RETURN_VALUE_ON_STACK} likes, @emph{and} something
-that @code{USE_STRUCT_CONVENTION} likes.
-
-Note that, in C and C@t{++}, arrays are never returned by value.  In those
-languages, these predicates will always see a pointer type, never an
-array type.  All the references above to arrays being returned by value
-apply only to other languages.
-
 @item SOFTWARE_SINGLE_STEP_P()
 @findex SOFTWARE_SINGLE_STEP_P
 Define this as 1 if the target does not have a hardware single-step
@@ -3632,22 +3547,6 @@
 them.
 @end itemize
 
-@item PCC_SOL_BROKEN
-@findex PCC_SOL_BROKEN
-(Used only in the Convex target.)
-
-@item DEPRECATED_PC_IN_SIGTRAMP (@var{pc}, @var{name})
-@findex DEPRECATED_PC_IN_SIGTRAMP
-@cindex sigtramp
-The @dfn{sigtramp} is a routine that the kernel calls (which then calls
-the signal handler).  On most machines it is a library routine that is
-linked into the executable.
-
-This function, given a program counter value in @var{pc} and the
-(possibly NULL) name of the function in which that @var{pc} resides,
-returns nonzero if the @var{pc} and/or @var{name} show that we are in
-sigtramp.
-
 @item PC_LOAD_SEGMENT
 @findex PC_LOAD_SEGMENT
 If defined, print information about the load segment for the program
@@ -3695,7 +3594,7 @@
 If defined, used by @code{frame_pop} to remove a stack frame.  This
 method has been superseeded by generic code.
 
-@item push_dummy_call (@var{gdbarch}, @var{func_addr}, @var{regcache}, @var{pc_addr}, @var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr})
+@item push_dummy_call (@var{gdbarch}, @var{function}, @var{regcache}, @var{pc_addr}, @var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr})
 @findex push_dummy_call
 @findex DEPRECATED_PUSH_ARGUMENTS.
 @anchor{push_dummy_call} Define this to push the dummy frame's call to
@@ -3703,13 +3602,15 @@
 @var{nargs}, the code should push @var{struct_addr} (when
 @var{struct_return}), and the return address (@var{bp_addr}).
 
+@var{function} is a pointer to a @code{struct value}; on architectures that use
+function descriptors, this contains the function descriptor value.
+
 Returns the updated top-of-stack pointer.
 
 This method replaces @code{DEPRECATED_PUSH_ARGUMENTS}.
 
 @item CORE_ADDR push_dummy_code (@var{gdbarch}, @var{sp}, @var{funaddr}, @var{using_gcc}, @var{args}, @var{nargs}, @var{value_type}, @var{real_pc}, @var{bp_addr})
 @findex push_dummy_code
-@findex DEPRECATED_FIX_CALL_DUMMY
 @anchor{push_dummy_code} Given a stack based call dummy, push the
 instruction sequence (including space for a breakpoint) to which the
 called function should return.
@@ -3722,15 +3623,8 @@
 (@pxref{frame_align}) breakpoint, @var{bp_addr} is set to the address
 reserved for that breakpoint, and @var{real_pc} set to @var{funaddr}.
 
-This method replaces @code{DEPRECATED_CALL_DUMMY_WORDS},
-@code{DEPRECATED_SIZEOF_CALL_DUMMY_WORDS}, @code{CALL_DUMMY},
-@code{CALL_DUMMY_LOCATION}, @code{DEPRECATED_REGISTER_SIZE},
-@code{DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET}, and
-@code{DEPRECATED_FIX_CALL_DUMMY}.
-
-@item DEPRECATED_PUSH_DUMMY_FRAME
-@findex DEPRECATED_PUSH_DUMMY_FRAME
-Used in @samp{call_function_by_hand} to create an artificial stack frame.
+This method replaces @code{CALL_DUMMY_LOCATION},
+@code{DEPRECATED_REGISTER_SIZE}.
 
 @item DEPRECATED_REGISTER_BYTES
 @findex DEPRECATED_REGISTER_BYTES
@@ -3869,10 +3763,6 @@
 This method has been deprecated in favour of @code{gdbarch_return_value}
 (@pxref{gdbarch_return_value}).
 
-@item SUN_FIXED_LBRAC_BUG
-@findex SUN_FIXED_LBRAC_BUG
-(Used only for Sun-3 and Sun-4 targets.)
-
 @item SYMBOL_RELOADING_DEFAULT
 @findex SYMBOL_RELOADING_DEFAULT
 The default value of the ``symbol-reloading'' variable.  (Never defined in
@@ -3995,8 +3885,8 @@
 previously saved using @code{SAVE_DUMMY_FRAME_TOS}.
 @xref{SAVE_DUMMY_FRAME_TOS}.
 
-@item USE_STRUCT_CONVENTION (@var{gcc_p}, @var{type})
-@findex USE_STRUCT_CONVENTION
+@item DEPRECATED_USE_STRUCT_CONVENTION (@var{gcc_p}, @var{type})
+@findex DEPRECATED_USE_STRUCT_CONVENTION
 If defined, this must be an expression that is nonzero if a value of the
 given @var{type} being returned from a function must have space
 allocated for it on the stack.  @var{gcc_p} is true if the function
@@ -4470,10 +4360,6 @@
 undefined) in @file{nm-@var{system}.h}.
 
 @table @code
-@item ATTACH_DETACH
-@findex ATTACH_DETACH
-If defined, then @value{GDBN} will include support for the @code{attach} and
-@code{detach} commands.
 
 @item CHILD_PREPARE_TO_STORE
 @findex CHILD_PREPARE_TO_STORE
@@ -5048,7 +4934,7 @@
 restrict the memory being allocated to no more than a few kilobytes.}
 
 @value{GDBN} uses the string function @code{xstrdup} and the print
-function @code{xasprintf}.
+function @code{xstrprintf}.
 
 @emph{Pragmatics: @code{asprintf} and @code{strdup} can fail.  Print
 functions such as @code{sprintf} are very prone to buffer overflow
diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi
index de48a19..f58c5af 100644
--- a/gdb/doc/observer.texi
+++ b/gdb/doc/observer.texi
@@ -35,6 +35,11 @@
 In particular, it is therefore not possible to call the attach
 or detach routines during a notification.
 
+@section Debugging
+Observer notifications can be traced using the command @samp{set debug
+observer 1} (@pxref{Debugging Output, , Optional messages about
+internal happenings, gdb, Debugging with @var{GDBN}}).
+
 @section @code{normal_stop} Notifications
 @cindex @code{normal_stop} observer
 @cindex notification about inferior execution stop
@@ -50,21 +55,38 @@
 commands list, the commands are executed after the notification
 is emitted.
 
-The following interface is available to manage @code{normal_stop}
-observers:
+The following interfaces are available to manage observers:
 
-@deftypefun extern struct observer *observer_attach_normal_stop (observer_normal_stop_ftype *@var{f})
-Attach the given @code{normal_stop} callback function @var{f} and
-return the associated observer.
+@deftypefun extern struct observer *observer_attach_@var{event} (observer_@var{event}_ftype *@var{f})
+Using the function @var{f}, create an observer that is notified when
+ever @var{event} occures, return the observer.
 @end deftypefun
 
-@deftypefun extern void observer_detach_normal_stop (struct observer *@var{observer});
+@deftypefun extern void observer_detach_@var{event} (struct observer *@var{observer});
 Remove @var{observer} from the list of observers to be notified when
-a @code{normal_stop} event occurs.
+@var{event} occurs.
 @end deftypefun
 
-@deftypefun extern void observer_notify_normal_stop (void);
-Send a notification to all @code{normal_stop} observers.
+@deftypefun extern void observer_notify_@var{event} (void);
+Send a notification to all @var{event} observers.
 @end deftypefun
 
+The following observable events are defined:
 
+@c note: all events must take at least one parameter.
+
+@deftypefun void normal_stop (struct bpstats *@var{bs})
+The inferior has stopped for real.
+@end deftypefun
+
+@deftypefun void target_changed (struct target_ops *@var{target})
+The target's register contents have changed.
+@end deftypefun
+
+@deftypefun void inferior_created (struct target_ops *@var{objfile}, int @var{from_tty})
+@value{GDBN} has just connected to an inferior.  For @samp{run},
+@value{GDBN} calls this observer while the inferior is still stopped
+at the entry-point instruction.  For @samp{attach} and @samp{core},
+@value{GDBN} calls this observer immediately after connecting to the
+inferior, and before any information on the inferior has been printed.
+@end deftypefun
diff --git a/gdb/doc/stabs.texinfo b/gdb/doc/stabs.texinfo
index e3be2ca..a00bc80 100644
--- a/gdb/doc/stabs.texinfo
+++ b/gdb/doc/stabs.texinfo
@@ -5,7 +5,7 @@
 
 @c This is a dir.info fragment to support semi-automated addition of
 @c manuals to an info tree.
-@dircategory Programming & development tools.
+@dircategory Software development
 @direntry
 * Stabs: (stabs).                 The "stabs" debugging information format.   
 @end direntry
diff --git a/gdb/dpx2-nat.c b/gdb/dpx2-nat.c
deleted file mode 100644
index 488c06a..0000000
--- a/gdb/dpx2-nat.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* DPX2 host interface.
-   Copyright 1988, 1989, 1991, 1993, 1995, 2000
-   Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include "defs.h"
-#include "gdbcore.h"
-
-#include "gdb_string.h"
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/dir.h>
-#include <signal.h>
-#include <sys/user.h>
-#include <sys/reg.h>
-#include <sys/utsname.h>
-
-
-/* This table must line up with REGISTER_NAME in "m68k-tdep.c".  */
-/* symbols like 'A0' come from <sys/reg.h> */
-static int regmap[] =
-{
-  R0, R1, R2, R3, R4, R5, R6, R7,
-  A0, A1, A2, A3, A4, A5, A6, SP,
-  PS, PC,
-  FP0, FP1, FP2, FP3, FP4, FP5, FP6, FP7,
-  FP_CR, FP_SR, FP_IAR
-};
-
-/* blockend is the value of u.u_ar0, and points to the
- * place where D0 is stored
- */
-
-int
-dpx2_register_u_addr (int blockend, int regnum)
-{
-  if (regnum < FP0_REGNUM)
-    return (blockend + 4 * regmap[regnum]);
-  else
-    return (int) &(((struct user *) 0)->u_fpstate[regmap[regnum]]);
-}
-
-/* This is the amount to subtract from u.u_ar0
-   to get the offset in the core file of the register values.
-   Unfortunately this is not provided in the system header files.
-   To make matters worse, this value also differs between
-   the dpx/2200 and dpx/2300 models and nlist is not available on the dpx2.
-   We use utsname() to decide on which model we are running.
-   FIXME: This breaks cross examination of core files (it would not be hard
-   to check whether u.u_ar0 is between 0x7fff5000 and 0x7fffc000 and if so
-   use 0x7fff5000 and if not use 0x7fffc000.  FIXME).  */
-
-#define KERNEL_U_ADDR_200 0x7fff5000
-#define KERNEL_U_ADDR_300 0x7fffc000
-
-CORE_ADDR kernel_u_addr;
-
-void
-_initialize_dpx2_nat (void)
-{
-  struct utsname uts;
-
-  if (uname (&uts) == 0 && strcmp (uts.machine, "DPX/2200") == 0)
-    kernel_u_addr = KERNEL_U_ADDR_200;
-  else
-    kernel_u_addr = KERNEL_U_ADDR_300;
-}
diff --git a/gdb/dsrec.c b/gdb/dsrec.c
index 1422600..2ca91fe 100644
--- a/gdb/dsrec.c
+++ b/gdb/dsrec.c
@@ -1,5 +1,5 @@
 /* S-record download support for GDB, the GNU debugger.
-   Copyright 1995, 1996, 1997, 1999, 2000, 2001
+   Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -93,7 +93,7 @@
       {
 	int numbytes;
 	bfd_vma addr = bfd_get_section_vma (abfd, s) + load_offset;
-	bfd_size_type size = bfd_get_section_size_before_reloc (s);
+	bfd_size_type size = bfd_get_section_size (s);
 	char *section_name = (char *) bfd_get_section_name (abfd, s);
 	/* Both GDB and BFD have mechanisms for printing addresses.
            In the below, GDB's is used so that the address is
@@ -124,8 +124,9 @@
 	    do
 	      {
 		serial_write (desc, srec, reclen);
-		if (ui_load_progress_hook)
-		  if (ui_load_progress_hook (section_name, (unsigned long) i))
+		if (deprecated_ui_load_progress_hook)
+		  if (deprecated_ui_load_progress_hook (section_name,
+							(unsigned long) i))
 		    error ("Canceled the download");
 	      }
 	    while (waitack != NULL && !waitack ());
@@ -137,8 +138,9 @@
 	      }
 	  }			/* Per-packet (or S-record) loop */
 
-	if (ui_load_progress_hook)
-	  if (ui_load_progress_hook (section_name, (unsigned long) i))
+	if (deprecated_ui_load_progress_hook)
+	  if (deprecated_ui_load_progress_hook (section_name,
+						(unsigned long) i))
 	    error ("Canceled the download");
 	putchar_unfiltered ('\n');
       }
@@ -261,7 +263,7 @@
   if (sect && abfd)
     {
       payload_size = (*maxrecsize - (1 + 1 + 2 + addr_size * 2 + 2)) / 2;
-      payload_size = min (payload_size, sect->_raw_size - sectoff);
+      payload_size = min (payload_size, bfd_get_section_size (sect) - sectoff);
 
       bfd_get_section_contents (abfd, sect, binbuf, sectoff, payload_size);
     }
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index 2c5153e..7063071 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -1,8 +1,8 @@
 /* Code dealing with dummy stack frames, for GDB, the GNU debugger.
 
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
-   Foundation, Inc.
+   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+   Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -112,7 +112,7 @@
   return NULL;
 }
 
-struct regcache *
+static struct regcache *
 deprecated_find_dummy_frame_regcache (CORE_ADDR pc, CORE_ADDR fp)
 {
   struct dummy_frame *dummy = find_dummy_frame (pc, fp);
@@ -131,7 +131,7 @@
   return deprecated_grub_regcache_for_registers (regcache);
 }
 
-/* Function: pc_in_call_dummy (pc, sp, fp)
+/* Function: pc_in_call_dummy (pc)
 
    Return true if the PC falls in a dummy frame created by gdb for an
    inferior call.  The code below which allows DECR_PC_AFTER_BREAK is
@@ -139,7 +139,7 @@
    subtracted out.  */
 
 int
-deprecated_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR fp)
+deprecated_pc_in_call_dummy (CORE_ADDR pc)
 {
   return pc_in_dummy_frame (pc);
 }
@@ -151,11 +151,7 @@
 
    FIXME: cagney/2002-11-23: This is silly.  Surely "infrun.c" can
    figure out what the real PC (as in the resume address) is BEFORE
-   calling this function (Oh, and I'm not even sure that this function
-   is called with an decremented PC, the call to pc_in_call_dummy() in
-   that file is conditional on
-   !DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET_P yet generic dummy
-   targets set DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET. True?).  */
+   calling this function.  */
 
 static int
 pc_in_dummy_frame (CORE_ADDR pc)
@@ -353,7 +349,7 @@
 	 determine the dummy frame's ID.  */
       (*this_id) = gdbarch_unwind_dummy_id (current_gdbarch, next_frame);
     }
-  else if (frame_relative_level (next_frame) < 0)
+  else if (get_frame_type (next_frame) == SENTINEL_FRAME)
     {
       /* We're unwinding a sentinel frame, the PC of which is pointing
 	 at a stack dummy.  Fake up the dummy frame's ID using the
@@ -398,7 +394,6 @@
 dummy_frame_sniffer (struct frame_info *next_frame)
 {
   CORE_ADDR pc = frame_pc_unwind (next_frame);
-  gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
   if (pc_in_dummy_frame (pc))
     return &dummy_frame_unwind;
   else
diff --git a/gdb/dummy-frame.h b/gdb/dummy-frame.h
index 6d565d1..07f8f5a 100644
--- a/gdb/dummy-frame.h
+++ b/gdb/dummy-frame.h
@@ -27,35 +27,9 @@
 struct frame_unwind;
 struct frame_id;
 
-/* GENERIC DUMMY FRAMES
-  
-   The following code serves to maintain the dummy stack frames for
-   inferior function calls (ie. when gdb calls into the inferior via
-   call_function_by_hand).  This code saves the machine state before
-   the call in host memory, so we must maintain an independent stack
-   and keep it consistant etc.  I am attempting to make this code
-   generic enough to be used by many targets.
- 
-   The cheapest and most generic way to do CALL_DUMMY on a new target
-   is probably to define CALL_DUMMY to be empty,
-   DEPRECATED_CALL_DUMMY_LENGTH to zero, and CALL_DUMMY_LOCATION to
-   AT_ENTRY.  Then you must remember to define PUSH_RETURN_ADDRESS,
-   because no call instruction will be being executed by the target.
-   Also DEPRECATED_FRAME_CHAIN_VALID as
-   generic_{file,func}_frame_chain_valid and do not set
-   DEPRECATED_FIX_CALL_DUMMY.  */
-
 /* If the PC falls in a dummy frame, return a dummy frame
    unwinder.  */
 
 extern const struct frame_unwind *dummy_frame_sniffer (struct frame_info *next_frame);
 
-/* Return the regcache that belongs to the dummy-frame identifed by PC
-   and FP, or NULL if no such frame exists.  */
-/* FIXME: cagney/2002-11-08: The function only exists because of
-   deprecated_generic_get_saved_register.  Eliminate that function and
-   this, to, can go.  */
-
-extern struct regcache *deprecated_find_dummy_frame_regcache (CORE_ADDR pc,
-							      CORE_ADDR fp);
 #endif /* !defined (DUMMY_FRAME_H)  */
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 13c836e..7ee18db 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -372,11 +372,17 @@
 	      {
 		struct dwarf2_frame_state_reg_info *old_rs = fs->regs.prev;
 
-		gdb_assert (old_rs);
-
-		xfree (fs->regs.reg);
-		fs->regs = *old_rs;
-		xfree (old_rs);
+		if (old_rs == NULL)
+		  {
+		    complaint (&symfile_complaints, "\
+bad CFI data; mismatched DW_CFA_restore_state at 0x%s", paddr (fs->pc));
+		  }
+		else
+		  {
+		    xfree (fs->regs.reg);
+		    fs->regs = *old_rs;
+		    xfree (old_rs);
+		  }
 	      }
 	      break;
 
@@ -1082,6 +1088,14 @@
     case DW_EH_PE_textrel:
       base = unit->tbase;
       break;
+    case DW_EH_PE_funcrel:
+      /* FIXME: kettenis/20040501: For now just pretend
+         DW_EH_PE_funcrel is equivalent to DW_EH_PE_absptr.  For
+         reading the initial location of an FDE it should be treated
+         as such, and currently that's the only place where this code
+         is used.  */
+      base = 0;
+      break;
     case DW_EH_PE_aligned:
       base = 0;
       offset = buf - unit->dwarf_frame_buffer;
@@ -1254,6 +1268,7 @@
       /* This is a CIE.  */
       struct dwarf2_cie *cie;
       char *augmentation;
+      unsigned int cie_version;
 
       /* Record the offset into the .debug_frame section of this CIE.  */
       cie_pointer = start - unit->dwarf_frame_buffer;
@@ -1274,7 +1289,8 @@
       cie->encoding = encoding_for_size (unit->addr_size);
 
       /* Check version number.  */
-      if (read_1_byte (unit->abfd, buf) != DW_CIE_VERSION)
+      cie_version = read_1_byte (unit->abfd, buf);
+      if (cie_version != 1 && cie_version != 3)
 	return NULL;
       buf += 1;
 
@@ -1300,8 +1316,15 @@
 	read_signed_leb128 (unit->abfd, buf, &bytes_read);
       buf += bytes_read;
 
-      cie->return_address_register = read_1_byte (unit->abfd, buf);
-      buf += 1;
+      if (cie_version == 1)
+	{
+	  cie->return_address_register = read_1_byte (unit->abfd, buf);
+	  bytes_read = 1;
+	}
+      else
+	cie->return_address_register = read_unsigned_leb128 (unit->abfd, buf,
+							     &bytes_read);
+      buf += bytes_read;
 
       cie->saw_z_augmentation = (*augmentation == 'z');
       if (cie->saw_z_augmentation)
@@ -1548,8 +1571,7 @@
       unit.dwarf_frame_buffer = dwarf2_read_section (objfile,
 						     dwarf_eh_frame_section);
 
-      unit.dwarf_frame_size
-	= bfd_get_section_size_before_reloc (dwarf_eh_frame_section);
+      unit.dwarf_frame_size = bfd_get_section_size (dwarf_eh_frame_section);
       unit.dwarf_frame_section = dwarf_eh_frame_section;
 
       /* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base
@@ -1576,8 +1598,7 @@
       unit.cie = NULL;
       unit.dwarf_frame_buffer = dwarf2_read_section (objfile,
 						     dwarf_frame_section);
-      unit.dwarf_frame_size
-	= bfd_get_section_size_before_reloc (dwarf_frame_section);
+      unit.dwarf_frame_size = bfd_get_section_size (dwarf_frame_section);
       unit.dwarf_frame_section = dwarf_frame_section;
 
       frame_ptr = unit.dwarf_frame_buffer;
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index 50baced..294afa0 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -575,6 +575,7 @@
 		break;
 	      case DW_OP_div:
 		binop = BINOP_DIV;
+                break;
 	      case DW_OP_minus:
 		binop = BINOP_SUB;
 		break;
@@ -595,6 +596,7 @@
 		break;
 	      case DW_OP_shr:
 		binop = BINOP_RSH;
+                break;
 	      case DW_OP_shra:
 		binop = BINOP_RSH;
 		val1 = value_from_longest (signed_address_type (), first);
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index ef333f7..cdbeb10 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -53,11 +53,14 @@
 find_location_expression (struct dwarf2_loclist_baton *baton,
 			  size_t *locexpr_length, CORE_ADDR pc)
 {
-  CORE_ADDR base_address = baton->base_address;
   CORE_ADDR low, high;
   char *loc_ptr, *buf_end;
   unsigned int addr_size = TARGET_ADDR_BIT / TARGET_CHAR_BIT, length;
   CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
+  /* Adjust base_address for relocatable objects.  */
+  CORE_ADDR base_offset = ANOFFSET (baton->objfile->section_offsets,
+				    SECT_OFF_TEXT (baton->objfile));
+  CORE_ADDR base_address = baton->base_address + base_offset;
 
   loc_ptr = baton->data;
   buf_end = baton->data + baton->size;
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 285eb6b..845672d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -44,6 +44,7 @@
 #include "dwarf2expr.h"
 #include "dwarf2loc.h"
 #include "cp-support.h"
+#include "hashtab.h"
 
 #include <fcntl.h>
 #include "gdb_string.h"
@@ -140,19 +141,34 @@
   }
 _STATEMENT_PROLOGUE;
 
-/* offsets and sizes of debugging sections */
+static const struct objfile_data *dwarf2_objfile_data_key;
 
-static unsigned int dwarf_info_size;
-static unsigned int dwarf_abbrev_size;
-static unsigned int dwarf_line_size;
-static unsigned int dwarf_pubnames_size;
-static unsigned int dwarf_aranges_size;
-static unsigned int dwarf_loc_size;
-static unsigned int dwarf_macinfo_size;
-static unsigned int dwarf_str_size;
-static unsigned int dwarf_ranges_size;
-unsigned int dwarf_frame_size;
-unsigned int dwarf_eh_frame_size;
+struct dwarf2_per_objfile
+{
+  /* Sizes of debugging sections.  */
+  unsigned int info_size;
+  unsigned int abbrev_size;
+  unsigned int line_size;
+  unsigned int pubnames_size;
+  unsigned int aranges_size;
+  unsigned int loc_size;
+  unsigned int macinfo_size;
+  unsigned int str_size;
+  unsigned int ranges_size;
+  unsigned int frame_size;
+  unsigned int eh_frame_size;
+
+  /* Loaded data from the sections.  */
+  char *info_buffer;
+  char *abbrev_buffer;
+  char *line_buffer;
+  char *str_buffer;
+  char *macinfo_buffer;
+  char *ranges_buffer;
+  char *loc_buffer;
+};
+
+static struct dwarf2_per_objfile *dwarf2_per_objfile;
 
 static asection *dwarf_info_section;
 static asection *dwarf_abbrev_section;
@@ -273,6 +289,19 @@
 
   /* Storage for the abbrev table.  */
   struct obstack abbrev_obstack;
+
+  /* Hash table holding all the loaded partial DIEs.  */
+  htab_t partial_dies;
+
+  /* Storage for things with the same lifetime as this read-in compilation
+     unit, including partial DIEs.  */
+  struct obstack comp_unit_obstack;
+
+  /* This flag will be set if this compilation unit includes any
+     DW_TAG_namespace DIEs.  If we know that there are explicit
+     DIEs for namespaces, we don't need to try to infer them
+     from mangled names.  */
+  unsigned int has_namespace_info : 1;
 };
 
 /* The line number information for a compilation unit (found in the
@@ -312,10 +341,11 @@
     unsigned int dir_index;
     unsigned int mod_time;
     unsigned int length;
+    int included_p; /* Non-zero if referenced by the Line Number Program.  */
   } *file_names;
 
   /* The start and end of the statement program following this
-     header.  These point into dwarf_line_buffer.  */
+     header.  These point into dwarf2_per_objfile->line_buffer.  */
   char *statement_program_start, *statement_program_end;
 };
 
@@ -323,20 +353,62 @@
    need this much information. */
 struct partial_die_info
   {
-    enum dwarf_tag tag;
-    unsigned char has_children;
-    unsigned char is_external;
-    unsigned char is_declaration;
-    unsigned char has_type;
+    /* Offset of this DIE.  */
     unsigned int offset;
-    unsigned int abbrev;
+
+    /* DWARF-2 tag for this DIE.  */
+    ENUM_BITFIELD(dwarf_tag) tag : 16;
+
+    /* Language code associated with this DIE.  This is only used
+       for the compilation unit DIE.  */
+    unsigned int language : 8;
+
+    /* Assorted flags describing the data found in this DIE.  */
+    unsigned int has_children : 1;
+    unsigned int is_external : 1;
+    unsigned int is_declaration : 1;
+    unsigned int has_type : 1;
+    unsigned int has_specification : 1;
+    unsigned int has_stmt_list : 1;
+    unsigned int has_pc_info : 1;
+
+    /* Flag set if the SCOPE field of this structure has been
+       computed.  */
+    unsigned int scope_set : 1;
+
+    /* The name of this DIE.  Normally the value of DW_AT_name, but
+       sometimes DW_TAG_MIPS_linkage_name or a string computed in some
+       other fashion.  */
     char *name;
-    int has_pc_info;
+    char *dirname;
+
+    /* The scope to prepend to our children.  This is generally
+       allocated on the comp_unit_obstack, so will disappear
+       when this compilation unit leaves the cache.  */
+    char *scope;
+
+    /* The location description associated with this DIE, if any.  */
+    struct dwarf_block *locdesc;
+
+    /* If HAS_PC_INFO, the PC range associated with this DIE.  */
     CORE_ADDR lowpc;
     CORE_ADDR highpc;
-    struct dwarf_block *locdesc;
-    unsigned int language;
+
+    /* Pointer into the info_buffer pointing at the target of
+       DW_AT_sibling, if any.  */
     char *sibling;
+
+    /* If HAS_SPECIFICATION, the offset of the DIE referred to by
+       DW_AT_specification (or DW_AT_abstract_origin or
+       DW_AT_extension).  */
+    unsigned int spec_offset;
+
+    /* If HAS_STMT_LIST, the offset of the Line Number Information data.  */
+    unsigned int line_offset;
+
+    /* Pointers to this DIE's parent, first child, and next sibling,
+       if any.  */
+    struct partial_die_info *die_parent, *die_child, *die_sibling;
   };
 
 /* This data structure holds the information of an abbrev. */
@@ -428,23 +500,11 @@
 
 static struct die_info *die_ref_table[REF_HASH_SIZE];
 
-/* Obstack for allocating temporary storage used during symbol reading.  */
-static struct obstack dwarf2_tmp_obstack;
-
 /* Allocate fields for structs, unions and enums in this size.  */
 #ifndef DW_FIELD_ALLOC_CHUNK
 #define DW_FIELD_ALLOC_CHUNK 4
 #endif
 
-/* Actually data from the sections.  */
-static char *dwarf_info_buffer;
-static char *dwarf_abbrev_buffer;
-static char *dwarf_line_buffer;
-static char *dwarf_str_buffer;
-static char *dwarf_macinfo_buffer;
-static char *dwarf_ranges_buffer;
-static char *dwarf_loc_buffer;
-
 /* A zeroed version of a partial die for initialization purposes.  */
 static struct partial_die_info zeroed_partial_die;
 
@@ -458,87 +518,17 @@
 				   the register number.  */
 
 /* We put a pointer to this structure in the read_symtab_private field
-   of the psymtab.
-
-   Most of the information in this structure is related to an entire
-   object file and could be passed via the sym_private field of the
-   objfile.  It is possible to have both dwarf2 and some other form
-   of debug symbols in one object file.  */
+   of the psymtab.  */
 
 struct dwarf2_pinfo
   {
-    /* Pointer to start of dwarf info buffer for the objfile.  */
-
-    char *dwarf_info_buffer;
-
-    /* Offset in dwarf_info_buffer for this compilation unit. */
+    /* Offset in .debug_info for this compilation unit. */
 
     unsigned long dwarf_info_offset;
-
-    /* Pointer to start of dwarf abbreviation buffer for the objfile.  */
-
-    char *dwarf_abbrev_buffer;
-
-    /* Size of dwarf abbreviation section for the objfile.  */
-
-    unsigned int dwarf_abbrev_size;
-
-    /* Pointer to start of dwarf line buffer for the objfile.  */
-
-    char *dwarf_line_buffer;
-
-    /* Size of dwarf_line_buffer, in bytes.  */
-    
-    unsigned int dwarf_line_size;
-
-    /* Pointer to start of dwarf string buffer for the objfile.  */
-
-    char *dwarf_str_buffer;
-
-    /* Size of dwarf string section for the objfile.  */
-
-    unsigned int dwarf_str_size;
-
-    /* Pointer to start of dwarf macro buffer for the objfile.  */
-
-    char *dwarf_macinfo_buffer;
-
-    /* Size of dwarf macinfo section for the objfile.  */
-    
-    unsigned int dwarf_macinfo_size;
-
-    /* Pointer to start of dwarf ranges buffer for the objfile.  */
-
-    char *dwarf_ranges_buffer;
-
-    /* Size of dwarf ranges buffer for the objfile.  */
-
-    unsigned int dwarf_ranges_size;
-
-    /* Pointer to start of dwarf locations buffer for the objfile.  */
-
-    char *dwarf_loc_buffer;
-
-    /* Size of dwarf locations buffer for the objfile.  */
-
-    unsigned int dwarf_loc_size;
   };
 
 #define PST_PRIVATE(p) ((struct dwarf2_pinfo *)(p)->read_symtab_private)
-#define DWARF_INFO_BUFFER(p) (PST_PRIVATE(p)->dwarf_info_buffer)
 #define DWARF_INFO_OFFSET(p) (PST_PRIVATE(p)->dwarf_info_offset)
-#define DWARF_ABBREV_BUFFER(p) (PST_PRIVATE(p)->dwarf_abbrev_buffer)
-#define DWARF_ABBREV_SIZE(p) (PST_PRIVATE(p)->dwarf_abbrev_size)
-#define DWARF_LINE_BUFFER(p) (PST_PRIVATE(p)->dwarf_line_buffer)
-#define DWARF_LINE_SIZE(p)   (PST_PRIVATE(p)->dwarf_line_size)
-#define DWARF_STR_BUFFER(p)  (PST_PRIVATE(p)->dwarf_str_buffer)
-#define DWARF_STR_SIZE(p)    (PST_PRIVATE(p)->dwarf_str_size)
-#define DWARF_MACINFO_BUFFER(p) (PST_PRIVATE(p)->dwarf_macinfo_buffer)
-#define DWARF_MACINFO_SIZE(p)   (PST_PRIVATE(p)->dwarf_macinfo_size)
-#define DWARF_RANGES_BUFFER(p)  (PST_PRIVATE(p)->dwarf_ranges_buffer)
-#define DWARF_RANGES_SIZE(p)    (PST_PRIVATE(p)->dwarf_ranges_size)
-#define DWARF_LOC_BUFFER(p)     (PST_PRIVATE(p)->dwarf_loc_buffer)
-#define DWARF_LOC_SIZE(p)       (PST_PRIVATE(p)->dwarf_loc_size)
 
 /* FIXME: We might want to set this from BFD via bfd_arch_bits_per_byte,
    but this would require a corresponding change in unpack_field_as_long
@@ -647,32 +637,30 @@
 static void dwarf2_build_psymtabs_easy (struct objfile *, int);
 #endif
 
+static void dwarf2_create_include_psymtab (char *, struct partial_symtab *,
+                                           struct objfile *);
+
+static void dwarf2_build_include_psymtabs (struct dwarf2_cu *,
+                                           struct partial_die_info *,
+                                           struct partial_symtab *);
+
 static void dwarf2_build_psymtabs_hard (struct objfile *, int);
 
-static char *scan_partial_symbols (char *, CORE_ADDR *, CORE_ADDR *,
-				   struct dwarf2_cu *,
-				   const char *namespace);
+static void scan_partial_symbols (struct partial_die_info *,
+				  CORE_ADDR *, CORE_ADDR *,
+				  struct dwarf2_cu *);
 
-static void add_partial_symbol (struct partial_die_info *, struct dwarf2_cu *,
-				const char *namespace);
+static void add_partial_symbol (struct partial_die_info *,
+				struct dwarf2_cu *);
 
-static int pdi_needs_namespace (enum dwarf_tag tag, const char *namespace);
+static int pdi_needs_namespace (enum dwarf_tag tag);
 
-static char *add_partial_namespace (struct partial_die_info *pdi,
-				    char *info_ptr,
-				    CORE_ADDR *lowpc, CORE_ADDR *highpc,
-				    struct dwarf2_cu *cu,
-				    const char *namespace);
+static void add_partial_namespace (struct partial_die_info *pdi,
+				   CORE_ADDR *lowpc, CORE_ADDR *highpc,
+				   struct dwarf2_cu *cu);
 
-static char *add_partial_structure (struct partial_die_info *struct_pdi,
-				    char *info_ptr,
-				    struct dwarf2_cu *cu,
-				    const char *namespace);
-
-static char *add_partial_enumeration (struct partial_die_info *enum_pdi,
-				      char *info_ptr,
-				      struct dwarf2_cu *cu,
-				      const char *namespace);
+static void add_partial_enumeration (struct partial_die_info *enum_pdi,
+				     struct dwarf2_cu *cu);
 
 static char *locate_pdi_sibling (struct partial_die_info *orig_pdi,
 				 char *info_ptr,
@@ -689,12 +677,25 @@
 
 static void dwarf2_free_abbrev_table (void *);
 
+static struct abbrev_info *peek_die_abbrev (char *, int *, struct dwarf2_cu *);
+
 static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int,
 						 struct dwarf2_cu *);
 
+static struct partial_die_info *load_partial_dies (bfd *, char *, int,
+						   struct dwarf2_cu *);
+
 static char *read_partial_die (struct partial_die_info *,
+			       struct abbrev_info *abbrev, unsigned int,
 			       bfd *, char *, struct dwarf2_cu *);
 
+static struct partial_die_info *find_partial_die (unsigned long,
+						  struct dwarf2_cu *,
+						  struct dwarf2_cu **);
+
+static void fixup_partial_die (struct partial_die_info *,
+			       struct dwarf2_cu *);
+
 static char *read_full_die (struct die_info **, bfd *, char *,
 			    struct dwarf2_cu *, int *);
 
@@ -741,6 +742,9 @@
 static struct attribute *dwarf2_attr (struct die_info *, unsigned int,
 				      struct dwarf2_cu *);
 
+static int dwarf2_flag_true_p (struct die_info *die, unsigned name,
+                               struct dwarf2_cu *cu);
+
 static int die_is_declaration (struct die_info *, struct dwarf2_cu *cu);
 
 static struct die_info *die_specification (struct die_info *die,
@@ -748,12 +752,15 @@
 
 static void free_line_header (struct line_header *lh);
 
+static void add_file_name (struct line_header *, char *, unsigned int,
+                           unsigned int, unsigned int);
+
 static struct line_header *(dwarf_decode_line_header
                             (unsigned int offset,
                              bfd *abfd, struct dwarf2_cu *cu));
 
 static void dwarf_decode_lines (struct line_header *, char *, bfd *,
-				struct dwarf2_cu *);
+				struct dwarf2_cu *, struct partial_symtab *);
 
 static void dwarf2_start_subfile (char *, char *);
 
@@ -919,9 +926,7 @@
 
 /* memory allocation interface */
 
-static void dwarf2_free_tmp_obstack (void *);
-
-static struct dwarf_block *dwarf_alloc_block (void);
+static struct dwarf_block *dwarf_alloc_block (struct dwarf2_cu *);
 
 static struct abbrev_info *dwarf_alloc_abbrev (struct dwarf2_cu *);
 
@@ -944,12 +949,30 @@
 static char *skip_one_die (char *info_ptr, struct abbrev_info *abbrev,
 			   struct dwarf2_cu *cu);
 
+static void free_stack_comp_unit (void *);
+
+static void *hashtab_obstack_allocate (void *data, size_t size, size_t count);
+
+static void dummy_obstack_deallocate (void *object, void *data);
+
+static hashval_t partial_die_hash (const void *item);
+
+static int partial_die_eq (const void *item_lhs, const void *item_rhs);
+
 /* Try to locate the sections we need for DWARF 2 debugging
    information and return true if we have enough to do something.  */
 
 int
-dwarf2_has_info (bfd *abfd)
+dwarf2_has_info (struct objfile *objfile)
 {
+  struct dwarf2_per_objfile *data;
+
+  /* Initialize per-objfile state.  */
+  data = obstack_alloc (&objfile->objfile_obstack, sizeof (*data));
+  memset (data, 0, sizeof (*data));
+  set_objfile_data (objfile, dwarf2_objfile_data_key, data);
+  dwarf2_per_objfile = data;
+
   dwarf_info_section = 0;
   dwarf_abbrev_section = 0;
   dwarf_line_section = 0;
@@ -960,7 +983,7 @@
   dwarf_ranges_section = 0;
   dwarf_loc_section = 0;
   
-  bfd_map_over_sections (abfd, dwarf2_locate_sections, NULL);
+  bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL);
   return (dwarf_info_section != NULL && dwarf_abbrev_section != NULL);
 }
 
@@ -973,47 +996,47 @@
 {
   if (strcmp (sectp->name, INFO_SECTION) == 0)
     {
-      dwarf_info_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->info_size = bfd_get_section_size (sectp);
       dwarf_info_section = sectp;
     }
   else if (strcmp (sectp->name, ABBREV_SECTION) == 0)
     {
-      dwarf_abbrev_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->abbrev_size = bfd_get_section_size (sectp);
       dwarf_abbrev_section = sectp;
     }
   else if (strcmp (sectp->name, LINE_SECTION) == 0)
     {
-      dwarf_line_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->line_size = bfd_get_section_size (sectp);
       dwarf_line_section = sectp;
     }
   else if (strcmp (sectp->name, PUBNAMES_SECTION) == 0)
     {
-      dwarf_pubnames_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->pubnames_size = bfd_get_section_size (sectp);
       dwarf_pubnames_section = sectp;
     }
   else if (strcmp (sectp->name, ARANGES_SECTION) == 0)
     {
-      dwarf_aranges_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->aranges_size = bfd_get_section_size (sectp);
       dwarf_aranges_section = sectp;
     }
   else if (strcmp (sectp->name, LOC_SECTION) == 0)
     {
-      dwarf_loc_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->loc_size = bfd_get_section_size (sectp);
       dwarf_loc_section = sectp;
     }
   else if (strcmp (sectp->name, MACINFO_SECTION) == 0)
     {
-      dwarf_macinfo_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->macinfo_size = bfd_get_section_size (sectp);
       dwarf_macinfo_section = sectp;
     }
   else if (strcmp (sectp->name, STR_SECTION) == 0)
     {
-      dwarf_str_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->str_size = bfd_get_section_size (sectp);
       dwarf_str_section = sectp;
     }
   else if (strcmp (sectp->name, FRAME_SECTION) == 0)
     {
-      dwarf_frame_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->frame_size = bfd_get_section_size (sectp);
       dwarf_frame_section = sectp;
     }
   else if (strcmp (sectp->name, EH_FRAME_SECTION) == 0)
@@ -1021,13 +1044,13 @@
       flagword aflag = bfd_get_section_flags (ignore_abfd, sectp);
       if (aflag & SEC_HAS_CONTENTS)
         {
-          dwarf_eh_frame_size = bfd_get_section_size_before_reloc (sectp);
+          dwarf2_per_objfile->eh_frame_size = bfd_get_section_size (sectp);
           dwarf_eh_frame_section = sectp;
         }
     }
   else if (strcmp (sectp->name, RANGES_SECTION) == 0)
     {
-      dwarf_ranges_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->ranges_size = bfd_get_section_size (sectp);
       dwarf_ranges_section = sectp;
     }
 }
@@ -1037,37 +1060,36 @@
 void
 dwarf2_build_psymtabs (struct objfile *objfile, int mainline)
 {
-
   /* We definitely need the .debug_info and .debug_abbrev sections */
 
-  dwarf_info_buffer = dwarf2_read_section (objfile, dwarf_info_section);
-  dwarf_abbrev_buffer = dwarf2_read_section (objfile, dwarf_abbrev_section);
+  dwarf2_per_objfile->info_buffer = dwarf2_read_section (objfile, dwarf_info_section);
+  dwarf2_per_objfile->abbrev_buffer = dwarf2_read_section (objfile, dwarf_abbrev_section);
 
   if (dwarf_line_section)
-    dwarf_line_buffer = dwarf2_read_section (objfile, dwarf_line_section);
+    dwarf2_per_objfile->line_buffer = dwarf2_read_section (objfile, dwarf_line_section);
   else
-    dwarf_line_buffer = NULL;
+    dwarf2_per_objfile->line_buffer = NULL;
 
   if (dwarf_str_section)
-    dwarf_str_buffer = dwarf2_read_section (objfile, dwarf_str_section);
+    dwarf2_per_objfile->str_buffer = dwarf2_read_section (objfile, dwarf_str_section);
   else
-    dwarf_str_buffer = NULL;
+    dwarf2_per_objfile->str_buffer = NULL;
 
   if (dwarf_macinfo_section)
-    dwarf_macinfo_buffer = dwarf2_read_section (objfile,
+    dwarf2_per_objfile->macinfo_buffer = dwarf2_read_section (objfile,
 						dwarf_macinfo_section);
   else
-    dwarf_macinfo_buffer = NULL;
+    dwarf2_per_objfile->macinfo_buffer = NULL;
 
   if (dwarf_ranges_section)
-    dwarf_ranges_buffer = dwarf2_read_section (objfile, dwarf_ranges_section);
+    dwarf2_per_objfile->ranges_buffer = dwarf2_read_section (objfile, dwarf_ranges_section);
   else
-    dwarf_ranges_buffer = NULL;
+    dwarf2_per_objfile->ranges_buffer = NULL;
 
   if (dwarf_loc_section)
-    dwarf_loc_buffer = dwarf2_read_section (objfile, dwarf_loc_section);
+    dwarf2_per_objfile->loc_buffer = dwarf2_read_section (objfile, dwarf_loc_section);
   else
-    dwarf_loc_buffer = NULL;
+    dwarf2_per_objfile->loc_buffer = NULL;
 
   if (mainline
       || (objfile->global_psymbols.size == 0
@@ -1108,7 +1130,7 @@
   pubnames_buffer = dwarf2_read_section (objfile,
 					 dwarf_pubnames_section);
   pubnames_ptr = pubnames_buffer;
-  while ((pubnames_ptr - pubnames_buffer) < dwarf_pubnames_size)
+  while ((pubnames_ptr - pubnames_buffer) < dwarf2_per_objfile->pubnames_size)
     {
       struct comp_unit_head cu_header;
       int bytes_read;
@@ -1157,6 +1179,99 @@
   return info_ptr;
 }
 
+static char *
+partial_read_comp_unit_head (struct comp_unit_head *header, char *info_ptr,
+			     bfd *abfd)
+{
+  char *beg_of_comp_unit = info_ptr;
+
+  info_ptr = read_comp_unit_head (header, info_ptr, abfd);
+
+  if (header->version != 2)
+    error ("Dwarf Error: wrong version in compilation unit header "
+	   "(is %d, should be %d) [in module %s]", header->version,
+	   2, bfd_get_filename (abfd));
+
+  if (header->abbrev_offset >= dwarf2_per_objfile->abbrev_size)
+    error ("Dwarf Error: bad offset (0x%lx) in compilation unit header "
+	   "(offset 0x%lx + 6) [in module %s]",
+	   (long) header->abbrev_offset,
+	   (long) (beg_of_comp_unit - dwarf2_per_objfile->info_buffer),
+	   bfd_get_filename (abfd));
+
+  if (beg_of_comp_unit + header->length + header->initial_length_size
+      > dwarf2_per_objfile->info_buffer + dwarf2_per_objfile->info_size)
+    error ("Dwarf Error: bad length (0x%lx) in compilation unit header "
+	   "(offset 0x%lx + 0) [in module %s]",
+	   (long) header->length,
+	   (long) (beg_of_comp_unit - dwarf2_per_objfile->info_buffer),
+	   bfd_get_filename (abfd));
+
+  return info_ptr;
+}
+
+/* Allocate a new partial symtab for file named NAME and mark this new
+   partial symtab as being an include of PST.  */
+
+static void
+dwarf2_create_include_psymtab (char *name, struct partial_symtab *pst,
+                               struct objfile *objfile)
+{
+  struct partial_symtab *subpst = allocate_psymtab (name, objfile);
+
+  subpst->section_offsets = pst->section_offsets;
+  subpst->textlow = 0;
+  subpst->texthigh = 0;
+
+  subpst->dependencies = (struct partial_symtab **)
+    obstack_alloc (&objfile->objfile_obstack,
+                   sizeof (struct partial_symtab *));
+  subpst->dependencies[0] = pst;
+  subpst->number_of_dependencies = 1;
+
+  subpst->globals_offset = 0;
+  subpst->n_global_syms = 0;
+  subpst->statics_offset = 0;
+  subpst->n_static_syms = 0;
+  subpst->symtab = NULL;
+  subpst->read_symtab = pst->read_symtab;
+  subpst->readin = 0;
+
+  /* No private part is necessary for include psymtabs.  This property
+     can be used to differentiate between such include psymtabs and
+     the regular ones.  If it ever happens that a regular psymtab can
+     legitimally have a NULL private part, then we'll have to add a
+     dedicated field for that in the dwarf2_pinfo structure.  */
+  subpst->read_symtab_private = NULL;
+}
+
+/* Read the Line Number Program data and extract the list of files
+   included by the source file represented by PST.  Build an include
+   partial symtab for each of these included files.
+   
+   This procedure assumes that there *is* a Line Number Program in
+   the given CU.  Callers should check that PDI->HAS_STMT_LIST is set
+   before calling this procedure.  */
+
+static void
+dwarf2_build_include_psymtabs (struct dwarf2_cu *cu,
+                               struct partial_die_info *pdi,
+                               struct partial_symtab *pst)
+{
+  struct objfile *objfile = cu->objfile;
+  bfd *abfd = objfile->obfd;
+  struct line_header *lh;
+
+  lh = dwarf_decode_line_header (pdi->line_offset, abfd, cu);
+  if (lh == NULL)
+    return;  /* No linetable, so no includes.  */
+
+  dwarf_decode_lines (lh, NULL, abfd, cu, pst);
+
+  free_line_header (lh);
+}
+
+
 /* Build the partial symbol table by doing a quick pass through the
    .debug_info and .debug_abbrev sections.  */
 
@@ -1166,105 +1281,64 @@
   /* Instead of reading this into a big buffer, we should probably use
      mmap()  on architectures that support it. (FIXME) */
   bfd *abfd = objfile->obfd;
-  char *info_ptr, *abbrev_ptr;
+  char *info_ptr;
   char *beg_of_comp_unit;
   struct partial_die_info comp_unit_die;
   struct partial_symtab *pst;
-  struct cleanup *back_to;
   CORE_ADDR lowpc, highpc, baseaddr;
 
-  info_ptr = dwarf_info_buffer;
-  abbrev_ptr = dwarf_abbrev_buffer;
+  info_ptr = dwarf2_per_objfile->info_buffer;
 
-  /* We use dwarf2_tmp_obstack for objects that don't need to survive
-     the partial symbol scan, like attribute values.
-
-     We could reduce our peak memory consumption during partial symbol
-     table construction by freeing stuff from this obstack more often
-     --- say, after processing each compilation unit, or each die ---
-     but it turns out that this saves almost nothing.  For an
-     executable with 11Mb of Dwarf 2 data, I found about 64k allocated
-     on dwarf2_tmp_obstack.  Some investigation showed:
-
-     1) 69% of the attributes used forms DW_FORM_addr, DW_FORM_data*,
-        DW_FORM_flag, DW_FORM_[su]data, and DW_FORM_ref*.  These are
-        all fixed-length values not requiring dynamic allocation.
-
-     2) 30% of the attributes used the form DW_FORM_string.  For
-        DW_FORM_string, read_attribute simply hands back a pointer to
-        the null-terminated string in dwarf_info_buffer, so no dynamic
-        allocation is needed there either.
-
-     3) The remaining 1% of the attributes all used DW_FORM_block1.
-        75% of those were DW_AT_frame_base location lists for
-        functions; the rest were DW_AT_location attributes, probably
-        for the global variables.
-
-     Anyway, what this all means is that the memory the dwarf2
-     reader uses as temporary space reading partial symbols is about
-     0.5% as much as we use for dwarf_*_buffer.  That's noise.  */
-
-  obstack_init (&dwarf2_tmp_obstack);
-  back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);
-
-  /* Since the objects we're extracting from dwarf_info_buffer vary in
+  /* Since the objects we're extracting from .debug_info vary in
      length, only the individual functions to extract them (like
-     read_comp_unit_head and read_partial_die) can really know whether
+     read_comp_unit_head and load_partial_die) can really know whether
      the buffer is large enough to hold another complete object.
 
-     At the moment, they don't actually check that.  If
-     dwarf_info_buffer holds just one extra byte after the last
-     compilation unit's dies, then read_comp_unit_head will happily
-     read off the end of the buffer.  read_partial_die is similarly
-     casual.  Those functions should be fixed.
+     At the moment, they don't actually check that.  If .debug_info
+     holds just one extra byte after the last compilation unit's dies,
+     then read_comp_unit_head will happily read off the end of the
+     buffer.  read_partial_die is similarly casual.  Those functions
+     should be fixed.
 
      For this loop condition, simply checking whether there's any data
      left at all should be sufficient.  */
-  while (info_ptr < dwarf_info_buffer + dwarf_info_size)
+  while (info_ptr < (dwarf2_per_objfile->info_buffer
+		     + dwarf2_per_objfile->info_size))
     {
       struct cleanup *back_to_inner;
       struct dwarf2_cu cu;
+      struct abbrev_info *abbrev;
+      unsigned int bytes_read;
+      struct dwarf2_per_cu_data *this_cu;
+
       beg_of_comp_unit = info_ptr;
 
-      cu.objfile = objfile;
-      info_ptr = read_comp_unit_head (&cu.header, info_ptr, abfd);
+      memset (&cu, 0, sizeof (cu));
 
-      if (cu.header.version != 2)
-	{
-	  error ("Dwarf Error: wrong version in compilation unit header (is %d, should be %d) [in module %s]", cu.header.version, 2, bfd_get_filename (abfd));
-	  return;
-	}
-      if (cu.header.abbrev_offset >= dwarf_abbrev_size)
-	{
-	  error ("Dwarf Error: bad offset (0x%lx) in compilation unit header (offset 0x%lx + 6) [in module %s]",
-		 (long) cu.header.abbrev_offset,
-		 (long) (beg_of_comp_unit - dwarf_info_buffer),
-		 bfd_get_filename (abfd));
-	  return;
-	}
-      if (beg_of_comp_unit + cu.header.length + cu.header.initial_length_size
-	  > dwarf_info_buffer + dwarf_info_size)
-	{
-	  error ("Dwarf Error: bad length (0x%lx) in compilation unit header (offset 0x%lx + 0) [in module %s]",
-		 (long) cu.header.length,
-		 (long) (beg_of_comp_unit - dwarf_info_buffer),
-		 bfd_get_filename (abfd));
-	  return;
-	}
+      obstack_init (&cu.comp_unit_obstack);
+
+      back_to_inner = make_cleanup (free_stack_comp_unit, &cu);
+
+      cu.objfile = objfile;
+      info_ptr = partial_read_comp_unit_head (&cu.header, info_ptr, abfd);
+
       /* Complete the cu_header */
-      cu.header.offset = beg_of_comp_unit - dwarf_info_buffer;
+      cu.header.offset = beg_of_comp_unit - dwarf2_per_objfile->info_buffer;
       cu.header.first_die_ptr = info_ptr;
       cu.header.cu_head_ptr = beg_of_comp_unit;
 
       cu.list_in_scope = &file_symbols;
 
+      cu.partial_dies = NULL;
+
       /* Read the abbrevs for this compilation unit into a table */
       dwarf2_read_abbrevs (abfd, &cu);
-      back_to_inner = make_cleanup (dwarf2_free_abbrev_table, &cu);
+      make_cleanup (dwarf2_free_abbrev_table, &cu);
 
       /* Read the compilation unit die */
-      info_ptr = read_partial_die (&comp_unit_die, abfd, info_ptr,
-				   &cu);
+      abbrev = peek_die_abbrev (info_ptr, &bytes_read, &cu);
+      info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read,
+				   abfd, info_ptr, &cu);
 
       /* Set the language we're debugging */
       set_cu_language (comp_unit_die.language, &cu);
@@ -1276,22 +1350,12 @@
 				  objfile->global_psymbols.next,
 				  objfile->static_psymbols.next);
 
+	  if (comp_unit_die.dirname)
+        pst->dirname = xstrdup (comp_unit_die.dirname);
+
       pst->read_symtab_private = (char *)
 	obstack_alloc (&objfile->objfile_obstack, sizeof (struct dwarf2_pinfo));
-      DWARF_INFO_BUFFER (pst) = dwarf_info_buffer;
-      DWARF_INFO_OFFSET (pst) = beg_of_comp_unit - dwarf_info_buffer;
-      DWARF_ABBREV_BUFFER (pst) = dwarf_abbrev_buffer;
-      DWARF_ABBREV_SIZE (pst) = dwarf_abbrev_size;
-      DWARF_LINE_BUFFER (pst) = dwarf_line_buffer;
-      DWARF_LINE_SIZE (pst) = dwarf_line_size;
-      DWARF_STR_BUFFER (pst) = dwarf_str_buffer;
-      DWARF_STR_SIZE (pst) = dwarf_str_size;
-      DWARF_MACINFO_BUFFER (pst) = dwarf_macinfo_buffer;
-      DWARF_MACINFO_SIZE (pst) = dwarf_macinfo_size;
-      DWARF_RANGES_BUFFER (pst) = dwarf_ranges_buffer;
-      DWARF_RANGES_SIZE (pst) = dwarf_ranges_size;
-      DWARF_LOC_BUFFER (pst) = dwarf_loc_buffer;
-      DWARF_LOC_SIZE (pst) = dwarf_loc_size;
+      DWARF_INFO_OFFSET (pst) = beg_of_comp_unit - dwarf2_per_objfile->info_buffer;
       baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 
       /* Store the function that reads in the rest of the symbol table */
@@ -1302,17 +1366,20 @@
          If not, there's no more debug_info for this comp unit. */
       if (comp_unit_die.has_children)
 	{
+	  struct partial_die_info *first_die;
+
 	  lowpc = ((CORE_ADDR) -1);
 	  highpc = ((CORE_ADDR) 0);
 
-	  info_ptr = scan_partial_symbols (info_ptr, &lowpc, &highpc,
-					   &cu, NULL);
+	  first_die = load_partial_dies (abfd, info_ptr, 1, &cu);
+
+	  scan_partial_symbols (first_die, &lowpc, &highpc, &cu);
 
 	  /* If we didn't find a lowpc, set it to highpc to avoid
 	     complaints from `maint check'.  */
 	  if (lowpc == ((CORE_ADDR) -1))
 	    lowpc = highpc;
-	  
+
 	  /* If the compilation unit didn't have an explicit address range,
 	     then use the information extracted from its child dies.  */
 	  if (! comp_unit_die.has_pc_info)
@@ -1335,155 +1402,226 @@
          also happen.) This happens in VxWorks.  */
       free_named_symtabs (pst->filename);
 
-      info_ptr = beg_of_comp_unit + cu.header.length 
+      if (comp_unit_die.has_stmt_list)
+        {
+          /* Get the list of files included in the current compilation unit,
+             and build a psymtab for each of them.  */
+          dwarf2_build_include_psymtabs (&cu, &comp_unit_die, pst);
+        }
+
+      info_ptr = beg_of_comp_unit + cu.header.length
                                   + cu.header.initial_length_size;
 
       do_cleanups (back_to_inner);
     }
-  do_cleanups (back_to);
 }
 
-/* Read in all interesting dies to the end of the compilation unit or
-   to the end of the current namespace.  NAMESPACE is NULL if we
-   haven't yet encountered any DW_TAG_namespace entries; otherwise,
-   it's the name of the current namespace.  In particular, it's the
-   empty string if we're currently in the global namespace but have
-   previously encountered a DW_TAG_namespace.  */
+/* Process all loaded DIEs for compilation unit CU, starting at FIRST_DIE.
+   Also set *LOWPC and *HIGHPC to the lowest and highest PC values found
+   in CU.  */
 
-static char *
-scan_partial_symbols (char *info_ptr, CORE_ADDR *lowpc,
-		      CORE_ADDR *highpc, struct dwarf2_cu *cu,
-		      const char *namespace)
+static void
+scan_partial_symbols (struct partial_die_info *first_die, CORE_ADDR *lowpc,
+		      CORE_ADDR *highpc, struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->objfile;
   bfd *abfd = objfile->obfd;
-  struct partial_die_info pdi;
+  struct partial_die_info *pdi;
 
   /* Now, march along the PDI's, descending into ones which have
      interesting children but skipping the children of the other ones,
      until we reach the end of the compilation unit.  */
 
-  while (1)
-    {
-      /* This flag tells whether or not info_ptr has gotten updated
-	 inside the loop.  */
-      int info_ptr_updated = 0;
+  pdi = first_die;
 
-      info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu);
+  while (pdi != NULL)
+    {
+      fixup_partial_die (pdi, cu);
 
       /* Anonymous namespaces have no name but have interesting
 	 children, so we need to look at them.  Ditto for anonymous
 	 enums.  */
 
-      if (pdi.name != NULL || pdi.tag == DW_TAG_namespace
-	  || pdi.tag == DW_TAG_enumeration_type)
+      if (pdi->name != NULL || pdi->tag == DW_TAG_namespace
+	  || pdi->tag == DW_TAG_enumeration_type)
 	{
-	  switch (pdi.tag)
+	  switch (pdi->tag)
 	    {
 	    case DW_TAG_subprogram:
-	      if (pdi.has_pc_info)
+	      if (pdi->has_pc_info)
 		{
-		  if (pdi.lowpc < *lowpc)
+		  if (pdi->lowpc < *lowpc)
 		    {
-		      *lowpc = pdi.lowpc;
+		      *lowpc = pdi->lowpc;
 		    }
-		  if (pdi.highpc > *highpc)
+		  if (pdi->highpc > *highpc)
 		    {
-		      *highpc = pdi.highpc;
+		      *highpc = pdi->highpc;
 		    }
-		  if (!pdi.is_declaration)
+		  if (!pdi->is_declaration)
 		    {
-		      add_partial_symbol (&pdi, cu, namespace);
+		      add_partial_symbol (pdi, cu);
 		    }
 		}
 	      break;
 	    case DW_TAG_variable:
 	    case DW_TAG_typedef:
 	    case DW_TAG_union_type:
-	      if (!pdi.is_declaration)
+	      if (!pdi->is_declaration)
 		{
-		  add_partial_symbol (&pdi, cu, namespace);
+		  add_partial_symbol (pdi, cu);
 		}
 	      break;
 	    case DW_TAG_class_type:
 	    case DW_TAG_structure_type:
-	      if (!pdi.is_declaration)
+	      if (!pdi->is_declaration)
 		{
-		  info_ptr = add_partial_structure (&pdi, info_ptr, cu,
-						    namespace);
-		  info_ptr_updated = 1;
+		  add_partial_symbol (pdi, cu);
 		}
 	      break;
 	    case DW_TAG_enumeration_type:
-	      if (!pdi.is_declaration)
-		{
-		  info_ptr = add_partial_enumeration (&pdi, info_ptr, cu,
-						      namespace);
-		  info_ptr_updated = 1;
-		}
+	      if (!pdi->is_declaration)
+		add_partial_enumeration (pdi, cu);
 	      break;
 	    case DW_TAG_base_type:
             case DW_TAG_subrange_type:
 	      /* File scope base type definitions are added to the partial
 	         symbol table.  */
-	      add_partial_symbol (&pdi, cu, namespace);
+	      add_partial_symbol (pdi, cu);
 	      break;
 	    case DW_TAG_namespace:
-	      /* We've hit a DW_TAG_namespace entry, so we know this
-		 file has been compiled using a compiler that
-		 generates them; update NAMESPACE to reflect that.  */
-	      if (namespace == NULL)
-		namespace = "";
-	      info_ptr = add_partial_namespace (&pdi, info_ptr, lowpc, highpc,
-						cu, namespace);
-	      info_ptr_updated = 1;
+	      add_partial_namespace (pdi, lowpc, highpc, cu);
 	      break;
 	    default:
 	      break;
 	    }
 	}
 
-      if (pdi.tag == 0)
-	break;
+      /* If the die has a sibling, skip to the sibling.  */
 
-      /* If the die has a sibling, skip to the sibling, unless another
-	 function has already updated info_ptr for us.  */
+      pdi = pdi->die_sibling;
+    }
+}
 
-      /* NOTE: carlton/2003-06-16: This is a bit hackish, but whether
-	 or not we want to update this depends on enough stuff (not
-	 only pdi.tag but also whether or not pdi.name is NULL) that
-	 this seems like the easiest way to handle the issue.  */
+/* Functions used to compute the fully scoped name of a partial DIE.
 
-      if (!info_ptr_updated)
-	info_ptr = locate_pdi_sibling (&pdi, info_ptr, abfd, cu);
+   Normally, this is simple.  For C++, the parent DIE's fully scoped
+   name is concatenated with "::" and the partial DIE's name.
+   Enumerators are an exception; they use the scope of their parent
+   enumeration type, i.e. the name of the enumeration type is not
+   prepended to the enumerator.
+
+   There are two complexities.  One is DW_AT_specification; in this
+   case "parent" means the parent of the target of the specification,
+   instead of the direct parent of the DIE.  The other is compilers
+   which do not emit DW_TAG_namespace; in this case we try to guess
+   the fully qualified name of structure types from their members'
+   linkage names.  This must be done using the DIE's children rather
+   than the children of any DW_AT_specification target.  We only need
+   to do this for structures at the top level, i.e. if the target of
+   any DW_AT_specification (if any; otherwise the DIE itself) does not
+   have a parent.  */
+
+/* Compute the scope prefix associated with PDI's parent, in
+   compilation unit CU.  The result will be allocated on CU's
+   comp_unit_obstack, or a copy of the already allocated PDI->NAME
+   field.  NULL is returned if no prefix is necessary.  */
+static char *
+partial_die_parent_scope (struct partial_die_info *pdi,
+			  struct dwarf2_cu *cu)
+{
+  char *grandparent_scope;
+  struct partial_die_info *parent, *real_pdi;
+  struct dwarf2_cu *spec_cu;
+
+  /* We need to look at our parent DIE; if we have a DW_AT_specification,
+     then this means the parent of the specification DIE.  */
+
+  real_pdi = pdi;
+  spec_cu = cu;
+  while (real_pdi->has_specification)
+    real_pdi = find_partial_die (real_pdi->spec_offset, spec_cu, &spec_cu);
+
+  parent = real_pdi->die_parent;
+  if (parent == NULL)
+    return NULL;
+
+  if (parent->scope_set)
+    return parent->scope;
+
+  fixup_partial_die (parent, cu);
+
+  grandparent_scope = partial_die_parent_scope (parent, spec_cu);
+
+  if (parent->tag == DW_TAG_namespace
+      || parent->tag == DW_TAG_structure_type
+      || parent->tag == DW_TAG_class_type
+      || parent->tag == DW_TAG_union_type)
+    {
+      if (grandparent_scope == NULL)
+	parent->scope = parent->name;
+      else
+	parent->scope = obconcat (&cu->comp_unit_obstack, grandparent_scope,
+				  "::", parent->name);
+    }
+  else if (parent->tag == DW_TAG_enumeration_type)
+    /* Enumerators should not get the name of the enumeration as a prefix.  */
+    parent->scope = grandparent_scope;
+  else
+    {
+      /* FIXME drow/2004-04-01: What should we be doing with
+	 function-local names?  For partial symbols, we should probably be
+	 ignoring them.  */
+      complaint (&symfile_complaints,
+		 "unhandled containing DIE tag %d for DIE at %d",
+		 parent->tag, pdi->offset);
+      parent->scope = grandparent_scope;
     }
 
-  return info_ptr;
+  parent->scope_set = 1;
+  return parent->scope;
+}
+
+/* Return the fully scoped name associated with PDI, from compilation unit
+   CU.  The result will be allocated with malloc.  */
+static char *
+partial_die_full_name (struct partial_die_info *pdi,
+		       struct dwarf2_cu *cu)
+{
+  char *parent_scope;
+
+  parent_scope = partial_die_parent_scope (pdi, cu);
+  if (parent_scope == NULL)
+    return NULL;
+  else
+    return concat (parent_scope, "::", pdi->name, NULL);
 }
 
 static void
-add_partial_symbol (struct partial_die_info *pdi,
-		    struct dwarf2_cu *cu, const char *namespace)
+add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->objfile;
   CORE_ADDR addr = 0;
-  char *actual_name = pdi->name;
+  char *actual_name;
+  const char *my_prefix;
   const struct partial_symbol *psym = NULL;
   CORE_ADDR baseaddr;
+  int built_actual_name = 0;
 
   baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 
-  /* If we're not in the global namespace and if the namespace name
-     isn't encoded in a mangled actual_name, add it.  */
-  
-  if (pdi_needs_namespace (pdi->tag, namespace))
+  actual_name = NULL;
+
+  if (pdi_needs_namespace (pdi->tag))
     {
-      actual_name = alloca (strlen (pdi->name) + 2 + strlen (namespace) + 1);
-      strcpy (actual_name, namespace);
-      strcat (actual_name, "::");
-      strcat (actual_name, pdi->name);
+      actual_name = partial_die_full_name (pdi, cu);
+      if (actual_name)
+	built_actual_name = 1;
     }
 
+  if (actual_name == NULL)
+    actual_name = pdi->name;
+
   switch (pdi->tag)
     {
     case DW_TAG_subprogram:
@@ -1556,6 +1694,12 @@
 			   &objfile->static_psymbols,
 			   0, (CORE_ADDR) 0, cu->language, objfile);
       break;
+    case DW_TAG_namespace:
+      add_psymbol_to_list (actual_name, strlen (actual_name),
+			   VAR_DOMAIN, LOC_TYPEDEF,
+			   &objfile->global_psymbols,
+			   0, (CORE_ADDR) 0, cu->language, objfile);
+      break;
     case DW_TAG_class_type:
     case DW_TAG_structure_type:
     case DW_TAG_union_type:
@@ -1600,26 +1744,30 @@
      (otherwise we'll have psym == NULL), and if we actually had a
      mangled name to begin with.  */
 
+  /* FIXME drow/2004-02-22: Why don't we do this for classes, i.e. the
+     cases which do not set PSYM above?  */
+
   if (cu->language == language_cplus
-      && namespace == NULL
+      && cu->has_namespace_info == 0
       && psym != NULL
       && SYMBOL_CPLUS_DEMANGLED_NAME (psym) != NULL)
     cp_check_possible_namespace_symbols (SYMBOL_CPLUS_DEMANGLED_NAME (psym),
 					 objfile);
+
+  if (built_actual_name)
+    xfree (actual_name);
 }
 
-/* Determine whether a die of type TAG living in the C++ namespace
-   NAMESPACE needs to have the name of the namespace prepended to the
+/* Determine whether a die of type TAG living in a C++ class or
+   namespace needs to have the name of the scope prepended to the
    name listed in the die.  */
 
 static int
-pdi_needs_namespace (enum dwarf_tag tag, const char *namespace)
+pdi_needs_namespace (enum dwarf_tag tag)
 {
-  if (namespace == NULL || namespace[0] == '\0')
-    return 0;
-
   switch (tag)
     {
+    case DW_TAG_namespace:
     case DW_TAG_typedef:
     case DW_TAG_class_type:
     case DW_TAG_structure_type:
@@ -1636,140 +1784,102 @@
    corresponding to that namespace to the symbol table.  NAMESPACE is
    the name of the enclosing namespace.  */
 
-static char *
-add_partial_namespace (struct partial_die_info *pdi, char *info_ptr,
+static void
+add_partial_namespace (struct partial_die_info *pdi,
 		       CORE_ADDR *lowpc, CORE_ADDR *highpc,
-		       struct dwarf2_cu *cu, const char *namespace)
+		       struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->objfile;
-  const char *new_name = pdi->name;
-  char *full_name;
 
-  /* Calculate the full name of the namespace that we just entered.  */
+  /* Add a symbol for the namespace.  */
 
-  if (new_name == NULL)
-    new_name = "(anonymous namespace)";
-  full_name = alloca (strlen (namespace) + 2 + strlen (new_name) + 1);
-  strcpy (full_name, namespace);
-  if (*namespace != '\0')
-    strcat (full_name, "::");
-  strcat (full_name, new_name);
-
-  /* FIXME: carlton/2003-10-07: We can't just replace this by a call
-     to add_partial_symbol, because we don't have a way to pass in the
-     full name to that function; that might be a flaw in
-     add_partial_symbol's interface.  */
-
-  add_psymbol_to_list (full_name, strlen (full_name),
-		       VAR_DOMAIN, LOC_TYPEDEF,
-		       &objfile->global_psymbols,
-		       0, 0, cu->language, objfile);
+  add_partial_symbol (pdi, cu);
 
   /* Now scan partial symbols in that namespace.  */
 
   if (pdi->has_children)
-    info_ptr = scan_partial_symbols (info_ptr, lowpc, highpc, cu, full_name);
-
-  return info_ptr;
+    scan_partial_symbols (pdi->die_child, lowpc, highpc, cu);
 }
 
-/* Read a partial die corresponding to a class or structure.  */
+/* See if we can figure out if the class lives in a namespace.  We do
+   this by looking for a member function; its demangled name will
+   contain namespace info, if there is any.  */
 
-static char *
-add_partial_structure (struct partial_die_info *struct_pdi, char *info_ptr,
-		       struct dwarf2_cu *cu,
-		       const char *namespace)
+static void
+guess_structure_name (struct partial_die_info *struct_pdi,
+		      struct dwarf2_cu *cu)
 {
-  bfd *abfd = cu->objfile->obfd;
-  char *actual_class_name = NULL;
-
   if (cu->language == language_cplus
-      && (namespace == NULL || namespace[0] == '\0')
-      && struct_pdi->name != NULL
+      && cu->has_namespace_info == 0
       && struct_pdi->has_children)
     {
-      /* See if we can figure out if the class lives in a namespace
-	 (or is nested within another class.)  We do this by looking
-	 for a member function; its demangled name will contain
-	 namespace info, if there is any.  */
-
       /* NOTE: carlton/2003-10-07: Getting the info this way changes
 	 what template types look like, because the demangler
 	 frequently doesn't give the same name as the debug info.  We
 	 could fix this by only using the demangled name to get the
 	 prefix (but see comment in read_structure_type).  */
 
-      /* FIXME: carlton/2004-01-23: If NAMESPACE equals "", we have
-	 the appropriate debug information, so it would be nice to be
-	 able to avoid this hack.  But NAMESPACE may not be the
-	 namespace where this class was defined: NAMESPACE reflects
-	 where STRUCT_PDI occurs in the tree of dies, but because of
-	 DW_AT_specification, that may not actually tell us where the
-	 class is defined.  (See the comment in read_func_scope for an
-	 example of how this could occur.)
+      struct partial_die_info *child_pdi = struct_pdi->die_child;
+      struct partial_die_info *real_pdi;
+      struct dwarf2_cu *spec_cu;
 
-         Unfortunately, our current partial symtab data structures are
-         completely unable to deal with DW_AT_specification.  So, for
-         now, the best thing to do is to get nesting information from
-         places other than the tree structure of dies if there's any
-         chance that a DW_AT_specification is involved. :-( */
+      /* If this DIE (this DIE's specification, if any) has a parent, then
+	 we should not do this.  We'll prepend the parent's fully qualified
+         name when we create the partial symbol.  */
 
-      char *next_child = info_ptr;
+      real_pdi = struct_pdi;
+      spec_cu = cu;
+      while (real_pdi->has_specification)
+	real_pdi = find_partial_die (real_pdi->spec_offset, spec_cu, &spec_cu);
 
-      while (1)
+      if (real_pdi->die_parent != NULL)
+	return;
+
+      while (child_pdi != NULL)
 	{
-	  struct partial_die_info child_pdi;
-
-	  next_child = read_partial_die (&child_pdi, abfd, next_child,
-					 cu);
-	  if (!child_pdi.tag)
-	    break;
-	  if (child_pdi.tag == DW_TAG_subprogram)
+	  if (child_pdi->tag == DW_TAG_subprogram)
 	    {
-	      actual_class_name = class_name_from_physname (child_pdi.name);
+	      char *actual_class_name
+		= language_class_name_from_physname (cu->language_defn,
+						     child_pdi->name);
 	      if (actual_class_name != NULL)
-		struct_pdi->name = actual_class_name;
+		{
+		  struct_pdi->name
+		    = obsavestring (actual_class_name,
+				    strlen (actual_class_name),
+				    &cu->comp_unit_obstack);
+		  xfree (actual_class_name);
+		}
 	      break;
 	    }
-	  else
-	    {
-	      next_child = locate_pdi_sibling (&child_pdi, next_child,
-					       abfd, cu);
-	    }
+
+	  child_pdi = child_pdi->die_sibling;
 	}
     }
-
-  add_partial_symbol (struct_pdi, cu, namespace);
-  xfree (actual_class_name);
-
-  return locate_pdi_sibling (struct_pdi, info_ptr, abfd, cu);
 }
 
 /* Read a partial die corresponding to an enumeration type.  */
 
-static char *
-add_partial_enumeration (struct partial_die_info *enum_pdi, char *info_ptr,
-			 struct dwarf2_cu *cu, const char *namespace)
+static void
+add_partial_enumeration (struct partial_die_info *enum_pdi,
+			 struct dwarf2_cu *cu)
 {
   struct objfile *objfile = cu->objfile;
   bfd *abfd = objfile->obfd;
-  struct partial_die_info pdi;
+  struct partial_die_info *pdi;
 
   if (enum_pdi->name != NULL)
-    add_partial_symbol (enum_pdi, cu, namespace);
-  
-  while (1)
+    add_partial_symbol (enum_pdi, cu);
+
+  pdi = enum_pdi->die_child;
+  while (pdi)
     {
-      info_ptr = read_partial_die (&pdi, abfd, info_ptr, cu);
-      if (pdi.tag == 0)
-	break;
-      if (pdi.tag != DW_TAG_enumerator || pdi.name == NULL)
+      if (pdi->tag != DW_TAG_enumerator || pdi->name == NULL)
 	complaint (&symfile_complaints, "malformed enumerator DIE ignored");
       else
-	add_partial_symbol (&pdi, cu, namespace);
+	add_partial_symbol (pdi, cu);
+      pdi = pdi->die_sibling;
     }
-
-  return info_ptr;
 }
 
 /* Read the initial uleb128 in the die at INFO_PTR in compilation unit CU.
@@ -1844,7 +1954,8 @@
 	  if (attr.form == DW_FORM_ref_addr)
 	    complaint (&symfile_complaints, "ignoring absolute DW_AT_sibling");
 	  else
-	    return dwarf_info_buffer + dwarf2_get_ref_die_offset (&attr, cu);
+	    return dwarf2_per_objfile->info_buffer
+	      + dwarf2_get_ref_die_offset (&attr, cu);
 	}
 
       /* If it isn't DW_AT_sibling, skip this attribute.  */
@@ -1926,7 +2037,7 @@
 		    bfd *abfd, struct dwarf2_cu *cu)
 {
   /* Do we know the sibling already?  */
-  
+
   if (orig_pdi->sibling)
     return orig_pdi->sibling;
 
@@ -1984,30 +2095,46 @@
   struct cleanup *back_to;
   struct attribute *attr;
   CORE_ADDR baseaddr;
+  int i;
+
+  for (i = 0; i < pst->number_of_dependencies; i++)
+    if (!pst->dependencies[i]->readin)
+      {
+        /* Inform about additional files that need to be read in.  */
+        if (info_verbose)
+          {
+            fputs_filtered (" ", gdb_stdout);
+            wrap_here ("");
+            fputs_filtered ("and ", gdb_stdout);
+            wrap_here ("");
+            printf_filtered ("%s...", pst->dependencies[i]->filename);
+            wrap_here ("");     /* Flush output */
+            gdb_flush (gdb_stdout);
+          }
+        psymtab_to_symtab_1 (pst->dependencies[i]);
+      }
+
+  if (pst->read_symtab_private == NULL)
+    {
+      /* It's an include file, no symbols to read for it.
+         Everything is in the parent symtab.  */
+      pst->readin = 1;
+      return;
+    }
+
+  dwarf2_per_objfile = objfile_data (pst->objfile, dwarf2_objfile_data_key);
 
   /* Set local variables from the partial symbol table info.  */
   offset = DWARF_INFO_OFFSET (pst);
-  dwarf_info_buffer = DWARF_INFO_BUFFER (pst);
-  dwarf_abbrev_buffer = DWARF_ABBREV_BUFFER (pst);
-  dwarf_abbrev_size = DWARF_ABBREV_SIZE (pst);
-  dwarf_line_buffer = DWARF_LINE_BUFFER (pst);
-  dwarf_line_size = DWARF_LINE_SIZE (pst);
-  dwarf_str_buffer = DWARF_STR_BUFFER (pst);
-  dwarf_str_size = DWARF_STR_SIZE (pst);
-  dwarf_macinfo_buffer = DWARF_MACINFO_BUFFER (pst);
-  dwarf_macinfo_size = DWARF_MACINFO_SIZE (pst);
-  dwarf_ranges_buffer = DWARF_RANGES_BUFFER (pst);
-  dwarf_ranges_size = DWARF_RANGES_SIZE (pst);
-  dwarf_loc_buffer = DWARF_LOC_BUFFER (pst);
-  dwarf_loc_size = DWARF_LOC_SIZE (pst);
-  info_ptr = dwarf_info_buffer + offset;
+
+  info_ptr = dwarf2_per_objfile->info_buffer + offset;
   baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 
   /* We're in the global namespace.  */
   processing_current_prefix = "";
 
-  obstack_init (&dwarf2_tmp_obstack);
-  back_to = make_cleanup (dwarf2_free_tmp_obstack, NULL);
+  obstack_init (&cu.comp_unit_obstack);
+  back_to = make_cleanup (free_stack_comp_unit, &cu);
 
   buildsym_init ();
   make_cleanup (really_free_pendings, NULL);
@@ -2229,13 +2356,6 @@
 	}
     }
 
-  if (objfile->ei.entry_point >= lowpc &&
-      objfile->ei.entry_point < highpc)
-    {
-      objfile->ei.deprecated_entry_file_lowpc = lowpc;
-      objfile->ei.deprecated_entry_file_highpc = highpc;
-    }
-
   attr = dwarf2_attr (die, DW_AT_language, cu);
   if (attr)
     {
@@ -2282,7 +2402,7 @@
         {
           make_cleanup ((make_cleanup_ftype *) free_line_header,
                         (void *) line_header);
-          dwarf_decode_lines (line_header, comp_dir, abfd, cu);
+          dwarf_decode_lines (line_header, comp_dir, abfd, cu, NULL);
         }
     }
 
@@ -2307,7 +2427,7 @@
   struct function_range *thisfn;
 
   thisfn = (struct function_range *)
-    obstack_alloc (&dwarf2_tmp_obstack, sizeof (struct function_range));
+    obstack_alloc (&cu->comp_unit_obstack, sizeof (struct function_range));
   thisfn->name = name;
   thisfn->lowpc = lowpc;
   thisfn->highpc = highpc;
@@ -2385,13 +2505,6 @@
   /* Record the function range for dwarf_decode_lines.  */
   add_to_cu_func_list (name, lowpc, highpc, cu);
 
-  if (objfile->ei.entry_point >= lowpc &&
-      objfile->ei.entry_point < highpc)
-    {
-      objfile->ei.entry_func_lowpc = lowpc;
-      objfile->ei.entry_func_highpc = highpc;
-    }
-
   new = push_context (0, lowpc);
   new->name = new_symbol (die, die->type, cu);
 
@@ -2538,14 +2651,14 @@
 	  found_base = cu_header->base_known;
 	  base = cu_header->base_address;
 
-	  if (offset >= dwarf_ranges_size)
+	  if (offset >= dwarf2_per_objfile->ranges_size)
 	    {
 	      complaint (&symfile_complaints,
 	                 "Offset %d out of bounds for DW_AT_ranges attribute",
 			 offset);
 	      return 0;
 	    }
-	  buffer = dwarf_ranges_buffer + offset;
+	  buffer = dwarf2_per_objfile->ranges_buffer + offset;
 
 	  /* Read in the largest possible address.  */
 	  marker = read_address (obfd, buffer, cu, &dummy);
@@ -3219,6 +3332,9 @@
       TYPE_LENGTH (type) = 0;
     }
 
+  if (die_is_declaration (die, cu))
+    TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
+
   /* We need to add the type field to the die immediately so we don't
      infinitely recurse when dealing with pointers to the structure
      type within the structure itself. */
@@ -3315,11 +3431,6 @@
 
       do_cleanups (back_to);
     }
-  else
-    {
-      /* No children, must be stub. */
-      TYPE_FLAGS (type) |= TYPE_FLAG_STUB;
-    }
 
   processing_current_prefix = previous_prefix;
   if (back_to != NULL)
@@ -3436,7 +3547,7 @@
 
   /* If we don't have namespace debug info, guess the name by trying
      to demangle the names of members, just like we did in
-     add_partial_structure.  */
+     guess_structure_name.  */
   if (!processing_has_namespace_info)
     {
       struct die_info *child;
@@ -3447,7 +3558,9 @@
 	{
 	  if (child->tag == DW_TAG_subprogram)
 	    {
-	      new_prefix = class_name_from_physname (dwarf2_linkage_name
+	      new_prefix 
+		= language_class_name_from_physname (cu->language_defn,
+						     dwarf2_linkage_name
 						     (child, cu));
 
 	      if (new_prefix != NULL)
@@ -4347,7 +4460,7 @@
 {
   bfd *abfd = objfile->obfd;
   char *buf, *retbuf;
-  bfd_size_type size = bfd_get_section_size_before_reloc (sectp);
+  bfd_size_type size = bfd_get_section_size (sectp);
 
   if (size == 0)
     return NULL;
@@ -4369,7 +4482,8 @@
 /* In DWARF version 2, the description of the debugging information is
    stored in a separate .debug_abbrev section.  Before we read any
    dies from a section we read in all abbreviations and install them
-   in a hash table.  */
+   in a hash table.  This function also sets flags in CU describing
+   the data found in the abbrev table.  */
 
 static void
 dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu)
@@ -4390,7 +4504,7 @@
   memset (cu->dwarf2_abbrevs, 0,
           ABBREV_HASH_SIZE * sizeof (struct abbrev_info *));
 
-  abbrev_ptr = dwarf_abbrev_buffer + cu_header->abbrev_offset;
+  abbrev_ptr = dwarf2_per_objfile->abbrev_buffer + cu_header->abbrev_offset;
   abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
   abbrev_ptr += bytes_read;
 
@@ -4409,6 +4523,9 @@
       cur_abbrev->has_children = read_1_byte (abfd, abbrev_ptr);
       abbrev_ptr += 1;
 
+      if (cur_abbrev->tag == DW_TAG_namespace)
+	cu->has_namespace_info = 1;
+
       /* now read in declarations */
       abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
       abbrev_ptr += bytes_read;
@@ -4448,8 +4565,8 @@
          already read (which means we are about to read the abbreviations
          for the next compile unit) or if the end of the abbreviation
          table is reached.  */
-      if ((unsigned int) (abbrev_ptr - dwarf_abbrev_buffer)
-	  >= dwarf_abbrev_size)
+      if ((unsigned int) (abbrev_ptr - dwarf2_per_objfile->abbrev_buffer)
+	  >= dwarf2_per_objfile->abbrev_size)
 	break;
       abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
       abbrev_ptr += bytes_read;
@@ -4492,36 +4609,257 @@
   return NULL;
 }
 
+/* Returns nonzero if TAG represents a type that we might generate a partial
+   symbol for.  */
+
+static int
+is_type_tag_for_partial (int tag)
+{
+  switch (tag)
+    {
+#if 0
+    /* Some types that would be reasonable to generate partial symbols for,
+       that we don't at present.  */
+    case DW_TAG_array_type:
+    case DW_TAG_file_type:
+    case DW_TAG_ptr_to_member_type:
+    case DW_TAG_set_type:
+    case DW_TAG_string_type:
+    case DW_TAG_subroutine_type:
+#endif
+    case DW_TAG_base_type:
+    case DW_TAG_class_type:
+    case DW_TAG_enumeration_type:
+    case DW_TAG_structure_type:
+    case DW_TAG_subrange_type:
+    case DW_TAG_typedef:
+    case DW_TAG_union_type:
+      return 1;
+    default:
+      return 0;
+    }
+}
+
+/* Load all DIEs that are interesting for partial symbols into memory.  */
+
+static struct partial_die_info *
+load_partial_dies (bfd *abfd, char *info_ptr, int building_psymtab,
+		   struct dwarf2_cu *cu)
+{
+  struct partial_die_info *part_die;
+  struct partial_die_info *parent_die, *last_die, *first_die = NULL;
+  struct abbrev_info *abbrev;
+  unsigned int bytes_read;
+
+  int nesting_level = 1;
+
+  parent_die = NULL;
+  last_die = NULL;
+
+  cu->partial_dies
+    = htab_create_alloc_ex (cu->header.length / 12,
+			    partial_die_hash,
+			    partial_die_eq,
+			    NULL,
+			    &cu->comp_unit_obstack,
+			    hashtab_obstack_allocate,
+			    dummy_obstack_deallocate);
+
+  part_die = obstack_alloc (&cu->comp_unit_obstack,
+			    sizeof (struct partial_die_info));
+
+  while (1)
+    {
+      abbrev = peek_die_abbrev (info_ptr, &bytes_read, cu);
+
+      /* A NULL abbrev means the end of a series of children.  */
+      if (abbrev == NULL)
+	{
+	  if (--nesting_level == 0)
+	    {
+	      /* PART_DIE was probably the last thing allocated on the
+		 comp_unit_obstack, so we could call obstack_free
+		 here.  We don't do that because the waste is small,
+		 and will be cleaned up when we're done with this
+		 compilation unit.  This way, we're also more robust
+		 against other users of the comp_unit_obstack.  */
+	      return first_die;
+	    }
+	  info_ptr += bytes_read;
+	  last_die = parent_die;
+	  parent_die = parent_die->die_parent;
+	  continue;
+	}
+
+      /* Check whether this DIE is interesting enough to save.  */
+      if (!is_type_tag_for_partial (abbrev->tag)
+	  && abbrev->tag != DW_TAG_enumerator
+	  && abbrev->tag != DW_TAG_subprogram
+	  && abbrev->tag != DW_TAG_variable
+	  && abbrev->tag != DW_TAG_namespace)
+	{
+	  /* Otherwise we skip to the next sibling, if any.  */
+	  info_ptr = skip_one_die (info_ptr + bytes_read, abbrev, cu);
+	  continue;
+	}
+
+      info_ptr = read_partial_die (part_die, abbrev, bytes_read,
+				   abfd, info_ptr, cu);
+
+      /* This two-pass algorithm for processing partial symbols has a
+	 high cost in cache pressure.  Thus, handle some simple cases
+	 here which cover the majority of C partial symbols.  DIEs
+	 which neither have specification tags in them, nor could have
+	 specification tags elsewhere pointing at them, can simply be
+	 processed and discarded.
+
+	 This segment is also optional; scan_partial_symbols and
+	 add_partial_symbol will handle these DIEs if we chain
+	 them in normally.  When compilers which do not emit large
+	 quantities of duplicate debug information are more common,
+	 this code can probably be removed.  */
+
+      /* Any complete simple types at the top level (pretty much all
+	 of them, for a language without namespaces), can be processed
+	 directly.  */
+      if (parent_die == NULL
+	  && part_die->has_specification == 0
+	  && part_die->is_declaration == 0
+	  && (part_die->tag == DW_TAG_typedef
+	      || part_die->tag == DW_TAG_base_type
+	      || part_die->tag == DW_TAG_subrange_type))
+	{
+	  if (building_psymtab && part_die->name != NULL)
+	    add_psymbol_to_list (part_die->name, strlen (part_die->name),
+				 VAR_DOMAIN, LOC_TYPEDEF,
+				 &cu->objfile->static_psymbols,
+				 0, (CORE_ADDR) 0, cu->language, cu->objfile);
+	  info_ptr = locate_pdi_sibling (part_die, info_ptr, abfd, cu);
+	  continue;
+	}
+
+      /* If we're at the second level, and we're an enumerator, and
+	 our parent has no specification (meaning possibly lives in a
+	 namespace elsewhere), then we can add the partial symbol now
+	 instead of queueing it.  */
+      if (part_die->tag == DW_TAG_enumerator
+	  && parent_die != NULL
+	  && parent_die->die_parent == NULL
+	  && parent_die->tag == DW_TAG_enumeration_type
+	  && parent_die->has_specification == 0)
+	{
+	  if (part_die->name == NULL)
+	    complaint (&symfile_complaints, "malformed enumerator DIE ignored");
+	  else if (building_psymtab)
+	    add_psymbol_to_list (part_die->name, strlen (part_die->name),
+				 VAR_DOMAIN, LOC_CONST,
+				 cu->language == language_cplus
+				 ? &cu->objfile->global_psymbols
+				 : &cu->objfile->static_psymbols,
+				 0, (CORE_ADDR) 0, cu->language, cu->objfile);
+
+	  info_ptr = locate_pdi_sibling (part_die, info_ptr, abfd, cu);
+	  continue;
+	}
+
+      /* We'll save this DIE so link it in.  */
+      part_die->die_parent = parent_die;
+      part_die->die_sibling = NULL;
+      part_die->die_child = NULL;
+
+      if (last_die && last_die == parent_die)
+	last_die->die_child = part_die;
+      else if (last_die)
+	last_die->die_sibling = part_die;
+
+      last_die = part_die;
+
+      if (first_die == NULL)
+	first_die = part_die;
+
+      /* Maybe add the DIE to the hash table.  Not all DIEs that we
+	 find interesting need to be in the hash table, because we
+	 also have the parent/sibling/child chains; only those that we
+	 might refer to by offset later during partial symbol reading.
+
+	 For now this means things that might have be the target of a
+	 DW_AT_specification, DW_AT_abstract_origin, or
+	 DW_AT_extension.  DW_AT_extension will refer only to
+	 namespaces; DW_AT_abstract_origin refers to functions (and
+	 many things under the function DIE, but we do not recurse
+	 into function DIEs during partial symbol reading) and
+	 possibly variables as well; DW_AT_specification refers to
+	 declarations.  Declarations ought to have the DW_AT_declaration
+	 flag.  It happens that GCC forgets to put it in sometimes, but
+	 only for functions, not for types.
+
+	 Adding more things than necessary to the hash table is harmless
+	 except for the performance cost.  Adding too few will result in
+	 internal errors in find_partial_die.  */
+
+      if (abbrev->tag == DW_TAG_subprogram
+	  || abbrev->tag == DW_TAG_variable
+	  || abbrev->tag == DW_TAG_namespace
+	  || part_die->is_declaration)
+	{
+	  void **slot;
+
+	  slot = htab_find_slot_with_hash (cu->partial_dies, part_die,
+					   part_die->offset, INSERT);
+	  *slot = part_die;
+	}
+
+      part_die = obstack_alloc (&cu->comp_unit_obstack,
+				sizeof (struct partial_die_info));
+
+      /* For some DIEs we want to follow their children (if any).  For C
+         we have no reason to follow the children of structures; for other
+	 languages we have to, both so that we can get at method physnames
+	 to infer fully qualified class names, and for DW_AT_specification.  */
+      if (last_die->has_children
+	  && (last_die->tag == DW_TAG_namespace
+	      || last_die->tag == DW_TAG_enumeration_type
+	      || (cu->language != language_c
+		  && (last_die->tag == DW_TAG_class_type
+		      || last_die->tag == DW_TAG_structure_type
+		      || last_die->tag == DW_TAG_union_type))))
+	{
+	  nesting_level++;
+	  parent_die = last_die;
+	  continue;
+	}
+
+      /* Otherwise we skip to the next sibling, if any.  */
+      info_ptr = locate_pdi_sibling (last_die, info_ptr, abfd, cu);
+
+      /* Back to the top, do it again.  */
+    }
+}
+
 /* Read a minimal amount of information into the minimal die structure.  */
 
 static char *
-read_partial_die (struct partial_die_info *part_die, bfd *abfd,
+read_partial_die (struct partial_die_info *part_die,
+		  struct abbrev_info *abbrev,
+		  unsigned int abbrev_len, bfd *abfd,
 		  char *info_ptr, struct dwarf2_cu *cu)
 {
-  unsigned int abbrev_number, bytes_read, i;
-  struct abbrev_info *abbrev;
+  unsigned int bytes_read, i;
   struct attribute attr;
-  struct attribute spec_attr;
-  int found_spec_attr = 0;
   int has_low_pc_attr = 0;
   int has_high_pc_attr = 0;
 
-  *part_die = zeroed_partial_die;
-  abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
-  info_ptr += bytes_read;
-  if (!abbrev_number)
+  memset (part_die, 0, sizeof (struct partial_die_info));
+
+  part_die->offset = info_ptr - dwarf2_per_objfile->info_buffer;
+
+  info_ptr += abbrev_len;
+
+  if (abbrev == NULL)
     return info_ptr;
 
-  abbrev = dwarf2_lookup_abbrev (abbrev_number, cu);
-  if (!abbrev)
-    {
-      error ("Dwarf Error: Could not find abbrev number %d [in module %s]", abbrev_number,
-		      bfd_get_filename (abfd));
-    }
-  part_die->offset = info_ptr - dwarf_info_buffer;
   part_die->tag = abbrev->tag;
   part_die->has_children = abbrev->has_children;
-  part_die->abbrev = abbrev_number;
 
   for (i = 0; i < abbrev->num_attrs; ++i)
     {
@@ -4537,6 +4875,10 @@
 	  if (part_die->name == NULL)
 	    part_die->name = DW_STRING (&attr);
 	  break;
+	case DW_AT_comp_dir:
+	  if (part_die->dirname == NULL)
+	    part_die->dirname = DW_STRING (&attr);
+	  break;
 	case DW_AT_MIPS_linkage_name:
 	  part_die->name = DW_STRING (&attr);
 	  break;
@@ -4578,8 +4920,9 @@
 	  break;
 	case DW_AT_abstract_origin:
 	case DW_AT_specification:
-	  found_spec_attr = 1;
-	  spec_attr = attr;
+	case DW_AT_extension:
+	  part_die->has_specification = 1;
+	  part_die->spec_offset = dwarf2_get_ref_die_offset (&attr, cu);
 	  break;
 	case DW_AT_sibling:
 	  /* Ignore absolute siblings, they might point outside of
@@ -4587,35 +4930,18 @@
 	  if (attr.form == DW_FORM_ref_addr)
 	    complaint (&symfile_complaints, "ignoring absolute DW_AT_sibling");
 	  else
-	    part_die->sibling =
-	      dwarf_info_buffer + dwarf2_get_ref_die_offset (&attr, cu);
+	    part_die->sibling = dwarf2_per_objfile->info_buffer
+	      + dwarf2_get_ref_die_offset (&attr, cu);
 	  break;
+        case DW_AT_stmt_list:
+          part_die->has_stmt_list = 1;
+          part_die->line_offset = DW_UNSND (&attr);
+          break;
 	default:
 	  break;
 	}
     }
 
-  /* If we found a reference attribute and the die has no name, try
-     to find a name in the referred to die.  */
-
-  if (found_spec_attr && part_die->name == NULL)
-    {
-      struct partial_die_info spec_die;
-      char *spec_ptr;
-
-      spec_ptr = dwarf_info_buffer
-	+ dwarf2_get_ref_die_offset (&spec_attr, cu);
-      read_partial_die (&spec_die, abfd, spec_ptr, cu);
-      if (spec_die.name)
-	{
-	  part_die->name = spec_die.name;
-
-	  /* Copy DW_AT_external attribute if it is set.  */
-	  if (spec_die.is_external)
-	    part_die->is_external = spec_die.is_external;
-	}
-    }
-
   /* When using the GNU linker, .gnu.linkonce. sections are used to
      eliminate duplicate copies of functions and vtables and such.
      The linker will arbitrarily choose one and discard the others.
@@ -4632,6 +4958,86 @@
   return info_ptr;
 }
 
+/* Find a cached partial DIE at OFFSET in CU.  */
+
+static struct partial_die_info *
+find_partial_die_in_comp_unit (unsigned long offset, struct dwarf2_cu *cu)
+{
+  struct partial_die_info *lookup_die = NULL;
+  struct partial_die_info part_die;
+
+  part_die.offset = offset;
+  lookup_die = htab_find_with_hash (cu->partial_dies, &part_die, offset);
+
+  if (lookup_die == NULL)
+    internal_error (__FILE__, __LINE__,
+		    "could not find partial DIE in cache\n");
+
+  return lookup_die;
+}
+
+/* Find a partial DIE at OFFSET, which may or may not be in CU.  */
+
+static struct partial_die_info *
+find_partial_die (unsigned long offset, struct dwarf2_cu *cu,
+		  struct dwarf2_cu **target_cu)
+{
+  struct dwarf2_per_cu_data *per_cu;
+
+  if (offset >= cu->header.offset
+      && offset < cu->header.offset + cu->header.length)
+    {
+      *target_cu = cu;
+      return find_partial_die_in_comp_unit (offset, cu);
+    }
+
+  internal_error (__FILE__, __LINE__,
+		  "unsupported inter-compilation-unit reference");
+}
+
+/* Adjust PART_DIE before generating a symbol for it.  This function
+   may set the is_external flag or change the DIE's name.  */
+
+static void
+fixup_partial_die (struct partial_die_info *part_die,
+		   struct dwarf2_cu *cu)
+{
+  /* If we found a reference attribute and the DIE has no name, try
+     to find a name in the referred to DIE.  */
+
+  if (part_die->name == NULL && part_die->has_specification)
+    {
+      struct partial_die_info *spec_die;
+      struct dwarf2_cu *spec_cu;
+
+      spec_die = find_partial_die (part_die->spec_offset, cu, &spec_cu);
+
+      fixup_partial_die (spec_die, spec_cu);
+
+      if (spec_die->name)
+	{
+	  part_die->name = spec_die->name;
+
+	  /* Copy DW_AT_external attribute if it is set.  */
+	  if (spec_die->is_external)
+	    part_die->is_external = spec_die->is_external;
+	}
+    }
+
+  /* Set default names for some unnamed DIEs.  */
+  if (part_die->name == NULL && (part_die->tag == DW_TAG_structure_type
+				 || part_die->tag == DW_TAG_class_type))
+    part_die->name = "(anonymous class)";
+
+  if (part_die->name == NULL && part_die->tag == DW_TAG_namespace)
+    part_die->name = "(anonymous namespace)";
+
+  if (part_die->tag == DW_TAG_structure_type
+      || part_die->tag == DW_TAG_class_type
+      || part_die->tag == DW_TAG_union_type)
+    guess_structure_name (part_die, cu);
+}
+
 /* Read the die from the .debug_info section buffer.  Set DIEP to
    point to a newly allocated die with its information, except for its
    child, sibling, and parent fields.  Set HAS_CHILDREN to tell
@@ -4645,7 +5051,7 @@
   struct abbrev_info *abbrev;
   struct die_info *die;
 
-  offset = info_ptr - dwarf_info_buffer;
+  offset = info_ptr - dwarf2_per_objfile->info_buffer;
   abbrev_number = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
   info_ptr += bytes_read;
   if (!abbrev_number)
@@ -4663,7 +5069,7 @@
   if (!abbrev)
     {
       error ("Dwarf Error: could not find abbrev number %d [in module %s]",
-	     abbrev_number, 
+	     abbrev_number,
 	     bfd_get_filename (abfd));
     }
   die = dwarf_alloc_die ();
@@ -4707,7 +5113,7 @@
       info_ptr += bytes_read;
       break;
     case DW_FORM_block2:
-      blk = dwarf_alloc_block ();
+      blk = dwarf_alloc_block (cu);
       blk->size = read_2_bytes (abfd, info_ptr);
       info_ptr += 2;
       blk->data = read_n_bytes (abfd, info_ptr, blk->size);
@@ -4715,7 +5121,7 @@
       DW_BLOCK (attr) = blk;
       break;
     case DW_FORM_block4:
-      blk = dwarf_alloc_block ();
+      blk = dwarf_alloc_block (cu);
       blk->size = read_4_bytes (abfd, info_ptr);
       info_ptr += 4;
       blk->data = read_n_bytes (abfd, info_ptr, blk->size);
@@ -4744,7 +5150,7 @@
       info_ptr += bytes_read;
       break;
     case DW_FORM_block:
-      blk = dwarf_alloc_block ();
+      blk = dwarf_alloc_block (cu);
       blk->size = read_unsigned_leb128 (abfd, info_ptr, &bytes_read);
       info_ptr += bytes_read;
       blk->data = read_n_bytes (abfd, info_ptr, blk->size);
@@ -4752,7 +5158,7 @@
       DW_BLOCK (attr) = blk;
       break;
     case DW_FORM_block1:
-      blk = dwarf_alloc_block ();
+      blk = dwarf_alloc_block (cu);
       blk->size = read_1_byte (abfd, info_ptr);
       info_ptr += 1;
       blk->data = read_n_bytes (abfd, info_ptr, blk->size);
@@ -5059,22 +5465,22 @@
   LONGEST str_offset = read_offset (abfd, buf, cu_header,
 				    (int *) bytes_read_ptr);
 
-  if (dwarf_str_buffer == NULL)
+  if (dwarf2_per_objfile->str_buffer == NULL)
     {
       error ("DW_FORM_strp used without .debug_str section [in module %s]",
 		      bfd_get_filename (abfd));
       return NULL;
     }
-  if (str_offset >= dwarf_str_size)
+  if (str_offset >= dwarf2_per_objfile->str_size)
     {
       error ("DW_FORM_strp pointing outside of .debug_str section [in module %s]",
 		      bfd_get_filename (abfd));
       return NULL;
     }
   gdb_assert (HOST_CHAR_BIT == 8);
-  if (dwarf_str_buffer[str_offset] == '\0')
+  if (dwarf2_per_objfile->str_buffer[str_offset] == '\0')
     return NULL;
-  return dwarf_str_buffer + str_offset;
+  return dwarf2_per_objfile->str_buffer + str_offset;
 }
 
 static unsigned long
@@ -5219,11 +5625,30 @@
   return NULL;
 }
 
+/* Return non-zero iff the attribute NAME is defined for the given DIE,
+   and holds a non-zero value.  This function should only be used for
+   DW_FORM_flag attributes.  */
+
+static int
+dwarf2_flag_true_p (struct die_info *die, unsigned name, struct dwarf2_cu *cu)
+{
+  struct attribute *attr = dwarf2_attr (die, name, cu);
+
+  return (attr && DW_UNSND (attr));
+}
+
 static int
 die_is_declaration (struct die_info *die, struct dwarf2_cu *cu)
 {
-  return (dwarf2_attr (die, DW_AT_declaration, cu)
-	  && ! dwarf2_attr (die, DW_AT_specification, cu));
+  /* A DIE is a declaration if it has a DW_AT_declaration attribute
+     which value is non-zero.  However, we have to be careful with
+     DIEs having a DW_AT_specification attribute, because dwarf2_attr()
+     (via dwarf2_flag_true_p) follows this attribute.  So we may
+     end up accidently finding a declaration attribute that belongs
+     to a different DIE referenced by the specification attribute,
+     even though the given DIE does not have a declaration attribute.  */
+  return (dwarf2_flag_true_p (die, DW_AT_declaration, cu)
+	  && dwarf2_attr (die, DW_AT_specification, cu) == NULL);
 }
 
 /* Return the die giving the specification for DIE, if there is
@@ -5314,12 +5739,13 @@
   fe->dir_index = dir_index;
   fe->mod_time = mod_time;
   fe->length = length;
+  fe->included_p = 0;
 }
  
 
 /* Read the statement program header starting at OFFSET in
-   dwarf_line_buffer, according to the endianness of ABFD.  Return a
-   pointer to a struct line_header, allocated using xmalloc.
+   .debug_line, according to the endianness of ABFD.  Return a pointer
+   to a struct line_header, allocated using xmalloc.
 
    NOTE: the strings in the include directory and file name tables of
    the returned object point into debug_line_buffer, and must not be
@@ -5335,7 +5761,7 @@
   int i;
   char *cur_dir, *cur_file;
 
-  if (dwarf_line_buffer == NULL)
+  if (dwarf2_per_objfile->line_buffer == NULL)
     {
       complaint (&symfile_complaints, "missing .debug_line section");
       return 0;
@@ -5343,7 +5769,7 @@
 
   /* Make sure that at least there's room for the total_length field.  That
      could be 12 bytes long, but we're just going to fudge that.  */
-  if (offset + 4 >= dwarf_line_size)
+  if (offset + 4 >= dwarf2_per_objfile->line_size)
     {
       dwarf2_statement_list_fits_in_line_number_section_complaint ();
       return 0;
@@ -5354,12 +5780,13 @@
   back_to = make_cleanup ((make_cleanup_ftype *) free_line_header,
                           (void *) lh);
 
-  line_ptr = dwarf_line_buffer + offset;
+  line_ptr = dwarf2_per_objfile->line_buffer + offset;
 
   /* read in the header */
   lh->total_length = read_initial_length (abfd, line_ptr, NULL, &bytes_read);
   line_ptr += bytes_read;
-  if (line_ptr + lh->total_length > dwarf_line_buffer + dwarf_line_size)
+  if (line_ptr + lh->total_length > (dwarf2_per_objfile->line_buffer
+				     + dwarf2_per_objfile->line_size))
     {
       dwarf2_statement_list_fits_in_line_number_section_complaint ();
       return 0;
@@ -5415,7 +5842,8 @@
   line_ptr += bytes_read;
   lh->statement_program_start = line_ptr; 
 
-  if (line_ptr > dwarf_line_buffer + dwarf_line_size)
+  if (line_ptr > (dwarf2_per_objfile->line_buffer
+		  + dwarf2_per_objfile->line_size))
     complaint (&symfile_complaints,
 	       "line number info header doesn't fit in `.debug_line' section");
 
@@ -5469,13 +5897,27 @@
   return fn->lowpc;
 }
 
-/* Decode the line number information for the compilation unit whose
-   line number info is at OFFSET in the .debug_line section.
-   The compilation directory of the file is passed in COMP_DIR.  */
+/* Decode the Line Number Program (LNP) for the given line_header
+   structure and CU.  The actual information extracted and the type
+   of structures created from the LNP depends on the value of PST.
+
+   1. If PST is NULL, then this procedure uses the data from the program
+      to create all necessary symbol tables, and their linetables.
+      The compilation directory of the file is passed in COMP_DIR,
+      and must not be NULL.
+   
+   2. If PST is not NULL, this procedure reads the program to determine
+      the list of files included by the unit represented by PST, and
+      builds all the associated partial symbol tables.  In this case,
+      the value of COMP_DIR is ignored, and can thus be NULL (the COMP_DIR
+      is not used to compute the full name of the symtab, and therefore
+      omitting it when building the partial symtab does not introduce
+      the potential for inconsistency - a partial symtab and its associated
+      symbtab having a different fullname -).  */
 
 static void
 dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
-		    struct dwarf2_cu *cu)
+		    struct dwarf2_cu *cu, struct partial_symtab *pst)
 {
   char *line_ptr;
   char *line_end;
@@ -5483,6 +5925,7 @@
   unsigned char op_code, extended_op, adj_opcode;
   CORE_ADDR baseaddr;
   struct objfile *objfile = cu->objfile;
+  const int decode_for_pst_p = (pst != NULL);
 
   baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
 
@@ -5501,9 +5944,9 @@
       int basic_block = 0;
       int end_sequence = 0;
 
-      /* Start a subfile for the current file of the state machine.  */
-      if (lh->num_file_names >= file)
+      if (!decode_for_pst_p && lh->num_file_names >= file)
 	{
+          /* Start a subfile for the current file of the state machine.  */
 	  /* lh->include_dirs and lh->file_names are 0-based, but the
 	     directory and file name numbers in the statement program
 	     are 1-based.  */
@@ -5528,22 +5971,27 @@
 	      address += (adj_opcode / lh->line_range)
 		* lh->minimum_instruction_length;
 	      line += lh->line_base + (adj_opcode % lh->line_range);
-	      /* append row to matrix using current values */
-	      record_line (current_subfile, line, 
-	                   check_cu_functions (address, cu));
+              if (!decode_for_pst_p)
+                {
+	          /* append row to matrix using current values */
+	          record_line (current_subfile, line, 
+	                       check_cu_functions (address, cu));
+                }
 	      basic_block = 1;
 	    }
 	  else switch (op_code)
 	    {
 	    case DW_LNS_extended_op:
-	      line_ptr += 1;	/* ignore length */
+	      read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+	      line_ptr += bytes_read;
 	      extended_op = read_1_byte (abfd, line_ptr);
 	      line_ptr += 1;
 	      switch (extended_op)
 		{
 		case DW_LNE_end_sequence:
 		  end_sequence = 1;
-		  record_line (current_subfile, 0, address);
+                  if (!decode_for_pst_p)
+		    record_line (current_subfile, 0, address);
 		  break;
 		case DW_LNE_set_address:
 		  address = read_address (abfd, line_ptr, cu, &bytes_read);
@@ -5576,8 +6024,9 @@
 		}
 	      break;
 	    case DW_LNS_copy:
-	      record_line (current_subfile, line, 
-	                   check_cu_functions (address, cu));
+              if (!decode_for_pst_p)
+	        record_line (current_subfile, line, 
+	                     check_cu_functions (address, cu));
 	      basic_block = 0;
 	      break;
 	    case DW_LNS_advance_pc:
@@ -5599,11 +6048,13 @@
                 file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
                 line_ptr += bytes_read;
                 fe = &lh->file_names[file - 1];
+                fe->included_p = 1;
                 if (fe->dir_index)
                   dir = lh->include_dirs[fe->dir_index - 1];
                 else
                   dir = comp_dir;
-                dwarf2_start_subfile (fe->name, dir);
+                if (!decode_for_pst_p)
+                  dwarf2_start_subfile (fe->name, dir);
               }
 	      break;
 	    case DW_LNS_set_column:
@@ -5641,6 +6092,22 @@
 	    }
 	}
     }
+
+  if (decode_for_pst_p)
+    {
+      int file_index;
+
+      /* Now that we're done scanning the Line Header Program, we can
+         create the psymtab of each included file.  */
+      for (file_index = 0; file_index < lh->num_file_names; file_index++)
+        if (lh->file_names[file_index].included_p == 1)
+          {
+            char *include_name = lh->file_names [file_index].name;
+    
+            if (strcmp (include_name, pst->filename) != 0)
+              dwarf2_create_include_psymtab (include_name, pst, objfile);
+          }
+    }
 }
 
 /* Start a subfile for DWARF.  FILENAME is the name of the file and
@@ -7766,19 +8233,13 @@
 
 /* memory allocation interface */
 
-static void
-dwarf2_free_tmp_obstack (void *ignore)
-{
-  obstack_free (&dwarf2_tmp_obstack, NULL);
-}
-
 static struct dwarf_block *
-dwarf_alloc_block (void)
+dwarf_alloc_block (struct dwarf2_cu *cu)
 {
   struct dwarf_block *blk;
 
   blk = (struct dwarf_block *)
-    obstack_alloc (&dwarf2_tmp_obstack, sizeof (struct dwarf_block));
+    obstack_alloc (&cu->comp_unit_obstack, sizeof (struct dwarf_block));
   return (blk);
 }
 
@@ -8051,14 +8512,15 @@
   char *mac_ptr, *mac_end;
   struct macro_source_file *current_file = 0;
 
-  if (dwarf_macinfo_buffer == NULL)
+  if (dwarf2_per_objfile->macinfo_buffer == NULL)
     {
       complaint (&symfile_complaints, "missing .debug_macinfo section");
       return;
     }
 
-  mac_ptr = dwarf_macinfo_buffer + offset;
-  mac_end = dwarf_macinfo_buffer + dwarf_macinfo_size;
+  mac_ptr = dwarf2_per_objfile->macinfo_buffer + offset;
+  mac_end = dwarf2_per_objfile->macinfo_buffer
+    + dwarf2_per_objfile->macinfo_size;
 
   for (;;)
     {
@@ -8205,8 +8667,8 @@
 
       /* We don't know how long the location list is, but make sure we
 	 don't run off the edge of the section.  */
-      baton->size = dwarf_loc_size - DW_UNSND (attr);
-      baton->data = dwarf_loc_buffer + DW_UNSND (attr);
+      baton->size = dwarf2_per_objfile->loc_size - DW_UNSND (attr);
+      baton->data = dwarf2_per_objfile->loc_buffer + DW_UNSND (attr);
       baton->base_address = cu->header.base_address;
       if (cu->header.base_known == 0)
 	complaint (&symfile_complaints,
@@ -8227,9 +8689,9 @@
 	{
 	  /* Note that we're just copying the block's data pointer
 	     here, not the actual data.  We're still pointing into the
-	     dwarf_info_buffer for SYM's objfile; right now we never
-	     release that buffer, but when we do clean up properly
-	     this may need to change.  */
+	     info_buffer for SYM's objfile; right now we never release
+	     that buffer, but when we do clean up properly this may
+	     need to change.  */
 	  baton->size = DW_BLOCK (attr)->size;
 	  baton->data = DW_BLOCK (attr)->data;
 	}
@@ -8245,3 +8707,69 @@
       SYMBOL_LOCATION_BATON (sym) = baton;
     }
 }
+
+/* This cleanup function is passed the address of a dwarf2_cu on the stack
+   when we're finished with it.  We can't free the pointer itself, but
+   release any associated storage.
+
+   Only used during partial symbol parsing.  */
+
+static void
+free_stack_comp_unit (void *data)
+{
+  struct dwarf2_cu *cu = data;
+
+  obstack_free (&cu->comp_unit_obstack, NULL);
+  cu->partial_dies = NULL;
+}
+
+/* Allocation function for the libiberty hash table which uses an
+   obstack.  */
+
+static void *
+hashtab_obstack_allocate (void *data, size_t size, size_t count)
+{
+  unsigned int total = size * count;
+  void *ptr = obstack_alloc ((struct obstack *) data, total);
+  memset (ptr, 0, total);
+  return ptr;
+}
+
+/* Trivial deallocation function for the libiberty splay tree and hash
+   table - don't deallocate anything.  Rely on later deletion of the
+   obstack.  */
+
+static void
+dummy_obstack_deallocate (void *object, void *data)
+{
+  return;
+}
+
+/* Trivial hash function for partial_die_info: the hash value of a DIE
+   is its offset in .debug_info for this objfile.  */
+
+static hashval_t
+partial_die_hash (const void *item)
+{
+  const struct partial_die_info *part_die = item;
+  return part_die->offset;
+}
+
+/* Trivial comparison function for partial_die_info structures: two DIEs
+   are equal if they have the same offset.  */
+
+static int
+partial_die_eq (const void *item_lhs, const void *item_rhs)
+{
+  const struct partial_die_info *part_die_lhs = item_lhs;
+  const struct partial_die_info *part_die_rhs = item_rhs;
+  return part_die_lhs->offset == part_die_rhs->offset;
+}
+
+void _initialize_dwarf2_read (void);
+
+void
+_initialize_dwarf2_read (void)
+{
+  dwarf2_objfile_data_key = register_objfile_data ();
+}
diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c
index c245108..cb31543 100644
--- a/gdb/dwarfread.c
+++ b/gdb/dwarfread.c
@@ -29,7 +29,7 @@
 
    DWARF-1 is slowly headed for obsoletion.
 
-   In gcc HEAD 2003-11-29 16:28:31 UTC, no targets prefer dwarf-1.
+   In gcc 3.4.0, support for dwarf-1 has been removed.
 
    In gcc 3.3.2, these targets prefer dwarf-1:
 
@@ -73,11 +73,22 @@
    Some non-gcc compilers produce dwarf-1: 
 
      PR gdb/1179 was from a user with Diab C++ 4.3.
+     On 2003-07-25 the gdb list received a report from a user
+      with Diab Compiler 4.4b.
      Other users have also reported using Diab compilers with dwarf-1.
+
+     Diab Compiler Suite 5.0.1 supports dwarf-2/dwarf-3 for C and C++.
+     (Diab(tm) Compiler Suite 5.0.1 Release Notes, DOC-14691-ZD-00,
+     Wind River Systems, 2002-07-31).
+
      On 2003-06-09 the gdb list received a report from a user
        with Absoft ProFortran f77 which is dwarf-1.
 
-   -- chastain 2003-12-01
+     Absoft ProFortran Linux Fortran User Guide (no version,
+     but copyright dates are 1991-2001) says that Absoft ProFortran
+     supports -gdwarf1 and -gdwarf2.
+
+   -- chastain 2004-04-24
 */
 
 /*
@@ -1781,12 +1792,6 @@
       return;
     }
 
-  if (objfile->ei.entry_point >= dip->at_low_pc &&
-      objfile->ei.entry_point < dip->at_high_pc)
-    {
-      objfile->ei.entry_func_lowpc = dip->at_low_pc;
-      objfile->ei.entry_func_highpc = dip->at_high_pc;
-    }
   new = push_context (0, dip->at_low_pc);
   new->name = new_symbol (dip, objfile);
   list_in_scope = &local_symbols;
@@ -1882,12 +1887,6 @@
   struct cleanup *back_to;
   struct symtab *symtab;
 
-  if (objfile->ei.entry_point >= dip->at_low_pc &&
-      objfile->ei.entry_point < dip->at_high_pc)
-    {
-      objfile->ei.deprecated_entry_file_lowpc = dip->at_low_pc;
-      objfile->ei.deprecated_entry_file_highpc = dip->at_high_pc;
-    }
   set_cu_language (dip);
   if (dip->at_producer != NULL)
     {
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 83a1862..b6abe08 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -83,12 +83,12 @@
   if (strcmp (sectp->name, ".debug") == 0)
     {
       ei->dboffset = sectp->filepos;
-      ei->dbsize = bfd_get_section_size_before_reloc (sectp);
+      ei->dbsize = bfd_get_section_size (sectp);
     }
   else if (strcmp (sectp->name, ".line") == 0)
     {
       ei->lnoffset = sectp->filepos;
-      ei->lnsize = bfd_get_section_size_before_reloc (sectp);
+      ei->lnsize = bfd_get_section_size (sectp);
     }
   else if (strcmp (sectp->name, ".stab") == 0)
     {
@@ -575,7 +575,7 @@
 				str_sect->filepos,
 				bfd_section_size (abfd, str_sect));
     }
-  if (dwarf2_has_info (abfd))
+  if (dwarf2_has_info (objfile))
     {
       /* DWARF 2 sections */
       dwarf2_build_psymtabs (objfile, mainline);
diff --git a/gdb/eval.c b/gdb/eval.c
index 452aeb7..b690a78 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -37,9 +37,6 @@
 #include "block.h"
 #include "parser-defs.h"
 
-/* Defined in symtab.c */
-extern int hp_som_som_object_present;
-
 /* This is defined in valops.c */
 extern int overload_resolution;
 
@@ -972,7 +969,7 @@
 	  /* 1997-08-01 Currently we do not support function invocation
 	     via pointers-to-methods with HP aCC. Pointer does not point
 	     to the function, but possibly to some thunk. */
-	  if (hp_som_som_object_present)
+	  if (deprecated_hp_som_som_object_present)
 	    {
 	      error ("Not implemented: function invocation through pointer to method with HP aCC");
 	    }
@@ -1368,7 +1365,7 @@
       arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
 
       /* With HP aCC, pointers to methods do not point to the function code */
-      if (hp_som_som_object_present &&
+      if (deprecated_hp_som_som_object_present &&
 	  (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_PTR) &&
       (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) == TYPE_CODE_METHOD))
 	error ("Pointers to methods not supported with HP aCC");	/* 1997-08-19 */
@@ -1381,7 +1378,7 @@
       arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
 
       /* With HP aCC, pointers to methods do not point to the function code */
-      if (hp_som_som_object_present &&
+      if (deprecated_hp_som_som_object_present &&
 	  (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_PTR) &&
       (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (arg2))) == TYPE_CODE_METHOD))
 	error ("Pointers to methods not supported with HP aCC");	/* 1997-08-19 */
@@ -1391,7 +1388,7 @@
     handle_pointer_to_member:
       /* HP aCC generates offsets that have bit #29 set; turn it off to get
          a real offset to the member. */
-      if (hp_som_som_object_present)
+      if (deprecated_hp_som_som_object_present)
 	{
 	  if (!mem_offset)	/* no bias -> really null */
 	    error ("Attempted dereference of null pointer-to-member");
@@ -1431,7 +1428,7 @@
       arg2 = evaluate_subexp (VALUE_TYPE (arg1), exp, pos, noside);
 
       /* Do special stuff for HP aCC pointers to members */
-      if (hp_som_som_object_present)
+      if (deprecated_hp_som_som_object_present)
 	{
 	  /* 1997-08-19 Can't assign HP aCC pointers to methods. No details of
 	     the implementation yet; but the pointer appears to point to a code
@@ -1934,7 +1931,7 @@
 	{
 	  struct value *retvalp = evaluate_subexp_for_address (exp, pos, noside);
 	  /* If HP aCC object, use bias for pointers to members */
-	  if (hp_som_som_object_present &&
+	  if (deprecated_hp_som_som_object_present &&
 	      (TYPE_CODE (VALUE_TYPE (retvalp)) == TYPE_CODE_PTR) &&
 	      (TYPE_CODE (TYPE_TARGET_TYPE (VALUE_TYPE (retvalp))) == TYPE_CODE_MEMBER))
 	    {
diff --git a/gdb/exec.c b/gdb/exec.c
index 418b0b3..4b43808 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -53,7 +53,7 @@
 
 struct vmap *map_vmap (bfd *, bfd *);
 
-void (*file_changed_hook) (char *);
+void (*deprecated_file_changed_hook) (char *);
 
 /* Prototypes for local functions */
 
@@ -267,8 +267,8 @@
       push_target (&exec_ops);
 
       /* Tell display code (if any) about the changed file name.  */
-      if (exec_file_display_hook)
-	(*exec_file_display_hook) (filename);
+      if (deprecated_exec_file_display_hook)
+	(*deprecated_exec_file_display_hook) (filename);
     }
 }
 
@@ -324,8 +324,8 @@
      the exec file, but that's rough.  */
   exec_file_command (arg, from_tty);
   symbol_file_command (arg, from_tty);
-  if (file_changed_hook)
-    file_changed_hook (arg);
+  if (deprecated_file_changed_hook)
+    deprecated_file_changed_hook (arg);
 }
 
 
diff --git a/gdb/expression.h b/gdb/expression.h
index 03b45c2..2b09716 100644
--- a/gdb/expression.h
+++ b/gdb/expression.h
@@ -378,6 +378,8 @@
 
 extern struct expression *parse_expression (char *);
 
+extern struct expression *parse_expression_in_context (char *, int);
+
 extern struct expression *parse_exp_1 (char **, struct block *, int);
 
 /* The innermost context required by the stack and register variables
diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index 1e7cd45..4219d45 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -465,6 +465,7 @@
   &exp_descriptor_standard,
   f_parse,			/* parser */
   f_error,			/* parser error function */
+  null_post_parser,
   f_printchar,			/* Print character constant */
   f_printstr,			/* function to print string constant */
   f_emit_char,			/* Function to print a single character */
@@ -477,6 +478,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   NULL,				/* Language specific symbol demangler */
+  NULL,				/* Language specific class_name_from_physname */
   {"", "", "", ""},		/* Binary format info */
   {"0%o", "0", "o", ""},	/* Octal format info */
   {"%d", "", "d", ""},		/* Decimal format info */
diff --git a/gdb/fbsd-proc.c b/gdb/fbsd-proc.c
index 16813a9..f021d27 100644
--- a/gdb/fbsd-proc.c
+++ b/gdb/fbsd-proc.c
@@ -22,22 +22,23 @@
 #include "defs.h"
 #include "gdbcore.h"
 #include "inferior.h"
-#include "gdb_string.h"
+#include "regcache.h"
+#include "regset.h"
 
+#include "gdb_assert.h"
+#include "gdb_string.h"
 #include <sys/procfs.h>
 #include <sys/types.h>
 
 #include "elf-bfd.h"
 
-#include "gregset.h"
-
 char *
 child_pid_to_exec_file (int pid)
 {
   char *path;
   char *buf;
 
-  xasprintf (&path, "/proc/%d/file", pid);
+  path = xstrprintf ("/proc/%d/file", pid);
   buf = xcalloc (MAXPATHLEN, sizeof (char));
   make_cleanup (xfree, path);
   make_cleanup (xfree, buf);
@@ -81,7 +82,7 @@
   char protection[4];
   int read, write, exec;
 
-  xasprintf (&mapfilename, "/proc/%ld/map", (long) pid);
+  mapfilename = xstrprintf ("/proc/%ld/map", (long) pid);
   mapfile = fopen (mapfilename, "r");
   if (mapfile == NULL)
     error ("Couldn't open %s\n", mapfilename);
@@ -120,21 +121,35 @@
 static char *
 fbsd_make_corefile_notes (bfd *obfd, int *note_size)
 {
+  struct gdbarch *gdbarch = current_gdbarch;
+  const struct regcache *regcache = current_regcache;
   gregset_t gregs;
   fpregset_t fpregs;
   char *note_data = NULL;
   Elf_Internal_Ehdr *i_ehdrp;
+  const struct regset *regset;
+  size_t size;
 
   /* Put a "FreeBSD" label in the ELF header.  */
   i_ehdrp = elf_elfheader (obfd);
   i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD;
 
-  fill_gregset (&gregs, -1);
+  gdb_assert (gdbarch_regset_from_core_section_p (gdbarch));
+
+  size = sizeof gregs;
+  regset = gdbarch_regset_from_core_section (gdbarch, ".reg", size);
+  gdb_assert (regset && regset->collect_regset);
+  regset->collect_regset (regset, regcache, -1, &gregs, size);
+
   note_data = elfcore_write_prstatus (obfd, note_data, note_size,
 				      ptid_get_pid (inferior_ptid),
 				      stop_signal, &gregs);
 
-  fill_fpregset (&fpregs, -1);
+  size = sizeof fpregs;
+  regset = gdbarch_regset_from_core_section (gdbarch, ".reg2", size);
+  gdb_assert (regset && regset->collect_regset);
+  regset->collect_regset (regset, regcache, -1, &fpregs, size);
+
   note_data = elfcore_write_prfpreg (obfd, note_data, note_size,
 				     &fpregs, sizeof (fpregs));
 
diff --git a/gdb/findvar.c b/gdb/findvar.c
index cb1ef65..e4ab862 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -284,13 +284,7 @@
 
   /* Convert raw data to virtual format if necessary.  */
 
-  if (DEPRECATED_REGISTER_CONVERTIBLE_P ()
-      && DEPRECATED_REGISTER_CONVERTIBLE (regnum))
-    {
-      DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, register_type (current_gdbarch, regnum),
-					      raw_buffer, VALUE_CONTENTS_RAW (reg_val));
-    }
-  else if (DEPRECATED_REGISTER_RAW_SIZE (regnum) == DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum))
+  if (DEPRECATED_REGISTER_RAW_SIZE (regnum) == DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum))
     memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer,
 	    DEPRECATED_REGISTER_RAW_SIZE (regnum));
   else
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index cacb2ed..71c8def 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -37,8 +37,9 @@
 
 struct frame_unwind_table
 {
-  struct frame_unwind_table_entry *head;
-  struct frame_unwind_table_entry **tail;
+  struct frame_unwind_table_entry *list;
+  /* The head of the OSABI part of the search list.  */
+  struct frame_unwind_table_entry **osabi_head;
 };
 
 static void *
@@ -46,9 +47,12 @@
 {
   struct frame_unwind_table *table
     = OBSTACK_ZALLOC (obstack, struct frame_unwind_table);
-  table->head = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
-  table->head->sniffer = dummy_frame_sniffer;
-  table->tail = &table->head->next;
+  /* Start the table out with a few default sniffers.  OSABI code
+     can't override this.  */
+  table->list = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
+  table->list->sniffer = dummy_frame_sniffer;
+  /* The insertion point for OSABI sniffers.  */
+  table->osabi_head = &table->list->next;
   return table;
 }
 
@@ -57,20 +61,26 @@
 			     frame_unwind_sniffer_ftype *sniffer)
 {
   struct frame_unwind_table *table = gdbarch_data (gdbarch, frame_unwind_data);
-  (*table->tail) = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct frame_unwind_table_entry);
-  (*table->tail)->sniffer = sniffer;
-  table->tail = &((*table->tail)->next);
+  struct frame_unwind_table_entry **ip;
+
+  /* Find the end of the list and insert the new entry there.  */
+  for (ip = table->osabi_head; (*ip) != NULL; ip = &(*ip)->next);
+  (*ip) = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct frame_unwind_table_entry);
+  (*ip)->sniffer = sniffer;
 }
 
 void
-frame_unwind_register_unwinder (struct gdbarch *gdbarch,
+frame_unwind_prepend_unwinder (struct gdbarch *gdbarch,
 				const struct frame_unwind *unwinder)
 {
   struct frame_unwind_table *table = gdbarch_data (gdbarch, frame_unwind_data);
-  (*table->tail) = GDBARCH_OBSTACK_ZALLOC (gdbarch,
-					   struct frame_unwind_table_entry);
-  (*table->tail)->unwinder = unwinder;
-  table->tail = &((*table->tail)->next);
+  struct frame_unwind_table_entry *entry;
+
+  /* Insert the new entry at the start of the list.  */
+  entry = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct frame_unwind_table_entry);
+  entry->unwinder = unwinder;
+  entry->next = (*table->osabi_head);
+  (*table->osabi_head) = entry;
 }
 
 const struct frame_unwind *
@@ -80,13 +90,7 @@
   struct gdbarch *gdbarch = get_frame_arch (next_frame);
   struct frame_unwind_table *table = gdbarch_data (gdbarch, frame_unwind_data);
   struct frame_unwind_table_entry *entry;
-  if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES && legacy_frame_p (gdbarch))
-    /* Seriously old code.  Don't even try to use this new mechanism.
-       (Note: The variable USE_GENERIC_DUMMY_FRAMES is deprecated, not
-       the dummy frame mechanism.  All architectures should be using
-       generic dummy frames).  */
-    return legacy_saved_regs_unwind;
-  for (entry = table->head; entry != NULL; entry = entry->next)
+  for (entry = table->list; entry != NULL; entry = entry->next)
     {
       if (entry->sniffer != NULL)
 	{
diff --git a/gdb/frame-unwind.h b/gdb/frame-unwind.h
index 49f2889..12d6dd2 100644
--- a/gdb/frame-unwind.h
+++ b/gdb/frame-unwind.h
@@ -131,11 +131,14 @@
   frame_sniffer_ftype *sniffer;
 };
 
-/* Register a frame unwinder, _appending_ it to the end of the search
-   list.  */
-extern void frame_unwind_register_unwinder (struct gdbarch *gdbarch,
-					    const struct frame_unwind *unwinder);
-
+/* Register a frame unwinder, _prepending_ it to the front of the
+   search list (so it is sniffed before previously registered
+   unwinders).  By using a prepend, later calls can install unwinders
+   that override earlier calls.  This allows, for instance, an OSABI
+   to install a a more specific sigtramp unwinder that overrides the
+   traditional brute-force unwinder.  */
+extern void frame_unwind_prepend_unwinder (struct gdbarch *gdbarch,
+					   const struct frame_unwind *unwinder);
 
 /* Given the NEXT frame, take a wiff of THIS frame's registers (namely
    the PC and attributes) and if it is the applicable unwinder return
diff --git a/gdb/frame.c b/gdb/frame.c
index f6aa5cf..0e3531a 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -39,6 +39,9 @@
 #include "frame-base.h"
 #include "command.h"
 #include "gdbcmd.h"
+#include "observer.h"
+
+static struct frame_info *get_prev_frame_1 (struct frame_info *this_frame);
 
 /* We keep a cache of stack frames, each of which is a "struct
    frame_info".  The innermost one gets allocated (in
@@ -57,17 +60,17 @@
      increases.  This is a cached value.  It could just as easily be
      computed by counting back from the selected frame to the inner
      most frame.  */
-  /* NOTE: cagney/2002-04-05: Perhaphs a level of ``-1'' should be
+  /* NOTE: cagney/2002-04-05: Perhaps a level of ``-1'' should be
      reserved to indicate a bogus frame - one that has been created
      just to keep GDB happy (GDB always needs a frame).  For the
      moment leave this as speculation.  */
   int level;
 
   /* The frame's type.  */
-  /* FIXME: cagney/2003-04-02: Should instead be returning
-     ->unwind->type.  Unfortunately, legacy code is still explicitly
-     setting the type using the method deprecated_set_frame_type.
-     Eliminate that method and this field can be eliminated.  */
+  /* FIXME: cagney/2004-05-01: Should instead just use ->unwind->type.
+     Unfortunately, legacy_get_prev_frame is still explicitly setting
+     the type.  Eliminate that method and this field can be
+     eliminated.  */
   enum frame_type type;
 
   /* For each register, address of where it was saved on entry to the
@@ -89,7 +92,7 @@
   /* The frame's low-level unwinder and corresponding cache.  The
      low-level unwinder is responsible for unwinding register values
      for the previous frame.  The low-level unwind methods are
-     selected based on the presence, or otherwize, of register unwind
+     selected based on the presence, or otherwise, of register unwind
      information such as CFI.  */
   void *prologue_cache;
   const struct frame_unwind *unwind;
@@ -230,11 +233,10 @@
 	{
 	  fi->unwind = frame_unwind_find_by_frame (fi->next,
 						   &fi->prologue_cache);
-	  /* FIXME: cagney/2003-04-02: Rather than storing the frame's
-	     type in the frame, the unwinder's type should be returned
-	     directly.  Unfortunately, legacy code, called by
-	     legacy_get_prev_frame, explicitly set the frames type
-	     using the method deprecated_set_frame_type().  */
+	  /* FIXME: cagney/2004-05-01: Should instead just use
+	     ->unwind->type.  Unfortunately, legacy_get_prev_frame is
+	     still explicitly setting the type.  Eliminate that method
+	     and this field can be eliminated.  */
 	  fi->type = fi->unwind->type;
 	}
       /* Find THIS frame's ID.  */
@@ -250,31 +252,58 @@
   return fi->this_id.value;
 }
 
+struct frame_id
+frame_unwind_id (struct frame_info *next_frame)
+{
+  /* Use prev_frame, and not get_prev_frame.  The latter will truncate
+     the frame chain, leading to this function unintentionally
+     returning a null_frame_id (e.g., when a caller requests the frame
+     ID of "main()"s caller.  */
+  return get_frame_id (get_prev_frame_1 (next_frame));
+}
+
 const struct frame_id null_frame_id; /* All zeros.  */
 
 struct frame_id
 frame_id_build_special (CORE_ADDR stack_addr, CORE_ADDR code_addr,
                         CORE_ADDR special_addr)
 {
-  struct frame_id id;
+  struct frame_id id = null_frame_id;
   id.stack_addr = stack_addr;
+  id.stack_addr_p = 1;
   id.code_addr = code_addr;
+  id.code_addr_p = 1;
   id.special_addr = special_addr;
+  id.special_addr_p = 1;
   return id;
 }
 
 struct frame_id
 frame_id_build (CORE_ADDR stack_addr, CORE_ADDR code_addr)
 {
-  return frame_id_build_special (stack_addr, code_addr, 0);
+  struct frame_id id = null_frame_id;
+  id.stack_addr = stack_addr;
+  id.stack_addr_p = 1;
+  id.code_addr = code_addr;
+  id.code_addr_p = 1;
+  return id;
+}
+
+struct frame_id
+frame_id_build_wild (CORE_ADDR stack_addr)
+{
+  struct frame_id id = null_frame_id;
+  id.stack_addr = stack_addr;
+  id.stack_addr_p = 1;
+  return id;
 }
 
 int
 frame_id_p (struct frame_id l)
 {
   int p;
-  /* The .code can be NULL but the .stack cannot.  */
-  p = (l.stack_addr != 0);
+  /* The frame is valid iff it has a valid stack address.  */
+  p = l.stack_addr_p;
   if (frame_debug)
     {
       fprintf_unfiltered (gdb_stdlog, "{ frame_id_p (l=");
@@ -288,20 +317,21 @@
 frame_id_eq (struct frame_id l, struct frame_id r)
 {
   int eq;
-  if (l.stack_addr == 0 || r.stack_addr == 0)
-    /* Like a NaN, if either ID is invalid, the result is false.  */
+  if (!l.stack_addr_p || !r.stack_addr_p)
+    /* Like a NaN, if either ID is invalid, the result is false.
+       Note that a frame ID is invalid iff it is the null frame ID.  */
     eq = 0;
   else if (l.stack_addr != r.stack_addr)
     /* If .stack addresses are different, the frames are different.  */
     eq = 0;
-  else if (l.code_addr == 0 || r.code_addr == 0)
-    /* A zero code addr is a wild card, always succeed.  */
+  else if (!l.code_addr_p || !r.code_addr_p)
+    /* An invalid code addr is a wild card, always succeed.  */
     eq = 1;
   else if (l.code_addr != r.code_addr)
     /* If .code addresses are different, the frames are different.  */
     eq = 0;
-  else if (l.special_addr == 0 || r.special_addr == 0)
-    /* A zero special addr is a wild card (or unused), always succeed.  */
+  else if (!l.special_addr_p || !r.special_addr_p)
+    /* An invalid special addr is a wild card (or unused), always succeed.  */
     eq = 1;
   else if (l.special_addr == r.special_addr)
     /* Frames are equal.  */
@@ -324,7 +354,7 @@
 frame_id_inner (struct frame_id l, struct frame_id r)
 {
   int inner;
-  if (l.stack_addr == 0 || r.stack_addr == 0)
+  if (!l.stack_addr_p || !r.stack_addr_p)
     /* Like NaN, any operation involving an invalid ID always fails.  */
     inner = 0;
   else
@@ -365,8 +395,8 @@
       if (frame_id_inner (id, this))
 	/* Gone to far.  */
 	return NULL;
-      /* Either, we're not yet gone far enough out along the frame
-         chain (inner(this,id), or we're comparing frameless functions
+      /* Either we're not yet gone far enough out along the frame
+         chain (inner(this,id)), or we're comparing frameless functions
          (same .base, different .func, no test available).  Struggle
          on until we've definitly gone to far.  */
     }
@@ -401,9 +431,9 @@
 	}
       else if (this_frame->level < 0)
 	{
-	  /* FIXME: cagney/2003-03-06: Old code and and a sentinel
+	  /* FIXME: cagney/2003-03-06: Old code and a sentinel
              frame.  Do like was always done.  Fetch the PC's value
-             direct from the global registers array (via read_pc).
+             directly from the global registers array (via read_pc).
              This assumes that this frame belongs to the current
              global register cache.  The assumption is dangerous.  */
 	  pc = read_pc ();
@@ -477,8 +507,8 @@
     {
       /* Make a copy of all the register values unwound from this
 	 frame.  Save them in a scratch buffer so that there isn't a
-	 race betweening trying to extract the old values from the
-	 current_regcache while, at the same time writing new values
+	 race between trying to extract the old values from the
+	 current_regcache while at the same time writing new values
 	 into that same cache.  */
       struct regcache *scratch = regcache_xmalloc (current_gdbarch);
       struct cleanup *cleanups = make_cleanup_regcache_xfree (scratch);
@@ -526,7 +556,7 @@
 
   /* NOTE: cagney/2002-11-27: A program trying to unwind a NULL frame
      is broken.  There is always a frame.  If there, for some reason,
-     isn't, there is some pretty busted code as it should have
+     isn't a frame, there is some pretty busted code as it should have
      detected the problem before calling here.  */
   gdb_assert (frame != NULL);
 
@@ -535,16 +565,15 @@
     {
       frame->unwind = frame_unwind_find_by_frame (frame->next,
 						  &frame->prologue_cache);
-      /* FIXME: cagney/2003-04-02: Rather than storing the frame's
-	 type in the frame, the unwinder's type should be returned
-	 directly.  Unfortunately, legacy code, called by
-	 legacy_get_prev_frame, explicitly set the frames type using
-	 the method deprecated_set_frame_type().  */
+      /* FIXME: cagney/2004-05-01: Should instead just use ->unwind->type.
+	 Unfortunately, legacy_get_prev_frame is still explicitly setting
+	 the type.  Eliminate that method and this field can be
+	 eliminated.  */
       frame->type = frame->unwind->type;
     }
 
   /* Ask this frame to unwind its register.  See comment in
-     "frame-unwind.h" for why NEXT frame and this unwind cace are
+     "frame-unwind.h" for why NEXT frame and this unwind cache are
      passed in.  */
   frame->unwind->prev_register (frame->next, &frame->prologue_cache, regnum,
 				optimizedp, lvalp, addrp, realnump, bufferp);
@@ -720,7 +749,7 @@
   int realnum;
   frame_register (frame, regnum, &optimized, &lval, &addr, &realnum, myaddr);
 
-  /* FIXME: cagney/2002-05-15: This test, is just bogus.
+  /* FIXME: cagney/2002-05-15: This test is just bogus.
 
      It indicates that the target failed to supply a value for a
      register because it was "not available" at this time.  Problem
@@ -756,7 +785,7 @@
 create_sentinel_frame (struct regcache *regcache)
 {
   struct frame_info *frame = FRAME_OBSTACK_ZALLOC (struct frame_info);
-  frame->type = NORMAL_FRAME;
+  frame->type = SENTINEL_FRAME;
   frame->level = -1;
   /* Explicitly initialize the sentinel frame's cache.  Provide it
      with the underlying regcache.  In the future additional
@@ -821,7 +850,7 @@
 unwind_to_current_frame (struct ui_out *ui_out, void *args)
 {
   struct frame_info *frame = get_prev_frame (args);
-  /* A sentinel frame can fail to unwind, eg, because it's PC value
+  /* A sentinel frame can fail to unwind, e.g., because its PC value
      lands in somewhere like start.  */
   if (frame == NULL)
     return 1;
@@ -863,7 +892,7 @@
 
 struct frame_info *deprecated_selected_frame;
 
-/* Return the selected frame.  Always non-null (unless there isn't an
+/* Return the selected frame.  Always non-NULL (unless there isn't an
    inferior sufficient for creating a frame) in which case an error is
    thrown.  */
 
@@ -880,9 +909,9 @@
   return deprecated_selected_frame;
 }
 
-/* This is a variant of get_selected_frame which can be called when
+/* This is a variant of get_selected_frame() which can be called when
    the inferior does not have a frame; in that case it will return
-   NULL instead of calling error ().  */
+   NULL instead of calling error().  */
 
 struct frame_info *
 deprecated_safe_get_selected_frame (void)
@@ -900,26 +929,26 @@
   struct symtab *s;
 
   deprecated_selected_frame = fi;
-  /* NOTE: cagney/2002-05-04: FI can be NULL.  This occures when the
+  /* NOTE: cagney/2002-05-04: FI can be NULL.  This occurs when the
      frame is being invalidated.  */
-  if (selected_frame_level_changed_hook)
-    selected_frame_level_changed_hook (frame_relative_level (fi));
+  if (deprecated_selected_frame_level_changed_hook)
+    deprecated_selected_frame_level_changed_hook (frame_relative_level (fi));
 
   /* FIXME: kseitz/2002-08-28: It would be nice to call
-     selected_frame_level_changed_event right here, but due to limitations
+     selected_frame_level_changed_event() right here, but due to limitations
      in the current interfaces, we would end up flooding UIs with events
-     because select_frame is used extensively internally.
+     because select_frame() is used extensively internally.
 
      Once we have frame-parameterized frame (and frame-related) commands,
      the event notification can be moved here, since this function will only
-     be called when the users selected frame is being changed. */
+     be called when the user's selected frame is being changed. */
 
   /* Ensure that symbols for this frame are read in.  Also, determine the
      source language of this frame, and switch to it if desired.  */
   if (fi)
     {
       /* We retrieve the frame's symtab by using the frame PC.  However
-         we cannot use the frame pc as is, because it usually points to
+         we cannot use the frame PC as-is, because it usually points to
          the instruction following the "call", which is sometimes the
          first instruction of another function.  So we rely on
          get_frame_address_in_block() which provides us with a PC which
@@ -957,7 +986,7 @@
 
   if (deprecated_get_frame_saved_regs (frame) == NULL)
     {
-      /* If nothing's initialized the saved regs, do it now.  */
+      /* If nothing has initialized the saved regs, do it now.  */
       gdb_assert (DEPRECATED_FRAME_INIT_SAVED_REGS_P ());
       DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
       gdb_assert (deprecated_get_frame_saved_regs (frame) != NULL);
@@ -974,8 +1003,8 @@
 	  *addrp = 0;
 	  *realnump = -1;
 	  if (bufferp != NULL)
-	    /* NOTE: cagney/2003-05-09: In-lined store_address with
-               it's body - store_unsigned_integer.  */
+	    /* NOTE: cagney/2003-05-09: In-lined store_address() with
+               it's body - store_unsigned_integer().  */
 	    store_unsigned_integer (bufferp, DEPRECATED_REGISTER_RAW_SIZE (regnum),
 				    deprecated_get_frame_saved_regs (frame)[regnum]);
 	}
@@ -1039,133 +1068,24 @@
 }
 	
 const struct frame_unwind legacy_saved_regs_unwinder = {
-  /* Not really.  It gets overridden by legacy_get_prev_frame.  */
+  /* Not really.  It gets overridden by legacy_get_prev_frame().  */
   UNKNOWN_FRAME,
   legacy_saved_regs_this_id,
   legacy_saved_regs_prev_register
 };
 const struct frame_unwind *legacy_saved_regs_unwind = &legacy_saved_regs_unwinder;
 
-
-/* Function: deprecated_generic_get_saved_register
-   Find register number REGNUM relative to FRAME and put its (raw,
-   target format) contents in *RAW_BUFFER.
-
-   Set *OPTIMIZED if the variable was optimized out (and thus can't be
-   fetched).  Note that this is never set to anything other than zero
-   in this implementation.
-
-   Set *LVAL to lval_memory, lval_register, or not_lval, depending on
-   whether the value was fetched from memory, from a register, or in a
-   strange and non-modifiable way (e.g. a frame pointer which was
-   calculated rather than fetched).  We will use not_lval for values
-   fetched from generic dummy frames.
-
-   Set *ADDRP to the address, either in memory or as a
-   DEPRECATED_REGISTER_BYTE offset into the registers array.  If the
-   value is stored in a dummy frame, set *ADDRP to zero.
-
-   The argument RAW_BUFFER must point to aligned memory.  */
-
-void
-deprecated_generic_get_saved_register (char *raw_buffer, int *optimized,
-				       CORE_ADDR *addrp,
-				       struct frame_info *frame, int regnum,
-				       enum lval_type *lval)
-{
-  if (!target_has_registers)
-    error ("No registers.");
-
-  /* Normal systems don't optimize out things with register numbers.  */
-  if (optimized != NULL)
-    *optimized = 0;
-
-  if (addrp)			/* default assumption: not found in memory */
-    *addrp = 0;
-
-  /* Note: since the current frame's registers could only have been
-     saved by frames INTERIOR TO the current frame, we skip examining
-     the current frame itself: otherwise, we would be getting the
-     previous frame's registers which were saved by the current frame.  */
-
-  if (frame != NULL)
-    {
-      for (frame = get_next_frame (frame);
-	   frame_relative_level (frame) >= 0;
-	   frame = get_next_frame (frame))
-	{
-	  if (get_frame_type (frame) == DUMMY_FRAME)
-	    {
-	      if (lval)		/* found it in a CALL_DUMMY frame */
-		*lval = not_lval;
-	      if (raw_buffer)
-		/* FIXME: cagney/2002-06-26: This should be via the
-		   gdbarch_register_read() method so that it, on the
-		   fly, constructs either a raw or pseudo register
-		   from the raw register cache.  */
-		regcache_raw_read
-		  (deprecated_find_dummy_frame_regcache (get_frame_pc (frame),
-							 get_frame_base (frame)),
-		   regnum, raw_buffer);
-	      return;
-	    }
-
-	  DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
-	  if (deprecated_get_frame_saved_regs (frame) != NULL
-	      && deprecated_get_frame_saved_regs (frame)[regnum] != 0)
-	    {
-	      if (lval)		/* found it saved on the stack */
-		*lval = lval_memory;
-	      if (regnum == SP_REGNUM)
-		{
-		  if (raw_buffer)	/* SP register treated specially */
-		    /* NOTE: cagney/2003-05-09: In-line store_address
-                       with it's body - store_unsigned_integer.  */
-		    store_unsigned_integer (raw_buffer,
-					    DEPRECATED_REGISTER_RAW_SIZE (regnum),
-					    deprecated_get_frame_saved_regs (frame)[regnum]);
-		}
-	      else
-		{
-		  if (addrp)	/* any other register */
-		    *addrp = deprecated_get_frame_saved_regs (frame)[regnum];
-		  if (raw_buffer)
-		    read_memory (deprecated_get_frame_saved_regs (frame)[regnum], raw_buffer,
-				 DEPRECATED_REGISTER_RAW_SIZE (regnum));
-		}
-	      return;
-	    }
-	}
-    }
-
-  /* If we get thru the loop to this point, it means the register was
-     not saved in any frame.  Return the actual live-register value.  */
-
-  if (lval)			/* found it in a live register */
-    *lval = lval_register;
-  if (addrp)
-    *addrp = DEPRECATED_REGISTER_BYTE (regnum);
-  if (raw_buffer)
-    deprecated_read_register_gen (regnum, raw_buffer);
-}
-
 /* Determine the frame's type based on its PC.  */
 
 static enum frame_type
 frame_type_from_pc (CORE_ADDR pc)
 {
-  if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
-      && deprecated_pc_in_call_dummy (pc, 0, 0))
+  /* NOTE: cagney/2004-05-08: Eliminating this function depends on all
+     architectures being forced to use the frame-unwind code.  */
+  if (deprecated_pc_in_call_dummy (pc))
     return DUMMY_FRAME;
   else
-    {
-      char *name;
-      find_pc_partial_function (pc, &name, NULL, NULL);
-      if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
-	return SIGTRAMP_FRAME;
-      else
-	return NORMAL_FRAME;
-    }
+    return NORMAL_FRAME;
 }
 
 /* Create an arbitrary (i.e. address specified by user) or innermost frame.
@@ -1225,6 +1145,14 @@
     return NULL;
 }
 
+/* Observer for the target_changed event.  */
+
+void
+frame_observer_target_changed (struct target_ops *target)
+{
+  flush_cached_frames ();
+}
+
 /* Flush the entire frame cache.  */
 
 void
@@ -1256,7 +1184,7 @@
 }
 
 /* Create the previous frame using the deprecated methods
-   INIT_EXTRA_INFO, INIT_FRAME_PC and INIT_FRAME_PC_FIRST.  */
+   INIT_EXTRA_INFO, and INIT_FRAME_PC.  */
 
 static struct frame_info *
 legacy_get_prev_frame (struct frame_info *this_frame)
@@ -1273,7 +1201,7 @@
      There is no reason to worry about memory leaks, should the
      remainder of the function fail.  The allocated memory will be
      quickly reclaimed when the frame cache is flushed, and the `we've
-     been here before' check, in get_prev_frame will stop repeated
+     been here before' check, in get_prev_frame() will stop repeated
      memory allocation calls.  */
   prev = FRAME_OBSTACK_ZALLOC (struct frame_info);
   prev->level = this_frame->level + 1;
@@ -1292,8 +1220,7 @@
   /* NOTE: cagney/2002-11-18: Should have been correctly setting the
      frame's type here, before anything else, and not last, at the
      bottom of this function.  The various
-     DEPRECATED_INIT_EXTRA_FRAME_INFO, DEPRECATED_INIT_FRAME_PC,
-     DEPRECATED_INIT_FRAME_PC_FIRST and
+     DEPRECATED_INIT_EXTRA_FRAME_INFO, DEPRECATED_INIT_FRAME_PC, and
      DEPRECATED_FRAME_INIT_SAVED_REGS methods are full of work-arounds
      that handle the frame not being correctly set from the start.
      Unfortunately those same work-arounds rely on the type defaulting
@@ -1314,7 +1241,7 @@
 
 	 Note that the pc-unwind is intentionally performed before the
 	 frame chain.  This is ok since, for old targets, both
-	 frame_pc_unwind (nee, DEPRECATED_FRAME_SAVED_PC) and
+	 frame_pc_unwind() (nee, DEPRECATED_FRAME_SAVED_PC) and
 	 DEPRECATED_FRAME_CHAIN()) assume THIS_FRAME's data structures
 	 have already been initialized (using
 	 DEPRECATED_INIT_EXTRA_FRAME_INFO) and hence the call order
@@ -1444,7 +1371,7 @@
      frame.  This macro will set FROMLEAF if THIS_FRAME is a frameless
      function invocation.  */
   if (this_frame->level == 0)
-    /* FIXME: 2002-11-09: Frameless functions can occure anywhere in
+    /* FIXME: 2002-11-09: Frameless functions can occur anywhere in
        the frame chain, not just the inner most frame!  The generic,
        per-architecture, frame code should handle this and the below
        should simply be removed.  */
@@ -1458,7 +1385,7 @@
        architecture frame-pointer register!) of the caller is the same
        as the callee.  */
     /* FIXME: 2002-11-09: There isn't any reason to special case this
-       edge condition.  Instead the per-architecture code should hande
+       edge condition.  Instead the per-architecture code should handle
        it locally.  */
     /* FIXME: cagney/2003-06-16: This returns the inner most stack
        address for the previous frame, that, however, is wrong.  It
@@ -1494,11 +1421,10 @@
 	  /* Find PREV frame's unwinder.  */
 	  prev->unwind = frame_unwind_find_by_frame (this_frame,
 						     &prev->prologue_cache);
-	  /* FIXME: cagney/2003-04-02: Rather than storing the frame's
-	     type in the frame, the unwinder's type should be returned
-	     directly.  Unfortunately, legacy code, called by
-	     legacy_get_prev_frame, explicitly set the frames type
-	     using the method deprecated_set_frame_type().  */
+	  /* FIXME: cagney/2004-05-01: Should instead just use
+	     ->unwind->type.  Unfortunately, legacy_get_prev_frame is
+	     still explicitly setting the type.  Eliminate that method
+	     and this field can be eliminated.  */
 	  prev->type = prev->unwind->type;
 	  /* Find PREV frame's ID.  */
 	  prev->unwind->this_id (this_frame,
@@ -1551,10 +1477,6 @@
      machines appear to require DEPRECATED_INIT_EXTRA_FRAME_INFO
      before they can do DEPRECATED_INIT_FRAME_PC.  Phoo.
 
-     We shouldn't need DEPRECATED_INIT_FRAME_PC_FIRST to add more
-     complication to an already overcomplicated part of GDB.
-     gnu@cygnus.com, 15Sep92.
-
      Assuming that some machines need DEPRECATED_INIT_FRAME_PC after
      DEPRECATED_INIT_EXTRA_FRAME_INFO, one possible scheme:
 
@@ -1588,10 +1510,10 @@
      reason for things to be this complicated.
 
      The trick is to assume that there is always a frame.  Instead of
-     special casing the inner-most frame, create fake frame
+     special casing the inner-most frame, create a fake frame
      (containing the hardware registers) that is inner to the
      user-visible inner-most frame (...) and then unwind from that.
-     That way architecture code can use use the standard
+     That way architecture code can use the standard
      frame_XX_unwind() functions and not differentiate between the
      inner most and any other case.
 
@@ -1606,21 +1528,16 @@
      FRAME_SAVED_PC(), and FRAME_SAVED_PC() computes the PC but
      without first needing the frame!  Instead of the convolution
      below, we could have simply called FRAME_SAVED_PC() and been done
-     with it!  Note that FRAME_SAVED_PC() is being superseed by
+     with it!  Note that FRAME_SAVED_PC() is being superseded by
      frame_pc_unwind() and that function does have somewhere to cache
      that PC value.  */
 
-  if (DEPRECATED_INIT_FRAME_PC_FIRST_P ())
-    deprecated_update_frame_pc_hack (prev,
-				     DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf,
-								     prev));
-
   if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ())
     DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, prev);
 
   /* This entry is in the frame queue now, which is good since
      FRAME_SAVED_PC may use that queue to figure out its value (see
-     tm-sparc.h).  We want the pc saved in the inferior frame. */
+     tm-sparc.h).  We want the PC saved in the inferior frame. */
   if (DEPRECATED_INIT_FRAME_PC_P ())
     deprecated_update_frame_pc_hack (prev,
 				     DEPRECATED_INIT_FRAME_PC (fromleaf,
@@ -1657,7 +1574,7 @@
     prev->unwind = frame_unwind_find_by_frame (prev->next,
 					       &prev->prologue_cache);
 
-  /* If the unwinder provides a frame type, use it.  Otherwize
+  /* If the unwinder provides a frame type, use it.  Otherwise
      continue on to that heuristic mess.  */
   if (prev->unwind->type != UNKNOWN_FRAME)
     {
@@ -1676,35 +1593,15 @@
     }
 
   /* NOTE: cagney/2002-11-18: The code segments, found in
-     create_new_frame and get_prev_frame(), that initializes the
-     frames type is subtly different.  The latter only updates ->type
+     create_new_frame() and get_prev_frame(), that initialize the
+     frame's type is subtly different.  The latter only updates ->type
      when it encounters a SIGTRAMP_FRAME or DUMMY_FRAME.  This stops
      get_prev_frame() overriding the frame's type when the INIT code
      has previously set it.  This is really somewhat bogus.  The
      initialization, as seen in create_new_frame(), should occur
      before the INIT function has been called.  */
-  if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
-      && deprecated_pc_in_call_dummy (get_frame_pc (prev), 0, 0))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (prev)))
     prev->type = DUMMY_FRAME;
-  else
-    {
-      /* FIXME: cagney/2002-11-10: This should be moved to before the
-	 INIT code above so that the INIT code knows what the frame's
-	 type is (in fact, for a [generic] dummy-frame, the type can
-	 be set and then the entire initialization can be skipped.
-	 Unforunatly, its the INIT code that sets the PC (Hmm, catch
-	 22).  */
-      char *name;
-      find_pc_partial_function (get_frame_pc (prev), &name, NULL, NULL);
-      if (DEPRECATED_PC_IN_SIGTRAMP (get_frame_pc (prev), name))
-	prev->type = SIGTRAMP_FRAME;
-      /* FIXME: cagney/2002-11-11: Leave prev->type alone.  Some
-         architectures are forcing the frame's type in INIT so we
-         don't want to override it here.  Remember, NORMAL_FRAME == 0,
-         so it all works (just :-/).  Once this initialization is
-         moved to the start of this function, all this nastness will
-         go away.  */
-    }
 
   if (prev->type == NORMAL_FRAME)
     prev->this_id.value.code_addr
@@ -1720,23 +1617,23 @@
   return prev;
 }
 
-/* Return a structure containing various interesting information
-   about the frame that called THIS_FRAME.  Returns NULL
-   if there is no such frame.
+/* Return a "struct frame_info" corresponding to the frame that called
+   THIS_FRAME.  Returns NULL if there is no such frame.
 
-   This function tests some target-independent conditions that should
-   terminate the frame chain, such as unwinding past main().  It
-   should not contain any target-dependent tests, such as checking
-   whether the program-counter is zero.  */
+   Unlike get_prev_frame, this function always tries to unwind the
+   frame.  */
 
-struct frame_info *
-get_prev_frame (struct frame_info *this_frame)
+static struct frame_info *
+get_prev_frame_1 (struct frame_info *this_frame)
 {
   struct frame_info *prev_frame;
+  struct frame_id this_id;
+
+  gdb_assert (this_frame != NULL);
 
   if (frame_debug)
     {
-      fprintf_unfiltered (gdb_stdlog, "{ get_prev_frame (this_frame=");
+      fprintf_unfiltered (gdb_stdlog, "{ get_prev_frame_1 (this_frame=");
       if (this_frame != NULL)
 	fprintf_unfiltered (gdb_stdlog, "%d", this_frame->level);
       else
@@ -1744,107 +1641,6 @@
       fprintf_unfiltered (gdb_stdlog, ") ");
     }
 
-  /* Return the inner-most frame, when the caller passes in NULL.  */
-  /* NOTE: cagney/2002-11-09: Not sure how this would happen.  The
-     caller should have previously obtained a valid frame using
-     get_selected_frame() and then called this code - only possibility
-     I can think of is code behaving badly.
-
-     NOTE: cagney/2003-01-10: Talk about code behaving badly.  Check
-     block_innermost_frame().  It does the sequence: frame = NULL;
-     while (1) { frame = get_prev_frame (frame); .... }.  Ulgh!  Why
-     it couldn't be written better, I don't know.
-
-     NOTE: cagney/2003-01-11: I suspect what is happening is
-     block_innermost_frame() is, when the target has no state
-     (registers, memory, ...), still calling this function.  The
-     assumption being that this function will return NULL indicating
-     that a frame isn't possible, rather than checking that the target
-     has state and then calling get_current_frame() and
-     get_prev_frame().  This is a guess mind.  */
-  if (this_frame == NULL)
-    {
-      /* NOTE: cagney/2002-11-09: There was a code segment here that
-	 would error out when CURRENT_FRAME was NULL.  The comment
-	 that went with it made the claim ...
-
-	 ``This screws value_of_variable, which just wants a nice
-	 clean NULL return from block_innermost_frame if there are no
-	 frames.  I don't think I've ever seen this message happen
-	 otherwise.  And returning NULL here is a perfectly legitimate
-	 thing to do.''
-
-         Per the above, this code shouldn't even be called with a NULL
-         THIS_FRAME.  */
-      return current_frame;
-    }
-
-  /* There is always a frame.  If this assertion fails, suspect that
-     something should be calling get_selected_frame() or
-     get_current_frame().  */
-  gdb_assert (this_frame != NULL);
-
-  /* Make sure we pass an address within THIS_FRAME's code block to
-     inside_main_func.  Otherwise, we might stop unwinding at a
-     function which has a call instruction as its last instruction if
-     that function immediately precedes main().  */
-  if (this_frame->level >= 0
-      && !backtrace_past_main
-      && inside_main_func (get_frame_address_in_block (this_frame)))
-    /* Don't unwind past main(), bug always unwind the sentinel frame.
-       Note, this is done _before_ the frame has been marked as
-       previously unwound.  That way if the user later decides to
-       allow unwinds past main(), that just happens.  */
-    {
-      if (frame_debug)
-	fprintf_unfiltered (gdb_stdlog, "-> NULL // inside main func }\n");
-      return NULL;
-    }
-
-  if (this_frame->level > backtrace_limit)
-    {
-      error ("Backtrace limit of %d exceeded", backtrace_limit);
-    }
-
-  /* If we're already inside the entry function for the main objfile,
-     then it isn't valid.  Don't apply this test to a dummy frame -
-     dummy frame PC's typically land in the entry func.  Don't apply
-     this test to the sentinel frame.  Sentinel frames should always
-     be allowed to unwind.  */
-  /* NOTE: cagney/2003-02-25: Don't enable until someone has found
-     hard evidence that this is needed.  */
-  /* NOTE: cagney/2003-07-07: Fixed a bug in inside_main_func - wasn't
-     checking for "main" in the minimal symbols.  With that fixed
-     asm-source tests now stop in "main" instead of halting the
-     backtrace in wierd and wonderful ways somewhere inside the entry
-     file.  Suspect that deprecated_inside_entry_file and
-     inside_entry_func tests were added to work around that (now
-     fixed) case.  */
-  /* NOTE: cagney/2003-07-15: danielj (if I'm reading it right)
-     suggested having the inside_entry_func test use the
-     inside_main_func msymbol trick (along with entry_point_address I
-     guess) to determine the address range of the start function.
-     That should provide a far better stopper than the current
-     heuristics.  */
-  /* NOTE: cagney/2003-07-15: Need to add a "set backtrace
-     beyond-entry-func" command so that this can be selectively
-     disabled.  */
-  if (0
-#if 0
-      && backtrace_beyond_entry_func
-#endif
-      && this_frame->type != DUMMY_FRAME && this_frame->level >= 0
-      && inside_entry_func (this_frame))
-    {
-      if (frame_debug)
-	{
-	  fprintf_unfiltered (gdb_stdlog, "-> ");
-	  fprint_frame (gdb_stdlog, NULL);
-	  fprintf_unfiltered (gdb_stdlog, "// inside entry func }\n");
-	}
-      return NULL;
-    }
-
   /* Only try to do the unwind once.  */
   if (this_frame->prev_p)
     {
@@ -1858,42 +1654,8 @@
     }
   this_frame->prev_p = 1;
 
-  /* If we're inside the entry file, it isn't valid.  Don't apply this
-     test to a dummy frame - dummy frame PC's typically land in the
-     entry file.  Don't apply this test to the sentinel frame.
-     Sentinel frames should always be allowed to unwind.  */
-  /* NOTE: drow/2002-12-25: should there be a way to disable this
-     check?  It assumes a single small entry file, and the way some
-     debug readers (e.g.  dbxread) figure out which object is the
-     entry file is somewhat hokey.  */
-  /* NOTE: cagney/2003-01-10: If there is a way of disabling this test
-     then it should probably be moved to before the ->prev_p test,
-     above.  */
-  /* NOTE: vinschen/2003-04-01: Disabled.  It turns out that the call
-     to deprecated_inside_entry_file destroys a meaningful backtrace
-     under some conditions.  E. g. the backtrace tests in the
-     asm-source testcase are broken for some targets.  In this test
-     the functions are all implemented as part of one file and the
-     testcase is not necessarily linked with a start file (depending
-     on the target).  What happens is, that the first frame is printed
-     normaly and following frames are treated as being inside the
-     enttry file then.  This way, only the #0 frame is printed in the
-     backtrace output.  */
-  if (0
-      && this_frame->type != DUMMY_FRAME && this_frame->level >= 0
-      && deprecated_inside_entry_file (get_frame_pc (this_frame)))
-    {
-      if (frame_debug)
-	{
-	  fprintf_unfiltered (gdb_stdlog, "-> ");
-	  fprint_frame (gdb_stdlog, NULL);
-	  fprintf_unfiltered (gdb_stdlog, " // inside entry file }\n");
-	}
-      return NULL;
-    }
-
   /* If any of the old frame initialization methods are around, use
-     the legacy get_prev_frame method.  */
+     the legacy get_prev_frame() method.  */
   if (legacy_frame_p (current_gdbarch))
     {
       prev_frame = legacy_get_prev_frame (this_frame);
@@ -1903,7 +1665,8 @@
   /* Check that this frame's ID was valid.  If it wasn't, don't try to
      unwind to the prev frame.  Be careful to not apply this test to
      the sentinel frame.  */
-  if (this_frame->level >= 0 && !frame_id_p (get_frame_id (this_frame)))
+  this_id = get_frame_id (this_frame);
+  if (this_frame->level >= 0 && !frame_id_p (this_id))
     {
       if (frame_debug)
 	{
@@ -1916,19 +1679,18 @@
 
   /* Check that this frame's ID isn't inner to (younger, below, next)
      the next frame.  This happens when a frame unwind goes backwards.
-     Since the sentinel frame doesn't really exist, don't compare the
-     inner-most against that sentinel.  */
-  if (this_frame->level > 0
-      && frame_id_inner (get_frame_id (this_frame),
-			 get_frame_id (this_frame->next)))
+     Exclude signal trampolines (due to sigaltstack the frame ID can
+     go backwards) and sentinel frames (the test is meaningless).  */
+  if (this_frame->next->level >= 0
+      && this_frame->next->type != SIGTRAMP_FRAME
+      && frame_id_inner (this_id, get_frame_id (this_frame->next)))
     error ("Previous frame inner to this frame (corrupt stack?)");
 
   /* Check that this and the next frame are not identical.  If they
      are, there is most likely a stack cycle.  As with the inner-than
      test above, avoid comparing the inner-most and sentinel frames.  */
   if (this_frame->level > 0
-      && frame_id_eq (get_frame_id (this_frame),
-		      get_frame_id (this_frame->next)))
+      && frame_id_eq (this_id, get_frame_id (this_frame->next)))
     error ("Previous frame identical to this frame (corrupt stack?)");
 
   /* Allocate the new frame but do not wire it in to the frame chain.
@@ -1977,6 +1739,136 @@
   return prev_frame;
 }
 
+/* Debug routine to print a NULL frame being returned.  */
+
+static void
+frame_debug_got_null_frame (struct ui_file *file,
+			    struct frame_info *this_frame,
+			    const char *reason)
+{
+  if (frame_debug)
+    {
+      fprintf_unfiltered (gdb_stdlog, "{ get_prev_frame (this_frame=");
+      if (this_frame != NULL)
+	fprintf_unfiltered (gdb_stdlog, "%d", this_frame->level);
+      else
+	fprintf_unfiltered (gdb_stdlog, "<NULL>");
+      fprintf_unfiltered (gdb_stdlog, ") -> // %s}\n", reason);
+    }
+}
+
+/* Return a structure containing various interesting information about
+   the frame that called THIS_FRAME.  Returns NULL if there is entier
+   no such frame or the frame fails any of a set of target-independent
+   condition that should terminate the frame chain (e.g., as unwinding
+   past main()).
+
+   This function should not contain target-dependent tests, such as
+   checking whether the program-counter is zero.  */
+
+struct frame_info *
+get_prev_frame (struct frame_info *this_frame)
+{
+  struct frame_info *prev_frame;
+
+  /* Return the inner-most frame, when the caller passes in NULL.  */
+  /* NOTE: cagney/2002-11-09: Not sure how this would happen.  The
+     caller should have previously obtained a valid frame using
+     get_selected_frame() and then called this code - only possibility
+     I can think of is code behaving badly.
+
+     NOTE: cagney/2003-01-10: Talk about code behaving badly.  Check
+     block_innermost_frame().  It does the sequence: frame = NULL;
+     while (1) { frame = get_prev_frame (frame); .... }.  Ulgh!  Why
+     it couldn't be written better, I don't know.
+
+     NOTE: cagney/2003-01-11: I suspect what is happening in
+     block_innermost_frame() is, when the target has no state
+     (registers, memory, ...), it is still calling this function.  The
+     assumption being that this function will return NULL indicating
+     that a frame isn't possible, rather than checking that the target
+     has state and then calling get_current_frame() and
+     get_prev_frame().  This is a guess mind.  */
+  if (this_frame == NULL)
+    {
+      /* NOTE: cagney/2002-11-09: There was a code segment here that
+	 would error out when CURRENT_FRAME was NULL.  The comment
+	 that went with it made the claim ...
+
+	 ``This screws value_of_variable, which just wants a nice
+	 clean NULL return from block_innermost_frame if there are no
+	 frames.  I don't think I've ever seen this message happen
+	 otherwise.  And returning NULL here is a perfectly legitimate
+	 thing to do.''
+
+         Per the above, this code shouldn't even be called with a NULL
+         THIS_FRAME.  */
+      frame_debug_got_null_frame (gdb_stdlog, this_frame, "this_frame NULL");
+      return current_frame;
+    }
+
+  /* There is always a frame.  If this assertion fails, suspect that
+     something should be calling get_selected_frame() or
+     get_current_frame().  */
+  gdb_assert (this_frame != NULL);
+
+  /* Make sure we pass an address within THIS_FRAME's code block to
+     inside_main_func().  Otherwise, we might stop unwinding at a
+     function which has a call instruction as its last instruction if
+     that function immediately precedes main().  */
+  if (this_frame->level >= 0
+      && !backtrace_past_main
+      && inside_main_func (get_frame_address_in_block (this_frame)))
+    /* Don't unwind past main(), but always unwind the sentinel frame.
+       Note, this is done _before_ the frame has been marked as
+       previously unwound.  That way if the user later decides to
+       allow unwinds past main(), that just happens.  */
+    {
+      frame_debug_got_null_frame (gdb_stdlog, this_frame, "inside main func");
+      return NULL;
+    }
+
+  if (this_frame->level > backtrace_limit)
+    {
+      error ("Backtrace limit of %d exceeded", backtrace_limit);
+    }
+
+  /* If we're already inside the entry function for the main objfile,
+     then it isn't valid.  Don't apply this test to a dummy frame -
+     dummy frame PCs typically land in the entry func.  Don't apply
+     this test to the sentinel frame.  Sentinel frames should always
+     be allowed to unwind.  */
+  /* NOTE: cagney/2003-02-25: Don't enable until someone has found
+     hard evidence that this is needed.  */
+  /* NOTE: cagney/2003-07-07: Fixed a bug in inside_main_func() -
+     wasn't checking for "main" in the minimal symbols.  With that
+     fixed asm-source tests now stop in "main" instead of halting the
+     backtrace in weird and wonderful ways somewhere inside the entry
+     file.  Suspect that tests for inside the entry file/func were
+     added to work around that (now fixed) case.  */
+  /* NOTE: cagney/2003-07-15: danielj (if I'm reading it right)
+     suggested having the inside_entry_func test use the
+     inside_main_func() msymbol trick (along with entry_point_address()
+     I guess) to determine the address range of the start function.
+     That should provide a far better stopper than the current
+     heuristics.  */
+  /* NOTE: cagney/2003-07-15: Need to add a "set backtrace
+     beyond-entry-func" command so that this can be selectively
+     disabled.  */
+  if (0
+#if 0
+      && backtrace_beyond_entry_func
+#endif
+      && this_frame->type != DUMMY_FRAME && this_frame->level >= 0
+      && inside_entry_func (this_frame))
+    {
+      frame_debug_got_null_frame (gdb_stdlog, this_frame, "inside entry func");
+      return NULL;
+    }
+
+  return get_prev_frame_1 (this_frame);
+}
+
 CORE_ADDR
 get_frame_pc (struct frame_info *frame)
 {
@@ -1998,7 +1890,7 @@
      "call".  Adjust that PC value so that it falls on the call
      instruction (which, hopefully, falls within THIS frame's code
      block.  So far it's proved to be a very good approximation.  See
-     get_frame_type for why ->type can't be used.  */
+     get_frame_type() for why ->type can't be used.  */
   if (next_frame->level >= 0
       && get_frame_type (next_frame) == NORMAL_FRAME)
     --pc;
@@ -2109,27 +2001,20 @@
 enum frame_type
 get_frame_type (struct frame_info *frame)
 {
-  /* Some targets still don't use [generic] dummy frames.  Catch them
-     here.  */
-  if (!DEPRECATED_USE_GENERIC_DUMMY_FRAMES
-      && deprecated_frame_in_dummy (frame))
-    return DUMMY_FRAME;
-
   /* Some legacy code, e.g, mips_init_extra_frame_info() wants
      to determine the frame's type prior to it being completely
      initialized.  Don't attempt to lazily initialize ->unwind for
      legacy code.  It will be initialized in legacy_get_prev_frame().  */
   if (frame->unwind == NULL && !legacy_frame_p (current_gdbarch))
     {
-      /* Initialize the frame's unwinder because it is that which
+      /* Initialize the frame's unwinder because that's what
          provides the frame's type.  */
       frame->unwind = frame_unwind_find_by_frame (frame->next, 
 						  &frame->prologue_cache);
-      /* FIXME: cagney/2003-04-02: Rather than storing the frame's
-	 type in the frame, the unwinder's type should be returned
-	 directly.  Unfortunately, legacy code, called by
-	 legacy_get_prev_frame, explicitly set the frames type using
-	 the method deprecated_set_frame_type().  */
+      /* FIXME: cagney/2004-05-01: Should instead just use
+	 ->unwind->type.  Unfortunately, legacy_get_prev_frame is
+	 still explicitly setting the type.  Eliminate that method and
+	 this field can be eliminated.  */
       frame->type = frame->unwind->type;
     }
   if (frame->type == UNKNOWN_FRAME)
@@ -2138,13 +2023,6 @@
     return frame->type;
 }
 
-void
-deprecated_set_frame_type (struct frame_info *frame, enum frame_type type)
-{
-  /* Arrrg!  See comment in "frame.h".  */
-  frame->type = type;
-}
-
 struct frame_extra_info *
 get_frame_extra_info (struct frame_info *fi)
 {
@@ -2166,7 +2044,7 @@
 			"{ deprecated_update_frame_pc_hack (frame=%d,pc=0x%s) }\n",
 			frame->level, paddr_nz (pc));
   /* NOTE: cagney/2003-03-11: Some architectures (e.g., Arm) are
-     maintaining a locally allocated frame object.  Since such frame's
+     maintaining a locally allocated frame object.  Since such frames
      are not in the frame chain, it isn't possible to assume that the
      frame has a next.  Sigh.  */
   if (frame->next != NULL)
@@ -2234,6 +2112,14 @@
   return read_memory_unsigned_integer (addr, len);
 }
 
+int
+safe_frame_unwind_memory (struct frame_info *this_frame,
+			  CORE_ADDR addr, void *buf, int len)
+{
+  /* NOTE: read_memory_nobpt returns zero on success!  */
+  return !read_memory_nobpt (addr, buf, len);
+}
+
 /* Architecture method.  */
 
 struct gdbarch *
@@ -2253,12 +2139,12 @@
 CORE_ADDR
 frame_sp_unwind (struct frame_info *next_frame)
 {
-  /* Normality, an architecture that provides a way of obtaining any
+  /* Normality - an architecture that provides a way of obtaining any
      frame inner-most address.  */
   if (gdbarch_unwind_sp_p (current_gdbarch))
     return gdbarch_unwind_sp (current_gdbarch, next_frame);
   /* Things are looking grim.  If it's the inner-most frame and there
-     is a TARGET_READ_SP then that can be used.  */
+     is a TARGET_READ_SP, then that can be used.  */
   if (next_frame->level < 0 && TARGET_READ_SP_P ())
     return TARGET_READ_SP ();
   /* Now things are really are grim.  Hope that the value returned by
@@ -2277,7 +2163,6 @@
 legacy_frame_p (struct gdbarch *current_gdbarch)
 {
   if (DEPRECATED_INIT_FRAME_PC_P ()
-      || DEPRECATED_INIT_FRAME_PC_FIRST_P ()
       || DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()
       || DEPRECATED_FRAME_CHAIN_P ())
     /* No question, it's a legacy frame.  */
@@ -2290,12 +2175,12 @@
       || DEPRECATED_FP_REGNUM >= 0)
     /* Assume it's legacy.  If you're trying to convert a legacy frame
        target to the new mechanism, get rid of these.  legacy
-       get_prev_frame requires these when unwind_frame_id isn't
+       get_prev_frame() requires these when unwind_frame_id() isn't
        available.  */
     return 1;
   /* Default to assuming that it's brand new code, and hence not
      legacy.  Force it down the non-legacy path so that the new code
-     uses the new frame mechanism from day one.  Dummy frame's won't
+     uses the new frame mechanism from day one.  Dummy frames won't
      work very well but we can live with that.  */
   return 0;
 }
@@ -2322,6 +2207,8 @@
 {
   obstack_init (&frame_cache_obstack);
 
+  observer_attach_target_changed (frame_observer_target_changed);
+
   add_prefix_cmd ("backtrace", class_maintenance, set_backtrace_cmd, "\
 Set backtrace specific variables.\n\
 Configure backtrace variables such as the backtrace limit",
diff --git a/gdb/frame.h b/gdb/frame.h
index 028167d..5fa3d89 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -40,8 +40,8 @@
    strongly hinting at its unsafeness)
 
    safe_....(): Safer version of various functions, doesn't throw an
-   error (leave this for later?).  Returns non-zero if the fetch
-   succeeds.   Return a freshly allocated error message?
+   error (leave this for later?).  Returns non-zero / non-NULL if the
+   request succeeds, zero / NULL otherwize.
 
    Suffixes:
 
@@ -94,23 +94,39 @@
      outer-most address (the inner-most address of the previous frame)
      is used.  Watch out for all the legacy targets that still use the
      function pointer register or stack pointer register.  They are
-     wrong.  */
+     wrong.
+
+     This field is valid only if stack_addr_p is true.  Otherwise, this
+     frame represents the null frame.  */
   CORE_ADDR stack_addr;
+
   /* The frame's code address.  This shall be constant through out the
      lifetime of the frame.  While the PC (a.k.a. resume address)
      changes as the function is executed, this code address cannot.
      Typically, it is set to the address of the entry point of the
-     frame's function (as returned by frame_func_unwind().  */
+     frame's function (as returned by frame_func_unwind().  
+
+     This field is valid only if code_addr_p is true.  Otherwise, this
+     frame is considered to have a wildcard code address, i.e. one that
+     matches every address value in frame comparisons.  */
   CORE_ADDR code_addr;
+
   /* The frame's special address.  This shall be constant through out the
      lifetime of the frame.  This is used for architectures that may have
      frames that do not change the stack but are still distinct and have 
      some form of distinct identifier (e.g. the ia64 which uses a 2nd 
      stack for registers).  This field is treated as unordered - i.e. will
      not be used in frame ordering comparisons such as frame_id_inner().
-     A zero in this field will be treated as a wild-card when comparing
-     frames for equality.  */
+
+     This field is valid only if special_addr_p is true.  Otherwise, this
+     frame is considered to have a wildcard special address, i.e. one that
+     matches every address value in frame comparisons.  */
   CORE_ADDR special_addr;
+
+  /* Flags to indicate the above fields have valid contents.  */
+  unsigned int stack_addr_p : 1;
+  unsigned int code_addr_p : 1;
+  unsigned int special_addr_p : 1;
 };
 
 /* Methods for constructing and comparing Frame IDs.
@@ -135,22 +151,24 @@
 
 /* Construct a frame ID.  The first parameter is the frame's constant
    stack address (typically the outer-bound), and the second the
-   frame's constant code address (typically the entry point) (or zero,
-   to indicate a wild card).  The special identifier address is
-   defaulted to zero.  */
+   frame's constant code address (typically the entry point).
+   The special identifier address is set to indicate a wild card.  */
 extern struct frame_id frame_id_build (CORE_ADDR stack_addr,
 				       CORE_ADDR code_addr);
 
 /* Construct a special frame ID.  The first parameter is the frame's constant
    stack address (typically the outer-bound), the second is the
-   frame's constant code address (typically the entry point) (or zero,
-   to indicate a wild card), and the third parameter is the frame's
-   special identifier address (or zero to indicate a wild card or 
-   unused default).  */
+   frame's constant code address (typically the entry point),
+   and the third parameter is the frame's special identifier address. */
 extern struct frame_id frame_id_build_special (CORE_ADDR stack_addr,
 					       CORE_ADDR code_addr,
 					       CORE_ADDR special_addr);
 
+/* Construct a wild card frame ID.  The parameter is the frame's constant
+   stack address (typically the outer-bound).  The code address as well
+   as the special identifier address are set to indicate wild cards.  */
+extern struct frame_id frame_id_build_wild (CORE_ADDR stack_addr);
+
 /* Returns non-zero when L is a valid frame (a valid frame has a
    non-zero .base).  */
 extern int frame_id_p (struct frame_id l);
@@ -175,7 +193,7 @@
    CLI (selected using `up', `down', ...).  The frames are created
    on-demand (via get_prev_frame()) and then held in a frame cache.  */
 /* FIXME: cagney/2002-11-28: Er, there is a lie here.  If you do the
-   sequence: `thread 1; up; thread 2; thread 1' you loose thread 1's
+   sequence: `thread 1; up; thread 2; thread 1' you lose thread 1's
    selected frame.  At present GDB only tracks the selected frame of
    the current thread.  But be warned, that might change.  */
 /* FIXME: cagney/2002-11-14: At any time, only one thread's selected
@@ -193,11 +211,11 @@
 
    FIXME: cagney/2002-11-28: The only difference between
    flush_cached_frames() and reinit_frame_cache() is that the latter
-   explicitly sets the selected frame back to the current frame there
+   explicitly sets the selected frame back to the current frame -- there
    isn't any real difference (except that one delays the selection of
    a new frame).  Code can instead simply rely on get_selected_frame()
-   to reinit's the selected frame as needed.  As for invalidating the
-   cache, there should be two methods one that reverts the thread's
+   to reinit the selected frame as needed.  As for invalidating the
+   cache, there should be two methods: one that reverts the thread's
    selected frame back to current frame (for when the inferior
    resumes) and one that does not (for when the user modifies the
    target invalidating the frame cache).  */
@@ -234,7 +252,7 @@
    This replaced: frame->pc; */
 extern CORE_ADDR get_frame_pc (struct frame_info *);
 
-/* An address (not necessarily alligned to an instruction boundary)
+/* An address (not necessarily aligned to an instruction boundary)
    that falls within THIS frame's code block.
 
    When a function call is the last statement in a block, the return
@@ -267,8 +285,8 @@
    attributes that are determined by the PC.  Note that for a normal
    frame, the PC refers to the resume address after the return, and
    not the call instruction.  In such a case, the address is adjusted
-   so that it (approximatly) identifies the call site (and not return
-   site).
+   so that it (approximately) identifies the call site (and not the
+   return site).
 
    NOTE: cagney/2002-11-28: The frame cache could be used to cache the
    computed value.  Working on the assumption that the bottle-neck is
@@ -310,8 +328,24 @@
 
 /* Return the per-frame unique identifer.  Can be used to relocate a
    frame after a frame cache flush (and other similar operations).  If
-   FI is NULL, return the null_frame_id.  */
+   FI is NULL, return the null_frame_id.
+
+   NOTE: kettenis/20040508: These functions return a structure.  On
+   platforms where structures are returned in static storage (vax,
+   m68k), this may trigger compiler bugs in code like:
+
+   if (frame_id_eq (get_frame_id (l), get_frame_id (r)))
+
+   where the return value from the first get_frame_id (l) gets
+   overwritten by the second get_frame_id (r).  Please avoid writing
+   code like this.  Use code like:
+
+   struct frame_id id = get_frame_id (l);
+   if (frame_id_eq (id, get_frame_id (r)))
+
+   instead, since that avoids the bug.  */
 extern struct frame_id get_frame_id (struct frame_info *fi);
+extern struct frame_id frame_unwind_id (struct frame_info *next_frame);
 
 /* Assuming that a frame is `normal', return its base-address, or 0 if
    the information isn't available.  NOTE: This address is really only
@@ -342,9 +376,9 @@
 enum frame_type
 {
   /* The frame's type hasn't yet been defined.  This is a catch-all
-     for legacy code that uses really strange technicques, such as
-     deprecated_set_frame_type, to set the frame's type.  New code
-     should not use this value.  */
+     for legacy_get_prev_frame that uses really strange techniques to
+     determine the frame's type.  New code should not use this
+     value.  */
   UNKNOWN_FRAME,
   /* A true stack frame, created by the target program during normal
      execution.  */
@@ -354,23 +388,13 @@
   DUMMY_FRAME,
   /* In a signal handler, various OSs handle this in various ways.
      The main thing is that the frame may be far from normal.  */
-  SIGTRAMP_FRAME
+  SIGTRAMP_FRAME,
+  /* Sentinel or registers frame.  This frame obtains register values
+     direct from the inferior's registers.  */
+  SENTINEL_FRAME
 };
 extern enum frame_type get_frame_type (struct frame_info *);
 
-/* FIXME: cagney/2002-11-10: Some targets want to directly mark a
-   frame as being of a specific type.  This shouldn't be necessary.
-   DEPRECATED_PC_IN_SIGTRAMP() indicates a SIGTRAMP_FRAME and
-   DEPRECATED_PC_IN_CALL_DUMMY() indicates a DUMMY_FRAME.  I suspect
-   the real problem here is that get_prev_frame() only sets
-   initialized after DEPRECATED_INIT_EXTRA_FRAME_INFO as been called.
-   Consequently, some targets found that the frame's type was wrong
-   and tried to fix it.  The correct fix is to modify get_prev_frame()
-   so that it initializes the frame's type before calling any other
-   functions.  */
-extern void deprecated_set_frame_type (struct frame_info *,
-				       enum frame_type type);
-
 /* Unwind the stack frame so that the value of REGNUM, in the previous
    (up, older) frame is returned.  If VALUEP is NULL, don't
    fetch/compute the value.  Instead just return the location of the
@@ -460,12 +484,17 @@
 extern ULONGEST get_frame_memory_unsigned (struct frame_info *this_frame,
 					   CORE_ADDR memaddr, int len);
 
+/* Same as above, but return non-zero when the entire memory read
+   succeeds, zero otherwize.  */
+extern int safe_frame_unwind_memory (struct frame_info *this_frame,
+				     CORE_ADDR addr, void *buf, int len);
+
 /* Return this frame's architecture.  */
 
 extern struct gdbarch *get_frame_arch (struct frame_info *this_frame);
 
 
-/* Values for the source flag to be used in print_frame_info_base(). */
+/* Values for the source flag to be used in print_frame_info_base().  */
 enum print_what
   { 
     /* Print only the source line, like in stepi. */
@@ -482,7 +511,7 @@
 /* Allocate additional space for appendices to a struct frame_info.
    NOTE: Much of GDB's code works on the assumption that the allocated
    saved_regs[] array is the size specified below.  If you try to make
-   that array smaller, GDB will happily walk off its end. */
+   that array smaller, GDB will happily walk off its end.  */
 
 #ifdef SIZEOF_FRAME_SAVED_REGS
 #error "SIZEOF_FRAME_SAVED_REGS can not be re-defined"
@@ -501,7 +530,7 @@
 /* If legacy_frame_chain_valid() returns zero it means that the given
    frame is the outermost one and has no caller.
 
-   This method has been superseeded by the per-architecture
+   This method has been superseded by the per-architecture
    frame_unwind_pc() (returns 0 to indicate an invalid return address)
    and per-frame this_id() (returns a NULL frame ID to indicate an
    invalid frame).  */
@@ -525,7 +554,7 @@
    Should it look at the most recently specified SAL?  If the target
    has no state, should this function try to extract a block from the
    most recently selected SAL?  That way `list foo' would give it some
-   sort of reference point.  Then again, perhaphs that would confuse
+   sort of reference point.  Then again, perhaps that would confuse
    things.
 
    Calls to this function can be broken down into two categories: Code
@@ -535,7 +564,7 @@
 
    The latter can be eliminated by correctly parameterizing the code,
    the former though is more interesting.  Per the "address" command,
-   it occures in the CLI code and makes it possible for commands to
+   it occurs in the CLI code and makes it possible for commands to
    work, even when the inferior has no state.  */
 
 extern struct block *get_selected_block (CORE_ADDR *addr_in_block);
@@ -548,43 +577,35 @@
 
 extern struct frame_info *find_relative_frame (struct frame_info *, int *);
 
-extern void show_and_print_stack_frame (struct frame_info *fi, int level,
-					int source);
+extern void show_and_print_stack_frame (struct frame_info *fi, int print_level,
+					enum print_what print_what);
 
-extern void print_stack_frame (struct frame_info *, int, int);
+extern void print_stack_frame (struct frame_info *, int print_level,
+			       enum print_what print_what);
 
 extern void show_stack_frame (struct frame_info *);
 
-extern void print_frame_info (struct frame_info *, int, int, int);
-
-extern void show_frame_info (struct frame_info *, int, int, int);
+extern void print_frame_info (struct frame_info *, int print_level,
+			      enum print_what print_what, int args);
 
 extern struct frame_info *block_innermost_frame (struct block *);
 
-/* NOTE: cagney/2002-09-13: There is no need for this function.   */
+/* NOTE: cagney/2002-09-13: There is no need for this function.  */
 extern CORE_ADDR deprecated_read_register_dummy (CORE_ADDR pc,
 						 CORE_ADDR fp, int);
 extern void generic_push_dummy_frame (void);
 extern void deprecated_pop_dummy_frame (void);
 
-extern int deprecated_pc_in_call_dummy (CORE_ADDR pc, CORE_ADDR sp,
-					CORE_ADDR fp);
+extern int deprecated_pc_in_call_dummy (CORE_ADDR pc);
 
 /* NOTE: cagney/2002-06-26: Targets should no longer use this
-   function.  Instead, the contents of a dummy frames registers can be
+   function.  Instead, the contents of a dummy frame register can be
    obtained by applying: frame_register_unwind to the dummy frame; or
    frame_register_unwind() to the next outer frame.  */
 
 extern char *deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
 
 
-/* The DEPRECATED_GET_SAVED_REGISTER architecture interface is
-   entirely redundant.  New architectures should implement per-frame
-   unwinders (ref "frame-unwind.h").  */
-extern void deprecated_generic_get_saved_register (char *, int *, CORE_ADDR *,
-						   struct frame_info *, int,
-						   enum lval_type *);
-
 extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi);
 
 /* FIXME: cagney/2003-02-02: Should be deprecated or replaced with a
@@ -605,7 +626,7 @@
 
 extern void locals_info (char *, int);
 
-extern void (*selected_frame_level_changed_hook) (int);
+extern void (*deprecated_selected_frame_level_changed_hook) (int);
 
 extern void return_command (char *, int);
 
@@ -618,11 +639,11 @@
    Unfortunately, it isn't that easy.
 
    The relevant code needs to be audited to determine if it is
-   possible (or pratical) to instead pass the applicable frame in as a
+   possible (or practical) to instead pass the applicable frame in as a
    parameter.  For instance, DEPRECATED_DO_REGISTERS_INFO() relied on
    the deprecated_selected_frame global, while its replacement,
    PRINT_REGISTERS_INFO(), is parameterized with the selected frame.
-   The only real exceptions occure at the edge (in the CLI code) where
+   The only real exceptions occur at the edge (in the CLI code) where
    user commands need to pick up the selected frame before proceeding.
 
    This is important.  GDB is trying to stamp out the hack:
diff --git a/gdb/frv-linux-tdep.c b/gdb/frv-linux-tdep.c
index e862625..b365915 100644
--- a/gdb/frv-linux-tdep.c
+++ b/gdb/frv-linux-tdep.c
@@ -26,6 +26,8 @@
 #include "elf-bfd.h"
 #include "elf/frv.h"
 #include "frv-tdep.h"
+#include "trad-frame.h"
+#include "frame-unwind.h"
 
 /* Define the size (in bytes) of an FR-V instruction.  */
 static const int frv_instr_size = 4;
@@ -151,7 +153,7 @@
 	      void *extension;
       } __attribute__((aligned(8)));  */
 
-static CORE_ADDR
+static LONGEST
 frv_linux_sigcontext_reg_addr (struct frame_info *next_frame, int regno,
                                CORE_ADDR *sc_addr_cache_ptr)
 {
@@ -233,15 +235,93 @@
     }
 }
 
+/* Signal trampolines.  */
+
+static struct trad_frame_cache *
+frv_linux_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
+{
+  struct trad_frame_cache *cache;
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  CORE_ADDR addr;
+  char buf[4];
+  int regnum;
+  CORE_ADDR sc_addr_cache_val = 0;
+  struct frame_id this_id;
+
+  if (*this_cache)
+    return *this_cache;
+
+  cache = trad_frame_cache_zalloc (next_frame);
+
+  /* FIXME: cagney/2004-05-01: This is is long standing broken code.
+     The frame ID's code address should be the start-address of the
+     signal trampoline and not the current PC within that
+     trampoline.  */
+  frame_unwind_register (next_frame, sp_regnum, buf);
+  this_id = frame_id_build (extract_unsigned_integer (buf, sizeof buf),
+			    frame_pc_unwind (next_frame));
+  trad_frame_set_id (cache, this_id);
+
+  for (regnum = 0; regnum < frv_num_regs; regnum++)
+    {
+      LONGEST reg_addr = frv_linux_sigcontext_reg_addr (next_frame, regnum,
+							&sc_addr_cache_val);
+      if (reg_addr != -1)
+	trad_frame_set_reg_addr (cache, regnum, reg_addr);
+    }
+
+  *this_cache = cache;
+  return cache;
+}
+
+static void
+frv_linux_sigtramp_frame_this_id (struct frame_info *next_frame, void **this_cache,
+			     struct frame_id *this_id)
+{
+  struct trad_frame_cache *cache =
+    frv_linux_sigtramp_frame_cache (next_frame, this_cache);
+  trad_frame_get_id (cache, this_id);
+}
+
+static void
+frv_linux_sigtramp_frame_prev_register (struct frame_info *next_frame,
+				   void **this_cache,
+				   int regnum, int *optimizedp,
+				   enum lval_type *lvalp, CORE_ADDR *addrp,
+				   int *realnump, void *valuep)
+{
+  /* Make sure we've initialized the cache.  */
+  struct trad_frame_cache *cache =
+    frv_linux_sigtramp_frame_cache (next_frame, this_cache);
+  trad_frame_get_register (cache, next_frame, regnum, optimizedp, lvalp,
+			   addrp, realnump, valuep);
+}
+
+static const struct frame_unwind frv_linux_sigtramp_frame_unwind =
+{
+  SIGTRAMP_FRAME,
+  frv_linux_sigtramp_frame_this_id,
+  frv_linux_sigtramp_frame_prev_register
+};
+
+static const struct frame_unwind *
+frv_linux_sigtramp_frame_sniffer (struct frame_info *next_frame)
+{
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
+  if (frv_linux_pc_in_sigtramp (pc, name))
+    return &frv_linux_sigtramp_frame_unwind;
+
+  return NULL;
+}
+
 static void
 frv_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  /* When the FR-V Linux kernel calls a signal handler, the return
-     address points to a bit of code on the stack.  This function is
-     used to identify this bit of code as a signal trampoline in order
-     to support backtracing through calls to signal handlers.  */
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, frv_linux_pc_in_sigtramp);
-  frv_set_sigcontext_reg_addr (gdbarch, frv_linux_sigcontext_reg_addr);
+  /* Set the sigtramp frame sniffer.  */
+  frame_unwind_append_sniffer (gdbarch, frv_linux_sigtramp_frame_sniffer); 
 }
 
 static enum gdb_osabi
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 8028e46..9b7524c 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -37,6 +37,7 @@
 #include "elf-bfd.h"
 #include "elf/frv.h"
 #include "osabi.h"
+#include "infcall.h"
 #include "frv-tdep.h"
 
 extern void _initialize_frv_tdep (void);
@@ -96,11 +97,6 @@
 
   /* Register names.  */
   char **register_names;
-
-  /* Given NEXT_FRAME, determine the address of register REGNO saved in
-     the calling sigtramp frame.  */
-  CORE_ADDR (*sigcontext_reg_addr) (struct frame_info *next_frame, int regno,
-                                    CORE_ADDR *);
 };
 
 #define CURRENT_VARIANT (gdbarch_tdep (current_gdbarch))
@@ -112,15 +108,6 @@
   return gdbarch_tdep (gdbarch)->frv_abi;
 }
 
-/* Set sigcontext_reg_addr.  */
-void
-frv_set_sigcontext_reg_addr (struct gdbarch *gdbarch,
-                             CORE_ADDR (*sigcontext_reg_addr)
-			       (struct frame_info *, int, CORE_ADDR *))
-{
-  gdbarch_tdep (gdbarch)->sigcontext_reg_addr = sigcontext_reg_addr;
-}
-
 /* Fetch the interpreter and executable loadmap addresses (for shared
    library support) for the FDPIC ABI.  Return 0 if successful, -1 if
    not.  (E.g, -1 will be returned if the ABI isn't the FDPIC ABI.)  */
@@ -200,6 +187,44 @@
   var->register_names[iacc0l_regnum] = "iacc0l";
   var->register_names[iacc0_regnum] = "iacc0";
 
+  /* fsr0 (Found on FR555 and FR501.)  */
+  var->register_names[fsr0_regnum] = "fsr0";
+
+  /* acc0 - acc7.  The architecture provides for the possibility of many
+     more (up to 64 total), but we don't want to make that big of a hole
+     in the G packet.  If we need more in the future, we'll add them
+     elsewhere.  */
+  for (r = acc0_regnum; r <= acc7_regnum; r++)
+    {
+      char *buf;
+      buf = xstrprintf ("acc%d", r - acc0_regnum);
+      var->register_names[r] = buf;
+    }
+
+  /* accg0 - accg7: These are one byte registers.  The remote protocol
+     provides the raw values packed four into a slot.  accg0123 and
+     accg4567 correspond to accg0 - accg3 and accg4-accg7 respectively.
+     We don't provide names for accg0123 and accg4567 since the user will
+     likely not want to see these raw values.  */
+
+  for (r = accg0_regnum; r <= accg7_regnum; r++)
+    {
+      char *buf;
+      buf = xstrprintf ("accg%d", r - accg0_regnum);
+      var->register_names[r] = buf;
+    }
+
+  /* msr0 and msr1.  */
+
+  var->register_names[msr0_regnum] = "msr0";
+  var->register_names[msr1_regnum] = "msr1";
+
+  /* gner and fner registers.  */
+  var->register_names[gner0_regnum] = "gner0";
+  var->register_names[gner1_regnum] = "gner1";
+  var->register_names[fner0_regnum] = "fner0";
+  var->register_names[fner1_regnum] = "fner1";
+
   return var;
 }
 
@@ -290,6 +315,21 @@
       regcache_raw_read (regcache, iacc0h_regnum, buffer);
       regcache_raw_read (regcache, iacc0l_regnum, (bfd_byte *) buffer + 4);
     }
+  else if (accg0_regnum <= reg && reg <= accg7_regnum)
+    {
+      /* The accg raw registers have four values in each slot with the
+         lowest register number occupying the first byte.  */
+
+      int raw_regnum = accg0123_regnum + (reg - accg0_regnum) / 4;
+      int byte_num = (reg - accg0_regnum) % 4;
+      bfd_byte buf[4];
+
+      regcache_raw_read (regcache, raw_regnum, buf);
+      memset (buffer, 0, 4);
+      /* FR-V is big endian, so put the requested byte in the first byte
+         of the buffer allocated to hold the pseudo-register.  */
+      ((bfd_byte *) buffer)[0] = buf[byte_num];
+    }
 }
 
 static void
@@ -301,6 +341,19 @@
       regcache_raw_write (regcache, iacc0h_regnum, buffer);
       regcache_raw_write (regcache, iacc0l_regnum, (bfd_byte *) buffer + 4);
     }
+  else if (accg0_regnum <= reg && reg <= accg7_regnum)
+    {
+      /* The accg raw registers have four values in each slot with the
+         lowest register number occupying the first byte.  */
+
+      int raw_regnum = accg0123_regnum + (reg - accg0_regnum) / 4;
+      int byte_num = (reg - accg0_regnum) % 4;
+      char buf[4];
+
+      regcache_raw_read (regcache, raw_regnum, buf);
+      buf[byte_num] = ((bfd_byte *) buffer)[0];
+      regcache_raw_write (regcache, raw_regnum, buf);
+    }
 }
 
 static int
@@ -311,8 +364,8 @@
       H_SPR_PSR,		/* psr_regnum */
       H_SPR_CCR,		/* ccr_regnum */
       H_SPR_CCCR,		/* cccr_regnum */
-      -1,			/* 132 */
-      -1,			/* 133 */
+      -1,			/* fdpic_loadmap_exec_regnum */
+      -1,			/* fdpic_loadmap_interp_regnum */
       -1,			/* 134 */
       H_SPR_TBR,		/* tbr_regnum */
       H_SPR_BRR,		/* brr_regnum */
@@ -320,14 +373,32 @@
       H_SPR_DBAR1,		/* dbar1_regnum */
       H_SPR_DBAR2,		/* dbar2_regnum */
       H_SPR_DBAR3,		/* dbar3_regnum */
-      -1,			/* 141 */
-      -1,			/* 142 */
-      -1,			/* 143 */
-      -1,			/* 144 */
+      H_SPR_SCR0,		/* scr0_regnum */
+      H_SPR_SCR1,		/* scr1_regnum */
+      H_SPR_SCR2,		/* scr2_regnum */
+      H_SPR_SCR3,		/* scr3_regnum */
       H_SPR_LR,			/* lr_regnum */
       H_SPR_LCR,		/* lcr_regnum */
       H_SPR_IACC0H,		/* iacc0h_regnum */
-      H_SPR_IACC0L		/* iacc0l_regnum */
+      H_SPR_IACC0L,		/* iacc0l_regnum */
+      H_SPR_FSR0,		/* fsr0_regnum */
+      /* FIXME: Add infrastructure for fetching/setting ACC and ACCG regs.  */
+      -1,			/* acc0_regnum */
+      -1,			/* acc1_regnum */
+      -1,			/* acc2_regnum */
+      -1,			/* acc3_regnum */
+      -1,			/* acc4_regnum */
+      -1,			/* acc5_regnum */
+      -1,			/* acc6_regnum */
+      -1,			/* acc7_regnum */
+      -1,			/* acc0123_regnum */
+      -1,			/* acc4567_regnum */
+      H_SPR_MSR0,		/* msr0_regnum */
+      H_SPR_MSR1,		/* msr1_regnum */
+      H_SPR_GNER0,		/* gner0_regnum */
+      H_SPR_GNER1,		/* gner1_regnum */
+      H_SPR_FNER0,		/* fner0_regnum */
+      H_SPR_FNER1,		/* fner1_regnum */
     };
 
   gdb_assert (reg >= 0 && reg < NUM_REGS);
@@ -1048,7 +1119,7 @@
 }
 
 static CORE_ADDR
-frv_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                      struct regcache *regcache, CORE_ADDR bp_addr,
                      int nargs, struct value **args, CORE_ADDR sp,
 		     int struct_return, CORE_ADDR struct_addr)
@@ -1065,6 +1136,7 @@
   int stack_space;
   int stack_offset;
   enum frv_abi abi = frv_abi (gdbarch);
+  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
 #if 0
   printf("Push %d args at sp = %x, struct_return=%d (%x)\n",
@@ -1286,16 +1358,6 @@
     return;
 
   id = frame_id_build (base, func);
-
-  /* Check that we're not going round in circles with the same frame
-     ID (but avoid applying the test to sentinel frames which do go
-     round in circles).  Can't use frame_id_eq() as that doesn't yet
-     compare the frame's PC value.  */
-  if (frame_relative_level (next_frame) >= 0
-      && get_frame_type (next_frame) != DUMMY_FRAME
-      && frame_id_eq (get_frame_id (next_frame), id))
-    return;
-
   (*this_id) = id;
 }
 
@@ -1358,102 +1420,6 @@
 			 frame_pc_unwind (next_frame));
 }
 
-/* Signal trampolines.  */
-
-static struct frv_unwind_cache *
-frv_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
-{
-  struct frv_unwind_cache *cache;
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-  CORE_ADDR addr;
-  char buf[4];
-  int regno;
-  CORE_ADDR sc_addr_cache_val = 0;
-
-  if (*this_cache)
-    return *this_cache;
-
-  cache = FRAME_OBSTACK_ZALLOC (struct frv_unwind_cache);
-  cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
-
-  frame_unwind_register (next_frame, sp_regnum, buf);
-  cache->base = extract_unsigned_integer (buf, sizeof buf);
-
-  for (regno = 0; regno < frv_num_regs; regno++)
-    {
-      cache->saved_regs[regno].addr 
-	= tdep->sigcontext_reg_addr (next_frame, regno, &sc_addr_cache_val);
-    }
-
-
-  if (cache->saved_regs[sp_regnum].addr != -1
-      && target_read_memory (cache->saved_regs[sp_regnum].addr,
-                              buf, sizeof buf) == 0)
-    {
-      cache->prev_sp = extract_unsigned_integer (buf, sizeof buf);
-
-      /* Now that we've bothered to read it out of memory, save the
-         prev frame's SP value in the cache.  */
-      trad_frame_set_value (cache->saved_regs, sp_regnum, cache->prev_sp);
-    }
-  else
-    {
-      warning ("Can't read SP value from sigtramp frame");
-    }
-
-  *this_cache = cache;
-  return cache;
-}
-
-static void
-frv_sigtramp_frame_this_id (struct frame_info *next_frame, void **this_cache,
-			     struct frame_id *this_id)
-{
-  struct frv_unwind_cache *cache =
-    frv_sigtramp_frame_cache (next_frame, this_cache);
-
-  (*this_id) = frame_id_build (cache->base, frame_pc_unwind (next_frame));
-}
-
-static void
-frv_sigtramp_frame_prev_register (struct frame_info *next_frame,
-				   void **this_cache,
-				   int regnum, int *optimizedp,
-				   enum lval_type *lvalp, CORE_ADDR *addrp,
-				   int *realnump, void *valuep)
-{
-  /* Make sure we've initialized the cache.  */
-  frv_sigtramp_frame_cache (next_frame, this_cache);
-
-  frv_frame_prev_register (next_frame, this_cache, regnum,
-			    optimizedp, lvalp, addrp, realnump, valuep);
-}
-
-static const struct frame_unwind frv_sigtramp_frame_unwind =
-{
-  SIGTRAMP_FRAME,
-  frv_sigtramp_frame_this_id,
-  frv_sigtramp_frame_prev_register
-};
-
-static const struct frame_unwind *
-frv_sigtramp_frame_sniffer (struct frame_info *next_frame)
-{
-  CORE_ADDR pc = frame_pc_unwind (next_frame);
-  char *name;
-
-  /* We shouldn't even bother to try if the OSABI didn't register
-     a sigcontext_reg_addr handler.  */
-  if (!gdbarch_tdep (current_gdbarch)->sigcontext_reg_addr)
-    return NULL;
-
-  find_pc_partial_function (pc, &name, NULL, NULL);
-  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
-    return &frv_sigtramp_frame_unwind;
-
-  return NULL;
-}
-
 static struct gdbarch *
 frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
@@ -1532,7 +1498,7 @@
 
   set_gdbarch_deprecated_frameless_function_invocation (gdbarch, frv_frameless_function_invocation);
 
-  set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, always_use_struct_convention);
   set_gdbarch_extract_return_value (gdbarch, frv_extract_return_value);
 
   set_gdbarch_deprecated_store_struct_return (gdbarch, frv_store_struct_return);
@@ -1593,9 +1559,6 @@
   /* Hook in ABI-specific overrides, if they have been registered.  */
   gdbarch_init_osabi (info, gdbarch);
 
-  /* Set the sigtramp frame sniffer.  */
-  frame_unwind_append_sniffer (gdbarch, frv_sigtramp_frame_sniffer); 
-
   /* Set the fallback (prologue based) frame sniffer.  */
   frame_unwind_append_sniffer (gdbarch, frv_frame_sniffer);
 
diff --git a/gdb/frv-tdep.h b/gdb/frv-tdep.h
index 5b9b88b..73122a6 100644
--- a/gdb/frv-tdep.h
+++ b/gdb/frv-tdep.h
@@ -66,7 +66,18 @@
   lcr_regnum = 146,
   iacc0h_regnum = 147,
   iacc0l_regnum = 148,
-  last_spr_regnum = 148,
+  fsr0_regnum = 149,
+  acc0_regnum = 150,
+  acc7_regnum = 157,
+  accg0123_regnum = 158,
+  accg4567_regnum = 159,
+  msr0_regnum = 160,
+  msr1_regnum = 161,
+  gner0_regnum = 162,
+  gner1_regnum = 163,
+  fner0_regnum = 164,
+  fner1_regnum = 165,
+  last_spr_regnum = 165,
 
   /* The total number of registers we know exist.  */
   frv_num_regs = last_spr_regnum + 1,
@@ -76,19 +87,16 @@
 
   /* iacc0 - the 64-bit concatenation of iacc0h and iacc0l.  */
   iacc0_regnum = first_pseudo_regnum + 0,
+  accg0_regnum = first_pseudo_regnum + 1,
+  accg7_regnum = accg0_regnum + 7,
 
-  last_pseudo_regnum = iacc0_regnum,
+  last_pseudo_regnum = accg7_regnum,
   frv_num_pseudo_regs = last_pseudo_regnum - first_pseudo_regnum + 1,
 };
 
 /* Return the FR-V ABI associated with GDBARCH.  */
 enum frv_abi frv_abi (struct gdbarch *gdbarch);
 
-/* Associate a sigcontext address fetcher with GDBARCH.  */
-void frv_set_sigcontext_reg_addr (struct gdbarch *gdbarch,
-                                  CORE_ADDR (*sigcontext_reg_addr)
-			            (struct frame_info *, int, CORE_ADDR *));
-
 /* Fetch the interpreter and executable loadmap addresses (for shared
    library support) for the FDPIC ABI.  Return 0 if successful, -1 if
    not.  (E.g, -1 will be returned if the ABI isn't the FDPIC ABI.)  */
diff --git a/gdb/gcore.c b/gdb/gcore.c
index b551372..3b3a259 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -244,7 +244,7 @@
 	  || strcmp (".bss", bfd_section_name (abfd, sec)) == 0)
 	{
 	  sec_vaddr = bfd_get_section_vma (abfd, sec);
-	  sec_size = bfd_get_section_size_before_reloc (sec);
+	  sec_size = bfd_get_section_size (sec);
 	  if (sec_vaddr + sec_size > top_of_data_memory)
 	    top_of_data_memory = sec_vaddr + sec_size;
 	}
diff --git a/gdb/gdb-events.c b/gdb/gdb-events.c
index 63ee3bc..e0916d8 100644
--- a/gdb/gdb-events.c
+++ b/gdb/gdb-events.c
@@ -1,6 +1,6 @@
 /* User Interface Events.
 
-   Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
 
@@ -39,16 +39,12 @@
 #include "gdb-events.h"
 #include "gdbcmd.h"
 
-#if WITH_GDB_EVENTS
 static struct gdb_events null_event_hooks;
 static struct gdb_events queue_event_hooks;
 static struct gdb_events *current_event_hooks = &null_event_hooks;
-#endif
 
 int gdb_events_debug;
 
-#if WITH_GDB_EVENTS
-
 void
 breakpoint_create_event (int b)
 {
@@ -119,41 +115,8 @@
   current_event_hooks->architecture_changed ();
 }
 
-void
-target_changed_event (void)
-{
-  if (gdb_events_debug)
-    fprintf_unfiltered (gdb_stdlog, "target_changed_event\n");
-  if (!current_event_hooks->target_changed)
-    return;
-  current_event_hooks->target_changed ();
-}
-
-void
-selected_frame_level_changed_event (int level)
-{
-  if (gdb_events_debug)
-    fprintf_unfiltered (gdb_stdlog, "selected_frame_level_changed_event\n");
-  if (!current_event_hooks->selected_frame_level_changed)
-    return;
-  current_event_hooks->selected_frame_level_changed (level);
-}
-
-void
-selected_thread_changed_event (int thread_num)
-{
-  if (gdb_events_debug)
-    fprintf_unfiltered (gdb_stdlog, "selected_thread_changed_event\n");
-  if (!current_event_hooks->selected_thread_changed)
-    return;
-  current_event_hooks->selected_thread_changed (thread_num);
-}
-
-#endif
-
-#if WITH_GDB_EVENTS
 struct gdb_events *
-set_gdb_event_hooks (struct gdb_events *vector)
+deprecated_set_gdb_event_hooks (struct gdb_events *vector)
 {
   struct gdb_events *old_events = current_event_hooks;
   if (vector == NULL)
@@ -162,15 +125,12 @@
     current_event_hooks = vector;
   return old_events;
 }
-#endif
 
-#if WITH_GDB_EVENTS
 void
 clear_gdb_event_hooks (void)
 {
-  set_gdb_event_hooks (&null_event_hooks);
+  deprecated_set_gdb_event_hooks (&null_event_hooks);
 }
-#endif
 
 enum gdb_event
 {
@@ -181,9 +141,6 @@
   tracepoint_delete,
   tracepoint_modify,
   architecture_changed,
-  target_changed,
-  selected_frame_level_changed,
-  selected_thread_changed,
   nr_gdb_events
 };
 
@@ -217,16 +174,6 @@
     int number;
   };
 
-struct selected_frame_level_changed
-  {
-    int level;
-  };
-
-struct selected_thread_changed
-  {
-    int thread_num;
-  };
-
 struct event
   {
     enum gdb_event type;
@@ -239,8 +186,6 @@
 	struct tracepoint_create tracepoint_create;
 	struct tracepoint_delete tracepoint_delete;
 	struct tracepoint_modify tracepoint_modify;
-	struct selected_frame_level_changed selected_frame_level_changed;
-	struct selected_thread_changed selected_thread_changed;
       }
     data;
   };
@@ -319,32 +264,6 @@
   append (event);
 }
 
-static void
-queue_target_changed (void)
-{
-  struct event *event = XMALLOC (struct event);
-  event->type = target_changed;
-  append (event);
-}
-
-static void
-queue_selected_frame_level_changed (int level)
-{
-  struct event *event = XMALLOC (struct event);
-  event->type = selected_frame_level_changed;
-  event->data.selected_frame_level_changed.level = level;
-  append (event);
-}
-
-static void
-queue_selected_thread_changed (int thread_num)
-{
-  struct event *event = XMALLOC (struct event);
-  event->type = selected_thread_changed;
-  event->data.selected_thread_changed.thread_num = thread_num;
-  append (event);
-}
-
 void
 gdb_events_deliver (struct gdb_events *vector)
 {
@@ -393,17 +312,6 @@
 	case architecture_changed:
 	  vector->architecture_changed ();
 	  break;
-	case target_changed:
-	  vector->target_changed ();
-	  break;
-	case selected_frame_level_changed:
-	  vector->selected_frame_level_changed
-	    (event->data.selected_frame_level_changed.level);
-	  break;
-	case selected_thread_changed:
-	  vector->selected_thread_changed
-	    (event->data.selected_thread_changed.thread_num);
-	  break;
 	}
       delivering_events = event->next;
       xfree (event);
@@ -415,7 +323,6 @@
 _initialize_gdb_events (void)
 {
   struct cmd_list_element *c;
-#if WITH_GDB_EVENTS
   queue_event_hooks.breakpoint_create = queue_breakpoint_create;
   queue_event_hooks.breakpoint_delete = queue_breakpoint_delete;
   queue_event_hooks.breakpoint_modify = queue_breakpoint_modify;
@@ -423,10 +330,6 @@
   queue_event_hooks.tracepoint_delete = queue_tracepoint_delete;
   queue_event_hooks.tracepoint_modify = queue_tracepoint_modify;
   queue_event_hooks.architecture_changed = queue_architecture_changed;
-  queue_event_hooks.target_changed = queue_target_changed;
-  queue_event_hooks.selected_frame_level_changed = queue_selected_frame_level_changed;
-  queue_event_hooks.selected_thread_changed = queue_selected_thread_changed;
-#endif
 
   c = add_set_cmd ("eventdebug", class_maintenance, var_zinteger,
 		   (char *) (&gdb_events_debug), "Set event debugging.\n\
diff --git a/gdb/gdb-events.h b/gdb/gdb-events.h
index 2ce193f..386250b 100644
--- a/gdb/gdb-events.h
+++ b/gdb/gdb-events.h
@@ -38,10 +38,6 @@
 #ifndef GDB_EVENTS_H
 #define GDB_EVENTS_H
 
-#ifndef WITH_GDB_EVENTS
-#define WITH_GDB_EVENTS 1
-#endif
-
 
 /* COMPAT: pointer variables for old, unconverted events.
    A call to set_gdb_events() will automatically update these. */
@@ -59,9 +55,6 @@
 typedef void (gdb_events_tracepoint_delete_ftype) (int number);
 typedef void (gdb_events_tracepoint_modify_ftype) (int number);
 typedef void (gdb_events_architecture_changed_ftype) (void);
-typedef void (gdb_events_target_changed_ftype) (void);
-typedef void (gdb_events_selected_frame_level_changed_ftype) (int level);
-typedef void (gdb_events_selected_thread_changed_ftype) (int thread_num);
 
 
 /* gdb-events: object. */
@@ -75,9 +68,6 @@
     gdb_events_tracepoint_delete_ftype *tracepoint_delete;
     gdb_events_tracepoint_modify_ftype *tracepoint_modify;
     gdb_events_architecture_changed_ftype *architecture_changed;
-    gdb_events_target_changed_ftype *target_changed;
-    gdb_events_selected_frame_level_changed_ftype *selected_frame_level_changed;
-    gdb_events_selected_thread_changed_ftype *selected_thread_changed;
   };
 
 
@@ -91,28 +81,9 @@
 extern void tracepoint_delete_event (int number);
 extern void tracepoint_modify_event (int number);
 extern void architecture_changed_event (void);
-extern void target_changed_event (void);
-extern void selected_frame_level_changed_event (int level);
-extern void selected_thread_changed_event (int thread_num);
-
-
-/* When GDB_EVENTS are not being used, completely disable them. */
-
-#if !WITH_GDB_EVENTS
-#define breakpoint_create_event(b) 0
-#define breakpoint_delete_event(b) 0
-#define breakpoint_modify_event(b) 0
-#define tracepoint_create_event(number) 0
-#define tracepoint_delete_event(number) 0
-#define tracepoint_modify_event(number) 0
-#define architecture_changed_event() 0
-#define target_changed_event() 0
-#define selected_frame_level_changed_event(level) 0
-#define selected_thread_changed_event(thread_num) 0
-#endif
 
 /* Install custom gdb-events hooks. */
-extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector);
+extern struct gdb_events *deprecated_set_gdb_event_hooks (struct gdb_events *vector);
 
 /* Deliver any pending events. */
 extern void gdb_events_deliver (struct gdb_events *vector);
@@ -120,10 +91,4 @@
 /* Clear event handlers */
 extern void clear_gdb_event_hooks (void);
 
-#if !WITH_GDB_EVENTS
-#define set_gdb_events(x) 0
-#define set_gdb_event_hooks(x) 0
-#define gdb_events_deliver(x) 0
-#endif
-
 #endif
diff --git a/gdb/gdb-events.sh b/gdb/gdb-events.sh
index bd07794..5be1e54 100755
--- a/gdb/gdb-events.sh
+++ b/gdb/gdb-events.sh
@@ -21,24 +21,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-#
-# What happens next:
-#
-
-# The gdb-events.h/gdb-events.c files this script generates are commited
-# and published.
-
-# Any UI module that is installing events is changed so that the
-# events are installed using the ``set_gdb_events()'' and
-# ``gdb_event_hooks()'' interfaces.  There could prove to be an issue
-# here with respect to annotate.  We might need to accomodate a hook
-# stack that allows several ui blocks to install their own events.
-
-# Each of the variable events (as currently generated) is converted
-# to either a straight function call or a function call with a
-# predicate.
-
-
 IFS=:
 
 read="class returntype function formal actual attrib"
@@ -65,46 +47,6 @@
 f:void:tracepoint_delete:int number:number
 f:void:tracepoint_modify:int number:number
 f:void:architecture_changed:void
-f:void:target_changed:void
-f:void:selected_frame_level_changed:int level:level
-f:void:selected_thread_changed:int thread_num:thread_num
-#*:void:annotate_starting_hook:void
-#*:void:annotate_stopped_hook:void
-#*:void:annotate_signalled_hook:void
-#*:void:annotate_signal_hook:void
-#*:void:annotate_exited_hook:void
-##*:void:print_register_hook:int
-##*:CORE_ADDR:find_toc_address_hook:CORE_ADDR
-##*:void:sparc_print_register_hook:int regno:regno
-#*:void:target_resume_hook:void
-#*:void:target_wait_loop_hook:void
-#*:void:init_gdb_hook:char *argv0:argv0
-#*:void:command_loop_hook:void
-#*:void:fputs_unfiltered_hook:const char *linebuff,struct ui_file *stream:linebuff, stream
-#*:void:print_frame_info_listing_hook:struct symtab *s, int line, int stopline, int noerror:s, line, stopline, noerror
-#*:int:query_hook:const char *query, va_list args:query, args
-#*:void:warning_hook:const char *string, va_list args:string, args
-#*:void:target_output_hook:char *b:b
-#*:void:interactive_hook:void
-#*:void:registers_changed_hook:void
-#*:void:readline_begin_hook:char *format, ...:format
-#*:char *:readline_hook:char *prompt:prompt
-#*:void:readline_end_hook:void
-#*:int:target_wait_hook:int pid, struct target_waitstatus *status:pid, status
-#*:void:call_command_hook:struct cmd_list_element *c, char *cmd, int from_tty:c, cmd, from_tty
-#*:NORETURN void:error_hook:void:: ATTR_NORETURN
-#*:void:error_begin_hook:void
-##*:int:target_architecture_hook:const struct bfd_arch_info *
-#*:void:exec_file_display_hook:char *filename:filename
-#*:void:file_changed_hook:char *filename:filename
-##*:void:specify_exec_file_hook:
-#*:int:gdb_load_progress_hook:char *section, unsigned long num:section, num
-#*:void:pre_add_symbol_hook:char *name:name
-#*:void:post_add_symbol_hook:void
-#*:void:selected_frame_level_changed_hook:int level:level
-#*:int:gdb_loop_hook:int signo:signo
-##*:void:solib_create_inferior_hook:void
-##*:void:xcoff_relocate_symtab_hook:unsigned int
 EOF
   grep -v '^#'
 }
@@ -114,7 +56,7 @@
   cat <<EOF
 /* User Interface Events.
 
-   Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
 
@@ -161,10 +103,6 @@
 
 #ifndef GDB_EVENTS_H
 #define GDB_EVENTS_H
-
-#ifndef WITH_GDB_EVENTS
-#define WITH_GDB_EVENTS 1
-#endif
 EOF
 
 # pointer declarations
@@ -235,46 +173,17 @@
   esac
 done
 
-# function macros
-echo ""
-echo ""
-cat <<EOF
-/* When GDB_EVENTS are not being used, completely disable them. */
-EOF
-echo ""
-echo "#if !WITH_GDB_EVENTS"
-function_list | while eval read $read
-do
-  case "${class}" in
-    "*" ) continue ;;
-    "?" )
-	echo "#define ${function}_event_p() 0"
-	echo "#define ${function}_event(${actual}) 0"
-	;;
-    "f" )
-	echo "#define ${function}_event(${actual}) 0"
-	;;
-  esac
-done
-echo "#endif"
-
 # our set function
 cat <<EOF
 
 /* Install custom gdb-events hooks. */
-extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector);
+extern struct gdb_events *deprecated_set_gdb_event_hooks (struct gdb_events *vector);
 
 /* Deliver any pending events. */
 extern void gdb_events_deliver (struct gdb_events *vector);
 
 /* Clear event handlers */
 extern void clear_gdb_event_hooks (void);
-
-#if !WITH_GDB_EVENTS
-#define set_gdb_events(x) 0
-#define set_gdb_event_hooks(x) 0
-#define gdb_events_deliver(x) 0
-#endif
 EOF
 
 # close it off
@@ -307,29 +216,14 @@
 #include "gdb-events.h"
 #include "gdbcmd.h"
 
-#if WITH_GDB_EVENTS
 static struct gdb_events null_event_hooks;
 static struct gdb_events queue_event_hooks;
 static struct gdb_events *current_event_hooks = &null_event_hooks;
-#endif
 
 int gdb_events_debug;
 EOF
 
-# global pointer variables - always have this
-#echo ""
-#function_list | while eval read $read
-#do
-#  case "${class}" in
-#    "*" )
-#	echo "${returntype} (*${function}_event) (${formal})${attrib} = 0;"
-#	;;
-#  esac
-#done
-
 # function bodies
-echo ""
-echo "#if WITH_GDB_EVENTS"
 function_list | while eval read $read
 do
   case "${class}" in
@@ -366,15 +260,12 @@
 	;;
   esac
 done
-echo ""
-echo "#endif"
 
 # Set hooks function
 echo ""
 cat <<EOF
-#if WITH_GDB_EVENTS
 struct gdb_events *
-set_gdb_event_hooks (struct gdb_events *vector)
+deprecated_set_gdb_event_hooks (struct gdb_events *vector)
 {
   struct gdb_events *old_events = current_event_hooks;
   if (vector == NULL)
@@ -393,19 +284,16 @@
 done
 cat <<EOF
 }
-#endif
 EOF
 
 # Clear hooks function
 echo ""
 cat <<EOF
-#if WITH_GDB_EVENTS
 void
 clear_gdb_event_hooks (void)
 {
-  set_gdb_event_hooks (&null_event_hooks);
+  deprecated_set_gdb_event_hooks (&null_event_hooks);
 }
-#endif
 EOF
 
 # event type
@@ -571,7 +459,6 @@
 _initialize_gdb_events (void)
 {
   struct cmd_list_element *c;
-#if WITH_GDB_EVENTS
 EOF
 function_list | while eval read $read
 do
@@ -582,7 +469,6 @@
   esac
 done
 cat <<EOF
-#endif
 
   c = add_set_cmd ("eventdebug", class_maintenance, var_zinteger,
 		   (char *) (&gdb_events_debug), "Set event debugging.\n\\
diff --git a/gdb/gdb-mi.el b/gdb/gdb-mi.el
new file mode 100644
index 0000000..8780e8a
--- /dev/null
+++ b/gdb/gdb-mi.el
@@ -0,0 +1,568 @@
+;;; gdb-mi.el (internally gdbmi6.el) - (24th May 2004)
+
+;; Run gdb with GDB/MI (-interp=mi) and access CLI using "cli-command"
+;; (could use "-interpreter-exec console cli-command")
+
+;; Author: Nick Roberts <nickrob@gnu.org>
+;; Maintainer: Nick Roberts <nickrob@gnu.org>
+;; Keywords: unix, tools
+
+;; Copyright (C) 2004  Free Software Foundation, Inc.
+
+;; This file is part of GNU GDB.
+
+;; GNU GDB 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 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.
+
+;;; Commentary:
+
+;; This mode acts as a graphical user interface to GDB and requires GDB 6.1
+;; onwards. You can interact with GDB through the GUD buffer in the usual way,
+;; but there are also buffers which control the execution and describe the
+;; state of your program. It separates the input/output of your program from
+;; that of GDB and displays expressions and their current values in their own
+;; buffers. It also uses features of Emacs 21 such as the fringe/display
+;; margin for breakpoints, and the toolbar (see the GDB Graphical Interface
+;; section in the Emacs info manual).
+
+;; Start the debugger with M-x gdbmi.
+
+;; This file uses GDB/MI as the primary interface to GDB. It is still under
+;; development and is part of a process to migrate Emacs from annotations
+;; (as used in gdb-ui.el) to GDB/MI.
+
+;; Known Bugs:
+;;
+
+;;; Code:
+
+(require 'gud)
+(require 'gdb-ui)
+
+
+;;;###autoload
+(defun gdbmi (command-line)
+  "Run gdb on program FILE in buffer *gud-FILE*.
+The directory containing FILE becomes the initial working directory
+and source-file directory for your debugger.
+
+If `gdb-many-windows' is nil (the default value) then gdb just
+pops up the GUD buffer unless `gdb-show-main' is t. In this case
+it starts with two windows: one displaying the GUD buffer and the
+other with the source file with the main routine of the inferior.
+
+If `gdb-many-windows' is t, regardless of the value of
+`gdb-show-main', the layout below will appear. Keybindings are
+given in relevant buffer.
+
+Watch expressions appear in the speedbar/slowbar.
+
+The following interactive lisp functions help control operation :
+
+`gdb-many-windows'    - Toggle the number of windows gdb uses.
+`gdb-restore-windows' - To restore the window layout.
+
+See Info node `(emacs)GDB Graphical Interface' for a more
+detailed description of this mode.
+
+
+---------------------------------------------------------------------
+                               GDB Toolbar
+---------------------------------------------------------------------
+GUD buffer (I/O of GDB)           | Locals buffer
+                                  |
+                                  |
+                                  |
+---------------------------------------------------------------------
+ Source buffer                    | Input/Output (of inferior) buffer
+                                  | (comint-mode)
+                                  |
+                                  |
+                                  |
+                                  |
+                                  |
+                                  |
+---------------------------------------------------------------------
+ Stack buffer                     | Breakpoints buffer
+ RET      gdb-frames-select       | SPC    gdb-toggle-breakpoint
+                                  | RET    gdb-goto-breakpoint
+                                  |   d    gdb-delete-breakpoint
+---------------------------------------------------------------------
+"
+  ;;
+  (interactive (list (gud-query-cmdline 'gdbmi)))
+  ;;
+  ;; Let's start with a basic gud-gdb buffer and then modify it a bit.
+  (gdb command-line)
+  ;;
+  (setq gdb-debug-log nil)
+  (set (make-local-variable 'gud-minor-mode) 'gdbmi)
+  (set (make-local-variable 'gud-marker-filter) 'gud-gdbmi-marker-filter)
+  ;;
+  (gud-def gud-break (if (not (string-equal mode-name "Machine"))
+			 (gud-call "-break-insert %f:%l" arg)
+		       (save-excursion
+			 (beginning-of-line)
+			 (forward-char 2)
+			 (gud-call "-break-insert *%a" arg)))
+	   "\C-b" "Set breakpoint at current line or address.")
+  ;;
+  (gud-def gud-remove (if (not (string-equal mode-name "Machine"))
+			  (gud-call "clear %f:%l" arg)
+			(save-excursion
+			  (beginning-of-line)
+			  (forward-char 2)
+			  (gud-call "clear *%a" arg)))
+	   "\C-d" "Remove breakpoint at current line or address.")
+  ;;
+  (gud-def gud-until  (if (not (string-equal mode-name "Machine"))
+			  (gud-call "until %f:%l" arg)
+			(save-excursion
+			  (beginning-of-line)
+			  (forward-char 2)
+			  (gud-call "until *%a" arg)))
+	   "\C-u" "Continue to current line or address.")
+
+  (define-key gud-minor-mode-map [left-margin mouse-1]
+    'gdb-mouse-toggle-breakpoint)
+  (define-key gud-minor-mode-map [left-fringe mouse-1]
+    'gdb-mouse-toggle-breakpoint)
+
+  (setq comint-input-sender 'gdbmi-send)
+  ;;
+  ;; (re-)initialise
+  (setq gdb-main-file nil)
+  (setq gdb-current-address "main")
+  (setq gdb-previous-address nil)
+  (setq gdb-previous-frame nil)
+  (setq gdb-current-frame "main")
+  (setq gdb-view-source t)
+  (setq gdb-selected-view 'source)
+  (setq gdb-var-list nil)
+  (setq gdb-var-changed nil)
+  (setq gdb-prompting nil)
+  (setq gdb-current-item nil)
+  (setq gdb-pending-triggers nil)
+  (setq gdb-output-sink 'user)
+  (setq gdb-server-prefix nil)
+  ;;
+  (setq gdb-buffer-type 'gdbmi)
+  ;;
+  ;; FIXME: use tty command to separate io.
+  ;;(gdb-clear-inferior-io)
+  ;;
+  (if (eq window-system 'w32)
+      (gdb-enqueue-input (list "-gdb-set new-console off\n" 'ignore)))
+  ;; find source file and compilation directory here
+  (gdb-enqueue-input (list "list main\n"   'ignore))   ; C program
+  (gdb-enqueue-input (list "list MAIN__\n" 'ignore))   ; Fortran program
+  (gdb-enqueue-input (list "info source\n" 'gdbmi-source-info))
+  ;;
+  (run-hooks 'gdbmi-mode-hook))
+
+; Force nil till fixed.
+(defconst gdbmi-use-inferior-io-buffer nil)
+
+; uses --all-values Needs GDB 6.1 onwards.
+(defun gdbmi-var-list-children (varnum)
+  (gdb-enqueue-input
+   (list (concat "-var-update " varnum "\n") 'ignore))
+  (gdb-enqueue-input
+   (list (concat "-var-list-children --all-values "  
+		 varnum "\n")
+	     `(lambda () (gdbmi-var-list-children-handler ,varnum)))))
+
+(defconst gdbmi-var-list-children-regexp
+"name=\"\\(.*?\\)\",exp=\"\\(.*?\\)\",numchild=\"\\(.*?\\)\",value=\"\\(.*?\\)\""
+)
+
+(defun gdbmi-var-list-children-handler (varnum)
+  (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
+    (goto-char (point-min))
+    (let ((var-list nil))
+     (catch 'child-already-watched
+       (dolist (var gdb-var-list)
+	 (if (string-equal varnum (cadr var))
+	     (progn
+	       (push var var-list)
+	       (while (re-search-forward gdbmi-var-list-children-regexp nil t)
+		 (let ((varchild (list (match-string 2)
+				       (match-string 1)
+				       (match-string 3)
+				       nil
+				       (match-string 4)
+				       nil)))
+		   (if (looking-at ",type=\"\\(.*?\\)\"")
+		       (setcar (nthcdr 3 varchild) (match-string 1)))
+		   (dolist (var1 gdb-var-list)
+		     (if (string-equal (cadr var1) (cadr varchild))
+			 (throw 'child-already-watched nil)))
+		   (push varchild var-list))))
+	   (push var var-list)))
+       (setq gdb-var-changed t)
+       (setq gdb-var-list (nreverse var-list))))))
+
+;(defun gdbmi-send (proc string)
+;  "A comint send filter for gdb."
+;  (setq gdb-output-sink 'user)
+;  (setq gdb-prompting nil)
+;  (process-send-string proc (concat "-interpreter-exec console \"" string "\"")))
+
+(defun gdbmi-send (proc string)
+  "A comint send filter for gdb."
+  (setq gdb-output-sink 'user)
+  (setq gdb-prompting nil)
+  (process-send-string proc (concat string "\n")))
+
+(defcustom gud-gdbmi-command-name "~/gdb/gdb/gdb -interp=mi"
+  "Default command to execute an executable under the GDB-UI debugger."
+  :type 'string
+  :group 'gud)
+
+(defconst gdb-stopped-regexp 
+  "\\((gdb) \n\\*stopped\\|^\\^done\\),reason=.*,file=\"\\(.*\\)\",line=\"\\(.*\\)\".*")
+
+(defconst gdb-console-regexp "~\"\\(.*\\)\\\\n\"")
+
+(defconst gdb-internals-regexp "&\".*\\n\"\n")
+
+(defconst gdb-gdb-regexp "(gdb) \n")
+
+(defconst gdb-running-regexp "^\\^running")
+
+(defun gdbmi-prompt ()
+  "This handler terminates the any collection of output. It also
+  sends the next command (if any) to gdb."
+  (unless gdb-pending-triggers
+	(gdb-get-current-frame)
+	(gdbmi-invalidate-frames)
+	(gdbmi-invalidate-breakpoints)
+	(gdbmi-invalidate-locals)
+	(dolist (frame (frame-list))
+	  (when (string-equal (frame-parameter frame 'name) "Speedbar")
+	    (setq gdb-var-changed t)    ; force update
+	    (dolist (var gdb-var-list)
+	      (setcar (nthcdr 5 var) nil))))
+	(gdb-var-update))
+  (let ((sink gdb-output-sink))
+    (when (eq sink 'emacs)
+      (let ((handler
+	     (car (cdr gdb-current-item))))
+	(with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
+	  (funcall handler)))))
+  (let ((input (gdb-dequeue-input)))
+    (if input
+	(gdb-send-item input)
+      (progn
+	(setq gud-running nil)
+	(setq gdb-prompting t)
+	(gud-display-frame)))))
+
+(defun gud-gdbmi-marker-filter (string)
+  "Filter GDB/MI output."
+  (if gdb-enable-debug-log (push (cons 'recv string) gdb-debug-log))
+  ;; Recall the left over gud-marker-acc from last time
+  (setq gud-marker-acc (concat gud-marker-acc string))
+  ;; Start accumulating output for the GUD buffer
+  (let ((output ""))
+
+    (if (string-match gdb-running-regexp gud-marker-acc) 
+       (setq gud-marker-acc (substring gud-marker-acc (match-end 0))
+	     gud-running t))
+
+    ;; Remove the trimmings from the console stream.
+    (while (string-match gdb-console-regexp gud-marker-acc) 
+       (setq 
+	gud-marker-acc (concat (substring gud-marker-acc 0 (match-beginning 0))
+			       (match-string 1 gud-marker-acc)
+			       (substring gud-marker-acc (match-end 0)))))
+
+    ;; Remove log stream containing debugging messages being produced by GDB's
+    ;; internals.
+    (while (string-match gdb-internals-regexp gud-marker-acc) 
+       (setq 
+	 gud-marker-acc (concat (substring gud-marker-acc 0 (match-beginning 0))
+				(substring gud-marker-acc (match-end 0)))))
+
+    (if (string-match gdb-stopped-regexp gud-marker-acc)
+      (setq
+
+       ;; Extract the frame position from the marker.
+       gud-last-frame (cons (match-string 2 gud-marker-acc)
+			    (string-to-int (match-string 3 gud-marker-acc)))
+
+       ;; Append any text before the marker to the output we're going
+       ;; to return - we don't include the marker in this text.
+       output (gdbmi-concat-output output
+		      (substring gud-marker-acc 0 (match-beginning 0)))
+
+       ;; Set the accumulator to the remaining text.
+       gud-marker-acc (substring gud-marker-acc (match-end 0))))
+      
+    (while (string-match gdb-gdb-regexp gud-marker-acc) 
+      (setq
+
+       ;; Append any text up to and including prompt less \n to the output.
+       output (gdbmi-concat-output output
+		      (substring gud-marker-acc 0 (- (match-end 0) 1)))
+
+       ;; Set the accumulator to the remaining text.
+       gud-marker-acc (substring gud-marker-acc (match-end 0)))
+      (gdbmi-prompt))
+
+    (setq output (gdbmi-concat-output output gud-marker-acc))
+    (setq gud-marker-acc "")
+    output))
+
+(defun gdbmi-concat-output (so-far new)
+  (let ((sink gdb-output-sink))
+    (cond
+     ((eq sink 'user) (concat so-far new))
+     ((eq sink 'emacs)
+      (gdb-append-to-partial-output new)
+      so-far)
+     ((eq sink 'inferior)
+      (gdb-append-to-inferior-io new)
+      so-far))))
+
+
+;; Breakpoint buffer : This displays the output of `-break-list'.
+;;
+(def-gdb-auto-updated-buffer gdb-breakpoints-buffer
+  ;; This defines the auto update rule for buffers of type
+  ;; `gdb-breakpoints-buffer'.
+  ;;
+  ;; It defines a function that queues the command below.  That function is
+  ;; called:
+  gdbmi-invalidate-breakpoints
+  ;;
+  ;; To update the buffer, this command is sent to gdb.
+  "-break-list\n"
+  ;;
+  ;; This also defines a function to be the handler for the output
+  ;; from the command above.  That function will copy the output into
+  ;; the appropriately typed buffer.  That function will be called:
+  gdb-break-list-handler
+  ;; buffer specific functions
+  gdb-break-list-custom)
+
+(defconst gdb-break-list-regexp
+"number=\"\\(.*?\\)\",type=\"\\(.*?\\)\",disp=\"\\(.*?\\)\",enabled=\"\\(.\\)\",addr=\"\\(.*?\\)\",func=\"\\(.*?\\)\",file=\"\\(.*?\\)\",line=\"\\(.*?\\)\"")
+
+(defun gdb-break-list-handler ()
+  (setq gdb-pending-triggers (delq 'gdbmi-invalidate-breakpoints
+				  gdb-pending-triggers))
+  (let ((breakpoint nil)
+	(breakpoints-list nil))
+    (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
+      (goto-char (point-min))
+      (while (re-search-forward gdb-break-list-regexp nil t)
+	(let ((breakpoint (list (match-string 1)
+				(match-string 2)
+				(match-string 3)
+				(match-string 4)
+				(match-string 5)
+				(match-string 6)
+				(match-string 7)
+				(match-string 8))))
+	  (push breakpoint breakpoints-list))))
+    (let ((buf (gdb-get-buffer 'gdb-breakpoints-buffer)))
+      (and buf (with-current-buffer buf
+		 (let ((p (point))
+		       (buffer-read-only nil))
+		   (erase-buffer)
+		   (insert "Num Type        Disp Enb Func\tFile:Line\tAddr\n")
+		   (dolist (breakpoint breakpoints-list)
+		     (insert (concat
+			      (nth 0 breakpoint) "   "
+			      (nth 1 breakpoint) "  "
+			      (nth 2 breakpoint) "   "
+			      (nth 3 breakpoint) " "
+			      (nth 5 breakpoint) "\t"
+			      (nth 6 breakpoint) ":" (nth 7 breakpoint) "\t" 
+			      (nth 4 breakpoint) "\n")))
+		   (goto-char p))))))
+  (gdb-break-list-custom))
+
+;;-put breakpoint icons in relevant margins (even those set in the GUD buffer)
+(defun gdb-break-list-custom ()
+  (let ((flag)(address))
+    ;;
+    ;; remove all breakpoint-icons in source buffers but not assembler buffer
+    (dolist (buffer (buffer-list))
+      (with-current-buffer buffer
+	(if (and (eq gud-minor-mode 'gdbmi)
+		 (not (string-match "\\`\\*.+\\*\\'" (buffer-name))))
+	    (gdb-remove-breakpoint-icons (point-min) (point-max)))))
+    (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
+      (save-excursion
+	(goto-char (point-min))
+	(while (< (point) (- (point-max) 1))
+	  (forward-line 1)
+	  (if (looking-at "[0-9]*\\s-*\\S-*\\s-*\\S-*\\s-*\\(.\\)\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)")
+	      (progn
+		(setq flag (char-after (match-beginning 1)))
+		(let ((line (match-string 3)) (buffer-read-only nil)
+		      (file (match-string 2)))
+		  (add-text-properties (point-at-bol) (point-at-eol)
+				       '(mouse-face highlight
+						    help-echo "mouse-2, RET: visit breakpoint"))
+		  (with-current-buffer
+		      (find-file-noselect
+		       (if (file-exists-p file) file
+			 (expand-file-name file gdb-cdir)))
+		    (save-current-buffer
+		      (set (make-local-variable 'gud-minor-mode) 'gdbmi)
+		      (set (make-local-variable 'tool-bar-map)
+			   gud-tool-bar-map))
+		    ;; only want one breakpoint icon at each location
+		    (save-excursion
+		      (goto-line (string-to-number line))
+		      (gdb-put-breakpoint-icon (eq flag ?y)))))))))
+	  (end-of-line)))
+  (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom)))
+
+;; Frames buffer.  This displays a perpetually correct bactrack trace.
+;;
+(def-gdb-auto-updated-buffer gdb-stack-buffer
+  gdbmi-invalidate-frames
+  "-stack-list-frames\n"
+  gdb-stack-list-frames-handler
+  gdb-stack-list-frames-custom)
+
+(defconst gdb-stack-list-frames-regexp
+"level=\"\\(.*?\\)\",addr=\"\\(.*?\\)\",func=\"\\(.*?\\)\",file=\"\\(.*?\\)\",line=\"\\(.*?\\)\"")
+
+(defun gdb-stack-list-frames-handler ()
+  (setq gdb-pending-triggers (delq 'gdbmi-invalidate-frames
+				  gdb-pending-triggers))
+  (let ((frame nil)
+	(call-stack nil))
+    (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
+      (goto-char (point-min))
+      (while (re-search-forward gdb-stack-list-frames-regexp nil t)
+	(let ((frame (list (match-string 1)
+			   (match-string 2)
+			   (match-string 3)
+			   (match-string 4)
+			   (match-string 5))))
+	  (push frame call-stack))))
+    (let ((buf (gdb-get-buffer 'gdb-stack-buffer)))
+      (and buf (with-current-buffer buf
+		 (let ((p (point))
+		       (buffer-read-only nil))
+		   (erase-buffer)
+		   (insert "Level\tFunc\tFile:Line\tAddr\n")
+		   (dolist (frame (nreverse call-stack))
+		     (insert (concat
+			      (nth 0 frame) "\t"
+			      (nth 2 frame) "\t"
+			      (nth 3 frame) ":" (nth 4 frame) "\t"
+			      (nth 1 frame) "\n")))
+		   (goto-char p))))))
+  (gdb-stack-list-frames-custom))
+
+(defun gdb-stack-list-frames-custom ()
+  (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
+    (save-excursion
+      (let ((buffer-read-only nil))
+	(goto-char (point-min))
+	(forward-line 1)
+	(while (< (point) (point-max))
+	  (add-text-properties (point-at-bol) (point-at-eol)
+			     '(mouse-face highlight
+			       help-echo "mouse-2, RET: Select frame"))
+	  (beginning-of-line)
+	  (when (and (or (looking-at "^#[0-9]*\\s-*\\S-* in \\(\\S-*\\)")
+			 (looking-at "^#[0-9]*\\s-*\\(\\S-*\\)"))
+		     (equal (match-string 1) gdb-current-frame))
+	    (put-text-property (point-at-bol) (point-at-eol)
+			       'face '(:inverse-video t)))
+	  (forward-line 1))))))
+
+;; Locals buffer.
+;; uses "-stack-list-locals 2". Needs GDB 6.1 onwards.
+(def-gdb-auto-updated-buffer gdb-locals-buffer
+  gdbmi-invalidate-locals
+  "-stack-list-locals 2\n"
+  gdb-stack-list-locals-handler
+  gdb-stack-list-locals-custom)
+
+(defconst gdb-stack-list-locals-regexp
+  (concat "name=\"\\(.*?\\)\",type=\"\\(.*?\\)\""))
+
+;; Dont display values of arrays or structures.
+;; These can be expanded using gud-watch.
+(defun gdb-stack-list-locals-handler nil
+  (setq gdb-pending-triggers (delq 'gdbmi-invalidate-locals
+				  gdb-pending-triggers))
+  (let ((local nil)
+	(locals-list nil))
+    (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
+      (goto-char (point-min))
+      (while (re-search-forward gdb-stack-list-locals-regexp nil t)
+	(let ((local (list (match-string 1)
+			   (match-string 2)
+			   nil)))
+	  (if (looking-at ",value=\"\\(.*?\\)\"")
+	      (setcar (nthcdr 2 local) (match-string 1)))
+	(push local locals-list))))
+    (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
+      (and buf (with-current-buffer buf
+		 (let ((p (point))
+		       (buffer-read-only nil))
+		   (erase-buffer)
+		   (dolist (local locals-list)
+		     (insert 
+		      (concat (car local) "\t" (nth 1 local) "\t"
+			      (or (nth 2 local)
+				  (if (string-match "struct" (nth 1 local))
+				      "(structure)"
+				    "(array)"))
+			      "\n")))
+		   (goto-char p)))))))
+
+(defun gdb-stack-list-locals-custom ()
+  nil)
+
+(defun gdbmi-source-info ()
+  "Find the source file where the program starts and displays it with related
+buffers."
+  (goto-char (point-min))
+  (if (search-forward "source file is " nil t)
+      (if (looking-at "\\S-*")
+	  (setq gdb-main-file (match-string 0)))
+    (setq gdb-view-source nil))
+  (if (search-forward "directory is " nil t)
+      (if (looking-at "\\S-*:\\(\\S-*\\)")
+	  (setq gdb-cdir (match-string 1))
+	(looking-at "\\S-*")
+	(setq gdb-cdir (match-string 0))))
+
+;temporary heuristic
+  (if gdb-main-file
+      (setq gdb-main-file (expand-file-name gdb-main-file gdb-cdir)))
+
+  (if gdb-many-windows
+      (gdb-setup-windows)
+    (gdb-get-create-buffer 'gdb-breakpoints-buffer)
+    (when gdb-show-main
+      (switch-to-buffer gud-comint-buffer)
+      (delete-other-windows)
+      (split-window)
+      (other-window 1)
+      (switch-to-buffer
+       (if gdb-view-source
+	   (gud-find-file gdb-main-file)
+	 (gdb-get-create-buffer 'gdb-assembler-buffer)))
+      (other-window 1))))
+
+(provide 'gdb-mi)
+;;; gdbmi.el ends here
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index d6246af..6e3d091 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -150,27 +150,17 @@
   gdbarch_deprecated_register_byte_ftype *deprecated_register_byte;
   gdbarch_deprecated_register_raw_size_ftype *deprecated_register_raw_size;
   gdbarch_deprecated_register_virtual_size_ftype *deprecated_register_virtual_size;
-  int deprecated_max_register_raw_size;
-  int deprecated_max_register_virtual_size;
   gdbarch_unwind_dummy_id_ftype *unwind_dummy_id;
   gdbarch_deprecated_save_dummy_frame_tos_ftype *deprecated_save_dummy_frame_tos;
   int deprecated_fp_regnum;
   gdbarch_deprecated_target_read_fp_ftype *deprecated_target_read_fp;
   gdbarch_push_dummy_call_ftype *push_dummy_call;
   gdbarch_deprecated_push_arguments_ftype *deprecated_push_arguments;
-  int deprecated_use_generic_dummy_frames;
   gdbarch_deprecated_push_return_address_ftype *deprecated_push_return_address;
   gdbarch_deprecated_dummy_write_sp_ftype *deprecated_dummy_write_sp;
   int deprecated_register_size;
   int call_dummy_location;
-  CORE_ADDR deprecated_call_dummy_start_offset;
-  CORE_ADDR deprecated_call_dummy_breakpoint_offset;
-  int deprecated_call_dummy_length;
-  LONGEST * deprecated_call_dummy_words;
-  int deprecated_sizeof_call_dummy_words;
-  gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy;
   gdbarch_push_dummy_code_ftype *push_dummy_code;
-  gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame;
   gdbarch_deprecated_do_registers_info_ftype *deprecated_do_registers_info;
   gdbarch_print_registers_info_ftype *print_registers_info;
   gdbarch_print_float_info_ftype *print_float_info;
@@ -180,15 +170,9 @@
   gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
   gdbarch_cannot_store_register_ftype *cannot_store_register;
   gdbarch_get_longjmp_target_ftype *get_longjmp_target;
-  gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy;
-  gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first;
   gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
   int believe_pcc_promotion;
-  int believe_pcc_promotion_type;
   gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register;
-  gdbarch_deprecated_register_convertible_ftype *deprecated_register_convertible;
-  gdbarch_deprecated_register_convert_to_virtual_ftype *deprecated_register_convert_to_virtual;
-  gdbarch_deprecated_register_convert_to_raw_ftype *deprecated_register_convert_to_raw;
   gdbarch_convert_register_p_ftype *convert_register_p;
   gdbarch_register_to_value_ftype *register_to_value;
   gdbarch_value_to_register_ftype *value_to_register;
@@ -198,12 +182,11 @@
   gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame;
   gdbarch_deprecated_store_struct_return_ftype *deprecated_store_struct_return;
   gdbarch_return_value_ftype *return_value;
-  gdbarch_return_value_on_stack_ftype *return_value_on_stack;
   gdbarch_extract_return_value_ftype *extract_return_value;
   gdbarch_store_return_value_ftype *store_return_value;
   gdbarch_deprecated_extract_return_value_ftype *deprecated_extract_return_value;
   gdbarch_deprecated_store_return_value_ftype *deprecated_store_return_value;
-  gdbarch_use_struct_convention_ftype *use_struct_convention;
+  gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention;
   gdbarch_deprecated_extract_struct_value_address_ftype *deprecated_extract_struct_value_address;
   gdbarch_deprecated_frame_init_saved_regs_ftype *deprecated_frame_init_saved_regs;
   gdbarch_deprecated_init_extra_frame_info_ftype *deprecated_init_extra_frame_info;
@@ -214,7 +197,7 @@
   gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
   gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
   CORE_ADDR decr_pc_after_break;
-  CORE_ADDR function_start_offset;
+  CORE_ADDR deprecated_function_start_offset;
   gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
   CORE_ADDR frame_args_skip;
   gdbarch_deprecated_frameless_function_invocation_ftype *deprecated_frameless_function_invocation;
@@ -232,7 +215,6 @@
   gdbarch_deprecated_reg_struct_has_addr_ftype *deprecated_reg_struct_has_addr;
   gdbarch_stabs_argument_has_addr_ftype *stabs_argument_has_addr;
   int frame_red_zone_size;
-  int parm_boundary;
   const struct floatformat * float_format;
   const struct floatformat * double_format;
   const struct floatformat * long_double_format;
@@ -245,9 +227,6 @@
   gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
   gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
   gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
-  gdbarch_deprecated_pc_in_sigtramp_ftype *deprecated_pc_in_sigtramp;
-  gdbarch_deprecated_sigtramp_start_ftype *deprecated_sigtramp_start;
-  gdbarch_deprecated_sigtramp_end_ftype *deprecated_sigtramp_end;
   gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
   gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
   gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
@@ -317,27 +296,17 @@
   generic_register_byte,  /* deprecated_register_byte */
   generic_register_size,  /* deprecated_register_raw_size */
   generic_register_size,  /* deprecated_register_virtual_size */
-  0,  /* deprecated_max_register_raw_size */
-  0,  /* deprecated_max_register_virtual_size */
   0,  /* unwind_dummy_id */
   0,  /* deprecated_save_dummy_frame_tos */
   -1,  /* deprecated_fp_regnum */
   0,  /* deprecated_target_read_fp */
   0,  /* push_dummy_call */
   0,  /* deprecated_push_arguments */
-  0,  /* deprecated_use_generic_dummy_frames */
   0,  /* deprecated_push_return_address */
   0,  /* deprecated_dummy_write_sp */
   0,  /* deprecated_register_size */
   0,  /* call_dummy_location */
-  0,  /* deprecated_call_dummy_start_offset */
-  0,  /* deprecated_call_dummy_breakpoint_offset */
-  0,  /* deprecated_call_dummy_length */
-  0,  /* deprecated_call_dummy_words */
-  0,  /* deprecated_sizeof_call_dummy_words */
-  0,  /* deprecated_fix_call_dummy */
   0,  /* push_dummy_code */
-  0,  /* deprecated_push_dummy_frame */
   0,  /* deprecated_do_registers_info */
   default_print_registers_info,  /* print_registers_info */
   0,  /* print_float_info */
@@ -347,15 +316,9 @@
   0,  /* cannot_fetch_register */
   0,  /* cannot_store_register */
   0,  /* get_longjmp_target */
-  deprecated_pc_in_call_dummy,  /* deprecated_pc_in_call_dummy */
-  0,  /* deprecated_init_frame_pc_first */
   0,  /* deprecated_init_frame_pc */
   0,  /* believe_pcc_promotion */
-  0,  /* believe_pcc_promotion_type */
   0,  /* deprecated_get_saved_register */
-  0,  /* deprecated_register_convertible */
-  0,  /* deprecated_register_convert_to_virtual */
-  0,  /* deprecated_register_convert_to_raw */
   0,  /* convert_register_p */
   0,  /* register_to_value */
   0,  /* value_to_register */
@@ -365,12 +328,11 @@
   0,  /* deprecated_pop_frame */
   0,  /* deprecated_store_struct_return */
   0,  /* return_value */
-  0,  /* return_value_on_stack */
   0,  /* extract_return_value */
   0,  /* store_return_value */
   0,  /* deprecated_extract_return_value */
   0,  /* deprecated_store_return_value */
-  0,  /* use_struct_convention */
+  0,  /* deprecated_use_struct_convention */
   0,  /* deprecated_extract_struct_value_address */
   0,  /* deprecated_frame_init_saved_regs */
   0,  /* deprecated_init_extra_frame_info */
@@ -381,7 +343,7 @@
   0,  /* memory_insert_breakpoint */
   0,  /* memory_remove_breakpoint */
   0,  /* decr_pc_after_break */
-  0,  /* function_start_offset */
+  0,  /* deprecated_function_start_offset */
   generic_remote_translate_xfer_address,  /* remote_translate_xfer_address */
   0,  /* frame_args_skip */
   0,  /* deprecated_frameless_function_invocation */
@@ -399,7 +361,6 @@
   0,  /* deprecated_reg_struct_has_addr */
   default_stabs_argument_has_addr,  /* stabs_argument_has_addr */
   0,  /* frame_red_zone_size */
-  0,  /* parm_boundary */
   0,  /* float_format */
   0,  /* double_format */
   0,  /* long_double_format */
@@ -412,9 +373,6 @@
   generic_skip_solib_resolver,  /* skip_solib_resolver */
   0,  /* in_solib_call_trampoline */
   0,  /* in_solib_return_trampoline */
-  0,  /* deprecated_pc_in_sigtramp */
-  0,  /* deprecated_sigtramp_start */
-  0,  /* deprecated_sigtramp_end */
   generic_in_function_epilogue_p,  /* in_function_epilogue_p */
   construct_inferior_arguments,  /* construct_inferior_arguments */
   0,  /* elf_make_msymbol_special */
@@ -491,24 +449,18 @@
   current_gdbarch->deprecated_register_raw_size = generic_register_size;
   current_gdbarch->deprecated_register_virtual_size = generic_register_size;
   current_gdbarch->deprecated_fp_regnum = -1;
-  current_gdbarch->deprecated_use_generic_dummy_frames = 1;
   current_gdbarch->call_dummy_location = AT_ENTRY_POINT;
-  current_gdbarch->deprecated_call_dummy_words = legacy_call_dummy_words;
-  current_gdbarch->deprecated_sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
   current_gdbarch->print_registers_info = default_print_registers_info;
   current_gdbarch->register_sim_regno = legacy_register_sim_regno;
   current_gdbarch->cannot_fetch_register = cannot_register_not;
   current_gdbarch->cannot_store_register = cannot_register_not;
-  current_gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy;
-  current_gdbarch->convert_register_p = legacy_convert_register_p;
-  current_gdbarch->register_to_value = legacy_register_to_value;
-  current_gdbarch->value_to_register = legacy_value_to_register;
+  current_gdbarch->convert_register_p = generic_convert_register_p;
   current_gdbarch->pointer_to_address = unsigned_pointer_to_address;
   current_gdbarch->address_to_pointer = unsigned_address_to_pointer;
-  current_gdbarch->return_value_on_stack = generic_return_value_on_stack_not;
+  current_gdbarch->return_value = legacy_return_value;
   current_gdbarch->extract_return_value = legacy_extract_return_value;
   current_gdbarch->store_return_value = legacy_store_return_value;
-  current_gdbarch->use_struct_convention = generic_use_struct_convention;
+  current_gdbarch->deprecated_use_struct_convention = generic_use_struct_convention;
   current_gdbarch->memory_insert_breakpoint = default_memory_insert_breakpoint;
   current_gdbarch->memory_remove_breakpoint = default_memory_remove_breakpoint;
   current_gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
@@ -522,7 +474,6 @@
   current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
   current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
   current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
-  current_gdbarch->deprecated_pc_in_sigtramp = legacy_pc_in_sigtramp;
   current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
   current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
   current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
@@ -624,23 +575,16 @@
   /* Skip verify of deprecated_register_byte, has predicate */
   /* Skip verify of deprecated_register_raw_size, has predicate */
   /* Skip verify of deprecated_register_virtual_size, has predicate */
-  /* Skip verify of deprecated_max_register_raw_size, has predicate */
-  /* Skip verify of deprecated_max_register_virtual_size, has predicate */
   /* Skip verify of unwind_dummy_id, has predicate */
   /* Skip verify of deprecated_save_dummy_frame_tos, has predicate */
   /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
   /* Skip verify of deprecated_target_read_fp, has predicate */
   /* Skip verify of push_dummy_call, has predicate */
   /* Skip verify of deprecated_push_arguments, has predicate */
-  /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */
   /* Skip verify of deprecated_push_return_address, has predicate */
   /* Skip verify of deprecated_dummy_write_sp, has predicate */
   /* Skip verify of call_dummy_location, invalid_p == 0 */
-  /* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */
-  /* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */
-  /* Skip verify of deprecated_fix_call_dummy, has predicate */
   /* Skip verify of push_dummy_code, has predicate */
-  /* Skip verify of deprecated_push_dummy_frame, has predicate */
   /* Skip verify of deprecated_do_registers_info, has predicate */
   /* Skip verify of print_registers_info, invalid_p == 0 */
   /* Skip verify of print_float_info, has predicate */
@@ -650,26 +594,18 @@
   /* Skip verify of cannot_fetch_register, invalid_p == 0 */
   /* Skip verify of cannot_store_register, invalid_p == 0 */
   /* Skip verify of get_longjmp_target, has predicate */
-  /* Skip verify of deprecated_pc_in_call_dummy, has predicate */
-  /* Skip verify of deprecated_init_frame_pc_first, has predicate */
   /* Skip verify of deprecated_init_frame_pc, has predicate */
   /* Skip verify of deprecated_get_saved_register, has predicate */
-  /* Skip verify of deprecated_register_convertible, has predicate */
-  /* Skip verify of deprecated_register_convert_to_virtual, invalid_p == 0 */
-  /* Skip verify of deprecated_register_convert_to_raw, invalid_p == 0 */
   /* Skip verify of convert_register_p, invalid_p == 0 */
-  /* Skip verify of register_to_value, invalid_p == 0 */
-  /* Skip verify of value_to_register, invalid_p == 0 */
   /* Skip verify of pointer_to_address, invalid_p == 0 */
   /* Skip verify of address_to_pointer, invalid_p == 0 */
   /* Skip verify of integer_to_address, has predicate */
   /* Skip verify of deprecated_pop_frame, has predicate */
   /* Skip verify of deprecated_store_struct_return, has predicate */
   /* Skip verify of return_value, has predicate */
-  /* Skip verify of return_value_on_stack, invalid_p == 0 */
   /* Skip verify of extract_return_value, invalid_p == 0 */
   /* Skip verify of store_return_value, invalid_p == 0 */
-  /* Skip verify of use_struct_convention, invalid_p == 0 */
+  /* Skip verify of deprecated_use_struct_convention, invalid_p == 0 */
   /* Skip verify of deprecated_extract_struct_value_address, has predicate */
   /* Skip verify of deprecated_frame_init_saved_regs, has predicate */
   /* Skip verify of deprecated_init_extra_frame_info, has predicate */
@@ -686,7 +622,7 @@
   /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
   /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
   /* Skip verify of decr_pc_after_break, invalid_p == 0 */
-  /* Skip verify of function_start_offset, invalid_p == 0 */
+  /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
   /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
   /* Skip verify of frame_args_skip, invalid_p == 0 */
   /* Skip verify of deprecated_frameless_function_invocation, has predicate */
@@ -720,9 +656,6 @@
   /* Skip verify of skip_solib_resolver, invalid_p == 0 */
   /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
   /* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
-  /* Skip verify of deprecated_pc_in_sigtramp, has predicate */
-  /* Skip verify of deprecated_sigtramp_start, has predicate */
-  /* Skip verify of deprecated_sigtramp_end, has predicate */
   /* Skip verify of in_function_epilogue_p, invalid_p == 0 */
   /* Skip verify of construct_inferior_arguments, invalid_p == 0 */
   /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
@@ -760,1692 +693,1342 @@
   fprintf_unfiltered (file,
                       "gdbarch_dump: GDB_MULTI_ARCH = %d\n",
                       GDB_MULTI_ARCH);
+#ifdef TARGET_ADDR_BIT
   fprintf_unfiltered (file,
-                      "gdbarch_dump: convert_from_func_ptr_addr = 0x%08lx\n",
-                      (long) current_gdbarch->convert_from_func_ptr_addr);
+                      "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
+                      XSTRING (TARGET_ADDR_BIT));
+#endif
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
-                      gdbarch_frame_align_p (current_gdbarch));
+                      "gdbarch_dump: addr_bit = %s\n",
+                      paddr_d (current_gdbarch->addr_bit));
+#ifdef ADDR_BITS_REMOVE
   fprintf_unfiltered (file,
-                      "gdbarch_dump: frame_align = 0x%08lx\n",
-                      (long) current_gdbarch->frame_align);
+                      "gdbarch_dump: %s # %s\n",
+                      "ADDR_BITS_REMOVE(addr)",
+                      XSTRING (ADDR_BITS_REMOVE (addr)));
+#endif
   fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
-                      gdbarch_regset_from_core_section_p (current_gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: regset_from_core_section = 0x%08lx\n",
-                      (long) current_gdbarch->regset_from_core_section);
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_return_value_p() = %d\n",
-                      gdbarch_return_value_p (current_gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: return_value = 0x%08lx\n",
-                      (long) current_gdbarch->return_value);
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
-                      (long) current_gdbarch->in_function_epilogue_p);
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: register_reggroup_p = 0x%08lx\n",
-                      (long) current_gdbarch->register_reggroup_p);
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: stabs_argument_has_addr = 0x%08lx\n",
-                      (long) current_gdbarch->stabs_argument_has_addr);
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
-                      gdbarch_pseudo_register_read_p (current_gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: pseudo_register_read = 0x%08lx\n",
-                      (long) current_gdbarch->pseudo_register_read);
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
-                      gdbarch_pseudo_register_write_p (current_gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: pseudo_register_write = 0x%08lx\n",
-                      (long) current_gdbarch->pseudo_register_write);
+                      "gdbarch_dump: addr_bits_remove = <0x%lx>\n",
+                      (long) current_gdbarch->addr_bits_remove);
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_address_class_name_to_type_flags_p() = %d\n",
                       gdbarch_address_class_name_to_type_flags_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: address_class_name_to_type_flags = 0x%08lx\n",
+                      "gdbarch_dump: address_class_name_to_type_flags = <0x%lx>\n",
                       (long) current_gdbarch->address_class_name_to_type_flags);
 #ifdef ADDRESS_CLASS_TYPE_FLAGS_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "ADDRESS_CLASS_TYPE_FLAGS_P()",
                       XSTRING (ADDRESS_CLASS_TYPE_FLAGS_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS_P() = %d\n",
-                      ADDRESS_CLASS_TYPE_FLAGS_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_address_class_type_flags_p() = %d\n",
+                      gdbarch_address_class_type_flags_p (current_gdbarch));
 #ifdef ADDRESS_CLASS_TYPE_FLAGS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "ADDRESS_CLASS_TYPE_FLAGS(byte_size, dwarf2_addr_class)",
                       XSTRING (ADDRESS_CLASS_TYPE_FLAGS (byte_size, dwarf2_addr_class)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: ADDRESS_CLASS_TYPE_FLAGS = <0x%08lx>\n",
-                      (long) current_gdbarch->address_class_type_flags
-                      /*ADDRESS_CLASS_TYPE_FLAGS ()*/);
 #endif
   fprintf_unfiltered (file,
+                      "gdbarch_dump: address_class_type_flags = <0x%lx>\n",
+                      (long) current_gdbarch->address_class_type_flags);
+  fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_address_class_type_flags_to_name_p() = %d\n",
                       gdbarch_address_class_type_flags_to_name_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: address_class_type_flags_to_name = 0x%08lx\n",
+                      "gdbarch_dump: address_class_type_flags_to_name = <0x%lx>\n",
                       (long) current_gdbarch->address_class_type_flags_to_name);
 #ifdef ADDRESS_TO_POINTER
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "ADDRESS_TO_POINTER(type, buf, addr)",
                       XSTRING (ADDRESS_TO_POINTER (type, buf, addr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: ADDRESS_TO_POINTER = <0x%08lx>\n",
-                      (long) current_gdbarch->address_to_pointer
-                      /*ADDRESS_TO_POINTER ()*/);
 #endif
-#ifdef ADDR_BITS_REMOVE
   fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "ADDR_BITS_REMOVE(addr)",
-                      XSTRING (ADDR_BITS_REMOVE (addr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: ADDR_BITS_REMOVE = <0x%08lx>\n",
-                      (long) current_gdbarch->addr_bits_remove
-                      /*ADDR_BITS_REMOVE ()*/);
-#endif
+                      "gdbarch_dump: address_to_pointer = <0x%lx>\n",
+                      (long) current_gdbarch->address_to_pointer);
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
                       gdbarch_adjust_breakpoint_address_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: adjust_breakpoint_address = 0x%08lx\n",
+                      "gdbarch_dump: adjust_breakpoint_address = <0x%lx>\n",
                       (long) current_gdbarch->adjust_breakpoint_address);
 #ifdef BELIEVE_PCC_PROMOTION
   fprintf_unfiltered (file,
                       "gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
                       XSTRING (BELIEVE_PCC_PROMOTION));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: BELIEVE_PCC_PROMOTION = %d\n",
-                      BELIEVE_PCC_PROMOTION);
 #endif
-#ifdef BELIEVE_PCC_PROMOTION_TYPE
   fprintf_unfiltered (file,
-                      "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE # %s\n",
-                      XSTRING (BELIEVE_PCC_PROMOTION_TYPE));
+                      "gdbarch_dump: believe_pcc_promotion = %s\n",
+                      paddr_d (current_gdbarch->believe_pcc_promotion));
+#ifdef TARGET_ARCHITECTURE
   fprintf_unfiltered (file,
-                      "gdbarch_dump: BELIEVE_PCC_PROMOTION_TYPE = %d\n",
-                      BELIEVE_PCC_PROMOTION_TYPE);
+                      "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
+                      XSTRING (TARGET_ARCHITECTURE));
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: bfd_arch_info = %s\n",
+                      TARGET_ARCHITECTURE->printable_name);
+#ifdef TARGET_BFD_VMA_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
+                      XSTRING (TARGET_BFD_VMA_BIT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: bfd_vma_bit = %s\n",
+                      paddr_d (current_gdbarch->bfd_vma_bit));
 #ifdef BREAKPOINT_FROM_PC
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "BREAKPOINT_FROM_PC(pcptr, lenptr)",
                       XSTRING (BREAKPOINT_FROM_PC (pcptr, lenptr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: BREAKPOINT_FROM_PC = <0x%08lx>\n",
-                      (long) current_gdbarch->breakpoint_from_pc
-                      /*BREAKPOINT_FROM_PC ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: breakpoint_from_pc = <0x%lx>\n",
+                      (long) current_gdbarch->breakpoint_from_pc);
+#ifdef TARGET_BYTE_ORDER
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
+                      XSTRING (TARGET_BYTE_ORDER));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: byte_order = %s\n",
+                      paddr_d (current_gdbarch->byte_order));
 #ifdef CALL_DUMMY_LOCATION
   fprintf_unfiltered (file,
                       "gdbarch_dump: CALL_DUMMY_LOCATION # %s\n",
                       XSTRING (CALL_DUMMY_LOCATION));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: CALL_DUMMY_LOCATION = %d\n",
-                      CALL_DUMMY_LOCATION);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: call_dummy_location = %s\n",
+                      paddr_d (current_gdbarch->call_dummy_location));
 #ifdef CANNOT_FETCH_REGISTER
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "CANNOT_FETCH_REGISTER(regnum)",
                       XSTRING (CANNOT_FETCH_REGISTER (regnum)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: CANNOT_FETCH_REGISTER = <0x%08lx>\n",
-                      (long) current_gdbarch->cannot_fetch_register
-                      /*CANNOT_FETCH_REGISTER ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: cannot_fetch_register = <0x%lx>\n",
+                      (long) current_gdbarch->cannot_fetch_register);
 #ifdef CANNOT_STEP_BREAKPOINT
   fprintf_unfiltered (file,
                       "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
                       XSTRING (CANNOT_STEP_BREAKPOINT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: CANNOT_STEP_BREAKPOINT = %d\n",
-                      CANNOT_STEP_BREAKPOINT);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: cannot_step_breakpoint = %s\n",
+                      paddr_d (current_gdbarch->cannot_step_breakpoint));
 #ifdef CANNOT_STORE_REGISTER
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "CANNOT_STORE_REGISTER(regnum)",
                       XSTRING (CANNOT_STORE_REGISTER (regnum)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: CANNOT_STORE_REGISTER = <0x%08lx>\n",
-                      (long) current_gdbarch->cannot_store_register
-                      /*CANNOT_STORE_REGISTER ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: cannot_store_register = <0x%lx>\n",
+                      (long) current_gdbarch->cannot_store_register);
+#ifdef TARGET_CHAR_SIGNED
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
+                      XSTRING (TARGET_CHAR_SIGNED));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: char_signed = %s\n",
+                      paddr_d (current_gdbarch->char_signed));
 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
                       XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
-                      (long) current_gdbarch->coff_make_msymbol_special
-                      /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
 #endif
   fprintf_unfiltered (file,
-                      "gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
+                      "gdbarch_dump: coff_make_msymbol_special = <0x%lx>\n",
+                      (long) current_gdbarch->coff_make_msymbol_special);
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: construct_inferior_arguments = <0x%lx>\n",
                       (long) current_gdbarch->construct_inferior_arguments);
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n",
+                      (long) current_gdbarch->convert_from_func_ptr_addr);
 #ifdef CONVERT_REGISTER_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "CONVERT_REGISTER_P(regnum, type)",
                       XSTRING (CONVERT_REGISTER_P (regnum, type)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: CONVERT_REGISTER_P = <0x%08lx>\n",
-                      (long) current_gdbarch->convert_register_p
-                      /*CONVERT_REGISTER_P ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: convert_register_p = <0x%lx>\n",
+                      (long) current_gdbarch->convert_register_p);
 #ifdef DECR_PC_AFTER_BREAK
   fprintf_unfiltered (file,
                       "gdbarch_dump: DECR_PC_AFTER_BREAK # %s\n",
                       XSTRING (DECR_PC_AFTER_BREAK));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DECR_PC_AFTER_BREAK = %ld\n",
-                      (long) DECR_PC_AFTER_BREAK);
 #endif
-#ifdef DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET
   fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET # %s\n",
-                      XSTRING (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET = %ld\n",
-                      (long) DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET);
-#endif
-#ifdef DEPRECATED_CALL_DUMMY_LENGTH
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_CALL_DUMMY_LENGTH # %s\n",
-                      XSTRING (DEPRECATED_CALL_DUMMY_LENGTH));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_CALL_DUMMY_LENGTH = %d\n",
-                      DEPRECATED_CALL_DUMMY_LENGTH);
-#endif
-#ifdef DEPRECATED_CALL_DUMMY_START_OFFSET
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_CALL_DUMMY_START_OFFSET # %s\n",
-                      XSTRING (DEPRECATED_CALL_DUMMY_START_OFFSET));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_CALL_DUMMY_START_OFFSET = %ld\n",
-                      (long) DEPRECATED_CALL_DUMMY_START_OFFSET);
-#endif
-#ifdef DEPRECATED_CALL_DUMMY_WORDS
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_CALL_DUMMY_WORDS # %s\n",
-                      XSTRING (DEPRECATED_CALL_DUMMY_WORDS));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_CALL_DUMMY_WORDS = 0x%08lx\n",
-                      (long) DEPRECATED_CALL_DUMMY_WORDS);
-#endif
+                      "gdbarch_dump: decr_pc_after_break = 0x%s\n",
+                      paddr_nz (current_gdbarch->decr_pc_after_break));
 #ifdef DEPRECATED_DO_REGISTERS_INFO_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_DO_REGISTERS_INFO_P()",
                       XSTRING (DEPRECATED_DO_REGISTERS_INFO_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO_P() = %d\n",
-                      DEPRECATED_DO_REGISTERS_INFO_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_do_registers_info_p() = %d\n",
+                      gdbarch_deprecated_do_registers_info_p (current_gdbarch));
 #ifdef DEPRECATED_DO_REGISTERS_INFO
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_DO_REGISTERS_INFO(reg_nr, fpregs)",
                       XSTRING (DEPRECATED_DO_REGISTERS_INFO (reg_nr, fpregs)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_DO_REGISTERS_INFO = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_do_registers_info
-                      /*DEPRECATED_DO_REGISTERS_INFO ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_do_registers_info = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_do_registers_info);
 #ifdef DEPRECATED_DUMMY_WRITE_SP_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_DUMMY_WRITE_SP_P()",
                       XSTRING (DEPRECATED_DUMMY_WRITE_SP_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP_P() = %d\n",
-                      DEPRECATED_DUMMY_WRITE_SP_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_dummy_write_sp_p() = %d\n",
+                      gdbarch_deprecated_dummy_write_sp_p (current_gdbarch));
 #ifdef DEPRECATED_DUMMY_WRITE_SP
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_DUMMY_WRITE_SP(val)",
                       XSTRING (DEPRECATED_DUMMY_WRITE_SP (val)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_DUMMY_WRITE_SP = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_dummy_write_sp
-                      /*DEPRECATED_DUMMY_WRITE_SP ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_dummy_write_sp = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_dummy_write_sp);
 #ifdef DEPRECATED_EXTRACT_RETURN_VALUE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_EXTRACT_RETURN_VALUE(type, regbuf, valbuf)",
                       XSTRING (DEPRECATED_EXTRACT_RETURN_VALUE (type, regbuf, valbuf)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_EXTRACT_RETURN_VALUE = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_extract_return_value
-                      /*DEPRECATED_EXTRACT_RETURN_VALUE ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_extract_return_value = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_extract_return_value);
 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P()",
                       XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() = %d\n",
-                      DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_extract_struct_value_address_p() = %d\n",
+                      gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch));
 #ifdef DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS(regcache)",
                       XSTRING (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (regcache)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_extract_struct_value_address
-                      /*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
 #endif
-#ifdef DEPRECATED_FIX_CALL_DUMMY_P
   fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_FIX_CALL_DUMMY_P()",
-                      XSTRING (DEPRECATED_FIX_CALL_DUMMY_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FIX_CALL_DUMMY_P() = %d\n",
-                      DEPRECATED_FIX_CALL_DUMMY_P ());
-#endif
-#ifdef DEPRECATED_FIX_CALL_DUMMY
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p)",
-                      XSTRING (DEPRECATED_FIX_CALL_DUMMY (dummy, pc, fun, nargs, args, type, gcc_p)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FIX_CALL_DUMMY = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_fix_call_dummy
-                      /*DEPRECATED_FIX_CALL_DUMMY ()*/);
-#endif
+                      "gdbarch_dump: deprecated_extract_struct_value_address = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_extract_struct_value_address);
 #ifdef DEPRECATED_FP_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: DEPRECATED_FP_REGNUM # %s\n",
                       XSTRING (DEPRECATED_FP_REGNUM));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FP_REGNUM = %d\n",
-                      DEPRECATED_FP_REGNUM);
 #endif
-#ifdef DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P
   fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P()",
-                      XSTRING (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P() = %d\n",
-                      DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P ());
-#endif
-#ifdef DEPRECATED_FRAMELESS_FUNCTION_INVOCATION
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_FRAMELESS_FUNCTION_INVOCATION(fi)",
-                      XSTRING (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION (fi)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAMELESS_FUNCTION_INVOCATION = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_frameless_function_invocation
-                      /*DEPRECATED_FRAMELESS_FUNCTION_INVOCATION ()*/);
-#endif
+                      "gdbarch_dump: deprecated_fp_regnum = %s\n",
+                      paddr_d (current_gdbarch->deprecated_fp_regnum));
 #ifdef DEPRECATED_FRAME_ARGS_ADDRESS_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_ARGS_ADDRESS_P()",
                       XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS_P() = %d\n",
-                      DEPRECATED_FRAME_ARGS_ADDRESS_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_frame_args_address_p() = %d\n",
+                      gdbarch_deprecated_frame_args_address_p (current_gdbarch));
 #ifdef DEPRECATED_FRAME_ARGS_ADDRESS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_ARGS_ADDRESS(fi)",
                       XSTRING (DEPRECATED_FRAME_ARGS_ADDRESS (fi)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_ARGS_ADDRESS = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_frame_args_address
-                      /*DEPRECATED_FRAME_ARGS_ADDRESS ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_frame_args_address = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_frame_args_address);
 #ifdef DEPRECATED_FRAME_CHAIN_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_CHAIN_P()",
                       XSTRING (DEPRECATED_FRAME_CHAIN_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_CHAIN_P() = %d\n",
-                      DEPRECATED_FRAME_CHAIN_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_frame_chain_p() = %d\n",
+                      gdbarch_deprecated_frame_chain_p (current_gdbarch));
 #ifdef DEPRECATED_FRAME_CHAIN
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_CHAIN(frame)",
                       XSTRING (DEPRECATED_FRAME_CHAIN (frame)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_CHAIN = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_frame_chain
-                      /*DEPRECATED_FRAME_CHAIN ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_frame_chain = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_frame_chain);
 #ifdef DEPRECATED_FRAME_CHAIN_VALID_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_CHAIN_VALID_P()",
                       XSTRING (DEPRECATED_FRAME_CHAIN_VALID_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID_P() = %d\n",
-                      DEPRECATED_FRAME_CHAIN_VALID_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_frame_chain_valid_p() = %d\n",
+                      gdbarch_deprecated_frame_chain_valid_p (current_gdbarch));
 #ifdef DEPRECATED_FRAME_CHAIN_VALID
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe)",
                       XSTRING (DEPRECATED_FRAME_CHAIN_VALID (chain, thisframe)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_CHAIN_VALID = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_frame_chain_valid
-                      /*DEPRECATED_FRAME_CHAIN_VALID ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_frame_chain_valid = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_frame_chain_valid);
 #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_INIT_SAVED_REGS_P()",
                       XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS_P() = %d\n",
-                      DEPRECATED_FRAME_INIT_SAVED_REGS_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_frame_init_saved_regs_p() = %d\n",
+                      gdbarch_deprecated_frame_init_saved_regs_p (current_gdbarch));
 #ifdef DEPRECATED_FRAME_INIT_SAVED_REGS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_INIT_SAVED_REGS(frame)",
                       XSTRING (DEPRECATED_FRAME_INIT_SAVED_REGS (frame)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_INIT_SAVED_REGS = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_frame_init_saved_regs
-                      /*DEPRECATED_FRAME_INIT_SAVED_REGS ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_frame_init_saved_regs = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_frame_init_saved_regs);
 #ifdef DEPRECATED_FRAME_LOCALS_ADDRESS_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_LOCALS_ADDRESS_P()",
                       XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS_P() = %d\n",
-                      DEPRECATED_FRAME_LOCALS_ADDRESS_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_frame_locals_address_p() = %d\n",
+                      gdbarch_deprecated_frame_locals_address_p (current_gdbarch));
 #ifdef DEPRECATED_FRAME_LOCALS_ADDRESS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_LOCALS_ADDRESS(fi)",
                       XSTRING (DEPRECATED_FRAME_LOCALS_ADDRESS (fi)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_LOCALS_ADDRESS = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_frame_locals_address
-                      /*DEPRECATED_FRAME_LOCALS_ADDRESS ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_frame_locals_address = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_frame_locals_address);
 #ifdef DEPRECATED_FRAME_SAVED_PC_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_SAVED_PC_P()",
                       XSTRING (DEPRECATED_FRAME_SAVED_PC_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC_P() = %d\n",
-                      DEPRECATED_FRAME_SAVED_PC_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_frame_saved_pc_p() = %d\n",
+                      gdbarch_deprecated_frame_saved_pc_p (current_gdbarch));
 #ifdef DEPRECATED_FRAME_SAVED_PC
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_FRAME_SAVED_PC(fi)",
                       XSTRING (DEPRECATED_FRAME_SAVED_PC (fi)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_frame_saved_pc
-                      /*DEPRECATED_FRAME_SAVED_PC ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_frame_saved_pc = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_frame_saved_pc);
+#ifdef DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P()",
+                      XSTRING (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P ()));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_frameless_function_invocation_p() = %d\n",
+                      gdbarch_deprecated_frameless_function_invocation_p (current_gdbarch));
+#ifdef DEPRECATED_FRAMELESS_FUNCTION_INVOCATION
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_FRAMELESS_FUNCTION_INVOCATION(fi)",
+                      XSTRING (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION (fi)));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_frameless_function_invocation = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_frameless_function_invocation);
+#ifdef DEPRECATED_FUNCTION_START_OFFSET
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
+                      XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_function_start_offset = 0x%s\n",
+                      paddr_nz (current_gdbarch->deprecated_function_start_offset));
 #ifdef DEPRECATED_GET_SAVED_REGISTER_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_GET_SAVED_REGISTER_P()",
                       XSTRING (DEPRECATED_GET_SAVED_REGISTER_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER_P() = %d\n",
-                      DEPRECATED_GET_SAVED_REGISTER_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_get_saved_register_p() = %d\n",
+                      gdbarch_deprecated_get_saved_register_p (current_gdbarch));
 #ifdef DEPRECATED_GET_SAVED_REGISTER
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
                       XSTRING (DEPRECATED_GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_get_saved_register
-                      /*DEPRECATED_GET_SAVED_REGISTER ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_get_saved_register = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_get_saved_register);
 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_INIT_EXTRA_FRAME_INFO_P()",
                       XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO_P() = %d\n",
-                      DEPRECATED_INIT_EXTRA_FRAME_INFO_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_init_extra_frame_info_p() = %d\n",
+                      gdbarch_deprecated_init_extra_frame_info_p (current_gdbarch));
 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_INIT_EXTRA_FRAME_INFO(fromleaf, frame)",
                       XSTRING (DEPRECATED_INIT_EXTRA_FRAME_INFO (fromleaf, frame)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_INIT_EXTRA_FRAME_INFO = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_init_extra_frame_info
-                      /*DEPRECATED_INIT_EXTRA_FRAME_INFO ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_init_extra_frame_info = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_init_extra_frame_info);
 #ifdef DEPRECATED_INIT_FRAME_PC_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_INIT_FRAME_PC_P()",
                       XSTRING (DEPRECATED_INIT_FRAME_PC_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_P() = %d\n",
-                      DEPRECATED_INIT_FRAME_PC_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_init_frame_pc_p() = %d\n",
+                      gdbarch_deprecated_init_frame_pc_p (current_gdbarch));
 #ifdef DEPRECATED_INIT_FRAME_PC
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_INIT_FRAME_PC(fromleaf, prev)",
                       XSTRING (DEPRECATED_INIT_FRAME_PC (fromleaf, prev)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_INIT_FRAME_PC = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_init_frame_pc
-                      /*DEPRECATED_INIT_FRAME_PC ()*/);
 #endif
-#ifdef DEPRECATED_INIT_FRAME_PC_FIRST_P
   fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_INIT_FRAME_PC_FIRST_P()",
-                      XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST_P() = %d\n",
-                      DEPRECATED_INIT_FRAME_PC_FIRST_P ());
-#endif
-#ifdef DEPRECATED_INIT_FRAME_PC_FIRST
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev)",
-                      XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_init_frame_pc_first
-                      /*DEPRECATED_INIT_FRAME_PC_FIRST ()*/);
-#endif
-#ifdef DEPRECATED_MAX_REGISTER_RAW_SIZE_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_MAX_REGISTER_RAW_SIZE_P()",
-                      XSTRING (DEPRECATED_MAX_REGISTER_RAW_SIZE_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE_P() = %d\n",
-                      DEPRECATED_MAX_REGISTER_RAW_SIZE_P ());
-#endif
-#ifdef DEPRECATED_MAX_REGISTER_RAW_SIZE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE # %s\n",
-                      XSTRING (DEPRECATED_MAX_REGISTER_RAW_SIZE));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_MAX_REGISTER_RAW_SIZE = %d\n",
-                      DEPRECATED_MAX_REGISTER_RAW_SIZE);
-#endif
-#ifdef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P()",
-                      XSTRING (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() = %d\n",
-                      DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P ());
-#endif
-#ifdef DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE # %s\n",
-                      XSTRING (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE = %d\n",
-                      DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE);
-#endif
-#ifdef DEPRECATED_PC_IN_CALL_DUMMY_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_PC_IN_CALL_DUMMY_P()",
-                      XSTRING (DEPRECATED_PC_IN_CALL_DUMMY_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY_P() = %d\n",
-                      DEPRECATED_PC_IN_CALL_DUMMY_P ());
-#endif
-#ifdef DEPRECATED_PC_IN_CALL_DUMMY
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address)",
-                      XSTRING (DEPRECATED_PC_IN_CALL_DUMMY (pc, sp, frame_address)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_PC_IN_CALL_DUMMY = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_pc_in_call_dummy
-                      /*DEPRECATED_PC_IN_CALL_DUMMY ()*/);
-#endif
-#ifdef DEPRECATED_PC_IN_SIGTRAMP_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_PC_IN_SIGTRAMP_P()",
-                      XSTRING (DEPRECATED_PC_IN_SIGTRAMP_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_PC_IN_SIGTRAMP_P() = %d\n",
-                      DEPRECATED_PC_IN_SIGTRAMP_P ());
-#endif
-#ifdef DEPRECATED_PC_IN_SIGTRAMP
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_PC_IN_SIGTRAMP(pc, name)",
-                      XSTRING (DEPRECATED_PC_IN_SIGTRAMP (pc, name)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_PC_IN_SIGTRAMP = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_pc_in_sigtramp
-                      /*DEPRECATED_PC_IN_SIGTRAMP ()*/);
-#endif
+                      "gdbarch_dump: deprecated_init_frame_pc = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_init_frame_pc);
 #ifdef DEPRECATED_POP_FRAME_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_POP_FRAME_P()",
                       XSTRING (DEPRECATED_POP_FRAME_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_POP_FRAME_P() = %d\n",
-                      DEPRECATED_POP_FRAME_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_pop_frame_p() = %d\n",
+                      gdbarch_deprecated_pop_frame_p (current_gdbarch));
 #ifdef DEPRECATED_POP_FRAME
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_POP_FRAME(-)",
                       XSTRING (DEPRECATED_POP_FRAME (-)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_POP_FRAME = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_pop_frame
-                      /*DEPRECATED_POP_FRAME ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_pop_frame = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_pop_frame);
 #ifdef DEPRECATED_PUSH_ARGUMENTS_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_PUSH_ARGUMENTS_P()",
                       XSTRING (DEPRECATED_PUSH_ARGUMENTS_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS_P() = %d\n",
-                      DEPRECATED_PUSH_ARGUMENTS_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_push_arguments_p() = %d\n",
+                      gdbarch_deprecated_push_arguments_p (current_gdbarch));
 #ifdef DEPRECATED_PUSH_ARGUMENTS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr)",
                       XSTRING (DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return, struct_addr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_PUSH_ARGUMENTS = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_push_arguments
-                      /*DEPRECATED_PUSH_ARGUMENTS ()*/);
 #endif
-#ifdef DEPRECATED_PUSH_DUMMY_FRAME_P
   fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_PUSH_DUMMY_FRAME_P()",
-                      XSTRING (DEPRECATED_PUSH_DUMMY_FRAME_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_PUSH_DUMMY_FRAME_P() = %d\n",
-                      DEPRECATED_PUSH_DUMMY_FRAME_P ());
-#endif
-#ifdef DEPRECATED_PUSH_DUMMY_FRAME
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_PUSH_DUMMY_FRAME(-)",
-                      XSTRING (DEPRECATED_PUSH_DUMMY_FRAME (-)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_PUSH_DUMMY_FRAME = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_push_dummy_frame
-                      /*DEPRECATED_PUSH_DUMMY_FRAME ()*/);
-#endif
+                      "gdbarch_dump: deprecated_push_arguments = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_push_arguments);
 #ifdef DEPRECATED_PUSH_RETURN_ADDRESS_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_PUSH_RETURN_ADDRESS_P()",
                       XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS_P() = %d\n",
-                      DEPRECATED_PUSH_RETURN_ADDRESS_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_push_return_address_p() = %d\n",
+                      gdbarch_deprecated_push_return_address_p (current_gdbarch));
 #ifdef DEPRECATED_PUSH_RETURN_ADDRESS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_PUSH_RETURN_ADDRESS(pc, sp)",
                       XSTRING (DEPRECATED_PUSH_RETURN_ADDRESS (pc, sp)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_PUSH_RETURN_ADDRESS = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_push_return_address
-                      /*DEPRECATED_PUSH_RETURN_ADDRESS ()*/);
 #endif
-#ifdef DEPRECATED_REGISTER_BYTE_P
   fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_BYTE_P()",
-                      XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_BYTE_P() = %d\n",
-                      DEPRECATED_REGISTER_BYTE_P ());
-#endif
-#ifdef DEPRECATED_REGISTER_BYTE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_BYTE(reg_nr)",
-                      XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_BYTE = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_register_byte
-                      /*DEPRECATED_REGISTER_BYTE ()*/);
-#endif
-#ifdef DEPRECATED_REGISTER_BYTES
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_BYTES # %s\n",
-                      XSTRING (DEPRECATED_REGISTER_BYTES));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_BYTES = %d\n",
-                      DEPRECATED_REGISTER_BYTES);
-#endif
-#ifdef DEPRECATED_REGISTER_CONVERTIBLE_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_CONVERTIBLE_P()",
-                      XSTRING (DEPRECATED_REGISTER_CONVERTIBLE_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_CONVERTIBLE_P() = %d\n",
-                      DEPRECATED_REGISTER_CONVERTIBLE_P ());
-#endif
-#ifdef DEPRECATED_REGISTER_CONVERTIBLE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_CONVERTIBLE(nr)",
-                      XSTRING (DEPRECATED_REGISTER_CONVERTIBLE (nr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_CONVERTIBLE = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_register_convertible
-                      /*DEPRECATED_REGISTER_CONVERTIBLE ()*/);
-#endif
-#ifdef DEPRECATED_REGISTER_CONVERT_TO_RAW
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
-                      XSTRING (DEPRECATED_REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_CONVERT_TO_RAW = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_register_convert_to_raw
-                      /*DEPRECATED_REGISTER_CONVERT_TO_RAW ()*/);
-#endif
-#ifdef DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
-                      XSTRING (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_register_convert_to_virtual
-                      /*DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL ()*/);
-#endif
-#ifdef DEPRECATED_REGISTER_RAW_SIZE_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_RAW_SIZE_P()",
-                      XSTRING (DEPRECATED_REGISTER_RAW_SIZE_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_RAW_SIZE_P() = %d\n",
-                      DEPRECATED_REGISTER_RAW_SIZE_P ());
-#endif
-#ifdef DEPRECATED_REGISTER_RAW_SIZE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_RAW_SIZE(reg_nr)",
-                      XSTRING (DEPRECATED_REGISTER_RAW_SIZE (reg_nr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_RAW_SIZE = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_register_raw_size
-                      /*DEPRECATED_REGISTER_RAW_SIZE ()*/);
-#endif
-#ifdef DEPRECATED_REGISTER_SIZE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
-                      XSTRING (DEPRECATED_REGISTER_SIZE));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_SIZE = %d\n",
-                      DEPRECATED_REGISTER_SIZE);
-#endif
-#ifdef DEPRECATED_REGISTER_VIRTUAL_SIZE_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_VIRTUAL_SIZE_P()",
-                      XSTRING (DEPRECATED_REGISTER_VIRTUAL_SIZE_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_SIZE_P() = %d\n",
-                      DEPRECATED_REGISTER_VIRTUAL_SIZE_P ());
-#endif
-#ifdef DEPRECATED_REGISTER_VIRTUAL_SIZE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_VIRTUAL_SIZE(reg_nr)",
-                      XSTRING (DEPRECATED_REGISTER_VIRTUAL_SIZE (reg_nr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_SIZE = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_register_virtual_size
-                      /*DEPRECATED_REGISTER_VIRTUAL_SIZE ()*/);
-#endif
-#ifdef DEPRECATED_REGISTER_VIRTUAL_TYPE_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_VIRTUAL_TYPE_P()",
-                      XSTRING (DEPRECATED_REGISTER_VIRTUAL_TYPE_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_TYPE_P() = %d\n",
-                      DEPRECATED_REGISTER_VIRTUAL_TYPE_P ());
-#endif
-#ifdef DEPRECATED_REGISTER_VIRTUAL_TYPE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_REGISTER_VIRTUAL_TYPE(reg_nr)",
-                      XSTRING (DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REGISTER_VIRTUAL_TYPE = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_register_virtual_type
-                      /*DEPRECATED_REGISTER_VIRTUAL_TYPE ()*/);
-#endif
+                      "gdbarch_dump: deprecated_push_return_address = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_push_return_address);
 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_REG_STRUCT_HAS_ADDR_P()",
                       XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REG_STRUCT_HAS_ADDR_P() = %d\n",
-                      DEPRECATED_REG_STRUCT_HAS_ADDR_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_reg_struct_has_addr_p() = %d\n",
+                      gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch));
 #ifdef DEPRECATED_REG_STRUCT_HAS_ADDR
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_REG_STRUCT_HAS_ADDR(gcc_p, type)",
                       XSTRING (DEPRECATED_REG_STRUCT_HAS_ADDR (gcc_p, type)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_REG_STRUCT_HAS_ADDR = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_reg_struct_has_addr
-                      /*DEPRECATED_REG_STRUCT_HAS_ADDR ()*/);
 #endif
-#ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_reg_struct_has_addr);
+#ifdef DEPRECATED_REGISTER_BYTE_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
-                      XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_SAVED_PC_AFTER_CALL_P() = %d\n",
-                      DEPRECATED_SAVED_PC_AFTER_CALL_P ());
+                      "DEPRECATED_REGISTER_BYTE_P()",
+                      XSTRING (DEPRECATED_REGISTER_BYTE_P ()));
 #endif
-#ifdef DEPRECATED_SAVED_PC_AFTER_CALL
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_register_byte_p() = %d\n",
+                      gdbarch_deprecated_register_byte_p (current_gdbarch));
+#ifdef DEPRECATED_REGISTER_BYTE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
-                      XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_SAVED_PC_AFTER_CALL = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_saved_pc_after_call
-                      /*DEPRECATED_SAVED_PC_AFTER_CALL ()*/);
+                      "DEPRECATED_REGISTER_BYTE(reg_nr)",
+                      XSTRING (DEPRECATED_REGISTER_BYTE (reg_nr)));
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_register_byte = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_register_byte);
+#ifdef DEPRECATED_REGISTER_BYTES
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: DEPRECATED_REGISTER_BYTES # %s\n",
+                      XSTRING (DEPRECATED_REGISTER_BYTES));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_register_bytes = %s\n",
+                      paddr_d (current_gdbarch->deprecated_register_bytes));
+#ifdef DEPRECATED_REGISTER_RAW_SIZE_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_REGISTER_RAW_SIZE_P()",
+                      XSTRING (DEPRECATED_REGISTER_RAW_SIZE_P ()));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_register_raw_size_p() = %d\n",
+                      gdbarch_deprecated_register_raw_size_p (current_gdbarch));
+#ifdef DEPRECATED_REGISTER_RAW_SIZE
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_REGISTER_RAW_SIZE(reg_nr)",
+                      XSTRING (DEPRECATED_REGISTER_RAW_SIZE (reg_nr)));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_register_raw_size = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_register_raw_size);
+#ifdef DEPRECATED_REGISTER_SIZE
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
+                      XSTRING (DEPRECATED_REGISTER_SIZE));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_register_size = %s\n",
+                      paddr_d (current_gdbarch->deprecated_register_size));
+#ifdef DEPRECATED_REGISTER_VIRTUAL_SIZE_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_REGISTER_VIRTUAL_SIZE_P()",
+                      XSTRING (DEPRECATED_REGISTER_VIRTUAL_SIZE_P ()));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_register_virtual_size_p() = %d\n",
+                      gdbarch_deprecated_register_virtual_size_p (current_gdbarch));
+#ifdef DEPRECATED_REGISTER_VIRTUAL_SIZE
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_REGISTER_VIRTUAL_SIZE(reg_nr)",
+                      XSTRING (DEPRECATED_REGISTER_VIRTUAL_SIZE (reg_nr)));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_register_virtual_size = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_register_virtual_size);
+#ifdef DEPRECATED_REGISTER_VIRTUAL_TYPE_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_REGISTER_VIRTUAL_TYPE_P()",
+                      XSTRING (DEPRECATED_REGISTER_VIRTUAL_TYPE_P ()));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_register_virtual_type_p() = %d\n",
+                      gdbarch_deprecated_register_virtual_type_p (current_gdbarch));
+#ifdef DEPRECATED_REGISTER_VIRTUAL_TYPE
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_REGISTER_VIRTUAL_TYPE(reg_nr)",
+                      XSTRING (DEPRECATED_REGISTER_VIRTUAL_TYPE (reg_nr)));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_register_virtual_type = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_register_virtual_type);
 #ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_SAVE_DUMMY_FRAME_TOS_P()",
                       XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() = %d\n",
-                      DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_save_dummy_frame_tos_p() = %d\n",
+                      gdbarch_deprecated_save_dummy_frame_tos_p (current_gdbarch));
 #ifdef DEPRECATED_SAVE_DUMMY_FRAME_TOS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_SAVE_DUMMY_FRAME_TOS(sp)",
                       XSTRING (DEPRECATED_SAVE_DUMMY_FRAME_TOS (sp)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_SAVE_DUMMY_FRAME_TOS = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_save_dummy_frame_tos
-                      /*DEPRECATED_SAVE_DUMMY_FRAME_TOS ()*/);
 #endif
-#ifdef DEPRECATED_SIGTRAMP_END_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_save_dummy_frame_tos = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_save_dummy_frame_tos);
+#ifdef DEPRECATED_SAVED_PC_AFTER_CALL_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_SIGTRAMP_END_P()",
-                      XSTRING (DEPRECATED_SIGTRAMP_END_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_SIGTRAMP_END_P() = %d\n",
-                      DEPRECATED_SIGTRAMP_END_P ());
+                      "DEPRECATED_SAVED_PC_AFTER_CALL_P()",
+                      XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL_P ()));
 #endif
-#ifdef DEPRECATED_SIGTRAMP_END
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_saved_pc_after_call_p() = %d\n",
+                      gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch));
+#ifdef DEPRECATED_SAVED_PC_AFTER_CALL
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_SIGTRAMP_END(pc)",
-                      XSTRING (DEPRECATED_SIGTRAMP_END (pc)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_SIGTRAMP_END = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_sigtramp_end
-                      /*DEPRECATED_SIGTRAMP_END ()*/);
+                      "DEPRECATED_SAVED_PC_AFTER_CALL(frame)",
+                      XSTRING (DEPRECATED_SAVED_PC_AFTER_CALL (frame)));
 #endif
-#ifdef DEPRECATED_SIGTRAMP_START_P
   fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_SIGTRAMP_START_P()",
-                      XSTRING (DEPRECATED_SIGTRAMP_START_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_SIGTRAMP_START_P() = %d\n",
-                      DEPRECATED_SIGTRAMP_START_P ());
-#endif
-#ifdef DEPRECATED_SIGTRAMP_START
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "DEPRECATED_SIGTRAMP_START(pc)",
-                      XSTRING (DEPRECATED_SIGTRAMP_START (pc)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_SIGTRAMP_START = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_sigtramp_start
-                      /*DEPRECATED_SIGTRAMP_START ()*/);
-#endif
-#ifdef DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_SIZEOF_CALL_DUMMY_WORDS # %s\n",
-                      XSTRING (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_SIZEOF_CALL_DUMMY_WORDS = %d\n",
-                      DEPRECATED_SIZEOF_CALL_DUMMY_WORDS);
-#endif
+                      "gdbarch_dump: deprecated_saved_pc_after_call = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_saved_pc_after_call);
 #ifdef DEPRECATED_STACK_ALIGN_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_STACK_ALIGN_P()",
                       XSTRING (DEPRECATED_STACK_ALIGN_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_STACK_ALIGN_P() = %d\n",
-                      DEPRECATED_STACK_ALIGN_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_stack_align_p() = %d\n",
+                      gdbarch_deprecated_stack_align_p (current_gdbarch));
 #ifdef DEPRECATED_STACK_ALIGN
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_STACK_ALIGN(sp)",
                       XSTRING (DEPRECATED_STACK_ALIGN (sp)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_STACK_ALIGN = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_stack_align
-                      /*DEPRECATED_STACK_ALIGN ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_stack_align = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_stack_align);
 #ifdef DEPRECATED_STORE_RETURN_VALUE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_STORE_RETURN_VALUE(type, valbuf)",
                       XSTRING (DEPRECATED_STORE_RETURN_VALUE (type, valbuf)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_STORE_RETURN_VALUE = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_store_return_value
-                      /*DEPRECATED_STORE_RETURN_VALUE ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_store_return_value = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_store_return_value);
 #ifdef DEPRECATED_STORE_STRUCT_RETURN_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_STORE_STRUCT_RETURN_P()",
                       XSTRING (DEPRECATED_STORE_STRUCT_RETURN_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN_P() = %d\n",
-                      DEPRECATED_STORE_STRUCT_RETURN_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_store_struct_return_p() = %d\n",
+                      gdbarch_deprecated_store_struct_return_p (current_gdbarch));
 #ifdef DEPRECATED_STORE_STRUCT_RETURN
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_STORE_STRUCT_RETURN(addr, sp)",
                       XSTRING (DEPRECATED_STORE_STRUCT_RETURN (addr, sp)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_STORE_STRUCT_RETURN = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_store_struct_return
-                      /*DEPRECATED_STORE_STRUCT_RETURN ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_store_struct_return = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_store_struct_return);
 #ifdef DEPRECATED_TARGET_READ_FP_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_TARGET_READ_FP_P()",
                       XSTRING (DEPRECATED_TARGET_READ_FP_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_TARGET_READ_FP_P() = %d\n",
-                      DEPRECATED_TARGET_READ_FP_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_deprecated_target_read_fp_p() = %d\n",
+                      gdbarch_deprecated_target_read_fp_p (current_gdbarch));
 #ifdef DEPRECATED_TARGET_READ_FP
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DEPRECATED_TARGET_READ_FP()",
                       XSTRING (DEPRECATED_TARGET_READ_FP ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_TARGET_READ_FP = <0x%08lx>\n",
-                      (long) current_gdbarch->deprecated_target_read_fp
-                      /*DEPRECATED_TARGET_READ_FP ()*/);
 #endif
-#ifdef DEPRECATED_USE_GENERIC_DUMMY_FRAMES
   fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_USE_GENERIC_DUMMY_FRAMES # %s\n",
-                      XSTRING (DEPRECATED_USE_GENERIC_DUMMY_FRAMES));
+                      "gdbarch_dump: deprecated_target_read_fp = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_target_read_fp);
+#ifdef DEPRECATED_USE_STRUCT_CONVENTION
   fprintf_unfiltered (file,
-                      "gdbarch_dump: DEPRECATED_USE_GENERIC_DUMMY_FRAMES = %d\n",
-                      DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type)",
+                      XSTRING (DEPRECATED_USE_STRUCT_CONVENTION (gcc_p, value_type)));
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: deprecated_use_struct_convention = <0x%lx>\n",
+                      (long) current_gdbarch->deprecated_use_struct_convention);
+#ifdef TARGET_DOUBLE_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
+                      XSTRING (TARGET_DOUBLE_BIT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: double_bit = %s\n",
+                      paddr_d (current_gdbarch->double_bit));
+#ifdef TARGET_DOUBLE_FORMAT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
+                      XSTRING (TARGET_DOUBLE_FORMAT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: double_format = %s\n",
+                      (TARGET_DOUBLE_FORMAT)->name);
 #ifdef DWARF2_REG_TO_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
                       XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DWARF2_REG_TO_REGNUM = <0x%08lx>\n",
-                      (long) current_gdbarch->dwarf2_reg_to_regnum
-                      /*DWARF2_REG_TO_REGNUM ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: dwarf2_reg_to_regnum = <0x%lx>\n",
+                      (long) current_gdbarch->dwarf2_reg_to_regnum);
 #ifdef DWARF_REG_TO_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "DWARF_REG_TO_REGNUM(dwarf_regnr)",
                       XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: DWARF_REG_TO_REGNUM = <0x%08lx>\n",
-                      (long) current_gdbarch->dwarf_reg_to_regnum
-                      /*DWARF_REG_TO_REGNUM ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: dwarf_reg_to_regnum = <0x%lx>\n",
+                      (long) current_gdbarch->dwarf_reg_to_regnum);
 #ifdef ECOFF_REG_TO_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
                       XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: ECOFF_REG_TO_REGNUM = <0x%08lx>\n",
-                      (long) current_gdbarch->ecoff_reg_to_regnum
-                      /*ECOFF_REG_TO_REGNUM ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: ecoff_reg_to_regnum = <0x%lx>\n",
+                      (long) current_gdbarch->ecoff_reg_to_regnum);
 #ifdef ELF_MAKE_MSYMBOL_SPECIAL
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
                       XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = <0x%08lx>\n",
-                      (long) current_gdbarch->elf_make_msymbol_special
-                      /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: elf_make_msymbol_special = <0x%lx>\n",
+                      (long) current_gdbarch->elf_make_msymbol_special);
 #ifdef EXTRACT_RETURN_VALUE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "EXTRACT_RETURN_VALUE(type, regcache, valbuf)",
                       XSTRING (EXTRACT_RETURN_VALUE (type, regcache, valbuf)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: EXTRACT_RETURN_VALUE = <0x%08lx>\n",
-                      (long) current_gdbarch->extract_return_value
-                      /*EXTRACT_RETURN_VALUE ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: extract_return_value = <0x%lx>\n",
+                      (long) current_gdbarch->extract_return_value);
 #ifdef FETCH_POINTER_ARGUMENT_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "FETCH_POINTER_ARGUMENT_P()",
                       XSTRING (FETCH_POINTER_ARGUMENT_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: FETCH_POINTER_ARGUMENT_P() = %d\n",
-                      FETCH_POINTER_ARGUMENT_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_fetch_pointer_argument_p() = %d\n",
+                      gdbarch_fetch_pointer_argument_p (current_gdbarch));
 #ifdef FETCH_POINTER_ARGUMENT
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "FETCH_POINTER_ARGUMENT(frame, argi, type)",
                       XSTRING (FETCH_POINTER_ARGUMENT (frame, argi, type)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: FETCH_POINTER_ARGUMENT = <0x%08lx>\n",
-                      (long) current_gdbarch->fetch_pointer_argument
-                      /*FETCH_POINTER_ARGUMENT ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: fetch_pointer_argument = <0x%lx>\n",
+                      (long) current_gdbarch->fetch_pointer_argument);
+#ifdef TARGET_FLOAT_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
+                      XSTRING (TARGET_FLOAT_BIT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: float_bit = %s\n",
+                      paddr_d (current_gdbarch->float_bit));
+#ifdef TARGET_FLOAT_FORMAT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
+                      XSTRING (TARGET_FLOAT_FORMAT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: float_format = %s\n",
+                      (TARGET_FLOAT_FORMAT)->name);
 #ifdef FP0_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: FP0_REGNUM # %s\n",
                       XSTRING (FP0_REGNUM));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: FP0_REGNUM = %d\n",
-                      FP0_REGNUM);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: fp0_regnum = %s\n",
+                      paddr_d (current_gdbarch->fp0_regnum));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_frame_align_p() = %d\n",
+                      gdbarch_frame_align_p (current_gdbarch));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: frame_align = <0x%lx>\n",
+                      (long) current_gdbarch->frame_align);
 #ifdef FRAME_ARGS_SKIP
   fprintf_unfiltered (file,
                       "gdbarch_dump: FRAME_ARGS_SKIP # %s\n",
                       XSTRING (FRAME_ARGS_SKIP));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: FRAME_ARGS_SKIP = %ld\n",
-                      (long) FRAME_ARGS_SKIP);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: frame_args_skip = 0x%s\n",
+                      paddr_nz (current_gdbarch->frame_args_skip));
 #ifdef FRAME_NUM_ARGS_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "FRAME_NUM_ARGS_P()",
                       XSTRING (FRAME_NUM_ARGS_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: FRAME_NUM_ARGS_P() = %d\n",
-                      FRAME_NUM_ARGS_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_frame_num_args_p() = %d\n",
+                      gdbarch_frame_num_args_p (current_gdbarch));
 #ifdef FRAME_NUM_ARGS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "FRAME_NUM_ARGS(frame)",
                       XSTRING (FRAME_NUM_ARGS (frame)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: FRAME_NUM_ARGS = <0x%08lx>\n",
-                      (long) current_gdbarch->frame_num_args
-                      /*FRAME_NUM_ARGS ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: frame_num_args = <0x%lx>\n",
+                      (long) current_gdbarch->frame_num_args);
 #ifdef FRAME_RED_ZONE_SIZE
   fprintf_unfiltered (file,
                       "gdbarch_dump: FRAME_RED_ZONE_SIZE # %s\n",
                       XSTRING (FRAME_RED_ZONE_SIZE));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: FRAME_RED_ZONE_SIZE = %d\n",
-                      FRAME_RED_ZONE_SIZE);
 #endif
-#ifdef FUNCTION_START_OFFSET
   fprintf_unfiltered (file,
-                      "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
-                      XSTRING (FUNCTION_START_OFFSET));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
-                      (long) FUNCTION_START_OFFSET);
-#endif
+                      "gdbarch_dump: frame_red_zone_size = %s\n",
+                      paddr_d (current_gdbarch->frame_red_zone_size));
 #ifdef GET_LONGJMP_TARGET_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "GET_LONGJMP_TARGET_P()",
                       XSTRING (GET_LONGJMP_TARGET_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: GET_LONGJMP_TARGET_P() = %d\n",
-                      GET_LONGJMP_TARGET_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_get_longjmp_target_p() = %d\n",
+                      gdbarch_get_longjmp_target_p (current_gdbarch));
 #ifdef GET_LONGJMP_TARGET
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "GET_LONGJMP_TARGET(pc)",
                       XSTRING (GET_LONGJMP_TARGET (pc)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: GET_LONGJMP_TARGET = <0x%08lx>\n",
-                      (long) current_gdbarch->get_longjmp_target
-                      /*GET_LONGJMP_TARGET ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
+                      (long) current_gdbarch->get_longjmp_target);
 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
   fprintf_unfiltered (file,
                       "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
                       XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT = %d\n",
-                      HAVE_NONSTEPPABLE_WATCHPOINT);
 #endif
-#ifdef INNER_THAN
   fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "INNER_THAN(lhs, rhs)",
-                      XSTRING (INNER_THAN (lhs, rhs)));
+                      "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
+                      paddr_d (current_gdbarch->have_nonsteppable_watchpoint));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: INNER_THAN = <0x%08lx>\n",
-                      (long) current_gdbarch->inner_than
-                      /*INNER_THAN ()*/);
-#endif
-#ifdef INTEGER_TO_ADDRESS_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "INTEGER_TO_ADDRESS_P()",
-                      XSTRING (INTEGER_TO_ADDRESS_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: INTEGER_TO_ADDRESS_P() = %d\n",
-                      INTEGER_TO_ADDRESS_P ());
-#endif
-#ifdef INTEGER_TO_ADDRESS
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "INTEGER_TO_ADDRESS(type, buf)",
-                      XSTRING (INTEGER_TO_ADDRESS (type, buf)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: INTEGER_TO_ADDRESS = <0x%08lx>\n",
-                      (long) current_gdbarch->integer_to_address
-                      /*INTEGER_TO_ADDRESS ()*/);
-#endif
+                      "gdbarch_dump: in_function_epilogue_p = <0x%lx>\n",
+                      (long) current_gdbarch->in_function_epilogue_p);
 #ifdef IN_SOLIB_CALL_TRAMPOLINE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
                       XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = <0x%08lx>\n",
-                      (long) current_gdbarch->in_solib_call_trampoline
-                      /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: in_solib_call_trampoline = <0x%lx>\n",
+                      (long) current_gdbarch->in_solib_call_trampoline);
 #ifdef IN_SOLIB_RETURN_TRAMPOLINE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "IN_SOLIB_RETURN_TRAMPOLINE(pc, name)",
                       XSTRING (IN_SOLIB_RETURN_TRAMPOLINE (pc, name)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: IN_SOLIB_RETURN_TRAMPOLINE = <0x%08lx>\n",
-                      (long) current_gdbarch->in_solib_return_trampoline
-                      /*IN_SOLIB_RETURN_TRAMPOLINE ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: in_solib_return_trampoline = <0x%lx>\n",
+                      (long) current_gdbarch->in_solib_return_trampoline);
+#ifdef INNER_THAN
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "INNER_THAN(lhs, rhs)",
+                      XSTRING (INNER_THAN (lhs, rhs)));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: inner_than = <0x%lx>\n",
+                      (long) current_gdbarch->inner_than);
+#ifdef TARGET_INT_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_INT_BIT # %s\n",
+                      XSTRING (TARGET_INT_BIT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: int_bit = %s\n",
+                      paddr_d (current_gdbarch->int_bit));
+#ifdef INTEGER_TO_ADDRESS_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "INTEGER_TO_ADDRESS_P()",
+                      XSTRING (INTEGER_TO_ADDRESS_P ()));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n",
+                      gdbarch_integer_to_address_p (current_gdbarch));
+#ifdef INTEGER_TO_ADDRESS
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "INTEGER_TO_ADDRESS(type, buf)",
+                      XSTRING (INTEGER_TO_ADDRESS (type, buf)));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: integer_to_address = <0x%lx>\n",
+                      (long) current_gdbarch->integer_to_address);
+#ifdef TARGET_LONG_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_LONG_BIT # %s\n",
+                      XSTRING (TARGET_LONG_BIT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: long_bit = %s\n",
+                      paddr_d (current_gdbarch->long_bit));
+#ifdef TARGET_LONG_DOUBLE_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
+                      XSTRING (TARGET_LONG_DOUBLE_BIT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: long_double_bit = %s\n",
+                      paddr_d (current_gdbarch->long_double_bit));
+#ifdef TARGET_LONG_DOUBLE_FORMAT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
+                      XSTRING (TARGET_LONG_DOUBLE_FORMAT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: long_double_format = %s\n",
+                      (TARGET_LONG_DOUBLE_FORMAT)->name);
+#ifdef TARGET_LONG_LONG_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
+                      XSTRING (TARGET_LONG_LONG_BIT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: long_long_bit = %s\n",
+                      paddr_d (current_gdbarch->long_long_bit));
 #ifdef MEMORY_INSERT_BREAKPOINT
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "MEMORY_INSERT_BREAKPOINT(addr, contents_cache)",
                       XSTRING (MEMORY_INSERT_BREAKPOINT (addr, contents_cache)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: MEMORY_INSERT_BREAKPOINT = <0x%08lx>\n",
-                      (long) current_gdbarch->memory_insert_breakpoint
-                      /*MEMORY_INSERT_BREAKPOINT ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: memory_insert_breakpoint = <0x%lx>\n",
+                      (long) current_gdbarch->memory_insert_breakpoint);
 #ifdef MEMORY_REMOVE_BREAKPOINT
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "MEMORY_REMOVE_BREAKPOINT(addr, contents_cache)",
                       XSTRING (MEMORY_REMOVE_BREAKPOINT (addr, contents_cache)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: MEMORY_REMOVE_BREAKPOINT = <0x%08lx>\n",
-                      (long) current_gdbarch->memory_remove_breakpoint
-                      /*MEMORY_REMOVE_BREAKPOINT ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: memory_remove_breakpoint = <0x%lx>\n",
+                      (long) current_gdbarch->memory_remove_breakpoint);
 #ifdef NAME_OF_MALLOC
   fprintf_unfiltered (file,
                       "gdbarch_dump: NAME_OF_MALLOC # %s\n",
                       XSTRING (NAME_OF_MALLOC));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: NAME_OF_MALLOC = %s\n",
-                      NAME_OF_MALLOC);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: name_of_malloc = %s\n",
+                      NAME_OF_MALLOC);
 #ifdef NUM_PSEUDO_REGS
   fprintf_unfiltered (file,
                       "gdbarch_dump: NUM_PSEUDO_REGS # %s\n",
                       XSTRING (NUM_PSEUDO_REGS));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: NUM_PSEUDO_REGS = %d\n",
-                      NUM_PSEUDO_REGS);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: num_pseudo_regs = %s\n",
+                      paddr_d (current_gdbarch->num_pseudo_regs));
 #ifdef NUM_REGS
   fprintf_unfiltered (file,
                       "gdbarch_dump: NUM_REGS # %s\n",
                       XSTRING (NUM_REGS));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: NUM_REGS = %d\n",
-                      NUM_REGS);
 #endif
-#ifdef PARM_BOUNDARY
   fprintf_unfiltered (file,
-                      "gdbarch_dump: PARM_BOUNDARY # %s\n",
-                      XSTRING (PARM_BOUNDARY));
+                      "gdbarch_dump: num_regs = %s\n",
+                      paddr_d (current_gdbarch->num_regs));
+#ifdef TARGET_OSABI
   fprintf_unfiltered (file,
-                      "gdbarch_dump: PARM_BOUNDARY = %d\n",
-                      PARM_BOUNDARY);
+                      "gdbarch_dump: TARGET_OSABI # %s\n",
+                      XSTRING (TARGET_OSABI));
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: osabi = %s\n",
+                      paddr_d (current_gdbarch->osabi));
 #ifdef PC_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: PC_REGNUM # %s\n",
                       XSTRING (PC_REGNUM));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: PC_REGNUM = %d\n",
-                      PC_REGNUM);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: pc_regnum = %s\n",
+                      paddr_d (current_gdbarch->pc_regnum));
 #ifdef POINTER_TO_ADDRESS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "POINTER_TO_ADDRESS(type, buf)",
                       XSTRING (POINTER_TO_ADDRESS (type, buf)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: POINTER_TO_ADDRESS = <0x%08lx>\n",
-                      (long) current_gdbarch->pointer_to_address
-                      /*POINTER_TO_ADDRESS ()*/);
 #endif
   fprintf_unfiltered (file,
+                      "gdbarch_dump: pointer_to_address = <0x%lx>\n",
+                      (long) current_gdbarch->pointer_to_address);
+  fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_print_float_info_p() = %d\n",
                       gdbarch_print_float_info_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: print_float_info = 0x%08lx\n",
+                      "gdbarch_dump: print_float_info = <0x%lx>\n",
                       (long) current_gdbarch->print_float_info);
+#ifdef TARGET_PRINT_INSN
   fprintf_unfiltered (file,
-                      "gdbarch_dump: print_registers_info = 0x%08lx\n",
+                      "gdbarch_dump: %s # %s\n",
+                      "TARGET_PRINT_INSN(vma, info)",
+                      XSTRING (TARGET_PRINT_INSN (vma, info)));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: print_insn = <0x%lx>\n",
+                      (long) current_gdbarch->print_insn);
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: print_registers_info = <0x%lx>\n",
                       (long) current_gdbarch->print_registers_info);
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_print_vector_info_p() = %d\n",
                       gdbarch_print_vector_info_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: print_vector_info = 0x%08lx\n",
+                      "gdbarch_dump: print_vector_info = <0x%lx>\n",
                       (long) current_gdbarch->print_vector_info);
 #ifdef PS_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: PS_REGNUM # %s\n",
                       XSTRING (PS_REGNUM));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: PS_REGNUM = %d\n",
-                      PS_REGNUM);
 #endif
   fprintf_unfiltered (file,
+                      "gdbarch_dump: ps_regnum = %s\n",
+                      paddr_d (current_gdbarch->ps_regnum));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_pseudo_register_read_p() = %d\n",
+                      gdbarch_pseudo_register_read_p (current_gdbarch));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: pseudo_register_read = <0x%lx>\n",
+                      (long) current_gdbarch->pseudo_register_read);
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n",
+                      gdbarch_pseudo_register_write_p (current_gdbarch));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: pseudo_register_write = <0x%lx>\n",
+                      (long) current_gdbarch->pseudo_register_write);
+#ifdef TARGET_PTR_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_PTR_BIT # %s\n",
+                      XSTRING (TARGET_PTR_BIT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: ptr_bit = %s\n",
+                      paddr_d (current_gdbarch->ptr_bit));
+  fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_push_dummy_call_p() = %d\n",
                       gdbarch_push_dummy_call_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: push_dummy_call = 0x%08lx\n",
+                      "gdbarch_dump: push_dummy_call = <0x%lx>\n",
                       (long) current_gdbarch->push_dummy_call);
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_push_dummy_code_p() = %d\n",
                       gdbarch_push_dummy_code_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: push_dummy_code = 0x%08lx\n",
+                      "gdbarch_dump: push_dummy_code = <0x%lx>\n",
                       (long) current_gdbarch->push_dummy_code);
+#ifdef TARGET_READ_PC_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "TARGET_READ_PC_P()",
+                      XSTRING (TARGET_READ_PC_P ()));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_read_pc_p() = %d\n",
+                      gdbarch_read_pc_p (current_gdbarch));
+#ifdef TARGET_READ_PC
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "TARGET_READ_PC(ptid)",
+                      XSTRING (TARGET_READ_PC (ptid)));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: read_pc = <0x%lx>\n",
+                      (long) current_gdbarch->read_pc);
+#ifdef TARGET_READ_SP_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "TARGET_READ_SP_P()",
+                      XSTRING (TARGET_READ_SP_P ()));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_read_sp_p() = %d\n",
+                      gdbarch_read_sp_p (current_gdbarch));
+#ifdef TARGET_READ_SP
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "TARGET_READ_SP()",
+                      XSTRING (TARGET_READ_SP ()));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: read_sp = <0x%lx>\n",
+                      (long) current_gdbarch->read_sp);
 #ifdef REGISTER_BYTES_OK_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "REGISTER_BYTES_OK_P()",
                       XSTRING (REGISTER_BYTES_OK_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: REGISTER_BYTES_OK_P() = %d\n",
-                      REGISTER_BYTES_OK_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_register_bytes_ok_p() = %d\n",
+                      gdbarch_register_bytes_ok_p (current_gdbarch));
 #ifdef REGISTER_BYTES_OK
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "REGISTER_BYTES_OK(nr_bytes)",
                       XSTRING (REGISTER_BYTES_OK (nr_bytes)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: REGISTER_BYTES_OK = <0x%08lx>\n",
-                      (long) current_gdbarch->register_bytes_ok
-                      /*REGISTER_BYTES_OK ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: register_bytes_ok = <0x%lx>\n",
+                      (long) current_gdbarch->register_bytes_ok);
 #ifdef REGISTER_NAME
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "REGISTER_NAME(regnr)",
                       XSTRING (REGISTER_NAME (regnr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: REGISTER_NAME = <0x%08lx>\n",
-                      (long) current_gdbarch->register_name
-                      /*REGISTER_NAME ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: register_name = <0x%lx>\n",
+                      (long) current_gdbarch->register_name);
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: register_reggroup_p = <0x%lx>\n",
+                      (long) current_gdbarch->register_reggroup_p);
 #ifdef REGISTER_SIM_REGNO
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "REGISTER_SIM_REGNO(reg_nr)",
                       XSTRING (REGISTER_SIM_REGNO (reg_nr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: REGISTER_SIM_REGNO = <0x%08lx>\n",
-                      (long) current_gdbarch->register_sim_regno
-                      /*REGISTER_SIM_REGNO ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: register_sim_regno = <0x%lx>\n",
+                      (long) current_gdbarch->register_sim_regno);
 #ifdef REGISTER_TO_VALUE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "REGISTER_TO_VALUE(frame, regnum, type, buf)",
                       XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: REGISTER_TO_VALUE = <0x%08lx>\n",
-                      (long) current_gdbarch->register_to_value
-                      /*REGISTER_TO_VALUE ()*/);
 #endif
   fprintf_unfiltered (file,
+                      "gdbarch_dump: register_to_value = <0x%lx>\n",
+                      (long) current_gdbarch->register_to_value);
+  fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_register_type_p() = %d\n",
                       gdbarch_register_type_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: register_type = 0x%08lx\n",
+                      "gdbarch_dump: register_type = <0x%lx>\n",
                       (long) current_gdbarch->register_type);
   fprintf_unfiltered (file,
-                      "gdbarch_dump: remote_translate_xfer_address = 0x%08lx\n",
+                      "gdbarch_dump: gdbarch_regset_from_core_section_p() = %d\n",
+                      gdbarch_regset_from_core_section_p (current_gdbarch));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: regset_from_core_section = <0x%lx>\n",
+                      (long) current_gdbarch->regset_from_core_section);
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: remote_translate_xfer_address = <0x%lx>\n",
                       (long) current_gdbarch->remote_translate_xfer_address);
-#ifdef RETURN_VALUE_ON_STACK
   fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "RETURN_VALUE_ON_STACK(type)",
-                      XSTRING (RETURN_VALUE_ON_STACK (type)));
+                      "gdbarch_dump: gdbarch_return_value_p() = %d\n",
+                      gdbarch_return_value_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: RETURN_VALUE_ON_STACK = <0x%08lx>\n",
-                      (long) current_gdbarch->return_value_on_stack
-                      /*RETURN_VALUE_ON_STACK ()*/);
-#endif
+                      "gdbarch_dump: return_value = <0x%lx>\n",
+                      (long) current_gdbarch->return_value);
 #ifdef SDB_REG_TO_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "SDB_REG_TO_REGNUM(sdb_regnr)",
                       XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: SDB_REG_TO_REGNUM = <0x%08lx>\n",
-                      (long) current_gdbarch->sdb_reg_to_regnum
-                      /*SDB_REG_TO_REGNUM ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: sdb_reg_to_regnum = <0x%lx>\n",
+                      (long) current_gdbarch->sdb_reg_to_regnum);
+#ifdef TARGET_SHORT_BIT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
+                      XSTRING (TARGET_SHORT_BIT));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: short_bit = %s\n",
+                      paddr_d (current_gdbarch->short_bit));
 #ifdef SKIP_PROLOGUE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "SKIP_PROLOGUE(ip)",
                       XSTRING (SKIP_PROLOGUE (ip)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: SKIP_PROLOGUE = <0x%08lx>\n",
-                      (long) current_gdbarch->skip_prologue
-                      /*SKIP_PROLOGUE ()*/);
 #endif
   fprintf_unfiltered (file,
-                      "gdbarch_dump: skip_solib_resolver = 0x%08lx\n",
+                      "gdbarch_dump: skip_prologue = <0x%lx>\n",
+                      (long) current_gdbarch->skip_prologue);
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: skip_solib_resolver = <0x%lx>\n",
                       (long) current_gdbarch->skip_solib_resolver);
 #ifdef SKIP_TRAMPOLINE_CODE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "SKIP_TRAMPOLINE_CODE(pc)",
                       XSTRING (SKIP_TRAMPOLINE_CODE (pc)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: SKIP_TRAMPOLINE_CODE = <0x%08lx>\n",
-                      (long) current_gdbarch->skip_trampoline_code
-                      /*SKIP_TRAMPOLINE_CODE ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: skip_trampoline_code = <0x%lx>\n",
+                      (long) current_gdbarch->skip_trampoline_code);
 #ifdef SMASH_TEXT_ADDRESS
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "SMASH_TEXT_ADDRESS(addr)",
                       XSTRING (SMASH_TEXT_ADDRESS (addr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: SMASH_TEXT_ADDRESS = <0x%08lx>\n",
-                      (long) current_gdbarch->smash_text_address
-                      /*SMASH_TEXT_ADDRESS ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: smash_text_address = <0x%lx>\n",
+                      (long) current_gdbarch->smash_text_address);
 #ifdef SOFTWARE_SINGLE_STEP_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "SOFTWARE_SINGLE_STEP_P()",
                       XSTRING (SOFTWARE_SINGLE_STEP_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: SOFTWARE_SINGLE_STEP_P() = %d\n",
-                      SOFTWARE_SINGLE_STEP_P ());
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
+                      gdbarch_software_single_step_p (current_gdbarch));
 #ifdef SOFTWARE_SINGLE_STEP
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
                       XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: SOFTWARE_SINGLE_STEP = <0x%08lx>\n",
-                      (long) current_gdbarch->software_single_step
-                      /*SOFTWARE_SINGLE_STEP ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: software_single_step = <0x%lx>\n",
+                      (long) current_gdbarch->software_single_step);
 #ifdef SP_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: SP_REGNUM # %s\n",
                       XSTRING (SP_REGNUM));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: SP_REGNUM = %d\n",
-                      SP_REGNUM);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: sp_regnum = %s\n",
+                      paddr_d (current_gdbarch->sp_regnum));
 #ifdef STAB_REG_TO_REGNUM
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "STAB_REG_TO_REGNUM(stab_regnr)",
                       XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: STAB_REG_TO_REGNUM = <0x%08lx>\n",
-                      (long) current_gdbarch->stab_reg_to_regnum
-                      /*STAB_REG_TO_REGNUM ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: stab_reg_to_regnum = <0x%lx>\n",
+                      (long) current_gdbarch->stab_reg_to_regnum);
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: stabs_argument_has_addr = <0x%lx>\n",
+                      (long) current_gdbarch->stabs_argument_has_addr);
 #ifdef STORE_RETURN_VALUE
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "STORE_RETURN_VALUE(type, regcache, valbuf)",
                       XSTRING (STORE_RETURN_VALUE (type, regcache, valbuf)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: STORE_RETURN_VALUE = <0x%08lx>\n",
-                      (long) current_gdbarch->store_return_value
-                      /*STORE_RETURN_VALUE ()*/);
 #endif
-#ifdef TARGET_ADDR_BIT
   fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
-                      XSTRING (TARGET_ADDR_BIT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_ADDR_BIT = %d\n",
-                      TARGET_ADDR_BIT);
-#endif
-#ifdef TARGET_ARCHITECTURE
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_ARCHITECTURE # %s\n",
-                      XSTRING (TARGET_ARCHITECTURE));
-  if (TARGET_ARCHITECTURE != NULL)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: TARGET_ARCHITECTURE = %s\n",
-                        TARGET_ARCHITECTURE->printable_name);
-#endif
-#ifdef TARGET_BFD_VMA_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
-                      XSTRING (TARGET_BFD_VMA_BIT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_BFD_VMA_BIT = %d\n",
-                      TARGET_BFD_VMA_BIT);
-#endif
-#ifdef TARGET_BYTE_ORDER
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
-                      XSTRING (TARGET_BYTE_ORDER));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
-                      (long) TARGET_BYTE_ORDER);
-#endif
-#ifdef TARGET_CHAR_SIGNED
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_CHAR_SIGNED # %s\n",
-                      XSTRING (TARGET_CHAR_SIGNED));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_CHAR_SIGNED = %d\n",
-                      TARGET_CHAR_SIGNED);
-#endif
-#ifdef TARGET_DOUBLE_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_DOUBLE_BIT # %s\n",
-                      XSTRING (TARGET_DOUBLE_BIT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_DOUBLE_BIT = %d\n",
-                      TARGET_DOUBLE_BIT);
-#endif
-#ifdef TARGET_DOUBLE_FORMAT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_DOUBLE_FORMAT # %s\n",
-                      XSTRING (TARGET_DOUBLE_FORMAT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_DOUBLE_FORMAT = %s\n",
-                      (TARGET_DOUBLE_FORMAT)->name);
-#endif
-#ifdef TARGET_FLOAT_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_FLOAT_BIT # %s\n",
-                      XSTRING (TARGET_FLOAT_BIT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_FLOAT_BIT = %d\n",
-                      TARGET_FLOAT_BIT);
-#endif
-#ifdef TARGET_FLOAT_FORMAT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_FLOAT_FORMAT # %s\n",
-                      XSTRING (TARGET_FLOAT_FORMAT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_FLOAT_FORMAT = %s\n",
-                      (TARGET_FLOAT_FORMAT)->name);
-#endif
-#ifdef TARGET_INT_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_INT_BIT # %s\n",
-                      XSTRING (TARGET_INT_BIT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_INT_BIT = %d\n",
-                      TARGET_INT_BIT);
-#endif
-#ifdef TARGET_LONG_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_LONG_BIT # %s\n",
-                      XSTRING (TARGET_LONG_BIT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_LONG_BIT = %d\n",
-                      TARGET_LONG_BIT);
-#endif
-#ifdef TARGET_LONG_DOUBLE_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
-                      XSTRING (TARGET_LONG_DOUBLE_BIT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %d\n",
-                      TARGET_LONG_DOUBLE_BIT);
-#endif
-#ifdef TARGET_LONG_DOUBLE_FORMAT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
-                      XSTRING (TARGET_LONG_DOUBLE_FORMAT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %s\n",
-                      (TARGET_LONG_DOUBLE_FORMAT)->name);
-#endif
-#ifdef TARGET_LONG_LONG_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_LONG_LONG_BIT # %s\n",
-                      XSTRING (TARGET_LONG_LONG_BIT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_LONG_LONG_BIT = %d\n",
-                      TARGET_LONG_LONG_BIT);
-#endif
-#ifdef TARGET_OSABI
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_OSABI # %s\n",
-                      XSTRING (TARGET_OSABI));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_OSABI = %ld\n",
-                      (long) TARGET_OSABI);
-#endif
-#ifdef TARGET_PRINT_INSN
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "TARGET_PRINT_INSN(vma, info)",
-                      XSTRING (TARGET_PRINT_INSN (vma, info)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_PRINT_INSN = <0x%08lx>\n",
-                      (long) current_gdbarch->print_insn
-                      /*TARGET_PRINT_INSN ()*/);
-#endif
-#ifdef TARGET_PTR_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_PTR_BIT # %s\n",
-                      XSTRING (TARGET_PTR_BIT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_PTR_BIT = %d\n",
-                      TARGET_PTR_BIT);
-#endif
-#ifdef TARGET_READ_PC_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "TARGET_READ_PC_P()",
-                      XSTRING (TARGET_READ_PC_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_READ_PC_P() = %d\n",
-                      TARGET_READ_PC_P ());
-#endif
-#ifdef TARGET_READ_PC
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "TARGET_READ_PC(ptid)",
-                      XSTRING (TARGET_READ_PC (ptid)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_READ_PC = <0x%08lx>\n",
-                      (long) current_gdbarch->read_pc
-                      /*TARGET_READ_PC ()*/);
-#endif
-#ifdef TARGET_READ_SP_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "TARGET_READ_SP_P()",
-                      XSTRING (TARGET_READ_SP_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_READ_SP_P() = %d\n",
-                      TARGET_READ_SP_P ());
-#endif
-#ifdef TARGET_READ_SP
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "TARGET_READ_SP()",
-                      XSTRING (TARGET_READ_SP ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_READ_SP = <0x%08lx>\n",
-                      (long) current_gdbarch->read_sp
-                      /*TARGET_READ_SP ()*/);
-#endif
-#ifdef TARGET_SHORT_BIT
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_SHORT_BIT # %s\n",
-                      XSTRING (TARGET_SHORT_BIT));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_SHORT_BIT = %d\n",
-                      TARGET_SHORT_BIT);
-#endif
-#ifdef TARGET_VIRTUAL_FRAME_POINTER
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
-                      XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_VIRTUAL_FRAME_POINTER = <0x%08lx>\n",
-                      (long) current_gdbarch->virtual_frame_pointer
-                      /*TARGET_VIRTUAL_FRAME_POINTER ()*/);
-#endif
-#ifdef TARGET_WRITE_PC
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "TARGET_WRITE_PC(val, ptid)",
-                      XSTRING (TARGET_WRITE_PC (val, ptid)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: TARGET_WRITE_PC = <0x%08lx>\n",
-                      (long) current_gdbarch->write_pc
-                      /*TARGET_WRITE_PC ()*/);
-#endif
+                      "gdbarch_dump: store_return_value = <0x%lx>\n",
+                      (long) current_gdbarch->store_return_value);
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_unwind_dummy_id_p() = %d\n",
                       gdbarch_unwind_dummy_id_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: unwind_dummy_id = 0x%08lx\n",
+                      "gdbarch_dump: unwind_dummy_id = <0x%lx>\n",
                       (long) current_gdbarch->unwind_dummy_id);
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
                       gdbarch_unwind_pc_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: unwind_pc = 0x%08lx\n",
+                      "gdbarch_dump: unwind_pc = <0x%lx>\n",
                       (long) current_gdbarch->unwind_pc);
   fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_unwind_sp_p() = %d\n",
                       gdbarch_unwind_sp_p (current_gdbarch));
   fprintf_unfiltered (file,
-                      "gdbarch_dump: unwind_sp = 0x%08lx\n",
+                      "gdbarch_dump: unwind_sp = <0x%lx>\n",
                       (long) current_gdbarch->unwind_sp);
-#ifdef USE_STRUCT_CONVENTION
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "USE_STRUCT_CONVENTION(gcc_p, value_type)",
-                      XSTRING (USE_STRUCT_CONVENTION (gcc_p, value_type)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: USE_STRUCT_CONVENTION = <0x%08lx>\n",
-                      (long) current_gdbarch->use_struct_convention
-                      /*USE_STRUCT_CONVENTION ()*/);
-#endif
 #ifdef VALUE_TO_REGISTER
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
                       "VALUE_TO_REGISTER(frame, regnum, type, buf)",
                       XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf)));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: VALUE_TO_REGISTER = <0x%08lx>\n",
-                      (long) current_gdbarch->value_to_register
-                      /*VALUE_TO_REGISTER ()*/);
 #endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: value_to_register = <0x%lx>\n",
+                      (long) current_gdbarch->value_to_register);
+#ifdef TARGET_VIRTUAL_FRAME_POINTER
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "TARGET_VIRTUAL_FRAME_POINTER(pc, frame_regnum, frame_offset)",
+                      XSTRING (TARGET_VIRTUAL_FRAME_POINTER (pc, frame_regnum, frame_offset)));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: virtual_frame_pointer = <0x%lx>\n",
+                      (long) current_gdbarch->virtual_frame_pointer);
+#ifdef TARGET_WRITE_PC
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "TARGET_WRITE_PC(val, ptid)",
+                      XSTRING (TARGET_WRITE_PC (val, ptid)));
+#endif
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: write_pc = <0x%lx>\n",
+                      (long) current_gdbarch->write_pc);
   if (current_gdbarch->dump_tdep != NULL)
     current_gdbarch->dump_tdep (current_gdbarch, file);
 }
@@ -3150,52 +2733,6 @@
 }
 
 int
-gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_max_register_raw_size != 0;
-}
-
-int
-gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_max_register_raw_size called\n");
-  return gdbarch->deprecated_max_register_raw_size;
-}
-
-void
-set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch,
-                                              int deprecated_max_register_raw_size)
-{
-  gdbarch->deprecated_max_register_raw_size = deprecated_max_register_raw_size;
-}
-
-int
-gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_max_register_virtual_size != 0;
-}
-
-int
-gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_max_register_virtual_size called\n");
-  return gdbarch->deprecated_max_register_virtual_size;
-}
-
-void
-set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch,
-                                                  int deprecated_max_register_virtual_size)
-{
-  gdbarch->deprecated_max_register_virtual_size = deprecated_max_register_virtual_size;
-}
-
-int
 gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -3292,13 +2829,13 @@
 }
 
 CORE_ADDR
-gdbarch_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
+gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr)
 {
   gdb_assert (gdbarch != NULL);
   gdb_assert (gdbarch->push_dummy_call != NULL);
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_call called\n");
-  return gdbarch->push_dummy_call (gdbarch, func_addr, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
+  return gdbarch->push_dummy_call (gdbarch, function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr);
 }
 
 void
@@ -3333,23 +2870,6 @@
 }
 
 int
-gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  /* Skip verify of deprecated_use_generic_dummy_frames, invalid_p == 0 */
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_generic_dummy_frames called\n");
-  return gdbarch->deprecated_use_generic_dummy_frames;
-}
-
-void
-set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch,
-                                                 int deprecated_use_generic_dummy_frames)
-{
-  gdbarch->deprecated_use_generic_dummy_frames = deprecated_use_generic_dummy_frames;
-}
-
-int
 gdbarch_deprecated_push_return_address_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -3430,112 +2950,6 @@
   gdbarch->call_dummy_location = call_dummy_location;
 }
 
-CORE_ADDR
-gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_start_offset called\n");
-  return gdbarch->deprecated_call_dummy_start_offset;
-}
-
-void
-set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch,
-                                                CORE_ADDR deprecated_call_dummy_start_offset)
-{
-  gdbarch->deprecated_call_dummy_start_offset = deprecated_call_dummy_start_offset;
-}
-
-CORE_ADDR
-gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_breakpoint_offset called\n");
-  return gdbarch->deprecated_call_dummy_breakpoint_offset;
-}
-
-void
-set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch,
-                                                     CORE_ADDR deprecated_call_dummy_breakpoint_offset)
-{
-  gdbarch->deprecated_call_dummy_breakpoint_offset = deprecated_call_dummy_breakpoint_offset;
-}
-
-int
-gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_length called\n");
-  return gdbarch->deprecated_call_dummy_length;
-}
-
-void
-set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch,
-                                          int deprecated_call_dummy_length)
-{
-  gdbarch->deprecated_call_dummy_length = deprecated_call_dummy_length;
-}
-
-LONGEST *
-gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  /* Skip verify of deprecated_call_dummy_words, invalid_p == 0 */
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_call_dummy_words called\n");
-  return gdbarch->deprecated_call_dummy_words;
-}
-
-void
-set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch,
-                                         LONGEST * deprecated_call_dummy_words)
-{
-  gdbarch->deprecated_call_dummy_words = deprecated_call_dummy_words;
-}
-
-int
-gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  /* Skip verify of deprecated_sizeof_call_dummy_words, invalid_p == 0 */
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_sizeof_call_dummy_words called\n");
-  return gdbarch->deprecated_sizeof_call_dummy_words;
-}
-
-void
-set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch,
-                                                int deprecated_sizeof_call_dummy_words)
-{
-  gdbarch->deprecated_sizeof_call_dummy_words = deprecated_sizeof_call_dummy_words;
-}
-
-int
-gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_fix_call_dummy != NULL;
-}
-
-void
-gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->deprecated_fix_call_dummy != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_fix_call_dummy called\n");
-  gdbarch->deprecated_fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p);
-}
-
-void
-set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch,
-                                       gdbarch_deprecated_fix_call_dummy_ftype deprecated_fix_call_dummy)
-{
-  gdbarch->deprecated_fix_call_dummy = deprecated_fix_call_dummy;
-}
-
 int
 gdbarch_push_dummy_code_p (struct gdbarch *gdbarch)
 {
@@ -3561,30 +2975,6 @@
 }
 
 int
-gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_push_dummy_frame != NULL;
-}
-
-void
-gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->deprecated_push_dummy_frame != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_push_dummy_frame called\n");
-  gdbarch->deprecated_push_dummy_frame ();
-}
-
-void
-set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch,
-                                         gdbarch_deprecated_push_dummy_frame_ftype deprecated_push_dummy_frame)
-{
-  gdbarch->deprecated_push_dummy_frame = deprecated_push_dummy_frame;
-}
-
-int
 gdbarch_deprecated_do_registers_info_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -3773,55 +3163,6 @@
 }
 
 int
-gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_pc_in_call_dummy != deprecated_pc_in_call_dummy;
-}
-
-int
-gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->deprecated_pc_in_call_dummy != NULL);
-  /* Do not check predicate: gdbarch->deprecated_pc_in_call_dummy != deprecated_pc_in_call_dummy, allow call.  */
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_call_dummy called\n");
-  return gdbarch->deprecated_pc_in_call_dummy (pc, sp, frame_address);
-}
-
-void
-set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch,
-                                         gdbarch_deprecated_pc_in_call_dummy_ftype deprecated_pc_in_call_dummy)
-{
-  gdbarch->deprecated_pc_in_call_dummy = deprecated_pc_in_call_dummy;
-}
-
-int
-gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_init_frame_pc_first != NULL;
-}
-
-CORE_ADDR
-gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->deprecated_init_frame_pc_first != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc_first called\n");
-  return gdbarch->deprecated_init_frame_pc_first (fromleaf, prev);
-}
-
-void
-set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch,
-                                            gdbarch_deprecated_init_frame_pc_first_ftype deprecated_init_frame_pc_first)
-{
-  gdbarch->deprecated_init_frame_pc_first = deprecated_init_frame_pc_first;
-}
-
-int
 gdbarch_deprecated_init_frame_pc_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -3862,22 +3203,6 @@
 }
 
 int
-gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_believe_pcc_promotion_type called\n");
-  return gdbarch->believe_pcc_promotion_type;
-}
-
-void
-set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
-                                        int believe_pcc_promotion_type)
-{
-  gdbarch->believe_pcc_promotion_type = believe_pcc_promotion_type;
-}
-
-int
 gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
@@ -3902,64 +3227,6 @@
 }
 
 int
-gdbarch_deprecated_register_convertible_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_register_convertible != NULL;
-}
-
-int
-gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->deprecated_register_convertible != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convertible called\n");
-  return gdbarch->deprecated_register_convertible (nr);
-}
-
-void
-set_gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch,
-                                             gdbarch_deprecated_register_convertible_ftype deprecated_register_convertible)
-{
-  gdbarch->deprecated_register_convertible = deprecated_register_convertible;
-}
-
-void
-gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->deprecated_register_convert_to_virtual != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convert_to_virtual called\n");
-  gdbarch->deprecated_register_convert_to_virtual (regnum, type, from, to);
-}
-
-void
-set_gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch,
-                                                    gdbarch_deprecated_register_convert_to_virtual_ftype deprecated_register_convert_to_virtual)
-{
-  gdbarch->deprecated_register_convert_to_virtual = deprecated_register_convert_to_virtual;
-}
-
-void
-gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, const char *from, char *to)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->deprecated_register_convert_to_raw != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convert_to_raw called\n");
-  gdbarch->deprecated_register_convert_to_raw (type, regnum, from, to);
-}
-
-void
-set_gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch,
-                                                gdbarch_deprecated_register_convert_to_raw_ftype deprecated_register_convert_to_raw)
-{
-  gdbarch->deprecated_register_convert_to_raw = deprecated_register_convert_to_raw;
-}
-
-int
 gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
 {
   gdb_assert (gdbarch != NULL);
@@ -4120,7 +3387,7 @@
 gdbarch_return_value_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
-  return gdbarch->return_value != NULL;
+  return gdbarch->return_value != legacy_return_value;
 }
 
 enum return_value_convention
@@ -4128,6 +3395,7 @@
 {
   gdb_assert (gdbarch != NULL);
   gdb_assert (gdbarch->return_value != NULL);
+  /* Do not check predicate: gdbarch->return_value != legacy_return_value, allow call.  */
   if (gdbarch_debug >= 2)
     fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value called\n");
   return gdbarch->return_value (gdbarch, valtype, regcache, readbuf, writebuf);
@@ -4140,23 +3408,6 @@
   gdbarch->return_value = return_value;
 }
 
-int
-gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->return_value_on_stack != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n");
-  return gdbarch->return_value_on_stack (type);
-}
-
-void
-set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch,
-                                   gdbarch_return_value_on_stack_ftype return_value_on_stack)
-{
-  gdbarch->return_value_on_stack = return_value_on_stack;
-}
-
 void
 gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf)
 {
@@ -4226,20 +3477,20 @@
 }
 
 int
-gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
+gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type)
 {
   gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->use_struct_convention != NULL);
+  gdb_assert (gdbarch->deprecated_use_struct_convention != NULL);
   if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n");
-  return gdbarch->use_struct_convention (gcc_p, value_type);
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_use_struct_convention called\n");
+  return gdbarch->deprecated_use_struct_convention (gcc_p, value_type);
 }
 
 void
-set_gdbarch_use_struct_convention (struct gdbarch *gdbarch,
-                                   gdbarch_use_struct_convention_ftype use_struct_convention)
+set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch,
+                                              gdbarch_deprecated_use_struct_convention_ftype deprecated_use_struct_convention)
 {
-  gdbarch->use_struct_convention = use_struct_convention;
+  gdbarch->deprecated_use_struct_convention = deprecated_use_struct_convention;
 }
 
 int
@@ -4441,20 +3692,20 @@
 }
 
 CORE_ADDR
-gdbarch_function_start_offset (struct gdbarch *gdbarch)
+gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
-  /* Skip verify of function_start_offset, invalid_p == 0 */
+  /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
   if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
-  return gdbarch->function_start_offset;
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
+  return gdbarch->deprecated_function_start_offset;
 }
 
 void
-set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
-                                   CORE_ADDR function_start_offset)
+set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
+                                              CORE_ADDR deprecated_function_start_offset)
 {
-  gdbarch->function_start_offset = function_start_offset;
+  gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
 }
 
 void
@@ -4838,22 +4089,6 @@
   gdbarch->frame_red_zone_size = frame_red_zone_size;
 }
 
-int
-gdbarch_parm_boundary (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_parm_boundary called\n");
-  return gdbarch->parm_boundary;
-}
-
-void
-set_gdbarch_parm_boundary (struct gdbarch *gdbarch,
-                           int parm_boundary)
-{
-  gdbarch->parm_boundary = parm_boundary;
-}
-
 const struct floatformat *
 gdbarch_float_format (struct gdbarch *gdbarch)
 {
@@ -5063,79 +4298,6 @@
 }
 
 int
-gdbarch_deprecated_pc_in_sigtramp_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_pc_in_sigtramp != legacy_pc_in_sigtramp;
-}
-
-int
-gdbarch_deprecated_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->deprecated_pc_in_sigtramp != NULL);
-  /* Do not check predicate: gdbarch->deprecated_pc_in_sigtramp != legacy_pc_in_sigtramp, allow call.  */
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pc_in_sigtramp called\n");
-  return gdbarch->deprecated_pc_in_sigtramp (pc, name);
-}
-
-void
-set_gdbarch_deprecated_pc_in_sigtramp (struct gdbarch *gdbarch,
-                                       gdbarch_deprecated_pc_in_sigtramp_ftype deprecated_pc_in_sigtramp)
-{
-  gdbarch->deprecated_pc_in_sigtramp = deprecated_pc_in_sigtramp;
-}
-
-int
-gdbarch_deprecated_sigtramp_start_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_sigtramp_start != NULL;
-}
-
-CORE_ADDR
-gdbarch_deprecated_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->deprecated_sigtramp_start != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_sigtramp_start called\n");
-  return gdbarch->deprecated_sigtramp_start (pc);
-}
-
-void
-set_gdbarch_deprecated_sigtramp_start (struct gdbarch *gdbarch,
-                                       gdbarch_deprecated_sigtramp_start_ftype deprecated_sigtramp_start)
-{
-  gdbarch->deprecated_sigtramp_start = deprecated_sigtramp_start;
-}
-
-int
-gdbarch_deprecated_sigtramp_end_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->deprecated_sigtramp_end != NULL;
-}
-
-CORE_ADDR
-gdbarch_deprecated_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->deprecated_sigtramp_end != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_sigtramp_end called\n");
-  return gdbarch->deprecated_sigtramp_end (pc);
-}
-
-void
-set_gdbarch_deprecated_sigtramp_end (struct gdbarch *gdbarch,
-                                     gdbarch_deprecated_sigtramp_end_ftype deprecated_sigtramp_end)
-{
-  gdbarch->deprecated_sigtramp_end = deprecated_sigtramp_end;
-}
-
-int
 gdbarch_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR addr)
 {
   gdb_assert (gdbarch != NULL);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 8585b70..ae4e70b 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -52,7 +52,6 @@
 
 extern struct gdbarch *current_gdbarch;
 
-
 /* If any of the following are defined, the target wasn't correctly
    converted. */
 
@@ -95,7 +94,7 @@
 
 /* Number of bits in a char or unsigned char for the target machine.
    Just like CHAR_BIT in <limits.h> but describes the target machine.
-   v:2:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
+   v:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
   
    Number of bits in a short or unsigned short for the target machine. */
 
@@ -238,7 +237,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_PC_P)
 #error "Non multi-arch definition of TARGET_READ_PC"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_PC_P)
+#if !defined (TARGET_READ_PC_P)
 #define TARGET_READ_PC_P() (gdbarch_read_pc_p (current_gdbarch))
 #endif
 
@@ -275,7 +274,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_READ_SP_P)
 #error "Non multi-arch definition of TARGET_READ_SP"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (TARGET_READ_SP_P)
+#if !defined (TARGET_READ_SP_P)
 #define TARGET_READ_SP_P() (gdbarch_read_sp_p (current_gdbarch))
 #endif
 
@@ -468,7 +467,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_VIRTUAL_TYPE_P)
 #error "Non multi-arch definition of DEPRECATED_REGISTER_VIRTUAL_TYPE"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_VIRTUAL_TYPE_P)
+#if !defined (DEPRECATED_REGISTER_VIRTUAL_TYPE_P)
 #define DEPRECATED_REGISTER_VIRTUAL_TYPE_P() (gdbarch_deprecated_register_virtual_type_p (current_gdbarch))
 #endif
 
@@ -513,7 +512,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_BYTE_P)
 #error "Non multi-arch definition of DEPRECATED_REGISTER_BYTE"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_BYTE_P)
+#if !defined (DEPRECATED_REGISTER_BYTE_P)
 #define DEPRECATED_REGISTER_BYTE_P() (gdbarch_deprecated_register_byte_p (current_gdbarch))
 #endif
 
@@ -543,7 +542,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_RAW_SIZE_P)
 #error "Non multi-arch definition of DEPRECATED_REGISTER_RAW_SIZE"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_RAW_SIZE_P)
+#if !defined (DEPRECATED_REGISTER_RAW_SIZE_P)
 #define DEPRECATED_REGISTER_RAW_SIZE_P() (gdbarch_deprecated_register_raw_size_p (current_gdbarch))
 #endif
 
@@ -573,7 +572,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_VIRTUAL_SIZE_P)
 #error "Non multi-arch definition of DEPRECATED_REGISTER_VIRTUAL_SIZE"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_VIRTUAL_SIZE_P)
+#if !defined (DEPRECATED_REGISTER_VIRTUAL_SIZE_P)
 #define DEPRECATED_REGISTER_VIRTUAL_SIZE_P() (gdbarch_deprecated_register_virtual_size_p (current_gdbarch))
 #endif
 
@@ -587,60 +586,6 @@
 #define DEPRECATED_REGISTER_VIRTUAL_SIZE(reg_nr) (gdbarch_deprecated_register_virtual_size (current_gdbarch, reg_nr))
 #endif
 
-/* DEPRECATED_MAX_REGISTER_RAW_SIZE can be deleted.  It has been
-   replaced by the constant MAX_REGISTER_SIZE. */
-
-#if defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
-/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_RAW_SIZE */
-#if !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
-#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_max_register_raw_size_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
-#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE_P)
-#define DEPRECATED_MAX_REGISTER_RAW_SIZE_P() (gdbarch_deprecated_max_register_raw_size_p (current_gdbarch))
-#endif
-
-extern int gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_max_register_raw_size (struct gdbarch *gdbarch, int deprecated_max_register_raw_size);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
-#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_RAW_SIZE"
-#endif
-#if !defined (DEPRECATED_MAX_REGISTER_RAW_SIZE)
-#define DEPRECATED_MAX_REGISTER_RAW_SIZE (gdbarch_deprecated_max_register_raw_size (current_gdbarch))
-#endif
-
-/* DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE can be deleted.  It has been
-   replaced by the constant MAX_REGISTER_SIZE. */
-
-#if defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
-/* Legacy for systems yet to multi-arch DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE */
-#if !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
-#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_max_register_virtual_size_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
-#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P)
-#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE_P() (gdbarch_deprecated_max_register_virtual_size_p (current_gdbarch))
-#endif
-
-extern int gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_max_register_virtual_size (struct gdbarch *gdbarch, int deprecated_max_register_virtual_size);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
-#error "Non multi-arch definition of DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE"
-#endif
-#if !defined (DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE)
-#define DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE (gdbarch_deprecated_max_register_virtual_size (current_gdbarch))
-#endif
-
 /* See gdbint.texinfo, and PUSH_DUMMY_CALL. */
 
 extern int gdbarch_unwind_dummy_id_p (struct gdbarch *gdbarch);
@@ -663,7 +608,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P)
 #error "Non multi-arch definition of DEPRECATED_SAVE_DUMMY_FRAME_TOS"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P)
+#if !defined (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P)
 #define DEPRECATED_SAVE_DUMMY_FRAME_TOS_P() (gdbarch_deprecated_save_dummy_frame_tos_p (current_gdbarch))
 #endif
 
@@ -703,7 +648,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_TARGET_READ_FP_P)
 #error "Non multi-arch definition of DEPRECATED_TARGET_READ_FP"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_TARGET_READ_FP_P)
+#if !defined (DEPRECATED_TARGET_READ_FP_P)
 #define DEPRECATED_TARGET_READ_FP_P() (gdbarch_deprecated_target_read_fp_p (current_gdbarch))
 #endif
 
@@ -722,8 +667,8 @@
 
 extern int gdbarch_push_dummy_call_p (struct gdbarch *gdbarch);
 
-typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
-extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
+typedef CORE_ADDR (gdbarch_push_dummy_call_ftype) (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
+extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
 extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call);
 
 /* PUSH_DUMMY_CALL is a direct replacement for DEPRECATED_PUSH_ARGUMENTS. */
@@ -739,7 +684,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_ARGUMENTS_P)
 #error "Non multi-arch definition of DEPRECATED_PUSH_ARGUMENTS"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_ARGUMENTS_P)
+#if !defined (DEPRECATED_PUSH_ARGUMENTS_P)
 #define DEPRECATED_PUSH_ARGUMENTS_P() (gdbarch_deprecated_push_arguments_p (current_gdbarch))
 #endif
 
@@ -753,17 +698,6 @@
 #define DEPRECATED_PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) (gdbarch_deprecated_push_arguments (current_gdbarch, nargs, args, sp, struct_return, struct_addr))
 #endif
 
-/* DEPRECATED_USE_GENERIC_DUMMY_FRAMES can be deleted.  Always true. */
-
-extern int gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_use_generic_dummy_frames (struct gdbarch *gdbarch, int deprecated_use_generic_dummy_frames);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
-#error "Non multi-arch definition of DEPRECATED_USE_GENERIC_DUMMY_FRAMES"
-#endif
-#if !defined (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
-#define DEPRECATED_USE_GENERIC_DUMMY_FRAMES (gdbarch_deprecated_use_generic_dummy_frames (current_gdbarch))
-#endif
-
 /* Implement PUSH_RETURN_ADDRESS, and then merge in
    DEPRECATED_PUSH_RETURN_ADDRESS. */
 
@@ -778,7 +712,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
 #error "Non multi-arch definition of DEPRECATED_PUSH_RETURN_ADDRESS"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
+#if !defined (DEPRECATED_PUSH_RETURN_ADDRESS_P)
 #define DEPRECATED_PUSH_RETURN_ADDRESS_P() (gdbarch_deprecated_push_return_address_p (current_gdbarch))
 #endif
 
@@ -805,7 +739,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DUMMY_WRITE_SP_P)
 #error "Non multi-arch definition of DEPRECATED_DUMMY_WRITE_SP"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DUMMY_WRITE_SP_P)
+#if !defined (DEPRECATED_DUMMY_WRITE_SP_P)
 #define DEPRECATED_DUMMY_WRITE_SP_P() (gdbarch_deprecated_dummy_write_sp_p (current_gdbarch))
 #endif
 
@@ -839,124 +773,12 @@
 #define CALL_DUMMY_LOCATION (gdbarch_call_dummy_location (current_gdbarch))
 #endif
 
-/* DEPRECATED_CALL_DUMMY_START_OFFSET can be deleted. */
-
-extern CORE_ADDR gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_call_dummy_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_start_offset);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_START_OFFSET)
-#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_START_OFFSET"
-#endif
-#if !defined (DEPRECATED_CALL_DUMMY_START_OFFSET)
-#define DEPRECATED_CALL_DUMMY_START_OFFSET (gdbarch_deprecated_call_dummy_start_offset (current_gdbarch))
-#endif
-
-/* DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET can be deleted. */
-
-extern CORE_ADDR gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_call_dummy_breakpoint_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_call_dummy_breakpoint_offset);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
-#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET"
-#endif
-#if !defined (DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET)
-#define DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET (gdbarch_deprecated_call_dummy_breakpoint_offset (current_gdbarch))
-#endif
-
-/* DEPRECATED_CALL_DUMMY_LENGTH can be deleted. */
-
-extern int gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_call_dummy_length (struct gdbarch *gdbarch, int deprecated_call_dummy_length);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_LENGTH)
-#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_LENGTH"
-#endif
-#if !defined (DEPRECATED_CALL_DUMMY_LENGTH)
-#define DEPRECATED_CALL_DUMMY_LENGTH (gdbarch_deprecated_call_dummy_length (current_gdbarch))
-#endif
-
-/* DEPRECATED_CALL_DUMMY_WORDS can be deleted. */
-
-extern LONGEST * gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_call_dummy_words (struct gdbarch *gdbarch, LONGEST * deprecated_call_dummy_words);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_CALL_DUMMY_WORDS)
-#error "Non multi-arch definition of DEPRECATED_CALL_DUMMY_WORDS"
-#endif
-#if !defined (DEPRECATED_CALL_DUMMY_WORDS)
-#define DEPRECATED_CALL_DUMMY_WORDS (gdbarch_deprecated_call_dummy_words (current_gdbarch))
-#endif
-
-/* Implement PUSH_DUMMY_CALL, then delete DEPRECATED_SIZEOF_CALL_DUMMY_WORDS. */
-
-extern int gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_sizeof_call_dummy_words (struct gdbarch *gdbarch, int deprecated_sizeof_call_dummy_words);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
-#error "Non multi-arch definition of DEPRECATED_SIZEOF_CALL_DUMMY_WORDS"
-#endif
-#if !defined (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS)
-#define DEPRECATED_SIZEOF_CALL_DUMMY_WORDS (gdbarch_deprecated_sizeof_call_dummy_words (current_gdbarch))
-#endif
-
-/* DEPRECATED_FIX_CALL_DUMMY can be deleted.  For the SPARC, implement
-   PUSH_DUMMY_CODE and set CALL_DUMMY_LOCATION to ON_STACK. */
-
-#if defined (DEPRECATED_FIX_CALL_DUMMY)
-/* Legacy for systems yet to multi-arch DEPRECATED_FIX_CALL_DUMMY */
-#if !defined (DEPRECATED_FIX_CALL_DUMMY_P)
-#define DEPRECATED_FIX_CALL_DUMMY_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_fix_call_dummy_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY_P)
-#error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FIX_CALL_DUMMY_P)
-#define DEPRECATED_FIX_CALL_DUMMY_P() (gdbarch_deprecated_fix_call_dummy_p (current_gdbarch))
-#endif
-
-typedef void (gdbarch_deprecated_fix_call_dummy_ftype) (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
-extern void gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p);
-extern void set_gdbarch_deprecated_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_fix_call_dummy_ftype *deprecated_fix_call_dummy);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FIX_CALL_DUMMY)
-#error "Non multi-arch definition of DEPRECATED_FIX_CALL_DUMMY"
-#endif
-#if !defined (DEPRECATED_FIX_CALL_DUMMY)
-#define DEPRECATED_FIX_CALL_DUMMY(dummy, pc, fun, nargs, args, type, gcc_p) (gdbarch_deprecated_fix_call_dummy (current_gdbarch, dummy, pc, fun, nargs, args, type, gcc_p))
-#endif
-
-/* This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al. */
-
 extern int gdbarch_push_dummy_code_p (struct gdbarch *gdbarch);
 
 typedef CORE_ADDR (gdbarch_push_dummy_code_ftype) (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr);
 extern CORE_ADDR gdbarch_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr);
 extern void set_gdbarch_push_dummy_code (struct gdbarch *gdbarch, gdbarch_push_dummy_code_ftype *push_dummy_code);
 
-/* Implement PUSH_DUMMY_CALL, then delete DEPRECATED_PUSH_DUMMY_FRAME. */
-
-#if defined (DEPRECATED_PUSH_DUMMY_FRAME)
-/* Legacy for systems yet to multi-arch DEPRECATED_PUSH_DUMMY_FRAME */
-#if !defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
-#define DEPRECATED_PUSH_DUMMY_FRAME_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_push_dummy_frame_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
-#error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PUSH_DUMMY_FRAME_P)
-#define DEPRECATED_PUSH_DUMMY_FRAME_P() (gdbarch_deprecated_push_dummy_frame_p (current_gdbarch))
-#endif
-
-typedef void (gdbarch_deprecated_push_dummy_frame_ftype) (void);
-extern void gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_push_dummy_frame (struct gdbarch *gdbarch, gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PUSH_DUMMY_FRAME)
-#error "Non multi-arch definition of DEPRECATED_PUSH_DUMMY_FRAME"
-#endif
-#if !defined (DEPRECATED_PUSH_DUMMY_FRAME)
-#define DEPRECATED_PUSH_DUMMY_FRAME (gdbarch_deprecated_push_dummy_frame (current_gdbarch))
-#endif
-
 #if defined (DEPRECATED_DO_REGISTERS_INFO)
 /* Legacy for systems yet to multi-arch DEPRECATED_DO_REGISTERS_INFO */
 #if !defined (DEPRECATED_DO_REGISTERS_INFO_P)
@@ -968,7 +790,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_DO_REGISTERS_INFO_P)
 #error "Non multi-arch definition of DEPRECATED_DO_REGISTERS_INFO"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_DO_REGISTERS_INFO_P)
+#if !defined (DEPRECATED_DO_REGISTERS_INFO_P)
 #define DEPRECATED_DO_REGISTERS_INFO_P() (gdbarch_deprecated_do_registers_info_p (current_gdbarch))
 #endif
 
@@ -1022,7 +844,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_BYTES_OK_P)
 #error "Non multi-arch definition of REGISTER_BYTES_OK"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (REGISTER_BYTES_OK_P)
+#if !defined (REGISTER_BYTES_OK_P)
 #define REGISTER_BYTES_OK_P() (gdbarch_register_bytes_ok_p (current_gdbarch))
 #endif
 
@@ -1069,7 +891,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_LONGJMP_TARGET_P)
 #error "Non multi-arch definition of GET_LONGJMP_TARGET"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_LONGJMP_TARGET_P)
+#if !defined (GET_LONGJMP_TARGET_P)
 #define GET_LONGJMP_TARGET_P() (gdbarch_get_longjmp_target_p (current_gdbarch))
 #endif
 
@@ -1083,62 +905,6 @@
 #define GET_LONGJMP_TARGET(pc) (gdbarch_get_longjmp_target (current_gdbarch, pc))
 #endif
 
-/* NOTE: cagney/2002-11-24: This function with predicate has a valid
-   (callable) initial value.  As a consequence, even when the predicate
-   is false, the corresponding function works.  This simplifies the
-   migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
-   doesn't need to be modified. */
-
-#if defined (DEPRECATED_PC_IN_CALL_DUMMY)
-/* Legacy for systems yet to multi-arch DEPRECATED_PC_IN_CALL_DUMMY */
-#if !defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
-#define DEPRECATED_PC_IN_CALL_DUMMY_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_pc_in_call_dummy_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
-#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_CALL_DUMMY_P)
-#define DEPRECATED_PC_IN_CALL_DUMMY_P() (gdbarch_deprecated_pc_in_call_dummy_p (current_gdbarch))
-#endif
-
-typedef int (gdbarch_deprecated_pc_in_call_dummy_ftype) (CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
-extern int gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address);
-extern void set_gdbarch_deprecated_pc_in_call_dummy (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_call_dummy_ftype *deprecated_pc_in_call_dummy);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_CALL_DUMMY)
-#error "Non multi-arch definition of DEPRECATED_PC_IN_CALL_DUMMY"
-#endif
-#if !defined (DEPRECATED_PC_IN_CALL_DUMMY)
-#define DEPRECATED_PC_IN_CALL_DUMMY(pc, sp, frame_address) (gdbarch_deprecated_pc_in_call_dummy (current_gdbarch, pc, sp, frame_address))
-#endif
-
-#if defined (DEPRECATED_INIT_FRAME_PC_FIRST)
-/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC_FIRST */
-#if !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
-#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
-#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
-#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (gdbarch_deprecated_init_frame_pc_first_p (current_gdbarch))
-#endif
-
-typedef CORE_ADDR (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
-extern CORE_ADDR gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
-extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST)
-#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST"
-#endif
-#if !defined (DEPRECATED_INIT_FRAME_PC_FIRST)
-#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_deprecated_init_frame_pc_first (current_gdbarch, fromleaf, prev))
-#endif
-
 #if defined (DEPRECATED_INIT_FRAME_PC)
 /* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC */
 #if !defined (DEPRECATED_INIT_FRAME_PC_P)
@@ -1150,7 +916,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_P)
 #error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_P)
+#if !defined (DEPRECATED_INIT_FRAME_PC_P)
 #define DEPRECATED_INIT_FRAME_PC_P() (gdbarch_deprecated_init_frame_pc_p (current_gdbarch))
 #endif
 
@@ -1173,15 +939,6 @@
 #define BELIEVE_PCC_PROMOTION (gdbarch_believe_pcc_promotion (current_gdbarch))
 #endif
 
-extern int gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch);
-extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int believe_pcc_promotion_type);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (BELIEVE_PCC_PROMOTION_TYPE)
-#error "Non multi-arch definition of BELIEVE_PCC_PROMOTION_TYPE"
-#endif
-#if !defined (BELIEVE_PCC_PROMOTION_TYPE)
-#define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch))
-#endif
-
 #if defined (DEPRECATED_GET_SAVED_REGISTER)
 /* Legacy for systems yet to multi-arch DEPRECATED_GET_SAVED_REGISTER */
 #if !defined (DEPRECATED_GET_SAVED_REGISTER_P)
@@ -1193,7 +950,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER_P)
 #error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER_P)
+#if !defined (DEPRECATED_GET_SAVED_REGISTER_P)
 #define DEPRECATED_GET_SAVED_REGISTER_P() (gdbarch_deprecated_get_saved_register_p (current_gdbarch))
 #endif
 
@@ -1207,64 +964,10 @@
 #define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_deprecated_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
 #endif
 
-/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
-   For raw <-> cooked register conversions, replaced by pseudo registers. */
-
-#if defined (DEPRECATED_REGISTER_CONVERTIBLE)
-/* Legacy for systems yet to multi-arch DEPRECATED_REGISTER_CONVERTIBLE */
-#if !defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
-#define DEPRECATED_REGISTER_CONVERTIBLE_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_register_convertible_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERTIBLE"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
-#define DEPRECATED_REGISTER_CONVERTIBLE_P() (gdbarch_deprecated_register_convertible_p (current_gdbarch))
-#endif
-
-typedef int (gdbarch_deprecated_register_convertible_ftype) (int nr);
-extern int gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr);
-extern void set_gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, gdbarch_deprecated_register_convertible_ftype *deprecated_register_convertible);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERTIBLE)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERTIBLE"
-#endif
-#if !defined (DEPRECATED_REGISTER_CONVERTIBLE)
-#define DEPRECATED_REGISTER_CONVERTIBLE(nr) (gdbarch_deprecated_register_convertible (current_gdbarch, nr))
-#endif
-
-/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
-   For raw <-> cooked register conversions, replaced by pseudo registers. */
-
-typedef void (gdbarch_deprecated_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to);
-extern void gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to);
-extern void set_gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_deprecated_register_convert_to_virtual_ftype *deprecated_register_convert_to_virtual);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL"
-#endif
-#if !defined (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL)
-#define DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_deprecated_register_convert_to_virtual (current_gdbarch, regnum, type, from, to))
-#endif
-
-/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
-   For raw <-> cooked register conversions, replaced by pseudo registers. */
-
-typedef void (gdbarch_deprecated_register_convert_to_raw_ftype) (struct type *type, int regnum, const char *from, char *to);
-extern void gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, const char *from, char *to);
-extern void set_gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_deprecated_register_convert_to_raw_ftype *deprecated_register_convert_to_raw);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERT_TO_RAW)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERT_TO_RAW"
-#endif
-#if !defined (DEPRECATED_REGISTER_CONVERT_TO_RAW)
-#define DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_deprecated_register_convert_to_raw (current_gdbarch, type, regnum, from, to))
-#endif
-
 typedef int (gdbarch_convert_register_p_ftype) (int regnum, struct type *type);
 extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type);
 extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p);
-#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_REGISTER_P)
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CONVERT_REGISTER_P)
 #error "Non multi-arch definition of CONVERT_REGISTER_P"
 #endif
 #if !defined (CONVERT_REGISTER_P)
@@ -1274,7 +977,7 @@
 typedef void (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, void *buf);
 extern void gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, void *buf);
 extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value);
-#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_TO_VALUE)
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (REGISTER_TO_VALUE)
 #error "Non multi-arch definition of REGISTER_TO_VALUE"
 #endif
 #if !defined (REGISTER_TO_VALUE)
@@ -1284,7 +987,7 @@
 typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const void *buf);
 extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const void *buf);
 extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register);
-#if (GDB_MULTI_ARCH >= GDB_MULTI_ARCH_PARTIAL) && defined (VALUE_TO_REGISTER)
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (VALUE_TO_REGISTER)
 #error "Non multi-arch definition of VALUE_TO_REGISTER"
 #endif
 #if !defined (VALUE_TO_REGISTER)
@@ -1322,7 +1025,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INTEGER_TO_ADDRESS_P)
 #error "Non multi-arch definition of INTEGER_TO_ADDRESS"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INTEGER_TO_ADDRESS_P)
+#if !defined (INTEGER_TO_ADDRESS_P)
 #define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch))
 #endif
 
@@ -1347,7 +1050,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME_P)
 #error "Non multi-arch definition of DEPRECATED_POP_FRAME"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME_P)
+#if !defined (DEPRECATED_POP_FRAME_P)
 #define DEPRECATED_POP_FRAME_P() (gdbarch_deprecated_pop_frame_p (current_gdbarch))
 #endif
 
@@ -1374,7 +1077,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STORE_STRUCT_RETURN_P)
 #error "Non multi-arch definition of DEPRECATED_STORE_STRUCT_RETURN"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STORE_STRUCT_RETURN_P)
+#if !defined (DEPRECATED_STORE_STRUCT_RETURN_P)
 #define DEPRECATED_STORE_STRUCT_RETURN_P() (gdbarch_deprecated_store_struct_return_p (current_gdbarch))
 #endif
 
@@ -1390,7 +1093,10 @@
 
 /* It has been suggested that this, well actually its predecessor,
    should take the type/value of the function to be called and not the
-   return type.  This is left as an exercise for the reader. */
+   return type.  This is left as an exercise for the reader.
+   NOTE: cagney/2004-06-13: The function stack.c:return_command uses
+   the predicate with default hack to avoid calling STORE_RETURN_VALUE
+   (via legacy_return_value), when a small struct is involved. */
 
 extern int gdbarch_return_value_p (struct gdbarch *gdbarch);
 
@@ -1398,19 +1104,10 @@
 extern enum return_value_convention gdbarch_return_value (struct gdbarch *gdbarch, struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf);
 extern void set_gdbarch_return_value (struct gdbarch *gdbarch, gdbarch_return_value_ftype *return_value);
 
-/* The deprecated methods RETURN_VALUE_ON_STACK, EXTRACT_RETURN_VALUE,
-   STORE_RETURN_VALUE and USE_STRUCT_CONVENTION have all been folded
-   into RETURN_VALUE. */
-
-typedef int (gdbarch_return_value_on_stack_ftype) (struct type *type);
-extern int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type);
-extern void set_gdbarch_return_value_on_stack (struct gdbarch *gdbarch, gdbarch_return_value_on_stack_ftype *return_value_on_stack);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (RETURN_VALUE_ON_STACK)
-#error "Non multi-arch definition of RETURN_VALUE_ON_STACK"
-#endif
-#if !defined (RETURN_VALUE_ON_STACK)
-#define RETURN_VALUE_ON_STACK(type) (gdbarch_return_value_on_stack (current_gdbarch, type))
-#endif
+/* The deprecated methods EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE,
+   DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS and
+   DEPRECATED_USE_STRUCT_CONVENTION have all been folded into
+   RETURN_VALUE. */
 
 typedef void (gdbarch_extract_return_value_ftype) (struct type *type, struct regcache *regcache, void *valbuf);
 extern void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, struct regcache *regcache, void *valbuf);
@@ -1452,14 +1149,14 @@
 #define DEPRECATED_STORE_RETURN_VALUE(type, valbuf) (gdbarch_deprecated_store_return_value (current_gdbarch, type, valbuf))
 #endif
 
-typedef int (gdbarch_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
-extern int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
-extern void set_gdbarch_use_struct_convention (struct gdbarch *gdbarch, gdbarch_use_struct_convention_ftype *use_struct_convention);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (USE_STRUCT_CONVENTION)
-#error "Non multi-arch definition of USE_STRUCT_CONVENTION"
+typedef int (gdbarch_deprecated_use_struct_convention_ftype) (int gcc_p, struct type *value_type);
+extern int gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type);
+extern void set_gdbarch_deprecated_use_struct_convention (struct gdbarch *gdbarch, gdbarch_deprecated_use_struct_convention_ftype *deprecated_use_struct_convention);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_USE_STRUCT_CONVENTION)
+#error "Non multi-arch definition of DEPRECATED_USE_STRUCT_CONVENTION"
 #endif
-#if !defined (USE_STRUCT_CONVENTION)
-#define USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_use_struct_convention (current_gdbarch, gcc_p, value_type))
+#if !defined (DEPRECATED_USE_STRUCT_CONVENTION)
+#define DEPRECATED_USE_STRUCT_CONVENTION(gcc_p, value_type) (gdbarch_deprecated_use_struct_convention (current_gdbarch, gcc_p, value_type))
 #endif
 
 /* As of 2004-01-17 only the 32-bit SPARC ABI has been identified as an
@@ -1478,7 +1175,7 @@
    will be needed for that case to work.  NB: It is passed the callers
    frame since it is only after the callee has returned that this
    function is used.
-  M:::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame */
+  M::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame */
 
 #if defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS)
 /* Legacy for systems yet to multi-arch DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS */
@@ -1491,7 +1188,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
 #error "Non multi-arch definition of DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
+#if !defined (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P)
 #define DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P() (gdbarch_deprecated_extract_struct_value_address_p (current_gdbarch))
 #endif
 
@@ -1516,7 +1213,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
 #error "Non multi-arch definition of DEPRECATED_FRAME_INIT_SAVED_REGS"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
+#if !defined (DEPRECATED_FRAME_INIT_SAVED_REGS_P)
 #define DEPRECATED_FRAME_INIT_SAVED_REGS_P() (gdbarch_deprecated_frame_init_saved_regs_p (current_gdbarch))
 #endif
 
@@ -1541,7 +1238,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
 #error "Non multi-arch definition of DEPRECATED_INIT_EXTRA_FRAME_INFO"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
+#if !defined (DEPRECATED_INIT_EXTRA_FRAME_INFO_P)
 #define DEPRECATED_INIT_EXTRA_FRAME_INFO_P() (gdbarch_deprecated_init_extra_frame_info_p (current_gdbarch))
 #endif
 
@@ -1620,13 +1317,21 @@
 #define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
 #endif
 
-extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch);
-extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET)
-#error "Non multi-arch definition of FUNCTION_START_OFFSET"
+/* A function can be addressed by either it's "pointer" (possibly a
+   descriptor address) or "entry point" (first executable instruction).
+   The method "convert_from_func_ptr_addr" converting the former to the
+   latter.  DEPRECATED_FUNCTION_START_OFFSET is being used to implement
+   a simplified subset of that functionality - the function's address
+   corresponds to the "function pointer" and the function's start
+   corresponds to the "function entry point" - and hence is redundant. */
+
+extern CORE_ADDR gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_function_start_offset);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FUNCTION_START_OFFSET)
+#error "Non multi-arch definition of DEPRECATED_FUNCTION_START_OFFSET"
 #endif
-#if !defined (FUNCTION_START_OFFSET)
-#define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
+#if !defined (DEPRECATED_FUNCTION_START_OFFSET)
+#define DEPRECATED_FUNCTION_START_OFFSET (gdbarch_deprecated_function_start_offset (current_gdbarch))
 #endif
 
 typedef void (gdbarch_remote_translate_xfer_address_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
@@ -1657,7 +1362,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P)
 #error "Non multi-arch definition of DEPRECATED_FRAMELESS_FUNCTION_INVOCATION"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P)
+#if !defined (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P)
 #define DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P() (gdbarch_deprecated_frameless_function_invocation_p (current_gdbarch))
 #endif
 
@@ -1682,7 +1387,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_P)
 #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_P)
+#if !defined (DEPRECATED_FRAME_CHAIN_P)
 #define DEPRECATED_FRAME_CHAIN_P() (gdbarch_deprecated_frame_chain_p (current_gdbarch))
 #endif
 
@@ -1707,7 +1412,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_CHAIN_VALID_P)
 #error "Non multi-arch definition of DEPRECATED_FRAME_CHAIN_VALID"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
+#if !defined (DEPRECATED_FRAME_CHAIN_VALID_P)
 #define DEPRECATED_FRAME_CHAIN_VALID_P() (gdbarch_deprecated_frame_chain_valid_p (current_gdbarch))
 #endif
 
@@ -1736,7 +1441,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC_P)
 #error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC_P)
+#if !defined (DEPRECATED_FRAME_SAVED_PC_P)
 #define DEPRECATED_FRAME_SAVED_PC_P() (gdbarch_deprecated_frame_saved_pc_p (current_gdbarch))
 #endif
 
@@ -1776,7 +1481,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_ARGS_ADDRESS_P)
 #error "Non multi-arch definition of DEPRECATED_FRAME_ARGS_ADDRESS"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_ARGS_ADDRESS_P)
+#if !defined (DEPRECATED_FRAME_ARGS_ADDRESS_P)
 #define DEPRECATED_FRAME_ARGS_ADDRESS_P() (gdbarch_deprecated_frame_args_address_p (current_gdbarch))
 #endif
 
@@ -1804,7 +1509,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P)
 #error "Non multi-arch definition of DEPRECATED_FRAME_LOCALS_ADDRESS"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P)
+#if !defined (DEPRECATED_FRAME_LOCALS_ADDRESS_P)
 #define DEPRECATED_FRAME_LOCALS_ADDRESS_P() (gdbarch_deprecated_frame_locals_address_p (current_gdbarch))
 #endif
 
@@ -1829,7 +1534,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
 #error "Non multi-arch definition of DEPRECATED_SAVED_PC_AFTER_CALL"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
+#if !defined (DEPRECATED_SAVED_PC_AFTER_CALL_P)
 #define DEPRECATED_SAVED_PC_AFTER_CALL_P() (gdbarch_deprecated_saved_pc_after_call_p (current_gdbarch))
 #endif
 
@@ -1854,7 +1559,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_NUM_ARGS_P)
 #error "Non multi-arch definition of FRAME_NUM_ARGS"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_NUM_ARGS_P)
+#if !defined (FRAME_NUM_ARGS_P)
 #define FRAME_NUM_ARGS_P() (gdbarch_frame_num_args_p (current_gdbarch))
 #endif
 
@@ -1884,7 +1589,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_STACK_ALIGN_P)
 #error "Non multi-arch definition of DEPRECATED_STACK_ALIGN"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_STACK_ALIGN_P)
+#if !defined (DEPRECATED_STACK_ALIGN_P)
 #define DEPRECATED_STACK_ALIGN_P() (gdbarch_deprecated_stack_align_p (current_gdbarch))
 #endif
 
@@ -1918,7 +1623,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P)
 #error "Non multi-arch definition of DEPRECATED_REG_STRUCT_HAS_ADDR"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P)
+#if !defined (DEPRECATED_REG_STRUCT_HAS_ADDR_P)
 #define DEPRECATED_REG_STRUCT_HAS_ADDR_P() (gdbarch_deprecated_reg_struct_has_addr_p (current_gdbarch))
 #endif
 
@@ -1945,15 +1650,6 @@
 #define FRAME_RED_ZONE_SIZE (gdbarch_frame_red_zone_size (current_gdbarch))
 #endif
 
-extern int gdbarch_parm_boundary (struct gdbarch *gdbarch);
-extern void set_gdbarch_parm_boundary (struct gdbarch *gdbarch, int parm_boundary);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (PARM_BOUNDARY)
-#error "Non multi-arch definition of PARM_BOUNDARY"
-#endif
-#if !defined (PARM_BOUNDARY)
-#define PARM_BOUNDARY (gdbarch_parm_boundary (current_gdbarch))
-#endif
-
 extern const struct floatformat * gdbarch_float_format (struct gdbarch *gdbarch);
 extern void set_gdbarch_float_format (struct gdbarch *gdbarch, const struct floatformat * float_format);
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (TARGET_FLOAT_FORMAT)
@@ -2038,7 +1734,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SOFTWARE_SINGLE_STEP_P)
 #error "Non multi-arch definition of SOFTWARE_SINGLE_STEP"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SOFTWARE_SINGLE_STEP_P)
+#if !defined (SOFTWARE_SINGLE_STEP_P)
 #define SOFTWARE_SINGLE_STEP_P() (gdbarch_software_single_step_p (current_gdbarch))
 #endif
 
@@ -2109,85 +1805,6 @@
 #define IN_SOLIB_RETURN_TRAMPOLINE(pc, name) (gdbarch_in_solib_return_trampoline (current_gdbarch, pc, name))
 #endif
 
-/* NOTE: cagney/2004-03-23: DEPRECATED_SIGTRAMP_START,
-   DEPRECATED_SIGTRAMP_END, and DEPRECATED_PC_IN_SIGTRAMP have all been
-   superseeded by signal trampoline frame sniffers. */
-
-#if defined (DEPRECATED_PC_IN_SIGTRAMP)
-/* Legacy for systems yet to multi-arch DEPRECATED_PC_IN_SIGTRAMP */
-#if !defined (DEPRECATED_PC_IN_SIGTRAMP_P)
-#define DEPRECATED_PC_IN_SIGTRAMP_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_pc_in_sigtramp_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_SIGTRAMP_P)
-#error "Non multi-arch definition of DEPRECATED_PC_IN_SIGTRAMP"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_PC_IN_SIGTRAMP_P)
-#define DEPRECATED_PC_IN_SIGTRAMP_P() (gdbarch_deprecated_pc_in_sigtramp_p (current_gdbarch))
-#endif
-
-typedef int (gdbarch_deprecated_pc_in_sigtramp_ftype) (CORE_ADDR pc, char *name);
-extern int gdbarch_deprecated_pc_in_sigtramp (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
-extern void set_gdbarch_deprecated_pc_in_sigtramp (struct gdbarch *gdbarch, gdbarch_deprecated_pc_in_sigtramp_ftype *deprecated_pc_in_sigtramp);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_PC_IN_SIGTRAMP)
-#error "Non multi-arch definition of DEPRECATED_PC_IN_SIGTRAMP"
-#endif
-#if !defined (DEPRECATED_PC_IN_SIGTRAMP)
-#define DEPRECATED_PC_IN_SIGTRAMP(pc, name) (gdbarch_deprecated_pc_in_sigtramp (current_gdbarch, pc, name))
-#endif
-
-#if defined (DEPRECATED_SIGTRAMP_START)
-/* Legacy for systems yet to multi-arch DEPRECATED_SIGTRAMP_START */
-#if !defined (DEPRECATED_SIGTRAMP_START_P)
-#define DEPRECATED_SIGTRAMP_START_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_sigtramp_start_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIGTRAMP_START_P)
-#error "Non multi-arch definition of DEPRECATED_SIGTRAMP_START"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SIGTRAMP_START_P)
-#define DEPRECATED_SIGTRAMP_START_P() (gdbarch_deprecated_sigtramp_start_p (current_gdbarch))
-#endif
-
-typedef CORE_ADDR (gdbarch_deprecated_sigtramp_start_ftype) (CORE_ADDR pc);
-extern CORE_ADDR gdbarch_deprecated_sigtramp_start (struct gdbarch *gdbarch, CORE_ADDR pc);
-extern void set_gdbarch_deprecated_sigtramp_start (struct gdbarch *gdbarch, gdbarch_deprecated_sigtramp_start_ftype *deprecated_sigtramp_start);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIGTRAMP_START)
-#error "Non multi-arch definition of DEPRECATED_SIGTRAMP_START"
-#endif
-#if !defined (DEPRECATED_SIGTRAMP_START)
-#define DEPRECATED_SIGTRAMP_START(pc) (gdbarch_deprecated_sigtramp_start (current_gdbarch, pc))
-#endif
-
-#if defined (DEPRECATED_SIGTRAMP_END)
-/* Legacy for systems yet to multi-arch DEPRECATED_SIGTRAMP_END */
-#if !defined (DEPRECATED_SIGTRAMP_END_P)
-#define DEPRECATED_SIGTRAMP_END_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_sigtramp_end_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIGTRAMP_END_P)
-#error "Non multi-arch definition of DEPRECATED_SIGTRAMP_END"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_SIGTRAMP_END_P)
-#define DEPRECATED_SIGTRAMP_END_P() (gdbarch_deprecated_sigtramp_end_p (current_gdbarch))
-#endif
-
-typedef CORE_ADDR (gdbarch_deprecated_sigtramp_end_ftype) (CORE_ADDR pc);
-extern CORE_ADDR gdbarch_deprecated_sigtramp_end (struct gdbarch *gdbarch, CORE_ADDR pc);
-extern void set_gdbarch_deprecated_sigtramp_end (struct gdbarch *gdbarch, gdbarch_deprecated_sigtramp_end_ftype *deprecated_sigtramp_end);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_SIGTRAMP_END)
-#error "Non multi-arch definition of DEPRECATED_SIGTRAMP_END"
-#endif
-#if !defined (DEPRECATED_SIGTRAMP_END)
-#define DEPRECATED_SIGTRAMP_END(pc) (gdbarch_deprecated_sigtramp_end (current_gdbarch, pc))
-#endif
-
 /* A target might have problems with watchpoints as soon as the stack
    frame of the current function has been destroyed.  This mostly happens
    as the first action in a funtion's epilogue.  in_function_epilogue_p()
@@ -2273,7 +1890,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (ADDRESS_CLASS_TYPE_FLAGS_P)
 #error "Non multi-arch definition of ADDRESS_CLASS_TYPE_FLAGS"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
+#if !defined (ADDRESS_CLASS_TYPE_FLAGS_P)
 #define ADDRESS_CLASS_TYPE_FLAGS_P() (gdbarch_address_class_type_flags_p (current_gdbarch))
 #endif
 
@@ -2318,7 +1935,7 @@
 #if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FETCH_POINTER_ARGUMENT_P)
 #error "Non multi-arch definition of FETCH_POINTER_ARGUMENT"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FETCH_POINTER_ARGUMENT_P)
+#if !defined (FETCH_POINTER_ARGUMENT_P)
 #define FETCH_POINTER_ARGUMENT_P() (gdbarch_fetch_pointer_argument_p (current_gdbarch))
 #endif
 
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 7292a0b..59d7f74 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -44,7 +44,7 @@
 
 
 # Format of the input table
-read="class level macro returntype function formal actual attrib staticdefault predefault postdefault invalid_p fmt print print_p description"
+read="class macro returntype function formal actual attrib staticdefault predefault postdefault invalid_p fmt print garbage_at_eol"
 
 do_read ()
 {
@@ -75,6 +75,13 @@
 EOF
 	    IFS="${OFS}"
 
+	    if test -n "${garbage_at_eol}"
+	    then
+		echo "Garbage at end-of-line in ${line}" 1>&2
+		kill $$
+		exit 1
+	    fi
+
 	    # .... and then going back through each field and strip out those
 	    # that ended up with just that space character.
 	    for r in ${read}
@@ -85,36 +92,35 @@
 		fi
 	    done
 
-	    case "${level}" in
-		1 ) gt_level=">= GDB_MULTI_ARCH_PARTIAL" ;;
-		2 ) gt_level="> GDB_MULTI_ARCH_PARTIAL" ;;
-		"" ) gt_level="> GDB_MULTI_ARCH_PARTIAL" ;;
-		* ) error "Error: bad level for ${function}" 1>&2 ; kill $$ ; exit 1 ;;
-	    esac
+	    FUNCTION=`echo ${function} | tr '[a-z]' '[A-Z]'`
+	    if test "x${macro}" = "x="
+	    then
+	        # Provide a UCASE version of function (for when there isn't MACRO)
+		macro="${FUNCTION}"
+	    elif test "${macro}" = "${FUNCTION}"
+	    then
+		echo "${function}: Specify = for macro field" 1>&2
+		kill $$
+		exit 1
+	    fi
 
+	    # Check that macro definition wasn't supplied for multi-arch
+	    case "${class}" in
+		[mM] )
+                    if test "${macro}" != ""
+		    then
+			echo "${macro}: Multi-arch yet macro" 1>&2
+			kill $$
+			exit 1
+		    fi
+	    esac
+	    
 	    case "${class}" in
 		m ) staticdefault="${predefault}" ;;
 		M ) staticdefault="0" ;;
 		* ) test "${staticdefault}" || staticdefault=0 ;;
 	    esac
 
-	    # come up with a format, use a few guesses for variables
-	    case ":${class}:${fmt}:${print}:" in
-		:[vV]::: )
-		    if [ "${returntype}" = int ]
-		    then
-			fmt="%d"
-			print="${macro}"
-		    elif [ "${returntype}" = long ]
-		    then
-			fmt="%ld"
-			print="${macro}"
-		    fi
-		    ;;
-	    esac
-	    test "${fmt}" || fmt="%ld"
-	    test "${print}" || print="(long) ${macro}"
-
 	    case "${class}" in
 	    F | V | M )
 		case "${invalid_p}" in
@@ -241,15 +247,11 @@
         # M -> multi-arch function + predicate
 	#   hiding a multi-arch function + predicate to test function validity
 
-    level ) : ;;
-
-	# See GDB_MULTI_ARCH description.  Having GDB_MULTI_ARCH >=
-	# LEVEL is a predicate on checking that a given method is
-	# initialized (using INVALID_P).
-
     macro ) : ;;
 
-	# The name of the MACRO that this method is to be accessed by.
+	# The name of the legacy C macro by which this method can be
+	# accessed.  If empty, no macro is defined.  If "=", a macro
+	# formed from the upper-case function name is used.
 
     returntype ) : ;;
 
@@ -362,20 +364,9 @@
 
 	# If PRINT is empty, ``(long)'' is used.
 
-    print_p ) : ;;
+    garbage_at_eol ) : ;;
 
-	# An optional indicator for any predicte to wrap around the
-	# print member code.
-
-	#   () -> Call a custom function to do the dump.
-	#   exp -> Wrap print up in ``if (${print_p}) ...
-	#   ``'' -> No predicate
-
-	# If PRINT_P is empty, ``1'' is always used.
-
-    description ) : ;;
-
-	# Currently unused.
+	# Catches stray fields.
 
     *)
 	echo "Bad field ${field}"
@@ -388,30 +379,30 @@
 {
   # See below (DOCO) for description of each field
   cat <<EOF
-i:2:TARGET_ARCHITECTURE:const struct bfd_arch_info *:bfd_arch_info::::&bfd_default_arch_struct::::%s:TARGET_ARCHITECTURE->printable_name:TARGET_ARCHITECTURE != NULL
+i:TARGET_ARCHITECTURE:const struct bfd_arch_info *:bfd_arch_info::::&bfd_default_arch_struct::::%s:TARGET_ARCHITECTURE->printable_name
 #
-i:2:TARGET_BYTE_ORDER:int:byte_order::::BFD_ENDIAN_BIG
+i:TARGET_BYTE_ORDER:int:byte_order::::BFD_ENDIAN_BIG
 #
-i:2:TARGET_OSABI:enum gdb_osabi:osabi::::GDB_OSABI_UNKNOWN
+i:TARGET_OSABI:enum gdb_osabi:osabi::::GDB_OSABI_UNKNOWN
 # Number of bits in a char or unsigned char for the target machine.
 # Just like CHAR_BIT in <limits.h> but describes the target machine.
-# v:2:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
+# v:TARGET_CHAR_BIT:int:char_bit::::8 * sizeof (char):8::0:
 #
 # Number of bits in a short or unsigned short for the target machine.
-v:2:TARGET_SHORT_BIT:int:short_bit::::8 * sizeof (short):2*TARGET_CHAR_BIT::0
+v:TARGET_SHORT_BIT:int:short_bit::::8 * sizeof (short):2*TARGET_CHAR_BIT::0
 # Number of bits in an int or unsigned int for the target machine.
-v:2:TARGET_INT_BIT:int:int_bit::::8 * sizeof (int):4*TARGET_CHAR_BIT::0
+v:TARGET_INT_BIT:int:int_bit::::8 * sizeof (int):4*TARGET_CHAR_BIT::0
 # Number of bits in a long or unsigned long for the target machine.
-v:2:TARGET_LONG_BIT:int:long_bit::::8 * sizeof (long):4*TARGET_CHAR_BIT::0
+v:TARGET_LONG_BIT:int:long_bit::::8 * sizeof (long):4*TARGET_CHAR_BIT::0
 # Number of bits in a long long or unsigned long long for the target
 # machine.
-v:2:TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):2*TARGET_LONG_BIT::0
+v:TARGET_LONG_LONG_BIT:int:long_long_bit::::8 * sizeof (LONGEST):2*TARGET_LONG_BIT::0
 # Number of bits in a float for the target machine.
-v:2:TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):4*TARGET_CHAR_BIT::0
+v:TARGET_FLOAT_BIT:int:float_bit::::8 * sizeof (float):4*TARGET_CHAR_BIT::0
 # Number of bits in a double for the target machine.
-v:2:TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):8*TARGET_CHAR_BIT::0
+v:TARGET_DOUBLE_BIT:int:double_bit::::8 * sizeof (double):8*TARGET_CHAR_BIT::0
 # Number of bits in a long double for the target machine.
-v:2:TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):8*TARGET_CHAR_BIT::0
+v:TARGET_LONG_DOUBLE_BIT:int:long_double_bit::::8 * sizeof (long double):8*TARGET_CHAR_BIT::0
 # For most targets, a pointer on the target and its representation as an
 # address in GDB have the same size and "look the same".  For such a
 # target, you need only set TARGET_PTR_BIT / ptr_bit and TARGET_ADDR_BIT
@@ -421,60 +412,60 @@
 # also need to set POINTER_TO_ADDRESS and ADDRESS_TO_POINTER as well.
 #
 # ptr_bit is the size of a pointer on the target
-v:2:TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):TARGET_INT_BIT::0
+v:TARGET_PTR_BIT:int:ptr_bit::::8 * sizeof (void*):TARGET_INT_BIT::0
 # addr_bit is the size of a target address as represented in gdb
-v:2:TARGET_ADDR_BIT:int:addr_bit::::8 * sizeof (void*):0:TARGET_PTR_BIT:
+v:TARGET_ADDR_BIT:int:addr_bit::::8 * sizeof (void*):0:TARGET_PTR_BIT:
 # Number of bits in a BFD_VMA for the target object file format.
-v:2:TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
+v:TARGET_BFD_VMA_BIT:int:bfd_vma_bit::::8 * sizeof (void*):TARGET_ARCHITECTURE->bits_per_address::0
 #
 # One if \`char' acts like \`signed char', zero if \`unsigned char'.
-v:2:TARGET_CHAR_SIGNED:int:char_signed::::1:-1:1::::
+v:TARGET_CHAR_SIGNED:int:char_signed::::1:-1:1::::
 #
-F:2:TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid
-f:2:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0
+F:TARGET_READ_PC:CORE_ADDR:read_pc:ptid_t ptid:ptid
+f:TARGET_WRITE_PC:void:write_pc:CORE_ADDR val, ptid_t ptid:val, ptid::0:generic_target_write_pc::0
 # UNWIND_SP is a direct replacement for TARGET_READ_SP.
-F:2:TARGET_READ_SP:CORE_ADDR:read_sp:void
+F:TARGET_READ_SP:CORE_ADDR:read_sp:void
 # Function for getting target's idea of a frame pointer.  FIXME: GDB's
 # whole scheme for dealing with "frames" and "frame pointers" needs a
 # serious shakedown.
-f:2:TARGET_VIRTUAL_FRAME_POINTER:void:virtual_frame_pointer:CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset:pc, frame_regnum, frame_offset::0:legacy_virtual_frame_pointer::0
+f:TARGET_VIRTUAL_FRAME_POINTER:void:virtual_frame_pointer:CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset:pc, frame_regnum, frame_offset::0:legacy_virtual_frame_pointer::0
 #
-M:::void:pseudo_register_read:struct regcache *regcache, int cookednum, void *buf:regcache, cookednum, buf
-M:::void:pseudo_register_write:struct regcache *regcache, int cookednum, const void *buf:regcache, cookednum, buf
+M::void:pseudo_register_read:struct regcache *regcache, int cookednum, void *buf:regcache, cookednum, buf
+M::void:pseudo_register_write:struct regcache *regcache, int cookednum, const void *buf:regcache, cookednum, buf
 #
-v:2:NUM_REGS:int:num_regs::::0:-1
+v:=:int:num_regs::::0:-1
 # This macro gives the number of pseudo-registers that live in the
 # register namespace but do not get fetched or stored on the target.
 # These pseudo-registers may be aliases for other registers,
 # combinations of other registers, or they may be computed by GDB.
-v:2:NUM_PSEUDO_REGS:int:num_pseudo_regs::::0:0::0:::
+v:=:int:num_pseudo_regs::::0:0::0:::
 
 # GDB's standard (or well known) register numbers.  These can map onto
 # a real register or a pseudo (computed) register or not be defined at
 # all (-1).
 # SP_REGNUM will hopefully be replaced by UNWIND_SP.
-v:2:SP_REGNUM:int:sp_regnum::::-1:-1::0
-v:2:PC_REGNUM:int:pc_regnum::::-1:-1::0
-v:2:PS_REGNUM:int:ps_regnum::::-1:-1::0
-v:2:FP0_REGNUM:int:fp0_regnum::::0:-1::0
+v:=:int:sp_regnum::::-1:-1::0
+v:=:int:pc_regnum::::-1:-1::0
+v:=:int:ps_regnum::::-1:-1::0
+v:=:int:fp0_regnum::::0:-1::0
 # Convert stab register number (from \`r\' declaration) to a gdb REGNUM.
-f:2:STAB_REG_TO_REGNUM:int:stab_reg_to_regnum:int stab_regnr:stab_regnr:::no_op_reg_to_regnum::0
+f:=:int:stab_reg_to_regnum:int stab_regnr:stab_regnr:::no_op_reg_to_regnum::0
 # Provide a default mapping from a ecoff register number to a gdb REGNUM.
-f:2:ECOFF_REG_TO_REGNUM:int:ecoff_reg_to_regnum:int ecoff_regnr:ecoff_regnr:::no_op_reg_to_regnum::0
+f:=:int:ecoff_reg_to_regnum:int ecoff_regnr:ecoff_regnr:::no_op_reg_to_regnum::0
 # Provide a default mapping from a DWARF register number to a gdb REGNUM.
-f:2:DWARF_REG_TO_REGNUM:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr:::no_op_reg_to_regnum::0
+f:=:int:dwarf_reg_to_regnum:int dwarf_regnr:dwarf_regnr:::no_op_reg_to_regnum::0
 # Convert from an sdb register number to an internal gdb register number.
-f:2:SDB_REG_TO_REGNUM:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_to_regnum::0
-f:2:DWARF2_REG_TO_REGNUM:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0
-f::REGISTER_NAME:const char *:register_name:int regnr:regnr
+f:=:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr:::no_op_reg_to_regnum::0
+f:=:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr:::no_op_reg_to_regnum::0
+f:=:const char *:register_name:int regnr:regnr
 
 # REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE.
-M:2:REGISTER_TYPE:struct type *:register_type:int reg_nr:reg_nr
+M::struct type *:register_type:int reg_nr:reg_nr
 # REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE.
-F:2:DEPRECATED_REGISTER_VIRTUAL_TYPE:struct type *:deprecated_register_virtual_type:int reg_nr:reg_nr
+F:=:struct type *:deprecated_register_virtual_type:int reg_nr:reg_nr
 # DEPRECATED_REGISTER_BYTES can be deleted.  The value is computed
 # from REGISTER_TYPE.
-v::DEPRECATED_REGISTER_BYTES:int:deprecated_register_bytes
+v:=:int:deprecated_register_bytes
 # If the value returned by DEPRECATED_REGISTER_BYTE agrees with the
 # register offsets computed using just REGISTER_TYPE, this can be
 # deleted.  See: maint print registers.  NOTE: cagney/2002-05-02: This
@@ -482,132 +473,94 @@
 # consequence, even when the predicate is false, the corresponding
 # function works.  This simplifies the migration process - old code,
 # calling DEPRECATED_REGISTER_BYTE, doesn't need to be modified.
-F::DEPRECATED_REGISTER_BYTE:int:deprecated_register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte
+F:=:int:deprecated_register_byte:int reg_nr:reg_nr::generic_register_byte:generic_register_byte
 # If all registers have identical raw and virtual sizes and those
 # sizes agree with the value computed from REGISTER_TYPE,
 # DEPRECATED_REGISTER_RAW_SIZE can be deleted.  See: maint print
 # registers.
-F:2:DEPRECATED_REGISTER_RAW_SIZE:int:deprecated_register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size
+F:=:int:deprecated_register_raw_size:int reg_nr:reg_nr::generic_register_size:generic_register_size
 # If all registers have identical raw and virtual sizes and those
 # sizes agree with the value computed from REGISTER_TYPE,
 # DEPRECATED_REGISTER_VIRTUAL_SIZE can be deleted.  See: maint print
 # registers.
-F:2:DEPRECATED_REGISTER_VIRTUAL_SIZE:int:deprecated_register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size
-# DEPRECATED_MAX_REGISTER_RAW_SIZE can be deleted.  It has been
-# replaced by the constant MAX_REGISTER_SIZE.
-V:2:DEPRECATED_MAX_REGISTER_RAW_SIZE:int:deprecated_max_register_raw_size
-# DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE can be deleted.  It has been
-# replaced by the constant MAX_REGISTER_SIZE.
-V:2:DEPRECATED_MAX_REGISTER_VIRTUAL_SIZE:int:deprecated_max_register_virtual_size
+F:=:int:deprecated_register_virtual_size:int reg_nr:reg_nr::generic_register_size:generic_register_size
 
 # See gdbint.texinfo, and PUSH_DUMMY_CALL.
-M::UNWIND_DUMMY_ID:struct frame_id:unwind_dummy_id:struct frame_info *info:info
+M::struct frame_id:unwind_dummy_id:struct frame_info *info:info
 # Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete
 # SAVE_DUMMY_FRAME_TOS.
-F:2:DEPRECATED_SAVE_DUMMY_FRAME_TOS:void:deprecated_save_dummy_frame_tos:CORE_ADDR sp:sp
+F:=:void:deprecated_save_dummy_frame_tos:CORE_ADDR sp:sp
 # Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete
 # DEPRECATED_FP_REGNUM.
-v:2:DEPRECATED_FP_REGNUM:int:deprecated_fp_regnum::::-1:-1::0
+v:=:int:deprecated_fp_regnum::::-1:-1::0
 # Implement UNWIND_DUMMY_ID and PUSH_DUMMY_CALL, then delete
 # DEPRECATED_TARGET_READ_FP.
-F::DEPRECATED_TARGET_READ_FP:CORE_ADDR:deprecated_target_read_fp:void
+F:=:CORE_ADDR:deprecated_target_read_fp:void
 
 # See gdbint.texinfo.  See infcall.c.  New, all singing all dancing,
 # replacement for DEPRECATED_PUSH_ARGUMENTS.
-M::PUSH_DUMMY_CALL:CORE_ADDR:push_dummy_call:CORE_ADDR func_addr, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:func_addr, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr
+M::CORE_ADDR:push_dummy_call:struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr
 # PUSH_DUMMY_CALL is a direct replacement for DEPRECATED_PUSH_ARGUMENTS.
-F:2:DEPRECATED_PUSH_ARGUMENTS:CORE_ADDR:deprecated_push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr
-# DEPRECATED_USE_GENERIC_DUMMY_FRAMES can be deleted.  Always true.
-v::DEPRECATED_USE_GENERIC_DUMMY_FRAMES:int:deprecated_use_generic_dummy_frames:::::1::0
+F:=:CORE_ADDR:deprecated_push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr
 # Implement PUSH_RETURN_ADDRESS, and then merge in
 # DEPRECATED_PUSH_RETURN_ADDRESS.
-F:2:DEPRECATED_PUSH_RETURN_ADDRESS:CORE_ADDR:deprecated_push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp
+F:=:CORE_ADDR:deprecated_push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp
 # Implement PUSH_DUMMY_CALL, then merge in DEPRECATED_DUMMY_WRITE_SP.
-F:2:DEPRECATED_DUMMY_WRITE_SP:void:deprecated_dummy_write_sp:CORE_ADDR val:val
+F:=:void:deprecated_dummy_write_sp:CORE_ADDR val:val
 # DEPRECATED_REGISTER_SIZE can be deleted.
-v::DEPRECATED_REGISTER_SIZE:int:deprecated_register_size
-v::CALL_DUMMY_LOCATION:int:call_dummy_location:::::AT_ENTRY_POINT::0
-# DEPRECATED_CALL_DUMMY_START_OFFSET can be deleted.
-v::DEPRECATED_CALL_DUMMY_START_OFFSET:CORE_ADDR:deprecated_call_dummy_start_offset
-# DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET can be deleted.
-v::DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET:CORE_ADDR:deprecated_call_dummy_breakpoint_offset
-# DEPRECATED_CALL_DUMMY_LENGTH can be deleted.
-v::DEPRECATED_CALL_DUMMY_LENGTH:int:deprecated_call_dummy_length
-# DEPRECATED_CALL_DUMMY_WORDS can be deleted.
-v::DEPRECATED_CALL_DUMMY_WORDS:LONGEST *:deprecated_call_dummy_words::::0:legacy_call_dummy_words::0:0x%08lx
-# Implement PUSH_DUMMY_CALL, then delete DEPRECATED_SIZEOF_CALL_DUMMY_WORDS.
-v::DEPRECATED_SIZEOF_CALL_DUMMY_WORDS:int:deprecated_sizeof_call_dummy_words::::0:legacy_sizeof_call_dummy_words::0
-# DEPRECATED_FIX_CALL_DUMMY can be deleted.  For the SPARC, implement
-# PUSH_DUMMY_CODE and set CALL_DUMMY_LOCATION to ON_STACK.
-F::DEPRECATED_FIX_CALL_DUMMY:void:deprecated_fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p
-# This is a replacement for DEPRECATED_FIX_CALL_DUMMY et.al.
-M::PUSH_DUMMY_CODE:CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr
-# Implement PUSH_DUMMY_CALL, then delete DEPRECATED_PUSH_DUMMY_FRAME.
-F:2:DEPRECATED_PUSH_DUMMY_FRAME:void:deprecated_push_dummy_frame:void:-
+v:=:int:deprecated_register_size
+v:=:int:call_dummy_location:::::AT_ENTRY_POINT::0
+M::CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr
 
-F:2:DEPRECATED_DO_REGISTERS_INFO:void:deprecated_do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs
-m:2:PRINT_REGISTERS_INFO:void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all:::default_print_registers_info::0
-M:2:PRINT_FLOAT_INFO:void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
-M:2:PRINT_VECTOR_INFO:void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
+F:=:void:deprecated_do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs
+m::void:print_registers_info:struct ui_file *file, struct frame_info *frame, int regnum, int all:file, frame, regnum, all:::default_print_registers_info::0
+M::void:print_float_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
+M::void:print_vector_info:struct ui_file *file, struct frame_info *frame, const char *args:file, frame, args
 # MAP a GDB RAW register number onto a simulator register number.  See
 # also include/...-sim.h.
-f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::legacy_register_sim_regno::0
-F:2:REGISTER_BYTES_OK:int:register_bytes_ok:long nr_bytes:nr_bytes
-f:2:CANNOT_FETCH_REGISTER:int:cannot_fetch_register:int regnum:regnum:::cannot_register_not::0
-f:2:CANNOT_STORE_REGISTER:int:cannot_store_register:int regnum:regnum:::cannot_register_not::0
+f:=:int:register_sim_regno:int reg_nr:reg_nr:::legacy_register_sim_regno::0
+F:=:int:register_bytes_ok:long nr_bytes:nr_bytes
+f:=:int:cannot_fetch_register:int regnum:regnum:::cannot_register_not::0
+f:=:int:cannot_store_register:int regnum:regnum:::cannot_register_not::0
 # setjmp/longjmp support.
-F:2:GET_LONGJMP_TARGET:int:get_longjmp_target:CORE_ADDR *pc:pc
-# NOTE: cagney/2002-11-24: This function with predicate has a valid
-# (callable) initial value.  As a consequence, even when the predicate
-# is false, the corresponding function works.  This simplifies the
-# migration process - old code, calling DEPRECATED_PC_IN_CALL_DUMMY(),
-# doesn't need to be modified.
-F::DEPRECATED_PC_IN_CALL_DUMMY:int:deprecated_pc_in_call_dummy:CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address:pc, sp, frame_address::deprecated_pc_in_call_dummy:deprecated_pc_in_call_dummy
-F:2:DEPRECATED_INIT_FRAME_PC_FIRST:CORE_ADDR:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
-F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
+F:=:int:get_longjmp_target:CORE_ADDR *pc:pc
+F:=:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev
 #
-v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
-v::BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
-F:2:DEPRECATED_GET_SAVED_REGISTER:void:deprecated_get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
+v:=:int:believe_pcc_promotion:::::::
+F:=:void:deprecated_get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
 #
-# For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
-# For raw <-> cooked register conversions, replaced by pseudo registers.
-F::DEPRECATED_REGISTER_CONVERTIBLE:int:deprecated_register_convertible:int nr:nr
-# For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
-# For raw <-> cooked register conversions, replaced by pseudo registers.
-f:2:DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL:void:deprecated_register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
-# For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
-# For raw <-> cooked register conversions, replaced by pseudo registers.
-f:2:DEPRECATED_REGISTER_CONVERT_TO_RAW:void:deprecated_register_convert_to_raw:struct type *type, int regnum, const char *from, char *to:type, regnum, from, to:::0::0
+f:=:int:convert_register_p:int regnum, struct type *type:regnum, type::0:generic_convert_register_p::0
+f:=:void:register_to_value:struct frame_info *frame, int regnum, struct type *type, void *buf:frame, regnum, type, buf::0
+f:=:void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const void *buf:frame, regnum, type, buf::0
 #
-f:1:CONVERT_REGISTER_P:int:convert_register_p:int regnum, struct type *type:regnum, type::0:legacy_convert_register_p::0
-f:1:REGISTER_TO_VALUE:void:register_to_value:struct frame_info *frame, int regnum, struct type *type, void *buf:frame, regnum, type, buf::0:legacy_register_to_value::0
-f:1:VALUE_TO_REGISTER:void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const void *buf:frame, regnum, type, buf::0:legacy_value_to_register::0
+f:=:CORE_ADDR:pointer_to_address:struct type *type, const void *buf:type, buf:::unsigned_pointer_to_address::0
+f:=:void:address_to_pointer:struct type *type, void *buf, CORE_ADDR addr:type, buf, addr:::unsigned_address_to_pointer::0
+F:=:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf
 #
-f:2:POINTER_TO_ADDRESS:CORE_ADDR:pointer_to_address:struct type *type, const void *buf:type, buf:::unsigned_pointer_to_address::0
-f:2:ADDRESS_TO_POINTER:void:address_to_pointer:struct type *type, void *buf, CORE_ADDR addr:type, buf, addr:::unsigned_address_to_pointer::0
-F:2:INTEGER_TO_ADDRESS:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf
-#
-F:2:DEPRECATED_POP_FRAME:void:deprecated_pop_frame:void:-
+F:=:void:deprecated_pop_frame:void:-
 # NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS.
-F:2:DEPRECATED_STORE_STRUCT_RETURN:void:deprecated_store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp
+F:=:void:deprecated_store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp
 
 # It has been suggested that this, well actually its predecessor,
 # should take the type/value of the function to be called and not the
 # return type.  This is left as an exercise for the reader.
 
-M:::enum return_value_convention:return_value:struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf:valtype, regcache, readbuf, writebuf
+# NOTE: cagney/2004-06-13: The function stack.c:return_command uses
+# the predicate with default hack to avoid calling STORE_RETURN_VALUE
+# (via legacy_return_value), when a small struct is involved.
 
-# The deprecated methods RETURN_VALUE_ON_STACK, EXTRACT_RETURN_VALUE,
-# STORE_RETURN_VALUE and USE_STRUCT_CONVENTION have all been folded
-# into RETURN_VALUE.
+M::enum return_value_convention:return_value:struct type *valtype, struct regcache *regcache, void *readbuf, const void *writebuf:valtype, regcache, readbuf, writebuf:::legacy_return_value
 
-f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::generic_return_value_on_stack_not::0
-f:2:EXTRACT_RETURN_VALUE:void:extract_return_value:struct type *type, struct regcache *regcache, void *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0
-f:2:STORE_RETURN_VALUE:void:store_return_value:struct type *type, struct regcache *regcache, const void *valbuf:type, regcache, valbuf:::legacy_store_return_value::0
-f:2:DEPRECATED_EXTRACT_RETURN_VALUE:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf
-f:2:DEPRECATED_STORE_RETURN_VALUE:void:deprecated_store_return_value:struct type *type, char *valbuf:type, valbuf
-f:2:USE_STRUCT_CONVENTION:int:use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0
+# The deprecated methods EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE,
+# DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS and
+# DEPRECATED_USE_STRUCT_CONVENTION have all been folded into
+# RETURN_VALUE.
+
+f:=:void:extract_return_value:struct type *type, struct regcache *regcache, void *valbuf:type, regcache, valbuf:::legacy_extract_return_value::0
+f:=:void:store_return_value:struct type *type, struct regcache *regcache, const void *valbuf:type, regcache, valbuf:::legacy_store_return_value::0
+f:=:void:deprecated_extract_return_value:struct type *type, char *regbuf, char *valbuf:type, regbuf, valbuf
+f:=:void:deprecated_store_return_value:struct type *type, char *valbuf:type, valbuf
+f:=:int:deprecated_use_struct_convention:int gcc_p, struct type *value_type:gcc_p, value_type:::generic_use_struct_convention::0
 
 # As of 2004-01-17 only the 32-bit SPARC ABI has been identified as an
 # ABI suitable for the implementation of a robust extract
@@ -627,62 +580,70 @@
 # frame since it is only after the callee has returned that this
 # function is used.
 
-#M:::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame
-F:2:DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS:CORE_ADDR:deprecated_extract_struct_value_address:struct regcache *regcache:regcache
+#M::CORE_ADDR:extract_returned_value_address:struct frame_info *caller_frame:caller_frame
+F:=:CORE_ADDR:deprecated_extract_struct_value_address:struct regcache *regcache:regcache
 
-F:2:DEPRECATED_FRAME_INIT_SAVED_REGS:void:deprecated_frame_init_saved_regs:struct frame_info *frame:frame
-F:2:DEPRECATED_INIT_EXTRA_FRAME_INFO:void:deprecated_init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame
+F:=:void:deprecated_frame_init_saved_regs:struct frame_info *frame:frame
+F:=:void:deprecated_init_extra_frame_info:int fromleaf, struct frame_info *frame:fromleaf, frame
 #
-f:2:SKIP_PROLOGUE:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
-f:2:INNER_THAN:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0
-f::BREAKPOINT_FROM_PC:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::0:
-M:2:ADJUST_BREAKPOINT_ADDRESS:CORE_ADDR:adjust_breakpoint_address:CORE_ADDR bpaddr:bpaddr
-f:2:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0
-f:2:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0
-v:2:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:::0
-v:2:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:::0
+f:=:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip::0:0
+f:=:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs::0:0
+f:=:const unsigned char *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr:::0:
+M::CORE_ADDR:adjust_breakpoint_address:CORE_ADDR bpaddr:bpaddr
+f:=:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0
+f:=:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0
+v:=:CORE_ADDR:decr_pc_after_break::::0:::0
+
+# A function can be addressed by either it's "pointer" (possibly a
+# descriptor address) or "entry point" (first executable instruction).
+# The method "convert_from_func_ptr_addr" converting the former to the
+# latter.  DEPRECATED_FUNCTION_START_OFFSET is being used to implement
+# a simplified subset of that functionality - the function's address
+# corresponds to the "function pointer" and the function's start
+# corresponds to the "function entry point" - and hence is redundant.
+
+v:=:CORE_ADDR:deprecated_function_start_offset::::0:::0
+
+m::void:remote_translate_xfer_address:struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:regcache, gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
 #
-m::REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:regcache, gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
-#
-v::FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:::0
+v:=:CORE_ADDR:frame_args_skip::::0:::0
 # DEPRECATED_FRAMELESS_FUNCTION_INVOCATION is not needed.  The new
 # frame code works regardless of the type of frame - frameless,
 # stackless, or normal.
-F::DEPRECATED_FRAMELESS_FUNCTION_INVOCATION:int:deprecated_frameless_function_invocation:struct frame_info *fi:fi
-F:2:DEPRECATED_FRAME_CHAIN:CORE_ADDR:deprecated_frame_chain:struct frame_info *frame:frame
-F:2:DEPRECATED_FRAME_CHAIN_VALID:int:deprecated_frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe
+F:=:int:deprecated_frameless_function_invocation:struct frame_info *fi:fi
+F:=:CORE_ADDR:deprecated_frame_chain:struct frame_info *frame:frame
+F:=:int:deprecated_frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe
 # DEPRECATED_FRAME_SAVED_PC has been replaced by UNWIND_PC.  Please
 # note, per UNWIND_PC's doco, that while the two have similar
 # interfaces they have very different underlying implementations.
-F:2:DEPRECATED_FRAME_SAVED_PC:CORE_ADDR:deprecated_frame_saved_pc:struct frame_info *fi:fi
-M::UNWIND_PC:CORE_ADDR:unwind_pc:struct frame_info *next_frame:next_frame
-M::UNWIND_SP:CORE_ADDR:unwind_sp:struct frame_info *next_frame:next_frame
+F:=:CORE_ADDR:deprecated_frame_saved_pc:struct frame_info *fi:fi
+M::CORE_ADDR:unwind_pc:struct frame_info *next_frame:next_frame
+M::CORE_ADDR:unwind_sp:struct frame_info *next_frame:next_frame
 # DEPRECATED_FRAME_ARGS_ADDRESS as been replaced by the per-frame
 # frame-base.  Enable frame-base before frame-unwind.
-F::DEPRECATED_FRAME_ARGS_ADDRESS:CORE_ADDR:deprecated_frame_args_address:struct frame_info *fi:fi::get_frame_base:get_frame_base
+F:=:CORE_ADDR:deprecated_frame_args_address:struct frame_info *fi:fi::get_frame_base:get_frame_base
 # DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
 # frame-base.  Enable frame-base before frame-unwind.
-F::DEPRECATED_FRAME_LOCALS_ADDRESS:CORE_ADDR:deprecated_frame_locals_address:struct frame_info *fi:fi::get_frame_base:get_frame_base
-F::DEPRECATED_SAVED_PC_AFTER_CALL:CORE_ADDR:deprecated_saved_pc_after_call:struct frame_info *frame:frame
-F:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame
+F:=:CORE_ADDR:deprecated_frame_locals_address:struct frame_info *fi:fi::get_frame_base:get_frame_base
+F:=:CORE_ADDR:deprecated_saved_pc_after_call:struct frame_info *frame:frame
+F:=:int:frame_num_args:struct frame_info *frame:frame
 #
 # DEPRECATED_STACK_ALIGN has been replaced by an initial aligning call
 # to frame_align and the requirement that methods such as
 # push_dummy_call and frame_red_zone_size maintain correct stack/frame
 # alignment.
-F:2:DEPRECATED_STACK_ALIGN:CORE_ADDR:deprecated_stack_align:CORE_ADDR sp:sp
-M:::CORE_ADDR:frame_align:CORE_ADDR address:address
+F:=:CORE_ADDR:deprecated_stack_align:CORE_ADDR sp:sp
+M::CORE_ADDR:frame_align:CORE_ADDR address:address
 # DEPRECATED_REG_STRUCT_HAS_ADDR has been replaced by
 # stabs_argument_has_addr.
-F:2:DEPRECATED_REG_STRUCT_HAS_ADDR:int:deprecated_reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type
-m:::int:stabs_argument_has_addr:struct type *type:type:::default_stabs_argument_has_addr::0
-v::FRAME_RED_ZONE_SIZE:int:frame_red_zone_size
-v:2:PARM_BOUNDARY:int:parm_boundary
+F:=:int:deprecated_reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type
+m::int:stabs_argument_has_addr:struct type *type:type:::default_stabs_argument_has_addr::0
+v:=:int:frame_red_zone_size
 #
-v:2:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (current_gdbarch)::%s:(TARGET_FLOAT_FORMAT)->name
-v:2:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (current_gdbarch)::%s:(TARGET_DOUBLE_FORMAT)->name
-v:2:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::default_double_format (current_gdbarch)::%s:(TARGET_LONG_DOUBLE_FORMAT)->name
-m:::CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr, struct target_ops *targ:addr, targ:::convert_from_func_ptr_addr_identity::0
+v:TARGET_FLOAT_FORMAT:const struct floatformat *:float_format::::::default_float_format (current_gdbarch)::%s:(TARGET_FLOAT_FORMAT)->name
+v:TARGET_DOUBLE_FORMAT:const struct floatformat *:double_format::::::default_double_format (current_gdbarch)::%s:(TARGET_DOUBLE_FORMAT)->name
+v:TARGET_LONG_DOUBLE_FORMAT:const struct floatformat *:long_double_format::::::default_double_format (current_gdbarch)::%s:(TARGET_LONG_DOUBLE_FORMAT)->name
+m::CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr, struct target_ops *targ:addr, targ:::convert_from_func_ptr_addr_identity::0
 # On some machines there are bits in addresses which are not really
 # part of the address, but are used by the kernel, the hardware, etc.
 # for special purposes.  ADDR_BITS_REMOVE takes out any such bits so
@@ -692,10 +653,10 @@
 # being a few stray bits in the PC which would mislead us, not as some
 # sort of generic thing to handle alignment or segmentation (it's
 # possible it should be in TARGET_READ_PC instead).
-f:2:ADDR_BITS_REMOVE:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr:::core_addr_identity::0
+f:=:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr:::core_addr_identity::0
 # It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
 # ADDR_BITS_REMOVE.
-f:2:SMASH_TEXT_ADDRESS:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr:::core_addr_identity::0
+f:=:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr:::core_addr_identity::0
 # FIXME/cagney/2001-01-18: This should be split in two.  A target method that indicates if
 # the target needs software single step.  An ISA method to implement it.
 #
@@ -704,31 +665,25 @@
 #
 # FIXME/cagney/2001-01-18: The logic is backwards.  It should be asking if the target can
 # single step.  If not, then implement single step using breakpoints.
-F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p
+F:=:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p
 # FIXME: cagney/2003-08-28: Need to find a better way of selecting the
 # disassembler.  Perhaphs objdump can handle it?
-f::TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, struct disassemble_info *info:vma, info:::0:
-f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0
+f:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, struct disassemble_info *info:vma, info:::0:
+f:=:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0
 
 
 # If IN_SOLIB_DYNSYM_RESOLVE_CODE returns true, and SKIP_SOLIB_RESOLVER
 # evaluates non-zero, this is the address where the debugger will place
 # a step-resume breakpoint to get us past the dynamic linker.
-m:2:SKIP_SOLIB_RESOLVER:CORE_ADDR:skip_solib_resolver:CORE_ADDR pc:pc:::generic_skip_solib_resolver::0
+m::CORE_ADDR:skip_solib_resolver:CORE_ADDR pc:pc:::generic_skip_solib_resolver::0
 # For SVR4 shared libraries, each call goes through a small piece of
 # trampoline code in the ".plt" section.  IN_SOLIB_CALL_TRAMPOLINE evaluates
 # to nonzero if we are currently stopped in one of these.
-f:2:IN_SOLIB_CALL_TRAMPOLINE:int:in_solib_call_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_call_trampoline::0
+f:=:int:in_solib_call_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_call_trampoline::0
 
 # Some systems also have trampoline code for returning from shared libs.
-f:2:IN_SOLIB_RETURN_TRAMPOLINE:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_return_trampoline::0
+f:=:int:in_solib_return_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_return_trampoline::0
 
-# NOTE: cagney/2004-03-23: DEPRECATED_SIGTRAMP_START,
-# DEPRECATED_SIGTRAMP_END, and DEPRECATED_PC_IN_SIGTRAMP have all been
-# superseeded by signal trampoline frame sniffers.
-F::DEPRECATED_PC_IN_SIGTRAMP:int:deprecated_pc_in_sigtramp:CORE_ADDR pc, char *name:pc, name:::legacy_pc_in_sigtramp
-F:2:DEPRECATED_SIGTRAMP_START:CORE_ADDR:deprecated_sigtramp_start:CORE_ADDR pc:pc
-F:2:DEPRECATED_SIGTRAMP_END:CORE_ADDR:deprecated_sigtramp_end:CORE_ADDR pc:pc
 # A target might have problems with watchpoints as soon as the stack
 # frame of the current function has been destroyed.  This mostly happens
 # as the first action in a funtion's epilogue.  in_function_epilogue_p()
@@ -738,7 +693,7 @@
 # already been invalidated regardless of the value of addr.  Targets
 # which don't suffer from that problem could just let this functionality
 # untouched.
-m:::int:in_function_epilogue_p:CORE_ADDR addr:addr::0:generic_in_function_epilogue_p::0
+m::int:in_function_epilogue_p:CORE_ADDR addr:addr::0:generic_in_function_epilogue_p::0
 # Given a vector of command-line arguments, return a newly allocated
 # string which, when passed to the create_inferior function, will be
 # parsed (on Unix systems, by the shell) to yield the same vector.
@@ -747,23 +702,23 @@
 # command-line arguments.
 # ARGC is the number of elements in the vector.
 # ARGV is an array of strings, one per argument.
-m::CONSTRUCT_INFERIOR_ARGUMENTS:char *:construct_inferior_arguments:int argc, char **argv:argc, argv:::construct_inferior_arguments::0
-f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0
-f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0
-v:2:NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0:%s:NAME_OF_MALLOC
-v:2:CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0
-v:2:HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0
-F:2:ADDRESS_CLASS_TYPE_FLAGS:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class
-M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:const char *:address_class_type_flags_to_name:int type_flags:type_flags
-M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:const char *name, int *type_flags_ptr:name, type_flags_ptr
+m::char *:construct_inferior_arguments:int argc, char **argv:argc, argv:::construct_inferior_arguments::0
+f:=:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0
+f:=:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0
+v:=:const char *:name_of_malloc::::"malloc":"malloc"::0:%s:NAME_OF_MALLOC
+v:=:int:cannot_step_breakpoint::::0:0::0
+v:=:int:have_nonsteppable_watchpoint::::0:0::0
+F:=:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class
+M::const char *:address_class_type_flags_to_name:int type_flags:type_flags
+M::int:address_class_name_to_type_flags:const char *name, int *type_flags_ptr:name, type_flags_ptr
 # Is a register in a group
-m:::int:register_reggroup_p:int regnum, struct reggroup *reggroup:regnum, reggroup:::default_register_reggroup_p::0
+m::int:register_reggroup_p:int regnum, struct reggroup *reggroup:regnum, reggroup:::default_register_reggroup_p::0
 # Fetch the pointer to the ith function argument.
-F::FETCH_POINTER_ARGUMENT:CORE_ADDR:fetch_pointer_argument:struct frame_info *frame, int argi, struct type *type:frame, argi, type
+F:=:CORE_ADDR:fetch_pointer_argument:struct frame_info *frame, int argi, struct type *type:frame, argi, type
 
 # Return the appropriate register set for a core file section with
 # name SECT_NAME and size SECT_SIZE.
-M:::const struct regset *:regset_from_core_section:const char *sect_name, size_t sect_size:sect_name, sect_size
+M::const struct regset *:regset_from_core_section:const char *sect_name, size_t sect_size:sect_name, sect_size
 EOF
 }
 
@@ -774,8 +729,7 @@
 function_list | while do_read
 do
     cat <<EOF
-${class} ${macro}(${actual})
-  ${returntype} ${function} ($formal)${attrib}
+${class} ${returntype} ${function} ($formal)${attrib}
 EOF
     for r in ${read}
     do
@@ -783,7 +737,7 @@
     done
     if class_is_predicate_p && fallback_default_p
     then
-	echo "Error: predicate function ${macro} can not have a non- multi-arch default" 1>&2
+	echo "Error: predicate function ${function} can not have a non- multi-arch default" 1>&2
 	kill $$
 	exit 1
     fi
@@ -877,7 +831,6 @@
 
 extern struct gdbarch *current_gdbarch;
 
-
 /* If any of the following are defined, the target wasn't correctly
    converted. */
 
@@ -897,12 +850,15 @@
 	printf "\n"
 	printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
 	printf "/* set_gdbarch_${function}() - not applicable - pre-initialized. */\n"
-	printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
-	printf "#error \"Non multi-arch definition of ${macro}\"\n"
-	printf "#endif\n"
-	printf "#if !defined (${macro})\n"
-	printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
-	printf "#endif\n"
+	if test -n "${macro}"
+	then
+	    printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n"
+	    printf "#error \"Non multi-arch definition of ${macro}\"\n"
+	    printf "#endif\n"
+	    printf "#if !defined (${macro})\n"
+	    printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
+	    printf "#endif\n"
+	fi
     fi
 done
 
@@ -919,30 +875,27 @@
 	    -e '3,$ s,#,  ,' \
 	    -e '$ s,$, */,'
     fi
-    if class_is_multiarch_p
+
+    if class_is_predicate_p
     then
-	if class_is_predicate_p
-	then
-	    printf "\n"
-	    printf "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);\n"
-	fi
-    else
-	if class_is_predicate_p
+	if test -n "${macro}"
 	then
 	    printf "\n"
 	    printf "#if defined (${macro})\n"
 	    printf "/* Legacy for systems yet to multi-arch ${macro} */\n"
-	    #printf "#if (GDB_MULTI_ARCH <= GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n"
 	    printf "#if !defined (${macro}_P)\n"
 	    printf "#define ${macro}_P() (1)\n"
 	    printf "#endif\n"
 	    printf "#endif\n"
-	    printf "\n"
-	    printf "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);\n"
-	    printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro}_P)\n"
+	fi
+	printf "\n"
+	printf "extern int gdbarch_${function}_p (struct gdbarch *gdbarch);\n"
+	if test -n "${macro}"
+	then
+	    printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro}_P)\n"
 	    printf "#error \"Non multi-arch definition of ${macro}\"\n"
 	    printf "#endif\n"
-	    printf "#if (GDB_MULTI_ARCH ${gt_level}) || !defined (${macro}_P)\n"
+	    printf "#if !defined (${macro}_P)\n"
 	    printf "#define ${macro}_P() (gdbarch_${function}_p (current_gdbarch))\n"
 	    printf "#endif\n"
 	fi
@@ -952,12 +905,15 @@
 	printf "\n"
 	printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
 	printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, ${returntype} ${function});\n"
-	printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
-	printf "#error \"Non multi-arch definition of ${macro}\"\n"
-	printf "#endif\n"
-	printf "#if !defined (${macro})\n"
-	printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
-	printf "#endif\n"
+	if test -n "${macro}"
+	then
+	    printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n"
+	    printf "#error \"Non multi-arch definition of ${macro}\"\n"
+	    printf "#endif\n"
+	    printf "#if !defined (${macro})\n"
+	    printf "#define ${macro} (gdbarch_${function} (current_gdbarch))\n"
+	    printf "#endif\n"
+	fi
     fi
     if class_is_function_p
     then
@@ -978,9 +934,9 @@
 	  printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch, ${formal});\n"
 	fi
 	printf "extern void set_gdbarch_${function} (struct gdbarch *gdbarch, gdbarch_${function}_ftype *${function});\n"
-	if class_is_multiarch_p ; then :
-	else
-	    printf "#if (GDB_MULTI_ARCH ${gt_level}) && defined (${macro})\n"
+	if test -n "${macro}"
+	then
+	    printf "#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (${macro})\n"
 	    printf "#error \"Non multi-arch definition of ${macro}\"\n"
 	    printf "#endif\n"
 	    if [ "x${actual}" = "x" ]
@@ -1548,12 +1504,12 @@
 	    printf "    current_gdbarch->${function} = ${postdefault};\n"
 	elif [ -n "${invalid_p}" ]
 	then
-	    printf "  if ((GDB_MULTI_ARCH ${gt_level})\n"
+	    printf "  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)\n"
 	    printf "      && (${invalid_p}))\n"
 	    printf "    fprintf_unfiltered (log, \"\\\\n\\\\t${function}\");\n"
 	elif [ -n "${predefault}" ]
 	then
-	    printf "  if ((GDB_MULTI_ARCH ${gt_level})\n"
+	    printf "  if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)\n"
 	    printf "      && (current_gdbarch->${function} == ${predefault}))\n"
 	    printf "    fprintf_unfiltered (log, \"\\\\n\\\\t${function}\");\n"
 	fi
@@ -1589,73 +1545,67 @@
                       "gdbarch_dump: GDB_MULTI_ARCH = %d\\n",
                       GDB_MULTI_ARCH);
 EOF
-function_list | sort -t: -k 3 | while do_read
+function_list | sort -t: -k 4 | while do_read
 do
     # First the predicate
     if class_is_predicate_p
     then
-	if class_is_multiarch_p
+	if test -n "${macro}"
 	then
-	    printf "  fprintf_unfiltered (file,\n"
-	    printf "                      \"gdbarch_dump: gdbarch_${function}_p() = %%d\\\\n\",\n"
-	    printf "                      gdbarch_${function}_p (current_gdbarch));\n"
-	else
 	    printf "#ifdef ${macro}_P\n"
 	    printf "  fprintf_unfiltered (file,\n"
 	    printf "                      \"gdbarch_dump: %%s # %%s\\\\n\",\n"
 	    printf "                      \"${macro}_P()\",\n"
 	    printf "                      XSTRING (${macro}_P ()));\n"
-	    printf "  fprintf_unfiltered (file,\n"
-	    printf "                      \"gdbarch_dump: ${macro}_P() = %%d\\\\n\",\n"
-	    printf "                      ${macro}_P ());\n"
 	    printf "#endif\n"
 	fi
-    fi
-    # multiarch functions don't have macros.
-    if class_is_multiarch_p
-    then
 	printf "  fprintf_unfiltered (file,\n"
-	printf "                      \"gdbarch_dump: ${function} = 0x%%08lx\\\\n\",\n"
-	printf "                      (long) current_gdbarch->${function});\n"
-	continue
+	printf "                      \"gdbarch_dump: gdbarch_${function}_p() = %%d\\\\n\",\n"
+	printf "                      gdbarch_${function}_p (current_gdbarch));\n"
     fi
     # Print the macro definition.
-    printf "#ifdef ${macro}\n"
+    if test -n "${macro}"
+    then
+	printf "#ifdef ${macro}\n"
+	if class_is_function_p
+	then
+	    printf "  fprintf_unfiltered (file,\n"
+	    printf "                      \"gdbarch_dump: %%s # %%s\\\\n\",\n"
+	    printf "                      \"${macro}(${actual})\",\n"
+	    printf "                      XSTRING (${macro} (${actual})));\n"
+	else
+	    printf "  fprintf_unfiltered (file,\n"
+	    printf "                      \"gdbarch_dump: ${macro} # %%s\\\\n\",\n"
+	    printf "                      XSTRING (${macro}));\n"
+	fi
+	printf "#endif\n"
+    fi
+    # Print the corresponding value.
     if class_is_function_p
     then
 	printf "  fprintf_unfiltered (file,\n"
-	printf "                      \"gdbarch_dump: %%s # %%s\\\\n\",\n"
-	printf "                      \"${macro}(${actual})\",\n"
-	printf "                      XSTRING (${macro} (${actual})));\n"
+	printf "                      \"gdbarch_dump: ${function} = <0x%%lx>\\\\n\",\n"
+	printf "                      (long) current_gdbarch->${function});\n"
     else
+	# It is a variable
+	case "${fmt}:${print}:${returntype}" in
+	    ::CORE_ADDR )
+		fmt="0x%s"
+		print="paddr_nz (current_gdbarch->${function})"
+		;;
+	    ::* )
+	        fmt="%s"
+		print="paddr_d (current_gdbarch->${function})"
+		;;
+	    * )
+	        test "${fmt}" || fmt="%ld"
+		test "${print}" || print="(long) (current_gdbarch->${function})"
+		;;
+        esac
 	printf "  fprintf_unfiltered (file,\n"
-	printf "                      \"gdbarch_dump: ${macro} # %%s\\\\n\",\n"
-	printf "                      XSTRING (${macro}));\n"
-    fi
-    if [ "x${print_p}" = "x()" ]
-    then
-        printf "  gdbarch_dump_${function} (current_gdbarch);\n"
-    elif [ "x${print_p}" = "x0" ]
-    then
-        printf "  /* skip print of ${macro}, print_p == 0. */\n"
-    elif [ -n "${print_p}" ]
-    then
-        printf "  if (${print_p})\n"
-	printf "    fprintf_unfiltered (file,\n"
-	printf "                        \"gdbarch_dump: ${macro} = %s\\\\n\",\n" "${fmt}"
-	printf "                        ${print});\n"
-    elif class_is_function_p
-    then
-	printf "  fprintf_unfiltered (file,\n"
-	printf "                      \"gdbarch_dump: ${macro} = <0x%%08lx>\\\\n\",\n"
-	printf "                      (long) current_gdbarch->${function}\n"
-	printf "                      /*${macro} ()*/);\n"
-    else
-	printf "  fprintf_unfiltered (file,\n"
-	printf "                      \"gdbarch_dump: ${macro} = %s\\\\n\",\n" "${fmt}"
+	printf "                      \"gdbarch_dump: ${function} = %s\\\\n\",\n" "${fmt}"
 	printf "                      ${print});\n"
     fi
-    printf "#endif\n"
 done
 cat <<EOF
   if (current_gdbarch->dump_tdep != NULL)
diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h
index e03ebf4..2c8427c 100644
--- a/gdb/gdbcore.h
+++ b/gdb/gdbcore.h
@@ -1,6 +1,8 @@
 /* Machine independent variables that describe the core file under GDB.
-   Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
-   1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation,
+   Inc.
 
    This file is part of GDB.
 
@@ -96,12 +98,12 @@
 
 /* Hook for `exec_file_command' command to call.  */
 
-extern void (*exec_file_display_hook) (char *filename);
+extern void (*deprecated_exec_file_display_hook) (char *filename);
 
 /* Hook for "file_command", which is more useful than above
    (because it is invoked AFTER symbols are read, not before) */
 
-extern void (*file_changed_hook) (char *filename);
+extern void (*deprecated_file_changed_hook) (char *filename);
 
 extern void specify_exec_file_hook (void (*hook) (char *filename));
 
@@ -194,15 +196,18 @@
 				 unsigned core_reg_size,
 				 int which, CORE_ADDR reg_addr);
 
-    /* Finds the next struct core_fns.  They are allocated and initialized
-       in whatever module implements the functions pointed to; an 
-       initializer calls add_core_fns to add them to the global chain.  */
+    /* Finds the next struct core_fns.  They are allocated and
+       initialized in whatever module implements the functions pointed
+       to; an initializer calls deprecated_add_core_fns to add them to
+       the global chain.  */
 
     struct core_fns *next;
 
   };
 
-extern void add_core_fns (struct core_fns *cf);
+/* NOTE: cagney/2004-04-05: Replaced by "regset.h" and
+   regset_from_core_section().  */
+extern void deprecated_add_core_fns (struct core_fns *cf);
 extern int default_core_sniffer (struct core_fns *cf, bfd * abfd);
 extern int default_check_format (bfd * abfd);
 
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 09dea26..0f8deeb 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -45,11 +45,9 @@
   /* State from wait_for_inferior */
   CORE_ADDR prev_pc;
   struct breakpoint *step_resume_breakpoint;
-  struct breakpoint *through_sigtramp_breakpoint;
   CORE_ADDR step_range_start;
   CORE_ADDR step_range_end;
   struct frame_id step_frame_id;
-  CORE_ADDR step_sp;
   int current_line;
   struct symtab *current_symtab;
   int trap_expected;
@@ -118,7 +116,6 @@
 			       CORE_ADDR prev_pc,
 			       int       trap_expected,
 			       struct breakpoint *step_resume_breakpoint,
-			       struct breakpoint *through_sigtramp_breakpoint,
 			       CORE_ADDR step_range_start,
 			       CORE_ADDR step_range_end,
 			       const struct frame_id *step_frame_id,
@@ -128,8 +125,7 @@
 			       bpstat    stepping_through_solib_catchpoints,
 			       int       stepping_through_sigtramp,
 			       int       current_line,
-			       struct symtab *current_symtab,
-			       CORE_ADDR step_sp);
+			       struct symtab *current_symtab);
 
 /* infrun context switch: load the debugger state previously saved
    for the given thread.  */
@@ -137,7 +133,6 @@
 			       CORE_ADDR *prev_pc,
 			       int       *trap_expected,
 			       struct breakpoint **step_resume_breakpoint,
-			       struct breakpoint **through_sigtramp_breakpoint,
 			       CORE_ADDR *step_range_start,
 			       CORE_ADDR *step_range_end,
 			       struct frame_id *step_frame_id,
@@ -147,8 +142,7 @@
 			       bpstat    *stepping_through_solib_catchpoints,
 			       int       *stepping_through_sigtramp,
 			       int       *current_line,
-			       struct symtab **current_symtab,
-			       CORE_ADDR *step_sp);
+			       struct symtab **current_symtab);
 
 /* Commands with a prefix of `thread'.  */
 extern struct cmd_list_element *thread_cmd_list;
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index a1141d7..c0696ad 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -136,7 +136,7 @@
     TYPE_CODE_TEMPLATE,		/* C++ template */
     TYPE_CODE_TEMPLATE_ARG,	/* C++ template arg */
 
-    TYPE_CODE_NAMESPACE,	/* C++ namespace.  */
+    TYPE_CODE_NAMESPACE		/* C++ namespace.  */
   };
 
 /* For now allow source to use TYPE_CODE_CLASS for C++ classes, as an
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index a61d577..f43d1ba 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -1574,7 +1574,7 @@
     }
 
   /* Pass back out our results.  */
-  bcopy (&inf->wait.status, status, sizeof (*status));
+  memcpy (status, &inf->wait.status, sizeof (*status));
 
   thread = inf->wait.thread;
   if (thread)
@@ -2040,7 +2040,8 @@
 }
 
 static void
-gnu_create_inferior (char *exec_file, char *allargs, char **env)
+gnu_create_inferior (char *exec_file, char *allargs, char **env,
+		     int from_tty)
 {
   struct inf *inf = cur_inf ();
 
@@ -2102,8 +2103,6 @@
 }
 
 
-#ifdef ATTACH_DETACH
-
 /* Attach to process PID, then initialize for debugging it
    and wait for the trace-trap that results from attaching.  */
 static void
@@ -2188,8 +2187,6 @@
 
   unpush_target (&gnu_ops);	/* Pop out of handling an inferior */
 }
-#endif /* ATTACH_DETACH */
-
 
 static void
 gnu_terminal_init_inferior (void)
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 0932ddb..8568add 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -183,7 +183,7 @@
 static void go32_files_info (struct target_ops *target);
 static void go32_stop (void);
 static void go32_kill_inferior (void);
-static void go32_create_inferior (char *exec_file, char *args, char **env);
+static void go32_create_inferior (char *exec_file, char *args, char **env, int from_tty);
 static void go32_mourn_inferior (void);
 static int go32_can_run (void);
 
@@ -574,7 +574,7 @@
 }
 
 static void
-go32_create_inferior (char *exec_file, char *args, char **env)
+go32_create_inferior (char *exec_file, char *args, char **env, int from_tty)
 {
   extern char **environ;
   jmp_buf start_state;
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index c6f55f8..300b99b 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -519,9 +519,7 @@
 static CORE_ADDR
 h8300_frame_chain (struct frame_info *thisframe)
 {
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe),
-				   get_frame_base (thisframe),
-				   get_frame_base (thisframe)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (thisframe)))
     {				/* initialize the from_pc now */
       get_frame_extra_info (thisframe)->from_pc =
 	deprecated_read_register_dummy (get_frame_pc (thisframe),
@@ -540,9 +538,7 @@
 static CORE_ADDR
 h8300_frame_saved_pc (struct frame_info *frame)
 {
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
-				   get_frame_base (frame),
-				   get_frame_base (frame)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
     return deprecated_read_register_dummy (get_frame_pc (frame),
 					   get_frame_base (frame),
 					   E_PC_REGNUM);
@@ -632,7 +628,7 @@
      to begin with.  */
 
 static CORE_ADDR
-h8300_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		       struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
 		       struct value **args, CORE_ADDR sp, int struct_return,
 		       CORE_ADDR struct_addr)
@@ -739,9 +735,7 @@
   unsigned regno;
   struct frame_info *frame = get_current_frame ();
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
-				   get_frame_base (frame),
-				   get_frame_base (frame)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
     {
       deprecated_pop_dummy_frame ();
     }
@@ -1326,7 +1320,7 @@
   set_gdbarch_deprecated_frameless_function_invocation (gdbarch, legacy_frameless_look_for_prologue);
 
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address);
-  set_gdbarch_use_struct_convention (gdbarch, always_use_struct_convention);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, always_use_struct_convention);
   set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc);
   set_gdbarch_push_dummy_code (gdbarch, h8300_push_dummy_code);
   set_gdbarch_push_dummy_call (gdbarch, h8300_push_dummy_call);
diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c
index 9be842b..8e8765a 100644
--- a/gdb/hppa-hpux-tdep.c
+++ b/gdb/hppa-hpux-tdep.c
@@ -24,145 +24,1231 @@
 #include "osabi.h"
 #include "gdb_string.h"
 #include "frame.h"
+#include "frame-unwind.h"
+#include "trad-frame.h"
+#include "symtab.h"
+#include "objfiles.h"
+#include "inferior.h"
+#include "infcall.h"
+#include "observer.h"
+#include "hppa-tdep.h"
+
+#include <dl.h>
+#include <machine/save_state.h>
+
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
+#endif
 
 /* Forward declarations.  */
 extern void _initialize_hppa_hpux_tdep (void);
 extern initialize_file_ftype _initialize_hppa_hpux_tdep;
 
-/* FIXME: brobecker 2002-12-25.  The following functions will eventually
-   become static, after the multiarching conversion is done.  */
-int hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name);
-void hppa32_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
-                                             CORE_ADDR *tmp);
-void hppa32_hpux_frame_base_before_sigtramp (struct frame_info *fi,
-                                             CORE_ADDR *tmp);
-void hppa32_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
-                                                    CORE_ADDR *fsr);
-void hppa64_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi,
-                                             CORE_ADDR *tmp);
-void hppa64_hpux_frame_base_before_sigtramp (struct frame_info *fi,
-                                             CORE_ADDR *tmp);
-void hppa64_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
-                                                    CORE_ADDR *fsr);
+typedef struct
+  {
+    struct minimal_symbol *msym;
+    CORE_ADDR solib_handle;
+    CORE_ADDR return_val;
+  }
+args_for_find_stub;
 
+/* Return one if PC is in the call path of a trampoline, else return zero.
+
+   Note we return one for *any* call trampoline (long-call, arg-reloc), not
+   just shared library trampolines (import, export).  */
+
+static int
+hppa32_hpux_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+  struct minimal_symbol *minsym;
+  struct unwind_table_entry *u;
+
+  /* First see if PC is in one of the two C-library trampolines.  */
+  if (pc == hppa_symbol_address("$$dyncall") 
+      || pc == hppa_symbol_address("_sr4export"))
+    return 1;
+
+  minsym = lookup_minimal_symbol_by_pc (pc);
+  if (minsym && strcmp (DEPRECATED_SYMBOL_NAME (minsym), ".stub") == 0)
+    return 1;
+
+  /* Get the unwind descriptor corresponding to PC, return zero
+     if no unwind was found.  */
+  u = find_unwind_entry (pc);
+  if (!u)
+    return 0;
+
+  /* If this isn't a linker stub, then return now.  */
+  if (u->stub_unwind.stub_type == 0)
+    return 0;
+
+  /* By definition a long-branch stub is a call stub.  */
+  if (u->stub_unwind.stub_type == LONG_BRANCH)
+    return 1;
+
+  /* The call and return path execute the same instructions within
+     an IMPORT stub!  So an IMPORT stub is both a call and return
+     trampoline.  */
+  if (u->stub_unwind.stub_type == IMPORT)
+    return 1;
+
+  /* Parameter relocation stubs always have a call path and may have a
+     return path.  */
+  if (u->stub_unwind.stub_type == PARAMETER_RELOCATION
+      || u->stub_unwind.stub_type == EXPORT)
+    {
+      CORE_ADDR addr;
+
+      /* Search forward from the current PC until we hit a branch
+         or the end of the stub.  */
+      for (addr = pc; addr <= u->region_end; addr += 4)
+	{
+	  unsigned long insn;
+
+	  insn = read_memory_integer (addr, 4);
+
+	  /* Does it look like a bl?  If so then it's the call path, if
+	     we find a bv or be first, then we're on the return path.  */
+	  if ((insn & 0xfc00e000) == 0xe8000000)
+	    return 1;
+	  else if ((insn & 0xfc00e001) == 0xe800c000
+		   || (insn & 0xfc000000) == 0xe0000000)
+	    return 0;
+	}
+
+      /* Should never happen.  */
+      warning ("Unable to find branch in parameter relocation stub.\n");
+      return 0;
+    }
+
+  /* Unknown stub type.  For now, just return zero.  */
+  return 0;
+}
+
+static int
+hppa64_hpux_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+  /* PA64 has a completely different stub/trampoline scheme.  Is it
+     better?  Maybe.  It's certainly harder to determine with any
+     certainty that we are in a stub because we can not refer to the
+     unwinders to help. 
+
+     The heuristic is simple.  Try to lookup the current PC value in th
+     minimal symbol table.  If that fails, then assume we are not in a
+     stub and return.
+
+     Then see if the PC value falls within the section bounds for the
+     section containing the minimal symbol we found in the first
+     step.  If it does, then assume we are not in a stub and return.
+
+     Finally peek at the instructions to see if they look like a stub.  */
+  struct minimal_symbol *minsym;
+  asection *sec;
+  CORE_ADDR addr;
+  int insn, i;
+
+  minsym = lookup_minimal_symbol_by_pc (pc);
+  if (! minsym)
+    return 0;
+
+  sec = SYMBOL_BFD_SECTION (minsym);
+
+  if (bfd_get_section_vma (sec->owner, sec) <= pc
+      && pc < (bfd_get_section_vma (sec->owner, sec)
+		 + bfd_section_size (sec->owner, sec)))
+      return 0;
+
+  /* We might be in a stub.  Peek at the instructions.  Stubs are 3
+     instructions long. */
+  insn = read_memory_integer (pc, 4);
+
+  /* Find out where we think we are within the stub.  */
+  if ((insn & 0xffffc00e) == 0x53610000)
+    addr = pc;
+  else if ((insn & 0xffffffff) == 0xe820d000)
+    addr = pc - 4;
+  else if ((insn & 0xffffc00e) == 0x537b0000)
+    addr = pc - 8;
+  else
+    return 0;
+
+  /* Now verify each insn in the range looks like a stub instruction.  */
+  insn = read_memory_integer (addr, 4);
+  if ((insn & 0xffffc00e) != 0x53610000)
+    return 0;
+	
+  /* Now verify each insn in the range looks like a stub instruction.  */
+  insn = read_memory_integer (addr + 4, 4);
+  if ((insn & 0xffffffff) != 0xe820d000)
+    return 0;
+    
+  /* Now verify each insn in the range looks like a stub instruction.  */
+  insn = read_memory_integer (addr + 8, 4);
+  if ((insn & 0xffffc00e) != 0x537b0000)
+    return 0;
+
+  /* Looks like a stub.  */
+  return 1;
+}
+
+/* Return one if PC is in the return path of a trampoline, else return zero.
+
+   Note we return one for *any* call trampoline (long-call, arg-reloc), not
+   just shared library trampolines (import, export).  */
+
+static int
+hppa_hpux_in_solib_return_trampoline (CORE_ADDR pc, char *name)
+{
+  struct unwind_table_entry *u;
+
+  /* Get the unwind descriptor corresponding to PC, return zero
+     if no unwind was found.  */
+  u = find_unwind_entry (pc);
+  if (!u)
+    return 0;
+
+  /* If this isn't a linker stub or it's just a long branch stub, then
+     return zero.  */
+  if (u->stub_unwind.stub_type == 0 || u->stub_unwind.stub_type == LONG_BRANCH)
+    return 0;
+
+  /* The call and return path execute the same instructions within
+     an IMPORT stub!  So an IMPORT stub is both a call and return
+     trampoline.  */
+  if (u->stub_unwind.stub_type == IMPORT)
+    return 1;
+
+  /* Parameter relocation stubs always have a call path and may have a
+     return path.  */
+  if (u->stub_unwind.stub_type == PARAMETER_RELOCATION
+      || u->stub_unwind.stub_type == EXPORT)
+    {
+      CORE_ADDR addr;
+
+      /* Search forward from the current PC until we hit a branch
+         or the end of the stub.  */
+      for (addr = pc; addr <= u->region_end; addr += 4)
+	{
+	  unsigned long insn;
+
+	  insn = read_memory_integer (addr, 4);
+
+	  /* Does it look like a bl?  If so then it's the call path, if
+	     we find a bv or be first, then we're on the return path.  */
+	  if ((insn & 0xfc00e000) == 0xe8000000)
+	    return 0;
+	  else if ((insn & 0xfc00e001) == 0xe800c000
+		   || (insn & 0xfc000000) == 0xe0000000)
+	    return 1;
+	}
+
+      /* Should never happen.  */
+      warning ("Unable to find branch in parameter relocation stub.\n");
+      return 0;
+    }
+
+  /* Unknown stub type.  For now, just return zero.  */
+  return 0;
+
+}
+
+/* Figure out if PC is in a trampoline, and if so find out where
+   the trampoline will jump to.  If not in a trampoline, return zero.
+
+   Simple code examination probably is not a good idea since the code
+   sequences in trampolines can also appear in user code.
+
+   We use unwinds and information from the minimal symbol table to
+   determine when we're in a trampoline.  This won't work for ELF
+   (yet) since it doesn't create stub unwind entries.  Whether or
+   not ELF will create stub unwinds or normal unwinds for linker
+   stubs is still being debated.
+
+   This should handle simple calls through dyncall or sr4export,
+   long calls, argument relocation stubs, and dyncall/sr4export
+   calling an argument relocation stub.  It even handles some stubs
+   used in dynamic executables.  */
+
+static CORE_ADDR
+hppa_hpux_skip_trampoline_code (CORE_ADDR pc)
+{
+  long orig_pc = pc;
+  long prev_inst, curr_inst, loc;
+  struct minimal_symbol *msym;
+  struct unwind_table_entry *u;
+
+  /* Addresses passed to dyncall may *NOT* be the actual address
+     of the function.  So we may have to do something special.  */
+  if (pc == hppa_symbol_address("$$dyncall"))
+    {
+      pc = (CORE_ADDR) read_register (22);
+
+      /* If bit 30 (counting from the left) is on, then pc is the address of
+         the PLT entry for this function, not the address of the function
+         itself.  Bit 31 has meaning too, but only for MPE.  */
+      if (pc & 0x2)
+	pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, TARGET_PTR_BIT / 8);
+    }
+  if (pc == hppa_symbol_address("$$dyncall_external"))
+    {
+      pc = (CORE_ADDR) read_register (22);
+      pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, TARGET_PTR_BIT / 8);
+    }
+  else if (pc == hppa_symbol_address("_sr4export"))
+    pc = (CORE_ADDR) (read_register (22));
+
+  /* Get the unwind descriptor corresponding to PC, return zero
+     if no unwind was found.  */
+  u = find_unwind_entry (pc);
+  if (!u)
+    return 0;
+
+  /* If this isn't a linker stub, then return now.  */
+  /* elz: attention here! (FIXME) because of a compiler/linker 
+     error, some stubs which should have a non zero stub_unwind.stub_type 
+     have unfortunately a value of zero. So this function would return here
+     as if we were not in a trampoline. To fix this, we go look at the partial
+     symbol information, which reports this guy as a stub.
+     (FIXME): Unfortunately, we are not that lucky: it turns out that the 
+     partial symbol information is also wrong sometimes. This is because 
+     when it is entered (somread.c::som_symtab_read()) it can happen that
+     if the type of the symbol (from the som) is Entry, and the symbol is
+     in a shared library, then it can also be a trampoline.  This would
+     be OK, except that I believe the way they decide if we are ina shared library
+     does not work. SOOOO..., even if we have a regular function w/o trampolines
+     its minimal symbol can be assigned type mst_solib_trampoline.
+     Also, if we find that the symbol is a real stub, then we fix the unwind
+     descriptor, and define the stub type to be EXPORT.
+     Hopefully this is correct most of the times. */
+  if (u->stub_unwind.stub_type == 0)
+    {
+
+/* elz: NOTE (FIXME!) once the problem with the unwind information is fixed
+   we can delete all the code which appears between the lines */
+/*--------------------------------------------------------------------------*/
+      msym = lookup_minimal_symbol_by_pc (pc);
+
+      if (msym == NULL || MSYMBOL_TYPE (msym) != mst_solib_trampoline)
+	return orig_pc == pc ? 0 : pc & ~0x3;
+
+      else if (msym != NULL && MSYMBOL_TYPE (msym) == mst_solib_trampoline)
+	{
+	  struct objfile *objfile;
+	  struct minimal_symbol *msymbol;
+	  int function_found = 0;
+
+	  /* go look if there is another minimal symbol with the same name as 
+	     this one, but with type mst_text. This would happen if the msym
+	     is an actual trampoline, in which case there would be another
+	     symbol with the same name corresponding to the real function */
+
+	  ALL_MSYMBOLS (objfile, msymbol)
+	  {
+	    if (MSYMBOL_TYPE (msymbol) == mst_text
+		&& DEPRECATED_STREQ (DEPRECATED_SYMBOL_NAME (msymbol), DEPRECATED_SYMBOL_NAME (msym)))
+	      {
+		function_found = 1;
+		break;
+	      }
+	  }
+
+	  if (function_found)
+	    /* the type of msym is correct (mst_solib_trampoline), but
+	       the unwind info is wrong, so set it to the correct value */
+	    u->stub_unwind.stub_type = EXPORT;
+	  else
+	    /* the stub type info in the unwind is correct (this is not a
+	       trampoline), but the msym type information is wrong, it
+	       should be mst_text. So we need to fix the msym, and also
+	       get out of this function */
+	    {
+	      MSYMBOL_TYPE (msym) = mst_text;
+	      return orig_pc == pc ? 0 : pc & ~0x3;
+	    }
+	}
+
+/*--------------------------------------------------------------------------*/
+    }
+
+  /* It's a stub.  Search for a branch and figure out where it goes.
+     Note we have to handle multi insn branch sequences like ldil;ble.
+     Most (all?) other branches can be determined by examining the contents
+     of certain registers and the stack.  */
+
+  loc = pc;
+  curr_inst = 0;
+  prev_inst = 0;
+  while (1)
+    {
+      /* Make sure we haven't walked outside the range of this stub.  */
+      if (u != find_unwind_entry (loc))
+	{
+	  warning ("Unable to find branch in linker stub");
+	  return orig_pc == pc ? 0 : pc & ~0x3;
+	}
+
+      prev_inst = curr_inst;
+      curr_inst = read_memory_integer (loc, 4);
+
+      /* Does it look like a branch external using %r1?  Then it's the
+         branch from the stub to the actual function.  */
+      if ((curr_inst & 0xffe0e000) == 0xe0202000)
+	{
+	  /* Yup.  See if the previous instruction loaded
+	     a value into %r1.  If so compute and return the jump address.  */
+	  if ((prev_inst & 0xffe00000) == 0x20200000)
+	    return (hppa_extract_21 (prev_inst) + hppa_extract_17 (curr_inst)) & ~0x3;
+	  else
+	    {
+	      warning ("Unable to find ldil X,%%r1 before ble Y(%%sr4,%%r1).");
+	      return orig_pc == pc ? 0 : pc & ~0x3;
+	    }
+	}
+
+      /* Does it look like a be 0(sr0,%r21)? OR 
+         Does it look like a be, n 0(sr0,%r21)? OR 
+         Does it look like a bve (r21)? (this is on PA2.0)
+         Does it look like a bve, n(r21)? (this is also on PA2.0)
+         That's the branch from an
+         import stub to an export stub.
+
+         It is impossible to determine the target of the branch via
+         simple examination of instructions and/or data (consider
+         that the address in the plabel may be the address of the
+         bind-on-reference routine in the dynamic loader).
+
+         So we have try an alternative approach.
+
+         Get the name of the symbol at our current location; it should
+         be a stub symbol with the same name as the symbol in the
+         shared library.
+
+         Then lookup a minimal symbol with the same name; we should
+         get the minimal symbol for the target routine in the shared
+         library as those take precedence of import/export stubs.  */
+      if ((curr_inst == 0xe2a00000) ||
+	  (curr_inst == 0xe2a00002) ||
+	  (curr_inst == 0xeaa0d000) ||
+	  (curr_inst == 0xeaa0d002))
+	{
+	  struct minimal_symbol *stubsym, *libsym;
+
+	  stubsym = lookup_minimal_symbol_by_pc (loc);
+	  if (stubsym == NULL)
+	    {
+	      warning ("Unable to find symbol for 0x%lx", loc);
+	      return orig_pc == pc ? 0 : pc & ~0x3;
+	    }
+
+	  libsym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (stubsym), NULL, NULL);
+	  if (libsym == NULL)
+	    {
+	      warning ("Unable to find library symbol for %s\n",
+		       DEPRECATED_SYMBOL_NAME (stubsym));
+	      return orig_pc == pc ? 0 : pc & ~0x3;
+	    }
+
+	  return SYMBOL_VALUE (libsym);
+	}
+
+      /* Does it look like bl X,%rp or bl X,%r0?  Another way to do a
+         branch from the stub to the actual function.  */
+      /*elz */
+      else if ((curr_inst & 0xffe0e000) == 0xe8400000
+	       || (curr_inst & 0xffe0e000) == 0xe8000000
+	       || (curr_inst & 0xffe0e000) == 0xe800A000)
+	return (loc + hppa_extract_17 (curr_inst) + 8) & ~0x3;
+
+      /* Does it look like bv (rp)?   Note this depends on the
+         current stack pointer being the same as the stack
+         pointer in the stub itself!  This is a branch on from the
+         stub back to the original caller.  */
+      /*else if ((curr_inst & 0xffe0e000) == 0xe840c000) */
+      else if ((curr_inst & 0xffe0f000) == 0xe840c000)
+	{
+	  /* Yup.  See if the previous instruction loaded
+	     rp from sp - 8.  */
+	  if (prev_inst == 0x4bc23ff1)
+	    return (read_memory_integer
+		    (read_register (HPPA_SP_REGNUM) - 8, 4)) & ~0x3;
+	  else
+	    {
+	      warning ("Unable to find restore of %%rp before bv (%%rp).");
+	      return orig_pc == pc ? 0 : pc & ~0x3;
+	    }
+	}
+
+      /* elz: added this case to capture the new instruction
+         at the end of the return part of an export stub used by
+         the PA2.0: BVE, n (rp) */
+      else if ((curr_inst & 0xffe0f000) == 0xe840d000)
+	{
+	  return (read_memory_integer
+		  (read_register (HPPA_SP_REGNUM) - 24, TARGET_PTR_BIT / 8)) & ~0x3;
+	}
+
+      /* What about be,n 0(sr0,%rp)?  It's just another way we return to
+         the original caller from the stub.  Used in dynamic executables.  */
+      else if (curr_inst == 0xe0400002)
+	{
+	  /* The value we jump to is sitting in sp - 24.  But that's
+	     loaded several instructions before the be instruction.
+	     I guess we could check for the previous instruction being
+	     mtsp %r1,%sr0 if we want to do sanity checking.  */
+	  return (read_memory_integer
+		  (read_register (HPPA_SP_REGNUM) - 24, TARGET_PTR_BIT / 8)) & ~0x3;
+	}
+
+      /* Haven't found the branch yet, but we're still in the stub.
+         Keep looking.  */
+      loc += 4;
+    }
+}
+
+
+/* Exception handling support for the HP-UX ANSI C++ compiler.
+   The compiler (aCC) provides a callback for exception events;
+   GDB can set a breakpoint on this callback and find out what
+   exception event has occurred. */
+
+/* The name of the hook to be set to point to the callback function */
+static char HP_ACC_EH_notify_hook[] = "__eh_notify_hook";
+/* The name of the function to be used to set the hook value */
+static char HP_ACC_EH_set_hook_value[] = "__eh_set_hook_value";
+/* The name of the callback function in end.o */
+static char HP_ACC_EH_notify_callback[] = "__d_eh_notify_callback";
+/* Name of function in end.o on which a break is set (called by above) */
+static char HP_ACC_EH_break[] = "__d_eh_break";
+/* Name of flag (in end.o) that enables catching throws */
+static char HP_ACC_EH_catch_throw[] = "__d_eh_catch_throw";
+/* Name of flag (in end.o) that enables catching catching */
+static char HP_ACC_EH_catch_catch[] = "__d_eh_catch_catch";
+/* The enum used by aCC */
+typedef enum
+  {
+    __EH_NOTIFY_THROW,
+    __EH_NOTIFY_CATCH
+  }
+__eh_notification;
+
+/* Is exception-handling support available with this executable? */
+static int hp_cxx_exception_support = 0;
+/* Has the initialize function been run? */
+static int hp_cxx_exception_support_initialized = 0;
+/* Address of __eh_notify_hook */
+static CORE_ADDR eh_notify_hook_addr = 0;
+/* Address of __d_eh_notify_callback */
+static CORE_ADDR eh_notify_callback_addr = 0;
+/* Address of __d_eh_break */
+static CORE_ADDR eh_break_addr = 0;
+/* Address of __d_eh_catch_catch */
+static CORE_ADDR eh_catch_catch_addr = 0;
+/* Address of __d_eh_catch_throw */
+static CORE_ADDR eh_catch_throw_addr = 0;
+/* Sal for __d_eh_break */
+static struct symtab_and_line *break_callback_sal = 0;
+
+/* Code in end.c expects __d_pid to be set in the inferior,
+   otherwise __d_eh_notify_callback doesn't bother to call
+   __d_eh_break!  So we poke the pid into this symbol
+   ourselves.
+   0 => success
+   1 => failure  */
 int
-hppa_hpux_pc_in_sigtramp (CORE_ADDR pc, char *name)
+setup_d_pid_in_inferior (void)
 {
-  /* Actually, for a PA running HPUX the kernel calls the signal handler
-     without an intermediate trampoline.  Luckily the kernel always sets
-     the return pointer for the signal handler to point to _sigreturn.  */
-  return (name && (strcmp ("_sigreturn", name) == 0));
-}
+  CORE_ADDR anaddr;
+  struct minimal_symbol *msymbol;
+  char buf[4];			/* FIXME 32x64? */
 
-/* For hppa32_hpux_frame_saved_pc_in_sigtramp, 
-   hppa32_hpux_frame_base_before_sigtramp and
-   hppa32_hpux_frame_find_saved_regs_in_sigtramp:
-
-   The signal context structure pointer is always saved at the base
-   of the frame which "calls" the signal handler.  We only want to find
-   the hardware save state structure, which lives 10 32bit words into
-   sigcontext structure.
-
-   Within the hardware save state structure, registers are found in the
-   same order as the register numbers in GDB.
-
-   At one time we peeked at %r31 rather than the PC queues to determine
-   what instruction took the fault.  This was done on purpose, but I don't
-   remember why.  Looking at the PC queues is really the right way, and
-   I don't remember why that didn't work when this code was originally
-   written.  */
-
-void
-hppa32_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi, CORE_ADDR *tmp)
-{
-  *tmp = read_memory_integer (get_frame_base (fi) + (43 * 4), 4);
-}
-
-void
-hppa32_hpux_frame_base_before_sigtramp (struct frame_info *fi,
-                                        CORE_ADDR *tmp)
-{
-  *tmp = read_memory_integer (get_frame_base (fi) + (40 * 4), 4);
-}
-
-void
-hppa32_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
-					       CORE_ADDR *fsr)
-{
-  int i;
-  const CORE_ADDR tmp = get_frame_base (fi) + (10 * 4);
-
-  for (i = 0; i < NUM_REGS; i++)
+  /* Slam the pid of the process into __d_pid; failing is only a warning!  */
+  msymbol = lookup_minimal_symbol ("__d_pid", NULL, symfile_objfile);
+  if (msymbol == NULL)
     {
-      if (i == SP_REGNUM)
-	fsr[SP_REGNUM] = read_memory_integer (tmp + SP_REGNUM * 4, 4);
-      else
-	fsr[i] = tmp + i * 4;
+      warning ("Unable to find __d_pid symbol in object file.");
+      warning ("Suggest linking executable with -g (links in /opt/langtools/lib/end.o).");
+      return 1;
     }
-}
 
-/* For hppa64_hpux_frame_saved_pc_in_sigtramp, 
-   hppa64_hpux_frame_base_before_sigtramp and
-   hppa64_hpux_frame_find_saved_regs_in_sigtramp:
-
-   These functions are the PA64 ABI equivalents of the 32bits counterparts
-   above. See the comments there.
-
-   For PA64, the save_state structure is at an offset of 24 32-bit words
-   from the sigcontext structure. The 64 bit general registers are at an
-   offset of 640 bytes from the beginning of the save_state structure,
-   and the floating pointer register are at an offset of 256 bytes from
-   the beginning of the save_state structure.  */
-
-void
-hppa64_hpux_frame_saved_pc_in_sigtramp (struct frame_info *fi, CORE_ADDR *tmp)
-{
-  *tmp = read_memory_integer
-           (get_frame_base (fi) + (24 * 4) + 640 + (33 * 8), 8);
-}
-
-void
-hppa64_hpux_frame_base_before_sigtramp (struct frame_info *fi,
-                                        CORE_ADDR *tmp)
-{
-  *tmp = read_memory_integer
-           (get_frame_base (fi) + (24 * 4) + 640 + (30 * 8), 8);
-}
-
-void
-hppa64_hpux_frame_find_saved_regs_in_sigtramp (struct frame_info *fi,
-					       CORE_ADDR *fsr)
-{
-  int i;
-  const CORE_ADDR tmp1 = get_frame_base (fi) + (24 * 4) + 640;
-  const CORE_ADDR tmp2 = get_frame_base (fi) + (24 * 4) + 256;
-
-  for (i = 0; i < NUM_REGS; i++)
+  anaddr = SYMBOL_VALUE_ADDRESS (msymbol);
+  store_unsigned_integer (buf, 4, PIDGET (inferior_ptid)); /* FIXME 32x64? */
+  if (target_write_memory (anaddr, buf, 4))	/* FIXME 32x64? */
     {
-      if (i == SP_REGNUM)
-        fsr[SP_REGNUM] = read_memory_integer (tmp1 + SP_REGNUM * 8, 8);
-      else if (i >= FP0_REGNUM)
-        fsr[i] = tmp2 + (i - FP0_REGNUM) * 8;
-      else
-        fsr[i] = tmp1 + i * 8;
+      warning ("Unable to write __d_pid");
+      warning ("Suggest linking executable with -g (links in /opt/langtools/lib/end.o).");
+      return 1;
     }
+  return 0;
+}
+
+/* elz: Used to lookup a symbol in the shared libraries.
+   This function calls shl_findsym, indirectly through a
+   call to __d_shl_get. __d_shl_get is in end.c, which is always
+   linked in by the hp compilers/linkers. 
+   The call to shl_findsym cannot be made directly because it needs
+   to be active in target address space. 
+   inputs: - minimal symbol pointer for the function we want to look up
+   - address in target space of the descriptor for the library
+   where we want to look the symbol up.
+   This address is retrieved using the 
+   som_solib_get_solib_by_pc function (somsolib.c). 
+   output: - real address in the library of the function.          
+   note: the handle can be null, in which case shl_findsym will look for
+   the symbol in all the loaded shared libraries.
+   files to look at if you need reference on this stuff:
+   dld.c, dld_shl_findsym.c
+   end.c
+   man entry for shl_findsym */
+
+CORE_ADDR
+find_stub_with_shl_get (struct minimal_symbol *function, CORE_ADDR handle)
+{
+  struct symbol *get_sym, *symbol2;
+  struct minimal_symbol *buff_minsym, *msymbol;
+  struct type *ftype;
+  struct value **args;
+  struct value *funcval;
+  struct value *val;
+
+  int x, namelen, err_value, tmp = -1;
+  CORE_ADDR endo_buff_addr, value_return_addr, errno_return_addr;
+  CORE_ADDR stub_addr;
+
+
+  args = alloca (sizeof (struct value *) * 8);		/* 6 for the arguments and one null one??? */
+  funcval = find_function_in_inferior ("__d_shl_get");
+  get_sym = lookup_symbol ("__d_shl_get", NULL, VAR_DOMAIN, NULL, NULL);
+  buff_minsym = lookup_minimal_symbol ("__buffer", NULL, NULL);
+  msymbol = lookup_minimal_symbol ("__shldp", NULL, NULL);
+  symbol2 = lookup_symbol ("__shldp", NULL, VAR_DOMAIN, NULL, NULL);
+  endo_buff_addr = SYMBOL_VALUE_ADDRESS (buff_minsym);
+  namelen = strlen (DEPRECATED_SYMBOL_NAME (function));
+  value_return_addr = endo_buff_addr + namelen;
+  ftype = check_typedef (SYMBOL_TYPE (get_sym));
+
+  /* do alignment */
+  if ((x = value_return_addr % 64) != 0)
+    value_return_addr = value_return_addr + 64 - x;
+
+  errno_return_addr = value_return_addr + 64;
+
+
+  /* set up stuff needed by __d_shl_get in buffer in end.o */
+
+  target_write_memory (endo_buff_addr, DEPRECATED_SYMBOL_NAME (function), namelen);
+
+  target_write_memory (value_return_addr, (char *) &tmp, 4);
+
+  target_write_memory (errno_return_addr, (char *) &tmp, 4);
+
+  target_write_memory (SYMBOL_VALUE_ADDRESS (msymbol),
+		       (char *) &handle, 4);
+
+  /* now prepare the arguments for the call */
+
+  args[0] = value_from_longest (TYPE_FIELD_TYPE (ftype, 0), 12);
+  args[1] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 1), SYMBOL_VALUE_ADDRESS (msymbol));
+  args[2] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 2), endo_buff_addr);
+  args[3] = value_from_longest (TYPE_FIELD_TYPE (ftype, 3), TYPE_PROCEDURE);
+  args[4] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 4), value_return_addr);
+  args[5] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 5), errno_return_addr);
+
+  /* now call the function */
+
+  val = call_function_by_hand (funcval, 6, args);
+
+  /* now get the results */
+
+  target_read_memory (errno_return_addr, (char *) &err_value, sizeof (err_value));
+
+  target_read_memory (value_return_addr, (char *) &stub_addr, sizeof (stub_addr));
+  if (stub_addr <= 0)
+    error ("call to __d_shl_get failed, error code is %d", err_value);
+
+  return (stub_addr);
+}
+
+/* Cover routine for find_stub_with_shl_get to pass to catch_errors */
+static int
+cover_find_stub_with_shl_get (void *args_untyped)
+{
+  args_for_find_stub *args = args_untyped;
+  args->return_val = find_stub_with_shl_get (args->msym, args->solib_handle);
+  return 0;
+}
+
+/* Initialize exception catchpoint support by looking for the
+   necessary hooks/callbacks in end.o, etc., and set the hook value to
+   point to the required debug function
+
+   Return 0 => failure
+   1 => success          */
+
+static int
+initialize_hp_cxx_exception_support (void)
+{
+  struct symtabs_and_lines sals;
+  struct cleanup *old_chain;
+  struct cleanup *canonical_strings_chain = NULL;
+  int i;
+  char *addr_start;
+  char *addr_end = NULL;
+  char **canonical = (char **) NULL;
+  int thread = -1;
+  struct symbol *sym = NULL;
+  struct minimal_symbol *msym = NULL;
+  struct objfile *objfile;
+  asection *shlib_info;
+
+  /* Detect and disallow recursion.  On HP-UX with aCC, infinite
+     recursion is a possibility because finding the hook for exception
+     callbacks involves making a call in the inferior, which means
+     re-inserting breakpoints which can re-invoke this code */
+
+  static int recurse = 0;
+  if (recurse > 0)
+    {
+      hp_cxx_exception_support_initialized = 0;
+      deprecated_exception_support_initialized = 0;
+      return 0;
+    }
+
+  hp_cxx_exception_support = 0;
+
+  /* First check if we have seen any HP compiled objects; if not,
+     it is very unlikely that HP's idiosyncratic callback mechanism
+     for exception handling debug support will be available!
+     This will percolate back up to breakpoint.c, where our callers
+     will decide to try the g++ exception-handling support instead. */
+  if (!deprecated_hp_som_som_object_present)
+    return 0;
+
+  /* We have a SOM executable with SOM debug info; find the hooks */
+
+  /* First look for the notify hook provided by aCC runtime libs */
+  /* If we find this symbol, we conclude that the executable must
+     have HP aCC exception support built in.  If this symbol is not
+     found, even though we're a HP SOM-SOM file, we may have been
+     built with some other compiler (not aCC).  This results percolates
+     back up to our callers in breakpoint.c which can decide to
+     try the g++ style of exception support instead.
+     If this symbol is found but the other symbols we require are
+     not found, there is something weird going on, and g++ support
+     should *not* be tried as an alternative.
+
+     ASSUMPTION: Only HP aCC code will have __eh_notify_hook defined.  
+     ASSUMPTION: HP aCC and g++ modules cannot be linked together. */
+
+  /* libCsup has this hook; it'll usually be non-debuggable */
+  msym = lookup_minimal_symbol (HP_ACC_EH_notify_hook, NULL, NULL);
+  if (msym)
+    {
+      eh_notify_hook_addr = SYMBOL_VALUE_ADDRESS (msym);
+      hp_cxx_exception_support = 1;
+    }
+  else
+    {
+      warning ("Unable to find exception callback hook (%s).", HP_ACC_EH_notify_hook);
+      warning ("Executable may not have been compiled debuggable with HP aCC.");
+      warning ("GDB will be unable to intercept exception events.");
+      eh_notify_hook_addr = 0;
+      hp_cxx_exception_support = 0;
+      return 0;
+    }
+
+  /* Next look for the notify callback routine in end.o */
+  /* This is always available in the SOM symbol dictionary if end.o is linked in */
+  msym = lookup_minimal_symbol (HP_ACC_EH_notify_callback, NULL, NULL);
+  if (msym)
+    {
+      eh_notify_callback_addr = SYMBOL_VALUE_ADDRESS (msym);
+      hp_cxx_exception_support = 1;
+    }
+  else
+    {
+      warning ("Unable to find exception callback routine (%s).", HP_ACC_EH_notify_callback);
+      warning ("Suggest linking executable with -g (links in /opt/langtools/lib/end.o).");
+      warning ("GDB will be unable to intercept exception events.");
+      eh_notify_callback_addr = 0;
+      return 0;
+    }
+
+#ifndef GDB_TARGET_IS_HPPA_20W
+  /* Check whether the executable is dynamically linked or archive bound */
+  /* With an archive-bound executable we can use the raw addresses we find
+     for the callback function, etc. without modification. For an executable
+     with shared libraries, we have to do more work to find the plabel, which
+     can be the target of a call through $$dyncall from the aCC runtime support
+     library (libCsup) which is linked shared by default by aCC. */
+  /* This test below was copied from somsolib.c/somread.c.  It may not be a very
+     reliable one to test that an executable is linked shared. pai/1997-07-18 */
+  shlib_info = bfd_get_section_by_name (symfile_objfile->obfd, "$SHLIB_INFO$");
+  if (shlib_info && (bfd_section_size (symfile_objfile->obfd, shlib_info) != 0))
+    {
+      /* The minsym we have has the local code address, but that's not the
+         plabel that can be used by an inter-load-module call. */
+      /* Find solib handle for main image (which has end.o), and use that
+         and the min sym as arguments to __d_shl_get() (which does the equivalent
+         of shl_findsym()) to find the plabel. */
+
+      args_for_find_stub args;
+      static char message[] = "Error while finding exception callback hook:\n";
+
+      args.solib_handle = som_solib_get_solib_by_pc (eh_notify_callback_addr);
+      args.msym = msym;
+      args.return_val = 0;
+
+      recurse++;
+      catch_errors (cover_find_stub_with_shl_get, &args, message,
+		    RETURN_MASK_ALL);
+      eh_notify_callback_addr = args.return_val;
+      recurse--;
+
+      deprecated_exception_catchpoints_are_fragile = 1;
+
+      if (!eh_notify_callback_addr)
+	{
+	  /* We can get here either if there is no plabel in the export list
+	     for the main image, or if something strange happened (?) */
+	  warning ("Couldn't find a plabel (indirect function label) for the exception callback.");
+	  warning ("GDB will not be able to intercept exception events.");
+	  return 0;
+	}
+    }
+  else
+    deprecated_exception_catchpoints_are_fragile = 0;
+#endif
+
+  /* Now, look for the breakpointable routine in end.o */
+  /* This should also be available in the SOM symbol dict. if end.o linked in */
+  msym = lookup_minimal_symbol (HP_ACC_EH_break, NULL, NULL);
+  if (msym)
+    {
+      eh_break_addr = SYMBOL_VALUE_ADDRESS (msym);
+      hp_cxx_exception_support = 1;
+    }
+  else
+    {
+      warning ("Unable to find exception callback routine to set breakpoint (%s).", HP_ACC_EH_break);
+      warning ("Suggest linking executable with -g (link in /opt/langtools/lib/end.o).");
+      warning ("GDB will be unable to intercept exception events.");
+      eh_break_addr = 0;
+      return 0;
+    }
+
+  /* Next look for the catch enable flag provided in end.o */
+  sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
+		       VAR_DOMAIN, 0, (struct symtab **) NULL);
+  if (sym)			/* sometimes present in debug info */
+    {
+      eh_catch_catch_addr = SYMBOL_VALUE_ADDRESS (sym);
+      hp_cxx_exception_support = 1;
+    }
+  else
+    /* otherwise look in SOM symbol dict. */
+    {
+      msym = lookup_minimal_symbol (HP_ACC_EH_catch_catch, NULL, NULL);
+      if (msym)
+	{
+	  eh_catch_catch_addr = SYMBOL_VALUE_ADDRESS (msym);
+	  hp_cxx_exception_support = 1;
+	}
+      else
+	{
+	  warning ("Unable to enable interception of exception catches.");
+	  warning ("Executable may not have been compiled debuggable with HP aCC.");
+	  warning ("Suggest linking executable with -g (link in /opt/langtools/lib/end.o).");
+	  return 0;
+	}
+    }
+
+  /* Next look for the catch enable flag provided end.o */
+  sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
+		       VAR_DOMAIN, 0, (struct symtab **) NULL);
+  if (sym)			/* sometimes present in debug info */
+    {
+      eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (sym);
+      hp_cxx_exception_support = 1;
+    }
+  else
+    /* otherwise look in SOM symbol dict. */
+    {
+      msym = lookup_minimal_symbol (HP_ACC_EH_catch_throw, NULL, NULL);
+      if (msym)
+	{
+	  eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (msym);
+	  hp_cxx_exception_support = 1;
+	}
+      else
+	{
+	  warning ("Unable to enable interception of exception throws.");
+	  warning ("Executable may not have been compiled debuggable with HP aCC.");
+	  warning ("Suggest linking executable with -g (link in /opt/langtools/lib/end.o).");
+	  return 0;
+	}
+    }
+
+  /* Set the flags */
+  hp_cxx_exception_support = 2;	/* everything worked so far */
+  hp_cxx_exception_support_initialized = 1;
+  deprecated_exception_support_initialized = 1;
+
+  return 1;
+}
+
+/* Target operation for enabling or disabling interception of
+   exception events.
+   KIND is either EX_EVENT_THROW or EX_EVENT_CATCH
+   ENABLE is either 0 (disable) or 1 (enable).
+   Return value is NULL if no support found;
+   -1 if something went wrong,
+   or a pointer to a symtab/line struct if the breakpointable
+   address was found. */
+
+struct symtab_and_line *
+child_enable_exception_callback (enum exception_event_kind kind, int enable)
+{
+  char buf[4];
+
+  if (!deprecated_exception_support_initialized
+      || !hp_cxx_exception_support_initialized)
+    if (!initialize_hp_cxx_exception_support ())
+      return NULL;
+
+  switch (hp_cxx_exception_support)
+    {
+    case 0:
+      /* Assuming no HP support at all */
+      return NULL;
+    case 1:
+      /* HP support should be present, but something went wrong */
+      return (struct symtab_and_line *) -1;	/* yuck! */
+      /* there may be other cases in the future */
+    }
+
+  /* Set the EH hook to point to the callback routine */
+  store_unsigned_integer (buf, 4, enable ? eh_notify_callback_addr : 0);	/* FIXME 32x64 problem */
+  /* pai: (temp) FIXME should there be a pack operation first? */
+  if (target_write_memory (eh_notify_hook_addr, buf, 4))	/* FIXME 32x64 problem */
+    {
+      warning ("Could not write to target memory for exception event callback.");
+      warning ("Interception of exception events may not work.");
+      return (struct symtab_and_line *) -1;
+    }
+  if (enable)
+    {
+      /* Ensure that __d_pid is set up correctly -- end.c code checks this. :-( */
+      if (PIDGET (inferior_ptid) > 0)
+	{
+	  if (setup_d_pid_in_inferior ())
+	    return (struct symtab_and_line *) -1;
+	}
+      else
+	{
+	  warning ("Internal error: Invalid inferior pid?  Cannot intercept exception events.");
+	  return (struct symtab_and_line *) -1;
+	}
+    }
+
+  switch (kind)
+    {
+    case EX_EVENT_THROW:
+      store_unsigned_integer (buf, 4, enable ? 1 : 0);
+      if (target_write_memory (eh_catch_throw_addr, buf, 4))	/* FIXME 32x64? */
+	{
+	  warning ("Couldn't enable exception throw interception.");
+	  return (struct symtab_and_line *) -1;
+	}
+      break;
+    case EX_EVENT_CATCH:
+      store_unsigned_integer (buf, 4, enable ? 1 : 0);
+      if (target_write_memory (eh_catch_catch_addr, buf, 4))	/* FIXME 32x64? */
+	{
+	  warning ("Couldn't enable exception catch interception.");
+	  return (struct symtab_and_line *) -1;
+	}
+      break;
+    default:
+      error ("Request to enable unknown or unsupported exception event.");
+    }
+
+  /* Copy break address into new sal struct, malloc'ing if needed. */
+  if (!break_callback_sal)
+    {
+      break_callback_sal = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line));
+    }
+  init_sal (break_callback_sal);
+  break_callback_sal->symtab = NULL;
+  break_callback_sal->pc = eh_break_addr;
+  break_callback_sal->line = 0;
+  break_callback_sal->end = eh_break_addr;
+
+  return break_callback_sal;
+}
+
+/* Record some information about the current exception event */
+static struct exception_event_record current_ex_event;
+/* Convenience struct */
+static struct symtab_and_line null_symtab_and_line =
+{NULL, 0, 0, 0};
+
+/* Report current exception event.  Returns a pointer to a record
+   that describes the kind of the event, where it was thrown from,
+   and where it will be caught.  More information may be reported
+   in the future */
+struct exception_event_record *
+child_get_current_exception_event (void)
+{
+  CORE_ADDR event_kind;
+  CORE_ADDR throw_addr;
+  CORE_ADDR catch_addr;
+  struct frame_info *fi, *curr_frame;
+  int level = 1;
+
+  curr_frame = get_current_frame ();
+  if (!curr_frame)
+    return (struct exception_event_record *) NULL;
+
+  /* Go up one frame to __d_eh_notify_callback, because at the
+     point when this code is executed, there's garbage in the
+     arguments of __d_eh_break. */
+  fi = find_relative_frame (curr_frame, &level);
+  if (level != 0)
+    return (struct exception_event_record *) NULL;
+
+  select_frame (fi);
+
+  /* Read in the arguments */
+  /* __d_eh_notify_callback() is called with 3 arguments:
+     1. event kind catch or throw
+     2. the target address if known
+     3. a flag -- not sure what this is. pai/1997-07-17 */
+  event_kind = read_register (HPPA_ARG0_REGNUM);
+  catch_addr = read_register (HPPA_ARG1_REGNUM);
+
+  /* Now go down to a user frame */
+  /* For a throw, __d_eh_break is called by
+     __d_eh_notify_callback which is called by
+     __notify_throw which is called
+     from user code.
+     For a catch, __d_eh_break is called by
+     __d_eh_notify_callback which is called by
+     <stackwalking stuff> which is called by
+     __throw__<stuff> or __rethrow_<stuff> which is called
+     from user code. */
+  /* FIXME: Don't use such magic numbers; search for the frames */
+  level = (event_kind == EX_EVENT_THROW) ? 3 : 4;
+  fi = find_relative_frame (curr_frame, &level);
+  if (level != 0)
+    return (struct exception_event_record *) NULL;
+
+  select_frame (fi);
+  throw_addr = get_frame_pc (fi);
+
+  /* Go back to original (top) frame */
+  select_frame (curr_frame);
+
+  current_ex_event.kind = (enum exception_event_kind) event_kind;
+  current_ex_event.throw_sal = find_pc_line (throw_addr, 1);
+  current_ex_event.catch_sal = find_pc_line (catch_addr, 1);
+
+  return &current_ex_event;
+}
+
+/* Signal frames.  */
+struct hppa_hpux_sigtramp_unwind_cache
+{
+  CORE_ADDR base;
+  struct trad_frame_saved_reg *saved_regs;
+};
+
+static int hppa_hpux_tramp_reg[] = {
+  HPPA_SAR_REGNUM,
+  HPPA_PCOQ_HEAD_REGNUM,
+  HPPA_PCSQ_HEAD_REGNUM,
+  HPPA_PCOQ_TAIL_REGNUM,
+  HPPA_PCSQ_TAIL_REGNUM,
+  HPPA_EIEM_REGNUM,
+  HPPA_IIR_REGNUM,
+  HPPA_ISR_REGNUM,
+  HPPA_IOR_REGNUM,
+  HPPA_IPSW_REGNUM,
+  -1,
+  HPPA_SR4_REGNUM,
+  HPPA_SR4_REGNUM + 1,
+  HPPA_SR4_REGNUM + 2,
+  HPPA_SR4_REGNUM + 3,
+  HPPA_SR4_REGNUM + 4,
+  HPPA_SR4_REGNUM + 5,
+  HPPA_SR4_REGNUM + 6,
+  HPPA_SR4_REGNUM + 7,
+  HPPA_RCR_REGNUM,
+  HPPA_PID0_REGNUM,
+  HPPA_PID1_REGNUM,
+  HPPA_CCR_REGNUM,
+  HPPA_PID2_REGNUM,
+  HPPA_PID3_REGNUM,
+  HPPA_TR0_REGNUM,
+  HPPA_TR0_REGNUM + 1,
+  HPPA_TR0_REGNUM + 2,
+  HPPA_CR27_REGNUM
+};
+
+static struct hppa_hpux_sigtramp_unwind_cache *
+hppa_hpux_sigtramp_frame_unwind_cache (struct frame_info *next_frame,
+				       void **this_cache)
+
+{
+  struct gdbarch *gdbarch = get_frame_arch (next_frame);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  struct hppa_hpux_sigtramp_unwind_cache *info;
+  unsigned int flag;
+  CORE_ADDR sp, scptr;
+  int i, incr, off, szoff;
+
+  if (*this_cache)
+    return *this_cache;
+
+  info = FRAME_OBSTACK_ZALLOC (struct hppa_hpux_sigtramp_unwind_cache);
+  *this_cache = info;
+  info->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+
+  sp = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM);
+
+  scptr = sp - 1352;
+  off = scptr;
+
+  /* See /usr/include/machine/save_state.h for the structure of the save_state_t
+     structure. */
+  
+  flag = read_memory_unsigned_integer(scptr, 4);
+    
+  if (!(flag & 0x40))
+    {
+      /* Narrow registers. */
+      off = scptr + offsetof (save_state_t, ss_narrow);
+      incr = 4;
+      szoff = 0;
+    }
+  else
+    {
+      /* Wide registers. */
+      off = scptr + offsetof (save_state_t, ss_wide) + 8;
+      incr = 8;
+      szoff = (tdep->bytes_per_address == 4 ? 4 : 0);
+    }
+
+  for (i = 1; i < 32; i++)
+    {
+      info->saved_regs[HPPA_R0_REGNUM + i].addr = off + szoff;
+      off += incr;
+    }
+
+  for (i = 0; 
+       i < sizeof(hppa_hpux_tramp_reg) / sizeof(hppa_hpux_tramp_reg[0]);
+       i++)
+    {
+      if (hppa_hpux_tramp_reg[i] > 0)
+        info->saved_regs[hppa_hpux_tramp_reg[i]].addr = off + szoff;
+      off += incr;
+    }
+
+  /* TODO: fp regs */
+
+  info->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM);
+
+  return info;
+}
+
+static void
+hppa_hpux_sigtramp_frame_this_id (struct frame_info *next_frame,
+				   void **this_prologue_cache,
+				   struct frame_id *this_id)
+{
+  struct hppa_hpux_sigtramp_unwind_cache *info
+    = hppa_hpux_sigtramp_frame_unwind_cache (next_frame, this_prologue_cache);
+  *this_id = frame_id_build (info->base, frame_pc_unwind (next_frame));
+}
+
+static void
+hppa_hpux_sigtramp_frame_prev_register (struct frame_info *next_frame,
+					 void **this_prologue_cache,
+					 int regnum, int *optimizedp,
+					 enum lval_type *lvalp, 
+					 CORE_ADDR *addrp,
+					 int *realnump, void *valuep)
+{
+  struct hppa_hpux_sigtramp_unwind_cache *info
+    = hppa_hpux_sigtramp_frame_unwind_cache (next_frame, this_prologue_cache);
+  hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum,
+		                   optimizedp, lvalp, addrp, realnump, valuep);
+}
+
+static const struct frame_unwind hppa_hpux_sigtramp_frame_unwind = {
+  SIGTRAMP_FRAME,
+  hppa_hpux_sigtramp_frame_this_id,
+  hppa_hpux_sigtramp_frame_prev_register
+};
+
+static const struct frame_unwind *
+hppa_hpux_sigtramp_unwind_sniffer (struct frame_info *next_frame)
+{
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
+
+  if (name && strcmp(name, "_sigreturn") == 0)
+    return &hppa_hpux_sigtramp_frame_unwind;
+
+  return NULL;
+}
+
+static void
+hppa_hpux_inferior_created (struct target_ops *objfile, int from_tty)
+{
+  /* Some HP-UX related globals to clear when a new "main"
+     symbol file is loaded.  HP-specific.  */
+  deprecated_hp_som_som_object_present = 0;
+  hp_cxx_exception_support_initialized = 0;
 }
 
 static void
 hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, hppa_hpux_pc_in_sigtramp);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  if (tdep->bytes_per_address == 4)
+    set_gdbarch_in_solib_call_trampoline (gdbarch, 
+					  hppa32_hpux_in_solib_call_trampoline);
+  else
+    set_gdbarch_in_solib_call_trampoline (gdbarch, 
+					  hppa64_hpux_in_solib_call_trampoline);
+
+  set_gdbarch_in_solib_return_trampoline (gdbarch,
+					  hppa_hpux_in_solib_return_trampoline);
+  set_gdbarch_skip_trampoline_code (gdbarch, hppa_hpux_skip_trampoline_code);
+
+  frame_unwind_append_sniffer (gdbarch, hppa_hpux_sigtramp_unwind_sniffer);
+
+  observer_attach_inferior_created (hppa_hpux_inferior_created);
 }
 
 static void
 hppa_hpux_som_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  tdep->is_elf = 0;
   hppa_hpux_init_abi (info, gdbarch);
 }
 
 static void
 hppa_hpux_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  tdep->is_elf = 1;
   hppa_hpux_init_abi (info, gdbarch);
 }
 
diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c
new file mode 100644
index 0000000..c15e1ab
--- /dev/null
+++ b/gdb/hppa-linux-nat.c
@@ -0,0 +1,375 @@
+/* Functions specific to running gdb native on HPPA running Linux.
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "regcache.h"
+#include "gdb_string.h"
+#include "inferior.h"
+
+#include <sys/procfs.h>
+#include <sys/ptrace.h>
+#include <string.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43)
+#include <asm/offset.h>
+#else
+#include <asm/offsets.h>
+#endif
+
+#include "hppa-tdep.h"
+
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+
+/* These must match the order of the register names.
+
+   Some sort of lookup table is needed because the offsets associated
+   with the registers are all over the board.  */
+
+static const int u_offsets[] =
+  {
+    /* general registers */
+    -1,
+    PT_GR1,
+    PT_GR2,
+    PT_GR3,
+    PT_GR4,
+    PT_GR5,
+    PT_GR6,
+    PT_GR7,
+    PT_GR8,
+    PT_GR9,
+    PT_GR10,
+    PT_GR11,
+    PT_GR12,
+    PT_GR13,
+    PT_GR14,
+    PT_GR15,
+    PT_GR16,
+    PT_GR17,
+    PT_GR18,
+    PT_GR19,
+    PT_GR20,
+    PT_GR21,
+    PT_GR22,
+    PT_GR23,
+    PT_GR24,
+    PT_GR25,
+    PT_GR26,
+    PT_GR27,
+    PT_GR28,
+    PT_GR29,
+    PT_GR30,
+    PT_GR31,
+
+    PT_SAR,
+    PT_IAOQ0,
+    PT_IASQ0,
+    PT_IAOQ1,
+    PT_IASQ1,
+    -1, /* eiem */
+    PT_IIR,
+    PT_ISR,
+    PT_IOR,
+    PT_PSW,
+    -1, /* goto */
+
+    PT_SR4,
+    PT_SR0,
+    PT_SR1,
+    PT_SR2,
+    PT_SR3,
+    PT_SR5,
+    PT_SR6,
+    PT_SR7,
+
+    -1, /* cr0 */
+    -1, /* pid0 */
+    -1, /* pid1 */
+    -1, /* ccr */
+    -1, /* pid2 */
+    -1, /* pid3 */
+    -1, /* cr24 */
+    -1, /* cr25 */
+    -1, /* cr26 */
+    PT_CR27,
+    -1, /* cr28 */
+    -1, /* cr29 */
+    -1, /* cr30 */
+
+    /* Floating point regs.  */
+    PT_FR0,  PT_FR0 + 4,
+    PT_FR1,  PT_FR1 + 4,
+    PT_FR2,  PT_FR2 + 4,
+    PT_FR3,  PT_FR3 + 4,
+    PT_FR4,  PT_FR4 + 4,
+    PT_FR5,  PT_FR5 + 4,
+    PT_FR6,  PT_FR6 + 4,
+    PT_FR7,  PT_FR7 + 4,
+    PT_FR8,  PT_FR8 + 4,
+    PT_FR9,  PT_FR9 + 4,
+    PT_FR10, PT_FR10 + 4,
+    PT_FR11, PT_FR11 + 4,
+    PT_FR12, PT_FR12 + 4,
+    PT_FR13, PT_FR13 + 4,
+    PT_FR14, PT_FR14 + 4,
+    PT_FR15, PT_FR15 + 4,
+    PT_FR16, PT_FR16 + 4,
+    PT_FR17, PT_FR17 + 4,
+    PT_FR18, PT_FR18 + 4,
+    PT_FR19, PT_FR19 + 4,
+    PT_FR20, PT_FR20 + 4,
+    PT_FR21, PT_FR21 + 4,
+    PT_FR22, PT_FR22 + 4,
+    PT_FR23, PT_FR23 + 4,
+    PT_FR24, PT_FR24 + 4,
+    PT_FR25, PT_FR25 + 4,
+    PT_FR26, PT_FR26 + 4,
+    PT_FR27, PT_FR27 + 4,
+    PT_FR28, PT_FR28 + 4,
+    PT_FR29, PT_FR29 + 4,
+    PT_FR30, PT_FR30 + 4,
+    PT_FR31, PT_FR31 + 4,
+  };
+
+CORE_ADDR
+register_addr (int regno, CORE_ADDR blockend)
+{
+  CORE_ADDR addr;
+
+  if ((unsigned) regno >= NUM_REGS)
+    error ("Invalid register number %d.", regno);
+
+  if (u_offsets[regno] == -1)
+    addr = 0;
+  else
+    {
+      addr = (CORE_ADDR) u_offsets[regno];
+    }
+
+  return addr;
+}
+
+/*
+ * Registers saved in a coredump:
+ * gr0..gr31
+ * sr0..sr7
+ * iaoq0..iaoq1
+ * iasq0..iasq1
+ * sar, iir, isr, ior, ipsw
+ * cr0, cr24..cr31
+ * cr8,9,12,13
+ * cr10, cr15
+ */
+#define GR_REGNUM(_n)	(HPPA_R0_REGNUM+_n)
+#define TR_REGNUM(_n)	(HPPA_TR0_REGNUM+_n)
+static const int greg_map[] =
+  {
+    GR_REGNUM(0), GR_REGNUM(1), GR_REGNUM(2), GR_REGNUM(3),
+    GR_REGNUM(4), GR_REGNUM(5), GR_REGNUM(6), GR_REGNUM(7),
+    GR_REGNUM(8), GR_REGNUM(9), GR_REGNUM(10), GR_REGNUM(11),
+    GR_REGNUM(12), GR_REGNUM(13), GR_REGNUM(14), GR_REGNUM(15),
+    GR_REGNUM(16), GR_REGNUM(17), GR_REGNUM(18), GR_REGNUM(19),
+    GR_REGNUM(20), GR_REGNUM(21), GR_REGNUM(22), GR_REGNUM(23),
+    GR_REGNUM(24), GR_REGNUM(25), GR_REGNUM(26), GR_REGNUM(27),
+    GR_REGNUM(28), GR_REGNUM(29), GR_REGNUM(30), GR_REGNUM(31),
+
+    HPPA_SR4_REGNUM+1, HPPA_SR4_REGNUM+2, HPPA_SR4_REGNUM+3, HPPA_SR4_REGNUM+4,
+    HPPA_SR4_REGNUM, HPPA_SR4_REGNUM+5, HPPA_SR4_REGNUM+6, HPPA_SR4_REGNUM+7,
+
+    HPPA_PCOQ_HEAD_REGNUM, HPPA_PCOQ_TAIL_REGNUM,
+    HPPA_PCSQ_HEAD_REGNUM, HPPA_PCSQ_TAIL_REGNUM,
+
+    HPPA_SAR_REGNUM, HPPA_IIR_REGNUM, HPPA_ISR_REGNUM, HPPA_IOR_REGNUM,
+    HPPA_IPSW_REGNUM, HPPA_RCR_REGNUM,
+
+    TR_REGNUM(0), TR_REGNUM(1), TR_REGNUM(2), TR_REGNUM(3),
+    TR_REGNUM(4), TR_REGNUM(5), TR_REGNUM(6), TR_REGNUM(7),
+
+    HPPA_PID0_REGNUM, HPPA_PID1_REGNUM, HPPA_PID2_REGNUM, HPPA_PID3_REGNUM,
+    HPPA_CCR_REGNUM, HPPA_EIEM_REGNUM,
+  };
+
+
+
+/* Fetch one register.  */
+
+static void
+fetch_register (int regno)
+{
+  int tid;
+  int val;
+
+  if (CANNOT_FETCH_REGISTER (regno))
+    {
+      supply_register (regno, NULL);
+      return;
+    }
+
+  /* GNU/Linux LWP ID's are process ID's.  */
+  tid = TIDGET (inferior_ptid);
+  if (tid == 0)
+    tid = PIDGET (inferior_ptid); /* Not a threaded program.  */
+
+  errno = 0;
+  val = ptrace (PTRACE_PEEKUSER, tid, register_addr (regno, 0), 0);
+  if (errno != 0)
+    error ("Couldn't read register %s (#%d): %s.", REGISTER_NAME (regno),
+	   regno, safe_strerror (errno));
+
+  regcache_raw_supply (current_regcache, regno, &val);
+}
+
+/* Store one register. */
+
+static void
+store_register (int regno)
+{
+  int tid;
+  int val;
+
+  if (CANNOT_STORE_REGISTER (regno))
+    return;
+
+  /* GNU/Linux LWP ID's are process ID's.  */
+  tid = TIDGET (inferior_ptid);
+  if (tid == 0)
+    tid = PIDGET (inferior_ptid); /* Not a threaded program.  */
+
+  errno = 0;
+  regcache_raw_collect (current_regcache, regno, &val);
+  ptrace (PTRACE_POKEUSER, tid, register_addr (regno, 0), val);
+  if (errno != 0)
+    error ("Couldn't write register %s (#%d): %s.", REGISTER_NAME (regno),
+	   regno, safe_strerror (errno));
+}
+
+/* Fetch registers from the child process.  Fetch all registers if
+   regno == -1, otherwise fetch all general registers or all floating
+   point registers depending upon the value of regno.  */
+
+void
+fetch_inferior_registers (int regno)
+{
+  if (-1 == regno)
+    {
+      for (regno = 0; regno < NUM_REGS; regno++)
+        fetch_register (regno);
+    }
+  else 
+    {
+      fetch_register (regno);
+    }
+}
+
+/* Store registers back into the inferior.  Store all registers if
+   regno == -1, otherwise store all general registers or all floating
+   point registers depending upon the value of regno.  */
+
+void
+store_inferior_registers (int regno)
+{
+  if (-1 == regno)
+    {
+      for (regno = 0; regno < NUM_REGS; regno++)
+	store_register (regno);
+    }
+  else
+    {
+      store_register (regno);
+    }
+}
+
+/* Fill GDB's register array with the general-purpose register values
+   in *gregsetp.  */
+
+void
+supply_gregset (gdb_gregset_t *gregsetp)
+{
+  int i;
+  greg_t *regp = (elf_greg_t *) gregsetp;
+
+  for (i = 0; i < sizeof (greg_map) / sizeof (greg_map[0]); i++, regp++)
+    {
+      int regno = greg_map[i];
+      supply_register (regno, regp);
+    }
+}
+
+/* Fill register regno (if it is a general-purpose register) in
+   *gregsetp with the appropriate value from GDB's register array.
+   If regno is -1, do this for all registers.  */
+
+void
+fill_gregset (gdb_gregset_t *gregsetp, int regno)
+{
+  int i;
+
+  for (i = 0; i < sizeof (greg_map) / sizeof (greg_map[0]); i++)
+    {
+      int mregno = greg_map[i];
+
+      if (regno == -1 || regno == mregno)
+	{
+          regcache_collect(mregno, &(*gregsetp)[i]);
+	}
+    }
+}
+
+/*  Given a pointer to a floating point register set in /proc format
+   (fpregset_t *), unpack the register contents and supply them as gdb's
+   idea of the current floating point register values. */
+
+void
+supply_fpregset (gdb_fpregset_t *fpregsetp)
+{
+  register int regi;
+  char *from;
+
+  for (regi = 0; regi <= 31; regi++)
+    {
+      from = (char *) &((*fpregsetp)[regi]);
+      supply_register (2*regi + HPPA_FP0_REGNUM, from);
+      supply_register (2*regi + HPPA_FP0_REGNUM + 1, from + 4);
+    }
+}
+
+/*  Given a pointer to a floating point register set in /proc format
+   (fpregset_t *), update the register specified by REGNO from gdb's idea
+   of the current floating point register set.  If REGNO is -1, update
+   them all. */
+
+void
+fill_fpregset (gdb_fpregset_t *fpregsetp, int regno)
+{
+  int i;
+
+  for (i = HPPA_FP0_REGNUM; i < HPPA_FP0_REGNUM + 32 * 2; i++)
+   {
+      /* Gross.  fpregset_t is double, registers[x] has single
+	 precision reg.  */
+      char *to = (char *) &((*fpregsetp)[(i - HPPA_FP0_REGNUM) / 2]);
+      if ((i - HPPA_FP0_REGNUM) & 1)
+	to += 4;
+      regcache_collect (i, to);
+   }
+}
diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c
new file mode 100644
index 0000000..1998a0a
--- /dev/null
+++ b/gdb/hppa-linux-tdep.c
@@ -0,0 +1,592 @@
+/* Target-dependent code for Linux running on PA-RISC, for GDB.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+This file is part of GDB.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "osabi.h"
+#include "target.h"
+#include "objfiles.h"
+#include "solib-svr4.h"
+#include "glibc-tdep.h"
+#include "frame-unwind.h"
+#include "trad-frame.h"
+#include "dwarf2-frame.h"
+#include "value.h"
+#include "hppa-tdep.h"
+
+#include "elf/common.h"
+
+#if 0
+/* Convert DWARF register number REG to the appropriate register
+   number used by GDB.  */
+static int
+hppa_dwarf_reg_to_regnum (int reg)
+{
+  /* registers 0 - 31 are the same in both sets */
+  if (reg < 32)
+    return reg;
+
+  /* dwarf regs 32 to 85 are fpregs 4 - 31 */
+  if (reg >= 32 && reg <= 85)
+    return HPPA_FP4_REGNUM + (reg - 32);
+
+  warning ("Unmapped DWARF Register #%d encountered\n", reg);
+  return -1;
+}
+#endif
+
+static void
+hppa_linux_target_write_pc (CORE_ADDR v, ptid_t ptid)
+{
+  /* Probably this should be done by the kernel, but it isn't.  */
+  write_register_pid (HPPA_PCOQ_HEAD_REGNUM, v | 0x3, ptid);
+  write_register_pid (HPPA_PCOQ_TAIL_REGNUM, (v + 4) | 0x3, ptid);
+}
+
+/* An instruction to match.  */
+struct insn_pattern
+{
+  unsigned int data;            /* See if it matches this....  */
+  unsigned int mask;            /* ... with this mask.  */
+};
+
+/* See bfd/elf32-hppa.c */
+static struct insn_pattern hppa_long_branch_stub[] = {
+  /* ldil LR'xxx,%r1 */
+  { 0x20200000, 0xffe00000 },
+  /* be,n RR'xxx(%sr4,%r1) */
+  { 0xe0202002, 0xffe02002 }, 
+  { 0, 0 }
+};
+
+static struct insn_pattern hppa_long_branch_pic_stub[] = {
+  /* b,l .+8, %r1 */
+  { 0xe8200000, 0xffe00000 },
+  /* addil LR'xxx - ($PIC_pcrel$0 - 4), %r1 */
+  { 0x28200000, 0xffe00000 },
+  /* be,n RR'xxxx - ($PIC_pcrel$0 - 8)(%sr4, %r1) */
+  { 0xe0202002, 0xffe02002 }, 
+  { 0, 0 }
+};
+
+static struct insn_pattern hppa_import_stub[] = {
+  /* addil LR'xxx, %dp */
+  { 0x2b600000, 0xffe00000 },
+  /* ldw RR'xxx(%r1), %r21 */
+  { 0x48350000, 0xffffb000 },
+  /* bv %r0(%r21) */
+  { 0xeaa0c000, 0xffffffff },
+  /* ldw RR'xxx+4(%r1), %r19 */
+  { 0x48330000, 0xffffb000 },
+  { 0, 0 }
+};
+
+static struct insn_pattern hppa_import_pic_stub[] = {
+  /* addil LR'xxx,%r19 */
+  { 0x2a600000, 0xffe00000 },
+  /* ldw RR'xxx(%r1),%r21 */
+  { 0x48350000, 0xffffb000 },
+  /* bv %r0(%r21) */
+  { 0xeaa0c000, 0xffffffff },
+  /* ldw RR'xxx+4(%r1),%r19 */
+  { 0x48330000, 0xffffb000 },
+  { 0, 0 },
+};
+
+static struct insn_pattern hppa_plt_stub[] = {
+  /* b,l 1b, %r20 - 1b is 3 insns before here */
+  { 0xea9f1fdd, 0xffffffff },
+  /* depi 0,31,2,%r20 */
+  { 0xd6801c1e, 0xffffffff },
+  { 0, 0 }
+};
+
+static struct insn_pattern hppa_sigtramp[] = {
+  /* ldi 0, %r25 or ldi 1, %r25 */
+  { 0x34190000, 0xfffffffd },
+  /* ldi __NR_rt_sigreturn, %r20 */
+  { 0x3414015a, 0xffffffff },
+  /* be,l 0x100(%sr2, %r0), %sr0, %r31 */
+  { 0xe4008200, 0xffffffff },
+  /* nop */
+  { 0x08000240, 0xffffffff },
+  { 0, 0 }
+};
+
+#define HPPA_MAX_INSN_PATTERN_LEN (4)
+
+/* Return non-zero if the instructions at PC match the series
+   described in PATTERN, or zero otherwise.  PATTERN is an array of
+   'struct insn_pattern' objects, terminated by an entry whose mask is
+   zero.
+
+   When the match is successful, fill INSN[i] with what PATTERN[i]
+   matched.  */
+static int
+insns_match_pattern (CORE_ADDR pc,
+                     struct insn_pattern *pattern,
+                     unsigned int *insn)
+{
+  int i;
+  CORE_ADDR npc = pc;
+
+  for (i = 0; pattern[i].mask; i++)
+    {
+      char buf[4];
+
+      read_memory_nobpt (npc, buf, 4);
+      insn[i] = extract_unsigned_integer (buf, 4);
+      if ((insn[i] & pattern[i].mask) == pattern[i].data)
+        npc += 4;
+      else
+        return 0;
+    }
+  return 1;
+}
+
+static int
+hppa_linux_in_dyncall (CORE_ADDR pc)
+{
+  return pc == hppa_symbol_address("$$dyncall");
+}
+
+/* There are several kinds of "trampolines" that we need to deal with:
+   - long branch stubs: these are inserted by the linker when a branch
+     target is too far away for a branch insn to reach
+   - plt stubs: these should go into the .plt section, so are easy to find
+   - import stubs: used to call from object to shared lib or shared lib to 
+     shared lib; these go in regular text sections.  In fact the linker tries
+     to put them throughout the code because branches have limited reachability.
+     We use the same mechanism as ppc64 to recognize the stub insn patterns.
+   - $$dyncall: similar to hpux, hppa-linux uses $$dyncall for indirect function
+     calls. $$dyncall is exported by libgcc.a  */
+static int
+hppa_linux_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+  unsigned int insn[HPPA_MAX_INSN_PATTERN_LEN];
+  int r;
+
+  r = in_plt_section (pc, name)
+      || hppa_linux_in_dyncall (pc)
+      || insns_match_pattern (pc, hppa_import_stub, insn)
+      || insns_match_pattern (pc, hppa_import_pic_stub, insn)
+      || insns_match_pattern (pc, hppa_long_branch_stub, insn)
+      || insns_match_pattern (pc, hppa_long_branch_pic_stub, insn);
+
+  return r;
+}
+
+static CORE_ADDR
+hppa_linux_skip_trampoline_code (CORE_ADDR pc)
+{
+  unsigned int insn[HPPA_MAX_INSN_PATTERN_LEN];
+  int dp_rel, pic_rel;
+
+  /* dyncall handles both PLABELs and direct addresses */
+  if (hppa_linux_in_dyncall (pc))
+    {
+      pc = (CORE_ADDR) read_register (22);
+
+      /* PLABELs have bit 30 set; if it's a PLABEL, then dereference it */
+      if (pc & 0x2)
+	pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, TARGET_PTR_BIT / 8);
+
+      return pc;
+    }
+
+  dp_rel = pic_rel = 0;
+  if ((dp_rel = insns_match_pattern (pc, hppa_import_stub, insn))
+      || (pic_rel = insns_match_pattern (pc, hppa_import_pic_stub, insn)))
+    {
+      /* Extract the target address from the addil/ldw sequence.  */
+      pc = hppa_extract_21 (insn[0]) + hppa_extract_14 (insn[1]);
+
+      if (dp_rel)
+        pc += (CORE_ADDR) read_register (27);
+      else
+        pc += (CORE_ADDR) read_register (19);
+
+      /* fallthrough */
+    }
+
+  if (in_plt_section (pc, NULL))
+    {
+      pc = (CORE_ADDR) read_memory_integer (pc, TARGET_PTR_BIT / 8);
+
+      /* if the plt slot has not yet been resolved, the target will
+         be the plt stub */
+      if (in_plt_section (pc, NULL))
+	{
+	  /* Sanity check: are we pointing to the plt stub? */
+  	  if (insns_match_pattern (pc, hppa_plt_stub, insn))
+	    {
+	      /* this should point to the fixup routine */
+      	      pc = (CORE_ADDR) read_memory_integer (pc + 8, TARGET_PTR_BIT / 8);
+	    }
+	  else
+	    {
+	      error ("Cannot resolve plt stub at 0x%s\n",
+		     paddr_nz (pc));
+	      pc = 0;
+	    }
+	}
+    }
+
+  return pc;
+}
+
+/* Signal frames.  */
+
+/* (This is derived from MD_FALLBACK_FRAME_STATE_FOR in gcc.)
+ 
+   Unfortunately, because of various bugs and changes to the kernel,
+   we have several cases to deal with.
+
+   In 2.4, the signal trampoline is 4 bytes, and pc should point directly at 
+   the beginning of the trampoline and struct rt_sigframe.
+
+   In <= 2.6.5-rc2-pa3, the signal trampoline is 9 bytes, and pc points at
+   the 4th word in the trampoline structure.  This is wrong, it should point 
+   at the 5th word.  This is fixed in 2.6.5-rc2-pa4.
+
+   To detect these cases, we first take pc, align it to 64-bytes
+   to get the beginning of the signal frame, and then check offsets 0, 4
+   and 5 to see if we found the beginning of the trampoline.  This will
+   tell us how to locate the sigcontext structure.
+
+   Note that with a 2.4 64-bit kernel, the signal context is not properly
+   passed back to userspace so the unwind will not work correctly.  */
+static CORE_ADDR
+hppa_linux_sigtramp_find_sigcontext (CORE_ADDR pc)
+{
+  unsigned int dummy[HPPA_MAX_INSN_PATTERN_LEN];
+  int offs = 0;
+  int try;
+  /* offsets to try to find the trampoline */
+  static int pcoffs[] = { 0, 4*4, 5*4 };
+  /* offsets to the rt_sigframe structure */
+  static int sfoffs[] = { 4*4, 10*4, 10*4 };
+  CORE_ADDR sp;
+
+  /* Most of the time, this will be correct.  The one case when this will
+     fail is if the user defined an alternate stack, in which case the
+     beginning of the stack will not be align_down (pc, 64).  */
+  sp = align_down (pc, 64);
+
+  /* rt_sigreturn trampoline:
+     3419000x ldi 0, %r25 or ldi 1, %r25   (x = 0 or 2)
+     3414015a ldi __NR_rt_sigreturn, %r20 
+     e4008200 be,l 0x100(%sr2, %r0), %sr0, %r31
+     08000240 nop  */
+
+  for (try = 0; try < ARRAY_SIZE (pcoffs); try++)
+    {
+      if (insns_match_pattern (sp + pcoffs[try], hppa_sigtramp, dummy))
+	{
+          offs = sfoffs[try];
+	  break;
+	}
+    }
+
+  if (offs == 0)
+    {
+      if (insns_match_pattern (pc, hppa_sigtramp, dummy))
+	{
+	  /* sigaltstack case: we have no way of knowing which offset to 
+	     use in this case; default to new kernel handling. If this is
+	     wrong the unwinding will fail.  */
+	  try = 2;
+	  sp = pc - pcoffs[try];
+	}
+      else
+      {
+        return 0;
+      }
+    }
+
+  /* sp + sfoffs[try] points to a struct rt_sigframe, which contains
+     a struct siginfo and a struct ucontext.  struct ucontext contains
+     a struct sigcontext. Return an offset to this sigcontext here.  Too 
+     bad we cannot include system specific headers :-(.  
+     sizeof(struct siginfo) == 128
+     offsetof(struct ucontext, uc_mcontext) == 24.  */
+  return sp + sfoffs[try] + 128 + 24;
+}
+
+struct hppa_linux_sigtramp_unwind_cache
+{
+  CORE_ADDR base;
+  struct trad_frame_saved_reg *saved_regs;
+};
+
+static struct hppa_linux_sigtramp_unwind_cache *
+hppa_linux_sigtramp_frame_unwind_cache (struct frame_info *next_frame,
+					void **this_cache)
+{
+  struct gdbarch *gdbarch = get_frame_arch (next_frame);
+  struct hppa_linux_sigtramp_unwind_cache *info;
+  CORE_ADDR pc, scptr;
+  int i;
+
+  if (*this_cache)
+    return *this_cache;
+
+  info = FRAME_OBSTACK_ZALLOC (struct hppa_linux_sigtramp_unwind_cache);
+  *this_cache = info;
+  info->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+
+  pc = frame_pc_unwind (next_frame);
+  scptr = hppa_linux_sigtramp_find_sigcontext (pc);
+
+  /* structure of struct sigcontext:
+   
+     struct sigcontext {
+	unsigned long sc_flags;
+	unsigned long sc_gr[32]; 
+	unsigned long long sc_fr[32];
+	unsigned long sc_iasq[2];
+	unsigned long sc_iaoq[2];
+	unsigned long sc_sar;           */
+
+  /* Skip sc_flags.  */
+  scptr += 4;
+
+  /* GR[0] is the psw, we don't restore that.  */
+  scptr += 4;
+
+  /* General registers.  */
+  for (i = 1; i < 32; i++)
+    {
+      info->saved_regs[HPPA_R0_REGNUM + i].addr = scptr;
+      scptr += 4;
+    }
+
+  /* Pad.  */
+  scptr += 4;
+
+  /* FP regs; FP0-3 are not restored.  */
+  scptr += (8 * 4);
+
+  for (i = 4; i < 32; i++)
+    {
+      info->saved_regs[HPPA_FP0_REGNUM + (i * 2)].addr = scptr;
+      scptr += 4;
+      info->saved_regs[HPPA_FP0_REGNUM + (i * 2) + 1].addr = scptr;
+      scptr += 4;
+    }
+
+  /* IASQ/IAOQ. */
+  info->saved_regs[HPPA_PCSQ_HEAD_REGNUM].addr = scptr;
+  scptr += 4;
+  info->saved_regs[HPPA_PCSQ_TAIL_REGNUM].addr = scptr;
+  scptr += 4;
+
+  info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].addr = scptr;
+  scptr += 4;
+  info->saved_regs[HPPA_PCOQ_TAIL_REGNUM].addr = scptr;
+  scptr += 4;
+
+  info->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM);
+
+  return info;
+}
+
+static void
+hppa_linux_sigtramp_frame_this_id (struct frame_info *next_frame,
+				   void **this_prologue_cache,
+				   struct frame_id *this_id)
+{
+  struct hppa_linux_sigtramp_unwind_cache *info
+    = hppa_linux_sigtramp_frame_unwind_cache (next_frame, this_prologue_cache);
+  *this_id = frame_id_build (info->base, frame_pc_unwind (next_frame));
+}
+
+static void
+hppa_linux_sigtramp_frame_prev_register (struct frame_info *next_frame,
+					 void **this_prologue_cache,
+					 int regnum, int *optimizedp,
+					 enum lval_type *lvalp, 
+					 CORE_ADDR *addrp,
+					 int *realnump, void *valuep)
+{
+  struct hppa_linux_sigtramp_unwind_cache *info
+    = hppa_linux_sigtramp_frame_unwind_cache (next_frame, this_prologue_cache);
+  hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum,
+		                   optimizedp, lvalp, addrp, realnump, valuep);
+}
+
+static const struct frame_unwind hppa_linux_sigtramp_frame_unwind = {
+  SIGTRAMP_FRAME,
+  hppa_linux_sigtramp_frame_this_id,
+  hppa_linux_sigtramp_frame_prev_register
+};
+
+/* hppa-linux always uses "new-style" rt-signals.  The signal handler's return
+   address should point to a signal trampoline on the stack.  The signal
+   trampoline is embedded in a rt_sigframe structure that is aligned on
+   the stack.  We take advantage of the fact that sp must be 64-byte aligned,
+   and the trampoline is small, so by rounding down the trampoline address
+   we can find the beginning of the struct rt_sigframe.  */
+static const struct frame_unwind *
+hppa_linux_sigtramp_unwind_sniffer (struct frame_info *next_frame)
+{
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+
+  if (hppa_linux_sigtramp_find_sigcontext (pc))
+    return &hppa_linux_sigtramp_frame_unwind;
+
+  return NULL;
+}
+
+/* Attempt to find (and return) the global pointer for the given
+   function.
+
+   This is a rather nasty bit of code searchs for the .dynamic section
+   in the objfile corresponding to the pc of the function we're trying
+   to call.  Once it finds the addresses at which the .dynamic section
+   lives in the child process, it scans the Elf32_Dyn entries for a
+   DT_PLTGOT tag.  If it finds one of these, the corresponding
+   d_un.d_ptr value is the global pointer.  */
+
+static CORE_ADDR
+hppa_linux_find_global_pointer (struct value *function)
+{
+  struct obj_section *faddr_sect;
+  CORE_ADDR faddr;
+  
+  faddr = value_as_address (function);
+
+  /* Is this a plabel? If so, dereference it to get the gp value.  */
+  if (faddr & 2)
+    {
+      int status;
+      char buf[4];
+
+      faddr &= ~3;
+
+      status = target_read_memory (faddr + 4, buf, sizeof (buf));
+      if (status == 0)
+	return extract_unsigned_integer (buf, sizeof (buf));
+    }
+
+  /* If the address is in the plt section, then the real function hasn't 
+     yet been fixed up by the linker so we cannot determine the gp of 
+     that function.  */
+  if (in_plt_section (faddr, NULL))
+    return 0;
+
+  faddr_sect = find_pc_section (faddr);
+  if (faddr_sect != NULL)
+    {
+      struct obj_section *osect;
+
+      ALL_OBJFILE_OSECTIONS (faddr_sect->objfile, osect)
+	{
+	  if (strcmp (osect->the_bfd_section->name, ".dynamic") == 0)
+	    break;
+	}
+
+      if (osect < faddr_sect->objfile->sections_end)
+	{
+	  CORE_ADDR addr;
+
+	  addr = osect->addr;
+	  while (addr < osect->endaddr)
+	    {
+	      int status;
+	      LONGEST tag;
+	      char buf[4];
+
+	      status = target_read_memory (addr, buf, sizeof (buf));
+	      if (status != 0)
+		break;
+	      tag = extract_signed_integer (buf, sizeof (buf));
+
+	      if (tag == DT_PLTGOT)
+		{
+		  CORE_ADDR global_pointer;
+
+		  status = target_read_memory (addr + 4, buf, sizeof (buf));
+		  if (status != 0)
+		    break;
+		  global_pointer = extract_unsigned_integer (buf, sizeof (buf));
+
+		  /* The payoff... */
+		  return global_pointer;
+		}
+
+	      if (tag == DT_NULL)
+		break;
+
+	      addr += 8;
+	    }
+	}
+    }
+  return 0;
+}
+
+/* Forward declarations.  */
+extern initialize_file_ftype _initialize_hppa_linux_tdep;
+
+static void
+hppa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  /* Linux is always ELF.  */
+  tdep->is_elf = 1;
+
+  tdep->find_global_pointer = hppa_linux_find_global_pointer;
+
+  set_gdbarch_write_pc (gdbarch, hppa_linux_target_write_pc);
+
+  frame_unwind_append_sniffer (gdbarch, hppa_linux_sigtramp_unwind_sniffer);
+
+  /* GNU/Linux uses SVR4-style shared libraries.  */
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+
+  set_gdbarch_in_solib_call_trampoline
+        (gdbarch, hppa_linux_in_solib_call_trampoline);
+  set_gdbarch_skip_trampoline_code
+	(gdbarch, hppa_linux_skip_trampoline_code);
+
+  /* GNU/Linux uses the dynamic linker included in the GNU C Library.  */
+  set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
+
+  /* On hppa-linux, currently, sizeof(long double) == 8.  There has been
+     some discussions to support 128-bit long double, but it requires some
+     more work in gcc and glibc first.  */
+  set_gdbarch_long_double_bit (gdbarch, 64);
+
+#if 0
+  /* Dwarf-2 unwinding support.  Not yet working.  */
+  set_gdbarch_dwarf_reg_to_regnum (gdbarch, hppa_dwarf_reg_to_regnum);
+  set_gdbarch_dwarf2_reg_to_regnum (gdbarch, hppa_dwarf_reg_to_regnum);
+  frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
+  frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer);
+#endif
+}
+
+void
+_initialize_hppa_linux_tdep (void)
+{
+  gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_LINUX, hppa_linux_init_abi);
+}
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index f96a211..7861fc3 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -25,150 +25,53 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
-#include "frame.h"
 #include "bfd.h"
 #include "inferior.h"
-#include "value.h"
 #include "regcache.h"
 #include "completer.h"
-#include "language.h"
 #include "osabi.h"
 #include "gdb_assert.h"
-#include "infttrace.h"
 #include "arch-utils.h"
 /* For argument passing to the inferior */
 #include "symtab.h"
-#include "infcall.h"
 #include "dis-asm.h"
 #include "trad-frame.h"
 #include "frame-unwind.h"
 #include "frame-base.h"
 
-#ifdef USG
-#include <sys/types.h>
-#endif
-
-#include <dl.h>
-#include <sys/param.h>
-#include <signal.h>
-
-#include <sys/ptrace.h>
-#include <machine/save_state.h>
-
-#ifdef COFF_ENCAPSULATE
-#include "a.out.encap.h"
-#else
-#endif
-
-/*#include <sys/user.h>         After a.out.h  */
-#include <sys/file.h>
-#include "gdb_stat.h"
-#include "gdb_wait.h"
-
 #include "gdbcore.h"
 #include "gdbcmd.h"
-#include "target.h"
-#include "symfile.h"
 #include "objfiles.h"
 #include "hppa-tdep.h"
 
+static int hppa_debug = 0;
+
 /* Some local constants.  */
 static const int hppa32_num_regs = 128;
 static const int hppa64_num_regs = 96;
 
+/* hppa-specific object data -- unwind and solib info.
+   TODO/maybe: think about splitting this into two parts; the unwind data is 
+   common to all hppa targets, but is only used in this file; we can register 
+   that separately and make this static. The solib data is probably hpux-
+   specific, so we can create a separate extern objfile_data that is registered
+   by hppa-hpux-tdep.c and shared with pa64solib.c and somsolib.c.  */
+const struct objfile_data *hppa_objfile_priv_data = NULL;
+
 /* Get at various relevent fields of an instruction word. */
 #define MASK_5 0x1f
 #define MASK_11 0x7ff
 #define MASK_14 0x3fff
 #define MASK_21 0x1fffff
 
-/* Define offsets into the call dummy for the _sr4export address.
-   See comments related to CALL_DUMMY for more info.  */
-#define SR4EXPORT_LDIL_OFFSET (INSTRUCTION_SIZE * 12)
-#define SR4EXPORT_LDO_OFFSET (INSTRUCTION_SIZE * 13)
-
-/* To support detection of the pseudo-initial frame
-   that threads have. */
-#define THREAD_INITIAL_FRAME_SYMBOL  "__pthread_exit"
-#define THREAD_INITIAL_FRAME_SYM_LEN  sizeof(THREAD_INITIAL_FRAME_SYMBOL)
-
 /* Sizes (in bytes) of the native unwind entries.  */
 #define UNWIND_ENTRY_SIZE 16
 #define STUB_UNWIND_ENTRY_SIZE 8
 
-static int get_field (unsigned word, int from, int to);
-
-static int extract_5_load (unsigned int);
-
-static unsigned extract_5R_store (unsigned int);
-
-static unsigned extract_5r_store (unsigned int);
-
-struct unwind_table_entry *find_unwind_entry (CORE_ADDR);
-
-static int extract_17 (unsigned int);
-
-static int extract_21 (unsigned);
-
-static int extract_14 (unsigned);
-
-static void unwind_command (char *, int);
-
-static int low_sign_extend (unsigned int, unsigned int);
-
-static int sign_extend (unsigned int, unsigned int);
-
-static int hppa_alignof (struct type *);
-
-static int prologue_inst_adjust_sp (unsigned long);
-
-static int is_branch (unsigned long);
-
-static int inst_saves_gr (unsigned long);
-
-static int inst_saves_fr (unsigned long);
-
-static int compare_unwind_entries (const void *, const void *);
-
-static void read_unwind_info (struct objfile *);
-
-static void internalize_unwinds (struct objfile *,
-				 struct unwind_table_entry *,
-				 asection *, unsigned int,
-				 unsigned int, CORE_ADDR);
-static void record_text_segment_lowaddr (bfd *, asection *, void *);
 /* FIXME: brobecker 2002-11-07: We will likely be able to make the
    following functions static, once we hppa is partially multiarched.  */
-int hppa_reg_struct_has_addr (int gcc_p, struct type *type);
-CORE_ADDR hppa_skip_prologue (CORE_ADDR pc);
-CORE_ADDR hppa_skip_trampoline_code (CORE_ADDR pc);
-int hppa_in_solib_call_trampoline (CORE_ADDR pc, char *name);
-int hppa_in_solib_return_trampoline (CORE_ADDR pc, char *name);
-int hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs);
 int hppa_pc_requires_run_before_use (CORE_ADDR pc);
 int hppa_instruction_nullified (void);
-int hppa_cannot_store_register (int regnum);
-CORE_ADDR hppa_smash_text_address (CORE_ADDR addr);
-CORE_ADDR hppa_target_read_pc (ptid_t ptid);
-void hppa_target_write_pc (CORE_ADDR v, ptid_t ptid);
-
-typedef struct
-  {
-    struct minimal_symbol *msym;
-    CORE_ADDR solib_handle;
-    CORE_ADDR return_val;
-  }
-args_for_find_stub;
-
-static int cover_find_stub_with_shl_get (void *);
-
-static int is_pa_2 = 0;		/* False */
-
-/* This is declared in symtab.c; set to 1 in hp-symtab-read.c */
-extern int hp_som_som_object_present;
-
-/* In breakpoint.c */
-extern int exception_catchpoints_are_fragile;
 
 /* Handle 32/64-bit struct return conventions.  */
 
@@ -177,22 +80,12 @@
 		     struct type *type, struct regcache *regcache,
 		     void *readbuf, const void *writebuf)
 {
-  if (TYPE_CODE (type) == TYPE_CODE_FLT)
-    {
-      if (readbuf != NULL)
-	regcache_cooked_read_part (regcache, FP4_REGNUM, 0,
-				   TYPE_LENGTH (type), readbuf);
-      if (writebuf != NULL)
-	regcache_cooked_write_part (regcache, FP4_REGNUM, 0,
-				    TYPE_LENGTH (type), writebuf);
-      return RETURN_VALUE_REGISTER_CONVENTION;
-    }
   if (TYPE_LENGTH (type) <= 2 * 4)
     {
       /* The value always lives in the right hand end of the register
 	 (or register pair)?  */
       int b;
-      int reg = 28;
+      int reg = TYPE_CODE (type) == TYPE_CODE_FLT ? HPPA_FP4_REGNUM : 28;
       int part = TYPE_LENGTH (type) % 4;
       /* The left hand register contains only part of the value,
 	 transfer that first so that the rest can be xfered as entire
@@ -235,19 +128,19 @@
       && TYPE_LENGTH (type) <= 8)
     {
       /* Floats are right aligned?  */
-      int offset = register_size (gdbarch, FP4_REGNUM) - TYPE_LENGTH (type);
+      int offset = register_size (gdbarch, HPPA_FP4_REGNUM) - TYPE_LENGTH (type);
       if (readbuf != NULL)
-	regcache_cooked_read_part (regcache, FP4_REGNUM, offset,
+	regcache_cooked_read_part (regcache, HPPA_FP4_REGNUM, offset,
 				   TYPE_LENGTH (type), readbuf);
       if (writebuf != NULL)
-	regcache_cooked_write_part (regcache, FP4_REGNUM, offset,
+	regcache_cooked_write_part (regcache, HPPA_FP4_REGNUM, offset,
 				    TYPE_LENGTH (type), writebuf);
       return RETURN_VALUE_REGISTER_CONVENTION;
     }
   else if (TYPE_LENGTH (type) <= 8 && is_integral_type (type))
     {
       /* Integrals are right aligned.  */
-      int offset = register_size (gdbarch, FP4_REGNUM) - TYPE_LENGTH (type);
+      int offset = register_size (gdbarch, HPPA_FP4_REGNUM) - TYPE_LENGTH (type);
       if (readbuf != NULL)
 	regcache_cooked_read_part (regcache, 28, offset,
 				   TYPE_LENGTH (type), readbuf);
@@ -282,16 +175,16 @@
 /* This assumes that no garbage lies outside of the lower bits of 
    value. */
 
-static int
-sign_extend (unsigned val, unsigned bits)
+int
+hppa_sign_extend (unsigned val, unsigned bits)
 {
   return (int) (val >> (bits - 1) ? (-1 << bits) | val : val);
 }
 
 /* For many immediate values the sign bit is the low bit! */
 
-static int
-low_sign_extend (unsigned val, unsigned bits)
+int
+hppa_low_hppa_sign_extend (unsigned val, unsigned bits)
 {
   return (int) ((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1);
 }
@@ -299,76 +192,88 @@
 /* Extract the bits at positions between FROM and TO, using HP's numbering
    (MSB = 0). */
 
-static int
-get_field (unsigned word, int from, int to)
+int
+hppa_get_field (unsigned word, int from, int to)
 {
   return ((word) >> (31 - (to)) & ((1 << ((to) - (from) + 1)) - 1));
 }
 
 /* extract the immediate field from a ld{bhw}s instruction */
 
-static int
-extract_5_load (unsigned word)
+int
+hppa_extract_5_load (unsigned word)
 {
-  return low_sign_extend (word >> 16 & MASK_5, 5);
+  return hppa_low_hppa_sign_extend (word >> 16 & MASK_5, 5);
 }
 
 /* extract the immediate field from a break instruction */
 
-static unsigned
-extract_5r_store (unsigned word)
+unsigned
+hppa_extract_5r_store (unsigned word)
 {
   return (word & MASK_5);
 }
 
 /* extract the immediate field from a {sr}sm instruction */
 
-static unsigned
-extract_5R_store (unsigned word)
+unsigned
+hppa_extract_5R_store (unsigned word)
 {
   return (word >> 16 & MASK_5);
 }
 
 /* extract a 14 bit immediate field */
 
-static int
-extract_14 (unsigned word)
+int
+hppa_extract_14 (unsigned word)
 {
-  return low_sign_extend (word & MASK_14, 14);
+  return hppa_low_hppa_sign_extend (word & MASK_14, 14);
 }
 
 /* extract a 21 bit constant */
 
-static int
-extract_21 (unsigned word)
+int
+hppa_extract_21 (unsigned word)
 {
   int val;
 
   word &= MASK_21;
   word <<= 11;
-  val = get_field (word, 20, 20);
+  val = hppa_get_field (word, 20, 20);
   val <<= 11;
-  val |= get_field (word, 9, 19);
+  val |= hppa_get_field (word, 9, 19);
   val <<= 2;
-  val |= get_field (word, 5, 6);
+  val |= hppa_get_field (word, 5, 6);
   val <<= 5;
-  val |= get_field (word, 0, 4);
+  val |= hppa_get_field (word, 0, 4);
   val <<= 2;
-  val |= get_field (word, 7, 8);
-  return sign_extend (val, 21) << 11;
+  val |= hppa_get_field (word, 7, 8);
+  return hppa_sign_extend (val, 21) << 11;
 }
 
 /* extract a 17 bit constant from branch instructions, returning the
    19 bit signed value. */
 
-static int
-extract_17 (unsigned word)
+int
+hppa_extract_17 (unsigned word)
 {
-  return sign_extend (get_field (word, 19, 28) |
-		      get_field (word, 29, 29) << 10 |
-		      get_field (word, 11, 15) << 11 |
+  return hppa_sign_extend (hppa_get_field (word, 19, 28) |
+		      hppa_get_field (word, 29, 29) << 10 |
+		      hppa_get_field (word, 11, 15) << 11 |
 		      (word & 0x1) << 16, 17) << 2;
 }
+
+CORE_ADDR 
+hppa_symbol_address(const char *sym)
+{
+  struct minimal_symbol *minsym;
+
+  minsym = lookup_minimal_symbol (sym, NULL, NULL);
+  if (minsym)
+    return SYMBOL_VALUE_ADDRESS (minsym);
+  else
+    return (CORE_ADDR)-1;
+}
 
 
 /* Compare the start address for two unwind entries returning 1 if 
@@ -389,15 +294,18 @@
     return 0;
 }
 
-static CORE_ADDR low_text_segment_address;
-
 static void
-record_text_segment_lowaddr (bfd *abfd, asection *section, void *ignored)
+record_text_segment_lowaddr (bfd *abfd, asection *section, void *data)
 {
-  if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
+  if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
        == (SEC_ALLOC | SEC_LOAD | SEC_READONLY))
-      && section->vma < low_text_segment_address)
-    low_text_segment_address = section->vma;
+    {
+      bfd_vma value = section->vma - section->filepos;
+      CORE_ADDR *low_text_segment_address = (CORE_ADDR *)data;
+
+      if (value < *low_text_segment_address)
+          *low_text_segment_address = value;
+    }
 }
 
 static void
@@ -407,30 +315,29 @@
 {
   /* We will read the unwind entries into temporary memory, then
      fill in the actual unwind table.  */
+
   if (size > 0)
     {
       unsigned long tmp;
       unsigned i;
       char *buf = alloca (size);
+      CORE_ADDR low_text_segment_address;
 
-      low_text_segment_address = -1;
-
-      /* If addresses are 64 bits wide, then unwinds are supposed to
+      /* For ELF targets, then unwinds are supposed to
 	 be segment relative offsets instead of absolute addresses. 
 
 	 Note that when loading a shared library (text_offset != 0) the
 	 unwinds are already relative to the text_offset that will be
 	 passed in.  */
-      if (TARGET_PTR_BIT == 64 && text_offset == 0)
+      if (gdbarch_tdep (current_gdbarch)->is_elf && text_offset == 0)
 	{
-	  bfd_map_over_sections (objfile->obfd,
-				 record_text_segment_lowaddr, NULL);
+          low_text_segment_address = -1;
 
-	  /* ?!? Mask off some low bits.  Should this instead subtract
-	     out the lowest section's filepos or something like that?
-	     This looks very hokey to me.  */
-	  low_text_segment_address &= ~0xfff;
-	  text_offset += low_text_segment_address;
+	  bfd_map_over_sections (objfile->obfd,
+				 record_text_segment_lowaddr, 
+				 &low_text_segment_address);
+
+	  text_offset = low_text_segment_address;
 	}
 
       bfd_get_section_contents (objfile->obfd, section, buf, 0, size);
@@ -502,12 +409,12 @@
   unsigned index, unwind_entries;
   unsigned stub_entries, total_entries;
   CORE_ADDR text_offset;
-  struct obj_unwind_info *ui;
-  obj_private_data_t *obj_private;
+  struct hppa_unwind_info *ui;
+  struct hppa_objfile_private *obj_private;
 
   text_offset = ANOFFSET (objfile->section_offsets, 0);
-  ui = (struct obj_unwind_info *) obstack_alloc (&objfile->objfile_obstack,
-					   sizeof (struct obj_unwind_info));
+  ui = (struct hppa_unwind_info *) obstack_alloc (&objfile->objfile_obstack,
+					   sizeof (struct hppa_unwind_info));
 
   ui->table = NULL;
   ui->cache = NULL;
@@ -616,18 +523,18 @@
 	 compare_unwind_entries);
 
   /* Keep a pointer to the unwind information.  */
-  if (objfile->obj_private == NULL)
+  obj_private = (struct hppa_objfile_private *) 
+	        objfile_data (objfile, hppa_objfile_priv_data);
+  if (obj_private == NULL)
     {
-      obj_private = (obj_private_data_t *)
-	obstack_alloc (&objfile->objfile_obstack,
-		       sizeof (obj_private_data_t));
+      obj_private = (struct hppa_objfile_private *)
+	obstack_alloc (&objfile->objfile_obstack, 
+                       sizeof (struct hppa_objfile_private));
+      set_objfile_data (objfile, hppa_objfile_priv_data, obj_private);
       obj_private->unwind_info = NULL;
       obj_private->so_info = NULL;
       obj_private->dp = 0;
-
-      objfile->obj_private = obj_private;
     }
-  obj_private = (obj_private_data_t *) objfile->obj_private;
   obj_private->unwind_info = ui;
 }
 
@@ -641,24 +548,35 @@
 {
   int first, middle, last;
   struct objfile *objfile;
+  struct hppa_objfile_private *priv;
+
+  if (hppa_debug)
+    fprintf_unfiltered (gdb_stdlog, "{ find_unwind_entry 0x%s -> ",
+		        paddr_nz (pc));
 
   /* A function at address 0?  Not in HP-UX! */
   if (pc == (CORE_ADDR) 0)
-    return NULL;
+    {
+      if (hppa_debug)
+	fprintf_unfiltered (gdb_stdlog, "NULL }\n");
+      return NULL;
+    }
 
   ALL_OBJFILES (objfile)
   {
-    struct obj_unwind_info *ui;
+    struct hppa_unwind_info *ui;
     ui = NULL;
-    if (objfile->obj_private)
-      ui = ((obj_private_data_t *) (objfile->obj_private))->unwind_info;
+    priv = objfile_data (objfile, hppa_objfile_priv_data);
+    if (priv)
+      ui = ((struct hppa_objfile_private *) priv)->unwind_info;
 
     if (!ui)
       {
 	read_unwind_info (objfile);
-	if (objfile->obj_private == NULL)
+        priv = objfile_data (objfile, hppa_objfile_priv_data);
+	if (priv == NULL)
 	  error ("Internal error reading unwind information.");
-	ui = ((obj_private_data_t *) (objfile->obj_private))->unwind_info;
+        ui = ((struct hppa_objfile_private *) priv)->unwind_info;
       }
 
     /* First, check the cache */
@@ -666,7 +584,12 @@
     if (ui->cache
 	&& pc >= ui->cache->region_start
 	&& pc <= ui->cache->region_end)
-      return ui->cache;
+      {
+	if (hppa_debug)
+	  fprintf_unfiltered (gdb_stdlog, "0x%s (cached) }\n",
+            paddr_nz ((CORE_ADDR) ui->cache));
+        return ui->cache;
+      }
 
     /* Not in the cache, do a binary search */
 
@@ -680,6 +603,9 @@
 	    && pc <= ui->table[middle].region_end)
 	  {
 	    ui->cache = &ui->table[middle];
+	    if (hppa_debug)
+	      fprintf_unfiltered (gdb_stdlog, "0x%s }\n",
+                paddr_nz ((CORE_ADDR) ui->cache));
 	    return &ui->table[middle];
 	  }
 
@@ -689,10 +615,14 @@
 	  first = middle + 1;
       }
   }				/* ALL_OBJFILES() */
+
+  if (hppa_debug)
+    fprintf_unfiltered (gdb_stdlog, "NULL (not found) }\n");
+
   return NULL;
 }
 
-const unsigned char *
+static const unsigned char *
 hppa_breakpoint_from_pc (CORE_ADDR *pc, int *len)
 {
   static const unsigned char breakpoint[] = {0x00, 0x01, 0x00, 0x04};
@@ -780,26 +710,6 @@
     return names[i];
 }
 
-
-
-/* Return the adjustment necessary to make for addresses on the stack
-   as presented by hpread.c.
-
-   This is necessary because of the stack direction on the PA and the
-   bizarre way in which someone (?) decided they wanted to handle
-   frame pointerless code in GDB.  */
-int
-hpread_adjust_stack_address (CORE_ADDR func_addr)
-{
-  struct unwind_table_entry *u;
-
-  u = find_unwind_entry (func_addr);
-  if (!u)
-    return 0;
-  else
-    return u->Total_frame_size << 3;
-}
-
 /* This function pushes a stack frame with arguments as part of the
    inferior function calling mechanism.
 
@@ -811,14 +721,11 @@
    arguments into their proper slots.  */
    
 CORE_ADDR
-hppa32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			struct regcache *regcache, CORE_ADDR bp_addr,
 			int nargs, struct value **args, CORE_ADDR sp,
 			int struct_return, CORE_ADDR struct_addr)
 {
-  /* NOTE: cagney/2004-02-27: This is a guess - its implemented by
-     reverse engineering testsuite failures.  */
-
   /* Stack base address at which any pass-by-reference parameters are
      stored.  */
   CORE_ADDR struct_end = 0;
@@ -832,12 +739,22 @@
   /* Two passes.  First pass computes the location of everything,
      second pass writes the bytes out.  */
   int write_pass;
+
+  /* Global pointer (r19) of the function we are trying to call.  */
+  CORE_ADDR gp;
+
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
   for (write_pass = 0; write_pass < 2; write_pass++)
     {
       CORE_ADDR struct_ptr = 0;
-      CORE_ADDR param_ptr = 0;
-      int reg = 27;	      /* NOTE: Registers go down.  */
+      /* The first parameter goes into sp-36, each stack slot is 4-bytes.  
+         struct_ptr is adjusted for each argument below, so the first
+	 argument will end up at sp-36.  */
+      CORE_ADDR param_ptr = 32;
       int i;
+      int small_struct = 0;
+
       for (i = 0; i < nargs; i++)
 	{
 	  struct value *arg = args[i];
@@ -868,23 +785,64 @@
 				      unpack_long (type,
 						   VALUE_CONTENTS (arg)));
 	    }
+	  else if (TYPE_CODE (type) == TYPE_CODE_FLT)
+            {
+	      /* Floating point value store, right aligned.  */
+	      param_len = align_up (TYPE_LENGTH (type), 4);
+	      memcpy (param_val, VALUE_CONTENTS (arg), param_len);
+            }
 	  else
 	    {
-	      /* Small struct value, store right aligned?  */
 	      param_len = align_up (TYPE_LENGTH (type), 4);
+
+	      /* Small struct value are stored right-aligned.  */
 	      memcpy (param_val + param_len - TYPE_LENGTH (type),
 		      VALUE_CONTENTS (arg), TYPE_LENGTH (type));
+
+	      /* Structures of size 5, 6 and 7 bytes are special in that
+	         the higher-ordered word is stored in the lower-ordered
+		 argument, and even though it is a 8-byte quantity the
+		 registers need not be 8-byte aligned.  */
+	      if (param_len > 4 && param_len < 8)
+		small_struct = 1;
 	    }
+
 	  param_ptr += param_len;
-	  reg -= param_len / 4;
+	  if (param_len == 8 && !small_struct)
+            param_ptr = align_up (param_ptr, 8);
+
+	  /* First 4 non-FP arguments are passed in gr26-gr23.
+	     First 4 32-bit FP arguments are passed in fr4L-fr7L.
+	     First 2 64-bit FP arguments are passed in fr5 and fr7.
+
+	     The rest go on the stack, starting at sp-36, towards lower
+	     addresses.  8-byte arguments must be aligned to a 8-byte
+	     stack boundary.  */
 	  if (write_pass)
 	    {
 	      write_memory (param_end - param_ptr, param_val, param_len);
-	      if (reg >= 23)
+
+	      /* There are some cases when we don't know the type
+		 expected by the callee (e.g. for variadic functions), so 
+		 pass the parameters in both general and fp regs.  */
+	      if (param_ptr <= 48)
 		{
-		  regcache_cooked_write (regcache, reg, param_val);
+		  int grreg = 26 - (param_ptr - 36) / 4;
+		  int fpLreg = 72 + (param_ptr - 36) / 4 * 2;
+		  int fpreg = 74 + (param_ptr - 32) / 8 * 4;
+
+		  regcache_cooked_write (regcache, grreg, param_val);
+		  regcache_cooked_write (regcache, fpLreg, param_val);
+
 		  if (param_len > 4)
-		    regcache_cooked_write (regcache, reg + 1, param_val + 4);
+		    {
+		      regcache_cooked_write (regcache, grreg + 1, 
+					     param_val + 4);
+
+		      regcache_cooked_write (regcache, fpreg, param_val);
+		      regcache_cooked_write (regcache, fpreg + 1, 
+					     param_val + 4);
+		    }
 		}
 	    }
 	}
@@ -892,14 +850,13 @@
       /* Update the various stack pointers.  */
       if (!write_pass)
 	{
-	  struct_end = sp + struct_ptr;
+	  struct_end = sp + align_up (struct_ptr, 64);
 	  /* PARAM_PTR already accounts for all the arguments passed
 	     by the user.  However, the ABI mandates minimum stack
 	     space allocations for outgoing arguments.  The ABI also
 	     mandates minimum stack alignments which we must
 	     preserve.  */
-	  param_end = struct_end + max (align_up (param_ptr, 8),
-					REG_PARM_STACK_SPACE);
+	  param_end = struct_end + align_up (param_ptr, 64);
 	}
     }
 
@@ -908,11 +865,18 @@
   if (struct_return)
     write_register (28, struct_addr);
 
-  /* Set the return address.  */
-  regcache_cooked_write_unsigned (regcache, RP_REGNUM, bp_addr);
+  gp = tdep->find_global_pointer (function);
 
-  /* The stack will have 32 bytes of additional space for a frame marker.  */
-  return param_end + 32;
+  if (gp != 0)
+    write_register (19, gp);
+
+  /* Set the return address.  */
+  regcache_cooked_write_unsigned (regcache, HPPA_RP_REGNUM, bp_addr);
+
+  /* Update the Stack Pointer.  */
+  regcache_cooked_write_unsigned (regcache, HPPA_SP_REGNUM, param_end);
+
+  return param_end;
 }
 
 /* This function pushes a stack frame with arguments as part of the
@@ -929,7 +893,7 @@
    to the callee, so we do that too.  */
    
 CORE_ADDR
-hppa64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			struct regcache *regcache, CORE_ADDR bp_addr,
 			int nargs, struct value **args, CORE_ADDR sp,
 			int struct_return, CORE_ADDR struct_addr)
@@ -1019,8 +983,7 @@
 	     space allocations for outgoing arguments.  The ABI also
 	     mandates minimum stack alignments which we must
 	     preserve.  */
-	  param_end = struct_end + max (align_up (param_ptr, 16),
-					REG_PARM_STACK_SPACE);
+	  param_end = struct_end + max (align_up (param_ptr, 16), 64);
 	}
     }
 
@@ -1030,13 +993,32 @@
     write_register (28, struct_addr);
 
   /* Set the return address.  */
-  regcache_cooked_write_unsigned (regcache, RP_REGNUM, bp_addr);
+  regcache_cooked_write_unsigned (regcache, HPPA_RP_REGNUM, bp_addr);
+
+  /* Update the Stack Pointer.  */
+  regcache_cooked_write_unsigned (regcache, HPPA_SP_REGNUM, param_end + 64);
 
   /* The stack will have 32 bytes of additional space for a frame marker.  */
   return param_end + 64;
 }
 
 static CORE_ADDR
+hppa32_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
+				   CORE_ADDR addr,
+				   struct target_ops *targ)
+{
+  if (addr & 2)
+    {
+      CORE_ADDR plabel;
+
+      plabel = addr & ~3;
+      target_read_memory(plabel, (char *)&addr, 4);
+    }
+
+  return addr;
+}
+
+static CORE_ADDR
 hppa32_frame_align (struct gdbarch *gdbarch, CORE_ADDR addr)
 {
   /* HP frames are 64-byte (or cache line) aligned (yes that's _byte_
@@ -1054,109 +1036,13 @@
 }
 
 
-/* elz: Used to lookup a symbol in the shared libraries.
-   This function calls shl_findsym, indirectly through a
-   call to __d_shl_get. __d_shl_get is in end.c, which is always
-   linked in by the hp compilers/linkers. 
-   The call to shl_findsym cannot be made directly because it needs
-   to be active in target address space. 
-   inputs: - minimal symbol pointer for the function we want to look up
-   - address in target space of the descriptor for the library
-   where we want to look the symbol up.
-   This address is retrieved using the 
-   som_solib_get_solib_by_pc function (somsolib.c). 
-   output: - real address in the library of the function.          
-   note: the handle can be null, in which case shl_findsym will look for
-   the symbol in all the loaded shared libraries.
-   files to look at if you need reference on this stuff:
-   dld.c, dld_shl_findsym.c
-   end.c
-   man entry for shl_findsym */
-
-CORE_ADDR
-find_stub_with_shl_get (struct minimal_symbol *function, CORE_ADDR handle)
-{
-  struct symbol *get_sym, *symbol2;
-  struct minimal_symbol *buff_minsym, *msymbol;
-  struct type *ftype;
-  struct value **args;
-  struct value *funcval;
-  struct value *val;
-
-  int x, namelen, err_value, tmp = -1;
-  CORE_ADDR endo_buff_addr, value_return_addr, errno_return_addr;
-  CORE_ADDR stub_addr;
-
-
-  args = alloca (sizeof (struct value *) * 8);		/* 6 for the arguments and one null one??? */
-  funcval = find_function_in_inferior ("__d_shl_get");
-  get_sym = lookup_symbol ("__d_shl_get", NULL, VAR_DOMAIN, NULL, NULL);
-  buff_minsym = lookup_minimal_symbol ("__buffer", NULL, NULL);
-  msymbol = lookup_minimal_symbol ("__shldp", NULL, NULL);
-  symbol2 = lookup_symbol ("__shldp", NULL, VAR_DOMAIN, NULL, NULL);
-  endo_buff_addr = SYMBOL_VALUE_ADDRESS (buff_minsym);
-  namelen = strlen (DEPRECATED_SYMBOL_NAME (function));
-  value_return_addr = endo_buff_addr + namelen;
-  ftype = check_typedef (SYMBOL_TYPE (get_sym));
-
-  /* do alignment */
-  if ((x = value_return_addr % 64) != 0)
-    value_return_addr = value_return_addr + 64 - x;
-
-  errno_return_addr = value_return_addr + 64;
-
-
-  /* set up stuff needed by __d_shl_get in buffer in end.o */
-
-  target_write_memory (endo_buff_addr, DEPRECATED_SYMBOL_NAME (function), namelen);
-
-  target_write_memory (value_return_addr, (char *) &tmp, 4);
-
-  target_write_memory (errno_return_addr, (char *) &tmp, 4);
-
-  target_write_memory (SYMBOL_VALUE_ADDRESS (msymbol),
-		       (char *) &handle, 4);
-
-  /* now prepare the arguments for the call */
-
-  args[0] = value_from_longest (TYPE_FIELD_TYPE (ftype, 0), 12);
-  args[1] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 1), SYMBOL_VALUE_ADDRESS (msymbol));
-  args[2] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 2), endo_buff_addr);
-  args[3] = value_from_longest (TYPE_FIELD_TYPE (ftype, 3), TYPE_PROCEDURE);
-  args[4] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 4), value_return_addr);
-  args[5] = value_from_pointer (TYPE_FIELD_TYPE (ftype, 5), errno_return_addr);
-
-  /* now call the function */
-
-  val = call_function_by_hand (funcval, 6, args);
-
-  /* now get the results */
-
-  target_read_memory (errno_return_addr, (char *) &err_value, sizeof (err_value));
-
-  target_read_memory (value_return_addr, (char *) &stub_addr, sizeof (stub_addr));
-  if (stub_addr <= 0)
-    error ("call to __d_shl_get failed, error code is %d", err_value);
-
-  return (stub_addr);
-}
-
-/* Cover routine for find_stub_with_shl_get to pass to catch_errors */
-static int
-cover_find_stub_with_shl_get (void *args_untyped)
-{
-  args_for_find_stub *args = args_untyped;
-  args->return_val = find_stub_with_shl_get (args->msym, args->solib_handle);
-  return 0;
-}
-
 /* Get the PC from %r31 if currently in a syscall.  Also mask out privilege
    bits.  */
 
-CORE_ADDR
+static CORE_ADDR
 hppa_target_read_pc (ptid_t ptid)
 {
-  int flags = read_register_pid (FLAGS_REGNUM, ptid);
+  int flags = read_register_pid (HPPA_FLAGS_REGNUM, ptid);
 
   /* The following test does not belong here.  It is OS-specific, and belongs
      in native code.  */
@@ -1164,16 +1050,16 @@
   if (flags & 2)
     return read_register_pid (31, ptid) & ~0x3;
 
-  return read_register_pid (PCOQ_HEAD_REGNUM, ptid) & ~0x3;
+  return read_register_pid (HPPA_PCOQ_HEAD_REGNUM, ptid) & ~0x3;
 }
 
 /* Write out the PC.  If currently in a syscall, then also write the new
    PC value into %r31.  */
 
-void
+static void
 hppa_target_write_pc (CORE_ADDR v, ptid_t ptid)
 {
-  int flags = read_register_pid (FLAGS_REGNUM, ptid);
+  int flags = read_register_pid (HPPA_FLAGS_REGNUM, ptid);
 
   /* The following test does not belong here.  It is OS-specific, and belongs
      in native code.  */
@@ -1183,8 +1069,8 @@
   if (flags & 2)
     write_register_pid (31, v | 0x3, ptid);
 
-  write_register_pid (PCOQ_HEAD_REGNUM, v, ptid);
-  write_register_pid (PCOQ_TAIL_REGNUM, v + 4, ptid);
+  write_register_pid (HPPA_PCOQ_HEAD_REGNUM, v, ptid);
+  write_register_pid (HPPA_PCOQ_TAIL_REGNUM, v + 4, ptid);
 }
 
 /* return the alignment of a type in bytes. Structures have the maximum
@@ -1222,515 +1108,6 @@
     }
 }
 
-/* Return one if PC is in the call path of a trampoline, else return zero.
-
-   Note we return one for *any* call trampoline (long-call, arg-reloc), not
-   just shared library trampolines (import, export).  */
-
-int
-hppa_in_solib_call_trampoline (CORE_ADDR pc, char *name)
-{
-  struct minimal_symbol *minsym;
-  struct unwind_table_entry *u;
-  static CORE_ADDR dyncall = 0;
-  static CORE_ADDR sr4export = 0;
-
-#ifdef GDB_TARGET_IS_HPPA_20W
-  /* PA64 has a completely different stub/trampoline scheme.  Is it
-     better?  Maybe.  It's certainly harder to determine with any
-     certainty that we are in a stub because we can not refer to the
-     unwinders to help. 
-
-     The heuristic is simple.  Try to lookup the current PC value in th
-     minimal symbol table.  If that fails, then assume we are not in a
-     stub and return.
-
-     Then see if the PC value falls within the section bounds for the
-     section containing the minimal symbol we found in the first
-     step.  If it does, then assume we are not in a stub and return.
-
-     Finally peek at the instructions to see if they look like a stub.  */
-  {
-    struct minimal_symbol *minsym;
-    asection *sec;
-    CORE_ADDR addr;
-    int insn, i;
-
-    minsym = lookup_minimal_symbol_by_pc (pc);
-    if (! minsym)
-      return 0;
-
-    sec = SYMBOL_BFD_SECTION (minsym);
-
-    if (bfd_get_section_vma (sec->owner, sec) <= pc
-	&& pc < (bfd_get_section_vma (sec->owner, sec)
-		 + bfd_section_size (sec->owner, sec)))
-      return 0;
-
-    /* We might be in a stub.  Peek at the instructions.  Stubs are 3
-       instructions long. */
-    insn = read_memory_integer (pc, 4);
-
-    /* Find out where we think we are within the stub.  */
-    if ((insn & 0xffffc00e) == 0x53610000)
-      addr = pc;
-    else if ((insn & 0xffffffff) == 0xe820d000)
-      addr = pc - 4;
-    else if ((insn & 0xffffc00e) == 0x537b0000)
-      addr = pc - 8;
-    else
-      return 0;
-
-    /* Now verify each insn in the range looks like a stub instruction.  */
-    insn = read_memory_integer (addr, 4);
-    if ((insn & 0xffffc00e) != 0x53610000)
-      return 0;
-	
-    /* Now verify each insn in the range looks like a stub instruction.  */
-    insn = read_memory_integer (addr + 4, 4);
-    if ((insn & 0xffffffff) != 0xe820d000)
-      return 0;
-    
-    /* Now verify each insn in the range looks like a stub instruction.  */
-    insn = read_memory_integer (addr + 8, 4);
-    if ((insn & 0xffffc00e) != 0x537b0000)
-      return 0;
-
-    /* Looks like a stub.  */
-    return 1;
-  }
-#endif
-
-  /* FIXME XXX - dyncall and sr4export must be initialized whenever we get a
-     new exec file */
-
-  /* First see if PC is in one of the two C-library trampolines.  */
-  if (!dyncall)
-    {
-      minsym = lookup_minimal_symbol ("$$dyncall", NULL, NULL);
-      if (minsym)
-	dyncall = SYMBOL_VALUE_ADDRESS (minsym);
-      else
-	dyncall = -1;
-    }
-
-  if (!sr4export)
-    {
-      minsym = lookup_minimal_symbol ("_sr4export", NULL, NULL);
-      if (minsym)
-	sr4export = SYMBOL_VALUE_ADDRESS (minsym);
-      else
-	sr4export = -1;
-    }
-
-  if (pc == dyncall || pc == sr4export)
-    return 1;
-
-  minsym = lookup_minimal_symbol_by_pc (pc);
-  if (minsym && strcmp (DEPRECATED_SYMBOL_NAME (minsym), ".stub") == 0)
-    return 1;
-
-  /* Get the unwind descriptor corresponding to PC, return zero
-     if no unwind was found.  */
-  u = find_unwind_entry (pc);
-  if (!u)
-    return 0;
-
-  /* If this isn't a linker stub, then return now.  */
-  if (u->stub_unwind.stub_type == 0)
-    return 0;
-
-  /* By definition a long-branch stub is a call stub.  */
-  if (u->stub_unwind.stub_type == LONG_BRANCH)
-    return 1;
-
-  /* The call and return path execute the same instructions within
-     an IMPORT stub!  So an IMPORT stub is both a call and return
-     trampoline.  */
-  if (u->stub_unwind.stub_type == IMPORT)
-    return 1;
-
-  /* Parameter relocation stubs always have a call path and may have a
-     return path.  */
-  if (u->stub_unwind.stub_type == PARAMETER_RELOCATION
-      || u->stub_unwind.stub_type == EXPORT)
-    {
-      CORE_ADDR addr;
-
-      /* Search forward from the current PC until we hit a branch
-         or the end of the stub.  */
-      for (addr = pc; addr <= u->region_end; addr += 4)
-	{
-	  unsigned long insn;
-
-	  insn = read_memory_integer (addr, 4);
-
-	  /* Does it look like a bl?  If so then it's the call path, if
-	     we find a bv or be first, then we're on the return path.  */
-	  if ((insn & 0xfc00e000) == 0xe8000000)
-	    return 1;
-	  else if ((insn & 0xfc00e001) == 0xe800c000
-		   || (insn & 0xfc000000) == 0xe0000000)
-	    return 0;
-	}
-
-      /* Should never happen.  */
-      warning ("Unable to find branch in parameter relocation stub.\n");
-      return 0;
-    }
-
-  /* Unknown stub type.  For now, just return zero.  */
-  return 0;
-}
-
-/* Return one if PC is in the return path of a trampoline, else return zero.
-
-   Note we return one for *any* call trampoline (long-call, arg-reloc), not
-   just shared library trampolines (import, export).  */
-
-int
-hppa_in_solib_return_trampoline (CORE_ADDR pc, char *name)
-{
-  struct unwind_table_entry *u;
-
-  /* Get the unwind descriptor corresponding to PC, return zero
-     if no unwind was found.  */
-  u = find_unwind_entry (pc);
-  if (!u)
-    return 0;
-
-  /* If this isn't a linker stub or it's just a long branch stub, then
-     return zero.  */
-  if (u->stub_unwind.stub_type == 0 || u->stub_unwind.stub_type == LONG_BRANCH)
-    return 0;
-
-  /* The call and return path execute the same instructions within
-     an IMPORT stub!  So an IMPORT stub is both a call and return
-     trampoline.  */
-  if (u->stub_unwind.stub_type == IMPORT)
-    return 1;
-
-  /* Parameter relocation stubs always have a call path and may have a
-     return path.  */
-  if (u->stub_unwind.stub_type == PARAMETER_RELOCATION
-      || u->stub_unwind.stub_type == EXPORT)
-    {
-      CORE_ADDR addr;
-
-      /* Search forward from the current PC until we hit a branch
-         or the end of the stub.  */
-      for (addr = pc; addr <= u->region_end; addr += 4)
-	{
-	  unsigned long insn;
-
-	  insn = read_memory_integer (addr, 4);
-
-	  /* Does it look like a bl?  If so then it's the call path, if
-	     we find a bv or be first, then we're on the return path.  */
-	  if ((insn & 0xfc00e000) == 0xe8000000)
-	    return 0;
-	  else if ((insn & 0xfc00e001) == 0xe800c000
-		   || (insn & 0xfc000000) == 0xe0000000)
-	    return 1;
-	}
-
-      /* Should never happen.  */
-      warning ("Unable to find branch in parameter relocation stub.\n");
-      return 0;
-    }
-
-  /* Unknown stub type.  For now, just return zero.  */
-  return 0;
-
-}
-
-/* Figure out if PC is in a trampoline, and if so find out where
-   the trampoline will jump to.  If not in a trampoline, return zero.
-
-   Simple code examination probably is not a good idea since the code
-   sequences in trampolines can also appear in user code.
-
-   We use unwinds and information from the minimal symbol table to
-   determine when we're in a trampoline.  This won't work for ELF
-   (yet) since it doesn't create stub unwind entries.  Whether or
-   not ELF will create stub unwinds or normal unwinds for linker
-   stubs is still being debated.
-
-   This should handle simple calls through dyncall or sr4export,
-   long calls, argument relocation stubs, and dyncall/sr4export
-   calling an argument relocation stub.  It even handles some stubs
-   used in dynamic executables.  */
-
-CORE_ADDR
-hppa_skip_trampoline_code (CORE_ADDR pc)
-{
-  long orig_pc = pc;
-  long prev_inst, curr_inst, loc;
-  static CORE_ADDR dyncall = 0;
-  static CORE_ADDR dyncall_external = 0;
-  static CORE_ADDR sr4export = 0;
-  struct minimal_symbol *msym;
-  struct unwind_table_entry *u;
-
-  /* FIXME XXX - dyncall and sr4export must be initialized whenever we get a
-     new exec file */
-
-  if (!dyncall)
-    {
-      msym = lookup_minimal_symbol ("$$dyncall", NULL, NULL);
-      if (msym)
-	dyncall = SYMBOL_VALUE_ADDRESS (msym);
-      else
-	dyncall = -1;
-    }
-
-  if (!dyncall_external)
-    {
-      msym = lookup_minimal_symbol ("$$dyncall_external", NULL, NULL);
-      if (msym)
-	dyncall_external = SYMBOL_VALUE_ADDRESS (msym);
-      else
-	dyncall_external = -1;
-    }
-
-  if (!sr4export)
-    {
-      msym = lookup_minimal_symbol ("_sr4export", NULL, NULL);
-      if (msym)
-	sr4export = SYMBOL_VALUE_ADDRESS (msym);
-      else
-	sr4export = -1;
-    }
-
-  /* Addresses passed to dyncall may *NOT* be the actual address
-     of the function.  So we may have to do something special.  */
-  if (pc == dyncall)
-    {
-      pc = (CORE_ADDR) read_register (22);
-
-      /* If bit 30 (counting from the left) is on, then pc is the address of
-         the PLT entry for this function, not the address of the function
-         itself.  Bit 31 has meaning too, but only for MPE.  */
-      if (pc & 0x2)
-	pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, TARGET_PTR_BIT / 8);
-    }
-  if (pc == dyncall_external)
-    {
-      pc = (CORE_ADDR) read_register (22);
-      pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, TARGET_PTR_BIT / 8);
-    }
-  else if (pc == sr4export)
-    pc = (CORE_ADDR) (read_register (22));
-
-  /* Get the unwind descriptor corresponding to PC, return zero
-     if no unwind was found.  */
-  u = find_unwind_entry (pc);
-  if (!u)
-    return 0;
-
-  /* If this isn't a linker stub, then return now.  */
-  /* elz: attention here! (FIXME) because of a compiler/linker 
-     error, some stubs which should have a non zero stub_unwind.stub_type 
-     have unfortunately a value of zero. So this function would return here
-     as if we were not in a trampoline. To fix this, we go look at the partial
-     symbol information, which reports this guy as a stub.
-     (FIXME): Unfortunately, we are not that lucky: it turns out that the 
-     partial symbol information is also wrong sometimes. This is because 
-     when it is entered (somread.c::som_symtab_read()) it can happen that
-     if the type of the symbol (from the som) is Entry, and the symbol is
-     in a shared library, then it can also be a trampoline.  This would
-     be OK, except that I believe the way they decide if we are ina shared library
-     does not work. SOOOO..., even if we have a regular function w/o trampolines
-     its minimal symbol can be assigned type mst_solib_trampoline.
-     Also, if we find that the symbol is a real stub, then we fix the unwind
-     descriptor, and define the stub type to be EXPORT.
-     Hopefully this is correct most of the times. */
-  if (u->stub_unwind.stub_type == 0)
-    {
-
-/* elz: NOTE (FIXME!) once the problem with the unwind information is fixed
-   we can delete all the code which appears between the lines */
-/*--------------------------------------------------------------------------*/
-      msym = lookup_minimal_symbol_by_pc (pc);
-
-      if (msym == NULL || MSYMBOL_TYPE (msym) != mst_solib_trampoline)
-	return orig_pc == pc ? 0 : pc & ~0x3;
-
-      else if (msym != NULL && MSYMBOL_TYPE (msym) == mst_solib_trampoline)
-	{
-	  struct objfile *objfile;
-	  struct minimal_symbol *msymbol;
-	  int function_found = 0;
-
-	  /* go look if there is another minimal symbol with the same name as 
-	     this one, but with type mst_text. This would happen if the msym
-	     is an actual trampoline, in which case there would be another
-	     symbol with the same name corresponding to the real function */
-
-	  ALL_MSYMBOLS (objfile, msymbol)
-	  {
-	    if (MSYMBOL_TYPE (msymbol) == mst_text
-		&& DEPRECATED_STREQ (DEPRECATED_SYMBOL_NAME (msymbol), DEPRECATED_SYMBOL_NAME (msym)))
-	      {
-		function_found = 1;
-		break;
-	      }
-	  }
-
-	  if (function_found)
-	    /* the type of msym is correct (mst_solib_trampoline), but
-	       the unwind info is wrong, so set it to the correct value */
-	    u->stub_unwind.stub_type = EXPORT;
-	  else
-	    /* the stub type info in the unwind is correct (this is not a
-	       trampoline), but the msym type information is wrong, it
-	       should be mst_text. So we need to fix the msym, and also
-	       get out of this function */
-	    {
-	      MSYMBOL_TYPE (msym) = mst_text;
-	      return orig_pc == pc ? 0 : pc & ~0x3;
-	    }
-	}
-
-/*--------------------------------------------------------------------------*/
-    }
-
-  /* It's a stub.  Search for a branch and figure out where it goes.
-     Note we have to handle multi insn branch sequences like ldil;ble.
-     Most (all?) other branches can be determined by examining the contents
-     of certain registers and the stack.  */
-
-  loc = pc;
-  curr_inst = 0;
-  prev_inst = 0;
-  while (1)
-    {
-      /* Make sure we haven't walked outside the range of this stub.  */
-      if (u != find_unwind_entry (loc))
-	{
-	  warning ("Unable to find branch in linker stub");
-	  return orig_pc == pc ? 0 : pc & ~0x3;
-	}
-
-      prev_inst = curr_inst;
-      curr_inst = read_memory_integer (loc, 4);
-
-      /* Does it look like a branch external using %r1?  Then it's the
-         branch from the stub to the actual function.  */
-      if ((curr_inst & 0xffe0e000) == 0xe0202000)
-	{
-	  /* Yup.  See if the previous instruction loaded
-	     a value into %r1.  If so compute and return the jump address.  */
-	  if ((prev_inst & 0xffe00000) == 0x20200000)
-	    return (extract_21 (prev_inst) + extract_17 (curr_inst)) & ~0x3;
-	  else
-	    {
-	      warning ("Unable to find ldil X,%%r1 before ble Y(%%sr4,%%r1).");
-	      return orig_pc == pc ? 0 : pc & ~0x3;
-	    }
-	}
-
-      /* Does it look like a be 0(sr0,%r21)? OR 
-         Does it look like a be, n 0(sr0,%r21)? OR 
-         Does it look like a bve (r21)? (this is on PA2.0)
-         Does it look like a bve, n(r21)? (this is also on PA2.0)
-         That's the branch from an
-         import stub to an export stub.
-
-         It is impossible to determine the target of the branch via
-         simple examination of instructions and/or data (consider
-         that the address in the plabel may be the address of the
-         bind-on-reference routine in the dynamic loader).
-
-         So we have try an alternative approach.
-
-         Get the name of the symbol at our current location; it should
-         be a stub symbol with the same name as the symbol in the
-         shared library.
-
-         Then lookup a minimal symbol with the same name; we should
-         get the minimal symbol for the target routine in the shared
-         library as those take precedence of import/export stubs.  */
-      if ((curr_inst == 0xe2a00000) ||
-	  (curr_inst == 0xe2a00002) ||
-	  (curr_inst == 0xeaa0d000) ||
-	  (curr_inst == 0xeaa0d002))
-	{
-	  struct minimal_symbol *stubsym, *libsym;
-
-	  stubsym = lookup_minimal_symbol_by_pc (loc);
-	  if (stubsym == NULL)
-	    {
-	      warning ("Unable to find symbol for 0x%lx", loc);
-	      return orig_pc == pc ? 0 : pc & ~0x3;
-	    }
-
-	  libsym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (stubsym), NULL, NULL);
-	  if (libsym == NULL)
-	    {
-	      warning ("Unable to find library symbol for %s\n",
-		       DEPRECATED_SYMBOL_NAME (stubsym));
-	      return orig_pc == pc ? 0 : pc & ~0x3;
-	    }
-
-	  return SYMBOL_VALUE (libsym);
-	}
-
-      /* Does it look like bl X,%rp or bl X,%r0?  Another way to do a
-         branch from the stub to the actual function.  */
-      /*elz */
-      else if ((curr_inst & 0xffe0e000) == 0xe8400000
-	       || (curr_inst & 0xffe0e000) == 0xe8000000
-	       || (curr_inst & 0xffe0e000) == 0xe800A000)
-	return (loc + extract_17 (curr_inst) + 8) & ~0x3;
-
-      /* Does it look like bv (rp)?   Note this depends on the
-         current stack pointer being the same as the stack
-         pointer in the stub itself!  This is a branch on from the
-         stub back to the original caller.  */
-      /*else if ((curr_inst & 0xffe0e000) == 0xe840c000) */
-      else if ((curr_inst & 0xffe0f000) == 0xe840c000)
-	{
-	  /* Yup.  See if the previous instruction loaded
-	     rp from sp - 8.  */
-	  if (prev_inst == 0x4bc23ff1)
-	    return (read_memory_integer
-		    (read_register (HPPA_SP_REGNUM) - 8, 4)) & ~0x3;
-	  else
-	    {
-	      warning ("Unable to find restore of %%rp before bv (%%rp).");
-	      return orig_pc == pc ? 0 : pc & ~0x3;
-	    }
-	}
-
-      /* elz: added this case to capture the new instruction
-         at the end of the return part of an export stub used by
-         the PA2.0: BVE, n (rp) */
-      else if ((curr_inst & 0xffe0f000) == 0xe840d000)
-	{
-	  return (read_memory_integer
-		  (read_register (HPPA_SP_REGNUM) - 24, TARGET_PTR_BIT / 8)) & ~0x3;
-	}
-
-      /* What about be,n 0(sr0,%rp)?  It's just another way we return to
-         the original caller from the stub.  Used in dynamic executables.  */
-      else if (curr_inst == 0xe0400002)
-	{
-	  /* The value we jump to is sitting in sp - 24.  But that's
-	     loaded several instructions before the be instruction.
-	     I guess we could check for the previous instruction being
-	     mtsp %r1,%sr0 if we want to do sanity checking.  */
-	  return (read_memory_integer
-		  (read_register (HPPA_SP_REGNUM) - 24, TARGET_PTR_BIT / 8)) & ~0x3;
-	}
-
-      /* Haven't found the branch yet, but we're still in the stub.
-         Keep looking.  */
-      loc += 4;
-    }
-}
-
-
 /* For the given instruction (INST), return any adjustment it makes
    to the stack pointer or zero for no adjustment. 
 
@@ -1744,11 +1121,11 @@
 
   /* The most common way to perform a stack adjustment ldo X(sp),sp */
   if ((inst & 0xffffc000) == 0x37de0000)
-    return extract_14 (inst);
+    return hppa_extract_14 (inst);
 
   /* stwm X,D(sp) */
   if ((inst & 0xffe00000) == 0x6fc00000)
-    return extract_14 (inst);
+    return hppa_extract_14 (inst);
 
   /* std,ma X,D(sp) */
   if ((inst & 0xffe00008) == 0x73c00008)
@@ -1758,16 +1135,16 @@
      save high bits in save_high21 for later use.  */
   if ((inst & 0xffe00000) == 0x28200000)
     {
-      save_high21 = extract_21 (inst);
+      save_high21 = hppa_extract_21 (inst);
       return 0;
     }
 
   if ((inst & 0xffff0000) == 0x343e0000)
-    return save_high21 + extract_14 (inst);
+    return save_high21 + hppa_extract_14 (inst);
 
   /* fstws as used by the HP compilers.  */
   if ((inst & 0xffffffe0) == 0x2fd01220)
-    return extract_5_load (inst);
+    return hppa_extract_5_load (inst);
 
   /* No adjustment.  */
   return 0;
@@ -1816,17 +1193,17 @@
       || (inst >> 26) == 0x1f
       || ((inst >> 26) == 0x1f
 	  && ((inst >> 6) == 0xa)))
-    return extract_5R_store (inst);
+    return hppa_extract_5R_store (inst);
 
   /* Does it look like a std?  */
   if ((inst >> 26) == 0x1c
       || ((inst >> 26) == 0x03
 	  && ((inst >> 6) & 0xf) == 0xb))
-    return extract_5R_store (inst);
+    return hppa_extract_5R_store (inst);
 
   /* Does it look like a stwm?  GCC & HPC may use this in prologues. */
   if ((inst >> 26) == 0x1b)
-    return extract_5R_store (inst);
+    return hppa_extract_5R_store (inst);
 
   /* Does it look like sth or stb?  HPC versions 9.0 and later use these
      too.  */
@@ -1834,7 +1211,7 @@
       || ((inst >> 26) == 0x3
 	  && (((inst >> 6) & 0xf) == 0x8
 	      || (inst >> 6) & 0xf) == 0x9))
-    return extract_5R_store (inst);
+    return hppa_extract_5R_store (inst);
 
   return 0;
 }
@@ -1852,14 +1229,14 @@
 {
   /* is this an FSTD ? */
   if ((inst & 0xfc00dfc0) == 0x2c001200)
-    return extract_5r_store (inst);
+    return hppa_extract_5r_store (inst);
   if ((inst & 0xfc000002) == 0x70000002)
-    return extract_5R_store (inst);
+    return hppa_extract_5R_store (inst);
   /* is this an FSTW ? */
   if ((inst & 0xfc00df80) == 0x24001200)
-    return extract_5r_store (inst);
+    return hppa_extract_5r_store (inst);
   if ((inst & 0xfc000002) == 0x7c000000)
-    return extract_5R_store (inst);
+    return hppa_extract_5R_store (inst);
   return 0;
 }
 
@@ -1950,7 +1327,7 @@
       old_save_sp = save_sp;
       old_stack_remaining = stack_remaining;
 
-      status = target_read_memory (pc, buf, 4);
+      status = read_memory_nobpt (pc, buf, 4);
       inst = extract_unsigned_integer (buf, 4);
 
       /* Yow! */
@@ -1999,7 +1376,7 @@
 	  while (reg_num >= (TARGET_PTR_BIT == 64 ? 19 : 23) && reg_num <= 26)
 	    {
 	      pc += 4;
-	      status = target_read_memory (pc, buf, 4);
+	      status = read_memory_nobpt (pc, buf, 4);
 	      inst = extract_unsigned_integer (buf, 4);
 	      if (status != 0)
 		return pc;
@@ -2012,7 +1389,7 @@
       reg_num = inst_saves_fr (inst);
       save_fr &= ~(1 << reg_num);
 
-      status = target_read_memory (pc + 4, buf, 4);
+      status = read_memory_nobpt (pc + 4, buf, 4);
       next_inst = extract_unsigned_integer (buf, 4);
 
       /* Yow! */
@@ -2039,13 +1416,13 @@
 	  while (reg_num >= 4 && reg_num <= (TARGET_PTR_BIT == 64 ? 11 : 7))
 	    {
 	      pc += 8;
-	      status = target_read_memory (pc, buf, 4);
+	      status = read_memory_nobpt (pc, buf, 4);
 	      inst = extract_unsigned_integer (buf, 4);
 	      if (status != 0)
 		return pc;
 	      if ((inst & 0xfc000000) != 0x34000000)
 		break;
-	      status = target_read_memory (pc + 4, buf, 4);
+	      status = read_memory_nobpt (pc + 4, buf, 4);
 	      next_inst = extract_unsigned_integer (buf, 4);
 	      if (status != 0)
 		return pc;
@@ -2143,7 +1520,7 @@
    Currently we must not skip more on the alpha, but we might the lenient
    stuff some day.  */
 
-CORE_ADDR
+static CORE_ADDR
 hppa_skip_prologue (CORE_ADDR pc)
 {
   unsigned long inst;
@@ -2184,10 +1561,20 @@
   CORE_ADDR this_sp;
   long frame_size;
   struct unwind_table_entry *u;
+  CORE_ADDR prologue_end;
   int i;
 
+  if (hppa_debug)
+    fprintf_unfiltered (gdb_stdlog, "{ hppa_frame_cache (frame=%d) -> ",
+      frame_relative_level(next_frame));
+
   if ((*this_cache) != NULL)
-    return (*this_cache);
+    {
+      if (hppa_debug)
+        fprintf_unfiltered (gdb_stdlog, "base=0x%s (cached) }", 
+          paddr_nz (((struct hppa_frame_cache *)*this_cache)->base));
+      return (*this_cache);
+    }
   cache = FRAME_OBSTACK_ZALLOC (struct hppa_frame_cache);
   (*this_cache) = cache;
   cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
@@ -2195,7 +1582,11 @@
   /* Yow! */
   u = find_unwind_entry (frame_func_unwind (next_frame));
   if (!u)
-    return (*this_cache);
+    {
+      if (hppa_debug)
+        fprintf_unfiltered (gdb_stdlog, "base=NULL (no unwind entry) }");
+      return (*this_cache);
+    }
 
   /* Turn the Entry_GR field into a bitmask.  */
   saved_gr_mask = 0;
@@ -2229,26 +1620,36 @@
      GCC code.  */
   {
     int final_iteration = 0;
-    CORE_ADDR pc;
-    CORE_ADDR end_pc = skip_prologue_using_sal (pc);
+    CORE_ADDR pc, end_pc;
     int looking_for_sp = u->Save_SP;
     int looking_for_rp = u->Save_RP;
     int fp_loc = -1;
-    if (end_pc == 0)
-      end_pc = frame_pc_unwind (next_frame);
+
+    /* We have to use hppa_skip_prologue instead of just 
+       skip_prologue_using_sal, in case we stepped into a function without
+       symbol information.  hppa_skip_prologue also bounds the returned
+       pc by the passed in pc, so it will not return a pc in the next
+       function.  */
+    prologue_end = hppa_skip_prologue (frame_func_unwind (next_frame));
+    end_pc = frame_pc_unwind (next_frame);
+
+    if (prologue_end != 0 && end_pc > prologue_end)
+      end_pc = prologue_end;
+
     frame_size = 0;
+
     for (pc = frame_func_unwind (next_frame);
 	 ((saved_gr_mask || saved_fr_mask
 	   || looking_for_sp || looking_for_rp
 	   || frame_size < (u->Total_frame_size << 3))
-	  && pc <= end_pc);
+	  && pc < end_pc);
 	 pc += 4)
       {
 	int reg;
 	char buf4[4];
-	long status = target_read_memory (pc, buf4, sizeof buf4);
+	long status = read_memory_nobpt (pc, buf4, sizeof buf4);
 	long inst = extract_unsigned_integer (buf4, sizeof buf4);
-	
+
 	/* Note the interesting effects of this instruction.  */
 	frame_size += prologue_inst_adjust_sp (inst);
 	
@@ -2257,12 +1658,12 @@
 	if (inst == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */
 	  {
 	    looking_for_rp = 0;
-	    cache->saved_regs[RP_REGNUM].addr = -20;
+	    cache->saved_regs[HPPA_RP_REGNUM].addr = -20;
 	  }
 	else if (inst == 0x0fc212c1) /* std rp,-0x10(sr0,sp) */
 	  {
 	    looking_for_rp = 0;
-	    cache->saved_regs[RP_REGNUM].addr = -16;
+	    cache->saved_regs[HPPA_RP_REGNUM].addr = -16;
 	  }
 	
 	/* Check to see if we saved SP into the stack.  This also
@@ -2281,7 +1682,7 @@
 	    && (!u->Save_SP || reg != HPPA_FP_REGNUM))
 	  {
 	    saved_gr_mask &= ~(1 << reg);
-	    if ((inst >> 26) == 0x1b && extract_14 (inst) >= 0)
+	    if ((inst >> 26) == 0x1b && hppa_extract_14 (inst) >= 0)
 	      /* stwm with a positive displacement is a _post_
 		 _modify_.  */
 	      cache->saved_regs[reg].addr = 0;
@@ -2295,9 +1696,9 @@
 		if ((inst >> 26) == 0x1c)
 		  offset = (inst & 0x1 ? -1 << 13 : 0) | (((inst >> 4) & 0x3ff) << 3);
 		else if ((inst >> 26) == 0x03)
-		  offset = low_sign_extend (inst & 0x1f, 5);
+		  offset = hppa_low_hppa_sign_extend (inst & 0x1f, 5);
 		else
-		  offset = extract_14 (inst);
+		  offset = hppa_extract_14 (inst);
 		
 		/* Handle code with and without frame pointers.  */
 		if (u->Save_SP)
@@ -2319,7 +1720,7 @@
 	/* ldo X(%r3),%r1 or ldo X(%r30),%r1.  */
 	if ((inst & 0xffffc000) == 0x34610000
 	    || (inst & 0xffffc000) == 0x37c10000)
-	  fp_loc = extract_14 (inst);
+	  fp_loc = hppa_extract_14 (inst);
 	
 	reg = inst_saves_fr (inst);
 	if (reg >= 12 && reg <= 21)
@@ -2333,7 +1734,7 @@
 		/* 1st HP CC FP register store.  After this
 		   instruction we've set enough state that the GCC and
 		   HPCC code are both handled in the same manner.  */
-		cache->saved_regs[reg + FP4_REGNUM + 4].addr = 0;
+		cache->saved_regs[reg + HPPA_FP4_REGNUM + 4].addr = 0;
 		fp_loc = 8;
 	      }
 	    else
@@ -2358,26 +1759,102 @@
        the current function (and is thus equivalent to the "saved"
        stack pointer.  */
     CORE_ADDR this_sp = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM);
-    /* FIXME: cagney/2004-02-22: This assumes that the frame has been
-       created.  If it hasn't everything will be out-of-wack.  */
-    if (u->Save_SP && trad_frame_addr_p (cache->saved_regs, HPPA_SP_REGNUM))
-      /* Both we're expecting the SP to be saved and the SP has been
-	 saved.  The entry SP value is saved at this frame's SP
-	 address.  */
-      cache->base = read_memory_integer (this_sp, TARGET_PTR_BIT / 8);
+    CORE_ADDR fp;
+
+    if (hppa_debug)
+      fprintf_unfiltered (gdb_stdlog, " (this_sp=0x%s, pc=0x%s, "
+		          "prologue_end=0x%s) ",
+		          paddr_nz (this_sp),
+			  paddr_nz (frame_pc_unwind (next_frame)),
+			  paddr_nz (prologue_end));
+
+     /* Check to see if a frame pointer is available, and use it for
+        frame unwinding if it is.
+ 
+        There are some situations where we need to rely on the frame
+        pointer to do stack unwinding.  For example, if a function calls
+        alloca (), the stack pointer can get adjusted inside the body of
+        the function.  In this case, the ABI requires that the compiler
+        maintain a frame pointer for the function.
+ 
+        The unwind record has a flag (alloca_frame) that indicates that
+        a function has a variable frame; unfortunately, gcc/binutils 
+        does not set this flag.  Instead, whenever a frame pointer is used
+        and saved on the stack, the Save_SP flag is set.  We use this to
+        decide whether to use the frame pointer for unwinding.
+	
+	fp may be zero if it is not available in an inner frame because
+	it has been modified by not yet saved.
+	
+        TODO: For the HP compiler, maybe we should use the alloca_frame flag 
+	instead of Save_SP.  */
+ 
+     fp = frame_unwind_register_unsigned (next_frame, HPPA_FP_REGNUM);
+ 
+     if (frame_pc_unwind (next_frame) >= prologue_end
+         && u->Save_SP && fp != 0)
+      {
+ 	cache->base = fp;
+ 
+ 	if (hppa_debug)
+	  fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [frame pointer] }",
+ 	    paddr_nz (cache->base));
+      }
+     else if (u->Save_SP 
+	      && trad_frame_addr_p (cache->saved_regs, HPPA_SP_REGNUM))
+      {
+            /* Both we're expecting the SP to be saved and the SP has been
+	       saved.  The entry SP value is saved at this frame's SP
+	       address.  */
+            cache->base = read_memory_integer (this_sp, TARGET_PTR_BIT / 8);
+
+	    if (hppa_debug)
+	      fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [saved] }",
+			          paddr_nz (cache->base));
+      }
     else
-      /* The prologue has been slowly allocating stack space.  Adjust
-	 the SP back.  */
-      cache->base = this_sp - frame_size;
+      {
+        /* The prologue has been slowly allocating stack space.  Adjust
+	   the SP back.  */
+        cache->base = this_sp - frame_size;
+	if (hppa_debug)
+	  fprintf_unfiltered (gdb_stdlog, " (base=0x%s) [unwind adjust] } ",
+			      paddr_nz (cache->base));
+
+      }
     trad_frame_set_value (cache->saved_regs, HPPA_SP_REGNUM, cache->base);
   }
 
   /* The PC is found in the "return register", "Millicode" uses "r31"
      as the return register while normal code uses "rp".  */
   if (u->Millicode)
-    cache->saved_regs[PCOQ_HEAD_REGNUM] = cache->saved_regs[31];
+    {
+      if (trad_frame_addr_p (cache->saved_regs, 31))
+        cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[31];
+      else
+	{
+	  ULONGEST r31 = frame_unwind_register_unsigned (next_frame, 31);
+	  trad_frame_set_value (cache->saved_regs, HPPA_PCOQ_HEAD_REGNUM, r31);
+        }
+    }
   else
-    cache->saved_regs[PCOQ_HEAD_REGNUM] = cache->saved_regs[RP_REGNUM];
+    {
+      if (trad_frame_addr_p (cache->saved_regs, HPPA_RP_REGNUM))
+        cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[HPPA_RP_REGNUM];
+      else
+	{
+	  ULONGEST rp = frame_unwind_register_unsigned (next_frame, HPPA_RP_REGNUM);
+	  trad_frame_set_value (cache->saved_regs, HPPA_PCOQ_HEAD_REGNUM, rp);
+	}
+    }
+
+  /* If the frame pointer was not saved in this frame, but we should be saving
+     it, set it to an invalid value so that another frame will not pick up the 
+     wrong frame pointer.  This can happen if we start unwinding after the 
+     frame pointer has been modified, but before we've saved it to the
+     stack.  */
+  if (u->Save_SP && !trad_frame_addr_p (cache->saved_regs, HPPA_FP_REGNUM))
+    trad_frame_set_value (cache->saved_regs, HPPA_FP_REGNUM, 0);
 
   {
     /* Convert all the offsets into addresses.  */
@@ -2389,6 +1866,9 @@
       }
   }
 
+  if (hppa_debug)
+    fprintf_unfiltered (gdb_stdlog, "base=0x%s }", 
+      paddr_nz (((struct hppa_frame_cache *)*this_cache)->base));
   return (*this_cache);
 }
 
@@ -2402,42 +1882,14 @@
 
 static void
 hppa_frame_prev_register (struct frame_info *next_frame,
-				 void **this_cache,
-				 int regnum, int *optimizedp,
-				 enum lval_type *lvalp, CORE_ADDR *addrp,
-				 int *realnump, void *valuep)
+			  void **this_cache,
+			  int regnum, int *optimizedp,
+			  enum lval_type *lvalp, CORE_ADDR *addrp,
+			  int *realnump, void *valuep)
 {
   struct hppa_frame_cache *info = hppa_frame_cache (next_frame, this_cache);
-  struct gdbarch *gdbarch = get_frame_arch (next_frame);
-  if (regnum == PCOQ_TAIL_REGNUM)
-    {
-      /* The PCOQ TAIL, or NPC, needs to be computed from the unwound
-	 PC register.  */
-      *optimizedp = 0;
-      *lvalp = not_lval;
-      *addrp = 0;
-      *realnump = 0;
-      if (valuep)
-	{
-	  int regsize = register_size (gdbarch, PCOQ_HEAD_REGNUM);
-	  CORE_ADDR pc;
-	  int optimized;
-	  enum lval_type lval;
-	  CORE_ADDR addr;
-	  int realnum;
-	  bfd_byte value[MAX_REGISTER_SIZE];
-	  trad_frame_prev_register (next_frame, info->saved_regs,
-				    PCOQ_HEAD_REGNUM, &optimized, &lval, &addr,
-				    &realnum, &value);
-	  pc = extract_unsigned_integer (&value, regsize);
-	  store_unsigned_integer (valuep, regsize, pc + 4);
-	}
-    }
-  else
-    {
-      trad_frame_prev_register (next_frame, info->saved_regs, regnum,
-				optimizedp, lvalp, addrp, realnump, valuep);
-    }
+  hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum,
+		                   optimizedp, lvalp, addrp, realnump, valuep);
 }
 
 static const struct frame_unwind hppa_frame_unwind =
@@ -2450,29 +1902,201 @@
 static const struct frame_unwind *
 hppa_frame_unwind_sniffer (struct frame_info *next_frame)
 {
-  return &hppa_frame_unwind;
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+
+  if (find_unwind_entry (pc))
+    return &hppa_frame_unwind;
+
+  return NULL;
 }
 
-static CORE_ADDR
-hppa_frame_base_address (struct frame_info *next_frame,
-				void **this_cache)
+/* This is a generic fallback frame unwinder that kicks in if we fail all
+   the other ones.  Normally we would expect the stub and regular unwinder
+   to work, but in some cases we might hit a function that just doesn't
+   have any unwind information available.  In this case we try to do
+   unwinding solely based on code reading.  This is obviously going to be
+   slow, so only use this as a last resort.  Currently this will only
+   identify the stack and pc for the frame.  */
+
+static struct hppa_frame_cache *
+hppa_fallback_frame_cache (struct frame_info *next_frame, void **this_cache)
 {
-  struct hppa_frame_cache *info = hppa_frame_cache (next_frame,
-							   this_cache);
-  return info->base;
+  struct hppa_frame_cache *cache;
+  unsigned int frame_size;
+  CORE_ADDR pc, start_pc, end_pc, cur_pc;
+
+  cache = FRAME_OBSTACK_ZALLOC (struct hppa_frame_cache);
+  (*this_cache) = cache;
+  cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+
+  pc = frame_func_unwind (next_frame);
+  cur_pc = frame_pc_unwind (next_frame);
+  frame_size = 0;
+
+  find_pc_partial_function (pc, NULL, &start_pc, &end_pc);
+
+  if (start_pc == 0 || end_pc == 0)
+    {
+      error ("Cannot find bounds of current function (@0x%s), unwinding will "
+	     "fail.", paddr_nz (pc));
+      return cache;
+    }
+
+  if (end_pc > cur_pc)
+    end_pc = cur_pc;
+
+  for (pc = start_pc; pc < end_pc; pc += 4)
+    {
+      unsigned int insn;
+
+      insn = read_memory_unsigned_integer (pc, 4);
+
+      frame_size += prologue_inst_adjust_sp (insn);
+
+      /* There are limited ways to store the return pointer into the
+	 stack.  */
+      if (insn == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */
+	 cache->saved_regs[HPPA_RP_REGNUM].addr = -20;
+      else if (insn == 0x0fc212c1) /* std rp,-0x10(sr0,sp) */
+	 cache->saved_regs[HPPA_RP_REGNUM].addr = -16;
+    }
+
+  cache->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM) - frame_size;
+  trad_frame_set_value (cache->saved_regs, HPPA_SP_REGNUM, cache->base);
+
+  if (trad_frame_addr_p (cache->saved_regs, HPPA_RP_REGNUM))
+    {
+      cache->saved_regs[HPPA_RP_REGNUM].addr += cache->base;
+      cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[HPPA_RP_REGNUM];
+    }
+  else
+    {
+      ULONGEST rp = frame_unwind_register_unsigned (next_frame, HPPA_RP_REGNUM);
+      trad_frame_set_value (cache->saved_regs, HPPA_PCOQ_HEAD_REGNUM, rp);
+    }
+
+  return cache;
 }
 
-static const struct frame_base hppa_frame_base = {
-  &hppa_frame_unwind,
-  hppa_frame_base_address,
-  hppa_frame_base_address,
-  hppa_frame_base_address
+static void
+hppa_fallback_frame_this_id (struct frame_info *next_frame, void **this_cache,
+			     struct frame_id *this_id)
+{
+  struct hppa_frame_cache *info = 
+    hppa_fallback_frame_cache (next_frame, this_cache);
+  (*this_id) = frame_id_build (info->base, frame_func_unwind (next_frame));
+}
+
+static void
+hppa_fallback_frame_prev_register (struct frame_info *next_frame,
+			  void **this_cache,
+			  int regnum, int *optimizedp,
+			  enum lval_type *lvalp, CORE_ADDR *addrp,
+			  int *realnump, void *valuep)
+{
+  struct hppa_frame_cache *info = 
+    hppa_fallback_frame_cache (next_frame, this_cache);
+  hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum,
+		                   optimizedp, lvalp, addrp, realnump, valuep);
+}
+
+static const struct frame_unwind hppa_fallback_frame_unwind =
+{
+  NORMAL_FRAME,
+  hppa_fallback_frame_this_id,
+  hppa_fallback_frame_prev_register
 };
 
-static const struct frame_base *
-hppa_frame_base_sniffer (struct frame_info *next_frame)
+static const struct frame_unwind *
+hppa_fallback_unwind_sniffer (struct frame_info *next_frame)
 {
-  return &hppa_frame_base;
+  return &hppa_fallback_frame_unwind;
+}
+
+/* Stub frames, used for all kinds of call stubs.  */
+struct hppa_stub_unwind_cache
+{
+  CORE_ADDR base;
+  struct trad_frame_saved_reg *saved_regs;
+};
+
+static struct hppa_stub_unwind_cache *
+hppa_stub_frame_unwind_cache (struct frame_info *next_frame,
+			      void **this_cache)
+{
+  struct gdbarch *gdbarch = get_frame_arch (next_frame);
+  struct hppa_stub_unwind_cache *info;
+  struct unwind_table_entry *u;
+
+  if (*this_cache)
+    return *this_cache;
+
+  info = FRAME_OBSTACK_ZALLOC (struct hppa_stub_unwind_cache);
+  *this_cache = info;
+  info->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+
+  info->base = frame_unwind_register_unsigned (next_frame, HPPA_SP_REGNUM);
+
+  if (gdbarch_osabi (gdbarch) == GDB_OSABI_HPUX_SOM)
+    {
+      /* HPUX uses export stubs in function calls; the export stub clobbers
+         the return value of the caller, and, later restores it from the
+	 stack.  */
+      u = find_unwind_entry (frame_pc_unwind (next_frame));
+
+      if (u && u->stub_unwind.stub_type == EXPORT)
+	{
+          info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].addr = info->base - 24;
+
+	  return info;
+	}
+    }
+
+  /* By default we assume that stubs do not change the rp.  */
+  info->saved_regs[HPPA_PCOQ_HEAD_REGNUM].realreg = HPPA_RP_REGNUM;
+
+  return info;
+}
+
+static void
+hppa_stub_frame_this_id (struct frame_info *next_frame,
+			 void **this_prologue_cache,
+			 struct frame_id *this_id)
+{
+  struct hppa_stub_unwind_cache *info
+    = hppa_stub_frame_unwind_cache (next_frame, this_prologue_cache);
+  *this_id = frame_id_build (info->base, frame_pc_unwind (next_frame));
+}
+
+static void
+hppa_stub_frame_prev_register (struct frame_info *next_frame,
+			       void **this_prologue_cache,
+			       int regnum, int *optimizedp,
+			       enum lval_type *lvalp, CORE_ADDR *addrp,
+			       int *realnump, void *valuep)
+{
+  struct hppa_stub_unwind_cache *info
+    = hppa_stub_frame_unwind_cache (next_frame, this_prologue_cache);
+  hppa_frame_prev_register_helper (next_frame, info->saved_regs, regnum,
+		                   optimizedp, lvalp, addrp, realnump, valuep);
+}
+
+static const struct frame_unwind hppa_stub_frame_unwind = {
+  NORMAL_FRAME,
+  hppa_stub_frame_this_id,
+  hppa_stub_frame_prev_register
+};
+
+static const struct frame_unwind *
+hppa_stub_unwind_sniffer (struct frame_info *next_frame)
+{
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+
+  if (pc == 0
+      || IN_SOLIB_CALL_TRAMPOLINE (pc, NULL)
+      || IN_SOLIB_RETURN_TRAMPOLINE (pc, NULL))
+    return &hppa_stub_frame_unwind;
+  return NULL;
 }
 
 static struct frame_id
@@ -2486,461 +2110,7 @@
 static CORE_ADDR
 hppa_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
 {
-  return frame_unwind_register_signed (next_frame, PCOQ_HEAD_REGNUM) & ~3;
-}
-
-/* Exception handling support for the HP-UX ANSI C++ compiler.
-   The compiler (aCC) provides a callback for exception events;
-   GDB can set a breakpoint on this callback and find out what
-   exception event has occurred. */
-
-/* The name of the hook to be set to point to the callback function */
-static char HP_ACC_EH_notify_hook[] = "__eh_notify_hook";
-/* The name of the function to be used to set the hook value */
-static char HP_ACC_EH_set_hook_value[] = "__eh_set_hook_value";
-/* The name of the callback function in end.o */
-static char HP_ACC_EH_notify_callback[] = "__d_eh_notify_callback";
-/* Name of function in end.o on which a break is set (called by above) */
-static char HP_ACC_EH_break[] = "__d_eh_break";
-/* Name of flag (in end.o) that enables catching throws */
-static char HP_ACC_EH_catch_throw[] = "__d_eh_catch_throw";
-/* Name of flag (in end.o) that enables catching catching */
-static char HP_ACC_EH_catch_catch[] = "__d_eh_catch_catch";
-/* The enum used by aCC */
-typedef enum
-  {
-    __EH_NOTIFY_THROW,
-    __EH_NOTIFY_CATCH
-  }
-__eh_notification;
-
-/* Is exception-handling support available with this executable? */
-static int hp_cxx_exception_support = 0;
-/* Has the initialize function been run? */
-int hp_cxx_exception_support_initialized = 0;
-/* Similar to above, but imported from breakpoint.c -- non-target-specific */
-extern int exception_support_initialized;
-/* Address of __eh_notify_hook */
-static CORE_ADDR eh_notify_hook_addr = 0;
-/* Address of __d_eh_notify_callback */
-static CORE_ADDR eh_notify_callback_addr = 0;
-/* Address of __d_eh_break */
-static CORE_ADDR eh_break_addr = 0;
-/* Address of __d_eh_catch_catch */
-static CORE_ADDR eh_catch_catch_addr = 0;
-/* Address of __d_eh_catch_throw */
-static CORE_ADDR eh_catch_throw_addr = 0;
-/* Sal for __d_eh_break */
-static struct symtab_and_line *break_callback_sal = 0;
-
-/* Code in end.c expects __d_pid to be set in the inferior,
-   otherwise __d_eh_notify_callback doesn't bother to call
-   __d_eh_break!  So we poke the pid into this symbol
-   ourselves.
-   0 => success
-   1 => failure  */
-int
-setup_d_pid_in_inferior (void)
-{
-  CORE_ADDR anaddr;
-  struct minimal_symbol *msymbol;
-  char buf[4];			/* FIXME 32x64? */
-
-  /* Slam the pid of the process into __d_pid; failing is only a warning!  */
-  msymbol = lookup_minimal_symbol ("__d_pid", NULL, symfile_objfile);
-  if (msymbol == NULL)
-    {
-      warning ("Unable to find __d_pid symbol in object file.");
-      warning ("Suggest linking executable with -g (links in /opt/langtools/lib/end.o).");
-      return 1;
-    }
-
-  anaddr = SYMBOL_VALUE_ADDRESS (msymbol);
-  store_unsigned_integer (buf, 4, PIDGET (inferior_ptid)); /* FIXME 32x64? */
-  if (target_write_memory (anaddr, buf, 4))	/* FIXME 32x64? */
-    {
-      warning ("Unable to write __d_pid");
-      warning ("Suggest linking executable with -g (links in /opt/langtools/lib/end.o).");
-      return 1;
-    }
-  return 0;
-}
-
-/* Initialize exception catchpoint support by looking for the
-   necessary hooks/callbacks in end.o, etc., and set the hook value to
-   point to the required debug function
-
-   Return 0 => failure
-   1 => success          */
-
-static int
-initialize_hp_cxx_exception_support (void)
-{
-  struct symtabs_and_lines sals;
-  struct cleanup *old_chain;
-  struct cleanup *canonical_strings_chain = NULL;
-  int i;
-  char *addr_start;
-  char *addr_end = NULL;
-  char **canonical = (char **) NULL;
-  int thread = -1;
-  struct symbol *sym = NULL;
-  struct minimal_symbol *msym = NULL;
-  struct objfile *objfile;
-  asection *shlib_info;
-
-  /* Detect and disallow recursion.  On HP-UX with aCC, infinite
-     recursion is a possibility because finding the hook for exception
-     callbacks involves making a call in the inferior, which means
-     re-inserting breakpoints which can re-invoke this code */
-
-  static int recurse = 0;
-  if (recurse > 0)
-    {
-      hp_cxx_exception_support_initialized = 0;
-      exception_support_initialized = 0;
-      return 0;
-    }
-
-  hp_cxx_exception_support = 0;
-
-  /* First check if we have seen any HP compiled objects; if not,
-     it is very unlikely that HP's idiosyncratic callback mechanism
-     for exception handling debug support will be available!
-     This will percolate back up to breakpoint.c, where our callers
-     will decide to try the g++ exception-handling support instead. */
-  if (!hp_som_som_object_present)
-    return 0;
-
-  /* We have a SOM executable with SOM debug info; find the hooks */
-
-  /* First look for the notify hook provided by aCC runtime libs */
-  /* If we find this symbol, we conclude that the executable must
-     have HP aCC exception support built in.  If this symbol is not
-     found, even though we're a HP SOM-SOM file, we may have been
-     built with some other compiler (not aCC).  This results percolates
-     back up to our callers in breakpoint.c which can decide to
-     try the g++ style of exception support instead.
-     If this symbol is found but the other symbols we require are
-     not found, there is something weird going on, and g++ support
-     should *not* be tried as an alternative.
-
-     ASSUMPTION: Only HP aCC code will have __eh_notify_hook defined.  
-     ASSUMPTION: HP aCC and g++ modules cannot be linked together. */
-
-  /* libCsup has this hook; it'll usually be non-debuggable */
-  msym = lookup_minimal_symbol (HP_ACC_EH_notify_hook, NULL, NULL);
-  if (msym)
-    {
-      eh_notify_hook_addr = SYMBOL_VALUE_ADDRESS (msym);
-      hp_cxx_exception_support = 1;
-    }
-  else
-    {
-      warning ("Unable to find exception callback hook (%s).", HP_ACC_EH_notify_hook);
-      warning ("Executable may not have been compiled debuggable with HP aCC.");
-      warning ("GDB will be unable to intercept exception events.");
-      eh_notify_hook_addr = 0;
-      hp_cxx_exception_support = 0;
-      return 0;
-    }
-
-  /* Next look for the notify callback routine in end.o */
-  /* This is always available in the SOM symbol dictionary if end.o is linked in */
-  msym = lookup_minimal_symbol (HP_ACC_EH_notify_callback, NULL, NULL);
-  if (msym)
-    {
-      eh_notify_callback_addr = SYMBOL_VALUE_ADDRESS (msym);
-      hp_cxx_exception_support = 1;
-    }
-  else
-    {
-      warning ("Unable to find exception callback routine (%s).", HP_ACC_EH_notify_callback);
-      warning ("Suggest linking executable with -g (links in /opt/langtools/lib/end.o).");
-      warning ("GDB will be unable to intercept exception events.");
-      eh_notify_callback_addr = 0;
-      return 0;
-    }
-
-#ifndef GDB_TARGET_IS_HPPA_20W
-  /* Check whether the executable is dynamically linked or archive bound */
-  /* With an archive-bound executable we can use the raw addresses we find
-     for the callback function, etc. without modification. For an executable
-     with shared libraries, we have to do more work to find the plabel, which
-     can be the target of a call through $$dyncall from the aCC runtime support
-     library (libCsup) which is linked shared by default by aCC. */
-  /* This test below was copied from somsolib.c/somread.c.  It may not be a very
-     reliable one to test that an executable is linked shared. pai/1997-07-18 */
-  shlib_info = bfd_get_section_by_name (symfile_objfile->obfd, "$SHLIB_INFO$");
-  if (shlib_info && (bfd_section_size (symfile_objfile->obfd, shlib_info) != 0))
-    {
-      /* The minsym we have has the local code address, but that's not the
-         plabel that can be used by an inter-load-module call. */
-      /* Find solib handle for main image (which has end.o), and use that
-         and the min sym as arguments to __d_shl_get() (which does the equivalent
-         of shl_findsym()) to find the plabel. */
-
-      args_for_find_stub args;
-      static char message[] = "Error while finding exception callback hook:\n";
-
-      args.solib_handle = som_solib_get_solib_by_pc (eh_notify_callback_addr);
-      args.msym = msym;
-      args.return_val = 0;
-
-      recurse++;
-      catch_errors (cover_find_stub_with_shl_get, &args, message,
-		    RETURN_MASK_ALL);
-      eh_notify_callback_addr = args.return_val;
-      recurse--;
-
-      exception_catchpoints_are_fragile = 1;
-
-      if (!eh_notify_callback_addr)
-	{
-	  /* We can get here either if there is no plabel in the export list
-	     for the main image, or if something strange happened (?) */
-	  warning ("Couldn't find a plabel (indirect function label) for the exception callback.");
-	  warning ("GDB will not be able to intercept exception events.");
-	  return 0;
-	}
-    }
-  else
-    exception_catchpoints_are_fragile = 0;
-#endif
-
-  /* Now, look for the breakpointable routine in end.o */
-  /* This should also be available in the SOM symbol dict. if end.o linked in */
-  msym = lookup_minimal_symbol (HP_ACC_EH_break, NULL, NULL);
-  if (msym)
-    {
-      eh_break_addr = SYMBOL_VALUE_ADDRESS (msym);
-      hp_cxx_exception_support = 1;
-    }
-  else
-    {
-      warning ("Unable to find exception callback routine to set breakpoint (%s).", HP_ACC_EH_break);
-      warning ("Suggest linking executable with -g (link in /opt/langtools/lib/end.o).");
-      warning ("GDB will be unable to intercept exception events.");
-      eh_break_addr = 0;
-      return 0;
-    }
-
-  /* Next look for the catch enable flag provided in end.o */
-  sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
-		       VAR_DOMAIN, 0, (struct symtab **) NULL);
-  if (sym)			/* sometimes present in debug info */
-    {
-      eh_catch_catch_addr = SYMBOL_VALUE_ADDRESS (sym);
-      hp_cxx_exception_support = 1;
-    }
-  else
-    /* otherwise look in SOM symbol dict. */
-    {
-      msym = lookup_minimal_symbol (HP_ACC_EH_catch_catch, NULL, NULL);
-      if (msym)
-	{
-	  eh_catch_catch_addr = SYMBOL_VALUE_ADDRESS (msym);
-	  hp_cxx_exception_support = 1;
-	}
-      else
-	{
-	  warning ("Unable to enable interception of exception catches.");
-	  warning ("Executable may not have been compiled debuggable with HP aCC.");
-	  warning ("Suggest linking executable with -g (link in /opt/langtools/lib/end.o).");
-	  return 0;
-	}
-    }
-
-  /* Next look for the catch enable flag provided end.o */
-  sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
-		       VAR_DOMAIN, 0, (struct symtab **) NULL);
-  if (sym)			/* sometimes present in debug info */
-    {
-      eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (sym);
-      hp_cxx_exception_support = 1;
-    }
-  else
-    /* otherwise look in SOM symbol dict. */
-    {
-      msym = lookup_minimal_symbol (HP_ACC_EH_catch_throw, NULL, NULL);
-      if (msym)
-	{
-	  eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (msym);
-	  hp_cxx_exception_support = 1;
-	}
-      else
-	{
-	  warning ("Unable to enable interception of exception throws.");
-	  warning ("Executable may not have been compiled debuggable with HP aCC.");
-	  warning ("Suggest linking executable with -g (link in /opt/langtools/lib/end.o).");
-	  return 0;
-	}
-    }
-
-  /* Set the flags */
-  hp_cxx_exception_support = 2;	/* everything worked so far */
-  hp_cxx_exception_support_initialized = 1;
-  exception_support_initialized = 1;
-
-  return 1;
-}
-
-/* Target operation for enabling or disabling interception of
-   exception events.
-   KIND is either EX_EVENT_THROW or EX_EVENT_CATCH
-   ENABLE is either 0 (disable) or 1 (enable).
-   Return value is NULL if no support found;
-   -1 if something went wrong,
-   or a pointer to a symtab/line struct if the breakpointable
-   address was found. */
-
-struct symtab_and_line *
-child_enable_exception_callback (enum exception_event_kind kind, int enable)
-{
-  char buf[4];
-
-  if (!exception_support_initialized || !hp_cxx_exception_support_initialized)
-    if (!initialize_hp_cxx_exception_support ())
-      return NULL;
-
-  switch (hp_cxx_exception_support)
-    {
-    case 0:
-      /* Assuming no HP support at all */
-      return NULL;
-    case 1:
-      /* HP support should be present, but something went wrong */
-      return (struct symtab_and_line *) -1;	/* yuck! */
-      /* there may be other cases in the future */
-    }
-
-  /* Set the EH hook to point to the callback routine */
-  store_unsigned_integer (buf, 4, enable ? eh_notify_callback_addr : 0);	/* FIXME 32x64 problem */
-  /* pai: (temp) FIXME should there be a pack operation first? */
-  if (target_write_memory (eh_notify_hook_addr, buf, 4))	/* FIXME 32x64 problem */
-    {
-      warning ("Could not write to target memory for exception event callback.");
-      warning ("Interception of exception events may not work.");
-      return (struct symtab_and_line *) -1;
-    }
-  if (enable)
-    {
-      /* Ensure that __d_pid is set up correctly -- end.c code checks this. :-( */
-      if (PIDGET (inferior_ptid) > 0)
-	{
-	  if (setup_d_pid_in_inferior ())
-	    return (struct symtab_and_line *) -1;
-	}
-      else
-	{
-	  warning ("Internal error: Invalid inferior pid?  Cannot intercept exception events.");
-	  return (struct symtab_and_line *) -1;
-	}
-    }
-
-  switch (kind)
-    {
-    case EX_EVENT_THROW:
-      store_unsigned_integer (buf, 4, enable ? 1 : 0);
-      if (target_write_memory (eh_catch_throw_addr, buf, 4))	/* FIXME 32x64? */
-	{
-	  warning ("Couldn't enable exception throw interception.");
-	  return (struct symtab_and_line *) -1;
-	}
-      break;
-    case EX_EVENT_CATCH:
-      store_unsigned_integer (buf, 4, enable ? 1 : 0);
-      if (target_write_memory (eh_catch_catch_addr, buf, 4))	/* FIXME 32x64? */
-	{
-	  warning ("Couldn't enable exception catch interception.");
-	  return (struct symtab_and_line *) -1;
-	}
-      break;
-    default:
-      error ("Request to enable unknown or unsupported exception event.");
-    }
-
-  /* Copy break address into new sal struct, malloc'ing if needed. */
-  if (!break_callback_sal)
-    {
-      break_callback_sal = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line));
-    }
-  init_sal (break_callback_sal);
-  break_callback_sal->symtab = NULL;
-  break_callback_sal->pc = eh_break_addr;
-  break_callback_sal->line = 0;
-  break_callback_sal->end = eh_break_addr;
-
-  return break_callback_sal;
-}
-
-/* Record some information about the current exception event */
-static struct exception_event_record current_ex_event;
-/* Convenience struct */
-static struct symtab_and_line null_symtab_and_line =
-{NULL, 0, 0, 0};
-
-/* Report current exception event.  Returns a pointer to a record
-   that describes the kind of the event, where it was thrown from,
-   and where it will be caught.  More information may be reported
-   in the future */
-struct exception_event_record *
-child_get_current_exception_event (void)
-{
-  CORE_ADDR event_kind;
-  CORE_ADDR throw_addr;
-  CORE_ADDR catch_addr;
-  struct frame_info *fi, *curr_frame;
-  int level = 1;
-
-  curr_frame = get_current_frame ();
-  if (!curr_frame)
-    return (struct exception_event_record *) NULL;
-
-  /* Go up one frame to __d_eh_notify_callback, because at the
-     point when this code is executed, there's garbage in the
-     arguments of __d_eh_break. */
-  fi = find_relative_frame (curr_frame, &level);
-  if (level != 0)
-    return (struct exception_event_record *) NULL;
-
-  select_frame (fi);
-
-  /* Read in the arguments */
-  /* __d_eh_notify_callback() is called with 3 arguments:
-     1. event kind catch or throw
-     2. the target address if known
-     3. a flag -- not sure what this is. pai/1997-07-17 */
-  event_kind = read_register (ARG0_REGNUM);
-  catch_addr = read_register (ARG1_REGNUM);
-
-  /* Now go down to a user frame */
-  /* For a throw, __d_eh_break is called by
-     __d_eh_notify_callback which is called by
-     __notify_throw which is called
-     from user code.
-     For a catch, __d_eh_break is called by
-     __d_eh_notify_callback which is called by
-     <stackwalking stuff> which is called by
-     __throw__<stuff> or __rethrow_<stuff> which is called
-     from user code. */
-  /* FIXME: Don't use such magic numbers; search for the frames */
-  level = (event_kind == EX_EVENT_THROW) ? 3 : 4;
-  fi = find_relative_frame (curr_frame, &level);
-  if (level != 0)
-    return (struct exception_event_record *) NULL;
-
-  select_frame (fi);
-  throw_addr = get_frame_pc (fi);
-
-  /* Go back to original (top) frame */
-  select_frame (curr_frame);
-
-  current_ex_event.kind = (enum exception_event_kind) event_kind;
-  current_ex_event.throw_sal = find_pc_line (throw_addr, 1);
-  current_ex_event.catch_sal = find_pc_line (catch_addr, 1);
-
-  return &current_ex_event;
+  return frame_unwind_register_signed (next_frame, HPPA_PCOQ_HEAD_REGNUM) & ~3;
 }
 
 /* Instead of this nasty cast, add a method pvoid() that prints out a
@@ -3033,29 +2203,14 @@
      front to the back.  But what do we put in the back?  What
      instruction comes after that one?  Because of the branch delay
      slot, the next insn is always at the back + 4.  */
-  write_register (PCOQ_HEAD_REGNUM, read_register (PCOQ_TAIL_REGNUM));
-  write_register (PCSQ_HEAD_REGNUM, read_register (PCSQ_TAIL_REGNUM));
+  write_register (HPPA_PCOQ_HEAD_REGNUM, read_register (HPPA_PCOQ_TAIL_REGNUM));
+  write_register (HPPA_PCSQ_HEAD_REGNUM, read_register (HPPA_PCSQ_TAIL_REGNUM));
 
-  write_register (PCOQ_TAIL_REGNUM, read_register (PCOQ_TAIL_REGNUM) + 4);
+  write_register (HPPA_PCOQ_TAIL_REGNUM, read_register (HPPA_PCOQ_TAIL_REGNUM) + 4);
   /* We can leave the tail's space the same, since there's no jump.  */
 }
 
 int
-hppa_reg_struct_has_addr (int gcc_p, struct type *type)
-{
-  /* On the PA, any pass-by-value structure > 8 bytes is actually passed
-     via a pointer regardless of its type or the compiler used.  */
-  return (TYPE_LENGTH (type) > 8);
-}
-
-int
-hppa_inner_than (CORE_ADDR lhs, CORE_ADDR rhs)
-{
-  /* Stack grows upward */
-  return (lhs > rhs);
-}
-
-int
 hppa_pc_requires_run_before_use (CORE_ADDR pc)
 {
   /* Sometimes we may pluck out a minimal symbol that has a negative address.
@@ -3089,8 +2244,8 @@
   /* brobecker 2002/11/07: Couldn't we use a ULONGEST here? It would
      avoid the type cast.  I'm leaving it as is for now as I'm doing
      semi-mechanical multiarching-related changes.  */
-  const int ipsw = (int) read_register (IPSW_REGNUM);
-  const int flags = (int) read_register (FLAGS_REGNUM);
+  const int ipsw = (int) read_register (HPPA_IPSW_REGNUM);
+  const int flags = (int) read_register (HPPA_FLAGS_REGNUM);
 
   return ((ipsw & 0x00200000) && !(flags & 0x2));
 }
@@ -3101,7 +2256,7 @@
 static struct type *
 hppa32_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
-   if (reg_nr < FP4_REGNUM)
+   if (reg_nr < HPPA_FP4_REGNUM)
      return builtin_type_uint32;
    else
      return builtin_type_ieee_single_big;
@@ -3113,7 +2268,7 @@
 static struct type *
 hppa64_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
-   if (reg_nr < FP4_REGNUM)
+   if (reg_nr < HPPA_FP4_REGNUM)
      return builtin_type_uint64;
    else
      return builtin_type_ieee_double_big;
@@ -3122,17 +2277,17 @@
 /* Return True if REGNUM is not a register available to the user
    through ptrace().  */
 
-int
+static int
 hppa_cannot_store_register (int regnum)
 {
   return (regnum == 0
-          || regnum == PCSQ_HEAD_REGNUM
-          || (regnum >= PCSQ_TAIL_REGNUM && regnum < IPSW_REGNUM)
-          || (regnum > IPSW_REGNUM && regnum < FP4_REGNUM));
+          || regnum == HPPA_PCSQ_HEAD_REGNUM
+          || (regnum >= HPPA_PCSQ_TAIL_REGNUM && regnum < HPPA_IPSW_REGNUM)
+          || (regnum > HPPA_IPSW_REGNUM && regnum < HPPA_FP4_REGNUM));
 
 }
 
-CORE_ADDR
+static CORE_ADDR
 hppa_smash_text_address (CORE_ADDR addr)
 {
   /* The low two bits of the PC on the PA contain the privilege level.
@@ -3151,10 +2306,62 @@
 			     struct type *type)
 {
   CORE_ADDR addr;
-  get_frame_register (frame, R0_REGNUM + 26 - argi, &addr);
+  get_frame_register (frame, HPPA_R0_REGNUM + 26 - argi, &addr);
   return addr;
 }
 
+static void
+hppa_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+			   int regnum, void *buf)
+{
+    ULONGEST tmp;
+
+    regcache_raw_read_unsigned (regcache, regnum, &tmp);
+    if (regnum == HPPA_PCOQ_HEAD_REGNUM || regnum == HPPA_PCOQ_TAIL_REGNUM)
+      tmp &= ~0x3;
+    store_unsigned_integer (buf, sizeof(tmp), tmp);
+}
+
+static CORE_ADDR
+hppa_find_global_pointer (struct value *function)
+{
+  return 0;
+}
+
+void
+hppa_frame_prev_register_helper (struct frame_info *next_frame,
+			         struct trad_frame_saved_reg saved_regs[],
+				 int regnum, int *optimizedp,
+				 enum lval_type *lvalp, CORE_ADDR *addrp,
+				 int *realnump, void *valuep)
+{
+  if (regnum == HPPA_PCOQ_TAIL_REGNUM)
+    {
+      if (valuep)
+	{
+	  CORE_ADDR pc;
+
+	  trad_frame_prev_register (next_frame, saved_regs,
+				    HPPA_PCOQ_HEAD_REGNUM, optimizedp,
+				    lvalp, addrp, realnump, valuep);
+
+	  pc = extract_unsigned_integer (valuep, 4);
+	  store_unsigned_integer (valuep, 4, pc + 4);
+	}
+
+      /* It's a computed value.  */
+      *optimizedp = 0;
+      *lvalp = not_lval;
+      *addrp = 0;
+      *realnump = -1;
+      return;
+    }
+
+  trad_frame_prev_register (next_frame, saved_regs, regnum,
+                            optimizedp, lvalp, addrp, realnump, valuep);
+}
+
+
 /* Here is a table of C type sizes on hppa with various compiles
    and options.  I measured this on PA 9000/800 with HP-UX 11.11
    and these compilers:
@@ -3210,7 +2417,7 @@
     return (arches->gdbarch);
 
   /* If none found, then allocate and initialize one.  */
-  tdep = XMALLOC (struct gdbarch_tdep);
+  tdep = XZALLOC (struct gdbarch_tdep);
   gdbarch = gdbarch_alloc (&info, tdep);
 
   /* Determine from the bfd_arch_info structure if we are dealing with
@@ -3222,6 +2429,8 @@
   else
     tdep->bytes_per_address = 4;
 
+  tdep->find_global_pointer = hppa_find_global_pointer;
+
   /* Some parts of the gdbarch vector depend on whether we are running
      on a 32 bits or 64 bits target.  */
   switch (tdep->bytes_per_address)
@@ -3253,14 +2462,11 @@
   /* The following gdbarch vector elements do not depend on the address
      size, or in any other gdbarch element previously set.  */
   set_gdbarch_skip_prologue (gdbarch, hppa_skip_prologue);
-  set_gdbarch_skip_trampoline_code (gdbarch, hppa_skip_trampoline_code);
-  set_gdbarch_in_solib_call_trampoline (gdbarch, hppa_in_solib_call_trampoline);
-  set_gdbarch_in_solib_return_trampoline (gdbarch,
-                                          hppa_in_solib_return_trampoline);
-  set_gdbarch_inner_than (gdbarch, hppa_inner_than);
+  set_gdbarch_inner_than (gdbarch, core_addr_greaterthan);
   set_gdbarch_sp_regnum (gdbarch, HPPA_SP_REGNUM);
   set_gdbarch_fp0_regnum (gdbarch, HPPA_FP0_REGNUM);
   set_gdbarch_cannot_store_register (gdbarch, hppa_cannot_store_register);
+  set_gdbarch_cannot_fetch_register (gdbarch, hppa_cannot_store_register);
   set_gdbarch_addr_bits_remove (gdbarch, hppa_smash_text_address);
   set_gdbarch_smash_text_address (gdbarch, hppa_smash_text_address);
   set_gdbarch_believe_pcc_promotion (gdbarch, 1);
@@ -3284,6 +2490,8 @@
     case 4:
       set_gdbarch_push_dummy_call (gdbarch, hppa32_push_dummy_call);
       set_gdbarch_frame_align (gdbarch, hppa32_frame_align);
+      set_gdbarch_convert_from_func_ptr_addr
+        (gdbarch, hppa32_convert_from_func_ptr_addr);
       break;
     case 8:
       set_gdbarch_push_dummy_call (gdbarch, hppa64_push_dummy_call);
@@ -3306,22 +2514,32 @@
       internal_error (__FILE__, __LINE__, "bad switch");
     }
       
+  set_gdbarch_breakpoint_from_pc (gdbarch, hppa_breakpoint_from_pc);
+  set_gdbarch_pseudo_register_read (gdbarch, hppa_pseudo_register_read);
+
   /* Frame unwind methods.  */
   set_gdbarch_unwind_dummy_id (gdbarch, hppa_unwind_dummy_id);
   set_gdbarch_unwind_pc (gdbarch, hppa_unwind_pc);
-  frame_unwind_append_sniffer (gdbarch, hppa_frame_unwind_sniffer);
-  frame_base_append_sniffer (gdbarch, hppa_frame_base_sniffer);
 
   /* Hook in ABI-specific overrides, if they have been registered.  */
   gdbarch_init_osabi (info, gdbarch);
 
+  /* Hook in the default unwinders.  */
+  frame_unwind_append_sniffer (gdbarch, hppa_stub_unwind_sniffer);
+  frame_unwind_append_sniffer (gdbarch, hppa_frame_unwind_sniffer);
+  frame_unwind_append_sniffer (gdbarch, hppa_fallback_unwind_sniffer);
+
   return gdbarch;
 }
 
 static void
 hppa_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
 {
-   /* Nothing to print for the moment.  */
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+  fprintf_unfiltered (file, "bytes_per_address = %d\n", 
+                      tdep->bytes_per_address);
+  fprintf_unfiltered (file, "elf = %s\n", tdep->is_elf ? "yes" : "no");
 }
 
 void
@@ -3334,6 +2552,8 @@
 
   gdbarch_register (bfd_arch_hppa, hppa_gdbarch_init, hppa_dump_tdep);
 
+  hppa_objfile_priv_data = register_objfile_data ();
+
   add_cmd ("unwind", class_maintenance, unwind_command,
 	   "Print unwind table entry at given address.",
 	   &maintenanceprintlist);
@@ -3367,5 +2587,9 @@
 			    break_at_finish_at_depth_command,
 "Set breakpoint at procedure exit.  Either there should\n\
 be no argument or the argument must be a depth.\n"), NULL);
-}
 
+  /* Debug this files internals. */
+  add_show_from_set (add_set_cmd ("hppa", class_maintenance, var_zinteger,
+				  &hppa_debug, "Set hppa debugging.\n\
+When non-zero, hppa specific debugging is enabled.", &setdebuglist), &showdebuglist);
+}
diff --git a/gdb/hppa-tdep.h b/gdb/hppa-tdep.h
index 05a4e89..26a7556 100644
--- a/gdb/hppa-tdep.h
+++ b/gdb/hppa-tdep.h
@@ -1,5 +1,5 @@
 /* Common target dependent code for GDB on HPPA systems.
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,12 +21,186 @@
 #ifndef HPPA_TDEP_H
 #define HPPA_TDEP_H
 
+struct trad_frame_saved_reg;
+
+/* Register numbers of various important registers.
+   Note that some of these values are "real" register numbers,
+   and correspond to the general registers of the machine,
+   and some are "phony" register numbers which are too large
+   to be actual register numbers as far as the user is concerned
+   but do serve to get the desired values when passed to read_register.  */
+
+enum hppa_regnum
+{
+  HPPA_R0_REGNUM = 0,		/* Doesn't actually exist, used as base for
+				   other r registers.  */
+  HPPA_R1_REGNUM = 1,
+  HPPA_FLAGS_REGNUM = 0,	/* Various status flags */
+  HPPA_RP_REGNUM = 2,		/* return pointer */
+  HPPA_FP_REGNUM = 3,		/* The ABI's frame pointer, when used */
+  HPPA_SP_REGNUM = 30,		/* Stack pointer.  */
+  HPPA_R31_REGNUM = 31,
+  HPPA_SAR_REGNUM = 32,		/* Shift Amount Register */
+  HPPA_IPSW_REGNUM = 41,	/* Interrupt Processor Status Word */
+  HPPA_PCOQ_HEAD_REGNUM = 33,	/* instruction offset queue head */
+  HPPA_PCSQ_HEAD_REGNUM = 34,	/* instruction space queue head */
+  HPPA_PCOQ_TAIL_REGNUM = 35,	/* instruction offset queue tail */
+  HPPA_PCSQ_TAIL_REGNUM = 36,	/* instruction space queue tail */
+  HPPA_EIEM_REGNUM = 37,	/* External Interrupt Enable Mask */
+  HPPA_IIR_REGNUM = 38,		/* Interrupt Instruction Register */
+  HPPA_ISR_REGNUM = 39,		/* Interrupt Space Register */
+  HPPA_IOR_REGNUM = 40,		/* Interrupt Offset Register */
+  HPPA_SR4_REGNUM = 43,		/* space register 4 */
+  HPPA_RCR_REGNUM = 51,		/* Recover Counter (also known as cr0) */
+  HPPA_PID0_REGNUM = 52,	/* Protection ID */
+  HPPA_PID1_REGNUM = 53,	/* Protection ID */
+  HPPA_PID2_REGNUM = 55,	/* Protection ID */
+  HPPA_PID3_REGNUM = 56,	/* Protection ID */
+  HPPA_CCR_REGNUM = 54,		/* Coprocessor Configuration Register */
+  HPPA_TR0_REGNUM = 57,		/* Temporary Registers (cr24 -> cr31) */
+  HPPA_CR27_REGNUM = 60,	/* Base register for thread-local storage, cr27 */
+  HPPA_FP0_REGNUM = 64,		/* First floating-point.  */
+  HPPA_FP4_REGNUM = 72,
+
+  HPPA_ARG0_REGNUM = 26,	/* The first argument of a callee. */
+  HPPA_ARG1_REGNUM = 25,	/* The second argument of a callee. */
+  HPPA_ARG2_REGNUM = 24,	/* The third argument of a callee. */
+  HPPA_ARG3_REGNUM = 23		/* The fourth argument of a callee. */
+};
+
 /* Target-dependent structure in gdbarch.  */
 struct gdbarch_tdep
 {
   /* The number of bytes in an address.  For now, this field is designed
      to allow us to differentiate hppa32 from hppa64 targets.  */
   int bytes_per_address;
+
+  /* Is this an ELF target? This can be 64-bit HP-UX, or a 32/64-bit GNU/Linux
+     system.  */
+  int is_elf;
+
+  /* Given a function address, try to find the global pointer for the 
+     corresponding shared object.  */
+  CORE_ADDR (*find_global_pointer) (struct value *);
 };
 
+/*
+ * Unwind table and descriptor.
+ */
+
+struct unwind_table_entry
+  {
+    CORE_ADDR region_start;
+    CORE_ADDR region_end;
+
+    unsigned int Cannot_unwind:1;	/* 0 */
+    unsigned int Millicode:1;	/* 1 */
+    unsigned int Millicode_save_sr0:1;	/* 2 */
+    unsigned int Region_description:2;	/* 3..4 */
+    unsigned int reserved1:1;	/* 5 */
+    unsigned int Entry_SR:1;	/* 6 */
+    unsigned int Entry_FR:4;	/* number saved *//* 7..10 */
+    unsigned int Entry_GR:5;	/* number saved *//* 11..15 */
+    unsigned int Args_stored:1;	/* 16 */
+    unsigned int Variable_Frame:1;	/* 17 */
+    unsigned int Separate_Package_Body:1;	/* 18 */
+    unsigned int Frame_Extension_Millicode:1;	/* 19 */
+    unsigned int Stack_Overflow_Check:1;	/* 20 */
+    unsigned int Two_Instruction_SP_Increment:1;	/* 21 */
+    unsigned int Ada_Region:1;	/* 22 */
+    unsigned int cxx_info:1;	/* 23 */
+    unsigned int cxx_try_catch:1;	/* 24 */
+    unsigned int sched_entry_seq:1;	/* 25 */
+    unsigned int reserved2:1;	/* 26 */
+    unsigned int Save_SP:1;	/* 27 */
+    unsigned int Save_RP:1;	/* 28 */
+    unsigned int Save_MRP_in_frame:1;	/* 29 */
+    unsigned int extn_ptr_defined:1;	/* 30 */
+    unsigned int Cleanup_defined:1;	/* 31 */
+
+    unsigned int MPE_XL_interrupt_marker:1;	/* 0 */
+    unsigned int HP_UX_interrupt_marker:1;	/* 1 */
+    unsigned int Large_frame:1;	/* 2 */
+    unsigned int Pseudo_SP_Set:1;	/* 3 */
+    unsigned int reserved4:1;	/* 4 */
+    unsigned int Total_frame_size:27;	/* 5..31 */
+
+    /* This is *NOT* part of an actual unwind_descriptor in an object
+       file.  It is *ONLY* part of the "internalized" descriptors that
+       we create from those in a file.
+     */
+    struct
+      {
+	unsigned int stub_type:4;	/* 0..3 */
+	unsigned int padding:28;	/* 4..31 */
+      }
+    stub_unwind;
+  };
+
+/* HP linkers also generate unwinds for various linker-generated stubs.
+   GDB reads in the stubs from the $UNWIND_END$ subspace, then 
+   "converts" them into normal unwind entries using some of the reserved
+   fields to store the stub type.  */
+
+/* The gaps represent linker stubs used in MPE and space for future
+   expansion.  */
+enum unwind_stub_types
+  {
+    LONG_BRANCH = 1,
+    PARAMETER_RELOCATION = 2,
+    EXPORT = 10,
+    IMPORT = 11,
+    IMPORT_SHLIB = 12,
+  };
+
+struct unwind_table_entry *find_unwind_entry (CORE_ADDR);
+
+/* We use the objfile->obj_private pointer for two things:
+ * 1.  An unwind table;
+ *
+ * 2.  A pointer to any associated shared library object.
+ *
+ * #defines are used to help refer to these objects.
+ */
+
+/* Info about the unwind table associated with an object file.
+ * This is hung off of the "objfile->obj_private" pointer, and
+ * is allocated in the objfile's psymbol obstack.  This allows
+ * us to have unique unwind info for each executable and shared
+ * library that we are debugging.
+ */
+struct hppa_unwind_info
+  {
+    struct unwind_table_entry *table;	/* Pointer to unwind info */
+    struct unwind_table_entry *cache;	/* Pointer to last entry we found */
+    int last;			/* Index of last entry */
+  };
+
+struct hppa_objfile_private
+  {
+    struct hppa_unwind_info *unwind_info;	/* a pointer */
+    struct so_list *so_info;	/* a pointer  */
+    CORE_ADDR dp;
+  };
+
+extern const struct objfile_data *hppa_objfile_priv_data;
+
+int hppa_get_field (unsigned word, int from, int to);
+int hppa_extract_5_load (unsigned int);
+unsigned hppa_extract_5R_store (unsigned int);
+unsigned hppa_extract_5r_store (unsigned int);
+int hppa_extract_17 (unsigned int);
+int hppa_extract_21 (unsigned);
+int hppa_extract_14 (unsigned);
+int hppa_low_sign_extend (unsigned int, unsigned int);
+int hppa_sign_extend (unsigned int, unsigned int);
+CORE_ADDR hppa_symbol_address(const char *sym);
+
+void
+hppa_frame_prev_register_helper (struct frame_info *next_frame,
+			         struct trad_frame_saved_reg *saved_regs,
+				 int regnum, int *optimizedp,
+				 enum lval_type *lvalp, CORE_ADDR *addrp,
+				 int *realnump, void *valuep);
+
 #endif  /* HPPA_TDEP_H */
diff --git a/gdb/hppabsd-nat.c b/gdb/hppabsd-nat.c
new file mode 100644
index 0000000..1962ded
--- /dev/null
+++ b/gdb/hppabsd-nat.c
@@ -0,0 +1,119 @@
+/* Native-dependent code for HP PA-RISC BSD's.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "inferior.h"
+#include "regcache.h"
+
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+
+#include "hppa-tdep.h"
+
+static int
+hppabsd_gregset_supplies_p (int regnum)
+{
+  return (regnum >= HPPA_R0_REGNUM && regnum <= HPPA_PCOQ_TAIL_REGNUM);
+}
+
+/* Supply the general-purpose registers stored in GREGS to REGCACHE.  */
+
+static void
+hppabsd_supply_gregset (struct regcache *regcache, const void *gregs)
+{
+  const char *regs = gregs;
+  int regnum;
+
+  for (regnum = HPPA_R1_REGNUM; regnum <= HPPA_R31_REGNUM; regnum++)
+    regcache_raw_supply (regcache, regnum, regs + regnum * 4);
+
+  regcache_raw_supply (regcache, HPPA_SAR_REGNUM, regs);
+  regcache_raw_supply (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 32 * 4);
+  regcache_raw_supply (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 33 * 4);
+}
+
+/* Collect the general-purpose registers from REGCACHE and store them
+   in GREGS.  */
+
+static void
+hppabsd_collect_gregset (const struct regcache *regcache,
+			  void *gregs, int regnum)
+{
+  char *regs = gregs;
+  int i;
+
+  for (i = HPPA_R1_REGNUM; i <= HPPA_R31_REGNUM; i++)
+    {
+      if (regnum == -1 || regnum == i)
+	regcache_raw_collect (regcache, i, regs + i * 4);
+    }
+
+  if (regnum == -1 || regnum == HPPA_SAR_REGNUM)
+    regcache_raw_collect (regcache, HPPA_SAR_REGNUM, regs);
+  if (regnum == -1 || regnum == HPPA_PCOQ_HEAD_REGNUM)
+    regcache_raw_collect (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 32 * 4);
+  if (regnum == -1 || regnum == HPPA_PCOQ_TAIL_REGNUM)
+    regcache_raw_collect (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 33 * 4);
+}
+
+
+/* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
+   for all registers (including the floating-point registers).  */
+
+void
+fetch_inferior_registers (int regnum)
+{
+  struct regcache *regcache = current_regcache;
+
+  if (regnum == -1 || hppabsd_gregset_supplies_p (regnum))
+    {
+      struct reg regs;
+
+      if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+		  (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+	perror_with_name ("Couldn't get registers");
+
+      hppabsd_supply_gregset (regcache, &regs);
+    }
+}
+
+/* Store register REGNUM back into the inferior.  If REGNUM is -1, do
+   this for all registers (including the floating-point registers).  */
+
+void
+store_inferior_registers (int regnum)
+{
+  if (regnum == -1 || hppabsd_gregset_supplies_p (regnum))
+    {
+      struct reg regs;
+
+      if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+                  (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+        perror_with_name ("Couldn't get registers");
+
+      hppabsd_collect_gregset (current_regcache, &regs, regnum);
+
+      if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+	          (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+        perror_with_name ("Couldn't write registers");
+    }
+}
diff --git a/gdb/hppabsd-tdep.c b/gdb/hppabsd-tdep.c
new file mode 100644
index 0000000..0a54371
--- /dev/null
+++ b/gdb/hppabsd-tdep.c
@@ -0,0 +1,137 @@
+/* Target-dependent code for HP PA-RISC BSD's.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "arch-utils.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
+
+#include "gdb_assert.h"
+#include "gdb_string.h"
+
+#include "hppa-tdep.h"
+#include "solib-svr4.h"
+
+/* Core file support.  */
+
+/* Sizeof `struct reg' in <machine/reg.h>.  */
+#define HPPABSD_SIZEOF_GREGS	(34 * 4)
+
+/* Supply register REGNUM from the buffer specified by GREGS and LEN
+   in the general-purpose register set REGSET to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+static void
+hppabsd_supply_gregset (const struct regset *regset, struct regcache *regcache,
+		     int regnum, const void *gregs, size_t len)
+{
+  const char *regs = gregs;
+  size_t offset;
+  int i;
+
+  gdb_assert (len >= HPPABSD_SIZEOF_GREGS);
+
+  for (i = HPPA_R1_REGNUM, offset = 4; i <= HPPA_R31_REGNUM; i++, offset += 4)
+    {
+      if (regnum == -1 || regnum == i)
+	regcache_raw_supply (regcache, i, regs + offset);
+    }
+
+  if (regnum == -1 || regnum == HPPA_SAR_REGNUM)
+    regcache_raw_supply (regcache, HPPA_SAR_REGNUM, regs);
+  if (regnum == -1 || regnum == HPPA_PCOQ_HEAD_REGNUM)
+    regcache_raw_supply (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 32 * 4);
+  if (regnum == -1 || regnum == HPPA_PCOQ_TAIL_REGNUM)
+    regcache_raw_supply (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 33 * 4);
+}
+
+/* OpenBSD/hppa register set.  */
+
+static struct regset hppabsd_gregset =
+{
+  NULL,
+  hppabsd_supply_gregset
+};
+
+/* Return the appropriate register set for the core section identified
+   by SECT_NAME and SECT_SIZE.  */
+
+static const struct regset *
+hppabsd_regset_from_core_section (struct gdbarch *gdbarch,
+				  const char *sect_name, size_t sect_size)
+{
+  if (strcmp (sect_name, ".reg") == 0 && sect_size >= HPPABSD_SIZEOF_GREGS)
+    return &hppabsd_gregset;
+
+  return NULL;
+}
+
+
+static void
+hppabsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  /* Core file support.  */
+  set_gdbarch_regset_from_core_section
+    (gdbarch, hppabsd_regset_from_core_section);
+
+  /* OpenBSD and NetBSD use ELF.  */
+  tdep->is_elf = 1;
+
+  /* OpenBSD and NetBSD uses SVR4-style shared libraries.  */
+  set_gdbarch_in_solib_call_trampoline
+    (gdbarch, generic_in_solib_call_trampoline);
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+}
+
+
+/* OpenBSD uses uses the traditional NetBSD core file format, even for
+   ports that use ELF.  */
+#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF
+
+static enum gdb_osabi
+hppabsd_core_osabi_sniffer (bfd *abfd)
+{
+  if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
+    return GDB_OSABI_NETBSD_CORE;
+
+  return GDB_OSABI_UNKNOWN;
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_hppabsd_tdep (void);
+
+void
+_initialize_hppabsd_tdep (void)
+{
+  /* BFD doesn't set a flavour for NetBSD style a.out core files.  */
+  gdbarch_register_osabi_sniffer (bfd_arch_hppa, bfd_target_unknown_flavour,
+				  hppabsd_core_osabi_sniffer);
+
+  gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_NETBSD_ELF,
+			  hppabsd_init_abi);
+  gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_OPENBSD_ELF,
+			  hppabsd_init_abi);
+}
diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c
index ea4015a..6b361eb 100644
--- a/gdb/hppah-nat.c
+++ b/gdb/hppah-nat.c
@@ -32,13 +32,10 @@
 #include "gdb_wait.h"
 #include "regcache.h"
 #include "gdb_string.h"
+#include "infttrace.h"
 #include <signal.h>
 
-extern int hpux_has_forked (int pid, int *childpid);
-extern int hpux_has_vforked (int pid, int *childpid);
-extern int hpux_has_execd (int pid, char **execd_pathname);
-extern int hpux_has_syscall_event (int pid, enum target_waitkind *kind,
-				   int *syscall_id);
+#include "hppa-tdep.h"
 
 static CORE_ADDR text_end;
 
@@ -117,9 +114,9 @@
 	}
 
       /* Floating-point registers come from the ss_fpblock area.  */
-      else if (regno >= FP0_REGNUM)
+      else if (regno >= HPPA_FP0_REGNUM)
 	addr = (HPPAH_OFFSETOF (save_state_t, ss_fpblock) 
-		+ (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (FP0_REGNUM)));
+		+ (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (HPPA_FP0_REGNUM)));
 
       /* Wide registers come from the ss_wide area.
 	 I think it's more PC to test (ss_flags & SS_WIDEREGS) to select
@@ -145,7 +142,7 @@
 	 layering will not allow us to perform a 64bit register store.
 
 	 What a crock.  */
-      if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM && len == 8)
+      if (regno == HPPA_PCOQ_HEAD_REGNUM || regno == HPPA_PCOQ_TAIL_REGNUM && len == 8)
 	{
 	  CORE_ADDR temp;
 
@@ -173,7 +170,7 @@
       /* Another crock.  HPUX complains if you write a nonzero value to
 	 the high part of IPSW.  What will it take for HP to catch a
 	 clue about building sensible interfaces?  */
-     if (regno == IPSW_REGNUM && len == 8)
+     if (regno == HPPA_IPSW_REGNUM && len == 8)
 	*(int *)&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)] = 0;
 #endif
 
@@ -193,7 +190,7 @@
 		        REGISTER_NAME (regno), err);
 	      /* If we fail to write the PC, give a true error instead of
 		 just a warning.  */
-	      if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
+	      if (regno == HPPA_PCOQ_HEAD_REGNUM || regno == HPPA_PCOQ_TAIL_REGNUM)
 		perror_with_name (msg);
 	      else
 		warning (msg);
@@ -235,9 +232,9 @@
     }
 
   /* Floating-point registers come from the ss_fpblock area.  */
-  else if (regno >= FP0_REGNUM)
+  else if (regno >= HPPA_FP0_REGNUM)
     addr = (HPPAH_OFFSETOF (save_state_t, ss_fpblock) 
-	    + (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (FP0_REGNUM)));
+	    + (DEPRECATED_REGISTER_BYTE (regno) - DEPRECATED_REGISTER_BYTE (HPPA_FP0_REGNUM)));
 
   /* Wide registers come from the ss_wide area.
      I think it's more PC to test (ss_flags & SS_WIDEREGS) to select
@@ -282,7 +279,7 @@
   /* If we're reading an address from the instruction address queue,
      mask out the bottom two bits --- they contain the privilege
      level.  */
-  if (regno == PCOQ_HEAD_REGNUM || regno == PCOQ_TAIL_REGNUM)
+  if (regno == HPPA_PCOQ_HEAD_REGNUM || regno == HPPA_PCOQ_TAIL_REGNUM)
     buf[len - 1] &= ~0x3;
 
   supply_register (regno, buf);
diff --git a/gdb/hpread.c b/gdb/hpread.c
index 76e9696..0701473 100644
--- a/gdb/hpread.c
+++ b/gdb/hpread.c
@@ -37,6 +37,7 @@
 #include "demangle.h"
 #include "somsolib.h"
 #include "gdb_assert.h"
+#include "hppa-tdep.h"
 
 /* Private information attached to an objfile which we use to find
    and internalize the HP C debug symbols within that objfile.  */
@@ -234,15 +235,12 @@
 
 static void hpread_adjust_bitoffsets (struct type *, int);
 
+static int hpread_adjust_stack_address (CORE_ADDR func_addr);
+
 static dnttpointer hpread_get_next_skip_over_anon_unions
   (int, dnttpointer, union dnttentry **, struct objfile *);
 
 
-/* Global to indicate presence of HP-compiled objects,
-   in particular, SOM executable file with SOM debug info 
-   Defined in symtab.c, used in hppa-tdep.c. */
-extern int hp_som_som_object_present;
-
 /* Static used to indicate a class type that requires a
    fix-up of one of its method types */
 static struct type *fixup_class = NULL;
@@ -385,6 +383,7 @@
       if (header_section_size == (bfd_size_type) sizeof (DOC_info_PXDB_header))
 	{
 	  buf = alloca (sizeof (DOC_info_PXDB_header));
+	  memset (buf, 0, sizeof (DOC_info_PXDB_header));
 
 	  if (!bfd_get_section_contents (sym_bfd,
 					 header_section,
@@ -452,6 +451,7 @@
 	{
 
 	  buf = alloca (sizeof (PXDB_header));
+	  memset (buf, 0, sizeof (PXDB_header));
 	  if (!bfd_get_section_contents (sym_bfd,
 					 header_section,
 					 buf, 0,
@@ -2875,7 +2875,7 @@
     }
 
   current_objfile = NULL;
-  hp_som_som_object_present = 1;	/* Indicate we've processed an HP SOM SOM file */
+  deprecated_hp_som_som_object_present = 1;	/* Indicate we've processed an HP SOM SOM file */
 
   return end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
 }
@@ -3252,10 +3252,9 @@
       if (paramp->dfparam.copyparam)
 	{
 	  SYMBOL_VALUE (sym) = paramp->dfparam.location;
-#ifdef HPREAD_ADJUST_STACK_ADDRESS
 	  SYMBOL_VALUE (sym)
-	    += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
-#endif
+	    += hpread_adjust_stack_address (CURRENT_FUNCTION_VALUE (objfile));
+
 	  /* This is likely a pass-by-invisible reference parameter,
 	     Hack on the symbol class to make GDB happy.  */
 	  /* ??rehrauer: This appears to be broken w/r/t to passing
@@ -3431,10 +3430,9 @@
       if (paramp->dfparam.copyparam)
 	{
 	  SYMBOL_VALUE (sym) = paramp->dfparam.location;
-#ifdef HPREAD_ADJUST_STACK_ADDRESS
 	  SYMBOL_VALUE (sym)
-	    += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
-#endif
+	    += hpread_adjust_stack_address(CURRENT_FUNCTION_VALUE (objfile));
+
 	  /* This is likely a pass-by-invisible reference parameter,
 	     Hack on the symbol class to make GDB happy.  */
 	  /* ??rehrauer: This appears to be broken w/r/t to passing
@@ -3690,6 +3688,7 @@
 
 	  /* Get space to record the next field/data-member. */
 	  new = (struct nextfield *) alloca (sizeof (struct nextfield));
+	  memset (new, 0, sizeof (struct nextfield));
 	  new->next = list;
 	  list = new;
 
@@ -3768,6 +3767,7 @@
 	  n_templ_args++;
 	  /* Allocate and fill in a struct next_template */
 	  t_new = (struct next_template *) alloca (sizeof (struct next_template));
+	  memset (t_new, 0, sizeof (struct next_template));
 	  t_new->next = t_list;
 	  t_list = t_new;
 	  t_list->arg.name = VT (objfile) + fieldp->dtempl_arg.name;
@@ -3908,6 +3908,7 @@
 		  /* Get space to record this member function */
 		  /* Note: alloca used; this will disappear on routine exit */
 		  fn_new = (struct next_fn_field *) alloca (sizeof (struct next_fn_field));
+		  memset (fn_new, 0, sizeof (struct next_fn_field));
 		  fn_new->next = fn_list;
 		  fn_list = fn_new;
 
@@ -4025,6 +4026,7 @@
 
 	      /* Get space to record this static member */
 	      new = (struct nextfield *) alloca (sizeof (struct nextfield));
+	      memset (new, 0, sizeof (struct nextfield));
 	      new->next = list;
 	      list = new;
 
@@ -4055,6 +4057,7 @@
 		warning ("Debug info inconsistent: FIELD of anonymous union doesn't have a_union bit set");
 	      /* Get space to record the next field/data-member. */
 	      new = (struct nextfield *) alloca (sizeof (struct nextfield));
+	      memset (new, 0, sizeof (struct nextfield));
 	      new->next = list;
 	      list = new;
 
@@ -4086,6 +4089,7 @@
 		warning ("Debug info inconsistent: SVAR field in anonymous union doesn't have a_union bit set");
 	      /* Get space to record the next field/data-member. */
 	      new = (struct nextfield *) alloca (sizeof (struct nextfield));
+	      memset (new, 0, sizeof (struct nextfield));
 	      new->next = list;
 	      list = new;
 
@@ -4106,6 +4110,7 @@
 		warning ("Debug info inconsistent: DVAR field in anonymous union doesn't have a_union bit set");
 	      /* Get space to record the next field/data-member. */
 	      new = (struct nextfield *) alloca (sizeof (struct nextfield));
+	      memset (new, 0, sizeof (struct nextfield));
 	      new->next = list;
 	      list = new;
 
@@ -4154,6 +4159,7 @@
 
 	  /* Get space to record the next field/data-member. */
 	  new = (struct nextfield *) alloca (sizeof (struct nextfield));
+	  memset (new, 0, sizeof (struct nextfield));
 	  new->next = list;
 	  list = new;
 
@@ -4237,6 +4243,7 @@
 	    break;
 
 	  i_new = (struct next_instantiation *) alloca (sizeof (struct next_instantiation));
+	  memset (i_new, 0, sizeof (struct next_instantiation));
 	  i_new->next = i_list;
 	  i_list = i_new;
 	  i_list->t = hpread_type_lookup (field, objfile);
@@ -5702,10 +5709,8 @@
       if (dn_bufp->dfparam.copyparam)
 	{
 	  SYMBOL_VALUE (sym) = dn_bufp->dfparam.location;
-#ifdef HPREAD_ADJUST_STACK_ADDRESS
 	  SYMBOL_VALUE (sym)
-	    += HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
-#endif
+	    += hpread_adjust_stack_address (CURRENT_FUNCTION_VALUE (objfile));
 	}
       else
 	SYMBOL_VALUE (sym) = dn_bufp->dfparam.location;
@@ -5747,7 +5752,7 @@
 	  /* Thread-local variable.
 	   */
 	  SYMBOL_CLASS (sym) = LOC_HP_THREAD_LOCAL_STATIC;
-	  SYMBOL_BASEREG (sym) = CR27_REGNUM;
+	  SYMBOL_BASEREG (sym) = HPPA_CR27_REGNUM;
 
 	  if (objfile->flags & OBJF_SHARED)
 	    {
@@ -5759,11 +5764,14 @@
 	       * to "somsolib.c".  But C lets us point to one.
 	       */
 	      struct so_list *so;
+              struct hppa_objfile_private *priv;
 
-	      if (objfile->obj_private == NULL)
+              priv = (struct hppa_objfile_private *)
+	        objfile_data (objfile, hppa_objfile_priv_data);
+	      if (priv == NULL)
 		error ("Internal error in reading shared library information.");
 
-	      so = ((obj_private_data_t *) (objfile->obj_private))->so_info;
+	      so = ((struct hppa_objfile_private *) priv)->so_info;
 	      if (so == NULL)
 		error ("Internal error in reading shared library information.");
 
@@ -5786,10 +5794,8 @@
 	SYMBOL_CLASS (sym) = LOC_LOCAL;
 
       SYMBOL_VALUE (sym) = dn_bufp->ddvar.location;
-#ifdef HPREAD_ADJUST_STACK_ADDRESS
       SYMBOL_VALUE (sym)
-	+= HPREAD_ADJUST_STACK_ADDRESS (CURRENT_FUNCTION_VALUE (objfile));
-#endif
+	+= hpread_adjust_stack_address (CURRENT_FUNCTION_VALUE (objfile));
       SYMBOL_TYPE (sym) = hpread_type_lookup (dn_bufp->ddvar.type, objfile);
       if (dn_bufp->ddvar.global)
 	add_symbol_to_list (sym, &global_symbols);
@@ -6269,6 +6275,24 @@
     TYPE_FIELD_BITPOS (type, i) -= bits;
 }
 
+/* Return the adjustment necessary to make for addresses on the stack
+   as presented by hpread.c.
+
+   This is necessary because of the stack direction on the PA and the
+   bizarre way in which someone (?) decided they wanted to handle
+   frame pointerless code in GDB.  */
+int
+hpread_adjust_stack_address (CORE_ADDR func_addr)
+{
+  struct unwind_table_entry *u;
+
+  u = find_unwind_entry (func_addr);
+  if (!u)
+    return 0;
+  else
+    return u->Total_frame_size << 3;
+}
+
 /* Because of quirks in HP compilers' treatment of anonymous unions inside
    classes, we have to chase through a chain of threaded FIELD entries.
    If we encounter an anonymous union in the chain, we must recursively skip over
diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c
index 242d3a3..8938541 100644
--- a/gdb/hpux-thread.c
+++ b/gdb/hpux-thread.c
@@ -431,9 +431,10 @@
 /* Fork an inferior process, and start debugging it with /proc.  */
 
 static void
-hpux_thread_create_inferior (char *exec_file, char *allargs, char **env)
+hpux_thread_create_inferior (char *exec_file, char *allargs, char **env,
+			     int from_tty)
 {
-  child_ops.to_create_inferior (exec_file, allargs, env);
+  child_ops.to_create_inferior (exec_file, allargs, env, from_tty);
 
   if (hpux_thread_active)
     {
@@ -581,6 +582,6 @@
 
   child_suppress_run = 1;
   /* Hook into new_objfile notification. */
-  target_new_objfile_chain = target_new_objfile_hook;
-  target_new_objfile_hook  = hpux_thread_new_objfile;
+  target_new_objfile_chain = deprecated_target_new_objfile_hook;
+  deprecated_target_new_objfile_hook  = hpux_thread_new_objfile;
 }
diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c
index 443f8f7..9dc5b39 100644
--- a/gdb/i386-cygwin-tdep.c
+++ b/gdb/i386-cygwin-tdep.c
@@ -26,11 +26,27 @@
 
 #include "i386-tdep.h"
 
+static CORE_ADDR
+i386_cygwin_skip_trampoline_code (CORE_ADDR pc)
+{
+  return i386_pe_skip_trampoline_code (pc, NULL);
+}
+
+static int
+i386_cygwin_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+  return (i386_pe_skip_trampoline_code (pc, name) != 0);
+}
+
 static void
 i386_cygwin_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
+  set_gdbarch_in_solib_call_trampoline (gdbarch,
+                                        i386_cygwin_in_solib_call_trampoline);
+  set_gdbarch_skip_trampoline_code (gdbarch, i386_cygwin_skip_trampoline_code);
+
   tdep->struct_return = reg_struct_return;
 }
 
diff --git a/gdb/i386-interix-nat.c b/gdb/i386-interix-nat.c
deleted file mode 100644
index 91b9be2..0000000
--- a/gdb/i386-interix-nat.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* Native-dependent code for Interix running on i386's, for GDB.
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#include "defs.h"
-
-#include <sys/procfs.h>
-#include <inferior.h>
-#include <fcntl.h>
-
-#include <i386-tdep.h>
-#include "gdb_string.h"
-#include "gdbcore.h"
-#include "gregset.h"
-#include "regcache.h"
-
-typedef unsigned long greg_t;
-
-/* This is a duplicate of the table in i386-linux-nat.c.  */
-
-static int regmap[] = {
-  EAX, ECX, EDX, EBX,
-  UESP, EBP, ESI, EDI,
-  EIP, EFL, CS, SS,
-  DS, ES, FS, GS,
-};
-
-/* Forward declarations.  */
-extern void _initialize_core_interix (void);
-extern initialize_file_ftype _initialize_core_interix;
-
-/*  Given a pointer to a general register set in /proc format (gregset_t *),
-    unpack the register contents and supply them as gdb's idea of the current
-    register values.  */
-
-void
-supply_gregset (gregset_t *gregsetp)
-{
-  int regi;
-  greg_t *regp = (greg_t *) & gregsetp->gregs;
-
-  for (regi = 0; regi < I386_NUM_GREGS; regi++)
-    {
-      supply_register (regi, (char *) (regp + regmap[regi]));
-    }
-}
-
-/* Store GDB's value for REGNO in *GREGSETP.  If REGNO is -1, do all
-   of them.  */
-
-void
-fill_gregset (gregset_t *gregsetp, int regno)
-{
-  int regi;
-  greg_t *regp = (greg_t *) gregsetp->gregs;
-
-  for (regi = 0; regi < I386_NUM_GREGS; regi++)
-    if (regno == -1 || regi == regno)
-      regcache_collect (regi, (void *) (regp + regmap[regi]));
-}
-
-/* Fill GDB's register file with the floating-point register values in
-   *FPREGSETP.  */
-
-void
-supply_fpregset (fpregset_t *fpregsetp)
-{
-  i387_supply_fsave (current_regcache, -1, fpregsetp);
-}
-
-/* Given a pointer to a floating point register set in (fpregset_t *)
-   format, update all of the registers from gdb's idea of the current
-   floating point register set.  */
-
-void
-fill_fpregset (fpregset_t *fpregsetp, int regno)
-{
-  i387_fill_fsave ((char *) fpregsetp, regno);
-}
-
-/* Read the values of either the general register set (WHICH equals 0)
-   or the floating point register set (WHICH equals 2) from the core
-   file data (pointed to by CORE_REG_SECT), and update gdb's idea of
-   their current values.  The CORE_REG_SIZE parameter is compared to
-   the size of the gregset or fpgregset structures (as appropriate) to
-   validate the size of the structure from the core file.  The
-   REG_ADDR parameter is ignored.  */
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
-                      CORE_ADDR reg_addr)
-{
-  gdb_gregset_t gregset;
-  gdb_fpregset_t fpregset;
-
-  if (which == 0)
-    {
-      if (core_reg_size != sizeof (gregset))
-        {
-          warning ("wrong size gregset struct in core file");
-        }
-      else
-        {
-          memcpy ((char *) &gregset, core_reg_sect, sizeof (gregset));
-          supply_gregset (&gregset);
-        }
-    }
-  else if (which == 2)
-    {
-      if (core_reg_size != sizeof (fpregset))
-        {
-          warning ("wrong size fpregset struct in core file");
-        }
-      else
-        {
-          memcpy ((char *) &fpregset, core_reg_sect, sizeof (fpregset));
-          supply_fpregset (&fpregset);
-        }
-    }
-}
-
-#include <setjmp.h>
-
-static struct core_fns interix_core_fns =
-{
-  bfd_target_coff_flavour,      /* core_flavour (more or less) */
-  default_check_format,         /* check_format */
-  default_core_sniffer,         /* core_sniffer */
-  fetch_core_registers,         /* core_read_registers */
-  NULL                          /* next */
-};
-
-void
-_initialize_core_interix (void)
-{
-  add_core_fns (&interix_core_fns);
-}
-
-/* We don't have a /proc/pid/file or /proc/pid/exe to read a link from,
-   so read it from the same place ps gets the name.  */
-
-char *
-child_pid_to_exec_file (int pid)
-{
-  char *path;
-  char *buf;
-  int fd, c;
-  char *p;
-
-  xasprintf (&path, "/proc/%d/stat", pid);
-  buf = xcalloc (MAXPATHLEN + 1, sizeof (char));
-  make_cleanup (xfree, path);
-  make_cleanup (xfree, buf);
-
-  fd = open (path, O_RDONLY);
-
-  if (fd < 0)
-    return NULL;
-
-  /* Skip over "Argv0\t".  */
-  lseek (fd, 6, SEEK_SET);
-
-  c = read (fd, buf, MAXPATHLEN);
-  close (fd);
-
-  if (c < 0)
-    return NULL;
-
-  buf[c] = '\0';                /* Ensure null termination.  */
-  p = strchr (buf, '\n');
-  if (p != NULL)
-    *p = '\0';
-
-  return buf;
-}
diff --git a/gdb/i386-interix-tdep.c b/gdb/i386-interix-tdep.c
deleted file mode 100644
index 02c3701..0000000
--- a/gdb/i386-interix-tdep.c
+++ /dev/null
@@ -1,358 +0,0 @@
-/* Target-dependent code for Interix running on i386's, for GDB.
-   Copyright 2002 Free Software Foundation, Inc.
-
-This file is part of GDB.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-
-#include "defs.h"
-#include "arch-utils.h"
-
-#include "frame.h"
-#include "gdb_string.h"
-#include "gdb-stabs.h"
-#include "gdbcore.h"
-#include "gdbtypes.h"
-#include "i386-tdep.h"
-#include "inferior.h"
-#include "libbfd.h"
-#include "objfiles.h"
-#include "osabi.h"
-#include "regcache.h"
-
-/* offsetof (mcontext_t, gregs.gregs[EBP]) */
-static const int mcontext_EBP_greg_offset = 180;
-
-/* offsetof (mcontext_t, gregs.gregs[EIP]) */
-static const int mcontext_EIP_greg_offset = 184;
-
-/* offsetof (mcontext_t, gregs.gregs[UESP]) */
-static const int mcontext_UESP_greg_offset = 196;
-
-/* offsetof (mcontext_t, gregs.reserved[1]) */
-static const int mcontext_syscall_greg_offset = 4;
-
-/* offsetof (_JUMP_BUFFER, Eip) */
-static const int jump_buffer_Eip_offset = 20;
-
-/* See procfs.c and *interix*.h in config/[alpha,i386].  */
-/* ??? These should be static, but this needs a bit of work before this
-   can be done.  */
-CORE_ADDR tramp_start;
-CORE_ADDR tramp_end;
-CORE_ADDR null_start;
-CORE_ADDR null_end;
-int winver;                     /* Windows NT version number */
-
-/* Forward declarations.  */
-extern void _initialize_i386_interix_tdep (void);
-extern initialize_file_ftype _initialize_i386_interix_tdep;
-
-/* Adjust the section offsets in an objfile structure so that it's correct
-   for the type of symbols being read (or undo it with the _restore
-   arguments).  
-
-   If main programs ever start showing up at other than the default Image
-   Base, this is where that would likely be applied.  */
-
-void
-pei_adjust_objfile_offsets (struct objfile *objfile,
-                            enum objfile_adjusts type)
-{
-  int i;
-  CORE_ADDR symbols_offset;
-
-  switch (type)
-    {
-    case adjust_for_symtab:
-      symbols_offset = NONZERO_LINK_BASE (objfile->obfd);
-      break;
-    case adjust_for_symtab_restore:
-      symbols_offset = -NONZERO_LINK_BASE (objfile->obfd);
-      break;
-    case adjust_for_stabs:
-    case adjust_for_stabs_restore:
-    case adjust_for_dwarf:
-    case adjust_for_dwarf_restore:
-    default:
-      return;
-    }
-
-  for (i = 0; i < objfile->num_sections; i++)
-    {
-      (objfile->section_offsets)->offsets[i] += symbols_offset;
-    }
-}
-
-static int
-i386_interix_pc_in_sigtramp (CORE_ADDR pc, char *name)
-{
-  /* This is sufficient, where used, but is NOT a complete test; There
-     is more in DEPRECATED_INIT_EXTRA_FRAME_INFO
-     (a.k.a. interix_back_one_frame).  */
-  return ((pc >= tramp_start && pc < tramp_end)
-          || (pc >= null_start && pc < null_end));
-}
-
-static int
-i386_interix_in_solib_call_trampoline (CORE_ADDR pc, char *name)
-{
-  return i386_pe_skip_trampoline_code (pc, name);
-}
-
-static CORE_ADDR
-i386_interix_skip_trampoline_code (CORE_ADDR pc)
-{
-  return i386_pe_skip_trampoline_code (pc, 0);
-}
-
-static int
-i386_interix_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
-{
-  /* In the context where this is used, we get the saved PC before we've
-     successfully unwound far enough to be sure what we've got (it may
-     be a signal handler caller).  If we're dealing with a signal
-     handler caller, this will return valid, which is fine.  If not,
-     it'll make the correct test.  */
-  return ((get_frame_type (thisframe) == SIGTRAMP_FRAME)
-          || (chain != 0
-              && !deprecated_inside_entry_file (read_memory_integer
-						(thisframe->frame + 4, 4))));
-}
-
-/* We want to find the previous frame, which on Interix is tricky when
-   signals are involved; set frame->frame appropriately, and also get
-   the pc and tweak tye frame's type; this replaces a boatload of
-   nested macros, as well.  */
-static void
-i386_interix_back_one_frame (int fromleaf, struct frame_info *frame)
-{
-  CORE_ADDR ra;
-  CORE_ADDR fm;
-  CORE_ADDR context;
-  long t;
-
-  if (frame == NULL)
-    internal_error (__FILE__, __LINE__, "unexpected NULL frame");
-
-  if (fromleaf)
-    {
-      frame->pc = DEPRECATED_SAVED_PC_AFTER_CALL (frame->next);
-      return;
-    }
-
-  if (!frame->next)
-    {
-      frame->pc = read_pc ();
-
-      /* Part of the signal stuff...  See below.  */
-      if (stopped_by_random_signal)
-        {
-          /* We know we're in a system call mini-frame; was it
-             NullApi or something else?  */
-          ra = DEPRECATED_SAVED_PC_AFTER_CALL (frame);
-          if (ra >= null_start && ra < null_end)
-	    deprecated_set_frame_type (frame, SIGTRAMP_FRAME);
-          /* There might also be an indirect call to the mini-frame,
-             putting one more return address on the stack.  (XP only,
-             I think?)  This can't (reasonably) return the address of the 
-             signal handler caller unless it's that situation, so this
-             is safe.  */
-          ra = read_memory_unsigned_integer (read_register (SP_REGNUM) + 4, 4);
-          if (ra >= null_start && ra < null_end)
-	    deprecated_set_frame_type (frame, SIGTRAMP_FRAME);
-        }
-      return;
-    }
-
-  if (!(get_frame_type (frame->next) == SIGTRAMP_FRAME))
-    {
-      frame->pc = read_memory_integer (frame->next->frame + 4, 4);
-      return;
-    }
-
-  /* This is messy (actually AWFUL)...  The "trampoline" might be 2, 3 
-     or all 5 entities on the frame. 
-
-     Chunk 1 will be present when we're actually in a signal handler.
-     Chunk 2 will be present when an asynchronous signal (one that
-     didn't come in with a system call) is present.
-     We may not (yet) be in the handler, if we're just returning
-     from the call.
-     When we're actually in a handler taken from an asynchronous
-     signal, both will be present.
-
-     Chunk 1:
-     PdxSignalDeliverer's frame 
-     + Context struct    -- not accounted for in any frame
-
-     Chunk 2:
-     + PdxNullPosixApi's frame 
-     + PdxNullApiCaller's frame
-     + Context struct = 0x230  not accounted for in any frame
-
-     The symbol names come from examining objdumps of psxdll.dll;
-     they don't appear in the runtime image.
-
-     For gdb's purposes, we can pile all this into one frame.  */
-
-  ra = frame->next->pc;
-  /* Are we already pointing at PdxNullPosixApi?  We are if
-     this is a signal frame, we're at next-to-top, and were stopped
-     by a random signal (if it wasn't the right address under
-     these circumstances, we wouldn't be here at all by tests above
-     on the prior frame).  */
-  if (frame->next->next == NULL && stopped_by_random_signal)
-    {
-      /* We're pointing at the frame FOR PdxNullApi.  */
-      fm = frame->frame;
-    }
-  else
-    {
-      /* No...  We must be pointing at the frame that was called
-         by PdxSignalDeliverer; back up across the whole mess.  */
-
-      /* Extract the frame for PdxSignalDeliverer.  Note:
-         DEPRECATED_FRAME_CHAIN used the "old" frame pointer because
-         we were a deliverer.  Get the address of the context record
-         that's on here frameless.  */
-      context = read_memory_integer (frame->frame, 4);  /* an Arg */
-
-      /* Now extract the frame pointer contained in the context.  */
-      fm = read_memory_integer (context + mcontext_EBP_greg_offset, 4);
-
-      ra = read_memory_integer (context + mcontext_EIP_greg_offset, 4);
-
-      /* We need to know if we're in a system call because we'll be
-         in a syscall mini-frame, if so, and the rules are different.  */
-      t = (long) read_memory_integer (context + mcontext_syscall_greg_offset,
-                                      4);
-      /* t contains 0 if running free, 1 if blocked on a system call,
-         and 2 if blocked on an exception message (e.g. a trap);
-         we don't expect to get here with a 2.  */
-      if (t != 1)
-        {
-          /* Not at a system call, therefore it can't be NullApi.  */
-          frame->pc = ra;
-          frame->frame = fm;
-          return;
-        }
-
-      /* It's a system call...  Mini frame, then look for NullApi.  */
-      /* Get the RA (on the stack) associated with this...  It's
-         a system call mini-frame.  */
-      ra = read_memory_integer (context + mcontext_UESP_greg_offset, 4);
-
-      if (winver >= 51)
-        {
-          /* Newer versions of Windows NT interpose another return
-             address (but no other "stack frame" stuff) that we need
-             to simply ignore here.  */
-          ra += 4;
-        }
-
-      ra = read_memory_integer (ra, 4);
-
-      if (!(ra >= null_start && ra < null_end))
-        {
-          /* No Null API present; we're done.  */
-          frame->pc = ra;
-          frame->frame = fm;
-          return;
-        }
-    }
-
-  /* At this point, we're looking at the frame for PdxNullPosixApi,
-     in either case.
-
-     PdxNullPosixApi is called by PdxNullApiCaller (which in turn
-     is called by _PdxNullApiCaller (note the _).)
-     PdxNullPosixApiCaller (no _) is a frameless function.
-
-     The saved frame pointer is as fm, but it's not of interest
-     to us because it skips us over the saved context, which is
-     the wrong thing to do, because it skips the interrrupted
-     routine!  PdxNullApiCaller takes as its only argument the
-     address of the context of the interrupded function (which
-     is really in no frame, but jammed on the stack by the system)
-
-     So: fm+0: saved bp
-     fm+4: return address to _PdxNullApiCaller
-     fm+8: arg to PdxNullApiCaller pushed by _Pdx...  */
-
-  fm = read_memory_integer (fm + 0x8, 4);
-
-  /* Extract the second context record.  */
-
-  ra = read_memory_integer (fm + mcontext_EIP_greg_offset, 4);
-  fm = read_memory_integer (fm + mcontext_EBP_greg_offset, 4);
-
-  frame->frame = fm;
-  frame->pc = ra;
-
-  return;
-}
-
-static CORE_ADDR
-i386_interix_frame_saved_pc (struct frame_info *fi)
-{
-  /* Assume that we've already unwound enough to have the caller's address
-     if we're dealing with a signal handler caller (And if that fails,
-     return 0).  */
-  if ((get_frame_type (fi) == SIGTRAMP_FRAME))
-    return fi->next ? fi->next->pc : 0;
-  else
-    return read_memory_integer (fi->frame + 4, 4);
-}
-
-static void
-i386_interix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
-{
-  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
-  tdep->struct_return = reg_struct_return;
-  tdep->jb_pc_offset = jump_buffer_Eip_offset;
-
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, i386_interix_pc_in_sigtramp);
-  set_gdbarch_in_solib_call_trampoline (gdbarch,
-                                        i386_interix_in_solib_call_trampoline);
-  set_gdbarch_skip_trampoline_code (gdbarch,
-                                    i386_interix_skip_trampoline_code);
-  set_gdbarch_deprecated_init_extra_frame_info (gdbarch, i386_interix_back_one_frame);
-  set_gdbarch_deprecated_frame_chain_valid (gdbarch, i386_interix_frame_chain_valid);
-  set_gdbarch_deprecated_frame_saved_pc (gdbarch, i386_interix_frame_saved_pc);
-  set_gdbarch_name_of_malloc (gdbarch, "_malloc");
-}
-
-static enum gdb_osabi
-i386_interix_osabi_sniffer (bfd * abfd)
-{
-  char *target_name = bfd_get_target (abfd);
-
-  if (strcmp (target_name, "pei-i386") == 0)
-    return GDB_OSABI_INTERIX;
-
-  return GDB_OSABI_UNKNOWN;
-}
-
-void
-_initialize_i386_interix_tdep (void)
-{
-  gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour,
-                                  i386_interix_osabi_sniffer);
-
-  gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_INTERIX,
-                          i386_interix_init_abi);
-}
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 1643661..128e719 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -1,6 +1,6 @@
-/* Native-dependent code for GNU/Linux x86.
+/* Native-dependent code for GNU/Linux i386.
 
-   Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index e177d59..2b08e89 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -83,13 +83,13 @@
 
    Checking for the code sequence should be somewhat reliable, because
    the effect is to call the system call sigreturn.  This is unlikely
-   to occur anywhere other than a signal trampoline.
+   to occur anywhere other than in a signal trampoline.
 
    It kind of sucks that we have to read memory from the process in
    order to identify a signal trampoline, but there doesn't seem to be
-   any other way.  The DEPRECATED_PC_IN_SIGTRAMP macro in tm-linux.h
-   arranges to only call us if no function name could be identified,
-   which should be the case since the code is on the stack.
+   any other way.  Therefore we only do the memory reads if no
+   function name could be identified, which should be the case since
+   the code is on the stack.
 
    Detection of signal trampolines for handlers that set the
    SA_RESTORER flag is in general not possible.  Unfortunately this is
@@ -217,11 +217,17 @@
   return pc;
 }
 
-/* Return whether PC is in a GNU/Linux sigtramp routine.  */
+/* Return whether the frame preceding NEXT_FRAME corresponds to a
+   GNU/Linux sigtramp routine.  */
 
 static int
-i386_linux_pc_in_sigtramp (CORE_ADDR pc, char *name)
+i386_linux_sigtramp_p (struct frame_info *next_frame)
 {
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
+
   /* If we have NAME, we can optimize the search.  The trampolines are
      named __restore and __restore_rt.  However, they aren't dynamically
      exported from the shared C library, so the trampoline may appear to
@@ -394,16 +400,11 @@
 
   tdep->jb_pc_offset = 20;	/* From <bits/setjmp.h>.  */
 
+  tdep->sigtramp_p = i386_linux_sigtramp_p;
   tdep->sigcontext_addr = i386_linux_sigcontext_addr;
   tdep->sc_reg_offset = i386_linux_sc_reg_offset;
   tdep->sc_num_regs = ARRAY_SIZE (i386_linux_sc_reg_offset);
 
-  /* When the i386 Linux kernel calls a signal handler, the return
-     address points to a bit of code on the stack.  This function is
-     used to identify this bit of code as a signal trampoline in order
-     to support backtracing through calls to signal handlers.  */
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, i386_linux_pc_in_sigtramp);
-
   /* GNU/Linux uses SVR4-style shared libraries.  */
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c
index 69a945e..8538db7 100644
--- a/gdb/i386-nto-tdep.c
+++ b/gdb/i386-nto-tdep.c
@@ -1,6 +1,6 @@
-/* i386-nto-tdep.c - i386 specific functionality for QNX Neutrino.
+/* Target-dependent code for QNX Neutrino x86.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by QNX Software Systems Ltd.
 
@@ -225,9 +225,16 @@
   return lmp;
 }
 
+/* Return whether the frame preceding NEXT_FRAME corresponds to a QNX
+   Neutrino sigtramp routine.  */
+
 static int
-i386nto_pc_in_sigtramp (CORE_ADDR pc, char *name)
+i386nto_sigtramp_p (struct frame_info *next_frame)
 {
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
   return name && strcmp ("__signalstub", name) == 0;
 }
 
@@ -242,7 +249,7 @@
   char buf[4];
   CORE_ADDR sp;
 
-  frame_unwind_register (next_frame, SP_REGNUM, buf);
+  frame_unwind_register (next_frame, I386_ESP_REGNUM, buf);
   sp = extract_unsigned_integer (buf, 4);
 
   return sp + I386_NTO_SIGCONTEXT_OFFSET;
@@ -278,7 +285,7 @@
   set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, i386nto_pc_in_sigtramp);
+  tdep->sigtramp_p = i386nto_sigtramp_p;
   tdep->sigcontext_addr = i386nto_sigcontext_addr;
   tdep->sc_pc_offset = 56;
   tdep->sc_sp_offset = 68;
diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c
index 96cd10d..46a7a7c 100644
--- a/gdb/i386-sol2-tdep.c
+++ b/gdb/i386-sol2-tdep.c
@@ -1,5 +1,6 @@
 /* Target-dependent code for Solaris x86.
-   Copyright 2002, 2003 Free Software Foundation, Inc.
+
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,7 +23,10 @@
 #include "value.h"
 #include "osabi.h"
 
+#include "gdb_string.h"
+
 #include "i386-tdep.h"
+#include "solib-svr4.h"
 
 /* From <ia32/sys/reg.h>.  */
 static int i386_sol2_gregset_reg_offset[] =
@@ -45,12 +49,18 @@
   0 * 4				/* %gs */
 };
 
+/* Return whether the frame preceding NEXT_FRAME corresponds to a
+   Solaris sigtramp routine.  */
+
 static int
-i386_sol2_pc_in_sigtramp (CORE_ADDR pc, char *name)
+i386_sol2_sigtramp_p (struct frame_info *next_frame)
 {
-  /* Signal handler frames under Solaris 2 are recognized by a return
-     address of 0xffffffff.  */
-  return (pc == 0xffffffff);
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
+  return (name && (strcmp ("sigacthandler", name) == 0
+		   || strcmp (name, "ucbsigvechandler") == 0));
 }
 
 /* Solaris doesn't have a `struct sigcontext', but it does have a
@@ -85,12 +95,14 @@
   tdep->sizeof_gregset = 19 * 4;
   tdep->sizeof_fpregset = 380;
 
+  /* Signal trampolines are slightly different from SVR4.  */
+  tdep->sigtramp_p = i386_sol2_sigtramp_p;
   tdep->sigcontext_addr = i386_sol2_mcontext_addr;
   tdep->sc_reg_offset = tdep->gregset_reg_offset;
   tdep->sc_num_regs = tdep->gregset_num_regs;
 
-  /* Signal trampolines are slightly different from SVR4.  */
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, i386_sol2_pc_in_sigtramp);
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, svr4_ilp32_fetch_link_map_offsets);
 }
 
 
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 84c6818..19e7ed9 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -51,8 +51,7 @@
 #include "i386-tdep.h"
 #include "i387-tdep.h"
 
-/* Names of the registers.  The first 10 registers match the register
-   numbering scheme used by GCC for stabs and DWARF.  */
+/* Register names.  */
 
 static char *i386_register_names[] =
 {
@@ -71,7 +70,7 @@
 
 static const int i386_num_register_names = ARRAY_SIZE (i386_register_names);
 
-/* MMX registers.  */
+/* Register names for MMX pseudo-registers.  */
 
 static char *i386_mmx_names[] =
 {
@@ -166,17 +165,24 @@
   return NULL;
 }
 
-/* Convert stabs register number REG to the appropriate register
+/* Convert a dbx register number REG to the appropriate register
    number used by GDB.  */
 
 static int
-i386_stab_reg_to_regnum (int reg)
+i386_dbx_reg_to_regnum (int reg)
 {
-  /* This implements what GCC calls the "default" register map.  */
+  /* This implements what GCC calls the "default" register map
+     (dbx_register_map[]).  */
+
   if (reg >= 0 && reg <= 7)
     {
-      /* General-purpose registers.  */
-      return reg;
+      /* General-purpose registers.  The debug info calls %ebp
+         register 4, and %esp register 5.  */
+      if (reg == 4)
+        return 5;
+      else if (reg == 5)
+        return 4;
+      else return reg;
     }
   else if (reg >= 12 && reg <= 19)
     {
@@ -198,13 +204,16 @@
   return NUM_REGS + NUM_PSEUDO_REGS;
 }
 
-/* Convert DWARF register number REG to the appropriate register
-   number used by GDB.  */
+/* Convert SVR4 register number REG to the appropriate register number
+   used by GDB.  */
 
 static int
-i386_dwarf_reg_to_regnum (int reg)
+i386_svr4_reg_to_regnum (int reg)
 {
-  /* The DWARF register numbering includes %eip and %eflags, and
+  /* This implements the GCC register map that tries to be compatible
+     with the SVR4 C compiler for DWARF (svr4_dbx_register_map[]).  */
+
+  /* The SVR4 register numbering includes %eip and %eflags, and
      numbers the floating point registers differently.  */
   if (reg >= 0 && reg <= 9)
     {
@@ -218,8 +227,8 @@
     }
   else if (reg >= 21)
     {
-      /* The SSE and MMX registers have identical numbers as in stabs.  */
-      return i386_stab_reg_to_regnum (reg);
+      /* The SSE and MMX registers have the same numbers as with dbx.  */
+      return i386_dbx_reg_to_regnum (reg);
     }
 
   /* This will hopefully provoke a warning.  */
@@ -563,12 +572,12 @@
 
 	    subl $XXX, %esp
 
-	 NOTE: You can't subtract a 16 bit immediate from a 32 bit
+	 NOTE: You can't subtract a 16-bit immediate from a 32-bit
 	 reg, so we don't have to worry about a data16 prefix.  */
       op = read_memory_unsigned_integer (pc + 3, 1);
       if (op == 0x83)
 	{
-	  /* `subl' with 8 bit immediate.  */
+	  /* `subl' with 8-bit immediate.  */
 	  if (read_memory_unsigned_integer (pc + 4, 1) != 0xec)
 	    /* Some instruction starting with 0x83 other than `subl'.  */
 	    return pc + 3;
@@ -580,12 +589,12 @@
 	}
       else if (op == 0x81)
 	{
-	  /* Maybe it is `subl' with a 32 bit immedediate.  */
+	  /* Maybe it is `subl' with a 32-bit immediate.  */
 	  if (read_memory_unsigned_integer (pc + 4, 1) != 0xec)
 	    /* Some instruction starting with 0x81 other than `subl'.  */
 	    return pc + 3;
 
-	  /* It is `subl' with a 32 bit immediate.  */
+	  /* It is `subl' with a 32-bit immediate.  */
 	  cache->locals = read_memory_integer (pc + 5, 4);
 	  return pc + 9;
 	}
@@ -648,9 +657,9 @@
    once used in the System V compiler).
 
    Local space is allocated just below the saved %ebp by either the
-   'enter' instruction, or by "subl $<size>, %esp".  'enter' has a 16
-   bit unsigned argument for space to allocate, and the 'addl'
-   instruction could have either a signed byte, or 32 bit immediate.
+   'enter' instruction, or by "subl $<size>, %esp".  'enter' has a
+   16-bit unsigned argument for space to allocate, and the 'addl'
+   instruction could have either a signed byte, or 32-bit immediate.
 
    Next, the registers used by this function are pushed.  With the
    System V compiler they will always be in the order: %edi, %esi,
@@ -741,7 +750,13 @@
 	}
     }
 
-  return i386_follow_jump (pc);
+  /* If the function starts with a branch (to startup code at the end)
+     the last instruction should bring us back to the first
+     instruction of the real code.  */
+  if (i386_follow_jump (start_pc) != start_pc)
+    pc = i386_follow_jump (pc);
+
+  return pc;
 }
 
 /* This function is 64-bit safe.  */
@@ -1010,17 +1025,27 @@
 static const struct frame_unwind *
 i386_sigtramp_frame_sniffer (struct frame_info *next_frame)
 {
-  CORE_ADDR pc = frame_pc_unwind (next_frame);
-  char *name;
+  struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (next_frame));
 
-  /* We shouldn't even bother to try if the OSABI didn't register
-     a sigcontext_addr handler.  */
-  if (!gdbarch_tdep (current_gdbarch)->sigcontext_addr)
+  /* We shouldn't even bother if we don't have a sigcontext_addr
+     handler.  */
+  if (tdep->sigcontext_addr == NULL)
     return NULL;
 
-  find_pc_partial_function (pc, &name, NULL, NULL);
-  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
-    return &i386_sigtramp_frame_unwind;
+  if (tdep->sigtramp_p != NULL)
+    {
+      if (tdep->sigtramp_p (next_frame))
+	return &i386_sigtramp_frame_unwind;
+    }
+
+  if (tdep->sigtramp_start != 0)
+    {
+      CORE_ADDR pc = frame_pc_unwind (next_frame);
+
+      gdb_assert (tdep->sigtramp_end != 0);
+      if (pc >= tdep->sigtramp_start && pc < tdep->sigtramp_end)
+	return &i386_sigtramp_frame_unwind;
+    }
 
   return NULL;
 }
@@ -1094,7 +1119,7 @@
 
 
 static CORE_ADDR
-i386_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		      struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
 		      struct value **args, CORE_ADDR sp, int struct_return,
 		      CORE_ADDR struct_addr)
@@ -1142,7 +1167,7 @@
      (i386_frame_this_id, i386_sigtramp_frame_this_id,
      i386_unwind_dummy_id).  It's there, since all frame unwinders for
      a given target have to agree (within a certain margin) on the
-     defenition of the stack address of a frame.  Otherwise
+     definition of the stack address of a frame.  Otherwise
      frame_id_inner() won't work correctly.  Since DWARF2/GCC uses the
      stack address *before* the function call as a frame's CFA.  On
      the i386, when %ebp is used as a frame pointer, the offset
@@ -1327,7 +1352,28 @@
 
   if ((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION)
       && !i386_reg_struct_return_p (gdbarch, type))
-    return RETURN_VALUE_STRUCT_CONVENTION;
+    {
+      /* The System V ABI says that:
+
+	 "A function that returns a structure or union also sets %eax
+	 to the value of the original address of the caller's area
+	 before it returns.  Thus when the caller receives control
+	 again, the address of the returned object resides in register
+	 %eax and can be used to access the object."
+
+	 So the ABI guarantees that we can always find the return
+	 value just after the function has returned.  */
+
+      if (readbuf)
+	{
+	  ULONGEST addr;
+
+	  regcache_raw_read_unsigned (regcache, I386_EAX_REGNUM, &addr);
+	  read_memory (addr, readbuf, TYPE_LENGTH (type));
+	}
+
+      return RETURN_VALUE_ABI_RETURNS_ADDRESS;
+    }
 
   /* This special case is for structures consisting of a single
      `float' or `double' member.  These structures are returned in
@@ -1514,7 +1560,7 @@
       return;
     }
 
-  /* Read a value spread accross multiple registers.  */
+  /* Read a value spread across multiple registers.  */
 
   gdb_assert (len > 4 && len % 4 == 0);
 
@@ -1546,7 +1592,7 @@
       return;
     }
 
-  /* Write a value spread accross multiple registers.  */
+  /* Write a value spread across multiple registers.  */
 
   gdb_assert (len > 4 && len % 4 == 0);
 
@@ -1562,15 +1608,15 @@
     }
 }
 
-/* Supply register REGNUM from the general-purpose register set REGSET
-   to register cache REGCACHE.  If REGNUM is -1, do this for all
-   registers in REGSET.  */
+/* Supply register REGNUM from the buffer specified by GREGS and LEN
+   in the general-purpose register set REGSET to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 void
 i386_supply_gregset (const struct regset *regset, struct regcache *regcache,
 		     int regnum, const void *gregs, size_t len)
 {
-  const struct gdbarch_tdep *tdep = regset->descr;
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
   const char *regs = gregs;
   int i;
 
@@ -1584,15 +1630,39 @@
     }
 }
 
-/* Supply register REGNUM from the floating-point register set REGSET
-   to register cache REGCACHE.  If REGNUM is -1, do this for all
-   registers in REGSET.  */
+/* Collect register REGNUM from the register cache REGCACHE and store
+   it in the buffer specified by GREGS and LEN as described by the
+   general-purpose register set REGSET.  If REGNUM is -1, do this for
+   all registers in REGSET.  */
+
+void
+i386_collect_gregset (const struct regset *regset,
+		      const struct regcache *regcache,
+		      int regnum, void *gregs, size_t len)
+{
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+  char *regs = gregs;
+  int i;
+
+  gdb_assert (len == tdep->sizeof_gregset);
+
+  for (i = 0; i < tdep->gregset_num_regs; i++)
+    {
+      if ((regnum == i || regnum == -1)
+	  && tdep->gregset_reg_offset[i] != -1)
+	regcache_raw_collect (regcache, i, regs + tdep->gregset_reg_offset[i]);
+    }
+}
+
+/* Supply register REGNUM from the buffer specified by FPREGS and LEN
+   in the floating-point register set REGSET to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
 
 static void
 i386_supply_fpregset (const struct regset *regset, struct regcache *regcache,
 		      int regnum, const void *fpregs, size_t len)
 {
-  const struct gdbarch_tdep *tdep = regset->descr;
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
 
   if (len == I387_SIZEOF_FXSAVE)
     {
@@ -1604,6 +1674,28 @@
   i387_supply_fsave (regcache, regnum, fpregs);
 }
 
+/* Collect register REGNUM from the register cache REGCACHE and store
+   it in the buffer specified by FPREGS and LEN as described by the
+   floating-point register set REGSET.  If REGNUM is -1, do this for
+   all registers in REGSET.  */
+
+static void
+i386_collect_fpregset (const struct regset *regset,
+		       const struct regcache *regcache,
+		       int regnum, void *fpregs, size_t len)
+{
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
+
+  if (len == I387_SIZEOF_FXSAVE)
+    {
+      i387_collect_fxsave (regcache, regnum, fpregs);
+      return;
+    }
+
+  gdb_assert (len == tdep->sizeof_fpregset);
+  i387_collect_fsave (regcache, regnum, fpregs);
+}
+
 /* Return the appropriate register set for the core section identified
    by SECT_NAME and SECT_SIZE.  */
 
@@ -1616,11 +1708,8 @@
   if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
     {
       if (tdep->gregset == NULL)
-	{
-	  tdep->gregset = XMALLOC (struct regset);
-	  tdep->gregset->descr = tdep;
-	  tdep->gregset->supply_regset = i386_supply_gregset;
-	}
+	tdep->gregset = regset_alloc (gdbarch, i386_supply_gregset,
+				      i386_collect_gregset);
       return tdep->gregset;
     }
 
@@ -1629,11 +1718,8 @@
 	  && sect_size == I387_SIZEOF_FXSAVE))
     {
       if (tdep->fpregset == NULL)
-	{
-	  tdep->fpregset = XMALLOC (struct regset);
-	  tdep->fpregset->descr = tdep;
-	  tdep->fpregset->supply_regset = i386_supply_fpregset;
-	}
+	tdep->fpregset = regset_alloc (gdbarch, i386_supply_fpregset,
+				       i386_collect_fpregset);
       return tdep->fpregset;
     }
 
@@ -1690,12 +1776,16 @@
 }
 
 
-/* Return non-zero if PC and NAME show that we are in a signal
-   trampoline.  */
+/* Return whether the frame preceding NEXT_FRAME corresponds to a
+   sigtramp routine.  */
 
 static int
-i386_pc_in_sigtramp (CORE_ADDR pc, char *name)
+i386_sigtramp_p (struct frame_info *next_frame)
 {
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
   return (name && strcmp ("_sigtramp", name) == 0);
 }
 
@@ -1725,11 +1815,18 @@
 
 /* System V Release 4 (SVR4).  */
 
+/* Return whether the frame preceding NEXT_FRAME corresponds to a SVR4
+   sigtramp routine.  */
+
 static int
-i386_svr4_pc_in_sigtramp (CORE_ADDR pc, char *name)
+i386_svr4_sigtramp_p (struct frame_info *next_frame)
 {
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
   /* UnixWare uses _sigacthandler.  The origin of the other symbols is
      currently unknown.  */
+  find_pc_partial_function (pc, &name, NULL, NULL);
   return (name && (strcmp ("_sigreturn", name) == 0
 		   || strcmp ("_sigacthandler", name) == 0
 		   || strcmp ("sigvechandler", name) == 0));
@@ -1752,23 +1849,13 @@
 }
 
 
-/* DJGPP.  */
-
-static int
-i386_go32_pc_in_sigtramp (CORE_ADDR pc, char *name)
-{
-  /* DJGPP doesn't have any special frames for signal handlers.  */
-  return 0;
-}
-
-
 /* Generic ELF.  */
 
 void
 i386_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
-  /* We typically use stabs-in-ELF with the DWARF register numbering.  */
-  set_gdbarch_stab_reg_to_regnum (gdbarch, i386_dwarf_reg_to_regnum);
+  /* We typically use stabs-in-ELF with the SVR4 register numbering.  */
+  set_gdbarch_stab_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
 }
 
 /* System V Release 4 (SVR4).  */
@@ -1785,7 +1872,7 @@
   set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, i386_svr4_pc_in_sigtramp);
+  tdep->sigtramp_p = i386_svr4_sigtramp_p;
   tdep->sigcontext_addr = i386_svr4_sigcontext_addr;
   tdep->sc_pc_offset = 36 + 14 * 4;
   tdep->sc_sp_offset = 36 + 17 * 4;
@@ -1800,7 +1887,8 @@
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, i386_go32_pc_in_sigtramp);
+  /* DJGPP doesn't have any special frames for signal handlers.  */
+  tdep->sigtramp_p = NULL;
 
   tdep->jb_pc_offset = 36;
 }
@@ -1905,7 +1993,7 @@
   tdep->sizeof_fpregset = I387_SIZEOF_FSAVE;
 
   /* The default settings include the FPU registers, the MMX registers
-     and the SSE registers.  This can be overidden for a specific ABI
+     and the SSE registers.  This can be overridden for a specific ABI
      by adjusting the members `st0_regnum', `mm0_regnum' and
      `num_xmm_regs' of `struct gdbarch_tdep', otherwise the registers
      will show up in the output of "info all-registers".  Ideally we
@@ -1921,7 +2009,7 @@
   tdep->st0_regnum = I386_ST0_REGNUM;
 
   /* The MMX registers are implemented as pseudo-registers.  Put off
-     caclulating the register number for %mm0 until we know the number
+     calculating the register number for %mm0 until we know the number
      of raw registers.  */
   tdep->mm0_regnum = 0;
 
@@ -1932,6 +2020,7 @@
   tdep->struct_return = pcc_struct_return;
   tdep->sigtramp_start = 0;
   tdep->sigtramp_end = 0;
+  tdep->sigtramp_p = i386_sigtramp_p;
   tdep->sigcontext_addr = NULL;
   tdep->sc_reg_offset = NULL;
   tdep->sc_pc_offset = -1;
@@ -1960,13 +2049,43 @@
   set_gdbarch_ps_regnum (gdbarch, I386_EFLAGS_REGNUM); /* %eflags */
   set_gdbarch_fp0_regnum (gdbarch, I386_ST0_REGNUM); /* %st(0) */
 
-  /* Use the "default" register numbering scheme for stabs and COFF.  */
-  set_gdbarch_stab_reg_to_regnum (gdbarch, i386_stab_reg_to_regnum);
-  set_gdbarch_sdb_reg_to_regnum (gdbarch, i386_stab_reg_to_regnum);
+  /* NOTE: kettenis/20040418: GCC does have two possible register
+     numbering schemes on the i386: dbx and SVR4.  These schemes
+     differ in how they number %ebp, %esp, %eflags, and the
+     floating-point registers, and are implemented by the arrays
+     dbx_register_map[] and svr4_dbx_register_map in
+     gcc/config/i386.c.  GCC also defines a third numbering scheme in
+     gcc/config/i386.c, which it designates as the "default" register
+     map used in 64bit mode.  This last register numbering scheme is
+     implemented in dbx64_register_map, and is used for AMD64; see
+     amd64-tdep.c.
 
-  /* Use the DWARF register numbering scheme for DWARF and DWARF 2.  */
-  set_gdbarch_dwarf_reg_to_regnum (gdbarch, i386_dwarf_reg_to_regnum);
-  set_gdbarch_dwarf2_reg_to_regnum (gdbarch, i386_dwarf_reg_to_regnum);
+     Currently, each GCC i386 target always uses the same register
+     numbering scheme across all its supported debugging formats
+     i.e. SDB (COFF), stabs and DWARF 2.  This is because
+     gcc/sdbout.c, gcc/dbxout.c and gcc/dwarf2out.c all use the
+     DBX_REGISTER_NUMBER macro which is defined by each target's
+     respective config header in a manner independent of the requested
+     output debugging format.
+
+     This does not match the arrangement below, which presumes that
+     the SDB and stabs numbering schemes differ from the DWARF and
+     DWARF 2 ones.  The reason for this arrangement is that it is
+     likely to get the numbering scheme for the target's
+     default/native debug format right.  For targets where GCC is the
+     native compiler (FreeBSD, NetBSD, OpenBSD, GNU/Linux) or for
+     targets where the native toolchain uses a different numbering
+     scheme for a particular debug format (stabs-in-ELF on Solaris)
+     the defaults below will have to be overridden, like
+     i386_elf_init_abi() does.  */
+
+  /* Use the dbx register numbering scheme for stabs and COFF.  */
+  set_gdbarch_stab_reg_to_regnum (gdbarch, i386_dbx_reg_to_regnum);
+  set_gdbarch_sdb_reg_to_regnum (gdbarch, i386_dbx_reg_to_regnum);
+
+  /* Use the SVR4 register numbering scheme for DWARF and DWARF 2.  */
+  set_gdbarch_dwarf_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
+  set_gdbarch_dwarf2_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
 
   /* We don't define ECOFF_REG_TO_REGNUM, since ECOFF doesn't seem to
      be in use on any of the supported i386 targets.  */
@@ -1993,7 +2112,6 @@
   set_gdbarch_decr_pc_after_break (gdbarch, 1);
 
   set_gdbarch_frame_args_skip (gdbarch, 8);
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, i386_pc_in_sigtramp);
 
   /* Wire in the MMX registers.  */
   set_gdbarch_num_pseudo_regs (gdbarch, i386_num_mmx_regs);
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index 9cb8765..32ef049 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -89,6 +89,9 @@
   CORE_ADDR sigtramp_start;
   CORE_ADDR sigtramp_end;
 
+  /* Detect sigtramp.  */
+  int (*sigtramp_p) (struct frame_info *);
+
   /* Get address of sigcontext for sigtramp.  */
   CORE_ADDR (*sigcontext_addr) (struct frame_info *);
 
@@ -217,9 +220,6 @@
 /* Functions and variables exported from i386bsd-tdep.c.  */
 
 extern void i386bsd_init_abi (struct gdbarch_info, struct gdbarch *);
-extern int i386bsd_pc_in_sigtramp (CORE_ADDR pc, char *name);
-extern CORE_ADDR i386bsd_sigtramp_start (CORE_ADDR pc);
-extern CORE_ADDR i386bsd_sigtramp_end (CORE_ADDR pc);
 extern CORE_ADDR i386fbsd_sigtramp_start_addr;
 extern CORE_ADDR i386fbsd_sigtramp_end_addr;
 extern CORE_ADDR i386obsd_sigtramp_start_addr;
diff --git a/gdb/i386bsd-nat.c b/gdb/i386bsd-nat.c
index 0f06b2b..4d663fc 100644
--- a/gdb/i386bsd-nat.c
+++ b/gdb/i386bsd-nat.c
@@ -31,20 +31,8 @@
 #include <machine/reg.h>
 #include <machine/frame.h>
 
-#ifdef HAVE_SYS_PROCFS_H
-#include <sys/procfs.h>
-#endif
-
-#ifndef HAVE_GREGSET_T
-typedef struct reg gregset_t;
-#endif
-
-#ifndef HAVE_FPREGSET_T
-typedef struct fpreg fpregset_t;
-#endif
-
-#include "gregset.h"
 #include "i386-tdep.h"
+#include "i387-tdep.h"
 
 
 /* In older BSD versions we cannot get at some of the segment
@@ -52,21 +40,13 @@
    registers until the 3.0 release.  We have autoconf checks for their
    presence, and deal gracefully with their absence.  */
 
-/* Registers we shouldn't try to fetch.  */
-#undef CANNOT_FETCH_REGISTER
-#define CANNOT_FETCH_REGISTER(regnum) cannot_fetch_register (regnum)
+/* Offset in `struct reg' where MEMBER is stored.  */
+#define REG_OFFSET(member) offsetof (struct reg, member)
 
-/* Registers we shouldn't try to store.  */
-#undef CANNOT_STORE_REGISTER
-#define CANNOT_STORE_REGISTER(regnum) cannot_fetch_register (regnum)
-
-/* Offset to the gregset_t location where REG is stored.  */
-#define REG_OFFSET(reg) offsetof (gregset_t, reg)
-
-/* At reg_offset[REGNUM] you'll find the offset to the gregset_t
-   location where the GDB register REGNUM is stored.  Unsupported
+/* At i386bsd_reg_offset[REGNUM] you'll find the offset in `struct
+   reg' where the GDB register REGNUM is stored.  Unsupported
    registers are marked with `-1'.  */
-static int reg_offset[] =
+static int i386bsd_r_reg_offset[] =
 {
   REG_OFFSET (r_eax),
   REG_OFFSET (r_ecx),
@@ -94,8 +74,6 @@
 #endif
 };
 
-#define REG_ADDR(regset, regnum) ((char *) (regset) + reg_offset[regnum])
-
 /* Macro to determine if a register is fetched with PT_GETREGS.  */
 #define GETREGS_SUPPLIES(regnum) \
   ((0 <= (regnum) && (regnum) <= 15))
@@ -105,68 +83,46 @@
    so that we try PT_GETXMMREGS the first time around.  */
 static int have_ptrace_xmmregs = -1;
 #endif
-
-/* Return nonzero if we shouldn't try to fetch register REGNUM.  */
-
-static int
-cannot_fetch_register (int regnum)
-{
-  return (reg_offset[regnum] == -1);
-}
 
 
-/* Transfering the registers between GDB, inferiors and core files.  */
+/* Supply the general-purpose registers in GREGS, to REGCACHE.  */
 
-/* Fill GDB's register array with the general-purpose register values
-   in *GREGSETP.  */
-
-void
-supply_gregset (gregset_t *gregsetp)
+static void
+i386bsd_supply_gregset (struct regcache *regcache, const void *gregs)
 {
-  int i;
+  const char *regs = gregs;
+  int regnum;
 
-  for (i = 0; i < I386_NUM_GREGS; i++)
+  for (regnum = 0; regnum < ARRAY_SIZE (i386bsd_r_reg_offset); regnum++)
     {
-      if (CANNOT_FETCH_REGISTER (i))
-	supply_register (i, NULL);
-      else
-	supply_register (i, REG_ADDR (gregsetp, i));
+      int offset = i386bsd_r_reg_offset[regnum];
+
+      if (offset != -1)
+	regcache_raw_supply (regcache, regnum, regs + offset);
     }
 }
 
-/* Fill register REGNUM (if it is a general-purpose register) in
-   *GREGSETPS with the value in GDB's register array.  If REGNUM is -1,
-   do this for all registers.  */
+/* Collect register REGNUM from REGCACHE and store its contents in
+   GREGS.  If REGNUM is -1, collect and store all appropriate
+   registers.  */
 
-void
-fill_gregset (gregset_t *gregsetp, int regnum)
+static void
+i386bsd_collect_gregset (const struct regcache *regcache,
+			 void *gregs, int regnum)
 {
+  char *regs = gregs;
   int i;
 
-  for (i = 0; i < I386_NUM_GREGS; i++)
-    if ((regnum == -1 || regnum == i) && ! CANNOT_STORE_REGISTER (i))
-      regcache_collect (i, REG_ADDR (gregsetp, i));
-}
+  for (i = 0; i < ARRAY_SIZE (i386bsd_r_reg_offset); i++)
+    {
+      if (regnum == -1 || regnum == i)
+	{
+	  int offset = i386bsd_r_reg_offset[i];
 
-#include "i387-tdep.h"
-
-/* Fill GDB's register array with the floating-point register values
-   in *FPREGSETP.  */
-
-void
-supply_fpregset (fpregset_t *fpregsetp)
-{
-  i387_supply_fsave (current_regcache, -1, fpregsetp);
-}
-
-/* Fill register REGNUM (if it is a floating-point register) in
-   *FPREGSETP with the value in GDB's register array.  If REGNUM is
-   -1, do this for all registers.  */
-
-void
-fill_fpregset (fpregset_t *fpregsetp, int regnum)
-{
-  i387_collect_fsave (current_regcache, regnum, fpregsetp);
+	  if (offset != -1)
+	    regcache_raw_collect (regcache, i, regs + offset);
+	}
+    }
 }
 
 /* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
@@ -177,20 +133,20 @@
 {
   if (regnum == -1 || GETREGS_SUPPLIES (regnum))
     {
-      gregset_t gregs;
+      struct reg regs;
 
       if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-		  (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+		  (PTRACE_ARG3_TYPE) &regs, 0) == -1)
 	perror_with_name ("Couldn't get registers");
 
-      supply_gregset (&gregs);
+      i386bsd_supply_gregset (current_regcache, &regs);
       if (regnum != -1)
 	return;
     }
 
   if (regnum == -1 || regnum >= I386_ST0_REGNUM)
     {
-      fpregset_t fpregs;
+      struct fpreg fpregs;
 #ifdef HAVE_PT_GETXMMREGS
       char xmmregs[512];
 
@@ -227,16 +183,16 @@
 {
   if (regnum == -1 || GETREGS_SUPPLIES (regnum))
     {
-      gregset_t gregs;
+      struct reg regs;
 
       if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-                  (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+                  (PTRACE_ARG3_TYPE) &regs, 0) == -1)
         perror_with_name ("Couldn't get registers");
 
-      fill_gregset (&gregs, regnum);
+      i386bsd_collect_gregset (current_regcache, &regs, regnum);
 
       if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
-	          (PTRACE_ARG3_TYPE) &gregs, 0) == -1)
+	          (PTRACE_ARG3_TYPE) &regs, 0) == -1)
         perror_with_name ("Couldn't write registers");
 
       if (regnum != -1)
@@ -245,7 +201,7 @@
 
   if (regnum == -1 || regnum >= I386_ST0_REGNUM)
     {
-      fpregset_t fpregs;
+      struct fpreg fpregs;
 #ifdef HAVE_PT_GETXMMREGS
       char xmmregs[512];
 
@@ -366,7 +322,9 @@
 CORE_ADDR
 register_u_addr (CORE_ADDR blockend, int regnum)
 {
-  return (CORE_ADDR) REG_ADDR (blockend, regnum);
+  gdb_assert (regnum >= 0 && regnum < ARRAY_SIZE (i386bsd_r_reg_offset));
+
+  return blockend + i386bsd_r_reg_offset[regnum];
 }
 
 #include <sys/param.h>
diff --git a/gdb/i386bsd-tdep.c b/gdb/i386bsd-tdep.c
index d501f73..4b4bffb 100644
--- a/gdb/i386bsd-tdep.c
+++ b/gdb/i386bsd-tdep.c
@@ -32,16 +32,6 @@
 
 /* Support for signal handlers.  */
 
-/* Return whether PC is in a BSD sigtramp routine.  */
-
-int
-i386bsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
-{
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
-  return (pc >= tdep->sigtramp_start && pc < tdep->sigtramp_end);
-}
-
 /* Assuming NEXT_FRAME is for a frame following a BSD sigtramp
    routine, return the address of the associated sigcontext structure.  */
 
@@ -56,22 +46,6 @@
 
   return read_memory_unsigned_integer (sp + 8, 4);
 }
-
-/* Return the start address of the sigtramp routine.  */
-
-CORE_ADDR
-i386bsd_sigtramp_start (CORE_ADDR pc)
-{
-  return gdbarch_tdep (current_gdbarch)->sigtramp_start;
-}
-
-/* Return the end address of the sigtramp routine.  */
-
-CORE_ADDR
-i386bsd_sigtramp_end (CORE_ADDR pc)
-{
-  return gdbarch_tdep (current_gdbarch)->sigtramp_end;
-}
 
 
 /* Support for shared libraries.  */
@@ -112,12 +86,6 @@
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, i386bsd_pc_in_sigtramp);
-
-  /* Allow the recognition of sigtramps as a function named <sigtramp>.  */
-  set_gdbarch_deprecated_sigtramp_start (gdbarch, i386bsd_sigtramp_start);
-  set_gdbarch_deprecated_sigtramp_end (gdbarch, i386bsd_sigtramp_end);
-
   /* Assume SunOS-style shared libraries.  */
   set_gdbarch_in_solib_call_trampoline (gdbarch,
 					i386bsd_aout_in_solib_call_trampoline);
diff --git a/gdb/i386fbsd-nat.c b/gdb/i386fbsd-nat.c
index efc61b6..ed07711 100644
--- a/gdb/i386fbsd-nat.c
+++ b/gdb/i386fbsd-nat.c
@@ -29,9 +29,6 @@
 
 #include "i386-tdep.h"
 
-/* Prevent warning from -Wmissing-prototypes.  */
-void _initialize_i386fbsd_nat (void);
-
 /* Resume execution of the inferior process.
    If STEP is nonzero, single-step it.
    If SIGNAL is nonzero, give it that signal.  */
@@ -79,6 +76,46 @@
     perror_with_name ("ptrace");
 }
 
+
+/* Support for debugging kernel virtual memory images.  */
+
+#include <sys/types.h>
+#include <machine/pcb.h>
+
+#include "bsd-kvm.h"
+
+static int
+i386fbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
+{
+  /* The following is true for FreeBSD 4.7:
+
+     The pcb contains %eip, %ebx, %esp, %ebp, %esi, %edi and %gs.
+     This accounts for all callee-saved registers specified by the
+     psABI and then some.  Here %esp contains the stack pointer at the
+     point just after the call to cpu_switch().  From this information
+     we reconstruct the register state as it would look when we just
+     returned from cpu_switch().  */
+
+  /* The stack pointer shouldn't be zero.  */
+  if (pcb->pcb_esp == 0)
+    return 0;
+
+  pcb->pcb_esp += 4;
+  regcache_raw_supply (regcache, I386_EDI_REGNUM, &pcb->pcb_edi);
+  regcache_raw_supply (regcache, I386_ESI_REGNUM, &pcb->pcb_esi);
+  regcache_raw_supply (regcache, I386_EBP_REGNUM, &pcb->pcb_ebp);
+  regcache_raw_supply (regcache, I386_ESP_REGNUM, &pcb->pcb_esp);
+  regcache_raw_supply (regcache, I386_EBX_REGNUM, &pcb->pcb_ebx);
+  regcache_raw_supply (regcache, I386_EIP_REGNUM, &pcb->pcb_eip);
+  regcache_raw_supply (regcache, I386_GS_REGNUM, &pcb->pcb_gs);
+
+  return 1;
+}
+
+
+/* Prevent warning from -Wmissing-prototypes.  */
+void _initialize_i386fbsd_nat (void);
+
 void
 _initialize_i386fbsd_nat (void)
 {
@@ -104,4 +141,7 @@
       }
   }
 #endif
+
+  /* Support debugging kernel virtual memory images.  */
+  bsd_kvm_add_target (i386fbsd_supply_pcb);
 }
diff --git a/gdb/i386nbsd-nat.c b/gdb/i386nbsd-nat.c
new file mode 100644
index 0000000..92da7e1
--- /dev/null
+++ b/gdb/i386nbsd-nat.c
@@ -0,0 +1,82 @@
+/* Native-dependent code for NetBSD/i386.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "regcache.h"
+
+#include "i386-tdep.h"
+
+/* Support for debugging kernel virtual memory images.  */
+
+#include <sys/types.h>
+#include <machine/frame.h>
+#include <machine/pcb.h>
+
+#include "bsd-kvm.h"
+
+static int
+i386nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
+{
+  struct switchframe sf;
+
+  /* The following is true for NetBSD 1.6.2:
+
+     The pcb contains %esp and %ebp at the point of the context switch
+     in cpu_switch().  At that point we have a stack frame as
+     described by `struct switchframe', which for NetBSD 1.6.2 has the
+     following layout:
+
+     interrupt level
+     %edi
+     %esi
+     %ebx
+     %eip
+
+     we reconstruct the register state as it would look when we just
+     returned from cpu_switch().  */
+
+  /* The stack pointer shouldn't be zero.  */
+  if (pcb->pcb_esp == 0)
+    return 0;
+
+  read_memory (pcb->pcb_esp, (char *) &sf, sizeof sf);
+  pcb->pcb_esp += sizeof (struct switchframe);
+  regcache_raw_supply (regcache, I386_EDI_REGNUM, &sf.sf_edi);
+  regcache_raw_supply (regcache, I386_ESI_REGNUM, &sf.sf_esi);
+  regcache_raw_supply (regcache, I386_EBP_REGNUM, &pcb->pcb_ebp);
+  regcache_raw_supply (regcache, I386_ESP_REGNUM, &pcb->pcb_esp);
+  regcache_raw_supply (regcache, I386_EBX_REGNUM, &sf.sf_ebx);
+  regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf.sf_eip);
+
+  return 1;
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_i386nbsd_nat (void);
+
+void
+_initialize_i386nbsd_nat (void)
+{
+  /* Support debugging kernel virtual memory images.  */
+  bsd_kvm_add_target (i386nbsd_supply_pcb);
+}
diff --git a/gdb/i386nbsd-tdep.c b/gdb/i386nbsd-tdep.c
index e1e05aa..3f19608 100644
--- a/gdb/i386nbsd-tdep.c
+++ b/gdb/i386nbsd-tdep.c
@@ -23,10 +23,12 @@
 
 #include "defs.h"
 #include "arch-utils.h"
+#include "frame.h"
 #include "gdbcore.h"
 #include "regcache.h"
 #include "regset.h"
 #include "osabi.h"
+#include "symtab.h"
 
 #include "gdb_assert.h"
 #include "gdb_string.h"
@@ -62,7 +64,7 @@
 			     struct regcache *regcache, int regnum,
 			     const void *regs, size_t len)
 {
-  const struct gdbarch_tdep *tdep = regset->descr;
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
 
   gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE);
 
@@ -84,11 +86,8 @@
       && sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
     {
       if (tdep->gregset == NULL)
-	{
-	  tdep->gregset = XMALLOC (struct regset);
-	  tdep->gregset->descr = tdep;
-	  tdep->gregset->supply_regset = i386nbsd_aout_supply_regset;
-	}
+        tdep->gregset =
+	  regset_alloc (gdbarch, i386nbsd_aout_supply_regset, NULL);
       return tdep->gregset;
     }
 
@@ -183,9 +182,16 @@
   return -1;
 }
 
+/* Return whether the frame preceding NEXT_FRAME corresponds to a
+   NetBSD sigtramp routine.  */
+
 static int
-i386nbsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
+i386nbsd_sigtramp_p (struct frame_info *next_frame)
 {
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
   return (nbsd_pc_in_sigtramp (pc, name)
 	  || i386nbsd_sigtramp_offset (pc) >= 0);
 }
@@ -225,12 +231,9 @@
   tdep->sizeof_gregset = 16 * 4;
 
   /* NetBSD has different signal trampoline conventions.  */
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, i386nbsd_pc_in_sigtramp);
-  /* FIXME: kettenis/20020906: We should probably provide
-     NetBSD-specific versions of these functions if we want to
-     recognize signal trampolines that live on the stack.  */
-  set_gdbarch_deprecated_sigtramp_start (gdbarch, NULL);
-  set_gdbarch_deprecated_sigtramp_end (gdbarch, NULL);
+  tdep->sigtramp_start = 0;
+  tdep->sigtramp_end = 0;
+  tdep->sigtramp_p = i386nbsd_sigtramp_p;
 
   /* NetBSD uses -freg-struct-return by default.  */
   tdep->struct_return = reg_struct_return;
diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c
index 740bae3..6f1ae5b 100644
--- a/gdb/i386obsd-tdep.c
+++ b/gdb/i386obsd-tdep.c
@@ -23,9 +23,12 @@
 
 #include "defs.h"
 #include "arch-utils.h"
+#include "frame.h"
 #include "gdbcore.h"
 #include "regcache.h"
 #include "regset.h"
+#include "symtab.h"
+#include "objfiles.h"
 #include "osabi.h"
 #include "target.h"
 
@@ -48,11 +51,13 @@
 /* Default page size.  */
 static const int i386obsd_page_size = 4096;
 
-/* Return whether PC is in an OpenBSD sigtramp routine.  */
+/* Return whether the frame preceding NEXT_FRAME corresponds to an
+   OpenBSD sigtramp routine.  */
 
 static int
-i386obsd_pc_in_sigtramp (CORE_ADDR pc, char *name)
+i386obsd_sigtramp_p (struct frame_info *next_frame)
 {
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
   CORE_ADDR start_pc = (pc & ~(i386obsd_page_size - 1));
   const char sigreturn[] =
   {
@@ -60,13 +65,17 @@
     0x67, 0x00, 0x00, 0x00,	/* movl $SYS_sigreturn, %eax */
     0xcd, 0x80			/* int $0x80 */
   };
-  char *buf;
+  char *name, *buf;
 
-  /* Avoid reading memory from the target if possible.  If we're in a
-     named function, we're certainly not in a sigtramp routine
-     provided by the kernel.  Take synthetic function names into
-     account though.  */
-  if (name && name[0] != '<')
+  /* If the function has a valid symbol name, it isn't a
+     trampoline.  */
+  find_pc_partial_function (pc, &name, NULL, NULL);
+  if (name != NULL)
+    return 0;
+
+  /* If the function lives in a valid section (even without a starting
+     point) it isn't a trampoline.  */
+  if (find_pc_section (pc) != NULL)
     return 0;
 
   /* If we can't read the instructions at START_PC, return zero.  */
@@ -78,34 +87,7 @@
   if (memcmp (buf, sigreturn, sizeof sigreturn) == 0)
     return 1;
 
-  /* Check for a traditional BSD sigtramp routine.  */
-  return i386bsd_pc_in_sigtramp (pc, name);
-}
-
-/* Return the start address of the sigtramp routine.  */
-
-static CORE_ADDR
-i386obsd_sigtramp_start (CORE_ADDR pc)
-{
-  CORE_ADDR start_pc = (pc & ~(i386obsd_page_size - 1));
-
-  if (i386bsd_pc_in_sigtramp (pc, NULL))
-    return i386bsd_sigtramp_start (pc);
-
-  return start_pc;
-}
-
-/* Return the end address of the sigtramp routine.  */
-
-static CORE_ADDR
-i386obsd_sigtramp_end (CORE_ADDR pc)
-{
-  CORE_ADDR start_pc = (pc & ~(i386obsd_page_size - 1));
-
-  if (i386bsd_pc_in_sigtramp (pc, NULL))
-    return i386bsd_sigtramp_end (pc);
-
-  return start_pc + 0x22;
+  return 0;
 }
 
 /* Mapping between the general-purpose registers in `struct reg'
@@ -137,7 +119,7 @@
 			     struct regcache *regcache, int regnum,
 			     const void *regs, size_t len)
 {
-  const struct gdbarch_tdep *tdep = regset->descr;
+  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
 
   gdb_assert (len >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE);
 
@@ -159,11 +141,8 @@
       && sect_size >= tdep->sizeof_gregset + I387_SIZEOF_FSAVE)
     {
       if (tdep->gregset == NULL)
-	{
-	  tdep->gregset = XMALLOC (struct regset);
-	  tdep->gregset->descr = tdep;
-	  tdep->gregset->supply_regset = i386obsd_aout_supply_regset;
-	}
+        tdep->gregset =
+	  regset_alloc (gdbarch, i386obsd_aout_supply_regset, NULL);
       return tdep->gregset;
     }
 
@@ -215,9 +194,7 @@
   /* OpenBSD uses a different memory layout.  */
   tdep->sigtramp_start = i386obsd_sigtramp_start_addr;
   tdep->sigtramp_end = i386obsd_sigtramp_end_addr;
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, i386obsd_pc_in_sigtramp);
-  set_gdbarch_deprecated_sigtramp_start (gdbarch, i386obsd_sigtramp_start);
-  set_gdbarch_deprecated_sigtramp_end (gdbarch, i386obsd_sigtramp_end);
+  tdep->sigtramp_p = i386obsd_sigtramp_p;
 
   /* OpenBSD has a `struct sigcontext' that's different from the
      original 4.3 BSD.  */
diff --git a/gdb/i386v4-nat.c b/gdb/i386v4-nat.c
index 188f01b..a2f3cd3 100644
--- a/gdb/i386v4-nat.c
+++ b/gdb/i386v4-nat.c
@@ -1,6 +1,7 @@
-/* Native-dependent code for SVR4 Unix running on i386's.
+/* Native-dependent code for Unix SVR4 running on i386's.
+
    Copyright 1988, 1989, 1991, 1992, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002
+   2001, 2002, 2004
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -95,7 +96,7 @@
   EAX, ECX, EDX, EBX,
   UESP, EBP, ESI, EDI,
   EIP, EFL, CS, SS,
-  DS, ES, FS, GS,
+  DS, ES, FS, GS
 };
 
 /* Fill GDB's register array with the general-purpose register values
@@ -105,25 +106,25 @@
 supply_gregset (gregset_t *gregsetp)
 {
   greg_t *regp = (greg_t *) gregsetp;
-  int i;
+  int regnum;
 
-  for (i = 0; i < I386_NUM_GREGS; i++)
-    supply_register (i, (char *) (regp + regmap[i]));
+  for (regnum = 0; regnum < I386_NUM_GREGS; regnum++)
+    regcache_raw_supply (current_regcache, regnum, regp + regmap[regnum]);
 }
 
-/* Fill register REGNO (if it is a general-purpose register) in
-   *GREGSETPS with the value in GDB's register array.  If REGNO is -1,
+/* Fill register REGNUM (if it is a general-purpose register) in
+   *GREGSETPS with the value in GDB's register array.  If REGNUM is -1,
    do this for all registers.  */
 
 void
-fill_gregset (gregset_t *gregsetp, int regno)
+fill_gregset (gregset_t *gregsetp, int regnum)
 {
   greg_t *regp = (greg_t *) gregsetp;
   int i;
 
   for (i = 0; i < I386_NUM_GREGS; i++)
-    if (regno == -1 || regno == i)
-      regcache_collect (i, regp + regmap[i]);
+    if (regnum == -1 || regnum == i)
+      regcache_raw_collect (current_regcache, i, regp + regmap[i]);
 }
 
 #endif /* HAVE_GREGSET_T */
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index 4b212c4..0e60a13 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -340,7 +340,6 @@
   put_frame_register (frame, regnum, to);
 }
 
-
 
 /* Handle FSAVE and FXSAVE formats.  */
 
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 8defe3b3..0f948a1 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -36,11 +36,12 @@
 #include "objfiles.h"
 #include "elf/common.h"		/* for DT_PLTGOT value */
 #include "elf-bfd.h"
-#include "elf.h"                /* for PT_IA64_UNWIND value */
 #include "dis-asm.h"
+#include "infcall.h"
 #include "ia64-tdep.h"
 
 #ifdef HAVE_LIBUNWIND_IA64_H
+#include "elf/ia64.h"           /* for PT_IA_64_UNWIND value */
 #include "libunwind-frame.h"
 #include "libunwind-ia64.h"
 #endif
@@ -98,7 +99,6 @@
 static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc;
 static gdbarch_skip_prologue_ftype ia64_skip_prologue;
 static gdbarch_extract_return_value_ftype ia64_extract_return_value;
-static gdbarch_use_struct_convention_ftype ia64_use_struct_convention;
 static struct type *is_float_or_hfa_type (struct type *t);
 
 static struct type *builtin_type_ia64_ext;
@@ -1116,7 +1116,7 @@
       if (next_pc == 0)
 	break;
 
-      if (it == B && ((instr & 0x1e1f800003f) != 0x04000000000))
+      if (it == B && ((instr & 0x1e1f800003fLL) != 0x04000000000LL))
 	{
 	  /* Exit loop upon hitting a non-nop branch instruction. */ 
 	  if (trust_limit)
@@ -1228,7 +1228,7 @@
 	    {
 	      cache->saved_regs[IA64_FR0_REGNUM + fM] = spill_addr;
 
-              if ((instr & 0x1efc0000000) == 0x0eec0000000)
+              if ((instr & 0x1efc0000000LL) == 0x0eec0000000LL)
 		spill_addr += imm;
 	      else
 		spill_addr = 0;		/* last one; must be done */
@@ -2048,7 +2048,7 @@
   CORE_ADDR pc = frame_pc_unwind (next_frame);
 
   find_pc_partial_function (pc, &name, NULL, NULL);
-  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
+  if (legacy_pc_in_sigtramp (pc, name))
     return &ia64_sigtramp_frame_unwind;
 
   return NULL;
@@ -2583,6 +2583,10 @@
   libunwind_frame_prev_register (next_frame, this_cache, reg,
 				 optimizedp, lvalp, addrp, realnump, valuep);
 
+  /* No more to do if the value is not supposed to be supplied.  */
+  if (!valuep)
+    return;
+
   if (VP0_REGNUM <= regnum && regnum <= VP63_REGNUM)
     {
       ULONGEST prN_val;
@@ -3019,7 +3023,7 @@
 }
 
 static CORE_ADDR
-ia64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr, 
+ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		      struct regcache *regcache, CORE_ADDR bp_addr,
 		      int nargs, struct value **args, CORE_ADDR sp,
 		      int struct_return, CORE_ADDR struct_addr)
@@ -3031,6 +3035,7 @@
   int nslots, rseslots, memslots, slotnum, nfuncargs;
   int floatreg;
   CORE_ADDR bsp, cfm, pfs, new_bsp, funcdescaddr, pc, global_pointer;
+  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   nslots = 0;
   nfuncargs = 0;
@@ -3328,7 +3333,7 @@
 
   set_gdbarch_skip_prologue (gdbarch, ia64_skip_prologue);
 
-  set_gdbarch_use_struct_convention (gdbarch, ia64_use_struct_convention);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, ia64_use_struct_convention);
   set_gdbarch_extract_return_value (gdbarch, ia64_extract_return_value);
 
   set_gdbarch_store_return_value (gdbarch, ia64_store_return_value);
diff --git a/gdb/infcall.c b/gdb/infcall.c
index b10f807..9e3e479 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -205,8 +205,9 @@
   else
     error ("Invalid data type for function to be called.");
 
-  *retval_type = value_type;
-  return funaddr;
+  if (retval_type != NULL)
+    *retval_type = value_type;
+  return funaddr + DEPRECATED_FUNCTION_START_OFFSET;
 }
 
 /* Call breakpoint_auto_delete on the current contents of the bpstat
@@ -219,85 +220,6 @@
 }
 
 static CORE_ADDR
-legacy_push_dummy_code (struct gdbarch *gdbarch,
-			CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
-			struct value **args, int nargs,
-			struct type *value_type,
-			CORE_ADDR *real_pc, CORE_ADDR *bp_addr)
-{
-  /* CALL_DUMMY is an array of words (DEPRECATED_REGISTER_SIZE), but
-     each word is in host byte order.  Before calling
-     DEPRECATED_FIX_CALL_DUMMY, we byteswap it and remove any extra
-     bytes which might exist because ULONGEST is bigger than
-     DEPRECATED_REGISTER_SIZE.  */
-  /* NOTE: This is pretty wierd, as the call dummy is actually a
-     sequence of instructions.  But CISC machines will have to pack
-     the instructions into DEPRECATED_REGISTER_SIZE units (and so will
-     RISC machines for which INSTRUCTION_SIZE is not
-     DEPRECATED_REGISTER_SIZE).  */
-  /* NOTE: This is pretty stupid.  CALL_DUMMY should be in strict
-     target byte order. */
-  CORE_ADDR start_sp;
-  ULONGEST *dummy = alloca (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS);
-  int sizeof_dummy1 = (DEPRECATED_REGISTER_SIZE
-		       * DEPRECATED_SIZEOF_CALL_DUMMY_WORDS
-		       / sizeof (ULONGEST));
-  char *dummy1 = alloca (sizeof_dummy1);
-  memcpy (dummy, DEPRECATED_CALL_DUMMY_WORDS,
-	  DEPRECATED_SIZEOF_CALL_DUMMY_WORDS);
-  if (INNER_THAN (1, 2))
-    {
-      /* Stack grows down */
-      sp -= sizeof_dummy1;
-      start_sp = sp;
-    }
-  else
-    {
-      /* Stack grows up */
-      start_sp = sp;
-      sp += sizeof_dummy1;
-    }
-  /* NOTE: cagney/2002-09-10: Don't bother re-adjusting the stack
-     after allocating space for the call dummy.  A target can specify
-     a SIZEOF_DUMMY1 (via DEPRECATED_SIZEOF_CALL_DUMMY_WORDS) such
-     that all local alignment requirements are met.  */
-  /* Create a call sequence customized for this function and the
-     number of arguments for it.  */
-  {
-    int i;
-    for (i = 0; i < (int) (DEPRECATED_SIZEOF_CALL_DUMMY_WORDS / sizeof (dummy[0]));
-	 i++)
-      store_unsigned_integer (&dummy1[i * DEPRECATED_REGISTER_SIZE],
-			      DEPRECATED_REGISTER_SIZE,
-			      (ULONGEST) dummy[i]);
-  }
-  /* NOTE: cagney/2003-04-22: This computation of REAL_PC, BP_ADDR and
-     DUMMY_ADDR is pretty messed up.  It comes from constant tinkering
-     with the values.  Instead a DEPRECATED_FIX_CALL_DUMMY replacement
-     (PUSH_DUMMY_BREAKPOINT?) should just do everything.  */
-  if (!gdbarch_push_dummy_call_p (current_gdbarch))
-    {
-      if (DEPRECATED_FIX_CALL_DUMMY_P ())
-	{
-	  /* gdb_assert (CALL_DUMMY_LOCATION == ON_STACK) true?  */
-	  DEPRECATED_FIX_CALL_DUMMY (dummy1, start_sp, funaddr, nargs, args,
-				     value_type, using_gcc);
-	}
-      (*real_pc) = start_sp;
-    }
-  /* Yes, the offset is applied to the real_pc and not the dummy addr.
-     Ulgh!  Blame the HP/UX target.  */
-  (*bp_addr) = (*real_pc) + DEPRECATED_CALL_DUMMY_BREAKPOINT_OFFSET;
-  /* Yes, the offset is applied to the real_pc and not the
-     dummy_addr.  Ulgh!  Blame the HP/UX target.  */
-  (*real_pc) += DEPRECATED_CALL_DUMMY_START_OFFSET;
-  write_memory (start_sp, (char *) dummy1, sizeof_dummy1);
-  if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
-    generic_save_call_dummy_addr (start_sp, start_sp + sizeof_dummy1);
-  return sp;
-}
-
-static CORE_ADDR
 generic_push_dummy_code (struct gdbarch *gdbarch,
 			 CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
 			 struct value **args, int nargs,
@@ -333,8 +255,8 @@
   return sp;
 }
 
-/* Provide backward compatibility.  Once DEPRECATED_FIX_CALL_DUMMY is
-   eliminated, this can be simplified.  */
+/* For CALL_DUMMY_ON_STACK, push a breakpoint sequence that the called
+   function returns to.  */
 
 static CORE_ADDR
 push_dummy_code (struct gdbarch *gdbarch,
@@ -346,10 +268,6 @@
   if (gdbarch_push_dummy_code_p (gdbarch))
     return gdbarch_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
 				    args, nargs, value_type, real_pc, bp_addr);
-  else if (DEPRECATED_FIX_CALL_DUMMY_P ()
-	   && !gdbarch_push_dummy_call_p (gdbarch))
-    return legacy_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
-				   args, nargs, value_type, real_pc, bp_addr);
   else    
     return generic_push_dummy_code (gdbarch, sp, funaddr, using_gcc,
 				    args, nargs, value_type, real_pc, bp_addr);
@@ -407,34 +325,23 @@
   inf_status = save_inferior_status (1);
   inf_status_cleanup = make_cleanup_restore_inferior_status (inf_status);
 
-  if (DEPRECATED_PUSH_DUMMY_FRAME_P ())
-    {
-      /* DEPRECATED_PUSH_DUMMY_FRAME is responsible for saving the
-	 inferior registers (and frame_pop() for restoring them).  (At
-	 least on most machines) they are saved on the stack in the
-	 inferior.  */
-      DEPRECATED_PUSH_DUMMY_FRAME;
-    }
-  else
-    {
-      /* FIXME: cagney/2003-02-26: Step zero of this little tinker is
-      to extract the generic dummy frame code from the architecture
-      vector.  Hence this direct call.
+  /* FIXME: cagney/2003-02-26: Step zero of this little tinker is to
+     extract the generic dummy frame code from the architecture
+     vector.  Hence this direct call.
 
-      A follow-on change is to modify this interface so that it takes
-      thread OR frame OR ptid as a parameter, and returns a dummy
-      frame handle.  The handle can then be used further down as a
-      parameter to generic_save_dummy_frame_tos().  Hmm, thinking
-      about it, since everything is ment to be using generic dummy
-      frames, why not even use some of the dummy frame code to here -
-      do a regcache dup and then pass the duped regcache, along with
-      all the other stuff, at one single point.
+     A follow-on change is to modify this interface so that it takes
+     thread OR frame OR ptid as a parameter, and returns a dummy frame
+     handle.  The handle can then be used further down as a parameter
+     to generic_save_dummy_frame_tos().  Hmm, thinking about it, since
+     everything is ment to be using generic dummy frames, why not even
+     use some of the dummy frame code to here - do a regcache dup and
+     then pass the duped regcache, along with all the other stuff, at
+     one single point.
 
-      In fact, you can even save the structure's return address in the
-      dummy frame and fix one of those nasty lost struct return edge
-      conditions.  */
-      generic_push_dummy_frame ();
-    }
+     In fact, you can even save the structure's return address in the
+     dummy frame and fix one of those nasty lost struct return edge
+     conditions.  */
+  generic_push_dummy_frame ();
 
   /* Ensure that the initial SP is correctly aligned.  */
   {
@@ -545,18 +452,6 @@
 	}
       break;
     case AT_ENTRY_POINT:
-      if (DEPRECATED_FIX_CALL_DUMMY_P ()
-	  && !gdbarch_push_dummy_call_p (current_gdbarch))
-	{
-	  /* Sigh.  Some targets use DEPRECATED_FIX_CALL_DUMMY to
-             shove extra stuff onto the stack or into registers.  That
-             code should be in PUSH_DUMMY_CALL, however, in the mean
-             time ...  */
-	  /* If the target is manipulating DUMMY1, it looses big time.  */
-	  void *dummy1 = NULL;
-	  DEPRECATED_FIX_CALL_DUMMY (dummy1, sp, funaddr, nargs, args,
-				     value_type, using_gcc);
-	}
       real_pc = funaddr;
       dummy_addr = entry_point_address ();
       /* Make certain that the address points at real code, and not a
@@ -596,10 +491,9 @@
       internal_error (__FILE__, __LINE__, "bad switch");
     }
 
-  if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES)
-    /* Save where the breakpoint is going to be inserted so that the
-       dummy-frame code is later able to re-identify it.  */
-    generic_save_call_dummy_addr (bp_addr, bp_addr + 1);
+  /* Save where the breakpoint is going to be inserted so that the
+     dummy-frame code is later able to re-identify it.  */
+  generic_save_call_dummy_addr (bp_addr, bp_addr + 1);
 
   if (nargs < TYPE_NFIELDS (ftype))
     error ("too few arguments in function call");
@@ -767,7 +661,7 @@
     /* When there is no push_dummy_call method, should this code
        simply error out.  That would the implementation of this method
        for all ABIs (which is probably a good thing).  */
-    sp = gdbarch_push_dummy_call (current_gdbarch, funaddr, current_regcache,
+    sp = gdbarch_push_dummy_call (current_gdbarch, function, current_regcache,
 				  bp_addr, nargs, args, sp, struct_return,
 				  struct_addr);
   else  if (DEPRECATED_PUSH_ARGUMENTS_P ())
@@ -775,7 +669,7 @@
     sp = DEPRECATED_PUSH_ARGUMENTS (nargs, args, sp, struct_return,
 				    struct_addr);
   else
-    sp = legacy_push_arguments (nargs, args, sp, struct_return, struct_addr);
+    error ("This target does not support function calls");
 
   if (DEPRECATED_PUSH_RETURN_ADDRESS_P ())
     /* for targets that use no CALL_DUMMY */
@@ -828,16 +722,13 @@
   if (DEPRECATED_DUMMY_WRITE_SP_P ())
     DEPRECATED_DUMMY_WRITE_SP (sp);
 
-  if (gdbarch_unwind_dummy_id_p (current_gdbarch))
-    {
-      /* Sanity.  The exact same SP value is returned by
-	 PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by
-	 unwind_dummy_id to form the frame ID's stack address.  */
-      gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
-      generic_save_dummy_frame_tos (sp);
-    }
-  else if (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ())
+  if (DEPRECATED_SAVE_DUMMY_FRAME_TOS_P ())
     DEPRECATED_SAVE_DUMMY_FRAME_TOS (sp);
+  else
+    /* Sanity.  The exact same SP value is returned by
+       PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by
+       unwind_dummy_id to form the frame ID's stack address.  */
+    generic_save_dummy_frame_tos (sp);
 
   /* Now proceed, having reached the desired place.  */
   clear_proceed_status ();
@@ -861,7 +752,6 @@
 	/* Sanity.  The exact same SP value is returned by
 	 PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by
 	 unwind_dummy_id to form the frame ID's stack address.  */
-	gdb_assert (DEPRECATED_USE_GENERIC_DUMMY_FRAMES);
 	frame = frame_id_build (sp, sal.pc);
       }
     else
@@ -1032,9 +922,14 @@
      leave the RETBUF alone.  */
   do_cleanups (inf_status_cleanup);
 
-  /* Figure out the value returned by the function.  */
-  if (struct_return)
-    {
+  /* Figure out the value returned by the function, return that.  */
+  {
+    struct value *retval;
+    if (TYPE_CODE (value_type) == TYPE_CODE_VOID)
+      /* If the function returns void, don't bother fetching the
+	 return value.  */
+      retval = allocate_value (value_type);
+    else if (struct_return)
       /* NOTE: cagney/2003-09-27: This assumes that PUSH_DUMMY_CALL
 	 has correctly stored STRUCT_ADDR in the target.  In the past
 	 that hasn't been the case, the old MIPS PUSH_ARGUMENTS
@@ -1043,18 +938,21 @@
 	 you're seeing problems with values being returned using the
 	 "struct return convention", check that PUSH_DUMMY_CALL isn't
 	 playing tricks.  */
-      struct value *retval = value_at (value_type, struct_addr, NULL);
-      do_cleanups (retbuf_cleanup);
-      return retval;
-    }
-  else
-    {
-      /* The non-register case was handled above.  */
-      struct value *retval = register_value_being_returned (value_type,
-							    retbuf);
-      do_cleanups (retbuf_cleanup);
-      return retval;
-    }
+      retval = value_at (value_type, struct_addr, NULL);
+    else
+      {
+	/* This code only handles "register convention".  */
+	retval = allocate_value (value_type);
+	gdb_assert (gdbarch_return_value (current_gdbarch, value_type,
+					  NULL, NULL, NULL)
+		    == RETURN_VALUE_REGISTER_CONVENTION);
+	gdbarch_return_value (current_gdbarch, value_type, retbuf,
+			      VALUE_CONTENTS_RAW (retval) /*read*/,
+			      NULL /*write*/);
+      }
+    do_cleanups (retbuf_cleanup);
+    return retval;
+  }
 }
 
 void _initialize_infcall (void);
@@ -1089,7 +987,7 @@
 is received while in a function called from gdb (call dummy).  If set, gdb\n\
 unwinds the stack and restore the context to what as it was before the call.\n\
 The default is to stop in the frame where the signal was received.", "\
-Set unwinding of stack if a signal is received while in a call dummy.\n\
+Show unwinding of stack if a signal is received while in a call dummy.\n\
 The unwindonsignal lets the user determine what gdb should do if a signal\n\
 is received while in a function called from gdb (call dummy).  If set, gdb\n\
 unwinds the stack and restore the context to what as it was before the call.\n\
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 1ad12bf..58875d3 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -186,10 +186,6 @@
 
 struct frame_id step_frame_id;
 
-/* Our notion of the current stack pointer.  */
-
-CORE_ADDR step_sp;
-
 enum step_over_calls_kind step_over_calls;
 
 /* If stepping, nonzero means step count is > 1
@@ -379,13 +375,14 @@
   inferior_io_terminal = savestring (file, strlen (file));
 }
 
-static void
-run_command (char *args, int from_tty)
+/* Kill the inferior if already running.  This function is designed
+   to be called when we are about to start the execution of the program
+   from the beginning.  Ask the user to confirm that he wants to restart
+   the program being debugged when FROM_TTY is non-null.  */
+
+void
+kill_if_already_running (int from_tty)
 {
-  char *exec_file;
-
-  dont_repeat ();
-
   if (! ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
     {
       if (from_tty
@@ -398,7 +395,16 @@
 #endif
       init_wait_for_inferior ();
     }
+}
 
+static void
+run_command (char *args, int from_tty)
+{
+  char *exec_file;
+
+  dont_repeat ();
+
+  kill_if_already_running (from_tty);
   clear_breakpoint_hit_counts ();
 
   /* Purge old solib objfiles. */
@@ -473,7 +479,7 @@
   /* We call get_inferior_args() because we might need to compute
      the value now.  */
   target_create_inferior (exec_file, get_inferior_args (),
-			  environ_vector (inferior_environ));
+			  environ_vector (inferior_environ), from_tty);
 }
 
 
@@ -485,6 +491,29 @@
 }
 
 
+/* Start the execution of the program up until the beginning of the main
+   program.  */
+
+static void
+start_command (char *args, int from_tty)
+{
+  /* Some languages such as Ada need to search inside the program
+     minimal symbols for the location where to put the temporary
+     breakpoint before starting.  */
+  if (!have_minimal_symbols ())
+    error ("No symbol table loaded.  Use the \"file\" command.");
+
+  /* If the inferior is already running, we want to ask the user if we
+     should restart it or not before we insert the temporary breakpoint.
+     This makes sure that this command doesn't have any side effect if
+     the user changes its mind.  */
+  kill_if_already_running (from_tty);
+
+  /* Insert the temporary breakpoint, and run...  */
+  tbreak_command (main_name (), 0);
+  run_command (args, from_tty);
+} 
+
 void
 continue_command (char *proc_count_exp, int from_tty)
 {
@@ -624,7 +653,6 @@
 	  if (!frame)		/* Avoid coredump here.  Why tho? */
 	    error ("No current frame");
 	  step_frame_id = get_frame_id (frame);
-	  step_sp = read_sp ();
 
 	  if (!single_inst)
 	    {
@@ -724,7 +752,6 @@
       if (!frame)		/* Avoid coredump here.  Why tho? */
 	error ("No current frame");
       step_frame_id = get_frame_id (frame);
-      step_sp = read_sp ();
 
       if (!single_inst)
 	{
@@ -977,7 +1004,6 @@
 
   step_over_calls = STEP_OVER_ALL;
   step_frame_id = get_frame_id (frame);
-  step_sp = read_sp ();
 
   step_multi = 0;		/* Only one call to proceed */
 
@@ -1046,80 +1072,62 @@
   until_break_command (arg, from_tty, 1);
 }
 
-
 /* Print the result of a function at the end of a 'finish' command.  */
 
 static void
 print_return_value (int struct_return, struct type *value_type)
 {
+  struct gdbarch *gdbarch = current_gdbarch;
   struct cleanup *old_chain;
   struct ui_stream *stb;
   struct value *value;
 
-  if (!struct_return)
-    {
-      /* The return value can be found in the inferior's registers.  */
-      value = register_value_being_returned (value_type, stop_registers);
-    }
-  /* FIXME: cagney/2004-01-17: When both return_value and
-     extract_returned_value_address are available, should use that to
-     find the address of and then extract the returned value.  */
+  gdb_assert (TYPE_CODE (value_type) != TYPE_CODE_VOID);
+
   /* FIXME: 2003-09-27: When returning from a nested inferior function
      call, it's possible (with no help from the architecture vector)
      to locate and return/print a "struct return" value.  This is just
      a more complicated case of what is already being done in in the
      inferior function call code.  In fact, when inferior function
      calls are made async, this will likely be made the norm.  */
-  else if (gdbarch_return_value_p (current_gdbarch))
-    /* We cannot determine the contents of the structure because it is
-       on the stack, and we don't know where, since we did not
-       initiate the call, as opposed to the call_function_by_hand
-       case.  */
+
+  switch (gdbarch_return_value (gdbarch, value_type, NULL, NULL, NULL))
     {
-      gdb_assert (gdbarch_return_value (current_gdbarch, value_type,
-					NULL, NULL, NULL)
-		  == RETURN_VALUE_STRUCT_CONVENTION);
+    case RETURN_VALUE_REGISTER_CONVENTION:
+    case RETURN_VALUE_ABI_RETURNS_ADDRESS:
+      value = allocate_value (value_type);
+      CHECK_TYPEDEF (value_type);
+      gdbarch_return_value (current_gdbarch, value_type, stop_registers,
+			    VALUE_CONTENTS_RAW (value), NULL);
+      break;
+    case RETURN_VALUE_STRUCT_CONVENTION:
+      value = NULL;
+      break;
+    default:
+      internal_error (__FILE__, __LINE__, "bad switch");
+    }
+
+  if (value)
+    {
+      /* Print it.  */
+      stb = ui_out_stream_new (uiout);
+      old_chain = make_cleanup_ui_out_stream_delete (stb);
+      ui_out_text (uiout, "Value returned is ");
+      ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
+			record_latest_value (value));
+      ui_out_text (uiout, " = ");
+      value_print (value, stb->stream, 0, Val_no_prettyprint);
+      ui_out_field_stream (uiout, "return-value", stb);
+      ui_out_text (uiout, "\n");
+      do_cleanups (old_chain);
+    }
+  else
+    {
       ui_out_text (uiout, "Value returned has type: ");
       ui_out_field_string (uiout, "return-type", TYPE_NAME (value_type));
       ui_out_text (uiout, ".");
       ui_out_text (uiout, " Cannot determine contents\n");
-      return;
     }
-  else
-    {
-      if (DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS_P ())
-	{
-	  CORE_ADDR addr = DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS (stop_registers);
-	  if (!addr)
-	    error ("Function return value unknown.");
-	  value = value_at (value_type, addr, NULL);
-	}
-      else
-	{
-	  /* It is "struct return" yet the value is being extracted,
-             presumably from registers, using EXTRACT_RETURN_VALUE.
-             This doesn't make sense.  Unfortunately, the legacy
-             interfaces allowed this behavior.  Sigh!  */
-	  value = allocate_value (value_type);
-	  CHECK_TYPEDEF (value_type);
-	  /* If the function returns void, don't bother fetching the
-	     return value.  */
-	  EXTRACT_RETURN_VALUE (value_type, stop_registers,
-				VALUE_CONTENTS_RAW (value));
-	}
-    }
-
-  /* Print it.  */
-  stb = ui_out_stream_new (uiout);
-  old_chain = make_cleanup_ui_out_stream_delete (stb);
-  ui_out_text (uiout, "Value returned is ");
-  ui_out_field_fmt (uiout, "gdb-result-var", "$%d",
-		    record_latest_value (value));
-  ui_out_text (uiout, " = ");
-  value_print (value, stb->stream, 0, Val_no_prettyprint);
-  ui_out_field_stream (uiout, "return-value", stb);
-  ui_out_text (uiout, "\n");
-  do_cleanups (old_chain);
 }
 
 /* Stuff that needs to be done by the finish command after the target
@@ -1234,8 +1242,7 @@
   if (from_tty)
     {
       printf_filtered ("Run till exit from ");
-      print_stack_frame (deprecated_selected_frame,
-			 frame_relative_level (deprecated_selected_frame), 0);
+      print_stack_frame (get_selected_frame (), 1, LOCATION);
     }
 
   /* If running asynchronously and the target support asynchronous
@@ -1505,8 +1512,7 @@
 {
   int i;
   const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
-  char raw_buffer[MAX_REGISTER_SIZE];
-  char virtual_buffer[MAX_REGISTER_SIZE];
+  char buffer[MAX_REGISTER_SIZE];
 
   if (DEPRECATED_DO_REGISTERS_INFO_P ())
     {
@@ -1546,35 +1552,19 @@
       print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
 
       /* Get the data in raw format.  */
-      if (! frame_register_read (frame, i, raw_buffer))
+      if (! frame_register_read (frame, i, buffer))
 	{
 	  fprintf_filtered (file, "*value not available*\n");
 	  continue;
 	}
 
-      /* FIXME: cagney/2002-08-03: This code shouldn't be necessary.
-         The function frame_register_read() should have returned the
-         pre-cooked register so no conversion is necessary.  */
-      /* Convert raw data to virtual format if necessary.  */
-      if (DEPRECATED_REGISTER_CONVERTIBLE_P ()
-	  && DEPRECATED_REGISTER_CONVERTIBLE (i))
-	{
-	  DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (i, register_type (current_gdbarch, i),
-				       raw_buffer, virtual_buffer);
-	}
-      else
-	{
-	  memcpy (virtual_buffer, raw_buffer,
-		  DEPRECATED_REGISTER_VIRTUAL_SIZE (i));
-	}
-
       /* If virtual format is floating, print it that way, and in raw
          hex.  */
       if (TYPE_CODE (register_type (current_gdbarch, i)) == TYPE_CODE_FLT)
 	{
 	  int j;
 
-	  val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0,
+	  val_print (register_type (current_gdbarch, i), buffer, 0, 0,
 		     file, 0, 1, 0, Val_pretty_default);
 
 	  fprintf_filtered (file, "\t(raw 0x");
@@ -1585,21 +1575,21 @@
 		idx = j;
 	      else
 		idx = DEPRECATED_REGISTER_RAW_SIZE (i) - 1 - j;
-	      fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
+	      fprintf_filtered (file, "%02x", (unsigned char) buffer[idx]);
 	    }
 	  fprintf_filtered (file, ")");
 	}
       else
 	{
 	  /* Print the register in hex.  */
-	  val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0,
+	  val_print (register_type (current_gdbarch, i), buffer, 0, 0,
 		     file, 'x', 1, 0, Val_pretty_default);
           /* If not a vector register, print it also according to its
              natural format.  */
 	  if (TYPE_VECTOR (register_type (current_gdbarch, i)) == 0)
 	    {
 	      fprintf_filtered (file, "\t");
-	      val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0,
+	      val_print (register_type (current_gdbarch, i), buffer, 0, 0,
 			 file, 0, 1, 0, Val_pretty_default);
 	    }
 	}
@@ -1798,9 +1788,6 @@
      based on what modes we are starting it with.  */
   target_terminal_init ();
 
-  /* Install inferior's terminal modes.  */
-  target_terminal_inferior ();
-
   /* Set up execution context to know that we should return from
      wait_for_inferior as soon as the target reports a stop.  */
   init_wait_for_inferior ();
@@ -1859,10 +1846,13 @@
    */
   target_post_attach (PIDGET (inferior_ptid));
 
+  /* Install inferior's terminal modes.  */
+  target_terminal_inferior ();
+
   normal_stop ();
 
-  if (attach_hook)
-    attach_hook ();
+  if (deprecated_attach_hook)
+    deprecated_attach_hook ();
 }
 
 /*
@@ -1884,8 +1874,8 @@
 #if defined(SOLIB_RESTART)
   SOLIB_RESTART ();
 #endif
-  if (detach_hook)
-    detach_hook ();
+  if (deprecated_detach_hook)
+    deprecated_detach_hook ();
 }
 
 /* Disconnect from the current target without resuming it (leaving it
@@ -1904,8 +1894,8 @@
 #if defined(SOLIB_RESTART)
   SOLIB_RESTART ();
 #endif
-  if (detach_hook)
-    detach_hook ();
+  if (deprecated_detach_hook)
+    deprecated_detach_hook ();
 }
 
 /* Stop the execution of the target while running in async mode, in
@@ -2134,6 +2124,13 @@
     add_com ("R", class_run, run_no_args_command,
 	     "Start debugged program with no arguments.");
 
+  c = add_com ("start", class_run, start_command,
+               "\
+Run the debugged program until the beginning of the main procedure.\n\
+You may specify arguments to give to your program, just as with the\n\
+\"run\" command.");
+  set_cmd_completer (c, filename_completer);
+
   add_com ("interrupt", class_run, interrupt_target_command,
 	   "Interrupt the execution of the debugged program.");
 
diff --git a/gdb/inferior.h b/gdb/inferior.h
index ab5a25b..76ec0b0 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -364,10 +364,6 @@
 
 extern struct frame_id step_frame_id;
 
-/* Our notion of the current stack pointer.  */
-
-extern CORE_ADDR step_sp;
-
 /* 1 means step over all subroutine calls.
    -1 means step over calls to undebuggable functions.  */
 
@@ -443,26 +439,11 @@
 /* FIXME: cagney/2000-04-17: gdbarch should manage this.  The default
    shouldn't be necessary. */
 
-#if !defined PUSH_DUMMY_FRAME
-#define PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "PUSH_DUMMY_FRAME"), 0)
-#endif
-
 #if !defined STORE_STRUCT_RETURN
 #define STORE_STRUCT_RETURN(a1,a2) (internal_error (__FILE__, __LINE__, "STORE_STRUCT_RETURN"), 0)
 #endif
 
 
-/* Are we in a call dummy? */
-
-/* NOTE: cagney/2002-11-24 cagney/2004-03-22: Targets need to both
-   switch to generic dummy frames.  The generic version should be able
-   to handle all cases since that code works by saving the address of
-   the dummy's breakpoint (where ever it is).  */
-
-extern int deprecated_pc_in_call_dummy_on_stack (CORE_ADDR pc,
-						 CORE_ADDR sp,
-						 CORE_ADDR frame_address);
-
 /* If STARTUP_WITH_SHELL is set, GDB's "run"
    will attempts to start up the debugee under a shell.
    This is in order for argument-expansion to occur. E.g.,
diff --git a/gdb/inflow.c b/gdb/inflow.c
index 35cd799..f2c306c 100644
--- a/gdb/inflow.c
+++ b/gdb/inflow.c
@@ -595,8 +595,7 @@
       if (deprecated_selected_frame == NULL)
 	fputs_filtered ("No selected stack frame.\n", gdb_stdout);
       else
-	print_stack_frame (deprecated_selected_frame,
-			   frame_relative_level (deprecated_selected_frame), 1);
+	print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC);
     }
 }
 
diff --git a/gdb/infptrace.c b/gdb/infptrace.c
index ef86f90..f40e6e9 100644
--- a/gdb/infptrace.c
+++ b/gdb/infptrace.c
@@ -76,13 +76,6 @@
 #define PT_KILL		8	/* Send child a SIGKILL signal */
 #endif
 
-#ifndef PT_ATTACH
-#define PT_ATTACH PTRACE_ATTACH
-#endif
-#ifndef PT_DETACH
-#define PT_DETACH PTRACE_DETACH
-#endif
-
 #include "gdbcore.h"
 #ifndef	NO_SYS_FILE
 #include <sys/file.h>
@@ -279,18 +272,25 @@
 }
 #endif /* CHILD_RESUME */
 
-
-#ifdef ATTACH_DETACH
 /* Start debugging the process whose number is PID.  */
 int
 attach (int pid)
 {
   errno = 0;
+#ifndef PT_ATTACH
+#ifdef PTRACE_ATTACH
+#define PT_ATTACH PTRACE_ATTACH
+#endif
+#endif
+#ifdef PT_ATTACH
   ptrace (PT_ATTACH, pid, (PTRACE_ARG3_TYPE) 0, 0);
   if (errno)
     perror_with_name ("ptrace");
   attach_flag = 1;
   return pid;
+#else
+  error ("This system does not support attaching to a process");
+#endif
 }
 
 /* Stop debugging the process whose number is PID
@@ -301,13 +301,21 @@
 detach (int signal)
 {
   errno = 0;
+#ifndef PT_DETACH
+#ifdef PTRACE_DETACH
+#define PT_DETACH PTRACE_DETACH
+#endif
+#endif
+#ifdef PT_DETACH
   ptrace (PT_DETACH, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) 1,
           signal);
   if (errno)
     print_sys_errmsg ("ptrace", errno);
   attach_flag = 0;
+#else
+  error ("This system does not support detaching from a process");
+#endif
 }
-#endif /* ATTACH_DETACH */
 
 /* Default the type of the ptrace transfer to int.  */
 #ifndef PTRACE_XFER_TYPE
@@ -598,9 +606,6 @@
 	  if (errno)
 	    return 0;
 	}
-#ifdef CLEAR_INSN_CACHE
-      CLEAR_INSN_CACHE ();
-#endif
     }
   else
     {
diff --git a/gdb/infrun.c b/gdb/infrun.c
index aaf6ac8..e7af5d9 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -60,8 +60,6 @@
 
 static int hook_stop_stub (void *);
 
-static void delete_breakpoint_current_contents (void *);
-
 static int restore_selected_frame (void *);
 
 static void build_infrun (void);
@@ -264,14 +262,6 @@
 static int stop_on_solib_events;
 #endif
 
-#ifdef HP_OS_BUG
-/* Nonzero if the next time we try to continue the inferior, it will
-   step one instruction and generate a spurious trace trap.
-   This is used to compensate for a bug in HP-UX.  */
-
-static int trap_expected_after_continue;
-#endif
-
 /* Nonzero means expecting a trace trap
    and should stop the inferior and return silently when it happens.  */
 
@@ -305,7 +295,6 @@
 static int stop_print_frame;
 
 static struct breakpoint *step_resume_breakpoint = NULL;
-static struct breakpoint *through_sigtramp_breakpoint = NULL;
 
 /* On some platforms (e.g., HP-UX), hardware watchpoints have bad
    interactions with an inferior that is running a kernel function
@@ -316,8 +305,8 @@
 static int number_of_threads_in_syscalls;
 
 /* This is a cached copy of the pid/waitstatus of the last event
-   returned by target_wait()/target_wait_hook().  This information is
-   returned by get_last_target_status(). */
+   returned by target_wait()/deprecated_target_wait_hook().  This
+   information is returned by get_last_target_status().  */
 static ptid_t target_last_wait_ptid;
 static struct target_waitstatus target_last_waitstatus;
 
@@ -423,9 +412,6 @@
   step_range_start = 0;
   step_range_end = 0;
 
-  /* If there was one, it's gone now. */
-  through_sigtramp_breakpoint = NULL;
-
   /* What is this a.out's name? */
   printf_unfiltered ("Executing new program: %s\n", execd_pathname);
 
@@ -572,11 +558,6 @@
       singlestep_ptid = inferior_ptid;
     }
 
-  /* Handle any optimized stores to the inferior NOW...  */
-#ifdef DO_DEFERRED_STORES
-  DO_DEFERRED_STORES;
-#endif
-
   /* If there were any forks/vforks/execs that were caught and are
      now to be followed, then do so.  */
   switch (pending_follow.kind)
@@ -779,18 +760,6 @@
   if (prepare_to_proceed () && breakpoint_here_p (read_pc ()))
     oneproc = 1;
 
-#ifdef HP_OS_BUG
-  if (trap_expected_after_continue)
-    {
-      /* If (step == 0), a trap will be automatically generated after
-         the first instruction is executed.  Force step one
-         instruction to clear this condition.  This should not occur
-         if step is nonzero, but it is harmless in that case.  */
-      oneproc = 1;
-      trap_expected_after_continue = 0;
-    }
-#endif /* HP_OS_BUG */
-
   if (oneproc)
     /* We will get a trace trap after one instruction.
        Continue it automatically and insert breakpoints then.  */
@@ -891,9 +860,6 @@
   /* These are meaningless until the first time through wait_for_inferior.  */
   prev_pc = 0;
 
-#ifdef HP_OS_BUG
-  trap_expected_after_continue = 0;
-#endif
   breakpoints_inserted = 0;
   breakpoint_init_inferior (inf_starting);
 
@@ -910,17 +876,6 @@
 
   stepping_past_singlestep_breakpoint = 0;
 }
-
-static void
-delete_breakpoint_current_contents (void *arg)
-{
-  struct breakpoint **breakpointp = (struct breakpoint **) arg;
-  if (*breakpointp != NULL)
-    {
-      delete_breakpoint (*breakpointp);
-      *breakpointp = NULL;
-    }
-}
 
 /* This enum encodes possible reasons for doing a target_wait, so that
    wfi can call target_wait in one place.  (Ultimately the call will be
@@ -972,7 +927,6 @@
   int handling_longjmp;		/* FIXME */
   ptid_t ptid;
   ptid_t saved_inferior_ptid;
-  int update_step_sp;
   int stepping_through_solib_after_catch;
   bpstat stepping_through_solib_catchpoints;
   int enable_hw_watchpoints_after_wait;
@@ -986,12 +940,11 @@
 
 void init_execution_control_state (struct execution_control_state *ecs);
 
-static void handle_step_into_function (struct execution_control_state *ecs);
 void handle_inferior_event (struct execution_control_state *ecs);
 
-static void check_sigtramp2 (struct execution_control_state *ecs);
 static void step_into_function (struct execution_control_state *ecs);
-static void step_over_function (struct execution_control_state *ecs);
+static void insert_step_resume_breakpoint (struct frame_info *step_frame,
+					   struct execution_control_state *ecs);
 static void stop_stepping (struct execution_control_state *ecs);
 static void prepare_to_wait (struct execution_control_state *ecs);
 static void keep_going (struct execution_control_state *ecs);
@@ -1013,8 +966,6 @@
 
   old_cleanups = make_cleanup (delete_step_resume_breakpoint,
 			       &step_resume_breakpoint);
-  make_cleanup (delete_breakpoint_current_contents,
-		&through_sigtramp_breakpoint);
 
   /* wfi still stays in a loop, so it's OK just to take the address of
      a local to get the ecs pointer.  */
@@ -1038,8 +989,8 @@
 
   while (1)
     {
-      if (target_wait_hook)
-	ecs->ptid = target_wait_hook (ecs->waiton_ptid, ecs->wp);
+      if (deprecated_target_wait_hook)
+	ecs->ptid = deprecated_target_wait_hook (ecs->waiton_ptid, ecs->wp);
       else
 	ecs->ptid = target_wait (ecs->waiton_ptid, ecs->wp);
 
@@ -1075,8 +1026,6 @@
     {
       old_cleanups = make_exec_cleanup (delete_step_resume_breakpoint,
 					&step_resume_breakpoint);
-      make_exec_cleanup (delete_breakpoint_current_contents,
-			 &through_sigtramp_breakpoint);
 
       /* Fill in with reasonable starting values.  */
       init_execution_control_state (async_ecs);
@@ -1095,9 +1044,9 @@
       registers_changed ();
     }
 
-  if (target_wait_hook)
+  if (deprecated_target_wait_hook)
     async_ecs->ptid =
-      target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp);
+      deprecated_target_wait_hook (async_ecs->waiton_ptid, async_ecs->wp);
   else
     async_ecs->ptid = target_wait (async_ecs->waiton_ptid, async_ecs->wp);
 
@@ -1128,7 +1077,6 @@
   ecs->random_signal = 0;
   ecs->remove_breakpoints_on_following_step = 0;
   ecs->handling_longjmp = 0;	/* FIXME */
-  ecs->update_step_sp = 0;
   ecs->stepping_through_solib_after_catch = 0;
   ecs->stepping_through_solib_catchpoints = NULL;
   ecs->enable_hw_watchpoints_after_wait = 0;
@@ -1154,9 +1102,9 @@
 }
 
 /* Return the cached copy of the last pid/waitstatus returned by
-   target_wait()/target_wait_hook().  The data is actually cached by
-   handle_inferior_event(), which gets called immediately after
-   target_wait()/target_wait_hook().  */
+   target_wait()/deprecated_target_wait_hook().  The data is actually
+   cached by handle_inferior_event(), which gets called immediately
+   after target_wait()/deprecated_target_wait_hook().  */
 
 void
 get_last_target_status (ptid_t *ptidp, struct target_waitstatus *status)
@@ -1181,160 +1129,32 @@
       /* Save infrun state for the old thread.  */
       save_infrun_state (inferior_ptid, prev_pc,
 			 trap_expected, step_resume_breakpoint,
-			 through_sigtramp_breakpoint, step_range_start,
+			 step_range_start,
 			 step_range_end, &step_frame_id,
 			 ecs->handling_longjmp, ecs->another_trap,
 			 ecs->stepping_through_solib_after_catch,
 			 ecs->stepping_through_solib_catchpoints,
 			 ecs->stepping_through_sigtramp,
-			 ecs->current_line, ecs->current_symtab, step_sp);
+			 ecs->current_line, ecs->current_symtab);
 
       /* Load infrun state for the new thread.  */
       load_infrun_state (ecs->ptid, &prev_pc,
 			 &trap_expected, &step_resume_breakpoint,
-			 &through_sigtramp_breakpoint, &step_range_start,
+			 &step_range_start,
 			 &step_range_end, &step_frame_id,
 			 &ecs->handling_longjmp, &ecs->another_trap,
 			 &ecs->stepping_through_solib_after_catch,
 			 &ecs->stepping_through_solib_catchpoints,
 			 &ecs->stepping_through_sigtramp,
-			 &ecs->current_line, &ecs->current_symtab, &step_sp);
+			 &ecs->current_line, &ecs->current_symtab);
     }
   inferior_ptid = ecs->ptid;
 }
 
-/* Wrapper for DEPRECATED_PC_IN_SIGTRAMP that takes care of the need
-   to find the function's name.
-
-   In a classic example of "left hand VS right hand", "infrun.c" was
-   trying to improve GDB's performance by caching the result of calls
-   to calls to find_pc_partial_funtion, while at the same time
-   find_pc_partial_function was also trying to ramp up performance by
-   caching its most recent return value.  The below makes the the
-   function find_pc_partial_function solely responsibile for
-   performance issues (the local cache that relied on a global
-   variable - arrrggg - deleted).
-
-   Using the testsuite and gcov, it was found that dropping the local
-   "infrun.c" cache and instead relying on find_pc_partial_function
-   increased the number of calls to 12000 (from 10000), but the number
-   of times find_pc_partial_function's cache missed (this is what
-   matters) was only increased by only 4 (to 3569).  (A quick back of
-   envelope caculation suggests that the extra 2000 function calls
-   @1000 extra instructions per call make the 1 MIP VAX testsuite run
-   take two extra seconds, oops :-)
-
-   Long term, this function can be eliminated, replaced by the code:
-   get_frame_type(current_frame()) == SIGTRAMP_FRAME (for new
-   architectures this is very cheap).  */
-
-static int
-pc_in_sigtramp (CORE_ADDR pc)
-{
-  char *name;
-  find_pc_partial_function (pc, &name, NULL, NULL);
-  return DEPRECATED_PC_IN_SIGTRAMP (pc, name);
-}
-
-/* Handle the inferior event in the cases when we just stepped
-   into a function.  */
-
-static void
-handle_step_into_function (struct execution_control_state *ecs)
-{
-  CORE_ADDR real_stop_pc;
-
-  if ((step_over_calls == STEP_OVER_NONE)
-      || ((step_range_end == 1)
-          && in_prologue (prev_pc, ecs->stop_func_start)))
-    {
-      /* I presume that step_over_calls is only 0 when we're
-         supposed to be stepping at the assembly language level
-         ("stepi").  Just stop.  */
-      /* Also, maybe we just did a "nexti" inside a prolog,
-         so we thought it was a subroutine call but it was not.
-         Stop as well.  FENN */
-      stop_step = 1;
-      print_stop_reason (END_STEPPING_RANGE, 0);
-      stop_stepping (ecs);
-      return;
-    }
-
-  if (step_over_calls == STEP_OVER_ALL || IGNORE_HELPER_CALL (stop_pc))
-    {
-      /* We're doing a "next".  */
-
-      if (legacy_frame_p (current_gdbarch)
-	  && pc_in_sigtramp (stop_pc)
-          && frame_id_inner (step_frame_id,
-                             frame_id_build (read_sp (), 0)))
-	/* NOTE: cagney/2004-03-15: This is only needed for legacy
-	   systems.  On non-legacy systems step_over_function doesn't
-	   use STEP_FRAME_ID and hence the below update "hack" isn't
-	   needed.  */
-        /* We stepped out of a signal handler, and into its calling
-           trampoline.  This is misdetected as a subroutine call, but
-           stepping over the signal trampoline isn't such a bad idea.
-           In order to do that, we have to ignore the value in
-           step_frame_id, since that doesn't represent the frame
-           that'll reach when we return from the signal trampoline.
-           Otherwise we'll probably continue to the end of the
-           program.  */
-        step_frame_id = null_frame_id;
-
-      step_over_function (ecs);
-      keep_going (ecs);
-      return;
-    }
-
-  /* If we are in a function call trampoline (a stub between
-     the calling routine and the real function), locate the real
-     function.  That's what tells us (a) whether we want to step
-     into it at all, and (b) what prologue we want to run to
-     the end of, if we do step into it.  */
-  real_stop_pc = skip_language_trampoline (stop_pc);
-  if (real_stop_pc == 0)
-    real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
-  if (real_stop_pc != 0)
-    ecs->stop_func_start = real_stop_pc;
-
-  /* If we have line number information for the function we
-     are thinking of stepping into, step into it.
-
-     If there are several symtabs at that PC (e.g. with include
-     files), just want to know whether *any* of them have line
-     numbers.  find_pc_line handles this.  */
-  {
-    struct symtab_and_line tmp_sal;
-
-    tmp_sal = find_pc_line (ecs->stop_func_start, 0);
-    if (tmp_sal.line != 0)
-      {
-        step_into_function (ecs);
-        return;
-      }
-  }
-
-  /* If we have no line number and the step-stop-if-no-debug
-     is set, we stop the step so that the user has a chance to
-     switch in assembly mode.  */
-  if (step_over_calls == STEP_OVER_UNDEBUGGABLE && step_stop_if_no_debug)
-    {
-      stop_step = 1;
-      print_stop_reason (END_STEPPING_RANGE, 0);
-      stop_stepping (ecs);
-      return;
-    }
-
-  step_over_function (ecs);
-  keep_going (ecs);
-  return;
-}
-
 static void
 adjust_pc_after_break (struct execution_control_state *ecs)
 {
-  CORE_ADDR stop_pc;
+  CORE_ADDR breakpoint_pc;
 
   /* If this target does not decrement the PC after breakpoints, then
      we have nothing to do.  */
@@ -1368,46 +1188,61 @@
   if (ecs->ws.value.sig != TARGET_SIGNAL_TRAP)
     return;
 
-  /* Find the location where (if we've hit a breakpoint) the breakpoint would
-     be.  */
-  stop_pc = read_pc_pid (ecs->ptid) - DECR_PC_AFTER_BREAK;
+  /* Find the location where (if we've hit a breakpoint) the
+     breakpoint would be.  */
+  breakpoint_pc = read_pc_pid (ecs->ptid) - DECR_PC_AFTER_BREAK;
 
-  /* If we're software-single-stepping, then assume this is a breakpoint.
-     NOTE drow/2004-01-17: This doesn't check that the PC matches, or that
-     we're even in the right thread.  The software-single-step code needs
-     some modernization.
-
-     If we're not software-single-stepping, then we first check that there
-     is an enabled software breakpoint at this address.  If there is, and
-     we weren't using hardware-single-step, then we've hit the breakpoint.
-
-     If we were using hardware-single-step, we check prev_pc; if we just
-     stepped over an inserted software breakpoint, then we should decrement
-     the PC and eventually report hitting the breakpoint.  The prev_pc check
-     prevents us from decrementing the PC if we just stepped over a jump
-     instruction and landed on the instruction after a breakpoint.
-
-     The last bit checks that we didn't hit a breakpoint in a signal handler
-     without an intervening stop in sigtramp, which is detected by a new
-     stack pointer value below any usual function calling stack adjustments.
-
-     NOTE drow/2004-01-17: I'm not sure that this is necessary.  The check
-     predates checking for software single step at the same time.  Also,
-     if we've moved into a signal handler we should have seen the
-     signal.  */
-
-  if ((SOFTWARE_SINGLE_STEP_P () && singlestep_breakpoints_inserted_p)
-      || (software_breakpoint_inserted_here_p (stop_pc)
-	  && !(currently_stepping (ecs)
-	       && prev_pc != stop_pc
-	       && !(step_range_end && INNER_THAN (read_sp (), (step_sp - 16))))))
-    write_pc_pid (stop_pc, ecs->ptid);
+  if (SOFTWARE_SINGLE_STEP_P ())
+    {
+      /* When using software single-step, a SIGTRAP can only indicate
+	 an inserted breakpoint.  This actually makes things
+	 easier.  */
+      if (singlestep_breakpoints_inserted_p)
+	/* When software single stepping, the instruction at [prev_pc]
+	   is never a breakpoint, but the instruction following
+	   [prev_pc] (in program execution order) always is.  Assume
+	   that following instruction was reached and hence a software
+	   breakpoint was hit.  */
+	write_pc_pid (breakpoint_pc, ecs->ptid);
+      else if (software_breakpoint_inserted_here_p (breakpoint_pc))
+	/* The inferior was free running (i.e., no single-step
+	   breakpoints inserted) and it hit a software breakpoint.  */
+	write_pc_pid (breakpoint_pc, ecs->ptid);
+    }
+  else
+    {
+      /* When using hardware single-step, a SIGTRAP is reported for
+	 both a completed single-step and a software breakpoint.  Need
+	 to differentiate between the two as the latter needs
+	 adjusting but the former does not.  */
+      if (currently_stepping (ecs))
+	{
+	  if (prev_pc == breakpoint_pc
+	      && software_breakpoint_inserted_here_p (breakpoint_pc))
+	    /* Hardware single-stepped a software breakpoint (as
+	       occures when the inferior is resumed with PC pointing
+	       at not-yet-hit software breakpoint).  Since the
+	       breakpoint really is executed, the inferior needs to be
+	       backed up to the breakpoint address.  */
+	    write_pc_pid (breakpoint_pc, ecs->ptid);
+	}
+      else
+	{
+	  if (software_breakpoint_inserted_here_p (breakpoint_pc))
+	    /* The inferior was free running (i.e., no hardware
+	       single-step and no possibility of a false SIGTRAP) and
+	       hit a software breakpoint.  */
+	    write_pc_pid (breakpoint_pc, ecs->ptid);
+	}
+    }
 }
 
 /* Given an execution control state that has been freshly filled in
    by an event from the inferior, figure out what it means and take
    appropriate action.  */
 
+int stepped_after_stopped_by_watchpoint;
+
 void
 handle_inferior_event (struct execution_control_state *ecs)
 {
@@ -1416,8 +1251,8 @@
      isn't used, then you're wrong!  The macro STOPPED_BY_WATCHPOINT,
      defined in the file "config/pa/nm-hppah.h", accesses the variable
      indirectly.  Mutter something rude about the HP merge.  */
-  int stepped_after_stopped_by_watchpoint;
   int sw_single_step_trap_p = 0;
+  int stopped_by_watchpoint = -1;  /* Mark as unknown.  */
 
   /* Cache the last pid/waitstatus. */
   target_last_wait_ptid = ecs->ptid;
@@ -1474,6 +1309,7 @@
   /* If it's a new process, add it to the thread database */
 
   ecs->new_thread_event = (!ptid_equal (ecs->ptid, inferior_ptid)
+			   && !ptid_equal (ecs->ptid, minus_one_ptid)
 			   && !in_thread_list (ecs->ptid));
 
   if (ecs->ws.kind != TARGET_WAITKIND_EXITED
@@ -1607,7 +1443,7 @@
 
       stop_pc = read_pc ();
 
-      stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
+      stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, 0);
 
       ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
 
@@ -1656,7 +1492,7 @@
       ecs->saved_inferior_ptid = inferior_ptid;
       inferior_ptid = ecs->ptid;
 
-      stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
+      stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, 0);
 
       ecs->random_signal = !bpstat_explains_signal (stop_bpstat);
       inferior_ptid = ecs->saved_inferior_ptid;
@@ -1778,8 +1614,8 @@
 
 	  ecs->ptid = saved_singlestep_ptid;
 	  context_switch (ecs);
-	  if (context_hook)
-	    context_hook (pid_to_thread_id (ecs->ptid));
+	  if (deprecated_context_hook)
+	    deprecated_context_hook (pid_to_thread_id (ecs->ptid));
 
 	  resume (1, TARGET_SIGNAL_0);
 	  prepare_to_wait (ecs);
@@ -1893,8 +1729,8 @@
     {
       context_switch (ecs);
 
-      if (context_hook)
-	context_hook (pid_to_thread_id (ecs->ptid));
+      if (deprecated_context_hook)
+	deprecated_context_hook (pid_to_thread_id (ecs->ptid));
 
       flush_cached_frames ();
     }
@@ -1972,7 +1808,7 @@
 
   /* It may be possible to simply continue after a watchpoint.  */
   if (HAVE_CONTINUABLE_WATCHPOINT)
-    STOPPED_BY_WATCHPOINT (ecs->ws);
+    stopped_by_watchpoint = STOPPED_BY_WATCHPOINT (ecs->ws);
 
   ecs->stop_func_start = 0;
   ecs->stop_func_end = 0;
@@ -1981,7 +1817,7 @@
      will both be 0 if it doesn't work.  */
   find_pc_partial_function (stop_pc, &ecs->stop_func_name,
 			    &ecs->stop_func_start, &ecs->stop_func_end);
-  ecs->stop_func_start += FUNCTION_START_OFFSET;
+  ecs->stop_func_start += DEPRECATED_FUNCTION_START_OFFSET;
   ecs->another_trap = 0;
   bpstat_clear (&stop_bpstat);
   stop_step = 0;
@@ -2045,20 +1881,15 @@
 	  return;
 	}
 
-      /* Don't even think about breakpoints
-         if just proceeded over a breakpoint.
-
-         However, if we are trying to proceed over a breakpoint
-         and end up in sigtramp, then through_sigtramp_breakpoint
-         will be set and we should check whether we've hit the
-         step breakpoint.  */
-      if (stop_signal == TARGET_SIGNAL_TRAP && trap_expected
-	  && through_sigtramp_breakpoint == NULL)
+      /* Don't even think about breakpoints if just proceeded over a
+         breakpoint.  */
+      if (stop_signal == TARGET_SIGNAL_TRAP && trap_expected)
 	bpstat_clear (&stop_bpstat);
       else
 	{
 	  /* See if there is a breakpoint at the current PC.  */
-	  stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid);
+	  stop_bpstat = bpstat_stop_status (stop_pc, ecs->ptid, 
+					    stopped_by_watchpoint);
 
 	  /* Following in case break condition called a
 	     function.  */
@@ -2136,39 +1967,22 @@
       if (signal_program[stop_signal] == 0)
 	stop_signal = TARGET_SIGNAL_0;
 
-      /* I'm not sure whether this needs to be check_sigtramp2 or
-         whether it could/should be keep_going.
+      if (step_range_end != 0
+	  && stop_signal != TARGET_SIGNAL_0
+	  && stop_pc >= step_range_start && stop_pc < step_range_end
+	  && frame_id_eq (get_frame_id (get_current_frame ()), step_frame_id))
+	{
+	  /* The inferior is about to take a signal that will take it
+	     out of the single step range.  Set a breakpoint at the
+	     current PC (which is presumably where the signal handler
+	     will eventually return) and then allow the inferior to
+	     run free.
 
-         This used to jump to step_over_function if we are stepping,
-         which is wrong.
-
-         Suppose the user does a `next' over a function call, and while
-         that call is in progress, the inferior receives a signal for
-         which GDB does not stop (i.e., signal_stop[SIG] is false).  In
-         that case, when we reach this point, there is already a
-         step-resume breakpoint established, right where it should be:
-         immediately after the function call the user is "next"-ing
-         over.  If we call step_over_function now, two bad things
-         happen:
-
-         - we'll create a new breakpoint, at wherever the current
-         frame's return address happens to be.  That could be
-         anywhere, depending on what function call happens to be on
-         the top of the stack at that point.  Point is, it's probably
-         not where we need it.
-
-         - the existing step-resume breakpoint (which is at the correct
-         address) will get orphaned: step_resume_breakpoint will point
-         to the new breakpoint, and the old step-resume breakpoint
-         will never be cleaned up.
-
-         The old behavior was meant to help HP-UX single-step out of
-         sigtramps.  It would place the new breakpoint at prev_pc, which
-         was certainly wrong.  I don't know the details there, so fixing
-         this probably breaks that.  As with anything else, it's up to
-         the HP-UX maintainer to furnish a fix that doesn't break other
-         platforms.  --JimB, 20 May 1999 */
-      check_sigtramp2 (ecs);
+	     Note that this is only needed for a signal delivered
+	     while in the single-step range.  Nested signals aren't a
+	     problem as they eventually all return.  */
+	  insert_step_resume_breakpoint (get_current_frame (), ecs);
+	}
       keep_going (ecs);
       return;
     }
@@ -2183,9 +1997,6 @@
     if (what.call_dummy)
       {
 	stop_stack_dummy = 1;
-#ifdef HP_OS_BUG
-	trap_expected_after_continue = 1;
-#endif
       }
 
     switch (what.main_action)
@@ -2209,13 +2020,6 @@
 	  {
 	    delete_step_resume_breakpoint (&step_resume_breakpoint);
 	  }
-	/* Not sure whether we need to blow this away too, but probably
-	   it is like the step-resume breakpoint.  */
-	if (through_sigtramp_breakpoint != NULL)
-	  {
-	    delete_breakpoint (through_sigtramp_breakpoint);
-	    through_sigtramp_breakpoint = NULL;
-	  }
 
 #if 0
 	/* FIXME - Need to implement nested temporary breakpoints */
@@ -2263,9 +2067,8 @@
       case BPSTAT_WHAT_STOP_NOISY:
 	stop_print_frame = 1;
 
-	/* We are about to nuke the step_resume_breakpoint and
-	   through_sigtramp_breakpoint via the cleanup chain, so
-	   no need to worry about it here.  */
+	/* We are about to nuke the step_resume_breakpointt via the
+	   cleanup chain, so no need to worry about it here.  */
 
 	stop_stepping (ecs);
 	return;
@@ -2273,9 +2076,8 @@
       case BPSTAT_WHAT_STOP_SILENT:
 	stop_print_frame = 0;
 
-	/* We are about to nuke the step_resume_breakpoint and
-	   through_sigtramp_breakpoint via the cleanup chain, so
-	   no need to worry about it here.  */
+	/* We are about to nuke the step_resume_breakpoin via the
+	   cleanup chain, so no need to worry about it here.  */
 
 	stop_stepping (ecs);
 	return;
@@ -2307,10 +2109,6 @@
 	break;
 
       case BPSTAT_WHAT_THROUGH_SIGTRAMP:
-	if (through_sigtramp_breakpoint)
-	  delete_breakpoint (through_sigtramp_breakpoint);
-	through_sigtramp_breakpoint = NULL;
-
 	/* If were waiting for a trap, hitting the step_resume_break
 	   doesn't count as getting it.  */
 	if (trap_expected)
@@ -2454,9 +2252,6 @@
       /* Having a step-resume breakpoint overrides anything
          else having to do with stepping commands until
          that breakpoint is reached.  */
-      /* I'm not sure whether this needs to be check_sigtramp2 or
-         whether it could/should be keep_going.  */
-      check_sigtramp2 (ecs);
       keep_going (ecs);
       return;
     }
@@ -2464,9 +2259,6 @@
   if (step_range_end == 0)
     {
       /* Likewise if we aren't even stepping.  */
-      /* I'm not sure whether this needs to be check_sigtramp2 or
-         whether it could/should be keep_going.  */
-      check_sigtramp2 (ecs);
       keep_going (ecs);
       return;
     }
@@ -2478,9 +2270,6 @@
      within it! */
   if (stop_pc >= step_range_start && stop_pc < step_range_end)
     {
-      /* We might be doing a BPSTAT_WHAT_SINGLE and getting a signal.
-         So definately need to check for sigtramp here.  */
-      check_sigtramp2 (ecs);
       keep_going (ecs);
       return;
     }
@@ -2516,114 +2305,112 @@
       return;
     }
 
-  /* We can't update step_sp every time through the loop, because
-     reading the stack pointer would slow down stepping too much.
-     But we can update it every time we leave the step range.  */
-  ecs->update_step_sp = 1;
-
-  /* Did we just step into a singal trampoline (either by stepping out
-     of a handler, or by taking a signal)?  */
-  /* NOTE: cagney/2004-03-16: Replaced (except for legacy) a check for
-     "pc_in_sigtramp(stop_pc) != pc_in_sigtramp(step_pc)" with
-     frame_type == SIGTRAMP && !frame_id_eq.  The latter is far more
-     robust as it will correctly handle nested signal trampolines.  */
-  if (legacy_frame_p (current_gdbarch)
-      ? (pc_in_sigtramp (stop_pc)
-	 && !pc_in_sigtramp (prev_pc)
-	 && INNER_THAN (read_sp (), step_sp))
-      : (get_frame_type (get_current_frame ()) == SIGTRAMP_FRAME
-	 && !frame_id_eq (get_frame_id (get_current_frame ()), step_frame_id)))
+  if (step_range_end != 1
+      && (step_over_calls == STEP_OVER_UNDEBUGGABLE
+	  || step_over_calls == STEP_OVER_ALL)
+      && get_frame_type (get_current_frame ()) == SIGTRAMP_FRAME)
     {
-      {
-	struct frame_id current_frame = get_frame_id (get_current_frame ());
-
-	if (frame_id_inner (current_frame, step_frame_id))
-	  {
-	    /* We have just taken a signal; go until we are back to
-	       the point where we took it and one more.  */
-
-	    /* This code is needed at least in the following case:
-	       The user types "next" and then a signal arrives (before
-	       the "next" is done).  */
-
-	    /* Note that if we are stopped at a breakpoint, then we need
-	       the step_resume breakpoint to override any breakpoints at
-	       the same location, so that we will still step over the
-	       breakpoint even though the signal happened.  */
-	    struct symtab_and_line sr_sal;
-
-	    init_sal (&sr_sal);
-	    sr_sal.symtab = NULL;
-	    sr_sal.line = 0;
-	    sr_sal.pc = prev_pc;
-	    /* We could probably be setting the frame to
-	       step_frame_id; I don't think anyone thought to try it.  */
-	    check_for_old_step_resume_breakpoint ();
-	    step_resume_breakpoint =
-	      set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume);
-	    if (breakpoints_inserted)
-	      insert_breakpoints ();
-	  }
-	else
-	  {
-	    /* We just stepped out of a signal handler and into
-	       its calling trampoline.
-
-	       Normally, we'd call step_over_function from
-	       here, but for some reason GDB can't unwind the
-	       stack correctly to find the real PC for the point
-	       user code where the signal trampoline will return
-	       -- FRAME_SAVED_PC fails, at least on HP-UX 10.20.
-	       But signal trampolines are pretty small stubs of
-	       code, anyway, so it's OK instead to just
-	       single-step out.  Note: assuming such trampolines
-	       don't exhibit recursion on any platform... */
-	    find_pc_partial_function (stop_pc, &ecs->stop_func_name,
-				      &ecs->stop_func_start,
-				      &ecs->stop_func_end);
-	    /* Readjust stepping range */
-	    step_range_start = ecs->stop_func_start;
-	    step_range_end = ecs->stop_func_end;
-	    ecs->stepping_through_sigtramp = 1;
-	  }
-      }
-
-
-      /* If this is stepi or nexti, make sure that the stepping range
-         gets us past that instruction.  */
-      if (step_range_end == 1)
-	/* FIXME: Does this run afoul of the code below which, if
-	   we step into the middle of a line, resets the stepping
-	   range?  */
-	step_range_end = (step_range_start = prev_pc) + 1;
-
-      ecs->remove_breakpoints_on_following_step = 1;
+      /* The inferior, while doing a "step" or "next", has ended up in
+	 a signal trampoline (either by a signal being delivered or by
+	 the signal handler returning).  Just single-step until the
+	 inferior leaves the trampoline (either by calling the handler
+	 or returning).  */
       keep_going (ecs);
       return;
     }
 
-  if (((stop_pc == ecs->stop_func_start	/* Quick test */
-	|| in_prologue (stop_pc, ecs->stop_func_start))
-       && !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name))
-      || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name)
-      || ecs->stop_func_name == 0)
+  if (frame_id_eq (frame_unwind_id (get_current_frame ()),
+                   step_frame_id))
     {
       /* It's a subroutine call.  */
-      handle_step_into_function (ecs);
-      return;
-    }
+      CORE_ADDR real_stop_pc;
+	
+      if ((step_over_calls == STEP_OVER_NONE)
+	  || ((step_range_end == 1)
+	      && in_prologue (prev_pc, ecs->stop_func_start)))
+	{
+	  /* I presume that step_over_calls is only 0 when we're
+	     supposed to be stepping at the assembly language level
+	     ("stepi").  Just stop.  */
+	  /* Also, maybe we just did a "nexti" inside a prolog, so we
+	     thought it was a subroutine call but it was not.  Stop as
+	     well.  FENN */
+	  stop_step = 1;
+	  print_stop_reason (END_STEPPING_RANGE, 0);
+	  stop_stepping (ecs);
+	  return;
+	}
+	
+      if (step_over_calls == STEP_OVER_ALL || IGNORE_HELPER_CALL (stop_pc))
+	{
+	  /* We're doing a "next", set a breakpoint at callee's return
+	     address (the address at which the caller will
+	     resume).  */
+	  insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()),
+					 ecs);
+	  keep_going (ecs);
+	  return;
+	}
+      
+      /* If we are in a function call trampoline (a stub between the
+	 calling routine and the real function), locate the real
+	 function.  That's what tells us (a) whether we want to step
+	 into it at all, and (b) what prologue we want to run to the
+	 end of, if we do step into it.  */
+      real_stop_pc = skip_language_trampoline (stop_pc);
+      if (real_stop_pc == 0)
+	real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
+      if (real_stop_pc != 0)
+	ecs->stop_func_start = real_stop_pc;
+      
+      if (IN_SOLIB_DYNSYM_RESOLVE_CODE (ecs->stop_func_start))
+	{
+	  struct symtab_and_line sr_sal;
+	  init_sal (&sr_sal);
+	  sr_sal.pc = ecs->stop_func_start;
 
-  /* We've wandered out of the step range.  */
+	  check_for_old_step_resume_breakpoint ();
+	  step_resume_breakpoint =
+	    set_momentary_breakpoint (sr_sal, null_frame_id, bp_step_resume);
+	  if (breakpoints_inserted)
+	    insert_breakpoints ();
 
-  ecs->sal = find_pc_line (stop_pc, 0);
+          keep_going (ecs);
+          return;
+	}
 
-  if (step_range_end == 1)
-    {
-      /* It is stepi or nexti.  We always want to stop stepping after
-         one instruction.  */
-      stop_step = 1;
-      print_stop_reason (END_STEPPING_RANGE, 0);
-      stop_stepping (ecs);
+      /* If we have line number information for the function we are
+	 thinking of stepping into, step into it.
+
+	 If there are several symtabs at that PC (e.g. with include
+	 files), just want to know whether *any* of them have line
+	 numbers.  find_pc_line handles this.  */
+      {
+	struct symtab_and_line tmp_sal;
+	
+	tmp_sal = find_pc_line (ecs->stop_func_start, 0);
+	if (tmp_sal.line != 0)
+	  {
+	    step_into_function (ecs);
+	    return;
+	  }
+      }
+
+      /* If we have no line number and the step-stop-if-no-debug is
+	 set, we stop the step so that the user has a chance to switch
+	 in assembly mode.  */
+      if (step_over_calls == STEP_OVER_UNDEBUGGABLE && step_stop_if_no_debug)
+	{
+	  stop_step = 1;
+	  print_stop_reason (END_STEPPING_RANGE, 0);
+	  stop_stepping (ecs);
+	  return;
+	}
+
+      /* Set a breakpoint at callee's return address (the address at
+	 which the caller will resume).  */
+      insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()), ecs);
+      keep_going (ecs);
       return;
     }
 
@@ -2659,6 +2446,51 @@
 	}
     }
 
+  /* NOTE: tausq/2004-05-24: This if block used to be done before all
+     the trampoline processing logic, however, there are some trampolines 
+     that have no names, so we should do trampoline handling first.  */
+  if (step_over_calls == STEP_OVER_UNDEBUGGABLE
+      && ecs->stop_func_name == NULL)
+    {
+      /* The inferior just stepped into, or returned to, an
+         undebuggable function (where there is no symbol, not even a
+         minimal symbol, corresponding to the address where the
+         inferior stopped).  Since we want to skip this kind of code,
+         we keep going until the inferior returns from this
+         function.  */
+      if (step_stop_if_no_debug)
+	{
+	  /* If we have no line number and the step-stop-if-no-debug
+	     is set, we stop the step so that the user has a chance to
+	     switch in assembly mode.  */
+	  stop_step = 1;
+	  print_stop_reason (END_STEPPING_RANGE, 0);
+	  stop_stepping (ecs);
+	  return;
+	}
+      else
+	{
+	  /* Set a breakpoint at callee's return address (the address
+	     at which the caller will resume).  */
+	  insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()),
+					 ecs);
+	  keep_going (ecs);
+	  return;
+	}
+    }
+
+  if (step_range_end == 1)
+    {
+      /* It is stepi or nexti.  We always want to stop stepping after
+         one instruction.  */
+      stop_step = 1;
+      print_stop_reason (END_STEPPING_RANGE, 0);
+      stop_stepping (ecs);
+      return;
+    }
+
+  ecs->sal = find_pc_line (stop_pc, 0);
+
   if (ecs->sal.line == 0)
     {
       /* We have no line number information.  That means to stop
@@ -2743,50 +2575,13 @@
 static int
 currently_stepping (struct execution_control_state *ecs)
 {
-  return ((through_sigtramp_breakpoint == NULL
-	   && !ecs->handling_longjmp
+  return ((!ecs->handling_longjmp
 	   && ((step_range_end && step_resume_breakpoint == NULL)
 	       || trap_expected))
 	  || ecs->stepping_through_solib_after_catch
 	  || bpstat_should_step ());
 }
 
-static void
-check_sigtramp2 (struct execution_control_state *ecs)
-{
-  if (trap_expected
-      && pc_in_sigtramp (stop_pc)
-      && !pc_in_sigtramp (prev_pc)
-      && INNER_THAN (read_sp (), step_sp))
-    {
-      /* What has happened here is that we have just stepped the
-         inferior with a signal (because it is a signal which
-         shouldn't make us stop), thus stepping into sigtramp.
-
-         So we need to set a step_resume_break_address breakpoint and
-         continue until we hit it, and then step.  FIXME: This should
-         be more enduring than a step_resume breakpoint; we should
-         know that we will later need to keep going rather than
-         re-hitting the breakpoint here (see the testsuite,
-         gdb.base/signals.exp where it says "exceedingly difficult").  */
-
-      struct symtab_and_line sr_sal;
-
-      init_sal (&sr_sal);	/* initialize to zeroes */
-      sr_sal.pc = prev_pc;
-      sr_sal.section = find_pc_overlay (sr_sal.pc);
-      /* We perhaps could set the frame if we kept track of what the
-         frame corresponding to prev_pc was.  But we don't, so don't.  */
-      through_sigtramp_breakpoint =
-	set_momentary_breakpoint (sr_sal, null_frame_id, bp_through_sigtramp);
-      if (breakpoints_inserted)
-	insert_breakpoints ();
-
-      ecs->remove_breakpoints_on_following_step = 1;
-      ecs->another_trap = 1;
-    }
-}
-
 /* Subroutine call with source code we should not step over.  Do step
    to the first line of code in it.  */
 
@@ -2864,104 +2659,37 @@
   keep_going (ecs);
 }
 
-/* We've just entered a callee, and we wish to resume until it returns
-   to the caller.  Setting a step_resume breakpoint on the return
-   address will catch a return from the callee.
-     
-   However, if the callee is recursing, we want to be careful not to
-   catch returns of those recursive calls, but only of THIS instance
-   of the caller.
-
-   To do this, we set the step_resume bp's frame to our current
-   caller's frame (obtained by doing a frame ID unwind).  */
+/* The inferior, as a result of a function call (has left) or signal
+   (about to leave) the single-step range.  Set a momentary breakpoint
+   within the step range where the inferior is expected to later
+   return.  */
 
 static void
-step_over_function (struct execution_control_state *ecs)
+insert_step_resume_breakpoint (struct frame_info *step_frame,
+			       struct execution_control_state *ecs)
 {
   struct symtab_and_line sr_sal;
-  struct frame_id sr_id;
+
+  /* This is only used within the step-resume range/frame.  */
+  gdb_assert (frame_id_eq (step_frame_id, get_frame_id (step_frame)));
+  gdb_assert (step_range_end != 0);
+  /* Remember, if the call instruction is the last in the step range,
+     the breakpoint will land just beyond that.  Hence ``<=
+     step_range_end''.  Also, ignore check when "nexti".  */
+  gdb_assert (step_range_start == step_range_end
+	      || (get_frame_pc (step_frame) >= step_range_start
+		  && get_frame_pc (step_frame) <= step_range_end));
 
   init_sal (&sr_sal);		/* initialize to zeros */
 
-  /* NOTE: cagney/2003-04-06:
-
-     At this point the equality get_frame_pc() == get_frame_func()
-     should hold.  This may make it possible for this code to tell the
-     frame where it's function is, instead of the reverse.  This would
-     avoid the need to search for the frame's function, which can get
-     very messy when there is no debug info available (look at the
-     heuristic find pc start code found in targets like the MIPS).  */
-
-  /* NOTE: cagney/2003-04-06:
-
-     The intent of DEPRECATED_SAVED_PC_AFTER_CALL was to:
-
-     - provide a very light weight equivalent to frame_unwind_pc()
-     (nee FRAME_SAVED_PC) that avoids the prologue analyzer
-
-     - avoid handling the case where the PC hasn't been saved in the
-     prologue analyzer
-
-     Unfortunately, not five lines further down, is a call to
-     get_frame_id() and that is guarenteed to trigger the prologue
-     analyzer.
-     
-     The `correct fix' is for the prologe analyzer to handle the case
-     where the prologue is incomplete (PC in prologue) and,
-     consequently, the return pc has not yet been saved.  It should be
-     noted that the prologue analyzer needs to handle this case
-     anyway: frameless leaf functions that don't save the return PC;
-     single stepping through a prologue.
-
-     The d10v handles all this by bailing out of the prologue analsis
-     when it reaches the current instruction.  */
-
-  if (DEPRECATED_SAVED_PC_AFTER_CALL_P ())
-    sr_sal.pc = ADDR_BITS_REMOVE (DEPRECATED_SAVED_PC_AFTER_CALL (get_current_frame ()));
-  else
-    sr_sal.pc = ADDR_BITS_REMOVE (frame_pc_unwind (get_current_frame ()));
+  sr_sal.pc = ADDR_BITS_REMOVE (get_frame_pc (step_frame));
   sr_sal.section = find_pc_overlay (sr_sal.pc);
 
   check_for_old_step_resume_breakpoint ();
 
-  /* NOTE: cagney/2004-03-15: Code using the current value of
-     "step_frame_id", instead of unwinding that frame ID, removed (at
-     least for non-legacy platforms).  On s390 GNU/Linux, after taking
-     a signal, the program is directly resumed at the signal handler
-     and, consequently, the PC would point at at the first instruction
-     of that signal handler but STEP_FRAME_ID would [incorrectly] at
-     the interrupted code when it should point at the signal
-     trampoline.  By always and locally doing a frame ID unwind, it's
-     possible to assert that the code is always using the correct
-     ID.  */
-  if (legacy_frame_p (current_gdbarch))
-    {
-      if (frame_id_p (step_frame_id)
-	  && !IN_SOLIB_DYNSYM_RESOLVE_CODE (sr_sal.pc))
-	/* NOTE: cagney/2004-02-27: Use the global state's idea of the
-	   stepping frame ID.  I suspect this is done as it is lighter
-	   weight than a call to get_prev_frame.  */
-	/* NOTE: cagney/2004-03-15: See comment above about how this
-	   is also broken.  */
-	sr_id = step_frame_id;
-      else
-	/* NOTE: cagney/2004-03-15: This is the way it was 'cos this
-	   is the way it always was.  It should be using the unwound
-	   (or caller's) ID, and not this (or the callee's) ID.  It
-	   appeared to work because: legacy architectures used the
-	   wrong end of the frame for the ID.stack (inner-most rather
-	   than outer-most) so that the callee's id.stack (un
-	   adjusted) matched the caller's id.stack giving the
-	   "correct" id; more often than not
-	   !IN_SOLIB_DYNSYM_RESOLVE_CODE and hence the code above (it
-	   was originally later in the function) fixed the ID by using
-	   global state.  */
-	sr_id = get_frame_id (get_current_frame ());
-    }
-  else
-    sr_id = get_frame_id (get_prev_frame (get_current_frame ()));
-
-  step_resume_breakpoint = set_momentary_breakpoint (sr_sal, sr_id, bp_step_resume);
+  step_resume_breakpoint
+    = set_momentary_breakpoint (sr_sal, get_frame_id (step_frame),
+				bp_step_resume);
 
   if (breakpoints_inserted)
     insert_breakpoints ();
@@ -2984,10 +2712,6 @@
   /* Save the pc before execution, to compare with pc after stop.  */
   prev_pc = read_pc ();		/* Might have been DECR_AFTER_BREAK */
 
-  if (ecs->update_step_sp)
-    step_sp = read_sp ();
-  ecs->update_step_sp = 0;
-
   /* If we did not do break;, it means we should keep running the
      inferior and not return to debugger.  */
 
@@ -3014,15 +2738,13 @@
       /* If we've just finished a special step resume and we don't
          want to hit a breakpoint, pull em out.  */
       if (step_resume_breakpoint == NULL
-	  && through_sigtramp_breakpoint == NULL
 	  && ecs->remove_breakpoints_on_following_step)
 	{
 	  ecs->remove_breakpoints_on_following_step = 0;
 	  remove_breakpoints ();
 	  breakpoints_inserted = 0;
 	}
-      else if (!breakpoints_inserted &&
-	       (through_sigtramp_breakpoint != NULL || !ecs->another_trap))
+      else if (!breakpoints_inserted && !ecs->another_trap)
 	{
 	  breakpoints_failed = insert_breakpoints ();
 	  if (breakpoints_failed)
@@ -3325,7 +3047,7 @@
 	     LOCATION: Print only location
 	     SRC_AND_LOC: Print location and source line */
 	  if (do_frame_printing)
-	    print_stack_frame (deprecated_selected_frame, -1, source_flag);
+	    print_stack_frame (get_selected_frame (), 0, source_flag);
 
 	  /* Display the auto-display expressions.  */
 	  do_displays ();
@@ -3354,7 +3076,7 @@
 
 done:
   annotate_stopped ();
-  observer_notify_normal_stop ();
+  observer_notify_normal_stop (stop_bpstat);
 }
 
 static int
diff --git a/gdb/inftarg.c b/gdb/inftarg.c
index a6f40ec..384c04e 100644
--- a/gdb/inftarg.c
+++ b/gdb/inftarg.c
@@ -34,7 +34,7 @@
 #include <signal.h>
 #include <sys/types.h>
 #include <fcntl.h>
-
+#include "observer.h"
 #include "gdb_wait.h"
 #include "inflow.h"
 
@@ -73,7 +73,7 @@
 
 static void ptrace_him (int);
 
-static void child_create_inferior (char *, char *, char **);
+static void child_create_inferior (char *, char *, char **, int);
 
 static void child_mourn_inferior (void);
 
@@ -194,46 +194,40 @@
 static void
 child_attach (char *args, int from_tty)
 {
+  char *exec_file;
+  int pid;
+  char *dummy;
+
   if (!args)
     error_no_arg ("process-id to attach");
 
-#ifndef ATTACH_DETACH
-  error ("Can't attach to a process on this machine.");
-#else
-  {
-    char *exec_file;
-    int pid;
-    char *dummy;
-
-    dummy = args;
-    pid = strtol (args, &dummy, 0);
-    /* Some targets don't set errno on errors, grrr! */
-    if ((pid == 0) && (args == dummy))
+  dummy = args;
+  pid = strtol (args, &dummy, 0);
+  /* Some targets don't set errno on errors, grrr! */
+  if ((pid == 0) && (args == dummy))
       error ("Illegal process-id: %s\n", args);
+  
+  if (pid == getpid ())	/* Trying to masturbate? */
+    error ("I refuse to debug myself!");
+  
+  if (from_tty)
+    {
+      exec_file = (char *) get_exec_file (0);
+      
+      if (exec_file)
+	printf_unfiltered ("Attaching to program: %s, %s\n", exec_file,
+			   target_pid_to_str (pid_to_ptid (pid)));
+      else
+	printf_unfiltered ("Attaching to %s\n",
+			   target_pid_to_str (pid_to_ptid (pid)));
+      
+      gdb_flush (gdb_stdout);
+    }
 
-    if (pid == getpid ())	/* Trying to masturbate? */
-      error ("I refuse to debug myself!");
-
-    if (from_tty)
-      {
-	exec_file = (char *) get_exec_file (0);
-
-	if (exec_file)
-	  printf_unfiltered ("Attaching to program: %s, %s\n", exec_file,
-			     target_pid_to_str (pid_to_ptid (pid)));
-	else
-	  printf_unfiltered ("Attaching to %s\n",
-	                     target_pid_to_str (pid_to_ptid (pid)));
-
-	gdb_flush (gdb_stdout);
-      }
-
-    attach (pid);
-
-    inferior_ptid = pid_to_ptid (pid);
-    push_target (&child_ops);
-  }
-#endif /* ATTACH_DETACH */
+  attach (pid);
+  
+  inferior_ptid = pid_to_ptid (pid);
+  push_target (&child_ops);
 }
 
 #if !defined(CHILD_POST_ATTACH)
@@ -256,31 +250,25 @@
 static void
 child_detach (char *args, int from_tty)
 {
-#ifdef ATTACH_DETACH
-  {
-    int siggnal = 0;
-    int pid = PIDGET (inferior_ptid);
-
-    if (from_tty)
-      {
-	char *exec_file = get_exec_file (0);
-	if (exec_file == 0)
-	  exec_file = "";
-	printf_unfiltered ("Detaching from program: %s, %s\n", exec_file,
-			   target_pid_to_str (pid_to_ptid (pid)));
-	gdb_flush (gdb_stdout);
-      }
-    if (args)
-      siggnal = atoi (args);
-
-    detach (siggnal);
-
-    inferior_ptid = null_ptid;
-    unpush_target (&child_ops);
-  }
-#else
-  error ("This version of Unix does not support detaching a process.");
-#endif
+  int siggnal = 0;
+  int pid = PIDGET (inferior_ptid);
+  
+  if (from_tty)
+    {
+      char *exec_file = get_exec_file (0);
+      if (exec_file == 0)
+	exec_file = "";
+      printf_unfiltered ("Detaching from program: %s, %s\n", exec_file,
+			 target_pid_to_str (pid_to_ptid (pid)));
+      gdb_flush (gdb_stdout);
+    }
+  if (args)
+    siggnal = atoi (args);
+  
+  detach (siggnal);
+  
+  inferior_ptid = null_ptid;
+  unpush_target (&child_ops);
 }
 
 /* Get ready to modify the registers array.  On machines which store
@@ -356,7 +344,8 @@
    ENV is the environment vector to pass.  Errors reported with error().  */
 
 static void
-child_create_inferior (char *exec_file, char *allargs, char **env)
+child_create_inferior (char *exec_file, char *allargs, char **env,
+		       int from_tty)
 {
 #ifdef HPUXHPPA
   fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, pre_fork_inferior, NULL);
@@ -364,6 +353,7 @@
   fork_inferior (exec_file, allargs, env, ptrace_me, ptrace_him, NULL, NULL);
 #endif
   /* We are at the first instruction we care about.  */
+  observer_notify_inferior_created (&current_target, from_tty);
   /* Pedal to the metal... */
   proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
 }
diff --git a/gdb/infttrace.c b/gdb/infttrace.c
index 3f76edb..eb79159 100644
--- a/gdb/infttrace.c
+++ b/gdb/infttrace.c
@@ -1,7 +1,7 @@
 /* Low level Unix child interface to ttrace, for GDB when running under HP-UX.
-   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
-   1999, 2000, 2001, 2003
-   Free Software Foundation, Inc.
+
+   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+   1998, 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -28,6 +28,7 @@
 #include "gdb_wait.h"
 #include "command.h"
 #include "gdbthread.h"
+#include "infttrace.h"
 
 /* We need pstat functionality so that we can get the exec file
    for a process we attach to.
@@ -4559,8 +4560,6 @@
 }
 #endif /* CHILD_RESUME */
 
-
-#ifdef ATTACH_DETACH
 /*
  * Like it says.
  *
@@ -4732,10 +4731,8 @@
 
   attach_flag = 1;
 }
-#endif /* ATTACH_DETACH */
 
 
-#ifdef ATTACH_DETACH
 /* Start debugging the process whose number is PID.
  * (A _real_ pid).
  */
@@ -4802,7 +4799,6 @@
 
   /* Process-state? */
 }
-#endif /* ATTACH_DETACH */
 
 
 /* Default the type of the ttrace transfer to int.  */
diff --git a/gdb/infttrace.h b/gdb/infttrace.h
index d3330e3..c947cc0 100644
--- a/gdb/infttrace.h
+++ b/gdb/infttrace.h
@@ -1,6 +1,6 @@
 /* Low level Unix child interface to ttrace, for GDB when running under HP-UX.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -22,7 +22,14 @@
 #ifndef INFTTRACE_H
 #define INFTTRACE_H
 
+enum target_waitkind;
+
 extern int parent_attach_all (int, PTRACE_ARG3_TYPE, int);
 extern pid_t hppa_switched_threads (pid_t gdb_pid);
+extern int hpux_has_forked (int pid, int *childpid);
+extern int hpux_has_vforked (int pid, int *childpid);
+extern int hpux_has_execd (int pid, char **execd_pathname);
+extern int hpux_has_syscall_event (int pid, enum target_waitkind *kind,
+				   int *syscall_id);
 
 #endif
diff --git a/gdb/interps.c b/gdb/interps.c
index 82e9af6..5856fa0 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -268,10 +268,10 @@
 current_interp_command_loop (void)
 {
   /* Somewhat messy.  For the moment prop up all the old ways of
-     selecting the command loop.  `command_loop_hook' should be
-     deprecated.  */
-  if (command_loop_hook != NULL)
-    command_loop_hook ();
+     selecting the command loop.  `deprecated_command_loop_hook'
+     should be deprecated.  */
+  if (deprecated_command_loop_hook != NULL)
+    deprecated_command_loop_hook ();
   else if (current_interpreter != NULL
 	   && current_interpreter->procs->command_loop_proc != NULL)
     current_interpreter->procs->command_loop_proc (current_interpreter->data);
@@ -322,27 +322,27 @@
 void
 clear_interpreter_hooks (void)
 {
-  init_ui_hook = 0;
-  print_frame_info_listing_hook = 0;
+  deprecated_init_ui_hook = 0;
+  deprecated_print_frame_info_listing_hook = 0;
   /*print_frame_more_info_hook = 0; */
-  query_hook = 0;
-  warning_hook = 0;
-  create_breakpoint_hook = 0;
-  delete_breakpoint_hook = 0;
-  modify_breakpoint_hook = 0;
-  interactive_hook = 0;
-  registers_changed_hook = 0;
-  readline_begin_hook = 0;
-  readline_hook = 0;
-  readline_end_hook = 0;
-  register_changed_hook = 0;
-  memory_changed_hook = 0;
-  context_hook = 0;
-  target_wait_hook = 0;
-  call_command_hook = 0;
-  error_hook = 0;
-  error_begin_hook = 0;
-  command_loop_hook = 0;
+  deprecated_query_hook = 0;
+  deprecated_warning_hook = 0;
+  deprecated_create_breakpoint_hook = 0;
+  deprecated_delete_breakpoint_hook = 0;
+  deprecated_modify_breakpoint_hook = 0;
+  deprecated_interactive_hook = 0;
+  deprecated_registers_changed_hook = 0;
+  deprecated_readline_begin_hook = 0;
+  deprecated_readline_hook = 0;
+  deprecated_readline_end_hook = 0;
+  deprecated_register_changed_hook = 0;
+  deprecated_memory_changed_hook = 0;
+  deprecated_context_hook = 0;
+  deprecated_target_wait_hook = 0;
+  deprecated_call_command_hook = 0;
+  deprecated_error_hook = 0;
+  deprecated_error_begin_hook = 0;
+  deprecated_command_loop_hook = 0;
   clear_gdb_event_hooks ();
 }
 
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index 93727a6..24bb883 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -1,6 +1,8 @@
 /* Native support for the SGI Iris running IRIX version 5, for GDB.
-   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
-   1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+   1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+
    Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
    and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
    Implemented for Irix 4.x by Garrett A. Wollman.
@@ -56,7 +58,7 @@
 {
   int regi;
   greg_t *regp = &(*gregsetp)[0];
-  int gregoff = sizeof (greg_t) - mips_regsize (current_gdbarch);
+  int gregoff = sizeof (greg_t) - mips_isa_regsize (current_gdbarch);
   static char zerobuf[32] = {0};
 
   for (regi = 0; regi <= CTX_RA; regi++)
@@ -209,8 +211,8 @@
     {
       memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size);
     }
-  else if (mips_regsize (current_gdbarch) == 4 &&
-	   core_reg_size == (2 * mips_regsize (current_gdbarch)) * NUM_REGS)
+  else if (mips_isa_regsize (current_gdbarch) == 4 &&
+	   core_reg_size == (2 * mips_isa_regsize (current_gdbarch)) * NUM_REGS)
     {
       /* This is a core file from a N32 executable, 64 bits are saved
          for all registers.  */
@@ -277,5 +279,5 @@
 void
 _initialize_core_irix5 (void)
 {
-  add_core_fns (&irix5_core_fns);
+  deprecated_add_core_fns (&irix5_core_fns);
 }
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index 6db6e88..1fb8cd2 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -62,6 +62,8 @@
 
 static void java_emit_char (int c, struct ui_file * stream, int quoter);
 
+static char *java_class_name_from_physname (const char *physname);
+
 /* This objfile contains symtabs that have been dynamically created
    to record dynamically loaded Java classes and dynamically
    compiled java methods. */
@@ -975,6 +977,59 @@
   return cplus_demangle (mangled, options | DMGL_JAVA);
 }
 
+/* Find the member function name of the demangled name NAME.  NAME
+   must be a method name including arguments, in order to correctly
+   locate the last component.
+
+   This function return a pointer to the first dot before the
+   member function name, or NULL if the name was not of the
+   expected form.  */
+
+static const char *
+java_find_last_component (const char *name)
+{
+  const char *p;
+
+  /* Find argument list.  */
+  p = strchr (name, '(');
+
+  if (p == NULL)
+    return NULL;
+
+  /* Back up and find first dot prior to argument list.  */
+  while (p > name && *p != '.')
+    p--;
+
+  if (p == name)
+    return NULL;
+
+  return p;
+}
+
+/* Return the name of the class containing method PHYSNAME.  */
+
+static char *
+java_class_name_from_physname (const char *physname) 
+{
+  char *ret = NULL;
+  const char *end;
+  int depth = 0;
+  char *demangled_name = java_demangle (physname, DMGL_PARAMS | DMGL_ANSI);
+
+  if (demangled_name == NULL)
+    return NULL;
+
+  end = java_find_last_component (demangled_name);
+  if (end != NULL)
+    {
+      ret = xmalloc (end - demangled_name + 1);
+      memcpy (ret, demangled_name, end - demangled_name);
+      ret[end - demangled_name] = '\0';
+    }
+
+  xfree (demangled_name);
+  return ret;
+}
 
 /* Table mapping opcodes into strings for printing operators
    and precedences of the operators.  */
@@ -1036,6 +1091,7 @@
   &exp_descriptor_java,
   java_parse,
   java_error,
+  null_post_parser,
   c_printchar,			/* Print a character constant */
   c_printstr,			/* Function to print string constant */
   java_emit_char,		/* Function to print a single character */
@@ -1048,6 +1104,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   java_demangle,		/* Language specific symbol demangler */
+  java_class_name_from_physname,/* Language specific class name */
   {"", "", "", ""},		/* Binary format info */
   {"0%lo", "0", "o", ""},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
diff --git a/gdb/language.c b/gdb/language.c
index bc00b47..dae3e80 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -1176,6 +1176,16 @@
   return NULL;
 }
 
+/* Return class name from physname or NULL.  */
+char *
+language_class_name_from_physname (const struct language_defn *current_language,
+				   const char *physname)
+{
+  if (current_language != NULL && current_language->la_class_name_from_physname)
+    return current_language->la_class_name_from_physname (physname);
+  return NULL;
+}
+
 /* Return the default string containing the list of characters
    delimiting words.  This is a reasonable default value that
    most languages should be able to use.  */
@@ -1258,6 +1268,10 @@
   return cplus_demangle (mangled, options);
 }
 
+static char *unk_lang_class_name (const char *mangled)
+{
+  return NULL;
+}
 
 static struct type **const (unknown_builtin_types[]) =
 {
@@ -1279,6 +1293,7 @@
   &exp_descriptor_standard,
   unk_lang_parser,
   unk_lang_error,
+  null_post_parser,
   unk_lang_printchar,		/* Print character constant */
   unk_lang_printstr,
   unk_lang_emit_char,
@@ -1291,6 +1306,7 @@
   basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   unk_lang_demangle,		/* Language specific symbol demangler */
+  unk_lang_class_name,		/* Language specific class_name_from_physname */
   {"", "", "", ""},		/* Binary format info */
   {"0%lo", "0", "o", ""},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
@@ -1315,6 +1331,7 @@
   &exp_descriptor_standard,
   unk_lang_parser,
   unk_lang_error,
+  null_post_parser,
   unk_lang_printchar,		/* Print character constant */
   unk_lang_printstr,
   unk_lang_emit_char,
@@ -1327,6 +1344,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   unk_lang_demangle,		/* Language specific symbol demangler */
+  unk_lang_class_name,		/* Language specific class_name_from_physname */
   {"", "", "", ""},		/* Binary format info */
   {"0%lo", "0", "o", ""},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
@@ -1350,6 +1368,7 @@
   &exp_descriptor_standard,
   unk_lang_parser,
   unk_lang_error,
+  null_post_parser,
   unk_lang_printchar,		/* Print character constant */
   unk_lang_printstr,
   unk_lang_emit_char,
@@ -1362,6 +1381,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   unk_lang_demangle,		/* Language specific symbol demangler */
+  unk_lang_class_name,		/* Language specific class_name_from_physname */
   {"", "", "", ""},		/* Binary format info */
   {"0%lo", "0", "o", ""},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
diff --git a/gdb/language.h b/gdb/language.h
index 8ed9fb0..bbb45f6 100644
--- a/gdb/language.h
+++ b/gdb/language.h
@@ -180,6 +180,14 @@
 
     void (*la_error) (char *);
 
+    /* Given an expression *EXPP created by prefixifying the result of
+       la_parser, perform any remaining processing necessary to complete
+       its translation.  *EXPP may change; la_post_parser is responsible 
+       for releasing its previous contents, if necessary.  If 
+       VOID_CONTEXT_P, then no value is expected from the expression.  */
+
+    void (*la_post_parser) (struct expression ** expp, int void_context_p);
+
     void (*la_printchar) (int ch, struct ui_file * stream);
 
     void (*la_printstr) (struct ui_file * stream, char *string,
@@ -239,6 +247,9 @@
     /* Return demangled language symbol, or NULL.  */
     char *(*la_demangle) (const char *mangled, int options);
 
+    /* Return class name of a mangled method name or NULL.  */
+    char *(*la_class_name_from_physname) (const char *physname);
+
     /* Base 2 (binary) formats. */
 
     struct language_format_info la_binary_format;
@@ -508,6 +519,10 @@
 extern char *language_demangle (const struct language_defn *current_language, 
 				const char *mangled, int options);
 
+/* Return class name from physname, or NULL.  */
+extern char *language_class_name_from_physname (const struct language_defn *,
+					        const char *physname);
+
 /* Splitting strings into words.  */
 extern char *default_word_break_characters (void);
 
diff --git a/gdb/libunwind-frame.c b/gdb/libunwind-frame.c
index d7e8dbc..3462625 100644
--- a/gdb/libunwind-frame.c
+++ b/gdb/libunwind-frame.c
@@ -1,6 +1,6 @@
 /* Frame unwinder for frames using the libunwind library.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    Written by Jeff Johnston, contributed by Red Hat Inc.
 
@@ -259,7 +259,8 @@
   *lvalp = not_lval;
   *realnump = -1;
 
-  memset (valuep, 0, register_size (current_gdbarch, regnum));
+  if (valuep)
+    memset (valuep, 0, register_size (current_gdbarch, regnum));
 
   if (uw_regnum < 0)
     return;
@@ -281,7 +282,8 @@
   if (ret < 0)
     return;
 
-  memcpy (valuep, ptr, register_size (current_gdbarch, regnum));
+  if (valuep)
+    memcpy (valuep, ptr, register_size (current_gdbarch, regnum));
 
   if (unw_get_saveloc_p (&cache->cursor, uw_regnum, &sl) < 0)
     return;
diff --git a/gdb/lin-lwp.c b/gdb/lin-lwp.c
index 0d8d1ff..4d04d62 100644
--- a/gdb/lin-lwp.c
+++ b/gdb/lin-lwp.c
@@ -1,5 +1,5 @@
 /* Multi-threaded debugging support for GNU/Linux (LWP layer).
-   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -183,6 +183,8 @@
 
   memset (lp, 0, sizeof (struct lwp_info));
 
+  lp->waitstatus.kind = TARGET_WAITKIND_IGNORE;
+
   lp->ptid = ptid;
 
   lp->next = lwp_list;
@@ -278,7 +280,7 @@
 void
 lin_lwp_attach_lwp (ptid_t ptid, int verbose)
 {
-  struct lwp_info *lp;
+  struct lwp_info *lp, *found_lp;
 
   gdb_assert (is_lwp (ptid));
 
@@ -293,13 +295,17 @@
   if (verbose)
     printf_filtered ("[New %s]\n", target_pid_to_str (ptid));
 
-  lp = find_lwp_pid (ptid);
+  found_lp = lp = find_lwp_pid (ptid);
   if (lp == NULL)
     lp = add_lwp (ptid);
 
-  /* We assume that we're already attached to any LWP that has an
-     id equal to the overall process id.  */
-  if (GET_LWP (ptid) != GET_PID (ptid))
+  /* We assume that we're already attached to any LWP that has an id
+     equal to the overall process id, and to any LWP that is already
+     in our list of LWPs.  If we're not seeing exit events from threads
+     and we've had PID wraparound since we last tried to stop all threads,
+     this assumption might be wrong; fortunately, this is very unlikely
+     to happen.  */
+  if (GET_LWP (ptid) != GET_PID (ptid) && found_lp == NULL)
     {
       pid_t pid;
       int status;
@@ -590,6 +596,41 @@
   return kill (lwpid, signo);
 }
 
+/* Handle a GNU/Linux extended wait response.  Most of the work we
+   just pass off to linux_handle_extended_wait, but if it reports a
+   clone event we need to add the new LWP to our list (and not report
+   the trap to higher layers).  This function returns non-zero if
+   the event should be ignored and we should wait again.  */
+
+static int
+lin_lwp_handle_extended (struct lwp_info *lp, int status)
+{
+  linux_handle_extended_wait (GET_LWP (lp->ptid), status,
+			      &lp->waitstatus);
+
+  /* TARGET_WAITKIND_SPURIOUS is used to indicate clone events.  */
+  if (lp->waitstatus.kind == TARGET_WAITKIND_SPURIOUS)
+    {
+      struct lwp_info *new_lp;
+      new_lp = add_lwp (BUILD_LWP (lp->waitstatus.value.related_pid,
+				   GET_PID (inferior_ptid)));
+      new_lp->cloned = 1;
+      new_lp->stopped = 1;
+
+      lp->waitstatus.kind = TARGET_WAITKIND_IGNORE;
+
+      if (debug_lin_lwp)
+	fprintf_unfiltered (gdb_stdlog,
+			    "LLHE: Got clone event from LWP %ld, resuming\n",
+			    GET_LWP (lp->ptid));
+      ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
+
+      return 1;
+    }
+
+  return 0;
+}
+
 /* Wait for LP to stop.  Returns the wait status, or 0 if the LWP has
    exited.  */
 
@@ -609,9 +650,11 @@
       pid = waitpid (GET_LWP (lp->ptid), &status, __WCLONE);
       if (pid == -1 && errno == ECHILD)
 	{
-	  /* The thread has previously exited.  We need to delete it now
-	     because in the case of NPTL threads, there won't be an
-	     exit event unless it is the main thread.  */
+	  /* The thread has previously exited.  We need to delete it
+	     now because, for some vendor 2.4 kernels with NPTL
+	     support backported, there won't be an exit event unless
+	     it is the main thread.  2.6 kernels will report an exit
+	     event for each thread that exits, as expected.  */
 	  thread_dead = 1;
 	  if (debug_lin_lwp)
 	    fprintf_unfiltered (gdb_stdlog, "WL: %s vanished.\n",
@@ -658,6 +701,17 @@
 
   gdb_assert (WIFSTOPPED (status));
 
+  /* Handle GNU/Linux's extended waitstatus for trace events.  */
+  if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)
+    {
+      if (debug_lin_lwp)
+	fprintf_unfiltered (gdb_stdlog,
+			    "WL: Handling extended status 0x%06x\n",
+			    status);
+      if (lin_lwp_handle_extended (lp, status))
+	return wait_lwp (lp);
+    }
+
   return status;
 }
 
@@ -1097,6 +1151,8 @@
   int status;
   pid_t pid;
 
+  ourstatus->kind = TARGET_WAITKIND_IGNORE;
+
   do
     {
       set_sigint_trap ();	/* Causes SIGINT to be passed on to the
@@ -1143,6 +1199,25 @@
 	  save_errno = EINTR;
 	}
 
+      /* Handle GNU/Linux's extended waitstatus for trace events.  */
+      if (pid != -1 && WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP
+	  && status >> 16 != 0)
+	{
+	  linux_handle_extended_wait (pid, status, ourstatus);
+
+	  /* If we see a clone event, detach the child, and don't
+	     report the event.  It would be nice to offer some way to
+	     switch into a non-thread-db based threaded mode at this
+	     point.  */
+	  if (ourstatus->kind == TARGET_WAITKIND_SPURIOUS)
+	    {
+	      ptrace (PTRACE_DETACH, ourstatus->value.related_pid, 0, 0);
+	      ourstatus->kind = TARGET_WAITKIND_IGNORE;
+	      pid = -1;
+	      save_errno = EINTR;
+	    }
+	}
+
       clear_sigio_trap ();
       clear_sigint_trap ();
     }
@@ -1159,11 +1234,9 @@
       return minus_one_ptid;
     }
 
-  /* Handle GNU/Linux's extended waitstatus for trace events.  */
-  if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)
-    return linux_handle_extended_wait (pid, status, ourstatus);
+  if (ourstatus->kind == TARGET_WAITKIND_IGNORE)
+    store_waitstatus (ourstatus, status);
 
-  store_waitstatus (ourstatus, status);
   return pid_to_ptid (pid);
 }
 
@@ -1371,6 +1444,20 @@
 		}
 	    }
 
+	  /* Handle GNU/Linux's extended waitstatus for trace events.  */
+	  if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)
+	    {
+	      if (debug_lin_lwp)
+		fprintf_unfiltered (gdb_stdlog,
+				    "LLW: Handling extended status 0x%06x\n",
+				    status);
+	      if (lin_lwp_handle_extended (lp, status))
+		{
+		  status = 0;
+		  continue;
+		}
+	    }
+
 	  /* Check if the thread has exited.  */
 	  if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1)
 	    {
@@ -1588,14 +1675,14 @@
   else
     trap_ptid = null_ptid;
 
-  /* Handle GNU/Linux's extended waitstatus for trace events.  */
-  if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP && status >> 16 != 0)
+  if (lp->waitstatus.kind != TARGET_WAITKIND_IGNORE)
     {
-      linux_handle_extended_wait (GET_LWP (lp->ptid), status, ourstatus);
-      return trap_ptid;
+      *ourstatus = lp->waitstatus;
+      lp->waitstatus.kind = TARGET_WAITKIND_IGNORE;
     }
+  else
+    store_waitstatus (ourstatus, status);
 
-  store_waitstatus (ourstatus, status);
   return (threaded ? lp->ptid : pid_to_ptid (GET_LWP (lp->ptid)));
 }
 
@@ -1671,9 +1758,10 @@
 }
 
 static void
-lin_lwp_create_inferior (char *exec_file, char *allargs, char **env)
+lin_lwp_create_inferior (char *exec_file, char *allargs, char **env,
+			 int from_tty)
 {
-  child_ops.to_create_inferior (exec_file, allargs, env);
+  child_ops.to_create_inferior (exec_file, allargs, env, from_tty);
 }
 
 static void
diff --git a/gdb/linespec.c b/gdb/linespec.c
index eedc671..1371f02 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -1842,7 +1842,7 @@
   values.sals[0].section = SYMBOL_BFD_SECTION (msymbol);
   if (funfirstline)
     {
-      values.sals[0].pc += FUNCTION_START_OFFSET;
+      values.sals[0].pc += DEPRECATED_FUNCTION_START_OFFSET;
       values.sals[0].pc = SKIP_PROLOGUE (values.sals[0].pc);
     }
   values.nelts = 1;
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 2680422..e421c9c 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1,5 +1,5 @@
 /* GNU/Linux native-dependent code common to multiple platforms.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -224,7 +224,8 @@
   if (! linux_supports_tracefork ())
     return;
 
-  options = PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK | PTRACE_O_TRACEEXEC;
+  options = PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK | PTRACE_O_TRACEEXEC
+    | PTRACE_O_TRACECLONE;
   if (linux_supports_tracevforkdone ())
     options |= PTRACE_O_TRACEVFORKDONE;
 
@@ -391,11 +392,8 @@
 {
   int event = status >> 16;
 
-  if (event == PTRACE_EVENT_CLONE)
-    internal_error (__FILE__, __LINE__,
-		    "unexpected clone event");
-
-  if (event == PTRACE_EVENT_FORK || event == PTRACE_EVENT_VFORK)
+  if (event == PTRACE_EVENT_FORK || event == PTRACE_EVENT_VFORK
+      || event == PTRACE_EVENT_CLONE)
     {
       unsigned long new_pid;
       int ret;
@@ -406,12 +404,10 @@
       if (! pull_pid_from_list (&stopped_pids, new_pid))
 	{
 	  /* The new child has a pending SIGSTOP.  We can't affect it until it
-	     hits the SIGSTOP, but we're already attached.
-
-	     It won't be a clone (we didn't ask for clones in the event mask)
-	     so we can just call waitpid and wait for the SIGSTOP.  */
+	     hits the SIGSTOP, but we're already attached.  */
 	  do {
-	    ret = waitpid (new_pid, &status, 0);
+	    ret = waitpid (new_pid, &status,
+			   (event == PTRACE_EVENT_CLONE) ? __WCLONE : 0);
 	  } while (ret == -1 && errno == EINTR);
 	  if (ret == -1)
 	    perror_with_name ("waiting for new child");
@@ -423,8 +419,13 @@
 			    "wait returned unexpected status 0x%x", status);
 	}
 
-      ourstatus->kind = (event == PTRACE_EVENT_FORK)
-	? TARGET_WAITKIND_FORKED : TARGET_WAITKIND_VFORKED;
+      if (event == PTRACE_EVENT_FORK)
+	ourstatus->kind = TARGET_WAITKIND_FORKED;
+      else if (event == PTRACE_EVENT_VFORK)
+	ourstatus->kind = TARGET_WAITKIND_VFORKED;
+      else
+	ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
+
       ourstatus->value.related_pid = new_pid;
       return inferior_ptid;
     }
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index 23730bb..74a8286 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -1,5 +1,5 @@
 /* Native debugging support for GNU/Linux (LWP layer).
-   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,6 +18,8 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include "target.h"
+
 /* Structure describing an LWP.  */
 
 struct lwp_info
@@ -52,6 +54,11 @@
   /* Non-zero if we were stepping this LWP.  */
   int step;
 
+  /* If WAITSTATUS->KIND != TARGET_WAITKIND_SPURIOUS, the waitstatus
+     for this LWP's last event.  This may correspond to STATUS above,
+     or to a local variable in lin_lwp_wait.  */
+  struct target_waitstatus waitstatus;
+
   /* Next LWP in list.  */
   struct lwp_info *next;
 };
@@ -60,7 +67,6 @@
    system".  */
 struct mem_attrib;
 struct target_ops;
-struct target_waitstatus;
 
 extern int linux_proc_xfer_memory (CORE_ADDR addr, char *myaddr, int len,
 				   int write, struct mem_attrib *attrib,
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index 7bfd40e..9f99b47 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -620,5 +620,5 @@
 void
 _initialize_core_lynx (void)
 {
-  add_core_fns (&lynx_core_fns);
+  deprecated_add_core_fns (&lynx_core_fns);
 }
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index e5b6b50..1ab5d3b 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -418,6 +418,7 @@
   &exp_descriptor_standard,
   m2_parse,			/* parser */
   m2_error,			/* parser error function */
+  null_post_parser,
   m2_printchar,			/* Print character constant */
   m2_printstr,			/* function to print string constant */
   m2_emit_char,			/* Function to print a single character */
@@ -430,6 +431,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   NULL,				/* Language specific symbol demangler */
+  NULL,				/* Language specific class_name_from_physname */
   {"", "", "", ""},		/* Binary format info */
   {"%loB", "", "o", "B"},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c
index 1cc522c..8ea87ae 100644
--- a/gdb/m32r-tdep.c
+++ b/gdb/m32r-tdep.c
@@ -686,7 +686,7 @@
 
 
 static CORE_ADDR
-m32r_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		      struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
 		      struct value **args, CORE_ADDR sp, int struct_return,
 		      CORE_ADDR struct_addr)
@@ -844,16 +844,6 @@
     return;
 
   id = frame_id_build (base, func);
-
-  /* Check that we're not going round in circles with the same frame
-     ID (but avoid applying the test to sentinel frames which do go
-     round in circles).  Can't use frame_id_eq() as that doesn't yet
-     compare the frame's PC value.  */
-  if (frame_relative_level (next_frame) >= 0
-      && get_frame_type (next_frame) != DUMMY_FRAME
-      && frame_id_eq (get_frame_id (next_frame), id))
-    return;
-
   (*this_id) = id;
 }
 
@@ -940,7 +930,7 @@
   set_gdbarch_push_dummy_call (gdbarch, m32r_push_dummy_call);
   set_gdbarch_store_return_value (gdbarch, m32r_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m32r_extract_struct_value_address);
-  set_gdbarch_use_struct_convention (gdbarch, m32r_use_struct_convention);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, m32r_use_struct_convention);
 
   set_gdbarch_skip_prologue (gdbarch, m32r_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index efe0509..43fce35 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -899,16 +899,6 @@
     return;
 
   id = frame_id_build (base, func);
-#if 0
-  /* Check that we're not going round in circles with the same frame
-     ID (but avoid applying the test to sentinel frames which do go
-     round in circles).  Can't use frame_id_eq() as that doesn't yet
-     compare the frame's PC value.  */
-  if (frame_relative_level (next_frame) >= 0
-      && get_frame_type (next_frame) != DUMMY_FRAME
-      && frame_id_eq (get_frame_id (next_frame), id))
-    return;
-#endif
   (*this_id) = id;
 }
 
@@ -1182,7 +1172,7 @@
 }
 
 static CORE_ADDR
-m68hc11_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                          struct regcache *regcache, CORE_ADDR bp_addr,
                          int nargs, struct value **args, CORE_ADDR sp,
                          int struct_return, CORE_ADDR struct_addr)
@@ -1342,31 +1332,24 @@
     }
 }
 
-/* Should call_function allocate stack space for a struct return?  */
-static int
-m68hc11_use_struct_convention (int gcc_p, struct type *type)
+enum return_value_convention
+m68hc11_return_value (struct gdbarch *gdbarch, struct type *valtype,
+		      struct regcache *regcache, void *readbuf,
+		      const void *writebuf)
 {
-  return (TYPE_CODE (type) == TYPE_CODE_STRUCT
-          || TYPE_CODE (type) == TYPE_CODE_UNION
-          || TYPE_LENGTH (type) > 4);
-}
-
-static int
-m68hc11_return_value_on_stack (struct type *type)
-{
-  return TYPE_LENGTH (type) > 4;
-}
-
-/* Extract from an array REGBUF containing the (raw) register state
-   the address in which a function should return its structure value,
-   as a CORE_ADDR (or an expression that can be used as one).  */
-static CORE_ADDR
-m68hc11_extract_struct_value_address (struct regcache *regcache)
-{
-  char buf[M68HC11_REG_SIZE];
-
-  regcache_cooked_read (regcache, HARD_D_REGNUM, buf);
-  return extract_unsigned_integer (buf, M68HC11_REG_SIZE);
+  if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT
+      || TYPE_CODE (valtype) == TYPE_CODE_UNION
+      || TYPE_CODE (valtype) == TYPE_CODE_ARRAY 
+      || TYPE_LENGTH (valtype) > 4)
+    return RETURN_VALUE_STRUCT_CONVENTION;
+  else
+    {
+      if (readbuf != NULL)
+	m68hc11_extract_return_value (valtype, regcache, readbuf);
+      if (writebuf != NULL)
+	m68hc11_store_return_value (valtype, regcache, writebuf);
+      return RETURN_VALUE_REGISTER_CONVENTION;
+    }
 }
 
 /* Test whether the ELF symbol corresponds to a function using rtc or
@@ -1549,12 +1532,7 @@
 
   set_gdbarch_push_dummy_call (gdbarch, m68hc11_push_dummy_call);
 
-  set_gdbarch_extract_return_value (gdbarch, m68hc11_extract_return_value);
-  set_gdbarch_return_value_on_stack (gdbarch, m68hc11_return_value_on_stack);
-
-  set_gdbarch_store_return_value (gdbarch, m68hc11_store_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68hc11_extract_struct_value_address);
-  set_gdbarch_use_struct_convention (gdbarch, m68hc11_use_struct_convention);
+  set_gdbarch_return_value (gdbarch, m68hc11_return_value);
   set_gdbarch_skip_prologue (gdbarch, m68hc11_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_breakpoint_from_pc (gdbarch, m68hc11_breakpoint_from_pc);
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 7fceb8b..0f81d39 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -1,4 +1,4 @@
-/* Target dependent code for the Motorola 68000 series.
+/* Target-dependent code for the Motorola 68000 series.
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000,
    2001, 2002, 2003, 2004 Free Software Foundation, Inc.
@@ -25,6 +25,7 @@
 #include "frame.h"
 #include "frame-base.h"
 #include "frame-unwind.h"
+#include "floatformat.h"
 #include "symtab.h"
 #include "gdbcore.h"
 #include "value.h"
@@ -64,11 +65,6 @@
 #define BPT_VECTOR 0xf
 #endif
 
-#if !defined (REMOTE_BPT_VECTOR)
-#define REMOTE_BPT_VECTOR 1
-#endif
-
-
 static const unsigned char *
 m68k_local_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
 {
@@ -134,8 +130,92 @@
     return register_names[regnum];
 }
 
-/* Extract from an array REGBUF containing the (raw) register state, a
-   function return value of TYPE, and copy that, in virtual format,
+/* Return nonzero if a value of type TYPE stored in register REGNUM
+   needs any special handling.  */
+
+static int
+m68k_convert_register_p (int regnum, struct type *type)
+{
+  return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FP0_REGNUM + 7);
+}
+
+/* Read a value of type TYPE from register REGNUM in frame FRAME, and
+   return its contents in TO.  */
+
+static void
+m68k_register_to_value (struct frame_info *frame, int regnum,
+			struct type *type, void *to)
+{
+  char from[M68K_MAX_REGISTER_SIZE];
+
+  /* We only support floating-point values.  */
+  if (TYPE_CODE (type) != TYPE_CODE_FLT)
+    {
+      warning ("Cannot convert floating-point register value "
+	       "to non-floating-point type.");
+      return;
+    }
+
+  /* Convert to TYPE.  This should be a no-op if TYPE is equivalent to
+     the extended floating-point format used by the FPU.  */
+  get_frame_register (frame, regnum, from);
+  convert_typed_floating (from, builtin_type_m68881_ext, to, type);
+}
+
+/* Write the contents FROM of a value of type TYPE into register
+   REGNUM in frame FRAME.  */
+
+static void
+m68k_value_to_register (struct frame_info *frame, int regnum,
+			struct type *type, const void *from)
+{
+  char to[M68K_MAX_REGISTER_SIZE];
+
+  /* We only support floating-point values.  */
+  if (TYPE_CODE (type) != TYPE_CODE_FLT)
+    {
+      warning ("Cannot convert non-floating-point type "
+	       "to floating-point register value.");
+      return;
+    }
+
+  /* Convert from TYPE.  This should be a no-op if TYPE is equivalent
+     to the extended floating-point format used by the FPU.  */
+  convert_typed_floating (from, type, to, builtin_type_m68881_ext);
+  put_frame_register (frame, regnum, to);
+}
+
+
+/* There is a fair number of calling conventions that are in somewhat
+   wide use.  The 68000/08/10 don't support an FPU, not even as a
+   coprocessor.  All function return values are stored in %d0/%d1.
+   Structures are returned in a static buffer, a pointer to which is
+   returned in %d0.  This means that functions returning a structure
+   are not re-entrant.  To avoid this problem some systems use a
+   convention where the caller passes a pointer to a buffer in %a1
+   where the return values is to be stored.  This convention is the
+   default, and is implemented in the function m68k_return_value.
+
+   The 68020/030/040/060 do support an FPU, either as a coprocessor
+   (68881/2) or built-in (68040/68060).  That's why System V release 4
+   (SVR4) instroduces a new calling convention specified by the SVR4
+   psABI.  Integer values are returned in %d0/%d1, pointer return
+   values in %a0 and floating values in %fp0.  When calling functions
+   returning a structure the caller should pass a pointer to a buffer
+   for the return value in %a0.  This convention is implemented in the
+   function m68k_svr4_return_value, and by appropriately setting the
+   struct_value_regnum member of `struct gdbarch_tdep'.
+
+   GNU/Linux returns values in the same way as SVR4 does, but uses %a1
+   for passing the structure return value buffer.
+
+   GCC can also generate code where small structures are returned in
+   %d0/%d1 instead of in memory by using -freg-struct-return.  This is
+   the default on NetBSD a.out, OpenBSD and GNU/Linux and several
+   embedded systems.  This convention is implemented by setting the
+   struct_return member of `struct gdbarch_tdep' to reg_struct_return.  */
+
+/* Read a function return value of TYPE from REGCACHE, and copy that
    into VALBUF.  */
 
 static void
@@ -145,13 +225,6 @@
   int len = TYPE_LENGTH (type);
   char buf[M68K_MAX_REGISTER_SIZE];
 
-  if (TYPE_CODE (type) == TYPE_CODE_STRUCT
-      && TYPE_NFIELDS (type) == 1)
-    {
-      m68k_extract_return_value (TYPE_FIELD_TYPE (type, 0), regcache, valbuf);
-      return;
-    }
-
   if (len <= 4)
     {
       regcache_raw_read (regcache, M68K_D0_REGNUM, buf);
@@ -169,8 +242,25 @@
 		    "Cannot extract return value of %d bytes long.", len);
 }
 
-/* Write into the appropriate registers a function return value stored
-   in VALBUF of type TYPE, given in virtual format.  */
+static void
+m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache,
+				void *valbuf)
+{
+  int len = TYPE_LENGTH (type);
+  char buf[M68K_MAX_REGISTER_SIZE];
+
+  if (TYPE_CODE (type) == TYPE_CODE_FLT)
+    {
+      regcache_raw_read (regcache, M68K_FP0_REGNUM, buf);
+      convert_typed_floating (buf, builtin_type_m68881_ext, valbuf, type);
+    }
+  else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4)
+    regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf);
+  else
+    m68k_extract_return_value (type, regcache, valbuf);
+}
+
+/* Write a function return value of TYPE from VALBUF into REGCACHE.  */
 
 static void
 m68k_store_return_value (struct type *type, struct regcache *regcache,
@@ -178,20 +268,13 @@
 {
   int len = TYPE_LENGTH (type);
 
-  if (TYPE_CODE (type) == TYPE_CODE_STRUCT
-      && TYPE_NFIELDS (type) == 1)
-    {
-      m68k_store_return_value (TYPE_FIELD_TYPE (type, 0), regcache, valbuf);
-      return;
-    }
-
   if (len <= 4)
     regcache_raw_write_part (regcache, M68K_D0_REGNUM, 4 - len, len, valbuf);
   else if (len <= 8)
     {
-      regcache_raw_write_part (regcache, M68K_D1_REGNUM, 8 - len,
+      regcache_raw_write_part (regcache, M68K_D0_REGNUM, 8 - len,
 			       len - 4, valbuf);
-      regcache_raw_write (regcache, M68K_D0_REGNUM,
+      regcache_raw_write (regcache, M68K_D1_REGNUM,
 			  (char *) valbuf + (len - 4));
     }
   else
@@ -199,105 +282,135 @@
 		    "Cannot store return value of %d bytes long.", len);
 }
 
-/* Extract from REGCACHE, which contains the (raw) register state, the
-   address in which a function should return its structure value, as a
-   CORE_ADDR.  */
-
-static CORE_ADDR
-m68k_extract_struct_value_address (struct regcache *regcache)
+static void
+m68k_svr4_store_return_value (struct type *type, struct regcache *regcache,
+			      const void *valbuf)
 {
-  char buf[4];
+  int len = TYPE_LENGTH (type);
 
-  regcache_cooked_read (regcache, M68K_D0_REGNUM, buf);
-  return extract_unsigned_integer (buf, 4);
-}
-
-static int
-m68k_use_struct_convention (int gcc_p, struct type *type)
-{
-  enum struct_return struct_return;
-
-  struct_return = gdbarch_tdep (current_gdbarch)->struct_return;
-  return generic_use_struct_convention (struct_return == reg_struct_return,
-					type);
-}
-
-/* A function that tells us whether the function invocation represented
-   by fi does not have a frame on the stack associated with it.  If it
-   does not, FRAMELESS is set to 1, else 0.  */
-
-static int
-m68k_frameless_function_invocation (struct frame_info *fi)
-{
-  if (get_frame_type (fi) == SIGTRAMP_FRAME)
-    return 0;
-  else
-    return legacy_frameless_look_for_prologue (fi);
-}
-
-int
-delta68_in_sigtramp (CORE_ADDR pc, char *name)
-{
-  if (name != NULL)
-    return strcmp (name, "_sigcode") == 0;
-  else
-    return 0;
-}
-
-CORE_ADDR
-delta68_frame_args_address (struct frame_info *frame_info)
-{
-  /* we assume here that the only frameless functions are the system calls
-     or other functions who do not put anything on the stack. */
-  if (get_frame_type (frame_info) == SIGTRAMP_FRAME)
-    return get_frame_base (frame_info) + 12;
-  else if (legacy_frameless_look_for_prologue (frame_info))
+  if (TYPE_CODE (type) == TYPE_CODE_FLT)
     {
-      /* Check for an interrupted system call */
-      if (get_next_frame (frame_info) && (get_frame_type (get_next_frame (frame_info)) == SIGTRAMP_FRAME))
-	return get_frame_base (get_next_frame (frame_info)) + 16;
-      else
-	return get_frame_base (frame_info) + 4;
+      char buf[M68K_MAX_REGISTER_SIZE];
+      convert_typed_floating (valbuf, type, buf, builtin_type_m68881_ext);
+      regcache_raw_write (regcache, M68K_FP0_REGNUM, buf);
+    }
+  else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4)
+    {
+      regcache_raw_write (regcache, M68K_A0_REGNUM, valbuf);
+      regcache_raw_write (regcache, M68K_D0_REGNUM, valbuf);
     }
   else
-    return get_frame_base (frame_info);
+    m68k_store_return_value (type, regcache, valbuf);
 }
 
-CORE_ADDR
-delta68_frame_saved_pc (struct frame_info *frame_info)
+/* Return non-zero if TYPE, which is assumed to be a structure or
+   union type, should be returned in registers for architecture
+   GDBARCH.  */
+
+static int
+m68k_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type)
 {
-  return read_memory_unsigned_integer (delta68_frame_args_address (frame_info)
-				       + 4, 4);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  enum type_code code = TYPE_CODE (type);
+  int len = TYPE_LENGTH (type);
+
+  gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION);
+
+  if (tdep->struct_return == pcc_struct_return)
+    return 0;
+
+  return (len == 1 || len == 2 || len == 4 || len == 8);
 }
 
-int
-delta68_frame_num_args (struct frame_info *fi)
+/* Determine, for architecture GDBARCH, how a return value of TYPE
+   should be returned.  If it is supposed to be returned in registers,
+   and READBUF is non-zero, read the appropriate value from REGCACHE,
+   and copy it into READBUF.  If WRITEBUF is non-zero, write the value
+   from WRITEBUF into REGCACHE.  */
+
+static enum return_value_convention
+m68k_return_value (struct gdbarch *gdbarch, struct type *type,
+		   struct regcache *regcache, void *readbuf,
+		   const void *writebuf)
 {
-  int val;
-  CORE_ADDR pc = DEPRECATED_FRAME_SAVED_PC (fi);
-  int insn = read_memory_unsigned_integer (pc, 2);
-  val = 0;
-  if (insn == 0047757 || insn == 0157374)	/* lea W(sp),sp or addaw #W,sp */
-    val = read_memory_integer (pc + 2, 2);
-  else if ((insn & 0170777) == 0050217	/* addql #N, sp */
-	   || (insn & 0170777) == 0050117)	/* addqw */
+  enum type_code code = TYPE_CODE (type);
+
+  if ((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION)
+      && !m68k_reg_struct_return_p (gdbarch, type))
+    return RETURN_VALUE_STRUCT_CONVENTION;
+
+  /* GCC returns a `long double' in memory.  */
+  if (code == TYPE_CODE_FLT && TYPE_LENGTH (type) == 12)
+    return RETURN_VALUE_STRUCT_CONVENTION;
+
+  if (readbuf)
+    m68k_extract_return_value (type, regcache, readbuf);
+  if (writebuf)
+    m68k_store_return_value (type, regcache, writebuf);
+
+  return RETURN_VALUE_REGISTER_CONVENTION;
+}
+
+static enum return_value_convention
+m68k_svr4_return_value (struct gdbarch *gdbarch, struct type *type,
+			struct regcache *regcache, void *readbuf,
+			const void *writebuf)
+{
+  enum type_code code = TYPE_CODE (type);
+
+  if ((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION)
+      && !m68k_reg_struct_return_p (gdbarch, type))
     {
-      val = (insn >> 9) & 7;
-      if (val == 0)
-	val = 8;
+      /* The System V ABI says that:
+
+	 "A function returning a structure or union also sets %a0 to
+	 the value it finds in %a0.  Thus when the caller receives
+	 control again, the address of the returned object resides in
+	 register %a0."
+
+	 So the ABI guarantees that we can always find the return
+	 value just after the function has returned.  */
+
+      if (readbuf)
+	{
+	  ULONGEST addr;
+
+	  regcache_raw_read_unsigned (regcache, M68K_A0_REGNUM, &addr);
+	  read_memory (addr, readbuf, TYPE_LENGTH (type));
+	}
+
+      return RETURN_VALUE_ABI_RETURNS_ADDRESS;
     }
-  else if (insn == 0157774)	/* addal #WW, sp */
-    val = read_memory_integer (pc + 2, 4);
-  val >>= 2;
-  return val;
+
+  /* This special case is for structures consisting of a single
+     `float' or `double' member.  These structures are returned in
+     %fp0.  For these structures, we call ourselves recursively,
+     changing TYPE into the type of the first member of the structure.
+     Since that should work for all structures that have only one
+     member, we don't bother to check the member's type here.  */
+  if (code == TYPE_CODE_STRUCT && TYPE_NFIELDS (type) == 1)
+    {
+      type = check_typedef (TYPE_FIELD_TYPE (type, 0));
+      return m68k_svr4_return_value (gdbarch, type, regcache,
+				     readbuf, writebuf);
+    }
+
+  if (readbuf)
+    m68k_svr4_extract_return_value (type, regcache, readbuf);
+  if (writebuf)
+    m68k_svr4_store_return_value (type, regcache, writebuf);
+
+  return RETURN_VALUE_REGISTER_CONVENTION;
 }
+
 
 static CORE_ADDR
-m68k_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		      struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
 		      struct value **args, CORE_ADDR sp, int struct_return,
 		      CORE_ADDR struct_addr)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   char buf[4];
   int i;
 
@@ -326,7 +439,7 @@
   if (struct_return)
     {
       store_unsigned_integer (buf, 4, struct_addr);
-      regcache_cooked_write (regcache, M68K_A1_REGNUM, buf);
+      regcache_cooked_write (regcache, tdep->struct_value_regnum, buf);
     }
 
   /* Store return address.  */
@@ -766,85 +879,6 @@
   return &m68k_frame_unwind;
 }
 
-/* Signal trampolines.  */
-
-static struct m68k_frame_cache *
-m68k_sigtramp_frame_cache (struct frame_info *next_frame, void **this_cache)
-{
-  struct m68k_frame_cache *cache;
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-  struct m68k_sigtramp_info info;
-  char buf[4];
-  int i;
-
-  if (*this_cache)
-    return *this_cache;
-
-  cache = m68k_alloc_frame_cache ();
-
-  frame_unwind_register (next_frame, M68K_SP_REGNUM, buf);
-  cache->base = extract_unsigned_integer (buf, 4) - 4;
-
-  info = tdep->get_sigtramp_info (next_frame);
-
-  for (i = 0; i < M68K_NUM_REGS; i++)
-    if (info.sc_reg_offset[i] != -1)
-      cache->saved_regs[i] = info.sigcontext_addr + info.sc_reg_offset[i];
-
-  *this_cache = cache;
-  return cache;
-}
-
-static void
-m68k_sigtramp_frame_this_id (struct frame_info *next_frame, void **this_cache,
-			     struct frame_id *this_id)
-{
-  struct m68k_frame_cache *cache =
-    m68k_sigtramp_frame_cache (next_frame, this_cache);
-
-  /* See the end of m68k_push_dummy_call.  */
-  *this_id = frame_id_build (cache->base + 8, frame_pc_unwind (next_frame));
-}
-
-static void
-m68k_sigtramp_frame_prev_register (struct frame_info *next_frame,
-				   void **this_cache,
-				   int regnum, int *optimizedp,
-				   enum lval_type *lvalp, CORE_ADDR *addrp,
-				   int *realnump, void *valuep)
-{
-  /* Make sure we've initialized the cache.  */
-  m68k_sigtramp_frame_cache (next_frame, this_cache);
-
-  m68k_frame_prev_register (next_frame, this_cache, regnum,
-			    optimizedp, lvalp, addrp, realnump, valuep);
-}
-
-static const struct frame_unwind m68k_sigtramp_frame_unwind =
-{
-  SIGTRAMP_FRAME,
-  m68k_sigtramp_frame_this_id,
-  m68k_sigtramp_frame_prev_register
-};
-
-static const struct frame_unwind *
-m68k_sigtramp_frame_sniffer (struct frame_info *next_frame)
-{
-  CORE_ADDR pc = frame_pc_unwind (next_frame);
-  char *name;
-
-  /* We shouldn't even bother to try if the OSABI didn't register
-     a get_sigtramp_info handler.  */
-  if (!gdbarch_tdep (current_gdbarch)->get_sigtramp_info)
-    return NULL;
-
-  find_pc_partial_function (pc, &name, NULL, NULL);
-  if (DEPRECATED_PC_IN_SIGTRAMP (pc, name))
-    return &m68k_sigtramp_frame_unwind;
-
-  return NULL;
-}
-
 static CORE_ADDR
 m68k_frame_base_address (struct frame_info *next_frame, void **this_cache)
 {
@@ -1036,6 +1070,22 @@
   *pc = extract_unsigned_integer (buf, TARGET_PTR_BIT / TARGET_CHAR_BIT);
   return 1;
 }
+
+
+/* System V Release 4 (SVR4).  */
+
+void
+m68k_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  /* SVR4 uses a different calling convention.  */
+  set_gdbarch_return_value (gdbarch, m68k_svr4_return_value);
+
+  /* SVR4 uses %a0 instead of %a1.  */
+  tdep->struct_value_regnum = M68K_A0_REGNUM;
+}
+
 
 /* Function: m68k_gdbarch_init
    Initializer function for the m68k gdbarch vector.
@@ -1063,17 +1113,10 @@
 
   /* Stack grows down. */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  set_gdbarch_parm_boundary (gdbarch, 32);
 
   set_gdbarch_believe_pcc_promotion (gdbarch, 1);
   set_gdbarch_decr_pc_after_break (gdbarch, 2);
 
-  set_gdbarch_extract_return_value (gdbarch, m68k_extract_return_value);
-  set_gdbarch_store_return_value (gdbarch, m68k_store_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68k_extract_struct_value_address);
-  set_gdbarch_use_struct_convention (gdbarch, m68k_use_struct_convention);
-
-  set_gdbarch_deprecated_frameless_function_invocation (gdbarch, m68k_frameless_function_invocation);
   set_gdbarch_frame_args_skip (gdbarch, 8);
 
   set_gdbarch_register_type (gdbarch, m68k_register_type);
@@ -1084,8 +1127,12 @@
   set_gdbarch_pc_regnum (gdbarch, M68K_PC_REGNUM);
   set_gdbarch_ps_regnum (gdbarch, M68K_PS_REGNUM);
   set_gdbarch_fp0_regnum (gdbarch, M68K_FP0_REGNUM);
+  set_gdbarch_convert_register_p (gdbarch, m68k_convert_register_p);
+  set_gdbarch_register_to_value (gdbarch,  m68k_register_to_value);
+  set_gdbarch_value_to_register (gdbarch, m68k_value_to_register);
 
   set_gdbarch_push_dummy_call (gdbarch, m68k_push_dummy_call);
+  set_gdbarch_return_value (gdbarch, m68k_return_value);
 
   /* Disassembler.  */
   set_gdbarch_print_insn (gdbarch, print_insn_m68k);
@@ -1096,8 +1143,8 @@
 #else
   tdep->jb_pc = -1;
 #endif
-  tdep->get_sigtramp_info = NULL;
-  tdep->struct_return = pcc_struct_return;
+  tdep->struct_value_regnum = M68K_A1_REGNUM;
+  tdep->struct_return = reg_struct_return;
 
   /* Frame unwinder.  */
   set_gdbarch_unwind_dummy_id (gdbarch, m68k_unwind_dummy_id);
@@ -1117,7 +1164,6 @@
   if (tdep->jb_pc >= 0)
     set_gdbarch_get_longjmp_target (gdbarch, m68k_get_longjmp_target);
 
-  frame_unwind_append_sniffer (gdbarch, m68k_sigtramp_frame_sniffer);
   frame_unwind_append_sniffer (gdbarch, m68k_frame_sniffer);
 
   return gdbarch;
diff --git a/gdb/m68k-tdep.h b/gdb/m68k-tdep.h
index 702e4fc..27a7feb 100644
--- a/gdb/m68k-tdep.h
+++ b/gdb/m68k-tdep.h
@@ -1,6 +1,7 @@
-/* Common target dependent code for the Motorola 68000 series.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, 2003
-   Free Software Foundation, Inc.
+/* Target-dependent code for the Motorola 68000 series.
+
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000,
+   2001, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,43 +25,33 @@
 
 struct frame_info;
 
-/* Register numbers of various important registers.
-   Note that some of these values are "real" register numbers,
-   and correspond to the general registers of the machine,
-   and some are "phony" register numbers which are too large
-   to be actual register numbers as far as the user is concerned
-   but do serve to get the desired values when passed to read_register.  */
+/* Register numbers of various important registers.  */
 
-enum
+enum m68k_regnum
 {
   M68K_D0_REGNUM = 0,
   M68K_D1_REGNUM = 1,
+  M68K_D2_REGNUM = 2,
+  M68K_D7_REGNUM = 7,
   M68K_A0_REGNUM = 8,
   M68K_A1_REGNUM = 9,
-  M68K_FP_REGNUM = 14,		/* Contains address of executing stack frame */
-  M68K_SP_REGNUM = 15,		/* Contains address of top of stack */
-  M68K_PS_REGNUM = 16,		/* Contains processor status */
-  M68K_PC_REGNUM = 17,		/* Contains program counter */
-  M68K_FP0_REGNUM = 18,		/* Floating point register 0 */
-  M68K_FPC_REGNUM = 26,		/* 68881 control register */
-  M68K_FPS_REGNUM = 27,		/* 68881 status register */
+  M68K_A2_REGNUM = 10,
+  M68K_FP_REGNUM = 14,		/* Address of executing stack frame.  */
+  M68K_SP_REGNUM = 15,		/* Address of top of stack.  */
+  M68K_PS_REGNUM = 16,		/* Processor status.  */
+  M68K_PC_REGNUM = 17,		/* Program counter.  */
+  M68K_FP0_REGNUM = 18,		/* Floating point register 0.  */
+  M68K_FPC_REGNUM = 26,		/* 68881 control register.  */
+  M68K_FPS_REGNUM = 27,		/* 68881 status register.  */
   M68K_FPI_REGNUM = 28
 };
 
-#define M68K_NUM_REGS (M68K_FPI_REGNUM + 1)
+/* Number of machine registers.  */
+#define M68K_NUM_REGS	(M68K_FPI_REGNUM + 1)
 
 /* Size of the largest register.  */
 #define M68K_MAX_REGISTER_SIZE	12
 
-struct m68k_sigtramp_info
-{
-  /* Address of sigcontext.  */
-  CORE_ADDR sigcontext_addr;
-
-  /* Offset of registers in `struct sigcontext'.  */
-  int *sc_reg_offset;
-};
-
 /* Convention for returning structures.  */
 
 enum struct_return
@@ -70,6 +61,7 @@
 };
 
 /* Target-dependent structure in gdbarch.  */
+
 struct gdbarch_tdep
 {
   /* Offset to PC value in the jump buffer.  If this is negative,
@@ -78,11 +70,20 @@
   /* The size of each entry in the jump buffer.  */
   size_t jb_elt_size;
 
-  /* Get info about sigtramp.  */
-  struct m68k_sigtramp_info (*get_sigtramp_info) (struct frame_info *);
+  /* Register in which the address to store a structure value is
+     passed to a function.  */
+  int struct_value_regnum;
 
   /* Convention for returning structures.  */
   enum struct_return struct_return;
 };
 
-#endif /* M68K_TDEP_H */
+/* Initialize a SVR4 architecture variant.  */
+extern void m68k_svr4_init_abi (struct gdbarch_info, struct gdbarch *);
+
+
+/* Functions exported from m68kbsd-tdep.c.  */
+
+extern int m68kbsd_fpreg_offset (int regnum);
+
+#endif /* m68k-tdep.h */
diff --git a/gdb/m68kbsd-nat.c b/gdb/m68kbsd-nat.c
new file mode 100644
index 0000000..285c149
--- /dev/null
+++ b/gdb/m68kbsd-nat.c
@@ -0,0 +1,228 @@
+/* Native-dependent code for Motorola 68000 BSD's.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "gdbcore.h"
+#include "inferior.h"
+#include "regcache.h"
+
+#include "gdb_assert.h"
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+
+#include "m68k-tdep.h"
+
+static int
+m68kbsd_gregset_supplies_p (int regnum)
+{
+  return (regnum >= M68K_D0_REGNUM && regnum <= M68K_PC_REGNUM);
+}
+
+static int
+m68kbsd_fpregset_supplies_p (int regnum)
+{
+  return (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FPI_REGNUM);
+}
+
+/* Supply the general-purpose registers stored in GREGS to REGCACHE.  */
+
+static void
+m68kbsd_supply_gregset (struct regcache *regcache, const void *gregs)
+{
+  const char *regs = gregs;
+  int regnum;
+
+  for (regnum = M68K_D0_REGNUM; regnum <= M68K_PC_REGNUM; regnum++)
+    regcache_raw_supply (regcache, regnum, regs + regnum * 4);
+}
+
+/* Supply the floating-point registers stored in FPREGS to REGCACHE.  */
+
+static void
+m68kbsd_supply_fpregset (struct regcache *regcache, const void *fpregs)
+{
+  const char *regs = fpregs;
+  int regnum;
+
+  for (regnum = M68K_FP0_REGNUM; regnum <= M68K_FPI_REGNUM; regnum++)
+    regcache_raw_supply (regcache, regnum,
+			 regs + m68kbsd_fpreg_offset (regnum));
+}
+
+/* Collect the general-purpose registers from REGCACHE and store them
+   in GREGS.  */
+
+static void
+m68kbsd_collect_gregset (const struct regcache *regcache,
+			 void *gregs, int regnum)
+{
+  char *regs = gregs;
+  int i;
+
+  for (i = M68K_D0_REGNUM; i <= M68K_PC_REGNUM; i++)
+    {
+      if (regnum == -1 || regnum == i)
+	regcache_raw_collect (regcache, i, regs + i * 4);
+    }
+}
+
+/* Collect the floating-point registers from REGCACHE and store them
+   in FPREGS.  */
+
+static void
+m68kbsd_collect_fpregset (struct regcache *regcache,
+			  void *fpregs, int regnum)
+{
+  char *regs = fpregs;
+  int i;
+
+  for (i = M68K_FP0_REGNUM; i <= M68K_FPI_REGNUM; i++)
+    {
+      if (regnum == -1 || regnum == i)
+	regcache_raw_collect (regcache, i, regs + m68kbsd_fpreg_offset (i));
+    }
+}
+
+
+/* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
+   for all registers (including the floating-point registers).  */
+
+void
+fetch_inferior_registers (int regnum)
+{
+  if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum))
+    {
+      struct reg regs;
+
+      if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+		  (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+	perror_with_name ("Couldn't get registers");
+
+      m68kbsd_supply_gregset (current_regcache, &regs);
+    }
+
+  if (regnum == -1 || m68kbsd_fpregset_supplies_p (regnum))
+    {
+      struct fpreg fpregs;
+
+      if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+		  (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+	perror_with_name ("Couldn't get floating point status");
+
+      m68kbsd_supply_fpregset (current_regcache, &fpregs);
+    }
+}
+
+/* Store register REGNUM back into the inferior.  If REGNUM is -1, do
+   this for all registers (including the floating-point registers).  */
+
+void
+store_inferior_registers (int regnum)
+{
+  if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum))
+    {
+      struct reg regs;
+
+      if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+                  (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+        perror_with_name ("Couldn't get registers");
+
+      m68kbsd_collect_gregset (current_regcache, &regs, regnum);
+
+      if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+	          (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+        perror_with_name ("Couldn't write registers");
+    }
+
+  if (regnum == -1 || m68kbsd_fpregset_supplies_p (regnum))
+    {
+      struct fpreg fpregs;
+
+      if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
+		  (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+	perror_with_name ("Couldn't get floating point status");
+
+      m68kbsd_collect_fpregset (current_regcache, &fpregs, regnum);
+
+      if (ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
+		  (PTRACE_ARG3_TYPE) &fpregs, 0) == -1)
+	perror_with_name ("Couldn't write floating point status");
+    }
+}
+
+
+/* Support for debugging kernel virtual memory images.  */
+
+#include <sys/types.h>
+#include <machine/pcb.h>
+
+#include "bsd-kvm.h"
+
+/* OpenBSD doesn't have these.  */
+#ifndef PCB_REGS_FP
+#define PCB_REGS_FP 10
+#endif
+#ifndef PCB_REGS_SP
+#define PCB_REGS_SP 11
+#endif
+
+static int
+m68kbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
+{
+  int regnum, tmp;
+  int i = 0;
+
+  /* The following is true for NetBSD 1.6.2:
+
+     The pcb contains %d2...%d7, %a2...%a7 and %ps.  This accounts for
+     all callee-saved registers.  From this information we reconstruct
+     the register state as it would look when we just returned from
+     cpu_switch().  */
+
+  /* The stack pointer shouldn't be zero.  */
+  if (pcb->pcb_regs[PCB_REGS_SP] == 0)
+    return 0;
+
+  for (regnum = M68K_D2_REGNUM; regnum <= M68K_D7_REGNUM; regnum++)
+    regcache_raw_supply (regcache, regnum, &pcb->pcb_regs[i++]);
+  for (regnum = M68K_A2_REGNUM; regnum <= M68K_SP_REGNUM; regnum++)
+    regcache_raw_supply (regcache, regnum, &pcb->pcb_regs[i++]);
+
+  tmp = pcb->pcb_ps & 0xffff;
+  regcache_raw_supply (regcache, M68K_PS_REGNUM, &tmp);
+
+  read_memory (pcb->pcb_regs[PCB_REGS_FP] + 4, (char *) &tmp, sizeof tmp);
+  regcache_raw_supply (regcache, M68K_PC_REGNUM, &tmp);
+
+  return 1;
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_m68kbsd_nat (void);
+
+void
+_initialize_m68kbsd_nat (void)
+{
+  /* Support debugging kernel virtual memory images.  */
+  bsd_kvm_add_target (m68kbsd_supply_pcb);
+}
diff --git a/gdb/m68kbsd-tdep.c b/gdb/m68kbsd-tdep.c
new file mode 100644
index 0000000..4060668
--- /dev/null
+++ b/gdb/m68kbsd-tdep.c
@@ -0,0 +1,228 @@
+/* Target-dependent code for Motorola 68000 BSD's.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "arch-utils.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
+
+#include "gdb_assert.h"
+#include "gdb_string.h"
+
+#include "m68k-tdep.h"
+#include "solib-svr4.h"
+
+/* Core file support.  */
+
+/* Sizeof `struct reg' in <machine/reg.h>.  */
+#define M68KBSD_SIZEOF_GREGS	(18 * 4)
+
+/* Sizeof `struct fpreg' in <machine/reg.h.  */
+#define M68KBSD_SIZEOF_FPREGS	(((8 * 3) + 3) * 4)
+
+int
+m68kbsd_fpreg_offset (int regnum)
+{
+  if (regnum >= M68K_FPC_REGNUM)
+    return 8 * 12 + (regnum - M68K_FPC_REGNUM) * 4;
+
+  return (regnum - M68K_FP0_REGNUM) * 12;
+}
+
+/* Supply register REGNUM from the buffer specified by FPREGS and LEN
+   in the floating-point register set REGSET to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+static void
+m68kbsd_supply_fpregset (const struct regset *regset,
+			 struct regcache *regcache,
+			 int regnum, const void *fpregs, size_t len)
+{
+  const char *regs = fpregs;
+  int i;
+
+  gdb_assert (len >= M68KBSD_SIZEOF_FPREGS);
+
+  for (i = M68K_FP0_REGNUM; i <= M68K_PC_REGNUM; i++)
+    {
+      if (regnum == i || regnum == -1)
+	regcache_raw_supply (regcache, i, regs + m68kbsd_fpreg_offset (i));
+    }
+}
+
+/* Supply register REGNUM from the buffer specified by GREGS and LEN
+   in the general-purpose register set REGSET to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+static void
+m68kbsd_supply_gregset (const struct regset *regset,
+			struct regcache *regcache,
+			int regnum, const void *gregs, size_t len)
+{
+  const char *regs = gregs;
+  int i;
+
+  gdb_assert (len >= M68KBSD_SIZEOF_GREGS);
+
+  for (i = M68K_D0_REGNUM; i <= M68K_PC_REGNUM; i++)
+    {
+      if (regnum == i || regnum == -1)
+	regcache_raw_supply (regcache, i, regs + i * 4);
+    }
+
+  if (len >= M68KBSD_SIZEOF_GREGS + M68KBSD_SIZEOF_FPREGS)
+    {
+      regs += M68KBSD_SIZEOF_GREGS;
+      len -= M68KBSD_SIZEOF_GREGS;
+      m68kbsd_supply_fpregset (regset, regcache, regnum, regs, len);
+    }
+}
+
+/* Motorola 68000 register sets.  */
+
+static struct regset m68kbsd_gregset =
+{
+  NULL,
+  m68kbsd_supply_gregset
+};
+
+static struct regset m68kbsd_fpregset =
+{
+  NULL,
+  m68kbsd_supply_fpregset
+};
+
+/* Return the appropriate register set for the core section identified
+   by SECT_NAME and SECT_SIZE.  */
+
+static const struct regset *
+m68kbsd_regset_from_core_section (struct gdbarch *gdbarch,
+				  const char *sect_name, size_t sect_size)
+{
+  if (strcmp (sect_name, ".reg") == 0 && sect_size >= M68KBSD_SIZEOF_GREGS)
+    return &m68kbsd_gregset;
+
+  if (strcmp (sect_name, ".reg2") == 0 && sect_size >= M68KBSD_SIZEOF_FPREGS)
+    return &m68kbsd_fpregset;
+
+  return NULL;
+}
+
+
+/* Support for shared libraries.  */
+
+/* Return non-zero if we are in a shared library trampoline code stub.  */
+
+int
+m68kbsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+  return (name && !strcmp (name, "_DYNAMIC"));
+}
+
+
+static void
+m68kbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  tdep->jb_pc = 5;
+  tdep->jb_elt_size = 4;
+
+  set_gdbarch_regset_from_core_section
+    (gdbarch, m68kbsd_regset_from_core_section);
+}
+
+/* OpenBSD and NetBSD a.out.  */
+
+static void
+m68kbsd_aout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  m68kbsd_init_abi (info, gdbarch);
+
+  tdep->struct_return = reg_struct_return;
+
+  /* Assume SunOS-style shared libraries.  */
+  set_gdbarch_in_solib_call_trampoline
+    (gdbarch, m68kbsd_aout_in_solib_call_trampoline);
+}
+
+/* NetBSD ELF.  */
+
+static void
+m68kbsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  m68kbsd_init_abi (info, gdbarch);
+
+  /* NetBSD ELF uses the SVR4 ABI.  */
+  m68k_svr4_init_abi (info, gdbarch);
+  tdep->struct_return = pcc_struct_return;
+
+  /* NetBSD ELF uses SVR4-style shared libraries.  */
+  set_gdbarch_in_solib_call_trampoline
+    (gdbarch, generic_in_solib_call_trampoline);
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+}
+
+
+static enum gdb_osabi
+m68kbsd_aout_osabi_sniffer (bfd *abfd)
+{
+  if (strcmp (bfd_get_target (abfd), "a.out-m68k-netbsd") == 0
+      || strcmp (bfd_get_target (abfd), "a.out-m68k4k-netbsd") == 0)
+    return GDB_OSABI_NETBSD_AOUT;
+
+  return GDB_OSABI_UNKNOWN;
+}
+
+static enum gdb_osabi
+m68kbsd_core_osabi_sniffer (bfd *abfd)
+{
+  if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
+    return GDB_OSABI_NETBSD_AOUT;
+
+  return GDB_OSABI_UNKNOWN;
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_m68kbsd_tdep (void);
+
+void
+_initialize_m68kbsd_tdep (void)
+{
+  gdbarch_register_osabi_sniffer (bfd_arch_m68k, bfd_target_aout_flavour,
+				  m68kbsd_aout_osabi_sniffer);
+
+  /* BFD doesn't set a flavour for NetBSD style a.out core files.  */
+  gdbarch_register_osabi_sniffer (bfd_arch_m68k, bfd_target_unknown_flavour,
+				  m68kbsd_core_osabi_sniffer);
+
+  gdbarch_register_osabi (bfd_arch_m68k, 0, GDB_OSABI_NETBSD_AOUT,
+			  m68kbsd_aout_init_abi);
+  gdbarch_register_osabi (bfd_arch_m68k, 0, GDB_OSABI_NETBSD_ELF,
+			  m68kbsd_elf_init_abi);
+}
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index 1407040..d90d8f8 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -617,5 +617,5 @@
 void
 _initialize_m68k_linux_nat (void)
 {
-  add_core_fns (&linux_elf_core_fns);
+  deprecated_add_core_fns (&linux_elf_core_fns);
 }
diff --git a/gdb/m68klinux-tdep.c b/gdb/m68klinux-tdep.c
index 1091951..0b84483 100644
--- a/gdb/m68klinux-tdep.c
+++ b/gdb/m68klinux-tdep.c
@@ -1,7 +1,7 @@
 /* Motorola m68k target-dependent support for GNU/Linux.
 
-   Copyright 1996, 1998, 2000, 2001, 2002, 2003 Free Software Foundation,
-   Inc.
+   Copyright 1996, 1998, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -33,6 +33,8 @@
 #include "objfiles.h"
 #include "symtab.h"
 #include "m68k-tdep.h"
+#include "trad-frame.h"
+#include "frame-unwind.h"
 
 /* Offsets (in target ints) into jmp_buf.  */
 
@@ -160,12 +162,21 @@
 
 /* Get info about saved registers in sigtramp.  */
 
-static struct m68k_sigtramp_info
+struct m68k_linux_sigtramp_info
+{
+  /* Address of sigcontext.  */
+  CORE_ADDR sigcontext_addr;
+
+  /* Offset of registers in `struct sigcontext'.  */
+  int *sc_reg_offset;
+};
+
+static struct m68k_linux_sigtramp_info
 m68k_linux_get_sigtramp_info (struct frame_info *next_frame)
 {
   CORE_ADDR sp;
   char buf[4];
-  struct m68k_sigtramp_info info;
+  struct m68k_linux_sigtramp_info info;
 
   frame_unwind_register (next_frame, M68K_SP_REGNUM, buf);
   sp = extract_unsigned_integer (buf, 4);
@@ -180,106 +191,88 @@
   return info;
 }
 
-/* Extract from an array REGBUF containing the (raw) register state, a
-   function return value of TYPE, and copy that, in virtual format,
-   into VALBUF.  */
+/* Signal trampolines.  */
 
-static void
-m68k_linux_extract_return_value (struct type *type, struct regcache *regcache,
-				 void *valbuf)
+static struct trad_frame_cache *
+m68k_linux_sigtramp_frame_cache (struct frame_info *next_frame,
+				 void **this_cache)
 {
-  int len = TYPE_LENGTH (type);
-  char buf[M68K_MAX_REGISTER_SIZE];
-
-  if (TYPE_CODE (type) == TYPE_CODE_STRUCT
-      && TYPE_NFIELDS (type) == 1)
-    {
-      m68k_linux_extract_return_value (TYPE_FIELD_TYPE (type, 0), regcache,
-				       valbuf);
-      return;
-    }
-
-  if (TYPE_CODE (type) == TYPE_CODE_FLT)
-    {
-      regcache_raw_read (regcache, M68K_FP0_REGNUM, buf);
-      convert_typed_floating (buf, builtin_type_m68881_ext, valbuf, type);
-    }
-  else if (TYPE_CODE (type) == TYPE_CODE_PTR)
-    regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf);
-  else
-    {
-      if (len <= 4)
-	{
-	  regcache_raw_read (regcache, M68K_D0_REGNUM, buf);
-	  memcpy (valbuf, buf + (4 - len), len);
-	}
-      else if (len <= 8)
-	{
-	  regcache_raw_read (regcache, M68K_D0_REGNUM, buf);
-	  memcpy (valbuf, buf + (8 - len), len - 4);
-	  regcache_raw_read (regcache, M68K_D1_REGNUM,
-			     (char *) valbuf + (len - 4));
-	}
-      else
-	internal_error (__FILE__, __LINE__,
-			"Cannot extract return value of %d bytes long.", len);
-    }
-}
-
-/* Write into the appropriate registers a function return value stored
-   in VALBUF of type TYPE, given in virtual format.  */
-
-static void
-m68k_linux_store_return_value (struct type *type, struct regcache *regcache,
-			       const void *valbuf)
-{
-  int len = TYPE_LENGTH (type);
-
-  if (TYPE_CODE (type) == TYPE_CODE_STRUCT
-      && TYPE_NFIELDS (type) == 1)
-    {
-      m68k_linux_store_return_value (TYPE_FIELD_TYPE (type, 0), regcache,
-				     valbuf);
-      return;
-    }
-
-  if (TYPE_CODE (type) == TYPE_CODE_FLT)
-    {
-      char buf[M68K_MAX_REGISTER_SIZE];
-      convert_typed_floating (valbuf, type, buf, builtin_type_m68881_ext);
-      regcache_raw_write (regcache, M68K_FP0_REGNUM, buf);
-    }
-  else if (TYPE_CODE (type) == TYPE_CODE_PTR)
-    regcache_raw_write (regcache, M68K_A0_REGNUM, valbuf);
-  else
-    {
-      if (len <= 4)
-	regcache_raw_write_part (regcache, M68K_D0_REGNUM,
-				 4 - len, len, valbuf);
-      else if (len <= 8)
-	{
-	  regcache_raw_write_part (regcache, M68K_D1_REGNUM, 8 - len,
-				   len - 4, valbuf);
-	  regcache_raw_write (regcache, M68K_D0_REGNUM,
-			      (char *) valbuf + (len - 4));
-	}
-      else
-	internal_error (__FILE__, __LINE__,
-			"Cannot store return value of %d bytes long.", len);
-    }
-}
-
-/* Extract from an array REGBUF containing the (raw) register state
-   the address in which a function should return its structure value,
-   as a CORE_ADDR.  */
-
-static CORE_ADDR
-m68k_linux_extract_struct_value_address (struct regcache *regcache)
-{
+  struct frame_id this_id;
+  struct trad_frame_cache *cache;
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  struct m68k_linux_sigtramp_info info;
   char buf[4];
+  int i;
 
-  regcache_cooked_read (regcache, M68K_A0_REGNUM, buf);
-  return extract_unsigned_integer (buf, 4);
+  if (*this_cache)
+    return *this_cache;
+
+  cache = trad_frame_cache_zalloc (next_frame);
+
+  /* FIXME: cagney/2004-05-01: This is is long standing broken code.
+     The frame ID's code address should be the start-address of the
+     signal trampoline and not the current PC within that
+     trampoline.  */
+  frame_unwind_register (next_frame, M68K_SP_REGNUM, buf);
+  /* See the end of m68k_push_dummy_call.  */
+  this_id = frame_id_build (extract_unsigned_integer (buf, 4) - 4 + 8,
+			    frame_pc_unwind (next_frame));
+  trad_frame_set_id (cache, this_id);
+
+  info = m68k_linux_get_sigtramp_info (next_frame);
+
+  for (i = 0; i < M68K_NUM_REGS; i++)
+    if (info.sc_reg_offset[i] != -1)
+      trad_frame_set_reg_addr (cache, i,
+			       info.sigcontext_addr + info.sc_reg_offset[i]);
+
+  *this_cache = cache;
+  return cache;
+}
+
+static void
+m68k_linux_sigtramp_frame_this_id (struct frame_info *next_frame,
+				   void **this_cache,
+				   struct frame_id *this_id)
+{
+  struct trad_frame_cache *cache =
+    m68k_linux_sigtramp_frame_cache (next_frame, this_cache);
+  trad_frame_get_id (cache, this_id);
+}
+
+static void
+m68k_linux_sigtramp_frame_prev_register (struct frame_info *next_frame,
+					 void **this_cache,
+					 int regnum, int *optimizedp,
+					 enum lval_type *lvalp,
+					 CORE_ADDR *addrp,
+					 int *realnump, void *valuep)
+{
+  /* Make sure we've initialized the cache.  */
+  struct trad_frame_cache *cache =
+    m68k_linux_sigtramp_frame_cache (next_frame, this_cache);
+  trad_frame_get_register (cache, next_frame, regnum, optimizedp, lvalp,
+			   addrp, realnump, valuep);
+}
+
+static const struct frame_unwind m68k_linux_sigtramp_frame_unwind =
+{
+  SIGTRAMP_FRAME,
+  m68k_linux_sigtramp_frame_this_id,
+  m68k_linux_sigtramp_frame_prev_register
+};
+
+static const struct frame_unwind *
+m68k_linux_sigtramp_frame_sniffer (struct frame_info *next_frame)
+{
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
+  if (m68k_linux_pc_in_sigtramp (pc, name))
+    return &m68k_linux_sigtramp_frame_unwind;
+
+  return NULL;
 }
 
 static void
@@ -289,14 +282,17 @@
 
   tdep->jb_pc = M68K_LINUX_JB_PC;
   tdep->jb_elt_size = M68K_LINUX_JB_ELEMENT_SIZE;
-  tdep->get_sigtramp_info = m68k_linux_get_sigtramp_info;
+
+  /* GNU/Linux uses a calling convention that's similar to SVR4.  It
+     returns integer values in %d0/%di, pointer values in %a0 and
+     floating values in %fp0, just like SVR4, but uses %a1 to pass the
+     address to store a structure value.  It also returns small
+     structures in registers instead of memory.  */
+  m68k_svr4_init_abi (info, gdbarch);
+  tdep->struct_value_regnum = M68K_A1_REGNUM;
   tdep->struct_return = reg_struct_return;
 
-  set_gdbarch_extract_return_value (gdbarch, m68k_linux_extract_return_value);
-  set_gdbarch_store_return_value (gdbarch, m68k_linux_store_return_value);
-  set_gdbarch_deprecated_extract_struct_value_address (gdbarch, m68k_linux_extract_struct_value_address);
-
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, m68k_linux_pc_in_sigtramp);
+  frame_unwind_append_sniffer (gdbarch, m68k_linux_sigtramp_frame_sniffer);
 
   /* Shared library handling.  */
   set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
diff --git a/gdb/m68knbsd-nat.c b/gdb/m68knbsd-nat.c
deleted file mode 100644
index 4617243..0000000
--- a/gdb/m68knbsd-nat.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Native-dependent code for Motorola m68k's running NetBSD, for GDB.
-   Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001
-   Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include "defs.h"
-#include <sys/types.h>
-#include <sys/ptrace.h>
-#include <machine/reg.h>
-#include <machine/frame.h>
-#include "inferior.h"
-#include "gdbcore.h"
-#include "regcache.h"
-
-void
-fetch_inferior_registers (int regno)
-{
-  struct reg inferior_registers;
-  struct fpreg inferior_fp_registers;
-
-  ptrace (PT_GETREGS, PIDGET (inferior_ptid),
-	  (PTRACE_ARG3_TYPE) & inferior_registers, 0);
-  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (0)], &inferior_registers,
-	  sizeof (inferior_registers));
-
-  ptrace (PT_GETFPREGS, PIDGET (inferior_ptid),
-	  (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
-  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers,
-	  sizeof (inferior_fp_registers));
-
-  deprecated_registers_fetched ();
-}
-
-void
-store_inferior_registers (int regno)
-{
-  struct reg inferior_registers;
-  struct fpreg inferior_fp_registers;
-
-  memcpy (&inferior_registers, &deprecated_registers[DEPRECATED_REGISTER_BYTE (0)],
-	  sizeof (inferior_registers));
-  ptrace (PT_SETREGS, PIDGET (inferior_ptid),
-	  (PTRACE_ARG3_TYPE) & inferior_registers, 0);
-
-  memcpy (&inferior_fp_registers, &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	  sizeof (inferior_fp_registers));
-  ptrace (PT_SETFPREGS, PIDGET (inferior_ptid),
-	  (PTRACE_ARG3_TYPE) & inferior_fp_registers, 0);
-}
-
-struct md_core
-{
-  struct reg intreg;
-  struct fpreg freg;
-};
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
-		      CORE_ADDR ignore)
-{
-  struct md_core *core_reg = (struct md_core *) core_reg_sect;
-
-  /* Integer registers */
-  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (0)],
-	  &core_reg->intreg, sizeof (struct reg));
-  /* Floating point registers */
-  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	  &core_reg->freg, sizeof (struct fpreg));
-}
-
-/* Register that we are able to handle m68knbsd core file formats.
-   FIXME: is this really bfd_target_unknown_flavour? */
-   
-static struct core_fns m68knbsd_core_fns =
-{  
-  bfd_target_unknown_flavour,           /* core_flavour */
-  default_check_format,                 /* check_format */
-  default_core_sniffer,                 /* core_sniffer */
-  fetch_core_registers,                 /* core_read_registers */
-  NULL                                  /* next */
-}; 
-   
-void
-_initialize_m68knbsd_nat (void)
-{
-  add_core_fns (&m68knbsd_core_fns);
-}
diff --git a/gdb/m68knbsd-tdep.c b/gdb/m68knbsd-tdep.c
deleted file mode 100644
index 520d14f..0000000
--- a/gdb/m68knbsd-tdep.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Target-dependent code for NetBSD/i386, for GDB.
-   Copyright 1988, 1989, 1991, 1992, 1994, 1996, 2000, 2001
-   Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include "defs.h"
-#include "gdbtypes.h"
-#include "regcache.h"
-
-int
-m68knbsd_use_struct_convention (int gcc_p, struct type *type)
-{
-  return !(TYPE_LENGTH (type) == 1
-	   || TYPE_LENGTH (type) == 2
-	   || TYPE_LENGTH (type) == 4
-	   || TYPE_LENGTH (type) == 8);
-}
diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c
new file mode 100644
index 0000000..572a66d
--- /dev/null
+++ b/gdb/m88k-tdep.c
@@ -0,0 +1,895 @@
+/* Target-dependent code for the Motorola 88000 series.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "arch-utils.h"
+#include "dis-asm.h"
+#include "frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "regcache.h"
+#include "regset.h"
+#include "symtab.h"
+#include "trad-frame.h"
+#include "value.h"
+
+#include "gdb_assert.h"
+#include "gdb_string.h"
+
+#include "m88k-tdep.h"
+
+/* Fetch the instruction at PC.  */
+
+static unsigned long
+m88k_fetch_instruction (CORE_ADDR pc)
+{
+  return read_memory_unsigned_integer (pc, 4);
+}
+
+/* Register information.  */
+
+/* Return the name of register REGNUM.  */
+
+static const char *
+m88k_register_name (int regnum)
+{
+  static char *register_names[] =
+  {
+    "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",
+    "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15",
+    "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
+    "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
+    "epsr", "fpsr", "fpcr", "sxip", "snip", "sfip"
+  };
+
+  if (regnum >= 0 && regnum < ARRAY_SIZE (register_names))
+    return register_names[regnum];
+
+  return NULL;
+}
+
+/* Return the GDB type object for the "standard" data type of data in
+   register REGNUM. */
+
+static struct type *
+m88k_register_type (struct gdbarch *gdbarch, int regnum)
+{
+  /* SXIP, SNIP, SFIP and R1 contain code addresses.  */
+  if ((regnum >= M88K_SXIP_REGNUM && regnum <= M88K_SFIP_REGNUM)
+      || regnum == M88K_R1_REGNUM)
+    return builtin_type_void_func_ptr;
+
+  /* R30 and R31 typically contains data addresses.  */
+  if (regnum == M88K_R30_REGNUM || regnum == M88K_R31_REGNUM)
+    return builtin_type_void_data_ptr;
+
+  return builtin_type_int32;
+}
+
+
+static CORE_ADDR
+m88k_addr_bits_remove (CORE_ADDR addr)
+{
+  /* All instructures are 4-byte aligned.  The lower 2 bits of SXIP,
+     SNIP and SFIP are used for special purposes: bit 0 is the
+     exception bit and bit 1 is the valid bit.  */
+  return addr & ~0x3;
+}
+
+/* Use the program counter to determine the contents and size of a
+   breakpoint instruction.  Return a pointer to a string of bytes that
+   encode a breakpoint instruction, store the length of the string in
+   *LEN and optionally adjust *PC to point to the correct memory
+   location for inserting the breakpoint.  */
+   
+static const unsigned char *
+m88k_breakpoint_from_pc (CORE_ADDR *pc, int *len)
+{
+  /* tb 0,r0,511 */
+  static unsigned char break_insn[] = { 0xf0, 0x00, 0xd1, 0xff };
+
+  *len = sizeof (break_insn);
+  return break_insn;
+}
+
+static CORE_ADDR
+m88k_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+  CORE_ADDR pc;
+
+  pc = frame_unwind_register_unsigned (next_frame, M88K_SXIP_REGNUM);
+  return m88k_addr_bits_remove (pc);
+}
+
+static void
+m88k_write_pc (CORE_ADDR pc, ptid_t ptid)
+{
+  /* According to the MC88100 RISC Microprocessor User's Manual,
+     section 6.4.3.1.2:
+
+     "... can be made to return to a particular instruction by placing
+     a valid instruction address in the SNIP and the next sequential
+     instruction address in the SFIP (with V bits set and E bits
+     clear).  The rte resumes execution at the instruction pointed to
+     by the SNIP, then the SFIP."
+
+     The E bit is the least significant bit (bit 0).  The V (valid)
+     bit is bit 1.  This is why we logical or 2 into the values we are
+     writing below.  It turns out that SXIP plays no role when
+     returning from an exception so nothing special has to be done
+     with it.  We could even (presumably) give it a totally bogus
+     value.  */
+
+  write_register_pid (M88K_SXIP_REGNUM, pc, ptid);
+  write_register_pid (M88K_SNIP_REGNUM, pc | 2, ptid);
+  write_register_pid (M88K_SFIP_REGNUM, (pc + 4) | 2, ptid);
+}
+
+
+/* The functions on this page are intended to be used to classify
+   function arguments.  */
+
+/* Check whether TYPE is "Integral or Pointer".  */
+
+static int
+m88k_integral_or_pointer_p (const struct type *type)
+{
+  switch (TYPE_CODE (type))
+    {
+    case TYPE_CODE_INT:
+    case TYPE_CODE_BOOL:
+    case TYPE_CODE_CHAR:
+    case TYPE_CODE_ENUM:
+    case TYPE_CODE_RANGE:
+      {
+	/* We have byte, half-word, word and extended-word/doubleword
+           integral types.  */
+	int len = TYPE_LENGTH (type);
+	return (len == 1 || len == 2 || len == 4 || len == 8);
+      }
+      return 1;
+    case TYPE_CODE_PTR:
+    case TYPE_CODE_REF:
+      {
+	/* Allow only 32-bit pointers.  */
+	return (TYPE_LENGTH (type) == 4);
+      }
+      return 1;
+    default:
+      break;
+    }
+
+  return 0;
+}
+
+/* Check whether TYPE is "Floating".  */
+
+static int
+m88k_floating_p (const struct type *type)
+{
+  switch (TYPE_CODE (type))
+    {
+    case TYPE_CODE_FLT:
+      {
+	int len = TYPE_LENGTH (type);
+	return (len == 4 || len == 8);
+      }
+    default:
+      break;
+    }
+
+  return 0;
+}
+
+/* Check whether TYPE is "Structure or Union".  */
+
+static int
+m88k_structure_or_union_p (const struct type *type)
+{
+  switch (TYPE_CODE (type))
+    {
+    case TYPE_CODE_STRUCT:
+    case TYPE_CODE_UNION:
+      return 1;
+    default:
+      break;
+    }
+
+  return 0;
+}
+
+/* Check whether TYPE has 8-byte alignment.  */
+
+static int
+m88k_8_byte_align_p (struct type *type)
+{
+  if (m88k_structure_or_union_p (type))
+    {
+      int i;
+
+      for (i = 0; i < TYPE_NFIELDS (type); i++)
+	{
+	  struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, i));
+
+	  if (m88k_8_byte_align_p (subtype))
+	    return 1;
+	}
+    }
+
+  if (m88k_integral_or_pointer_p (type) || m88k_floating_p (type))
+    return (TYPE_LENGTH (type) == 8);
+
+  return 0;
+}
+
+/* Check whether TYPE can be passed in a register.  */
+
+static int
+m88k_in_register_p (struct type *type)
+{
+  if (m88k_integral_or_pointer_p (type) || m88k_floating_p (type))
+    return 1;
+
+  if (m88k_structure_or_union_p (type) && TYPE_LENGTH (type) == 4)
+    return 1;
+
+  return 0;
+}
+
+static CORE_ADDR
+m88k_store_arguments (struct regcache *regcache, int nargs,
+		      struct value **args, CORE_ADDR sp)
+{
+  int num_register_words = 0;
+  int num_stack_words = 0;
+  int i;
+
+  for (i = 0; i < nargs; i++)
+    {
+      struct type *type = VALUE_TYPE (args[i]);
+      int len = TYPE_LENGTH (type);
+
+      if (m88k_integral_or_pointer_p (type) && len < 4)
+	{
+	  args[i] = value_cast (builtin_type_int32, args[i]);
+	  type = VALUE_TYPE (args[i]);
+	  len = TYPE_LENGTH (type);
+	}
+
+      if (m88k_in_register_p (type))
+	{
+	  int num_words = 0;
+
+	  if (num_register_words % 2 == 1 && m88k_8_byte_align_p (type))
+	    num_words++;
+
+	  num_words += ((len + 3) / 4);
+	  if (num_register_words + num_words <= 8)
+	    {
+	      num_register_words += num_words;
+	      continue;
+	    }
+
+	  /* We've run out of available registers.  Pass the argument
+             on the stack.  */
+	}
+
+      if (num_stack_words % 2 == 1 && m88k_8_byte_align_p (type))
+	num_stack_words++;
+
+      num_stack_words += ((len + 3) / 4);
+    }
+
+  /* Allocate stack space.  */
+  sp = align_down (sp - 32 - num_stack_words * 4, 16);
+  num_stack_words = num_register_words = 0;
+
+  for (i = 0; i < nargs; i++)
+    {
+      char *valbuf = VALUE_CONTENTS (args[i]);
+      struct type *type = VALUE_TYPE (args[i]);
+      int len = TYPE_LENGTH (type);
+      int stack_word = num_stack_words;
+
+      if (m88k_in_register_p (type))
+	{
+	  int register_word = num_register_words;
+
+	  if (register_word % 2 == 1 && m88k_8_byte_align_p (type))
+	    register_word++;
+
+	  gdb_assert (len == 4 || len == 8);
+
+	  if (register_word + len / 8 < 8)
+	    {
+	      int regnum = M88K_R2_REGNUM + register_word;
+
+	      regcache_raw_write (regcache, regnum, valbuf);
+	      if (len > 4)
+		regcache_raw_write (regcache, regnum + 1, valbuf + 4);
+
+	      num_register_words = (register_word + len / 4);
+	      continue;
+	    }
+	}
+
+      if (stack_word % 2 == -1 && m88k_8_byte_align_p (type))
+	stack_word++;
+
+      write_memory (sp + stack_word * 4, valbuf, len);
+      num_stack_words = (stack_word + (len + 3) / 4);
+    }
+
+  return sp;
+}
+
+static CORE_ADDR
+m88k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
+		      struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
+		      struct value **args, CORE_ADDR sp, int struct_return,
+		      CORE_ADDR struct_addr)
+{
+  /* Set up the function arguments.  */
+  sp = m88k_store_arguments (regcache, nargs, args, sp);
+  gdb_assert (sp % 16 == 0);
+
+  /* Store return value address.  */
+  if (struct_return)
+    regcache_raw_write_unsigned (regcache, M88K_R12_REGNUM, struct_addr);
+
+  /* Store the stack pointer and return address in the appropriate
+     registers.  */
+  regcache_raw_write_unsigned (regcache, M88K_R31_REGNUM, sp);
+  regcache_raw_write_unsigned (regcache, M88K_R1_REGNUM, bp_addr);
+
+  /* Return the stack pointer.  */
+  return sp;
+}
+
+static struct frame_id
+m88k_unwind_dummy_id (struct gdbarch *arch, struct frame_info *next_frame)
+{
+  CORE_ADDR sp;
+
+  sp = frame_unwind_register_unsigned (next_frame, M88K_R31_REGNUM);
+  return frame_id_build (sp, frame_pc_unwind (next_frame));
+}
+
+
+/* Determine, for architecture GDBARCH, how a return value of TYPE
+   should be returned.  If it is supposed to be returned in registers,
+   and READBUF is non-zero, read the appropriate value from REGCACHE,
+   and copy it into READBUF.  If WRITEBUF is non-zero, write the value
+   from WRITEBUF into REGCACHE.  */
+
+static enum return_value_convention
+m88k_return_value (struct gdbarch *gdbarch, struct type *type,
+		   struct regcache *regcache, void *readbuf,
+		   const void *writebuf)
+{
+  int len = TYPE_LENGTH (type);
+  char buf[8];
+
+  if (!m88k_integral_or_pointer_p (type) && !m88k_floating_p (type))
+    return RETURN_VALUE_STRUCT_CONVENTION;
+
+  if (readbuf)
+    {
+      /* Read the contents of R2 and (if necessary) R3.  */
+      regcache_cooked_read (regcache, M88K_R2_REGNUM, buf);
+      if (len > 4)
+	{
+	  regcache_cooked_read (regcache, M88K_R3_REGNUM, buf + 4);
+	  gdb_assert (len == 8);
+	  memcpy (readbuf, buf, len);
+	}
+      else
+	{
+	  /* Just stripping off any unused bytes should preserve the
+             signed-ness just fine.  */
+	  memcpy (readbuf, buf + 4 - len, len);
+	}
+    }
+
+  if (writebuf)
+    {
+      /* Read the contents to R2 and (if necessary) R3.  */
+      if (len > 4)
+	{
+	  gdb_assert (len == 8);
+	  memcpy (buf, writebuf, 8);
+	  regcache_cooked_write (regcache, M88K_R3_REGNUM, buf + 4);
+	}
+      else
+	{
+	  /* ??? Do we need to do any sign-extension here?  */
+	  memcpy (buf + 4 - len, writebuf, len);
+	}
+      regcache_cooked_write (regcache, M88K_R2_REGNUM, buf);
+    }
+
+  return RETURN_VALUE_REGISTER_CONVENTION;
+}
+
+/* Default frame unwinder.  */
+
+struct m88k_frame_cache
+{
+  /* Base address.  */
+  CORE_ADDR base;
+  CORE_ADDR pc;
+
+  int sp_offset;
+  int fp_offset;
+
+  /* Table of saved registers.  */
+  struct trad_frame_saved_reg *saved_regs;
+};
+
+/* Prologue analysis.  */
+
+/* Macros for extracting fields from instructions.  */
+
+#define BITMASK(pos, width) (((0x1 << (width)) - 1) << (pos))
+#define EXTRACT_FIELD(val, pos, width) ((val) >> (pos) & BITMASK (0, width))
+#define	SUBU_OFFSET(x)	((unsigned)(x & 0xFFFF))
+#define	ST_OFFSET(x)	((unsigned)((x) & 0xFFFF))
+#define	ST_SRC(x)	EXTRACT_FIELD ((x), 21, 5)
+#define	ADDU_OFFSET(x)	((unsigned)(x & 0xFFFF))
+
+/* Possible actions to be taken by the prologue analyzer for the
+   instructions it encounters.  */
+
+enum m88k_prologue_insn_action
+{
+  M88K_PIA_SKIP,		/* Ignore.  */
+  M88K_PIA_NOTE_ST,		/* Note register store.  */
+  M88K_PIA_NOTE_STD,		/* Note register pair store.  */
+  M88K_PIA_NOTE_SP_ADJUSTMENT,	/* Note stack pointer adjustment.  */
+  M88K_PIA_NOTE_FP_ASSIGNMENT,	/* Note frame pointer assignment.  */
+  M88K_PIA_NOTE_BRANCH,		/* Note branch.  */
+  M88K_PIA_NOTE_PROLOGUE_END	/* Note end of prologue.  */
+};
+
+/* Table of instructions that may comprise a function prologue.  */
+
+struct m88k_prologue_insn
+{
+  unsigned long insn;
+  unsigned long mask;
+  enum m88k_prologue_insn_action action;
+};
+
+struct m88k_prologue_insn m88k_prologue_insn_table[] =
+{
+  /* Various register move instructions.  */
+  { 0x58000000, 0xf800ffff, M88K_PIA_SKIP },     /* or/or.u with immed of 0 */
+  { 0xf4005800, 0xfc1fffe0, M88K_PIA_SKIP },     /* or rd,r0,rs */
+  { 0xf4005800, 0xfc00ffff, M88K_PIA_SKIP },     /* or rd,rs,r0 */
+
+  /* Various other instructions.  */
+  { 0x58000000, 0xf8000000, M88K_PIA_SKIP },     /* or/or.u */
+
+  /* Stack pointer setup: "subu sp,sp,n" where n is a multiple of 8.  */
+  { 0x67ff0000, 0xffff0007, M88K_PIA_NOTE_SP_ADJUSTMENT },
+
+  /* Frame pointer assignment: "addu r30,r31,n".  */
+  { 0x63df0000, 0xffff0000, M88K_PIA_NOTE_FP_ASSIGNMENT },
+
+  /* Store to stack instructions; either "st rx,sp,n" or "st.d rx,sp,n".  */
+  { 0x241f0000, 0xfc1f0000, M88K_PIA_NOTE_ST },  /* st rx,sp,n */
+  { 0x201f0000, 0xfc1f0000, M88K_PIA_NOTE_STD }, /* st.d rs,sp,n */
+
+  /* Instructions needed for setting up r25 for pic code.  */
+  { 0x5f200000, 0xffff0000, M88K_PIA_SKIP },     /* or.u r25,r0,offset_high */
+  { 0xcc000002, 0xffffffff, M88K_PIA_SKIP },     /* bsr.n Lab */
+  { 0x5b390000, 0xffff0000, M88K_PIA_SKIP },     /* or r25,r25,offset_low */
+  { 0xf7396001, 0xffffffff, M88K_PIA_SKIP },     /* Lab: addu r25,r25,r1 */
+
+  /* Various branch or jump instructions which have a delay slot --
+     these do not form part of the prologue, but the instruction in
+     the delay slot might be a store instruction which should be
+     noted.  */
+  { 0xc4000000, 0xe4000000, M88K_PIA_NOTE_BRANCH },
+                                      /* br.n, bsr.n, bb0.n, or bb1.n */
+  { 0xec000000, 0xfc000000, M88K_PIA_NOTE_BRANCH }, /* bcnd.n */
+  { 0xf400c400, 0xfffff7e0, M88K_PIA_NOTE_BRANCH }, /* jmp.n or jsr.n */
+
+  /* Catch all.  Ends prologue analysis.  */
+  { 0x00000000, 0x00000000, M88K_PIA_NOTE_PROLOGUE_END }
+};
+
+/* Do a full analysis of the function prologue at PC and update CACHE
+   accordingly.  Bail out early if LIMIT is reached.  Return the
+   address where the analysis stopped.  If LIMIT points beyond the
+   function prologue, the return address should be the end of the
+   prologue.  */
+
+static CORE_ADDR
+m88k_analyze_prologue (CORE_ADDR pc, CORE_ADDR limit,
+		       struct m88k_frame_cache *cache)
+{
+  CORE_ADDR end = limit;
+
+  /* Provide a dummy cache if necessary.  */
+  if (cache == NULL)
+    {
+      size_t sizeof_saved_regs =
+	(M88K_R31_REGNUM + 1) * sizeof (struct trad_frame_saved_reg);
+
+      cache = alloca (sizeof (struct m88k_frame_cache));
+      cache->saved_regs = alloca (sizeof_saved_regs);
+
+      /* We only initialize the members we care about.  */
+      cache->saved_regs[M88K_R1_REGNUM].addr = -1;
+      cache->fp_offset = -1;
+    }
+
+  while (pc < limit)
+    {
+      struct m88k_prologue_insn *pi = m88k_prologue_insn_table;
+      unsigned long insn = m88k_fetch_instruction (pc);
+
+      while ((insn & pi->mask) != pi->insn)
+	pi++;
+
+      switch (pi->action)
+	{
+	case M88K_PIA_SKIP:
+	  /* If we have a frame pointer, and R1 has been saved,
+             consider this instruction as not being part of the
+             prologue.  */
+	  if (cache->fp_offset != -1
+	      && cache->saved_regs[M88K_R1_REGNUM].addr != -1)
+	    return min (pc, end);
+	  break;
+
+	case M88K_PIA_NOTE_ST:
+	case M88K_PIA_NOTE_STD:
+	  /* If no frame has been allocated, the stores aren't part of
+             the prologue.  */
+	  if (cache->sp_offset == 0)
+	    return min (pc, end);
+
+	  /* Record location of saved registers.  */
+	  {
+	    int regnum = ST_SRC (insn) + M88K_R0_REGNUM;
+	    ULONGEST offset = ST_OFFSET (insn);
+
+	    cache->saved_regs[regnum].addr = offset;
+	    if (pi->action == M88K_PIA_NOTE_STD && regnum < M88K_R31_REGNUM)
+	      cache->saved_regs[regnum + 1].addr = offset + 4;
+	  }
+	  break;
+
+	case M88K_PIA_NOTE_SP_ADJUSTMENT:
+	  /* A second stack pointer adjustment isn't part of the
+             prologue.  */
+	  if (cache->sp_offset != 0)
+	    return min (pc, end);
+
+	  /* Store stack pointer adjustment.  */
+	  cache->sp_offset = -SUBU_OFFSET (insn);
+	  break;
+
+	case M88K_PIA_NOTE_FP_ASSIGNMENT:
+	  /* A second frame pointer assignment isn't part of the
+             prologue.  */
+	  if (cache->fp_offset != -1)
+	    return min (pc, end);
+
+	  /* Record frame pointer assignment.  */
+	  cache->fp_offset = ADDU_OFFSET (insn);
+	  break;
+
+	case M88K_PIA_NOTE_BRANCH:
+	  /* The branch instruction isn't part of the prologue, but
+             the instruction in the delay slot might be.  Limit the
+             prologue analysis to the delay slot and record the branch
+             instruction as the end of the prologue.  */
+	  limit = min (limit, pc + 2 * M88K_INSN_SIZE);
+	  end = pc;
+	  break;
+
+	case M88K_PIA_NOTE_PROLOGUE_END:
+	  return min (pc, end);
+	}
+
+      pc += M88K_INSN_SIZE;
+    }
+
+  return end;
+}
+
+/* An upper limit to the size of the prologue.  */
+const int m88k_max_prologue_size = 128 * M88K_INSN_SIZE;
+
+/* Return the address of first real instruction of the function
+   starting at PC.  */
+
+static CORE_ADDR
+m88k_skip_prologue (CORE_ADDR pc)
+{
+  struct symtab_and_line sal;
+  CORE_ADDR func_start, func_end;
+
+  /* This is the preferred method, find the end of the prologue by
+     using the debugging information.  */
+  if (find_pc_partial_function (pc, NULL, &func_start, &func_end))
+    {
+      sal = find_pc_line (func_start, 0);
+
+      if (sal.end < func_end && pc <= sal.end)
+	return sal.end;
+    }
+
+  return m88k_analyze_prologue (pc, pc + m88k_max_prologue_size, NULL);
+}
+
+struct m88k_frame_cache *
+m88k_frame_cache (struct frame_info *next_frame, void **this_cache)
+{
+  struct m88k_frame_cache *cache;
+  CORE_ADDR frame_sp;
+
+  if (*this_cache)
+    return *this_cache;
+
+  cache = FRAME_OBSTACK_ZALLOC (struct m88k_frame_cache);
+  cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+  cache->fp_offset = -1;
+
+  cache->pc = frame_func_unwind (next_frame);
+  if (cache->pc != 0)
+    {
+      CORE_ADDR addr_in_block = frame_unwind_address_in_block (next_frame);
+      m88k_analyze_prologue (cache->pc, addr_in_block, cache);
+    }
+
+  /* Calculate the stack pointer used in the prologue.  */
+  if (cache->fp_offset != -1)
+    {
+      CORE_ADDR fp;
+
+      fp = frame_unwind_register_unsigned (next_frame, M88K_R30_REGNUM);
+      frame_sp = fp - cache->fp_offset;
+    }
+  else
+    {
+      /* If we know where the return address is saved, we can take a
+         solid guess at what the frame pointer should be.  */
+      if (cache->saved_regs[M88K_R1_REGNUM].addr != -1)
+	cache->fp_offset = cache->saved_regs[M88K_R1_REGNUM].addr - 4;
+      frame_sp = frame_unwind_register_unsigned (next_frame, M88K_R31_REGNUM);
+    }
+
+  /* Now that we know the stack pointer, adjust the location of the
+     saved registers.  */
+  {
+    int regnum;
+
+    for (regnum = M88K_R0_REGNUM; regnum < M88K_R31_REGNUM; regnum ++)
+      if (cache->saved_regs[regnum].addr != -1)
+	cache->saved_regs[regnum].addr += frame_sp;
+  }
+
+  /* Calculate the frame's base.  */
+  cache->base = frame_sp - cache->sp_offset;
+  trad_frame_set_value (cache->saved_regs, M88K_R31_REGNUM, cache->base);
+
+  /* Identify SXIP with the return address in R1.  */
+  cache->saved_regs[M88K_SXIP_REGNUM] = cache->saved_regs[M88K_R1_REGNUM];
+
+  *this_cache = cache;
+  return cache;
+}
+
+static void
+m88k_frame_this_id (struct frame_info *next_frame, void **this_cache,
+		    struct frame_id *this_id)
+{
+  struct m88k_frame_cache *cache = m88k_frame_cache (next_frame, this_cache);
+
+  /* This marks the outermost frame.  */
+  if (cache->base == 0)
+    return;
+
+  (*this_id) = frame_id_build (cache->base, cache->pc);
+}
+
+static void
+m88k_frame_prev_register (struct frame_info *next_frame, void **this_cache,
+			  int regnum, int *optimizedp,
+			  enum lval_type *lvalp, CORE_ADDR *addrp,
+			  int *realnump, void *valuep)
+{
+  struct m88k_frame_cache *cache = m88k_frame_cache (next_frame, this_cache);
+
+  if (regnum == M88K_SNIP_REGNUM || regnum == M88K_SFIP_REGNUM)
+    {
+      if (valuep)
+	{
+	  CORE_ADDR pc;
+
+	  trad_frame_prev_register (next_frame, cache->saved_regs,
+				    M88K_SXIP_REGNUM, optimizedp,
+				    lvalp, addrp, realnump, valuep);
+
+	  pc = extract_unsigned_integer (valuep, 4);
+	  if (regnum == M88K_SFIP_REGNUM)
+	    pc += 4;
+	  store_unsigned_integer (valuep, 4, pc + 4);
+	}
+
+      /* It's a computed value.  */
+      *optimizedp = 0;
+      *lvalp = not_lval;
+      *addrp = 0;
+      *realnump = -1;
+      return;
+    }
+
+  trad_frame_prev_register (next_frame, cache->saved_regs, regnum,
+			    optimizedp, lvalp, addrp, realnump, valuep);
+}
+
+static const struct frame_unwind m88k_frame_unwind =
+{
+  NORMAL_FRAME,
+  m88k_frame_this_id,
+  m88k_frame_prev_register
+};
+
+static const struct frame_unwind *
+m88k_frame_sniffer (struct frame_info *next_frame)
+{
+  return &m88k_frame_unwind;
+}
+
+
+static CORE_ADDR
+m88k_frame_base_address (struct frame_info *next_frame, void **this_cache)
+{
+  struct m88k_frame_cache *cache = m88k_frame_cache (next_frame, this_cache);
+
+  if (cache->fp_offset != -1)
+    return cache->base + cache->sp_offset + cache->fp_offset;
+
+  return 0;
+}
+
+static const struct frame_base m88k_frame_base =
+{
+  &m88k_frame_unwind,
+  m88k_frame_base_address,
+  m88k_frame_base_address,
+  m88k_frame_base_address
+};
+
+
+/* Core file support.  */
+
+/* Supply register REGNUM from the buffer specified by GREGS and LEN
+   in the general-purpose register set REGSET to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+static void
+m88k_supply_gregset (const struct regset *regset,
+		     struct regcache *regcache,
+		     int regnum, const void *gregs, size_t len)
+{
+  const char *regs = gregs;
+  int i;
+
+  for (i = 0; i < M88K_NUM_REGS; i++)
+    {
+      if (regnum == i || regnum == -1)
+	regcache_raw_supply (regcache, i, regs + i * 4);
+    }
+}
+
+/* Motorola 88000 register set.  */
+
+static struct regset m88k_gregset =
+{
+  NULL,
+  m88k_supply_gregset
+};
+
+/* Return the appropriate register set for the core section identified
+   by SECT_NAME and SECT_SIZE.  */
+
+static const struct regset *
+m88k_regset_from_core_section (struct gdbarch *gdbarch,
+			       const char *sect_name, size_t sect_size)
+{
+  if (strcmp (sect_name, ".reg") == 0 && sect_size >= M88K_NUM_REGS * 4)
+    return &m88k_gregset;
+
+  return NULL;
+}
+
+
+static struct gdbarch *
+m88k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+{
+  struct gdbarch *gdbarch;
+
+  /* If there is already a candidate, use it.  */
+  arches = gdbarch_list_lookup_by_info (arches, &info);
+  if (arches != NULL)
+    return arches->gdbarch;
+
+  /* Allocate space for the new architecture.  */
+  gdbarch = gdbarch_alloc (&info, NULL);
+
+  /* There is no real `long double'.  */
+  set_gdbarch_long_double_bit (gdbarch, 64);
+  set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
+
+  set_gdbarch_num_regs (gdbarch, M88K_NUM_REGS);
+  set_gdbarch_register_name (gdbarch, m88k_register_name);
+  set_gdbarch_register_type (gdbarch, m88k_register_type);
+
+  /* Register numbers of various important registers.  */
+  set_gdbarch_sp_regnum (gdbarch, M88K_R31_REGNUM);
+  set_gdbarch_pc_regnum (gdbarch, M88K_SXIP_REGNUM);
+
+  /* Core file support.  */
+  set_gdbarch_regset_from_core_section
+    (gdbarch, m88k_regset_from_core_section);
+
+  set_gdbarch_print_insn (gdbarch, print_insn_m88k);
+
+  set_gdbarch_skip_prologue (gdbarch, m88k_skip_prologue);
+
+  /* Stack grows downward.  */
+  set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
+
+  /* Call dummy code.  */
+  set_gdbarch_push_dummy_call (gdbarch, m88k_push_dummy_call);
+  set_gdbarch_unwind_dummy_id (gdbarch, m88k_unwind_dummy_id);
+
+  /* Return value info */
+  set_gdbarch_return_value (gdbarch, m88k_return_value);
+
+  set_gdbarch_addr_bits_remove (gdbarch, m88k_addr_bits_remove);
+  set_gdbarch_breakpoint_from_pc (gdbarch, m88k_breakpoint_from_pc);
+  set_gdbarch_unwind_pc (gdbarch, m88k_unwind_pc);
+  set_gdbarch_write_pc (gdbarch, m88k_write_pc);
+
+  frame_base_set_default (gdbarch, &m88k_frame_base);
+  frame_unwind_append_sniffer (gdbarch, m88k_frame_sniffer);
+
+  return gdbarch;
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_m88k_tdep (void);
+
+void
+_initialize_m88k_tdep (void)
+{
+  gdbarch_register (bfd_arch_m88k, m88k_gdbarch_init, NULL);
+}
diff --git a/gdb/m88k-tdep.h b/gdb/m88k-tdep.h
new file mode 100644
index 0000000..1389bfc
--- /dev/null
+++ b/gdb/m88k-tdep.h
@@ -0,0 +1,49 @@
+/* Target-dependent code for the Motorola 88000 series.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef M88K_TDEP_H
+#define M88K_TDEP_H
+
+/* Register numbers of various important registers.  */
+
+enum m88k_regnum
+{
+  M88K_R0_REGNUM,
+  M88K_R1_REGNUM,		/* Return address (hardware).  */
+  M88K_R2_REGNUM,
+  M88K_R3_REGNUM,
+  M88K_R12_REGNUM = 12,
+  M88K_R30_REGNUM = 30,		/* Frame pointer.  */
+  M88K_R31_REGNUM,		/* Stack pointer. */
+  M88K_EPSR_REGNUM,
+  M88K_FPSR_REGNUM,
+  M88K_FPCR_REGNUM,
+  M88K_SXIP_REGNUM,
+  M88K_SNIP_REGNUM,
+  M88K_SFIP_REGNUM,
+  M88K_NUM_REGS			/* Number of machine registers.  */
+
+};
+
+/* Instruction size.  */
+#define M88K_INSN_SIZE 4
+
+#endif /* m88k-tdep.h */
diff --git a/gdb/m88kbsd-nat.c b/gdb/m88kbsd-nat.c
new file mode 100644
index 0000000..02ecbdf
--- /dev/null
+++ b/gdb/m88kbsd-nat.c
@@ -0,0 +1,94 @@
+/* Native-dependent code for Motorola 88000 BSD's.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "inferior.h"
+#include "regcache.h"
+
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+
+#include "m88k-tdep.h"
+
+/* Supply the general-purpose registers stored in GREGS to REGCACHE.  */
+
+static void
+m88kbsd_supply_gregset (struct regcache *regcache, const void *gregs)
+{
+  const char *regs = gregs;
+  int regnum;
+
+  for (regnum = 0; regnum < M88K_NUM_REGS; regnum++)
+    regcache_raw_supply (regcache, regnum, regs + regnum * 4);
+}
+
+/* Collect the general-purpose registers from REGCACHE and store them
+   in GREGS.  */
+
+static void
+m88kbsd_collect_gregset (const struct regcache *regcache,
+			 void *gregs, int regnum)
+{
+  char *regs = gregs;
+  int i;
+
+  for (i = 0; i < M88K_NUM_REGS; i++)
+    {
+      if (regnum == -1 || regnum == i)
+	regcache_raw_collect (regcache, i, regs + i * 4);
+    }
+}
+
+
+/* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
+   for all registers.  */
+
+void
+fetch_inferior_registers (int regnum)
+{
+  struct reg regs;
+
+  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't get registers");
+
+  m88kbsd_supply_gregset (current_regcache, &regs);
+}
+
+/* Store register REGNUM back into the inferior.  If REGNUM is -1, do
+   this for all registers.  */
+
+void
+store_inferior_registers (int regnum)
+{
+  struct reg regs;
+
+  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't get registers");
+
+  m88kbsd_collect_gregset (current_regcache, &regs, regnum);
+
+  if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't write registers");
+}
diff --git a/gdb/main.c b/gdb/main.c
index 7385cfd..a419309 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -527,7 +527,7 @@
   }
 
   /* Initialize all files.  Give the interpreter a chance to take
-     control of the console via the init_ui_hook()) */
+     control of the console via the deprecated_init_ui_hook().  */
   gdb_init (argv[0]);
 
   /* Do these (and anything which might call wrap_here or *_filtered)
@@ -779,10 +779,10 @@
 	  /* GUIs generally have their own command loop, mainloop, or whatever.
 	     This is a good place to gain control because many error
 	     conditions will end up here via longjmp(). */
-	  if (command_loop_hook)
-	    command_loop_hook ();
+	  if (deprecated_command_loop_hook)
+	    deprecated_command_loop_hook ();
 	  else
-	    command_loop ();
+	    deprecated_command_loop ();
 	  quit_command ((char *) 0, instream == stdin);
 	}
     }
diff --git a/gdb/mcore-tdep.c b/gdb/mcore-tdep.c
index 321ba69..f8f7b8e 100644
--- a/gdb/mcore-tdep.c
+++ b/gdb/mcore-tdep.c
@@ -713,8 +713,7 @@
 {
   for (; fi != NULL; fi = get_next_frame (fi))
     {
-      if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				       get_frame_base (fi)))
+      if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
 	return deprecated_read_register_dummy (get_frame_pc (fi),
 					       get_frame_base (fi), regnum);
       else if (deprecated_get_frame_saved_regs (fi)[regnum] != 0)
@@ -731,8 +730,7 @@
 mcore_frame_saved_pc (struct frame_info * fi)
 {
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				   get_frame_base (fi)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
     return deprecated_read_register_dummy (get_frame_pc (fi),
 					   get_frame_base (fi), PC_REGNUM);
   else
@@ -750,8 +748,7 @@
   int rn;
   struct frame_info *fi = get_current_frame ();
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				   get_frame_base (fi)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
     deprecated_pop_dummy_frame ();
   else
     {
@@ -919,11 +916,11 @@
    argument.
 
    For gdb, this leaves us two routes, based on what
-   USE_STRUCT_CONVENTION (mcore_use_struct_convention) returns.  If
-   this macro returns 1, gdb will call STORE_STRUCT_RETURN to store
-   the return value.
+   DEPRECATED_USE_STRUCT_CONVENTION (mcore_use_struct_convention)
+   returns.  If this macro returns 1, gdb will call
+   STORE_STRUCT_RETURN to store the return value.
 
-   If USE_STRUCT_CONVENTION returns 0, then gdb uses
+   If DEPRECATED_USE_STRUCT_CONVENTION returns 0, then gdb uses
    STORE_RETURN_VALUE and EXTRACT_RETURN_VALUE to store/fetch the
    functions return value.  */
 
@@ -995,8 +992,7 @@
   get_frame_extra_info (fi)->status = 0;
   get_frame_extra_info (fi)->framesize = 0;
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				   get_frame_base (fi)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
     {
       /* We need to setup fi->frame here because call_function_by_hand
          gets it wrong by assuming it's always FP.  */
@@ -1022,7 +1018,6 @@
 static struct gdbarch *
 mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
-  static LONGEST call_dummy_words[7] = { };
   struct gdbarch_tdep *tdep = NULL;
   struct gdbarch *gdbarch;
 
@@ -1041,8 +1036,6 @@
 
   /* All registers are 32 bits */
   set_gdbarch_deprecated_register_size (gdbarch, MCORE_REG_SIZE);
-  set_gdbarch_deprecated_max_register_raw_size (gdbarch, MCORE_REG_SIZE);
-  set_gdbarch_deprecated_max_register_virtual_size (gdbarch, MCORE_REG_SIZE);
   set_gdbarch_register_name (gdbarch, mcore_register_name);
   set_gdbarch_deprecated_register_virtual_type (gdbarch, mcore_register_virtual_type);
   set_gdbarch_deprecated_register_virtual_size (gdbarch, mcore_register_size);
@@ -1056,9 +1049,6 @@
 
   /* Call Dummies:  */
 
-  set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
-  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
-  set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
   set_gdbarch_deprecated_saved_pc_after_call (gdbarch, mcore_saved_pc_after_call);
   set_gdbarch_breakpoint_from_pc (gdbarch, mcore_breakpoint_from_pc);
   set_gdbarch_deprecated_push_return_address (gdbarch, mcore_push_return_address);
@@ -1084,7 +1074,7 @@
 
   /* Stack grows down.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-  set_gdbarch_use_struct_convention (gdbarch, mcore_use_struct_convention);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, mcore_use_struct_convention);
   set_gdbarch_believe_pcc_promotion (gdbarch, 1);
   /* MCore will never pass a sturcture by reference. It will always be split
      between registers and stack.  */
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 89d0282..c0165ab 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -321,10 +321,6 @@
 
 static char *mdebug_next_symbol_text (struct objfile *);
 
-/* Address bounds for the signal trampoline in inferior, if any */
-
-CORE_ADDR sigtramp_address, sigtramp_end;
-
 /* Allocate zeroed memory */
 
 static void *
@@ -3605,13 +3601,6 @@
       includes_used = 0;
       dependencies_used = 0;
 
-      if (objfile->ei.entry_point >= save_pst->textlow &&
-	  objfile->ei.entry_point < save_pst->texthigh)
-	{
-	  objfile->ei.deprecated_entry_file_lowpc = save_pst->textlow;
-	  objfile->ei.deprecated_entry_file_highpc = save_pst->texthigh;
-	}
-
       /* The objfile has its functions reordered if this partial symbol
          table overlaps any other partial symbol table.
          We cannot assume a reordered objfile if a partial symbol table
@@ -4751,126 +4740,6 @@
   install_minimal_symbols (objfile);
   do_cleanups (back_to);
 }
-
-
-/* Things used for calling functions in the inferior.
-   These functions are exported to our companion
-   mips-tdep.c file and are here because they play
-   with the symbol-table explicitly. */
-
-/* Sigtramp: make sure we have all the necessary information
-   about the signal trampoline code. Since the official code
-   from MIPS does not do so, we make up that information ourselves.
-   If they fix the library (unlikely) this code will neutralize itself. */
-
-/* FIXME: This function is called only by mips-tdep.c.  It needs to be
-   here because it calls functions defined in this file, but perhaps
-   this could be handled in a better way.  Only compile it in when
-   tm-mips.h is included. */
-
-#ifdef TM_MIPS_H
-
-void
-fixup_sigtramp (void)
-{
-  struct symbol *s;
-  struct symtab *st;
-  struct block *b, *b0 = NULL;
-
-  sigtramp_address = -1;
-
-  /* We have to handle the following cases here:
-     a) The Mips library has a sigtramp label within sigvec.
-     b) Irix has a _sigtramp which we want to use, but it also has sigvec.  */
-  s = lookup_symbol ("sigvec", 0, VAR_DOMAIN, 0, NULL);
-  if (s != 0)
-    {
-      b0 = SYMBOL_BLOCK_VALUE (s);
-      s = lookup_symbol ("sigtramp", b0, VAR_DOMAIN, 0, NULL);
-    }
-  if (s == 0)
-    {
-      /* No sigvec or no sigtramp inside sigvec, try _sigtramp.  */
-      s = lookup_symbol ("_sigtramp", 0, VAR_DOMAIN, 0, NULL);
-    }
-
-  /* But maybe this program uses its own version of sigvec */
-  if (s == 0)
-    return;
-
-  /* Did we or MIPSco fix the library ? */
-  if (SYMBOL_CLASS (s) == LOC_BLOCK)
-    {
-      sigtramp_address = BLOCK_START (SYMBOL_BLOCK_VALUE (s));
-      sigtramp_end = BLOCK_END (SYMBOL_BLOCK_VALUE (s));
-      return;
-    }
-
-  sigtramp_address = SYMBOL_VALUE (s);
-  sigtramp_end = sigtramp_address + 0x88;	/* black magic */
-
-  /* But what symtab does it live in ? */
-  st = find_pc_symtab (SYMBOL_VALUE (s));
-
-  /*
-   * Ok, there goes the fix: turn it into a procedure, with all the
-   * needed info.  Note we make it a nested procedure of sigvec,
-   * which is the way the (assembly) code is actually written.
-   */
-  SYMBOL_DOMAIN (s) = VAR_DOMAIN;
-  SYMBOL_CLASS (s) = LOC_BLOCK;
-  SYMBOL_TYPE (s) = init_type (TYPE_CODE_FUNC, 4, 0, (char *) NULL,
-			       st->objfile);
-  TYPE_TARGET_TYPE (SYMBOL_TYPE (s)) = mdebug_type_void;
-
-  /* Need a block to allocate MIPS_EFI_SYMBOL_NAME in */
-  b = new_block (NON_FUNCTION_BLOCK);
-  SYMBOL_BLOCK_VALUE (s) = b;
-  BLOCK_START (b) = sigtramp_address;
-  BLOCK_END (b) = sigtramp_end;
-  BLOCK_FUNCTION (b) = s;
-  BLOCK_SUPERBLOCK (b) = BLOCK_SUPERBLOCK (b0);
-  add_block (b, st);
-  sort_blocks (st);
-
-  /* Make a MIPS_EFI_SYMBOL_NAME entry for it */
-  {
-    struct mips_extra_func_info *e =
-    ((struct mips_extra_func_info *)
-     xzalloc (sizeof (struct mips_extra_func_info)));
-
-    e->numargs = 0;		/* the kernel thinks otherwise */
-    e->pdr.frameoffset = 32;
-    e->pdr.framereg = SP_REGNUM;
-    /* Note that setting pcreg is no longer strictly necessary as
-       mips_frame_saved_pc is now aware of signal handler frames.  */
-    e->pdr.pcreg = PC_REGNUM;
-    e->pdr.regmask = -2;
-    /* Offset to saved r31, in the sigtramp case the saved registers
-       are above the frame in the sigcontext.
-       We have 4 alignment bytes, 12 bytes for onstack, mask and pc,
-       32 * 4 bytes for the general registers, 12 bytes for mdhi, mdlo, ownedfp
-       and 32 * 4 bytes for the floating point registers.  */
-    e->pdr.regoffset = 4 + 12 + 31 * 4;
-    e->pdr.fregmask = -1;
-    /* Offset to saved f30 (first saved *double* register).  */
-    e->pdr.fregoffset = 4 + 12 + 32 * 4 + 12 + 30 * 4;
-    e->pdr.isym = (long) s;
-    e->pdr.adr = sigtramp_address;
-
-    current_objfile = st->objfile;	/* Keep new_symbol happy */
-    s = new_symbol (MIPS_EFI_SYMBOL_NAME);
-    SYMBOL_VALUE (s) = (long) e;
-    SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
-    SYMBOL_CLASS (s) = LOC_CONST;
-    SYMBOL_TYPE (s) = mdebug_type_void;
-    current_objfile = NULL;
-  }
-
-  dict_add_symbol (BLOCK_DICT (b), s);
-}
-
-#endif /* TM_MIPS_H */
 
 void
 _initialize_mdebugread (void)
diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c
index 5d15aa9..528cd3c 100644
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -134,7 +134,7 @@
   address = argv[optind];
 
   /* Now we have what we need, let's insert the breakpoint! */
-  old_hooks = set_gdb_event_hooks (&breakpoint_hooks);
+  old_hooks = deprecated_set_gdb_event_hooks (&breakpoint_hooks);
   switch (type)
     {
     case REG_BP:
@@ -160,7 +160,7 @@
       internal_error (__FILE__, __LINE__,
 		      "mi_cmd_break_insert: Bad switch.");
     }
-  set_gdb_event_hooks (old_hooks);
+  deprecated_set_gdb_event_hooks (old_hooks);
 
   if (rc == GDB_RC_FAIL)
     return MI_CMD_CAUGHT_ERROR;
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index 439c719..65f7f90 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -54,7 +54,7 @@
       struct cleanup *old_cleanups;
       char *run;
       if (args != NULL)
-	xasprintf (&run, "%s %s", cmd, args);
+	run = xstrprintf ("%s %s", cmd, args);
       else
 	run = xstrdup (cmd);
       old_cleanups = make_cleanup (xfree, run);
diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c
index eb1d67a..aa20a79 100644
--- a/gdb/mi/mi-cmd-file.c
+++ b/gdb/mi/mi-cmd-file.c
@@ -25,6 +25,7 @@
 #include "ui-out.h"
 #include "symtab.h"
 #include "source.h"
+#include "objfiles.h"
 
 /* Return to the client the absolute path and line number of the 
    current file being executed. */
@@ -39,7 +40,6 @@
   if ( !mi_valid_noargs("mi_cmd_file_list_exec_source_file", argc, argv) )
     error ("mi_cmd_file_list_exec_source_file: Usage: No args");
 
-  
   /* Set the default file and line, also get them */
   set_default_source_symtab_and_line();
   st = get_current_source_symtab_and_line();
@@ -51,17 +51,68 @@
     error ("mi_cmd_file_list_exec_source_file: No symtab");
 
   /* Extract the fullname if it is not known yet */
-  if (st.symtab->fullname == NULL)
-    symtab_to_filename (st.symtab);
-
-  /* We may not be able to open the file (not available). */
-  if (st.symtab->fullname == NULL)
-    error ("mi_cmd_file_list_exec_source_file: File not found");
+  symtab_to_fullname (st.symtab);
 
   /* Print to the user the line, filename and fullname */
   ui_out_field_int (uiout, "line", st.line);
   ui_out_field_string (uiout, "file", st.symtab->filename);
+
+  /* We may not be able to open the file (not available). */
+  if (st.symtab->fullname)
   ui_out_field_string (uiout, "fullname", st.symtab->fullname);
 
   return MI_CMD_DONE;
 }
+
+enum mi_cmd_result
+mi_cmd_file_list_exec_source_files (char *command, char **argv, int argc)
+{
+  struct symtab *s;
+  struct partial_symtab *ps;
+  struct objfile *objfile;
+
+  if (!mi_valid_noargs ("mi_cmd_file_list_exec_source_files", argc, argv))
+    error ("mi_cmd_file_list_exec_source_files: Usage: No args");
+
+  /* Print the table header */
+  ui_out_begin (uiout, ui_out_type_list, "files");
+
+  /* Look at all of the symtabs */
+  ALL_SYMTABS (objfile, s)
+  {
+    ui_out_begin (uiout, ui_out_type_tuple, NULL);
+
+    ui_out_field_string (uiout, "file", s->filename);
+
+    /* Extract the fullname if it is not known yet */
+    symtab_to_fullname (s);
+
+    if (s->fullname)
+      ui_out_field_string (uiout, "fullname", s->fullname);
+
+    ui_out_end (uiout, ui_out_type_tuple);
+  }
+
+  /* Look at all of the psymtabs */
+  ALL_PSYMTABS (objfile, ps)
+  {
+    if (!ps->readin)
+      {
+	ui_out_begin (uiout, ui_out_type_tuple, NULL);
+
+	ui_out_field_string (uiout, "file", ps->filename);
+
+	/* Extract the fullname if it is not known yet */
+	psymtab_to_fullname (ps);
+
+	if (ps->fullname)
+	  ui_out_field_string (uiout, "fullname", ps->fullname);
+
+	ui_out_end (uiout, ui_out_type_tuple);
+      }
+  }
+
+  ui_out_end (uiout, ui_out_type_list);
+
+  return MI_CMD_DONE;
+}
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 7db9ffb..37d0846 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -85,14 +85,9 @@
        i++, fi = get_prev_frame (fi))
     {
       QUIT;
-      /* level == i: always print the level 'i'
-         source == LOC_AND_ADDRESS: print the location and the address 
-         always, even for level 0.
+      /* Print the location and the address always, even for level 0.
          args == 0: don't print the arguments. */
-      print_frame_info (fi /* frame info */ ,
-			i /* level */ ,
-			LOC_AND_ADDRESS /* source */ ,
-			0 /* args */ );
+      print_frame_info (fi, 1, LOC_AND_ADDRESS, 0 /* args */ );
     }
 
   do_cleanups (cleanup_stack);
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 709ed301..6f3a2b7 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -50,9 +50,8 @@
 
   if (argc != 3)
     {
-      /*      xasprintf (&mi_error_message,
-         "mi_cmd_var_create: Usage: .");
-         return MI_CMD_ERROR; */
+      /* mi_error_message = xstrprintf ("mi_cmd_var_create: Usage:
+         ...."); return MI_CMD_ERROR; */
       error ("mi_cmd_var_create: Usage: NAME FRAME EXPRESSION.");
     }
 
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index 0dfc217..918676d 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -81,7 +81,7 @@
   { "file-exec-file", { "exec-file", 1 }, NULL, NULL },
   { "file-list-exec-sections", { NULL, 0 }, NULL, NULL },
   { "file-list-exec-source-file", { NULL, 0 }, 0, mi_cmd_file_list_exec_source_file},
-  { "file-list-exec-source-files", { NULL, 0 }, NULL, NULL },
+  { "file-list-exec-source-files", { NULL, 0 }, NULL, mi_cmd_file_list_exec_source_files },
   { "file-list-shared-libraries", { NULL, 0 }, NULL, NULL },
   { "file-list-symbol-files", { NULL, 0 }, NULL, NULL },
   { "file-symbol-file", { "symbol-file", 1 }, NULL, NULL },
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
index 5453059..f9a08d9 100644
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -87,6 +87,7 @@
 extern mi_cmd_args_ftype mi_cmd_exec_until;
 extern mi_cmd_args_ftype mi_cmd_exec_interrupt;
 extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_file;
+extern mi_cmd_argv_ftype mi_cmd_file_list_exec_source_files;
 extern mi_cmd_argv_ftype mi_cmd_gdb_exit;
 extern mi_cmd_argv_ftype mi_cmd_interpreter_exec;
 extern mi_cmd_argv_ftype mi_cmd_stack_info_depth;
@@ -146,7 +147,6 @@
 extern struct ui_file *raw_stdout;
 
 extern char *mi_error_message;
-extern void mi_error_last_message (void);
 extern void mi_execute_command (char *cmd, int from_tty);
 
 #endif
diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c
index 08201ca..19dbda5 100644
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -127,17 +127,17 @@
      be a better way of doing this... */
   clear_interpreter_hooks ();
 
-  show_load_progress = mi_load_progress;
+  deprecated_show_load_progress = mi_load_progress;
 
   /* If we're _the_ interpreter, take control. */
   if (current_interp_named_p (INTERP_MI1))
-    command_loop_hook = mi1_command_loop;
+    deprecated_command_loop_hook = mi1_command_loop;
   else if (current_interp_named_p (INTERP_MI2))
-    command_loop_hook = mi2_command_loop;
+    deprecated_command_loop_hook = mi2_command_loop;
   else if (current_interp_named_p (INTERP_MI3))
-    command_loop_hook = mi3_command_loop;
+    deprecated_command_loop_hook = mi3_command_loop;
   else
-    command_loop_hook = mi2_command_loop;
+    deprecated_command_loop_hook = mi2_command_loop;
 
   return 1;
 }
@@ -194,25 +194,21 @@
 
   if (argc < 2)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_interpreter_exec: Usage: -interpreter-exec interp command");
+      mi_error_message = xstrprintf ("mi_cmd_interpreter_exec: Usage: -interpreter-exec interp command");
       return MI_CMD_ERROR;
     }
 
   interp_to_use = interp_lookup (argv[0]);
   if (interp_to_use == NULL)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_interpreter_exec: could not find interpreter \"%s\"",
-		 argv[0]);
+      mi_error_message = xstrprintf ("mi_cmd_interpreter_exec: could not find interpreter \"%s\"", argv[0]);
       return MI_CMD_ERROR;
     }
 
   if (!interp_exec_p (interp_to_use))
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_interpreter_exec: interpreter \"%s\" does not support command execution",
-		 argv[0]);
+      mi_error_message = xstrprintf ("mi_cmd_interpreter_exec: interpreter \"%s\" does not support command execution",
+				     argv[0]);
       return MI_CMD_ERROR;
     }
 
@@ -246,7 +242,7 @@
       sync_execution = 1;
       if (interp_exec (interp_to_use, argv[i]) < 0)
 	{
-	  mi_error_last_message ();
+	  mi_error_message = error_last_message ();
 	  result = MI_CMD_ERROR;
 	  break;
 	}
@@ -282,13 +278,13 @@
 static void
 mi_insert_notify_hooks (void)
 {
-  query_hook = mi_interp_query_hook;
+  deprecated_query_hook = mi_interp_query_hook;
 }
 
 static void
 mi_remove_notify_hooks (void)
 {
-  query_hook = NULL;
+  deprecated_query_hook = NULL;
 }
 
 static int
@@ -341,27 +337,27 @@
   uiout = mi_out_new (mi_version);
   /* HACK: Override any other interpreter hooks.  We need to create a
      real event table and pass in that. */
-  init_ui_hook = 0;
-  /* command_loop_hook = 0; */
-  print_frame_info_listing_hook = 0;
-  query_hook = 0;
-  warning_hook = 0;
-  create_breakpoint_hook = 0;
-  delete_breakpoint_hook = 0;
-  modify_breakpoint_hook = 0;
-  interactive_hook = 0;
-  registers_changed_hook = 0;
-  readline_begin_hook = 0;
-  readline_hook = 0;
-  readline_end_hook = 0;
-  register_changed_hook = 0;
-  memory_changed_hook = 0;
-  context_hook = 0;
-  target_wait_hook = 0;
-  call_command_hook = 0;
-  error_hook = 0;
-  error_begin_hook = 0;
-  show_load_progress = mi_load_progress;
+  deprecated_init_ui_hook = 0;
+  /* deprecated_command_loop_hook = 0; */
+  deprecated_print_frame_info_listing_hook = 0;
+  deprecated_query_hook = 0;
+  deprecated_warning_hook = 0;
+  deprecated_create_breakpoint_hook = 0;
+  deprecated_delete_breakpoint_hook = 0;
+  deprecated_modify_breakpoint_hook = 0;
+  deprecated_interactive_hook = 0;
+  deprecated_registers_changed_hook = 0;
+  deprecated_readline_begin_hook = 0;
+  deprecated_readline_hook = 0;
+  deprecated_readline_end_hook = 0;
+  deprecated_register_changed_hook = 0;
+  deprecated_memory_changed_hook = 0;
+  deprecated_context_hook = 0;
+  deprecated_target_wait_hook = 0;
+  deprecated_call_command_hook = 0;
+  deprecated_error_hook = 0;
+  deprecated_error_begin_hook = 0;
+  deprecated_show_load_progress = mi_load_progress;
 #endif
   /* Turn off 8 bit strings in quoted output.  Any character with the
      high bit set is printed using C's octal format. */
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index c46bf63..3fc1586 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -99,16 +99,6 @@
 static int register_changed_p (int regnum);
 static int get_register (int regnum, int format);
 
-/* A helper function which will set mi_error_message to
-   error_last_message.  */
-void
-mi_error_last_message (void)
-{
-  char *s = error_last_message ();
-  xasprintf (&mi_error_message, "%s", s);
-  xfree (s);
-}
-
 /* Command implementations. FIXME: Is this libgdb? No.  This is the MI
    layer that calls libgdb.  Any operation used in the below should be
    formalized. */
@@ -191,9 +181,7 @@
 
   /* Because we have called return_command with from_tty = 0, we need
      to print the frame here. */
-  print_stack_frame (deprecated_selected_frame,
-		     frame_relative_level (deprecated_selected_frame),
-		     LOC_AND_ADDRESS);
+  print_stack_frame (get_selected_frame (), 1, LOC_AND_ADDRESS);
 
   return MI_CMD_DONE;
 }
@@ -215,8 +203,7 @@
 {
   if (!target_executing)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_exec_interrupt: Inferior not executing.");
+      mi_error_message = xstrprintf ("mi_cmd_exec_interrupt: Inferior not executing.");
       return MI_CMD_ERROR;
     }
   interrupt_target_command (args, from_tty);
@@ -241,8 +228,7 @@
 
   if (argc != 1)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_thread_select: USAGE: threadnum.");
+      mi_error_message = xstrprintf ("mi_cmd_thread_select: USAGE: threadnum.");
       return MI_CMD_ERROR;
     }
   else
@@ -265,8 +251,7 @@
 
   if (argc != 0)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_thread_list_ids: No arguments required.");
+      mi_error_message = xstrprintf ("mi_cmd_thread_list_ids: No arguments required.");
       return MI_CMD_ERROR;
     }
   else
@@ -316,7 +301,7 @@
       if (regnum < 0 || regnum >= numregs)
 	{
 	  do_cleanups (cleanup);
-	  xasprintf (&mi_error_message, "bad register number");
+	  mi_error_message = xstrprintf ("bad register number");
 	  return MI_CMD_ERROR;
 	}
       if (REGISTER_NAME (regnum) == NULL
@@ -359,8 +344,7 @@
 	  if (changed < 0)
 	    {
 	      do_cleanups (cleanup);
-	      xasprintf (&mi_error_message,
-			 "mi_cmd_data_list_changed_registers: Unable to read register contents.");
+	      mi_error_message = xstrprintf ("mi_cmd_data_list_changed_registers: Unable to read register contents.");
 	      return MI_CMD_ERROR;
 	    }
 	  else if (changed)
@@ -382,8 +366,7 @@
 	  if (changed < 0)
 	    {
 	      do_cleanups (cleanup);
-	      xasprintf (&mi_error_message,
-			 "mi_cmd_data_list_register_change: Unable to read register contents.");
+	      mi_error_message = xstrprintf ("mi_cmd_data_list_register_change: Unable to read register contents.");
 	      return MI_CMD_ERROR;
 	    }
 	  else if (changed)
@@ -392,7 +375,7 @@
       else
 	{
 	  do_cleanups (cleanup);
-	  xasprintf (&mi_error_message, "bad register number");
+	  mi_error_message = xstrprintf ("bad register number");
 	  return MI_CMD_ERROR;
 	}
     }
@@ -444,8 +427,7 @@
 
   if (argc == 0)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_list_register_values: Usage: -data-list-register-values <format> [<regnum1>...<regnumN>]");
+      mi_error_message = xstrprintf ("mi_cmd_data_list_register_values: Usage: -data-list-register-values <format> [<regnum1>...<regnumN>]");
       return MI_CMD_ERROR;
     }
 
@@ -453,8 +435,7 @@
 
   if (!target_has_registers)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_list_register_values: No registers.");
+      mi_error_message = xstrprintf ("mi_cmd_data_list_register_values: No registers.");
       return MI_CMD_ERROR;
     }
 
@@ -504,7 +485,7 @@
       else
 	{
 	  do_cleanups (list_cleanup);
-	  xasprintf (&mi_error_message, "bad register number");
+	  mi_error_message = xstrprintf ("bad register number");
 	  return MI_CMD_ERROR;
 	}
     }
@@ -516,8 +497,7 @@
 static int
 get_register (int regnum, int format)
 {
-  char raw_buffer[MAX_REGISTER_SIZE];
-  char virtual_buffer[MAX_REGISTER_SIZE];
+  char buffer[MAX_REGISTER_SIZE];
   int optim;
   int realnum;
   CORE_ADDR addr;
@@ -530,26 +510,14 @@
     format = 0;
 
   frame_register (deprecated_selected_frame, regnum, &optim, &lval, &addr,
-		  &realnum, raw_buffer);
+		  &realnum, buffer);
 
   if (optim)
     {
-      xasprintf (&mi_error_message, "Optimized out");
+      mi_error_message = xstrprintf ("Optimized out");
       return -1;
     }
 
-  /* Convert raw data to virtual format if necessary.  */
-
-  if (DEPRECATED_REGISTER_CONVERTIBLE_P ()
-      && DEPRECATED_REGISTER_CONVERTIBLE (regnum))
-    {
-      DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum,
-				   register_type (current_gdbarch, regnum),
-				   raw_buffer, virtual_buffer);
-    }
-  else
-    memcpy (virtual_buffer, raw_buffer, DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum));
-
   if (format == 'r')
     {
       int j;
@@ -561,7 +529,7 @@
 	{
 	  int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
 	  : DEPRECATED_REGISTER_RAW_SIZE (regnum) - 1 - j;
-	  sprintf (ptr, "%02x", (unsigned char) raw_buffer[idx]);
+	  sprintf (ptr, "%02x", (unsigned char) buffer[idx]);
 	  ptr += 2;
 	}
       ui_out_field_string (uiout, "value", buf);
@@ -569,7 +537,7 @@
     }
   else
     {
-      val_print (register_type (current_gdbarch, regnum), virtual_buffer, 0, 0,
+      val_print (register_type (current_gdbarch, regnum), buffer, 0, 0,
 		 stb->stream, format, 1, 0, Val_pretty_default);
       ui_out_field_stream (uiout, "value", stb);
       ui_out_stream_delete (stb);
@@ -599,8 +567,7 @@
 
   if (argc == 0)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_write_register_values: Usage: -data-write-register-values <format> [<regnum1> <value1>...<regnumN> <valueN>]");
+      mi_error_message = xstrprintf ("mi_cmd_data_write_register_values: Usage: -data-write-register-values <format> [<regnum1> <value1>...<regnumN> <valueN>]");
       return MI_CMD_ERROR;
     }
 
@@ -608,22 +575,19 @@
 
   if (!target_has_registers)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_write_register_values: No registers.");
+      mi_error_message = xstrprintf ("mi_cmd_data_write_register_values: No registers.");
       return MI_CMD_ERROR;
     }
 
   if (!(argc - 1))
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_write_register_values: No regs and values specified.");
+      mi_error_message = xstrprintf ("mi_cmd_data_write_register_values: No regs and values specified.");
       return MI_CMD_ERROR;
     }
 
   if ((argc - 1) % 2)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_write_register_values: Regs and vals are not in pairs.");
+      mi_error_message = xstrprintf ("mi_cmd_data_write_register_values: Regs and vals are not in pairs.");
       return MI_CMD_ERROR;
     }
 
@@ -652,7 +616,7 @@
 	}
       else
 	{
-	  xasprintf (&mi_error_message, "bad register number");
+	  mi_error_message = xstrprintf ("bad register number");
 	  return MI_CMD_ERROR;
 	}
     }
@@ -674,8 +638,7 @@
 
   if (argc != 1)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_assign: Usage: -data-assign expression");
+      mi_error_message = xstrprintf ("mi_cmd_data_assign: Usage: -data-assign expression");
       return MI_CMD_ERROR;
     }
 
@@ -705,8 +668,7 @@
 
   if (argc != 1)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_evaluate_expression: Usage: -data-evaluate-expression expression");
+      mi_error_message = xstrprintf ("mi_cmd_data_evaluate_expression: Usage: -data-evaluate-expression expression");
       return MI_CMD_ERROR;
     }
 
@@ -735,7 +697,7 @@
   char *run;
   struct cleanup *old_cleanups = NULL;
 
-  xasprintf (&run, "load %s", args);
+  run = xstrprintf ("load %s", args);
   old_cleanups = make_cleanup (xfree, run);
   execute_command (run, from_tty);
 
@@ -750,7 +712,7 @@
   char *run;
   struct cleanup *old_cleanups = NULL;
 
-  xasprintf (&run, "target %s", args);
+  run = xstrprintf ("target %s", args);
   old_cleanups = make_cleanup (xfree, run);
 
   /* target-select is always synchronous.  once the call has returned
@@ -838,8 +800,7 @@
 
   if (argc < 5 || argc > 6)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_read_memory: Usage: ADDR WORD-FORMAT WORD-SIZE NR-ROWS NR-COLS [ASCHAR].");
+      mi_error_message = xstrprintf ("mi_cmd_data_read_memory: Usage: ADDR WORD-FORMAT WORD-SIZE NR-ROWS NR-COLS [ASCHAR].");
       return MI_CMD_ERROR;
     }
 
@@ -878,16 +839,15 @@
   nr_rows = atol (argv[3]);
   if (nr_rows <= 0)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_read_memory: invalid number of rows.");
+      mi_error_message = xstrprintf ("mi_cmd_data_read_memory: invalid number of rows.");
       return MI_CMD_ERROR;
     }
   /* number of bytes per row. */
   nr_cols = atol (argv[4]);
   if (nr_cols <= 0)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_read_memory: invalid number of columns.");
+      mi_error_message = xstrprintf ("mi_cmd_data_read_memory: invalid number of columns.");
+      return MI_CMD_ERROR;
     }
   /* The un-printable character when printing ascii. */
   if (argc == 6)
@@ -899,12 +859,6 @@
   total_bytes = word_size * nr_rows * nr_cols;
   mbuf = xcalloc (total_bytes, 1);
   make_cleanup (xfree, mbuf);
-  if (mbuf == NULL)
-    {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_read_memory: out of memory.");
-      return MI_CMD_ERROR;
-    }
   nr_bytes = 0;
   while (nr_bytes < total_bytes)
     {
@@ -1048,8 +1002,7 @@
 
   if (argc != 4)
     {
-      xasprintf (&mi_error_message,
-		 "mi_cmd_data_write_memory: Usage: [-o COLUMN_OFFSET] ADDR FORMAT WORD-SIZE VALUE.");
+      mi_error_message = xstrprintf ("mi_cmd_data_write_memory: Usage: [-o COLUMN_OFFSET] ADDR FORMAT WORD-SIZE VALUE.");
       return MI_CMD_ERROR;
     }
 
@@ -1314,7 +1267,7 @@
       struct cleanup *old_cleanups;
       char *run;
       if (args_p)
-	xasprintf (&run, "%s %s", cmd, args);
+	run = xstrprintf ("%s %s", cmd, args);
       else
 	run = xstrdup (cmd);
       if (mi_debug_p)
@@ -1341,14 +1294,14 @@
       make_exec_cleanup (free, async_args);
       strcpy (async_args, args);
       strcat (async_args, "&");
-      xasprintf (&run, "%s %s", mi, async_args);
+      run = xstrprintf ("%s %s", mi, async_args);
       make_exec_cleanup (free, run);
       add_continuation (mi_exec_async_cli_cmd_continuation, NULL);
       old_cleanups = NULL;
     }
   else
     {
-      xasprintf (&run, "%s %s", mi, args);
+      run = xstrprintf ("%s %s", mi, args);
       old_cleanups = make_cleanup (xfree, run);
     }
 
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 83aef9d..3aeda7d 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -580,26 +580,23 @@
   struct msym_bunch *new;
   struct minimal_symbol *msymbol;
 
-  if (ms_type == mst_file_text)
-    {
-      /* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into
-         the minimal symbols, because if there is also another symbol
-         at the same address (e.g. the first function of the file),
-         lookup_minimal_symbol_by_pc would have no way of getting the
-         right one.  */
-      if (name[0] == 'g'
-	  && (strcmp (name, GCC_COMPILED_FLAG_SYMBOL) == 0
-	      || strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0))
-	return (NULL);
+  /* Don't put gcc_compiled, __gnu_compiled_cplus, and friends into
+     the minimal symbols, because if there is also another symbol
+     at the same address (e.g. the first function of the file),
+     lookup_minimal_symbol_by_pc would have no way of getting the
+     right one.  */
+  if (ms_type == mst_file_text && name[0] == 'g'
+      && (strcmp (name, GCC_COMPILED_FLAG_SYMBOL) == 0
+	  || strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0))
+    return (NULL);
 
-      {
-	const char *tempstring = name;
-	if (tempstring[0] == get_symbol_leading_char (objfile->obfd))
-	  ++tempstring;
-	if (strncmp (tempstring, "__gnu_compiled", 14) == 0)
-	  return (NULL);
-      }
-    }
+  /* It's safe to strip the leading char here once, since the name
+     is also stored stripped in the minimal symbol table. */
+  if (name[0] == get_symbol_leading_char (objfile->obfd))
+    ++name;
+
+  if (ms_type == mst_file_text && strncmp (name, "__gnu_compiled", 14) == 0)
+    return (NULL);
 
   if (msym_bunch_index == BUNCH_SIZE)
     {
@@ -794,7 +791,7 @@
       add_minsym_to_hash_table (msym, objfile->msymbol_hash);
 
       msym->demangled_hash_next = 0;
-      if (SYMBOL_DEMANGLED_NAME (msym) != NULL)
+      if (SYMBOL_SEARCH_NAME (msym) != SYMBOL_LINKAGE_NAME (msym))
 	add_minsym_to_demangled_hash_table (msym,
                                             objfile->msymbol_demangled_hash);
     }
@@ -831,7 +828,6 @@
   struct msym_bunch *bunch;
   struct minimal_symbol *msymbols;
   int alloc_count;
-  char leading_char;
 
   if (msym_count > 0)
     {
@@ -859,18 +855,11 @@
          each bunch is full. */
 
       mcount = objfile->minimal_symbol_count;
-      leading_char = get_symbol_leading_char (objfile->obfd);
 
       for (bunch = msym_bunch; bunch != NULL; bunch = bunch->next)
 	{
 	  for (bindex = 0; bindex < msym_bunch_index; bindex++, mcount++)
-	    {
-	      msymbols[mcount] = bunch->contents[bindex];
-	      if (SYMBOL_LINKAGE_NAME (&msymbols[mcount])[0] == leading_char)
-		{
-		  SYMBOL_LINKAGE_NAME (&msymbols[mcount])++;
-		}
-	    }
+	    msymbols[mcount] = bunch->contents[bindex];
 	  msym_bunch_index = BUNCH_SIZE;
 	}
 
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 7e59eb1..76bbef2 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -28,6 +28,8 @@
 #include "gdb_string.h"
 #include "gdb_assert.h"
 #include "frame.h"
+#include "trad-frame.h"
+#include "tramp-frame.h"
 
 /* Copied from <asm/elf.h>.  */
 #define ELF_NGREG       45
@@ -87,7 +89,8 @@
 }
 
 /* Transform the bits comprising a 32-bit register to the right size
-   for supply_register().  This is needed when mips_regsize() is 8.  */
+   for supply_register().  This is needed when mips_isa_regsize() is
+   8.  */
 
 static void
 supply_32bit_reg (int regnum, const void *addr)
@@ -797,6 +800,312 @@
   return 0;
 }      
 
+/* Signal trampoline support.  There are four supported layouts for a
+   signal frame: o32 sigframe, o32 rt_sigframe, n32 rt_sigframe, and
+   n64 rt_sigframe.  We handle them all independently; not the most
+   efficient way, but simplest.  First, declare all the unwinders.  */
+
+static void mips_linux_o32_sigframe_init (const struct tramp_frame *self,
+					  struct frame_info *next_frame,
+					  struct trad_frame_cache *this_cache,
+					  CORE_ADDR func);
+
+static void mips_linux_n32n64_sigframe_init (const struct tramp_frame *self,
+					     struct frame_info *next_frame,
+					     struct trad_frame_cache *this_cache,
+					     CORE_ADDR func);
+
+#define MIPS_NR_LINUX 4000
+#define MIPS_NR_N64_LINUX 5000
+#define MIPS_NR_N32_LINUX 6000
+
+#define MIPS_NR_sigreturn MIPS_NR_LINUX + 119
+#define MIPS_NR_rt_sigreturn MIPS_NR_LINUX + 193
+#define MIPS_NR_N64_rt_sigreturn MIPS_NR_N64_LINUX + 211
+#define MIPS_NR_N32_rt_sigreturn MIPS_NR_N32_LINUX + 211
+
+#define MIPS_INST_LI_V0_SIGRETURN 0x24020000 + MIPS_NR_sigreturn
+#define MIPS_INST_LI_V0_RT_SIGRETURN 0x24020000 + MIPS_NR_rt_sigreturn
+#define MIPS_INST_LI_V0_N64_RT_SIGRETURN 0x24020000 + MIPS_NR_N64_rt_sigreturn
+#define MIPS_INST_LI_V0_N32_RT_SIGRETURN 0x24020000 + MIPS_NR_N32_rt_sigreturn
+#define MIPS_INST_SYSCALL 0x0000000c
+
+struct tramp_frame mips_linux_o32_sigframe = {
+  4,
+  { MIPS_INST_LI_V0_SIGRETURN, MIPS_INST_SYSCALL, TRAMP_SENTINEL_INSN },
+  mips_linux_o32_sigframe_init
+};
+
+struct tramp_frame mips_linux_o32_rt_sigframe = {
+  4,
+  { MIPS_INST_LI_V0_RT_SIGRETURN, MIPS_INST_SYSCALL, TRAMP_SENTINEL_INSN },
+  mips_linux_o32_sigframe_init
+};
+
+struct tramp_frame mips_linux_n32_rt_sigframe = {
+  4,
+  { MIPS_INST_LI_V0_N32_RT_SIGRETURN, MIPS_INST_SYSCALL, TRAMP_SENTINEL_INSN },
+  mips_linux_n32n64_sigframe_init
+};
+
+struct tramp_frame mips_linux_n64_rt_sigframe = {
+  4,
+  { MIPS_INST_LI_V0_N64_RT_SIGRETURN, MIPS_INST_SYSCALL, TRAMP_SENTINEL_INSN },
+  mips_linux_n32n64_sigframe_init
+};
+
+/* *INDENT-OFF* */
+/* The unwinder for o32 signal frames.  The legacy structures look
+   like this:
+
+   struct sigframe {
+     u32 sf_ass[4];            [argument save space for o32]
+     u32 sf_code[2];           [signal trampoline]
+     struct sigcontext sf_sc;
+     sigset_t sf_mask;
+   };
+
+   struct sigcontext {
+        unsigned int       sc_regmask;          [Unused]
+        unsigned int       sc_status;
+        unsigned long long sc_pc;
+        unsigned long long sc_regs[32];
+        unsigned long long sc_fpregs[32];
+        unsigned int       sc_ownedfp;
+        unsigned int       sc_fpc_csr;
+        unsigned int       sc_fpc_eir;          [Unused]
+        unsigned int       sc_used_math;
+        unsigned int       sc_ssflags;          [Unused]
+	[Alignment hole of four bytes]
+        unsigned long long sc_mdhi;
+        unsigned long long sc_mdlo;
+
+        unsigned int       sc_cause;            [Unused]
+        unsigned int       sc_badvaddr;         [Unused]
+
+        unsigned long      sc_sigset[4];        [kernel's sigset_t]
+   };
+
+   The RT signal frames look like this:
+
+   struct rt_sigframe {
+     u32 rs_ass[4];            [argument save space for o32]
+     u32 rs_code[2]            [signal trampoline]
+     struct siginfo rs_info;
+     struct ucontext rs_uc;
+   };
+
+   struct ucontext {
+     unsigned long     uc_flags;
+     struct ucontext  *uc_link;
+     stack_t           uc_stack;
+     [Alignment hole of four bytes]
+     struct sigcontext uc_mcontext;
+     sigset_t          uc_sigmask;
+   };  */
+/* *INDENT-ON* */
+
+#define SIGFRAME_CODE_OFFSET         (4 * 4)
+#define SIGFRAME_SIGCONTEXT_OFFSET   (6 * 4)
+
+#define RTSIGFRAME_SIGINFO_SIZE      128
+#define STACK_T_SIZE                 (3 * 4)
+#define UCONTEXT_SIGCONTEXT_OFFSET   (2 * 4 + STACK_T_SIZE + 4)
+#define RTSIGFRAME_SIGCONTEXT_OFFSET (SIGFRAME_SIGCONTEXT_OFFSET \
+				      + RTSIGFRAME_SIGINFO_SIZE \
+				      + UCONTEXT_SIGCONTEXT_OFFSET)
+
+#define SIGCONTEXT_PC       (1 * 8)
+#define SIGCONTEXT_REGS     (2 * 8)
+#define SIGCONTEXT_FPREGS   (34 * 8)
+#define SIGCONTEXT_FPCSR    (66 * 8 + 4)
+#define SIGCONTEXT_HI       (69 * 8)
+#define SIGCONTEXT_LO       (70 * 8)
+#define SIGCONTEXT_CAUSE    (71 * 8 + 0)
+#define SIGCONTEXT_BADVADDR (71 * 8 + 4)
+
+#define SIGCONTEXT_REG_SIZE 8
+
+static void
+mips_linux_o32_sigframe_init (const struct tramp_frame *self,
+			      struct frame_info *next_frame,
+			      struct trad_frame_cache *this_cache,
+			      CORE_ADDR func)
+{
+  int ireg, reg_position;
+  CORE_ADDR sigcontext_base = func - SIGFRAME_CODE_OFFSET;
+  const struct mips_regnum *regs = mips_regnum (current_gdbarch);
+
+  if (self == &mips_linux_o32_sigframe)
+    sigcontext_base += SIGFRAME_SIGCONTEXT_OFFSET;
+  else
+    sigcontext_base += RTSIGFRAME_SIGCONTEXT_OFFSET;
+    
+  /* I'm not proud of this hack.  Eventually we will have the infrastructure
+     to indicate the size of saved registers on a per-frame basis, but
+     right now we don't; the kernel saves eight bytes but we only want
+     four.  */
+  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+    sigcontext_base += 4;
+
+#if 0
+  trad_frame_set_reg_addr (this_cache, ORIG_ZERO_REGNUM + NUM_REGS,
+			   sigcontext_base + SIGCONTEXT_REGS);
+#endif
+
+  for (ireg = 1; ireg < 32; ireg++)
+    trad_frame_set_reg_addr (this_cache, ireg + ZERO_REGNUM + NUM_REGS,
+			     sigcontext_base + SIGCONTEXT_REGS
+			     + ireg * SIGCONTEXT_REG_SIZE);
+
+  for (ireg = 0; ireg < 32; ireg++)
+    trad_frame_set_reg_addr (this_cache, ireg + regs->fp0 + NUM_REGS,
+			     sigcontext_base + SIGCONTEXT_FPREGS
+			     + ireg * SIGCONTEXT_REG_SIZE);
+
+  trad_frame_set_reg_addr (this_cache, regs->pc + NUM_REGS,
+			   sigcontext_base + SIGCONTEXT_PC);
+
+  trad_frame_set_reg_addr (this_cache, regs->fp_control_status + NUM_REGS,
+			   sigcontext_base + SIGCONTEXT_FPCSR);
+  trad_frame_set_reg_addr (this_cache, regs->hi + NUM_REGS,
+			   sigcontext_base + SIGCONTEXT_HI);
+  trad_frame_set_reg_addr (this_cache, regs->lo + NUM_REGS,
+			   sigcontext_base + SIGCONTEXT_LO);
+  trad_frame_set_reg_addr (this_cache, regs->cause + NUM_REGS,
+			   sigcontext_base + SIGCONTEXT_CAUSE);
+  trad_frame_set_reg_addr (this_cache, regs->badvaddr + NUM_REGS,
+			   sigcontext_base + SIGCONTEXT_BADVADDR);
+
+  /* Choice of the bottom of the sigframe is somewhat arbitrary.  */
+  trad_frame_set_id (this_cache,
+		     frame_id_build (func - SIGFRAME_CODE_OFFSET, func));
+}
+
+/* *INDENT-OFF* */
+/* For N32/N64 things look different.  There is no non-rt signal frame.
+
+  struct rt_sigframe_n32 {
+    u32 rs_ass[4];                  [ argument save space for o32 ]
+    u32 rs_code[2];                 [ signal trampoline ]
+    struct siginfo rs_info;
+    struct ucontextn32 rs_uc;
+  };
+
+  struct ucontextn32 {
+    u32                 uc_flags;
+    s32                 uc_link;
+    stack32_t           uc_stack;
+    struct sigcontext   uc_mcontext;
+    sigset_t            uc_sigmask;   [ mask last for extensibility ]
+  };
+                                
+  struct rt_sigframe_n32 {
+    u32 rs_ass[4];                  [ argument save space for o32 ]
+    u32 rs_code[2];                 [ signal trampoline ]
+    struct siginfo rs_info;
+    struct ucontext rs_uc;
+  };
+
+  struct ucontext {
+    unsigned long     uc_flags;
+    struct ucontext  *uc_link;
+    stack_t           uc_stack;
+    struct sigcontext uc_mcontext;
+    sigset_t          uc_sigmask;   [ mask last for extensibility ]
+  };
+
+  And the sigcontext is different (this is for both n32 and n64):
+
+  struct sigcontext {
+    unsigned long long sc_regs[32];
+    unsigned long long sc_fpregs[32];
+    unsigned long long sc_mdhi;
+    unsigned long long sc_mdlo;
+    unsigned long long sc_pc;
+    unsigned int       sc_status;
+    unsigned int       sc_fpc_csr;
+    unsigned int       sc_fpc_eir;
+    unsigned int       sc_used_math;
+    unsigned int       sc_cause;
+    unsigned int       sc_badvaddr;
+  };  */
+/* *INDENT-ON* */
+
+#define N32_STACK_T_SIZE		STACK_T_SIZE
+#define N64_STACK_T_SIZE		(2 * 8 + 4)
+#define N32_UCONTEXT_SIGCONTEXT_OFFSET  (2 * 4 + N32_STACK_T_SIZE + 4)
+#define N64_UCONTEXT_SIGCONTEXT_OFFSET  (2 * 8 + N64_STACK_T_SIZE + 4)
+#define N32_SIGFRAME_SIGCONTEXT_OFFSET	(SIGFRAME_SIGCONTEXT_OFFSET \
+					 + RTSIGFRAME_SIGINFO_SIZE \
+					 + N32_UCONTEXT_SIGCONTEXT_OFFSET)
+#define N64_SIGFRAME_SIGCONTEXT_OFFSET	(SIGFRAME_SIGCONTEXT_OFFSET \
+					 + RTSIGFRAME_SIGINFO_SIZE \
+					 + N64_UCONTEXT_SIGCONTEXT_OFFSET)
+
+#define N64_SIGCONTEXT_REGS     (0 * 8)
+#define N64_SIGCONTEXT_FPREGS   (32 * 8)
+#define N64_SIGCONTEXT_HI       (64 * 8)
+#define N64_SIGCONTEXT_LO       (65 * 8)
+#define N64_SIGCONTEXT_PC       (66 * 8)
+#define N64_SIGCONTEXT_FPCSR    (67 * 8 + 1 * 4)
+#define N64_SIGCONTEXT_FIR      (67 * 8 + 2 * 4)
+#define N64_SIGCONTEXT_CAUSE    (67 * 8 + 4 * 4)
+#define N64_SIGCONTEXT_BADVADDR (67 * 8 + 5 * 4)
+
+#define N64_SIGCONTEXT_REG_SIZE 8
+  
+static void
+mips_linux_n32n64_sigframe_init (const struct tramp_frame *self,
+				 struct frame_info *next_frame,
+				 struct trad_frame_cache *this_cache,
+				 CORE_ADDR func)
+{
+  int ireg, reg_position;
+  CORE_ADDR sigcontext_base = func - SIGFRAME_CODE_OFFSET;
+  const struct mips_regnum *regs = mips_regnum (current_gdbarch);
+
+  if (self == &mips_linux_n32_rt_sigframe)
+    sigcontext_base += N32_SIGFRAME_SIGCONTEXT_OFFSET;
+  else
+    sigcontext_base += N64_SIGFRAME_SIGCONTEXT_OFFSET;
+    
+#if 0
+  trad_frame_set_reg_addr (this_cache, ORIG_ZERO_REGNUM + NUM_REGS,
+			   sigcontext_base + N64_SIGCONTEXT_REGS);
+#endif
+
+  for (ireg = 1; ireg < 32; ireg++)
+    trad_frame_set_reg_addr (this_cache, ireg + ZERO_REGNUM + NUM_REGS,
+			     sigcontext_base + N64_SIGCONTEXT_REGS
+			     + ireg * N64_SIGCONTEXT_REG_SIZE);
+
+  for (ireg = 0; ireg < 32; ireg++)
+    trad_frame_set_reg_addr (this_cache, ireg + regs->fp0 + NUM_REGS,
+			     sigcontext_base + N64_SIGCONTEXT_FPREGS
+			     + ireg * N64_SIGCONTEXT_REG_SIZE);
+
+  trad_frame_set_reg_addr (this_cache, regs->pc + NUM_REGS,
+			   sigcontext_base + N64_SIGCONTEXT_PC);
+
+  trad_frame_set_reg_addr (this_cache, regs->fp_control_status + NUM_REGS,
+			   sigcontext_base + N64_SIGCONTEXT_FPCSR);
+  trad_frame_set_reg_addr (this_cache, regs->hi + NUM_REGS,
+			   sigcontext_base + N64_SIGCONTEXT_HI);
+  trad_frame_set_reg_addr (this_cache, regs->lo + NUM_REGS,
+			   sigcontext_base + N64_SIGCONTEXT_LO);
+  trad_frame_set_reg_addr (this_cache, regs->cause + NUM_REGS,
+			   sigcontext_base + N64_SIGCONTEXT_CAUSE);
+  trad_frame_set_reg_addr (this_cache, regs->badvaddr + NUM_REGS,
+			   sigcontext_base + N64_SIGCONTEXT_BADVADDR);
+
+  /* Choice of the bottom of the sigframe is somewhat arbitrary.  */
+  trad_frame_set_id (this_cache,
+		     frame_id_build (func - SIGFRAME_CODE_OFFSET, func));
+}
+
+/* Initialize one of the GNU/Linux OS ABIs.  */
+
 static void
 mips_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -811,6 +1120,8 @@
 	set_solib_svr4_fetch_link_map_offsets
 	  (gdbarch, mips_linux_svr4_fetch_link_map_offsets);
 	set_mips_linux_register_addr (gdbarch, mips_linux_register_addr);
+	tramp_frame_prepend_unwinder (gdbarch, &mips_linux_o32_sigframe);
+	tramp_frame_prepend_unwinder (gdbarch, &mips_linux_o32_rt_sigframe);
 	break;
       case MIPS_ABI_N32:
 	set_gdbarch_get_longjmp_target (gdbarch,
@@ -818,6 +1129,7 @@
 	set_solib_svr4_fetch_link_map_offsets
 	  (gdbarch, mips_linux_svr4_fetch_link_map_offsets);
 	set_mips_linux_register_addr (gdbarch, mips64_linux_register_addr);
+	tramp_frame_prepend_unwinder (gdbarch, &mips_linux_n32_rt_sigframe);
 	break;
       case MIPS_ABI_N64:
 	set_gdbarch_get_longjmp_target (gdbarch,
@@ -825,6 +1137,7 @@
 	set_solib_svr4_fetch_link_map_offsets
 	  (gdbarch, mips64_linux_svr4_fetch_link_map_offsets);
 	set_mips_linux_register_addr (gdbarch, mips64_linux_register_addr);
+	tramp_frame_prepend_unwinder (gdbarch, &mips_linux_n64_rt_sigframe);
 	break;
       default:
 	internal_error (__FILE__, __LINE__, "can't handle ABI");
@@ -854,5 +1167,5 @@
 			      mips_linux_init_abi);
     }
 
-  add_core_fns (&regset_core_fns);
+  deprecated_add_core_fns (&regset_core_fns);
 }
diff --git a/gdb/mips-nat.c b/gdb/mips-nat.c
index 626f770..39f1f77 100644
--- a/gdb/mips-nat.c
+++ b/gdb/mips-nat.c
@@ -250,5 +250,5 @@
 void
 _initialize_core_mips (void)
 {
-  add_core_fns (&mips_core_fns);
+  deprecated_add_core_fns (&mips_core_fns);
 }
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 563a7d8..454296d 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -53,6 +53,9 @@
 #include "frame-unwind.h"
 #include "frame-base.h"
 #include "trad-frame.h"
+#include "infcall.h"
+
+static const struct objfile_data *mips_pdr_data;
 
 static void set_reg_offset (CORE_ADDR *saved_regs, int regnum, CORE_ADDR off);
 static struct type *mips_register_type (struct gdbarch *gdbarch, int regnum);
@@ -105,8 +108,7 @@
 };
 
 /* Some MIPS boards don't support floating point while others only
-   support single-precision floating-point operations.  See also
-   FP_REGISTER_DOUBLE. */
+   support single-precision floating-point operations.  */
 
 enum mips_fpu_type
 {
@@ -135,9 +137,6 @@
   enum mips_fpu_type mips_fpu_type;
   int mips_last_arg_regnum;
   int mips_last_fp_arg_regnum;
-  int mips_default_saved_regsize;
-  int mips_fp_register_double;
-  int mips_default_stack_argsize;
   int default_mask_address_p;
   /* Is the target using 64-bit raw integer registers but only
      storing a left-aligned 32-bit value in each?  */
@@ -231,7 +230,7 @@
 }
 
 int
-mips_regsize (struct gdbarch *gdbarch)
+mips_isa_regsize (struct gdbarch *gdbarch)
 {
   return (gdbarch_bfd_arch_info (gdbarch)->bits_per_word
 	  / gdbarch_bfd_arch_info (gdbarch)->bits_per_byte);
@@ -239,16 +238,30 @@
 
 /* Return the currently configured (or set) saved register size. */
 
-static const char *mips_saved_regsize_string = size_auto;
+static const char *mips_abi_regsize_string = size_auto;
 
 static unsigned int
-mips_saved_regsize (struct gdbarch_tdep *tdep)
+mips_abi_regsize (struct gdbarch *gdbarch)
 {
-  if (mips_saved_regsize_string == size_auto)
-    return tdep->mips_default_saved_regsize;
-  else if (mips_saved_regsize_string == size_64)
+  if (mips_abi_regsize_string == size_auto)
+    switch (mips_abi (gdbarch))
+      {
+      case MIPS_ABI_EABI32:
+      case MIPS_ABI_O32:
+	return 4;
+      case MIPS_ABI_N32:
+      case MIPS_ABI_N64:
+      case MIPS_ABI_O64:
+      case MIPS_ABI_EABI64:
+	return 8;
+      case MIPS_ABI_UNKNOWN:
+      case MIPS_ABI_LAST:
+      default:
+	internal_error (__FILE__, __LINE__, "bad switch");
+      }
+  else if (mips_abi_regsize_string == size_64)
     return 8;
-  else				/* if (mips_saved_regsize_string == size_32) */
+  else				/* if (mips_abi_regsize_string == size_32) */
     return 4;
 }
 
@@ -361,22 +374,17 @@
   return 0;
 }
 
-/* Indicate that the ABI makes use of double-precision registers
-   provided by the FPU (rather than combining pairs of registers to
-   form double-precision values).  See also MIPS_FPU_TYPE.  */
-#define FP_REGISTER_DOUBLE (gdbarch_tdep (current_gdbarch)->mips_fp_register_double)
-
 /* The amount of space reserved on the stack for registers. This is
-   different to MIPS_SAVED_REGSIZE as it determines the alignment of
+   different to MIPS_ABI_REGSIZE as it determines the alignment of
    data allocated after the registers have run out. */
 
 static const char *mips_stack_argsize_string = size_auto;
 
 static unsigned int
-mips_stack_argsize (struct gdbarch_tdep *tdep)
+mips_stack_argsize (struct gdbarch *gdbarch)
 {
   if (mips_stack_argsize_string == size_auto)
-    return tdep->mips_default_stack_argsize;
+    return mips_abi_regsize (gdbarch);
   else if (mips_stack_argsize_string == size_64)
     return 8;
   else				/* if (mips_stack_argsize_string == size_32) */
@@ -692,16 +700,16 @@
       && (regnum % NUM_REGS) < mips_regnum (current_gdbarch)->fp0 + 32)
     {
       /* The floating-point registers raw, or cooked, always match
-         mips_regsize(), and also map 1:1, byte for byte.  */
+         mips_isa_regsize(), and also map 1:1, byte for byte.  */
       switch (gdbarch_byte_order (gdbarch))
 	{
 	case BFD_ENDIAN_BIG:
-	  if (mips_regsize (gdbarch) == 4)
+	  if (mips_isa_regsize (gdbarch) == 4)
 	    return builtin_type_ieee_single_big;
 	  else
 	    return builtin_type_ieee_double_big;
 	case BFD_ENDIAN_LITTLE:
-	  if (mips_regsize (gdbarch) == 4)
+	  if (mips_isa_regsize (gdbarch) == 4)
 	    return builtin_type_ieee_single_little;
 	  else
 	    return builtin_type_ieee_double_little;
@@ -710,24 +718,38 @@
 	  internal_error (__FILE__, __LINE__, "bad switch");
 	}
     }
-  else if (regnum >=
-	   (NUM_REGS + mips_regnum (current_gdbarch)->fp_control_status)
-	   && regnum <= NUM_REGS + LAST_EMBED_REGNUM)
-    /* The pseudo/cooked view of the embedded registers is always
-       32-bit.  The raw view is handled below.  */
-    return builtin_type_int32;
-  else if (regnum >= NUM_REGS && mips_regsize (gdbarch)
-	   && gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p)
-    /* The target, while using a 64-bit register buffer, is only
-       transfering 32-bits of each integer register.  Reflect this in
-       the cooked/pseudo register value.  */
-    return builtin_type_int32;
-  else if (mips_regsize (gdbarch) == 8)
-    /* 64-bit ISA.  */
-    return builtin_type_int64;
+  else if (regnum < NUM_REGS)
+    {
+      /* The raw or ISA registers.  These are all sized according to
+	 the ISA regsize.  */
+      if (mips_isa_regsize (gdbarch) == 4)
+	return builtin_type_int32;
+      else
+	return builtin_type_int64;
+    }
   else
-    /* 32-bit ISA.  */
-    return builtin_type_int32;
+    {
+      /* The cooked or ABI registers.  These are sized according to
+	 the ABI (with a few complications).  */
+      if (regnum >= (NUM_REGS
+		     + mips_regnum (current_gdbarch)->fp_control_status)
+	  && regnum <= NUM_REGS + LAST_EMBED_REGNUM)
+	/* The pseudo/cooked view of the embedded registers is always
+	   32-bit.  The raw view is handled below.  */
+	return builtin_type_int32;
+      else if (gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p)
+	/* The target, while possibly using a 64-bit register buffer,
+	   is only transfering 32-bits of each integer register.
+	   Reflect this in the cooked/pseudo (ABI) register value.  */
+	return builtin_type_int32;
+      else if (mips_abi_regsize (gdbarch) == 4)
+	/* The ABI is restricted to 32-bit registers (the ISA could be
+	   32- or 64-bit).  */
+	return builtin_type_int32;
+      else
+	/* 64-bit ABI.  */
+	return builtin_type_int64;
+    }
 }
 
 /* TARGET_READ_SP -- Remove useless bits from the stack pointer.  */
@@ -735,7 +757,7 @@
 static CORE_ADDR
 mips_read_sp (void)
 {
-  return read_signed_register (SP_REGNUM);
+  return read_signed_register (MIPS_SP_REGNUM);
 }
 
 /* Should the upper word of 64-bit addresses be zeroed? */
@@ -827,7 +849,7 @@
 static struct frame_id
 mips_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
 {
-  return frame_id_build (frame_unwind_register_signed (next_frame, NUM_REGS + SP_REGNUM),
+  return frame_id_build (frame_unwind_register_signed (next_frame, NUM_REGS + MIPS_SP_REGNUM),
 			 frame_pc_unwind (next_frame));
 }
 
@@ -858,7 +880,7 @@
     {
       /* If function is frameless, then we need to do it the hard way.  I
          strongly suspect that frameless always means prologueless... */
-      if (PROC_FRAME_REG (proc_desc) == SP_REGNUM
+      if (PROC_FRAME_REG (proc_desc) == MIPS_SP_REGNUM
 	  && PROC_FRAME_OFFSET (proc_desc) == 0)
 	return 0;
     }
@@ -1572,7 +1594,7 @@
       if (gen_mask & 0x80000000)
 	{
 	  cache->saved_regs[NUM_REGS + ireg].addr = reg_position;
-	  reg_position -= mips_saved_regsize (tdep);
+	  reg_position -= mips_abi_regsize (gdbarch);
 	}
   }
 
@@ -1593,7 +1615,7 @@
 	  CORE_ADDR reg_position = (cache->base
 				    + PROC_REG_OFFSET (proc_desc));
 	  if (inst & 0x20)
-	    reg_position -= mips_saved_regsize (tdep);
+	    reg_position -= mips_abi_regsize (gdbarch);
 
 	  /* Check if the s0 and s1 registers were pushed on the
 	     stack.  */
@@ -1602,7 +1624,7 @@
 	  for (reg = 16; reg < sreg_count + 16; reg++)
 	    {
 	      cache->saved_regs[NUM_REGS + reg].addr = reg_position;
-	      reg_position -= mips_saved_regsize (tdep);
+	      reg_position -= mips_abi_regsize (gdbarch);
 	    }
 	}
     }
@@ -1618,7 +1640,7 @@
     for (ireg = MIPS_NUMREGS - 1; float_mask; --ireg, float_mask <<= 1)
       if (float_mask & 0x80000000)
 	{
-	  if (mips_saved_regsize (tdep) == 4
+	  if (mips_abi_regsize (gdbarch) == 4
 	      && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
 	    {
 	      /* On a big endian 32 bit ABI, floating point registers
@@ -1645,15 +1667,15 @@
 	         loop).  */
 	      if ((ireg & 1))
 		cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->fp0 + ireg]
-		  .addr = reg_position - mips_saved_regsize (tdep);
+		  .addr = reg_position - mips_abi_regsize (gdbarch);
 	      else
 		cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->fp0 + ireg]
-		  .addr = reg_position + mips_saved_regsize (tdep);
+		  .addr = reg_position + mips_abi_regsize (gdbarch);
 	    }
 	  else
 	    cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->fp0 + ireg]
 	      .addr = reg_position;
-	  reg_position -= mips_saved_regsize (tdep);
+	  reg_position -= mips_abi_regsize (gdbarch);
 	}
 
     cache->saved_regs[NUM_REGS + mips_regnum (current_gdbarch)->pc]
@@ -1661,7 +1683,7 @@
   }
 
   /* SP_REGNUM, contains the value and not the address.  */
-  trad_frame_set_value (cache->saved_regs, NUM_REGS + SP_REGNUM, cache->base);
+  trad_frame_set_value (cache->saved_regs, NUM_REGS + MIPS_SP_REGNUM, cache->base);
 
   return (*this_cache);
 }
@@ -1734,8 +1756,8 @@
       regcache_cooked_read_signed (current_regcache, regno, &val);
       return val;
     }
-  else if ((regno % NUM_REGS) == SP_REGNUM)
-    /* The SP_REGNUM is special, its value is stored in saved_regs.
+  else if ((regno % NUM_REGS) == MIPS_SP_REGNUM)
+    /* MIPS_SP_REGNUM is special, its value is stored in saved_regs.
        In fact, it is so special that it can even only be fetched
        using a raw register number!  Once this code as been converted
        to frame-unwind the problem goes away.  */
@@ -1884,9 +1906,8 @@
 	  {
 	    static int blurb_printed = 0;
 
-	    warning
-	      ("Warning: GDB can't find the start of the function at 0x%s.",
-	       paddr_nz (pc));
+	    warning ("GDB can't find the start of the function at 0x%s.",
+		     paddr_nz (pc));
 
 	    if (!blurb_printed)
 	      {
@@ -2098,7 +2119,7 @@
 	{
 	  PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
 	  set_reg_offset (temp_saved_regs, reg, sp + offset);
-	  offset += mips_saved_regsize (tdep);
+	  offset += mips_abi_regsize (current_gdbarch);
 	}
 
       /* Check if the ra register was pushed on the stack.  */
@@ -2107,7 +2128,7 @@
 	{
 	  PROC_REG_MASK (&temp_proc_desc) |= 1 << RA_REGNUM;
 	  set_reg_offset (temp_saved_regs, RA_REGNUM, sp + offset);
-	  offset -= mips_saved_regsize (tdep);
+	  offset -= mips_abi_regsize (current_gdbarch);
 	}
 
       /* Check if the s0 and s1 registers were pushed on the stack.  */
@@ -2115,7 +2136,7 @@
 	{
 	  PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
 	  set_reg_offset (temp_saved_regs, reg, sp + offset);
-	  offset -= mips_saved_regsize (tdep);
+	  offset -= mips_abi_regsize (current_gdbarch);
 	}
     }
 }
@@ -2163,19 +2184,17 @@
 	}
       else if ((high_word & 0xFFE0) == 0xffa0)	/* sd reg,offset($sp) */
 	{
-	  /* Irix 6.2 N32 ABI uses sd instructions for saving $gp and $ra,
-	     but the register size used is only 32 bits. Make the address
-	     for the saved register point to the lower 32 bits.  */
+	  /* Irix 6.2 N32 ABI uses sd instructions for saving $gp and
+	     $ra.  */
 	  PROC_REG_MASK (&temp_proc_desc) |= 1 << reg;
-	  set_reg_offset (temp_saved_regs, reg,
-			  sp + low_word + 8 - mips_regsize (current_gdbarch));
+	  set_reg_offset (temp_saved_regs, reg, sp + low_word);
 	}
       else if (high_word == 0x27be)	/* addiu $30,$sp,size */
 	{
 	  /* Old gcc frame, r30 is virtual frame pointer.  */
 	  if ((long) low_word != PROC_FRAME_OFFSET (&temp_proc_desc))
 	    frame_addr = sp + low_word;
-	  else if (PROC_FRAME_REG (&temp_proc_desc) == SP_REGNUM)
+	  else if (PROC_FRAME_REG (&temp_proc_desc) == MIPS_SP_REGNUM)
 	    {
 	      unsigned alloca_adjust;
 	      PROC_FRAME_REG (&temp_proc_desc) = 30;
@@ -2198,7 +2217,7 @@
       else if (inst == 0x03A0F021 || inst == 0x03a0f025 || inst == 0x03a0f02d)
 	{
 	  /* New gcc frame, virtual frame pointer is at r30 + frame_size.  */
-	  if (PROC_FRAME_REG (&temp_proc_desc) == SP_REGNUM)
+	  if (PROC_FRAME_REG (&temp_proc_desc) == MIPS_SP_REGNUM)
 	    {
 	      unsigned alloca_adjust;
 	      PROC_FRAME_REG (&temp_proc_desc) = 30;
@@ -2230,7 +2249,7 @@
   CORE_ADDR sp;
 
   if (cur_frame)
-    sp = read_next_frame_reg (next_frame, NUM_REGS + SP_REGNUM);
+    sp = read_next_frame_reg (next_frame, NUM_REGS + MIPS_SP_REGNUM);
   else
     sp = 0;
 
@@ -2240,7 +2259,7 @@
   temp_saved_regs = xrealloc (temp_saved_regs, SIZEOF_FRAME_SAVED_REGS);
   memset (temp_saved_regs, '\0', SIZEOF_FRAME_SAVED_REGS);
   PROC_LOW_ADDR (&temp_proc_desc) = start_pc;
-  PROC_FRAME_REG (&temp_proc_desc) = SP_REGNUM;
+  PROC_FRAME_REG (&temp_proc_desc) = MIPS_SP_REGNUM;
   PROC_PC_REG (&temp_proc_desc) = RA_REGNUM;
 
   if (start_pc + 200 < limit_pc)
@@ -2286,9 +2305,6 @@
   struct obj_section *sec;
   struct mips_objfile_private *priv;
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0))
-    return NULL;
-
   find_pc_partial_function (pc, NULL, &startaddr, NULL);
   if (addrptr)
     *addrptr = startaddr;
@@ -2298,7 +2314,7 @@
   sec = find_pc_section (pc);
   if (sec != NULL)
     {
-      priv = (struct mips_objfile_private *) sec->objfile->obj_private;
+      priv = (struct mips_objfile_private *) objfile_data (sec->objfile, mips_pdr_data);
 
       /* Search the ".pdr" section generated by GAS.  This includes most of
          the information normally found in ECOFF PDRs.  */
@@ -2316,7 +2332,7 @@
 	  priv = obstack_alloc (&sec->objfile->objfile_obstack,
 				sizeof (struct mips_objfile_private));
 	  priv->size = 0;
-	  sec->objfile->obj_private = priv;
+	  set_objfile_data (sec->objfile, mips_pdr_data, priv);
 	}
       else if (priv == NULL)
 	{
@@ -2344,7 +2360,7 @@
 	  else
 	    priv->size = 0;
 
-	  sec->objfile->obj_private = priv;
+	  set_objfile_data (sec->objfile, mips_pdr_data, priv);
 	}
       the_bfd = NULL;
 
@@ -2632,10 +2648,10 @@
       && ((MIPS_FPU_TYPE == MIPS_FPU_DOUBLE && (len == 4 || len == 8))
 	  || (MIPS_FPU_TYPE == MIPS_FPU_SINGLE && len == 4)))
     {
-      if (!FP_REGISTER_DOUBLE && len == 8)
+      if (mips_abi_regsize (current_gdbarch) < 8 && len == 8)
 	{
 	  /* We need to break a 64bit float in two 32 bit halves and
-	     spread them across a floating-point register pair. */
+	     spread them across a floating-point register pair.  */
 	  lo->buf_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
 	  hi->buf_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 0 : 4;
 	  lo->reg_offset = ((TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
@@ -2673,22 +2689,22 @@
       lo->reg = regnum + 0;
       hi->reg = regnum + 1;
       if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
-	  && len < mips_saved_regsize (tdep))
+	  && len < mips_abi_regsize (current_gdbarch))
 	{
 	  /* "un-left-justify" the value in the low register */
-	  lo->reg_offset = mips_saved_regsize (tdep) - len;
+	  lo->reg_offset = mips_abi_regsize (current_gdbarch) - len;
 	  lo->len = len;
 	  hi->reg_offset = 0;
 	  hi->len = 0;
 	}
-      else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && len > mips_saved_regsize (tdep)	/* odd-size structs */
-	       && len < mips_saved_regsize (tdep) * 2
+      else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG && len > mips_abi_regsize (current_gdbarch)	/* odd-size structs */
+	       && len < mips_abi_regsize (current_gdbarch) * 2
 	       && (TYPE_CODE (valtype) == TYPE_CODE_STRUCT ||
 		   TYPE_CODE (valtype) == TYPE_CODE_UNION))
 	{
 	  /* "un-left-justify" the value spread across two registers. */
-	  lo->reg_offset = 2 * mips_saved_regsize (tdep) - len;
-	  lo->len = mips_saved_regsize (tdep) - lo->reg_offset;
+	  lo->reg_offset = 2 * mips_abi_regsize (current_gdbarch) - len;
+	  lo->len = mips_abi_regsize (current_gdbarch) - lo->reg_offset;
 	  hi->reg_offset = 0;
 	  hi->len = len - lo->len;
 	}
@@ -2697,10 +2713,10 @@
 	  /* Only perform a partial copy of the second register. */
 	  lo->reg_offset = 0;
 	  hi->reg_offset = 0;
-	  if (len > mips_saved_regsize (tdep))
+	  if (len > mips_abi_regsize (current_gdbarch))
 	    {
-	      lo->len = mips_saved_regsize (tdep);
-	      hi->len = len - mips_saved_regsize (tdep);
+	      lo->len = mips_abi_regsize (current_gdbarch);
+	      hi->len = len - mips_abi_regsize (current_gdbarch);
 	    }
 	  else
 	    {
@@ -2710,7 +2726,7 @@
 	}
       if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
 	  && register_size (current_gdbarch, regnum) == 8
-	  && mips_saved_regsize (tdep) == 4)
+	  && mips_abi_regsize (current_gdbarch) == 4)
 	{
 	  /* Account for the fact that only the least-signficant part
 	     of the register is being used */
@@ -2728,7 +2744,7 @@
 mips_eabi_use_struct_convention (int gcc_p, struct type *type)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-  return (TYPE_LENGTH (type) > 2 * mips_saved_regsize (tdep));
+  return (TYPE_LENGTH (type) > 2 * mips_abi_regsize (current_gdbarch));
 }
 
 /* Should call_function pass struct by reference? 
@@ -2743,13 +2759,13 @@
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
   if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
-    return (len > mips_saved_regsize (tdep));
+    return (len > mips_abi_regsize (current_gdbarch));
 
   return 0;
 }
 
 static CORE_ADDR
-mips_eabi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			   struct regcache *regcache, CORE_ADDR bp_addr,
 			   int nargs, struct value **args, CORE_ADDR sp,
 			   int struct_return, CORE_ADDR struct_addr)
@@ -2760,6 +2776,7 @@
   int len = 0;
   int stack_offset = 0;
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   /* For shared libraries, "t9" needs to point at the function
      address.  */
@@ -2783,7 +2800,7 @@
      passed in registers, but that's OK.  */
   for (argnum = 0; argnum < nargs; argnum++)
     len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
-		     mips_stack_argsize (tdep));
+		     mips_stack_argsize (gdbarch));
   sp -= align_up (len, 16);
 
   if (mips_debug)
@@ -2824,13 +2841,13 @@
 
       /* The EABI passes structures that do not fit in a register by
          reference.  */
-      if (len > mips_saved_regsize (tdep)
+      if (len > mips_abi_regsize (gdbarch)
 	  && (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION))
 	{
-	  store_unsigned_integer (valbuf, mips_saved_regsize (tdep),
+	  store_unsigned_integer (valbuf, mips_abi_regsize (gdbarch),
 				  VALUE_ADDRESS (arg));
 	  typecode = TYPE_CODE_PTR;
-	  len = mips_saved_regsize (tdep);
+	  len = mips_abi_regsize (gdbarch);
 	  val = valbuf;
 	  if (mips_debug)
 	    fprintf_unfiltered (gdb_stdlog, " push");
@@ -2843,7 +2860,8 @@
          up before the check to see if there are any FP registers
          left.  Non MIPS_EABI targets also pass the FP in the integer
          registers so also round up normal registers.  */
-      if (!FP_REGISTER_DOUBLE && fp_register_arg_p (typecode, arg_type))
+      if (mips_abi_regsize (gdbarch) < 8
+	  && fp_register_arg_p (typecode, arg_type))
 	{
 	  if ((float_argreg & 1))
 	    float_argreg++;
@@ -2864,7 +2882,7 @@
       if (fp_register_arg_p (typecode, arg_type)
 	  && float_argreg <= MIPS_LAST_FP_ARG_REGNUM)
 	{
-	  if (!FP_REGISTER_DOUBLE && len == 8)
+	  if (mips_abi_regsize (gdbarch) < 8 && len == 8)
 	    {
 	      int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
 	      unsigned long regval;
@@ -2902,12 +2920,12 @@
 	     register-sized pieces.  Large arguments are split between
 	     registers and stack.  */
 	  /* Note: structs whose size is not a multiple of
-	     mips_regsize() are treated specially: Irix cc passes them
-	     in registers where gcc sometimes puts them on the stack.
-	     For maximum compatibility, we will put them in both
-	     places.  */
-	  int odd_sized_struct = ((len > mips_saved_regsize (tdep))
-				  && (len % mips_saved_regsize (tdep) != 0));
+	     mips_abi_regsize() are treated specially: Irix cc passes
+	     them in registers where gcc sometimes puts them on the
+	     stack.  For maximum compatibility, we will put them in
+	     both places.  */
+	  int odd_sized_struct = ((len > mips_abi_regsize (gdbarch))
+				  && (len % mips_abi_regsize (gdbarch) != 0));
 
 	  /* Note: Floating-point values that didn't fit into an FP
 	     register are only written to memory.  */
@@ -2915,8 +2933,8 @@
 	    {
 	      /* Remember if the argument was written to the stack.  */
 	      int stack_used_p = 0;
-	      int partial_len = (len < mips_saved_regsize (tdep)
-				 ? len : mips_saved_regsize (tdep));
+	      int partial_len = (len < mips_abi_regsize (gdbarch)
+				 ? len : mips_abi_regsize (gdbarch));
 
 	      if (mips_debug)
 		fprintf_unfiltered (gdb_stdlog, " -- partial=%d",
@@ -2934,16 +2952,16 @@
 		  stack_used_p = 1;
 		  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
 		    {
-		      if (mips_stack_argsize (tdep) == 8
+		      if (mips_stack_argsize (gdbarch) == 8
 			  && (typecode == TYPE_CODE_INT
 			      || typecode == TYPE_CODE_PTR
 			      || typecode == TYPE_CODE_FLT) && len <= 4)
-			longword_offset = mips_stack_argsize (tdep) - len;
+			longword_offset = mips_stack_argsize (gdbarch) - len;
 		      else if ((typecode == TYPE_CODE_STRUCT
 				|| typecode == TYPE_CODE_UNION)
 			       && (TYPE_LENGTH (arg_type)
-				   < mips_stack_argsize (tdep)))
-			longword_offset = mips_stack_argsize (tdep) - len;
+				   < mips_stack_argsize (gdbarch)))
+			longword_offset = mips_stack_argsize (gdbarch) - len;
 		    }
 
 		  if (mips_debug)
@@ -2985,7 +3003,7 @@
 		    fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
 				      argreg,
 				      phex (regval,
-					    mips_saved_regsize (tdep)));
+					    mips_abi_regsize (gdbarch)));
 		  write_register (argreg, regval);
 		  argreg++;
 		}
@@ -3001,14 +3019,14 @@
 
 	      if (stack_used_p)
 		stack_offset += align_up (partial_len,
-					  mips_stack_argsize (tdep));
+					  mips_stack_argsize (gdbarch));
 	    }
 	}
       if (mips_debug)
 	fprintf_unfiltered (gdb_stdlog, "\n");
     }
 
-  regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
+  regcache_cooked_write_signed (regcache, MIPS_SP_REGNUM, sp);
 
   /* Return adjusted stack pointer.  */
   return sp;
@@ -3066,7 +3084,7 @@
 /* N32/N64 ABI stuff.  */
 
 static CORE_ADDR
-mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			     struct regcache *regcache, CORE_ADDR bp_addr,
 			     int nargs, struct value **args, CORE_ADDR sp,
 			     int struct_return, CORE_ADDR struct_addr)
@@ -3077,6 +3095,7 @@
   int len = 0;
   int stack_offset = 0;
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   /* For shared libraries, "t9" needs to point at the function
      address.  */
@@ -3098,7 +3117,7 @@
   /* Now make space on the stack for the args.  */
   for (argnum = 0; argnum < nargs; argnum++)
     len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
-		     mips_stack_argsize (tdep));
+		     mips_stack_argsize (gdbarch));
   sp -= align_up (len, 16);
 
   if (mips_debug)
@@ -3163,20 +3182,20 @@
 	     register-sized pieces.  Large arguments are split between
 	     registers and stack.  */
 	  /* Note: structs whose size is not a multiple of
-	     mips_regsize() are treated specially: Irix cc passes them
-	     in registers where gcc sometimes puts them on the stack.
-	     For maximum compatibility, we will put them in both
-	     places.  */
-	  int odd_sized_struct = ((len > mips_saved_regsize (tdep))
-				  && (len % mips_saved_regsize (tdep) != 0));
+	     mips_abi_regsize() are treated specially: Irix cc passes
+	     them in registers where gcc sometimes puts them on the
+	     stack.  For maximum compatibility, we will put them in
+	     both places.  */
+	  int odd_sized_struct = ((len > mips_abi_regsize (gdbarch))
+				  && (len % mips_abi_regsize (gdbarch) != 0));
 	  /* Note: Floating-point values that didn't fit into an FP
 	     register are only written to memory.  */
 	  while (len > 0)
 	    {
 	      /* Rememer if the argument was written to the stack.  */
 	      int stack_used_p = 0;
-	      int partial_len = (len < mips_saved_regsize (tdep)
-				 ? len : mips_saved_regsize (tdep));
+	      int partial_len = (len < mips_abi_regsize (gdbarch)
+				 ? len : mips_abi_regsize (gdbarch));
 
 	      if (mips_debug)
 		fprintf_unfiltered (gdb_stdlog, " -- partial=%d",
@@ -3194,11 +3213,11 @@
 		  stack_used_p = 1;
 		  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
 		    {
-		      if (mips_stack_argsize (tdep) == 8
+		      if (mips_stack_argsize (gdbarch) == 8
 			  && (typecode == TYPE_CODE_INT
 			      || typecode == TYPE_CODE_PTR
 			      || typecode == TYPE_CODE_FLT) && len <= 4)
-			longword_offset = mips_stack_argsize (tdep) - len;
+			longword_offset = mips_stack_argsize (gdbarch) - len;
 		    }
 
 		  if (mips_debug)
@@ -3247,10 +3266,10 @@
 
 		     cagney/2001-07-23: gdb/179: Also, GCC, when
 		     outputting LE O32 with sizeof (struct) <
-		     mips_saved_regsize(), generates a left shift as
+		     mips_abi_regsize(), generates a left shift as
 		     part of storing the argument in a register a
 		     register (the left shift isn't generated when
-		     sizeof (struct) >= mips_saved_regsize()).  Since
+		     sizeof (struct) >= mips_abi_regsize()).  Since
 		     it is quite possible that this is GCC
 		     contradicting the LE/O32 ABI, GDB has not been
 		     adjusted to accommodate this.  Either someone
@@ -3260,17 +3279,17 @@
 		     accordingly.  */
 
 		  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
-		      && partial_len < mips_saved_regsize (tdep)
+		      && partial_len < mips_abi_regsize (gdbarch)
 		      && (typecode == TYPE_CODE_STRUCT ||
 			  typecode == TYPE_CODE_UNION))
-		    regval <<= ((mips_saved_regsize (tdep) - partial_len) *
+		    regval <<= ((mips_abi_regsize (gdbarch) - partial_len) *
 				TARGET_CHAR_BIT);
 
 		  if (mips_debug)
 		    fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
 				      argreg,
 				      phex (regval,
-					    mips_saved_regsize (tdep)));
+					    mips_abi_regsize (gdbarch)));
 		  write_register (argreg, regval);
 		  argreg++;
 		}
@@ -3286,14 +3305,14 @@
 
 	      if (stack_used_p)
 		stack_offset += align_up (partial_len,
-					  mips_stack_argsize (tdep));
+					  mips_stack_argsize (gdbarch));
 	    }
 	}
       if (mips_debug)
 	fprintf_unfiltered (gdb_stdlog, "\n");
     }
 
-  regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
+  regcache_cooked_write_signed (regcache, MIPS_SP_REGNUM, sp);
 
   /* Return adjusted stack pointer.  */
   return sp;
@@ -3308,7 +3327,7 @@
   if (TYPE_CODE (type) == TYPE_CODE_STRUCT
       || TYPE_CODE (type) == TYPE_CODE_UNION
       || TYPE_CODE (type) == TYPE_CODE_ARRAY
-      || TYPE_LENGTH (type) > 2 * mips_saved_regsize (tdep))
+      || TYPE_LENGTH (type) > 2 * mips_abi_regsize (gdbarch))
     return RETURN_VALUE_STRUCT_CONVENTION;
   else if (TYPE_CODE (type) == TYPE_CODE_FLT
 	   && tdep->mips_fpu_type != MIPS_FPU_NONE)
@@ -3404,7 +3423,7 @@
 /* O32 ABI stuff.  */
 
 static CORE_ADDR
-mips_o32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			  struct regcache *regcache, CORE_ADDR bp_addr,
 			  int nargs, struct value **args, CORE_ADDR sp,
 			  int struct_return, CORE_ADDR struct_addr)
@@ -3415,6 +3434,7 @@
   int len = 0;
   int stack_offset = 0;
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   /* For shared libraries, "t9" needs to point at the function
      address.  */
@@ -3436,7 +3456,7 @@
   /* Now make space on the stack for the args.  */
   for (argnum = 0; argnum < nargs; argnum++)
     len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
-		     mips_stack_argsize (tdep));
+		     mips_stack_argsize (gdbarch));
   sp -= align_up (len, 16);
 
   if (mips_debug)
@@ -3456,7 +3476,7 @@
 			    "mips_o32_push_dummy_call: struct_return reg=%d 0x%s\n",
 			    argreg, paddr_nz (struct_addr));
       write_register (argreg++, struct_addr);
-      stack_offset += mips_stack_argsize (tdep);
+      stack_offset += mips_stack_argsize (gdbarch);
     }
 
   /* Now load as many as possible of the first arguments into
@@ -3482,7 +3502,8 @@
          up before the check to see if there are any FP registers
          left.  O32/O64 targets also pass the FP in the integer
          registers so also round up normal registers.  */
-      if (!FP_REGISTER_DOUBLE && fp_register_arg_p (typecode, arg_type))
+      if (mips_abi_regsize (gdbarch) < 8
+	  && fp_register_arg_p (typecode, arg_type))
 	{
 	  if ((float_argreg & 1))
 	    float_argreg++;
@@ -3501,7 +3522,7 @@
       if (fp_register_arg_p (typecode, arg_type)
 	  && float_argreg <= MIPS_LAST_FP_ARG_REGNUM)
 	{
-	  if (!FP_REGISTER_DOUBLE && len == 8)
+	  if (mips_abi_regsize (gdbarch) < 8 && len == 8)
 	    {
 	      int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
 	      unsigned long regval;
@@ -3548,10 +3569,10 @@
 		fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
 				    argreg, phex (regval, len));
 	      write_register (argreg, regval);
-	      argreg += FP_REGISTER_DOUBLE ? 1 : 2;
+	      argreg += (mips_abi_regsize (gdbarch) == 8) ? 1 : 2;
 	    }
 	  /* Reserve space for the FP register.  */
-	  stack_offset += align_up (len, mips_stack_argsize (tdep));
+	  stack_offset += align_up (len, mips_stack_argsize (gdbarch));
 	}
       else
 	{
@@ -3559,15 +3580,15 @@
 	     register-sized pieces.  Large arguments are split between
 	     registers and stack.  */
 	  /* Note: structs whose size is not a multiple of
-	     mips_regsize() are treated specially: Irix cc passes them
-	     in registers where gcc sometimes puts them on the stack.
-	     For maximum compatibility, we will put them in both
-	     places.  */
-	  int odd_sized_struct = ((len > mips_saved_regsize (tdep))
-				  && (len % mips_saved_regsize (tdep) != 0));
+	     mips_abi_regsize() are treated specially: Irix cc passes
+	     them in registers where gcc sometimes puts them on the
+	     stack.  For maximum compatibility, we will put them in
+	     both places.  */
+	  int odd_sized_struct = ((len > mips_abi_regsize (gdbarch))
+				  && (len % mips_abi_regsize (gdbarch) != 0));
 	  /* Structures should be aligned to eight bytes (even arg registers)
 	     on MIPS_ABI_O32, if their first member has double precision.  */
-	  if (mips_saved_regsize (tdep) < 8
+	  if (mips_abi_regsize (gdbarch) < 8
 	      && mips_type_needs_double_align (arg_type))
 	    {
 	      if ((argreg & 1))
@@ -3579,8 +3600,8 @@
 	    {
 	      /* Remember if the argument was written to the stack.  */
 	      int stack_used_p = 0;
-	      int partial_len = (len < mips_saved_regsize (tdep)
-				 ? len : mips_saved_regsize (tdep));
+	      int partial_len = (len < mips_abi_regsize (gdbarch)
+				 ? len : mips_abi_regsize (gdbarch));
 
 	      if (mips_debug)
 		fprintf_unfiltered (gdb_stdlog, " -- partial=%d",
@@ -3598,11 +3619,11 @@
 		  stack_used_p = 1;
 		  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
 		    {
-		      if (mips_stack_argsize (tdep) == 8
+		      if (mips_stack_argsize (gdbarch) == 8
 			  && (typecode == TYPE_CODE_INT
 			      || typecode == TYPE_CODE_PTR
 			      || typecode == TYPE_CODE_FLT) && len <= 4)
-			longword_offset = mips_stack_argsize (tdep) - len;
+			longword_offset = mips_stack_argsize (gdbarch) - len;
 		    }
 
 		  if (mips_debug)
@@ -3639,7 +3660,7 @@
 		{
 		  LONGEST regval = extract_signed_integer (val, partial_len);
 		  /* Value may need to be sign extended, because
-		     mips_regsize() != mips_saved_regsize().  */
+		     mips_isa_regsize() != mips_abi_regsize().  */
 
 		  /* A non-floating-point argument being passed in a
 		     general register.  If a struct or union, and if
@@ -3654,10 +3675,10 @@
 
 		     cagney/2001-07-23: gdb/179: Also, GCC, when
 		     outputting LE O32 with sizeof (struct) <
-		     mips_saved_regsize(), generates a left shift as
+		     mips_abi_regsize(), generates a left shift as
 		     part of storing the argument in a register a
 		     register (the left shift isn't generated when
-		     sizeof (struct) >= mips_saved_regsize()).  Since
+		     sizeof (struct) >= mips_abi_regsize()).  Since
 		     it is quite possible that this is GCC
 		     contradicting the LE/O32 ABI, GDB has not been
 		     adjusted to accommodate this.  Either someone
@@ -3666,19 +3687,19 @@
 		     identified as such and GDB gets tweaked
 		     accordingly.  */
 
-		  if (mips_saved_regsize (tdep) < 8
+		  if (mips_abi_regsize (gdbarch) < 8
 		      && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
-		      && partial_len < mips_saved_regsize (tdep)
+		      && partial_len < mips_abi_regsize (gdbarch)
 		      && (typecode == TYPE_CODE_STRUCT ||
 			  typecode == TYPE_CODE_UNION))
-		    regval <<= ((mips_saved_regsize (tdep) - partial_len) *
+		    regval <<= ((mips_abi_regsize (gdbarch) - partial_len) *
 				TARGET_CHAR_BIT);
 
 		  if (mips_debug)
 		    fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
 				      argreg,
 				      phex (regval,
-					    mips_saved_regsize (tdep)));
+					    mips_abi_regsize (gdbarch)));
 		  write_register (argreg, regval);
 		  argreg++;
 
@@ -3699,14 +3720,14 @@
 	         always allocated.  */
 
 	      stack_offset += align_up (partial_len,
-					mips_stack_argsize (tdep));
+					mips_stack_argsize (gdbarch));
 	    }
 	}
       if (mips_debug)
 	fprintf_unfiltered (gdb_stdlog, "\n");
     }
 
-  regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
+  regcache_cooked_write_signed (regcache, MIPS_SP_REGNUM, sp);
 
   /* Return adjusted stack pointer.  */
   return sp;
@@ -3836,9 +3857,9 @@
       int regnum;
       for (offset = 0, regnum = V0_REGNUM;
 	   offset < TYPE_LENGTH (type);
-	   offset += mips_stack_argsize (tdep), regnum++)
+	   offset += mips_stack_argsize (gdbarch), regnum++)
 	{
-	  int xfer = mips_stack_argsize (tdep);
+	  int xfer = mips_stack_argsize (gdbarch);
 	  if (offset + xfer > TYPE_LENGTH (type))
 	    xfer = TYPE_LENGTH (type) - offset;
 	  if (mips_debug)
@@ -3855,7 +3876,7 @@
    ABI.  */
 
 static CORE_ADDR
-mips_o64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			  struct regcache *regcache, CORE_ADDR bp_addr,
 			  int nargs,
 			  struct value **args, CORE_ADDR sp,
@@ -3867,6 +3888,7 @@
   int len = 0;
   int stack_offset = 0;
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   /* For shared libraries, "t9" needs to point at the function
      address.  */
@@ -3888,7 +3910,7 @@
   /* Now make space on the stack for the args.  */
   for (argnum = 0; argnum < nargs; argnum++)
     len += align_up (TYPE_LENGTH (VALUE_TYPE (args[argnum])),
-		     mips_stack_argsize (tdep));
+		     mips_stack_argsize (gdbarch));
   sp -= align_up (len, 16);
 
   if (mips_debug)
@@ -3908,7 +3930,7 @@
 			    "mips_o64_push_dummy_call: struct_return reg=%d 0x%s\n",
 			    argreg, paddr_nz (struct_addr));
       write_register (argreg++, struct_addr);
-      stack_offset += mips_stack_argsize (tdep);
+      stack_offset += mips_stack_argsize (gdbarch);
     }
 
   /* Now load as many as possible of the first arguments into
@@ -3934,7 +3956,8 @@
          up before the check to see if there are any FP registers
          left.  O32/O64 targets also pass the FP in the integer
          registers so also round up normal registers.  */
-      if (!FP_REGISTER_DOUBLE && fp_register_arg_p (typecode, arg_type))
+      if (mips_abi_regsize (gdbarch) < 8
+	  && fp_register_arg_p (typecode, arg_type))
 	{
 	  if ((float_argreg & 1))
 	    float_argreg++;
@@ -3953,7 +3976,7 @@
       if (fp_register_arg_p (typecode, arg_type)
 	  && float_argreg <= MIPS_LAST_FP_ARG_REGNUM)
 	{
-	  if (!FP_REGISTER_DOUBLE && len == 8)
+	  if (mips_abi_regsize (gdbarch) < 8 && len == 8)
 	    {
 	      int low_offset = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? 4 : 0;
 	      unsigned long regval;
@@ -4000,10 +4023,10 @@
 		fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s",
 				    argreg, phex (regval, len));
 	      write_register (argreg, regval);
-	      argreg += FP_REGISTER_DOUBLE ? 1 : 2;
+	      argreg += (mips_abi_regsize (gdbarch) == 8) ? 1 : 2;
 	    }
 	  /* Reserve space for the FP register.  */
-	  stack_offset += align_up (len, mips_stack_argsize (tdep));
+	  stack_offset += align_up (len, mips_stack_argsize (gdbarch));
 	}
       else
 	{
@@ -4011,15 +4034,15 @@
 	     register-sized pieces.  Large arguments are split between
 	     registers and stack.  */
 	  /* Note: structs whose size is not a multiple of
-	     mips_regsize() are treated specially: Irix cc passes them
-	     in registers where gcc sometimes puts them on the stack.
-	     For maximum compatibility, we will put them in both
-	     places.  */
-	  int odd_sized_struct = ((len > mips_saved_regsize (tdep))
-				  && (len % mips_saved_regsize (tdep) != 0));
+	     mips_abi_regsize() are treated specially: Irix cc passes
+	     them in registers where gcc sometimes puts them on the
+	     stack.  For maximum compatibility, we will put them in
+	     both places.  */
+	  int odd_sized_struct = ((len > mips_abi_regsize (gdbarch))
+				  && (len % mips_abi_regsize (gdbarch) != 0));
 	  /* Structures should be aligned to eight bytes (even arg registers)
 	     on MIPS_ABI_O32, if their first member has double precision.  */
-	  if (mips_saved_regsize (tdep) < 8
+	  if (mips_abi_regsize (gdbarch) < 8
 	      && mips_type_needs_double_align (arg_type))
 	    {
 	      if ((argreg & 1))
@@ -4031,8 +4054,8 @@
 	    {
 	      /* Remember if the argument was written to the stack.  */
 	      int stack_used_p = 0;
-	      int partial_len = (len < mips_saved_regsize (tdep)
-				 ? len : mips_saved_regsize (tdep));
+	      int partial_len = (len < mips_abi_regsize (gdbarch)
+				 ? len : mips_abi_regsize (gdbarch));
 
 	      if (mips_debug)
 		fprintf_unfiltered (gdb_stdlog, " -- partial=%d",
@@ -4050,11 +4073,11 @@
 		  stack_used_p = 1;
 		  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
 		    {
-		      if (mips_stack_argsize (tdep) == 8
+		      if (mips_stack_argsize (gdbarch) == 8
 			  && (typecode == TYPE_CODE_INT
 			      || typecode == TYPE_CODE_PTR
 			      || typecode == TYPE_CODE_FLT) && len <= 4)
-			longword_offset = mips_stack_argsize (tdep) - len;
+			longword_offset = mips_stack_argsize (gdbarch) - len;
 		    }
 
 		  if (mips_debug)
@@ -4091,7 +4114,7 @@
 		{
 		  LONGEST regval = extract_signed_integer (val, partial_len);
 		  /* Value may need to be sign extended, because
-		     mips_regsize() != mips_saved_regsize().  */
+		     mips_isa_regsize() != mips_abi_regsize().  */
 
 		  /* A non-floating-point argument being passed in a
 		     general register.  If a struct or union, and if
@@ -4106,10 +4129,10 @@
 
 		     cagney/2001-07-23: gdb/179: Also, GCC, when
 		     outputting LE O32 with sizeof (struct) <
-		     mips_saved_regsize(), generates a left shift as
+		     mips_abi_regsize(), generates a left shift as
 		     part of storing the argument in a register a
 		     register (the left shift isn't generated when
-		     sizeof (struct) >= mips_saved_regsize()).  Since
+		     sizeof (struct) >= mips_abi_regsize()).  Since
 		     it is quite possible that this is GCC
 		     contradicting the LE/O32 ABI, GDB has not been
 		     adjusted to accommodate this.  Either someone
@@ -4118,19 +4141,19 @@
 		     identified as such and GDB gets tweaked
 		     accordingly.  */
 
-		  if (mips_saved_regsize (tdep) < 8
+		  if (mips_abi_regsize (gdbarch) < 8
 		      && TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
-		      && partial_len < mips_saved_regsize (tdep)
+		      && partial_len < mips_abi_regsize (gdbarch)
 		      && (typecode == TYPE_CODE_STRUCT ||
 			  typecode == TYPE_CODE_UNION))
-		    regval <<= ((mips_saved_regsize (tdep) - partial_len) *
+		    regval <<= ((mips_abi_regsize (gdbarch) - partial_len) *
 				TARGET_CHAR_BIT);
 
 		  if (mips_debug)
 		    fprintf_filtered (gdb_stdlog, " - reg=%d val=%s",
 				      argreg,
 				      phex (regval,
-					    mips_saved_regsize (tdep)));
+					    mips_abi_regsize (gdbarch)));
 		  write_register (argreg, regval);
 		  argreg++;
 
@@ -4151,14 +4174,14 @@
 	         always allocated.  */
 
 	      stack_offset += align_up (partial_len,
-					mips_stack_argsize (tdep));
+					mips_stack_argsize (gdbarch));
 	    }
 	}
       if (mips_debug)
 	fprintf_unfiltered (gdb_stdlog, "\n");
     }
 
-  regcache_cooked_write_signed (regcache, SP_REGNUM, sp);
+  regcache_cooked_write_signed (regcache, MIPS_SP_REGNUM, sp);
 
   /* Return adjusted stack pointer.  */
   return sp;
@@ -4465,7 +4488,7 @@
   struct gdbarch *gdbarch = get_frame_arch (frame);
   /* do values for GP (int) regs */
   char raw_buffer[MAX_REGISTER_SIZE];
-  int ncols = (mips_regsize (gdbarch) == 8 ? 4 : 8);	/* display cols per row */
+  int ncols = (mips_abi_regsize (gdbarch) == 8 ? 4 : 8);	/* display cols per row */
   int col, byte;
   int regnum;
 
@@ -4480,7 +4503,7 @@
 	  TYPE_CODE_FLT)
 	break;			/* end the row: reached FP register */
       fprintf_filtered (file,
-			mips_regsize (current_gdbarch) == 8 ? "%17s" : "%9s",
+			mips_abi_regsize (current_gdbarch) == 8 ? "%17s" : "%9s",
 			REGISTER_NAME (regnum));
       col++;
     }
@@ -4504,7 +4527,7 @@
 	error ("can't read register %d (%s)", regnum, REGISTER_NAME (regnum));
       /* pad small registers */
       for (byte = 0;
-	   byte < (mips_regsize (current_gdbarch)
+	   byte < (mips_abi_regsize (current_gdbarch)
 		   - register_size (current_gdbarch, regnum)); byte++)
 	printf_filtered ("  ");
       /* Now print the register value in hex, endian order. */
@@ -4819,16 +4842,6 @@
     return mips32_skip_prologue (pc);
 }
 
-/* Exported procedure: Is PC in the signal trampoline code */
-
-static int
-mips_pc_in_sigtramp (CORE_ADDR pc, char *ignore)
-{
-  if (sigtramp_address == 0)
-    fixup_sigtramp ();
-  return (pc >= sigtramp_address && pc < sigtramp_end);
-}
-
 /* Root of all "set mips "/"show mips " commands. This will eventually be
    used for all MIPS-specific commands.  */
 
@@ -5429,7 +5442,7 @@
   if (found_abi == MIPS_ABI_UNKNOWN && info.abfd != NULL)
     bfd_map_over_sections (info.abfd, mips_find_abi_section, &found_abi);
 
-  /* If we have no usefu BFD information, use the ABI from the last
+  /* If we have no useful BFD information, use the ABI from the last
      MIPS architecture (if there is one).  */
   if (found_abi == MIPS_ABI_UNKNOWN && info.abfd == NULL && arches != NULL)
     found_abi = gdbarch_tdep (arches->gdbarch)->found_abi;
@@ -5500,6 +5513,7 @@
       case bfd_mach_mips3900:
       case bfd_mach_mips4100:
       case bfd_mach_mips4111:
+      case bfd_mach_mips4120:
 	fpu_type = MIPS_FPU_NONE;
 	break;
       case bfd_mach_mips4650:
@@ -5598,7 +5612,8 @@
       }
     /* FIXME: cagney/2003-11-15: For MIPS, hasn't PC_REGNUM been
        replaced by read_pc?  */
-    set_gdbarch_pc_regnum (gdbarch, regnum->pc);
+    set_gdbarch_pc_regnum (gdbarch, regnum->pc + num_regs);
+    set_gdbarch_sp_regnum (gdbarch, MIPS_SP_REGNUM + num_regs);
     set_gdbarch_fp0_regnum (gdbarch, regnum->fp0);
     set_gdbarch_num_regs (gdbarch, num_regs);
     set_gdbarch_num_pseudo_regs (gdbarch, num_regs);
@@ -5612,9 +5627,6 @@
     case MIPS_ABI_O32:
       set_gdbarch_push_dummy_call (gdbarch, mips_o32_push_dummy_call);
       set_gdbarch_return_value (gdbarch, mips_o32_return_value);
-      tdep->mips_default_saved_regsize = 4;
-      tdep->mips_default_stack_argsize = 4;
-      tdep->mips_fp_register_double = 0;
       tdep->mips_last_arg_regnum = A0_REGNUM + 4 - 1;
       tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 4 - 1;
       tdep->default_mask_address_p = 0;
@@ -5628,17 +5640,13 @@
 						 mips_o64_store_return_value);
       set_gdbarch_deprecated_extract_return_value (gdbarch,
 						   mips_o64_extract_return_value);
-      tdep->mips_default_saved_regsize = 8;
-      tdep->mips_default_stack_argsize = 8;
-      tdep->mips_fp_register_double = 1;
       tdep->mips_last_arg_regnum = A0_REGNUM + 4 - 1;
       tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 4 - 1;
       tdep->default_mask_address_p = 0;
       set_gdbarch_long_bit (gdbarch, 32);
       set_gdbarch_ptr_bit (gdbarch, 32);
       set_gdbarch_long_long_bit (gdbarch, 64);
-      set_gdbarch_use_struct_convention (gdbarch,
-					 always_use_struct_convention);
+      set_gdbarch_deprecated_use_struct_convention (gdbarch, always_use_struct_convention);
       break;
     case MIPS_ABI_EABI32:
       set_gdbarch_push_dummy_call (gdbarch, mips_eabi_push_dummy_call);
@@ -5646,9 +5654,6 @@
 						 mips_eabi_store_return_value);
       set_gdbarch_deprecated_extract_return_value (gdbarch,
 						   mips_eabi_extract_return_value);
-      tdep->mips_default_saved_regsize = 4;
-      tdep->mips_default_stack_argsize = 4;
-      tdep->mips_fp_register_double = 0;
       tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;
       tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 8 - 1;
       tdep->default_mask_address_p = 0;
@@ -5657,8 +5662,7 @@
       set_gdbarch_long_long_bit (gdbarch, 64);
       set_gdbarch_deprecated_reg_struct_has_addr
 	(gdbarch, mips_eabi_reg_struct_has_addr);
-      set_gdbarch_use_struct_convention (gdbarch,
-					 mips_eabi_use_struct_convention);
+      set_gdbarch_deprecated_use_struct_convention (gdbarch, mips_eabi_use_struct_convention);
       break;
     case MIPS_ABI_EABI64:
       set_gdbarch_push_dummy_call (gdbarch, mips_eabi_push_dummy_call);
@@ -5666,9 +5670,6 @@
 						 mips_eabi_store_return_value);
       set_gdbarch_deprecated_extract_return_value (gdbarch,
 						   mips_eabi_extract_return_value);
-      tdep->mips_default_saved_regsize = 8;
-      tdep->mips_default_stack_argsize = 8;
-      tdep->mips_fp_register_double = 1;
       tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;
       tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 8 - 1;
       tdep->default_mask_address_p = 0;
@@ -5677,15 +5678,11 @@
       set_gdbarch_long_long_bit (gdbarch, 64);
       set_gdbarch_deprecated_reg_struct_has_addr
 	(gdbarch, mips_eabi_reg_struct_has_addr);
-      set_gdbarch_use_struct_convention (gdbarch,
-					 mips_eabi_use_struct_convention);
+      set_gdbarch_deprecated_use_struct_convention (gdbarch, mips_eabi_use_struct_convention);
       break;
     case MIPS_ABI_N32:
       set_gdbarch_push_dummy_call (gdbarch, mips_n32n64_push_dummy_call);
       set_gdbarch_return_value (gdbarch, mips_n32n64_return_value);
-      tdep->mips_default_saved_regsize = 8;
-      tdep->mips_default_stack_argsize = 8;
-      tdep->mips_fp_register_double = 1;
       tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;
       tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 8 - 1;
       tdep->default_mask_address_p = 0;
@@ -5696,9 +5693,6 @@
     case MIPS_ABI_N64:
       set_gdbarch_push_dummy_call (gdbarch, mips_n32n64_push_dummy_call);
       set_gdbarch_return_value (gdbarch, mips_n32n64_return_value);
-      tdep->mips_default_saved_regsize = 8;
-      tdep->mips_default_stack_argsize = 8;
-      tdep->mips_fp_register_double = 1;
       tdep->mips_last_arg_regnum = A0_REGNUM + 8 - 1;
       tdep->mips_last_fp_arg_regnum = tdep->regnum->fp0 + 12 + 8 - 1;
       tdep->default_mask_address_p = 0;
@@ -5741,9 +5735,7 @@
 
   /* Unwind the frame.  */
   set_gdbarch_unwind_pc (gdbarch, mips_unwind_pc);
-  frame_unwind_append_sniffer (gdbarch, mips_mdebug_frame_sniffer);
   set_gdbarch_unwind_dummy_id (gdbarch, mips_unwind_dummy_id);
-  frame_base_append_sniffer (gdbarch, mips_mdebug_frame_base_sniffer);
 
   /* Map debug register numbers onto internal register numbers.  */
   set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum);
@@ -5779,7 +5771,6 @@
   set_gdbarch_register_type (gdbarch, mips_register_type);
 
   set_gdbarch_print_registers_info (gdbarch, mips_print_registers_info);
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, mips_pc_in_sigtramp);
 
   set_gdbarch_print_insn (gdbarch, gdb_print_insn_mips);
 
@@ -5808,6 +5799,10 @@
   /* Hook in OS ABI-specific overrides, if they have been registered.  */
   gdbarch_init_osabi (info, gdbarch);
 
+  /* Unwind the frame.  */
+  frame_unwind_append_sniffer (gdbarch, mips_mdebug_frame_sniffer);
+  frame_base_append_sniffer (gdbarch, mips_mdebug_frame_base_sniffer);
+
   return gdbarch;
 }
 
@@ -5901,9 +5896,6 @@
 			  tdep->default_mask_address_p);
     }
   fprintf_unfiltered (file,
-		      "mips_dump_tdep: FP_REGISTER_DOUBLE = %d\n",
-		      FP_REGISTER_DOUBLE);
-  fprintf_unfiltered (file,
 		      "mips_dump_tdep: MIPS_DEFAULT_FPU_TYPE = %d (%s)\n",
 		      MIPS_DEFAULT_FPU_TYPE,
 		      (MIPS_DEFAULT_FPU_TYPE == MIPS_FPU_NONE ? "none"
@@ -5919,11 +5911,8 @@
 		       : MIPS_FPU_TYPE == MIPS_FPU_DOUBLE ? "double"
 		       : "???"));
   fprintf_unfiltered (file,
-		      "mips_dump_tdep: FP_REGISTER_DOUBLE = %d\n",
-		      FP_REGISTER_DOUBLE);
-  fprintf_unfiltered (file,
 		      "mips_dump_tdep: mips_stack_argsize() = %d\n",
-		      mips_stack_argsize (tdep));
+		      mips_stack_argsize (current_gdbarch));
   fprintf_unfiltered (file, "mips_dump_tdep: A0_REGNUM = %d\n", A0_REGNUM);
   fprintf_unfiltered (file,
 		      "mips_dump_tdep: ADDR_BITS_REMOVE # %s\n",
@@ -5982,8 +5971,8 @@
   fprintf_unfiltered (file,
 		      "mips_dump_tdep: MIPS_NUMREGS = %d\n", MIPS_NUMREGS);
   fprintf_unfiltered (file,
-		      "mips_dump_tdep: mips_saved_regsize() = %d\n",
-		      mips_saved_regsize (tdep));
+		      "mips_dump_tdep: mips_abi_regsize() = %d\n",
+		      mips_abi_regsize (current_gdbarch));
   fprintf_unfiltered (file,
 		      "mips_dump_tdep: PRID_REGNUM = %d\n", PRID_REGNUM);
   fprintf_unfiltered (file,
@@ -6102,6 +6091,8 @@
 
   gdbarch_register (bfd_arch_mips, mips_gdbarch_init, mips_dump_tdep);
 
+  mips_pdr_data = register_objfile_data ();
+
   /* Add root prefix command for all "set mips"/"show mips" commands */
   add_prefix_cmd ("mips", no_class, set_mips_command,
 		  "Various MIPS specific commands.",
@@ -6115,7 +6106,7 @@
   add_show_from_set (add_set_enum_cmd ("saved-gpreg-size",
 				       class_obscure,
 				       size_enums,
-				       &mips_saved_regsize_string, "\
+				       &mips_abi_regsize_string, "\
 Set size of general purpose registers saved on the stack.\n\
 This option can be set to one of:\n\
   32    - Force GDB to treat saved GP registers as 32-bit\n\
diff --git a/gdb/mips-tdep.h b/gdb/mips-tdep.h
index 7a00ffa..a28f729 100644
--- a/gdb/mips-tdep.h
+++ b/gdb/mips-tdep.h
@@ -43,9 +43,9 @@
 /* For wince :-(.  */
 extern CORE_ADDR mips_next_pc (CORE_ADDR pc);
 
-/* Return the "MIPS" register size.  Just a short cut to the BFD
+/* Return the MIPS ISA's register size.  Just a short cut to the BFD
    architecture's word size.  */
-extern int mips_regsize (struct gdbarch *gdbarch);
+extern int mips_isa_regsize (struct gdbarch *gdbarch);
 
 /* Return the current index for various MIPS registers.  */
 struct mips_regnum
@@ -62,6 +62,7 @@
 extern const struct mips_regnum *mips_regnum (struct gdbarch *gdbarch);
 
 enum {
+  MIPS_SP_REGNUM = 29,
   MIPS_EMBED_LO_REGNUM = 33,
   MIPS_EMBED_HI_REGNUM = 34,
   MIPS_EMBED_BADVADDR_REGNUM = 35,
diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c
index 114a374..163d5ff 100644
--- a/gdb/mipsnbsd-tdep.c
+++ b/gdb/mipsnbsd-tdep.c
@@ -47,7 +47,7 @@
 	  if (CANNOT_FETCH_REGISTER (i))
 	    supply_register (i, NULL);
 	  else
-            supply_register (i, regs + (i * mips_regsize (current_gdbarch)));
+            supply_register (i, regs + (i * mips_isa_regsize (current_gdbarch)));
         }
     }
 }
@@ -59,7 +59,7 @@
 
   for (i = 0; i <= PC_REGNUM; i++)
     if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i))
-      regcache_collect (i, regs + (i * mips_regsize (current_gdbarch)));
+      regcache_collect (i, regs + (i * mips_isa_regsize (current_gdbarch)));
 }
 
 void
@@ -76,7 +76,7 @@
 	  if (CANNOT_FETCH_REGISTER (i))
 	    supply_register (i, NULL);
 	  else
-            supply_register (i, fpregs + ((i - FP0_REGNUM) * mips_regsize (current_gdbarch)));
+            supply_register (i, fpregs + ((i - FP0_REGNUM) * mips_isa_regsize (current_gdbarch)));
 	}
     }
 }
@@ -89,7 +89,7 @@
   for (i = FP0_REGNUM; i <= mips_regnum (current_gdbarch)->fp_control_status;
        i++)
     if ((regno == i || regno == -1) && ! CANNOT_STORE_REGISTER (i))
-      regcache_collect (i, fpregs + ((i - FP0_REGNUM) * mips_regsize (current_gdbarch)));
+      regcache_collect (i, fpregs + ((i - FP0_REGNUM) * mips_isa_regsize (current_gdbarch)));
 }
 
 static void
@@ -221,13 +221,6 @@
   return -1;
 }
 
-static int
-mipsnbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
-{
-  return (nbsd_pc_in_sigtramp (pc, func_name)
-	  || mipsnbsd_sigtramp_offset (pc) >= 0);
-}
-
 /* Figure out where the longjmp will land.  We expect that we have
    just entered longjmp and haven't yet setup the stack frame, so
    the args are still in the argument regs.  A0_REGNUM points at the
@@ -236,7 +229,7 @@
    success.  */
 
 #define NBSD_MIPS_JB_PC			(2 * 4)
-#define NBSD_MIPS_JB_ELEMENT_SIZE	mips_regsize (current_gdbarch)
+#define NBSD_MIPS_JB_ELEMENT_SIZE	mips_isa_regsize (current_gdbarch)
 #define NBSD_MIPS_JB_OFFSET		(NBSD_MIPS_JB_PC * \
 					 NBSD_MIPS_JB_ELEMENT_SIZE)
 
@@ -345,8 +338,6 @@
 mipsnbsd_init_abi (struct gdbarch_info info,
                    struct gdbarch *gdbarch)
 {
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, mipsnbsd_pc_in_sigtramp);
-
   set_gdbarch_get_longjmp_target (gdbarch, mipsnbsd_get_longjmp_target);
 
   set_gdbarch_cannot_fetch_register (gdbarch, mipsnbsd_cannot_fetch_register);
@@ -366,6 +357,6 @@
   gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_NETBSD_ELF,
 			  mipsnbsd_init_abi);
 
-  add_core_fns (&mipsnbsd_core_fns);
-  add_core_fns (&mipsnbsd_elfcore_fns);
+  deprecated_add_core_fns (&mipsnbsd_core_fns);
+  deprecated_add_core_fns (&mipsnbsd_elfcore_fns);
 }
diff --git a/gdb/mipsnbsd-tdep.h b/gdb/mipsnbsd-tdep.h
index 0feca87..2ca0cc2 100644
--- a/gdb/mipsnbsd-tdep.h
+++ b/gdb/mipsnbsd-tdep.h
@@ -1,5 +1,6 @@
 /* Common target dependent code for GDB on MIPS systems running NetBSD.
-   Copyright 2002 Free Software Foundation, Inc.
+
+   Copyright 2002, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -27,7 +28,7 @@
 void mipsnbsd_supply_fpreg (char *, int);
 void mipsnbsd_fill_fpreg (char *, int);
 
-#define SIZEOF_STRUCT_REG	(38 * mips_regsize (current_gdbarch))
-#define SIZEOF_STRUCT_FPREG	(33 * mips_regsize (current_gdbarch))
+#define SIZEOF_STRUCT_REG	(38 * mips_isa_regsize (current_gdbarch))
+#define SIZEOF_STRUCT_FPREG	(33 * mips_isa_regsize (current_gdbarch))
 
 #endif /* MIPSNBSD_TDEP_H */
diff --git a/gdb/mipsread.c b/gdb/mipsread.c
index f67eeea..d34755e 100644
--- a/gdb/mipsread.c
+++ b/gdb/mipsread.c
@@ -59,12 +59,9 @@
    symbol file is specified (not just adding some symbols from another
    file, e.g. a shared library).  */
 
-extern CORE_ADDR sigtramp_address;
-
 static void
 mipscoff_new_init (struct objfile *ignore)
 {
-  sigtramp_address = 0;
   stabsread_new_init ();
   buildsym_new_init ();
 }
@@ -105,25 +102,6 @@
      minimal symbols for this objfile. */
 
   install_minimal_symbols (objfile);
-
-  /* If the entry_file bounds are still unknown after processing the
-     partial symbols, then try to set them from the minimal symbols
-     surrounding the entry_point.  */
-
-  if (mainline
-      && objfile->ei.entry_point != INVALID_ENTRY_POINT
-      && objfile->ei.deprecated_entry_file_lowpc == INVALID_ENTRY_LOWPC)
-    {
-      struct minimal_symbol *m;
-
-      m = lookup_minimal_symbol_by_pc (objfile->ei.entry_point);
-      if (m && DEPRECATED_SYMBOL_NAME (m + 1))
-	{
-	  objfile->ei.deprecated_entry_file_lowpc = SYMBOL_VALUE_ADDRESS (m);
-	  objfile->ei.deprecated_entry_file_highpc = SYMBOL_VALUE_ADDRESS (m + 1);
-	}
-    }
-
   do_cleanups (back_to);
 }
 
@@ -256,10 +234,10 @@
       || si.got_sect == NULL)
     return;
 
-  sym_secsize = bfd_get_section_size_before_reloc (si.sym_sect);
-  str_secsize = bfd_get_section_size_before_reloc (si.str_sect);
-  dyninfo_secsize = bfd_get_section_size_before_reloc (si.dyninfo_sect);
-  got_secsize = bfd_get_section_size_before_reloc (si.got_sect);
+  sym_secsize = bfd_get_section_size (si.sym_sect);
+  str_secsize = bfd_get_section_size (si.str_sect);
+  dyninfo_secsize = bfd_get_section_size (si.dyninfo_sect);
+  got_secsize = bfd_get_section_size (si.got_sect);
   sym_secptr = xmalloc (sym_secsize);
   cleanups = make_cleanup (free, sym_secptr);
   str_secptr = xmalloc (str_secsize);
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 5e3a5f8..e5e9dd2 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -122,23 +122,63 @@
 }
 
 static void
-mn10300_extract_return_value (struct type *type, char *regbuf, char *valbuf)
+mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type,
+			      struct regcache *regcache, void *valbuf)
 {
+  char buf[MAX_REGISTER_SIZE];
+  int len = TYPE_LENGTH (type);
+  int reg, regsz;
+
   if (TYPE_CODE (type) == TYPE_CODE_PTR)
-    memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (4), TYPE_LENGTH (type));
+    reg = 4;
   else
-    memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (0), TYPE_LENGTH (type));
+    reg = 0;
+
+  regsz = register_size (gdbarch, reg);
+  if (len <= regsz)
+    {
+      regcache_raw_read (regcache, reg, buf);
+      memcpy (valbuf, buf, len);
+    }
+  else if (len <= 2 * regsz)
+    {
+      regcache_raw_read (regcache, reg, buf);
+      memcpy (valbuf, buf, regsz);
+      gdb_assert (regsz == register_size (gdbarch, reg + 1));
+      regcache_raw_read (regcache, reg + 1, buf);
+      memcpy ((char *) valbuf + regsz, buf, len - regsz);
+    }
+  else
+    internal_error (__FILE__, __LINE__,
+		    "Cannot extract return value %d bytes long.", len);
 }
 
 static void
-mn10300_store_return_value (struct type *type, char *valbuf)
+mn10300_store_return_value (struct gdbarch *gdbarch, struct type *type,
+			    struct regcache *regcache, const void *valbuf)
 {
+  int len = TYPE_LENGTH (type);
+  int reg, regsz;
+  
   if (TYPE_CODE (type) == TYPE_CODE_PTR)
-    deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (4), valbuf,
-				     TYPE_LENGTH (type));
+    reg = 4;
   else
-    deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (0), valbuf,
-				     TYPE_LENGTH (type));
+    reg = 0;
+
+  regsz = register_size (gdbarch, reg);
+
+  if (len <= regsz)
+    regcache_raw_write_part (regcache, reg, 0, len, valbuf);
+  else if (len <= 2 * regsz)
+    {
+      regcache_raw_write (regcache, reg, valbuf);
+      gdb_assert (regsz == register_size (gdbarch, reg + 1));
+      regcache_raw_write_part (regcache, reg+1, 0,
+			       len - regsz, (char *) valbuf + regsz);
+    }
+  else
+    internal_error (__FILE__, __LINE__,
+		    "Cannot store return value %d bytes long.", len);
 }
 
 static struct frame_info *analyze_dummy_frame (CORE_ADDR, CORE_ADDR);
@@ -164,12 +204,111 @@
 #define MY_FRAME_IN_FP 0x2
 #define NO_MORE_FRAMES 0x4
 
+/* Compute the alignment required by a type.  */
+
+static int
+mn10300_type_align (struct type *type)
+{
+  int i, align = 1;
+
+  switch (TYPE_CODE (type))
+    {
+    case TYPE_CODE_INT:
+    case TYPE_CODE_ENUM:
+    case TYPE_CODE_SET:
+    case TYPE_CODE_RANGE:
+    case TYPE_CODE_CHAR:
+    case TYPE_CODE_BOOL:
+    case TYPE_CODE_FLT:
+    case TYPE_CODE_PTR:
+    case TYPE_CODE_REF:
+      return TYPE_LENGTH (type);
+
+    case TYPE_CODE_COMPLEX:
+      return TYPE_LENGTH (type) / 2;
+
+    case TYPE_CODE_STRUCT:
+    case TYPE_CODE_UNION:
+      for (i = 0; i < TYPE_NFIELDS (type); i++)
+	{
+	  int falign = mn10300_type_align (TYPE_FIELD_TYPE (type, i));
+	  while (align < falign)
+	    align <<= 1;
+	}
+      return align;
+
+    case TYPE_CODE_ARRAY:
+      /* HACK!  Structures containing arrays, even small ones, are not
+	 elligible for returning in registers.  */
+      return 256;
+
+    case TYPE_CODE_TYPEDEF:
+      return mn10300_type_align (check_typedef (type));
+
+    default:
+      internal_error (__FILE__, __LINE__, "bad switch");
+    }
+}
 
 /* Should call_function allocate stack space for a struct return?  */
 static int
-mn10300_use_struct_convention (int gcc_p, struct type *type)
+mn10300_use_struct_convention (struct type *type)
 {
-  return (TYPE_NFIELDS (type) > 1 || TYPE_LENGTH (type) > 8);
+  /* Structures bigger than a pair of words can't be returned in
+     registers.  */
+  if (TYPE_LENGTH (type) > 8)
+    return 1;
+
+  switch (TYPE_CODE (type))
+    {
+    case TYPE_CODE_STRUCT:
+    case TYPE_CODE_UNION:
+      /* Structures with a single field are handled as the field
+	 itself.  */
+      if (TYPE_NFIELDS (type) == 1)
+	return mn10300_use_struct_convention (TYPE_FIELD_TYPE (type, 0));
+
+      /* Structures with word or double-word size are passed in memory, as
+	 long as they require at least word alignment.  */
+      if (mn10300_type_align (type) >= 4)
+	return 0;
+
+      return 1;
+
+      /* Arrays are addressable, so they're never returned in
+	 registers.  This condition can only hold when the array is
+	 the only field of a struct or union.  */
+    case TYPE_CODE_ARRAY:
+      return 1;
+
+    case TYPE_CODE_TYPEDEF:
+      return mn10300_use_struct_convention (check_typedef (type));
+
+    default:
+      return 0;
+    }
+}
+
+/* Determine, for architecture GDBARCH, how a return value of TYPE
+   should be returned.  If it is supposed to be returned in registers,
+   and READBUF is non-zero, read the appropriate value from REGCACHE,
+   and copy it into READBUF.  If WRITEBUF is non-zero, write the value
+   from WRITEBUF into REGCACHE.  */
+
+static enum return_value_convention
+mn10300_return_value (struct gdbarch *gdbarch, struct type *type,
+		      struct regcache *regcache, void *readbuf,
+		      const void *writebuf)
+{
+  if (mn10300_use_struct_convention (type))
+    return RETURN_VALUE_STRUCT_CONVENTION;
+
+  if (readbuf)
+    mn10300_extract_return_value (gdbarch, type, regcache, readbuf);
+  if (writebuf)
+    mn10300_store_return_value (gdbarch, type, regcache, writebuf);
+
+  return RETURN_VALUE_REGISTER_CONVENTION;
 }
 
 /* The breakpoint instruction must be the same size as the smallest
@@ -457,8 +596,8 @@
   addr = func_addr;
 
   /* Suck in two bytes.  */
-  status = read_memory_nobpt (addr, buf, 2);
-  if (status != 0)
+  if (addr + 2 >= stop
+      || (status = read_memory_nobpt (addr, buf, 2)) != 0)
     {
       fix_frame_pointer (fi, 0);
       return addr;
@@ -737,10 +876,9 @@
         write_register (regnum, value);
       }
 
-  /* Actually cut back the stack.  */
-  write_register (SP_REGNUM, get_frame_base (frame));
-
-  /* Don't we need to set the PC?!?  XXX FIXME.  */
+  /* Actually cut back the stack, adjusted by the saved registers like
+     ret would.  */
+  write_register (SP_REGNUM, get_frame_base (frame) + saved_regs_size (frame));
 }
 
 /* Function: pop_frame
@@ -1111,7 +1249,6 @@
 mn10300_gdbarch_init (struct gdbarch_info info,
 		      struct gdbarch_list *arches)
 {
-  static LONGEST mn10300_call_dummy_words[] = { 0 };
   struct gdbarch *gdbarch;
   struct gdbarch_tdep *tdep = NULL;
   int am33_mode;
@@ -1154,10 +1291,8 @@
   set_gdbarch_register_name (gdbarch, register_name);
   set_gdbarch_deprecated_register_size (gdbarch, 4);
   set_gdbarch_deprecated_register_bytes (gdbarch, num_regs * gdbarch_deprecated_register_size (gdbarch));
-  set_gdbarch_deprecated_max_register_raw_size (gdbarch, 4);
   set_gdbarch_deprecated_register_raw_size (gdbarch, mn10300_register_raw_size);
   set_gdbarch_deprecated_register_byte (gdbarch, mn10300_register_byte);
-  set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4);
   set_gdbarch_deprecated_register_virtual_size (gdbarch, mn10300_register_virtual_size);
   set_gdbarch_deprecated_register_virtual_type (gdbarch, mn10300_register_virtual_type);
   set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mn10300_dwarf2_reg_to_regnum);
@@ -1177,8 +1312,7 @@
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mn10300_frame_init_saved_regs);
   set_gdbarch_deprecated_frame_chain (gdbarch, mn10300_frame_chain);
   set_gdbarch_deprecated_frame_saved_pc (gdbarch, mn10300_frame_saved_pc);
-  set_gdbarch_deprecated_extract_return_value (gdbarch, mn10300_extract_return_value);
-  set_gdbarch_deprecated_store_return_value (gdbarch, mn10300_store_return_value);
+  set_gdbarch_return_value (gdbarch, mn10300_return_value);
   set_gdbarch_deprecated_store_struct_return (gdbarch, mn10300_store_struct_return);
   set_gdbarch_deprecated_pop_frame (gdbarch, mn10300_pop_frame);
   set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue);
@@ -1186,14 +1320,10 @@
   set_gdbarch_deprecated_target_read_fp (gdbarch, mn10300_read_fp);
 
   /* Calling functions in the inferior from GDB.  */
-  set_gdbarch_deprecated_call_dummy_words (gdbarch, mn10300_call_dummy_words);
-  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (mn10300_call_dummy_words));
   set_gdbarch_deprecated_push_arguments (gdbarch, mn10300_push_arguments);
   set_gdbarch_deprecated_reg_struct_has_addr
     (gdbarch, mn10300_reg_struct_has_addr);
   set_gdbarch_deprecated_push_return_address (gdbarch, mn10300_push_return_address);
-  set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
-  set_gdbarch_use_struct_convention (gdbarch, mn10300_use_struct_convention);
 
   tdep->am33_mode = am33_mode;
 
diff --git a/gdb/monitor.c b/gdb/monitor.c
index cd4f045..a3f6672 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -2011,7 +2011,8 @@
    the program at that point.  */
 
 static void
-monitor_create_inferior (char *exec_file, char *args, char **env)
+monitor_create_inferior (char *exec_file, char *args, char **env,
+			 int from_tty)
 {
   if (args && (*args != '\000'))
     error ("Args are not supported by the monitor.");
diff --git a/gdb/ns32k-tdep.c b/gdb/ns32k-tdep.c
index 95475a8..500f3a0 100644
--- a/gdb/ns32k-tdep.c
+++ b/gdb/ns32k-tdep.c
@@ -399,22 +399,6 @@
 }
 
 static void
-ns32k_push_dummy_frame (void)
-{
-  CORE_ADDR sp = read_register (SP_REGNUM);
-  int regnum;
-
-  sp = push_word (sp, read_register (PC_REGNUM));
-  sp = push_word (sp, read_register (DEPRECATED_FP_REGNUM));
-  write_register (DEPRECATED_FP_REGNUM, sp);
-
-  for (regnum = 0; regnum < 8; regnum++)
-    sp = push_word (sp, read_register (regnum));
-
-  write_register (SP_REGNUM, sp);
-}
-
-static void
 ns32k_pop_frame (void)
 {
   struct frame_info *frame = get_current_frame ();
@@ -434,42 +418,34 @@
   write_register (SP_REGNUM, fp + 8);
   flush_cached_frames ();
 }
-
-/* The NS32000 call dummy sequence:
 
-	enter	0xff,0			82 ff 00
-	jsr	@0x00010203		7f ae c0 01 02 03
-	adjspd	0x69696969		7f a5 01 02 03 04
-	bpt				f2
-
-   It is 16 bytes long.  */
-
-static LONGEST ns32k_call_dummy_words[] =
+static CORE_ADDR
+ns32k_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
+		      int struct_return, CORE_ADDR struct_addr)
 {
-  0x7f00ff82,
-  0x0201c0ae,
-  0x01a57f03,
-  0xf2040302
-};
-static int sizeof_ns32k_call_dummy_words = sizeof (ns32k_call_dummy_words);
+  /* ASSERT ( !struct_return); */
+  int i;
+  for (i = nargs - 1; i >= 0; i--)
+    {
+      struct value *arg = args[i];
+      int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg));
+      int container_len = len;
+      int offset;
 
-#define NS32K_CALL_DUMMY_ADDR         5
-#define NS32K_CALL_DUMMY_NARGS        11
+      /* Are we going to put it at the high or low end of the
+	 container?  */
+      if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+	offset = container_len - len;
+      else
+	offset = 0;
 
-static void
-ns32k_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
-                      struct value **args, struct type *type, int gcc_p)
-{
-  int flipped;
-
-  flipped = fun | 0xc0000000;
-  flip_bytes (&flipped, 4);
-  store_unsigned_integer (dummy + NS32K_CALL_DUMMY_ADDR, 4, flipped);
-
-  flipped = - nargs * 4;
-  flip_bytes (&flipped, 4);
-  store_unsigned_integer (dummy + NS32K_CALL_DUMMY_NARGS, 4, flipped);
+      /* Stack grows downward.  */
+      sp -= container_len;
+      write_memory (sp + offset, VALUE_CONTENTS_ALL (arg), len);
+    }
+  return sp;
 }
+
 
 static void
 ns32k_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
@@ -545,10 +521,7 @@
 
   set_gdbarch_deprecated_register_size (gdbarch, NS32K_REGISTER_SIZE);
   set_gdbarch_deprecated_register_raw_size (gdbarch, ns32k_register_raw_size);
-  set_gdbarch_deprecated_max_register_raw_size (gdbarch, NS32K_MAX_REGISTER_RAW_SIZE);
   set_gdbarch_deprecated_register_virtual_size (gdbarch, ns32k_register_virtual_size);
-  set_gdbarch_deprecated_max_register_virtual_size (gdbarch,
-                                         NS32K_MAX_REGISTER_VIRTUAL_SIZE);
   set_gdbarch_deprecated_register_virtual_type (gdbarch, ns32k_register_virtual_type);
 
   /* Frame and stack info */
@@ -574,16 +547,9 @@
   set_gdbarch_deprecated_store_return_value (gdbarch, ns32k_store_return_value);
 
   /* Call dummy info */
-  set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame);
   set_gdbarch_deprecated_pop_frame (gdbarch, ns32k_pop_frame);
   set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
-  set_gdbarch_deprecated_call_dummy_words (gdbarch, ns32k_call_dummy_words);
-  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof_ns32k_call_dummy_words);
-  set_gdbarch_deprecated_fix_call_dummy (gdbarch, ns32k_fix_call_dummy);
-  set_gdbarch_deprecated_call_dummy_start_offset (gdbarch, 3);
-  set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 15);
-  set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
-  set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
+  set_gdbarch_deprecated_push_arguments (gdbarch, ns32k_push_arguments);
 
   /* Breakpoint info */
   set_gdbarch_breakpoint_from_pc (gdbarch, ns32k_breakpoint_from_pc);
diff --git a/gdb/ns32k-tdep.h b/gdb/ns32k-tdep.h
index c2dc71a..0b6551f 100644
--- a/gdb/ns32k-tdep.h
+++ b/gdb/ns32k-tdep.h
@@ -50,8 +50,6 @@
    + 8                        * 8 /* size of floating point regs */)
 
 #define NS32K_REGISTER_SIZE             4
-#define NS32K_MAX_REGISTER_RAW_SIZE     8
-#define NS32K_MAX_REGISTER_VIRTUAL_SIZE 8
 
 void ns32k_gdbarch_init_32082 (struct gdbarch *);
 void ns32k_gdbarch_init_32382 (struct gdbarch *);
diff --git a/gdb/ns32knbsd-nat.c b/gdb/ns32knbsd-nat.c
index 2dc7771..52c6840 100644
--- a/gdb/ns32knbsd-nat.c
+++ b/gdb/ns32knbsd-nat.c
@@ -182,7 +182,7 @@
 void
 _initialize_ns32knbsd_nat (void)
 {
-  add_core_fns (&nat_core_fns);
+  deprecated_add_core_fns (&nat_core_fns);
 }
 
 
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index 00b4096..9c4b3f9 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -963,7 +963,8 @@
 }
 
 static void
-procfs_create_inferior (char *exec_file, char *allargs, char **env)
+procfs_create_inferior (char *exec_file, char *allargs, char **env,
+			int from_tty)
 {
   struct inheritance inherit;
   pid_t pid;
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 056b93f..ed32a5c 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -333,5 +333,5 @@
 #endif
 
   /* Register core file support.  */
-  add_core_fns (&regset_core_fns);
+  deprecated_add_core_fns (&regset_core_fns);
 }
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 5c184f3..bcd4873 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -662,6 +662,7 @@
   &exp_descriptor_standard,
   objc_parse,
   objc_error,
+  null_post_parser,
   objc_printchar,		/* Print a character constant */
   objc_printstr,		/* Function to print string constant */
   objc_emit_char,
@@ -674,6 +675,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   objc_demangle,		/* Language specific symbol demangler */
+  NULL,				/* Language specific class_name_from_physname */
   {"",     "",    "",  ""},	/* Binary format info */
   {"0%lo",  "0",   "o", ""},	/* Octal format info */
   {"%ld",   "",    "d", ""},	/* Decimal format info */
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 6179077..48d6954 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -250,10 +250,6 @@
       /* Examination of non-executable.o files.  Short-circuit this stuff.  */
       objfile->ei.entry_point = INVALID_ENTRY_POINT;
     }
-  objfile->ei.deprecated_entry_file_lowpc = INVALID_ENTRY_LOWPC;
-  objfile->ei.deprecated_entry_file_highpc = INVALID_ENTRY_HIGHPC;
-  objfile->ei.entry_func_lowpc = INVALID_ENTRY_LOWPC;
-  objfile->ei.entry_func_highpc = INVALID_ENTRY_HIGHPC;
   objfile->ei.main_func_lowpc = INVALID_ENTRY_LOWPC;
   objfile->ei.main_func_highpc = INVALID_ENTRY_HIGHPC;
 }
@@ -651,18 +647,6 @@
       }
   }
 
-  if (objfile->ei.entry_func_lowpc != INVALID_ENTRY_LOWPC)
-    {
-      objfile->ei.entry_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
-      objfile->ei.entry_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
-    }
-
-  if (objfile->ei.deprecated_entry_file_lowpc != INVALID_ENTRY_LOWPC)
-    {
-      objfile->ei.deprecated_entry_file_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
-      objfile->ei.deprecated_entry_file_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
-    }
-
   if (objfile->ei.main_func_lowpc != INVALID_ENTRY_LOWPC)
     {
       objfile->ei.main_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 2b8ca7d..29be972 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -44,9 +44,8 @@
    to the user executable's recorded entry point, as if the call had been made
    directly by the kernel.
 
-   The traditional gdb method of using this info is to use the
-   recorded entry point to set the variables
-   deprecated_entry_file_lowpc and deprecated_entry_file_highpc from
+   The traditional gdb method of using this info was to use the
+   recorded entry point to set the entry-file's lowpc and highpc from
    the debugging information, where these values are the starting
    address (inclusive) and ending address (exclusive) of the
    instruction space in the executable which correspond to the
@@ -57,7 +56,7 @@
 
    NOTE: cagney/2003-09-09: It turns out that this "traditional"
    method doesn't work.  Corinna writes: ``It turns out that the call
-   to deprecated_inside_entry_file destroys a meaningful backtrace
+   to test for "inside entry file" destroys a meaningful backtrace
    under some conditions.  E. g. the backtrace tests in the asm-source
    testcase are broken for some targets.  In this test the functions
    are all implemented as part of one file and the testcase is not
@@ -111,18 +110,6 @@
 
 #define INVALID_ENTRY_POINT (~0)	/* ~0 will not be in any file, we hope.  */
 
-    /* Start (inclusive) and end (exclusive) of function containing the
-       entry point. */
-
-    CORE_ADDR entry_func_lowpc;
-    CORE_ADDR entry_func_highpc;
-
-    /* Start (inclusive) and end (exclusive) of object file containing the
-       entry point. */
-
-    CORE_ADDR deprecated_entry_file_lowpc;
-    CORE_ADDR deprecated_entry_file_highpc;
-
     /* Start (inclusive) and end (exclusive) of the user code main() function. */
 
     CORE_ADDR main_func_lowpc;
diff --git a/gdb/observer.c b/gdb/observer.c
index fce5f92..6bdcdf5 100644
--- a/gdb/observer.c
+++ b/gdb/observer.c
@@ -52,6 +52,10 @@
 
 #include "defs.h"
 #include "observer.h"
+#include "command.h"
+#include "gdbcmd.h"
+
+static int observer_debug;
 
 /* The internal generic observer.  */
 
@@ -159,37 +163,6 @@
     }
 }
 
-/* normal_stop notifications.  */
-
-static struct observer_list *normal_stop_subject = NULL;
-
-static void
-observer_normal_stop_notification_stub (const void *data,
-					const void *unused_args)
-{
-  observer_normal_stop_ftype *notify = (observer_normal_stop_ftype *) data;
-  (*notify) ();
-}
-
-struct observer *
-observer_attach_normal_stop (observer_normal_stop_ftype *f)
-{
-  return generic_observer_attach (&normal_stop_subject,
-				  &observer_normal_stop_notification_stub,
-				  (void *) f);
-}
-
-void
-observer_detach_normal_stop (struct observer *observer)
-{
-  generic_observer_detach (&normal_stop_subject, observer);
-}
-
-void
-observer_notify_normal_stop (void)
-{
-  generic_observer_notify (normal_stop_subject, NULL);
-}
 
 /* The following code is only used to unit-test the observers from our
    testsuite.  DO NOT USE IT within observer.c (or anywhere else for
@@ -203,20 +176,35 @@
 int observer_test_third_observer = 0;
 
 void
-observer_test_first_notification_function (void)
+observer_test_first_notification_function (struct bpstats *bs)
 {
   observer_test_first_observer++;
 }
 
 void
-observer_test_second_notification_function (void)
+observer_test_second_notification_function (struct bpstats *bs)
 {
   observer_test_second_observer++;
 }
 
 void
-observer_test_third_notification_function (void)
+observer_test_third_notification_function (struct bpstats *bs)
 {
   observer_test_third_observer++;
 }
 
+extern initialize_file_ftype _initialize_observer; /* -Wmissing-prototypes */
+
+void
+_initialize_observer (void)
+{
+  add_setshow_zinteger_cmd ("observer", class_maintenance, &observer_debug, "\
+Set observer debugging.\n\
+When non-zero, observer debugging is enabled.",  "\
+Show observer debugging.\n\
+When non-zero, observer debugging is enabled.",
+			    NULL, NULL,
+			    &setdebuglist, &showdebuglist);
+}
+
+#include "observer.inc"
diff --git a/gdb/observer.h b/gdb/observer.h
deleted file mode 100644
index 8b9a6db..0000000
--- a/gdb/observer.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* GDB Notifications to Observers.
-   Copyright 2003 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#ifndef OBSERVER_H
-#define OBSERVER_H
-
-struct observer;
-
-/* normal_stop notifications.  */
-
-typedef void (observer_normal_stop_ftype) (void);
-
-extern struct observer *
-  observer_attach_normal_stop (observer_normal_stop_ftype *f);
-extern void observer_detach_normal_stop (struct observer *observer);
-extern void observer_notify_normal_stop (void);
-
-#endif /* OBSERVER_H */
diff --git a/gdb/observer.sh b/gdb/observer.sh
new file mode 100755
index 0000000..2cc0e7f
--- /dev/null
+++ b/gdb/observer.sh
@@ -0,0 +1,156 @@
+#!/bin/sh -e
+
+if test $# -ne 3
+then
+    echo "Usage: $0 <h|inc> <observer.texi> <observer.out>" 1>&2
+    exit 0
+fi
+
+lang=$1 ; shift
+texi=$1 ; shift
+o=$1 ; shift
+echo "Creating ${o}-tmp" 1>&2
+rm -f ${o}-tmp
+
+# Can use any of the following: cat cmp cp diff echo egrep expr false
+# grep install-info ln ls mkdir mv pwd rm rmdir sed sleep sort tar
+# test touch true
+
+cat <<EOF >>${o}-tmp
+/* GDB Notifications to Observers.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+
+   --
+
+   This file was generated using observer.sh and observer.texi.  */
+
+EOF
+
+
+case $lang in
+    h) cat <<EOF >>${o}-tmp
+#ifndef OBSERVER_H
+#define OBSERVER_H
+
+struct observer;
+struct bpstats;
+EOF
+        ;;
+esac
+
+
+# generate a list of events that can be observed
+
+IFS=:
+sed -n '
+/@deftypefun void/{
+# Save original line for later processing into the actual parameter
+    h
+# Convert from: @deftypefun void EVENT (TYPE @var{PARAM},...)
+# to event and formals: EVENT:TYPE PARAM, ...:
+    s/^.* void \([a-z_][a-z_]*\) (\(.*\))$/\1:\2/
+    s/@var{//g
+    s/}//g
+# Switch to held
+    x
+# Convert from: @deftypefun void FUNC (TYPE @var{PARAM},...)
+# to actuals: PARAM, ...
+    s/^[^{]*[{]*//
+    s/[}]*[^}]*$//
+    s/}[^{]*{/, /g
+# Combine held (EVENT:TYPE PARAM, ...:) and pattern (PARAM, ...) into
+# FUNC:TYPE PARAM, ...:PARAM, ...
+    H
+    x
+    s/\n/:/g
+    p
+}
+' $texi | while read event formal actual
+do
+  case $lang in
+      h) cat <<EOF >>${o}-tmp
+
+/* ${event} notifications.  */
+
+typedef void (observer_${event}_ftype) (${formal});
+
+extern struct observer *observer_attach_${event} (observer_${event}_ftype *f);
+extern void observer_detach_${event} (struct observer *observer);
+extern void observer_notify_${event} (${formal});
+EOF
+	;;
+
+      inc)
+      	cat <<EOF >>${o}-tmp
+
+/* ${event} notifications.  */
+
+static struct observer_list *${event}_subject = NULL;
+
+struct ${event}_args { `echo "${formal}" | sed -e 's/,/;/g'`; };
+
+static void
+observer_${event}_notification_stub (const void *data, const void *args_data)
+{
+  observer_${event}_ftype *notify = (observer_${event}_ftype *) data;
+  const struct ${event}_args *args = args_data;
+  notify (`echo ${actual} | sed -e 's/\([a-z0-9_][a-z0-9_]*\)/args->\1/g'`);
+}
+
+struct observer *
+observer_attach_${event} (observer_${event}_ftype *f)
+{
+  return generic_observer_attach (&${event}_subject,
+				  &observer_${event}_notification_stub,
+				  (void *) f);
+}
+
+void
+observer_detach_${event} (struct observer *observer)
+{
+  generic_observer_detach (&${event}_subject, observer);
+}
+
+void
+observer_notify_${event} (${formal})
+{
+  struct ${event}_args args;
+  `echo ${actual} | sed -e 's/\([a-z0-9_][a-z0-9_]*\)/args.\1 = \1/g'`;
+  if (observer_debug)
+    fprintf_unfiltered (gdb_stdlog, "observer_notify_${event}() called\n");
+  generic_observer_notify (${event}_subject, &args);
+}
+EOF
+	;;
+    esac
+done
+
+
+case $lang in
+    h) cat <<EOF >>${o}-tmp
+
+#endif /* OBSERVER_H */
+EOF
+esac
+
+
+echo Moving ${o}-tmp to ${o}
+mv ${o}-tmp ${o}
diff --git a/gdb/ocd.c b/gdb/ocd.c
index c53db89..8ea727d 100644
--- a/gdb/ocd.c
+++ b/gdb/ocd.c
@@ -225,7 +225,7 @@
   flush_cached_frames ();
   registers_changed ();
   stop_pc = read_pc ();
-  print_stack_frame (get_selected_frame (), -1, 1);
+  print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC);
 
   buf[0] = OCD_LOG_FILE;
   buf[1] = 3;			/* close existing WIGGLERS.LOG */
@@ -1014,7 +1014,7 @@
    the program at that point.  */
 
 void
-ocd_create_inferior (char *exec_file, char *args, char **env)
+ocd_create_inferior (char *exec_file, char *args, char **env, int from_tty)
 {
   if (args && (*args != '\000'))
     error ("Args are not supported by BDM.");
diff --git a/gdb/ocd.h b/gdb/ocd.h
index 64d695a..cf93762 100644
--- a/gdb/ocd.h
+++ b/gdb/ocd.h
@@ -112,7 +112,8 @@
 
 void ocd_mourn (void);
 
-void ocd_create_inferior (char *exec_file, char *args, char **env);
+void ocd_create_inferior (char *exec_file, char *args, char **env,
+			  int from_tty);
 
 int ocd_thread_alive (ptid_t th);
 
diff --git a/gdb/osabi.c b/gdb/osabi.c
index 3acfc70..ea84456 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -1,5 +1,6 @@
 /* OS ABI variant handling for GDB.
-   Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
+
+   Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -501,10 +502,11 @@
   switch (elfosabi)
     {
     case ELFOSABI_NONE:
-      /* When elfosabi is ELFOSABI_NONE (0), then the ELF structures in the
-         file are conforming to the base specification for that machine
-	 (there are no OS-specific extensions).  In order to determine the
-	 real OS in use we must look for OS notes that have been added.  */
+      /* When the EI_OSABI field in the ELF header is ELFOSABI_NONE
+         (0), then the ELF structures in the file are conforming to
+         the base specification for that machine (there are no
+         OS-specific extensions).  In order to determine the real OS
+         in use we must look for OS-specific notes.  */
       bfd_map_over_sections (abfd,
 			     generic_elf_osabi_sniff_abi_tag_sections,
 			     &osabi);
@@ -531,7 +533,14 @@
       break;
 
     case ELFOSABI_HPUX:
+      /* For some reason the default value for the EI_OSABI field is
+         ELFOSABI_HPUX for all PA-RISC targets (with the exception of
+         GNU/Linux).  We use HP-UX ELF as the default, but let any
+         OS-specific notes override this.  */
       osabi = GDB_OSABI_HPUX_ELF;
+      bfd_map_over_sections (abfd,
+			     generic_elf_osabi_sniff_abi_tag_sections,
+			     &osabi);
       break;
     }
 
diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index a402532..3866e2c 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -454,6 +454,7 @@
   &exp_descriptor_standard,
   pascal_parse,
   pascal_error,
+  null_post_parser,
   pascal_printchar,		/* Print a character constant */
   pascal_printstr,		/* Function to print string constant */
   pascal_emit_char,		/* Print a single char */
@@ -466,6 +467,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   NULL,				/* Language specific symbol demangler */
+  NULL,				/* Language specific class_name_from_physname */
   {"", "%", "b", ""},		/* Binary format info */
   {"0%lo", "0", "o", ""},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
diff --git a/gdb/pa64solib.c b/gdb/pa64solib.c
index 4e29455..0bb3de8 100644
--- a/gdb/pa64solib.c
+++ b/gdb/pa64solib.c
@@ -52,6 +52,7 @@
 #include "language.h"
 #include "regcache.h"
 #include "exec.h"
+#include "hppa-tdep.h"
 
 #include <fcntl.h>
 
@@ -220,7 +221,7 @@
 {
   bfd *tmp_bfd;
   asection *sec;
-  obj_private_data_t *obj_private;
+  struct hppa_objfile_private *obj_private;
   struct section_addr_info *section_addrs;
   struct cleanup *my_cleanups;
 
@@ -278,17 +279,18 @@
   /* Mark this as a shared library and save private data.  */
   so->objfile->flags |= OBJF_SHARED;
 
-  if (so->objfile->obj_private == NULL)
+  obj_private = (struct hppa_objfile_private *)
+	        objfile_data (so->objfile, hppa_objfile_priv_data);
+  if (obj_private == NULL)
     {
-      obj_private = (obj_private_data_t *)
+      obj_private = (struct hppa_objfile_private *)
 	obstack_alloc (&so->objfile->objfile_obstack,
-		       sizeof (obj_private_data_t));
+		       sizeof (struct hppa_objfile_private));
+      set_objfile_data (so->objfile, hppa_objfile_priv_data, obj_private);
       obj_private->unwind_info = NULL;
       obj_private->so_info = NULL;
-      so->objfile->obj_private = obj_private;
     }
 
-  obj_private = (obj_private_data_t *) so->objfile->obj_private;
   obj_private->so_info = so;
   obj_private->dp = so->pa64_solib_desc.linkage_ptr;
   do_cleanups (my_cleanups);
@@ -647,7 +649,7 @@
 {
   CORE_ADDR event_kind;
 
-  event_kind = read_register (ARG0_REGNUM);
+  event_kind = read_register (HPPA_ARG0_REGNUM);
   return (event_kind == DLD_CB_LOAD);
 }
 
@@ -658,7 +660,7 @@
 {
   CORE_ADDR event_kind;
 
-  event_kind = read_register (ARG0_REGNUM);
+  event_kind = read_register (HPPA_ARG0_REGNUM);
   return (event_kind == DLD_CB_UNLOAD);
 }
 
@@ -672,7 +674,7 @@
 pa64_solib_loaded_library_pathname (int pid)
 {
   static char dll_path[MAXPATHLEN];
-  CORE_ADDR  dll_path_addr = read_register (ARG3_REGNUM);
+  CORE_ADDR  dll_path_addr = read_register (HPPA_ARG3_REGNUM);
   read_memory_string (dll_path_addr, dll_path, MAXPATHLEN);
   return dll_path;
 }
@@ -687,7 +689,7 @@
 pa64_solib_unloaded_library_pathname (int pid)
 {
   static char dll_path[MAXPATHLEN];
-  CORE_ADDR dll_path_addr = read_register (ARG3_REGNUM);
+  CORE_ADDR dll_path_addr = read_register (HPPA_ARG3_REGNUM);
   read_memory_string (dll_path_addr, dll_path, MAXPATHLEN);
   return dll_path;
 }
diff --git a/gdb/parse.c b/gdb/parse.c
index 374e88e..4af6d7c 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -95,8 +95,6 @@
 
 static int expressiondebug = 0;
 
-extern int hp_som_som_object_present;
-
 static void free_funcalls (void *ignore);
 
 static void prefixify_expression (struct expression *);
@@ -104,6 +102,9 @@
 static void prefixify_subexp (struct expression *, struct expression *, int,
 			      int);
 
+static struct expression *parse_exp_in_context (char **, struct block *, int, 
+						int);
+
 void _initialize_parse (void);
 
 /* Data structure for saving values of arglist_len for function calls whose
@@ -590,7 +591,7 @@
      return NULL, and caller must default to standard GDB
      behaviour. */
 
-  if (!hp_som_som_object_present)
+  if (!deprecated_hp_som_som_object_present)
     return (struct symbol *) NULL;
 
   p = name;
@@ -1023,6 +1024,16 @@
 struct expression *
 parse_exp_1 (char **stringptr, struct block *block, int comma)
 {
+  return parse_exp_in_context (stringptr, block, comma, 0);
+}
+
+/* As for parse_exp_1, except that if VOID_CONTEXT_P, then
+   no value is expected from the expression.  */
+
+static struct expression *
+parse_exp_in_context (char **stringptr, struct block *block, int comma, 
+		      int void_context_p)
+{
   struct cleanup *old_chain;
 
   lexptr = *stringptr;
@@ -1078,6 +1089,8 @@
 
   prefixify_expression (expout);
 
+  current_language->la_post_parser (&expout, void_context_p);
+
   if (expressiondebug)
     dump_prefix_expression (expout, gdb_stdlog);
 
@@ -1097,6 +1110,28 @@
     error ("Junk after end of expression.");
   return exp;
 }
+
+
+/* As for parse_expression, except that if VOID_CONTEXT_P, then
+   no value is expected from the expression.  */
+
+struct expression *
+parse_expression_in_context (char *string, int void_context_p)
+{
+  struct expression *exp;
+  exp = parse_exp_in_context (&string, 0, 0, void_context_p);
+  if (*string != '\000')
+    error ("Junk after end of expression.");
+  return exp;
+}
+
+/* A post-parser that does nothing */
+
+/* ARGSUSED */
+void
+null_post_parser (struct expression **exp, int void_context_p)
+{
+}
 
 /* Stuff for maintaining a stack of types.  Currently just used by C, but
    probably useful for any language which declares its types "backwards".  */
diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h
index c84fcad..43a07c37 100644
--- a/gdb/parser-defs.h
+++ b/gdb/parser-defs.h
@@ -172,6 +172,8 @@
 
 extern struct type *follow_types (struct type *);
 
+extern void null_post_parser (struct expression **, int);
+
 /* During parsing of a C expression, the pointer to the next character
    is in this variable.  */
 
diff --git a/gdb/ppc-bdm.c b/gdb/ppc-bdm.c
index 2355b2c..e4d2ddb 100644
--- a/gdb/ppc-bdm.c
+++ b/gdb/ppc-bdm.c
@@ -37,6 +37,7 @@
 #include "ocd.h"
 #include "ppc-tdep.h"
 #include "regcache.h"
+#include "gdb_assert.h"
 
 static void bdm_ppc_open (char *name, int from_tty);
 
@@ -153,21 +154,12 @@
 static void
 bdm_ppc_fetch_registers (int regno)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int i;
-  unsigned char *regs, *beginregs, *endregs, *almostregs;
-  unsigned char midregs[32];
-  unsigned char mqreg[1];
+  unsigned char *regs;
   int first_regno, last_regno;
   int first_bdm_regno, last_bdm_regno;
-  int reglen, beginreglen, endreglen;
-
-#if 1
-  for (i = 0; i < (FPLAST_REGNUM - FP0_REGNUM + 1); i++)
-    {
-      midregs[i] = -1;
-    }
-  mqreg[0] = -1;
-#endif
+  int reglen;
 
   if (regno == -1)
     {
@@ -192,6 +184,12 @@
       return;			/* Unsupported register */
     }
 
+  /* FIXME: jimb/2004-05-04: I'm not sure how to adapt this code to
+     processors that lack floating point registers, and I don't have
+     have the equipment to test it.  So we'll leave that case for the
+     next person who encounters it.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
 #if 1
   /* Can't ask for floating point regs on ppc 8xx, also need to
      avoid asking for the mq register. */
@@ -202,7 +200,8 @@
       /* if asking for an invalid register */
       if ((first_regno == gdbarch_tdep (current_gdbarch)->ppc_mq_regnum)
           || (first_regno == gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum)
-	  || ((first_regno >= FP0_REGNUM) && (first_regno <= FPLAST_REGNUM)))
+	  || ((first_regno >= tdep->ppc_fp0_regnum)
+              && (first_regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
 	{
 /*          printf("invalid reg request!\n"); */
 	  supply_register (first_regno, NULL);
@@ -215,18 +214,9 @@
 	}
     }
   else
-    /* want all regs */
-    {
-/*      printf("Asking for registers %d to %d\n", first_regno, last_regno); */
-      beginregs = ocd_read_bdm_registers (first_bdm_regno,
-					  FP0_REGNUM - 1, &beginreglen);
-      endregs = (strcat (midregs,
-			 ocd_read_bdm_registers (FPLAST_REGNUM + 1,
-					  last_bdm_regno - 1, &endreglen)));
-      almostregs = (strcat (beginregs, endregs));
-      regs = (strcat (almostregs, mqreg));
-      reglen = beginreglen + 32 + endreglen + 1;
-    }
+    internal_error (__FILE__, __LINE__,
+                    "ppc_bdm_fetch_registers: "
+                    "'all registers' case not implemented");
 
 #endif
 #if 0
@@ -258,6 +248,7 @@
 static void
 bdm_ppc_store_registers (int regno)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int i;
   int first_regno, last_regno;
   int first_bdm_regno, last_bdm_regno;
@@ -282,6 +273,12 @@
   if (first_bdm_regno == -1)
     return;			/* Unsupported register */
 
+  /* FIXME: jimb/2004-05-04: I'm not sure how to adapt this code to
+     processors that lack floating point registers, and I don't have
+     have the equipment to test it.  So we'll leave that case for the
+     next person who encounters it.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
   for (i = first_regno; i <= last_regno; i++)
     {
       int bdm_regno;
@@ -292,7 +289,8 @@
       /* (need to avoid FP regs and MQ reg) */
       if ((i != gdbarch_tdep (current_gdbarch)->ppc_mq_regnum) 
           && (i != gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum) 
-          && ((i < FP0_REGNUM) || (i > FPLAST_REGNUM)))
+          && ((i < tdep->ppc_fp0_regnum)
+              || (i >= tdep->ppc_fp0_regnum + ppc_num_fprs)))
 	{
 /*          printf("write valid reg %d\n", bdm_regno); */
 	  ocd_write_bdm_registers (bdm_regno, deprecated_registers + DEPRECATED_REGISTER_BYTE (i), 4);
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index a8eb7b6..4d8f503 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -26,6 +26,7 @@
 #include "inferior.h"
 #include "gdbcore.h"
 #include "regcache.h"
+#include "gdb_assert.h"
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -69,6 +70,16 @@
 #define PTRACE_SETVRREGS 19
 #endif
 
+
+/* Similarly for the ptrace requests for getting / setting the SPE
+   registers (ev0 -- ev31, acc, and spefscr).  See the description of
+   gdb_evrregset_t for details.  */
+#ifndef PTRACE_GETEVRREGS
+#define PTRACE_GETEVRREGS 20
+#define PTRACE_SETEVRREGS 21
+#endif
+
+
 /* This oddity is because the Linux kernel defines elf_vrregset_t as
    an array of 33 16 bytes long elements.  I.e. it leaves out vrsave.
    However the PTRACE_GETVRREGS and PTRACE_SETVRREGS requests return
@@ -100,9 +111,49 @@
 
 typedef char gdb_vrregset_t[SIZEOF_VRREGS];
 
-/* For runtime check of ptrace support for VRREGS.  */
+
+/* On PPC processors that support the the Signal Processing Extension
+   (SPE) APU, the general-purpose registers are 64 bits long.
+   However, the ordinary Linux PTRACE_PEEKUSR / PTRACE_POKEUSR /
+   PT_READ_U / PT_WRITE_U ptrace calls only access the lower half of
+   each register, to allow them to behave the same way they do on
+   non-SPE systems.  There's a separate pair of calls,
+   PTRACE_GETEVRREGS / PTRACE_SETEVRREGS, that read and write the top
+   halves of all the general-purpose registers at once, along with
+   some SPE-specific registers.
+
+   GDB itself continues to claim the general-purpose registers are 32
+   bits long; the full 64-bit registers are called 'ev0' -- 'ev31'.
+   The ev registers are raw registers, and the GPR's are pseudo-
+   registers mapped onto their lower halves.  This means that reading
+   and writing ev registers involves a mix of regset-at-once
+   PTRACE_{GET,SET}EVRREGS calls and register-at-a-time
+   PTRACE_{PEEK,POKE}USR calls.
+
+   This is the structure filled in by PTRACE_GETEVRREGS and written to
+   the inferior's registers by PTRACE_SETEVRREGS.  */
+struct gdb_evrregset_t
+{
+  unsigned long evr[32];
+  unsigned long long acc;
+  unsigned long spefscr;
+};
+
+
+/* Non-zero if our kernel may support the PTRACE_GETVRREGS and
+   PTRACE_SETVRREGS requests, for reading and writing the Altivec
+   registers.  Zero if we've tried one of them and gotten an
+   error.  */
 int have_ptrace_getvrregs = 1;
 
+
+/* Non-zero if our kernel may support the PTRACE_GETEVRREGS and
+   PTRACE_SETEVRREGS requests, for reading and writing the SPE
+   registers.  Zero if we've tried one of them and gotten an
+   error.  */
+int have_ptrace_getsetevrregs = 1;
+
+
 int
 kernel_u_size (void)
 {
@@ -132,14 +183,17 @@
   int wordsize = sizeof (PTRACE_XFER_TYPE);
 
   /* General purpose registers occupy 1 slot each in the buffer */
-  if (regno >= tdep->ppc_gp0_regnum && regno <= tdep->ppc_gplast_regnum )
-    u_addr =  ((PT_R0 + regno) * wordsize);
+  if (regno >= tdep->ppc_gp0_regnum 
+      && regno < tdep->ppc_gp0_regnum + ppc_num_gprs)
+    u_addr = ((regno - tdep->ppc_gp0_regnum + PT_R0) * wordsize);
 
   /* Floating point regs: eight bytes each in both 32- and 64-bit
      ptrace interfaces.  Thus, two slots each in 32-bit interface, one
      slot each in 64-bit interface.  */
-  if (regno >= FP0_REGNUM && regno <= FPLAST_REGNUM)
-    u_addr = (PT_FPR0 * wordsize) + ((regno - FP0_REGNUM) * 8);
+  if (tdep->ppc_fp0_regnum >= 0
+      && regno >= tdep->ppc_fp0_regnum
+      && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)
+    u_addr = (PT_FPR0 * wordsize) + ((regno - tdep->ppc_fp0_regnum) * 8);
 
   /* UISA special purpose registers: 1 slot each */
   if (regno == PC_REGNUM)
@@ -158,7 +212,8 @@
 #endif
   if (regno == tdep->ppc_ps_regnum)
     u_addr = PT_MSR * wordsize;
-  if (regno == tdep->ppc_fpscr_regnum)
+  if (tdep->ppc_fpscr_regnum >= 0
+      && regno == tdep->ppc_fpscr_regnum)
     u_addr = PT_FPSCR * wordsize;
 
   return u_addr;
@@ -198,15 +253,152 @@
                    regs + (regno - tdep->ppc_vr0_regnum) * vrregsize + offset);
 }
 
+/* Fetch the top 32 bits of TID's general-purpose registers and the
+   SPE-specific registers, and place the results in EVRREGSET.  If we
+   don't support PTRACE_GETEVRREGS, then just fill EVRREGSET with
+   zeros.
+
+   All the logic to deal with whether or not the PTRACE_GETEVRREGS and
+   PTRACE_SETEVRREGS requests are supported is isolated here, and in
+   set_spe_registers.  */
+static void
+get_spe_registers (int tid, struct gdb_evrregset_t *evrregset)
+{
+  if (have_ptrace_getsetevrregs)
+    {
+      if (ptrace (PTRACE_GETEVRREGS, tid, 0, evrregset) >= 0)
+        return;
+      else
+        {
+          /* EIO means that the PTRACE_GETEVRREGS request isn't supported;
+             we just return zeros.  */
+          if (errno == EIO)
+            have_ptrace_getsetevrregs = 0;
+          else
+            /* Anything else needs to be reported.  */
+            perror_with_name ("Unable to fetch SPE registers");
+        }
+    }
+
+  memset (evrregset, 0, sizeof (*evrregset));
+}
+
+/* Assuming TID refers to an SPE process, store the full 64-bit value
+   of TID's ev register EV_REGNUM in DEST, getting the high bits from
+   EVRREGS and the low bits from the kernel via ptrace.  */
+static void
+read_spliced_spe_reg (int tid, int ev_regnum,
+                      struct gdb_evrregset_t *evrregs,
+                      char *dest)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+  /* Make sure we're trying to read an EV register; that's all we
+     handle.  */
+  gdb_assert (tdep->ppc_ev0_regnum <= ev_regnum
+              && ev_regnum <= tdep->ppc_ev31_regnum);
+
+  /* Make sure the sizes for the splicing add up.  */
+  gdb_assert (sizeof (evrregs->evr[0]) + sizeof (PTRACE_XFER_TYPE)
+              == register_size (current_gdbarch, ev_regnum));
+
+  {
+    /* The index of ev_regnum in evrregs->evr[].  */
+    int ev_index = ev_regnum - tdep->ppc_ev0_regnum;
+
+    /* The number of the corresponding general-purpose register, which
+       holds the lower 32 bits of the EV register.  */
+    int gpr_regnum = tdep->ppc_gp0_regnum + ev_index;
+
+    /* The offset of gpr_regnum in the process's uarea.  */
+    CORE_ADDR gpr_uoffset = ppc_register_u_addr (gpr_regnum);
+
+    /* The low word of the EV register's value.  */
+    PTRACE_XFER_TYPE low_word;
+
+    /* The PTRACE_PEEKUSR / PT_READ_U ptrace requests need to be able
+       to return arbitrary register values, so they can't return -1 to
+       indicate an error.  So we clear errno, and then check it after
+       the call.  */
+    errno = 0;
+    low_word = ptrace (PT_READ_U, tid, (PTRACE_ARG3_TYPE) gpr_uoffset, 0);
+  
+    if (errno != 0)
+      {
+        char message[128];
+        sprintf (message, "reading register %s (#%d)",
+                 REGISTER_NAME (ev_regnum), ev_regnum);
+        perror_with_name (message);
+      }
+
+    if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+      {
+        memcpy (dest, &evrregs->evr[ev_index],
+                sizeof (evrregs->evr[ev_index]));
+        * (PTRACE_XFER_TYPE *) (dest + sizeof (evrregs->evr[ev_index]))
+          = low_word;
+      }
+    else if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
+      {
+        * (PTRACE_XFER_TYPE *) dest = low_word;
+        memcpy (dest + sizeof (PTRACE_XFER_TYPE),
+                &evrregs->evr[ev_index], sizeof (evrregs->evr[ev_index]));
+      }
+    else
+      gdb_assert (0);
+  }
+}
+
+
+/* On SPE machines, supply the full value of the SPE register REGNO
+   from TID.  This handles ev0 -- ev31 and acc, which are 64 bits
+   long, and spefscr, which is 32 bits long.  */
+static void
+fetch_spe_register (int tid, int regno)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  struct gdb_evrregset_t evrregs;
+
+  get_spe_registers (tid, &evrregs);
+
+  if (tdep->ppc_ev0_regnum <= regno
+      && regno <= tdep->ppc_ev31_regnum)
+    {
+      char buf[MAX_REGISTER_SIZE];
+      read_spliced_spe_reg (tid, regno, &evrregs, buf);
+      supply_register (regno, buf);
+    }
+  else if (regno == tdep->ppc_acc_regnum)
+    {
+      gdb_assert (sizeof (evrregs.acc)
+                  == register_size (current_gdbarch, regno));
+      supply_register (regno, &evrregs.acc);
+    }
+  else if (regno == tdep->ppc_spefscr_regnum)
+    {
+      gdb_assert (sizeof (evrregs.spefscr)
+                  == register_size (current_gdbarch, regno));
+      supply_register (regno, &evrregs.spefscr);
+    }
+  else
+    gdb_assert (0);
+}
+
 static void
 fetch_register (int tid, int regno)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   /* This isn't really an address.  But ptrace thinks of it as one.  */
-  char mess[128];              /* For messages */
-  int i;
+  CORE_ADDR regaddr = ppc_register_u_addr (regno);
+  int bytes_transferred;
   unsigned int offset;         /* Offset of registers within the u area. */
   char buf[MAX_REGISTER_SIZE];
-  CORE_ADDR regaddr = ppc_register_u_addr (regno);
+
+  /* Sanity check: this function should only be called to fetch raw
+     registers' values, never pseudoregisters' values.  */
+  if (tdep->ppc_gp0_regnum <= regno
+      && regno < tdep->ppc_gp0_regnum + ppc_num_gprs)
+    gdb_assert (! tdep->ppc_gprs_pseudo_p);
 
   if (altivec_register_p (regno))
     {
@@ -223,6 +415,11 @@
         AltiVec registers, fall through and return zeroes, because
         regaddr will be -1 in this case.  */
     }
+  else if (spe_register_p (regno))
+    {
+      fetch_spe_register (tid, regno);
+      return;
+    }
 
   if (regaddr == -1)
     {
@@ -234,32 +431,42 @@
   /* Read the raw register using PTRACE_XFER_TYPE sized chunks.  On a
      32-bit platform, 64-bit floating-point registers will require two
      transfers.  */
-  for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+  for (bytes_transferred = 0;
+       bytes_transferred < register_size (current_gdbarch, regno);
+       bytes_transferred += sizeof (PTRACE_XFER_TYPE))
     {
       errno = 0;
-      *(PTRACE_XFER_TYPE *) & buf[i] = ptrace (PT_READ_U, tid,
-					       (PTRACE_ARG3_TYPE) regaddr, 0);
+      *(PTRACE_XFER_TYPE *) & buf[bytes_transferred]
+        = ptrace (PT_READ_U, tid, (PTRACE_ARG3_TYPE) regaddr, 0);
       regaddr += sizeof (PTRACE_XFER_TYPE);
       if (errno != 0)
 	{
-	  sprintf (mess, "reading register %s (#%d)", 
+          char message[128];
+	  sprintf (message, "reading register %s (#%d)", 
 		   REGISTER_NAME (regno), regno);
-	  perror_with_name (mess);
+	  perror_with_name (message);
 	}
     }
 
-  /* Now supply the register.  Be careful to map between ptrace's and
-     the current_regcache's idea of the current wordsize.  */
-  if ((regno >= FP0_REGNUM && regno < FP0_REGNUM +32)
-      || gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE)
-    /* FPs are always 64 bits.  Little endian values are always found
-       at the left-hand end of the register.  */
-    regcache_raw_supply (current_regcache, regno, buf);
-  else
-    /* Big endian register, need to fetch the right-hand end.  */
-    regcache_raw_supply (current_regcache, regno,
-                        (buf + sizeof (PTRACE_XFER_TYPE)
-                         - register_size (current_gdbarch, regno)));
+  /* Now supply the register.  Keep in mind that the regcache's idea
+     of the register's size may not be a multiple of sizeof
+     (PTRACE_XFER_TYPE).  */
+  if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_LITTLE)
+    {
+      /* Little-endian values are always found at the left end of the
+         bytes transferred.  */
+      regcache_raw_supply (current_regcache, regno, buf);
+    }
+  else if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+    {
+      /* Big-endian values are found at the right end of the bytes
+         transferred.  */
+      size_t padding = (bytes_transferred
+                        - register_size (current_gdbarch, regno));
+      regcache_raw_supply (current_regcache, regno, buf + padding);
+    }
+  else 
+    gdb_assert (0);
 }
 
 static void
@@ -304,19 +511,64 @@
   supply_vrregset (&regs);
 }
 
+/* On SPE machines, fetch the full 64 bits of all the general-purpose
+   registers, as well as the SPE-specific registers 'acc' and
+   'spefscr'.  */
+static void
+fetch_spe_registers (int tid)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  struct gdb_evrregset_t evrregs;
+  int i;
+
+  get_spe_registers (tid, &evrregs);
+
+  /* Splice and supply each of the EV registers.  */
+  for (i = 0; i < ppc_num_gprs; i++)
+    {
+      char buf[MAX_REGISTER_SIZE];
+
+      read_spliced_spe_reg (tid, tdep->ppc_ev0_regnum + i, &evrregs, buf);
+      supply_register (tdep->ppc_ev0_regnum + i, buf);
+    }
+
+  /* Supply the SPE-specific registers.  */
+  supply_register (tdep->ppc_acc_regnum, &evrregs.acc);
+  supply_register (tdep->ppc_spefscr_regnum, &evrregs.spefscr);
+}
+
 static void 
 fetch_ppc_registers (int tid)
 {
   int i;
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
-  for (i = 0; i <= tdep->ppc_fpscr_regnum; i++)
-    fetch_register (tid, i);
+  if (! tdep->ppc_gprs_pseudo_p)
+    for (i = 0; i < ppc_num_gprs; i++)
+      fetch_register (tid, tdep->ppc_gp0_regnum + i);
+  if (tdep->ppc_fp0_regnum >= 0)
+    for (i = 0; i < ppc_num_fprs; i++)
+      fetch_register (tid, tdep->ppc_fp0_regnum + i);
+  fetch_register (tid, PC_REGNUM);
+  if (tdep->ppc_ps_regnum != -1)
+    fetch_register (tid, tdep->ppc_ps_regnum);
+  if (tdep->ppc_cr_regnum != -1)
+    fetch_register (tid, tdep->ppc_cr_regnum);
+  if (tdep->ppc_lr_regnum != -1)
+    fetch_register (tid, tdep->ppc_lr_regnum);
+  if (tdep->ppc_ctr_regnum != -1)
+    fetch_register (tid, tdep->ppc_ctr_regnum);
+  if (tdep->ppc_xer_regnum != -1)
+    fetch_register (tid, tdep->ppc_xer_regnum);
   if (tdep->ppc_mq_regnum != -1)
     fetch_register (tid, tdep->ppc_mq_regnum);
+  if (tdep->ppc_fpscr_regnum != -1)
+    fetch_register (tid, tdep->ppc_fpscr_regnum);
   if (have_ptrace_getvrregs)
     if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
       fetch_altivec_registers (tid);
+  if (tdep->ppc_ev0_regnum >= 0)
+    fetch_spe_registers (tid);
 }
 
 /* Fetch registers from the child process.  Fetch all registers if
@@ -372,41 +624,186 @@
     perror_with_name ("Unable to store AltiVec register");
 }
 
+/* Assuming TID referrs to an SPE process, set the top halves of TID's
+   general-purpose registers and its SPE-specific registers to the
+   values in EVRREGSET.  If we don't support PTRACE_SETEVRREGS, do
+   nothing.
+
+   All the logic to deal with whether or not the PTRACE_GETEVRREGS and
+   PTRACE_SETEVRREGS requests are supported is isolated here, and in
+   get_spe_registers.  */
+static void
+set_spe_registers (int tid, struct gdb_evrregset_t *evrregset)
+{
+  if (have_ptrace_getsetevrregs)
+    {
+      if (ptrace (PTRACE_SETEVRREGS, tid, 0, evrregset) >= 0)
+        return;
+      else
+        {
+          /* EIO means that the PTRACE_SETEVRREGS request isn't
+             supported; we fail silently, and don't try the call
+             again.  */
+          if (errno == EIO)
+            have_ptrace_getsetevrregs = 0;
+          else
+            /* Anything else needs to be reported.  */
+            perror_with_name ("Unable to set SPE registers");
+        }
+    }
+}
+
+/* Store the bytes at SRC as the contents of TID's EV register EV_REGNUM.
+   Write the less significant word to TID using ptrace, and copy the
+   more significant word to the appropriate slot in EVRREGS.  */
+static void
+write_spliced_spe_reg (int tid, int ev_regnum,
+                       struct gdb_evrregset_t *evrregs,
+                       char *src)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+  /* Make sure we're trying to write an EV register; that's all we
+     handle.  */
+  gdb_assert (tdep->ppc_ev0_regnum <= ev_regnum
+              && ev_regnum <= tdep->ppc_ev31_regnum);
+
+  /* Make sure the sizes for the splicing add up.  */
+  gdb_assert (sizeof (evrregs->evr[0]) + sizeof (PTRACE_XFER_TYPE)
+              == register_size (current_gdbarch, ev_regnum));
+
+  {
+    int ev_index = ev_regnum - tdep->ppc_ev0_regnum;
+
+    /* The number of the corresponding general-purpose register, which
+       holds the lower 32 bits of the EV register.  */
+    int gpr_regnum = tdep->ppc_gp0_regnum + ev_index;
+
+    /* The offset of gpr_regnum in the process's uarea.  */
+    CORE_ADDR gpr_uoffset = ppc_register_u_addr (gpr_regnum);
+
+    /* The PTRACE_POKEUSR / PT_WRITE_U ptrace requests need to be able
+       to return arbitrary register values, so they can't return -1 to
+       indicate an error.  So we clear errno, and check it again
+       afterwards.  */
+    errno = 0;
+
+    if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+      {
+        memcpy (&evrregs->evr[ev_index], src, sizeof (evrregs->evr[ev_index]));
+        ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) gpr_uoffset,
+                * (PTRACE_XFER_TYPE *) (src + sizeof (evrregs->evr[0])));
+      }
+    else if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
+      {
+        ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) gpr_uoffset,
+                * (PTRACE_XFER_TYPE *) src);
+        memcpy (&evrregs->evr[ev_index], src + sizeof (PTRACE_XFER_TYPE),
+                sizeof (evrregs->evr[ev_index]));
+      }
+    else 
+      gdb_assert (0);
+
+    if (errno != 0)
+      {
+        char message[128];
+        sprintf (message, "writing register %s (#%d)", 
+                 REGISTER_NAME (ev_regnum), ev_regnum);
+        perror_with_name (message);
+      }
+  }
+}
+
+/* Write GDB's value for the SPE register REGNO to TID.  */
+static void
+store_spe_register (int tid, int regno)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  struct gdb_evrregset_t evrregs;
+
+  /* We can only read and write the entire EVR register set at a time,
+     so to write just a single register, we do a read-modify-write
+     maneuver.  */
+  get_spe_registers (tid, &evrregs);
+
+  if (tdep->ppc_ev0_regnum >= 0
+      && tdep->ppc_ev0_regnum <= regno && regno <= tdep->ppc_ev31_regnum)
+    {
+      char buf[MAX_REGISTER_SIZE];
+      regcache_collect (regno, buf);
+      write_spliced_spe_reg (tid, regno, &evrregs, buf);
+    }
+  else if (tdep->ppc_acc_regnum >= 0
+           && regno == tdep->ppc_acc_regnum)
+    {
+      gdb_assert (sizeof (evrregs.acc)
+                  == register_size (current_gdbarch, regno));
+      regcache_collect (regno, &evrregs.acc);
+    }
+  else if (tdep->ppc_spefscr_regnum >= 0
+           && regno == tdep->ppc_spefscr_regnum)
+    {
+      gdb_assert (sizeof (evrregs.spefscr)
+                  == register_size (current_gdbarch, regno));
+      regcache_collect (regno, &evrregs.spefscr);
+    }
+  else
+    gdb_assert (0);
+
+  /* Write back the modified register set.  */
+  set_spe_registers (tid, &evrregs);
+}
+
 static void
 store_register (int tid, int regno)
 {
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   /* This isn't really an address.  But ptrace thinks of it as one.  */
   CORE_ADDR regaddr = ppc_register_u_addr (regno);
-  char mess[128];              /* For messages */
   int i;
-  unsigned int offset;         /* Offset of registers within the u area.  */
+  size_t bytes_to_transfer;
   char buf[MAX_REGISTER_SIZE];
 
+  /* Sanity check: this function should only be called to store raw
+     registers' values, never pseudoregisters' values.  */
+  if (tdep->ppc_gp0_regnum <= regno
+      && regno < tdep->ppc_gp0_regnum + ppc_num_gprs)
+    gdb_assert (! tdep->ppc_gprs_pseudo_p);
+
   if (altivec_register_p (regno))
     {
       store_altivec_register (tid, regno);
       return;
     }
+  else if (spe_register_p (regno))
+    {
+      store_spe_register (tid, regno);
+      return;
+    }
 
   if (regaddr == -1)
     return;
 
-  /* First collect the register value from the regcache.  Be careful
-     to to convert the regcache's wordsize into ptrace's wordsize.  */
+  /* First collect the register.  Keep in mind that the regcache's
+     idea of the register's size may not be a multiple of sizeof
+     (PTRACE_XFER_TYPE).  */
   memset (buf, 0, sizeof buf);
-  if ((regno >= FP0_REGNUM && regno < FP0_REGNUM + 32)
-      || TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
-    /* Floats are always 64-bit.  Little endian registers are always
-       at the left-hand end of the register cache.  */
-    regcache_raw_collect (current_regcache, regno, buf);
-  else
-    /* Big-endian registers belong at the right-hand end of the
-       buffer.  */
-    regcache_raw_collect (current_regcache, regno,
-                         (buf + sizeof (PTRACE_XFER_TYPE)
-                          - register_size (current_gdbarch, regno)));
+  bytes_to_transfer = align_up (register_size (current_gdbarch, regno),
+                                sizeof (PTRACE_XFER_TYPE));
+  if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
+    {
+      /* Little-endian values always sit at the left end of the buffer.  */
+      regcache_raw_collect (current_regcache, regno, buf);
+    }
+  else if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+    {
+      /* Big-endian values sit at the right end of the buffer.  */
+      size_t padding = (bytes_to_transfer
+                        - register_size (current_gdbarch, regno));
+      regcache_raw_collect (current_regcache, regno, buf + padding);
+    }
 
-  for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+  for (i = 0; i < bytes_to_transfer; i += sizeof (PTRACE_XFER_TYPE))
     {
       errno = 0;
       ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr,
@@ -414,7 +811,7 @@
       regaddr += sizeof (PTRACE_XFER_TYPE);
 
       if (errno == EIO 
-          && regno == gdbarch_tdep (current_gdbarch)->ppc_fpscr_regnum)
+          && regno == tdep->ppc_fpscr_regnum)
 	{
 	  /* Some older kernel versions don't allow fpscr to be written.  */
 	  continue;
@@ -422,9 +819,10 @@
 
       if (errno != 0)
 	{
-	  sprintf (mess, "writing register %s (#%d)", 
+          char message[128];
+	  sprintf (message, "writing register %s (#%d)", 
 		   REGISTER_NAME (regno), regno);
-	  perror_with_name (mess);
+	  perror_with_name (message);
 	}
     }
 }
@@ -474,18 +872,67 @@
 }
 
 static void
+store_spe_registers (tid)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  struct gdb_evrregset_t evrregs;
+  int i;
+
+  /* The code below should store to every field of evrregs; if that
+     doesn't happen, make it obvious by initializing it with
+     suspicious values.  */
+  memset (&evrregs, 42, sizeof (evrregs));
+
+  for (i = 0; i < ppc_num_gprs; i++)
+    {
+      char buf[MAX_REGISTER_SIZE];
+
+      regcache_collect (tdep->ppc_ev0_regnum + i, buf);
+      write_spliced_spe_reg (tid, tdep->ppc_ev0_regnum + i, &evrregs, buf);
+    }
+
+  gdb_assert (sizeof (evrregs.acc)
+              == register_size (current_gdbarch, tdep->ppc_acc_regnum));
+  regcache_collect (tdep->ppc_acc_regnum, &evrregs.acc);
+  gdb_assert (sizeof (evrregs.spefscr)
+              == register_size (current_gdbarch, tdep->ppc_spefscr_regnum));
+  regcache_collect (tdep->ppc_acc_regnum, &evrregs.spefscr);
+
+  set_spe_registers (tid, &evrregs);
+}
+
+static void
 store_ppc_registers (int tid)
 {
   int i;
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   
-  for (i = 0; i <= tdep->ppc_fpscr_regnum; i++)
-    store_register (tid, i);
+  if (! tdep->ppc_gprs_pseudo_p)
+    for (i = 0; i < ppc_num_gprs; i++)
+      store_register (tid, tdep->ppc_gp0_regnum + i);
+  if (tdep->ppc_fp0_regnum >= 0)
+    for (i = 0; i < ppc_num_fprs; i++)
+      store_register (tid, tdep->ppc_fp0_regnum + i);
+  store_register (tid, PC_REGNUM);
+  if (tdep->ppc_ps_regnum != -1)
+    store_register (tid, tdep->ppc_ps_regnum);
+  if (tdep->ppc_cr_regnum != -1)
+    store_register (tid, tdep->ppc_cr_regnum);
+  if (tdep->ppc_lr_regnum != -1)
+    store_register (tid, tdep->ppc_lr_regnum);
+  if (tdep->ppc_ctr_regnum != -1)
+    store_register (tid, tdep->ppc_ctr_regnum);
+  if (tdep->ppc_xer_regnum != -1)
+    store_register (tid, tdep->ppc_xer_regnum);
   if (tdep->ppc_mq_regnum != -1)
     store_register (tid, tdep->ppc_mq_regnum);
+  if (tdep->ppc_fpscr_regnum != -1)
+    store_register (tid, tdep->ppc_fpscr_regnum);
   if (have_ptrace_getvrregs)
     if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1)
       store_altivec_registers (tid);
+  if (tdep->ppc_ev0_regnum >= 0)
+    store_spe_registers (tid);
 }
 
 void
@@ -539,10 +986,10 @@
   /* Start with zeros.  */
   memset (regp, 0, elf_ngreg * sizeof (*regp));
 
-  for (regi = 0; regi < 32; regi++)
+  for (regi = 0; regi < ppc_num_gprs; regi++)
     {
-      if ((regno == -1) || regno == regi)
-	right_fill_reg (regi, (regp + PT_R0 + regi));
+      if ((regno == -1) || regno == tdep->ppc_gp0_regnum + regi)
+	right_fill_reg (tdep->ppc_gp0_regnum + regi, (regp + PT_R0 + regi));
     }
 
   if ((regno == -1) || regno == PC_REGNUM)
@@ -582,11 +1029,14 @@
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); 
   bfd_byte *fpp = (void *) fpregsetp;
   
-  for (regi = 0; regi < 32; regi++)
+  if (ppc_floating_point_unit_p (current_gdbarch))
     {
-      if ((regno == -1) || (regno == FP0_REGNUM + regi))
-	regcache_collect (FP0_REGNUM + regi, fpp + 8 * regi);
+      for (regi = 0; regi < ppc_num_fprs; regi++)
+        {
+          if ((regno == -1) || (regno == tdep->ppc_fp0_regnum + regi))
+            regcache_collect (tdep->ppc_fp0_regnum + regi, fpp + 8 * regi);
+        }
+      if (regno == -1 || regno == tdep->ppc_fpscr_regnum)
+        right_fill_reg (tdep->ppc_fpscr_regnum, (fpp + 8 * 32));
     }
-  if ((regno == -1) || regno == tdep->ppc_fpscr_regnum)
-    right_fill_reg (tdep->ppc_fpscr_regnum, (fpp + 8 * 32));
 }
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index ba2733e..a7e58bc 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -114,8 +114,8 @@
 /* Determine if pc is in a signal trampoline...
 
    Ha!  That's not what this does at all.  wait_for_inferior in
-   infrun.c calls DEPRECATED_PC_IN_SIGTRAMP in order to detect entry
-   into a signal trampoline just after delivery of a signal.  But on
+   infrun.c calls get_frame_type() in order to detect entry into a
+   signal trampoline just after delivery of a signal.  But on
    GNU/Linux, signal trampolines are used for the return path only.
    The kernel sets things up so that the signal handler is called
    directly.
@@ -146,20 +146,9 @@
    signal is delivered while stepping, the next instruction that
    would've been stepped over isn't, instead a signal is delivered and
    the first instruction of the handler is stepped over instead.  That
-   puts us on the second instruction.  (I added the test for the
-   first instruction long after the fact, just in case the observed
-   behavior is ever fixed.)
-
-   DEPRECATED_PC_IN_SIGTRAMP is called from blockframe.c as well in
-   order to set the frame's type (if a SIGTRAMP_FRAME).  Because of
-   our strange definition of in_sigtramp below, we can't rely on the
-   frame's type getting set correctly from within blockframe.c.  This
-   is why we take pains to set it in init_extra_frame_info().
-
-   NOTE: cagney/2002-11-10: I suspect the real problem here is that
-   the get_prev_frame() only initializes the frame's type after the
-   call to INIT_FRAME_INFO.  get_prev_frame() should be fixed, this
-   code shouldn't be working its way around a bug :-(.  */
+   puts us on the second instruction.  (I added the test for the first
+   instruction long after the fact, just in case the observed behavior
+   is ever fixed.)  */
 
 int
 ppc_linux_in_sigtramp (CORE_ADDR pc, char *func_name)
@@ -848,17 +837,6 @@
   return addr;
 }
 
-
-enum {
-  ELF_NGREG = 48,
-  ELF_NFPREG = 33,
-  ELF_NVRREG = 33
-};
-
-enum {
-  ELF_FPREGSET_SIZE = (ELF_NFPREG * 8)
-};
-
 static void
 right_supply_register (struct regcache *regcache, int wordsize, int regnum,
 		       const bfd_byte *buf)
@@ -882,8 +860,10 @@
   struct gdbarch_tdep *regcache_tdep = gdbarch_tdep (regcache_arch);
   const bfd_byte *buf = gregs;
 
-  for (regi = 0; regi < 32; regi++)
-    right_supply_register (regcache, wordsize, regi, buf + wordsize * regi);
+  for (regi = 0; regi < ppc_num_gprs; regi++)
+    right_supply_register (regcache, wordsize,
+                           regcache_tdep->ppc_gp0_regnum + regi,
+                           buf + wordsize * regi);
 
   right_supply_register (regcache, wordsize, gdbarch_pc_regnum (regcache_arch),
 			 buf + wordsize * PPC_LINUX_PT_NIP);
@@ -954,7 +934,7 @@
   fpregs = gpregs + 48 * tdep->wordsize;
 
   /* General purpose.  */
-  for (i = 0; i < 32; i++)
+  for (i = 0; i < ppc_num_gprs; i++)
     {
       int regnum = i + tdep->ppc_gp0_regnum;
       cache->saved_regs[regnum].addr = gpregs + i * tdep->wordsize;
@@ -966,12 +946,16 @@
   cache->saved_regs[tdep->ppc_cr_regnum].addr = gpregs + 38 * tdep->wordsize;
 
   /* Floating point registers.  */
-  for (i = 0; i < 32; i++)
+  if (ppc_floating_point_unit_p (gdbarch))
     {
-      int regnum = i + FP0_REGNUM;
-      cache->saved_regs[regnum].addr = fpregs + i * tdep->wordsize;
+      for (i = 0; i < ppc_num_fprs; i++)
+        {
+          int regnum = i + tdep->ppc_fp0_regnum;
+          cache->saved_regs[regnum].addr = fpregs + i * tdep->wordsize;
+        }
+      cache->saved_regs[tdep->ppc_fpscr_regnum].addr
+        = fpregs + 32 * tdep->wordsize;
     }
-  cache->saved_regs[tdep->ppc_fpscr_regnum].addr = fpregs + 32 * tdep->wordsize;
 
   return cache;
 }
@@ -1040,13 +1024,18 @@
   struct gdbarch_tdep *regcache_tdep = gdbarch_tdep (regcache_arch);
   const bfd_byte *buf = fpset;
 
-  for (regi = 0; regi < 32; regi++)
-    regcache_raw_supply (regcache, FP0_REGNUM + regi, buf + 8 * regi);
+  if (! ppc_floating_point_unit_p (regcache_arch))
+    return;
 
-  /* The FPSCR is stored in the low order word of the last doubleword in the
-     fpregset.  */
+  for (regi = 0; regi < ppc_num_fprs; regi++)
+    regcache_raw_supply (regcache, 
+                         regcache_tdep->ppc_fp0_regnum + regi,
+                         buf + 8 * regi);
+
+  /* The FPSCR is stored in the low order word of the last
+     doubleword in the fpregset.  */
   regcache_raw_supply (regcache, regcache_tdep->ppc_fpscr_regnum,
-		       buf + 8 * 32 + 4);
+                       buf + 8 * 32 + 4);
 }
 
 static struct regset ppc_linux_fpregset = { NULL, ppc_linux_supply_fpregset };
@@ -1076,6 +1065,15 @@
 
   if (tdep->wordsize == 4)
     {
+      /* NOTE: jimb/2004-03-26: The System V ABI PowerPC Processor
+         Supplement says that long doubles are sixteen bytes long.
+         However, as one of the known warts of its ABI, PPC GNU/Linux
+         uses eight-byte long doubles.  GCC only recently got 128-bit
+         long double support on PPC, so it may be changing soon.  The
+         Linux Standards Base says that programs that use 'long
+         double' on PPC GNU/Linux are non-conformant.  */
+      set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
+
       /* Until November 2001, gcc did not comply with the 32 bit SysV
 	 R4 ABI requirement that structures less than or equal to 8
 	 bytes should be returned in registers.  Instead GCC was using
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 60cf986..cdf2855 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -30,6 +30,7 @@
 #include "ppc-tdep.h"
 #include "target.h"
 #include "objfiles.h"
+#include "infcall.h"
 
 /* Pass the arguments in either registers, or in the stack. Using the
    ppc sysv ABI, the first eight words of the argument list (that might
@@ -43,7 +44,7 @@
    starting from r4. */
 
 CORE_ADDR
-ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			      struct regcache *regcache, CORE_ADDR bp_addr,
 			      int nargs, struct value **args, CORE_ADDR sp,
 			      int struct_return, CORE_ADDR struct_addr)
@@ -114,9 +115,10 @@
 		         the register's floating-point format.  */
 		      char regval[MAX_REGISTER_SIZE];
 		      struct type *regtype
-			= register_type (gdbarch, FP0_REGNUM + freg);
+			= register_type (gdbarch, tdep->ppc_fp0_regnum + freg);
 		      convert_typed_floating (val, type, regval, regtype);
-		      regcache_cooked_write (regcache, FP0_REGNUM + freg,
+		      regcache_cooked_write (regcache,
+                                             tdep->ppc_fp0_regnum + freg,
 					     regval);
 		    }
 		  freg++;
@@ -338,8 +340,9 @@
 	  /* Floats and doubles stored in "f1".  Convert the value to
 	     the required type.  */
 	  char regval[MAX_REGISTER_SIZE];
-	  struct type *regtype = register_type (gdbarch, FP0_REGNUM + 1);
-	  regcache_cooked_read (regcache, FP0_REGNUM + 1, regval);
+	  struct type *regtype = register_type (gdbarch,
+                                                tdep->ppc_fp0_regnum + 1);
+	  regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
 	  convert_typed_floating (regval, regtype, readbuf, type);
 	}
       if (writebuf)
@@ -347,9 +350,9 @@
 	  /* Floats and doubles stored in "f1".  Convert the value to
 	     the register's "double" type.  */
 	  char regval[MAX_REGISTER_SIZE];
-	  struct type *regtype = register_type (gdbarch, FP0_REGNUM);
+	  struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum);
 	  convert_typed_floating (writebuf, type, regval, regtype);
-	  regcache_cooked_write (regcache, FP0_REGNUM + 1, regval);
+	  regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
 	}
       return RETURN_VALUE_REGISTER_CONVENTION;
     }
@@ -538,11 +541,12 @@
    greatly simplifies the logic. */
 
 CORE_ADDR
-ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 				struct regcache *regcache, CORE_ADDR bp_addr,
 				int nargs, struct value **args, CORE_ADDR sp,
 				int struct_return, CORE_ADDR struct_addr)
 {
+  CORE_ADDR func_addr = find_function_addr (function, NULL);
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   /* By this stage in the proceedings, SP has been decremented by "red
      zone size" + "struct return size".  Fetch the stack-pointer from
@@ -643,10 +647,11 @@
 		      && freg <= 13)
 		    {
 		      char regval[MAX_REGISTER_SIZE];
-		      struct type *regtype = register_type (gdbarch,
-							    FP0_REGNUM);
+		      struct type *regtype
+                        = register_type (gdbarch, tdep->ppc_fp0_regnum);
 		      convert_typed_floating (val, type, regval, regtype);
-		      regcache_cooked_write (regcache, FP0_REGNUM + freg,
+		      regcache_cooked_write (regcache,
+                                             tdep->ppc_fp0_regnum + freg,
 					     regval);
 		    }
 		  if (greg <= 10)
@@ -847,19 +852,25 @@
 			     const void *writebuf)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  /* This function exists to support a calling convention that
+     requires floating-point registers.  It shouldn't be used on
+     processors that lack them.  */
+  gdb_assert (ppc_floating_point_unit_p (gdbarch));
+
   /* Floats and doubles in F1.  */
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT && TYPE_LENGTH (valtype) <= 8)
     {
       char regval[MAX_REGISTER_SIZE];
-      struct type *regtype = register_type (gdbarch, FP0_REGNUM);
+      struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum);
       if (writebuf != NULL)
 	{
 	  convert_typed_floating (writebuf, valtype, regval, regtype);
-	  regcache_cooked_write (regcache, FP0_REGNUM + 1, regval);
+	  regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
 	}
       if (readbuf != NULL)
 	{
-	  regcache_cooked_read (regcache, FP0_REGNUM + 1, regval);
+	  regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
 	  convert_typed_floating (regval, regtype, readbuf, valtype);
 	}
       return RETURN_VALUE_REGISTER_CONVENTION;
@@ -921,10 +932,10 @@
 	  for (i = 0; i < TYPE_LENGTH (valtype) / 8; i++)
 	    {
 	      if (writebuf != NULL)
-		regcache_cooked_write (regcache, FP0_REGNUM + 1 + i,
+		regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1 + i,
 				       (const bfd_byte *) writebuf + i * 8);
 	      if (readbuf != NULL)
-		regcache_cooked_read (regcache, FP0_REGNUM + 1 + i,
+		regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1 + i,
 				      (bfd_byte *) readbuf + i * 8);
 	    }
 	}
@@ -941,18 +952,21 @@
 	    {
 	      char regval[MAX_REGISTER_SIZE];
 	      struct type *regtype =
-		register_type (current_gdbarch, FP0_REGNUM);
+		register_type (current_gdbarch, tdep->ppc_fp0_regnum);
 	      if (writebuf != NULL)
 		{
 		  convert_typed_floating ((const bfd_byte *) writebuf +
 					  i * (TYPE_LENGTH (valtype) / 2),
 					  valtype, regval, regtype);
-		  regcache_cooked_write (regcache, FP0_REGNUM + 1 + i,
+		  regcache_cooked_write (regcache,
+                                         tdep->ppc_fp0_regnum + 1 + i,
 					 regval);
 		}
 	      if (readbuf != NULL)
 		{
-		  regcache_cooked_read (regcache, FP0_REGNUM + 1 + i, regval);
+		  regcache_cooked_read (regcache,
+                                        tdep->ppc_fp0_regnum + 1 + i,
+                                        regval);
 		  convert_typed_floating (regval, regtype,
 					  (bfd_byte *) readbuf +
 					  i * (TYPE_LENGTH (valtype) / 2),
@@ -971,10 +985,10 @@
 	  for (i = 0; i < 4; i++)
 	    {
 	      if (writebuf != NULL)
-		regcache_cooked_write (regcache, FP0_REGNUM + 1 + i,
+		regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1 + i,
 				       (const bfd_byte *) writebuf + i * 8);
 	      if (readbuf != NULL)
-		regcache_cooked_read (regcache, FP0_REGNUM + 1 + i,
+		regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1 + i,
 				      (bfd_byte *) readbuf + i * 8);
 	    }
 	}
diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h
index d570f79..f770530 100644
--- a/gdb/ppc-tdep.h
+++ b/gdb/ppc-tdep.h
@@ -41,14 +41,14 @@
 							       void *readbuf,
 							       const void *writebuf);
 CORE_ADDR ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
-					CORE_ADDR func_addr,
+					struct value *function,
 					struct regcache *regcache,
 					CORE_ADDR bp_addr, int nargs,
 					struct value **args, CORE_ADDR sp,
 					int struct_return,
 					CORE_ADDR struct_addr);
 CORE_ADDR ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
-					  CORE_ADDR func_addr,
+					  struct value *function,
 					  struct regcache *regcache,
 					  CORE_ADDR bp_addr, int nargs,
 					  struct value **args, CORE_ADDR sp,
@@ -73,36 +73,108 @@
 
 /* From rs6000-tdep.c... */
 int altivec_register_p (int regno);
+int spe_register_p (int regno);
 
-
-/* Return non-zero when the architecture has an FPU (or at least when
-   the ABI is using the FPU).  */
+/* Return non-zero if the architecture described by GDBARCH has
+   floating-point registers (f0 --- f31 and fpscr).  */
 int ppc_floating_point_unit_p (struct gdbarch *gdbarch);
 
+/* Register set description.  */
+
+struct ppc_reg_offsets
+{
+  /* General-purpose registers.  */
+  int r0_offset;
+  int pc_offset;
+  int ps_offset;
+  int cr_offset;
+  int lr_offset;
+  int ctr_offset;
+  int xer_offset;
+  int mq_offset;
+
+  /* Floating-point registers.  */
+  int f0_offset;
+  int fpscr_offset;
+
+  /* AltiVec registers.  */
+  int vr0_offset;
+  int vscr_offset;
+  int vrsave_offset;
+};
+
+/* Supply register REGNUM in the general-purpose register set REGSET
+   from the buffer specified by GREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+extern void ppc_supply_gregset (const struct regset *regset,
+				struct regcache *regcache,
+				int regnum, const void *gregs, size_t len);
+
+/* Supply register REGNUM in the floating-point register set REGSET
+   from the buffer specified by FPREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+extern void ppc_supply_fpregset (const struct regset *regset,
+				 struct regcache *regcache,
+				 int regnum, const void *fpregs, size_t len);
+
+/* Collect register REGNUM in the general-purpose register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   GREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+extern void ppc_collect_gregset (const struct regset *regset,
+				 const struct regcache *regcache,
+				 int regnum, void *gregs, size_t len);
+
+/* Collect register REGNUM in the floating-point register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   FPREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+extern void ppc_collect_fpregset (const struct regset *regset,
+				  const struct regcache *regcache,
+				  int regnum, void *fpregs, size_t len);
+
 /* Private data that this module attaches to struct gdbarch. */
 
 struct gdbarch_tdep
   {
     int wordsize;              /* size in bytes of fixed-point word */
-    int *regoff;               /* byte offsets in register arrays */
     const struct reg *regs;    /* from current variant */
     int ppc_gp0_regnum;		/* GPR register 0 */
-    int ppc_gplast_regnum;	/* GPR register 31 */
+    int ppc_gprs_pseudo_p;      /* non-zero if GPRs are pseudo-registers */
     int ppc_toc_regnum;		/* TOC register */
     int ppc_ps_regnum;	        /* Processor (or machine) status (%msr) */
     int ppc_cr_regnum;		/* Condition register */
     int ppc_lr_regnum;		/* Link register */
     int ppc_ctr_regnum;		/* Count register */
     int ppc_xer_regnum;		/* Integer exception register */
+
+    /* On PPC and RS6000 variants that have no floating-point
+       registers, the next two members will be -1.  */
+    int ppc_fp0_regnum;         /* floating-point register 0 */
     int ppc_fpscr_regnum;	/* Floating point status and condition
     				   register */
+
     int ppc_mq_regnum;		/* Multiply/Divide extension register */
     int ppc_vr0_regnum;		/* First AltiVec register */
     int ppc_vrsave_regnum;	/* Last AltiVec register */
     int ppc_ev0_regnum;         /* First ev register */
     int ppc_ev31_regnum;        /* Last ev register */
+    int ppc_acc_regnum;         /* SPE 'acc' register */
+    int ppc_spefscr_regnum;     /* SPE 'spefscr' register */
     int lr_frame_offset;	/* Offset to ABI specific location where
                                    link register is saved.  */
 };
 
+
+/* Constants for register set sizes.  */
+enum
+  {
+    ppc_num_gprs = 32,          /* 32 general-purpose registers */
+    ppc_num_fprs = 32           /* 32 floating-point registers */
+  };
+
 #endif
diff --git a/gdb/ppcnbsd-nat.c b/gdb/ppcnbsd-nat.c
index ce097d7..7b22b12 100644
--- a/gdb/ppcnbsd-nat.c
+++ b/gdb/ppcnbsd-nat.c
@@ -25,6 +25,7 @@
 
 #include "defs.h"
 #include "inferior.h"
+#include "gdb_assert.h"
 
 #include "ppc-tdep.h"
 #include "ppcnbsd-tdep.h"
@@ -35,7 +36,8 @@
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
-  return ((regno >= 0 && regno <= 31)
+  return ((regno >= tdep->ppc_gp0_regnum
+           && regno < tdep->ppc_gp0_regnum + ppc_num_gprs)
           || regno == tdep->ppc_lr_regnum
           || regno == tdep->ppc_cr_regnum
           || regno == tdep->ppc_xer_regnum
@@ -49,7 +51,20 @@
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
-  return ((regno >= FP0_REGNUM && regno <= FP0_REGNUM + 31)
+  /* FIXME: jimb/2004-05-05: Some PPC variants don't have floating
+     point registers.  Traditionally, GDB's register set has still
+     listed the floating point registers for such machines, so this
+     code is harmless.  However, the new E500 port actually omits the
+     floating point registers entirely from the register set --- they
+     don't even have register numbers assigned to them.
+
+     It's not clear to me how best to update this code, so this assert
+     will alert the first person to encounter the NetBSD/E500
+     combination to the problem.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
+  return ((regno >= tdep->ppc_fp0_regnum
+           && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)
 	  || regno == tdep->ppc_fpscr_regnum);
 }
 
diff --git a/gdb/ppcnbsd-tdep.c b/gdb/ppcnbsd-tdep.c
index 7d27e83..317cd85 100644
--- a/gdb/ppcnbsd-tdep.c
+++ b/gdb/ppcnbsd-tdep.c
@@ -1,5 +1,7 @@
 /* Target-dependent code for PowerPC systems running NetBSD.
-   Copyright 2002, 2003 Free Software Foundation, Inc.
+
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
+
    Contributed by Wasabi Systems, Inc.
 
    This file is part of GDB.
@@ -30,7 +32,9 @@
 #include "ppc-tdep.h"
 #include "ppcnbsd-tdep.h"
 #include "nbsd-tdep.h"
-
+#include "tramp-frame.h"
+#include "trad-frame.h"
+#include "gdb_assert.h"
 #include "solib-svr4.h"
 
 #define REG_FIXREG_OFFSET(x)	((x) * 4)
@@ -51,10 +55,11 @@
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int i;
 
-  for (i = 0; i <= 31; i++)
+  for (i = 0; i < ppc_num_gprs; i++)
     {
-      if (regno == i || regno == -1)
-	supply_register (i, regs + REG_FIXREG_OFFSET (i));
+      if (regno == tdep->ppc_gp0_regnum + i || regno == -1)
+	supply_register (tdep->ppc_gp0_regnum + i,
+                         regs + REG_FIXREG_OFFSET (i));
     }
 
   if (regno == tdep->ppc_lr_regnum || regno == -1)
@@ -79,10 +84,11 @@
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int i;
 
-  for (i = 0; i <= 31; i++)
+  for (i = 0; i < ppc_num_gprs; i++)
     {
-      if (regno == i || regno == -1)
-	regcache_collect (i, regs + REG_FIXREG_OFFSET (i));
+      if (regno == tdep->ppc_gp0_regnum + i || regno == -1)
+	regcache_collect (tdep->ppc_gp0_regnum + i,
+                          regs + REG_FIXREG_OFFSET (i));
     }
 
   if (regno == tdep->ppc_lr_regnum || regno == -1)
@@ -107,10 +113,23 @@
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int i;
 
-  for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
+  /* FIXME: jimb/2004-05-05: Some PPC variants don't have floating
+     point registers.  Traditionally, GDB's register set has still
+     listed the floating point registers for such machines, so this
+     code is harmless.  However, the new E500 port actually omits the
+     floating point registers entirely from the register set --- they
+     don't even have register numbers assigned to them.
+
+     It's not clear to me how best to update this code, so this assert
+     will alert the first person to encounter the NetBSD/E500
+     combination to the problem.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
+  for (i = 0; i < ppc_num_fprs; i++)
     {
-      if (regno == i || regno == -1)
-	supply_register (i, fpregs + FPREG_FPR_OFFSET (i - FP0_REGNUM));
+      if (regno == tdep->ppc_fp0_regnum + i || regno == -1)
+	supply_register (tdep->ppc_fp0_regnum + i,
+                         fpregs + FPREG_FPR_OFFSET (i));
     }
 
   if (regno == tdep->ppc_fpscr_regnum || regno == -1)
@@ -123,10 +142,23 @@
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   int i;
 
-  for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
+  /* FIXME: jimb/2004-05-05: Some PPC variants don't have floating
+     point registers.  Traditionally, GDB's register set has still
+     listed the floating point registers for such machines, so this
+     code is harmless.  However, the new E500 port actually omits the
+     floating point registers entirely from the register set --- they
+     don't even have register numbers assigned to them.
+
+     It's not clear to me how best to update this code, so this assert
+     will alert the first person to encounter the NetBSD/E500
+     combination to the problem.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
+  for (i = 0; i < ppc_num_fprs; i++)
     {
-      if (regno == i || regno == -1)
-	regcache_collect (i, fpregs + FPREG_FPR_OFFSET (i - FP0_REGNUM));
+      if (regno == tdep->ppc_fp0_regnum + i || regno == -1)
+	regcache_collect (tdep->ppc_fp0_regnum + i,
+                          fpregs + FPREG_FPR_OFFSET (i));
     }
 
   if (regno == tdep->ppc_fpscr_regnum || regno == -1)
@@ -197,13 +229,6 @@
   NULL					/* next */
 };
 
-static int
-ppcnbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
-{
-  /* FIXME: Need to add support for kernel-provided signal trampolines.  */
-  return (nbsd_pc_in_sigtramp (pc, func_name));
-}
-
 /* NetBSD is confused.  It appears that 1.5 was using the correct SVr4
    convention but, 1.6 switched to the below broken convention.  For
    the moment use the broken convention.  Ulgh!.  */
@@ -228,15 +253,68 @@
 }
 
 static void
+ppcnbsd_sigtramp_cache_init (const struct tramp_frame *self,
+			     struct frame_info *next_frame,
+			     struct trad_frame_cache *this_cache,
+			     CORE_ADDR func)
+{
+  CORE_ADDR base;
+  CORE_ADDR offset;
+  int i;
+  struct gdbarch *gdbarch = get_frame_arch (next_frame);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  base = frame_unwind_register_unsigned (next_frame, SP_REGNUM);
+  offset = base + 0x18 + 2 * tdep->wordsize;
+  for (i = 0; i < ppc_num_gprs; i++)
+    {
+      int regnum = i + tdep->ppc_gp0_regnum;
+      trad_frame_set_reg_addr (this_cache, regnum, offset);
+      offset += tdep->wordsize;
+    }
+  trad_frame_set_reg_addr (this_cache, tdep->ppc_lr_regnum, offset);
+  offset += tdep->wordsize;
+  trad_frame_set_reg_addr (this_cache, tdep->ppc_cr_regnum, offset);
+  offset += tdep->wordsize;
+  trad_frame_set_reg_addr (this_cache, tdep->ppc_xer_regnum, offset);
+  offset += tdep->wordsize;
+  trad_frame_set_reg_addr (this_cache, tdep->ppc_ctr_regnum, offset);
+  offset += tdep->wordsize;
+  trad_frame_set_reg_addr (this_cache, PC_REGNUM, offset); /* SRR0? */
+  offset += tdep->wordsize;
+
+  /* Construct the frame ID using the function start.  */
+  trad_frame_set_id (this_cache, frame_id_build (base, func));
+}
+
+/* Given the NEXT frame, examine the instructions at and around this
+   frame's resume address (aka PC) to see of they look like a signal
+   trampoline.  Return the address of the trampolines first
+   instruction, or zero if it isn't a signal trampoline.  */
+
+static const struct tramp_frame ppcnbsd_sigtramp = {
+  4, /* insn size */
+  { /* insn */
+    0x38610018, /* addi r3,r1,24 */
+    0x38000127, /* li r0,295 */
+    0x44000002, /* sc */
+    0x38000001, /* li r0,1 */
+    0x44000002, /* sc */
+    TRAMP_SENTINEL_INSN
+  },
+  ppcnbsd_sigtramp_cache_init
+};
+
+static void
 ppcnbsd_init_abi (struct gdbarch_info info,
                   struct gdbarch *gdbarch)
 {
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, ppcnbsd_pc_in_sigtramp);
   /* For NetBSD, this is an on again, off again thing.  Some systems
      do use the broken struct convention, and some don't.  */
   set_gdbarch_return_value (gdbarch, ppcnbsd_return_value);
   set_solib_svr4_fetch_link_map_offsets (gdbarch,
                                 nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
+  tramp_frame_prepend_unwinder (gdbarch, &ppcnbsd_sigtramp);
 }
 
 void
@@ -245,6 +323,6 @@
   gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_NETBSD_ELF,
 			  ppcnbsd_init_abi);
 
-  add_core_fns (&ppcnbsd_core_fns);
-  add_core_fns (&ppcnbsd_elfcore_fns);
+  deprecated_add_core_fns (&ppcnbsd_core_fns);
+  deprecated_add_core_fns (&ppcnbsd_elfcore_fns);
 }
diff --git a/gdb/ppcobsd-nat.c b/gdb/ppcobsd-nat.c
new file mode 100644
index 0000000..713eb4a
--- /dev/null
+++ b/gdb/ppcobsd-nat.c
@@ -0,0 +1,98 @@
+/* Native-dependent code for OpenBSD/powerpc.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "inferior.h"
+#include "regcache.h"
+
+#include <stddef.h>
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+
+#include "ppc-tdep.h"
+#include "ppcobsd-tdep.h"
+
+/* OpenBSD/powerpc doesn't have PT_GETFPREGS/PT_SETFPREGS like
+   NetBSD/powerpc and FreeBSD/powerpc.  */
+
+/* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
+   for all registers.  */
+
+void
+fetch_inferior_registers (int regnum)
+{
+  struct reg regs;
+
+  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't get registers");
+
+  ppcobsd_supply_gregset (&ppcobsd_gregset, current_regcache, -1,
+			  &regs, sizeof regs);
+}
+
+/* Store register REGNUM back into the inferior.  If REGNUM is -1, do
+   this for all registers.  */
+
+void
+store_inferior_registers (int regnum)
+{
+  struct reg regs;
+
+  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't get registers");
+
+  ppcobsd_collect_gregset (&ppcobsd_gregset, current_regcache,
+			   regnum, &regs, sizeof regs);
+
+  if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't write registers");
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_ppcobsd_nat (void);
+
+void
+_initialize_ppcobsd_nat (void)
+{
+  /* General-purpose registers.  */
+  ppcobsd_reg_offsets.r0_offset = offsetof (struct reg, gpr);
+  ppcobsd_reg_offsets.pc_offset = offsetof (struct reg, pc);
+  ppcobsd_reg_offsets.ps_offset = offsetof (struct reg, ps);
+  ppcobsd_reg_offsets.cr_offset = offsetof (struct reg, cnd);
+  ppcobsd_reg_offsets.lr_offset = offsetof (struct reg, lr);
+  ppcobsd_reg_offsets.ctr_offset = offsetof (struct reg, cnt);
+  ppcobsd_reg_offsets.xer_offset = offsetof (struct reg, xer);
+  ppcobsd_reg_offsets.mq_offset = offsetof (struct reg, mq);
+
+  /* Floating-point registers.  */
+  ppcobsd_reg_offsets.f0_offset = offsetof (struct reg, fpr);
+  ppcobsd_reg_offsets.fpscr_offset = -1;
+
+  /* AltiVec registers.  */
+  ppcobsd_reg_offsets.vr0_offset = offsetof (struct vreg, vreg);
+  ppcobsd_reg_offsets.vscr_offset = offsetof (struct vreg, vscr);
+  ppcobsd_reg_offsets.vrsave_offset = offsetof (struct vreg, vrsave);
+}
diff --git a/gdb/ppcobsd-tdep.c b/gdb/ppcobsd-tdep.c
new file mode 100644
index 0000000..49a8601
--- /dev/null
+++ b/gdb/ppcobsd-tdep.c
@@ -0,0 +1,178 @@
+/* Target-dependent code for OpenBSD/powerpc.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "arch-utils.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
+#include "gdb_assert.h"
+
+#include "gdb_string.h"
+
+#include "ppc-tdep.h"
+#include "ppcobsd-tdep.h"
+#include "solib-svr4.h"
+
+/* Register offsets from <machine/reg.h>.  */
+struct ppc_reg_offsets ppcobsd_reg_offsets;
+
+
+/* Core file support.  */
+
+/* Supply register REGNUM in the general-purpose register set REGSET
+   from the buffer specified by GREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+void
+ppcobsd_supply_gregset (const struct regset *regset,
+			struct regcache *regcache, int regnum,
+			const void *gregs, size_t len)
+{
+  /* FIXME: jimb/2004-05-05: Some PPC variants don't have floating
+     point registers.  Traditionally, GDB's register set has still
+     listed the floating point registers for such machines, so this
+     code is harmless.  However, the new E500 port actually omits the
+     floating point registers entirely from the register set --- they
+     don't even have register numbers assigned to them.
+
+     It's not clear to me how best to update this code, so this assert
+     will alert the first person to encounter the OpenBSD/E500
+     combination to the problem.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
+  ppc_supply_gregset (regset, regcache, regnum, gregs, len);
+  ppc_supply_fpregset (regset, regcache, regnum, gregs, len);
+}
+
+/* Collect register REGNUM in the general-purpose register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   GREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+void
+ppcobsd_collect_gregset (const struct regset *regset,
+			 const struct regcache *regcache, int regnum,
+			 void *gregs, size_t len)
+{
+  /* FIXME: jimb/2004-05-05: Some PPC variants don't have floating
+     point registers.  Traditionally, GDB's register set has still
+     listed the floating point registers for such machines, so this
+     code is harmless.  However, the new E500 port actually omits the
+     floating point registers entirely from the register set --- they
+     don't even have register numbers assigned to them.
+
+     It's not clear to me how best to update this code, so this assert
+     will alert the first person to encounter the OpenBSD/E500
+     combination to the problem.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
+  ppc_collect_gregset (regset, regcache, regnum, gregs, len);
+  ppc_collect_fpregset (regset, regcache, regnum, gregs, len);
+}
+
+/* OpenBS/powerpc register set.  */
+
+struct regset ppcobsd_gregset =
+{
+  &ppcobsd_reg_offsets,
+  ppcobsd_supply_gregset
+};
+
+/* Return the appropriate register set for the core section identified
+   by SECT_NAME and SECT_SIZE.  */
+
+static const struct regset *
+ppcobsd_regset_from_core_section (struct gdbarch *gdbarch,
+				  const char *sect_name, size_t sect_size)
+{
+  if (strcmp (sect_name, ".reg") == 0 && sect_size >= 412)
+    return &ppcobsd_gregset;
+
+  return NULL;
+}
+
+
+static void
+ppcobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  /* OpenBSD uses SVR4-style shared libraries.  */
+  set_gdbarch_in_solib_call_trampoline
+    (gdbarch, generic_in_solib_call_trampoline);
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+
+  set_gdbarch_regset_from_core_section
+    (gdbarch, ppcobsd_regset_from_core_section);
+}
+
+
+/* OpenBSD uses uses the traditional NetBSD core file format, even for
+   ports that use ELF.  */
+#define GDB_OSABI_NETBSD_CORE GDB_OSABI_OPENBSD_ELF
+
+static enum gdb_osabi
+ppcobsd_core_osabi_sniffer (bfd *abfd)
+{
+  if (strcmp (bfd_get_target (abfd), "netbsd-core") == 0)
+    return GDB_OSABI_NETBSD_CORE;
+
+  return GDB_OSABI_UNKNOWN;
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_ppcobsd_tdep (void);
+
+void
+_initialize_ppcobsd_tdep (void)
+{
+  /* BFD doesn't set a flavour for NetBSD style a.out core files.  */
+  gdbarch_register_osabi_sniffer (bfd_arch_powerpc, bfd_target_unknown_flavour,
+                                  ppcobsd_core_osabi_sniffer);
+
+  gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_OPENBSD_ELF,
+			  ppcobsd_init_abi);
+
+  /* Avoid initializing the register offsets again if they were
+     already initailized by ppcobsd-nat.c.  */
+  if (ppcobsd_reg_offsets.pc_offset == 0)
+    {
+      /* General-purpose registers.  */
+      ppcobsd_reg_offsets.r0_offset = 0;
+      ppcobsd_reg_offsets.pc_offset = 384;
+      ppcobsd_reg_offsets.ps_offset = 388;
+      ppcobsd_reg_offsets.cr_offset = 392;
+      ppcobsd_reg_offsets.lr_offset = 396;
+      ppcobsd_reg_offsets.ctr_offset = 400;
+      ppcobsd_reg_offsets.xer_offset = 404;
+      ppcobsd_reg_offsets.mq_offset = 408;
+
+      /* Floating-point registers.  */
+      ppcobsd_reg_offsets.f0_offset = 128;
+      ppcobsd_reg_offsets.fpscr_offset = -1;
+
+      /* AltiVec registers.  */
+      ppcobsd_reg_offsets.vr0_offset = 0;
+      ppcobsd_reg_offsets.vscr_offset = 512;
+      ppcobsd_reg_offsets.vrsave_offset = 520;
+    }
+}
diff --git a/gdb/ppcobsd-tdep.h b/gdb/ppcobsd-tdep.h
new file mode 100644
index 0000000..8f29aaa
--- /dev/null
+++ b/gdb/ppcobsd-tdep.h
@@ -0,0 +1,54 @@
+/* Target-dependent code for OpenBSD/powerpc.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifndef PPCOBSD_TDEP_H
+#define PPCOBSD_TDEP_H
+
+#include <stddef.h>
+
+struct regset;
+struct regcache;
+
+/* Register offsets for OpenBSD/powerpc.  */
+extern struct ppc_reg_offsets ppcobsd_reg_offsets;
+
+/* Register sets for OpenBSD/powerpc.  */
+extern struct regset ppcobsd_gregset;
+
+
+/* Supply register REGNUM in the general-purpose register set REGSET
+   from the buffer specified by GREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+extern void ppcobsd_supply_gregset (const struct regset *regset,
+				    struct regcache *regcache, int regnum,
+				    const void *gregs, size_t len);
+
+/* Collect register REGNUM in the general-purpose register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   GREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+extern void ppcobsd_collect_gregset (const struct regset *regset,
+				     const struct regcache *regcache,
+				     int regnum, void *gregs, size_t len);
+
+#endif /* ppcobsd-tdep.h */
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 352b735..672b5ac 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -124,7 +124,7 @@
 static void procfs_prepare_to_store (void);
 static void procfs_kill_inferior (void);
 static void procfs_mourn_inferior (void);
-static void procfs_create_inferior (char *, char *, char **);
+static void procfs_create_inferior (char *, char *, char **, int);
 static ptid_t procfs_wait (ptid_t, struct target_waitstatus *);
 static int procfs_xfer_memory (CORE_ADDR, char *, int, int,
 			       struct mem_attrib *attrib,
@@ -4972,7 +4972,8 @@
  */
 
 static void
-procfs_create_inferior (char *exec_file, char *allargs, char **env)
+procfs_create_inferior (char *exec_file, char *allargs, char **env,
+			int from_tty)
 {
   char *shell_file = getenv ("SHELL");
   char *tryname;
diff --git a/gdb/rdi-share/ardi.c b/gdb/rdi-share/ardi.c
index 3d17669..dead319 100644
--- a/gdb/rdi-share/ardi.c
+++ b/gdb/rdi-share/ardi.c
@@ -1353,7 +1353,7 @@
 static int angel_RDI_ExecuteOrStep(PointHandle *handle, word type, 
                                    unsigned ninstr)
 {
-  extern int (*ui_loop_hook) (int);
+  extern int (*deprecated_ui_loop_hook) (int);
   int err;
   adp_stopped_struct stopped_info;
   void* stateptr = (void *)&stopped_info;
@@ -1414,8 +1414,8 @@
   signal(SIGINT, ardi_sigint_handler);
   while( executing )
   {
-    if (ui_loop_hook)
-      ui_loop_hook(0);
+    if (deprecated_ui_loop_hook)
+      deprecated_ui_loop_hook(0);
     
     if (interrupt_request || stop_request)
       {
diff --git a/gdb/regcache.c b/gdb/regcache.c
index c455e46..ceeaca6 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -30,6 +30,7 @@
 #include "gdb_assert.h"
 #include "gdb_string.h"
 #include "gdbcmd.h"		/* For maintenanceprintlist.  */
+#include "observer.h"
 
 /*
  * DATA STRUCTURE
@@ -63,9 +64,9 @@
   /* The cooked register space.  Each cooked register in the range
      [0..NR_RAW_REGISTERS) is direct-mapped onto the corresponding raw
      register.  The remaining [NR_RAW_REGISTERS
-     .. NR_COOKED_REGISTERS) (a.k.a. pseudo regiters) are mapped onto
+     .. NR_COOKED_REGISTERS) (a.k.a. pseudo registers) are mapped onto
      both raw registers and memory by the architecture methods
-     gdbarch_register_read and gdbarch_register_write.  */
+     gdbarch_pseudo_register_read and gdbarch_pseudo_register_write.  */
   int nr_cooked_registers;
   long sizeof_cooked_registers;
   long sizeof_cooked_register_valid_p;
@@ -566,6 +567,14 @@
   return regnum >= 0 && regnum < NUM_REGS;
 }
 
+/* Observer for the target_changed event.  */
+
+void
+regcache_observer_target_changed (struct target_ops *target)
+{
+  registers_changed ();
+}
+
 /* Low level examining and depositing of registers.
 
    The caller is responsible for making sure that the inferior is
@@ -594,8 +603,8 @@
   for (i = 0; i < current_regcache->descr->nr_raw_registers; i++)
     set_register_cached (i, 0);
 
-  if (registers_changed_hook)
-    registers_changed_hook ();
+  if (deprecated_registers_changed_hook)
+    deprecated_registers_changed_hook ();
 }
 
 /* DEPRECATED_REGISTERS_FETCHED ()
@@ -1230,20 +1239,6 @@
 supply_register (int regnum, const void *val)
 {
   regcache_raw_supply (current_regcache, regnum, val);
-
-  /* On some architectures, e.g. HPPA, there are a few stray bits in
-     some registers, that the rest of the code would like to ignore.  */
-
-  /* NOTE: cagney/2001-03-16: The macro CLEAN_UP_REGISTER_VALUE is
-     going to be deprecated.  Instead architectures will leave the raw
-     register value as is and instead clean things up as they pass
-     through the method gdbarch_pseudo_register_read() clean up the
-     values. */
-
-#ifdef DEPRECATED_CLEAN_UP_REGISTER_VALUE
-  DEPRECATED_CLEAN_UP_REGISTER_VALUE \
-    (regnum, register_buffer (current_regcache, regnum));
-#endif
 }
 
 void
@@ -1577,7 +1572,7 @@
 		char *n;
 		if (!footnote_register_type_name_null)
 		  footnote_register_type_name_null = ++footnote_nr;
-		xasprintf (&n, "*%d", footnote_register_type_name_null);
+		n = xstrprintf ("*%d", footnote_register_type_name_null);
 		make_cleanup (xfree, n);
 		t = n;
 	      }
@@ -1711,6 +1706,8 @@
   DEPRECATED_REGISTER_GDBARCH_SWAP (deprecated_register_valid);
   deprecated_register_gdbarch_swap (NULL, 0, build_regcache);
 
+  observer_attach_target_changed (regcache_observer_target_changed);
+
   add_com ("flushregs", class_maintenance, reg_flush_command,
 	   "Force gdb to flush its register cache (maintainer command)");
 
diff --git a/gdb/regset.c b/gdb/regset.c
new file mode 100644
index 0000000..d588b7d
--- /dev/null
+++ b/gdb/regset.c
@@ -0,0 +1,46 @@
+/* Manage register sets.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "regset.h"
+
+#include "gdb_assert.h"
+
+/* Allocate a fresh 'struct regset' whose supply_regset function is
+   SUPPLY_REGSET, and whose collect_regset function is COLLECT_REGSET.
+   If the regset has no collect_regset function, pass NULL for
+   COLLECT_REGSET.
+
+   The object returned is allocated on ARCH's obstack.  */
+
+struct regset *
+regset_alloc (struct gdbarch *arch,
+              supply_regset_ftype *supply_regset,
+              collect_regset_ftype *collect_regset)
+{
+  struct regset *regset = GDBARCH_OBSTACK_ZALLOC (arch, struct regset);
+
+  regset->arch = arch;
+  regset->supply_regset = supply_regset;
+  regset->collect_regset = collect_regset;
+
+  return regset;
+}
diff --git a/gdb/regset.h b/gdb/regset.h
index 6172f0f..7bc5d24 100644
--- a/gdb/regset.h
+++ b/gdb/regset.h
@@ -1,6 +1,6 @@
 /* Manage register sets.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -27,15 +27,37 @@
 
 /* Data structure describing a register set.  */
 
+typedef void (supply_regset_ftype) (const struct regset *, struct regcache *,
+                                    int, const void *, size_t);
+typedef void (collect_regset_ftype) (const struct regset *, 
+                                     const struct regcache *,
+                                     int, void *, size_t);
+
 struct regset
 {
   /* Data pointer for private use by the methods below, presumably
      providing some sort of description of the register set.  */
   const void *descr;
 
-  /* Function supplying a register set to a register cache.  */
-  void (*supply_regset) (const struct regset *, struct regcache *,
-			 int, const void *, size_t);
+  /* Function supplying values in a register set to a register cache.  */
+  supply_regset_ftype *supply_regset;
+
+  /* Function collecting values in a register set from a register cache.  */
+  collect_regset_ftype *collect_regset;
+
+  /* Architecture associated with the register set.  */
+  struct gdbarch *arch;
 };
 
+/* Allocate a fresh 'struct regset' whose supply_regset function is
+   SUPPLY_REGSET, and whose collect_regset function is COLLECT_REGSET.
+   If the regset has no collect_regset function, pass NULL for
+   COLLECT_REGSET.
+
+   The object returned is allocated on ARCH's obstack.  */
+
+extern struct regset *regset_alloc (struct gdbarch *arch,
+                                    supply_regset_ftype *supply_regset,
+                                    collect_regset_ftype *collect_regset);
+
 #endif /* regset.h */
diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c
index c422c94..16a6690 100644
--- a/gdb/remote-e7000.c
+++ b/gdb/remote-e7000.c
@@ -1,7 +1,7 @@
 /* Remote debugging interface for Renesas E7000 ICE, for GDB
 
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003 Free Software Foundation, Inc.
+   2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support. 
 
@@ -371,7 +371,8 @@
    user types "run" after having attached.  */
 
 static void
-e7000_create_inferior (char *execfile, char *args, char **env)
+e7000_create_inferior (char *execfile, char *args, char **env,
+		       int from_tty)
 {
   int entry_pt;
 
@@ -629,7 +630,7 @@
   flush_cached_frames ();
   registers_changed ();
   stop_pc = read_pc ();
-  print_stack_frame (get_selected_frame (), -1, 1);
+  print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC);
 
   return 1;
 }
@@ -1568,7 +1569,7 @@
 	  file_ptr fptr;
 
 	  section_address = bfd_get_section_vma (pbfd, section);
-	  section_size = bfd_get_section_size_before_reloc (section);
+	  section_size = bfd_get_section_size (section);
 
 	  if (!quiet)
 	    printf_filtered ("[Loading section %s at 0x%s (%s bytes)]\n",
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c
index e211858..e42a34b 100644
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -1,6 +1,6 @@
 /* Remote debugging interface for M32R/SDI.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Renesas Technology Co.
    Written by Kei Sakamoto <sakamoto.kei@renesas.com>.
@@ -264,7 +264,8 @@
 /* This is called not only when we first attach, but also when the
    user types "run" after having attached.  */
 static void
-m32r_create_inferior (char *execfile, char *args, char **env)
+m32r_create_inferior (char *execfile, char *args, char **env,
+		      int from_tty)
 {
   CORE_ADDR entry_pt;
 
@@ -1319,7 +1320,7 @@
 	  int n;
 
 	  section_address = bfd_section_lma (pbfd, section);
-	  section_size = bfd_get_section_size_before_reloc (section);
+	  section_size = bfd_get_section_size (section);
 
 	  if (!mmu_on)
 	    {
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index c757684..a011467 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -1,7 +1,7 @@
 /* Remote debugging interface for MIPS remote debugging protocol.
 
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002 Free Software Foundation, Inc.
+   2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support.  Written by Ian Lance Taylor
    <ian@cygnus.com>.
@@ -114,8 +114,6 @@
 
 static void mips_files_info (struct target_ops *ignore);
 
-static void mips_create_inferior (char *execfile, char *args, char **env);
-
 static void mips_mourn_inferior (void);
 
 static int pmon_makeb64 (unsigned long v, char *p, int n, int *chksum);
@@ -1588,7 +1586,7 @@
   flush_cached_frames ();
   registers_changed ();
   stop_pc = read_pc ();
-  print_stack_frame (get_selected_frame (), -1, 1);
+  print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC);
   xfree (serial_port_name);
 }
 
@@ -2178,7 +2176,7 @@
 /* Start running on the target board.  */
 
 static void
-mips_create_inferior (char *execfile, char *args, char **env)
+mips_create_inferior (char *execfile, char *args, char **env, int from_tty)
 {
   CORE_ADDR entry_pt;
 
@@ -2650,20 +2648,20 @@
 	  /* FIXME!  vma too small????? */
 	  printf_filtered ("%s\t: 0x%4lx .. 0x%4lx  ", s->name,
 			   (long) s->vma,
-			   (long) (s->vma + s->_raw_size));
+			   (long) (s->vma + bfd_get_section_size (s)));
 	  gdb_flush (gdb_stdout);
 
-	  for (i = 0; i < s->_raw_size; i += numbytes)
+	  for (i = 0; i < bfd_get_section_size (s); i += numbytes)
 	    {
-	      numbytes = min (srec_frame, s->_raw_size - i);
+	      numbytes = min (srec_frame, bfd_get_section_size (s) - i);
 
 	      bfd_get_section_contents (abfd, s, buffer, i, numbytes);
 
 	      reclen = mips_make_srec (srec, '3', s->vma + i, buffer, numbytes);
 	      send_srec (srec, reclen, s->vma + i);
 
-	      if (ui_load_progress_hook)
-		ui_load_progress_hook (s->name, i);
+	      if (deprecated_ui_load_progress_hook)
+		deprecated_ui_load_progress_hook (s->name, i);
 
 	      if (hashmark)
 		{
@@ -3137,11 +3135,11 @@
   for (s = abfd->sections; s && !finished; s = s->next)
     if (s->flags & SEC_LOAD)	/* only deal with loadable sections */
       {
-	bintotal += s->_raw_size;
-	final = (s->vma + s->_raw_size);
+	bintotal += bfd_get_section_size (s);
+	final = (s->vma + bfd_get_section_size (s));
 
 	printf_filtered ("%s\t: 0x%4x .. 0x%4x  ", s->name, (unsigned int) s->vma,
-			 (unsigned int) (s->vma + s->_raw_size));
+			 (unsigned int) (s->vma + bfd_get_section_size (s)));
 	gdb_flush (gdb_stdout);
 
 	/* Output the starting address */
@@ -3162,11 +3160,13 @@
 
 	    reclen = 0;
 
-	    for (i = 0; ((i < s->_raw_size) && !finished); i += binamount)
+	    for (i = 0;
+		 i < bfd_get_section_size (s) && !finished;
+		 i += binamount)
 	      {
 		int binptr = 0;
 
-		binamount = min (BINCHUNK, s->_raw_size - i);
+		binamount = min (BINCHUNK, bfd_get_section_size (s) - i);
 
 		bfd_get_section_contents (abfd, s, binbuf, i, binamount);
 
@@ -3186,8 +3186,8 @@
 			    break;
 			  }
 
-			if (ui_load_progress_hook)
-			  ui_load_progress_hook (s->name, i);
+			if (deprecated_ui_load_progress_hook)
+			  deprecated_ui_load_progress_hook (s->name, i);
 
 			if (hashmark)
 			  {
diff --git a/gdb/remote-rdi.c b/gdb/remote-rdi.c
index 268ed32..31932f5 100644
--- a/gdb/remote-rdi.c
+++ b/gdb/remote-rdi.c
@@ -68,8 +68,6 @@
 
 static void arm_rdi_open (char *name, int from_tty);
 
-static void arm_rdi_create_inferior (char *exec_file, char *args, char **env);
-
 static void arm_rdi_close (int quitting);
 
 static void arm_rdi_store_registers (int regno);
@@ -334,7 +332,7 @@
    user types "run" after having attached.  */
 
 static void
-arm_rdi_create_inferior (char *exec_file, char *args, char **env)
+arm_rdi_create_inferior (char *exec_file, char *args, char **env, int from_tty)
 {
   int len, rslt;
   unsigned long arg1, arg2;
diff --git a/gdb/remote-rdp.c b/gdb/remote-rdp.c
index 2db0a91..5360467 100644
--- a/gdb/remote-rdp.c
+++ b/gdb/remote-rdp.c
@@ -630,7 +630,7 @@
     }
   else
     {
-      char buf[ARM_MAX_REGISTER_RAW_SIZE];
+      char buf[MAX_REGISTER_SIZE];
       if (regno < 15)
 	rdp_fetch_one_register (1 << regno, buf);
       else if (regno == ARM_PC_REGNUM)
@@ -660,7 +660,7 @@
     }
   else
     {
-      char tmp[ARM_MAX_REGISTER_RAW_SIZE];
+      char tmp[MAX_REGISTER_SIZE];
       deprecated_read_register_gen (regno, tmp);
       if (regno < 15)
 	rdp_store_one_register (1 << regno, tmp);
@@ -721,7 +721,7 @@
   if (commandline != NULL)
     xfree (commandline);
 
-  xasprintf (&commandline, "%s %s", command, args);
+  commandline = xstrprintf ("%s %s", command, args);
 }
 
 static void
@@ -1181,7 +1181,7 @@
   flush_cached_frames ();
   registers_changed ();
   stop_pc = read_pc ();
-  print_stack_frame (get_selected_frame (), -1, 1);
+  print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC);
 }
 
 
@@ -1351,7 +1351,8 @@
 
 
 static void
-remote_rdp_create_inferior (char *exec_file, char *allargs, char **env)
+remote_rdp_create_inferior (char *exec_file, char *allargs, char **env,
+			    int from_tty)
 {
   CORE_ADDR entry_point;
 
diff --git a/gdb/remote-sds.c b/gdb/remote-sds.c
index d74fd7d..ce85d09 100644
--- a/gdb/remote-sds.c
+++ b/gdb/remote-sds.c
@@ -76,8 +76,6 @@
 
 static void sds_mourn (void);
 
-static void sds_create_inferior (char *, char *, char **);
-
 static void sds_load (char *, int);
 
 static int getmessage (unsigned char *, int);
@@ -985,7 +983,7 @@
 }
 
 static void
-sds_create_inferior (char *exec_file, char *args, char **env)
+sds_create_inferior (char *exec_file, char *args, char **env, int from_tty)
 {
   inferior_ptid = pid_to_ptid (42000);
 
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 9b0b3fd..a1be90e 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -48,8 +48,6 @@
 
 extern void _initialize_remote_sim (void);
 
-extern int (*ui_loop_hook) (int signo);
-
 static void dump_mem (char *buf, int len);
 
 static void init_callbacks (void);
@@ -83,8 +81,6 @@
 
 static void gdbsim_load (char *prog, int fromtty);
 
-static void gdbsim_create_inferior (char *exec_file, char *args, char **env);
-
 static void gdbsim_open (char *args, int from_tty);
 
 static void gdbsim_close (int quitting);
@@ -268,8 +264,8 @@
 static void
 gdb_os_error (host_callback * p, const char *format,...)
 {
-  if (error_hook)
-    (*error_hook) ();
+  if (deprecated_error_hook)
+    (*deprecated_error_hook) ();
   else
     {
       va_list args;
@@ -429,7 +425,7 @@
    user types "run" after having attached.  */
 
 static void
-gdbsim_create_inferior (char *exec_file, char *args, char **env)
+gdbsim_create_inferior (char *exec_file, char *args, char **env, int from_tty)
 {
   int len;
   char *arg_buf, **argv;
@@ -636,8 +632,8 @@
 static int
 gdb_os_poll_quit (host_callback *p)
 {
-  if (ui_loop_hook != NULL)
-    ui_loop_hook (0);
+  if (deprecated_ui_loop_hook != NULL)
+    deprecated_ui_loop_hook (0);
 
   if (quit_flag)		/* gdb's idea of quit */
     {
diff --git a/gdb/remote-st.c b/gdb/remote-st.c
index ce4c7ab..8ae2721 100644
--- a/gdb/remote-st.c
+++ b/gdb/remote-st.c
@@ -229,7 +229,8 @@
 /* This is called not only when we first attach, but also when the
    user types "run" after having attached.  */
 static void
-st2000_create_inferior (char *execfile, char *args, char **env)
+st2000_create_inferior (char *execfile, char *args, char **env,
+			int from_tty)
 {
   int entry_pt;
 
diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c
index fd51781..7895a97 100644
--- a/gdb/remote-vx.c
+++ b/gdb/remote-vx.c
@@ -202,7 +202,7 @@
    On VxWorks, we ignore exec_file.  */
 
 static void
-vx_create_inferior (char *exec_file, char *args, char **env)
+vx_create_inferior (char *exec_file, char *args, char **env, int from_tty)
 {
   enum clnt_stat status;
   arg_array passArgs;
@@ -747,17 +747,8 @@
   SOURCE_STEP source_step;
 
   source_step.taskId = PIDGET (inferior_ptid);
-
-  if (step_range_end)
-    {
-      source_step.startAddr = step_range_start;
-      source_step.endAddr = step_range_end;
-    }
-  else
-    {
-      source_step.startAddr = 0;
-      source_step.endAddr = 0;
-    }
+  source_step.startAddr = 0;
+  source_step.endAddr = 0;
 
   status = net_clnt_call (VX_SOURCE_STEP, xdr_SOURCE_STEP, &source_step,
 			  xdr_int, &step_status);
diff --git a/gdb/remote-vx68.c b/gdb/remote-vx68.c
index 8cdac6f..8b00824 100644
--- a/gdb/remote-vx68.c
+++ b/gdb/remote-vx68.c
@@ -85,14 +85,15 @@
 
   net_read_registers (mc68k_greg_packet, MC68K_GREG_PLEN, PTRACE_GETREGS);
 
-  bcopy (&mc68k_greg_packet[MC68K_R_D0], deprecated_registers,
-	 16 * MC68K_GREG_SIZE);
-  bcopy (&mc68k_greg_packet[MC68K_R_SR],
-	 &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
-	 MC68K_GREG_SIZE);
-  bcopy (&mc68k_greg_packet[MC68K_R_PC],
-	 &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
-	 MC68K_GREG_SIZE);
+  memcpy (deprecated_registers,
+	  &mc68k_greg_packet[MC68K_R_D0]
+	  16 * MC68K_GREG_SIZE);
+  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
+	  &mc68k_greg_packet[MC68K_R_SR],
+	  MC68K_GREG_SIZE);
+  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
+	  &mc68k_greg_packet[MC68K_R_PC],
+	  MC68K_GREG_SIZE);
 
   /* Get floating-point registers, if the target system has them.
      Otherwise, zero them.  */
@@ -102,12 +103,12 @@
       net_read_registers (mc68k_fpreg_packet, MC68K_FPREG_PLEN,
 			  PTRACE_GETFPREGS);
 
-      bcopy (&mc68k_fpreg_packet[MC68K_R_FP0],
-	     &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	     MC68K_FPREG_SIZE * 8);
-      bcopy (&mc68k_fpreg_packet[MC68K_R_FPCR],
-	     &deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
-	     MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
+      memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
+	      &mc68k_fpreg_packet[MC68K_R_FP0],
+	      MC68K_FPREG_SIZE * 8);
+      memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
+	      &mc68k_fpreg_packet[MC68K_R_FPCR],
+	      MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
     }
   else
     {
@@ -134,12 +135,14 @@
 
   /* Store general-purpose registers.  */
 
-  bcopy (deprecated_registers, &mc68k_greg_packet[MC68K_R_D0],
-	 16 * MC68K_GREG_SIZE);
-  bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
-	 &mc68k_greg_packet[MC68K_R_SR], MC68K_GREG_SIZE);
-  bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
-	 &mc68k_greg_packet[MC68K_R_PC], MC68K_GREG_SIZE);
+  memcpy (&mc68k_greg_packet[MC68K_R_D0], deprecated_registers,
+	  16 * MC68K_GREG_SIZE);
+  memcpy (&mc68k_greg_packet[MC68K_R_SR],
+	  &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
+	  MC68K_GREG_SIZE);
+  memcpy (&mc68k_greg_packet[MC68K_R_PC],
+	  &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
+	  MC68K_GREG_SIZE);
 
   net_write_registers (mc68k_greg_packet, MC68K_GREG_PLEN, PTRACE_SETREGS);
 
@@ -147,12 +150,12 @@
 
   if (target_has_fp)
     {
-      bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	     &mc68k_fpreg_packet[MC68K_R_FP0],
-	     MC68K_FPREG_SIZE * 8);
-      bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
-	     &mc68k_fpreg_packet[MC68K_R_FPCR],
-	     MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
+      memcpy (&mc68k_fpreg_packet[MC68K_R_FP0],
+	      &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
+	      MC68K_FPREG_SIZE * 8);
+      memcpy (&mc68k_fpreg_packet[MC68K_R_FPCR],
+	      &deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
+	      MC68K_FPREG_PLEN - (MC68K_FPREG_SIZE * 8));
 
       net_write_registers (mc68k_fpreg_packet, MC68K_FPREG_PLEN,
 			   PTRACE_SETFPREGS);
diff --git a/gdb/remote-vxmips.c b/gdb/remote-vxmips.c
index 55ba49b..617bce0 100644
--- a/gdb/remote-vxmips.c
+++ b/gdb/remote-vxmips.c
@@ -103,19 +103,23 @@
 
   /* Copy the general registers.  */
 
-  bcopy (&mips_greg_packet[MIPS_R_GP0], &deprecated_registers[0],
-	 32 * MIPS_GREG_SIZE);
+  memcpy (&deprecated_registers[0], &mips_greg_packet[MIPS_R_GP0],
+	  32 * MIPS_GREG_SIZE);
 
   /* Copy SR, LO, HI, and PC.  */
 
-  bcopy (&mips_greg_packet[MIPS_R_SR],
-	 &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)], MIPS_GREG_SIZE);
-  bcopy (&mips_greg_packet[MIPS_R_LO],
-	 &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)], MIPS_GREG_SIZE);
-  bcopy (&mips_greg_packet[MIPS_R_HI],
-	 &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)], MIPS_GREG_SIZE);
-  bcopy (&mips_greg_packet[MIPS_R_PC],
-	 &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)], MIPS_GREG_SIZE);
+  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
+	  &mips_greg_packet[MIPS_R_SR],
+	  MIPS_GREG_SIZE);
+  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)],
+	  &mips_greg_packet[MIPS_R_LO],
+	  MIPS_GREG_SIZE);
+  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)],
+	  &mips_greg_packet[MIPS_R_HI],
+	  MIPS_GREG_SIZE);
+  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)],
+	  &mips_greg_packet[MIPS_R_PC],
+	  MIPS_GREG_SIZE);
 
   /* If the target has floating point registers, fetch them.
      Otherwise, zero the floating point register values in
@@ -129,15 +133,15 @@
 
       /* Copy the floating point registers.  */
 
-      bcopy (&mips_fpreg_packet[MIPS_R_FP0],
-	     &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	     DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
+      memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
+	      &mips_fpreg_packet[MIPS_R_FP0],
+	      DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
 
       /* Copy the floating point control/status register (fpcsr).  */
 
-      bcopy (&mips_fpreg_packet[MIPS_R_FPCSR],
-	     &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)],
-	     DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->fp_control_status));
+      memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)],
+	      &mips_fpreg_packet[MIPS_R_FPCSR],
+	      DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->fp_control_status));
     }
   else
     {
@@ -163,19 +167,23 @@
 
   /* Store general registers.  */
 
-  bcopy (&deprecated_registers[0], &mips_greg_packet[MIPS_R_GP0],
-	 32 * MIPS_GREG_SIZE);
+  memcpy (&mips_greg_packet[MIPS_R_GP0], &deprecated_registers[0],
+	  32 * MIPS_GREG_SIZE);
 
   /* Copy SR, LO, HI, and PC.  */
 
-  bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
-	 &mips_greg_packet[MIPS_R_SR], MIPS_GREG_SIZE);
-  bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)],
-	 &mips_greg_packet[MIPS_R_LO], MIPS_GREG_SIZE);
-  bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)],
-	 &mips_greg_packet[MIPS_R_HI], MIPS_GREG_SIZE);
-  bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)],
-	 &mips_greg_packet[MIPS_R_PC], MIPS_GREG_SIZE);
+  memcpy (&mips_greg_packet[MIPS_R_SR],
+	  &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)],
+	  MIPS_GREG_SIZE);
+  memcpy (&mips_greg_packet[MIPS_R_LO],
+	  &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)],
+	  MIPS_GREG_SIZE);
+  memcpy (&mips_greg_packet[MIPS_R_HI],
+	  &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)],
+	  MIPS_GREG_SIZE);
+  memcpy (&mips_greg_packet[MIPS_R_PC],
+	  &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)],
+	  MIPS_GREG_SIZE);
 
   net_write_registers (mips_greg_packet, MIPS_GREG_PLEN, PTRACE_SETREGS);
 
@@ -185,15 +193,15 @@
     {
       /* Copy the floating point data registers.  */
 
-      bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	     &mips_fpreg_packet[MIPS_R_FP0],
-	     DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
+      memcpy (&mips_fpreg_packet[MIPS_R_FP0],
+	      &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
+	      DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
 
       /* Copy the floating point control/status register (fpcsr).  */
 
-      bcopy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)],
-	     &mips_fpreg_packet[MIPS_R_FPCSR],
-	     DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->fp_control_status));
+      memcpy (&mips_fpreg_packet[MIPS_R_FPCSR],
+	      &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)],
+	      DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->fp_control_status));
 
       net_write_registers (mips_fpreg_packet, MIPS_FPREG_PLEN,
 			   PTRACE_SETFPREGS);
diff --git a/gdb/remote.c b/gdb/remote.c
index e23a30f..f754f80 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -107,9 +107,6 @@
 
 static void extended_remote_mourn (void);
 
-static void extended_remote_create_inferior (char *, char *, char **);
-static void extended_remote_async_create_inferior (char *, char *, char **);
-
 static void remote_mourn_1 (struct target_ops *);
 
 static void remote_send (char *buf, long sizeof_buf);
@@ -654,12 +651,12 @@
   config->title = title;
   config->detect = AUTO_BOOLEAN_AUTO;
   config->support = PACKET_SUPPORT_UNKNOWN;
-  xasprintf (&set_doc, "Set use of remote protocol `%s' (%s) packet",
-	     name, title);
-  xasprintf (&show_doc, "Show current use of remote protocol `%s' (%s) packet",
-	     name, title);
+  set_doc = xstrprintf ("Set use of remote protocol `%s' (%s) packet",
+			name, title);
+  show_doc = xstrprintf ("Show current use of remote protocol `%s' (%s) packet",
+			 name, title);
   /* set/show TITLE-packet {auto,on,off} */
-  xasprintf (&cmd_name, "%s-packet", title);
+  cmd_name = xstrprintf ("%s-packet", title);
   add_setshow_auto_boolean_cmd (cmd_name, class_obscure,
 				&config->detect, set_doc, show_doc,
 				set_func, show_func,
@@ -668,7 +665,7 @@
   if (legacy)
     {
       char *legacy_name;
-      xasprintf (&legacy_name, "%s-packet", name);
+      legacy_name = xstrprintf ("%s-packet", name);
       add_alias_cmd (legacy_name, cmd_name, class_obscure, 0,
 		     set_remote_list);
       add_alias_cmd (legacy_name, cmd_name, class_obscure, 0,
@@ -774,42 +771,6 @@
   show_packet_config_cmd (&remote_protocol_qSymbol);
 }
 
-/* Should we try the 'e' (step over range) request? */
-static struct packet_config remote_protocol_e;
-
-static void
-set_remote_protocol_e_packet_cmd (char *args, int from_tty,
-				  struct cmd_list_element *c)
-{
-  update_packet_config (&remote_protocol_e);
-}
-
-static void
-show_remote_protocol_e_packet_cmd (char *args, int from_tty,
-				   struct cmd_list_element *c)
-{
-  show_packet_config_cmd (&remote_protocol_e);
-}
-
-
-/* Should we try the 'E' (step over range / w signal #) request? */
-static struct packet_config remote_protocol_E;
-
-static void
-set_remote_protocol_E_packet_cmd (char *args, int from_tty,
-				  struct cmd_list_element *c)
-{
-  update_packet_config (&remote_protocol_E);
-}
-
-static void
-show_remote_protocol_E_packet_cmd (char *args, int from_tty,
-				   struct cmd_list_element *c)
-{
-  show_packet_config_cmd (&remote_protocol_E);
-}
-
-
 /* Should we try the 'P' (set register) request?  */
 
 static struct packet_config remote_protocol_P;
@@ -1006,8 +967,8 @@
 /* These are pointers to hook functions that may be set in order to
    modify resume/wait behavior for a particular architecture.  */
 
-void (*target_resume_hook) (void);
-void (*target_wait_loop_hook) (void);
+void (*deprecated_target_resume_hook) (void);
+void (*deprecated_target_wait_loop_hook) (void);
 
 
 
@@ -2077,8 +2038,6 @@
 init_all_packet_configs (void)
 {
   int i;
-  update_packet_config (&remote_protocol_e);
-  update_packet_config (&remote_protocol_E);
   update_packet_config (&remote_protocol_P);
   update_packet_config (&remote_protocol_qSymbol);
   update_packet_config (&remote_protocol_vcont);
@@ -2552,8 +2511,8 @@
 
   /* A hook for when we need to do something at the last moment before
      resumption.  */
-  if (target_resume_hook)
-    (*target_resume_hook) ();
+  if (deprecated_target_resume_hook)
+    (*deprecated_target_resume_hook) ();
 
   /* The vCont packet doesn't need to specify threads via Hc.  */
   if (remote_vcont_resume (ptid, step, siggnal))
@@ -2565,60 +2524,6 @@
   else
     set_thread (pid, 0);	/* run this thread */
 
-  /* The s/S/c/C packets do not return status.  So if the target does
-     not support the S or C packets, the debug agent returns an empty
-     string which is detected in remote_wait().  This protocol defect
-     is fixed in the e/E packets. */
-
-  if (step && step_range_end)
-    {
-      /* If the target does not support the 'E' packet, we try the 'S'
-	 packet.  Ideally we would fall back to the 'e' packet if that
-	 too is not supported.  But that would require another copy of
-	 the code to issue the 'e' packet (and fall back to 's' if not
-	 supported) in remote_wait().  */
-
-      if (siggnal != TARGET_SIGNAL_0)
-	{
-	  if (remote_protocol_E.support != PACKET_DISABLE)
-	    {
-	      p = buf;
-	      *p++ = 'E';
-	      *p++ = tohex (((int) siggnal >> 4) & 0xf);
-	      *p++ = tohex (((int) siggnal) & 0xf);
-	      *p++ = ',';
-	      p += hexnumstr (p, (ULONGEST) step_range_start);
-	      *p++ = ',';
-	      p += hexnumstr (p, (ULONGEST) step_range_end);
-	      *p++ = 0;
-
-	      putpkt (buf);
-	      getpkt (buf, (rs->remote_packet_size), 0);
-
-	      if (packet_ok (buf, &remote_protocol_E) == PACKET_OK)
-		return;
-	    }
-	}
-      else
-	{
-	  if (remote_protocol_e.support != PACKET_DISABLE)
-	    {
-	      p = buf;
-	      *p++ = 'e';
-	      p += hexnumstr (p, (ULONGEST) step_range_start);
-	      *p++ = ',';
-	      p += hexnumstr (p, (ULONGEST) step_range_end);
-	      *p++ = 0;
-
-	      putpkt (buf);
-	      getpkt (buf, (rs->remote_packet_size), 0);
-
-	      if (packet_ok (buf, &remote_protocol_e) == PACKET_OK)
-		return;
-	    }
-	}
-    }
-
   if (siggnal != TARGET_SIGNAL_0)
     {
       buf[0] = step ? 'S' : 'C';
@@ -2883,8 +2788,8 @@
 
       /* This is a hook for when we need to do something (perhaps the
          collection of trace data) every time the target stops.  */
-      if (target_wait_loop_hook)
-	(*target_wait_loop_hook) ();
+      if (deprecated_target_wait_loop_hook)
+	(*deprecated_target_wait_loop_hook) ();
 
       remote_stopped_by_watchpoint_p = 0;
 
@@ -3074,8 +2979,8 @@
 
       /* This is a hook for when we need to do something (perhaps the
          collection of trace data) every time the target stops.  */
-      if (target_wait_loop_hook)
-	(*target_wait_loop_hook) ();
+      if (deprecated_target_wait_loop_hook)
+	(*deprecated_target_wait_loop_hook) ();
 
       switch (buf[0])
 	{
@@ -4338,7 +4243,8 @@
    we're debugging, arguments and an environment.  */
 
 static void
-extended_remote_create_inferior (char *exec_file, char *args, char **env)
+extended_remote_create_inferior (char *exec_file, char *args, char **env,
+				 int from_tty)
 {
   /* Rip out the breakpoints; we'll reinsert them after restarting
      the remote server.  */
@@ -4360,7 +4266,8 @@
 
 /* Async version of extended_remote_create_inferior. */
 static void
-extended_remote_async_create_inferior (char *exec_file, char *args, char **env)
+extended_remote_async_create_inferior (char *exec_file, char *args, char **env,
+				       int from_tty)
 {
   /* Rip out the breakpoints; we'll reinsert them after restarting
      the remote server.  */
@@ -4640,10 +4547,13 @@
     return remote_stopped_by_watchpoint_p;
 }
 
+extern int stepped_after_stopped_by_watchpoint;
+
 static CORE_ADDR
 remote_stopped_data_address (void)
 {
-  if (remote_stopped_by_watchpoint ())
+  if (remote_stopped_by_watchpoint ()
+      || stepped_after_stopped_by_watchpoint)
     return remote_watch_data_address;
   return (CORE_ADDR)0;
 }
@@ -4819,7 +4729,7 @@
       if (!(s->flags & SEC_LOAD))
 	continue;		/* skip non-loadable section */
 
-      size = bfd_get_section_size_before_reloc (s);
+      size = bfd_get_section_size (s);
       if (size == 0)
 	continue;		/* skip zero-length section */
 
@@ -5419,8 +5329,6 @@
   /* FIXME: cagney/2002-06-15: This function should iterate over
      remote_show_cmdlist for a list of sub commands to show.  */
   show_remote_protocol_Z_packet_cmd (args, from_tty, NULL);
-  show_remote_protocol_e_packet_cmd (args, from_tty, NULL);
-  show_remote_protocol_E_packet_cmd (args, from_tty, NULL);
   show_remote_protocol_P_packet_cmd (args, from_tty, NULL);
   show_remote_protocol_qSymbol_packet_cmd (args, from_tty, NULL);
   show_remote_protocol_vcont_packet_cmd (args, from_tty, NULL);
@@ -5479,8 +5387,8 @@
   add_target (&extended_async_remote_ops);
 
   /* Hook into new objfile notification.  */
-  remote_new_objfile_chain = target_new_objfile_hook;
-  target_new_objfile_hook  = remote_new_objfile;
+  remote_new_objfile_chain = deprecated_target_new_objfile_hook;
+  deprecated_target_new_objfile_hook  = remote_new_objfile;
 
 #if 0
   init_remote_threadtests ();
@@ -5605,28 +5513,6 @@
 			 &remote_set_cmdlist, &remote_show_cmdlist,
 			 0);
 
-  add_packet_config_cmd (&remote_protocol_e,
-			 "e", "step-over-range",
-			 set_remote_protocol_e_packet_cmd,
-			 show_remote_protocol_e_packet_cmd,
-			 &remote_set_cmdlist, &remote_show_cmdlist,
-			 0);
-  /* Disable by default.  The ``e'' packet has nasty interactions with
-     the threading code - it relies on global state.  */
-  remote_protocol_e.detect = AUTO_BOOLEAN_FALSE;
-  update_packet_config (&remote_protocol_e);
-
-  add_packet_config_cmd (&remote_protocol_E,
-			 "E", "step-over-range-w-signal",
-			 set_remote_protocol_E_packet_cmd,
-			 show_remote_protocol_E_packet_cmd,
-			 &remote_set_cmdlist, &remote_show_cmdlist,
-			 0);
-  /* Disable by default.  The ``e'' packet has nasty interactions with
-     the threading code - it relies on global state.  */
-  remote_protocol_E.detect = AUTO_BOOLEAN_FALSE;
-  update_packet_config (&remote_protocol_E);
-
   add_packet_config_cmd (&remote_protocol_P,
 			 "P", "set-register",
 			 set_remote_protocol_P_packet_cmd,
diff --git a/gdb/remote.h b/gdb/remote.h
index 7c0df32..40c55f1 100644
--- a/gdb/remote.h
+++ b/gdb/remote.h
@@ -58,7 +58,7 @@
 
 extern int remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len);
 
-extern void (*target_resume_hook) (void);
-extern void (*target_wait_loop_hook) (void);
+extern void (*deprecated_target_resume_hook) (void);
+extern void (*deprecated_target_wait_loop_hook) (void);
 
 #endif
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 3d6c07c..dd52cf1 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -28,7 +28,7 @@
 #include "xcoffsolib.h"
 #include "symfile.h"
 #include "objfiles.h"
-#include "libbfd.h"		/* For bfd_cache_lookup (FIXME) */
+#include "libbfd.h"		/* For bfd_default_set_arch_mach (FIXME) */
 #include "bfd.h"
 #include "gdb-stabs.h"
 #include "regcache.h"
@@ -156,12 +156,15 @@
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
   *isfloat = 0;
-  if (tdep->ppc_gp0_regnum <= regno && regno <= tdep->ppc_gplast_regnum)
+  if (tdep->ppc_gp0_regnum <= regno
+      && regno < tdep->ppc_gp0_regnum + ppc_num_gprs)
     return regno;
-  else if (FP0_REGNUM <= regno && regno <= FPLAST_REGNUM)
+  else if (tdep->ppc_fp0_regnum >= 0
+           && tdep->ppc_fp0_regnum <= regno
+           && regno < tdep->ppc_fp0_regnum + ppc_num_fprs)
     {
       *isfloat = 1;
-      return regno - FP0_REGNUM + FPR0;
+      return regno - tdep->ppc_fp0_regnum + FPR0;
     }
   else if (regno == PC_REGNUM)
     return IAR;
@@ -175,7 +178,8 @@
     return CTR;
   else if (regno == tdep->ppc_xer_regnum)
     return XER;
-  else if (regno == tdep->ppc_fpscr_regnum)
+  else if (tdep->ppc_fpscr_regnum >= 0
+           && regno == tdep->ppc_fpscr_regnum)
     return FPSCR;
   else if (tdep->ppc_mq_regnum >= 0 && regno == tdep->ppc_mq_regnum)
     return MQ;
@@ -350,15 +354,16 @@
 
       /* Read 32 general purpose registers.  */
       for (regno = tdep->ppc_gp0_regnum;
-           regno <= tdep->ppc_gplast_regnum;
+           regno < tdep->ppc_gp0_regnum + ppc_num_gprs;
 	   regno++)
 	{
 	  fetch_register (regno);
 	}
 
       /* Read general purpose floating point registers.  */
-      for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++)
-	fetch_register (regno);
+      if (tdep->ppc_fp0_regnum >= 0)
+        for (regno = 0; regno < ppc_num_fprs; regno++)
+          fetch_register (tdep->ppc_fp0_regnum + regno);
 
       /* Read special registers.  */
       fetch_register (PC_REGNUM);
@@ -367,7 +372,8 @@
       fetch_register (tdep->ppc_lr_regnum);
       fetch_register (tdep->ppc_ctr_regnum);
       fetch_register (tdep->ppc_xer_regnum);
-      fetch_register (tdep->ppc_fpscr_regnum);
+      if (tdep->ppc_fpscr_regnum >= 0)
+        fetch_register (tdep->ppc_fpscr_regnum);
       if (tdep->ppc_mq_regnum >= 0)
 	fetch_register (tdep->ppc_mq_regnum);
     }
@@ -389,15 +395,16 @@
 
       /* Write general purpose registers first.  */
       for (regno = tdep->ppc_gp0_regnum;
-           regno <= tdep->ppc_gplast_regnum;
+           regno < tdep->ppc_gp0_regnum + ppc_num_gprs;
 	   regno++)
 	{
 	  store_register (regno);
 	}
 
       /* Write floating point registers.  */
-      for (regno = FP0_REGNUM; regno <= FPLAST_REGNUM; regno++)
-	store_register (regno);
+      if (tdep->ppc_fp0_regnum >= 0)
+        for (regno = 0; regno < ppc_num_fprs; regno++)
+          store_register (tdep->ppc_fp0_regnum + regno);
 
       /* Write special registers.  */
       store_register (PC_REGNUM);
@@ -406,7 +413,8 @@
       store_register (tdep->ppc_lr_regnum);
       store_register (tdep->ppc_ctr_regnum);
       store_register (tdep->ppc_xer_regnum);
-      store_register (tdep->ppc_fpscr_regnum);
+      if (tdep->ppc_fpscr_regnum >= 0)
+        store_register (tdep->ppc_fpscr_regnum);
       if (tdep->ppc_mq_regnum >= 0)
 	store_register (tdep->ppc_mq_regnum);
     }
@@ -578,11 +586,14 @@
 
   if (ARCH64 ())
     {
-      for (regi = 0; regi < 32; regi++)
-        supply_register (regi, (char *) &regs->r64.gpr[regi]);
+      for (regi = 0; regi < ppc_num_gprs; regi++)
+        supply_register (tdep->ppc_gp0_regnum + regi,
+                         (char *) &regs->r64.gpr[regi]);
 
-      for (regi = 0; regi < 32; regi++)
-	supply_register (FP0_REGNUM + regi, (char *) &regs->r64.fpr[regi]);
+      if (tdep->ppc_fp0_regnum >= 0)
+        for (regi = 0; regi < ppc_num_fprs; regi++)
+          supply_register (tdep->ppc_fp0_regnum + regi,
+                           (char *) &regs->r64.fpr[regi]);
 
       supply_register (PC_REGNUM, (char *) &regs->r64.iar);
       supply_register (tdep->ppc_ps_regnum, (char *) &regs->r64.msr);
@@ -590,15 +601,19 @@
       supply_register (tdep->ppc_lr_regnum, (char *) &regs->r64.lr);
       supply_register (tdep->ppc_ctr_regnum, (char *) &regs->r64.ctr);
       supply_register (tdep->ppc_xer_regnum, (char *) &regs->r64.xer);
-      supply_register (tdep->ppc_fpscr_regnum, (char *) &regs->r64.fpscr);
+      if (tdep->ppc_fpscr_regnum >= 0)
+        supply_register (tdep->ppc_fpscr_regnum, (char *) &regs->r64.fpscr);
     }
   else
     {
-      for (regi = 0; regi < 32; regi++)
-        supply_register (regi, (char *) &regs->r32.gpr[regi]);
+      for (regi = 0; regi < ppc_num_gprs; regi++)
+        supply_register (tdep->ppc_gp0_regnum + regi,
+                         (char *) &regs->r32.gpr[regi]);
 
-      for (regi = 0; regi < 32; regi++)
-	supply_register (FP0_REGNUM + regi, (char *) &regs->r32.fpr[regi]);
+      if (tdep->ppc_fp0_regnum >= 0)
+        for (regi = 0; regi < ppc_num_fprs; regi++)
+          supply_register (tdep->ppc_fp0_regnum + regi,
+                           (char *) &regs->r32.fpr[regi]);
 
       supply_register (PC_REGNUM, (char *) &regs->r32.iar);
       supply_register (tdep->ppc_ps_regnum, (char *) &regs->r32.msr);
@@ -606,7 +621,8 @@
       supply_register (tdep->ppc_lr_regnum, (char *) &regs->r32.lr);
       supply_register (tdep->ppc_ctr_regnum, (char *) &regs->r32.ctr);
       supply_register (tdep->ppc_xer_regnum, (char *) &regs->r32.xer);
-      supply_register (tdep->ppc_fpscr_regnum, (char *) &regs->r32.fpscr);
+      if (tdep->ppc_fpscr_regnum >= 0)
+        supply_register (tdep->ppc_fpscr_regnum, (char *) &regs->r32.fpscr);
       if (tdep->ppc_mq_regnum >= 0)
 	supply_register (tdep->ppc_mq_regnum, (char *) &regs->r32.mq);
     }
@@ -880,8 +896,8 @@
 
 	  /* Announce new object files.  Doing this after symbol relocation
 	     makes aix-thread.c's job easier. */
-	  if (target_new_objfile_hook && vp->objfile)
-	    target_new_objfile_hook (vp->objfile);
+	  if (deprecated_target_new_objfile_hook && vp->objfile)
+	    deprecated_target_new_objfile_hook (vp->objfile);
 
 	  /* There may be more, so we don't break out of the loop.  */
 	}
@@ -1162,8 +1178,8 @@
 
       vmap_symtab (vp);
 
-      if (target_new_objfile_hook && vp != vmap && vp->objfile)
-	target_new_objfile_hook (vp->objfile);
+      if (deprecated_target_new_objfile_hook && vp != vmap && vp->objfile)
+	deprecated_target_new_objfile_hook (vp->objfile);
     }
   while (LDI_NEXT (ldi, arch64) != 0);
   vmap_exec ();
@@ -1223,5 +1239,5 @@
      starting a child process. */
   rs6000_set_host_arch_hook = set_host_arch;
 
-  add_core_fns (&rs6000_core_fns);
+  deprecated_add_core_fns (&rs6000_core_fns);
 }
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index f19f120..1302066 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -31,10 +31,12 @@
 #include "objfiles.h"
 #include "arch-utils.h"
 #include "regcache.h"
+#include "regset.h"
 #include "doublest.h"
 #include "value.h"
 #include "parser-defs.h"
 #include "osabi.h"
+#include "infcall.h"
 
 #include "libbfd.h"		/* for bfd_default_set_arch_mach */
 #include "coff/internal.h"	/* for libcoff.h */
@@ -139,17 +141,216 @@
     return (regno >= tdep->ppc_vr0_regnum && regno <= tdep->ppc_vrsave_regnum);
 }
 
-/* Use the architectures FP registers?  */
+
+/* Return true if REGNO is an SPE register, false otherwise.  */
+int
+spe_register_p (int regno)
+{
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  
+  /* Is it a reference to EV0 -- EV31, and do we have those?  */
+  if (tdep->ppc_ev0_regnum >= 0
+      && tdep->ppc_ev31_regnum >= 0
+      && tdep->ppc_ev0_regnum <= regno && regno <= tdep->ppc_ev31_regnum)
+    return 1;
+
+  /* Is it a reference to the 64-bit accumulator, and do we have that?  */
+  if (tdep->ppc_acc_regnum >= 0
+      && tdep->ppc_acc_regnum == regno)
+    return 1;
+
+  /* Is it a reference to the SPE floating-point status and control register,
+     and do we have that?  */
+  if (tdep->ppc_spefscr_regnum >= 0
+      && tdep->ppc_spefscr_regnum == regno)
+    return 1;
+
+  return 0;
+}
+
+
+/* Return non-zero if the architecture described by GDBARCH has
+   floating-point registers (f0 --- f31 and fpscr).  */
 int
 ppc_floating_point_unit_p (struct gdbarch *gdbarch)
 {
-  const struct bfd_arch_info *info = gdbarch_bfd_arch_info (gdbarch);
-  if (info->arch == bfd_arch_powerpc)
-    return (info->mach != bfd_mach_ppc_e500);
-  if (info->arch == bfd_arch_rs6000)
-    return 1;
-  return 0;
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+  return (tdep->ppc_fp0_regnum >= 0
+          && tdep->ppc_fpscr_regnum >= 0);
 }
+
+
+/* Register set support functions.  */
+
+static void
+ppc_supply_reg (struct regcache *regcache, int regnum, 
+		const char *regs, size_t offset)
+{
+  if (regnum != -1 && offset != -1)
+    regcache_raw_supply (regcache, regnum, regs + offset);
+}
+
+static void
+ppc_collect_reg (const struct regcache *regcache, int regnum,
+		 char *regs, size_t offset)
+{
+  if (regnum != -1 && offset != -1)
+    regcache_raw_collect (regcache, regnum, regs + offset);
+}
+    
+/* Supply register REGNUM in the general-purpose register set REGSET
+   from the buffer specified by GREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+void
+ppc_supply_gregset (const struct regset *regset, struct regcache *regcache,
+		    int regnum, const void *gregs, size_t len)
+{
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  const struct ppc_reg_offsets *offsets = regset->descr;
+  size_t offset;
+  int i;
+
+  for (i = tdep->ppc_gp0_regnum, offset = offsets->r0_offset;
+       i < tdep->ppc_gp0_regnum + ppc_num_gprs;
+       i++, offset += 4)
+    {
+      if (regnum == -1 || regnum == i)
+	ppc_supply_reg (regcache, i, gregs, offset);
+    }
+
+  if (regnum == -1 || regnum == PC_REGNUM)
+    ppc_supply_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset);
+  if (regnum == -1 || regnum == tdep->ppc_ps_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_ps_regnum,
+		    gregs, offsets->ps_offset);
+  if (regnum == -1 || regnum == tdep->ppc_cr_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_cr_regnum,
+		    gregs, offsets->cr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_lr_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_lr_regnum,
+		    gregs, offsets->lr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_ctr_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_ctr_regnum,
+		    gregs, offsets->ctr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_xer_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_xer_regnum,
+		    gregs, offsets->cr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_mq_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_mq_regnum, gregs, offsets->mq_offset);
+}
+
+/* Supply register REGNUM in the floating-point register set REGSET
+   from the buffer specified by FPREGS and LEN to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
+void
+ppc_supply_fpregset (const struct regset *regset, struct regcache *regcache,
+		     int regnum, const void *fpregs, size_t len)
+{
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  const struct ppc_reg_offsets *offsets = regset->descr;
+  size_t offset;
+  int i;
+
+  gdb_assert (ppc_floating_point_unit_p (gdbarch));
+
+  offset = offsets->f0_offset;
+  for (i = tdep->ppc_fp0_regnum;
+       i < tdep->ppc_fp0_regnum + ppc_num_fprs;
+       i++, offset += 4)
+    {
+      if (regnum == -1 || regnum == i)
+	ppc_supply_reg (regcache, i, fpregs, offset);
+    }
+
+  if (regnum == -1 || regnum == tdep->ppc_fpscr_regnum)
+    ppc_supply_reg (regcache, tdep->ppc_fpscr_regnum,
+		    fpregs, offsets->fpscr_offset);
+}
+
+/* Collect register REGNUM in the general-purpose register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   GREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+void
+ppc_collect_gregset (const struct regset *regset,
+		     const struct regcache *regcache,
+		     int regnum, void *gregs, size_t len)
+{
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  const struct ppc_reg_offsets *offsets = regset->descr;
+  size_t offset;
+  int i;
+
+  offset = offsets->r0_offset;
+  for (i = tdep->ppc_gp0_regnum;
+       i < tdep->ppc_gp0_regnum + ppc_num_gprs;
+       i++, offset += 4)
+    {
+      if (regnum == -1 || regnum == i)
+	ppc_collect_reg (regcache, i, gregs, offset);
+    }
+
+  if (regnum == -1 || regnum == PC_REGNUM)
+    ppc_collect_reg (regcache, PC_REGNUM, gregs, offsets->pc_offset);
+  if (regnum == -1 || regnum == tdep->ppc_ps_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_ps_regnum,
+		     gregs, offsets->ps_offset);
+  if (regnum == -1 || regnum == tdep->ppc_cr_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_cr_regnum,
+		     gregs, offsets->cr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_lr_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_lr_regnum,
+		     gregs, offsets->lr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_ctr_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_ctr_regnum,
+		     gregs, offsets->ctr_offset);
+  if (regnum == -1 || regnum == tdep->ppc_xer_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_xer_regnum,
+		     gregs, offsets->xer_offset);
+  if (regnum == -1 || regnum == tdep->ppc_mq_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_mq_regnum,
+		     gregs, offsets->mq_offset);
+}
+
+/* Collect register REGNUM in the floating-point register set
+   REGSET. from register cache REGCACHE into the buffer specified by
+   FPREGS and LEN.  If REGNUM is -1, do this for all registers in
+   REGSET.  */
+
+void
+ppc_collect_fpregset (const struct regset *regset,
+		      const struct regcache *regcache,
+		      int regnum, void *fpregs, size_t len)
+{
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  const struct ppc_reg_offsets *offsets = regset->descr;
+  size_t offset;
+  int i;
+
+  gdb_assert (ppc_floating_point_unit_p (gdbarch));
+
+  offset = offsets->f0_offset;
+  for (i = tdep->ppc_fp0_regnum;
+       i <= tdep->ppc_fp0_regnum + ppc_num_fprs;
+       i++, offset += 4)
+    {
+      if (regnum == -1 || regnum == i)
+	ppc_collect_reg (regcache, regnum, fpregs, offset);
+    }
+
+  if (regnum == -1 || regnum == tdep->ppc_fpscr_regnum)
+    ppc_collect_reg (regcache, tdep->ppc_fpscr_regnum,
+		     fpregs, offsets->fpscr_offset);
+}
+
 
 /* Read a LEN-byte address from debugged memory address MEMADDR. */
 
@@ -419,6 +620,76 @@
   return lim_pc;
 }
 
+/* Return nonzero if the given instruction OP can be part of the prologue
+   of a function and saves a parameter on the stack.  FRAMEP should be
+   set if one of the previous instructions in the function has set the
+   Frame Pointer.  */
+
+static int
+store_param_on_stack_p (unsigned long op, int framep, int *r0_contains_arg)
+{
+  /* Move parameters from argument registers to temporary register.  */
+  if ((op & 0xfc0007fe) == 0x7c000378)         /* mr(.)  Rx,Ry */
+    {
+      /* Rx must be scratch register r0.  */
+      const int rx_regno = (op >> 16) & 31;
+      /* Ry: Only r3 - r10 are used for parameter passing.  */
+      const int ry_regno = GET_SRC_REG (op);
+
+      if (rx_regno == 0 && ry_regno >= 3 && ry_regno <= 10)
+        {
+          *r0_contains_arg = 1;
+          return 1;
+        }
+      else
+        return 0;
+    }
+
+  /* Save a General Purpose Register on stack.  */
+
+  if ((op & 0xfc1f0003) == 0xf8010000 ||       /* std  Rx,NUM(r1) */
+      (op & 0xfc1f0000) == 0xd8010000)         /* stfd Rx,NUM(r1) */
+    {
+      /* Rx: Only r3 - r10 are used for parameter passing.  */
+      const int rx_regno = GET_SRC_REG (op);
+
+      return (rx_regno >= 3 && rx_regno <= 10);
+    }
+           
+  /* Save a General Purpose Register on stack via the Frame Pointer.  */
+
+  if (framep &&
+      ((op & 0xfc1f0000) == 0x901f0000 ||     /* st rx,NUM(r31) */
+       (op & 0xfc1f0000) == 0x981f0000 ||     /* stb Rx,NUM(r31) */
+       (op & 0xfc1f0000) == 0xd81f0000))      /* stfd Rx,NUM(r31) */
+    {
+      /* Rx: Usually, only r3 - r10 are used for parameter passing.
+         However, the compiler sometimes uses r0 to hold an argument.  */
+      const int rx_regno = GET_SRC_REG (op);
+
+      return ((rx_regno >= 3 && rx_regno <= 10)
+              || (rx_regno == 0 && *r0_contains_arg));
+    }
+
+  if ((op & 0xfc1f0000) == 0xfc010000)         /* frsp, fp?,NUM(r1) */
+    {
+      /* Only f2 - f8 are used for parameter passing.  */
+      const int src_regno = GET_SRC_REG (op);
+
+      return (src_regno >= 2 && src_regno <= 8);
+    }
+
+  if (framep && ((op & 0xfc1f0000) == 0xfc1f0000))  /* frsp, fp?,NUM(r31) */
+    {
+      /* Only f2 - f8 are used for parameter passing.  */
+      const int src_regno = GET_SRC_REG (op);
+
+      return (src_regno >= 2 && src_regno <= 8);
+    }
+
+  /* Not an insn that saves a parameter on stack.  */
+  return 0;
+}
 
 static CORE_ADDR
 skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
@@ -441,6 +712,7 @@
   int minimal_toc_loaded = 0;
   int prev_insn_was_prologue_insn = 1;
   int num_skip_non_prologue_insns = 0;
+  int r0_contains_arg = 0;
   const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (current_gdbarch);
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   
@@ -509,11 +781,15 @@
 	     ones.  */
 	  if (lr_reg < 0)
 	    lr_reg = (op & 0x03e00000);
+          if (lr_reg == 0)
+            r0_contains_arg = 0;
 	  continue;
 	}
       else if ((op & 0xfc1fffff) == 0x7c000026)
 	{			/* mfcr Rx */
 	  cr_reg = (op & 0x03e00000);
+          if (cr_reg == 0)
+            r0_contains_arg = 0;
 	  continue;
 
 	}
@@ -560,6 +836,7 @@
 				   for >= 32k frames */
 	  fdata->offset = (op & 0x0000ffff) << 16;
 	  fdata->frameless = 0;
+          r0_contains_arg = 0;
 	  continue;
 
 	}
@@ -568,6 +845,7 @@
 				   lf of >= 32k frames */
 	  fdata->offset |= (op & 0x0000ffff);
 	  fdata->frameless = 0;
+          r0_contains_arg = 0;
 	  continue;
 
 	}
@@ -700,19 +978,9 @@
 
 	  /* store parameters in stack */
 	}
-      else if ((op & 0xfc1f0003) == 0xf8010000 ||	/* std rx,NUM(r1) */
-	       (op & 0xfc1f0000) == 0xd8010000 ||	/* stfd Rx,NUM(r1) */
-	       (op & 0xfc1f0000) == 0xfc010000)		/* frsp, fp?,NUM(r1) */
-	{
-	  continue;
-
-	  /* store parameters in stack via frame pointer */
-	}
-      else if (framep &&
-	       ((op & 0xfc1f0000) == 0x901f0000 ||	/* st rx,NUM(r1) */
-		(op & 0xfc1f0000) == 0xd81f0000 ||	/* stfd Rx,NUM(r1) */
-		(op & 0xfc1f0000) == 0xfc1f0000))
-	{			/* frsp, fp?,NUM(r1) */
+      /* Move parameters from argument registers to temporary register.  */
+      else if (store_param_on_stack_p (op, framep, &r0_contains_arg))
+        {
 	  continue;
 
 	  /* Set up frame pointer */
@@ -780,8 +1048,15 @@
       else if ((op & 0xffff0000) == 0x38000000         /* li r0, SIMM */
                || (op & 0xffff0000) == 0x39c00000)     /* li r14, SIMM */
 	{
+          if ((op & 0xffff0000) == 0x38000000)
+            r0_contains_arg = 0;
 	  li_found_pc = pc;
 	  vr_saved_offset = SIGNED_SHORT (op);
+
+          /* This insn by itself is not part of the prologue, unless
+             if part of the pair of insns mentioned above. So do not
+             record this insn as part of the prologue yet.  */
+          prev_insn_was_prologue_insn = 0;
 	}
       /* Store vector register S at (r31+r0) aligned to 16 bytes.  */      
       /* 011111 sssss 11111 00000 00111001110 */
@@ -997,7 +1272,7 @@
    starting from r4.  */
 
 static CORE_ADDR
-rs6000_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			struct regcache *regcache, CORE_ADDR bp_addr,
 			int nargs, struct value **args, CORE_ADDR sp,
 			int struct_return, CORE_ADDR struct_addr)
@@ -1010,12 +1285,18 @@
   char tmp_buffer[50];
   int f_argno = 0;		/* current floating point argno */
   int wordsize = gdbarch_tdep (current_gdbarch)->wordsize;
+  CORE_ADDR func_addr = find_function_addr (function, NULL);
 
   struct value *arg = 0;
   struct type *type;
 
   CORE_ADDR saved_sp;
 
+  /* The calling convention this function implements assumes the
+     processor has floating-point registers.  We shouldn't be using it
+     on PPC variants that lack them.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
   /* The first eight words of ther arguments are passed in registers.
      Copy them appropriately.  */
   ii = 0;
@@ -1066,10 +1347,11 @@
 	     there is no way we would run out of them.  */
 
 	  if (len > 8)
-	    printf_unfiltered (
-				"Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
+	    printf_unfiltered ("Fatal Error: a floating point parameter "
+                               "#%d with a size > 8 is found!\n", argno);
 
-	  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
+	  memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE
+                                        (tdep->ppc_fp0_regnum + 1 + f_argno)],
 		  VALUE_CONTENTS (arg),
 		  len);
 	  ++f_argno;
@@ -1179,16 +1461,20 @@
 	    {
 
 	      if (len > 8)
-		printf_unfiltered (
-				    "Fatal Error: a floating point parameter #%d with a size > 8 is found!\n", argno);
+		printf_unfiltered ("Fatal Error: a floating point parameter"
+                                   " #%d with a size > 8 is found!\n", argno);
 
-	      memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1 + f_argno)],
+	      memcpy (&(deprecated_registers
+                        [DEPRECATED_REGISTER_BYTE
+                         (tdep->ppc_fp0_regnum + 1 + f_argno)]),
 		      VALUE_CONTENTS (arg),
 		      len);
 	      ++f_argno;
 	    }
 
-	  write_memory (sp + 24 + (ii * 4), (char *) VALUE_CONTENTS (arg), len);
+	  write_memory (sp + 24 + (ii * 4),
+                        (char *) VALUE_CONTENTS (arg),
+                        len);
 	  ii += ((len + 3) & -4) / 4;
 	}
     }
@@ -1239,25 +1525,23 @@
   int offset = 0;
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
+  /* The calling convention this function implements assumes the
+     processor has floating-point registers.  We shouldn't be using it
+     on PPC variants that lack them.  */
+  gdb_assert (ppc_floating_point_unit_p (current_gdbarch));
+
   if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
     {
 
-      double dd;
-      float ff;
       /* floats and doubles are returned in fpr1. fpr's have a size of 8 bytes.
          We need to truncate the return value into float size (4 byte) if
          necessary.  */
 
-      if (TYPE_LENGTH (valtype) > 4)	/* this is a double */
-	memcpy (valbuf,
-		&regbuf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)],
-		TYPE_LENGTH (valtype));
-      else
-	{			/* float */
-	  memcpy (&dd, &regbuf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], 8);
-	  ff = (float) dd;
-	  memcpy (valbuf, &ff, sizeof (float));
-	}
+      convert_typed_floating (&regbuf[DEPRECATED_REGISTER_BYTE
+                                      (tdep->ppc_fp0_regnum + 1)],
+                              builtin_type_double,
+                              valbuf,
+                              valtype);
     }
   else if (TYPE_CODE (valtype) == TYPE_CODE_ARRAY
            && TYPE_LENGTH (valtype) == 16
@@ -1395,33 +1679,13 @@
   return reg->name;
 }
 
-/* Index within `registers' of the first byte of the space for
-   register N.  */
-
-static int
-rs6000_register_byte (int n)
-{
-  return gdbarch_tdep (current_gdbarch)->regoff[n];
-}
-
-/* Return the number of bytes of storage in the actual machine representation
-   for register N if that register is available, else return 0.  */
-
-static int
-rs6000_register_raw_size (int n)
-{
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-  const struct reg *reg = tdep->regs + n;
-  return regsize (reg, tdep->wordsize);
-}
-
 /* Return the GDB type object for the "standard" data type
    of data in register N.  */
 
 static struct type *
-rs6000_register_virtual_type (int n)
+rs6000_register_type (struct gdbarch *gdbarch, int n)
 {
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
   const struct reg *reg = tdep->regs + n;
 
   if (reg->fpr)
@@ -1451,49 +1715,49 @@
     }
 }
 
-/* Return whether register N requires conversion when moving from raw format
-   to virtual format.
-
-   The register format for RS/6000 floating point registers is always
+/* The register format for RS/6000 floating point registers is always
    double, we need a conversion if the memory format is float.  */
 
 static int
-rs6000_register_convertible (int n)
+rs6000_convert_register_p (int regnum, struct type *type)
 {
-  const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + n;
-  return reg->fpr;
+  const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + regnum;
+  
+  return (reg->fpr
+          && TYPE_CODE (type) == TYPE_CODE_FLT
+          && TYPE_LENGTH (type) != TYPE_LENGTH (builtin_type_double));
 }
 
-/* Convert data from raw format for register N in buffer FROM
-   to virtual format with type TYPE in buffer TO.  */
-
 static void
-rs6000_register_convert_to_virtual (int n, struct type *type,
-				    char *from, char *to)
+rs6000_register_to_value (struct frame_info *frame,
+                          int regnum,
+                          struct type *type,
+                          void *to)
 {
-  if (TYPE_LENGTH (type) != DEPRECATED_REGISTER_RAW_SIZE (n))
-    {
-      double val = deprecated_extract_floating (from, DEPRECATED_REGISTER_RAW_SIZE (n));
-      deprecated_store_floating (to, TYPE_LENGTH (type), val);
-    }
-  else
-    memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (n));
+  const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + regnum;
+  char from[MAX_REGISTER_SIZE];
+  
+  gdb_assert (reg->fpr);
+  gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
+
+  get_frame_register (frame, regnum, from);
+  convert_typed_floating (from, builtin_type_double, to, type);
 }
 
-/* Convert data from virtual format with type TYPE in buffer FROM
-   to raw format for register N in buffer TO.  */
-
 static void
-rs6000_register_convert_to_raw (struct type *type, int n,
-				const char *from, char *to)
+rs6000_value_to_register (struct frame_info *frame,
+                          int regnum,
+                          struct type *type,
+                          const void *from)
 {
-  if (TYPE_LENGTH (type) != DEPRECATED_REGISTER_RAW_SIZE (n))
-    {
-      double val = deprecated_extract_floating (from, TYPE_LENGTH (type));
-      deprecated_store_floating (to, DEPRECATED_REGISTER_RAW_SIZE (n), val);
-    }
-  else
-    memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (n));
+  const struct reg *reg = gdbarch_tdep (current_gdbarch)->regs + regnum;
+  char to[MAX_REGISTER_SIZE];
+
+  gdb_assert (reg->fpr);
+  gdb_assert (TYPE_CODE (type) == TYPE_CODE_FLT);
+
+  convert_typed_floating (from, type, to, builtin_type_double);
+  put_frame_register (frame, regnum, to);
 }
 
 static void
@@ -1506,7 +1770,7 @@
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); 
 
   if (reg_nr >= tdep->ppc_gp0_regnum 
-      && reg_nr <= tdep->ppc_gplast_regnum)
+      && reg_nr < tdep->ppc_gp0_regnum + ppc_num_gprs)
     {
       base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum;
 
@@ -1529,7 +1793,7 @@
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); 
 
   if (reg_nr >= tdep->ppc_gp0_regnum 
-      && reg_nr <= tdep->ppc_gplast_regnum)
+      && reg_nr < tdep->ppc_gp0_regnum + ppc_num_gprs)
     {
       base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum;
       /* reg_nr is 32 bit here, and base_regnum is 64 bits.  */
@@ -1547,70 +1811,139 @@
     }
 }
 
-/* Convert a dwarf2 register number to a gdb REGNUM.  */
-static int
-e500_dwarf2_reg_to_regnum (int num)
-{
-  int regnum;
-  if (0 <= num && num <= 31)
-    return num + gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum;
-  else 
-    return num;
-}
-
-/* Convert a dbx stab register number (from `r' declaration) to a gdb
-   REGNUM.  */
+/* Convert a DBX STABS register number to a GDB register number.  */
 static int
 rs6000_stab_reg_to_regnum (int num)
 {
-  int regnum;
-  switch (num)
-    {
-    case 64: 
-      regnum = gdbarch_tdep (current_gdbarch)->ppc_mq_regnum;
-      break;
-    case 65: 
-      regnum = gdbarch_tdep (current_gdbarch)->ppc_lr_regnum;
-      break;
-    case 66: 
-      regnum = gdbarch_tdep (current_gdbarch)->ppc_ctr_regnum;
-      break;
-    case 76: 
-      regnum = gdbarch_tdep (current_gdbarch)->ppc_xer_regnum;
-      break;
-    default: 
-      regnum = num;
-      break;
-    }
-  return regnum;
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+  if (0 <= num && num <= 31)
+    return tdep->ppc_gp0_regnum + num;
+  else if (32 <= num && num <= 63)
+    /* FIXME: jimb/2004-05-05: What should we do when the debug info
+       specifies registers the architecture doesn't have?  Our
+       callers don't check the value we return.  */
+    return tdep->ppc_fp0_regnum + (num - 32);
+  else if (77 <= num && num <= 108)
+    return tdep->ppc_vr0_regnum + (num - 77);
+  else if (1200 <= num && num < 1200 + 32)
+    return tdep->ppc_ev0_regnum + (num - 1200);
+  else
+    switch (num)
+      {
+      case 64: 
+        return tdep->ppc_mq_regnum;
+      case 65:
+        return tdep->ppc_lr_regnum;
+      case 66: 
+        return tdep->ppc_ctr_regnum;
+      case 76: 
+        return tdep->ppc_xer_regnum;
+      case 109:
+        return tdep->ppc_vrsave_regnum;
+      case 110:
+        return tdep->ppc_vrsave_regnum - 1; /* vscr */
+      case 111:
+        return tdep->ppc_acc_regnum;
+      case 112:
+        return tdep->ppc_spefscr_regnum;
+      default: 
+        return num;
+      }
 }
 
-static void
-rs6000_store_return_value (struct type *type, char *valbuf)
+
+/* Convert a Dwarf 2 register number to a GDB register number.  */
+static int
+rs6000_dwarf2_reg_to_regnum (int num)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
 
-  if (TYPE_CODE (type) == TYPE_CODE_FLT)
+  if (0 <= num && num <= 31)
+    return tdep->ppc_gp0_regnum + num;
+  else if (32 <= num && num <= 63)
+    /* FIXME: jimb/2004-05-05: What should we do when the debug info
+       specifies registers the architecture doesn't have?  Our
+       callers don't check the value we return.  */
+    return tdep->ppc_fp0_regnum + (num - 32);
+  else if (1124 <= num && num < 1124 + 32)
+    return tdep->ppc_vr0_regnum + (num - 1124);
+  else if (1200 <= num && num < 1200 + 32)
+    return tdep->ppc_ev0_regnum + (num - 1200);
+  else
+    switch (num)
+      {
+      case 67:
+        return tdep->ppc_vrsave_regnum - 1; /* vscr */
+      case 99:
+        return tdep->ppc_acc_regnum;
+      case 100:
+        return tdep->ppc_mq_regnum;
+      case 101:
+        return tdep->ppc_xer_regnum;
+      case 108:
+        return tdep->ppc_lr_regnum;
+      case 109:
+        return tdep->ppc_ctr_regnum;
+      case 356:
+        return tdep->ppc_vrsave_regnum;
+      case 612:
+        return tdep->ppc_spefscr_regnum;
+      default:
+        return num;
+      }
+}
 
+
+static void
+rs6000_store_return_value (struct type *type,
+                           struct regcache *regcache,
+                           const void *valbuf)
+{
+  struct gdbarch *gdbarch = get_regcache_arch (regcache);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+  int regnum = -1;
+
+  /* The calling convention this function implements assumes the
+     processor has floating-point registers.  We shouldn't be using it
+     on PPC variants that lack them.  */
+  gdb_assert (ppc_floating_point_unit_p (gdbarch));
+
+  if (TYPE_CODE (type) == TYPE_CODE_FLT)
     /* Floating point values are returned starting from FPR1 and up.
        Say a double_double_double type could be returned in
        FPR1/FPR2/FPR3 triple.  */
-
-    deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1), valbuf,
-				     TYPE_LENGTH (type));
+    regnum = tdep->ppc_fp0_regnum + 1;
   else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
     {
       if (TYPE_LENGTH (type) == 16
           && TYPE_VECTOR (type))
-	deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (tdep->ppc_vr0_regnum + 2),
-					 valbuf, TYPE_LENGTH (type));
+        regnum = tdep->ppc_vr0_regnum + 2;
+      else
+        gdb_assert (0);
     }
   else
     /* Everything else is returned in GPR3 and up.  */
-    deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (gdbarch_tdep (current_gdbarch)->ppc_gp0_regnum + 3),
-				     valbuf, TYPE_LENGTH (type));
+    regnum = tdep->ppc_gp0_regnum + 3;
+
+  {
+    size_t bytes_written = 0;
+
+    while (bytes_written < TYPE_LENGTH (type))
+      {
+        /* How much of this value can we write to this register?  */
+        size_t bytes_to_write = min (TYPE_LENGTH (type) - bytes_written,
+                                     register_size (gdbarch, regnum));
+        regcache_cooked_write_part (regcache, regnum,
+                                    0, bytes_to_write,
+                                    (char *) valbuf + bytes_written);
+        regnum++;
+        bytes_written += bytes_to_write;
+      }
+  }
 }
 
+
 /* Extract from an array REGBUF containing the (raw) register state
    the address in which a function should return its structure value,
    as a CORE_ADDR (or an expression that can be used as one).  */
@@ -1843,14 +2176,6 @@
   PPC_ALTIVEC_REGS
 };
 
-/* PowerPC UISA - a PPC processor as viewed by user-level
-   code, but without floating point registers.  */
-static const struct reg registers_powerpc_nofp[] =
-{
-  COMMON_UISA_NOFP_REGS,
-  PPC_UISA_SPRS
-};
-
 /* IBM PowerPC 403.  */
 static const struct reg registers_403[] =
 {
@@ -1984,7 +2309,7 @@
 {
   /* gpr0-gpr31, fpr0-fpr31 */
   COMMON_UISA_REGS,
-  /* ctr, xre, lr, cr */
+  /* cr, lr, ctr, xer, fpscr */
   PPC_UISA_SPRS,
   /* sr0-sr15 */
   PPC_SEGMENT_REGS,
@@ -2005,7 +2330,7 @@
   R8(acc), R(spefscr),
   /* NOTE: Add new registers here the end of the raw register
      list and just before the first pseudo register.  */
-  /* 39...70 */
+  /* 41...72 */
   PPC_GPRS_PSEUDO_REGS
 };
 
@@ -2268,11 +2593,17 @@
     {
       int i;
       CORE_ADDR fpr_addr = cache->base + fdata.fpr_offset;
-      for (i = fdata.saved_fpr; i < 32; i++)
-	{
-	  cache->saved_regs[FP0_REGNUM + i].addr = fpr_addr;
-	  fpr_addr += 8;
-	}
+
+      /* If skip_prologue says floating-point registers were saved,
+         but the current architecture has no floating-point registers,
+         then that's strange.  But we have no indices to even record
+         the addresses under, so we just ignore it.  */
+      if (ppc_floating_point_unit_p (gdbarch))
+        for (i = fdata.saved_fpr; i < ppc_num_fprs; i++)
+          {
+            cache->saved_regs[tdep->ppc_fp0_regnum + i].addr = fpr_addr;
+            fpr_addr += 8;
+          }
     }
 
   /* if != -1, fdata.saved_gpr is the smallest number of saved_gpr.
@@ -2282,7 +2613,7 @@
     {
       int i;
       CORE_ADDR gpr_addr = cache->base + fdata.gpr_offset;
-      for (i = fdata.saved_gpr; i < 32; i++)
+      for (i = fdata.saved_gpr; i < ppc_num_gprs; i++)
 	{
 	  cache->saved_regs[tdep->ppc_gp0_regnum + i].addr = gpr_addr;
 	  gpr_addr += wordsize;
@@ -2313,7 +2644,7 @@
 	{
 	  int i;
 	  CORE_ADDR ev_addr = cache->base + fdata.ev_offset;
-	  for (i = fdata.saved_ev; i < 32; i++)
+	  for (i = fdata.saved_ev; i < ppc_num_gprs; i++)
 	    {
 	      cache->saved_regs[tdep->ppc_ev0_regnum + i].addr = ev_addr;
               cache->saved_regs[tdep->ppc_gp0_regnum + i].addr = ev_addr + 4;
@@ -2533,7 +2864,7 @@
   tdep->regs = v->regs;
 
   tdep->ppc_gp0_regnum = 0;
-  tdep->ppc_gplast_regnum = 31;
+  tdep->ppc_gprs_pseudo_p = 0;
   tdep->ppc_toc_regnum = 2;
   tdep->ppc_ps_regnum = 65;
   tdep->ppc_cr_regnum = 66;
@@ -2546,7 +2877,14 @@
     tdep->ppc_mq_regnum = 70;
   else
     tdep->ppc_mq_regnum = -1;
+  tdep->ppc_fp0_regnum = 32;
   tdep->ppc_fpscr_regnum = power ? 71 : 70;
+  tdep->ppc_vr0_regnum = -1;
+  tdep->ppc_vrsave_regnum = -1;
+  tdep->ppc_ev0_regnum = -1;
+  tdep->ppc_ev31_regnum = -1;
+  tdep->ppc_acc_regnum = -1;
+  tdep->ppc_spefscr_regnum = -1;
 
   set_gdbarch_pc_regnum (gdbarch, 64);
   set_gdbarch_sp_regnum (gdbarch, 1);
@@ -2558,53 +2896,9 @@
   else
     {
       set_gdbarch_deprecated_extract_return_value (gdbarch, rs6000_extract_return_value);
-      set_gdbarch_deprecated_store_return_value (gdbarch, rs6000_store_return_value);
+      set_gdbarch_store_return_value (gdbarch, rs6000_store_return_value);
     }
 
-  if (v->arch == bfd_arch_powerpc)
-    switch (v->mach)
-      {
-      case bfd_mach_ppc: 
-	tdep->ppc_vr0_regnum = 71;
-	tdep->ppc_vrsave_regnum = 104;
-	tdep->ppc_ev0_regnum = -1;
-	tdep->ppc_ev31_regnum = -1;
-	break;
-      case bfd_mach_ppc_7400:
-	tdep->ppc_vr0_regnum = 119;
-	tdep->ppc_vrsave_regnum = 152;
-	tdep->ppc_ev0_regnum = -1;
-	tdep->ppc_ev31_regnum = -1;
-	break;
-      case bfd_mach_ppc_e500:
-        tdep->ppc_gp0_regnum = 41;
-        tdep->ppc_gplast_regnum = tdep->ppc_gp0_regnum + 32 - 1;
-        tdep->ppc_toc_regnum = -1;
-        tdep->ppc_ps_regnum = 1;
-        tdep->ppc_cr_regnum = 2;
-        tdep->ppc_lr_regnum = 3;
-        tdep->ppc_ctr_regnum = 4;
-        tdep->ppc_xer_regnum = 5;
-	tdep->ppc_ev0_regnum = 7;
-	tdep->ppc_ev31_regnum = 38;
-        set_gdbarch_pc_regnum (gdbarch, 0);
-        set_gdbarch_sp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1);
-        set_gdbarch_deprecated_fp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1);
-        set_gdbarch_dwarf2_reg_to_regnum (gdbarch, e500_dwarf2_reg_to_regnum);
-        set_gdbarch_pseudo_register_read (gdbarch, e500_pseudo_register_read);
-        set_gdbarch_pseudo_register_write (gdbarch, e500_pseudo_register_write);
-	break;
-      default:
-	tdep->ppc_vr0_regnum = -1;
-	tdep->ppc_vrsave_regnum = -1;
-	tdep->ppc_ev0_regnum = -1;
-	tdep->ppc_ev31_regnum = -1;
-	break;
-      }   
-
-  /* Sanity check on registers.  */
-  gdb_assert (strcmp (tdep->regs[tdep->ppc_gp0_regnum].name, "r0") == 0);
-
   /* Set lr_frame_offset.  */
   if (wordsize == 8)
     tdep->lr_frame_offset = 16;
@@ -2613,13 +2907,42 @@
   else
     tdep->lr_frame_offset = 8;
 
-  /* Calculate byte offsets in raw register array.  */
-  tdep->regoff = xmalloc (v->num_tot_regs * sizeof (int));
-  for (i = off = 0; i < v->num_tot_regs; i++)
-    {
-      tdep->regoff[i] = off;
-      off += regsize (v->regs + i, wordsize);
-    }
+  if (v->arch == bfd_arch_powerpc)
+    switch (v->mach)
+      {
+      case bfd_mach_ppc: 
+	tdep->ppc_vr0_regnum = 71;
+	tdep->ppc_vrsave_regnum = 104;
+	break;
+      case bfd_mach_ppc_7400:
+	tdep->ppc_vr0_regnum = 119;
+	tdep->ppc_vrsave_regnum = 152;
+	break;
+      case bfd_mach_ppc_e500:
+        tdep->ppc_gp0_regnum = 41;
+        tdep->ppc_gprs_pseudo_p = 1;
+        tdep->ppc_toc_regnum = -1;
+        tdep->ppc_ps_regnum = 1;
+        tdep->ppc_cr_regnum = 2;
+        tdep->ppc_lr_regnum = 3;
+        tdep->ppc_ctr_regnum = 4;
+        tdep->ppc_xer_regnum = 5;
+	tdep->ppc_ev0_regnum = 7;
+	tdep->ppc_ev31_regnum = 38;
+        tdep->ppc_fp0_regnum = -1;
+        tdep->ppc_fpscr_regnum = -1;
+        tdep->ppc_acc_regnum = 39;
+        tdep->ppc_spefscr_regnum = 40;
+        set_gdbarch_pc_regnum (gdbarch, 0);
+        set_gdbarch_sp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1);
+        set_gdbarch_deprecated_fp_regnum (gdbarch, tdep->ppc_gp0_regnum + 1);
+        set_gdbarch_pseudo_register_read (gdbarch, e500_pseudo_register_read);
+        set_gdbarch_pseudo_register_write (gdbarch, e500_pseudo_register_write);
+	break;
+      }   
+
+  /* Sanity check on registers.  */
+  gdb_assert (strcmp (tdep->regs[tdep->ppc_gp0_regnum].name, "r0") == 0);
 
   /* Select instruction printer.  */
   if (arch == power)
@@ -2632,11 +2955,7 @@
   set_gdbarch_num_regs (gdbarch, v->nregs);
   set_gdbarch_num_pseudo_regs (gdbarch, v->npregs);
   set_gdbarch_register_name (gdbarch, rs6000_register_name);
-  set_gdbarch_deprecated_register_size (gdbarch, wordsize);
-  set_gdbarch_deprecated_register_bytes (gdbarch, off);
-  set_gdbarch_deprecated_register_byte (gdbarch, rs6000_register_byte);
-  set_gdbarch_deprecated_register_raw_size (gdbarch, rs6000_register_raw_size);
-  set_gdbarch_deprecated_register_virtual_type (gdbarch, rs6000_register_virtual_type);
+  set_gdbarch_register_type (gdbarch, rs6000_register_type);
 
   set_gdbarch_ptr_bit (gdbarch, wordsize * TARGET_CHAR_BIT);
   set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
@@ -2662,10 +2981,12 @@
        224.  */
     set_gdbarch_frame_red_zone_size (gdbarch, 224);
 
-  set_gdbarch_deprecated_register_convertible (gdbarch, rs6000_register_convertible);
-  set_gdbarch_deprecated_register_convert_to_virtual (gdbarch, rs6000_register_convert_to_virtual);
-  set_gdbarch_deprecated_register_convert_to_raw (gdbarch, rs6000_register_convert_to_raw);
+  set_gdbarch_convert_register_p (gdbarch, rs6000_convert_register_p);
+  set_gdbarch_register_to_value (gdbarch, rs6000_register_to_value);
+  set_gdbarch_value_to_register (gdbarch, rs6000_value_to_register);
+
   set_gdbarch_stab_reg_to_regnum (gdbarch, rs6000_stab_reg_to_regnum);
+  set_gdbarch_dwarf2_reg_to_regnum (gdbarch, rs6000_dwarf2_reg_to_regnum);
   /* Note: kevinb/2002-04-12: I'm not convinced that rs6000_push_arguments()
      is correct for the SysV ABI when the wordsize is 8, but I'm also
      fairly certain that ppc_sysv_abi_push_arguments() will give even
@@ -2699,8 +3020,7 @@
   set_gdbarch_frame_args_skip (gdbarch, 8);
 
   if (!sysv_abi)
-    set_gdbarch_use_struct_convention (gdbarch,
-				       rs6000_use_struct_convention);
+    set_gdbarch_deprecated_use_struct_convention (gdbarch, rs6000_use_struct_convention);
 
   if (!sysv_abi)
     {
@@ -2728,7 +3048,6 @@
       frame_base_append_sniffer (gdbarch, rs6000_frame_base_sniffer);
       break;
     default:
-      set_gdbarch_deprecated_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
       set_gdbarch_believe_pcc_promotion (gdbarch, 1);
 
       set_gdbarch_unwind_pc (gdbarch, rs6000_unwind_pc);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 0f8f65d..fbaf567 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1803,10 +1803,10 @@
       /* If the next frame is a NORMAL_FRAME, this frame *cannot* have frame 
 	 size zero.  This is only possible if the next frame is a sentinel 
 	 frame, a dummy frame, or a signal trampoline frame.  */
-      if (get_frame_type (next_frame) == NORMAL_FRAME
-	  /* For some reason, sentinel frames are NORMAL_FRAMEs
-	     -- but they have negative frame level.  */
-	  && frame_relative_level (next_frame) >= 0)
+      /* FIXME: cagney/2004-05-01: This sanity check shouldn't be
+	 needed, instead the code should simpliy rely on its
+	 analysis.  */
+      if (get_frame_type (next_frame) == NORMAL_FRAME)
 	return 0;
 
       /* If we really have a frameless function, %r14 must be valid
@@ -1850,9 +1850,9 @@
      treat it as frameless if we're currently within the function epilog 
      code at a point where the frame pointer has already been restored.  
      This can only happen in an innermost frame.  */
-  if (size > 0
-      && (get_frame_type (next_frame) != NORMAL_FRAME
-	  || frame_relative_level (next_frame) < 0))
+  /* FIXME: cagney/2004-05-01: This sanity check shouldn't be needed,
+     instead the code should simpliy rely on its analysis.  */
+  if (size > 0 && get_frame_type (next_frame) != NORMAL_FRAME)
     {
       /* See the comment in s390_in_function_epilogue_p on why this is
 	 not completely reliable ...  */
@@ -2153,7 +2153,7 @@
 	ucontext (contains sigregs at offset 5 words)  */
   if (next_ra == next_cfa)
     {
-      sigreg_ptr = next_cfa + 8 + 128 + 5*word_size;
+      sigreg_ptr = next_cfa + 8 + 128 + align_up (5*word_size, 8);
     }
 
   /* Old-style RT frame and all non-RT frames:
@@ -2565,7 +2565,7 @@
    Our caller has taken care of any type promotions needed to satisfy
    prototypes or the old K&R argument-passing rules.  */
 static CORE_ADDR
-s390_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 		      struct regcache *regcache, CORE_ADDR bp_addr,
 		      int nargs, struct value **args, CORE_ADDR sp,
 		      int struct_return, CORE_ADDR struct_addr)
diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c
index 872dcaf..665ac1b 100644
--- a/gdb/scm-lang.c
+++ b/gdb/scm-lang.c
@@ -253,6 +253,7 @@
   &exp_descriptor_scm,
   scm_parse,
   c_error,
+  null_post_parser,
   scm_printchar,		/* Print a character constant */
   scm_printstr,			/* Function to print string constant */
   NULL,				/* Function to print a single character */
@@ -265,6 +266,7 @@
   basic_lookup_symbol_nonlocal,	/* lookup_symbol_nonlocal */
   basic_lookup_transparent_type,/* lookup_transparent_type */
   NULL,				/* Language specific symbol demangler */
+  NULL,				/* Language specific class_name_from_physname */
   {"", "", "", ""},		/* Binary format info */
   {"#o%lo", "#o", "o", ""},	/* Octal format info */
   {"%ld", "", "d", ""},		/* Decimal format info */
diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c
index 94c1ee3..f1e5c7f 100644
--- a/gdb/sentinel-frame.c
+++ b/gdb/sentinel-frame.c
@@ -83,8 +83,7 @@
 
 const struct frame_unwind sentinel_frame_unwinder =
 {
-  /* Should the sentinel frame be given a special type?  */
-  NORMAL_FRAME,
+  SENTINEL_FRAME,
   sentinel_frame_this_id,
   sentinel_frame_prev_register
 };
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index a9a8714..de8c428 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -44,12 +44,11 @@
 
 static int net_open (struct serial *scb, const char *name);
 static void net_close (struct serial *scb);
-extern int (*ui_loop_hook) (int);
 void _initialize_ser_tcp (void);
 
 /* seconds to wait for connect */
 #define TIMEOUT 15
-/* how many times per second to poll ui_loop_hook */
+/* how many times per second to poll deprecated_ui_loop_hook */
 #define POLL_INTERVAL 2
 
 /* Open a tcp socket */
@@ -133,9 +132,9 @@
 	  /* While we wait for the connect to complete 
 	     poll the UI so it can update or the user can 
 	     interrupt. */
-	  if (ui_loop_hook)
+	  if (deprecated_ui_loop_hook)
 	    {
-	      if (ui_loop_hook (0))
+	      if (deprecated_ui_loop_hook (0))
 		{
 		  errno = EINTR;
 		  net_close (scb);
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c
index 38b6716..6f64f41 100644
--- a/gdb/ser-unix.c
+++ b/gdb/ser-unix.c
@@ -99,8 +99,6 @@
 
 void _initialize_ser_hardwire (void);
 
-extern int (*ui_loop_hook) (int);
-
 /* Open up a real live device for serial I/O */
 
 static int
@@ -580,11 +578,12 @@
       /* N.B. The UI may destroy our world (for instance by calling
          remote_stop,) in which case we want to get out of here as
          quickly as possible.  It is not safe to touch scb, since
-         someone else might have freed it.  The ui_loop_hook signals that 
-         we should exit by returning 1. */
+         someone else might have freed it.  The
+         deprecated_ui_loop_hook signals that we should exit by
+         returning 1.  */
 
-      if (ui_loop_hook)
-	detach = ui_loop_hook (0);
+      if (deprecated_ui_loop_hook)
+	detach = deprecated_ui_loop_hook (0);
 
       if (detach)
 	return SERIAL_TIMEOUT;
@@ -959,12 +958,13 @@
       /* N.B. The UI may destroy our world (for instance by calling
          remote_stop,) in which case we want to get out of here as
          quickly as possible.  It is not safe to touch scb, since
-         someone else might have freed it.  The ui_loop_hook signals that 
-         we should exit by returning 1. */
+         someone else might have freed it.  The
+         deprecated_ui_loop_hook signals that we should exit by
+         returning 1.  */
 
-      if (ui_loop_hook)
+      if (deprecated_ui_loop_hook)
 	{
-	  if (ui_loop_hook (0))
+	  if (deprecated_ui_loop_hook (0))
 	    return SERIAL_TIMEOUT;
 	}
 
diff --git a/gdb/serial.c b/gdb/serial.c
index ada5631..72f02be 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -394,7 +394,7 @@
   char *buf;
   va_start (args, format);
 
-  xvasprintf (&buf, format, args);
+  buf = xstrvprintf (format, args);
   serial_write (desc, buf, strlen (buf));
 
   xfree (buf);
diff --git a/gdb/serial.h b/gdb/serial.h
index 7495b70..abe76b0 100644
--- a/gdb/serial.h
+++ b/gdb/serial.h
@@ -62,8 +62,9 @@
 enum serial_rc {
   SERIAL_ERROR = -1,	/* General error. */
   SERIAL_TIMEOUT = -2,	/* Timeout or data-not-ready during read.
-			   Unfortunately, through ui_loop_hook(), this
-			   can also be a QUIT indication.  */
+			   Unfortunately, through
+			   deprecated_ui_loop_hook(), this can also be
+			   a QUIT indication.  */
   SERIAL_EOF = -3	/* General end-of-file or remote target
 			   connection closed, indication.  Includes
 			   things like the line dropping dead. */
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 45833fc..86380ce 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -885,7 +885,7 @@
 
 static CORE_ADDR
 sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
-			CORE_ADDR func_addr,
+			struct value *function,
 			struct regcache *regcache,
 			CORE_ADDR bp_addr, int nargs,
 			struct value **args,
@@ -997,7 +997,7 @@
 
 static CORE_ADDR
 sh_push_dummy_call_nofpu (struct gdbarch *gdbarch,
-			  CORE_ADDR func_addr,
+			  struct value *function,
 			  struct regcache *regcache,
 			  CORE_ADDR bp_addr,
 			  int nargs, struct value **args,
@@ -1147,7 +1147,11 @@
       int len = TYPE_LENGTH (type);
       int i, regnum = FP0_REGNUM;
       for (i = 0; i < len; i += 4)
-	regcache_raw_write (regcache, regnum++, (char *) valbuf + i);
+	if (TARGET_BYTE_ORDER == BFD_ENDIAN_LITTLE)
+	  regcache_raw_write (regcache, regnum++,
+			      (char *) valbuf + len - 4 - i);
+	else
+	  regcache_raw_write (regcache, regnum++, (char *) valbuf + i);
     }
   else
     sh_default_store_return_value (type, regcache, valbuf);
@@ -2211,7 +2215,7 @@
   set_gdbarch_print_registers_info (gdbarch, sh_print_registers_info);
 
   set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc);
-  set_gdbarch_use_struct_convention (gdbarch, sh_use_struct_convention);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, sh_use_struct_convention);
 
   set_gdbarch_print_insn (gdbarch, gdb_print_insn_sh);
   set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno);
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index 1d7b313..5809a01 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -736,12 +736,9 @@
 static CORE_ADDR
 sh64_frame_chain (struct frame_info *frame)
 {
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
-				   get_frame_base (frame),
-				   get_frame_base (frame)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
     return get_frame_base (frame);    /* dummy frame same as caller's frame */
-  if (get_frame_pc (frame)
-      && !deprecated_inside_entry_file (get_frame_pc (frame)))
+  if (get_frame_pc (frame))
     {
       int media_mode = pc_is_isa32 (get_frame_pc (frame));
       int size;
@@ -765,8 +762,7 @@
   int media_mode = 0;
 
   for (; fi; fi = get_next_frame (fi))
-    if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				     get_frame_base (fi)))
+    if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
       /* When the caller requests PR from the dummy frame, we return
          PC because that's where the previous routine appears to have
          done a call from.  */
@@ -1215,8 +1211,7 @@
   if (get_next_frame (fi)) 
     deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				   get_frame_base (fi)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
     {
       /* We need to setup fi->frame here because call_function_by_hand
          gets it wrong by assuming it's always FP.  */
@@ -1224,7 +1219,7 @@
       get_frame_extra_info (fi)->return_pc = 
 	deprecated_read_register_dummy (get_frame_pc (fi),
 					get_frame_base (fi), PC_REGNUM);
-      get_frame_extra_info (fi)->f_offset = -(DEPRECATED_CALL_DUMMY_LENGTH + 4);
+      get_frame_extra_info (fi)->f_offset = -4;
       get_frame_extra_info (fi)->leaf_function = 0;
       return;
     }
@@ -1273,9 +1268,7 @@
 
   while (frame && ((frame = get_next_frame (frame)) != NULL))
     {
-      if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
-				       get_frame_base (frame),
-				       get_frame_base (frame)))
+      if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
 	{
 	  if (lval)		/* found it in a CALL_DUMMY frame */
 	    *lval = not_lval;
@@ -1370,9 +1363,7 @@
 
   int media_mode = pc_is_isa32 (get_frame_pc (frame));
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
-				   get_frame_base (frame),
-				   get_frame_base (frame)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
     deprecated_pop_dummy_frame ();
   else
     {
@@ -2794,7 +2785,6 @@
 struct gdbarch *
 sh64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
-  static LONGEST sh64_call_dummy_words[] = {0};
   struct gdbarch *gdbarch;
   struct gdbarch_tdep *tdep;
 
@@ -2875,8 +2865,6 @@
   set_gdbarch_deprecated_do_registers_info (gdbarch, sh64_do_registers_info);
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sh64_nofp_frame_init_saved_regs);
   set_gdbarch_breakpoint_from_pc (gdbarch, sh64_breakpoint_from_pc);
-  set_gdbarch_deprecated_call_dummy_words (gdbarch, sh64_call_dummy_words);
-  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (sh64_call_dummy_words));
 
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh64_init_extra_frame_info);
   set_gdbarch_deprecated_frame_chain (gdbarch, sh64_frame_chain);
@@ -2887,7 +2875,7 @@
   set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
   set_gdbarch_deprecated_store_struct_return (gdbarch, sh64_store_struct_return);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address);
-  set_gdbarch_use_struct_convention (gdbarch, sh64_use_struct_convention);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, sh64_use_struct_convention);
   set_gdbarch_deprecated_pop_frame (gdbarch, sh64_pop_frame);
   set_gdbarch_elf_make_msymbol_special (gdbarch,
 					sh64_elf_make_msymbol_special);
diff --git a/gdb/shnbsd-tdep.c b/gdb/shnbsd-tdep.c
index 2b731ce..ce67c7f 100644
--- a/gdb/shnbsd-tdep.c
+++ b/gdb/shnbsd-tdep.c
@@ -166,19 +166,10 @@
   NULL					/* next */
 };
 
-static int
-shnbsd_pc_in_sigtramp (CORE_ADDR pc, char *func_name)
-{
-  /* FIXME: Need to add support for kernel-provided signal trampolines.  */
-  return (nbsd_pc_in_sigtramp (pc, func_name));
-}
-
 static void
 shnbsd_init_abi (struct gdbarch_info info,
                   struct gdbarch *gdbarch)
 {
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, shnbsd_pc_in_sigtramp);
-
   set_solib_svr4_fetch_link_map_offsets (gdbarch,
 		                nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
 }
@@ -186,8 +177,8 @@
 void
 _initialize_shnbsd_tdep (void)
 {
-  add_core_fns (&shnbsd_core_fns);
-  add_core_fns (&shnbsd_elfcore_fns);
+  deprecated_add_core_fns (&shnbsd_core_fns);
+  deprecated_add_core_fns (&shnbsd_elfcore_fns);
 
   gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_NETBSD_ELF,
 			  shnbsd_init_abi);
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 3ac2a34..2279b44 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -1,5 +1,6 @@
-/* Low level interface for debugging Solaris threads for GDB, the GNU debugger.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+/* Solaris threads debugging interface.
+
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -20,32 +21,35 @@
    Boston, MA 02111-1307, USA.  */
 
 /* This module implements a sort of half target that sits between the
-   machine-independent parts of GDB and the /proc interface (procfs.c) to
-   provide access to the Solaris user-mode thread implementation.
+   machine-independent parts of GDB and the /proc interface (procfs.c)
+   to provide access to the Solaris user-mode thread implementation.
 
-   Solaris threads are true user-mode threads, which are invoked via the thr_*
-   and pthread_* (native and Posix respectivly) interfaces.  These are mostly
-   implemented in user-space, with all thread context kept in various
-   structures that live in the user's heap.  These should not be confused with
-   lightweight processes (LWPs), which are implemented by the kernel, and
-   scheduled without explicit intervention by the process.
+   Solaris threads are true user-mode threads, which are invoked via
+   the thr_* and pthread_* (native and POSIX respectivly) interfaces.
+   These are mostly implemented in user-space, with all thread context
+   kept in various structures that live in the user's heap.  These
+   should not be confused with lightweight processes (LWPs), which are
+   implemented by the kernel, and scheduled without explicit
+   intervention by the process.
 
-   Just to confuse things a little, Solaris threads (both native and Posix) are
-   actually implemented using LWPs.  In general, there are going to be more
-   threads than LWPs.  There is no fixed correspondence between a thread and an
-   LWP.  When a thread wants to run, it gets scheduled onto the first available
-   LWP and can therefore migrate from one LWP to another as time goes on.  A
+   Just to confuse things a little, Solaris threads (both native and
+   POSIX) are actually implemented using LWPs.  In general, there are
+   going to be more threads than LWPs.  There is no fixed
+   correspondence between a thread and an LWP.  When a thread wants to
+   run, it gets scheduled onto the first available LWP and can
+   therefore migrate from one LWP to another as time goes on.  A
    sleeping thread may not be associated with an LWP at all!
 
-   To make it possible to mess with threads, Sun provides a library called
-   libthread_db.so.1 (not to be confused with libthread_db.so.0, which doesn't
-   have a published interface).  This interface has an upper part, which it
-   provides, and a lower part which I provide.  The upper part consists of the
-   td_* routines, which allow me to find all the threads, query their state,
-   etc...  The lower part consists of all of the ps_*, which are used by the
-   td_* routines to read/write memory, manipulate LWPs, lookup symbols, etc...
-   The ps_* routines actually do most of their work by calling functions in
-   procfs.c.  */
+   To make it possible to mess with threads, Sun provides a library
+   called libthread_db.so.1 (not to be confused with
+   libthread_db.so.0, which doesn't have a published interface).  This
+   interface has an upper part, which it provides, and a lower part
+   which we provide.  The upper part consists of the td_* routines,
+   which allow us to find all the threads, query their state, etc...
+   The lower part consists of all of the ps_*, which are used by the
+   td_* routines to read/write memory, manipulate LWPs, lookup
+   symbols, etc...  The ps_* routines actually do most of their work
+   by calling functions in procfs.c.  */
 
 #include "defs.h"
 #include <thread.h>
@@ -81,38 +85,34 @@
 /* Prototypes for supply_gregset etc. */
 #include "gregset.h"
 
-/* This struct is defined by us, but mainly used for the proc_service interface.
-   We don't have much use for it, except as a handy place to get a real pid
-   for memory accesses.  */
+/* This struct is defined by us, but mainly used for the proc_service
+   interface.  We don't have much use for it, except as a handy place
+   to get a real PID for memory accesses.  */
 
 struct ps_prochandle
-  {
-    ptid_t ptid;
-  };
+{
+  ptid_t ptid;
+};
 
 struct string_map
-  {
-    int num;
-    char *str;
-  };
+{
+  int num;
+  char *str;
+};
 
 static struct ps_prochandle main_ph;
 static td_thragent_t *main_ta;
 static int sol_thread_active = 0;
 
-static char *td_err_string (td_err_e errcode);
-static char *td_state_string (td_thr_state_e statecode);
-static ptid_t thread_to_lwp (ptid_t thread_id, int default_lwp);
 static void sol_thread_resume (ptid_t ptid, int step, enum target_signal signo);
-static ptid_t lwp_to_thread (ptid_t lwp);
 static int sol_thread_alive (ptid_t ptid);
 static void sol_core_close (int quitting);
 
 static void init_sol_thread_ops (void);
 static void init_sol_core_ops (void);
 
-/* Default definitions: These must be defined in tm.h
-   if they are to be shared with a process module such as procfs.  */
+/* Default definitions: These must be defined in tm.h if they are to
+   be shared with a process module such as procfs.  */
 
 #define GET_PID(ptid)		ptid_get_pid (ptid)
 #define GET_LWP(ptid)		ptid_get_lwp (ptid)
@@ -124,105 +124,87 @@
 #define BUILD_LWP(lwp, pid)	ptid_build (pid, lwp, 0)
 #define BUILD_THREAD(tid, pid)	ptid_build (pid, 0, tid)
 
-/* Pointers to routines from lithread_db resolved by dlopen() */
+/* Pointers to routines from libthread_db resolved by dlopen().  */
 
-static void     (*p_td_log)               (const int on_off);
-static td_err_e (*p_td_ta_new)            (const struct ps_prochandle * ph_p,
-					   td_thragent_t ** ta_pp);
-static td_err_e (*p_td_ta_delete)         (td_thragent_t * ta_p);
-static td_err_e (*p_td_init)              (void);
-static td_err_e (*p_td_ta_get_ph)         (const td_thragent_t * ta_p,
-					   struct ps_prochandle ** ph_pp);
-static td_err_e (*p_td_ta_get_nthreads)   (const td_thragent_t * ta_p,
-					   int *nthread_p);
-static td_err_e (*p_td_ta_tsd_iter)       (const td_thragent_t * ta_p,
-					   td_key_iter_f * cb,
-					   void *cbdata_p);
-static td_err_e (*p_td_ta_thr_iter)       (const td_thragent_t * ta_p,
-					   td_thr_iter_f * cb,
-					   void *cbdata_p,
-					   td_thr_state_e state,
-					   int ti_pri,
-					   sigset_t * ti_sigmask_p,
-					   unsigned ti_user_flags);
-static td_err_e (*p_td_thr_validate)      (const td_thrhandle_t * th_p);
-static td_err_e (*p_td_thr_tsd)           (const td_thrhandle_t * th_p,
-					   const thread_key_t key,
-					   void **data_pp);
-static td_err_e (*p_td_thr_get_info)      (const td_thrhandle_t * th_p,
-					   td_thrinfo_t * ti_p);
-static td_err_e (*p_td_thr_getfpregs)     (const td_thrhandle_t * th_p,
-					   prfpregset_t * fpregset);
-static td_err_e (*p_td_thr_getxregsize)   (const td_thrhandle_t * th_p,
-					   int *xregsize);
-static td_err_e (*p_td_thr_getxregs)      (const td_thrhandle_t * th_p,
-					   const caddr_t xregset);
-static td_err_e (*p_td_thr_sigsetmask)    (const td_thrhandle_t * th_p,
-					   const sigset_t ti_sigmask);
-static td_err_e (*p_td_thr_setprio)       (const td_thrhandle_t * th_p,
-					   const int ti_pri);
-static td_err_e (*p_td_thr_setsigpending) (const td_thrhandle_t * th_p,
-					   const uchar_t ti_pending_flag,
-					   const sigset_t ti_pending);
-static td_err_e (*p_td_thr_setfpregs)     (const td_thrhandle_t * th_p,
-					   const prfpregset_t * fpregset);
-static td_err_e (*p_td_thr_setxregs)      (const td_thrhandle_t * th_p,
-					   const caddr_t xregset);
-static td_err_e (*p_td_ta_map_id2thr)     (const td_thragent_t * ta_p,
-					   thread_t tid,
-					   td_thrhandle_t * th_p);
-static td_err_e (*p_td_ta_map_lwp2thr)    (const td_thragent_t * ta_p,
-					   lwpid_t lwpid,
-					   td_thrhandle_t * th_p);
-static td_err_e (*p_td_thr_getgregs)      (const td_thrhandle_t * th_p,
-					   prgregset_t regset);
-static td_err_e (*p_td_thr_setgregs)      (const td_thrhandle_t * th_p,
-					   const prgregset_t regset);
+static void (*p_td_log)(const int on_off);
+static td_err_e (*p_td_ta_new)(const struct ps_prochandle *ph_p,
+			       td_thragent_t **ta_pp);
+static td_err_e (*p_td_ta_delete)(td_thragent_t *ta_p);
+static td_err_e (*p_td_init)(void);
+static td_err_e (*p_td_ta_get_ph)(const td_thragent_t *ta_p,
+				  struct ps_prochandle **ph_pp);
+static td_err_e (*p_td_ta_get_nthreads)(const td_thragent_t *ta_p,
+					int *nthread_p);
+static td_err_e (*p_td_ta_tsd_iter)(const td_thragent_t *ta_p,
+				    td_key_iter_f *cb, void *cbdata_p);
+static td_err_e (*p_td_ta_thr_iter)(const td_thragent_t *ta_p,
+				    td_thr_iter_f *cb, void *cbdata_p,
+				    td_thr_state_e state, int ti_pri,
+				    sigset_t *ti_sigmask_p,
+				    unsigned ti_user_flags);
+static td_err_e (*p_td_thr_validate)(const td_thrhandle_t *th_p);
+static td_err_e (*p_td_thr_tsd)(const td_thrhandle_t * th_p,
+				const thread_key_t key, void **data_pp);
+static td_err_e (*p_td_thr_get_info)(const td_thrhandle_t *th_p,
+				     td_thrinfo_t *ti_p);
+static td_err_e (*p_td_thr_getfpregs)(const td_thrhandle_t *th_p,
+				      prfpregset_t *fpregset);
+static td_err_e (*p_td_thr_getxregsize)(const td_thrhandle_t *th_p,
+					int *xregsize);
+static td_err_e (*p_td_thr_getxregs)(const td_thrhandle_t *th_p,
+				     const caddr_t xregset);
+static td_err_e (*p_td_thr_sigsetmask)(const td_thrhandle_t *th_p,
+				       const sigset_t ti_sigmask);
+static td_err_e (*p_td_thr_setprio)(const td_thrhandle_t *th_p,
+				    const int ti_pri);
+static td_err_e (*p_td_thr_setsigpending)(const td_thrhandle_t *th_p,
+					  const uchar_t ti_pending_flag,
+					  const sigset_t ti_pending);
+static td_err_e (*p_td_thr_setfpregs)(const td_thrhandle_t *th_p,
+				      const prfpregset_t *fpregset);
+static td_err_e (*p_td_thr_setxregs)(const td_thrhandle_t *th_p,
+				     const caddr_t xregset);
+static td_err_e (*p_td_ta_map_id2thr)(const td_thragent_t *ta_p,
+				      thread_t tid,
+				      td_thrhandle_t *th_p);
+static td_err_e (*p_td_ta_map_lwp2thr)(const td_thragent_t *ta_p,
+				       lwpid_t lwpid,
+				       td_thrhandle_t *th_p);
+static td_err_e (*p_td_thr_getgregs)(const td_thrhandle_t *th_p,
+				     prgregset_t regset);
+static td_err_e (*p_td_thr_setgregs)(const td_thrhandle_t *th_p,
+				     const prgregset_t regset);
+
 
-/*
-
-   LOCAL FUNCTION
-
-   td_err_string - Convert a thread_db error code to a string
-
-   SYNOPSIS
-
-   char * td_err_string (errcode)
-
-   DESCRIPTION
-
-   Return the thread_db error string associated with errcode.  If errcode
-   is unknown, then return a message.
-
- */
+/* Return the libthread_db error string associated with ERRCODE.  If
+   ERRCODE is unknown, return an appropriate message.  */
 
 static char *
 td_err_string (td_err_e errcode)
 {
-  static struct string_map
-    td_err_table[] =
+  static struct string_map td_err_table[] =
   {
-    {TD_OK, "generic \"call succeeded\""},
-    {TD_ERR, "generic error."},
-    {TD_NOTHR, "no thread can be found to satisfy query"},
-    {TD_NOSV, "no synch. variable can be found to satisfy query"},
-    {TD_NOLWP, "no lwp can be found to satisfy query"},
-    {TD_BADPH, "invalid process handle"},
-    {TD_BADTH, "invalid thread handle"},
-    {TD_BADSH, "invalid synchronization handle"},
-    {TD_BADTA, "invalid thread agent"},
-    {TD_BADKEY, "invalid key"},
-    {TD_NOMSG, "td_thr_event_getmsg() called when there was no message"},
-    {TD_NOFPREGS, "FPU register set not available for given thread"},
-    {TD_NOLIBTHREAD, "application not linked with libthread"},
-    {TD_NOEVENT, "requested event is not supported"},
-    {TD_NOCAPAB, "capability not available"},
-    {TD_DBERR, "Debugger service failed"},
-    {TD_NOAPLIC, "Operation not applicable to"},
-    {TD_NOTSD, "No thread specific data for this thread"},
-    {TD_MALLOC, "Malloc failed"},
-    {TD_PARTIALREG, "Only part of register set was written/read"},
-    {TD_NOXREGS, "X register set not available for given thread"}
+    { TD_OK, "generic \"call succeeded\"" },
+    { TD_ERR, "generic error." },
+    { TD_NOTHR, "no thread can be found to satisfy query" },
+    { TD_NOSV, "no synch. variable can be found to satisfy query" },
+    { TD_NOLWP, "no lwp can be found to satisfy query" },
+    { TD_BADPH, "invalid process handle" },
+    { TD_BADTH, "invalid thread handle" },
+    { TD_BADSH, "invalid synchronization handle" },
+    { TD_BADTA, "invalid thread agent" },
+    { TD_BADKEY, "invalid key" },
+    { TD_NOMSG, "td_thr_event_getmsg() called when there was no message" },
+    { TD_NOFPREGS, "FPU register set not available for given thread" },
+    { TD_NOLIBTHREAD, "application not linked with libthread" },
+    { TD_NOEVENT, "requested event is not supported" },
+    { TD_NOCAPAB, "capability not available" },
+    { TD_DBERR, "Debugger service failed" },
+    { TD_NOAPLIC, "Operation not applicable to" },
+    { TD_NOTSD, "No thread specific data for this thread" },
+    { TD_MALLOC, "Malloc failed" },
+    { TD_PARTIALREG, "Only part of register set was written/read" },
+    { TD_NOXREGS, "X register set not available for given thread" }
   };
   const int td_err_size = sizeof td_err_table / sizeof (struct string_map);
   int i;
@@ -232,44 +214,30 @@
     if (td_err_table[i].num == errcode)
       return td_err_table[i].str;
 
-  sprintf (buf, "Unknown thread_db error code: %d", errcode);
+  sprintf (buf, "Unknown libthread_db error code: %d", errcode);
 
   return buf;
 }
-
-/*
 
-   LOCAL FUNCTION
-
-   td_state_string - Convert a thread_db state code to a string
-
-   SYNOPSIS
-
-   char * td_state_string (statecode)
-
-   DESCRIPTION
-
-   Return the thread_db state string associated with statecode.  If
-   statecode is unknown, then return a message.
-
- */
+/* Return the the libthread_db state string assicoated with STATECODE.
+   If STATECODE is unknown, return an appropriate message.  */
 
 static char *
 td_state_string (td_thr_state_e statecode)
 {
-  static struct string_map
-    td_thr_state_table[] =
+  static struct string_map td_thr_state_table[] =
   {
-    {TD_THR_ANY_STATE, "any state"},
-    {TD_THR_UNKNOWN, "unknown"},
-    {TD_THR_STOPPED, "stopped"},
-    {TD_THR_RUN, "run"},
-    {TD_THR_ACTIVE, "active"},
-    {TD_THR_ZOMBIE, "zombie"},
-    {TD_THR_SLEEP, "sleep"},
-    {TD_THR_STOPPED_ASLEEP, "stopped asleep"}
+    { TD_THR_ANY_STATE, "any state" },
+    { TD_THR_UNKNOWN, "unknown" },
+    { TD_THR_STOPPED, "stopped" },
+    { TD_THR_RUN, "run" },
+    { TD_THR_ACTIVE, "active" },
+    { TD_THR_ZOMBIE, "zombie" },
+    { TD_THR_SLEEP, "sleep" },
+    { TD_THR_STOPPED_ASLEEP, "stopped asleep" }
   };
-  const int td_thr_state_table_size = sizeof td_thr_state_table / sizeof (struct string_map);
+  const int td_thr_state_table_size =
+    sizeof td_thr_state_table / sizeof (struct string_map);
   int i;
   static char buf[50];
 
@@ -277,32 +245,17 @@
     if (td_thr_state_table[i].num == statecode)
       return td_thr_state_table[i].str;
 
-  sprintf (buf, "Unknown thread_db state code: %d", statecode);
+  sprintf (buf, "Unknown libthread_db state code: %d", statecode);
 
   return buf;
 }
 
-/*
 
-   LOCAL FUNCTION
+/* Convert a POSIX or Solaris thread ID into a LWP ID.  If THREAD_ID
+   doesn't exist, that's an error.  If it's an inactive thread, return
+   DEFAULT_LPW.
 
-   thread_to_lwp - Convert a Posix or Solaris thread id to a LWP id.
-
-   SYNOPSIS
-
-   tpid_t thread_to_lwp (thread_id, default_lwp)
-
-   DESCRIPTION
-
-   This function converts a Posix or Solaris thread id to a lightweight
-   process id.  If thread_id is non-existent, that's an error.  If it's
-   an inactive thread, then we return default_lwp.
-
-   NOTES
-
-   This function probably shouldn't call error()...
-
- */
+   NOTE: This function probably shouldn't call error().  */
 
 static ptid_t
 thread_to_lwp (ptid_t thread_id, int default_lwp)
@@ -312,19 +265,19 @@
   td_err_e val;
 
   if (is_lwp (thread_id))
-    return thread_id;		/* It's already an LWP id */
+    return thread_id;		/* It's already an LWP ID.  */
 
-  /* It's a thread.  Convert to lwp */
+  /* It's a thread.  Convert to LWP.  */
 
   val = p_td_ta_map_id2thr (main_ta, GET_THREAD (thread_id), &th);
   if (val == TD_NOTHR)
-    return pid_to_ptid (-1);		/* thread must have terminated */
+    return pid_to_ptid (-1);	/* Thread must have terminated.  */
   else if (val != TD_OK)
     error ("thread_to_lwp: td_ta_map_id2thr %s", td_err_string (val));
 
   val = p_td_thr_get_info (&th, &ti);
   if (val == TD_NOTHR)
-    return pid_to_ptid (-1);		/* thread must have terminated */
+    return pid_to_ptid (-1);	/* Thread must have terminated.  */
   else if (val != TD_OK)
     error ("thread_to_lwp: td_thr_get_info: %s", td_err_string (val));
 
@@ -338,27 +291,11 @@
 
   return BUILD_LWP (ti.ti_lid, PIDGET (thread_id));
 }
-
-/*
 
-   LOCAL FUNCTION
+/* Convert an LWP ID into a POSIX or Solaris thread ID.  If LWP_ID
+   doesn't exists, that's an error.
 
-   lwp_to_thread - Convert a LWP id to a Posix or Solaris thread id.
-
-   SYNOPSIS
-
-   int lwp_to_thread (lwp_id)
-
-   DESCRIPTION
-
-   This function converts a lightweight process id to a Posix or Solaris
-   thread id.  If thread_id is non-existent, that's an error.
-
-   NOTES
-
-   This function probably shouldn't call error()...
-
- */
+   NOTE: This function probably shouldn't call error().  */
 
 static ptid_t
 lwp_to_thread (ptid_t lwp)
@@ -368,29 +305,28 @@
   td_err_e val;
 
   if (is_thread (lwp))
-    return lwp;			/* It's already a thread id */
+    return lwp;			/* It's already a thread ID.  */
 
-  /* It's an lwp.  Convert it to a thread id.  */
+  /* It's an LWP.  Convert it to a thread ID.  */
 
   if (!sol_thread_alive (lwp))
-    return pid_to_ptid (-1);	/* defunct lwp */
+    return pid_to_ptid (-1);	/* Must be a defunct LPW.  */
 
   val = p_td_ta_map_lwp2thr (main_ta, GET_LWP (lwp), &th);
   if (val == TD_NOTHR)
-    return pid_to_ptid (-1);	/* thread must have terminated */
+    return pid_to_ptid (-1);	/* Thread must have terminated.  */
   else if (val != TD_OK)
     error ("lwp_to_thread: td_ta_map_lwp2thr: %s.", td_err_string (val));
 
   val = p_td_thr_validate (&th);
   if (val == TD_NOTHR)
-    return lwp;			/* libthread doesn't know about it;
-				   just return lwp */
+    return lwp;			/* Unknown to libthread; just return LPW,  */
   else if (val != TD_OK)
     error ("lwp_to_thread: td_thr_validate: %s.", td_err_string (val));
 
   val = p_td_thr_get_info (&th, &ti);
   if (val == TD_NOTHR)
-    return pid_to_ptid (-1);	/* thread must have terminated */
+    return pid_to_ptid (-1);	/* Thread must have terminated.  */
   else if (val != TD_OK)
     error ("lwp_to_thread: td_thr_get_info: %s.", td_err_string (val));
 
@@ -398,8 +334,9 @@
 }
 
 
-/* Most target vector functions from here on actually just pass through to
-   procfs.c, as they don't need to do anything specific for threads.  */
+/* Most target vector functions from here on actually just pass
+   through to procfs.c, as they don't need to do anything specific for
+   threads.  */
 
 static void
 sol_thread_open (char *arg, int from_tty)
@@ -407,21 +344,21 @@
   procfs_ops.to_open (arg, from_tty);
 }
 
-/* Attach to process PID, then initialize for debugging it
-   and wait for the trace-trap that results from attaching.  */
+/* Attach to process PID, then initialize for debugging it and wait
+   for the trace-trap that results from attaching.  */
 
 static void
 sol_thread_attach (char *args, int from_tty)
 {
   procfs_ops.to_attach (args, from_tty);
 
-  /* Must get symbols from solibs before libthread_db can run! */
+  /* Must get symbols from shared libraries before libthread_db can run!  */
   SOLIB_ADD ((char *) 0, from_tty, (struct target_ops *) 0, auto_solib_add);
 
   if (sol_thread_active)
     {
       printf_filtered ("sol-thread active.\n");
-      main_ph.ptid = inferior_ptid;		/* Save for xfer_memory */
+      main_ph.ptid = inferior_ptid; /* Save for xfer_memory.  */
       push_target (&sol_thread_ops);
       inferior_ptid = lwp_to_thread (inferior_ptid);
       if (PIDGET (inferior_ptid) == -1)
@@ -429,16 +366,17 @@
       else
 	add_thread (inferior_ptid);
     }
-  /* XXX - might want to iterate over all the threads and register them. */
+
+  /* FIXME: Might want to iterate over all the threads and register
+     them.  */
 }
 
-/* Take a program previously attached to and detaches it.
-   The program resumes execution and will no longer stop
-   on signals, etc.  We'd better not have left any breakpoints
-   in the program or it'll die when it hits one.  For this
-   to work, it may be necessary for the process to have been
-   previously attached.  It *might* work if the program was
-   started via the normal ptrace (PTRACE_TRACEME).  */
+/* Take a program previously attached to and detaches it.  The program
+   resumes execution and will no longer stop on signals, etc.  We'd
+   better not have left any breakpoints in the program or it'll die
+   when it hits one.  For this to work, it may be necessary for the
+   process to have been previously attached.  It *might* work if the
+   program was started via the normal ptrace (PTRACE_TRACEME).  */
 
 static void
 sol_thread_detach (char *args, int from_tty)
@@ -448,10 +386,10 @@
   procfs_ops.to_detach (args, from_tty);
 }
 
-/* Resume execution of process PID.  If STEP is nozero, then
-   just single step it.  If SIGNAL is nonzero, restart it with that
-   signal activated.  We may have to convert pid from a thread-id to an LWP id
-   for procfs.  */
+/* Resume execution of process PTID.  If STEP is nozero, then just
+   single step it.  If SIGNAL is nonzero, restart it with that signal
+   activated.  We may have to convert PTID from a thread ID to an LWP
+   ID for procfs.  */
 
 static void
 sol_thread_resume (ptid_t ptid, int step, enum target_signal signo)
@@ -469,7 +407,7 @@
       ptid_t save_ptid = ptid;
 
       ptid = thread_to_lwp (ptid, -2);
-      if (PIDGET (ptid) == -2)		/* Inactive thread */
+      if (PIDGET (ptid) == -2)		/* Inactive thread.  */
 	error ("This version of Solaris can't start inactive threads.");
       if (info_verbose && PIDGET (ptid) == -1)
 	warning ("Specified thread %ld seems to have terminated",
@@ -481,8 +419,8 @@
   do_cleanups (old_chain);
 }
 
-/* Wait for any threads to stop.  We may have to convert PID from a thread id
-   to a LWP id, and vice versa on the way out.  */
+/* Wait for any threads to stop.  We may have to convert PIID from a
+   thread ID to an LWP ID, and vice versa on the way out.  */
 
 static ptid_t
 sol_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
@@ -503,7 +441,7 @@
       ptid_t save_ptid = ptid;
 
       ptid = thread_to_lwp (ptid, -2);
-      if (PIDGET (ptid) == -2)		/* Inactive thread */
+      if (PIDGET (ptid) == -2)		/* Inactive thread.  */
 	error ("This version of Solaris can't start inactive threads.");
       if (info_verbose && PIDGET (ptid) == -1)
 	warning ("Specified thread %ld seems to have terminated",
@@ -514,12 +452,12 @@
 
   if (ourstatus->kind != TARGET_WAITKIND_EXITED)
     {
-      /* Map the LWP of interest back to the appropriate thread ID */
+      /* Map the LWP of interest back to the appropriate thread ID.  */
       rtnval = lwp_to_thread (rtnval);
       if (PIDGET (rtnval) == -1)
 	rtnval = save_ptid;
 
-      /* See if we have a new thread */
+      /* See if we have a new thread.  */
       if (is_thread (rtnval)
 	  && !ptid_equal (rtnval, save_ptid)
 	  && !in_thread_list (rtnval))
@@ -529,9 +467,9 @@
 	}
     }
 
-  /* During process initialization, we may get here without the thread package
-     being initialized, since that can only happen after we've found the shared
-     libs.  */
+  /* During process initialization, we may get here without the thread
+     package being initialized, since that can only happen after we've
+     found the shared libs.  */
 
   do_cleanups (old_chain);
 
@@ -539,7 +477,7 @@
 }
 
 static void
-sol_thread_fetch_registers (int regno)
+sol_thread_fetch_registers (int regnum)
 {
   thread_t thread;
   td_thrhandle_t thandle;
@@ -552,54 +490,51 @@
 #endif
 
   if (!is_thread (inferior_ptid))
-    {				/* LWP: pass the request on to procfs.c */
+    {
+      /* It's an LWP; pass the request on to procfs.  */
       if (target_has_execution)
-	procfs_ops.to_fetch_registers (regno);
+	procfs_ops.to_fetch_registers (regnum);
       else
-	orig_core_ops.to_fetch_registers (regno);
+	orig_core_ops.to_fetch_registers (regnum);
       return;
     }
 
-  /* Solaris thread: convert inferior_ptid into a td_thrhandle_t */
-
+  /* Solaris thread: convert INFERIOR_PTID into a td_thrhandle_t.  */
   thread = GET_THREAD (inferior_ptid);
-
   if (thread == 0)
-    error ("sol_thread_fetch_registers:  thread == 0");
+    error ("sol_thread_fetch_registers: thread == 0");
 
   val = p_td_ta_map_id2thr (main_ta, thread, &thandle);
   if (val != TD_OK)
     error ("sol_thread_fetch_registers: td_ta_map_id2thr: %s",
 	   td_err_string (val));
 
-  /* Get the integer regs */
+  /* Get the general-purpose registers.  */
 
   val = p_td_thr_getgregs (&thandle, gregset);
-  if (val != TD_OK
-      && val != TD_PARTIALREG)
+  if (val != TD_OK && val != TD_PARTIALREG)
     error ("sol_thread_fetch_registers: td_thr_getgregs %s",
 	   td_err_string (val));
 
-  /* For the sparc, TD_PARTIALREG means that only i0->i7, l0->l7, pc and sp
-     are saved (by a thread context switch).  */
+  /* For SPARC, TD_PARTIALREG means that only %i0...%i7, %l0..%l7, %pc
+     and %sp are saved (by a thread context switch).  */
 
-  /* And, now the fp regs */
+  /* And, now the floating-point registers.  */
 
   val = p_td_thr_getfpregs (&thandle, &fpregset);
-  if (val != TD_OK
-      && val != TD_NOFPREGS)
+  if (val != TD_OK && val != TD_NOFPREGS)
     error ("sol_thread_fetch_registers: td_thr_getfpregs %s",
 	   td_err_string (val));
 
-/* Note that we must call supply_{g fp}regset *after* calling the td routines
-   because the td routines call ps_lget* which affect the values stored in the
-   registers array.  */
+  /* Note that we must call supply_gregset and supply_fpregset *after*
+     calling the td routines because the td routines call ps_lget*
+     which affect the values stored in the registers array.  */
 
-  supply_gregset  ((gdb_gregset_t *)  &gregset);
+  supply_gregset ((gdb_gregset_t *) &gregset);
   supply_fpregset ((gdb_fpregset_t *) &fpregset);
 
 #if 0
-/* thread_db doesn't seem to handle this right */
+  /* FIXME: libthread_db doesn't seem to handle this right.  */
   val = td_thr_getxregsize (&thandle, &xregsize);
   if (val != TD_OK && val != TD_NOXREGS)
     error ("sol_thread_fetch_registers: td_thr_getxregsize %s",
@@ -617,12 +552,12 @@
 }
 
 static void
-sol_thread_store_registers (int regno)
+sol_thread_store_registers (int regnum)
 {
   thread_t thread;
   td_thrhandle_t thandle;
   td_err_e val;
-  prgregset_t  gregset;
+  prgregset_t gregset;
   prfpregset_t fpregset;
 #if 0
   int xregsize;
@@ -630,13 +565,13 @@
 #endif
 
   if (!is_thread (inferior_ptid))
-    {				/* LWP: pass the request on to procfs.c */
-      procfs_ops.to_store_registers (regno);
+    {
+      /* It's an LWP; pass the request on to procfs.c.  */
+      procfs_ops.to_store_registers (regnum);
       return;
     }
 
-  /* Solaris thread: convert inferior_ptid into a td_thrhandle_t */
-
+  /* Solaris thread: convert INFERIOR_PTID into a td_thrhandle_t.  */
   thread = GET_THREAD (inferior_ptid);
 
   val = p_td_ta_map_id2thr (main_ta, thread, &thandle);
@@ -644,12 +579,13 @@
     error ("sol_thread_store_registers: td_ta_map_id2thr %s",
 	   td_err_string (val));
 
-  if (regno != -1)
-    {				/* Not writing all the regs */
+  if (regnum != -1)
+    {
+      /* Not writing all the registers.  */
       char old_value[MAX_REGISTER_SIZE];
 
       /* Save new register value.  */
-      regcache_collect (regno, old_value);
+      regcache_collect (regnum, old_value);
 
       val = p_td_thr_getgregs (&thandle, gregset);
       if (val != TD_OK)
@@ -661,10 +597,10 @@
 	       td_err_string (val));
 
       /* Restore new register value.  */
-      supply_register (regno, old_value);
+      supply_register (regnum, old_value);
 
 #if 0
-/* thread_db doesn't seem to handle this right */
+      /* FIXME: libthread_db doesn't seem to handle this right.  */
       val = td_thr_getxregsize (&thandle, &xregsize);
       if (val != TD_OK && val != TD_NOXREGS)
 	error ("sol_thread_store_registers: td_thr_getxregsize %s",
@@ -681,8 +617,8 @@
 #endif
     }
 
-  fill_gregset  ((gdb_gregset_t *)  &gregset,  regno);
-  fill_fpregset ((gdb_fpregset_t *) &fpregset, regno);
+  fill_gregset ((gdb_gregset_t *) &gregset, regnum);
+  fill_fpregset ((gdb_fpregset_t *) &fpregset, regnum);
 
   val = p_td_thr_setgregs (&thandle, gregset);
   if (val != TD_OK)
@@ -694,22 +630,22 @@
 	   td_err_string (val));
 
 #if 0
-/* thread_db doesn't seem to handle this right */
+  /* FIXME: libthread_db doesn't seem to handle this right.  */
   val = td_thr_getxregsize (&thandle, &xregsize);
   if (val != TD_OK && val != TD_NOXREGS)
     error ("sol_thread_store_registers: td_thr_getxregsize %s",
 	   td_err_string (val));
 
-  /* Should probably do something about writing the xregs here, but what are
-     they? */
+  /* ??? Should probably do something about writing the xregs here,
+     but what are they?  */
 #endif
 }
 
 /* Get ready to modify the registers array.  On machines which store
-   individual registers, this doesn't need to do anything.  On machines
-   which store all the registers in one fell swoop, this makes sure
-   that registers contains all the registers from the program being
-   debugged.  */
+   individual registers, this doesn't need to do anything.  On
+   machines which store all the registers in one fell swoop, this
+   makes sure that registers contains all the registers from the
+   program being debugged.  */
 
 static void
 sol_thread_prepare_to_store (void)
@@ -721,7 +657,7 @@
    MEMADDR.  If DOWRITE is non-zero, transfer them to the target,
    otherwise transfer them from the target.  TARGET is unused.
 
-   Returns the number of bytes transferred. */
+   Returns the number of bytes transferred.  */
 
 static int
 sol_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int dowrite,
@@ -733,10 +669,15 @@
 
   old_chain = save_inferior_ptid ();
 
-  if (is_thread (inferior_ptid) ||	/* A thread */
-      !target_thread_alive (inferior_ptid))	/* An lwp, but not alive */
-    inferior_ptid = procfs_first_available ();	/* Find any live lwp.  */
-  /* Note: don't need to call switch_to_thread; we're just reading memory.  */
+  if (is_thread (inferior_ptid) || !target_thread_alive (inferior_ptid))
+    {
+      /* It's either a thread or an LWP that isn't alive.  Any live
+         LWP will do so use the first available.
+
+	 NOTE: We don't need to call switch_to_thread; we're just
+	 reading memory.  */
+      inferior_ptid = procfs_first_available ();
+    }
 
   if (target_has_execution)
     retval = procfs_ops.to_xfer_memory (memaddr, myaddr, len,
@@ -750,9 +691,9 @@
   return retval;
 }
 
-/* Perform partial transfers on OBJECT.  See target_read_partial
-   and target_write_partial for details of each variant.  One, and
-   only one, of readbuf or writebuf must be non-NULL.  */
+/* Perform partial transfers on OBJECT.  See target_read_partial and
+   target_write_partial for details of each variant.  One, and only
+   one, of readbuf or writebuf must be non-NULL.  */
 
 static LONGEST
 sol_thread_xfer_partial (struct target_ops *ops, enum target_object object,
@@ -764,10 +705,15 @@
 
   old_chain = save_inferior_ptid ();
 
-  if (is_thread (inferior_ptid) ||	/* A thread */
-      !target_thread_alive (inferior_ptid))	/* An lwp, but not alive */
-    inferior_ptid = procfs_first_available ();	/* Find any live lwp.  */
-  /* Note: don't need to call switch_to_thread; we're just reading memory.  */
+  if (is_thread (inferior_ptid) || !target_thread_alive (inferior_ptid))
+    {
+      /* It's either a thread or an LWP that isn't alive.  Any live
+         LWP will do so use the first available.
+
+	 NOTE: We don't need to call switch_to_thread; we're just
+	 reading memory.  */
+      inferior_ptid = procfs_first_available ();
+    }
 
   if (target_has_execution)
     retval = procfs_ops.to_xfer_partial (ops, object, annex,
@@ -804,13 +750,15 @@
 /* Fork an inferior process, and start debugging it with /proc.  */
 
 static void
-sol_thread_create_inferior (char *exec_file, char *allargs, char **env)
+sol_thread_create_inferior (char *exec_file, char *allargs, char **env,
+			    int from_tty)
 {
-  procfs_ops.to_create_inferior (exec_file, allargs, env);
+  procfs_ops.to_create_inferior (exec_file, allargs, env, from_tty);
 
   if (sol_thread_active && !ptid_equal (inferior_ptid, null_ptid))
     {
-      main_ph.ptid = inferior_ptid;	/* Save for xfer_memory */
+      /* Save for xfer_memory.  */
+      main_ph.ptid = inferior_ptid;
 
       push_target (&sol_thread_ops);
 
@@ -823,15 +771,15 @@
     }
 }
 
-/* This routine is called whenever a new symbol table is read in, or when all
-   symbol tables are removed.  libthread_db can only be initialized when it
-   finds the right variables in libthread.so.  Since it's a shared library,
-   those variables don't show up until the library gets mapped and the symbol
-   table is read in.  */
+/* This routine is called whenever a new symbol table is read in, or
+   when all symbol tables are removed.  libthread_db can only be
+   initialized when it finds the right variables in libthread.so.
+   Since it's a shared library, those variables don't show up until
+   the library gets mapped and the symbol table is read in.
 
-/* This new_objfile event is now managed by a chained function pointer.
- * It is the callee's responsability to call the next client on the chain.
- */
+   This new_objfile event is managed by a chained function pointer.
+   It is the callee's responsability to call the next client on the
+   chain.  */
 
 /* Saved pointer to previous owner of the new_objfile event. */
 static void (*target_new_objfile_chain) (struct objfile *);
@@ -847,13 +795,14 @@
       goto quit;
     }
 
-  /* don't do anything if init failed to resolve the libthread_db library */
+  /* Don't do anything if init failed to resolve the libthread_db
+     library.  */
   if (!procfs_suppress_run)
     goto quit;
 
-  /* Now, initialize the thread debugging library.  This needs to be done after
-     the shared libraries are located because it needs information from the
-     user's thread library.  */
+  /* Now, initialize libthread_db.  This needs to be done after the
+     shared libraries are located because it needs information from
+     the user's thread library.  */
 
   val = p_td_init ();
   if (val != TD_OK)
@@ -872,8 +821,9 @@
     }
 
   sol_thread_active = 1;
+
 quit:
-  /* Call predecessor on chain, if any. */
+  /* Call predecessor on chain, if any.  */
   if (target_new_objfile_chain)
     target_new_objfile_chain (objfile);
 }
@@ -887,7 +837,8 @@
   procfs_ops.to_mourn_inferior ();
 }
 
-/* Mark our target-struct as eligible for stray "run" and "attach" commands.  */
+/* Mark our target-struct as eligible for stray "run" and "attach"
+   commands.  */
 
 static int
 sol_thread_can_run (void)
@@ -911,25 +862,28 @@
 
  */
 
+/* Return true if PTID is still active in the inferior.  */
+
 static int
 sol_thread_alive (ptid_t ptid)
 {
-  if (is_thread (ptid))		/* non-kernel thread */
+  if (is_thread (ptid))
     {
+      /* It's a (user-level) thread.  */
       td_err_e val;
       td_thrhandle_t th;
       int pid;
 
       pid = GET_THREAD (ptid);
       if ((val = p_td_ta_map_id2thr (main_ta, pid, &th)) != TD_OK)
-	return 0;		/* thread not found */
+	return 0;		/* Thread not found.  */
       if ((val = p_td_thr_validate (&th)) != TD_OK)
-	return 0;		/* thread not valid */
-      return 1;			/* known thread: return true */
+	return 0;		/* Thread not valid.  */
+      return 1;			/* Known thread.  */
     }
   else
-    /* kernel thread (LWP): let procfs test it */
     {
+      /* It's an LPW; pass the request on to procfs.  */
       if (target_has_execution)
 	return procfs_ops.to_thread_alive (ptid);
       else
@@ -943,23 +897,22 @@
   procfs_ops.to_stop ();
 }
 
-/* These routines implement the lower half of the thread_db interface.  Ie: the
-   ps_* routines.  */
+/* These routines implement the lower half of the thread_db interface,
+   i.e. the ps_* routines.  */
 
-/* Various versions of <proc_service.h> have slightly
-   different function prototypes.  In particular, we have
+/* Various versions of <proc_service.h> have slightly different
+   function prototypes.  In particular, we have
 
    NEWER                        OLDER
    struct ps_prochandle *       const struct ps_prochandle *
    void*                        char*
-   const void*          char*
-   int                  size_t
+   const void*          	char*
+   int                  	size_t
 
-   Which one you have depends on solaris version and what
-   patches you've applied.  On the theory that there are
-   only two major variants, we have configure check the
-   prototype of ps_pdwrite (), and use that info to make
-   appropriate typedefs here. */
+   Which one you have depends on the Solaris version and what patches
+   you've applied.  On the theory that there are only two major
+   variants, we have configure check the prototype of ps_pdwrite (),
+   and use that info to make appropriate typedefs here. */
 
 #ifdef PROC_SERVICE_IS_OLD
 typedef const struct ps_prochandle *gdb_ps_prochandle_t;
@@ -975,13 +928,12 @@
 typedef psaddr_t gdb_ps_addr_t;
 #endif
 
+/* The next four routines are called by libthread_db to tell us to
+   stop and stop a particular process or lwp.  Since GDB ensures that
+   these are all stopped by the time we call anything in thread_db,
+   these routines need to do nothing.  */
 
-/* The next four routines are called by thread_db to tell us to stop and stop
-   a particular process or lwp.  Since GDB ensures that these are all stopped
-   by the time we call anything in thread_db, these routines need to do
-   nothing.  */
-
-/* Process stop */
+/* Process stop.  */
 
 ps_err_e
 ps_pstop (gdb_ps_prochandle_t ph)
@@ -989,7 +941,7 @@
   return PS_OK;
 }
 
-/* Process continue */
+/* Process continue.  */
 
 ps_err_e
 ps_pcontinue (gdb_ps_prochandle_t ph)
@@ -997,7 +949,7 @@
   return PS_OK;
 }
 
-/* LWP stop */
+/* LWP stop.  */
 
 ps_err_e
 ps_lstop (gdb_ps_prochandle_t ph, lwpid_t lwpid)
@@ -1005,7 +957,7 @@
   return PS_OK;
 }
 
-/* LWP continue */
+/* LWP continue.  */
 
 ps_err_e
 ps_lcontinue (gdb_ps_prochandle_t ph, lwpid_t lwpid)
@@ -1017,17 +969,15 @@
 
 ps_err_e
 ps_pglobal_lookup (gdb_ps_prochandle_t ph, const char *ld_object_name,
-		   const char *ld_symbol_name, gdb_ps_addr_t * ld_symbol_addr)
+		   const char *ld_symbol_name, gdb_ps_addr_t *ld_symbol_addr)
 {
   struct minimal_symbol *ms;
 
   ms = lookup_minimal_symbol (ld_symbol_name, NULL, NULL);
-
   if (!ms)
     return PS_NOSYM;
 
   *ld_symbol_addr = SYMBOL_VALUE_ADDRESS (ms);
-
   return PS_OK;
 }
 
@@ -1041,10 +991,15 @@
 
   old_chain = save_inferior_ptid ();
 
-  if (is_thread (inferior_ptid) ||	/* A thread */
-      !target_thread_alive (inferior_ptid))	/* An lwp, but not alive */
-    inferior_ptid = procfs_first_available ();	/* Find any live lwp.  */
-  /* Note: don't need to call switch_to_thread; we're just reading memory.  */
+  if (is_thread (inferior_ptid) || !target_thread_alive (inferior_ptid))
+    {
+      /* It's either a thread or an LWP that isn't alive.  Any live
+         LWP will do so use the first available.
+
+	 NOTE: We don't need to call switch_to_thread; we're just
+	 reading memory.  */
+      inferior_ptid = procfs_first_available ();
+    }
 
 #if defined (__sparcv9)
   /* For Sparc64 cross Sparc32, make sure the address has not been
@@ -1135,11 +1090,10 @@
   return rw_common (1, ph, addr, (char *) buf, size);
 }
 
-/* Get integer regs for LWP */
+/* Get general-purpose registers for LWP.  */
 
 ps_err_e
-ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
-	     prgregset_t gregset)
+ps_lgetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid, prgregset_t gregset)
 {
   struct cleanup *old_chain;
 
@@ -1158,7 +1112,7 @@
   return PS_OK;
 }
 
-/* Set integer regs for LWP */
+/* Set general-purpose registers for LWP.  */
 
 ps_err_e
 ps_lsetregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
@@ -1184,7 +1138,7 @@
 /* Log a message (sends to gdb_stderr).  */
 
 void
-ps_plog (const char *fmt,...)
+ps_plog (const char *fmt, ...)
 {
   va_list args;
 
@@ -1267,11 +1221,11 @@
   return PS_OK;
 }
 
-/* Get floating-point regs for LWP */
+/* Get floating-point registers for LWP.  */
 
 ps_err_e
 ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
-	       prfpregset_t * fpregset)
+	       prfpregset_t *fpregset)
 {
   struct cleanup *old_chain;
 
@@ -1314,10 +1268,9 @@
 }
 
 #ifdef PR_MODEL_LP64
-/* Identify process as 32-bit or 64-bit.
-   At the moment I'm using bfd to do this.
-   There might be a more solaris-specific (eg. procfs) method,
-   but this ought to work.  */
+/* Identify process as 32-bit or 64-bit.  At the moment we're using
+   BFD to do this.  There might be a more Solaris-specific
+   (e.g. procfs) method, but this ought to work.  */
 
 ps_err_e
 ps_pdmodel (gdb_ps_prochandle_t ph, int *data_model)
@@ -1341,12 +1294,12 @@
 ps_lgetLDT (gdb_ps_prochandle_t ph, lwpid_t lwpid,
 	    struct ssd *pldt)
 {
-  /* NOTE: only used on Solaris, therefore OK to refer to procfs.c */
+  /* NOTE: only used on Solaris, therefore OK to refer to procfs.c.  */
   extern struct ssd *procfs_find_LDT_entry (ptid_t);
   struct ssd *ret;
 
-  /* FIXME: can't I get the process ID from the prochandle or something?
-   */
+  /* FIXME: can't I get the process ID from the prochandle or
+     something?  */
 
   if (PIDGET (inferior_ptid) <= 0 || lwpid <= 0)
     return PS_BADLID;
@@ -1357,19 +1310,21 @@
       memcpy (pldt, ret, sizeof (struct ssd));
       return PS_OK;
     }
-  else	/* LDT not found. */
+  else
+    /* LDT not found.  */
     return PS_ERR;
 }
 #endif /* TM_I386SOL2_H */
 
-/* Convert a pid to printable form. */
+
+/* Convert PTID to printable form.  */
 
 char *
 solaris_pid_to_str (ptid_t ptid)
 {
   static char buf[100];
 
-  /* in case init failed to resolve the libthread_db library */
+  /* In case init failed to resolve the libthread_db library.  */
   if (!procfs_suppress_run)
     return procfs_pid_to_str (ptid);
 
@@ -1382,7 +1337,8 @@
       if (PIDGET (lwp) == -1)
 	sprintf (buf, "Thread %ld (defunct)", GET_THREAD (ptid));
       else if (PIDGET (lwp) != -2)
-	sprintf (buf, "Thread %ld (LWP %ld)", GET_THREAD (ptid), GET_LWP (lwp));
+	sprintf (buf, "Thread %ld (LWP %ld)",
+		 GET_THREAD (ptid), GET_LWP (lwp));
       else
 	sprintf (buf, "Thread %ld        ", GET_THREAD (ptid));
     }
@@ -1395,9 +1351,8 @@
 }
 
 
-/* Worker bee for find_new_threads
-   Callback function that gets called once per USER thread (i.e., not
-   kernel) thread. */
+/* Worker bee for find_new_threads.  Callback function that gets
+   called once per user-level thread (i.e. not for LWP's).  */
 
 static int
 sol_find_new_threads_callback (const td_thrhandle_t *th, void *ignored)
@@ -1406,10 +1361,10 @@
   td_thrinfo_t ti;
   ptid_t ptid;
 
-  if ((retval = p_td_thr_get_info (th, &ti)) != TD_OK)
-    {
-      return -1;
-    }
+  retval = p_td_thr_get_info (th, &ti);
+  if (retval != TD_OK)
+    return -1;
+
   ptid = BUILD_THREAD (ti.ti_tid, PIDGET (inferior_ptid));
   if (!in_thread_list (ptid))
     add_thread (ptid);
@@ -1420,7 +1375,8 @@
 static void
 sol_find_new_threads (void)
 {
-  /* don't do anything if init failed to resolve the libthread_db library */
+  /* Don't do anything if init failed to resolve the libthread_db
+     library.  */
   if (!procfs_suppress_run)
     return;
 
@@ -1429,7 +1385,11 @@
       printf_filtered ("No process.\n");
       return;
     }
-  procfs_ops.to_find_new_threads ();	/* first find new kernel threads */
+
+  /* First Find any new LWP's.  */
+  procfs_ops.to_find_new_threads ();
+
+  /* Then find any new user-level threads.  */
   p_td_ta_thr_iter (main_ta, sol_find_new_threads_callback, (void *) 0,
 		    TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY,
 		    TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS);
@@ -1460,9 +1420,10 @@
   orig_core_ops.to_files_info (t);
 }
 
-/* Worker bee for info sol-thread command.  This is a callback function that
-   gets called once for each Solaris thread (ie. not kernel thread) in the
-   inferior.  Print anything interesting that we can think of.  */
+/* Worker bee for the "info sol-thread" command.  This is a callback
+   function that gets called once for each Solaris user-level thread
+   (i.e. not for LWPs) in the inferior.  Print anything interesting
+   that we can think of.  */
 
 static int
 info_cb (const td_thrhandle_t *th, void *s)
@@ -1470,7 +1431,8 @@
   td_err_e ret;
   td_thrinfo_t ti;
 
-  if ((ret = p_td_thr_get_info (th, &ti)) == TD_OK)
+  ret = p_td_thr_get_info (th, &ti);
+  if (ret == TD_OK)
     {
       printf_filtered ("%s thread #%d, lwp %d, ",
 		       ti.ti_type == TD_THR_SYSTEM ? "system" : "user  ",
@@ -1500,29 +1462,31 @@
 	  printf_filtered ("(stopped asleep)");
 	  break;
 	}
-      /* Print thr_create start function: */
+      /* Print thr_create start function.  */
       if (ti.ti_startfunc != 0)
 	{
 	  struct minimal_symbol *msym;
 	  msym = lookup_minimal_symbol_by_pc (ti.ti_startfunc);
 	  if (msym)
-	    printf_filtered ("   startfunc: %s\n", DEPRECATED_SYMBOL_NAME (msym));
+	    printf_filtered ("   startfunc: %s\n",
+			     DEPRECATED_SYMBOL_NAME (msym));
 	  else
 	    printf_filtered ("   startfunc: 0x%s\n", paddr (ti.ti_startfunc));
 	}
 
-      /* If thread is asleep, print function that went to sleep: */
+      /* If thread is asleep, print function that went to sleep.  */
       if (ti.ti_state == TD_THR_SLEEP)
 	{
 	  struct minimal_symbol *msym;
 	  msym = lookup_minimal_symbol_by_pc (ti.ti_pc);
 	  if (msym)
-	    printf_filtered (" - Sleep func: %s\n", DEPRECATED_SYMBOL_NAME (msym));
+	    printf_filtered (" - Sleep func: %s\n",
+			     DEPRECATED_SYMBOL_NAME (msym));
 	  else
 	    printf_filtered (" - Sleep func: 0x%s\n", paddr (ti.ti_startfunc));
 	}
 
-      /* Wrap up line, if necessary */
+      /* Wrap up line, if necessary.  */
       if (ti.ti_state != TD_THR_SLEEP && ti.ti_startfunc == 0)
 	printf_filtered ("\n");	/* don't you hate counting newlines? */
     }
@@ -1532,7 +1496,8 @@
   return 0;
 }
 
-/* List some state about each Solaris user thread in the inferior.  */
+/* List some state about each Solaris user-level thread in the
+   inferior.  */
 
 static void
 info_solthreads (char *args, int from_tty)
@@ -1543,10 +1508,8 @@
 }
 
 static int
-sol_find_memory_regions (int (*func) (CORE_ADDR,
-				      unsigned long,
-				      int, int, int,
-				      void *),
+sol_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
+				      int, int, int, void *),
 			 void *data)
 {
   return procfs_ops.to_find_memory_regions (func, data);
@@ -1564,7 +1527,6 @@
   return 0;
 }
 
-
 static void
 init_sol_thread_ops (void)
 {
@@ -1611,7 +1573,6 @@
   sol_thread_ops.to_magic = OPS_MAGIC;
 }
 
-
 static void
 init_sol_core_ops (void)
 {
@@ -1636,18 +1597,20 @@
   sol_core_ops.to_has_thread_control = tc_none;
   sol_core_ops.to_thread_alive = sol_thread_alive;
   sol_core_ops.to_pid_to_str = solaris_pid_to_str;
-  /* On Solaris/x86, when debugging a threaded core file from process <n>,
-     the following causes "info threads" to produce "procfs: couldn't find pid
-     <n> in procinfo list" where <n> is the pid of the process that produced
-     the core file.  Disable it for now. */
-  /* sol_core_ops.to_find_new_threads = sol_find_new_threads; */
+  /* On Solaris/x86, when debugging a threaded core file from process
+     <n>, the following causes "info threads" to produce "procfs:
+     couldn't find pid <n> in procinfo list" where <n> is the pid of
+     the process that produced the core file.  Disable it for now. */
+#if 0
+  sol_core_ops.to_find_new_threads = sol_find_new_threads;
+#endif
   sol_core_ops.to_magic = OPS_MAGIC;
 }
 
-/* we suppress the call to add_target of core_ops in corelow because
-   if there are two targets in the stratum core_stratum, find_core_target
-   won't know which one to return.  see corelow.c for an additonal
-   comment on coreops_suppress_target. */
+/* We suppress the call to add_target of core_ops in corelow because
+   if there are two targets in the stratum core_stratum,
+   find_core_target won't know which one to return.  See corelow.c for
+   an additonal comment on coreops_suppress_target.  */
 int coreops_suppress_target = 1;
 
 void
@@ -1701,19 +1664,19 @@
   memcpy (&core_ops, &sol_core_ops, sizeof (struct target_ops));
   add_target (&core_ops);
 
-  /* Hook into new_objfile notification. */
-  target_new_objfile_chain = target_new_objfile_hook;
-  target_new_objfile_hook  = sol_thread_new_objfile;
+  /* Hook into new_objfile notification.  */
+  target_new_objfile_chain = deprecated_target_new_objfile_hook;
+  deprecated_target_new_objfile_hook  = sol_thread_new_objfile;
   return;
 
-die:
-
-  fprintf_unfiltered (gdb_stderr, "[GDB will not be able to debug user-mode threads: %s]\n", dlerror ());
+ die:
+  fprintf_unfiltered (gdb_stderr, "\
+[GDB will not be able to debug user-mode threads: %s]\n", dlerror ());
 
   if (dlhandle)
     dlclose (dlhandle);
 
-  /* allow the user to debug non-threaded core files */
+  /* Allow the user to debug non-threaded core files.  */
   add_target (&core_ops);
 
   return;
diff --git a/gdb/solib-aix5.c b/gdb/solib-aix5.c
index 1a8c9df..54b1199 100644
--- a/gdb/solib-aix5.c
+++ b/gdb/solib-aix5.c
@@ -193,7 +193,7 @@
 
     /* Open the map file */
 
-    xasprintf (&map_pathname, "/proc/%d/map", pid);
+    map_pathname = xstrprintf ("/proc/%d/map", pid);
     map_fd = open (map_pathname, O_RDONLY);
     xfree (map_pathname);
     if (map_fd < 0)
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index abf2948..7976e67 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -272,133 +272,6 @@
   return symaddr;
 }
 
-#ifdef HANDLE_SVR4_EXEC_EMULATORS
-
-/*
-   Solaris BCP (the part of Solaris which allows it to run SunOS4
-   a.out files) throws in another wrinkle. Solaris does not fill
-   in the usual a.out link map structures when running BCP programs,
-   the only way to get at them is via groping around in the dynamic
-   linker.
-   The dynamic linker and it's structures are located in the shared
-   C library, which gets run as the executable's "interpreter" by
-   the kernel.
-
-   Note that we can assume nothing about the process state at the time
-   we need to find these structures.  We may be stopped on the first
-   instruction of the interpreter (C shared library), the first
-   instruction of the executable itself, or somewhere else entirely
-   (if we attached to the process for example).
- */
-
-static char *debug_base_symbols[] =
-{
-  "r_debug",			/* Solaris 2.3 */
-  "_r_debug",			/* Solaris 2.1, 2.2 */
-  NULL
-};
-
-static int look_for_base (int, CORE_ADDR);
-
-/*
-
-   LOCAL FUNCTION
-
-   look_for_base -- examine file for each mapped address segment
-
-   SYNOPSYS
-
-   static int look_for_base (int fd, CORE_ADDR baseaddr)
-
-   DESCRIPTION
-
-   This function is passed to proc_iterate_over_mappings, which
-   causes it to get called once for each mapped address space, with
-   an open file descriptor for the file mapped to that space, and the
-   base address of that mapped space.
-
-   Our job is to find the debug base symbol in the file that this
-   fd is open on, if it exists, and if so, initialize the dynamic
-   linker structure base address debug_base.
-
-   Note that this is a computationally expensive proposition, since
-   we basically have to open a bfd on every call, so we specifically
-   avoid opening the exec file.
- */
-
-static int
-look_for_base (int fd, CORE_ADDR baseaddr)
-{
-  bfd *interp_bfd;
-  CORE_ADDR address = 0;
-  char **symbolp;
-
-  /* If the fd is -1, then there is no file that corresponds to this
-     mapped memory segment, so skip it.  Also, if the fd corresponds
-     to the exec file, skip it as well. */
-
-  if (fd == -1
-      || (exec_bfd != NULL
-	  && fdmatch (fileno ((FILE *) (exec_bfd->iostream)), fd)))
-    {
-      return (0);
-    }
-
-  /* Try to open whatever random file this fd corresponds to.  Note that
-     we have no way currently to find the filename.  Don't gripe about
-     any problems we might have, just fail. */
-
-  if ((interp_bfd = bfd_fdopenr ("unnamed", gnutarget, fd)) == NULL)
-    {
-      return (0);
-    }
-  if (!bfd_check_format (interp_bfd, bfd_object))
-    {
-      /* FIXME-leak: on failure, might not free all memory associated with
-         interp_bfd.  */
-      bfd_close (interp_bfd);
-      return (0);
-    }
-
-  /* Now try to find our debug base symbol in this file, which we at
-     least know to be a valid ELF executable or shared library. */
-
-  for (symbolp = debug_base_symbols; *symbolp != NULL; symbolp++)
-    {
-      address = bfd_lookup_symbol (interp_bfd, *symbolp, 0);
-      if (address != 0)
-	{
-	  break;
-	}
-    }
-  if (address == 0)
-    {
-      /* FIXME-leak: on failure, might not free all memory associated with
-         interp_bfd.  */
-      bfd_close (interp_bfd);
-      return (0);
-    }
-
-  /* Eureka!  We found the symbol.  But now we may need to relocate it
-     by the base address.  If the symbol's value is less than the base
-     address of the shared library, then it hasn't yet been relocated
-     by the dynamic linker, and we have to do it ourself.  FIXME: Note
-     that we make the assumption that the first segment that corresponds
-     to the shared library has the base address to which the library
-     was relocated. */
-
-  if (address < baseaddr)
-    {
-      address += baseaddr;
-    }
-  debug_base = address;
-  /* FIXME-leak: on failure, might not free all memory associated with
-     interp_bfd.  */
-  bfd_close (interp_bfd);
-  return (1);
-}
-#endif /* HANDLE_SVR4_EXEC_EMULATORS */
-
 /*
 
    LOCAL FUNCTION
@@ -579,11 +452,6 @@
       if (exec_bfd != NULL
 	  && bfd_get_flavour (exec_bfd) == bfd_target_elf_flavour)
 	debug_base = elf_locate_base ();
-#ifdef HANDLE_SVR4_EXEC_EMULATORS
-      /* Try it the hard way for emulated executables.  */
-      else if (!ptid_equal (inferior_ptid, null_ptid) && target_has_execution)
-	proc_iterate_over_mappings (look_for_base);
-#endif
     }
   return (debug_base);
 }
diff --git a/gdb/somread.c b/gdb/somread.c
index 4ffa4c1..13b5209 100644
--- a/gdb/somread.c
+++ b/gdb/somread.c
@@ -219,6 +219,7 @@
 	      if ((symname[0] == 'L' && symname[1] == '$')
 	      || (symname[0] == '$' && symname[strlen (symname) - 1] == '$')
 		  || (symname[0] == 'D' && symname[1] == '$')
+		  || (strncmp (symname, "L0\001", 3) == 0)
 		  || (strncmp (symname, "$PIC", 4) == 0))
 		continue;
 	      break;
diff --git a/gdb/somsolib.c b/gdb/somsolib.c
index 7ecc97e..0081280 100644
--- a/gdb/somsolib.c
+++ b/gdb/somsolib.c
@@ -43,6 +43,7 @@
 #include "regcache.h"
 #include "gdb_assert.h"
 #include "exec.h"
+#include "hppa-tdep.h"
 
 #include <fcntl.h>
 
@@ -278,7 +279,7 @@
 som_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty,
 			     CORE_ADDR text_addr)
 {
-  obj_private_data_t *obj_private;
+  struct hppa_objfile_private *obj_private;
   struct obj_section *s;
 
   so->objfile = symbol_file_add (name, from_tty, NULL, 0, OBJF_SHARED);
@@ -307,17 +308,18 @@
    */
   so->objfile->flags |= OBJF_SHARED;
 
-  if (so->objfile->obj_private == NULL)
+  obj_private = (struct hppa_objfile_private *)
+	        objfile_data (so->objfile, hppa_objfile_priv_data);
+  if (obj_private == NULL)
     {
-      obj_private = (obj_private_data_t *)
+      obj_private = (struct hppa_objfile_private *)
 	obstack_alloc (&so->objfile->objfile_obstack,
-		       sizeof (obj_private_data_t));
+		       sizeof (struct hppa_objfile_private));
+      set_objfile_data (so->objfile, hppa_objfile_priv_data, obj_private);
       obj_private->unwind_info = NULL;
       obj_private->so_info = NULL;
-      so->objfile->obj_private = obj_private;
     }
 
-  obj_private = (obj_private_data_t *) so->objfile->obj_private;
   obj_private->so_info = so;
 
   if (!bfd_check_format (so->abfd, bfd_object))
@@ -1062,7 +1064,7 @@
   CORE_ADDR addr;
   struct minimal_symbol *msymbol;
   int status;
-  char dld_flags_buffer[TARGET_INT_BIT / TARGET_CHAR_BIT];
+  char dld_flags_buffer[4];
   unsigned int dld_flags_value;
   struct cleanup *old_cleanups = save_inferior_ptid ();
 
@@ -1079,16 +1081,13 @@
   msymbol = lookup_minimal_symbol ("__dld_flags", NULL, NULL);
 
   addr = SYMBOL_VALUE_ADDRESS (msymbol);
-  status = target_read_memory (addr, dld_flags_buffer, TARGET_INT_BIT / TARGET_CHAR_BIT);
+  status = target_read_memory (addr, dld_flags_buffer, 4);
 
-  dld_flags_value = extract_unsigned_integer (dld_flags_buffer,
-					      sizeof (dld_flags_value));
+  dld_flags_value = extract_unsigned_integer (dld_flags_buffer, 4);
 
   dld_flags_value &= ~DLD_FLAGS_HOOKVALID;
-  store_unsigned_integer (dld_flags_buffer,
-			  sizeof (dld_flags_value),
-			  dld_flags_value);
-  status = target_write_memory (addr, dld_flags_buffer, TARGET_INT_BIT / TARGET_CHAR_BIT);
+  store_unsigned_integer (dld_flags_buffer, 4, dld_flags_value);
+  status = target_write_memory (addr, dld_flags_buffer, 4);
 
   do_cleanups (old_cleanups);
 }
@@ -1135,7 +1134,7 @@
 {
   CORE_ADDR event_kind;
 
-  event_kind = read_register (ARG0_REGNUM);
+  event_kind = read_register (HPPA_ARG0_REGNUM);
   return (event_kind == SHL_LOAD);
 }
 
@@ -1144,7 +1143,7 @@
 {
   CORE_ADDR event_kind;
 
-  event_kind = read_register (ARG0_REGNUM);
+  event_kind = read_register (HPPA_ARG0_REGNUM);
   return (event_kind == SHL_UNLOAD);
 }
 
@@ -1158,7 +1157,7 @@
   static char dll_pathname[1024];
 
   /* Read the descriptor of this newly-loaded library. */
-  dll_handle_address = read_register (ARG1_REGNUM);
+  dll_handle_address = read_register (HPPA_ARG1_REGNUM);
   read_memory (dll_handle_address, (char *) &dll_descriptor, sizeof (dll_descriptor));
 
   /* We can find a pointer to the dll's pathname within the descriptor. */
diff --git a/gdb/source.c b/gdb/source.c
index 92cdce4..6a91c6c 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1,6 +1,6 @@
 /* List lines of source files for GDB, the GNU debugger.
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -741,11 +741,11 @@
       strcat (filename, string);
 
       if (is_regular_file (filename))
-      {
-        fd = open (filename, mode);
-        if (fd >= 0)
-          break;
-      }
+	{
+	  fd = open (filename, mode);
+	  if (fd >= 0)
+	    break;
+	}
     }
 
 done:
@@ -765,9 +765,9 @@
 	  /* Beware the // my son, the Emacs barfs, the botch that catch... */
 
 	  char *f = concat (current_directory,
-           IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
-				     ? "" : SLASH_STRING,
-				     filename, NULL);
+			    IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
+			    ? "" : SLASH_STRING,
+			    filename, NULL);
 	  *filename_opened = xfullpath (f);
 	  xfree (f);
 	}
@@ -787,8 +787,7 @@
    If the file was found, this function returns 1, and FULL_PATHNAME is
    set to the fully-qualified pathname.
 
-   Else, this functions returns 0, and FULL_PATHNAME is set to NULL.
- */
+   Else, this functions returns 0, and FULL_PATHNAME is set to NULL.  */
 int
 source_full_path_of (char *filename, char **full_pathname)
 {
@@ -805,30 +804,46 @@
   return 1;
 }
 
+/* This function is capable of finding the absolute path to a
+   source file, and opening it, provided you give it an 
+   OBJFILE and FILENAME. Both the DIRNAME and FULLNAME are only
+   added suggestions on where to find the file. 
 
-/* Open a source file given a symtab S.  Returns a file descriptor or
-   negative number for error.  */
+   OBJFILE should be the objfile associated with a psymtab or symtab. 
+   FILENAME should be the filename to open.
+   DIRNAME is the compilation directory of a particular source file.
+           Only some debug formats provide this info.
+   FULLNAME can be the last known absolute path to the file in question.
 
+   On Success 
+     A valid file descriptor is returned. ( the return value is positive )
+     FULLNAME is set to the absolute path to the file just opened.
+
+   On Failure
+     A non valid file descriptor is returned. ( the return value is negitive ) 
+     FULLNAME is set to NULL.  */
 int
-open_source_file (struct symtab *s)
+find_and_open_source (struct objfile *objfile,
+		      const char *filename,
+		      const char *dirname,
+		      char **fullname)
 {
   char *path = source_path;
   const char *p;
   int result;
-  char *fullname;
 
   /* Quick way out if we already know its full name */
-  if (s->fullname)
+  if (*fullname)
     {
-      result = open (s->fullname, OPEN_MODE);
+      result = open (*fullname, OPEN_MODE);
       if (result >= 0)
 	return result;
       /* Didn't work -- free old one, try again. */
-      xmfree (s->objfile->md, s->fullname);
-      s->fullname = NULL;
+      xmfree (objfile->md, *fullname);
+      *fullname = NULL;
     }
 
-  if (s->dirname != NULL)
+  if (dirname != NULL)
     {
       /* Replace a path entry of  $cdir  with the compilation directory name */
 #define	cdir_len	5
@@ -841,61 +856,106 @@
 	  int len;
 
 	  path = (char *)
-	    alloca (strlen (source_path) + 1 + strlen (s->dirname) + 1);
+	    alloca (strlen (source_path) + 1 + strlen (dirname) + 1);
 	  len = p - source_path;
 	  strncpy (path, source_path, len);	/* Before $cdir */
-	  strcpy (path + len, s->dirname);	/* new stuff */
+	  strcpy (path + len, dirname);	/* new stuff */
 	  strcat (path + len, source_path + len + cdir_len);	/* After $cdir */
 	}
     }
 
-  result = openp (path, 0, s->filename, OPEN_MODE, 0, &s->fullname);
+  result = openp (path, 0, filename, OPEN_MODE, 0, fullname);
   if (result < 0)
     {
       /* Didn't work.  Try using just the basename. */
-      p = lbasename (s->filename);
-      if (p != s->filename)
-	result = openp (path, 0, p, OPEN_MODE, 0, &s->fullname);
+      p = lbasename (filename);
+      if (p != filename)
+	result = openp (path, 0, p, OPEN_MODE, 0, fullname);
     }
 
   if (result >= 0)
     {
-      fullname = s->fullname;
-      s->fullname = mstrsave (s->objfile->md, s->fullname);
-      xfree (fullname);
+      char *tmp_fullname;
+      tmp_fullname = *fullname;
+      *fullname = mstrsave (objfile->md, *fullname);
+      xfree (tmp_fullname);
     }
   return result;
 }
 
-/* Return the path to the source file associated with symtab.  Returns NULL
-   if no symtab.  */
+/* Open a source file given a symtab S.  Returns a file descriptor or
+   negative number for error.  
+   
+   This function is a convience function to find_and_open_source. */
 
-char *
-symtab_to_filename (struct symtab *s)
+int
+open_source_file (struct symtab *s)
 {
-  int fd;
+  if (!s)
+    return -1;
+
+  return find_and_open_source (s->objfile, s->filename, s->dirname, 
+			       &s->fullname);
+}
+
+/* Finds the fullname that a symtab represents.
+
+   If this functions finds the fullname, it will save it in ps->fullname
+   and it will also return the value.
+
+   If this function fails to find the file that this symtab represents,
+   NULL will be returned and ps->fullname will be set to NULL.  */
+char *
+symtab_to_fullname (struct symtab *s)
+{
+  int r;
 
   if (!s)
     return NULL;
 
-  /* If we've seen the file before, just return fullname. */
+  /* Don't check s->fullname here, the file could have been 
+     deleted/moved/..., look for it again */
+  r = find_and_open_source (s->objfile, s->filename, s->dirname,
+			    &s->fullname);
 
-  if (s->fullname)
-    return s->fullname;
+  if (r)
+    {
+      close (r);
+      return s->fullname;
+    }
 
-  /* Try opening the file to setup fullname */
+  return NULL;
+}
 
-  fd = open_source_file (s);
-  if (fd < 0)
-    return s->filename;		/* File not found.  Just use short name */
+/* Finds the fullname that a partial_symtab represents.
 
-  /* Found the file.  Cleanup and return the full name */
+   If this functions finds the fullname, it will save it in ps->fullname
+   and it will also return the value.
 
-  close (fd);
-  return s->fullname;
+   If this function fails to find the file that this partial_symtab represents,
+   NULL will be returned and ps->fullname will be set to NULL.  */
+char *
+psymtab_to_fullname (struct partial_symtab *ps)
+{
+  int r;
+
+  if (!ps)
+    return NULL;
+
+  /* Don't check ps->fullname here, the file could have been
+     deleted/moved/..., look for it again */
+  r = find_and_open_source (ps->objfile, ps->filename, ps->dirname,
+			    &ps->fullname);
+
+  if (r) 
+    {
+      close (r);
+      return ps->fullname;
+    }
+
+  return NULL;
 }
 
-
 /* Create and initialize the table S->line_charpos that records
    the positions of the lines in the source file, which is assumed
    to be open on descriptor DESC.
diff --git a/gdb/source.h b/gdb/source.h
index 7cfed1a..ecfe1f0 100644
--- a/gdb/source.h
+++ b/gdb/source.h
@@ -27,6 +27,9 @@
    negative number for error.  */
 extern int open_source_file (struct symtab *s);
 
+extern char* psymtab_to_fullname (struct partial_symtab *ps);
+extern char* symtab_to_fullname (struct symtab *s);
+
 /* Create and initialize the table S->line_charpos that records the
    positions of the lines in the source file, which is assumed to be
    open on descriptor DESC.  All set S->nlines to the number of such
diff --git a/gdb/sparc-linux-tdep.c b/gdb/sparc-linux-tdep.c
index 8f77dcc..2484a53 100644
--- a/gdb/sparc-linux-tdep.c
+++ b/gdb/sparc-linux-tdep.c
@@ -293,7 +293,6 @@
   set_gdbarch_long_double_bit (gdbarch, 64);
   set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, sparc32_linux_pc_in_sigtramp);
   frame_unwind_append_sniffer (gdbarch, sparc32_linux_sigtramp_frame_sniffer);
 
   set_solib_svr4_fetch_link_map_offsets
diff --git a/gdb/sparc-sol2-tdep.c b/gdb/sparc-sol2-tdep.c
index 0885d47..10143bb 100644
--- a/gdb/sparc-sol2-tdep.c
+++ b/gdb/sparc-sol2-tdep.c
@@ -1,6 +1,6 @@
 /* Target-dependent code for Solaris SPARC.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -34,6 +34,7 @@
 #include "gdb_string.h"
 
 #include "sparc-tdep.h"
+#include "solib-svr4.h"
 
 /* From <sys/regset.h>.  */
 const struct sparc_gregset sparc32_sol2_gregset =
@@ -177,6 +178,8 @@
   /* Solaris has SVR4-style shared libraries...  */
   set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, svr4_ilp32_fetch_link_map_offsets);
 
   /* ...which means that we need some special handling when doing
      prologue analysis.  */
@@ -185,7 +188,6 @@
   /* Solaris has kernel-assisted single-stepping support.  */
   set_gdbarch_software_single_step (gdbarch, NULL);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, sparc_sol2_pc_in_sigtramp);
   frame_unwind_append_sniffer (gdbarch, sparc32_sol2_sigtramp_frame_sniffer);
 }
 
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 893648c..7fbd9de 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -450,7 +450,7 @@
 }
 
 static CORE_ADDR
-sparc32_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+sparc32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			 struct regcache *regcache, CORE_ADDR bp_addr,
 			 int nargs, struct value **args, CORE_ADDR sp,
 			 int struct_return, CORE_ADDR struct_addr)
diff --git a/gdb/sparc64-sol2-tdep.c b/gdb/sparc64-sol2-tdep.c
index 43057fe..733ce1a 100644
--- a/gdb/sparc64-sol2-tdep.c
+++ b/gdb/sparc64-sol2-tdep.c
@@ -31,6 +31,7 @@
 #include "gdb_assert.h"
 
 #include "sparc64-tdep.h"
+#include "solib-svr4.h"
 
 /* From <sys/regset.h>.  */
 const struct sparc_gregset sparc64_sol2_gregset =
@@ -153,7 +154,6 @@
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, sparc_sol2_pc_in_sigtramp);
   frame_unwind_append_sniffer (gdbarch, sparc64_sol2_sigtramp_frame_sniffer);
 
   sparc64_init_abi (info, gdbarch);
@@ -161,6 +161,8 @@
   /* Solaris has SVR4-style shared libraries...  */
   set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, svr4_lp64_fetch_link_map_offsets);
 
   /* ...which means that we need some special handling when doing
      prologue analysis.  */
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 8aad619..a4398d5 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -52,17 +52,6 @@
 /* The functions on this page are intended to be used to classify
    function arguments.  */
 
-/* Return the contents if register REGNUM as an address.  */
-
-static CORE_ADDR
-sparc_address_from_register (int regnum)
-{
-  ULONGEST addr;
-
-  regcache_cooked_read_unsigned (current_regcache, regnum, &addr);
-  return addr;
-}
-
 /* Check whether TYPE is "Integral or Pointer".  */
 
 static int
@@ -579,8 +568,7 @@
   struct sparc_frame_cache *cache =
     sparc64_frame_cache (next_frame, this_cache);
 
-  /* ??? Should we take BIAS into account here?  */
-  return cache->base;
+  return cache->base + BIAS;
 }
 
 static const struct frame_base sparc64_frame_base =
@@ -943,7 +931,7 @@
 	      gdb_assert (element < 6);
 	      regnum = SPARC_O0_REGNUM + element;
 	      regcache_cooked_write (regcache, regnum, valbuf);
-	      regcache_cooked_write (regcache, regnum + 1, valbuf);
+	      regcache_cooked_write (regcache, regnum + 1, valbuf + 8);
 	    }
 	}
 
@@ -960,7 +948,7 @@
 }
 
 static CORE_ADDR
-sparc64_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
+sparc64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
 			 struct regcache *regcache, CORE_ADDR bp_addr,
 			 int nargs, struct value **args, CORE_ADDR sp,
 			 int struct_return, CORE_ADDR struct_addr)
diff --git a/gdb/sparc64fbsd-tdep.c b/gdb/sparc64fbsd-tdep.c
index 0c410ef..9ca4983 100644
--- a/gdb/sparc64fbsd-tdep.c
+++ b/gdb/sparc64fbsd-tdep.c
@@ -54,7 +54,7 @@
 			    struct regcache *regcache,
 			    int regnum, const void *gregs, size_t len)
 {
-  sparc64_supply_gregset (regset->descr, regcache, regnum, gregs);
+  sparc64_supply_gregset (&sparc64fbsd_gregset, regcache, regnum, gregs);
 }
 
 static void
@@ -199,16 +199,12 @@
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  tdep->gregset = XMALLOC (struct regset);
-  tdep->gregset->descr = &sparc64fbsd_gregset;
-  tdep->gregset->supply_regset = sparc64fbsd_supply_gregset;
+  tdep->gregset = regset_alloc (gdbarch, sparc64fbsd_supply_gregset, NULL);
   tdep->sizeof_gregset = 256;
 
-  tdep->fpregset = XMALLOC (struct regset);
-  tdep->fpregset->supply_regset = sparc64fbsd_supply_fpregset;
+  tdep->fpregset = regset_alloc (gdbarch, sparc64fbsd_supply_fpregset, NULL);
   tdep->sizeof_fpregset = 272;
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, sparc64fbsd_pc_in_sigtramp);
   frame_unwind_append_sniffer (gdbarch, sparc64fbsd_sigtramp_frame_sniffer);
 
   sparc64_init_abi (info, gdbarch);
diff --git a/gdb/sparc64nbsd-tdep.c b/gdb/sparc64nbsd-tdep.c
index 7b2adf3..544c65b 100644
--- a/gdb/sparc64nbsd-tdep.c
+++ b/gdb/sparc64nbsd-tdep.c
@@ -57,7 +57,7 @@
 			    struct regcache *regcache,
 			    int regnum, const void *gregs, size_t len)
 {
-  sparc64_supply_gregset (regset->descr, regcache, regnum, gregs);
+  sparc64_supply_gregset (&sparc64nbsd_gregset, regcache, regnum, gregs);
 }
 
 static void
@@ -226,16 +226,12 @@
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  tdep->gregset = XMALLOC (struct regset);
-  tdep->gregset->descr = &sparc64nbsd_gregset;
-  tdep->gregset->supply_regset = sparc64nbsd_supply_gregset;
+  tdep->gregset = regset_alloc (gdbarch, sparc64nbsd_supply_gregset, NULL);
   tdep->sizeof_gregset = 160;
 
-  tdep->fpregset = XMALLOC (struct regset);
-  tdep->fpregset->supply_regset = sparc64nbsd_supply_fpregset;
+  tdep->fpregset = regset_alloc (gdbarch, sparc64nbsd_supply_fpregset, NULL);
   tdep->sizeof_fpregset = 272;
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, sparc64nbsd_pc_in_sigtramp);
   frame_unwind_append_sniffer (gdbarch, sparc64nbsd_sigtramp_frame_sniffer);
 
   sparc64_init_abi (info, gdbarch);
diff --git a/gdb/sparc64obsd-tdep.c b/gdb/sparc64obsd-tdep.c
index 162f11d..b74679c 100644
--- a/gdb/sparc64obsd-tdep.c
+++ b/gdb/sparc64obsd-tdep.c
@@ -61,7 +61,7 @@
 {
   const char *regs = gregs;
 
-  sparc64_supply_gregset (regset->descr, regcache, regnum, regs);
+  sparc64_supply_gregset (&sparc64obsd_core_gregset, regcache, regnum, regs);
   sparc64_supply_fpregset (regcache, regnum, regs + 288);
 }
 
@@ -184,12 +184,9 @@
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  tdep->gregset = XMALLOC (struct regset);
-  tdep->gregset->descr = &sparc64obsd_core_gregset;
-  tdep->gregset->supply_regset = sparc64obsd_supply_gregset;
+  tdep->gregset = regset_alloc (gdbarch, sparc64obsd_supply_gregset, NULL);
   tdep->sizeof_gregset = 832;
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, sparc64obsd_pc_in_sigtramp);
   frame_unwind_append_sniffer (gdbarch, sparc64obsd_sigtramp_frame_sniffer);
 
   sparc64_init_abi (info, gdbarch);
diff --git a/gdb/sparcnbsd-nat.c b/gdb/sparcnbsd-nat.c
index 9038ea3..01089ee 100644
--- a/gdb/sparcnbsd-nat.c
+++ b/gdb/sparcnbsd-nat.c
@@ -20,10 +20,44 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
+#include "gdbcore.h"
+#include "regcache.h"
 
 #include "sparc-tdep.h"
 #include "sparc-nat.h"
 
+/* Support for debugging kernel virtual memory images.  */
+
+#include <sys/types.h>
+#include <machine/pcb.h>
+
+#include "bsd-kvm.h"
+
+static int
+sparc32nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
+{
+  /* The following is true for NetBSD 1.6.2:
+
+     The pcb contains %sp, %sp, %psr and %wim.  From this information
+     we reconstruct the register state as it would look when we just
+     returned from cpu_switch().  */
+
+  /* The stack pointer shouldn't be zero.  */
+  if (pcb->pcb_sp == 0)
+    return 0;
+
+  regcache_raw_supply (regcache, SPARC_SP_REGNUM, &pcb->pcb_sp);
+  regcache_raw_supply (regcache, SPARC_O7_REGNUM, &pcb->pcb_pc);
+  regcache_raw_supply (regcache, SPARC32_PSR_REGNUM, &pcb->pcb_psr);
+  regcache_raw_supply (regcache, SPARC32_WIM_REGNUM, &pcb->pcb_wim);
+  regcache_raw_supply (regcache, SPARC32_PC_REGNUM, &pcb->pcb_pc);
+
+  sparc_supply_rwindow (regcache, pcb->pcb_sp, -1);
+
+  return 1;
+}
+
+
 /* Provide a prototype to silence -Wmissing-prototypes.  */
 void _initialize_sparcnbsd_nat (void);
 
@@ -31,4 +65,7 @@
 _initialize_sparcnbsd_nat (void)
 {
   sparc_gregset = &sparc32nbsd_gregset;
+
+  /* Support debugging kernel virtual memory images.  */
+  bsd_kvm_add_target (sparc32nbsd_supply_pcb);
 }
diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c
index 4cf4dcf..9019590 100644
--- a/gdb/sparcnbsd-tdep.c
+++ b/gdb/sparcnbsd-tdep.c
@@ -55,7 +55,7 @@
 			    struct regcache *regcache,
 			    int regnum, const void *gregs, size_t len)
 {
-  sparc32_supply_gregset (regset->descr, regcache, regnum, gregs);
+  sparc32_supply_gregset (&sparc32nbsd_gregset, regcache, regnum, gregs);
 
   /* Traditional NetBSD core files don't use multiple register sets.
      Instead, the general-purpose and floating-point registers are
@@ -274,16 +274,12 @@
   set_gdbarch_long_double_bit (gdbarch, 64);
   set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
 
-  tdep->gregset = XMALLOC (struct regset);
-  tdep->gregset->descr = &sparc32nbsd_gregset;
-  tdep->gregset->supply_regset = sparc32nbsd_supply_gregset;
+  tdep->gregset = regset_alloc (gdbarch, sparc32nbsd_supply_gregset, NULL);
   tdep->sizeof_gregset = 20 * 4;
 
-  tdep->fpregset = XMALLOC (struct regset);
-  tdep->fpregset->supply_regset = sparc32nbsd_supply_fpregset;
+  tdep->fpregset = regset_alloc (gdbarch, sparc32nbsd_supply_fpregset, NULL);
   tdep->sizeof_fpregset = 33 * 4;
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, sparc32nbsd_pc_in_sigtramp);
   frame_unwind_append_sniffer (gdbarch, sparc32nbsd_sigtramp_frame_sniffer);
 }
 
@@ -346,9 +342,8 @@
   gdbarch_register_osabi_sniffer (bfd_arch_sparc, bfd_target_aout_flavour,
 				  sparcnbsd_aout_osabi_sniffer);
 
-  /* BFD doesn't set the architecture for NetBSD style a.out core
-     files.  */
-  gdbarch_register_osabi_sniffer (bfd_arch_unknown, bfd_target_unknown_flavour,
+  /* BFD doesn't set a flavour for NetBSD style a.out core files.  */
+  gdbarch_register_osabi_sniffer (bfd_arch_sparc, bfd_target_unknown_flavour,
                                   sparcnbsd_core_osabi_sniffer);
 
   gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_AOUT,
diff --git a/gdb/sparcobsd-tdep.c b/gdb/sparcobsd-tdep.c
index 2677d4d..a7b9beb 100644
--- a/gdb/sparcobsd-tdep.c
+++ b/gdb/sparcobsd-tdep.c
@@ -152,7 +152,6 @@
   set_gdbarch_long_double_bit (gdbarch, 64);
   set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
 
-  set_gdbarch_deprecated_pc_in_sigtramp (gdbarch, sparc32obsd_pc_in_sigtramp);
   frame_unwind_append_sniffer (gdbarch, sparc32obsd_sigtramp_frame_sniffer);
 
   set_solib_svr4_fetch_link_map_offsets
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 07c6fe0..e91a980 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -978,61 +978,17 @@
 	      init_type (TYPE_CODE_INT, TARGET_INT_BIT / TARGET_CHAR_BIT,
 			 TYPE_FLAG_UNSIGNED, "unsigned int", NULL);
 
-	  if (BELIEVE_PCC_PROMOTION_TYPE)
+	  /* If PCC says a parameter is a short or a char, it is
+	     really an int.  */
+	  if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type)
+	      && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
 	    {
-	      /* This is defined on machines (e.g. sparc) where we
-	         should believe the type of a PCC 'short' argument,
-	         but shouldn't believe the address (the address is the
-	         address of the corresponding int).
-
-	         My guess is that this correction, as opposed to
-	         changing the parameter to an 'int' (as done below,
-	         for PCC on most machines), is the right thing to do
-	         on all machines, but I don't want to risk breaking
-	         something that already works.  On most PCC machines,
-	         the sparc problem doesn't come up because the calling
-	         function has to zero the top bytes (not knowing
-	         whether the called function wants an int or a short),
-	         so there is little practical difference between an
-	         int and a short (except perhaps what happens when the
-	         GDB user types "print short_arg = 0x10000;").
-
-	         Hacked for SunOS 4.1 by gnu@cygnus.com.  In 4.1, the
-	         compiler actually produces the correct address (we
-	         don't need to fix it up).  I made this code adapt so
-	         that it will offset the symbol if it was pointing at
-	         an int-aligned location and not otherwise.  This way
-	         you can use the same gdb for 4.0.x and 4.1 systems.
-
-	         If the parameter is shorter than an int, and is
-	         integral (e.g. char, short, or unsigned equivalent),
-	         and is claimed to be passed on an integer boundary,
-	         don't believe it!  Offset the parameter's address to
-	         the tail-end of that integer.  */
-
-	      if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type)
-		  && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT
-	      && 0 == SYMBOL_VALUE (sym) % TYPE_LENGTH (pcc_promotion_type))
-		{
-		  SYMBOL_VALUE (sym) += TYPE_LENGTH (pcc_promotion_type)
-		    - TYPE_LENGTH (SYMBOL_TYPE (sym));
-		}
-	      break;
+	      SYMBOL_TYPE (sym) =
+		TYPE_UNSIGNED (SYMBOL_TYPE (sym))
+		? pcc_unsigned_promotion_type
+		: pcc_promotion_type;
 	    }
-	  else
-	    {
-	      /* If PCC says a parameter is a short or a char,
-	         it is really an int.  */
-	      if (TYPE_LENGTH (SYMBOL_TYPE (sym)) < TYPE_LENGTH (pcc_promotion_type)
-		  && TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_INT)
-		{
-		  SYMBOL_TYPE (sym) =
-		    TYPE_UNSIGNED (SYMBOL_TYPE (sym))
-		    ? pcc_unsigned_promotion_type
-		    : pcc_promotion_type;
-		}
-	      break;
-	    }
+	  break;
 	}
 
     case 'P':
diff --git a/gdb/stack.c b/gdb/stack.c
index 93e36b5..ce986c7 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -52,7 +52,7 @@
 
 void locals_info (char *, int);
 
-void (*selected_frame_level_changed_hook) (int);
+void (*deprecated_selected_frame_level_changed_hook) (int);
 
 void _initialize_stack (void);
 
@@ -95,9 +95,9 @@
 				     struct ui_file *);
 
 static void print_frame (struct frame_info *fi, 
-			 int level, 
-			 int source, 
-			 int args, 
+			 int print_level, 
+			 enum print_what print_what, 
+			 int print_args, 
 			 struct symtab_and_line sal);
 
 static void backtrace_command (char *, int);
@@ -120,42 +120,38 @@
 struct print_stack_frame_args
   {
     struct frame_info *fi;
-    int level;
-    int source;
-    int args;
+    int print_level;
+    enum print_what print_what;
+    int print_args;
   };
 
 /* Show or print the frame arguments.
    Pass the args the way catch_errors wants them.  */
-static int print_stack_frame_stub (void *args);
 static int
 print_stack_frame_stub (void *args)
 {
   struct print_stack_frame_args *p = (struct print_stack_frame_args *) args;
 
-  print_frame_info (p->fi, p->level, p->source, p->args);
+  print_frame_info (p->fi, p->print_level, p->print_what, p->print_args);
   return 0;
 }
 
-/* Show or print a stack frame briefly.  FRAME_INFI should be the frame info
-   and LEVEL should be its level in the stack (or -1 for level not defined).
-   This prints the level, the function executing, the arguments,
-   and the file name and line number.
-   If the pc is not at the beginning of the source line,
-   the actual pc is printed at the beginning.
-
-   If SOURCE is 1, print the source line as well.
-   If SOURCE is -1, print ONLY the source line.  */
+/* Show or print a stack frame FI briefly.  The output is format
+   according to PRINT_LEVEL and PRINT_WHAT printing the frame's
+   relative level, function name, argument list, and file name and
+   line number.  If the frame's PC is not at the beginning of the
+   source line, the actual PC is printed at the beginning.  */
 
 void
-print_stack_frame (struct frame_info *fi, int level, int source)
+print_stack_frame (struct frame_info *fi, int print_level,
+		   enum print_what print_what)
 {
   struct print_stack_frame_args args;
 
   args.fi = fi;
-  args.level = level;
-  args.source = source;
-  args.args = 1;
+  args.print_level = print_level;
+  args.print_what = print_what;
+  args.print_args = 1;
 
   catch_errors (print_stack_frame_stub, (char *) &args, "", RETURN_MASK_ALL);
 }  
@@ -418,7 +414,8 @@
    LOC_AND_SRC: Print location and source line.  */
 
 void
-print_frame_info (struct frame_info *fi, int level, int source, int args)
+print_frame_info (struct frame_info *fi, int print_level,
+		  enum print_what print_what, int print_args)
 {
   struct symtab_and_line sal;
   int source_print;
@@ -430,14 +427,16 @@
       struct cleanup *uiout_cleanup
 	= make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
 
-      annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi));
+      annotate_frame_begin (print_level ? frame_relative_level (fi) : 0,
+			    get_frame_pc (fi));
 
       /* Do this regardless of SOURCE because we don't have any source
          to list for this frame.  */
-      if (level >= 0)
+      if (print_level)
         {
           ui_out_text (uiout, "#");
-          ui_out_field_fmt_int (uiout, 2, ui_left, "level", level);
+          ui_out_field_fmt_int (uiout, 2, ui_left, "level",
+				frame_relative_level (fi));
         }
       if (ui_out_is_mi_like_p (uiout))
         {
@@ -471,14 +470,14 @@
      line containing fi->pc.  */
   find_frame_sal (fi, &sal);
 
-  location_print = (source == LOCATION 
-		    || source == LOC_AND_ADDRESS
-		    || source == SRC_AND_LOC);
+  location_print = (print_what == LOCATION 
+		    || print_what == LOC_AND_ADDRESS
+		    || print_what == SRC_AND_LOC);
 
   if (location_print || !sal.symtab)
-    print_frame (fi, level, source, args, sal);
+    print_frame (fi, print_level, print_what, print_args, sal);
 
-  source_print = (source == SRC_LINE || source == SRC_AND_LOC);
+  source_print = (print_what == SRC_LINE || print_what == SRC_AND_LOC);
 
   if (sal.symtab)
     set_current_source_symtab_and_line (&sal);
@@ -487,15 +486,16 @@
     {
       struct symtab_and_line cursal;
       int done = 0;
-      int mid_statement = (source == SRC_LINE) && (get_frame_pc (fi) != sal.pc);
+      int mid_statement = ((print_what == SRC_LINE)
+			   && (get_frame_pc (fi) != sal.pc));
 
       if (annotation_level)
 	done = identify_source_line (sal.symtab, sal.line, mid_statement,
 				     get_frame_pc (fi));
       if (!done)
 	{
-	  if (print_frame_info_listing_hook)
-	    print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0);
+	  if (deprecated_print_frame_info_listing_hook)
+	    deprecated_print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0);
 	  else
 	    {
 	      /* We used to do this earlier, but that is clearly
@@ -522,7 +522,7 @@
       set_current_source_symtab_and_line (&cursal);
     }
 
-  if (source != 0)
+  if (print_what != LOCATION)
     set_default_breakpoint (1, get_frame_pc (fi), sal.symtab, sal.line);
 
   annotate_frame_end ();
@@ -532,9 +532,9 @@
 
 static void
 print_frame (struct frame_info *fi, 
-	     int level, 
-	     int source, 
-	     int args, 
+	     int print_level, 
+	     enum print_what print_what, 
+	     int print_args, 
 	     struct symtab_and_line sal)
 {
   struct symbol *func;
@@ -571,14 +571,6 @@
 	  && (SYMBOL_VALUE_ADDRESS (msymbol)
 	      > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
 	{
-#if 0
-	  /* There is no particular reason to think the line number
-	     information is wrong.  Someone might have just put in
-	     a label with asm() but left the line numbers alone.  */
-	  /* In this case we have no way of knowing the source file
-	     and line number, so don't print them.  */
-	  sal.symtab = 0;
-#endif
 	  /* We also don't know anything about the function besides
 	     its address and name.  */
 	  func = 0;
@@ -622,19 +614,21 @@
 	}
     }
 
-  annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi));
+  annotate_frame_begin (print_level ? frame_relative_level (fi) : 0,
+			get_frame_pc (fi));
 
   list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
 
-  if (level >= 0)
+  if (print_level)
     {
       ui_out_text (uiout, "#");
-      ui_out_field_fmt_int (uiout, 2, ui_left, "level", level);
+      ui_out_field_fmt_int (uiout, 2, ui_left, "level",
+			    frame_relative_level (fi));
     }
   if (addressprint)
     if (get_frame_pc (fi) != sal.pc
 	|| !sal.symtab
-	|| source == LOC_AND_ADDRESS)
+	|| print_what == LOC_AND_ADDRESS)
       {
 	annotate_frame_address ();
 	ui_out_field_core_addr (uiout, "addr", get_frame_pc (fi));
@@ -649,7 +643,7 @@
   annotate_frame_args ();
       
   ui_out_text (uiout, " (");
-  if (args)
+  if (print_args)
     {
       struct print_args_args args;
       struct cleanup *args_list_chain;
@@ -940,14 +934,6 @@
   print_address_numeric (frame_pc_unwind (fi), 1, gdb_stdout);
   printf_filtered ("\n");
 
-  {
-    int frameless;
-    frameless = (DEPRECATED_FRAMELESS_FUNCTION_INVOCATION_P ()
-		 && DEPRECATED_FRAMELESS_FUNCTION_INVOCATION (fi));
-    if (frameless)
-      printf_filtered (" (FRAMELESS),");
-  }
-
   if (calling_frame_info)
     {
       printf_filtered (" called by frame at ");
@@ -1102,33 +1088,6 @@
   }
 }
 
-#if 0
-/* Set a limit on the number of frames printed by default in a
-   backtrace.  */
-
-static int backtrace_limit;
-
-static void
-set_backtrace_limit_command (char *count_exp, int from_tty)
-{
-  int count = parse_and_eval_long (count_exp);
-
-  if (count < 0)
-    error ("Negative argument not meaningful as backtrace limit.");
-
-  backtrace_limit = count;
-}
-
-static void
-backtrace_limit_info (char *arg, int from_tty)
-{
-  if (arg)
-    error ("\"Info backtrace-limit\" takes no arguments.");
-
-  printf_unfiltered ("Backtrace limit: %d.\n", backtrace_limit);
-}
-#endif
-
 /* Print briefly all stack frames or just the innermost COUNT frames.  */
 
 static void backtrace_command_1 (char *count_exp, int show_locals,
@@ -1220,7 +1179,7 @@
          means further attempts to backtrace would fail (on the other
          hand, perhaps the code does or could be fixed to make sure
          the frame->prev field gets set to NULL in that case).  */
-      print_frame_info (fi, trailing_level + i, 0, 1);
+      print_frame_info (fi, 1, LOCATION, 1);
       if (show_locals)
 	print_frame_local_vars (fi, 1, gdb_stdout);
     }
@@ -1353,7 +1312,7 @@
 
   ALL_BLOCK_SYMBOLS (b, iter, sym)
     {
-      if (DEPRECATED_STREQ (DEPRECATED_SYMBOL_NAME (sym), "default"))
+      if (strcmp (DEPRECATED_SYMBOL_NAME (sym), "default") == 0)
 	{
 	  if (*have_default)
 	    continue;
@@ -1507,10 +1466,6 @@
       /* Ideally, here we should interact with the C++ runtime
          system to find the list of active handlers, etc. */
       fprintf_filtered (gdb_stdout, "Info catch not supported with this target/compiler combination.\n");
-#if 0
-      if (!deprecated_selected_frame)
-	error ("No frame selected.");
-#endif
     }
   else
     {
@@ -1606,9 +1561,7 @@
 {
   select_frame (fi);
   if (fi)
-    {
-      print_stack_frame (fi, frame_relative_level (fi), 1);
-    }
+    print_stack_frame (fi, 1, SRC_AND_LOC);
 }
 
 /* Return the symbol-block in which the selected frame is executing.
@@ -1695,7 +1648,6 @@
 select_frame_command (char *level_exp, int from_tty)
 {
   struct frame_info *frame;
-  int level = frame_relative_level (deprecated_selected_frame);
 
   if (!target_has_stack)
     error ("No stack.");
@@ -1703,8 +1655,6 @@
   frame = parse_frame_specification (level_exp);
 
   select_frame (frame);
-  if (level != frame_relative_level (deprecated_selected_frame))
-    selected_frame_level_changed_event (frame_relative_level (deprecated_selected_frame));
 }
 
 /* The "frame" command.  With no arg, print selected frame briefly.
@@ -1715,8 +1665,7 @@
 frame_command (char *level_exp, int from_tty)
 {
   select_frame_command (level_exp, from_tty);
-  print_stack_frame (deprecated_selected_frame,
-		     frame_relative_level (deprecated_selected_frame), 1);
+  print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC);
 }
 
 /* The XDB Compatibility command to print the current frame. */
@@ -1726,8 +1675,7 @@
 {
   if (target_has_stack == 0 || deprecated_selected_frame == 0)
     error ("No stack.");
-  print_stack_frame (deprecated_selected_frame,
-			  frame_relative_level (deprecated_selected_frame), 1);
+  print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC);
 }
 
 /* Select the frame up one or COUNT stack levels
@@ -1749,7 +1697,6 @@
   if (count1 != 0 && count_exp == 0)
     error ("Initial frame selected; you cannot go up.");
   select_frame (fi);
-  selected_frame_level_changed_event (frame_relative_level (deprecated_selected_frame));
 }
 
 static void
@@ -1762,8 +1709,7 @@
 up_command (char *count_exp, int from_tty)
 {
   up_silently_base (count_exp);
-  print_stack_frame (deprecated_selected_frame,
-		     frame_relative_level (deprecated_selected_frame), 1);
+  print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC);
 }
 
 /* Select the frame down one or COUNT stack levels
@@ -1794,7 +1740,6 @@
     }
 
   select_frame (frame);
-  selected_frame_level_changed_event (frame_relative_level (deprecated_selected_frame));
 }
 
 static void
@@ -1807,8 +1752,7 @@
 down_command (char *count_exp, int from_tty)
 {
   down_silently_base (count_exp);
-  print_stack_frame (deprecated_selected_frame,
-		     frame_relative_level (deprecated_selected_frame), 1);
+  print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC);
 }
 
 void
@@ -1844,6 +1788,7 @@
 	return_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (thisfun));
       if (return_type == NULL)
 	return_type = builtin_type_int;
+      CHECK_TYPEDEF (return_type);
       return_value = value_cast (return_type, return_value);
 
       /* Make sure the value is fully evaluated.  It may live in the
@@ -1925,24 +1870,12 @@
   if (return_value != NULL)
     {
       struct type *return_type = VALUE_TYPE (return_value);
-      if (!gdbarch_return_value_p (current_gdbarch))
-	{
-	  STORE_RETURN_VALUE (return_type, current_regcache,
-			      VALUE_CONTENTS (return_value));
-	}
-      /* FIXME: cagney/2004-01-17: If extract_returned_value_address
-         is available and the function is using
-         RETURN_VALUE_STRUCT_CONVENTION, should use it to find the
-         address of the returned value so that it can be assigned.  */
-      else
-	{
-	  gdb_assert (gdbarch_return_value (current_gdbarch, return_type,
-					    NULL, NULL, NULL)
-		      == RETURN_VALUE_REGISTER_CONVENTION);
-	  gdbarch_return_value (current_gdbarch, return_type,
-				current_regcache, NULL /*read*/,
-				VALUE_CONTENTS (return_value) /*write*/);
-	}
+      gdb_assert (gdbarch_return_value (current_gdbarch, return_type,
+					NULL, NULL, NULL)
+		  == RETURN_VALUE_REGISTER_CONVENTION);
+      gdbarch_return_value (current_gdbarch, return_type,
+			    current_regcache, NULL /*read*/,
+			    VALUE_CONTENTS (return_value) /*write*/);
     }
 
   /* If we are at the end of a call dummy now, pop the dummy frame
diff --git a/gdb/sun3-nat.c b/gdb/sun3-nat.c
deleted file mode 100644
index 6c52d33..0000000
--- a/gdb/sun3-nat.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* Host-dependent code for Sun-3 for GDB, the GNU debugger.
-   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1996, 1999, 2000, 2001
-   Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include "defs.h"
-#include "inferior.h"
-#include "gdbcore.h"
-#include "regcache.h"
-
-#include <sys/ptrace.h>
-#define KERNEL			/* To get floating point reg definitions */
-#include <machine/reg.h>
-
-static void fetch_core_registers (char *, unsigned, int, CORE_ADDR);
-
-void
-fetch_inferior_registers (int regno)
-{
-  struct regs inferior_registers;
-  struct fp_status inferior_fp_registers;
-
-  deprecated_registers_fetched ();
-
-  ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid),
-	  (PTRACE_ARG3_TYPE) & inferior_registers);
-
-  if (FP0_REGNUM >= 0)
-    ptrace (PTRACE_GETFPREGS, PIDGET (inferior_ptid),
-	    (PTRACE_ARG3_TYPE) & inferior_fp_registers);
-
-  memcpy (deprecated_registers, &inferior_registers, 16 * 4);
-  if (FP0_REGNUM >= 0)
-    memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	    &inferior_fp_registers, sizeof inferior_fp_registers.fps_regs);
-
-  *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps;
-  *(int *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc;
-  if (FP0_REGNUM >= 0)
-    memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
-	    &inferior_fp_registers.fps_control,
-	    sizeof inferior_fp_registers - 
-	    sizeof inferior_fp_registers.fps_regs);
-}
-
-/* Store our register values back into the inferior.
-   If REGNO is -1, do this for all registers.
-   Otherwise, REGNO specifies which register (so we can save time).  */
-
-void
-store_inferior_registers (int regno)
-{
-  struct regs inferior_registers;
-  struct fp_status inferior_fp_registers;
-
-  memcpy (&inferior_registers, deprecated_registers, 16 * 4);
-  if (FP0_REGNUM >= 0)
-    memcpy (&inferior_fp_registers,
-	    &deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-	    sizeof inferior_fp_registers.fps_regs);
-
-  inferior_registers.r_ps = *(int *) &&deprecated_registers[DEPRECATED_REGISTER_BYTE (PS_REGNUM)];
-  inferior_registers.r_pc = *(int *) &&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)];
-
-  if (FP0_REGNUM >= 0)
-    memcpy (&inferior_fp_registers.fps_control,
-	    &&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
-	    sizeof inferior_fp_registers - 
-	    sizeof inferior_fp_registers.fps_regs);
-
-  ptrace (PTRACE_SETREGS, PIDGET (inferior_ptid),
-	  (PTRACE_ARG3_TYPE) & inferior_registers);
-  if (FP0_REGNUM >= 0)
-    ptrace (PTRACE_SETFPREGS, PIDGET (inferior_ptid),
-	    (PTRACE_ARG3_TYPE) & inferior_fp_registers);
-}
-
-
-/* All of this stuff is only relevant if both host and target are sun3.  */
-
-/* Provide registers to GDB from a core file.
-
-   CORE_REG_SECT points to an array of bytes, which were obtained from
-   a core file which BFD thinks might contain register contents. 
-   CORE_REG_SIZE is its size.
-
-   WHICH says which register set corelow suspects this is:
-     0 --- the general-purpose register set
-     2 --- the floating-point register set
-
-   REG_ADDR isn't used.  */
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
-		      int which, CORE_ADDR reg_addr)
-{
-  struct regs *regs = (struct regs *) core_reg_sect;
-
-  if (which == 0)
-    {
-      if (core_reg_size < sizeof (struct regs))
-	  error ("Can't find registers in core file");
-
-      memcpy (&deprecated_registers, (char *) regs, 16 * 4);
-      supply_register (PS_REGNUM, (char *) &regs->r_ps);
-      supply_register (PC_REGNUM, (char *) &regs->r_pc);
-
-    }
-  else if (which == 2)
-    {
-
-#define fpustruct  ((struct fpu *) core_reg_sect)
-
-      if (core_reg_size >= sizeof (struct fpu))
-	{
-	  if (FP0_REGNUM >= 0)
-	    {
-	      memcpy (&&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
-		      fpustruct->f_fpstatus.fps_regs,
-		      sizeof fpustruct->f_fpstatus.fps_regs);
-	      memcpy (&&deprecated_registers[DEPRECATED_REGISTER_BYTE (FPC_REGNUM)],
-		      &fpustruct->f_fpstatus.fps_control,
-		      sizeof fpustruct->f_fpstatus -
-		      sizeof fpustruct->f_fpstatus.fps_regs);
-	    }
-	}
-      else
-	fprintf_unfiltered (gdb_stderr, 
-			    "Couldn't read float regs from core file\n");
-    }
-}
-
-
-/* Register that we are able to handle sun3 core file formats.
-   FIXME: is this really bfd_target_unknown_flavour? */
-
-static struct core_fns sun3_core_fns =
-{
-  bfd_target_unknown_flavour,		/* core_flavour */
-  default_check_format,			/* check_format */
-  default_core_sniffer,			/* core_sniffer */
-  fetch_core_registers,			/* core_read_registers */
-  NULL					/* next */
-};
-
-void
-_initialize_core_sun3 (void)
-{
-  add_core_fns (&sun3_core_fns);
-}
diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c
new file mode 100644
index 0000000..00bce17
--- /dev/null
+++ b/gdb/symfile-mem.c
@@ -0,0 +1,146 @@
+/* Reading symbol files from memory.
+
+   Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
+   2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* This file defines functions (and commands to exercise those
+   functions) for reading debugging information from object files
+   whose images are mapped directly into the inferior's memory.  For
+   example, the Linux kernel maps a "syscall DSO" into each process's
+   address space; this DSO provides kernel-specific code for some
+   system calls.
+
+   At the moment, BFD only has functions for parsing object files from
+   memory for the ELF format, even though the general idea isn't
+   ELF-specific.  This means that BFD only provides the functions GDB
+   needs when configured for ELF-based targets.  So these functions
+   may only be compiled on ELF-based targets.
+
+   GDB has no idea whether it has been configured for an ELF-based
+   target or not: it just tries to handle whatever files it is given.
+   But this means there are no preprocessor symbols on which we could
+   make these functions' compilation conditional.
+
+   So, for the time being, we put these functions alone in this file,
+   and have .mt files reference them as appropriate.  In the future, I
+   hope BFD will provide a format-independent bfd_from_remote_memory
+   entry point.  */
+
+
+#include "defs.h"
+#include "symtab.h"
+#include "gdbcore.h"
+#include "objfiles.h"
+#include "gdbcmd.h"
+#include "target.h"
+#include "value.h"
+#include "symfile.h"
+
+
+/* Read inferior memory at ADDR to find the header of a loaded object file
+   and read its in-core symbols out of inferior memory.  TEMPL is a bfd
+   representing the target's format.  */
+static struct objfile *
+symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, int from_tty)
+{
+  struct objfile *objf;
+  struct bfd *nbfd;
+  struct bfd_section *sec;
+  bfd_vma loadbase;
+  struct section_addr_info *sai;
+  unsigned int i;
+
+  if (bfd_get_flavour (templ) != bfd_target_elf_flavour)
+    error ("add-symbol-file-from-memory not supported for this target");
+
+  nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase,
+					 target_read_memory);
+  if (nbfd == NULL)
+    error ("Failed to read a valid object file image from memory.");
+
+  nbfd->filename = xstrdup ("shared object read from target memory");
+
+  if (!bfd_check_format (nbfd, bfd_object))
+    {
+      /* FIXME: should be checking for errors from bfd_close (for one thing,
+         on error it does not free all the storage associated with the
+         bfd).  */
+      bfd_close (nbfd);
+      error ("Got object file from memory but can't read symbols: %s.",
+	     bfd_errmsg (bfd_get_error ()));
+    }
+
+  sai = alloc_section_addr_info (bfd_count_sections (nbfd));
+  make_cleanup (xfree, sai);
+  i = 0;
+  for (sec = nbfd->sections; sec != NULL; sec = sec->next)
+    if ((bfd_get_section_flags (nbfd, sec) & (SEC_ALLOC|SEC_LOAD)) != 0)
+      {
+	sai->other[i].addr = bfd_get_section_vma (nbfd, sec) + loadbase;
+	sai->other[i].name = (char *) bfd_get_section_name (nbfd, sec);
+	sai->other[i].sectindex = sec->index;
+	++i;
+      }
+
+  objf = symbol_file_add_from_bfd (nbfd, from_tty,
+                                   sai, 0, OBJF_SHARED);
+
+  /* This might change our ideas about frames already looked at.  */
+  reinit_frame_cache ();
+
+  return objf;
+}
+
+
+static void
+add_symbol_file_from_memory_command (char *args, int from_tty)
+{
+  CORE_ADDR addr;
+  struct bfd *templ;
+
+  if (args == NULL)
+    error ("add-symbol-file-from-memory requires an expression argument");
+
+  addr = parse_and_eval_address (args);
+
+  /* We need some representative bfd to know the target we are looking at.  */
+  if (symfile_objfile != NULL)
+    templ = symfile_objfile->obfd;
+  else
+    templ = exec_bfd;
+  if (templ == NULL)
+    error ("\
+Must use symbol-file or exec-file before add-symbol-file-from-memory.");
+
+  symbol_file_add_from_memory (templ, addr, from_tty);
+}
+
+
+void
+_initialize_symfile_mem ()
+{
+  add_cmd ("add-symbol-file-from-memory", class_files,
+           add_symbol_file_from_memory_command,
+           "\
+Load the symbols out of memory from a dynamically loaded object file.\n\
+Give an expression for the address of the file's shared object file header.",
+           &cmdlist);
+
+}
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 19ae294..f3108a3 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -60,28 +60,15 @@
 #define O_BINARY 0
 #endif
 
-#ifdef HPUXHPPA
-
-/* Some HP-UX related globals to clear when a new "main"
-   symbol file is loaded. HP-specific.  */
-
-extern int hp_som_som_object_present;
-extern int hp_cxx_exception_support_initialized;
-#define RESET_HP_UX_GLOBALS() do {\
-                                    hp_som_som_object_present = 0;             /* indicates HP-compiled code */        \
-                                    hp_cxx_exception_support_initialized = 0;  /* must reinitialize exception stuff */ \
-                              } while (0)
-#endif
-
-int (*ui_load_progress_hook) (const char *section, unsigned long num);
-void (*show_load_progress) (const char *section,
-			    unsigned long section_sent, 
-			    unsigned long section_size, 
-			    unsigned long total_sent, 
+int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num);
+void (*deprecated_show_load_progress) (const char *section,
+			    unsigned long section_sent,
+			    unsigned long section_size,
+			    unsigned long total_sent,
 			    unsigned long total_size);
-void (*pre_add_symbol_hook) (char *);
-void (*post_add_symbol_hook) (void);
-void (*target_new_objfile_hook) (struct objfile *);
+void (*deprecated_pre_add_symbol_hook) (const char *);
+void (*deprecated_post_add_symbol_hook) (void);
+void (*deprecated_target_new_objfile_hook) (struct objfile *);
 
 static void clear_symtab_users_cleanup (void *ignore);
 
@@ -208,8 +195,8 @@
   struct partial_symbol *const *s1 = s1p;
   struct partial_symbol *const *s2 = s2p;
 
-  return strcmp_iw_ordered (SYMBOL_NATURAL_NAME (*s1),
-			    SYMBOL_NATURAL_NAME (*s2));
+  return strcmp_iw_ordered (SYMBOL_SEARCH_NAME (*s1),
+			    SYMBOL_SEARCH_NAME (*s2));
 }
 
 void
@@ -294,8 +281,8 @@
   return pst->symtab;
 }
 
-/* Remember the lowest-addressed loadable section we've seen.  
-   This function is called via bfd_map_over_sections. 
+/* Remember the lowest-addressed loadable section we've seen.
+   This function is called via bfd_map_over_sections.
 
    In case of equal vmas, the section with the largest size becomes the
    lowest-addressed loadable section.
@@ -352,12 +339,12 @@
 
   for (stp = start, oidx = 0; stp != end; stp++)
     {
-      if (bfd_get_section_flags (stp->bfd, 
+      if (bfd_get_section_flags (stp->bfd,
 				 stp->the_bfd_section) & (SEC_ALLOC | SEC_LOAD)
 	  && oidx < end - start)
 	{
 	  sap->other[oidx].addr = stp->addr;
-	  sap->other[oidx].name 
+	  sap->other[oidx].name
 	    = xstrdup (bfd_section_name (stp->bfd, stp->the_bfd_section));
 	  sap->other[oidx].sectindex = stp->the_bfd_section->index;
 	  oidx++;
@@ -388,21 +375,21 @@
 {
   asection *sect;
   int i;
-  
+
   sect = bfd_get_section_by_name (objfile->obfd, ".text");
-  if (sect) 
+  if (sect)
     objfile->sect_index_text = sect->index;
 
   sect = bfd_get_section_by_name (objfile->obfd, ".data");
-  if (sect) 
+  if (sect)
     objfile->sect_index_data = sect->index;
 
   sect = bfd_get_section_by_name (objfile->obfd, ".bss");
-  if (sect) 
+  if (sect)
     objfile->sect_index_bss = sect->index;
 
   sect = bfd_get_section_by_name (objfile->obfd, ".rodata");
-  if (sect) 
+  if (sect)
     objfile->sect_index_rodata = sect->index;
 
   /* This is where things get really weird...  We MUST have valid
@@ -437,7 +424,7 @@
 
 
 /* Parse the user's idea of an offset for dynamic linking, into our idea
-   of how to represent it for fast symbol reading.  This is the default 
+   of how to represent it for fast symbol reading.  This is the default
    version of the sym_fns.sym_offsets function for symbol readers that
    don't need to do anything special.  It allocates a section_offsets table
    for the objectfile OBJFILE and stuffs ADDR into all of the offsets.  */
@@ -450,9 +437,9 @@
 
   objfile->num_sections = bfd_count_sections (objfile->obfd);
   objfile->section_offsets = (struct section_offsets *)
-    obstack_alloc (&objfile->objfile_obstack, 
+    obstack_alloc (&objfile->objfile_obstack,
 		   SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
-  memset (objfile->section_offsets, 0, 
+  memset (objfile->section_offsets, 0,
 	  SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
 
   /* Now calculate offsets for section that were specified by the
@@ -537,7 +524,7 @@
      no load address was specified. */
   if (! addrs && ! offsets)
     {
-      local_addr 
+      local_addr
 	= alloc_section_addr_info (bfd_count_sections (objfile->obfd));
       make_cleanup (xfree, local_addr);
       addrs = local_addr;
@@ -580,7 +567,7 @@
       CORE_ADDR lower_offset;
       int i;
 
-      /* Find lowest loadable section to be used as starting point for 
+      /* Find lowest loadable section to be used as starting point for
          continguous sections. FIXME!! won't work without call to find
 	 .text first, but this assumes text is lowest section. */
       lower_sect = bfd_get_section_by_name (objfile->obfd, ".text");
@@ -590,7 +577,7 @@
       if (lower_sect == NULL)
 	warning ("no loadable sections found in added symbol-file %s",
 		 objfile->name);
-      else 
+      else
 	if ((bfd_get_section_flags (objfile->obfd, lower_sect) & SEC_CODE) == 0)
 	  warning ("Lowest section in %s is %s at %s",
 		   objfile->name,
@@ -600,11 +587,11 @@
  	lower_offset = bfd_section_vma (objfile->obfd, lower_sect);
       else
  	lower_offset = 0;
- 
+
       /* Calculate offsets for the loadable sections.
  	 FIXME! Sections must be in order of increasing loadable section
  	 so that contiguous sections can use the lower-offset!!!
- 
+
          Adjust offsets if the segments are not contiguous.
          If the section is contiguous, its offset should be set to
  	 the offset of the highest loadable section lower than it
@@ -628,7 +615,7 @@
                 else
                   {
                     warning ("section %s not found in %s",
-                             addrs->other[i].name, 
+                             addrs->other[i].name,
                              objfile->name);
                     addrs->other[i].addr = 0;
                   }
@@ -684,24 +671,24 @@
     {
       struct obj_section *s;
 
- 	/* Map section offsets in "addr" back to the object's 
- 	   sections by comparing the section names with bfd's 
+ 	/* Map section offsets in "addr" back to the object's
+ 	   sections by comparing the section names with bfd's
  	   section names.  Then adjust the section address by
  	   the offset. */ /* for gdb/13815 */
- 
+
       ALL_OBJFILE_OSECTIONS (objfile, s)
 	{
 	  CORE_ADDR s_addr = 0;
 	  int i;
 
- 	    for (i = 0; 
+ 	    for (i = 0;
 	         !s_addr && i < addrs->num_sections && addrs->other[i].name;
 		 i++)
- 	      if (strcmp (bfd_section_name (s->objfile->obfd, 
-					    s->the_bfd_section), 
+ 	      if (strcmp (bfd_section_name (s->objfile->obfd,
+					    s->the_bfd_section),
 			  addrs->other[i].name) == 0)
  	        s_addr = addrs->other[i].addr; /* end added for gdb/13815 */
- 
+
 	  s->addr -= s->offset;
 	  s->addr += s_addr;
 	  s->endaddr -= s->offset;
@@ -761,8 +748,8 @@
 /* Process a symbol file, as either the main file or as a dynamically
    loaded file.
 
-   NAME is the file name (which will be tilde-expanded and made
-   absolute herein) (but we don't free or modify NAME itself).
+   ABFD is a BFD already open on the file, as from symfile_bfd_open.
+   This BFD will be closed on error, and is always consumed by this function.
 
    FROM_TTY says how verbose to be.
 
@@ -776,7 +763,7 @@
    Upon success, returns a pointer to the objfile that was added.
    Upon failure, jumps back to command level (never returns). */
 static struct objfile *
-symbol_file_add_with_addrs_or_offsets (char *name, int from_tty,
+symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
                                        struct section_addr_info *addrs,
                                        struct section_offsets *offsets,
                                        int num_offsets,
@@ -785,15 +772,15 @@
   struct objfile *objfile;
   struct partial_symtab *psymtab;
   char *debugfile;
-  bfd *abfd;
   struct section_addr_info *orig_addrs;
   struct cleanup *my_cleanups;
+  const char *name = bfd_get_filename (abfd);
 
-  /* Open a bfd for the file, and give user a chance to burp if we'd be
+  my_cleanups = make_cleanup_bfd_close (abfd);
+
+  /* Give user a chance to burp if we'd be
      interactively wiping out any existing symbols.  */
 
-  abfd = symfile_bfd_open (name);
-
   if ((have_full_symbols () || have_partial_symbols ())
       && mainline
       && from_tty
@@ -801,6 +788,7 @@
     error ("Not confirmed.");
 
   objfile = allocate_objfile (abfd, flags);
+  discard_cleanups (my_cleanups);
 
   orig_addrs = alloc_section_addr_info (bfd_count_sections (abfd));
   my_cleanups = make_cleanup (xfree, orig_addrs);
@@ -817,8 +805,8 @@
      performed, or need to read an unmapped symbol table. */
   if (from_tty || info_verbose)
     {
-      if (pre_add_symbol_hook)
-	pre_add_symbol_hook (name);
+      if (deprecated_pre_add_symbol_hook)
+	deprecated_pre_add_symbol_hook (name);
       else
 	{
 	  printf_unfiltered ("Reading symbols from %s...", name);
@@ -866,14 +854,14 @@
 	}
       objfile->separate_debug_objfile->separate_debug_objfile_backlink
         = objfile;
-      
+
       /* Put the separate debug object before the normal one, this is so that
          usage of the ALL_OBJFILES_SAFE macro will stay safe. */
       put_objfile_before (objfile->separate_debug_objfile, objfile);
-      
+
       xfree (debugfile);
     }
-  
+
   if (!have_partial_symbols () && !have_full_symbols ())
     {
       wrap_here ("");
@@ -883,8 +871,8 @@
 
   if (from_tty || info_verbose)
     {
-      if (post_add_symbol_hook)
-	post_add_symbol_hook ();
+      if (deprecated_post_add_symbol_hook)
+	deprecated_post_add_symbol_hook ();
       else
 	{
 	  printf_unfiltered ("done.\n");
@@ -903,13 +891,29 @@
 
   new_symfile_objfile (objfile, mainline, from_tty);
 
-  if (target_new_objfile_hook)
-    target_new_objfile_hook (objfile);
+  if (deprecated_target_new_objfile_hook)
+    deprecated_target_new_objfile_hook (objfile);
 
   return (objfile);
 }
 
 
+/* Process the symbol file ABFD, as either the main file or as a
+   dynamically loaded file.
+
+   See symbol_file_add_with_addrs_or_offsets's comments for
+   details.  */
+struct objfile *
+symbol_file_add_from_bfd (bfd *abfd, int from_tty,
+                          struct section_addr_info *addrs,
+                          int mainline, int flags)
+{
+  return symbol_file_add_with_addrs_or_offsets (abfd,
+						from_tty, addrs, 0, 0,
+                                                mainline, flags);
+}
+
+
 /* Process a symbol file, as either the main file or as a dynamically
    loaded file.  See symbol_file_add_with_addrs_or_offsets's comments
    for details.  */
@@ -917,8 +921,8 @@
 symbol_file_add (char *name, int from_tty, struct section_addr_info *addrs,
 		 int mainline, int flags)
 {
-  return symbol_file_add_with_addrs_or_offsets (name, from_tty, addrs, 0, 0, 
-                                                mainline, flags);
+  return symbol_file_add_from_bfd (symfile_bfd_open (name), from_tty,
+                                   addrs, mainline, flags);
 }
 
 
@@ -929,7 +933,7 @@
    The auxiliary function, symbol_file_add_main_1(), has the flags
    argument for the switches that can only be specified in the symbol_file
    command itself.  */
-   
+
 void
 symbol_file_add_main (char *args, int from_tty)
 {
@@ -941,10 +945,6 @@
 {
   symbol_file_add (args, from_tty, NULL, 1, flags);
 
-#ifdef HPUXHPPA
-  RESET_HP_UX_GLOBALS ();
-#endif
-
   /* Getting new symbols may change our opinion about
      what is frameless.  */
   reinit_frame_cache ();
@@ -973,9 +973,6 @@
     symfile_objfile = NULL;
     if (from_tty)
       printf_unfiltered ("No symbol file now.\n");
-#ifdef HPUXHPPA
-    RESET_HP_UX_GLOBALS ();
-#endif
 }
 
 static char *
@@ -987,14 +984,14 @@
   char *contents;
   int crc_offset;
   unsigned char *p;
-  
+
   sect = bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink");
 
   if (sect == NULL)
     return NULL;
 
   debuglink_size = bfd_section_size (objfile->obfd, sect);
-  
+
   contents = xmalloc (debuglink_size);
   bfd_get_section_contents (objfile->obfd, sect, contents,
 			    (file_ptr)0, (bfd_size_type)debuglink_size);
@@ -1004,7 +1001,7 @@
   crc_offset = (crc_offset + 3) & ~3;
 
   crc32 = bfd_get_32 (objfile->obfd, (bfd_byte *) (contents + crc_offset));
-  
+
   *crc32_out = crc32;
   return contents;
 }
@@ -1051,7 +1048,7 @@
 
   if (basename == NULL)
     return NULL;
-  
+
   dir = xstrdup (objfile->name);
 
   /* Strip off the final filename part, leaving the directory name,
@@ -1065,12 +1062,12 @@
     }
   gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i]));
   dir[i+1] = '\0';
-  
+
   debugfile = alloca (strlen (debug_file_directory) + 1
                       + strlen (dir)
                       + strlen (DEBUG_SUBDIRECTORY)
                       + strlen ("/")
-                      + strlen (basename) 
+                      + strlen (basename)
                       + 1);
 
   /* First try in the same directory as the original file.  */
@@ -1083,7 +1080,7 @@
       xfree (dir);
       return xstrdup (debugfile);
     }
-  
+
   /* Then try in the subdirectory named DEBUG_SUBDIRECTORY.  */
   strcpy (debugfile, dir);
   strcat (debugfile, DEBUG_SUBDIRECTORY);
@@ -1096,7 +1093,7 @@
       xfree (dir);
       return xstrdup (debugfile);
     }
-  
+
   /* Then try in the global debugfile directory.  */
   strcpy (debugfile, debug_file_directory);
   strcat (debugfile, "/");
@@ -1109,7 +1106,7 @@
       xfree (dir);
       return xstrdup (debugfile);
     }
-  
+
   xfree (basename);
   xfree (dir);
   return NULL;
@@ -1160,7 +1157,7 @@
 	  else
 	    {
 	      name = *argv;
-	      
+
 	      symbol_file_add_main_1 (name, from_tty, flags);
 	    }
 	  argv++;
@@ -1353,7 +1350,7 @@
 {
   bfd_size_type *sum = data;
 
-  *sum += bfd_get_section_size_before_reloc (asec);
+  *sum += bfd_get_section_size (asec);
 }
 
 /* Opaque data for load_section_callback.  */
@@ -1373,7 +1370,7 @@
 
   if (bfd_get_section_flags (abfd, asec) & SEC_LOAD)
     {
-      bfd_size_type size = bfd_get_section_size_before_reloc (asec);
+      bfd_size_type size = bfd_get_section_size (asec);
       if (size > 0)
 	{
 	  char *buffer;
@@ -1422,7 +1419,7 @@
 		     that.  remote.c could implement that method
 		     using the ``qCRC'' packet.  */
 		  char *check = xmalloc (len);
-		  struct cleanup *verify_cleanups = 
+		  struct cleanup *verify_cleanups =
 		    make_cleanup (xfree, check);
 
 		  if (target_read_memory (lma, check, len) != 0)
@@ -1439,13 +1436,14 @@
 	      args->write_count += 1;
 	      sent += len;
 	      if (quit_flag
-		  || (ui_load_progress_hook != NULL
-		      && ui_load_progress_hook (sect_name, sent)))
+		  || (deprecated_ui_load_progress_hook != NULL
+		      && deprecated_ui_load_progress_hook (sect_name, sent)))
 		error ("Canceled the download");
 
-	      if (show_load_progress != NULL)
-		show_load_progress (sect_name, sent, size, 
-				    args->data_count, args->total_size);
+	      if (deprecated_show_load_progress != NULL)
+		deprecated_show_load_progress (sect_name, sent, size,
+					       args->data_count,
+					       args->total_size);
 	    }
 	  while (sent < size);
 
@@ -1511,7 +1509,7 @@
 	     bfd_errmsg (bfd_get_error ()));
     }
 
-  bfd_map_over_sections (loadfile_bfd, add_section_size_callback, 
+  bfd_map_over_sections (loadfile_bfd, add_section_size_callback,
 			 (void *) &cbdata.total_size);
 
   start_time = time (NULL);
@@ -1536,7 +1534,7 @@
      file is loaded in.  Some targets do (e.g., remote-vx.c) but
      others don't (or didn't - perhaphs they have all been deleted).  */
 
-  print_transfer_performance (gdb_stdout, cbdata.data_count, 
+  print_transfer_performance (gdb_stdout, cbdata.data_count,
 			      cbdata.write_count, end_time - start_time);
 
   do_cleanups (old_cleanups);
@@ -1552,7 +1550,7 @@
 report_transfer_performance (unsigned long data_count, time_t start_time,
 			     time_t end_time)
 {
-  print_transfer_performance (gdb_stdout, data_count, 
+  print_transfer_performance (gdb_stdout, data_count,
 			      end_time - start_time, 0);
 }
 
@@ -1565,14 +1563,14 @@
   ui_out_text (uiout, "Transfer rate: ");
   if (time_count > 0)
     {
-      ui_out_field_fmt (uiout, "transfer-rate", "%lu", 
+      ui_out_field_fmt (uiout, "transfer-rate", "%lu",
 			(data_count * 8) / time_count);
       ui_out_text (uiout, " bits/sec");
     }
   else
     {
       ui_out_field_fmt (uiout, "transferred-bits", "%lu", (data_count * 8));
-      ui_out_text (uiout, " bits in <1 sec");    
+      ui_out_text (uiout, " bits in <1 sec");
     }
   if (write_count > 0)
     {
@@ -1618,7 +1616,7 @@
   struct cleanup *my_cleanups = make_cleanup (null_cleanup, NULL);
 
   num_sect_opts = 16;
-  sect_opts = (struct sect_opt *) xmalloc (num_sect_opts 
+  sect_opts = (struct sect_opt *) xmalloc (num_sect_opts
 					   * sizeof (struct sect_opt));
 
   dont_repeat ();
@@ -1661,12 +1659,12 @@
                to load the program. */
 	    sect_opts[section_index].name = ".text";
 	    sect_opts[section_index].value = arg;
-	    if (++section_index > num_sect_opts) 
+	    if (++section_index > num_sect_opts)
 	      {
 		num_sect_opts *= 2;
-		sect_opts = ((struct sect_opt *) 
+		sect_opts = ((struct sect_opt *)
 			     xrealloc (sect_opts,
-				       num_sect_opts 
+				       num_sect_opts
 				       * sizeof (struct sect_opt)));
 	      }
 	  }
@@ -1697,12 +1695,12 @@
 		    {
 		      sect_opts[section_index].value = arg;
 		      expecting_sec_addr = 0;
-		      if (++section_index > num_sect_opts) 
+		      if (++section_index > num_sect_opts)
 			{
 			  num_sect_opts *= 2;
-			  sect_opts = ((struct sect_opt *) 
+			  sect_opts = ((struct sect_opt *)
 				       xrealloc (sect_opts,
-						 num_sect_opts 
+						 num_sect_opts
 						 * sizeof (struct sect_opt)));
 			}
 		    }
@@ -1718,7 +1716,7 @@
      functions.  We have to split this up into separate print
      statements because local_hex_string returns a local static
      string. */
- 
+
   printf_unfiltered ("add symbol table from file \"%s\" at\n", filename);
   section_addrs = alloc_section_addr_info (section_index);
   make_cleanup (xfree, section_addrs);
@@ -1727,7 +1725,7 @@
       CORE_ADDR addr;
       char *val = sect_opts[i].value;
       char *sec = sect_opts[i].name;
- 
+
       addr = parse_and_eval_address (val);
 
       /* Here we store the section offsets in the order they were
@@ -1735,13 +1733,13 @@
       section_addrs->other[sec_num].name = sec;
       section_addrs->other[sec_num].addr = addr;
       printf_unfiltered ("\t%s_addr = %s\n",
-		       sec, 
+		       sec,
 		       local_hex_string ((unsigned long)addr));
       sec_num++;
 
-      /* The object's sections are initialized when a 
+      /* The object's sections are initialized when a
 	 call is made to build_objfile_section_table (objfile).
-	 This happens in reread_symbols. 
+	 This happens in reread_symbols.
 	 At this point, we don't know what file type this is,
 	 so we can't determine what section names are valid.  */
     }
@@ -1846,9 +1844,9 @@
 	      /* Save the offsets, we will nuke them with the rest of the
 	         objfile_obstack.  */
 	      num_offsets = objfile->num_sections;
-	      offsets = ((struct section_offsets *) 
+	      offsets = ((struct section_offsets *)
 			 alloca (SIZEOF_N_SECTION_OFFSETS (num_offsets)));
-	      memcpy (offsets, objfile->section_offsets, 
+	      memcpy (offsets, objfile->section_offsets,
 		      SIZEOF_N_SECTION_OFFSETS (num_offsets));
 
 	      /* Nuke all the state that we will re-read.  Much of the following
@@ -1915,9 +1913,9 @@
 	      /* We use the same section offsets as from last time.  I'm not
 	         sure whether that is always correct for shared libraries.  */
 	      objfile->section_offsets = (struct section_offsets *)
-		obstack_alloc (&objfile->objfile_obstack, 
+		obstack_alloc (&objfile->objfile_obstack,
 			       SIZEOF_N_SECTION_OFFSETS (num_offsets));
-	      memcpy (objfile->section_offsets, offsets, 
+	      memcpy (objfile->section_offsets, offsets,
 		      SIZEOF_N_SECTION_OFFSETS (num_offsets));
 	      objfile->num_sections = num_offsets;
 
@@ -1927,9 +1925,6 @@
 	      if (objfile == symfile_objfile)
 		{
 		  (*objfile->sf->sym_new_init) (objfile);
-#ifdef HPUXHPPA
-		  RESET_HP_UX_GLOBALS ();
-#endif
 		}
 
 	      (*objfile->sf->sym_init) (objfile);
@@ -2002,7 +1997,7 @@
          separated debug info, or
          - if the new primary objfile has separate debug
          info, but it's under a different filename.
- 
+
          If the old and new objfiles both have separate
          debug info, under the same filename, then we're
          okay --- if the separated file's contents have
@@ -2023,7 +2018,7 @@
          Preserve the flags from objfile that make sense.  */
       objfile->separate_debug_objfile
         = (symbol_file_add_with_addrs_or_offsets
-           (debug_file,
+           (symfile_bfd_open (debug_file),
             info_verbose, /* from_tty: Don't override the default. */
             0, /* No addr table.  */
             objfile->section_offsets, objfile->num_sections,
@@ -2055,7 +2050,7 @@
   if (fl_table_next >= fl_table_size)
     {
       fl_table_size += 10;
-      filename_language_table = 
+      filename_language_table =
 	xrealloc (filename_language_table,
 		  fl_table_size * sizeof (*filename_language_table));
     }
@@ -2310,8 +2305,8 @@
   set_default_breakpoint (0, 0, 0, 0);
   clear_current_source_symtab_and_line ();
   clear_pc_function_cache ();
-  if (target_new_objfile_hook)
-    target_new_objfile_hook (NULL);
+  if (deprecated_target_new_objfile_hook)
+    deprecated_target_new_objfile_hook (NULL);
 }
 
 static void
@@ -2324,7 +2319,7 @@
 
    This function is run after symbol reading, or from a cleanup.
    If an old symbol table was obsoleted, the old symbol table
-   has been blown away, but the other GDB data structures that may 
+   has been blown away, but the other GDB data structures that may
    reference it have not yet been cleared or re-directed.  (The old
    symtab was zapped, and the cleanup queued, in free_named_symtab()
    below.)
@@ -2549,7 +2544,7 @@
 }
 
 /* Add a symbol with a long value to a psymtab.
-   Since one arg is a struct, we pass in a ptr and deref it (sigh).  
+   Since one arg is a struct, we pass in a ptr and deref it (sigh).
    Return the partial symbol that has been added.  */
 
 /* NOTE: carlton/2003-09-11: The reason why we return the partial
@@ -2727,10 +2722,10 @@
    same VMA, each with its own unique LMA (or load address).
    2) It is assumed that some runtime mechanism exists for mapping the
    sections, one by one, from the load address into the VMA address.
-   3) This code provides a mechanism for gdb to keep track of which 
+   3) This code provides a mechanism for gdb to keep track of which
    sections should be considered to be mapped from the VMA to the LMA.
    This information is used for symbol lookup, and memory read/write.
-   For instance, if a section has been mapped then its contents 
+   For instance, if a section has been mapped then its contents
    should be read from the VMA, otherwise from the LMA.
 
    Two levels of debugger support for overlays are available.  One is
@@ -2754,7 +2749,7 @@
    Functional interface:
    find_pc_mapped_section(pc):    if the pc is in the range of a mapped
    section, return that section.
-   find_pc_overlay(pc):       find any overlay section that contains 
+   find_pc_overlay(pc):       find any overlay section that contains
    the pc, either in its VMA or its LMA
    overlay_is_mapped(sect):       true if overlay is marked as mapped
    section_is_overlay(sect):      true if section's VMA != LMA
@@ -2778,7 +2773,7 @@
 void (*target_overlay_update) (struct obj_section *) = simple_overlay_update;
 
 /* Function: section_is_overlay (SECTION)
-   Returns true if SECTION has VMA not equal to LMA, ie. 
+   Returns true if SECTION has VMA not equal to LMA, ie.
    SECTION is loaded at an address different from where it will "run".  */
 
 int
@@ -2809,7 +2804,7 @@
 }
 
 /* Function: overlay_is_mapped (SECTION)
-   Returns true if section is an overlay, and is currently mapped. 
+   Returns true if section is an overlay, and is currently mapped.
    Private: public access is thru function section_is_mapped.
 
    Access to the ovly_mapped flag is restricted to this function, so
@@ -2830,7 +2825,7 @@
     case ovly_off:
       return 0;			/* overlay debugging off */
     case ovly_auto:		/* overlay debugging automatic */
-      /* Unles there is a target_overlay_update function, 
+      /* Unles there is a target_overlay_update function,
          there's really nothing useful to do here (can't really go auto)  */
       if (target_overlay_update)
 	{
@@ -2879,7 +2874,7 @@
   if (overlay_debugging)
     if (section && section_is_overlay (section))
       {
-	size = bfd_get_section_size_before_reloc (section);
+	size = bfd_get_section_size (section);
 	if (section->lma <= pc && pc < section->lma + size)
 	  return 1;
       }
@@ -2899,7 +2894,7 @@
   if (overlay_debugging)
     if (section && section_is_overlay (section))
       {
-	size = bfd_get_section_size_before_reloc (section);
+	size = bfd_get_section_size (section);
 	if (section->vma <= pc && pc < section->vma + size)
 	  return 1;
       }
@@ -2915,9 +2910,9 @@
   /* FIXME: need bfd *, so we can use bfd_section_vma methods. */
 
   CORE_ADDR a_start = a->vma;
-  CORE_ADDR a_end = a->vma + bfd_get_section_size_before_reloc (a);
+  CORE_ADDR a_end = a->vma + bfd_get_section_size (a);
   CORE_ADDR b_start = b->vma;
-  CORE_ADDR b_end = b->vma + bfd_get_section_size_before_reloc (b);
+  CORE_ADDR b_end = b->vma + bfd_get_section_size (b);
 
   return (a_start < b_end && b_start < a_end);
 }
@@ -2957,7 +2952,7 @@
 }
 
 
-/* Function: symbol_overlayed_address 
+/* Function: symbol_overlayed_address
    Return one of two addresses (relative to the VMA or to the LMA),
    depending on whether the section is mapped or not.  */
 
@@ -2984,7 +2979,7 @@
   return address;
 }
 
-/* Function: find_pc_overlay (PC) 
+/* Function: find_pc_overlay (PC)
    Return the best-match overlay section for PC:
    If PC matches a mapped overlay section's VMA, return that section.
    Else if PC matches an unmapped section's VMA, return that section.
@@ -3014,7 +3009,7 @@
 }
 
 /* Function: find_pc_mapped_section (PC)
-   If PC falls into the VMA address range of an overlay section that is 
+   If PC falls into the VMA address range of an overlay section that is
    currently marked as MAPPED, return that section.  Else return NULL.  */
 
 asection *
@@ -3052,7 +3047,7 @@
 
 	vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
 	lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
-	size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+	size = bfd_get_section_size (osect->the_bfd_section);
 	name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
 
 	printf_filtered ("Section %s, loaded at ", name);
@@ -3122,7 +3117,7 @@
 }
 
 /* Function: unmap_overlay_command
-   Mark the overlay section as unmapped 
+   Mark the overlay section as unmapped
    (ie. resident in its LMA address range, rather than the VMA range).  */
 
 void
@@ -3216,10 +3211,10 @@
 
 /* Target Overlays for the "Simplest" overlay manager:
 
-   This is GDB's default target overlay layer.  It works with the 
-   minimal overlay manager supplied as an example by Cygnus.  The 
-   entry point is via a function pointer "target_overlay_update", 
-   so targets that use a different runtime overlay manager can 
+   This is GDB's default target overlay layer.  It works with the
+   minimal overlay manager supplied as an example by Cygnus.  The
+   entry point is via a function pointer "target_overlay_update",
+   so targets that use a different runtime overlay manager can
    substitute their own overlay_update function and take over the
    function pointer.
 
@@ -3377,7 +3372,7 @@
 }
 #endif
 
-/* Function: simple_overlay_update_1 
+/* Function: simple_overlay_update_1
    A helper function for simple_overlay_update.  Assuming a cached copy
    of _ovly_table exists, look through it to find an entry whose vma,
    lma and size match those of OSECT.  Re-read the entry and make sure
@@ -3392,7 +3387,7 @@
   bfd *obfd = osect->objfile->obfd;
   asection *bsect = osect->the_bfd_section;
 
-  size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+  size = bfd_get_section_size (osect->the_bfd_section);
   for (i = 0; i < cache_novlys; i++)
     if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
 	&& cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
@@ -3414,11 +3409,11 @@
 }
 
 /* Function: simple_overlay_update
-   If OSECT is NULL, then update all sections' mapped state 
-   (after re-reading the entire target _ovly_table). 
-   If OSECT is non-NULL, then try to find a matching entry in the 
+   If OSECT is NULL, then update all sections' mapped state
+   (after re-reading the entire target _ovly_table).
+   If OSECT is non-NULL, then try to find a matching entry in the
    cached ovly_table and update only OSECT's mapped state.
-   If a cached entry can't be found or the cache isn't valid, then 
+   If a cached entry can't be found or the cache isn't valid, then
    re-read the entire cache, and go ahead and update all sections.  */
 
 static void
@@ -3453,7 +3448,7 @@
       bfd *obfd = osect->objfile->obfd;
       asection *bsect = osect->the_bfd_section;
 
-      size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+      size = bfd_get_section_size (bsect);
       for (i = 0; i < cache_novlys; i++)
 	if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
 	    && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
@@ -3600,7 +3595,7 @@
         (char *) &debug_file_directory,
         "Set the directory where separate debug symbols are searched for.\n"
         "Separate debug symbols are first searched for in the same\n"
-        "directory as the binary, then in the `" DEBUG_SUBDIRECTORY 
+        "directory as the binary, then in the `" DEBUG_SUBDIRECTORY
         "' subdirectory,\n"
         "and lastly at the path of the directory of the binary with\n"
         "the global debug-file directory prepended\n",
diff --git a/gdb/symfile.h b/gdb/symfile.h
index baa353e..b76d3ba 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -189,6 +189,10 @@
 extern struct objfile *symbol_file_add (char *, int,
 					struct section_addr_info *, int, int);
 
+extern struct objfile *symbol_file_add_from_bfd (bfd *, int,
+                                                 struct section_addr_info *,
+                                                 int, int);
+
 /* Create a new section_addr_info, with room for NUM_SECTIONS.  */
 
 extern struct section_addr_info *alloc_section_addr_info (size_t
@@ -315,7 +319,7 @@
 
 /* From dwarf2read.c */
 
-extern int dwarf2_has_info (bfd *abfd);
+extern int dwarf2_has_info (struct objfile *);
 
 extern void dwarf2_build_psymtabs (struct objfile *, int);
 extern void dwarf2_build_frame_info (struct objfile *);
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 6995891b5..cd6dd5d 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -114,9 +114,9 @@
 					  struct symtab **symtab);
 #endif
 
-/* This flag is used in hppa-tdep.c, and set in hp-symtab-read.c */
-/* Signals the presence of objects compiled by HP compilers */
-int hp_som_som_object_present = 0;
+/* This flag is used in hppa-tdep.c, and set in hp-symtab-read.c.
+   Signals the presence of objects compiled by HP compilers.  */
+int deprecated_hp_som_som_object_present = 0;
 
 static void fixup_section (struct general_symbol_info *, struct objfile *);
 
@@ -181,21 +181,25 @@
     
     if (full_path != NULL)
       {
-	const char *fp = symtab_to_filename (s);
-	if (FILENAME_CMP (full_path, fp) == 0)
-	  {
-	    return s;
-	  }
+        const char *fp = symtab_to_fullname (s);
+        if (fp != NULL && FILENAME_CMP (full_path, fp) == 0)
+          {
+            return s;
+          }
       }
 
     if (real_path != NULL)
       {
-	char *rp = gdb_realpath (symtab_to_filename (s));
-        make_cleanup (xfree, rp);
-	if (FILENAME_CMP (real_path, rp) == 0)
-	  {
-	    return s;
-	  }
+        char *fullname = symtab_to_fullname (s);
+        if (fullname != NULL)
+          {
+            char *rp = gdb_realpath (fullname);
+            make_cleanup (xfree, rp);
+            if (FILENAME_CMP (real_path, rp) == 0)
+              {
+                return s;
+              }
+          }
       }
   }
 
@@ -659,6 +663,14 @@
     return NULL;
 }
 
+/* Return the search name of a symbol---generally the demangled or
+   linkage name of the symbol, depending on how it will be searched for.
+   If there is no distinct demangled name, then returns the same value 
+   (same pointer) as SYMBOL_LINKAGE_NAME. */
+char *symbol_search_name (const struct general_symbol_info *gsymbol) {
+  return symbol_natural_name (gsymbol);
+}
+
 /* Initialize the structure fields to zero values.  */
 void
 init_sal (struct symtab_and_line *sal)
@@ -868,6 +880,62 @@
       ginfo->bfd_section = SYMBOL_BFD_SECTION (msym);
       ginfo->section = SYMBOL_SECTION (msym);
     }
+  else if (objfile)
+    {
+      /* Static, function-local variables do appear in the linker
+	 (minimal) symbols, but are frequently given names that won't
+	 be found via lookup_minimal_symbol().  E.g., it has been
+	 observed in frv-uclinux (ELF) executables that a static,
+	 function-local variable named "foo" might appear in the
+	 linker symbols as "foo.6" or "foo.3".  Thus, there is no
+	 point in attempting to extend the lookup-by-name mechanism to
+	 handle this case due to the fact that there can be multiple
+	 names.
+	 
+	 So, instead, search the section table when lookup by name has
+	 failed.  The ``addr'' and ``endaddr'' fields may have already
+	 been relocated.  If so, the relocation offset (i.e. the
+	 ANOFFSET value) needs to be subtracted from these values when
+	 performing the comparison.  We unconditionally subtract it,
+	 because, when no relocation has been performed, the ANOFFSET
+	 value will simply be zero.
+	 
+	 The address of the symbol whose section we're fixing up HAS
+	 NOT BEEN adjusted (relocated) yet.  It can't have been since
+	 the section isn't yet known and knowing the section is
+	 necessary in order to add the correct relocation value.  In
+	 other words, we wouldn't even be in this function (attempting
+	 to compute the section) if it were already known.
+
+	 Note that it is possible to search the minimal symbols
+	 (subtracting the relocation value if necessary) to find the
+	 matching minimal symbol, but this is overkill and much less
+	 efficient.  It is not necessary to find the matching minimal
+	 symbol, only its section.  
+	 
+	 Note that this technique (of doing a section table search)
+	 can fail when unrelocated section addresses overlap.  For
+	 this reason, we still attempt a lookup by name prior to doing
+	 a search of the section table.  */
+	 
+      CORE_ADDR addr;
+      struct obj_section *s;
+
+      addr = ginfo->value.address;
+
+      ALL_OBJFILE_OSECTIONS (objfile, s)
+	{
+	  int idx = s->the_bfd_section->index;
+	  CORE_ADDR offset = ANOFFSET (objfile->section_offsets, idx);
+
+	  if (s->addr - offset <= addr && addr < s->endaddr - offset)
+	    {
+	      ginfo->bfd_section = s->the_bfd_section;
+	      ginfo->section = idx;
+	      return;
+	    }
+	}
+    }
 }
 
 struct symbol *
@@ -1467,7 +1535,7 @@
 	    {
 	      do_linear_search = 1;
 	    }
-	  if (strcmp_iw_ordered (SYMBOL_NATURAL_NAME (*center), name) >= 0)
+	  if (strcmp_iw_ordered (SYMBOL_SEARCH_NAME (*center), name) >= 0)
 	    {
 	      top = center;
 	    }
@@ -1482,7 +1550,7 @@
       while (top <= real_top
 	     && (linkage_name != NULL
 		 ? strcmp (SYMBOL_LINKAGE_NAME (*top), linkage_name) == 0
-		 : SYMBOL_MATCHES_NATURAL_NAME (*top,name)))
+		 : SYMBOL_MATCHES_SEARCH_NAME (*top,name)))
 	{
 	  if (SYMBOL_DOMAIN (*top) == domain)
 	    {
@@ -1503,7 +1571,7 @@
 	    {
 	      if (linkage_name != NULL
 		  ? strcmp (SYMBOL_LINKAGE_NAME (*psym), linkage_name) == 0
-		  : SYMBOL_MATCHES_NATURAL_NAME (*psym, name))
+		  : SYMBOL_MATCHES_SEARCH_NAME (*psym, name))
 		{
 		  return (*psym);
 		}
@@ -2349,7 +2417,7 @@
 	  !section_is_mapped (section))
 	pc = overlay_unmapped_address (pc, section);
 
-      pc += FUNCTION_START_OFFSET;
+      pc += DEPRECATED_FUNCTION_START_OFFSET;
       pc = SKIP_PROLOGUE (pc);
 
       /* For overlays, map pc back into its mapped VMA range */
@@ -3921,7 +3989,7 @@
 
   /* Get an initial range for the function.  */
   find_pc_partial_function (func_addr, NULL, &start_pc, &end_pc);
-  start_pc += FUNCTION_START_OFFSET;
+  start_pc += DEPRECATED_FUNCTION_START_OFFSET;
 
   prologue_sal = find_pc_line (start_pc, 0);
   if (prologue_sal.line != 0)
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 16a212e..dfde997 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -258,6 +258,20 @@
 #define SYMBOL_MATCHES_NATURAL_NAME(symbol, name)			\
   (strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0)
 
+/* Macro that returns the name to be used when sorting and searching symbols. 
+   In  C++, Chill, and Java, we search for the demangled form of a name,
+   and so sort symbols accordingly.  In Ada, however, we search by mangled
+   name.  If there is no distinct demangled name, then SYMBOL_SEARCH_NAME
+   returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */
+#define SYMBOL_SEARCH_NAME(symbol)					 \
+   (symbol_search_name (&(symbol)->ginfo))
+extern char *symbol_search_name (const struct general_symbol_info *);
+
+/* Analogous to SYMBOL_MATCHES_NATURAL_NAME, but uses the search
+   name.  */
+#define SYMBOL_MATCHES_SEARCH_NAME(symbol, name)			\
+  (strcmp_iw (SYMBOL_SEARCH_NAME (symbol), (name)) == 0)
+
 /* Classification types for a minimal symbol.  These should be taken as
    "advisory only", since if gdb can't easily figure out a
    classification it simply selects mst_unknown.  It may also have to
@@ -877,6 +891,10 @@
 
   char *fullname;
 
+  /* Directory in which it was compiled, or NULL if we don't know.  */
+
+  char *dirname;
+
   /* Information about the object file from which symbols should be read.  */
 
   struct objfile *objfile;
@@ -1362,4 +1380,9 @@
 extern void set_main_name (const char *name);
 extern /*const */ char *main_name (void);
 
+/* Global to indicate presence of HP-compiled objects,
+   in particular, SOM executable file with SOM debug info 
+   Defined in symtab.c, used in hppa-tdep.c. */
+extern int deprecated_hp_som_som_object_present;
+
 #endif /* !defined(SYMTAB_H) */
diff --git a/gdb/target.c b/gdb/target.c
index d4ff6c0..75f81f3 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -41,8 +41,6 @@
 
 static void target_info (char *, int);
 
-static void maybe_kill_then_create_inferior (char *, char *, char **);
-
 static void maybe_kill_then_attach (char *, int);
 
 static void kill_or_be_killed (int);
@@ -151,8 +149,6 @@
 
 static int debug_to_lookup_symbol (char *, CORE_ADDR *);
 
-static void debug_to_create_inferior (char *, char *, char **);
-
 static void debug_to_mourn_inferior (void);
 
 static int debug_to_can_run (void);
@@ -339,10 +335,11 @@
 }
 
 static void
-maybe_kill_then_create_inferior (char *exec, char *args, char **env)
+maybe_kill_then_create_inferior (char *exec, char *args, char **env,
+				 int from_tty)
 {
   kill_or_be_killed (0);
-  target_create_inferior (exec, args, env);
+  target_create_inferior (exec, args, env, from_tty);
 }
 
 /* Go through the target stack from top to bottom, copying over zero
@@ -1268,20 +1265,12 @@
 void
 target_detach (char *args, int from_tty)
 {
-  /* Handle any optimized stores to the inferior.  */
-#ifdef DO_DEFERRED_STORES
-  DO_DEFERRED_STORES;
-#endif
   (current_target.to_detach) (args, from_tty);
 }
 
 void
 target_disconnect (char *args, int from_tty)
 {
-  /* Handle any optimized stores to the inferior.  */
-#ifdef DO_DEFERRED_STORES
-  DO_DEFERRED_STORES;
-#endif
   (current_target.to_disconnect) (args, from_tty);
 }
 
@@ -1348,12 +1337,13 @@
 }
 
 void
-find_default_create_inferior (char *exec_file, char *allargs, char **env)
+find_default_create_inferior (char *exec_file, char *allargs, char **env,
+			      int from_tty)
 {
   struct target_ops *t;
 
   t = find_default_run_target ("run");
-  (t->to_create_inferior) (exec_file, allargs, env);
+  (t->to_create_inferior) (exec_file, allargs, env, from_tty);
   return;
 }
 
@@ -1536,11 +1526,6 @@
   breakpoint_init_inferior (inf_exited);
   registers_changed ();
 
-#ifdef CLEAR_DEFERRED_STORES
-  /* Delete any pending stores to the inferior... */
-  CLEAR_DEFERRED_STORES;
-#endif
-
   reopen_exec_file ();
   reinit_frame_cache ();
 
@@ -1551,8 +1536,8 @@
   if (!show_breakpoint_hit_counts)
     breakpoint_clear_ignore_counts ();
 
-  if (detach_hook)
-    detach_hook ();
+  if (deprecated_detach_hook)
+    deprecated_detach_hook ();
 }
 
 /* Helper function for child_wait and the Lynx derivatives of child_wait.
@@ -2079,12 +2064,13 @@
 }
 
 static void
-debug_to_create_inferior (char *exec_file, char *args, char **env)
+debug_to_create_inferior (char *exec_file, char *args, char **env,
+			  int from_tty)
 {
-  debug_target.to_create_inferior (exec_file, args, env);
+  debug_target.to_create_inferior (exec_file, args, env, from_tty);
 
-  fprintf_unfiltered (gdb_stdlog, "target_create_inferior (%s, %s, xxx)\n",
-		      exec_file, args);
+  fprintf_unfiltered (gdb_stdlog, "target_create_inferior (%s, %s, xxx, %d)\n",
+		      exec_file, args, from_tty);
 }
 
 static void
diff --git a/gdb/target.h b/gdb/target.h
index 2d8ce37..92becca 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -353,7 +353,7 @@
     void (*to_kill) (void);
     void (*to_load) (char *, int);
     int (*to_lookup_symbol) (char *, CORE_ADDR *);
-    void (*to_create_inferior) (char *, char *, char **);
+    void (*to_create_inferior) (char *, char *, char **, int);
     void (*to_post_startup_inferior) (ptid_t);
     void (*to_acknowledge_created_inferior) (int);
     int (*to_insert_fork_catchpoint) (int);
@@ -712,8 +712,8 @@
    ENV is the environment vector to pass.  Errors reported with error().
    On VxWorks and various standalone systems, we ignore exec_file.  */
 
-#define	target_create_inferior(exec_file, args, env)	\
-     (*current_target.to_create_inferior) (exec_file, args, env)
+#define	target_create_inferior(exec_file, args, env, FROM_TTY)	\
+     (*current_target.to_create_inferior) (exec_file, args, env, (FROM_TTY))
 
 
 /* Some targets (such as ttrace-based HPUX) don't allow us to request
@@ -949,19 +949,19 @@
  * The old way of doing this is to define a macro 'target_new_objfile'
  * that points to the function that you want to be called on every
  * objfile/shlib load.
- *
- * The new way is to grab the function pointer, 'target_new_objfile_hook',
- * and point it to the function that you want to be called on every
- * objfile/shlib load.
- *
- * If multiple clients are willing to be cooperative, they can each
- * save a pointer to the previous value of target_new_objfile_hook
- * before modifying it, and arrange for their function to call the
- * previous function in the chain.  In that way, multiple clients
- * can receive this notification (something like with signal handlers).
- */
 
-extern void (*target_new_objfile_hook) (struct objfile *);
+   The new way is to grab the function pointer,
+   'deprecated_target_new_objfile_hook', and point it to the function
+   that you want to be called on every objfile/shlib load.
+
+   If multiple clients are willing to be cooperative, they can each
+   save a pointer to the previous value of
+   deprecated_target_new_objfile_hook before modifying it, and arrange
+   for their function to call the previous function in the chain.  In
+   that way, multiple clients can receive this notification (something
+   like with signal handlers).  */
+
+extern void (*deprecated_target_new_objfile_hook) (struct objfile *);
 
 #ifndef target_pid_or_tid_to_str
 #define target_pid_or_tid_to_str(ID) \
@@ -1088,15 +1088,6 @@
     (*current_target.to_stopped_data_address) ()
 #endif
 
-/* Sometimes gdb may pick up what appears to be a valid target address
-   from a minimal symbol, but the value really means, essentially,
-   "This is an index into a table which is populated when the inferior
-   is run.  Therefore, do not attempt to use this as a PC."  */
-
-#if !defined(PC_REQUIRES_RUN_BEFORE_USE)
-#define PC_REQUIRES_RUN_BEFORE_USE(pc) (0)
-#endif
-
 /* This will only be defined by a target that supports catching vfork events,
    such as HP-UX.
 
@@ -1182,7 +1173,7 @@
 
 extern void find_default_attach (char *, int);
 
-extern void find_default_create_inferior (char *, char *, char **);
+extern void find_default_create_inferior (char *, char *, char **, int);
 
 extern struct target_ops *find_run_target (void);
 
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 6c85be8..a59e259 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,496 @@
+2004-07-08  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* gdb.java/jmain.exp: Fix expected line number for main to
+	break at.  Set XFAIL for break at main test since gcj does not 
+	provide line number info for first statement in main.
+
+2004-07-08  Andrew Cagney  <cagney@gnu.org>
+
+	* gdb.base/attach.exp: Cleanup copyright.  Re-indent.
+
+	* gdb.base/sigbpt.exp: Make the common part of each test name a
+	prefix instead of suffix.
+
+2004-07-07  Bob Rossi  <bob_rossi@cox.net>
+
+	* gdb.mi/mi2-file.exp: Revert to version 1.1, except changed name of
+	test from test_tbreak_creation_and_listing to
+	test_file_list_exec_source_file
+	* gdb.mi/mi-file.exp: Add test for -file-list-exec-source-files
+	Changed name of test from test_tbreak_creation_and_listing to
+	test_file_list_exec_source_file
+
+2004-07-07  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* gdb.java/jmisc.exp: Fix expected output of ptype to look for
+	the jmisc() constructor instead of <init>.
+	* gdb.java/jmisc1.exp: Ditto.
+
+2004-07-07  Andrew Cagney  <cagney@gnu.org>
+
+	* gdb.base/sigbpt.exp (stepi_out): Check for a single step
+	corrupting the PC.
+
+2004-07-06  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.cp/templates.exp: Accept whitespace change in demangler
+	output.
+
+2004-07-06  Andrew Cagney  <cagney@gnu.org>
+
+	* gdb.base/sigbpt.exp, gdb.base/sigbpt.c: New test.
+
+2004-07-02  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* lib/compiler.c: Accept __HP_CXD_SPP for old hp ansi c compiler.
+	* lib/compiler.cc: Likewise.
+
+2004-06-30  Michael Chastain   <mec.gnu@mindspring.com>
+
+	* lib/compiler.cc: Work around string preprocessing problem
+	with old hp c++ compiler.
+	* lib/compiler.c: Likewise.
+
+2004-06-29  Corinna Vinschen  <vinschen@redhat.com>
+
+	* gdb.arch/i386-prologue.c: Add copyright header.  Use preprocessor
+	directives to conditionalize symbol prefixing.
+	* gdb.arch/i386-prologue.exp: Allow symbol prefixing by adding
+	additional_flags handling.  Add underscore prefix for Cygwin.
+	* gdb.arch/i386-unwind.c: Use preprocessor directives to
+	conditionalize symbol prefixing.
+	* gdb.arch/i386-unwind.exp: Allow symbol prefixing by adding
+	additional_flags handling.  Add underscore prefix for Cygwin.
+
+2004-06-29  Corinna Vinschen  <vinschen@redhat.com>
+
+	* gdb.base/bigcore.exp: Skip test on Cygwin.
+
+2004-06-28  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.hp/gdb.base-hp/reg.exp: Accept both old and new gdb output
+	formats for "info register".  Use gdb_test_multiple.  Fix
+	the "invalid register" test.
+
+2004-06-28  Corinna Vinschen  <vinschen@redhat.com>
+
+	* gdb.base/attach.exp: Fix copyright date.  Set testpid to Windows
+	PID for Cygwin.  Add Cygwin specific strings to check for in some
+	tests.
+	(do_attach_tests): Add a test for user interaction when attaching
+	to a process with no matching symbol table already loaded.
+
+2004-06-26  Andrew Cagney  <cagney@gnu.org>
+
+	Test PR java/1567 and PR java/1565.
+	* gdb.java/jmain.exp, gdb.java/jmain.java: New files.
+	* gdb.java/jmisc2.exp: Delete file.
+
+2004-06-26  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.hp/gdb.base-hp/reg.exp: Update copyright notice.
+
+2004-06-25  Corinna Vinschen  <vinschen@redhat.com>
+
+	* gdb.base/attach.exp (do_attach_tests): Don't forget to kill second
+	attach process.
+
+2004-06-23  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.cp/pr-1553.exp: Remove.
+
+2004-06-22  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.cp/pr-1553.cc: Remove.
+	* gdb.cp/pr-1553.exp: Disable this test.
+
+2004-06-20  Jim Blandy  <jimb@redhat.com>
+
+        Fix PR testsuite/1680.
+	* gdb.arch/i386-sse.exp: Properly quote curly braces in
+	regular expressions.
+
+2004-06-19  Michael Chastain  <mec.gnu@mindspring.com>
+
+	Fix PR testsuite/1679.
+	* gdb.arch/i386-sse.exp: Do not call gdb_suppress_entire_file.
+	Issue an UNSUPPORTED result instead.
+
+2004-06-18  Jim Blandy  <jimb@redhat.com>
+
+	* gdb.base/charset.exp: Only send a control-C if we see a new
+	prompt and incomplete command.
+
+2004-06-18  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.cp/pr-574.cc: Add copyright notice.
+
+2004-06-17  Jim Blandy  <jimb@redhat.com>
+
+	* gdb.base/charset.exp: Don't refer to $expect_out(1,string) in
+	cases where the regexp has no groups; this grabs random text from
+	the previous test suite, whatever that was.
+
+2004-06-17  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.cp/printmethod.cc: Add copyright notice.
+
+2004-06-16  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.cp/psmang1.cc, gdb.cp/psmang2.cc: Add copyright notice.
+
+2004-06-16  Andrew Cagney  <cagney@gnu.org>
+
+	* gdb.base/signull.c: Update copyright.  Include <string.h>.
+	(bowler): Replace data_pointer with data_read
+	and data_write cases.  Add code_descriptor case.
+	(zero, desc): New array and pointer.
+	(data, code): Change to simple pointers.
+	* gdb.base/signull.exp: Fix probe pattern matching a function
+	descriptor SIGSEGV.  Replace data_pointer with data_read and
+	data_write tests.
+
+2004-06-16  Andrew Cagney  <cagney@gnu.org>
+
+	* gdb.base/long_long.exp, gdb.base/long_long.c: Rewrite.
+
+2004-06-15  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.base/long_long.c: Add copyright notice.
+
+2004-06-15  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.base/long_long.exp: Remove reference to
+	bug-gdb@prep.ai.mit.edu.  Change line-number-specific breakpoint
+	to gdb_breakpoint and gdb_continue_to_breakpoint.
+
+2004-06-14  Jim Blandy  <jimb@redhat.com>
+
+	* gdb.arch/e500-regs.exp: Fix up 'print' pattern for the little-
+	endian case.
+
+2004-06-14  Andrew Cagney  <cagney@gnu.org>
+
+	* gdb.base/gcore.exp (capture_command_output): Delete the always
+	passing tests containing inferior values.
+	* gdb.base/ending-run.exp: Do not include the breakpoint address
+	in the test message.  Update copyright.
+	* gdb.base/sizeof.exp (check_sizeof): Do not include the type's
+	size in the test name, use gdb_test_multiple.  Update copyright.
+
+2004-06-14  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.cp/ref-types.cc: Add copyright notice.
+
+2004-06-14  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* lib/compiler.c: Remove gcc_compiled, hp_cc_compiler,
+	hp_aCC_compiler.
+	* lib/compiler.cc: Likewise.
+	* lib/gdb.exp (get_compiler_info): Eval lines only if they are
+	'set' commands.  Log diagnostics for other lines.  Set
+	gcc_compiled, hp_cc_compiler, and hp_aCC_compiler.
+
+2004-06-13  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.cp/try_catch.cc: Add copyright notice.
+
+2004-06-12  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.cp/userdef.cc: Add copyright notice.
+
+2004-06-11  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.cp/virtfunc.cc: Add copyright notice.
+
+2004-06-11  Randolph Chung  <tausq@debian.org>
+
+	* gdb.base/structs2.exp: Mark two tests as xfail because of a compiler
+	problem.
+
+2004-06-10  Andrew Cagney  <cagney@gnu.org>
+
+	* lib/compiler.cc, lib/compiler.c: Append either
+	__GNUC_PATCHLEVEL__, or "unknown" to the compiler_info.
+	* gdb.base/structs.exp (test_struct_calls): Check for gcc-3-3-*
+	instead of gcc-3-3.
+
+2004-06-09  Andrew Cagney  <cagney@gnu.org>
+
+	* gdb.base/structs.exp (test_struct_calls): Fix KFAIL for
+	gdb/1455, bug is specific to "long long" and "double".
+	
+	* gdb.base/structs.exp (test_struct_returns, test_struct_returns)
+	(test_struct_calls): Remove KFAIL of "long double" on i*86-*-*,
+	x86_64-*-*, sparc64-*-*, and sparc*-*-solaris2*.  PR tdep/1447
+	fixed.
+
+2004-06-09  Andrew Cagney  <cagney@gnu.org>
+
+	* gdb.base/structs.exp (test_struct_returns): Replace
+	"return_value_unknown" and "finish_value_unknown" by
+	"return_value_known" and "finish_value_known".  Instead of
+	"return_value_unknown" iff "finish_value_unknown", check
+	"return_value_known" implies "finish_value_known".
+
+2004-06-08  Martin Hunt  <hunt@redhat.com>
+
+	* gdb.base/float.exp: Add pattern for mips targets.
+
+2004-06-08  Randolph Chung  <tausq@debian.org>
+
+	* gdb.base/float.exp: Add pattern for hppa*-* target; make the failure
+	message for unknown architectures more clear.
+
+2004-06-08  Joel Brobecker  <brobecker@gnat.com>
+
+	* gdb.ada/null_record.exp: Use "start" instead of "begin" to
+	start the execution of the program.
+
+2004-06-07  Jim Blandy  <jimb@redhat.com>
+
+	* gdb.arch/i386-sse.exp, gdb.arch/i386-sse.c: New tests.
+	* gdb.arch/i386-cpuid.h: New helper file.
+
+2004-06-07  Randolph Chung  <tausq@debian.org>
+
+	* gdb.base/shlib-call.exp: Allow breakpoint to be added after inferior
+	has started.
+
+2004-06-04  Roland McGrath  <roland@redhat.com>
+
+	Fix PR gdb/1647.
+	* gdb.base/auxv.exp (fetch_auxv): Revert last change and fix it
+	differently to be robust to output buffering differences.
+
+2004-06-04  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.threads/pthreads.exp: Update copyright years.
+	(check_control_c): Change asynchronous 'after' to synchronous.
+
+2004-06-04  Roland McGrath  <roland@redhat.com>
+
+	* gdb.base/auxv.exp (fetch_auxv): Consume output fully through
+	next gdb prompt.
+
+2004-06-02  Michael Chastain  <mec.gnu@mindspring.com>
+
+	Fix PR gdb/1636.
+	* gdb.threads/manythreads.exp: Change asynchronous 'after'
+	calls to synchronous.
+
+2004-05-26  Jim Blandy  <jimb@redhat.com>
+
+	* gdb.arch/e500-prologue.exp, gdb.arch/e500-prologue.c: New tests.
+
+2004-05-24  Randolph Chung  <tausq@debian.org>
+
+	* gdb.asm/asm-source.exp: Enable test for hppa-linux target.
+	* gdb.asm/pa.inc: New file.
+
+2004-05-22  Mark Kettenis  <kettenis@gnu.org>
+
+	* gdb.base/signull.c: Use sigjmp_buf instead of jmp_buf.
+
+2004-05-21  Joel Brobecker  <brobecker@gnat.com>
+            Daniel Jacobowitz  <drow@mvista.com>
+
+	* lib/gdb.exp (gdb_test_multiple): Improve regexp matching the
+	GDB prompt.
+
+2004-05-20  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+	* gdb.base/signull.c: Use sigsetjmp/siglongjmp instead of
+	setjmp/longjmp.  Use sigaction instead of signal.
+
+2004-05-19  J. Brobecker  <brobecker@gnat.com>
+            Michael Snyder  <msnyder@redhat.com>
+
+	* gdb.threads/pthread_cond_wait.c: New file.
+	* gdb.threads/pthread_cond_wait.exp: New testcase.
+
+2004-05-13  Andrew Cagney  <cagney@redhat.com>
+
+	* gdb.base/signull.exp, gdb.base/signull.c: New files.
+	* gdb.base/gdb1476.c, gdb.base/gdb1476.exp: Delete files.
+
+2004-05-11  Andrew Cagney  <cagney@redhat.com>
+
+	* gdb.base/sigstep.exp (advancei): Update KFAILs.  gdb/1613 is
+	fixed but revealed gdb/1639.
+
+2004-05-10  Andrew Cagney  <cagney@redhat.com>
+
+	* gdb.base/signals.exp (signal_tests_1): Simplify "continue to
+	func1" and "next to 2nd alarm", kernel bug avoided.
+
+2004-05-10  Daniel Jacobowitz  <dan@debian.org>
+
+	PR external/1568
+	* gdb.base/bigcore.exp: Check the size of the dumped core file.
+	XFAIL if it is smaller than bytes_allocated.
+	* gdb.base/bigcore.c (bytes_allocated): Make static and unsigned.
+	(main): Make chunks_allocated unsigned.  Correct comment.
+
+2004-05-07  Joel Brobecker  <brobecker@gnat.com>
+
+	* gdb.arch/powerpc-aix-prologue.c: New file.
+	* gdb.arch/powerpc-aix-prologue.exp: New file.
+
+2004-05-07  Jim Blandy  <jimb@redhat.com>
+
+	* gdb.base/lineinc.exp, gdb.base/lineinc1.h, gdb.base/lineinc2.h,
+	gdb.base/lineinc3.h, gdb.base/lineinc.c: New tests.
+
+2004-05-06  Joel Brobecker  <brobecker@gnat.com>
+
+	* gdb.base/sep.exp: No longer setup_kfail when the program was
+	built with dwarf2.
+
+2004-05-05  Jim Ingham  <jingham@apple.com>
+
+	* gdb.base/pending.exp: Make sure pending breakpoints
+	preserve the ignore count.
+
+2004-04-27  Jerome Guitton  <guitton@gnat.com>
+
+	* i386-prologue.exp: Add testcase for jump instruction as first
+	instruction of the real code.
+	* i386-prologue.c (jump_at_beginning): New function.
+
+2004-04-28  Mark Kettenis  <kettenis@gnu.org>
+
+	* gdb.base/call-sc.exp: Remove patterns to KFAIL PR gdb/1624 on
+	x86_64-*-*.
+
+2004-04-28  Mark Kettenis  <kettenis@gnu.org>
+
+	* gdb.base/call-sc.exp: Remove patterns to KFAIL PR gdb/1623 on
+	i*86-*-*.
+
+2004-04-25  Mark Kettenis  <kettenis@gnu.org>
+
+	* gdb.base/call-sc.exp (start_scalars_test): Fix regular
+	expression that checks the return type.
+
+2004-04-23  Andrew Cagney  <cagney@redhat.com>
+
+	* gdb.base/call-sc.exp: New test of scalar call/return values.
+	* gdb.base/call-sc.c: Ditto.
+
+2004-04-23  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+	* gdb.threads/manythreads.c: Reduce thread stack size.
+
+2004-04-23  Jeff Johnston  <jjohnstn@redhat.com>
+
+	* gdb.threads/manythreads.c: Add copyright notice.
+
+2004-04-23  Andrew Cagney  <cagney@redhat.com>
+
+	* gdb.base/siginfo.exp: Better handle step out of signal.
+	* gdb.base/sigstep.exp: Ditto.
+
+2004-04-22  Jeff Johnston  <jjohnstn@redhat.com>
+            Daniel Jacobowitz  <drow@mvista.com>
+
+	* gdb.threads/manythreads.c: New testcase.
+	* gdb.threads/manythreads.exp: Ditto.
+
+2004-04-22  Jim Blandy  <jimb@redhat.com>
+
+	* gdb.stabs/exclfwd.exp, gdb.stabs/exclfwd1.c,
+	gdb.stabs/exclfwd2.c, gdb.stabs/exclfwd.h: New test.
+
+2004-04-21  Michael Chastain  <mec.gnu@mindspring.com>
+
+	* gdb.stabs/weird.exp: Accept full pathname for $binfile.
+
+2004-04-21  Andrew Cagney  <cagney@redhat.com>
+
+	* gdb.base/sigstep.c: New file.
+	* gdb.base/sigstep.exp: New file.
+
+2004-04-16  Joel Brobecker  <brobecker@gnat.com>
+
+	* gdb.gdb/observer.exp (test_normal_stop_notifications): Update
+	call to observer_notify_normal_stop.
+
+2004-04-15  Andrew Cagney  <cagney@redhat.com>
+
+	* gdb.base/siginfo.c: New file.
+	* gdb.base/siginfo.exp: New file.
+
+2004-04-12  J. Brobecker  <brobecker@gnat.com>
+
+	* gdb.base/sep.exp: Fix typo in comment.
+
+2004-04-12  J. Brobecker  <brobecker@gnat.com>
+
+	* gdb.base/sep.c: New file.
+	* gdb.base/sep-proc.c: New file.
+	* gdb.base/sep.exp: New testcase.
+
+2004-04-09  Mark Kettenis  <kettenis@gnu.org>
+
+	* gdb.base/bigcore.exp: Disable on Solaris; no sparse core file
+	support.
+
+2004-04-05  Andrew Cagney  <cagney@redhat.com>
+
+	* gdb.base/sigaltstack.c: New file.
+	* gdb.base/sigaltstack.exp: New file.
+
+2004-04-04  Joel Brobecker  <brobecker@gnat.com>
+
+	* gdb.base/foll-fork.exp: Update the expected output for
+	"help set follow-fork-mode", to match a change that was made
+	to the help of this variable on 2004-01-13.
+
+2004-04-01  Joel Brobecker  <brobecker@gnat.com>
+
+	* lib/ada.exp: Add copyright notice.
+	* bar.ads: Likewise.
+	* bar.adb: Likewise.
+	* null_record.adb: Likewise.
+	* null_record.exp: Likewise.
+	* gnat_ada.gpr.in: Likewise. Fix typo in a comment, clarify another.
+
+2004-04-01  Joel Brobecker  <brobecker@gnat.com>
+
+	* configure.in: Generate gdb.ada/Makefile and gdb.ada/gnat_ada.gpr.
+	* configure: Regenerate.
+
+2004-04-01  Joel Brobecker  <brobecker@gnat.com>
+
+	* lib/ada.exp (gdb_compile_ada): Emit UNSUPPORTED if we failed
+	to build the application. Remove the message printed when in
+	verbose mode, redundant with the UNSUPPORTED message above.
+
+2004-03-31  Joel Brobecker  <brobecker@gnat.com>
+
+	* gdb.ada (bar.ads, bar.adb, null_record.adb): New files.
+	* gdb.ada (null_record.exp): New testcase.
+
+2004-03-31  Joel Brobecker  <brobecker@gnat.com>
+
+	* Makefile.in (ALL_SUBDIRS) Add gdb.ada.
+
+2004-03-31  Joel Brobecker  <brobecker@gnat.com>
+
+	* gdb.ada: New subdirectory.
+	* gdb.ada/Makefile.in: New file.
+	* gdb.ada/gnat_ada.gpr.in: New file.
+
+2004-03-31  Joel Brobecker  <brobecker@gnat.com>
+
+	* lib/ada.exp: New file.
+
+2004-03-24  Daniel Jacobowitz  <drow@mvista.com>
+
+	* gdb.base/gdb1250.exp: Use runto {allow-pending}.
+	* lib/gdb.exp (runto, gdb_breakpoint): Support {allow-pending}.
+
 2004-03-22  Andrew Cagney  <cagney@redhat.com>
 
 	* gdb.base/watchpoint.exp (test_stepping): Delete bogus XFAILs
diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index 3f3b7ad..99c0a8f 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -35,8 +35,8 @@
 EXEEXT = @EXEEXT@
 SUBDIRS = @subdirs@
 RPATH_ENVVAR = @RPATH_ENVVAR@
-ALL_SUBDIRS = gdb.arch gdb.asm gdb.base gdb.cp gdb.disasm gdb.java gdb.mi \
-	gdb.objc gdb.threads gdb.trace $(SUBDIRS)
+ALL_SUBDIRS = gdb.ada gdb.arch gdb.asm gdb.base gdb.cp gdb.disasm \
+	gdb.java gdb.mi gdb.objc gdb.threads gdb.trace $(SUBDIRS)
 
 EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
           echo $${rootme}/../../expect/expect ; \
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index 1419ba1..cbf3652 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -917,7 +917,7 @@
   if { (eval echo configure:918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
-      *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;;
+      *.c | *.o | *.obj | *.ilk | *.pdb) ;;
       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
       esac
     done
@@ -1049,7 +1049,8 @@
 
 ac_given_srcdir=$srcdir
 
-trap 'rm -fr `echo "Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
+trap 'rm -fr `echo "Makefile gdb.ada/Makefile gdb.ada/gnat_ada.gpr \
+  gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
   gdb.cp/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \
   gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
@@ -1143,7 +1144,8 @@
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
+CONFIG_FILES=\${CONFIG_FILES-"Makefile gdb.ada/Makefile gdb.ada/gnat_ada.gpr \
+  gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
   gdb.cp/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \
   gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile"}
 EOF
diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in
index 49b0444..4b95363 100644
--- a/gdb/testsuite/configure.in
+++ b/gdb/testsuite/configure.in
@@ -112,6 +112,7 @@
 AC_EXEEXT
 
 AC_CONFIG_SUBDIRS($configdirs)
-AC_OUTPUT([Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
+AC_OUTPUT([Makefile gdb.ada/Makefile gdb.ada/gnat_ada.gpr \
+  gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
   gdb.cp/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \
   gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile])
diff --git a/gdb/testsuite/gdb.ada/Makefile.in b/gdb/testsuite/gdb.ada/Makefile.in
new file mode 100644
index 0000000..1fb2048
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/Makefile.in
@@ -0,0 +1,21 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = null_record
+
+MISCELLANEOUS =
+
+all info install-info dvi install uninstall installcheck check:
+	@echo "Nothing to be done for $@..."
+
+clean mostlyclean:
+	-gnatclean -Pgnat_ada -q $(EXECUTABLES)
+	-rm -f *~ *.o a.out xgdb *.x *.ci *.tmp
+	-rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES)
+	-rm -f $(MISCELLANEOUS) twice-tmp.c
+
+distclean maintainer-clean realclean: clean
+	-rm -f *~ core
+	-rm -f Makefile config.status config.log gnat_ada.gpr
+	-rm -f *-init.exp
+	-rm -fr *.log summary detail *.plog *.sum *.psum site.*
diff --git a/gdb/testsuite/gdb.ada/bar.adb b/gdb/testsuite/gdb.ada/bar.adb
new file mode 100644
index 0000000..9c75139
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/bar.adb
@@ -0,0 +1,24 @@
+--  Copyright 2004 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
+--  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.
+
+package body Bar is
+
+   procedure Do_Nothing is
+   begin
+      null;
+   end Do_Nothing;
+
+end Bar;
diff --git a/gdb/testsuite/gdb.ada/bar.ads b/gdb/testsuite/gdb.ada/bar.ads
new file mode 100644
index 0000000..c3ca11b
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/bar.ads
@@ -0,0 +1,23 @@
+--  Copyright 2004 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
+--  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.
+
+package Bar is
+
+   type Empty is null record;
+
+   procedure Do_Nothing;
+
+end Bar;
diff --git a/gdb/testsuite/gdb.ada/gnat_ada.gpr.in b/gdb/testsuite/gdb.ada/gnat_ada.gpr.in
new file mode 100644
index 0000000..23cd558
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/gnat_ada.gpr.in
@@ -0,0 +1,27 @@
+--  Copyright 2004 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
+--  the Free Software Foundation; either version 2 of the License, or
+--  (at your option) any later version.
+--
+--  This program is distributed in the hope that it will be useful,
+--  but WITHOUT ANY WARRANTY; without even the implied warranty of
+--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+--  GNU General Public License for more details.
+--
+--  You should have received a copy of the GNU General Public License
+--  along with this program; if not, write to the Free Software
+--  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+--  This project file allows us to control the location where the
+--  compilation artifacts produced when building the Ada examples
+--  are stored.
+
+project Gnat_Ada is
+
+   for Source_Dirs use ("@srcdir@");
+   --  No need to set the Object_Dir, it is set to "." by default
+   --  (which means the same directory as this project file).
+
+end Gnat_Ada;
diff --git a/gdb/testsuite/gdb.ada/null_record.adb b/gdb/testsuite/gdb.ada/null_record.adb
new file mode 100644
index 0000000..260b3d6
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/null_record.adb
@@ -0,0 +1,23 @@
+--  Copyright 2004 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
+--  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.
+
+with Bar; use Bar;
+
+procedure Null_Record is
+begin
+   Do_Nothing;
+end Null_Record;
+
diff --git a/gdb/testsuite/gdb.ada/null_record.exp b/gdb/testsuite/gdb.ada/null_record.exp
new file mode 100644
index 0000000..d98867c
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/null_record.exp
@@ -0,0 +1,43 @@
+# Copyright 2004 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
+# 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.  
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+load_lib "ada.exp"
+
+set testfile "null_record"
+set srcfile ${testfile}.adb
+set binfile ${objdir}/${subdir}/${testfile}
+
+if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
+  return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "start" \
+         "Breakpoint \[0-9\]+ at .*null_record.adb.*" \
+         "start"
+
+gdb_test "ptype empty" \
+         "type = record null; end record" \
+         "ptype on null record"
diff --git a/gdb/testsuite/gdb.arch/e500-prologue.c b/gdb/testsuite/gdb.arch/e500-prologue.c
new file mode 100644
index 0000000..f9e83da
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/e500-prologue.c
@@ -0,0 +1,54 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2004 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
+   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.  */
+
+void arg_passing_test2 (void);
+
+int
+main (void)
+{
+  arg_passing_test2 ();
+  return 0;
+}
+
+
+/* Asm for procedure arg_passing_test2.
+
+   The challenge here is getting past the 'mr 0,3' and 'stb'
+   instructions.  */
+
+asm ("	.section	\".text\"\n"
+     "	.align 2\n"
+     "	.globl arg_passing_test2\n"
+     "	.type	arg_passing_test2, @function\n"
+     "arg_passing_test2:\n"
+     "	stwu 1,-64(1)\n"
+     "	stw 31,60(1)\n"
+     "	mr 31,1\n"
+     "	mr 0,3\n"
+     "	evstdd 4,16(31)\n"
+     "	stw 5,24(31)\n"
+     "	stw 7,32(31)\n"
+     "	stw 8,36(31)\n"
+     "	stw 9,40(31)\n"
+     "	stb 0,8(31)\n"
+     "	lwz 11,0(1)\n"
+     "	lwz 31,-4(11)\n"
+     "	mr 1,11\n"
+     "	blr\n"
+     "	.size	arg_passing_test2, .-arg_passing_test2\n");
diff --git a/gdb/testsuite/gdb.arch/e500-prologue.exp b/gdb/testsuite/gdb.arch/e500-prologue.exp
new file mode 100644
index 0000000..06dec9f
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/e500-prologue.exp
@@ -0,0 +1,82 @@
+# Copyright 2004 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+#
+# This file is part of the gdb testsuite.
+
+if $tracelevel {
+    strace $tracelevel
+}
+
+# Test PowerPC E500 prologue analyzer.
+
+set prms_id 0
+set bug_id 0
+
+if ![istarget "powerpc-*"] then {
+    verbose "Skipping powerpc E500 prologue tests."
+    return
+}
+
+set testfile "e500-prologue"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] != "" } {
+    unsupported "Testcase compile failed."
+    return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Insert a breakpoint in FUNCTION and verifies that the breakpoint was
+# inserted at the expected location.  EXPECTED_LOCATION should be an
+# offset relative to the function start address.
+proc insert_breakpoint {function expected_location} {
+    global gdb_prompt
+    global expect_out
+    global hex
+    
+    set address ""
+
+    # Insert a breakpoint using the given function name, and extract
+    # the breakpoint address for the output.
+    gdb_test_multiple "break $function" "set breakpoint in $function" {
+        -re "Breakpoint 1 at ($hex).*$gdb_prompt $" {
+            set address $expect_out(1,string)
+        }
+        default {
+            fail "set breakpoint in $function"
+        }
+    }
+
+    # If we managed to get the breakpoing address, then check that
+    # we inserted it at the expected location by examining the
+    # instruction at that address (we're not interested in the insn
+    # itself, but rather at the address printed at the begining of
+    # the instruction).
+    if { $address != "" } then {
+       gdb_test "x /i $address" \
+                ".*<$function\\+$expected_location>.*" \
+                "check $function breakpoint address"
+    } else {
+       fail "unable to compute breakpoint address"
+    }
+
+}
+
+insert_breakpoint "arg_passing_test2" 40
diff --git a/gdb/testsuite/gdb.arch/e500-regs.exp b/gdb/testsuite/gdb.arch/e500-regs.exp
index 9224704..30dae0a 100644
--- a/gdb/testsuite/gdb.arch/e500-regs.exp
+++ b/gdb/testsuite/gdb.arch/e500-regs.exp
@@ -1,4 +1,4 @@
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2004 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
@@ -112,7 +112,7 @@
 if {$endianness == "big"} {
      set decimal_vector ".uint64 = 4294967297, v2_float = .1.*e-45, 1.*e-45., v2_int32 = .1, 1., v4_int16 = .0, 1, 0, 1., v8_int8 = ..000.000.000.001.000.000.000.001.."
 } else {
-     set decimal_vector ".uint64 = 0x0000000100000001, v2_float = .1.*e-45, 1.*e-45., v2_int32 = .1, 1., v4_int16 = .1, 0, 1, 0., v8_int8 = ..001.000.000.000.001.000.000.000.001.000.000.000.001.000.000.."
+     set decimal_vector ".uint64 = 4294967297, v2_float = .1.*e-45, 1.*e-45., v2_int32 = .1, 1., v4_int16 = .1, 0, 1, 0., v8_int8 = ..001.000.000.000.001.000.000.."
 }
 
 for {set i 0} {$i < 32} {incr i 1} {
diff --git a/gdb/testsuite/gdb.arch/i386-cpuid.h b/gdb/testsuite/gdb.arch/i386-cpuid.h
new file mode 100644
index 0000000..067b22f
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/i386-cpuid.h
@@ -0,0 +1,77 @@
+/* Helper file for i386 platform.  Runtime check for MMX/SSE/SSE2 support.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* Used by 20020523-2.c and i386-sse-6.c, and possibly others.  */
+/* Plagarized from 20020523-2.c.  */
+/* Plagarized from gcc.  */
+
+#define bit_CMOV (1 << 15)
+#define bit_MMX (1 << 23)
+#define bit_SSE (1 << 25)
+#define bit_SSE2 (1 << 26)
+
+#ifndef NOINLINE
+#define NOINLINE __attribute__ ((noinline))
+#endif
+
+unsigned int i386_cpuid (void) NOINLINE;
+
+unsigned int NOINLINE
+i386_cpuid (void)
+{
+  int fl1, fl2;
+
+#ifndef __x86_64__
+  /* See if we can use cpuid.  On AMD64 we always can.  */
+  __asm__ ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;"
+	   "pushl %0; popfl; pushfl; popl %0; popfl"
+	   : "=&r" (fl1), "=&r" (fl2)
+	   : "i" (0x00200000));
+  if (((fl1 ^ fl2) & 0x00200000) == 0)
+    return (0);
+#endif
+
+  /* Host supports cpuid.  See if cpuid gives capabilities, try
+     CPUID(0).  Preserve %ebx and %ecx; cpuid insn clobbers these, we
+     don't need their CPUID values here, and %ebx may be the PIC
+     register.  */
+#ifdef __x86_64__
+  __asm__ ("pushq %%rcx; pushq %%rbx; cpuid; popq %%rbx; popq %%rcx"
+	   : "=a" (fl1) : "0" (0) : "rdx", "cc");
+#else
+  __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx"
+	   : "=a" (fl1) : "0" (0) : "edx", "cc");
+#endif
+  if (fl1 == 0)
+    return (0);
+
+  /* Invoke CPUID(1), return %edx; caller can examine bits to
+     determine what's supported.  */
+#ifdef __x86_64__
+  __asm__ ("pushq %%rcx; pushq %%rbx; cpuid; popq %%rbx; popq %%rcx"
+	   : "=d" (fl2), "=a" (fl1) : "1" (1) : "cc");
+#else
+  __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx"
+	   : "=d" (fl2), "=a" (fl1) : "1" (1) : "cc");
+#endif
+
+  return fl2;
+}
diff --git a/gdb/testsuite/gdb.arch/i386-prologue.c b/gdb/testsuite/gdb.arch/i386-prologue.c
index 4c92a9c..15ed2ca 100644
--- a/gdb/testsuite/gdb.arch/i386-prologue.c
+++ b/gdb/testsuite/gdb.arch/i386-prologue.c
@@ -1,11 +1,40 @@
+/* Unwinder test program.
+
+   Copyright 2003, 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifdef SYMBOL_PREFIX
+#define SYMBOL(str)	SYMBOL_PREFIX #str
+#else
+#define SYMBOL(str)	#str
+#endif
+
 void gdb1253 (void);
 void gdb1338 (void);
+void jump_at_beginning (void);
 
 int
 main (void)
 {
   gdb1253 ();
   gdb1338 ();
+  jump_at_beginning ();
   return 0;
 }
 
@@ -13,7 +42,7 @@
 
 asm(".text\n"
     "    .align 8\n"
-    "gdb1253:\n"
+    SYMBOL (gdb1253) ":\n"
     "    pushl %ebp\n"
     "    xorl  %ecx, %ecx\n"
     "    movl  %esp, %ebp\n"
@@ -26,7 +55,7 @@
 
 asm(".text\n"
     "    .align 8\n"
-    "gdb1338:\n"
+    SYMBOL (gdb1338) ":\n"
     "    pushl %edi\n"
     "    pushl %esi\n"
     "    pushl %ebx\n"
@@ -35,3 +64,19 @@
     "    popl  %esi\n"
     "    popl  %edi\n"
     "    ret\n");
+
+/* The purpose of this function is to verify that, during prologue
+   skip, GDB does not follow a jump at the beginnning of the "real"
+   code.  */
+
+asm(".text\n"
+    "    .align 8\n"
+    SYMBOL (jump_at_beginning) ":\n"
+    "    pushl %ebp\n"
+    "    movl  %esp,%ebp\n"
+    "    jmp   .gdbjump\n"
+    "    nop\n"
+    ".gdbjump:\n"
+    "    movl  %ebp,%esp\n"
+    "    popl  %ebp\n"
+    "    ret\n");
diff --git a/gdb/testsuite/gdb.arch/i386-prologue.exp b/gdb/testsuite/gdb.arch/i386-prologue.exp
index f1c1e72..1258e44 100644
--- a/gdb/testsuite/gdb.arch/i386-prologue.exp
+++ b/gdb/testsuite/gdb.arch/i386-prologue.exp
@@ -1,4 +1,4 @@
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2004 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
@@ -36,7 +36,15 @@
 set testfile "i386-prologue"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+
+# some targets have leading underscores on assembly symbols.
+# TODO: detect this automatically
+set additional_flags ""
+if [istarget "i?86-*-cygwin*"] then {
+  set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\""
+}   
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
 
@@ -76,3 +84,16 @@
 gdb_test "info frame" \
 	".*Saved registers:.*ebx at.*esi at.*edi at.*eip at.*" \
 	"saved registers in gdb1338"
+
+# Testcase jump_at_beginning.
+gdb_test_multiple "break jump_at_beginning" \
+	"set breakpoint in jump_at_beginning" {
+    -re "Breakpoint \[0-9\]* at ($hex).*$gdb_prompt $" {
+	gdb_test "x/i $expect_out(1,string)" \
+		".*<jump_at_beginning.*>:.*jmp.*" \
+		"check jump_at_beginning prologue end"
+    }
+    default {
+        fail "set breakpoint in jump_at_beginning"
+    }
+}
diff --git a/gdb/testsuite/gdb.arch/i386-sse.c b/gdb/testsuite/gdb.arch/i386-sse.c
new file mode 100644
index 0000000..496721c
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/i386-sse.c
@@ -0,0 +1,90 @@
+/* Test program for SSE registers.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <stdio.h>
+#include "i386-cpuid.h"
+
+typedef struct {
+  float f[4];
+} v4sf_t;
+
+
+v4sf_t data[8] =
+  {
+    { {  0.0, 0.25, 0.50, 0.75 } },
+    { {  1.0, 1.25, 1.50, 1.75 } },
+    { {  2.0, 2.25, 2.50, 2.75 } },
+    { {  3.0, 3.25, 3.50, 3.75 } },
+    { {  4.0, 4.25, 4.50, 4.75 } },
+    { {  5.0, 5.25, 5.50, 5.75 } },
+    { {  6.0, 6.25, 6.50, 6.75 } },
+    { {  7.0, 7.25, 7.50, 7.75 } },
+  };
+
+
+int
+have_sse (void)
+{
+  int edx = i386_cpuid ();
+
+  if (edx & bit_SSE)
+    return 1;
+  else
+    return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+  if (have_sse ())
+    {
+      asm ("movaps 0(%0), %%xmm0\n\t"
+           "movaps 16(%0), %%xmm1\n\t"
+           "movaps 32(%0), %%xmm2\n\t"
+           "movaps 48(%0), %%xmm3\n\t"
+           "movaps 64(%0), %%xmm4\n\t"
+           "movaps 80(%0), %%xmm5\n\t"
+           "movaps 96(%0), %%xmm6\n\t"
+           "movaps 112(%0), %%xmm7\n\t"
+           : /* no output operands */
+           : "r" (data) 
+           : "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7");
+
+      puts ("Hi!"); /* first breakpoint here */
+
+      asm (
+           "movaps %%xmm0, 0(%0)\n\t"
+           "movaps %%xmm1, 16(%0)\n\t"
+           "movaps %%xmm2, 32(%0)\n\t"
+           "movaps %%xmm3, 48(%0)\n\t"
+           "movaps %%xmm4, 64(%0)\n\t"
+           "movaps %%xmm5, 80(%0)\n\t"
+           "movaps %%xmm6, 96(%0)\n\t"
+           "movaps %%xmm7, 112(%0)\n\t"
+           : /* no output operands */
+           : "r" (data) 
+           : "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7");
+
+      puts ("Bye!"); /* second breakpoint here */
+    }
+
+  return 0;
+}
diff --git a/gdb/testsuite/gdb.arch/i386-sse.exp b/gdb/testsuite/gdb.arch/i386-sse.exp
new file mode 100644
index 0000000..702ee71
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/i386-sse.exp
@@ -0,0 +1,92 @@
+# Copyright 2004 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
+# 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.  
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@gnu.org
+
+# This file is part of the gdb testsuite.
+
+if $tracelevel {
+    strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+if ![istarget "i?86-*-*"] then {
+    verbose "Skipping i386 SSE tests."
+    return
+}
+
+set testfile "i386-sse"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+    unsupported "compiler does not support SSE"
+    return
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+    gdb_suppress_tests
+}
+
+send_gdb "print have_sse ()\r"
+gdb_expect {
+    -re ".. = 1\r\n$gdb_prompt " {
+        pass "check whether processor supports SSE"
+    }
+    -re ".. = 0\r\n$gdb_prompt " {
+        verbose "processor does not support SSE; skipping SSE tests"
+        return
+    }
+    -re ".*$gdb_prompt $" {
+        fail "check whether processor supports SSE"
+    }
+    timeout {
+        fail "check whether processor supports SSE (timeout)"
+    }
+}
+
+gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
+         "Breakpoint .* at .*i386-sse.c.*" \
+         "set breakpoint in main"
+gdb_continue_to_breakpoint "continue to first breakpoint in main"
+
+foreach r {0 1 2 3 4 5 6 7} {
+    gdb_test "print \$xmm$r.v4_float" \
+        ".. = \\{$r, $r.25, $r.5, $r.75\\}.*" \
+        "check contents of %xmm$r"
+}
+
+foreach r {0 1 2 3 4 5 6 7} {
+    gdb_test "set var \$xmm$r.v4_float\[0\] = $r + 10" "" "set %xmm$r"
+}
+
+gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
+         "Breakpoint .* at .*i386-sse.c.*" \
+         "set breakpoint in main"
+gdb_continue_to_breakpoint "continue to second breakpoint in main"
+
+foreach r {0 1 2 3 4 5 6 7} {
+    gdb_test "print data\[$r\]" \
+        ".. = \\{f = \\{[expr $r + 10], $r.25, $r.5, $r.75\\}\\}.*" \
+        "check contents of data\[$r\]"
+}
diff --git a/gdb/testsuite/gdb.arch/i386-unwind.c b/gdb/testsuite/gdb.arch/i386-unwind.c
index 6d10ecb..b1fa1df 100644
--- a/gdb/testsuite/gdb.arch/i386-unwind.c
+++ b/gdb/testsuite/gdb.arch/i386-unwind.c
@@ -1,6 +1,6 @@
 /* Unwinder test program.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -19,6 +19,12 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#ifdef SYMBOL_PREFIX
+#define SYMBOL(str)	SYMBOL_PREFIX #str
+#else
+#define SYMBOL(str)	#str
+#endif
+
 void
 trap (void)
 {
@@ -34,9 +40,9 @@
     "gdb1435:\n"
     "    pushl %ebp\n"
     "    mov   %esp, %ebp\n"
-    "    call  trap\n"
-    "    .globl main\n"
-    "main:\n"
+    "    call  " SYMBOL (trap) "\n"
+    "    .globl " SYMBOL (main) "\n"
+    SYMBOL (main) ":\n"
     "    pushl %ebp\n"
     "    mov   %esp, %ebp\n"
     "    call  gdb1435\n");
diff --git a/gdb/testsuite/gdb.arch/i386-unwind.exp b/gdb/testsuite/gdb.arch/i386-unwind.exp
index 9c3130f..85fb9da 100644
--- a/gdb/testsuite/gdb.arch/i386-unwind.exp
+++ b/gdb/testsuite/gdb.arch/i386-unwind.exp
@@ -1,4 +1,4 @@
-# Copyright 2003 Free Software Foundation, Inc.
+# Copyright 2003, 2004 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
@@ -36,7 +36,15 @@
 set testfile "i386-unwind"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+
+# some targets have leading underscores on assembly symbols.
+# TODO: detect this automatically
+set additional_flags ""
+if [istarget "i?86-*-cygwin*"] then {
+  set additional_flags "additional_flags=-DSYMBOL_PREFIX=\"_\""
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
 
diff --git a/gdb/testsuite/gdb.arch/powerpc-aix-prologue.c b/gdb/testsuite/gdb.arch/powerpc-aix-prologue.c
new file mode 100644
index 0000000..ee31b49
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/powerpc-aix-prologue.c
@@ -0,0 +1,55 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2004 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
+   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.  */
+
+void li_stw (void);
+
+int
+main (void)
+{
+  li_stw ();
+  return 0;
+}
+
+/* Asm for procedure li_stw().
+
+   The purpose of this function is to verify that GDB does not
+   include the li insn as part of the function prologue (only part
+   of the prologue if part of a pair of insns saving vector registers).
+   Similarly, GDB should not include the stw insn following the li insn,
+   because the source register is not used for parameter passing.  */
+
+
+asm ("        .csect .text[PR]\n"
+     "        .align 2\n"
+     "        .lglobl .li_stw\n"
+     "        .csect li_stw[DS]\n"
+     "li_stw:\n"
+     "        .long .li_stw, TOC[tc0], 0\n"
+     "        .csect .text[PR]\n"
+     ".li_stw:\n"
+     "        stw 31,-4(1)\n"
+     "        stwu 1,-48(1)\n"
+     "        mr 31,1\n"
+     "        stw 11,24(31)\n"
+     "        li 0,8765\n"
+     "        stw 0,28(31)\n"
+     "        lwz 1,0(1)\n"
+     "        lwz 31,-4(1)\n"
+     "        blr\n");
+
diff --git a/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp b/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp
new file mode 100644
index 0000000..76e3c27
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/powerpc-aix-prologue.exp
@@ -0,0 +1,82 @@
+# Copyright 2004 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+#
+# This file is part of the gdb testsuite.
+
+if $tracelevel {
+    strace $tracelevel
+}
+
+# Test rs6000 prologue analyzer.
+
+set prms_id 0
+set bug_id 0
+
+if ![istarget "powerpc-*-aix*"] then {
+    verbose "Skipping powerpc-aix prologue tests."
+    return
+}
+
+set testfile "powerpc-aix-prologue"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] != "" } {
+    unsupported "Testcase compile failed."
+    return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Insert a breakpoint in FUNCTION and verifies that the breakpoint was
+# inserted at the expected location.  EXPECTED_LOCATION should be an
+# offset relative to the function start address.
+proc insert_breakpoint {function expected_location} {
+    global gdb_prompt
+    global expect_out
+    global hex
+    
+    set address ""
+
+    # Insert a breakpoint using the given function name, and extract
+    # the breakpoint address for the output.
+    gdb_test_multiple "break $function" "set breakpoint in $function" {
+        -re "Breakpoint 1 at ($hex).*$gdb_prompt $" {
+            set address $expect_out(1,string)
+        }
+        default {
+            fail "set breakpoint in $function"
+        }
+    }
+
+    # If we managed to get the breakpoing address, then check that
+    # we inserted it at the expected location by examining the
+    # instruction at that address (we're not interested in the insn
+    # itself, but rather at the address printed at the begining of
+    # the instruction).
+    if { $address != "" } then {
+       gdb_test "x /i $address" \
+                ".*<$function\\+$expected_location>.*" \
+                "check $function breakpoint address"
+    } else {
+       fail "unable to compute breakpoint address"
+    }
+
+}
+
+insert_breakpoint "li_stw" 12
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index 75e64b4..8839349 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -112,6 +112,10 @@
         set asm-arch ia64
         set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
     }
+    "hppa*-linux-*" {
+        set asm-arch pa
+        set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+    }
 }
 
 if { "${asm-arch}" == "" } {
diff --git a/gdb/testsuite/gdb.asm/pa.inc b/gdb/testsuite/gdb.asm/pa.inc
new file mode 100644
index 0000000..d53336e
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/pa.inc
@@ -0,0 +1,44 @@
+	comment "subroutine prologue"
+	.macro gdbasm_enter
+	stw %rp, -20(%sp)
+	copy %r3, %r1
+	copy %sp, %r3
+	stwm %r1, 64(%sp)
+	.endm
+
+	comment "subroutine epilogue"
+	.macro gdbasm_leave
+	ldw -20(%r3), %rp
+	bv %r0(%rp)
+	ldwm -64(%sp), %r3
+	.endm
+
+	.macro gdbasm_call subr
+	bl	\subr , %rp
+	nop
+	.endm
+
+	.macro gdbasm_several_nops
+	nop
+	nop
+	nop
+	nop
+	.endm
+
+	comment "exit (0)"
+	.macro gdbasm_exit0
+	comment "Don't know how to exit, but this will certainly halt..."
+	ldw	0(%r0), %r1
+	.endm
+
+	comment "crt0 startup"
+	.macro gdbasm_startup
+	.align 4
+	.endm
+
+	comment "Declare a data variable"
+	.macro gdbasm_datavar name value
+	.data
+\name:
+	.long	\value
+	.endm
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index ea11087..cf38d92 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -1,4 +1,4 @@
-#   Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
+# Copyright 1997, 1999, 2002, 2003, 2004 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
@@ -14,12 +14,9 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-
 if $tracelevel then {
-	strace $tracelevel
-	}
+    strace $tracelevel
+}
 
 set prms_id 0
 set bug_id 0
@@ -61,13 +58,13 @@
 # build the first test case
 #
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
 
 # Build the in-system-call test
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug}] != "" } {
-     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
 
 if [get_compiler_info ${binfile}] {
@@ -75,351 +72,505 @@
 }
 
 proc do_attach_tests {} {
-   global gdb_prompt
-   global binfile
-   global escapedbinfile
-   global srcfile
-   global testfile
-   global objdir
-   global subdir
-   global timeout
+    global gdb_prompt
+    global binfile
+    global escapedbinfile
+    global srcfile
+    global testfile
+    global objdir
+    global subdir
+    global timeout
+    
+    # Start the program running and then wait for a bit, to be sure
+    # that it can be attached to.
 
-   # Start the program running and then wait for a bit, to be sure
-   # that it can be attached to.
-   #
-   set testpid [eval exec $binfile &]
-   exec sleep 2
+    set testpid [eval exec $binfile &]
+    exec sleep 2
+    if { [istarget "*-*-cygwin*"] } {
+	# testpid is the Cygwin PID, GDB uses the Windows PID, which might be
+	# different due to the way fork/exec works.
+	set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
+    }
 
-   # Verify that we cannot attach to nonsense.
-   #
-   send_gdb "attach abc\n"
-   gdb_expect {
-      -re ".*Illegal process-id: abc.*$gdb_prompt $"\
-                      {pass "attach to nonsense is prohibited"}
-      -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\
-                      {
-                        # Response expected from /proc-based systems.
-                        pass "attach to nonsense is prohibited" 
-                      }
-      -re "Attaching to.*$gdb_prompt $"\
-                      {fail "attach to nonsense is prohibited (bogus pid allowed)"}
-      -re "$gdb_prompt $" {fail "attach to nonsense is prohibited"}
-      timeout         {fail "(timeout) attach to nonsense is prohibited"}
-   }
+    # Verify that we cannot attach to nonsense.
 
-   # Verify that we cannot attach to what appears to be a valid
-   # process ID, but is a process that doesn't exist.  Traditionally,
-   # most systems didn't have a process with ID 0, so we take that as
-   # the default.  However, there are a few exceptions.
-   #
-   set boguspid 0
-   if { [istarget "*-*-*bsd*"] } {
-       # In FreeBSD 5.0, PID 0 is used for "swapper".  Use -1 instead
-       # (which should have the desired effect on any version of
-       # FreeBSD, and probably other *BSD's too).
-       set boguspid -1
-   }
-   send_gdb "attach $boguspid\n"
-   gdb_expect {
-       -re "Attaching to.*, process $boguspid.*No such process.*$gdb_prompt $"\
-	       {
-	   # Response expected on ptrace-based systems (i.e. HP-UX 10.20).
-	   pass "attach to nonexistent process is prohibited"
-       }
-       -re "Attaching to.*, process $boguspid failed.*Hint.*$gdb_prompt $"\
-	       {
-	   # Response expected on ttrace-based systems (i.e. HP-UX 11.0).
-	   pass "attach to nonexistent process is prohibited"
-       }
-       -re "Attaching to.*, process $boguspid.*denied.*$gdb_prompt $"\
-	       {pass "attach to nonexistent process is prohibited"}
-       -re "Attaching to.*, process $boguspid.*not permitted.*$gdb_prompt $"\
-	       {pass "attach to nonexistent process is prohibited"}
-       -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\
-	       {
-	   # Response expected from /proc-based systems.
-	   pass "attach to nonexistent process is prohibited"
-       }
-       -re "$gdb_prompt $" {fail "attach to nonexistent process is prohibited"}
-       timeout {
-	   fail "(timeout) attach to nonexistent process is prohibited"
-       }
-   }
+    send_gdb "attach abc\n"
+    gdb_expect {
+	-re ".*Illegal process-id: abc.*$gdb_prompt $" {
+	    pass "attach to nonsense is prohibited"
+	}
+	-re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $" {
+	    # Response expected from /proc-based systems.
+	    pass "attach to nonsense is prohibited" 
+	}
+	-re ".*Can't attach to process..*$gdb_prompt $" {
+	    # Response expected on Cygwin
+	    pass "attach to nonsense is prohibited"
+	}
+	-re "Attaching to.*$gdb_prompt $" {
+	    fail "attach to nonsense is prohibited (bogus pid allowed)"
+	}
+	-re "$gdb_prompt $" {
+	    fail "attach to nonsense is prohibited"
+	}
+	timeout {
+	    fail "(timeout) attach to nonsense is prohibited"
+	}
+    }
 
-   # Verify that we can attach to the process by first giving its
-   # executable name via the file command, and using attach with
-   # the process ID.
-   #
-   # (Actually, the test system appears to do this automatically
-   # for us.  So, we must also be prepared to be asked if we want
-   # to discard an existing set of symbols.)
-   #
-   send_gdb "file $binfile\n"
-   gdb_expect {
-      -re "Load new symbol table from.*y or n.*$" {
-         send_gdb "y\n"
-         gdb_expect {
-            -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
-                            {pass "(re)set file, before attach1"}
-            -re "$gdb_prompt $" {fail "(re)set file, before attach1"}
-            timeout         {fail "(timeout) (re)set file, before attach1"}
-         }
-      }
-      -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
-                      {pass "set file, before attach1"}
-      -re "$gdb_prompt $" {fail "set file, before attach1"}
-      timeout         {fail "(timeout) set file, before attach1"}
-   }
+    # Verify that we cannot attach to what appears to be a valid
+    # process ID, but is a process that doesn't exist.  Traditionally,
+    # most systems didn't have a process with ID 0, so we take that as
+    # the default.  However, there are a few exceptions.
 
-   send_gdb "attach $testpid\n"
-   gdb_expect {
-      -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\
-                      {pass "attach1, after setting file"}
-      -re "$gdb_prompt $" {fail "attach1, after setting file"}
-      timeout         {fail "(timeout) attach1, after setting file"}
-   }
+    set boguspid 0
+    if { [istarget "*-*-*bsd*"] } {
+	# In FreeBSD 5.0, PID 0 is used for "swapper".  Use -1 instead
+	# (which should have the desired effect on any version of
+	# FreeBSD, and probably other *BSD's too).
+	set boguspid -1
+    }
+    send_gdb "attach $boguspid\n"
+    gdb_expect {
+	-re "Attaching to.*, process $boguspid.*No such process.*$gdb_prompt $" {
+	    # Response expected on ptrace-based systems (i.e. HP-UX 10.20).
+	    pass "attach to nonexistent process is prohibited"
+	}
+	-re "Attaching to.*, process $boguspid failed.*Hint.*$gdb_prompt $" {
+	    # Response expected on ttrace-based systems (i.e. HP-UX 11.0).
+	    pass "attach to nonexistent process is prohibited"
+	}
+	-re "Attaching to.*, process $boguspid.*denied.*$gdb_prompt $" {
+	    pass "attach to nonexistent process is prohibited"
+	}
+	-re "Attaching to.*, process $boguspid.*not permitted.*$gdb_prompt $" {
+	    pass "attach to nonexistent process is prohibited"
+	}
+	-re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $" {
+	    # Response expected from /proc-based systems.
+	    pass "attach to nonexistent process is prohibited"
+	}
+	-re ".*Can't attach to process..*$gdb_prompt $" {
+	    # Response expected on Cygwin
+	    pass "attach to nonexistent process is prohibited"
+	}
+	-re "$gdb_prompt $" {
+	    fail "attach to nonexistent process is prohibited"
+	}
+	timeout {
+	    fail "(timeout) attach to nonexistent process is prohibited"
+	}
+    }
+    
+    # Verify that we can attach to the process by first giving its
+    # executable name via the file command, and using attach with the
+    # process ID.
 
-   # Verify that we can "see" the variable "should_exit" in the
-   # program, and that it is zero.
-   #
-   send_gdb "print should_exit\n"
-   gdb_expect {
-      -re ".* = 0.*$gdb_prompt $"\
-                      {pass "after attach1, print should_exit"}
-      -re "$gdb_prompt $" {fail "after attach1, print should_exit"}
-      timeout         {fail "(timeout) after attach1, print should_exit"}
-   }
+    # (Actually, the test system appears to do this automatically for
+    # us.  So, we must also be prepared to be asked if we want to
+    # discard an existing set of symbols.)
+    
+    send_gdb "file $binfile\n"
+    gdb_expect {
+	-re "Load new symbol table from.*y or n.*$" {
+	    send_gdb "y\n"
+	    gdb_expect {
+		-re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
+		    pass "(re)set file, before attach1"
+		}
+		-re "$gdb_prompt $" {
+		    fail "(re)set file, before attach1"
+		}
+		timeout {
+		    fail "(timeout) (re)set file, before attach1"
+		}
+	    }
+	}
+	-re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
+	    pass "set file, before attach1"
+	}
+	-re "$gdb_prompt $" {
+	    fail "set file, before attach1"
+	}
+	timeout {
+	    fail "(timeout) set file, before attach1"
+	}
+    }
 
-   # Detach the process.
-   #
-   send_gdb "detach\n"
-   gdb_expect {
-      -re "Detaching from program: .*$escapedbinfile.*$gdb_prompt $"\
-                      {pass "attach1 detach"}
-      -re "$gdb_prompt $" {fail "attach1 detach"}
-      timeout         {fail "(timeout) attach1 detach"}
-   }
+    send_gdb "attach $testpid\n"
+    gdb_expect {
+	-re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $" {
+	    pass "attach1, after setting file"
+	}
+	-re "Attaching to program.*`?$escapedbinfile\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" {
+	    # Response expected on Cygwin
+	    pass "attach1, after setting file"
+	}
+	-re "$gdb_prompt $" {
+	    fail "attach1, after setting file"
+	}
+	timeout {
+	    fail "(timeout) attach1, after setting file"
+	}
+    }
 
-   # Wait a bit for gdb to finish detaching
-   #
-   exec sleep 5
+    # Verify that we can "see" the variable "should_exit" in the
+    # program, and that it is zero.
+   
+    send_gdb "print should_exit\n"
+    gdb_expect {
+	-re ".* = 0.*$gdb_prompt $" {
+	    pass "after attach1, print should_exit"
+	}
+	-re "$gdb_prompt $" {
+	    fail "after attach1, print should_exit"
+	}
+	timeout {
+	    fail "(timeout) after attach1, print should_exit"
+	}
+    }
 
-   # Purge the symbols from gdb's brain.  (We want to be certain
-   # the next attach, which won't be preceded by a "file" command,
-   # is really getting the executable file without our help.)
-   #
-   set old_timeout $timeout
-   set timeout 15 
-   send_gdb "file\n"
-   gdb_expect {
-      -re ".*gdb internal error.*$" { 
-          fail "Internal error, prob. Memory corruption" 
-      }
-      -re "No executable file now.*Discard symbol table.*y or n.*$" {
-         send_gdb "y\n"
-         gdb_expect {
-            -re "No symbol file now.*$gdb_prompt $"\
-                            {pass "attach1, purging symbols after detach"}
-            -re "$gdb_prompt $" {fail "attach1, purging symbols after detach"}
-            timeout         {fail "(timeout) attach1, purging symbols after detach"}
-         }
-      }
-      -re "$gdb_prompt $" {fail "attach1, purging file after detach"}
-      timeout         {
-          fail "(timeout) attach1, purging file after detach"
-      }
-   }
-   set timeout $old_timeout
+    # Detach the process.
+   
+    send_gdb "detach\n"
+    gdb_expect {
+	-re "Detaching from program: .*$escapedbinfile.*$gdb_prompt $" {
+	    pass "attach1 detach"
+	}
+	-re "$gdb_prompt $" {
+	    fail "attach1 detach"
+	}
+	timeout {
+	    fail "(timeout) attach1 detach"
+	}
+    }
 
-   # Verify that we can attach to the process just by giving the
-   # process ID.
-   #
-   send_gdb "attach $testpid\n"
-   gdb_expect {
-      -re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $"\
-                      {pass "attach2"}
-      -re "$gdb_prompt $" {fail "attach2"}
-      timeout         {fail "(timeout) attach2"}
-   }
+    # Wait a bit for gdb to finish detaching
+    
+    exec sleep 5
 
-   # Verify that we can modify the variable "should_exit" in the
-   # program.
-   #
-   send_gdb "set should_exit=1\n"
-   gdb_expect {
-      -re "$gdb_prompt $" {pass "after attach2, set should_exit"}
-      timeout         {fail "(timeout) after attach2, set should_exit"}
-   }
+    # Purge the symbols from gdb's brain.  (We want to be certain the
+    # next attach, which won't be preceded by a "file" command, is
+    # really getting the executable file without our help.)
+    
+    set old_timeout $timeout
+    set timeout 15 
+    send_gdb "file\n"
+    gdb_expect {
+	-re ".*gdb internal error.*$" { 
+	    fail "Internal error, prob. Memory corruption" 
+	}
+	-re "No executable file now.*Discard symbol table.*y or n.*$" {
+	    send_gdb "y\n"
+	    gdb_expect {
+		-re "No symbol file now.*$gdb_prompt $" {
+		    pass "attach1, purging symbols after detach"
+		}
+		-re "$gdb_prompt $" {
+		    fail "attach1, purging symbols after detach"
+		}
+		timeout {
+		    fail "(timeout) attach1, purging symbols after detach"
+		}
+	    }
+	}
+	-re "$gdb_prompt $" {
+	    fail "attach1, purging file after detach"
+	}
+	timeout {
+	    fail "(timeout) attach1, purging file after detach"
+	}
+    }
+    set timeout $old_timeout
 
-   # Verify that the modification really happened.
-   #
-   send_gdb "tbreak 19\n"
-   gdb_expect {
-      -re "Breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $"\
-                      {pass "after attach2, set tbreak postloop"}
-      -re "$gdb_prompt $" {fail "after attach2, set tbreak postloop"}
-      timeout         {fail "(timeout) after attach2, set tbreak postloop"}
-   }
-   send_gdb "continue\n"
-   gdb_expect {
-      -re "main.*at.*$srcfile:19.*$gdb_prompt $"\
-                      {pass "after attach2, reach tbreak postloop"}
-      -re "$gdb_prompt $" {fail "after attach2, reach tbreak postloop"}
-      timeout         {fail "(timeout) after attach2, reach tbreak postloop"}
-   }
+    # Verify that we can attach to the process just by giving the
+    # process ID.
+   
+    send_gdb "attach $testpid\n"
+    gdb_expect {
+	-re "Attaching to process $testpid.*Load new symbol table from \"$escapedbinfile\.exe\".*y or n.*$" {
+	    # On Cygwin, the DLL's symbol tables are loaded prior to the
+	    # executable's symbol table.  This in turn always results in
+	    # asking the user for actually loading the symbol table of the
+	    # executable.
+	    send_gdb "y\n"
+	    gdb_expect {
+		-re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
+		    pass "(re)set file, before attach2"
+		}
+		-re "$gdb_prompt $" {
+		    fail "(re)set file, before attach2"
+		}
+		timeout {
+		    fail "(timeout) (re)set file, before attach2"
+		}
+	    }
+	}
+	-re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $" {
+	    pass "attach2"
+	}
+	-re "$gdb_prompt $" {
+	    fail "attach2"
+	}
+	timeout {
+	    fail "(timeout) attach2"
+	}
+    }
 
-   # Allow the test process to exit, to cleanup after ourselves.
-   #
-   send_gdb "continue\n"
-   gdb_expect {
-      -re "Program exited normally.*$gdb_prompt $"\
-                      {pass "after attach2, exit"}
-      -re "$gdb_prompt $" {fail "after attach2, exit"}
-      timeout         {fail "(timeout) after attach2, exit"}
-   }
+    # Verify that we can modify the variable "should_exit" in the
+    # program.
 
-   # Make sure we don't leave a process around to confuse
-   # the next test run (and prevent the compile by keeping
-   # the text file busy), in case the "set should_exit" didn't
-   # work.
-   #
-   remote_exec build "kill -9 ${testpid}"
-   # Start the program running and then wait for a bit, to be sure
-   # that it can be attached to.
-   #
-   set testpid [eval exec $binfile &]
-   exec sleep 2
+    send_gdb "set should_exit=1\n"
+    gdb_expect {
+	-re "$gdb_prompt $" {
+	    pass "after attach2, set should_exit"
+	}
+	timeout {
+	    fail "(timeout) after attach2, set should_exit"
+	}
+    }
 
-   # Verify that we can attach to the process, and find its a.out
-   # when we're cd'd to some directory that doesn't contain the
-   # a.out.  (We use the source path set by the "dir" command.)
-   #
-   send_gdb "dir ${objdir}/${subdir}\n"
-   gdb_expect {
-      -re ".*Source directories searched: .*$gdb_prompt $"\
-                      {pass "set source path"}
-      -re "$gdb_prompt $" {fail "set source path"}
-      timeout         {fail "(timeout) set source path"}
-   }
+    # Verify that the modification really happened.
 
-   send_gdb "cd /tmp\n"
-   gdb_expect {
-      -re ".*Working directory /tmp.*$gdb_prompt $"\
-                      {pass "cd away from process' a.out"}
-      -re "$gdb_prompt $" {fail "cd away from process' a.out"}
-      timeout         {fail "(timeout) cd away from process' a.out"}
-   }
+    send_gdb "tbreak 19\n"
+    gdb_expect {
+	-re "Breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" {
+	    pass "after attach2, set tbreak postloop"
+	}
+	-re "$gdb_prompt $" {
+	    fail "after attach2, set tbreak postloop"
+	}
+	timeout {
+	    fail "(timeout) after attach2, set tbreak postloop"
+	}
+    }
+    send_gdb "continue\n"
+    gdb_expect {
+	-re "main.*at.*$srcfile:19.*$gdb_prompt $" {
+	    pass "after attach2, reach tbreak postloop"
+	}
+	-re "$gdb_prompt $" {
+	    fail "after attach2, reach tbreak postloop"
+	}
+	timeout {
+	    fail "(timeout) after attach2, reach tbreak postloop"
+	}
+    }
 
-   # Explicitly flush out any knowledge of the previous attachment.
-   send_gdb "symbol\n"
-   gdb_expect {
-      -re ".*Discard symbol table from.*y or n. $"\
-                      {send_gdb "y\n"
-                       gdb_expect {
-                          -re ".*No symbol file now.*$gdb_prompt $"\
-                                          {pass "before attach3, flush symbols"}
-                          -re "$gdb_prompt $" {fail "before attach3, flush symbols"}
-                          timeout         {fail "(timeout) before attach3, flush symbols"}
-                       }
-                      }
-      -re ".*No symbol file now.*$gdb_prompt $"\
-                      {pass "before attach3, flush symbols"}
-      -re "$gdb_prompt $" {fail "before attach3, flush symbols"}
-      timeout         {fail "(timeout) before attach3, flush symbols"}
-   }
-   send_gdb "exec\n"
-   gdb_expect {
-      -re ".*No executable file now.*$gdb_prompt $"\
-                      {pass "before attach3, flush exec"}
-      -re "$gdb_prompt $" {fail "before attach3, flush exec"}
-      timeout         {fail "(timeout) before attach3, flush exec"}
-   }
+    # Allow the test process to exit, to cleanup after ourselves.
 
-   send_gdb "attach $testpid\n"
-   gdb_expect {
-      -re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $"\
-                      {pass "attach when process' a.out not in cwd"}
-      -re "$gdb_prompt $" {fail "attach when process' a.out not in cwd"}
-      timeout         {fail "(timeout) attach when process' a.out not in cwd"}
-   }
+    send_gdb "continue\n"
+    gdb_expect {
+	-re "Program exited normally.*$gdb_prompt $" {
+	    pass "after attach2, exit"
+	}
+	-re "$gdb_prompt $" {
+	    fail "after attach2, exit"
+	}
+	timeout {
+	    fail "(timeout) after attach2, exit"
+	}
+    }
 
-   send_gdb "kill\n"
-   gdb_expect {
-      -re ".*Kill the program being debugged.*y or n. $"\
-                      {send_gdb "y\n"
-                       gdb_expect {
-                          -re "$gdb_prompt $" {pass "after attach3, exit"}
-                          timeout {fail "(timeout) after attach3, exit"}
-                       }
-                      }
-      -re "$gdb_prompt $" {fail "after attach3, exit"}
-      timeout         {fail "(timeout) after attach3, exit"}
-   }
+    # Make sure we don't leave a process around to confuse
+    # the next test run (and prevent the compile by keeping
+    # the text file busy), in case the "set should_exit" didn't
+    # work.
+   
+    remote_exec build "kill -9 ${testpid}"
+    # Start the program running and then wait for a bit, to be sure
+    # that it can be attached to.
+   
+    set testpid [eval exec $binfile &]
+    exec sleep 2
+    if { [istarget "*-*-cygwin*"] } {
+	# testpid is the Cygwin PID, GDB uses the Windows PID, which might be
+	# different due to the way fork/exec works.
+	set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
+    }
+
+    # Verify that we can attach to the process, and find its a.out
+    # when we're cd'd to some directory that doesn't contain the
+    # a.out.  (We use the source path set by the "dir" command.)
+    
+    send_gdb "dir ${objdir}/${subdir}\n"
+    gdb_expect {
+	-re ".*Source directories searched: .*$gdb_prompt $" {
+	    pass "set source path"
+	}
+	-re "$gdb_prompt $" {
+	    fail "set source path"
+	}
+	timeout {
+	    fail "(timeout) set source path"
+	}
+    }
+
+    send_gdb "cd /tmp\n"
+    gdb_expect {
+	-re ".*Working directory /tmp.*$gdb_prompt $" {
+	    pass "cd away from process' a.out"
+	}
+	-re "$gdb_prompt $" {
+	    fail "cd away from process' a.out"
+	}
+	timeout {
+	    fail "(timeout) cd away from process' a.out"
+	}
+    }
+
+    # Explicitly flush out any knowledge of the previous attachment.
+    send_gdb "symbol\n"
+    gdb_expect {
+	-re ".*Discard symbol table from.*y or n. $" {
+	    send_gdb "y\n"
+	    gdb_expect {
+		-re ".*No symbol file now.*$gdb_prompt $" {
+		    pass "before attach3, flush symbols"
+		}
+		-re "$gdb_prompt $" {
+		    fail "before attach3, flush symbols"
+		}
+		timeout {
+		    fail "(timeout) before attach3, flush symbols"
+		}
+	    }
+	}
+	-re ".*No symbol file now.*$gdb_prompt $" {
+	    pass "before attach3, flush symbols"
+	}
+	-re "$gdb_prompt $" {
+	    fail "before attach3, flush symbols"
+	}
+	timeout {
+	    fail "(timeout) before attach3, flush symbols"
+	}
+    }
+    send_gdb "exec\n"
+    gdb_expect {
+	-re ".*No executable file now.*$gdb_prompt $" {
+	    pass "before attach3, flush exec"
+	}
+	-re "$gdb_prompt $" {
+	    fail "before attach3, flush exec"
+	}
+	timeout {
+	    fail "(timeout) before attach3, flush exec"
+	}
+    }
+
+    send_gdb "attach $testpid\n"
+    gdb_expect {
+	-re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $" {
+	    pass "attach when process' a.out not in cwd"
+	}
+	-re "$gdb_prompt $" {
+	    fail "attach when process' a.out not in cwd"
+	}
+	timeout {
+	    fail "(timeout) attach when process' a.out not in cwd"
+	}
+    }
+
+    send_gdb "kill\n"
+    gdb_expect {
+	-re ".*Kill the program being debugged.*y or n. $" {
+	    send_gdb "y\n"
+	    gdb_expect {
+		-re "$gdb_prompt $" {
+		    pass "after attach3, exit"
+		}
+		timeout {
+		    fail "(timeout) after attach3, exit"
+		}
+	    }
+	}
+	-re "$gdb_prompt $" {
+	    fail "after attach3, exit"
+	}
+	timeout {
+	    fail "(timeout) after attach3, exit"
+	}
+    }
+    
+    # Another "don't leave a process around"
+    remote_exec build "kill -9 ${testpid}"
 }
 
 proc do_call_attach_tests {} {
-   global gdb_prompt
-   global binfile2
-
-   # Start the program running and then wait for a bit, to be sure
-   # that it can be attached to.
-   #
-   set testpid [eval exec $binfile2 &]
-   exec sleep 2
-
-   # Attach
-   #
-   gdb_test "file $binfile2" ".*" "force switch to gdb64, if necessary"
-   send_gdb "attach $testpid\n"
-   gdb_expect {
-      -re ".*warning: reading register.*I.*O error.*$gdb_prompt $" {
-         fail "attach call, read register 3 error"
-     }
-     -re "Attaching to.*process $testpid.*libc.*$gdb_prompt $" {
-         pass "attach call"
-     }
-      -re "$gdb_prompt $" {fail "attach call"}
-      timeout         {fail "(timeout) attach call"}
-   }
-
-   # See if other registers are problems
-   #
-   send_gdb "i r r3\n"
-   gdb_expect {
-       -re ".*warning: reading register.*$gdb_prompt $" {
-           pass "CHFts23490: known bug"
-       }
-       -re ".*r3.*$gdb_prompt $" {
-           pass "Bug fixed, Yayyy!"
-       }
-       timeout { fail "timeout on info reg" }
-   }
-
-   # Get rid of the process
-   #
-   gdb_test "p should_exit = 1" ".*"
-   gdb_test "c" ".*Program exited normally.*"
+    global gdb_prompt
+    global binfile2
+    
+    # Start the program running and then wait for a bit, to be sure
+    # that it can be attached to.
    
-   # Be paranoid
-   #
-    remote_exec build "kill -9 ${testpid}"
+    set testpid [eval exec $binfile2 &]
+    exec sleep 2
+    if { [istarget "*-*-cygwin*"] } {
+	# testpid is the Cygwin PID, GDB uses the Windows PID, which might be
+	# different due to the way fork/exec works.
+	set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
+    }
 
+    # Attach
+   
+    gdb_test "file $binfile2" ".*" "force switch to gdb64, if necessary"
+    send_gdb "attach $testpid\n"
+    gdb_expect {
+	-re ".*warning: reading register.*I.*O error.*$gdb_prompt $" {
+	    fail "attach call, read register 3 error"
+	}
+	-re "Attaching to.*process $testpid.*libc.*$gdb_prompt $" {
+	    pass "attach call"
+	}
+	-re "Attaching to.*process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" {
+	    pass "attach call"
+	}
+	-re "$gdb_prompt $" {
+	    fail "attach call"
+	}
+	timeout {
+	    fail "(timeout) attach call"
+	}
+    }
+
+    # See if other registers are problems
+    
+    send_gdb "i r r3\n"
+    gdb_expect {
+	-re ".*warning: reading register.*$gdb_prompt $" {
+	    pass "CHFts23490: known bug"
+	}
+	-re ".*r3.*$gdb_prompt $" {
+	    pass "Bug fixed, Yayyy!"
+	}
+	timeout { fail "timeout on info reg" }
+    }
+
+    # Get rid of the process
+    
+    gdb_test "p should_exit = 1" ".*"
+    gdb_test "c" ".*Program exited normally.*"
+   
+    # Be paranoid
+   
+    remote_exec build "kill -9 ${testpid}"
 }
 
 
 # Start with a fresh gdb
-#
+
 gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
 # This is a test of gdb's ability to attach to a running process.
-#
+
 do_attach_tests
 
 # Test attaching when the target is inside a system call
-#
+
 gdb_exit
 gdb_start
 
diff --git a/gdb/testsuite/gdb.base/auxv.exp b/gdb/testsuite/gdb.base/auxv.exp
index 3a509b9..cb064f5 100644
--- a/gdb/testsuite/gdb.base/auxv.exp
+++ b/gdb/testsuite/gdb.base/auxv.exp
@@ -82,12 +82,15 @@
 	}
 	-ex "The program has no auxiliary information now" {
 	    set bad 1
+	    exp_continue
 	}
 	-ex "Auxiliary vector is empty" {
 	    set bad 1
+	    exp_continue
 	}
 	-ex "No auxiliary vector found" {
 	    set bad 1
+	    exp_continue
 	}
 	-re "^\[0-9\]+\[ \t\]+(AT_\[^ \t\]+)\[^\r\n\]+\[\r\n\]+" {
 	    lappend auxv_lines $expect_out(0,string)
@@ -103,8 +106,11 @@
 	    incr bad
 	}
 	-re "^\[^\r\n\]+\[\r\n\]+" {
-	    warning "Unrecognized output: $expect_out(0,string)"
-	    set bad 1
+	    if {!$bad} {
+		warning "Unrecognized output: $expect_out(0,string)"
+		set bad 1
+	    }
+	    exp_continue
 	}
     }] != 0} {
 	return {}
diff --git a/gdb/testsuite/gdb.base/bigcore.c b/gdb/testsuite/gdb.base/bigcore.c
index 8cd1b5f..bbf37fb 100644
--- a/gdb/testsuite/gdb.base/bigcore.c
+++ b/gdb/testsuite/gdb.base/bigcore.c
@@ -117,6 +117,8 @@
 static struct list dummy;
 static struct list heap = { &dummy, &dummy };
 
+static unsigned long bytes_allocated;
+
 int
 main ()
 {
@@ -151,14 +153,13 @@
      each section.  The linking ensures that some, but not all, the
      memory is allocated.  NB: Some kernels handle this efficiently -
      only allocating and writing out referenced pages leaving holes in
-     the file for unreferend pages - while others handle this poorly -
-     writing out all pages including those that wern't referenced.  */
+     the file for unmodified pages - while others handle this poorly -
+     writing out all pages including those that weren't modified.  */
 
   print_string ("Alocating the entire heap ...\n");
   {
     size_t chunk_size;
-    long bytes_allocated = 0;
-    long chunks_allocated = 0;
+    unsigned long chunks_allocated = 0;
     /* Create a linked list of memory chunks.  Start with
        MAX_CHUNK_SIZE blocks of memory and then try allocating smaller
        and smaller amounts until all (well at least most) memory has
diff --git a/gdb/testsuite/gdb.base/bigcore.exp b/gdb/testsuite/gdb.base/bigcore.exp
index 58cbfa1..b720136 100644
--- a/gdb/testsuite/gdb.base/bigcore.exp
+++ b/gdb/testsuite/gdb.base/bigcore.exp
@@ -41,7 +41,10 @@
 # consumes too many resources - gigabytes worth of disk space and and
 # I/O bandwith.
 
-if { [istarget "*-*-*bsd*"] || [istarget "*-*-hpux*"] } {
+if { [istarget "*-*-*bsd*"]
+     || [istarget "*-*-hpux*"]
+     || [istarget "*-*-solaris*"] 
+     || [istarget "*-*-cygwin*"] } {
     untested "Kernel lacks sparse corefile support (PR gdb/1551)"
     return
 }
@@ -103,9 +106,30 @@
 gdb_test continue ".*print_string.*"
 gdb_test next ".*0 = 0.*"
 
+# Check that the corefile is plausibly large enough.  We're trying to
+# detect the case where the operating system has truncated the file
+# just before signed wraparound.  TCL, unfortunately, has a similar
+# problem - so use catch.  It can handle the "bad" size but not necessarily
+# the "good" one.  And we must use GDB for the comparison, similarly.
+
+if {[catch {file size $corefile} core_size] == 0} {
+    set core_ok 0
+    gdb_test_multiple "print bytes_allocated < $core_size" "check core size" {
+	-re " = 1\r\n$gdb_prompt $" {
+	    pass "check core size"
+	    set core_ok 1
+	}
+	-re " = 0\r\n$gdb_prompt $" {
+	    xfail "check core size (system does not support large corefiles)"
+	}
+    }
+    if {$core_ok == 0} {
+	return 0
+    }
+}
+
 # Traverse part of bigcore's linked list of memory chunks (forward or
-# backward), saving each chunk's address.  I don't know why but
-# expect_out didn't work with gdb_test_multiple.
+# backward), saving each chunk's address.
 
 proc extract_heap { dir } {
     global gdb_prompt
@@ -113,8 +137,7 @@
     set heap ""
     set test "extract ${dir} heap"
     set lim 0
-    send_gdb "print heap.${dir}\n"
-    gdb_expect {
+    gdb_test_multiple "print heap.${dir}" "$test" {
 	-re " = \\(struct list \\*\\) 0x0.*$gdb_prompt $" {
 	    pass "$test"
 	}
diff --git a/gdb/testsuite/gdb.base/call-sc.c b/gdb/testsuite/gdb.base/call-sc.c
new file mode 100644
index 0000000..70ae87f
--- /dev/null
+++ b/gdb/testsuite/gdb.base/call-sc.c
@@ -0,0 +1,83 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2004 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
+   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.
+
+*/
+
+/* Useful abreviations.  */
+typedef void t;
+typedef char tc;
+typedef short ts;
+typedef int ti;
+typedef long tl;
+typedef long long tll;
+typedef float tf;
+typedef double td;
+typedef long double tld;
+typedef enum { e = '1' } te;
+
+/* Force the type of each field.  */
+#ifndef T
+typedef t T;
+#endif
+
+T foo = '1', L;
+
+T fun()
+{
+  return foo;  
+}
+
+#ifdef PROTOTYPES
+void Fun(T foo)
+#else
+void Fun(foo)
+     T foo;
+#endif
+{
+  L = foo;
+}
+
+zed ()
+{
+  L = 'Z';
+}
+
+int main()
+{
+#ifdef usestubs
+  set_debug_traps();
+  breakpoint();
+#endif
+  int i;
+
+  Fun(foo);	
+
+  /* An infinite loop that first clears all the variables and then
+     calls the function.  This "hack" is to make re-testing easier -
+     "advance fun" is guaranteed to have always been preceeded by a
+     global variable clearing zed call.  */
+
+  zed ();
+  while (1)
+    {
+      L = fun ();	
+      zed ();
+    }
+
+  return 0;
+}
diff --git a/gdb/testsuite/gdb.base/call-sc.exp b/gdb/testsuite/gdb.base/call-sc.exp
new file mode 100644
index 0000000..69b24b0
--- /dev/null
+++ b/gdb/testsuite/gdb.base/call-sc.exp
@@ -0,0 +1,476 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2004 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
+# 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.  
+
+# Test "return", "finish", and "call" of functions that a scalar (int,
+# float, enum) and/or take a single scalar parameter.
+
+if $tracelevel then {
+	strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# Some targets can't call functions, so don't even bother with this
+# test.
+
+if [target_info exists gdb,cannot_call_functions] {
+    setup_xfail "*-*-*"
+    fail "This target can not call functions"
+    continue
+}
+
+set testfile "call-sc"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the
+# compiler used to compile the test case.
+
+if [get_compiler_info ${binfile}] {
+    return -1;
+}
+
+# Use the file name, compiler and tuples to set up any needed KFAILs.
+
+proc setup_kfails { file tuples bug } {
+    global testfile
+    if [string match $file $testfile] {
+	foreach f $tuples { setup_kfail $f $bug }
+    }
+}
+
+proc setup_compiler_kfails { file compiler format tuples bug } {
+    global testfile
+    if {[string match $file $testfile] && [test_compiler_info $compiler]  && [test_debug_format $format]} {
+	foreach f $tuples { setup_kfail $f $bug }
+    }
+}
+
+# Compile a variant of scalars.c using TYPE to specify the type of the
+# parameter and return-type.  Run the compiled program up to "main".
+# Also updates the global "testfile" to reflect the most recent build.
+
+proc start_scalars_test { type } {
+    global testfile
+    global srcfile
+    global binfile
+    global objdir
+    global subdir
+    global srcdir
+    global gdb_prompt
+    global expect_out
+
+    # Create the additional flags
+    set flags "debug additional_flags=-DT=${type}"
+    set testfile "call-sc-${type}"
+
+    set binfile ${objdir}/${subdir}/${testfile}
+    if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags}"] != "" } {
+	# built the second test case since we can't use prototypes
+	warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
+	if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "${flags} additional_flags=-DNO_PROTOTYPES"] != "" } {
+	    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+	}
+    }
+
+    # Start with a fresh gdb.
+    gdb_exit
+    gdb_start
+    gdb_reinitialize_dir $srcdir/$subdir
+    gdb_load ${binfile}
+
+    # Make certain that the output is consistent
+    gdb_test "set print sevenbit-strings" "" \
+	    "set print sevenbit-strings; ${testfile}"
+    gdb_test "set print address off" "" \
+	    "set print address off; ${testfile}"
+    gdb_test "set width 0" "" \
+	    "set width 0; ${testfile}"
+
+    # Advance to main
+    if { ![runto_main] } then {
+	gdb_suppress_tests;
+    }
+
+    # Get the debug format
+    get_debug_format
+
+    # check that type matches what was passed in
+    set test "ptype; ${testfile}"
+    set foo_t "xxx"
+    gdb_test_multiple "ptype ${type}" "${test}" {
+	-re "type = (\[^\r\n\]*)\r\n$gdb_prompt $" {
+	    set foo_t "$expect_out(1,string)"
+	    pass "$test (${foo_t})"
+	}
+    }
+    gdb_test "ptype foo" "type = ${foo_t}" "ptype foo; ${testfile} $expect_out(1,string)"
+}
+
+
+# Given N (0..25), return the corresponding alphabetic letter in lower
+# or upper case.  This is ment to be i18n proof.
+
+proc i2a { n } {
+    return [string range "abcdefghijklmnopqrstuvwxyz" $n $n]
+}
+
+proc I2A { n } {
+    return [string toupper [i2a $n]]
+}
+
+
+# Use the file name, compiler and tuples to set up any needed KFAILs.
+
+proc setup_kfails { file tuples bug } {
+    global testfile
+    if [string match $file $testfile] {
+	foreach f $tuples { setup_kfail $f $bug }
+    }
+}
+
+proc setup_compiler_kfails { file compiler format tuples bug } {
+    global testfile
+    if {[string match $file $testfile] && [test_compiler_info $compiler]  && [test_debug_format $format]} {
+	foreach f $tuples { setup_kfail $f $bug }
+    }
+}
+
+# Test GDB's ability to make inferior function calls to functions
+# returning (or passing) in a single scalar.
+
+# start_scalars_test() will have previously built a program with a
+# specified scalar type.  To ensure robustness of the output, "p/c" is
+# used.
+
+# This tests the code paths "which return-value convention?" and
+# "extract return-value from registers" called by "infcall.c".
+
+proc test_scalar_calls { } {
+    global testfile
+    global gdb_prompt
+
+    # Check that GDB can always extract a scalar-return value from an
+    # inferior function call.  Since GDB always knows the location of
+    # an inferior function call's return value these should never fail
+    
+    # Implemented by calling the parameterless function "fun" and then
+    # examining the return value printed by GDB.
+
+    set tests "call ${testfile}"
+
+    # Call fun, checking the printed return-value.
+    gdb_test "p/c fun()" "= 49 '1'" "p/c fun(); ${tests}"
+
+    # Check that GDB can always pass a structure to an inferior function.
+    # This test can never fail.
+
+    # Implemented by calling the one parameter function "Fun" which
+    # stores its parameter in the global variable "L".  GDB then
+    # examining that global to confirm that the value is as expected.
+
+    gdb_test "call Fun(foo)" "" "call Fun(foo); ${tests}"
+    gdb_test "p/c L" " = 49 '1'" "p/c L; ${tests}"
+}
+
+# Test GDB's ability to both return a function (with "return" or
+# "finish") and correctly extract/store any corresponding
+# return-value.
+
+# Check that GDB can consistently extract/store structure return
+# values.  There are two cases - returned in registers and returned in
+# memory.  For the latter case, the return value can't be found and a
+# failure is "expected".  However GDB must still both return the
+# function and display the final source and line information.
+
+# N identifies the number of elements in the struct that will be used
+# for the test case.  FAILS is a list of target tuples that will fail
+# this test.
+
+# This tests the code paths "which return-value convention?", "extract
+# return-value from registers", and "store return-value in registers".
+# Unlike "test struct calls", this test is expected to "fail" when the
+# return-value is in memory (GDB can't find the location).  The test
+# is in three parts: test "return"; test "finish"; check that the two
+# are consistent.  GDB can sometimes work for one command and not the
+# other.
+
+proc test_scalar_returns { } {
+    global gdb_prompt
+    global testfile
+
+    set tests "return ${testfile}"
+
+
+    # Check that "return" works.
+
+    # GDB must always force the return of a function that has
+    # a struct result.  Dependant on the ABI, it may, or may not be
+    # possible to store the return value in a register.
+
+    # The relevant code looks like "L{n} = fun{n}()".  The test forces
+    # "fun{n}" to "return" with an explicit value.  Since that code
+    # snippet will store the the returned value in "L{n}" the return
+    # is tested by examining "L{n}".  This assumes that the
+    # compiler implemented this as fun{n}(&L{n}) and hence that when
+    # the value isn't stored "L{n}" remains unchanged.  Also check for
+    # consistency between this and the "finish" case.
+
+    # Get into a call of fun
+    gdb_test "advance fun" \
+	    "fun .*\[\r\n\]+\[0-9\].*return foo.*" \
+	    "advance to fun for return; ${tests}"
+
+    # Check that the program invalidated the relevant global.
+    gdb_test "p/c L" " = 90 'Z'" "zed L for return; ${tests}"
+
+    # Force the "return".  This checks that the return is always
+    # performed, and that GDB correctly reported this to the user.
+    # GDB 6.0 and earlier, when the return-value's location wasn't
+    # known, both failed to print a final "source and line" and misplaced
+    # the frame ("No frame").
+
+    # The test is writen so that it only reports one FAIL/PASS for the
+    # entire operation.  The value returned is checked further down.
+    # "return_value_unknown", if non-empty, records why GDB realised
+    # that it didn't know where the return value was.
+
+    set test "return foo; ${tests}"
+    set return_value_unknown 0
+    set return_value_unimplemented 0
+    gdb_test_multiple "return foo" "${test}" {
+	-re "The location" {
+	    # Ulgh, a struct return, remember this (still need prompt).
+	    set return_value_unknown 1
+	    exp_continue
+	}
+	-re "A structure or union" {
+	    # Ulgh, a struct return, remember this (still need prompt).
+	    set return_value_unknown 1
+	    # Double ulgh.  Architecture doesn't use return_value and
+	    # hence hasn't implemented small structure return.
+	    set return_value_unimplemented 1
+	    exp_continue
+	}
+	-re "Make fun return now.*y or n. $" {
+	    gdb_test_multiple "y" "${test}" {
+		-re "L *= fun.*${gdb_prompt} $" {
+		    # Need to step off the function call
+		    gdb_test "next" "zed.*" "${test}"
+		}
+		-re "L[expr  + 1] *= fun[expr  + 1].*${gdb_prompt} $" {
+		    pass "${test}"
+		}
+	    }
+	}
+    }
+
+    # Check that the return-value is as expected.  At this stage we're
+    # just checking that GDB has returned a value consistent with
+    # "return_value_unknown" set above.
+
+    set test "value foo returned; ${tests}"
+    gdb_test_multiple "p/c L" "${test}" {
+	-re " = 49 '1'.*${gdb_prompt} $" {
+	    if $return_value_unknown {
+		# This contradicts the above claim that GDB didn't
+		# know the location of the return-value.
+		fail "${test}"
+	    } else {
+		pass "${test}"
+	    }
+	}
+	-re " = 90 .*${gdb_prompt} $" {
+	    if $return_value_unknown {
+		# The struct return case.  Since any modification
+		# would be by reference, and that can't happen, the
+		# value should be unmodified and hence Z is expected.
+		# Is this a reasonable assumption?
+		pass "${test}"
+	    } else {
+		# This contradicts the above claim that GDB knew
+		# the location of the return-value.
+		fail "${test}"
+	    }
+	}
+	-re ".*${gdb_prompt} $" {
+	    if $return_value_unimplemented {
+		# What a suprize.  The architecture hasn't implemented
+		# return_value, and hence has to fail.
+		kfail "$test" gdb/1444
+	    } else {
+		fail "$test"
+	    }
+	}
+    }	
+    
+    # Check that a "finish" works.
+
+    # This is almost but not quite the same as "call struct funcs".
+    # Architectures can have subtle differences in the two code paths.
+
+    # The relevant code snippet is "L{n} = fun{n}()".  The program is
+    # advanced into a call to  "fun{n}" and then that function is
+    # finished.  The returned value that GDB prints, reformatted using
+    # "p/c", is checked.
+
+    # Get into "fun()".
+    gdb_test "advance fun" \
+	    "fun .*\[\r\n\]+\[0-9\].*return foo.*" \
+	    "advance to fun for finish; ${tests}"
+
+    # Check that the program invalidated the relevant global.
+    gdb_test "p/c L" " = 90 'Z'" "zed L for finish; ${tests}"
+
+    # Finish the function, set 'finish_value_unknown" to non-empty if the
+    # return-value was not found.
+    set test "finish foo; ${tests}"
+    set finish_value_unknown 0
+    gdb_test_multiple "finish" "${test}" {
+	-re "Value returned is .*${gdb_prompt} $" {
+	    pass "${test}"
+	}
+	-re "Cannot determine contents.*${gdb_prompt} $" {
+	    # Expected bad value.  For the moment this is ok.
+	    set finish_value_unknown 1
+	    pass "${test}"
+	}
+    }
+
+    # Re-print the last (return-value) using the more robust
+    # "p/c".  If no return value was found, the 'Z' from the previous
+    # check that the variable was cleared, is printed.
+    set test "value foo finished; ${tests}"
+    gdb_test_multiple "p/c" "${test}" {
+	-re " = 49 '1'\[\r\n\]+${gdb_prompt} $" {
+	    if $finish_value_unknown {
+		# This contradicts the above claim that GDB didn't
+		# know the location of the return-value.
+		fail "${test}"
+	    } else {
+		pass "${test}"
+	    }
+	}
+	-re " = 90 'Z'\[\r\n\]+${gdb_prompt} $" {
+	    # The value didn't get found.  This is "expected".
+	    if $finish_value_unknown {
+		pass "${test}"
+	    } else {
+		# This contradicts the above claim that GDB did
+		# know the location of the return-value.
+		fail "${test}"
+	    }
+	}
+    }
+
+    # Finally, check that "return" and finish" have consistent
+    # behavior.
+
+    # Since both "return" and "finish" use equivalent "which
+    # return-value convention" logic, both commands should have
+    # identical can/can-not find return-value messages.
+
+    # Note that since "call" and "finish" use common code paths, a
+    # failure here is a strong indicator of problems with "store
+    # return-value" code paths.  Suggest looking at "return_value"
+    # when investigating a fix.
+
+    set test "return and finish use same convention; ${tests}"
+    if {$finish_value_unknown == $return_value_unknown} {
+	pass "${test}"
+    } else {
+	kfail gdb/1444 "${test}"
+    }
+}
+
+# ABIs pass anything >8 or >16 bytes in memory but below that things
+# randomly use register and/and structure conventions.  Check all
+# possible sized char scalars in that range.  But only a restricted
+# range of the other types.
+
+# NetBSD/PPC returns "unnatural" (3, 5, 6, 7) sized scalars in memory.
+
+# d10v is weird. 5/6 byte scalars go in memory.  2 or more char
+# scalars go in memory.  Everything else is in a register!
+
+# Test every single char struct from 1..17 in size.  This is what the
+# original "scalars" test was doing.
+
+start_scalars_test tc
+test_scalar_calls
+test_scalar_returns
+
+
+# Let the fun begin.
+
+# Assuming that any integer struct larger than 8 bytes goes in memory,
+# come up with many and varied combinations of a return struct.  For
+# "struct calls" test just beyond that 8 byte boundary, for "struct
+# returns" test up to that boundary.
+
+# For floats, assumed that up to two struct elements can be stored in
+# floating point registers, regardless of their size.
+
+# The approx size of each structure it is computed assumed that tc=1,
+# ts=2, ti=4, tl=4, tll=8, tf=4, td=8, tld=16, and that all fields are
+# naturally aligned.  Padding being added where needed.  Note that
+# these numbers are just approx, the d10v has ti=2, a 64-bit has has
+# tl=8.
+
+# Approx size: 2, 4, ...
+start_scalars_test ts
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 4, 8, ...
+start_scalars_test ti
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 4, 8, ...
+start_scalars_test tl
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 8, 16, ...
+start_scalars_test tll
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 4, 8, ...
+start_scalars_test tf
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 8, 16, ...
+start_scalars_test td
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 16, 32, ...
+start_scalars_test tld
+test_scalar_calls
+test_scalar_returns
+
+# Approx size: 4, 8, ...
+start_scalars_test te
+test_scalar_calls
+test_scalar_returns
+
+return 0
diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp
index 780e909..588bf05 100644
--- a/gdb/testsuite/gdb.base/charset.exp
+++ b/gdb/testsuite/gdb.base/charset.exp
@@ -140,7 +140,7 @@
 	# We got some output that ended with a regular prompt
         fail "get valid character sets"
     }
-    -re "^set charset.*$" {
+    -re ".*$gdb_prompt set charset.*$" {
 	# We got some other output, send a cntrl-c to gdb to get us back
         # to the prompt.
 	send_gdb "\003"
@@ -200,7 +200,6 @@
 
     -re "\\.\r\n$gdb_prompt $" {
 	#set host_charset_list $expect_out(1,string)
-	set charsets($expect_out(1,string)) 1
 	pass "capture valid host charsets"
     }
 
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
index af32acd..1363a00 100644
--- a/gdb/testsuite/gdb.base/ending-run.exp
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -1,4 +1,7 @@
-# Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 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
@@ -12,10 +15,7 @@
 # 
 # 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.  */
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 # use this to debug:
 #
@@ -109,7 +109,7 @@
     -re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
         set line_nine $expect_out(1,string)
         gdb_test "b ending-run.c:14" ".*Breakpoint 7.*ending-run.c, line 14.*"
-        gdb_test "b *$line_nine" ".*Note.*also.*Breakpoint 8.*"
+        gdb_test "b *$line_nine" ".*Note.*also.*Breakpoint 8.*" "Breakpoint 7 at *ending-run.c:14"
         gdb_test "c" ".*Breakpoint.*7.*callee.*14.*"
         gdb_test "cle" ".*Deleted breakpoints 8 7.*" "Clear 2 by default"
     }
diff --git a/gdb/testsuite/gdb.base/float.exp b/gdb/testsuite/gdb.base/float.exp
index 01b0a99..c09c37b 100644
--- a/gdb/testsuite/gdb.base/float.exp
+++ b/gdb/testsuite/gdb.base/float.exp
@@ -63,6 +63,8 @@
     gdb_test "info float" "f0.*f1.*f127.*" "info float"
 } elseif [istarget "m68k-*-*"] then {
     gdb_test "info float" "fp0.*fp1.*fp7.*" "info float"
+} elseif [istarget "mips*-*-*"] then {
+    gdb_test "info float" "f0:.*flt:.*dbl:.*" "info float"
 } elseif [istarget "s390*-*-*"] then {
     gdb_test "info float" "fpc.*f0.*f1.*f15.*" "info float"
 } elseif [istarget "sh*-*"] then {
@@ -75,6 +77,8 @@
 	      pass "info float (without FPU)"
 	}
     }
+} elseif [istarget "hppa*-*"] then {
+    gdb_test "info float" "fr4.*fr4R.*fr31R.*" "info float"
 } else {
-    gdb_test "info float" "No floating.point info available for this processor." "info float"
+    gdb_test "info float" "No floating.point info available for this processor." "info float (unknown target)"
 }
diff --git a/gdb/testsuite/gdb.base/foll-fork.exp b/gdb/testsuite/gdb.base/foll-fork.exp
index d3fb167..2ef3a4a 100644
--- a/gdb/testsuite/gdb.base/foll-fork.exp
+++ b/gdb/testsuite/gdb.base/foll-fork.exp
@@ -280,8 +280,7 @@
 A fork or vfork creates a new process.  follow-fork-mode can be:.*
 .*parent  - the original process is debugged after a fork.*
 .*child   - the new process is debugged after a fork.*
-.*ask     - the debugger will ask for one of the above choices.*
-For \"parent\" or \"child\", the unfollowed process will run free..*
+The unfollowed process will continue to run..*
 By default, the debugger will follow the parent process..*$gdb_prompt $"\
                       { pass "help set follow" }
       -re "$gdb_prompt $" { fail "help set follow" }
diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp
index 33fcba4..29239ef 100644
--- a/gdb/testsuite/gdb.base/gcore.exp
+++ b/gdb/testsuite/gdb.base/gcore.exp
@@ -187,7 +187,6 @@
 
 set post_corefile_extern_array \
 	[capture_command_output "print extern_array" "$print_prefix"]
-pass "extern_array = $post_corefile_extern_array"
 if ![string compare $pre_corefile_extern_array $post_corefile_extern_array]  {
     pass "corefile restored extern array"
 } else {
@@ -196,7 +195,6 @@
 
 set post_corefile_static_array \
 	[capture_command_output "print static_array" "$print_prefix"]
-pass "static_array = $post_corefile_static_array"
 if ![string compare $pre_corefile_static_array $post_corefile_static_array]  {
     pass "corefile restored static array"
 } else {
@@ -205,7 +203,6 @@
 
 set post_corefile_uninit_array \
 	[capture_command_output "print un_initialized_array" "$print_prefix"]
-pass "uninit_array = $post_corefile_uninit_array"
 if ![string compare $pre_corefile_uninit_array $post_corefile_uninit_array]  {
     pass "corefile restored un-initialized array"
 } else {
@@ -214,7 +211,6 @@
 
 set post_corefile_heap_string \
 	[capture_command_output "print heap_string" "$print_prefix"]
-pass "heap_string = $post_corefile_heap_string"
 if ![string compare $pre_corefile_heap_string $post_corefile_heap_string]  {
     pass "corefile restored heap array"
 } else {
@@ -223,7 +219,6 @@
 
 set post_corefile_local_array \
 	[capture_command_output "print array_func::local_array" "$print_prefix"]
-pass "local_array = $post_corefile_local_array"
 if ![string compare $pre_corefile_local_array $post_corefile_local_array]  {
     pass "corefile restored stack array"
 } else {
diff --git a/gdb/testsuite/gdb.base/gdb1250.exp b/gdb/testsuite/gdb.base/gdb1250.exp
index 60a6f59..4ffdf2b 100644
--- a/gdb/testsuite/gdb.base/gdb1250.exp
+++ b/gdb/testsuite/gdb.base/gdb1250.exp
@@ -42,7 +42,7 @@
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if ![runto abort] then {
+if ![runto abort {allow-pending}] then {
     perror "couldn't run to breakpoint"
     continue
 }
diff --git a/gdb/testsuite/gdb.base/gdb1476.c b/gdb/testsuite/gdb.base/gdb1476.c
deleted file mode 100644
index c3f4376..0000000
--- a/gdb/testsuite/gdb.base/gdb1476.c
+++ /dev/null
@@ -1,12 +0,0 @@
-void x()
-{
-  void (*fp)() = 0;
-  fp();
-}
-
-int
-main()
-{
-  x();
-  return 0;
-}
diff --git a/gdb/testsuite/gdb.base/gdb1476.exp b/gdb/testsuite/gdb.base/gdb1476.exp
deleted file mode 100644
index b88b2de..0000000
--- a/gdb/testsuite/gdb.base/gdb1476.exp
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 2004 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
-# 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.  
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@gnu.org
-
-# This file is part of the gdb testsuite.
-
-if $tracelevel {
-    strace $tracelevel
-}
-
-# Testcase for backtrace/gdb1476.
-
-set prms_id 0
-set bug_id 0
-
-set testfile "gdb1476"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-}
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
-#
-# Run to `main' where we begin our tests.
-#
-
-if ![runto_main] then {
-    gdb_suppress_tests
-}
-
-# If we can examine what's at memory address 0, it is possible that we
-# could also execute it.  This could probably make us run away,
-# executing random code, which could have all sorts of ill effects,
-# especially on targets without an MMU.  Don't run the tests in that
-# case.
-
-send_gdb "x 0\n"
-gdb_expect {
-    -re "0x0:.*Cannot access memory at address 0x0.*$gdb_prompt $" { }
-    -re "0x0:.*Error accessing memory address 0x0.*$gdb_prompt $" { }
-    -re ".*$gdb_prompt $" {
-	untested "Memory at address 0 is possibly executable"
-	return
-    }
-}
-
-gdb_test "continue" "Program received signal SIGSEGV.*" \
-	"continue to null pointer call"
-
-gdb_test "backtrace 10" \
-	"#0\[ \t\]*0x0* in .*\r\n#1\[ \t\]*$hex in x.*\r\n#2\[ \t\]*$hex in main.*" \
-	"backtrace from null pointer call"
diff --git a/gdb/testsuite/gdb.base/lineinc.c b/gdb/testsuite/gdb.base/lineinc.c
new file mode 100644
index 0000000..91784e7
--- /dev/null
+++ b/gdb/testsuite/gdb.base/lineinc.c
@@ -0,0 +1,30 @@
+/* The following is written to tickle a specific bug in the macro
+   table code (now hopefully fixed), which doesn't insert new included
+   files in the #including file's list in the proper place.  They
+   should be sorted by the number of the line which #included them, in
+   increasing order, but the sense of the comparison was reversed, so
+   the list ends up being built backwards.  This isn't a problem by
+   itself, but the code to pick new, non-conflicting line numbers for
+   headers alleged to be #included at the same line as some other
+   header assumes that the list's line numbers are in ascending order.
+
+   So, given the following input, lineinc1.h gets added to lineinc.c's
+   #inclusion list first, at line 10.  When the debug info reader
+   tries to add lineinc2.h at line 10 as well, the code will notice the
+   duplication --- since there's only one extant element in the list,
+   it'll find it --- and insert it after lineinc1.h, with line 11.
+   Since the code is putting the list in order of descending
+   #inclusion line number, the list is now out of order.  When we try
+   to #include lineinc3.h at line 11, we won't notice the duplication.  */
+
+#line 10
+#include "lineinc1.h"
+#line 10
+#include "lineinc2.h"
+#line 11
+#include "lineinc3.h"
+
+int
+main (int argc, char **argv)
+{
+}
diff --git a/gdb/testsuite/gdb.base/lineinc.exp b/gdb/testsuite/gdb.base/lineinc.exp
new file mode 100644
index 0000000..4707ce5
--- /dev/null
+++ b/gdb/testsuite/gdb.base/lineinc.exp
@@ -0,0 +1,126 @@
+# Test macro handling of #included files.
+# Copyright 2003 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
+# 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.  
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# The test program lineinc.c contains a mix of #line directives and
+# #include directives that will cause the compiler to attribute more
+# than one #inclusion to the same source line.  You can get similar
+# effects using things like GCC's '-imacros' flag.
+#
+# Compiling lineinc.c with Dwarf 2 macro information will produce
+# something like this:
+# 
+#     $ gcc -g3 lineinc.c -o lineinc
+#     $ readelf -wml lineinc
+#     ...
+#      The File Name Table:
+#       Entry	Dir	Time	Size	Name
+#       1	0	0	0	lineinc.c
+#       2	0	0	0	lineinc1.h
+#       3	0	0	0	lineinc2.h
+#       4	0	0	0	lineinc3.h
+#     ...
+#     Contents of the .debug_macinfo section:
+#     
+#      DW_MACINFO_start_file - lineno: 0 filenum: 1
+#      DW_MACINFO_define - lineno : 1 macro : __VERSION__ "3.2 20020903 (Red Hat Linux 8.0 3.2-7)"
+#      DW_MACINFO_define - lineno : 2 macro : __USER_LABEL_PREFIX__ 
+#     ...
+#      DW_MACINFO_define - lineno : 1 macro : __i386__ 1
+#      DW_MACINFO_define - lineno : 1 macro : __tune_i386__ 1
+#      DW_MACINFO_start_file - lineno: 10 filenum: 2
+#      DW_MACINFO_define - lineno : 1 macro : FOO 1
+#      DW_MACINFO_end_file
+#      DW_MACINFO_start_file - lineno: 10 filenum: 3
+#      DW_MACINFO_undef - lineno : 1 macro : FOO
+#      DW_MACINFO_define - lineno : 2 macro : FOO 2
+#      DW_MACINFO_end_file
+#      DW_MACINFO_start_file - lineno: 11 filenum: 4
+#      DW_MACINFO_undef - lineno : 1 macro : FOO
+#      DW_MACINFO_define - lineno : 2 macro : FOO 3
+#      DW_MACINFO_end_file
+#      DW_MACINFO_end_file
+#     $   
+#
+# Note how the inclusions of lineinc1.h and lineinc2.h are both
+# attributed to line 10 of lineinc.c, and the #inclusion of lineinc3.h
+# is attributed to line 11.  This is all correct, given the #line
+# directives in lineinc.c.
+#
+# Dwarf 2 macro information doesn't contain enough information to
+# allow GDB to figure out what's really going on here --- it makes no
+# mention of the #line directives --- so we just try to cope as best
+# we can.  If the macro table were to attribute more than one
+# #inclusion to the same source line, then GDB wouldn't be able to
+# tell which #included file's #definitions and #undefinitions come
+# first, so it can't tell which #definitions are in scope following
+# all the #inclusions.  To cope with this, GDB puts all the files
+# #included by a given source file in a list sorted by the line at
+# which they were #included; this gives GDB the chance to detect
+# multiple #inclusions at the same line, complain, and assign
+# distinct, albiet incorrect, line numbers to each #inclusion.
+#
+# However, at one point GDB was sorting the list in reverse order,
+# while the code to assign new, distinct line numbers assumed it was
+# sorted in ascending order; GDB would get an internal error trying to
+# read the above debugging info.
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "lineinc"
+set binfile ${objdir}/${subdir}/${testfile}
+
+
+if {[gdb_compile "${srcdir}/${subdir}/${testfile}.c" ${binfile} executable {debug}] != ""} {
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Any command that causes GDB to read the debugging info for the
+# lineinc.c compilation unit will do here.
+set test_name "tolerate macro info with multiple #inclusions per line"
+gdb_test_multiple "break main" $test_name {
+    -re "Breakpoint 1 at 0x.*: file .*lineinc.c.*\\.\r\n${gdb_prompt}" {
+        pass $test_name
+    }
+    -re ".*internal-error:.*.y or n. " {
+        fail $test_name
+        send_gdb "y\n"
+        gdb_expect {
+            -re ".*.y or n. " {
+                send_gdb "n\n"
+                exp_continue
+            }
+            -re "$gdb_prompt" {
+            }                
+            timeout {
+                fail "$test_name (timeout)"
+            }
+        }
+    }
+}
diff --git a/gdb/testsuite/gdb.base/lineinc1.h b/gdb/testsuite/gdb.base/lineinc1.h
new file mode 100644
index 0000000..8523d58
--- /dev/null
+++ b/gdb/testsuite/gdb.base/lineinc1.h
@@ -0,0 +1 @@
+#define FOO 1
diff --git a/gdb/testsuite/gdb.base/lineinc2.h b/gdb/testsuite/gdb.base/lineinc2.h
new file mode 100644
index 0000000..ee800ba
--- /dev/null
+++ b/gdb/testsuite/gdb.base/lineinc2.h
@@ -0,0 +1,2 @@
+#undef FOO
+#define FOO 2
diff --git a/gdb/testsuite/gdb.base/lineinc3.h b/gdb/testsuite/gdb.base/lineinc3.h
new file mode 100644
index 0000000..be3bb54
--- /dev/null
+++ b/gdb/testsuite/gdb.base/lineinc3.h
@@ -0,0 +1,2 @@
+#undef FOO
+#define FOO 3
diff --git a/gdb/testsuite/gdb.base/long_long.c b/gdb/testsuite/gdb.base/long_long.c
index 04fba92..3cc7c1f 100644
--- a/gdb/testsuite/gdb.base/long_long.c
+++ b/gdb/testsuite/gdb.base/long_long.c
@@ -1,3 +1,23 @@
+/* This test script is part of GDB, the GNU debugger.
+
+   Copyright 1999, 2004,
+   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
+   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.
+   */
+
 /* Test long long expression; test printing in general.
  *
  * /CLO/BUILD_ENV/Exports/cc -g +e -o long_long long_long.c
@@ -7,55 +27,74 @@
  * cc +e +DA2.0 -g -o long_long long_long.c
  */
 
-#ifdef PROTOTYPES
-long long callee(long long i)
-#else
-long long callee( i )
-long long i;
-#endif
+enum { MAX_BYTES = 16 };
+
+void
+pack (unsigned char b[MAX_BYTES], int size, int nr)
 {
-   register long long result;
-
-   result  = 0x12345678;
-   result  = result << i;
-   result += 0x9abcdef0;
-
-   return result;
+  static long long val[] = { 0x123456789abcdefLL, 01234567123456701234567LL, 12345678901234567890ULL};
+  volatile static int e = 1;
+  int i;
+  for (i = 0; i < nr; i++)
+    {
+      int offset;
+      if (*(char *)&e)
+	/* Little endian.  */
+	offset = sizeof (long long) - size;
+      else
+	/* Big endian endian.  */
+	offset = 0;
+      memcpy (b + size * i, (char *) val + sizeof (long long) * i + offset, size);
+    }
 }
 
+unsigned char b[MAX_BYTES];
+unsigned char h[MAX_BYTES];
+unsigned char w[MAX_BYTES];
+unsigned char g[MAX_BYTES];
+
+unsigned char c[MAX_BYTES];
+unsigned char s[MAX_BYTES];
+unsigned char i[MAX_BYTES];
+unsigned char l[MAX_BYTES];
+unsigned char ll[MAX_BYTES];
+
 int known_types()
 {
-   long long bin = 0, oct = 0, dec = 0, hex = 0;
+  /* A union is used here as, hopefully it has well defined packing
+     rules.  */
+  struct {
+    long long bin, oct, dec, hex;    
+  } val;
+  memset (&val, 0, sizeof val);
 
-   /* Known values, filling the full 64 bits.
-    */
-   bin = 0x123456789abcdefLL; /* 64 bits = 16 hex digits */
-   oct = 01234567123456701234567LL; /*  = 21+ octal digits */
-   dec = 12345678901234567890ULL;    /*  = 19+ decimal digits */
+  /* Known values, filling the full 64 bits.  */
+  val.bin = 0x123456789abcdefLL; /* 64 bits = 16 hex digits */
+  val.oct = 01234567123456701234567LL; /*  = 21+ octal digits */
+  val.dec = 12345678901234567890ULL;    /*  = 19+ decimal digits */
 
-   /* Stop here and look!
-    */
-   hex = bin - dec | oct;
+  /* Stop here and look!  */
+  val.hex = val.bin - val.dec | val.oct;
 
-   return 0;
+  return 0;
 }
 
 int main() {
 
-   register long long x, y;
-   register long long i;
-   
-   x = (long long) 0xfedcba9876543210LL;
-   y = x++;
-   x +=y;
-   i = 11;
-   x = callee( i );
-   y += x;
+   /* Pack Byte, Half, Word and Giant arrays with byte-orderd values.
+      That way "(gdb) x" gives the same output on different
+      architectures.  */
+   pack (b, 1, 2);
+   pack (h, 2, 2);
+   pack (w, 4, 2);
+   pack (g, 8, 2);
+   pack (c, sizeof (char), 2);
+   pack (s, sizeof (short), 2);
+   pack (i, sizeof (int), 2);
+   pack (l, sizeof (long), 2);
+   pack (ll, sizeof (long long), 2);
 
    known_types();
    
    return 0;
 }
-
-
-
diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
index 11308db..b36b30b 100644
--- a/gdb/testsuite/gdb.base/long_long.exp
+++ b/gdb/testsuite/gdb.base/long_long.exp
@@ -1,5 +1,7 @@
-# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 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
@@ -15,10 +17,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-
-
 # long_long.exp   Test printing of 64-bit things in 32-bit gdb.
 #                 Also test differnet kinds of formats.
 #
@@ -66,94 +64,141 @@
 set target_bigendian_p 1
 send_gdb "show endian\n"
 gdb_expect {
-    -re ".*little endian.*$gdb_prompt $" { set target_bigendian_p 0 }
-    -re ".*big endian.*$gdb_prompt $" { }
-    -re ".*$gdb_prompt $" {
+    -re "little endian.*$gdb_prompt $" { set target_bigendian_p 0 }
+    -re "big endian.*$gdb_prompt $" { }
+    -re "$gdb_prompt $" {
 	 fail "getting target endian"
     }
     default	{ fail "(timeout) getting target endian" }
 }
 
-# Detect targets with 2-byte integers.  Yes, it's not general to assume
-# that all others have 4-byte ints, but don't worry about it until one
-# actually exists.
+# Detect the size of the target's basic types.
 
-set sizeof_int 4
-send_gdb "print sizeof(int)\n"
-gdb_expect {
-    -re ".* = 2.*$gdb_prompt $" { set sizeof_int 2 }
-    -re ".*$gdb_prompt $" { }
-    default { }
+proc get_valueof { fmt exp default } {
+    global gdb_prompt
+    send_gdb "print${fmt} ${exp}\n"
+    gdb_expect {
+	-re "\\$\[0-9\]* = (\[-\]*\[0-9\]*).*$gdb_prompt $" {
+	    set val $expect_out(1,string)
+	    pass "get value of ${exp} ($val)"
+	}
+	timeout {
+	    set size ${default}
+	    fail "get value of ${exp} (timeout)"
+	}
+    }
+    return ${val}
 }
 
-# Detect targets with 2-byte pointers.  Assume all others use 4-bytes.
-set sizeof_ptr 4
-send_gdb "print sizeof(void*)\n"
-gdb_expect {
-    -re ".* = 2.*$gdb_prompt $" { set sizeof_ptr 2 }
-    -re ".*$gdb_prompt $" { }
-    default { }
+proc get_sizeof { type default } {
+    return [get_valueof "/d" "sizeof (${type})" $default]
 }
 
-# Detect targets with 4-byte shorts.  Assume all others use 2-bytes.
+set sizeof_char [get_sizeof "char" 1]
+set sizeof_short [get_sizeof "short" 2]
+set sizeof_int [get_sizeof "int" 4]
+set sizeof_long [get_sizeof "long" 4]
+set sizeof_long_long [get_sizeof "long long" 8]
+set sizeof_data_ptr [get_sizeof "void *" 4]
+set sizeof_double [get_sizeof "double" 8]
+set sizeof_long_double [get_sizeof "long double" 8]
 
-set sizeof_short 2
-send_gdb "print sizeof(short)\n"
-gdb_expect {
-    -re ".* = 4.*$gdb_prompt $" { set sizeof_short 4 }
-    -re ".*$gdb_prompt $" { }
-    default { }
+# Tests to handle ISA/ABI variants
+
+proc pat2 { n pats } {
+    set i 0
+    while { $n > 1 } {
+	set n [expr $n / 2]
+	incr i
+    }
+    return [lindex $pats $i]
 }
 
-# Detect targets with 4-byte doubles.
-
-set sizeof_double 8
-send_gdb "print sizeof(double)\n"
-gdb_expect {
-    -re ".* = 4.*$gdb_prompt $" { set sizeof_double 4 }
-    -re ".*$gdb_prompt $" { }
-    default { }
+proc gdb_test_xxx { test pat name } {
+    if { $pat == "" } {
+	setup_kfail *-*-* gdb/1672
+	gdb_test $test "xxx" $name
+    } else {
+	gdb_test $test $pat $name
+    }
 }
 
-set sizeof_long_double 8
-send_gdb "print sizeof(long double)\n"
-gdb_expect {
-    -re ".* = 4.*$gdb_prompt $" { set sizeof_long_double 4 }
-    -re ".*$gdb_prompt $" { }
-    default { }
+proc gdb_test_bi { test be le } {
+    global target_bigendian_p
+
+    if { $target_bigendian_p } {
+	gdb_test_xxx $test $be $test
+    } else {
+	gdb_test_xxx $test $le $test
+    }
 }
 
-gdb_test "n 4"   ".*38.*" "get to known place"
+proc gdb_test_ptr { test args } {
+    global sizeof_data_ptr
+
+    gdb_test_xxx $test [pat2 $sizeof_data_ptr $args] $test
+}
+
+proc gdb_test_xptr { examine args } {
+    global sizeof_data_ptr
+    set x [pat2 $sizeof_data_ptr $args]
+    # X is of the form { VARIABLE PATTERN }
+    gdb_test_xxx "$examine [lindex $x 0]" [lindex $x 1] "$examine"
+}
+
+proc gdb_test_char { test args } {
+    global sizeof_char
+    gdb_test_xxx $test [pat2 $sizeof_char $args] $test
+}
+
+proc gdb_test_short { test args } {
+    global sizeof_short
+    gdb_test_xxx $test [pat2 $sizeof_short $args] $test
+}
+
+proc gdb_test_int { test args } {
+    global sizeof_int
+    gdb_test_xxx $test [pat2 $sizeof_int $args] $test
+}
+
+proc gdb_test_long { test args } {
+    global sizeof_long
+    gdb_test_xxx $test [pat2 $sizeof_long $args] $test
+}
+
+proc gdb_test_long_long { test args } {
+    global sizeof_long_long
+    gdb_test_xxx $test [pat2 $sizeof_long_long $args] $test
+}
+
+gdb_breakpoint [gdb_get_line_number "Stop here and look"]
+gdb_continue_to_breakpoint "Stop here and look"
 
 # Check the hack for long long prints.
 #
-gdb_test "p/x hex" ".*0x0*0.*" "hex print p/x"
-gdb_test "p/x dec" ".*0xab54a98ceb1f0ad2.*" "decimal print p/x"
+gdb_test "p/x val.hex" "0x0*0" "hex print p/x"
+gdb_test "p/x val.dec" "0xab54a98ceb1f0ad2" "decimal print p/x"
 # see if 'p/<code>' is handled same as 'p /<code>'
 #
-gdb_test "p /x dec" ".*0xab54a98ceb1f0ad2.*" "default print dec"
-gdb_test "p /x bin" ".*0x0*123456789abcdef.*" "default print bin"
-gdb_test "p /x oct" ".*0xa72ee53977053977.*" "default print oct"
-gdb_test "p hex" ".*= 0*x*0*0.*" "default print hex"
+gdb_test "p /x val.dec" "0xab54a98ceb1f0ad2" "default print val.dec"
+gdb_test "p /x val.bin" "0x123456789abcdef" "default print val.bin"
+gdb_test "p /x val.oct" "0xa72ee53977053977" "default print val.oct"
+gdb_test "p val.hex" "= 0" "default print hex"
 
-gdb_test "p/u dec" ".*12345678901234567890.*" "decimal print p/u"
-gdb_test "p/t bin" ".*0*100100011010001010110011110001001101010111100110111101111.*" "binary print"
-gdb_test "p/o oct" ".*01234567123456701234567.*" "octal print"
-gdb_test "p /d bin" ".*81985529216486895.*" "print +ve long long"
-gdb_test "p/d dec" ".*-6101065172474983726.*" "decimal print p/d"
+gdb_test "p/u val.dec" "12345678901234567890" "decimal print p/u"
+gdb_test "p/t val.bin" "100100011010001010110011110001001101010111100110111101111" "binary print"
+gdb_test "p/o val.oct" "01234567123456701234567" "octal print"
+gdb_test "p /d val.bin" "81985529216486895" "print +ve long long"
+gdb_test "p/d val.dec" "-6101065172474983726" "decimal print p/d"
 
 # Try all the combinations to bump up coverage.
 #
-gdb_test "p/d oct" ".*-6399925985474168457.*"
-gdb_test "p/u oct" ".*12046818088235383159.*"
-gdb_test "p/o oct" ".*.*"
-gdb_test "p/t oct" ".*1010011100101110111001010011100101110111000001010011100101110111.*"
-if { $sizeof_ptr == 2 } {
-  gdb_test "p/a oct" ".*0x.*3977.*"
-} else {
-  gdb_test "p/a oct" ".*0x.*77053977.*"
-}
-gdb_test "p/c oct" ".*'w'.*"
+gdb_test "p/d val.oct" "-6399925985474168457"
+gdb_test "p/u val.oct" "12046818088235383159"
+gdb_test "p/o val.oct" ""
+gdb_test "p/t val.oct" "1010011100101110111001010011100101110111000001010011100101110111"
+gdb_test_ptr "p/a val.oct" "" "" "0x77053977" "0xa72ee53977053977"
+gdb_test "p/c val.oct" "'w'"
 
 if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
     # ARM floating point numbers are not strictly little endian or big endian,
@@ -164,149 +209,130 @@
 	    [istarget "xscale*-*-*"] || \
 	    [istarget "strongarm*-*-*"] } then {
 	# assume the long long represents a floating point double in ARM format
-	gdb_test "p/f oct" ".*2.1386676354387559e\\+265.*"
+	gdb_test "p/f val.oct" "2.1386676354387559e\\+265"
     } else {
 	# assume the long long represents a floating point double in little
 	# endian format
-	gdb_test "p/f oct" ".*-5.9822653797615723e-120.*"
+	gdb_test "p/f val.oct" "-5.9822653797615723e-120"
     }
-
 } else {
-
-    gdb_test "p/f oct" ".*-2.42716126e-15.*"
-
+    gdb_test "p/f val.oct" "-2.42716126e-15"
 }
 
-if { $target_bigendian_p } {
+gdb_test_char "p/x *(char *)c" "0x1"
+gdb_test_char "p/d *(char *)c" "1"
+gdb_test_char "p/u *(char *)c" "1"
+gdb_test_char "p/o *(char *)c" "01"
+gdb_test_char "p/t *(char *)c" "1"
+gdb_test_char "p/a *(char *)c" "0x1"
+gdb_test_char "p/f *(char *)c" "1"
+gdb_test_char "p/c *(char *)c" "1 '.001'"
 
-    if { $sizeof_int == 4 } {
+gdb_test_short "p/x *(short *)s" "" "0x123" ""
+gdb_test_short "p/d *(short *)s" "" "291" ""
+gdb_test_short "p/u *(short *)s" "" "291" ""
+gdb_test_short "p/o *(short *)s" "" "0443" ""
+gdb_test_short "p/t *(short *)s" "" "100100011" ""
+gdb_test_short "p/a *(short *)s" "" "0x123" ""
+gdb_test_short "p/f *(short *)s" "" "291" ""
+gdb_test_short "p/c *(short *)s" "" "35 '.'" ""
 
-	gdb_test "p/d *(int *)&oct" ".*-1490098887.*"
-	gdb_test "p/u *(int *)&oct" ".*2804868409.*"
-	gdb_test "p/o *(int *)&oct" ".*024713562471.*"
-	gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*"
+gdb_test_int "p/x *(int *)i" "" "0x123" "0x1234567" ""
+gdb_test_int "p/d *(int *)i" "" "291" "19088743" ""
+gdb_test_int "p/u *(int *)i" "" "291" "19088743" ""
+gdb_test_int "p/o *(int *)i" "" "0443" "0110642547" ""
+gdb_test_int "p/t *(int *)i" "" "100100011" "1001000110100010101100111" ""
+gdb_test_int "p/a *(int *)i" "" "" "0x1234567" ""
+gdb_test_int "p/f *(int *)i" "" "291" "2.99881655e-38" ""
+gdb_test_int "p/c *(int *)i" "" "35 '.'" "103 'g'" ""
 
-	if { $sizeof_ptr == 2 } {
-	    gdb_test "p/a *(int *)&oct" ".*0xe539.*"
-	} else {
-	    gdb_test "p/a *(int *)&oct" ".*0xf*a72ee539.*"
-	}
+gdb_test_long "p/x *(long *)l" "" "0x123" "0x1234567" "0x123456789abcdef"
+gdb_test_long "p/d *(long *)l" "" "291" "19088743" "81985529216486895"
+gdb_test_long "p/u *(long *)l" "" "291" "19088743" "81985529216486895"
+gdb_test_long "p/o *(long *)l" "" "0443" "0110642547" "04432126361152746757"
+gdb_test_long "p/t *(long *)l" "" "100100011" "1001000110100010101100111" "100100011010001010110011110001001101010111100110111101111"
+gdb_test_ptr "p/a *(long *)l" "" "" "0x1234567" "0x123456789abcdef"
+gdb_test_long "p/f *(long *)l" "" "291" "2.99881655e-38" "3.5127005640885037e-303"
+gdb_test_long "p/c *(long *)l" "" "35 '.'" "103 'g'" "-17 '.*'"
 
-	gdb_test "p/c *(int *)&oct" ".*57 '9'.*"
-	gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*"
+gdb_test_long_long "p/x *(long long *)ll" "" "" "" "0x123456789abcdef"
+gdb_test_long_long "p/d *(long long *)ll" "" "" "" "81985529216486895"
+gdb_test_long_long "p/u *(long long *)ll" "" "" "" "81985529216486895"
+gdb_test_long_long "p/o *(long long *)ll" "" "" "" "04432126361152746757"
+gdb_test_long_long "p/t *(long long *)ll" "" "" "" "100100011010001010110011110001001101010111100110111101111"
+gdb_test_ptr "p/a *(long long *)ll" "" "" "0x89abcdef" "0x123456789abcdef"
+gdb_test_long_long "p/f *(long long *)ll" "" "" "" "3.5127005640885037e-303"
+gdb_test_long_long "p/c *(long long *)ll" "" "" "" "-17 '.*'"
 
-    } else {
+# Implict Word size (except for a, c, and f)
 
-	gdb_test "p/d *(int *)&oct" ".*-22738.*"
-	gdb_test "p/u *(int *)&oct" ".*42798.*"
-	gdb_test "p/o *(int *)&oct" ".*0123456.*"
-	gdb_test "p/t *(int *)&oct" ".*1010011100101110.*"
-
-	if { $sizeof_ptr == 2 } {
-	    gdb_test "p/a *(int *)&oct" ".*0xa72e.*"
-	} else {
-	    gdb_test "p/a *(int *)&oct" ".*0xffffa72e.*"
-	}
-	gdb_test "p/c *(int *)&oct" ".*46 '.'.*"
-	gdb_test "p/f *(int *)&oct" ".*-22738.*"
-
-    }
-
-    if { $sizeof_short == 2 } {
-	gdb_test "p/d *(short *)&oct" ".*-22738.*"
-	gdb_test "p/u *(short *)&oct" ".*42798.*"
-	gdb_test "p/o *(short *)&oct" ".*0123456.*"
-	gdb_test "p/t *(short *)&oct" ".*1010011100101110.*"
-	if { $sizeof_ptr == 2 } {
-	    gdb_test "p/a *(short *)&oct" ".*0xa72e.*"
-	} else {
-	    gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*"
-	}
-	gdb_test "p/c *(short *)&oct" ".* 46 '.'.*"
-	gdb_test "p/f *(short *)&oct" ".*-22738.*"
-    } else {
-	gdb_test "p/d *(short *)&oct" ".*-1490098887.*"
-	gdb_test "p/u *(short *)&oct" ".*2804868409.*"
-	gdb_test "p/o *(short *)&oct" ".*024713562471.*"
-	gdb_test "p/t *(short *)&oct" ".*10100111001011101110010100111001.*"
-	gdb_test "p/a *(short *)&oct" ".*0xf*a72ee539.*"
-	gdb_test "p/c *(short *)&oct" ".* 57 '9'.*"
-	gdb_test "p/f *(short *)&oct" ".*-2.42716126e-15.*"
-    }
-
-    gdb_test "x/x &oct" ".*0xa72ee539.*"
-    gdb_test "x/d &oct" ".*.-1490098887*"
-    gdb_test "x/u &oct" ".*2804868409.*"
-    gdb_test "x/o &oct" ".*024713562471.*"
-    gdb_test "x/t &oct" ".*10100111001011101110010100111001.*"
-    if { $sizeof_ptr == 2 } {
-	gdb_test "x/a &oct" ".*0xa72e.*"
-    } else {
-	gdb_test "x/a &oct" ".*0xa72ee539.*"
-    }
-    gdb_test "x/c &oct" ".*-89 .*"
-    # FIXME GDB's output is correct, but this longer match fails.
-    # gdb_test "x/c &oct" ".*-89 '\\\\247'.*"
-    if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
-	gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*"
-    } else {
-	gdb_test "x/f &oct" ".*-2.42716126e-15.*"
-    }
-
-    # FIXME Fill in the results for all the following tests.  (But be careful
-    # about looking at locations with unspecified contents!)
-
-    gdb_test "x/2x &oct" ".*0xa72ee53977053977.*"
-    gdb_test "x/2d &oct" ".*-6399925985474168457.*"
-    gdb_test "x/2u &oct" ".*.*"
-    gdb_test "x/2o &oct" ".*.*"
-    gdb_test "x/2t &oct" ".*.*"
-    gdb_test "x/2a &oct" ".*.*"
-    gdb_test "x/2c &oct" ".*.*"
-    gdb_test "x/2f &oct" ".*.*"
-
-    gdb_test "x/2bx &oct" ".*.*"
-    gdb_test "x/2bd &oct" ".*.*"
-    gdb_test "x/2bu &oct" ".*.*"
-    gdb_test "x/2bo &oct" ".*.*"
-    gdb_test "x/2bt &oct" ".*.*"
-    gdb_test "x/2ba &oct" ".*.*"
-    gdb_test "x/2bc &oct" ".*.*"
-    gdb_test "x/2bf &oct" ".*.*"
-
-    gdb_test "x/2hx &oct" ".*.*"
-    gdb_test "x/2hd &oct" ".*.*"
-    gdb_test "x/2hu &oct" ".*.*"
-    gdb_test "x/2ho &oct" ".*.*"
-    gdb_test "x/2ht &oct" ".*.*"
-    gdb_test "x/2ha &oct" ".*.*"
-    gdb_test "x/2hc &oct" ".*.*"
-    gdb_test "x/2hf &oct" ".*.*"
-
-    gdb_test "x/2wx &oct" ".*.*"
-    gdb_test "x/2wd &oct" ".*.*"
-    gdb_test "x/2wu &oct" ".*.*"
-    gdb_test "x/2wo &oct" ".*.*"
-    gdb_test "x/2wt &oct" ".*.*"
-    gdb_test "x/2wa &oct" ".*.*"
-    gdb_test "x/2wc &oct" ".*.*"
-    gdb_test "x/2wf &oct" ".*.*"
-
-    gdb_test "x/2gx &oct" ".*.*"
-    gdb_test "x/2gd &oct" ".*.*"
-    gdb_test "x/2gu &oct" ".*.*"
-    gdb_test "x/2go &oct" ".*.*"
-    gdb_test "x/2gt &oct" ".*.*"
-    gdb_test "x/2ga &oct" ".*.*"
-    gdb_test "x/2gc &oct" ".*.*"
-    gdb_test "x/2gf &oct" ".*.*"
-
+gdb_test "x/w w" "" "set examine size to w"
+gdb_test "x/x w" "0x01234567"
+gdb_test "x/d w" "19088743"
+gdb_test "x/u w" "19088743"
+gdb_test "x/o w" "0110642547"
+gdb_test "x/t w" "00000001001000110100010101100111"
+gdb_test_xptr "x/a" { b "" } { h "" } { w "0x1234567" } { g "0x123456789abcdef" }
+gdb_test "x/c b" "1 '.001'"
+if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
+    gdb_test "x/f &val.oct" "-5.9822653797615723e-120"
 } else {
-
-    # FIXME Add little-endian versions of these tests, or define a
-    # gdb_test_bi with two strings to match on.
-
+    gdb_test "x/f &val.oct" "-2.42716126e-15"
 }
 
+# Implict Giant size (except for a, c, and f)
+
+gdb_test "x/g g" "" "set examine size to g"
+gdb_test "x/2x g" "0x0123456789abcdef.*0xa72ee53977053977"
+gdb_test "x/2d g" "81985529216486895.*-6399925985474168457"
+gdb_test "x/2u g" "81985529216486895.*12046818088235383159"
+gdb_test "x/2o g" "04432126361152746757.*01234567123456701234567"
+gdb_test "x/2t g" "0000000100100011010001010110011110001001101010111100110111101111.*1010011100101110111001010011100101110111000001010011100101110111"
+gdb_test_xptr "x/2a" { b "" } { h "" } { w "0x1234567.*0xa72ee539" } { g "0x123456789abcdef.*0xa72ee53977053977" }
+gdb_test "x/2c b" "1 '.001'.*-89 '.'"
+if { $sizeof_double == 8 || $sizeof_long_double == 8 } {
+    gdb_test "x/2f &val.oct" "-5.9822653797615723e-120.*-5.9041889495880968e-100"
+} else {
+    gdb_test "x/2f &val.oct" "-2.42716126e-15"
+}
+
+# Explicit sizes, and two memory locations ...
+
+gdb_test "x/2bx b" "0x01.*0xa7"
+gdb_test "x/2bd b" "1.*-89"
+gdb_test "x/2bu b" "1.*167"
+gdb_test "x/2bo b" "01.*0247"
+gdb_test "x/2bt b" "00000001.*10100111"
+gdb_test_ptr "x/2ba b" "" "" "0x1.*0xffffffa7" "0x1.*0xffffffffffffffa7"
+gdb_test "x/2bc b" "1 '.001'.*-89 '.'"
+gdb_test "x/2bf b" "1.*-89"
+
+gdb_test "x/2hx h" "0x0123.*0xa72e"
+gdb_test "x/2hd h" "291.*-22738"
+gdb_test "x/2hu h" "291.*42798"
+gdb_test "x/2ho h" "0443.*0123456"
+gdb_test "x/2ht h" "0000000100100011.*1010011100101110"
+gdb_test_ptr "x/2ha h" "" ""  "0x123.*0xffffa72e" "0x123.*0xffffffffffffa72e"
+gdb_test "x/2hc h" "35 '.'.*46 '.'"
+gdb_test "x/2hf h" "291.*-22738"
+
+gdb_test "x/2wx w" "0x01234567.*0xa72ee539"
+gdb_test "x/2wd w" "19088743.*-1490098887"
+gdb_test "x/2wu w" "19088743.*2804868409"
+gdb_test "x/2wo w" "0110642547.*024713562471"
+gdb_test "x/2wt w" "00000001001000110100010101100111.*10100111001011101110010100111001"
+gdb_test_ptr "x/2wa w" "" ""  "0x1234567.*0xa72ee539" "0x1234567.*0xffffffffa72ee539"
+gdb_test "x/2wc w" "103 'g'.*57 '9'"
+gdb_test "x/2wf w" "2.99881655e-38.*-2.42716126e-15"
+
+gdb_test "x/2gx g" "0x0123456789abcdef.*0xa72ee53977053977"
+gdb_test "x/2gd g" "81985529216486895.*-6399925985474168457"
+gdb_test "x/2gu g" "81985529216486895.*12046818088235383159"
+gdb_test "x/2go g" "04432126361152746757.*01234567123456701234567"
+gdb_test "x/2gt g" "0000000100100011010001010110011110001001101010111100110111101111.*1010011100101110111001010011100101110111000001010011100101110111"
+gdb_test_ptr "x/2ga g" "" "" "0x89abcdef.*0x77053977" "0x123456789abcdef.*0xa72ee53977053977"
+gdb_test "x/2gc g" "-17 '.'.*119 'w'"
+gdb_test "x/2gf g" "3.5127005640885037e-303.*-5.9822653797615723e-120"
+
 gdb_exit
 return 0
diff --git a/gdb/testsuite/gdb.base/pending.exp b/gdb/testsuite/gdb.base/pending.exp
index 315e544..9bc0802 100644
--- a/gdb/testsuite/gdb.base/pending.exp
+++ b/gdb/testsuite/gdb.base/pending.exp
@@ -207,6 +207,31 @@
 \[0-9\]+\[\t \]+breakpoint     keep y.*PENDING.*pendshr.c:26 if x > 3.*" \
 "multiple pending breakpoints"
 
+
+#
+# Try a pending break for a line in a source file with ignore count:
+#
+
+gdb_test_multiple "break pendshr.c:27" "Set pending breakpoint 3" {
+     -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
+	    gdb_test "y" "Breakpoint.*pendshr.c:27.*pending." \
+		"Set pending breakpoint 3"
+     }
+}
+
+gdb_test {ignore $bpnum 2} "Will ignore next 2 crossings of breakpoint .*" \
+    "set ignore count on pending breakpoint 3"
+
+gdb_test "info break" \
+    "Num Type\[ \]+Disp Enb Address\[ \]+What.*
+\[0-9\]+\[\t \]+breakpoint     keep n.*PENDING.*pendfunc1.*
+\[\t \]+stop only if k == 1.*
+\[\t \]+print k.*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$mainline.*
+\[0-9\]+\[\t \]+breakpoint     keep y.*PENDING.*pendshr.c:26 if x > 3.*
+\[0-9\]+\[\t \]+breakpoint     keep y.*PENDING.*pendshr.c:27.*ignore next 2 hits.*" \
+"multiple pending breakpoints 2"
+
 #
 # Run to main which should resolve a pending breakpoint
 #
@@ -239,6 +264,19 @@
 \[$\]1 = 1." \
 "continue to resolved breakpoint 1"
 
+#
+# Disable the other two breakpoints, and continue to the one with
+# the ignore count.  Make sure you hit it the third time, x should
+# be 3 then.
+#
+
+gdb_test "disable 7" "" "Disable other breakpoints"
+gdb_test "disable 5" "" "Disable other breakpoints"
+
+gdb_test "continue" \
+	{.*Breakpoint.*pendfunc1.*\(x=3\) at.*pendshr.c:27.*printf.*;} \
+"continue to resolved breakpoint 3"
+
 delete_breakpoints
 
 gdb_breakpoint "main"
@@ -259,6 +297,7 @@
 #
 
 rerun_to_main
+
 gdb_test "info break" \
     "Num Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$mainline.*
diff --git a/gdb/config/i386/tm-i386.h b/gdb/testsuite/gdb.base/sep-proc.c
similarity index 65%
copy from gdb/config/i386/tm-i386.h
copy to gdb/testsuite/gdb.base/sep-proc.c
index e2bd81f..0fbb17a 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/testsuite/gdb.base/sep-proc.c
@@ -1,8 +1,6 @@
-/* Macro definitions for GDB on an Intel i[345]86.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+/* This file is part of GDB, the GNU debugger.
 
-   This file is part of GDB.
+   Copyright 2004 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
@@ -13,13 +11,16 @@
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-#ifndef TM_I386_H
-#define TM_I386_H 1
+   Please email any bugs, comments, and/or additions to this file to:
+   bug-gdb@prep.ai.mit.edu  */
 
-#endif /* ifndef TM_I386_H */
+void
+say_hello (void)
+{
+  printf ("Hello world.\n");
+}
diff --git a/gdb/testsuite/gdb.base/sep.c b/gdb/testsuite/gdb.base/sep.c
new file mode 100644
index 0000000..4402bd8
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sep.c
@@ -0,0 +1,35 @@
+/* This file is part of GDB, the GNU debugger.
+
+   Copyright 2004 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
+   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.
+
+   Please email any bugs, comments, and/or additions to this file to:
+   bug-gdb@prep.ai.mit.edu  */
+
+#include <stdio.h>
+
+/* Include a .c file.  This is usually considered bad practice in C,
+   but this emulate a practice which is common in other languages.
+   One such language is Ada and its concept of "separates", for instance.  */
+#include "sep-proc.c"
+
+int
+main (void)
+{
+  say_hello ();
+  return 0;
+}
+
diff --git a/gdb/testsuite/gdb.base/sep.exp b/gdb/testsuite/gdb.base/sep.exp
new file mode 100644
index 0000000..7a7c22a
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sep.exp
@@ -0,0 +1,68 @@
+# Copyright 2004 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
+# 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.  
+#
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+set testfile "sep"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Try to display the source code inside a file which is included by
+# another source file.  The purpose of this test is to verify that
+# this operation works, even before we have loaded full symbols for
+# that file (by doing a "break say_hello" for instance).
+#
+# We just check that the command succeeds, so no need to match the
+# complete exact output.  Simply verifying that we get procedure
+# say_hello is good enough, and avoid unnecessary failures is someone
+# decides later to reformat sep-proc.c.
+
+gdb_test "list sep-proc.c:23" \
+         "void.*say_hello.*" \
+         "list using location inside included file"
+
+# Try the same, but this time with a breakpoint.  We need to exit
+# GDB to make sure that we havn't loaded the full symbols yet when
+# we test the breakpoint insertion.
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set test "breakpoint inside included file"
+gdb_test_multiple "break sep-proc.c:25" "$test" {
+    -re "Breakpoint.*at.* file .*sep-proc.c, line .*" {
+        pass "$test"
+    }
+    -re "No source file named sep-proc.c.*" {
+        fail "$test"
+    }
+}
+
diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
index 4205253..26a6556 100644
--- a/gdb/testsuite/gdb.base/shlib-call.exp
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -291,17 +291,17 @@
 
 # PR's 16495, 18213
 # test that we can re-set breakpoints in shared libraries
-gdb_breakpoint "shr1"
+gdb_breakpoint "shr1" "allow-pending"
 
 # FIXME: should not send "run" explicitly.  Non-portable.
 
 if ![is_remote target] {
-  gdb_test "run" "Starting program:.*Breakpoint 1,.*" \
+  gdb_test "run" "Starting program:.*Breakpoint .,.*" \
 	"run to bp in shared library"
 
   gdb_test "cont" ".*Program exited normally..*"
 
-  gdb_test "run" "Starting program:.*Breakpoint 1,.*" \
+  gdb_test "run" "Starting program:.*Breakpoint .,.*" \
 	"re-run to bp in shared library (PR's 16495, 18213)"
 
   gdb_test "cont" ".*Program exited normally..*"
diff --git a/gdb/testsuite/gdb.base/sigaltstack.c b/gdb/testsuite/gdb.base/sigaltstack.c
new file mode 100644
index 0000000..afcc8fb
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sigaltstack.c
@@ -0,0 +1,95 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2004 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
+   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.
+
+   Please email any bugs, comments, and/or additions to this file to:
+   bug-gdb@prep.ai.mit.edu  */
+
+#include <signal.h>
+#include <stdio.h>
+#include <sys/time.h>
+
+enum level { MAIN, OUTER, INNER, LEAF, NR_LEVELS };
+
+/* Levels completed flag.  */
+volatile enum level level = NR_LEVELS;
+
+void catcher (int signal);
+
+void
+thrower (enum level next_level, int sig, int itimer, int on_stack)
+{
+  level = next_level;
+  /* Set up the signal handler.  */
+  {
+    struct sigaction act;
+    memset (&act, 0, sizeof (act));
+    act.sa_handler = catcher;
+    act.sa_flags |= on_stack;
+    sigaction (sig, &act, NULL);
+  }
+  /* Set up a one-off timer.  A timer, rather than SIGSEGV, is used as
+     after a timer handler finishes the interrupted code can safely
+     resume.  */
+  {
+    struct itimerval itime;
+    memset (&itime, 0, sizeof (itime));
+    itime.it_value.tv_usec = 250 * 1000;
+    setitimer (itimer, &itime, NULL);
+  }
+  /* Wait.  */
+  while (level != LEAF);
+}
+
+void
+catcher (int signal)
+{
+  /* Find the next level.  */
+  switch (level)
+    {
+    case MAIN:
+      thrower (OUTER, SIGALRM, ITIMER_REAL, SA_ONSTACK);
+      break;
+    case OUTER:
+      thrower (INNER, SIGVTALRM, ITIMER_VIRTUAL, SA_ONSTACK);
+      break;
+    case INNER:
+      level = LEAF;
+      return;
+    }
+}
+
+
+main ()
+{
+  /* Set up the altstack.  */
+  {
+    static char stack[SIGSTKSZ * NR_LEVELS];
+    struct sigaltstack alt;
+    memset (&alt, 0, sizeof (alt));
+    alt.ss_sp = stack;
+    alt.ss_size = SIGSTKSZ;
+    alt.ss_flags = 0;
+    if (sigaltstack (&alt, NULL) < 0)
+      {
+	perror ("sigaltstack");
+	exit (0);
+      }
+  }
+  level = MAIN;
+  catcher (0);
+}
diff --git a/gdb/testsuite/gdb.base/sigaltstack.exp b/gdb/testsuite/gdb.base/sigaltstack.exp
new file mode 100644
index 0000000..8f09ccf
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sigaltstack.exp
@@ -0,0 +1,88 @@
+# Copyright 2004 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
+# 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.  
+
+
+# The program sigaltstack.c creates a backtrace containing nested
+# signal handlers on an alternative stack.  This in turn leads to a
+# non-contiguous (and possibly non-monotonic) backtrace - stack
+# address jump at the normal-alt stack boundary.
+
+# This test confirms that GDB can both backtrace through and finish
+# such a stack.
+
+if [target_info exists gdb,nosignals] {
+    verbose "Skipping signals.exp because of nosignals."
+    continue
+}
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile sigaltstack
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+    untested "Couldn't compile ${module}.c"
+    return -1
+}
+
+# get things started
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Pass all the alarms straight through (but verbosely)
+gdb_test "handle SIGALRM print pass nostop"
+gdb_test "handle SIGVTALRM print pass nostop"
+gdb_test "handle SIGPROF print pass nostop"
+
+# Advance to main
+if { ![runto_main] } then {
+    gdb_suppress_tests;
+}
+
+# Stop in handle, when at the inner most level
+gdb_test "break catcher if level == INNER"
+gdb_test "continue" ".* catcher .*" "continue to catch"
+# step off the assignment
+gdb_test "next"
+
+# Full backtrace?
+send_gdb "bt\n"
+gdb_expect_list "backtrace" ".*$gdb_prompt $" {
+    "\[\r\n\]+.0 \[^\r\n\]* catcher "
+    "\[\r\n\]+.1  .signal handler called."
+    "\[\r\n\]+.2 \[^\r\n\]* thrower .next_level=INNER"
+    "\[\r\n\]+.3 \[^\r\n\]* catcher "
+    "\[\r\n\]+.4  .signal handler called."
+    "\[\r\n\]+.5 \[^\r\n\]* thrower .next_level=OUTER"
+    "\[\r\n\]+.6 \[^\r\n\]* catcher "
+    "\[\r\n\]+.7 \[^\r\n\]* main .*"
+}
+
+# Finish?
+gdb_test "finish" "signal handler called." "finish from catch LEAF"
+gdb_test "finish" "thrower .next_level=INNER, .*" "finish to throw INNER"
+gdb_test "finish" "catcher .*" "finish to catch INNER"
+gdb_test "finish" "signal handler called.*" "finish from catch INNER"
+gdb_test "finish" "thrower .next_level=OUTER, .*" "finish to OUTER"
+gdb_test "finish" "catcher .*" "finish to catch MAIN"
+gdb_test "finish" "main .*" "finish to MAIN"
diff --git a/gdb/testsuite/gdb.base/sigbpt.c b/gdb/testsuite/gdb.base/sigbpt.c
new file mode 100644
index 0000000..b189f6d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sigbpt.c
@@ -0,0 +1,53 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2004 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
+   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 <signal.h>
+#include <stdlib.h>
+#include <string.h>
+
+extern void
+keeper (int sig)
+{
+}
+
+volatile long v1 = 0;
+volatile long v2 = 0;
+volatile long v3 = 0;
+
+extern long
+bowler (void)
+{
+  /* Try to read address zero.  Do it in a slightly convoluted way so
+     that more than one instruction is used.  */
+  return *(char *) (v1 + v2 + v3);
+}
+
+int
+main ()
+{
+  static volatile int i;
+
+  struct sigaction act;
+  memset (&act, 0, sizeof act);
+  act.sa_handler = keeper;
+  sigaction (SIGSEGV, &act, NULL);
+
+  bowler ();
+  return 0;
+}
diff --git a/gdb/testsuite/gdb.base/sigbpt.exp b/gdb/testsuite/gdb.base/sigbpt.exp
new file mode 100644
index 0000000..61625b5
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sigbpt.exp
@@ -0,0 +1,266 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2004 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
+# 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.  
+
+# Check that GDB can and only executes single instructions when
+# stepping through a sequence of breakpoints interleaved by a signal
+# handler.
+
+# This test is known to tickle the following problems: kernel letting
+# the inferior execute both the system call, and the instruction
+# following, when single-stepping a system call; kernel failing to
+# propogate the single-step state when single-stepping the sigreturn
+# system call, instead resuming the inferior at full speed; GDB
+# doesn't know how to software single-step across a sigreturn
+# instruction.  Since the kernel problems can be "fixed" using
+# software single-step this is KFAILed rather than XFAILed.
+
+if $tracelevel {
+    strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "sigbpt"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# Run to `main' where we begin our tests.
+#
+
+if ![runto_main] then {
+    gdb_suppress_tests
+}
+
+# If we can examine what's at memory address 0, it is possible that we
+# could also execute it.  This could probably make us run away,
+# executing random code, which could have all sorts of ill effects,
+# especially on targets without an MMU.  Don't run the tests in that
+# case.
+
+send_gdb "x 0\n"
+gdb_expect {
+    -re "0x0:.*Cannot access memory at address 0x0.*$gdb_prompt $" { }
+    -re "0x0:.*Error accessing memory address 0x0.*$gdb_prompt $" { }
+    -re ".*$gdb_prompt $" {
+	untested "Memory at address 0 is possibly executable"
+	return
+    }
+}
+
+gdb_test "break keeper"
+
+# Run to bowler, and then single step until there's a SIGSEGV.  Record
+# the address of each single-step instruction (up to and including the
+# instruction that causes the SIGSEGV) in bowler_addrs, and the address
+# of the actual SIGSEGV in segv_addr.
+
+set bowler_addrs bowler
+gdb_test {display/i $pc}
+gdb_test "advance *bowler" "bowler.*" "advance to the bowler"
+set test "stepping to SIGSEGV"
+gdb_test_multiple "stepi" "$test" {
+    -re "Program received signal SIGSEGV.*pc *(0x\[0-9a-f\]*).*$gdb_prompt $" {
+	set segv_addr $expect_out(1,string)
+	pass "$test"
+    }
+    -re " .*pc *(0x\[0-9a-f\]*).*bowler.*$gdb_prompt $" {
+	set bowler_addrs [concat $expect_out(1,string) $bowler_addrs]
+	send_gdb "stepi\n"
+	exp_continue
+    }
+}
+
+# Now record the address of the instruction following the faulting
+# instruction in bowler_addrs.
+
+set test "get insn after fault"
+gdb_test_multiple {x/2i $pc} "$test" {
+    -re "(0x\[0-9a-f\]*).*bowler.*(0x\[0-9a-f\]*).*bowler.*$gdb_prompt $" {
+	set bowler_addrs [concat $expect_out(2,string) $bowler_addrs]
+	pass "$test"
+    }
+}
+
+# Procedures for returning the address of the instruction before, at
+# and after, the faulting instruction.
+
+proc before_segv { } {
+    global bowler_addrs
+    return [lindex $bowler_addrs 2]
+}
+
+proc at_segv { } {
+    global bowler_addrs
+    return [lindex $bowler_addrs 1]
+}
+
+proc after_segv { } {
+    global bowler_addrs
+    return [lindex $bowler_addrs 0]
+}
+
+# Check that the address table and SIGSEGV correspond.
+
+set test "Verify that SIGSEGV occurs at the last STEPI insn"
+if {[string compare $segv_addr [at_segv]] == 0} {
+    pass "$test"
+} else {
+    fail "$test ($segv_addr [at_segv])"
+}
+
+# Check that the inferior is correctly single stepped all the way back
+# to a faulting instruction.
+
+proc stepi_out { name args } {
+    global gdb_prompt
+
+    # Set SIGSEGV to pass+nostop and then run the inferior all the way
+    # through to the signal handler.  With the handler is reached,
+    # disable SIGSEGV, ensuring that further signals stop the
+    # inferior.  Stops a SIGSEGV infinite loop when a broke system
+    # keeps re-executing the faulting instruction.
+    rerun_to_main
+    gdb_test "handle SIGSEGV nostop print pass" "" "${name}; pass SIGSEGV"
+    gdb_test "continue" "keeper.*" "${name}; continue to keeper"
+    gdb_test "handle SIGSEGV stop print nopass" "" "${name}; nopass SIGSEGV"
+
+    # Insert all the breakpoints.  To avoid the need to step over
+    # these instructions, this is delayed until after the keeper has
+    # been reached.
+    for {set i 0} {$i < [llength $args]} {incr i} {
+	gdb_test "break [lindex $args $i]" "Breakpoint.*" \
+	    "${name}; set breakpoint $i of [llength $args]"
+    }
+
+    # Single step our way out of the keeper, through the signal
+    # trampoline, and back to the instruction that faulted.
+    set test "${name}; stepi out of handler"
+    gdb_test_multiple "stepi" "$test" {
+	-re "keeper.*$gdb_prompt $" {
+	    send_gdb "stepi\n"
+	    exp_continue
+	}
+	-re "signal handler.*$gdb_prompt $" {
+	    send_gdb "stepi\n"
+	    exp_continue
+	}
+	-re "Program received signal SIGSEGV.*$gdb_prompt $" {
+	    kfail gdb/1702 "$test (executed fault insn)"
+	}
+	-re "Breakpoint.*pc *[at_segv] .*bowler.*$gdb_prompt $" {
+	    pass "$test (at breakpoint)"
+	}
+	-re "Breakpoint.*pc *[after_segv] .*bowler.*$gdb_prompt $" {
+	    kfail gdb/1702 "$test (executed breakpoint)"
+	}
+	-re "pc *[at_segv] .*bowler.*$gdb_prompt $" {
+	    pass "$test"
+	}
+	-re "pc *[after_segv] .*bowler.*$gdb_prompt $" {
+	    kfail gdb/1702 "$test (skipped fault insn)"
+	}
+	-re "pc *0x\[a-z0-9\]* .*bowler.*$gdb_prompt $" {
+	    kfail gdb/1702 "$test (corrupt pc)"
+	}
+    }
+
+    # Clear any breakpoints
+    for {set i 0} {$i < [llength $args]} {incr i} {
+	gdb_test "clear [lindex $args $i]" "Deleted .*" \
+	    "${name}; clear breakpoint $i of [llength $args]"
+    }
+}
+
+# Let a signal handler exit, returning to a breakpoint instruction
+# inserted at the original fault instruction.  Check that the
+# breakpoint is hit, and that single stepping off that breakpoint
+# executes the underlying fault instruction causing a SIGSEGV.
+
+proc cont_out { name args } {
+    global gdb_prompt
+
+    # Set SIGSEGV to pass+nostop and then run the inferior all the way
+    # through to the signal handler.  With the handler is reached,
+    # disable SIGSEGV, ensuring that further signals stop the
+    # inferior.  Stops a SIGSEGV infinite loop when a broke system
+    # keeps re-executing the faulting instruction.
+    rerun_to_main
+    gdb_test "handle SIGSEGV nostop print pass" "" "${name}; pass SIGSEGV"
+    gdb_test "continue" "keeper.*" "${name}; continue to keeper"
+    gdb_test "handle SIGSEGV stop print nopass" "" "${name}; nopass SIGSEGV"
+
+    # Insert all the breakpoints.  To avoid the need to step over
+    # these instructions, this is delayed until after the keeper has
+    # been reached.  Always set a breakpoint at the signal trampoline
+    # instruction.
+    set args [concat $args "*[at_segv]"]
+    for {set i 0} {$i < [llength $args]} {incr i} {
+	gdb_test "break [lindex $args $i]" "Breakpoint.*" \
+	    "${name}; set breakpoint $i  of [llength $args]"
+    }
+
+    # Let the handler return, it should "appear to hit" the breakpoint
+    # inserted at the faulting instruction.  Note that the breakpoint
+    # instruction wasn't executed, rather the inferior was SIGTRAPed
+    # with the PC at the breakpoint.
+    gdb_test "continue" "Breakpoint.*pc *[at_segv] .*" \
+	"${name}; continue to breakpoint at fault"
+
+    # Now single step the faulted instrction at that breakpoint.
+    gdb_test "stepi" \
+	"Program received signal SIGSEGV.*pc *[at_segv] .*" \
+	"${name}; stepi fault"    
+
+    # Clear any breakpoints
+    for {set i 0} {$i < [llength $args]} {incr i} {
+	gdb_test "clear [lindex $args $i]" "Deleted .*" \
+	    "${name}; clear breakpoint $i of [llength $args]"
+    }
+
+}
+
+
+
+# Try to confuse DECR_PC_AFTER_BREAK architectures by scattering
+# breakpoints around the faulting address.  In all cases the inferior
+# should single-step out of the signal trampoline halting (but not
+# executing) the fault instruction.
+
+stepi_out "stepi"
+stepi_out "stepi bp before segv" "*[before_segv]"
+stepi_out "stepi bp at segv" "*[at_segv]"
+stepi_out "stepi bp before and at segv" "*[at_segv]" "*[before_segv]"
+
+
+# Try to confuse DECR_PC_AFTER_BREAK architectures by scattering
+# breakpoints around the faulting address.  In all cases the inferior
+# should exit the signal trampoline halting at the breakpoint that
+# replaced the fault instruction.
+cont_out "cont"
+cont_out "cont bp after segv" "*[before_segv]"
+cont_out "cont bp before and after segv" "*[before_segv]" "*[after_segv]"
diff --git a/gdb/testsuite/gdb.base/siginfo.c b/gdb/testsuite/gdb.base/siginfo.c
new file mode 100644
index 0000000..b2a758b
--- /dev/null
+++ b/gdb/testsuite/gdb.base/siginfo.c
@@ -0,0 +1,68 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2004 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
+   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 <stdio.h>
+#include <signal.h>
+#include <sys/time.h>
+
+static volatile int done;
+
+#ifdef SA_SIGINFO
+static void /* HANDLER */
+handler (int sig, siginfo_t *info, void *context)
+{
+  done = 1;
+} /* handler */
+#else
+static void
+handler (int sig)
+{
+  done = 1;
+} /* handler */
+#endif
+
+main ()
+{
+  /* Set up the signal handler.  */
+  {
+    struct sigaction action;
+    memset (&action, 0, sizeof (action));
+#ifdef SA_SIGINFO
+    action.sa_sigaction = handler;
+    action.sa_flags |= SA_SIGINFO;
+#else
+    action.sa_handler = handler;
+#endif
+    sigaction (SIGVTALRM, &action, NULL);
+  }
+
+  /* Set up a one-off timer.  A timer, rather than SIGSEGV, is used as
+     after a timer handler finishes the interrupted code can safely
+     resume.  */
+  {
+    struct itimerval itime;
+    memset (&itime, 0, sizeof (itime));
+    itime.it_value.tv_usec = 250 * 1000;
+    setitimer (ITIMER_VIRTUAL, &itime, NULL);
+  }
+  /* Wait.  */
+  while (!done);
+  return 0;
+} /* main */
diff --git a/gdb/testsuite/gdb.base/siginfo.exp b/gdb/testsuite/gdb.base/siginfo.exp
new file mode 100644
index 0000000..a081ab8
--- /dev/null
+++ b/gdb/testsuite/gdb.base/siginfo.exp
@@ -0,0 +1,98 @@
+# Copyright 2004 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
+# 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.  
+
+
+# The program siginfo.c creates a backtrace containing a signal
+# handler registered using sigaction's sa_sigaction / SA_SIGINFO.
+# Some OS's (e.g., GNU/Linux) use different signal trampolines for
+# sa_sigaction and sa_handler.
+
+# This test first confirms that GDB can backtrace through the
+# alternative sa_sigaction signal handler, and second that GDB can
+# nexti/stepi out of such a handler.
+
+if [target_info exists gdb,nosignals] {
+    verbose "Skipping signals.exp because of nosignals."
+    continue
+}
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile siginfo
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+    untested "Couldn't compile ${module}.c"
+    return -1
+}
+
+# get things started
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "display/i \$pc"
+
+# Advance to main
+if { ![runto_main] } then {
+    gdb_suppress_tests;
+}
+
+# Pass all the alarms straight through (but verbosely)
+# gdb_test "handle SIGALRM print pass nostop"
+# gdb_test "handle SIGVTALRM print pass nostop"
+# gdb_test "handle SIGPROF print pass nostop"
+
+# Run to the signal handler, validate the backtrace.
+gdb_test "break handler"
+gdb_test "continue" ".* handler .*" "continue to stepi handler"
+send_gdb "bt\n"
+gdb_expect_list "backtrace for nexti" ".*$gdb_prompt $" {
+    "\[\r\n\]+.0 \[^\r\n\]* handler "
+    "\[\r\n\]+.1  .signal handler called."
+    "\[\r\n\]+.2 \[^\r\n\]* main .*"
+}
+
+# Check that GDB can step the inferior back to main
+set test "step out of handler"
+gdb_test_multiple "step" "${test}" {
+    -re "done = 1;.*${gdb_prompt} $" {
+	send_gdb "$i\n"
+	exp_continue
+    }
+    -re "\} .. handler .*${gdb_prompt} $" {
+	send_gdb "step\n"
+	exp_continue
+    }
+    -re "Program exited normally.*${gdb_prompt} $" {
+	kfail gdb/1613 "$test (program exited)"
+    }
+    -re "(while ..done|return 0).*${gdb_prompt} $" {
+	# After stepping out of a function /r signal-handler, GDB will
+	# advance the inferior until it is at the first instruction of
+	# a code-line.  While typically things return to the middle of
+	# the "while..." (and hence GDB advances the inferior to the
+	# "return..." line) it is also possible for the return to land
+	# on the first instruction of "while...".  Accept both cases.
+	pass "$test"
+    }
+}
diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp
index a07e3a8..46ae214 100644
--- a/gdb/testsuite/gdb.base/signals.exp
+++ b/gdb/testsuite/gdb.base/signals.exp
@@ -60,102 +60,47 @@
 	# An alarm has been signaled, give the signal time to get delivered.
 	sleep 2
 
-	# i386 BSD currently fails the next test with a SIGTRAP.
-	setup_xfail "i*86-*-bsd*"
-	# But Dynix has a DECR_PC_AFTER_BREAK of zero, so the failure
-	# is shadowed by hitting the through_sigtramp_breakpoint.
-	clear_xfail "i*86-sequent-bsd*"
-	# Univel SVR4 i386 continues instead of stepping.
-	setup_xfail "i*86-univel-sysv4*"
-	# lynx fails with "next" acting like "continue"
-	setup_xfail "*-*-*lynx*"
-	# linux (aout versions) also fails with "next" acting like "continue"
-	# this is probably more dependant on the kernel version than on the
-	# object file format or utils.  (sigh)
-	setup_xfail "i*86-pc-linuxaout-gnu" "i*86-pc-linuxoldld-gnu"
-	send_gdb "next\n"
-	gdb_expect {
-	    -re "alarm .*$gdb_prompt $" { pass "next to 2nd alarm (1)" }
-	    -re "Program received signal SIGTRAP.*first.*$gdb_prompt $" {
+	# NOTE: cagney/2004-05-09: The following is retained as an
+	# historical reference.  Because signal delivery when doing a
+	# next has been changed to use a continue, and not a
+	# single-step, the kernel bug of a stuck trace-bit in the
+	# trampoline's saved PS register is avoided.
 
-		# This can happen on machines that have a trace flag
-		# in their PS register.
-		# The trace flag in the PS register will be set due to
-		# the `next' command.
-		# Before calling the signal handler, the PS register
-		# is pushed along with the context on the user stack.
-		# When the signal handler has finished, it reenters the
-		# the kernel via a sigreturn syscall, which restores the
-		# PS register along with the context.
-		# If the kernel erroneously does not clear the trace flag
-		# in the pushed context, gdb will receive a SIGTRAP from
-		# the set trace flag in the restored context after the
-		# signal handler has finished.
+	# This can happen on machines that have a trace flag in their
+	# PS register.  The trace flag in the PS register will be set
+	# due to the `next' command.  Before calling the signal
+	# handler, the PS register is pushed along with the context on
+	# the user stack.  When the signal handler has finished, it
+	# reenters the the kernel via a sigreturn syscall, which
+	# restores the PS register along with the context.  If the
+	# kernel erroneously does not clear the trace flag in the
+	# pushed context, gdb will receive a SIGTRAP from the set
+	# trace flag in the restored context after the signal handler
+	# has finished.
 
-		# I do not yet understand why the SIGTRAP does not occur
-		# after stepping the instruction at the restored PC on
-		# i386 BSDI 1.0 systems.
+	# I do not yet understand why the SIGTRAP does not occur after
+	# stepping the instruction at the restored PC on i386 BSDI 1.0
+	# systems.
 
-		# Note that the vax under Ultrix also exhibits
-		# this behaviour (it is uncovered by the `continue from
-		# a break in a signal handler' test below).
-		# With this test the failure is shadowed by hitting the
-		# through_sigtramp_breakpoint upon return from the signal
-		# handler.
+	# Note that the vax under Ultrix also exhibits this behaviour
+	# (it is uncovered by the `continue from a break in a signal
+	# handler' test below).  With this test the failure is
+	# shadowed by hitting the through_sigtramp_breakpoint upon
+	# return from the signal handler.
+	
+	# SVR4 and Linux based i*86 systems exhibit this behaviour as
+	# well (it is uncovered by the `continue from a break in a
+	# signal handler' test below).  As these systems use procfs,
+	# where we tell the kernel not to tell gdb about `pass'
+	# signals, and the trace flag is cleared by the kernel before
+	# entering the sigtramp routine, GDB will not notice the
+	# execution of the signal handler.  Upon return from the
+	# signal handler, GDB will receive a SIGTRAP from the set
+	# trace flag in the restored context.  The SIGTRAP marks the
+	# end of a (albeit long winded) single step for GDB, causing
+	# this test to pass.
 
-		# SVR4 and Linux based i*86 systems exhibit this behaviour
-		# as well (it is uncovered by the `continue from a break
-		# in a signal handler' test below).
-		# As these systems use procfs, where we tell the kernel not
-		# to tell gdb about `pass' signals, and the trace flag is
-		# cleared by the kernel before entering the sigtramp
-		# routine, GDB will not notice the execution of the signal 
-		# handler.
-		# Upon return from the signal handler, GDB will receive
-		# a SIGTRAP from the set trace flag in the restored context.
-		# The SIGTRAP marks the end of a (albeit long winded)
-		# single step for GDB, causing this test to pass.
-
-		fail "next to 2nd alarm (1) (probably kernel bug)"
-		gdb_test "next" "alarm.*" "next to 2nd alarm (1)"
-	    }
-	    -re "Program exited with code.*$gdb_prompt $" {
-
-		# This is apparently a bug in the UnixWare kernel (but
-		# has not been investigated beyond the
-		# resume/target_wait level, and has not been reported
-		# to Univel).  If it steps when a signal is pending,
-		# it does a continue instead.  I don't know whether
-		# there is a workaround.
-
-		# Perhaps this problem exists on other SVR4 systems;
-		# but (a) we have no reason to think so, and (b) if we
-		# put a wrong xfail here, we never get an XPASS to let
-		# us know that it was incorrect (and then if such a
-		# configuration regresses we have no way of knowing).
-		# Solaris is not a relevant data point either way
-		# because it lacks single stepping.
-
-		# fnf: I don't agree with the above philosophy.  We
-		# can never be sure that any particular XFAIL is
-		# specified 100% correctly in that no systems with
-		# the bug are missed and all systems without the bug
-		# are excluded.  If we include an XFAIL that isn't
-		# appropriate for a particular system, then when that
-		# system gets tested it will XPASS, and someone should
-		# investigate and fix the setup_xfail as appropriate,
-		# or more preferably, the actual bug.  Each such case
-		# adds more data to narrowing down the scope of the
-		# problem and ultimately fixing it.
-
-		setup_xfail "i*86-*-sysv4*"
-		fail "'next' behaved as 'continue (known SVR4 bug)'"
-		return 0
-	    }
-	    -re ".*$gdb_prompt $" { fail "next to 2nd alarm (1)" }
-	    timeout { fail "next to 2nd alarm (1); (timeout)" }
-	    eof { fail "next to 2nd alarm (1); (eof)" }
-	}
+	gdb_test "next" "alarm .*" "next to 2nd alarm"
 
 	gdb_test "break handler" "Breakpoint \[0-9\]+ .*"
 	gdb_test "next" "\\+\\+count; /\\* second \\*/" \
@@ -191,41 +136,13 @@
 	gdb_test "break func1" "Breakpoint \[0-9\]+ .*"
 	gdb_test "break func2" "Breakpoint \[0-9\]+ .*"
 
-	# Vax Ultrix and i386 BSD currently fail the next test with
-	# a SIGTRAP, but with different symptoms.
-	setup_xfail "vax-*-ultrix*"
-	setup_xfail "i*86-*-bsd*"
-	setup_xfail "i*86-*-freebsd*"
-	setup_xfail "i*86-pc-linux-gnu*"
-	setup_xfail "i*86-*-solaris2*"
-	send_gdb "continue\n"
-	gdb_expect {
-	    -re "Breakpoint.*func1.*$gdb_prompt $" { pass "continue to func1" }
-	    -re "Program received signal SIGTRAP.*second.*$gdb_prompt $" {
+	# NOTE: cagney/2004-05-09: Ref "next to 2nd alarm" above.
+	# Because signal delivery when doing a next has been changed
+	# to use a continue, and not a single-step, the kernel bug of
+	# a stuck trace-bit in the trampoline's saved PS register is
+	# avoided.
 
-		# See explanation for `next to 2nd alarm (1)' fail above.
-		# We did step into the signal handler, hit a breakpoint
-		# in the handler and continued from the breakpoint.
-		# The set trace flag in the restored context is causing
-		# the SIGTRAP, without stepping an instruction.
-
-		fail "continue to func1 (probably kernel bug)"
-		gdb_test "continue" "Breakpoint.*func1.*" \
-		    "extra continue to func1"
-	    }
-	    -re "Program received signal SIGTRAP.*func1 ..;.*$gdb_prompt $" {
-
-		# On the vax under Ultrix the set trace flag in the restored
-		# context is causing the SIGTRAP, but after stepping one
-		# instruction, as expected.
-
-		fail "continue to func1 (probably kernel bug)"
-		gdb_test "continue" "Breakpoint.*func1.*" \
-		    "extra continue to func1"
-	    }
-	    -re ".*$gdb_prompt $" { fail "continue to func1" }
-	    default { fail "continue to func1" }
-	}
+	gdb_test "continue" "Breakpoint.*func1.*" "continue to func1"
 
 	setup_xfail "*-*-irix*"
 	send_gdb "signal SIGUSR1\n"
diff --git a/gdb/testsuite/gdb.base/signull.c b/gdb/testsuite/gdb.base/signull.c
new file mode 100644
index 0000000..4139d14
--- /dev/null
+++ b/gdb/testsuite/gdb.base/signull.c
@@ -0,0 +1,88 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 1996, 1999, 2003, 2004 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
+   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 <signal.h>
+#include <setjmp.h>
+#include <stdlib.h>
+#include <string.h>
+
+enum tests {
+  code_entry_point, code_descriptor, data_read, data_write
+};
+
+static volatile enum tests test;
+
+/* Some basic types and zero buffers.  */
+
+typedef long data_t;
+typedef long code_t (void);
+data_t *volatile data;
+code_t *volatile code;
+/* "desc" is intentionally initialized to a data object.  This is
+   needed to test function descriptors on arches like ia64.  */
+data_t zero[10];
+code_t *volatile desc = (code_t *) (void *) zero;
+
+sigjmp_buf env;
+
+extern void
+keeper (int sig)
+{
+  siglongjmp (env, 0);
+}
+
+extern long
+bowler (void)
+{
+  switch (test)
+    {
+    case data_read:
+      /* Try to read address zero.  */
+      return (*data);
+    case data_write:
+      /* Try to write (the assignment) to address zero.  */
+      return (*data) = 1;
+    case code_entry_point:
+      /* For typical architectures, call a function at address
+	 zero.  */
+      return (*code) ();
+    case code_descriptor:
+      /* For atypical architectures that use function descriptors,
+	 call a function descriptor, the code field of which is zero
+	 (which has the effect of jumping to address zero).  */
+      return (*desc) ();
+    }
+}
+
+int
+main ()
+{
+  static volatile int i;
+
+  struct sigaction act;
+  memset (&act, 0, sizeof act);
+  act.sa_handler = keeper;
+  sigaction (SIGSEGV, &act, NULL);
+
+  for (i = 0; i < 10; i++)
+    {
+      sigsetjmp (env, 1);
+      bowler ();
+    }
+}
diff --git a/gdb/testsuite/gdb.base/signull.exp b/gdb/testsuite/gdb.base/signull.exp
new file mode 100644
index 0000000..8dc9164
--- /dev/null
+++ b/gdb/testsuite/gdb.base/signull.exp
@@ -0,0 +1,120 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2004 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
+# 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.  
+
+# Check that GDB can trigger and backtrace SIGSEGV signal stacks
+# caused by both accessing (data) and executing (code) at address
+# zero.
+
+# On function descriptor architectures, a zero descriptor, instead of
+# a NULL pointer, is used.  That way the NULL code test always
+# contains a zero code reference.
+
+# For recovery, sigjmp/longjmp are used.
+
+# This also tests backtrace/gdb1476.
+
+if $tracelevel {
+    strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "signull"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# Run to `main' where we begin our tests.
+#
+
+if ![runto_main] then {
+    gdb_suppress_tests
+}
+
+# If we can examine what's at memory address 0, it is possible that we
+# could also execute it.  This could probably make us run away,
+# executing random code, which could have all sorts of ill effects,
+# especially on targets without an MMU.  Don't run the tests in that
+# case.
+
+send_gdb "x 0\n"
+gdb_expect {
+    -re "0x0:.*Cannot access memory at address 0x0.*$gdb_prompt $" { }
+    -re "0x0:.*Error accessing memory address 0x0.*$gdb_prompt $" { }
+    -re ".*$gdb_prompt $" {
+	untested "Memory at address 0 is possibly executable"
+	return
+    }
+}
+
+# If an attempt to call a NULL pointer leaves the inferior in main,
+# then function pointers are descriptors, probe this and remember the
+# result.
+
+gdb_test "set test = code_entry_point" "" "set for function pointer probe"
+set test "probe function pointer"
+set function_pointer code_entry_point
+gdb_test_multiple "continue" "$test" {
+    -re "Program received signal SIGSEGV.*bowler .*$gdb_prompt $" {
+	set function_pointer code_descriptor
+	pass "$test (function descriptor)"
+    }
+    -re "Program received signal SIGSEGV.*0.*$gdb_prompt $" {
+	pass "$test (function entry-point)"
+    }
+}
+
+# Re-start from scratch, breakpoint the bowler so that control is
+# regained after each test, and run up to that.
+rerun_to_main
+gdb_test "break bowler"
+gdb_test "break keeper"
+# By default Stop:Yes Print:Yes Pass:Yes
+gdb_test "handle SIGSEGV" "SIGSEGV.*Yes.*Yes.*Yes.*Segmentation fault"
+
+# For the given signal type, check that: the SIGSEGV occures; a
+# backtrace from the SEGV works; the sigsegv is delivered; a backtrace
+# through the SEGV works.
+
+proc test_segv { name tag bt_from_segv bt_from_keeper } {
+    gdb_test continue "Breakpoint.* bowler.*" "${name} starts with the bowler"
+    gdb_test "set test = $tag"
+    gdb_test continue "Program received signal SIGSEGV.*" "${name} got SEGV"
+    gdb_test backtrace $bt_from_segv "backtrace segv for ${name}"
+    gdb_test continue "Breakpoint.* keeper.*" "${name} through to keeper"
+    gdb_test backtrace $bt_from_keeper "backtrace keeper for ${name}"
+}
+
+test_segv data-read data_read \
+    {#0 .* bowler .*#1  .* main .*} \
+    {#0 .* keeper .*#1  .* handler .*#2 .* bowler .*#3  .* main .*}
+test_segv data-write data_write \
+    {#0 .* bowler .*#1  .* main .*} \
+    {#0 .* keeper .*#1  .* handler .*#2 .* bowler .*#3  .* main .*}
+test_segv code $function_pointer \
+    {#0 .* 0x0+ .*#1 .* bowler .*#2  .* main .*} \
+    {#0 .* keeper .*#1  .* handler .*#2 .* 0x0+ .*#3 .* bowler .*#4 .* main .*}
diff --git a/gdb/testsuite/gdb.base/sigstep.c b/gdb/testsuite/gdb.base/sigstep.c
new file mode 100644
index 0000000..a9e8618
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sigstep.c
@@ -0,0 +1,56 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2004 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
+   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 <stdio.h>
+#include <signal.h>
+#include <sys/time.h>
+
+static volatile int done;
+
+static void
+handler (int sig)
+{
+  done = 1;
+} /* handler */
+
+main ()
+{
+  /* Set up the signal handler.  */
+  {
+    struct sigaction action;
+    memset (&action, 0, sizeof (action));
+    action.sa_handler = handler;
+    sigaction (SIGVTALRM, &action, NULL);
+  }
+
+  /* Set up a one-off timer.  A timer, rather than SIGSEGV, is used as
+     after a timer handler finishes the interrupted code can safely
+     resume.  */
+  {
+    struct itimerval itime;
+    memset (&itime, 0, sizeof (itime));
+    itime.it_value.tv_usec = 250 * 1000;
+    setitimer (ITIMER_VIRTUAL, &itime, NULL);
+  }
+
+  /* Wait.  */
+  while (!done);
+  return 0;
+} /* main */
diff --git a/gdb/testsuite/gdb.base/sigstep.exp b/gdb/testsuite/gdb.base/sigstep.exp
new file mode 100644
index 0000000..ea16ec6
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sigstep.exp
@@ -0,0 +1,177 @@
+# Copyright 2004 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
+# 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.  
+
+
+# The program sigstep.c creates a very simple backtrace containing one
+# signal handler and signal trampoline.
+
+# This test runs the program up to the signal handler, and then
+# attempts to step/next the inferior back to main.
+
+if [target_info exists gdb,nosignals] {
+    verbose "Skipping sigstep.exp because of nosignals."
+    continue
+}
+
+if $tracelevel then {
+    strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile sigstep
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+    untested "Couldn't compile ${module}.c"
+    return -1
+}
+
+# get things started
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "display/i \$pc"
+
+# Advance to main
+if { ![runto_main] } then {
+    gdb_suppress_tests;
+}
+
+# Pass all the alarms straight through (but verbosely)
+# gdb_test "handle SIGALRM print pass nostop"
+# gdb_test "handle SIGVTALRM print pass nostop"
+# gdb_test "handle SIGPROF print pass nostop"
+
+# Run to the signal handler, validate the backtrace.
+gdb_test "break handler"
+gdb_test "continue" ".* handler .*" "continue to stepi handler"
+send_gdb "bt\n"
+gdb_expect_list "backtrace for nexti" ".*$gdb_prompt $" {
+    "\[\r\n\]+.0 \[^\r\n\]* handler "
+    "\[\r\n\]+.1  .signal handler called."
+    "\[\r\n\]+.2 \[^\r\n\]* main .*"
+}
+
+proc advance { i } {
+    global gdb_prompt
+
+    # Get us back into the handler
+    rerun_to_main
+    gdb_test "continue" ".* handler .*" "continue to handler for $i"
+
+    set test "$i out of handler"
+    gdb_test_multiple "$i" "${test}" {
+	-re "done = 1;.*${gdb_prompt} $" {
+	    send_gdb "$i\n"
+	    exp_continue
+	}
+	-re "\} .. handler .*${gdb_prompt} $" {
+	    send_gdb "$i\n"
+	    exp_continue
+	}
+	-re "Program exited normally.*${gdb_prompt} $" {
+	    setup_kfail powerpc-*-*bsd* gdb/1639
+	    fail "$test (program exited)"
+	}
+	-re "(while ..done|return 0).*${gdb_prompt} $" {
+	    # After stepping out of a function /r signal-handler, GDB will
+	    # advance the inferior until it is at the first instruction of
+	    # a code-line.  While typically things return to the middle of
+	    # the "while..." (and hence GDB advances the inferior to the
+	    # "return..." line) it is also possible for the return to land
+	    # on the first instruction of "while...".  Accept both cases.
+	    pass "$test"
+	}
+    }
+}
+
+proc advancei { i } {
+    global gdb_prompt
+    set program_exited 0
+
+    # Get us back into the handler
+    rerun_to_main
+    gdb_test "continue" ".* handler .*" "continue to handler for $i"
+
+    set test "$i into signal trampoline"
+    gdb_test_multiple "$i" "${test}" {
+	-re "done = 1;.*${gdb_prompt} $" {
+	    send_gdb "$i\n"
+	    exp_continue
+	}
+	-re "\} .. handler .*${gdb_prompt} $" {
+	    send_gdb "$i\n"
+	    exp_continue
+	}
+	-re "signal handler called.*${gdb_prompt} $" {
+	    pass "$test"
+	}
+	-re "main .*${gdb_prompt} $" {
+	    fail "$test (in main)"
+	}
+	-re "Program exited normally.*${gdb_prompt} $" {
+	    fail "$test (program exited)"
+	    set program_exited 1
+	}
+	-re "Make handler return now.*y or n. $" {
+	    send_gdb "y\n"
+	    exp_continue
+	}
+    }
+
+    set test "$i out of signal trampoline"
+    gdb_test_multiple "$i" "${test}" {
+	-re "while .*${gdb_prompt} $" {
+	    pass "$test (in main)"
+	}
+	-re "signal handler called.*${gdb_prompt} $" {
+	    send_gdb "$i\n"
+	    exp_continue
+	}
+	-re "return .*${gdb_prompt} $" {
+	    fail "$test (stepped)"
+	}
+	-re "Make .*frame return now.*y or n. $" {
+	    send_gdb "y\n"
+	    exp_continue
+	}
+	-re "Program exited normally.*${gdb_prompt} $" {
+	    kfail gdb/1639 "$test (program exited)"
+	    set program_exited 1
+	}
+	-re "The program is not being run.*${gdb_prompt} $" {
+	    if { $program_exited } {
+		# Previously kfailed with an exit
+		pass "$test (the program is not being run)"
+	    } else {
+		fail "$test (the program is not being run)"
+	    }
+	}
+    }
+}
+
+advance step
+advancei stepi
+
+advance next
+advancei nexti
+
+advancei finish
+advancei return
diff --git a/gdb/testsuite/gdb.base/sizeof.exp b/gdb/testsuite/gdb.base/sizeof.exp
index 7fcbe0e..c12c699 100644
--- a/gdb/testsuite/gdb.base/sizeof.exp
+++ b/gdb/testsuite/gdb.base/sizeof.exp
@@ -1,4 +1,6 @@
-# Copyright 2000, 2002 Free Software Foundation, Inc.
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2000, 2002, 2003, 2004 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
@@ -14,9 +16,6 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
 
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-
 if $tracelevel {
     strace $tracelevel
 }
@@ -103,16 +102,10 @@
     }
 
     set pat [string_to_regexp "sizeof (${type}) == ${size}"]
-    send_gdb "next\n"
-    gdb_expect {
+    set test "check sizeof ${type}"
+    gdb_test_multiple "next" "$test" {
 	-re "${pat}\[\r\n\].*$gdb_prompt $" {
-	    pass "check sizeof ${type} == ${size}"
-	}
-	-re ".*$gdb_prompt $" {
-	    fail "check sizeof ${type} == ${size}"
-	}
-	timeout {
-	    fail "check sizeof ${type} == ${size} (timeout)"
+	    pass "$test"
 	}
     }
 }
diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp
index 4d282d2..84435df 100644
--- a/gdb/testsuite/gdb.base/structs.exp
+++ b/gdb/testsuite/gdb.base/structs.exp
@@ -218,11 +218,8 @@
     set tests "call $n ${testfile}"
 
     # Call fun${n}, checking the printed return-value.
-    setup_kfails structs-*tld* i*86-*-* gdb/1447
-    setup_kfails structs-*tld* sparc64-*-* gdb/1447
-    setup_kfails structs-*tld* sparc*-*-solaris2* gdb/1447
-    setup_kfails structs-*tld* x86_64-*-* gdb/1447
-    setup_compiler_kfails structs-tc-* gcc-3-3 "DWARF 2" i*86-*-* gdb/1455
+    setup_compiler_kfails structs-tc-tll gcc-3-3-* "DWARF 2" i*86-*-* gdb/1455
+    setup_compiler_kfails structs-tc-td gcc-3-3-* "DWARF 2" i*86-*-* gdb/1455
     gdb_test "p/c fun${n}()"  "[foo ${n}]" "p/c fun<n>(); ${tests}"
 
     # Check that GDB can always pass a structure to an inferior function.
@@ -233,11 +230,8 @@
     # examining that global to confirm that the value is as expected.
 
     gdb_test "call Fun${n}(foo${n})" "" "call Fun<n>(foo<n>); ${tests}"
-    setup_kfails structs-*tld* i*86-*-* gdb/1447
-    setup_kfails structs-*tld* sparc64-*-* gdb/1447
-    setup_kfails structs-*tld* sparc*-*-solaris2* gdb/1447
-    setup_kfails structs-*tld* x86_64-*-* gdb/1447
-    setup_compiler_kfails structs-tc-* gcc-3-3 "DWARF 2" i*86-*-* gdb/1455
+    setup_compiler_kfails structs-tc-tll gcc-3-3-* "DWARF 2" i*86-*-* gdb/1455
+    setup_compiler_kfails structs-tc-td gcc-3-3-* "DWARF 2" i*86-*-* gdb/1455
     gdb_test "p/c L${n}" [foo ${n}] "p/c L<n>; ${tests}"
 }
 
@@ -290,10 +284,6 @@
 	    "advance to fun<n> for return; ${tests}"
 
     # Check that the program invalidated the relevant global.
-    setup_kfails structs-tld i*86-*-* gdb/1447
-    setup_kfails structs-tld sparc64-*-* gdb/1447
-    setup_kfails structs-tld sparc*-*-solaris2* gdb/1447
-    setup_kfails structs-tld x86_64-*-* gdb/1447
     gdb_test "p/c L${n}" " = [zed $n]" "zed L<n> for return; ${tests}"
 
     # Force the "return".  This checks that the return is always
@@ -304,21 +294,21 @@
 
     # The test is writen so that it only reports one FAIL/PASS for the
     # entire operation.  The value returned is checked further down.
-    # "return_value_unknown", if non-empty, records why GDB realised
-    # that it didn't know where the return value was.
+    # "return_value_known", if non-zero, indicates that GDB knew where
+    # the return value was located.
 
     set test "return foo<n>; ${tests}"
-    set return_value_unknown 0
+    set return_value_known 1
     set return_value_unimplemented 0
     gdb_test_multiple "return foo${n}" "${test}" {
 	-re "The location" {
 	    # Ulgh, a struct return, remember this (still need prompt).
-	    set return_value_unknown 1
+	    set return_value_known 0
 	    exp_continue
 	}
 	-re "A structure or union" {
 	    # Ulgh, a struct return, remember this (still need prompt).
-	    set return_value_unknown 1
+	    set return_value_known 0
 	    # Double ulgh.  Architecture doesn't use return_value and
 	    # hence hasn't implemented small structure return.
 	    set return_value_unimplemented 1
@@ -339,34 +329,30 @@
 
     # Check that the return-value is as expected.  At this stage we're
     # just checking that GDB has returned a value consistent with
-    # "return_value_unknown" set above.
+    # "return_value_known" set above.
 
     set test "value foo<n> returned; ${tests}"
-    setup_kfails structs-*tld* i*86-*-* gdb/1447
-    setup_kfails structs-*tld* sparc64-*-* gdb/1447
-    setup_kfails structs-*tld* sparc*-*-solaris2* gdb/1447
-    setup_kfails structs-*tld* x86_64-*-* gdb/1447
     gdb_test_multiple "p/c L${n}" "${test}" {
 	-re " = [foo ${n}].*${gdb_prompt} $" {
-	    if $return_value_unknown {
+	    if $return_value_known {
+		pass "${test}"
 		# This contradicts the above claim that GDB didn't
 		# know the location of the return-value.
-		fail "${test}"
 	    } else {
-		pass "${test}"
+		fail "${test}"
 	    }
 	}
 	-re " = [zed ${n}].*${gdb_prompt} $" {
-	    if $return_value_unknown {
+	    if $return_value_known {
+		# This contradicts the above claim that GDB knew
+		# the location of the return-value.
+		fail "${test}"
+	    } else {
 		# The struct return case.  Since any modification
 		# would be by reference, and that can't happen, the
 		# value should be unmodified and hence Z is expected.
 		# Is this a reasonable assumption?
 		pass "${test}"
-	    } else {
-		# This contradicts the above claim that GDB knew
-		# the location of the return-value.
-		fail "${test}"
 	    }
 	}
 	-re ".*${gdb_prompt} $" {
@@ -396,23 +382,20 @@
 	    "advance to fun<n> for finish; ${tests}"
 
     # Check that the program invalidated the relevant global.
-    setup_kfails structs-tld i*86-*-* gdb/1447
-    setup_kfails structs-tld sparc64-*-* gdb/1447
-    setup_kfails structs-tld sparc*-*-solaris2* gdb/1447
-    setup_kfails structs-tld x86_64-*-* gdb/1447
     gdb_test "p/c L${n}" " = [zed $n]" "zed L<n> for finish; ${tests}"
 
-    # Finish the function, set 'finish_value_unknown" to non-empty if the
-    # return-value was not found.
+    # Finish the function, set 'finish_value_known" to non-empty if
+    # the return-value was found.
+
     set test "finish foo<n>; ${tests}"
-    set finish_value_unknown 0
+    set finish_value_known 1
     gdb_test_multiple "finish" "${test}" {
 	-re "Value returned is .*${gdb_prompt} $" {
 	    pass "${test}"
 	}
 	-re "Cannot determine contents.*${gdb_prompt} $" {
 	    # Expected bad value.  For the moment this is ok.
-	    set finish_value_unknown 1
+	    set finish_value_known 0
 	    pass "${test}"
 	}
     }
@@ -421,28 +404,24 @@
     # "p/c".  If no return value was found, the 'Z' from the previous
     # check that the variable was cleared, is printed.
     set test "value foo<n> finished; ${tests}"
-    setup_kfails structs-*tld* i*86-*-* gdb/1447
-    setup_kfails structs-*tld* sparc64-*-* gdb/1447
-    setup_kfails structs-*tld* sparc*-*-solaris2* gdb/1447
-    setup_kfails structs-*tld* x86_64-*-* gdb/1447
     gdb_test_multiple "p/c" "${test}" {
 	-re "[foo ${n}]\[\r\n\]+${gdb_prompt} $" {
-	    if $finish_value_unknown {
+	    if $finish_value_known {
+		pass "${test}"
+	    } else {
 		# This contradicts the above claim that GDB didn't
 		# know the location of the return-value.
 		fail "${test}"
-	    } else {
-		pass "${test}"
 	    }
 	}
 	-re "[zed ${n}]\[\r\n\]+${gdb_prompt} $" {
 	    # The value didn't get found.  This is "expected".
-	    if $finish_value_unknown {
-		pass "${test}"
-	    } else {
+	    if $finish_value_known {
 		# This contradicts the above claim that GDB did
 		# know the location of the return-value.
 		fail "${test}"
+	    } else {
+		pass "${test}"
 	    }
 	}
     }
@@ -450,20 +429,17 @@
     # Finally, check that "return" and finish" have consistent
     # behavior.
 
-    # Since both "return" and "finish" use equivalent "which
-    # return-value convention" logic, both commands should have
-    # identical can/can-not find return-value messages.
+    # Since "finish" works in more cases than "return" (see
+    # RETURN_VALUE_ABI_RETURNS_ADDRESS and
+    # RETURN_VALUE_ABI_PRESERVES_ADDRESS), the "return" value being
+    # known implies that the "finish" value is known (but not the
+    # reverse).
 
-    # Note that since "call" and "finish" use common code paths, a
-    # failure here is a strong indicator of problems with "store
-    # return-value" code paths.  Suggest looking at "return_value"
-    # when investigating a fix.
-
-    set test "return and finish use same convention; ${tests}"
-    if {$finish_value_unknown == $return_value_unknown} {
-	pass "${test}"
-    } else {
+    set test "return value known implies finish value known; ${tests}"
+    if {$return_value_known && ! $finish_value_known} {
 	kfail gdb/1444 "${test}"
+    } else {
+	pass "${test}"
     }
 }
 
diff --git a/gdb/testsuite/gdb.base/structs2.exp b/gdb/testsuite/gdb.base/structs2.exp
index c3c4e67..e7f6553 100644
--- a/gdb/testsuite/gdb.base/structs2.exp
+++ b/gdb/testsuite/gdb.base/structs2.exp
@@ -29,6 +29,12 @@
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+    return -1;
+}
+
 # build the first test case
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
     # built the second test case since we can't use prototypes
@@ -64,10 +70,16 @@
     "Breakpoint .* at .*" \
     "structs2 breakpoint set"
 
+if [test_compiler_info gcc-*-*] {
+  setup_xfail hppa*-* gcc/15860
+}
 gdb_test "continue" \
     ".*pr_char=120.*pr_uchar=130.*pr_short=32000.*pr_ushort=33000.*bkpt = 1.*" \
     "structs2 continue1"
 
+if [test_compiler_info gcc-*-*] {
+  setup_xfail hppa*-* gcc/15860
+}
 gdb_test "continue" \
     ".*pr_char=-126.*pr_uchar=120.*pr_short=-32536.*pr_ushort=32000.*bkpt = 1.*" \
     "structs2 continue2"
diff --git a/gdb/testsuite/gdb.cp/pr-1553.cc b/gdb/testsuite/gdb.cp/pr-1553.cc
deleted file mode 100644
index 58441fd..0000000
--- a/gdb/testsuite/gdb.cp/pr-1553.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-class A {
-public:
-  class B;
-  class C;
-};
-
-class A::B {
-  int a_b;
-
-public:
-  C* get_c(int i);
-};
-
-class A::C
-{
-  int a_c;
-};
-
-class E {
-public:
-  class F;
-};
- 
-class E::F {
-public:
-  int e_f;
- 
-  F& operator=(const F &other);
-};
-
-void refer_to (E::F *f) {
-  // Do nothing.
-}
-
-void refer_to (A::C **ref) {
-  // Do nothing.  But, while we're at it, force out debug info for
-  // A::B and E::F.
-
-  A::B b;
-  E::F f;
-
-  refer_to (&f);
-}
-
-int main () {
-  A::C* c_var;
-  A::B* b_var;
-  E *e_var;
-
-  // Keep around a reference so that GCC 3.4 doesn't optimize the variable
-  // away.
-  refer_to (&c_var);
-}
diff --git a/gdb/testsuite/gdb.cp/pr-1553.exp b/gdb/testsuite/gdb.cp/pr-1553.exp
deleted file mode 100644
index fe9e2a2..0000000
--- a/gdb/testsuite/gdb.cp/pr-1553.exp
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright 2004 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
-# 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.  
-
-# Test for PR gdb/1553.
-
-# This file is part of the gdb testsuite.
-
-set ws "\[\r\n\t \]+"
-
-if $tracelevel then {
-	strace $tracelevel
-}
-
-if { [skip_cplus_tests] } { continue }
-
-#
-# test running programs
-#
-set prms_id 0
-set bug_id 0
-
-set testfile "pr-1553"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-    gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-}
-
-if [get_compiler_info ${binfile} "c++"] {
-    return -1
-}
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
-if ![runto_main] then {
-    perror "couldn't run to breakpoint"
-    continue
-}
-
-gdb_test "ptype c_var" "type = class A::C \{${ws}private:${ws}int a_c;${ws}\} \\*"
-
-gdb_test "ptype E::F" "type = class E::F \{${ws}public:${ws}int e_f;${ws}E::F & operator=\\(E::F const ?&\\);${ws}\}"
-
-gdb_exit
-return 0
diff --git a/gdb/testsuite/gdb.cp/pr-574.cc b/gdb/testsuite/gdb.cp/pr-574.cc
index eb06b61..ff9df6c 100644
--- a/gdb/testsuite/gdb.cp/pr-574.cc
+++ b/gdb/testsuite/gdb.cp/pr-574.cc
@@ -1,3 +1,23 @@
+/* This test script is part of GDB, the GNU debugger.
+
+   Copyright 2002, 2004
+   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
+   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.
+   */
+
 /*
   An attempt to replicate PR gdb/574 with a shorter program.
 
diff --git a/gdb/testsuite/gdb.cp/printmethod.cc b/gdb/testsuite/gdb.cp/printmethod.cc
index d32e1b1..6afb491 100644
--- a/gdb/testsuite/gdb.cp/printmethod.cc
+++ b/gdb/testsuite/gdb.cp/printmethod.cc
@@ -1,3 +1,23 @@
+/* This test script is part of GDB, the GNU debugger.
+
+   Copyright 2002, 2004,
+   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
+   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.
+   */
+
 /* Create some objects, and try to print out their methods.  */
 
 class A {
diff --git a/gdb/testsuite/gdb.cp/psmang1.cc b/gdb/testsuite/gdb.cp/psmang1.cc
index 19a9283..9f19bed 100644
--- a/gdb/testsuite/gdb.cp/psmang1.cc
+++ b/gdb/testsuite/gdb.cp/psmang1.cc
@@ -1,3 +1,23 @@
+/* This test script is part of GDB, the GNU debugger.
+
+   Copyright 2002, 2004,
+   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
+   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.
+   */
+
 /* Do not move this definition into a header file!  See the comments
    in psmang.exp.  */
 struct s
diff --git a/gdb/testsuite/gdb.cp/psmang2.cc b/gdb/testsuite/gdb.cp/psmang2.cc
index b9b1bb5..88e04ba 100644
--- a/gdb/testsuite/gdb.cp/psmang2.cc
+++ b/gdb/testsuite/gdb.cp/psmang2.cc
@@ -1,3 +1,23 @@
+/* This test script is part of GDB, the GNU debugger.
+
+   Copyright 2002, 2004,
+   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
+   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 <stdio.h>
 
 /* Do not move this definition into a header file!  See the comments
diff --git a/gdb/testsuite/gdb.cp/ref-types.cc b/gdb/testsuite/gdb.cp/ref-types.cc
index 23cc510..1c2f4f4 100644
--- a/gdb/testsuite/gdb.cp/ref-types.cc
+++ b/gdb/testsuite/gdb.cp/ref-types.cc
@@ -1,3 +1,23 @@
+/* This test script is part of GDB, the GNU debugger.
+
+   Copyright 1999, 2004
+   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
+   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.
+   */
+
 int main2(void);
 
 void marker1 (void)
diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp
index 00a5598..8fb6f5c 100644
--- a/gdb/testsuite/gdb.cp/templates.exp
+++ b/gdb/testsuite/gdb.cp/templates.exp
@@ -453,10 +453,10 @@
 
 send_gdb "ptype quxint\n"   
 gdb_expect {   
-   -re "type = class Qux<int, ?&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
-   -re "type = class Qux<int, ?&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
-   -re "type = class Qux<int, ?\\(char ?\\*\\)\\(&string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
-   -re "type = class Qux<int, ?&\\(string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
+   -re "type = class Qux<int, ?& ?string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
+   -re "type = class Qux<int, ?& ?string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
+   -re "type = class Qux<int, ?\\(char ?\\*\\)\\(& ?string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
+   -re "type = class Qux<int, ?& ?\\(string\\)> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*int qux\\(int, int\\);.*\r\n\\}\r\n$gdb_prompt $" {
        kfail "gdb/1512" "ptype quxint"
    }
    -re "$gdb_prompt $"                     { fail "ptype quxint" }
diff --git a/gdb/testsuite/gdb.cp/try_catch.cc b/gdb/testsuite/gdb.cp/try_catch.cc
index e13dd64..764a612 100644
--- a/gdb/testsuite/gdb.cp/try_catch.cc
+++ b/gdb/testsuite/gdb.cp/try_catch.cc
@@ -1,4 +1,22 @@
-// 2002-05-27
+/* This test script is part of GDB, the GNU debugger.
+
+   Copyright 2002, 2004,
+   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
+   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 <exception>
 #include <stdexcept>
diff --git a/gdb/testsuite/gdb.cp/userdef.cc b/gdb/testsuite/gdb.cp/userdef.cc
index 0bb88a2..a40995a 100644
--- a/gdb/testsuite/gdb.cp/userdef.cc
+++ b/gdb/testsuite/gdb.cp/userdef.cc
@@ -1,3 +1,23 @@
+/* This test script is part of GDB, the GNU debugger.
+
+   Copyright 1999, 2002, 2003, 2004,
+   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
+   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 <iostream>
 
 using namespace std;
diff --git a/gdb/testsuite/gdb.cp/virtfunc.cc b/gdb/testsuite/gdb.cp/virtfunc.cc
index 005de9d..0757ae7 100644
--- a/gdb/testsuite/gdb.cp/virtfunc.cc
+++ b/gdb/testsuite/gdb.cp/virtfunc.cc
@@ -1,3 +1,23 @@
+/* This test script is part of GDB, the GNU debugger.
+
+   Copyright 1993, 1994, 1997, 1998, 1999, 2003, 2004,
+   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
+   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.
+   */
+
 // Pls try the following program on virtual functions and try to do print on
 //  most of the code in main().  Almost none of them works !
 
diff --git a/gdb/testsuite/gdb.gdb/observer.exp b/gdb/testsuite/gdb.gdb/observer.exp
index 80ab29a..c36d461 100644
--- a/gdb/testsuite/gdb.gdb/observer.exp
+++ b/gdb/testsuite/gdb.gdb/observer.exp
@@ -153,7 +153,10 @@
 
 proc test_normal_stop_notifications { first second third message } {
     reset_counters
-    gdb_test "call observer_notify_normal_stop ()" "" \
+    # Call observer_notify_normal_stop.  Note that this procedure
+    # takes one argument, but this argument is ignored by the observer
+    # callbacks we have installed.  So we just pass an arbitrary value.
+    gdb_test "call observer_notify_normal_stop (0)" "" \
              "sending notification ($message)"
     check_counters $first $second $third $message
 }
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp b/gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp
index 797dc85..cc1028d 100644
--- a/gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp
@@ -1,4 +1,7 @@
-# Copyright (C) 1998 Free Software Foundation, Inc.
+# This test script is part of GDB, the GNU debugger.
+
+# Copyright 1998, 1999, 2001, 2004,
+# 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
@@ -104,44 +107,81 @@
 
 # Look for known values
 #
-gdb_test "info reg r1"  "r1 1"
-gdb_test "info reg r4"  "r4 2"
-gdb_test "info reg r5"  "r5 4"
-gdb_test "info reg r6"  "r6 8"
-gdb_test "info reg r7"  "r7 10"
-gdb_test "info reg r8"  "r8 20"
-gdb_test "info reg r9"  "r9 40"
-gdb_test "info reg r10" "r10 80"
-gdb_test "info reg r11" "r11 100"
-gdb_test "info reg r12" "r12 200"
-gdb_test "info reg r13" "r13 400"
-gdb_test "info reg r14" "r14 800"
-gdb_test "info reg r15" "r15 1000"
-gdb_test "info reg r16" "r16 2000"
+# The output format changed between gdb 6.1.1 and gdb HEAD 2004-06-01.
+#
+#   gdb 6.1.1:
+#   (gdb) info reg r1
+#   r1 1
+#
+#   gdb HEAD 2004-06-01:
+#   (gdb) info reg r1
+#   r1             0x1     1
+#
+# For now, I accept both formats.  In the future, you can remove
+# the old gdb 6.1.1 format.
+#
+# -- chastain 2004-06-26
+
+set ws "\[\r\n\t \]+"
+
+proc hp_integer_reg {regname vhex vdec} {
+  global ws
+  set value_611 "$regname${ws}$vhex"
+  set value_new "$regname${ws}0x$vhex${ws}$vdec"
+  gdb_test "info reg $regname" "$value_611|$value_new"
+}
+
+hp_integer_reg "r1"      "1"     "1"
+hp_integer_reg "r4"      "2"     "2"
+hp_integer_reg "r5"      "4"     "4"
+hp_integer_reg "r6"      "8"     "8"
+hp_integer_reg "r7"     "10"    "16"
+hp_integer_reg "r8"     "20"    "32"
+hp_integer_reg "r9"     "40"    "64"
+hp_integer_reg "r10"    "80"   "128"
+hp_integer_reg "r11"   "100"   "256"
+hp_integer_reg "r12"   "200"   "512"
+hp_integer_reg "r13"   "400"  "1024"
+hp_integer_reg "r14"   "800"  "2048"
+hp_integer_reg "r15"  "1000"  "4096"
+hp_integer_reg "r16"  "2000"  "8192"
 
 # Two odd variants that GDB supports are:
 #   "1" means "r1", and
 #   "$1" means "r1"
-#
-gdb_test "info reg 1 4" "r1 1.*r4 2"
-gdb_test "info reg \$1" "r1 1"
+
+hp_integer_reg "1" "1" "1"
+hp_integer_reg "4" "2" "2"
+
+set name "info reg \$1"
+gdb_test_multiple "info reg \$1" "$name" {
+    -re "r1${ws}1\r\n$gdb_prompt $" {
+	pass "$name"
+    }
+    -re "r1${ws}0x1${ws}1\r\n$gdb_prompt $" {
+	pass "$name"
+    }
+}
 
 # Verify that GDB responds gracefully to a register ID number that
 # is out of range.
-#
-gdb_test "info reg 999" "999: invalid register"
+
+gdb_test "info reg 999" "Invalid register.*999.*"
 
 # Make sure the floating point status and error registers
 # don't show up as floating point numbers!
-#
-gdb_test "info reg fpsr" ".*fpsr 0.*" "fpsr"
-gdb_test "info reg fpe1" ".*fpe1 0.*" "fpe1"
-gdb_test "info reg fpe2" ".*fpe2 0.*" "fpe2"
-gdb_test "info reg fpe3" ".*fpe3 0.*" "fpe3"
-gdb_test "info reg fpe4" ".*fpe4 0.*" "fpe4"
-gdb_test "info reg fpe5" ".*fpe5 0.*" "fpe5"
-gdb_test "info reg fpe6" ".*fpe6 0.*" "fpe6"
-gdb_test "info reg fpe7" ".*fpe7 0.*" "fpe7"
+
+hp_integer_reg "fpsr" "0" "0"
+hp_integer_reg "fpe1" "0" "0"
+hp_integer_reg "fpe2" "0" "0"
+hp_integer_reg "fpe3" "0" "0"
+hp_integer_reg "fpe4" "0" "0"
+hp_integer_reg "fpe5" "0" "0"
+hp_integer_reg "fpe6" "0" "0"
+hp_integer_reg "fpe7" "0" "0"
+
+# Floating point registers.
+# TODO: these are old format only.
 
 gdb_test "info reg fr4"  ".*fr4.*(double precision).* 1"
 gdb_test "info reg fr5"  ".*fr5.*(double precision).* 2"
@@ -151,33 +191,39 @@
 gdb_test "info reg fr9"  ".*fr9.*(double precision).* 32"
 gdb_test "info reg fr10" ".*fr10.*(double precision).* 256"
 
-gdb_test "info reg r19" "r19 deadbeefbadcadee"
+# An integer register with a 64-bit value.
 
-# Need to add test of use of $<register-name>
-#
-# Q: How do you say a literal "$" in expect?
-# A: You say "\$".   A literal "\" is "\\".
-#
-# Please note that this test will fail as long as we are running
-# in 32-bit mode: it will produce "$1 = 0xbadcadee".  To fix it
-# would require building a real 64-bit gdb (expression evaluation, 
-# in particular).
-#
-send_gdb "p/x \$r19\n"
-    gdb_expect {
-        -re ".*= 0xdeadbeefbadcadee.*$gdb_prompt $" {
-            pass "64-bit works"
-        }
-        -re ".*= 0xbadcadee.*$gdb_prompt $" {
-            pass "32-bit extract when using PRINT; expected but not good"
-        }
-        -re ".*$gdb_prompt $" {
-            fail "didn't print any part of right value"
-        }
-        timeout {
-            fail "timeout on print"
-        }
+set name "info reg r19"
+gdb_test_multiple "info reg r19" "$name" {
+    -re "r19${ws}deadbeefbadcadee\r\n$gdb_prompt $" {
+	# old gdb 6.1.1 format, good result
+	pass "$name"
     }
+    -re "r19${ws}badcadee\r\n$gdb_prompt $" {
+	# old gdb 6.1.1 format, bad result
+	fail "$name (32-bit truncation)"
+    }
+    -re "r19${ws}0xdeadbeefbadcadee${ws}16045690984232431086\r\n$gdb_prompt $" {
+	# new gdb HEAD 2004-06-01 format, good result
+	pass "$name"
+    }
+    -re "r19${ws}0xbadcadee${ws}3135024622\r\n$gdb_prompt $" {
+	# new gdb HEAD 2004-06-01 format, 32 bit truncation
+	fail "$name (32-bit truncation)"
+    }
+}
+
+set name "print /x \$r19"
+gdb_test_multiple "print /x \$r19" "$name" {
+    -re "= 0xdeadbeefbadcadee\r\n$gdb_prompt $" {
+	pass "$name"
+    }
+    -re "= 0xbadcadee\r\n$gdb_prompt $" {
+	# this was a PASS in the last version so keep it PASS for now
+	# -- chastain 2004-06-26
+	pass "$name (32-bit truncation)"
+    }
+}
 
 # Need to add tests of setting wide regs too.  E.g.
 #
diff --git a/gdb/testsuite/gdb.java/jmain.exp b/gdb/testsuite/gdb.java/jmain.exp
new file mode 100644
index 0000000..49e7ca3
--- /dev/null
+++ b/gdb/testsuite/gdb.java/jmain.exp
@@ -0,0 +1,67 @@
+# Copyright 2000, 2004 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+# This file was based on jmisc.exp which in turn was written by
+# Anthony Green. (green@redhat.com)
+
+if $tracelevel then {
+	strace $tracelevel
+}
+
+load_lib "java.exp"
+
+set testfile "jmain"
+set srcfile ${srcdir}/$subdir/${testfile}.java
+set binfile ${objdir}/${subdir}/${testfile}
+if  { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
+    untested "Couldn't compile ${srcfile}"
+    return -1
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+# Check that plain old "main" works.  The load should both set the
+# language to java and (since --main=jmain), some how set the scope to
+# jmain's main.
+
+# Where the breakpoint should always land
+
+set bpmain "Breakpoint .* file .*jmain.java, line 5\."
+
+gdb_load "${binfile}"
+setup_kfail *-*-* java/1567
+gdb_test "break main" "${bpmain}"
+
+# Check that an unqualified "main" works.
+
+
+gdb_load "${binfile}"
+setup_kfail *-*-* java/1565
+gdb_test "break jmain.main" "${bpmain}"
+
+# Check that a fully qualified "main" works.
+gdb_load "${binfile}"
+setup_xfail *-*-* gcc/16439
+gdb_test "break \'${testfile}.main(java.lang.String\[\])\'" "${bpmain}"
diff --git a/gdb/testsuite/gdb.java/jmain.java b/gdb/testsuite/gdb.java/jmain.java
new file mode 100644
index 0000000..ee5c8bb
--- /dev/null
+++ b/gdb/testsuite/gdb.java/jmain.java
@@ -0,0 +1,7 @@
+public class jmain
+{
+  public static void main (String[] args)
+    {
+	return;
+    }
+}
diff --git a/gdb/testsuite/gdb.java/jmisc.exp b/gdb/testsuite/gdb.java/jmisc.exp
index 9fd220f..9e32011 100644
--- a/gdb/testsuite/gdb.java/jmisc.exp
+++ b/gdb/testsuite/gdb.java/jmisc.exp
@@ -1,4 +1,4 @@
-# Copyright 2000 Free Software Foundation, Inc.
+# Copyright 2000, 2004 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
@@ -72,7 +72,7 @@
 
     send_gdb "ptype jmisc\n"   
     gdb_expect {   
-	-re "type = class jmisc  extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+void <init>\\(void\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $"               { pass "ptype jmisc" }
+	-re "type = class jmisc  extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+jmisc\\(\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $"               { pass "ptype jmisc" }
 	-re ".*$gdb_prompt $"             { fail "ptype jmisc" }
 	timeout { fail "ptype jmisc (timeout)" ; return }
     }
diff --git a/gdb/testsuite/gdb.java/jmisc1.exp b/gdb/testsuite/gdb.java/jmisc1.exp
index dd5af98..dab85c8 100644
--- a/gdb/testsuite/gdb.java/jmisc1.exp
+++ b/gdb/testsuite/gdb.java/jmisc1.exp
@@ -1,4 +1,4 @@
-# Copyright 2002, 2003 Free Software Foundation, Inc.
+# Copyright 2002, 2003, 2004 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
@@ -70,7 +70,7 @@
 
     send_gdb "ptype jmisc\n"   
     gdb_expect {   
-	-re "type = class jmisc  extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+void <init>\\(void\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $"               { pass "ptype jmisc" }
+	-re "type = class jmisc  extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+jmisc\\(\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $"               { pass "ptype jmisc" }
 	-re ".*$gdb_prompt $"             { fail "ptype jmisc" }
 	timeout { fail "ptype jmisc (timeout)" ; return }
     }
diff --git a/gdb/testsuite/gdb.java/jmisc2.exp b/gdb/testsuite/gdb.java/jmisc2.exp
deleted file mode 100644
index 2eeb99d..0000000
--- a/gdb/testsuite/gdb.java/jmisc2.exp
+++ /dev/null
@@ -1,91 +0,0 @@
-# Copyright 2002 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
-# 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.  
-
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-
-# This file was written by Anthony Green. (green@redhat.com)
-#
-
-if $tracelevel then {
-	strace $tracelevel
-}
-
-load_lib "java.exp"
-
-set testfile "jmisc"
-set srcfile ${srcdir}/$subdir/${testfile}.java
-set binfile ${objdir}/${subdir}/${testfile}
-if  { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
-    untested "Couldn't compile ${srcfile}"
-    return -1
-}
-
-# Set the current language to java.  This counts as a test.  If it
-# fails, then we skip the other tests.
-
-proc set_lang_java {} {
-    global gdb_prompt
-    global binfile objdir subdir
-
-    verbose "loading file '$binfile'"
-    gdb_load $binfile
-
-    send_gdb "set language java\n"
-    gdb_expect {
-	-re ".*$gdb_prompt $" {}
-	timeout { fail "set language java (timeout)" ; return 0 }
-    }
-
-    return [gdb_test "show language" ".* source language is \"java\".*" \
-	"set language to \"java\""]
-}
-
-set prms_id 0
-set bug_id 0
-
-# Start with a fresh gdb.
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-
-gdb_test "set print sevenbit-strings" ".*"
-
-if ![set_lang_java] then {
-    send_gdb "ptype jmisc\n"   
-    gdb_expect {   
-	-re "type = class jmisc  extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+void <init>\\(void\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $"               { pass "ptype jmisc" }
-	-re ".*$gdb_prompt $"             { fail "ptype jmisc" }
-	timeout { fail "ptype jmisc (timeout)" ; return }
-    }
-
-    runto ${testfile}.main(java.lang.String\[\])
-
-    send_gdb "p args\n"
-    gdb_expect {   
-	-re "\\\$1 = java\.lang\.String\\\[]@\[a-f0-9]+\[\r\n\ \t]+$gdb_prompt $"                                        { pass "p args" }
-	-re ".*$gdb_prompt $"             { fail "p args" }
-	timeout { fail "p args (timeout)" ; return }
-    }
-
-    send_gdb "p *args\n"
-    gdb_expect {   
-	-re "\\\$2 = \{length: 0\}\[\r\n\ \t]+$gdb_prompt $"                                                             { pass "p *args" }
-	-re ".*$gdb_prompt $"             { fail "p *args" }
-	timeout { fail "p *args (timeout)" ; return }
-    }
-}
diff --git a/gdb/testsuite/gdb.mi/mi-file.exp b/gdb/testsuite/gdb.mi/mi-file.exp
index 2ffdcbf..070750f 100644
--- a/gdb/testsuite/gdb.mi/mi-file.exp
+++ b/gdb/testsuite/gdb.mi/mi-file.exp
@@ -1,4 +1,4 @@
-#   Copyright 1999 Free Software Foundation, Inc.
+#   Copyright 1999, 2004 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
@@ -47,7 +47,7 @@
 mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load ${binfile}
 
-proc test_tbreak_creation_and_listing {} {
+proc test_file_list_exec_source_file {} {
     global srcfile
     global srcdir
     global subdir
@@ -59,7 +59,17 @@
                "request path info of current source file (${srcfile})"
 }
 
-test_tbreak_creation_and_listing
+proc test_file_list_exec_source_files {} {
+    global srcfile
+
+    # get the path and absolute path to the current executable
+    mi_gdb_test "222-file-list-exec-source-files" \
+	    "222\\\^done,files=\\\[\{file=\".*/${srcfile}\",fullname=\"/.*/${srcfile}\"\},\{file=\".*\"\},\{file=\".*\"\},\{file=\".*\"\},\{file=\".*\"\}\\\]" \
+              "Getting a list of source files."
+}
+
+test_file_list_exec_source_file
+test_file_list_exec_source_files
 
 mi_gdb_exit
 return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-file.exp b/gdb/testsuite/gdb.mi/mi2-file.exp
index fe75a93..1d2a417 100644
--- a/gdb/testsuite/gdb.mi/mi2-file.exp
+++ b/gdb/testsuite/gdb.mi/mi2-file.exp
@@ -1,4 +1,4 @@
-#   Copyright 1999 Free Software Foundation, Inc.
+#   Copyright 1999, 2004 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
@@ -47,7 +47,7 @@
 mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load ${binfile}
 
-proc test_tbreak_creation_and_listing {} {
+proc test_file_list_exec_source_file {} {
     global srcfile
     global srcdir
     global subdir
@@ -59,7 +59,7 @@
                "request path info of current source file (${srcfile})"
 }
 
-test_tbreak_creation_and_listing
+test_file_list_exec_source_file
 
 mi_gdb_exit
 return 0
diff --git a/gdb/testsuite/gdb.stabs/exclfwd.exp b/gdb/testsuite/gdb.stabs/exclfwd.exp
new file mode 100644
index 0000000..05ab97c
--- /dev/null
+++ b/gdb/testsuite/gdb.stabs/exclfwd.exp
@@ -0,0 +1,72 @@
+#   Copyright 2004 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
+# 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.  
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@gnu.org
+
+if $tracelevel {
+    strace $tracelevel
+}
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile exclfwd
+set binfile ${objdir}/${subdir}/${testfile}
+
+foreach file {exclfwd1 exclfwd2} {
+    if {[gdb_compile "${srcdir}/${subdir}/${file}.c" "${file}.o" object {debug}] != ""} {
+        gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+    }
+}
+
+if {[gdb_compile "exclfwd1.o exclfwd2.o" ${binfile} executable {debug}] != "" } {
+     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+    perror "couldn't run to breakpoint"
+    continue
+}
+
+get_debug_format
+
+set eol "\[ \t\]*\[\n\r\]+"
+
+gdb_test "ptype v1" "type = struct a {$eol
+    int x;$eol
+    int y;$eol
+}$eol"
+
+if { [test_debug_format "stabs"] } then {
+    setup_kfail "gdb/1602" *-*-*
+}
+gdb_test "ptype v2" "type = struct a {$eol
+    const char .c;$eol
+}$eol"
+
+if { [test_debug_format "stabs"] } then {
+    setup_kfail "gdb/1603" *-*-*
+}
+gdb_test "ptype v3" "type = const char ."
diff --git a/gdb/config/m68k/xm-nbsd.h b/gdb/testsuite/gdb.stabs/exclfwd.h
similarity index 67%
copy from gdb/config/m68k/xm-nbsd.h
copy to gdb/testsuite/gdb.stabs/exclfwd.h
index 6c735fa..3f064b1 100644
--- a/gdb/config/m68k/xm-nbsd.h
+++ b/gdb/testsuite/gdb.stabs/exclfwd.h
@@ -1,7 +1,6 @@
-/* Parameters for execution on a Motorola m68k running NetBSD, for GDB.
-   Copyright 1996 Free Software Foundation, Inc.
+/* This testcase is part of GDB, the GNU debugger.
 
-   This file is part of GDB.
+   Copyright 2004 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
@@ -12,11 +11,12 @@
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-/* Get generic NetBSD host definitions. */
-#include "config/xm-nbsd.h"
+   Please email any bugs, comments, and/or additions to this file to:
+   bug-gdb@gnu.org  */
+
+typedef struct a a_t;
diff --git a/gdb/config/i386/tm-i386.h b/gdb/testsuite/gdb.stabs/exclfwd1.c
similarity index 64%
copy from gdb/config/i386/tm-i386.h
copy to gdb/testsuite/gdb.stabs/exclfwd1.c
index e2bd81f..a7574e5 100644
--- a/gdb/config/i386/tm-i386.h
+++ b/gdb/testsuite/gdb.stabs/exclfwd1.c
@@ -1,8 +1,6 @@
-/* Macro definitions for GDB on an Intel i[345]86.
-   Copyright 1995, 1996, 1998, 1999, 2000, 2001
-   Free Software Foundation, Inc.
+/* This testcase is part of GDB, the GNU debugger.
 
-   This file is part of GDB.
+   Copyright 2004 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
@@ -13,13 +11,24 @@
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-#ifndef TM_I386_H
-#define TM_I386_H 1
+   Please email any bugs, comments, and/or additions to this file to:
+   bug-gdb@gnu.org  */
 
-#endif /* ifndef TM_I386_H */
+#include "exclfwd.h"
+
+struct a 
+{
+  int x, y;
+};
+
+a_t v1;
+
+int
+main ()
+{
+}
diff --git a/gdb/config/sparc/tm-nbsd64.h b/gdb/testsuite/gdb.stabs/exclfwd2.c
similarity index 63%
copy from gdb/config/sparc/tm-nbsd64.h
copy to gdb/testsuite/gdb.stabs/exclfwd2.c
index cc1d6b3..f7de015 100644
--- a/gdb/config/sparc/tm-nbsd64.h
+++ b/gdb/testsuite/gdb.stabs/exclfwd2.c
@@ -1,7 +1,6 @@
-/* Macro definitions for UltraSPARC running under NetBSD.
-   Copyright 1994, 2002 Free Software Foundation, Inc.
+/* This testcase is part of GDB, the GNU debugger.
 
-   This file is part of GDB.
+   Copyright 2004 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
@@ -12,16 +11,20 @@
    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.  */
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-#ifndef TM_NBSD64_H
-#define TM_NBSD64_H
+   Please email any bugs, comments, and/or additions to this file to:
+   bug-gdb@gnu.org  */
 
-#include "sparc/tm-sp64.h" /* sets GDB_MULTI_ARCH */
-#include "solib.h"
+#include "exclfwd.h"
 
-#endif /* TM_NBSD64_H */
+struct a
+{
+  const char *c;
+};
+
+a_t v2;
+const char *v3;
diff --git a/gdb/testsuite/gdb.stabs/weird.exp b/gdb/testsuite/gdb.stabs/weird.exp
index 324f67b..7f67ccb 100644
--- a/gdb/testsuite/gdb.stabs/weird.exp
+++ b/gdb/testsuite/gdb.stabs/weird.exp
@@ -317,7 +317,7 @@
 	send_gdb "y\n"
 	exp_continue
     }
-    -re "^Reading symbols from $binfile\\.\\.\\.done\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)\r\n$gdb_prompt $" {
+    -re "^Reading symbols from .*$binfile\\.\\.\\.done\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)\r\n$gdb_prompt $" {
 	pass "weirdx.o read without error"
     }
     -re ".*$gdb_prompt $" {
diff --git a/gdb/testsuite/gdb.threads/manythreads.c b/gdb/testsuite/gdb.threads/manythreads.c
new file mode 100644
index 0000000..e39412c
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/manythreads.c
@@ -0,0 +1,68 @@
+/* Manythreads test program.
+   Copyright 2004
+   Free Software Foundation, Inc.
+
+   Written by Jeff Johnston <jjohnstn@redhat.com> 
+   Contributed by Red Hat
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <pthread.h>
+#include <stdio.h>
+#include <limits.h>
+
+void *
+thread_function (void *arg)
+{
+  int x = (int)arg;
+
+  printf ("Thread <%d> executing\n", x);
+
+  return NULL;
+}
+
+int 
+main (int argc, char **argv)
+{
+  pthread_attr_t attr;
+  pthread_t threads[256];
+  int i, j;
+
+  pthread_attr_init (&attr);
+  pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN);
+
+  /* Create a ton of quick-executing threads, then wait for them to
+     complete.  */
+  for (i = 0; i < 1000; ++i) 
+    {
+      for (j = 0; j < 256; ++j)
+	{
+	  pthread_create (&threads[j], &attr, thread_function, 
+			  (void *)(i * 1000 + j));
+	}
+
+      for (j = 0; j < 256; ++j)
+	{
+	  pthread_join (threads[j], NULL);
+	}
+    }
+
+  pthread_attr_destroy (&attr);
+
+  return 0;
+}
diff --git a/gdb/testsuite/gdb.threads/manythreads.exp b/gdb/testsuite/gdb.threads/manythreads.exp
new file mode 100644
index 0000000..a2baf84
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/manythreads.exp
@@ -0,0 +1,127 @@
+# manythreads.exp -- Expect script to test stopping many threads
+# Copyright (C) 2004 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
+# 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.  
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Jeff Johnston. (jjohnstn@redhat.com)
+
+if $tracelevel then {
+	strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "manythreads"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
+    return -1
+}
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+gdb_test "set print sevenbit-strings" ""
+runto_main
+
+# We'll need this when we send_gdb a ^C to GDB.  Need to do it before we
+# run the program and gdb starts saving and restoring tty states.
+# On Ultrix, we don't need it and it is really slow (because shell_escape
+# doesn't use vfork).
+if ![istarget "*-*-ultrix*"] then {
+    gdb_test "shell stty intr '^C'" ""
+}
+
+set message "first continue"
+gdb_test_multiple "continue" "first continue" {
+  -re "error:.*$gdb_prompt $" {
+    fail "$message"
+  }
+  -re "Continuing" {
+    pass "$message"
+  }
+}
+
+# Send a Ctrl-C and verify that we can do info threads and continue
+after 1000
+send_gdb "\003"
+set message "stop threads 1"
+gdb_test_multiple "" "stop threads 1" {
+  -re "\\\[New \[^\]\]*\\\]\r\n" {
+    exp_continue
+  }
+  -re "\\\[\[^\]\]* exited\\\]\r\n" {
+    exp_continue
+  }
+  -re "Thread \[^\n\]* executing\r\n" {
+    exp_continue
+  }
+  -re "Program received signal SIGINT.*$gdb_prompt $" {
+    pass "$message"
+  }
+  timeout {
+    fail "$message (timeout)"
+  }
+}
+
+gdb_test "info threads" ".*1 Thread.*.LWP.*"
+
+set message "second continue"
+gdb_test_multiple "continue" "second continue" {
+  -re "error:.*$gdb_prompt $" {
+    fail "$message"
+  }
+  -re "Continuing" {
+    pass "$message"
+  }
+}
+
+# Send another Ctrl-C and verify that we can do info threads and quit
+after 1000
+send_gdb "\003"
+set message "stop threads 2"
+gdb_test_multiple "" "stop threads 2" {
+  -re "\\\[New \[^\]\]*\\\]\r\n" {
+    exp_continue
+  }
+  -re "\\\[\[^\]\]* exited\\\]\r\n" {
+    exp_continue
+  }
+  -re "Thread \[^\n\]* executing\r\n" {
+    exp_continue
+  }
+  -re "Program received signal SIGINT.*$gdb_prompt $" {
+    pass "stop threads 2"
+  }
+} 
+
+gdb_test_multiple "quit" "GDB exits after stopping multithreaded program" {
+    -re "The program is running.  Exit anyway\\? \\(y or n\\) $" {
+	send_gdb "y\n"
+	exp_continue
+    }
+    eof {
+        pass "GDB exits after stopping multithreaded program"
+    }
+    timeout {
+        fail "GDB exits after stopping multithreaded program (timeout)"
+    }
+}
+
diff --git a/gdb/testsuite/gdb.threads/pthread_cond_wait.c b/gdb/testsuite/gdb.threads/pthread_cond_wait.c
new file mode 100644
index 0000000..ae87f8c
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/pthread_cond_wait.c
@@ -0,0 +1,76 @@
+/* A small multi-threaded test case.
+
+   Copyright 2004
+   Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include <pthread.h>
+#include <stdio.h>
+#include <time.h>
+
+void
+cond_wait (pthread_cond_t *cond, pthread_mutex_t *mut)
+{
+  pthread_mutex_lock(mut);
+  pthread_cond_wait (cond, mut);
+  pthread_mutex_unlock (mut);
+}
+
+void
+noreturn (void)
+{
+  pthread_mutex_t mut;
+  pthread_cond_t cond;
+
+  pthread_mutex_init (&mut, NULL);
+  pthread_cond_init (&cond, NULL);
+
+  /* Wait for a condition that will never be signaled, so we effectively
+     block the thread here.  */
+  cond_wait (&cond, &mut);
+}
+
+void *
+forever_pthread (void *unused)
+{
+  noreturn ();
+}
+
+void
+break_me (void)
+{
+  /* Just an anchor to help putting a breakpoint.  */
+}
+
+int
+main (void)
+{
+  pthread_t forever;
+  const struct timespec ts = { 0, 10000000 }; /* 0.01 sec */
+
+  pthread_create (&forever, NULL, forever_pthread, NULL);
+  for (;;)
+    {
+      nanosleep (&ts, NULL);
+      break_me();
+    }
+
+  return 0;
+}
+
diff --git a/gdb/testsuite/gdb.threads/pthread_cond_wait.exp b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp
new file mode 100644
index 0000000..72ae03a
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/pthread_cond_wait.exp
@@ -0,0 +1,73 @@
+# Copyright (C) 2004 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
+# 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.  
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@gnu.org
+
+# This file verifies that GDB is able to compute a backtrace for a thread
+# being blocked on a call to pthread_cond_wait(). 
+
+if $tracelevel then {
+	strace $tracelevel
+}
+
+set testfile "pthread_cond_wait"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug "incdir=${objdir}"]] != "" } {
+    return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "break break_me" \
+    "Breakpoint 1 at .*: file .*${srcfile}, line .*" \
+         "breakpoint on break_me"
+
+gdb_test "run" \
+         ".*Breakpoint 1, break_me ().*" \
+         "run to break_me"
+
+# 
+# Backtrace all threads, find the one running noreturn, and
+# verify that we are able to get a sensible backtrace, including
+# the frame for the pthread_cond_wait() call.
+#
+# The string below will only match if the functions named
+# occur in a single thread's backtrace, in the given order.
+#
+
+global hex
+global decimal
+
+#
+# This is a "backtrace break" ("btb"):
+#
+set btb "\[^\r\n\]+\[\r\n\]+\#${decimal}\[ \t\]+${hex} in "
+
+# One of the threads is blocked on a call to pthread_cond_wait, and
+# we want to verify that we are able to get a sensible backtrace for
+# that thread.  Because we don't know its thread ID, we can't switch
+# to it before doing the backtrace. So we get a backtrace for all
+# threads, and verify that one them returns the expected backtrace.
+gdb_test "thread apply all backtrace" \
+    "pthread_cond_wait${btb}cond_wait${btb}noreturn${btb}forever_pthread.*" \
+    "backtrace in blocked thread"
+
diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp
index 5dbe1a8..a60a3d3 100644
--- a/gdb/testsuite/gdb.threads/pthreads.exp
+++ b/gdb/testsuite/gdb.threads/pthreads.exp
@@ -1,4 +1,5 @@
-# Copyright (C) 1996, 1997, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004
+# 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,9 +231,9 @@
 	    fail "Continue with all threads running (timeout)"
 	}
     }
-    sleep 1
+    after 2000
+    send_gdb "\003"
     set description "Stopped with a ^C"
-    after 1000 [send_gdb "\003"]
     gdb_expect {
 	-re "Program received signal SIGINT.*$gdb_prompt $" {
 	    pass $description
diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
new file mode 100644
index 0000000..3bd8e29
--- /dev/null
+++ b/gdb/testsuite/lib/ada.exp
@@ -0,0 +1,429 @@
+# Copyright 2004 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
+# 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.  
+
+load_lib libgloss.exp
+
+# FIXME:brobecker/2004-03-31:
+# The following function should eventually be part of dejagnu. Even after
+# this function becomes available in dejagnu, we will keep for a while
+# a copy of this function here in order to avoid increasing the dejagnu
+# version requirement.
+
+proc gdb_find_gnatmake {} {
+    global tool_root_dir
+
+    set root "$tool_root_dir/gcc"
+    set GM ""
+
+    if ![is_remote host] {
+        set file [lookfor_file $root gnatmake]
+        if { $file != "" } {
+            set GM "$file -I$root/ada/rts --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --GCC=$root/xgcc -margs";
+        }   
+    }
+
+    if {$GM == ""} {
+        set GM [transform gnatmake]
+    }
+
+    return $GM
+}   
+
+# FIXME:brobecker/2004-03-31:
+# The following function is a copy of the function of the same name provided
+# by dejagnu, except that it has been modified to add support for building
+# Ada programs.  This copy is temporarily placed here until the changes
+# are merged into the dejagnu official release. Once the changes are merged,
+# we will likely keep this local copy for a while to avoid increasing the
+# dejagnu version requirement.
+
+proc gdb_default_target_compile {source destfile type options} {
+    global target_triplet
+    global tool_root_dir
+    global CFLAGS_FOR_TARGET
+    global compiler_flags
+
+    if { $destfile == "" && $type != "preprocess" && $type != "none" } {
+	error "Must supply an output filename for the compile to default_target_compile"
+    }
+
+    set add_flags ""
+    set libs ""
+    set compiler_type "c"
+    set compiler ""
+    set ldflags ""
+    set dest [target_info name]
+
+    if [info exists CFLAGS_FOR_TARGET] {
+	append add_flags " $CFLAGS_FOR_TARGET"
+    }
+
+    if [info exists target_info(host,name)] {
+	set host [host_info name];
+    } else {
+	set host "unix";
+    }
+
+    foreach i $options {
+	if { $i == "ada" } {
+	    set compiler_type "ada"
+	    if [board_info $dest exists adaflags] {
+		append add_flags " [target_info adaflags]"
+	    }
+	    # append add_flags " [gnatmake_include_flags]";
+	    if [board_info $dest exists gnatmake] {
+		set compiler [target_info gnatmake];
+	    } else {
+		set compiler [find_gnatmake];
+	    }
+	}
+
+	if { $i == "c++" } {
+	    set compiler_type "c++"
+	    if [board_info $dest exists cxxflags] {
+		append add_flags " [target_info cxxflags]"
+	    }
+	    append add_flags " [g++_include_flags]";
+	    if [board_info $dest exists c++compiler] {
+		set compiler [target_info c++compiler];
+	    } else {
+		set compiler [find_g++];
+	    }
+	}
+
+	if { $i == "f77" } {
+	    set compiler_type "f77"
+	    if [board_info $dest exists f77flags] {
+		append add_flags " [target_info f77flags]"
+	    }
+#	    append add_flags " [f77_include_flags]"
+	    if [board_info $dest exists f77compiler] {
+		set compiler [target_info f77compiler]
+	    } else {
+		set compiler [find_g77]
+	    }
+	}
+
+	if [regexp "^dest=" $i] {
+	    regsub "^dest=" $i "" tmp
+	    if [board_info $tmp exists name] {
+		set dest [board_info $tmp name];
+	    } else {
+		set dest $tmp;
+	    }
+	}
+	if [regexp "^compiler=" $i] {
+	    regsub "^compiler=" $i "" tmp
+	    set compiler $tmp
+	}
+	if [regexp "^additional_flags=" $i] {
+	    regsub "^additional_flags=" $i "" tmp
+	    append add_flags " $tmp"
+	}
+	if [regexp "^ldflags=" $i] {
+	    regsub "^ldflags=" $i "" tmp
+	    append ldflags " $tmp"
+	}
+	if [regexp "^libs=" $i] {
+	    regsub "^libs=" $i "" tmp
+	    append libs " $tmp"
+	}
+	if [regexp "^incdir=" $i] {
+	    regsub "^incdir=" $i "-I" tmp
+	    append add_flags " $tmp"
+	}
+	if [regexp "^libdir=" $i] {
+	    regsub "^libdir=" $i "-L" tmp
+	    append add_flags " $tmp"
+	}
+	if [regexp "^ldscript=" $i] {
+	    regsub "^ldscript=" $i "" ldscript
+	}
+ 	if [regexp "^redirect=" $i] {
+ 	    regsub "^redirect=" $i "" redirect
+ 	}
+ 	if [regexp "^optimize=" $i] {
+ 	    regsub "^optimize=" $i "" optimize
+ 	}
+ 	if [regexp "^timeout=" $i] {
+ 	    regsub "^timeout=" $i "" timeout
+ 	}
+    }
+
+    if [board_info $host exists cflags_for_target] {
+	append add_flags " [board_info $host cflags_for_target]";
+    }
+
+    global CC_FOR_TARGET
+    global CXX_FOR_TARGET
+    global F77_FOR_TARGET
+    global GNATMAKE_FOR_TARGET
+    
+    if [info exists CC_FOR_TARGET] {
+	if { $compiler == "" } {
+	    set compiler $CC_FOR_TARGET
+	}
+    }
+
+    if [info exists CXX_FOR_TARGET] {
+	if { $compiler_type == "c++" } {
+	    set compiler $CXX_FOR_TARGET
+	}
+    }
+
+    if [info exists F77_FOR_TARGET] {
+	if { $compiler_type == "f77" } {
+	    set compiler $F77_FOR_TARGET
+	}
+    }
+
+    if [info exists GNATMAKE_FOR_TARGET] {
+	if { $compiler_type == "ada" } {
+	    set compiler $GNATMAKE_FOR_TARGET
+	}
+    }
+
+    if { $compiler == "" } {
+	set compiler [board_info $dest compiler];
+	if { $compiler == "" } {
+	    return "default_target_compile: No compiler to compile with";
+	}
+    }
+
+    if ![is_remote host] {
+	if { [which $compiler] == 0 } {
+	    return "default_target_compile: Can't find $compiler."
+	}
+    }
+
+    if {$type == "object"} {
+	append add_flags " -c"
+    }
+
+    if { $type == "preprocess" } {
+	append add_flags " -E"
+    }
+    
+    if { $type == "assembly" } {
+	append add_flags " -S"
+    }
+
+    if [board_info $dest exists cflags] {
+	append add_flags " [board_info $dest cflags]"
+    }
+
+    if { $type == "executable" } {
+	# This must be added here.
+	# if [board_info $dest exists ldscript] {
+	#     append add_flags " [board_info $dest ldscript]"
+	# }
+
+	if [board_info $dest exists ldflags] {
+	    append add_flags " [board_info $dest ldflags]"
+	}
+	if { $compiler_type == "c++" } {
+	    append add_flags " [g++_link_flags]";
+	}
+	if [isnative] {
+	    # This is a lose.
+	    catch "glob -nocomplain $tool_root_dir/libstdc++/libstdc++.so* $tool_root_dir/libstdc++/libstdc++.sl" tmp
+	    if { ${tmp} != "" } {
+		if [regexp ".*solaris2.*" $target_triplet] {
+		    # Solaris 2
+		    append add_flags " -R$tool_root_dir/libstdc++"
+		} elseif [regexp ".*(osf|irix5|linux).*" $target_triplet] {
+		    # OSF/1 or Irix5
+		    append add_flags " -Wl,-rpath,$tool_root_dir/libstdc++"
+		} elseif [regexp ".*hppa.*" $target_triplet] {
+		    # HP/UX
+		    append add_flags " -Wl,-a,shared_archive"
+		}
+	    }
+	}
+    }
+
+    if ![info exists ldscript] {
+	set ldscript [board_info $dest ldscript]
+    }
+
+    foreach i $options {
+	if { $i == "debug" } {
+	    if [board_info $dest exists debug_flags] {
+		append add_flags " [board_info $dest debug_flags]";
+	    } else {
+		append add_flags " -g"
+	    }
+	}
+    }
+
+    if [info exists optimize] {
+	append add_flags " $optimize";
+    }
+
+    if { $type == "executable" } {
+	append add_flags " $ldflags"
+	foreach x $libs {
+	    if [file exists $x] {
+		append source " $x"
+	    } else {
+		append add_flags " $x";
+	    }
+	}
+
+	if [board_info $dest exists libs] {
+	    append add_flags " [board_info $dest libs]"
+	}
+
+	# This probably isn't such a good idea, but it avoids nasty
+	# hackiness in the testsuites.
+	# The math library must be linked in before the C library.  The C
+	# library is linked in by the linker script, so this must be before
+	# the linker script.
+	if [board_info $dest exists mathlib] {
+	    append add_flags " [board_info $dest mathlib]"
+	} else {
+	    append add_flags " -lm"
+	}
+
+	# This must be added here.
+	append add_flags " $ldscript";
+
+	if [board_info $dest exists remote_link] {
+	    # Relink option.
+	    append add_flags " -Wl,-r"
+	}
+	if [board_info $dest exists output_format] {
+	    append add_flags " -Wl,-oformat,[board_info $dest output_format]";
+	}
+    }
+
+    if [board_info $dest exists multilib_flags] {
+	append add_flags " [board_info $dest multilib_flags]";
+    }
+
+    verbose "doing compile"
+
+    set sources ""
+    if [is_remote host] {
+	foreach x $source {
+	    set file [remote_download host $x];
+	    if { $file == "" } {
+		warning "Unable to download $x to host."
+		return "Unable to download $x to host."
+	    } else {
+		append sources " $file";
+	    }
+	}
+    } else {
+	set sources $source
+    }
+
+    if [is_remote host] {
+	append add_flags " -o a.out"
+	remote_file host delete a.out;
+    } else {
+	if { $destfile != "" } {
+	    append add_flags " -o $destfile";
+	}
+    }
+
+    # This is obscure: we put SOURCES at the end when building an
+    # object, because otherwise, in some situations, libtool will
+    # become confused about the name of the actual source file.
+    if {$type == "object"} {
+        set opts "$add_flags $sources"
+    } else {
+        set opts "$sources $add_flags"
+    }
+
+    if [is_remote host] {
+	if [host_info exists use_at] {
+	    set fid [open "atfile" "w"];
+	    puts $fid "$opts";
+	    close $fid;
+	    set opts "@[remote_download host atfile]"
+	    remote_file build delete atfile
+	}
+    }
+
+    verbose "Invoking the compiler as $compiler $opts" 2
+
+    if [info exists redirect] {
+	verbose "Redirecting output to $redirect" 2
+	set status [remote_exec host "$compiler $opts" "" "" $redirect];
+    } else {
+	if [info exists timeout] {
+	    verbose "Setting timeout to $timeout" 2
+	    set status [remote_exec host "$compiler $opts" "" "" "" $timeout];
+	} else {
+	    set status [remote_exec host "$compiler $opts"];
+	}
+    }
+
+    set compiler_flags $opts
+    if [is_remote host] {
+	remote_upload host a.out $destfile;
+	remote_file host delete a.out;
+    }
+    set comp_output [prune_warnings [lindex $status 1]];
+    regsub "^\[\r\n\]+" $comp_output "" comp_output;
+    if { [lindex $status 0] != 0 } {
+	verbose -log "compiler exited with status [lindex $status 0]";
+    }
+    if { [lindex $status 1] != "" } {
+	verbose -log "output is:\n[lindex $status 1]" 2;
+    }
+    if { [lindex $status 0] != 0 && "${comp_output}" == "" } {
+	set comp_output "exit status is [lindex $status 0]";
+    }
+    return ${comp_output};
+}
+
+# See if the version of dejaGNU being used to run the testsuite is
+# recent enough to contain support for building Ada programs or not.
+# If not, then use the functions above in place of the ones provided
+# by dejaGNU. This is only temporary (brobecker/2004-03-31).
+
+if {[info procs find_gnatmake] == ""} {
+  proc find_gnatmake { } { return [gdb_find_gnatmake] }
+  proc default_target_compile { source destfile type options } {
+    return [gdb_default_target_compile $source $destfile $type $options]
+  }
+}
+
+# Compile some Ada code.
+
+proc gdb_compile_ada {source dest type options} {
+
+    set objdir [file dirname $dest]
+
+    append options " ada"
+    append options " additional_flags=-P$objdir/gnat_ada"
+
+    set result [target_compile $source $dest $type $options]
+
+    # The Ada build always produces some output, even when the build
+    # succeeds. Thus, we can not use the output the same way we do in
+    # gdb_compile to determine whether the build has succeeded or not.
+    # We therefore simply check whether the dest file has been created
+    # or not. Unless not present, the build has succeeded.
+    if ![file exists $dest] {
+        unsupported "Ada compilation failed: $result"
+        return "Ada compilation failed."
+    }
+}
+
diff --git a/gdb/testsuite/lib/compiler.c b/gdb/testsuite/lib/compiler.c
index b1f1f5d..da2fb0c 100644
--- a/gdb/testsuite/lib/compiler.c
+++ b/gdb/testsuite/lib/compiler.c
@@ -34,27 +34,36 @@
 
    TODO: purge signed_keyword_not_used.  */
 
-set compiler_info ""
+/* Note the semicolon at the end of this line.  Older versions of
+   hp c++ have a bug in string preprocessing: if the last token on a
+   line is a string, then the preprocessor concatenates the next line
+   onto the current line and eats the newline!  That messes up TCL of
+   course.  That happens with HP aC++ A.03.13, but it no longer happens
+   with HP aC++ A.03.45. */
+
+set compiler_info "unknown" ;
 
 #if defined (__GNUC__)
-set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ } -]
-set gcc_compiled __GNUC__
+#if defined (__GNUC_PATCHLEVEL__)
+/* Only GCC versions >= 3.0 define the __GNUC_PATCHLEVEL__ macro.  */
+set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__} -]
 #else
-set gcc_compiled 0
+set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ "unknown"} -]
+#endif
+#endif
+
+#if defined (__HP_CXD_SPP)
+/* older hp ansi c, such as A.11.01.25171.gp, defines this */
+set compiler_info [join {hpcc __HP_CXD_SPP} -]
 #endif
 
 #if defined (__HP_cc)
+/* newer hp ansi c, such as B.11.11.28706.gp, defines this */
 set compiler_info [join {hpcc __HP_cc} -]
-set hp_cc_compiler __HP_cc
-#else
-set hp_cc_compiler 0
 #endif
 
 #if defined (__HP_aCC)
 set compiler_info [join {hpacc __HP_aCC} -]
-set hp_aCC_compiler __HP_aCC
-#else
-set hp_aCC_compiler 0
 #endif
 
 /* gdb.base/whatis.exp still uses this */
diff --git a/gdb/testsuite/lib/compiler.cc b/gdb/testsuite/lib/compiler.cc
index 0c5eb66..66fb32b 100644
--- a/gdb/testsuite/lib/compiler.cc
+++ b/gdb/testsuite/lib/compiler.cc
@@ -22,27 +22,36 @@
 /* This file is exactly like compiler.c.  I could just use compiler.c if
    I could be sure that every C++ compiler accepted extensions of ".c".  */
 
-set compiler_info ""
+/* Note the semicolon at the end of this line.  Older versions of
+   hp c++ have a bug in string preprocessing: if the last token on a
+   line is a string, then the preprocessor concatenates the next line
+   onto the current line and eats the newline!  That messes up TCL of
+   course.  That happens with HP aC++ A.03.13, but it no longer happens
+   with HP aC++ A.03.45. */
+
+set compiler_info "unknown" ;
 
 #if defined (__GNUC__)
-set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ } -]
-set gcc_compiled __GNUC__
+#if defined (__GNUC_PATCHLEVEL__)
+/* Only GCC versions >= 3.0 define the __GNUC_PATCHLEVEL__ macro.  */
+set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__} -]
 #else
-set gcc_compiled 0
+set compiler_info [join {gcc __GNUC__ __GNUC_MINOR__ "unknown"} -]
+#endif
+#endif
+
+#if defined (__HP_CXD_SPP)
+/* older hp ansi c, such as A.11.01.25171.gp, defines this */
+set compiler_info [join {hpcc __HP_CXD_SPP} -]
 #endif
 
 #if defined (__HP_cc)
+/* newer hp ansi c, such as B.11.11.28706.gp, defines this */
 set compiler_info [join {hpcc __HP_cc} -]
-set hp_cc_compiler __HP_cc
-#else
-set hp_cc_compiler 0
 #endif
 
 #if defined (__HP_aCC)
 set compiler_info [join {hpacc __HP_aCC} -]
-set hp_aCC_compiler __HP_aCC
-#else
-set hp_aCC_compiler 0
 #endif
 
 /* gdb.base/whatis.exp still uses this */
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 72d9143..a41291c 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -265,18 +265,32 @@
     }
 }
 
-proc gdb_breakpoint { function } {
+# Set a breakpoint at FUNCTION.  If there is an additional argument it is
+# a list of options; the only currently supported option is allow-pending.
+
+proc gdb_breakpoint { function args } {
     global gdb_prompt
     global decimal
 
+    set pending_response n
+    if {[lsearch -exact [lindex $args 0] allow-pending] != -1} {
+	set pending_response y
+    }
+
     send_gdb "break $function\n"
     # The first two regexps are what we get with -g, the third is without -g.
     gdb_expect 30 {
 	-re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {}
 	-re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
 	-re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {}
+	-re "Breakpoint \[0-9\]* \\(.*\\) pending.*$gdb_prompt $" {
+		if {$pending_response == "n"} {
+			fail "setting breakpoint at $function"
+			return 0
+		}
+	}
 	-re "Make breakpoint pending.*y or \\\[n\\\]. $" { 
-		send_gdb "n\n"
+		send_gdb "$pending_response\n"
 		exp_continue
 	}
 	-re "$gdb_prompt $" { fail "setting breakpoint at $function" ; return 0 }
@@ -289,15 +303,16 @@
 # Since this is the only breakpoint that will be set, if it stops
 # at a breakpoint, we will assume it is the one we want.  We can't
 # just compare to "function" because it might be a fully qualified,
-# single quoted C++ function specifier.
+# single quoted C++ function specifier.  If there's an additional argument,
+# pass it to gdb_breakpoint.
 
-proc runto { function } {
+proc runto { function args } {
     global gdb_prompt
     global decimal
 
     delete_breakpoints
 
-    if ![gdb_breakpoint $function] {
+    if ![gdb_breakpoint $function [lindex $args 0]] {
 	return 0;
     }
 
@@ -646,7 +661,7 @@
 	    fail "$errmsg"
 	    set result -1
 	}
-	 -re ".*$gdb_prompt $" {
+	 -re "\r\n$gdb_prompt $" {
 	    if ![string match "" $message] then {
 		fail "$message"
 	    }
@@ -1175,10 +1190,12 @@
 
     # These come from compiler.c or compiler.cc
     global compiler_info
+    global signed_keyword_not_used
+
+    # Legacy global data symbols.
     global gcc_compiled
     global hp_cc_compiler
     global hp_aCC_compiler
-    global signed_keyword_not_used
 
     # Choose which file to preprocess.
     set ifile "${srcdir}/lib/compiler.c"
@@ -1192,15 +1209,43 @@
     set cppout [ gdb_compile "${ifile}" "" preprocess [list "$args" quiet] ]
     log_file -a "$outdir/$tool.log" 
 
-    # Source the output.
+    # Eval the output.
+    set unknown 0
     foreach cppline [ split "$cppout" "\n" ] {
-	if { ! [ regexp "^#" "$cppline" ] } {
-	    if { ! [ regexp "^\[\n\r\t \]*$" "$cppline" ] } {
-		verbose "get_compiler_info: $cppline" 2
-		eval "$cppline"
-	    }
+	if { [ regexp "^#" "$cppline" ] } {
+	    # line marker
+	} elseif { [ regexp "^\[\n\r\t \]*$" "$cppline" ] } {
+	    # blank line
+	} elseif { [ regexp "^\[\n\r\t \]*set\[\n\r\t \]" "$cppline" ] } {
+	    # eval this line
+	    verbose "get_compiler_info: $cppline" 2
+	    eval "$cppline"
+	} else {
+	    # unknown line
+	    verbose -log "get_compiler_info: $cppline"
+	    set unknown 1
 	}
     }
+
+    # Reset to unknown compiler if any diagnostics happened.
+    if { $unknown } {
+	set compiler_info "unknown"
+	set signed_keyword_not_used 0
+    }
+
+    # Set the legacy symbols.
+    set gcc_compiled     0
+    set hp_cc_compiler   0
+    set hp_aCC_compiler  0
+    if { [regexp "^gcc-1-" "$compiler_info" ] } { set gcc_compiled 1 }
+    if { [regexp "^gcc-2-" "$compiler_info" ] } { set gcc_compiled 2 }
+    if { [regexp "^gcc-3-" "$compiler_info" ] } { set gcc_compiled 3 }
+    if { [regexp "^gcc-4-" "$compiler_info" ] } { set gcc_compiled 4 }
+    if { [regexp "^gcc-5-" "$compiler_info" ] } { set gcc_compiled 5 }
+    if { [regexp "^hpcc-"  "$compiler_info" ] } { set hp_cc_compiler 1 }
+    if { [regexp "^hpacc-" "$compiler_info" ] } { set hp_aCC_compiler 1 }
+
+    # Log what happened.
     verbose -log "get_compiler_info: $compiler_info"
 
     # Most compilers will evaluate comparisons and other boolean
diff --git a/gdb/thread-db.c b/gdb/thread-db.c
index 804f48a..50ae747 100644
--- a/gdb/thread-db.c
+++ b/gdb/thread-db.c
@@ -1,6 +1,6 @@
 /* libthread_db assisted debugging support, generic parts.
 
-   Copyright 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -35,6 +35,10 @@
 #include "regcache.h"
 #include "solib-svr4.h"
 
+#ifdef HAVE_GNU_LIBC_VERSION_H
+#include <gnu/libc-version.h>
+#endif
+
 #ifndef LIBTHREAD_DB_SO
 #define LIBTHREAD_DB_SO "libthread_db.so.1"
 #endif
@@ -130,6 +134,7 @@
 static void thread_db_find_new_threads (void);
 static void attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
 			   const td_thrinfo_t *ti_p, int verbose);
+static void detach_thread (ptid_t ptid, int verbose);
 
 
 /* Building process ids.  */
@@ -150,6 +155,9 @@
 
 struct private_thread_info
 {
+  /* Flag set when we see a TD_DEATH event for this thread.  */
+  unsigned int dying:1;
+
   /* Cached thread state.  */
   unsigned int th_valid:1;
   unsigned int ti_valid:1;
@@ -244,7 +252,10 @@
 
    THP is a handle to the current thread; if INFOP is not NULL, the
    struct thread_info associated with this thread is returned in
-   *INFOP.  */
+   *INFOP.
+
+   If the thread is a zombie, TD_THR_ZOMBIE is returned.  Otherwise,
+   zero is returned to indicate success.  */
 
 static int
 thread_get_info_callback (const td_thrhandle_t *thp, void *infop)
@@ -263,6 +274,22 @@
   thread_ptid = BUILD_THREAD (ti.ti_tid, GET_PID (inferior_ptid));
   thread_info = find_thread_pid (thread_ptid);
 
+  /* In the case of a zombie thread, don't continue.  We don't want to
+     attach to it thinking it is a new thread.  */
+  if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE)
+    {
+      if (infop != NULL)
+        *(struct thread_info **) infop = thread_info;
+      if (thread_info != NULL)
+	{
+	  memcpy (&thread_info->private->th, thp, sizeof (*thp));
+	  thread_info->private->th_valid = 1;
+	  memcpy (&thread_info->private->ti, &ti, sizeof (ti));
+	  thread_info->private->ti_valid = 1;
+	}
+      return TD_THR_ZOMBIE;
+    }
+
   if (thread_info == NULL)
     {
       /* New thread.  Attach to it now (why wait?).  */
@@ -347,7 +374,19 @@
 	   GET_LWP (ptid), thread_db_err_str (err));
 
   thread_info = NULL;
-  thread_get_info_callback (&th, &thread_info);
+
+  /* Fetch the thread info.  If we get back TD_THR_ZOMBIE, then the
+     event thread has already died.  If another gdb interface has called
+     thread_alive() previously, the thread won't be found on the thread list
+     anymore.  In that case, we don't want to process this ptid anymore
+     to avoid the possibility of later treating it as a newly
+     discovered thread id that we should add to the list.  Thus,
+     we return a -1 ptid which is also how the thread list marks a
+     dead thread.  */
+  if (thread_get_info_callback (&th, &thread_info) == TD_THR_ZOMBIE
+      && thread_info == NULL)
+    return pid_to_ptid (-1);
+
   gdb_assert (thread_info && thread_info->private->ti_valid);
 
   return BUILD_THREAD (thread_info->private->ti.ti_tid, GET_PID (ptid));
@@ -491,6 +530,10 @@
   td_thr_events_t events;
   td_notify_t notify;
   td_err_e err;
+#ifdef HAVE_GNU_LIBC_VERSION_H
+  const char *libc_version;
+  int libc_major, libc_minor;
+#endif
 
   /* We cannot use the thread event reporting facility if these
      functions aren't available.  */
@@ -501,12 +544,16 @@
   /* Set the process wide mask saying which events we're interested in.  */
   td_event_emptyset (&events);
   td_event_addset (&events, TD_CREATE);
-#if 0
+
+#ifdef HAVE_GNU_LIBC_VERSION_H
   /* FIXME: kettenis/2000-04-23: The event reporting facility is
      broken for TD_DEATH events in glibc 2.1.3, so don't enable it for
      now.  */
-  td_event_addset (&events, TD_DEATH);
+  libc_version = gnu_get_libc_version ();
+  if (sscanf (libc_version, "%d.%d", &libc_major, &libc_minor) == 2
+      && (libc_major > 2 || (libc_major == 2 && libc_minor > 1)))
 #endif
+    td_event_addset (&events, TD_DEATH);
 
   err = td_ta_set_event_p (thread_agent, &events);
   if (err != TD_OK)
@@ -689,6 +736,10 @@
     target_new_objfile_chain (objfile);
 }
 
+/* Attach to a new thread.  This function is called when we receive a
+   TD_CREATE event or when we iterate over all threads and find one
+   that wasn't already in our list.  */
+
 static void
 attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
 	       const td_thrinfo_t *ti_p, int verbose)
@@ -696,6 +747,27 @@
   struct thread_info *tp;
   td_err_e err;
 
+  /* If we're being called after a TD_CREATE event, we may already
+     know about this thread.  There are two ways this can happen.  We
+     may have iterated over all threads between the thread creation
+     and the TD_CREATE event, for instance when the user has issued
+     the `info threads' command before the SIGTRAP for hitting the
+     thread creation breakpoint was reported.  Alternatively, the
+     thread may have exited and a new one been created with the same
+     thread ID.  In the first case we don't need to do anything; in
+     the second case we should discard information about the dead
+     thread and attach to the new one.  */
+  if (in_thread_list (ptid))
+    {
+      tp = find_thread_pid (ptid);
+      gdb_assert (tp != NULL);
+
+      if (!tp->private->dying)
+        return;
+
+      delete_thread (ptid);
+    }
+
   check_thread_signals ();
 
   /* Add the thread to GDB's thread list.  */
@@ -741,8 +813,21 @@
 static void
 detach_thread (ptid_t ptid, int verbose)
 {
+  struct thread_info *thread_info;
+
   if (verbose)
     printf_unfiltered ("[%s exited]\n", target_pid_to_str (ptid));
+
+  /* Don't delete the thread now, because it still reports as active
+     until it has executed a few instructions after the event
+     breakpoint - if we deleted it now, "info threads" would cause us
+     to re-attach to it.  Just mark it as having had a TD_DEATH
+     event.  This means that we won't delete it from our thread list
+     until we notice that it's dead (via prune_threads), or until
+     something re-uses its thread ID.  */
+  thread_info = find_thread_pid (ptid);
+  gdb_assert (thread_info != NULL);
+  thread_info->private->dying = 1;
 }
 
 static void
@@ -847,12 +932,9 @@
       switch (msg.event)
 	{
 	case TD_CREATE:
-
-	  /* We may already know about this thread, for instance when the
-	     user has issued the `info threads' command before the SIGTRAP
-	     for hitting the thread creation breakpoint was reported.  */
-	  if (!in_thread_list (ptid))
-	    attach_thread (ptid, msg.th_p, &ti, 1);
+	  /* Call attach_thread whether or not we already know about a
+	     thread with this thread ID.  */
+	  attach_thread (ptid, msg.th_p, &ti, 1);
 
 	  break;
 
@@ -899,7 +981,16 @@
   if (!ptid_equal (trap_ptid, null_ptid))
     trap_ptid = thread_from_lwp (trap_ptid);
 
-  return thread_from_lwp (ptid);
+  /* Change the ptid back into the higher level PID + TID format.
+     If the thread is dead and no longer on the thread list, we will 
+     get back a dead ptid.  This can occur if the thread death event
+     gets postponed by other simultaneous events.  In such a case, 
+     we want to just ignore the event and continue on.  */
+  ptid = thread_from_lwp (ptid);
+  if (GET_PID (ptid) == -1)
+    ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
+  
+  return ptid;
 }
 
 static int
@@ -1012,7 +1103,8 @@
 }
 
 static void
-thread_db_create_inferior (char *exec_file, char *allargs, char **env)
+thread_db_create_inferior (char *exec_file, char *allargs, char **env,
+			   int from_tty)
 {
   if (!keep_thread_db)
     {
@@ -1020,7 +1112,7 @@
       using_thread_db = 0;
     }
 
-  target_beneath->to_create_inferior (exec_file, allargs, env);
+  target_beneath->to_create_inferior (exec_file, allargs, env, from_tty);
 }
 
 static void
@@ -1308,7 +1400,7 @@
       add_target (&thread_db_ops);
 
       /* Add ourselves to objfile event chain.  */
-      target_new_objfile_chain = target_new_objfile_hook;
-      target_new_objfile_hook = thread_db_new_objfile;
+      target_new_objfile_chain = deprecated_target_new_objfile_hook;
+      deprecated_target_new_objfile_hook = thread_db_new_objfile;
     }
 }
diff --git a/gdb/thread.c b/gdb/thread.c
index f8cc18d..1664592 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1,7 +1,7 @@
 /* Multi-process/thread control for GDB, the GNU debugger.
 
    Copyright 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Lynx Real-Time Systems, Inc.  Los Gatos, CA.
 
@@ -294,7 +294,6 @@
 		   CORE_ADDR *prev_pc,
 		   int *trap_expected,
 		   struct breakpoint **step_resume_breakpoint,
-		   struct breakpoint **through_sigtramp_breakpoint,
 		   CORE_ADDR *step_range_start,
 		   CORE_ADDR *step_range_end,
 		   struct frame_id *step_frame_id,
@@ -304,7 +303,7 @@
 		   bpstat *stepping_through_solib_catchpoints,
 		   int *stepping_through_sigtramp,
 		   int *current_line,
-		   struct symtab **current_symtab, CORE_ADDR *step_sp)
+		   struct symtab **current_symtab)
 {
   struct thread_info *tp;
 
@@ -317,7 +316,6 @@
   *prev_pc = tp->prev_pc;
   *trap_expected = tp->trap_expected;
   *step_resume_breakpoint = tp->step_resume_breakpoint;
-  *through_sigtramp_breakpoint = tp->through_sigtramp_breakpoint;
   *step_range_start = tp->step_range_start;
   *step_range_end = tp->step_range_end;
   *step_frame_id = tp->step_frame_id;
@@ -330,7 +328,6 @@
   *stepping_through_sigtramp = tp->stepping_through_sigtramp;
   *current_line = tp->current_line;
   *current_symtab = tp->current_symtab;
-  *step_sp = tp->step_sp;
 }
 
 /* Save infrun state for the thread PID.  */
@@ -340,7 +337,6 @@
 		   CORE_ADDR prev_pc,
 		   int trap_expected,
 		   struct breakpoint *step_resume_breakpoint,
-		   struct breakpoint *through_sigtramp_breakpoint,
 		   CORE_ADDR step_range_start,
 		   CORE_ADDR step_range_end,
 		   const struct frame_id *step_frame_id,
@@ -350,7 +346,7 @@
 		   bpstat stepping_through_solib_catchpoints,
 		   int stepping_through_sigtramp,
 		   int current_line,
-		   struct symtab *current_symtab, CORE_ADDR step_sp)
+		   struct symtab *current_symtab)
 {
   struct thread_info *tp;
 
@@ -363,7 +359,6 @@
   tp->prev_pc = prev_pc;
   tp->trap_expected = trap_expected;
   tp->step_resume_breakpoint = step_resume_breakpoint;
-  tp->through_sigtramp_breakpoint = through_sigtramp_breakpoint;
   tp->step_range_start = step_range_start;
   tp->step_range_end = step_range_end;
   tp->step_frame_id = (*step_frame_id);
@@ -374,7 +369,6 @@
   tp->stepping_through_sigtramp = stepping_through_sigtramp;
   tp->current_line = current_line;
   tp->current_symtab = current_symtab;
-  tp->step_sp = step_sp;
 }
 
 /* Return true if TP is an active thread. */
@@ -417,15 +411,9 @@
   struct thread_info *tp;
   ptid_t current_ptid;
   struct frame_info *cur_frame;
-  int saved_frame_level = frame_relative_level (get_selected_frame ());
-  int counter;
+  struct frame_id saved_frame_id = get_frame_id (get_selected_frame ());
   char *extra_info;
 
-  /* Check that there really is a frame.  This happens when a simulator
-     is connected but not loaded or running, for instance.  */
-  if (legacy_frame_p (current_gdbarch) && saved_frame_level < 0)
-    error ("No frame.");
-
   prune_threads ();
   target_find_new_threads ();
   current_ptid = inferior_ptid;
@@ -436,11 +424,7 @@
       else
 	printf_filtered ("  ");
 
-#ifdef HPUXHPPA
       printf_filtered ("%d %s", tp->num, target_tid_to_str (tp->ptid));
-#else
-      printf_filtered ("%d %s", tp->num, target_pid_to_str (tp->ptid));
-#endif
 
       extra_info = target_extra_thread_info (tp);
       if (extra_info)
@@ -448,32 +432,28 @@
       puts_filtered ("  ");
 
       switch_to_thread (tp->ptid);
-      print_stack_frame (get_selected_frame (), -1, 0);
+      print_stack_frame (get_selected_frame (), 0, LOCATION);
     }
 
   switch_to_thread (current_ptid);
 
-  /* Code below copied from "up_silently_base" in "stack.c".
-   * It restores the frame set by the user before the "info threads"
-   * command.  We have finished the info-threads display by switching
-   * back to the current thread.  That switch has put us at the top
-   * of the stack (leaf frame).
-   */
-  counter = saved_frame_level;
-  cur_frame = find_relative_frame (get_selected_frame (), &counter);
-  if (counter != 0)
+  /* Restores the frame set by the user before the "info threads"
+     command.  We have finished the info-threads display by switching
+     back to the current thread.  That switch has put us at the top of
+     the stack (leaf frame).  */
+  cur_frame = frame_find_by_id (saved_frame_id);
+  if (cur_frame == NULL)
     {
-      /* Ooops, can't restore, tell user where we are. */
+      /* Ooops, can't restore, tell user where we are.  */
       warning ("Couldn't restore frame in current thread, at frame 0");
-      print_stack_frame (get_selected_frame (), -1, 0);
+      print_stack_frame (get_selected_frame (), 0, LOCATION);
     }
   else
     {
       select_frame (cur_frame);
+      /* re-show current frame. */
+      show_stack_frame (cur_frame);
     }
-
-  /* re-show current frame. */
-  show_stack_frame (cur_frame);
 }
 
 /* Switch from one thread to another. */
@@ -497,7 +477,7 @@
   if (!ptid_equal (ptid, inferior_ptid))
     {
       switch_to_thread (ptid);
-      print_stack_frame (get_current_frame (), 0, -1);
+      print_stack_frame (get_current_frame (), 1, SRC_LINE);
     }
 }
 
@@ -557,13 +537,8 @@
     if (thread_alive (tp))
       {
 	switch_to_thread (tp->ptid);
-#ifdef HPUXHPPA
 	printf_filtered ("\nThread %d (%s):\n",
 			 tp->num, target_tid_to_str (inferior_ptid));
-#else
-	printf_filtered ("\nThread %d (%s):\n", tp->num,
-			 target_pid_to_str (inferior_ptid));
-#endif
 	execute_command (cmd, from_tty);
 	strcpy (cmd, saved_cmd);	/* Restore exact command used previously */
       }
@@ -633,13 +608,8 @@
 	  else
 	    {
 	      switch_to_thread (tp->ptid);
-#ifdef HPUXHPPA
 	      printf_filtered ("\nThread %d (%s):\n", tp->num,
 			       target_tid_to_str (inferior_ptid));
-#else
-	      printf_filtered ("\nThread %d (%s):\n", tp->num,
-			       target_pid_to_str (inferior_ptid));
-#endif
 	      execute_command (cmd, from_tty);
 	      strcpy (cmd, saved_cmd);	/* Restore exact command used previously */
 	    }
@@ -662,12 +632,7 @@
       if (target_has_stack)
 	printf_filtered ("[Current thread is %d (%s)]\n",
 			 pid_to_thread_id (inferior_ptid),
-#if defined(HPUXHPPA)
-			 target_tid_to_str (inferior_ptid)
-#else
-			 target_pid_to_str (inferior_ptid)
-#endif
-	  );
+			 target_tid_to_str (inferior_ptid));
       else
 	error ("No stack.");
       return;
@@ -697,15 +662,10 @@
   ui_out_text (uiout, "[Switching to thread ");
   ui_out_field_int (uiout, "new-thread-id", pid_to_thread_id (inferior_ptid));
   ui_out_text (uiout, " (");
-#if defined(HPUXHPPA)
   ui_out_text (uiout, target_tid_to_str (inferior_ptid));
-#else
-  ui_out_text (uiout, target_pid_to_str (inferior_ptid));
-#endif
   ui_out_text (uiout, ")]");
 
-  print_stack_frame (deprecated_selected_frame,
-		     frame_relative_level (deprecated_selected_frame), 1);
+  print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC);
   return GDB_RC_OK;
 }
 
diff --git a/gdb/top.c b/gdb/top.c
index d6bdfd0..98e5010 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -193,103 +193,104 @@
    If the UI fails to initialize and it wants GDB to continue
    using the default UI, then it should clear this hook before returning. */
 
-void (*init_ui_hook) (char *argv0);
+void (*deprecated_init_ui_hook) (char *argv0);
 
 /* This hook is called from within gdb's many mini-event loops which could
    steal control from a real user interface's event loop. It returns
    non-zero if the user is requesting a detach, zero otherwise. */
 
-int (*ui_loop_hook) (int);
+int (*deprecated_ui_loop_hook) (int);
 
 /* Called instead of command_loop at top level.  Can be invoked via
    throw_exception().  */
 
-void (*command_loop_hook) (void);
+void (*deprecated_command_loop_hook) (void);
 
 
 /* Called from print_frame_info to list the line we stopped in.  */
 
-void (*print_frame_info_listing_hook) (struct symtab * s, int line,
-				       int stopline, int noerror);
+void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, int line,
+						  int stopline, int noerror);
 /* Replaces most of query.  */
 
-int (*query_hook) (const char *, va_list);
+int (*deprecated_query_hook) (const char *, va_list);
 
 /* Replaces most of warning.  */
 
-void (*warning_hook) (const char *, va_list);
+void (*deprecated_warning_hook) (const char *, va_list);
 
-/* These three functions support getting lines of text from the user.  They
-   are used in sequence.  First readline_begin_hook is called with a text
-   string that might be (for example) a message for the user to type in a
-   sequence of commands to be executed at a breakpoint.  If this function
-   calls back to a GUI, it might take this opportunity to pop up a text
-   interaction window with this message.  Next, readline_hook is called
-   with a prompt that is emitted prior to collecting the user input.
-   It can be called multiple times.  Finally, readline_end_hook is called
-   to notify the GUI that we are done with the interaction window and it
-   can close it. */
+/* These three functions support getting lines of text from the user.
+   They are used in sequence.  First deprecated_readline_begin_hook is
+   called with a text string that might be (for example) a message for
+   the user to type in a sequence of commands to be executed at a
+   breakpoint.  If this function calls back to a GUI, it might take
+   this opportunity to pop up a text interaction window with this
+   message.  Next, deprecated_readline_hook is called with a prompt
+   that is emitted prior to collecting the user input.  It can be
+   called multiple times.  Finally, deprecated_readline_end_hook is
+   called to notify the GUI that we are done with the interaction
+   window and it can close it.  */
 
-void (*readline_begin_hook) (char *, ...);
-char *(*readline_hook) (char *);
-void (*readline_end_hook) (void);
+void (*deprecated_readline_begin_hook) (char *, ...);
+char *(*deprecated_readline_hook) (char *);
+void (*deprecated_readline_end_hook) (void);
 
 /* Called as appropriate to notify the interface of the specified breakpoint
    conditions.  */
 
-void (*create_breakpoint_hook) (struct breakpoint * bpt);
-void (*delete_breakpoint_hook) (struct breakpoint * bpt);
-void (*modify_breakpoint_hook) (struct breakpoint * bpt);
+void (*deprecated_create_breakpoint_hook) (struct breakpoint * bpt);
+void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt);
+void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt);
 
 /* Called as appropriate to notify the interface that we have attached
    to or detached from an already running process. */
 
-void (*attach_hook) (void);
-void (*detach_hook) (void);
+void (*deprecated_attach_hook) (void);
+void (*deprecated_detach_hook) (void);
 
 /* Called during long calculations to allow GUI to repair window damage, and to
    check for stop buttons, etc... */
 
-void (*interactive_hook) (void);
+void (*deprecated_interactive_hook) (void);
 
 /* Called when the registers have changed, as a hint to a GUI
    to minimize window update. */
 
-void (*registers_changed_hook) (void);
+void (*deprecated_registers_changed_hook) (void);
 
 /* Tell the GUI someone changed the register REGNO. -1 means
    that the caller does not know which register changed or
    that several registers have changed (see value_assign). */
-void (*register_changed_hook) (int regno);
+void (*deprecated_register_changed_hook) (int regno);
 
 /* Tell the GUI someone changed LEN bytes of memory at ADDR */
-void (*memory_changed_hook) (CORE_ADDR addr, int len);
+void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len);
 
 /* Called when going to wait for the target.  Usually allows the GUI to run
    while waiting for target events.  */
 
-ptid_t (*target_wait_hook) (ptid_t ptid,
-                            struct target_waitstatus * status);
+ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
+				       struct target_waitstatus * status);
 
 /* Used by UI as a wrapper around command execution.  May do various things
    like enabling/disabling buttons, etc...  */
 
-void (*call_command_hook) (struct cmd_list_element * c, char *cmd,
-			   int from_tty);
+void (*deprecated_call_command_hook) (struct cmd_list_element * c, char *cmd,
+				      int from_tty);
 
 /* Called after a `set' command has finished.  Is only run if the
    `set' command succeeded.  */
 
-void (*set_hook) (struct cmd_list_element * c);
+void (*deprecated_set_hook) (struct cmd_list_element * c);
 
 /* Called when the current thread changes.  Argument is thread id.  */
 
-void (*context_hook) (int id);
+void (*deprecated_context_hook) (int id);
 
 /* Takes control from error ().  Typically used to prevent longjmps out of the
    middle of the GUI.  Usually used in conjunction with a catch routine.  */
 
-NORETURN void (*error_hook) (void) ATTR_NORETURN;
+NORETURN void (*deprecated_error_hook) (void) ATTR_NORETURN;
 
 
 /* One should use catch_errors rather than manipulating these
@@ -737,8 +738,8 @@
 	do_setshow_command (arg, from_tty & caution, c);
       else if (!cmd_func_p (c))
 	error ("That is not a command, just a help topic.");
-      else if (call_command_hook)
-	call_command_hook (c, arg, from_tty & caution);
+      else if (deprecated_call_command_hook)
+	deprecated_call_command_hook (c, arg, from_tty & caution);
       else
 	cmd_func (c, arg, from_tty & caution);
        
@@ -1234,9 +1235,9 @@
 	}
 
       /* Don't use fancy stuff if not talking to stdin.  */
-      if (readline_hook && instream == NULL)
+      if (deprecated_readline_hook && instream == NULL)
 	{
-	  rl = (*readline_hook) (local_prompt);
+	  rl = (*deprecated_readline_hook) (local_prompt);
 	}
       else if (command_editing_p && instream == stdin && ISATTY (instream))
 	{
@@ -1452,7 +1453,7 @@
       /* This is something of a hack.  But there's no reliable way to
          see if a GUI is running.  The `use_windows' variable doesn't
          cut it.  */
-      if (init_ui_hook)
+      if (deprecated_init_ui_hook)
 	s = "A debugging session is active.\nDo you still want to close the debugger?";
       else if (attach_flag)
 	s = "The program is running.  Quit anyway (and detach it)? ";
@@ -1905,8 +1906,9 @@
   set_language (language_c);
   expected_language = current_language;		/* don't warn about the change.  */
 
-  /* Allow another UI to initialize. If the UI fails to initialize, and
-     it wants GDB to revert to the CLI, it should clear init_ui_hook. */
-  if (init_ui_hook)
-    init_ui_hook (argv0);
+  /* Allow another UI to initialize. If the UI fails to initialize,
+     and it wants GDB to revert to the CLI, it should clear
+     deprecated_init_ui_hook.  */
+  if (deprecated_init_ui_hook)
+    deprecated_init_ui_hook (argv0);
 }
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 39c6877..a6d700d 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1,7 +1,7 @@
 /* Tracing functionality for remote targets in custom GDB protocol
 
-   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
-   Foundation, Inc.
+   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -65,9 +65,9 @@
 #define MAX_AGENT_EXPR_LEN	184
 
 
-extern void (*readline_begin_hook) (char *, ...);
-extern char *(*readline_hook) (char *);
-extern void (*readline_end_hook) (void);
+extern void (*deprecated_readline_begin_hook) (char *, ...);
+extern char *(*deprecated_readline_hook) (char *);
+extern void (*deprecated_readline_end_hook) (void);
 extern void x_command (char *, int);
 extern int addressprint;	/* Print machine addresses? */
 
@@ -787,8 +787,8 @@
 
       if (from_tty)
 	{
-	  if (readline_begin_hook)
-	    (*readline_begin_hook) ("%s  %s\n", tmpbuf, end_msg);
+	  if (deprecated_readline_begin_hook)
+	    (*deprecated_readline_begin_hook) ("%s  %s\n", tmpbuf, end_msg);
 	  else if (input_from_terminal_p ())
 	    printf_filtered ("%s\n%s\n", tmpbuf, end_msg);
 	}
@@ -797,8 +797,8 @@
       t->step_count = 0;	/* read_actions may set this */
       read_actions (t);
 
-      if (readline_end_hook)
-	(*readline_end_hook) ();
+      if (deprecated_readline_end_hook)
+	(*deprecated_readline_end_hook) ();
       /* tracepoints_changed () */
     }
   /* else just return */
@@ -842,8 +842,8 @@
       gdb_flush (gdb_stdout);
       gdb_flush (gdb_stderr);
 
-      if (readline_hook && instream == NULL)
-	line = (*readline_hook) (prompt);
+      if (deprecated_readline_hook && instream == NULL)
+	line = (*deprecated_readline_hook) (prompt);
       else if (instream == stdin && ISATTY (instream))
 	{
 	  line = gdb_readline_wrapper (prompt);
@@ -1693,7 +1693,7 @@
 
       anysecs = 1;
       lma = s->lma;
-      size = bfd_get_section_size_before_reloc (s);
+      size = bfd_get_section_size (s);
       sprintf_vma (tmp1, lma);
       sprintf_vma (tmp2, lma + size);
       sprintf (target_buf + strlen (target_buf), 
@@ -1804,8 +1804,8 @@
       set_tracepoint_num (-1);
       set_traceframe_context (-1);
       trace_running_p = 1;
-      if (trace_start_stop_hook)
-	trace_start_stop_hook (1, from_tty);
+      if (deprecated_trace_start_stop_hook)
+	deprecated_trace_start_stop_hook (1, from_tty);
 
     }
   else
@@ -1823,8 +1823,8 @@
       if (strcmp (target_buf, "OK"))
 	error ("Bogus reply from target: %s", target_buf);
       trace_running_p = 0;
-      if (trace_start_stop_hook)
-	trace_start_stop_hook (0, from_tty);
+      if (deprecated_trace_start_stop_hook)
+	deprecated_trace_start_stop_hook (0, from_tty);
     }
   else
     error ("Trace can only be run on remote targets.");
@@ -1935,7 +1935,7 @@
 
   if (from_tty)
     {
-      int source_only;
+      enum print_what print_what;
 
       /* NOTE: in immitation of the step command, try to determine
          whether we have made a transition from one function to another.
@@ -1951,13 +1951,11 @@
 	  (old_frame_addr == 0 ||
 	   get_frame_base (get_current_frame ()) == 0 ||
 	   old_frame_addr == get_frame_base (get_current_frame ())))
-	source_only = -1;
+	print_what = SRC_LINE;
       else
-	source_only = 1;
+	print_what = SRC_AND_LOC;
 
-      print_stack_frame (deprecated_selected_frame,
-			 frame_relative_level (deprecated_selected_frame),
-			 source_only);
+      print_stack_frame (get_selected_frame (), 1, print_what);
       do_displays ();
     }
 }
@@ -1985,8 +1983,8 @@
 
   if (target_is_remote ())
     {
-      if (trace_find_hook)
-	trace_find_hook (args, from_tty);
+      if (deprecated_trace_find_hook)
+	deprecated_trace_find_hook (args, from_tty);
 
       if (args == 0 || *args == 0)
 	{			/* TFIND with no args means find NEXT trace frame. */
@@ -2347,7 +2345,7 @@
 
   sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL);
   if (sals.nelts == 0)
-    return;			/* presumably decode_line_1 has already warned */
+    return;		/* presumably decode_line_1 has already warned */
 
   /* Resolve line numbers to PC */
   resolve_sal_pc (&sals.sals[0]);
@@ -2389,7 +2387,8 @@
 	      break;
 	    case LOC_STATIC:
 	      printf_filtered ("in static storage at address ");
-	      print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 1, gdb_stdout);
+	      print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 
+				     1, gdb_stdout);
 	      break;
 	    case LOC_REGISTER:
 	      printf_filtered ("a local variable in register $%s",
@@ -2421,12 +2420,13 @@
 	      continue;
 	    case LOC_LABEL:
 	      printf_filtered ("a label at address ");
-	      print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 1, gdb_stdout);
+	      print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 
+				     1, gdb_stdout);
 	      break;
 	    case LOC_BLOCK:
 	      printf_filtered ("a function at address ");
-	      print_address_numeric (BLOCK_START (SYMBOL_BLOCK_VALUE (sym)), 1,
-				     gdb_stdout);
+	      print_address_numeric (BLOCK_START (SYMBOL_BLOCK_VALUE (sym)),
+				     1, gdb_stdout);
 	      break;
 	    case LOC_BASEREG:
 	      printf_filtered ("a variable at offset %ld from register $%s",
@@ -2439,7 +2439,8 @@
 			       REGISTER_NAME (SYMBOL_BASEREG (sym)));
 	      break;
 	    case LOC_UNRESOLVED:
-	      msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), NULL, NULL);
+	      msym = lookup_minimal_symbol (DEPRECATED_SYMBOL_NAME (sym), 
+					    NULL, NULL);
 	      if (msym == NULL)
 		printf_filtered ("Unresolved Static");
 	      else
@@ -2452,10 +2453,22 @@
 	    case LOC_OPTIMIZED_OUT:
 	      printf_filtered ("optimized out.\n");
 	      continue;
+	    case LOC_HP_THREAD_LOCAL_STATIC:
+	      printf_filtered ("HP thread local static ");
+	      break;
+	    case LOC_INDIRECT:
+	      printf_filtered ("extern (local indirect) at address ");
+	      print_address_numeric (SYMBOL_VALUE_ADDRESS (sym), 
+				     1, gdb_stdout);
+	      break;
+	    case LOC_COMPUTED:
+	    case LOC_COMPUTED_ARG:
+	      SYMBOL_OPS (sym)->describe_location (sym, gdb_stdout);
+	      break;
 	    }
 	  if (SYMBOL_TYPE (sym))
 	    printf_filtered (", length %d.\n",
-			   TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
+			     TYPE_LENGTH (check_typedef (SYMBOL_TYPE (sym))));
 	}
       if (BLOCK_FUNCTION (block))
 	break;
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
index c464ae1..280d36c 100644
--- a/gdb/tracepoint.h
+++ b/gdb/tracepoint.h
@@ -109,11 +109,11 @@
 
 /* A hook used to notify the UI of tracepoint operations */
 
-void (*create_tracepoint_hook) (struct tracepoint *);
-void (*delete_tracepoint_hook) (struct tracepoint *);
-void (*modify_tracepoint_hook) (struct tracepoint *);
-void (*trace_find_hook) (char *arg, int from_tty);
-void (*trace_start_stop_hook) (int start, int from_tty);
+void (*deprecated_create_tracepoint_hook) (struct tracepoint *);
+void (*deprecated_delete_tracepoint_hook) (struct tracepoint *);
+void (*deprecated_modify_tracepoint_hook) (struct tracepoint *);
+void (*deprecated_trace_find_hook) (char *arg, int from_tty);
+void (*deprecated_trace_start_stop_hook) (int start, int from_tty);
 
 struct tracepoint *get_tracepoint_by_number (char **, int, int);
 int get_traceframe_number (void);
diff --git a/gdb/trad-frame.h b/gdb/trad-frame.h
index 194f39a..51f3a0e 100644
--- a/gdb/trad-frame.h
+++ b/gdb/trad-frame.h
@@ -42,6 +42,8 @@
 
 void trad_frame_set_reg_unknown (struct trad_frame_cache *this_trad_cache,
 				 int regnum, CORE_ADDR addr);
+void trad_frame_set_reg_addr (struct trad_frame_cache *this_trad_cache,
+			      int regnum, CORE_ADDR addr);
 void trad_frame_get_register (struct trad_frame_cache *this_trad_cache,
 			      struct frame_info *next_frame,
 			      int regnum, int *optimizedp,
diff --git a/gdb/tramp-frame.c b/gdb/tramp-frame.c
index 7a8057e..6ea2e3f 100644
--- a/gdb/tramp-frame.c
+++ b/gdb/tramp-frame.c
@@ -28,6 +28,7 @@
 #include "target.h"
 #include "trad-frame.h"
 #include "frame-base.h"
+#include "gdb_assert.h"
 
 struct frame_data
 {
@@ -84,23 +85,25 @@
 }
 
 static CORE_ADDR
-tramp_frame_start (CORE_ADDR pc, const struct tramp_frame *tramp)
+tramp_frame_start (const struct tramp_frame *tramp,
+		   struct frame_info *next_frame, CORE_ADDR pc)
 {
   int ti;
   /* Search through the trampoline for one that matches the
      instruction sequence around PC.  */
-  for (ti = 0; tramp->insn[ti] != 0; ti++)
+  for (ti = 0; tramp->insn[ti] != TRAMP_SENTINEL_INSN; ti++)
     {
       CORE_ADDR func = pc - tramp->insn_size * ti;
       int i;
       for (i = 0; 1; i++)
 	{
-	  bfd_byte buf[sizeof (LONGEST)];
-	  CORE_ADDR insn;
-	  if (tramp->insn[i] == 0)
+	  bfd_byte buf[sizeof (tramp->insn[0])];
+	  ULONGEST insn;
+	  if (tramp->insn[i] == TRAMP_SENTINEL_INSN)
 	    return func;
-	  if (target_read_memory (func + i * tramp->insn_size, buf,
-				  tramp->insn_size) != 0)
+	  if (!safe_frame_unwind_memory (next_frame,
+					 func + i * tramp->insn_size,
+					 buf, tramp->insn_size))
 	    break;
 	  insn = extract_unsigned_integer (buf, tramp->insn_size);
 	  if (tramp->insn[i] != insn)
@@ -132,7 +135,7 @@
   if (find_pc_section (pc) != NULL)
     return 0;
   /* Finally, check that the trampoline matches at PC.  */
-  func = tramp_frame_start (pc, tramp);
+  func = tramp_frame_start (tramp, next_frame, pc);
   if (func == 0)
     return 0;
   tramp_cache = FRAME_OBSTACK_ZALLOC (struct tramp_frame_cache);
@@ -143,11 +146,21 @@
 }
 
 void
-tramp_frame_append (struct gdbarch *gdbarch,
-		    const struct tramp_frame *tramp_frame)
+tramp_frame_prepend_unwinder (struct gdbarch *gdbarch,
+			      const struct tramp_frame *tramp_frame)
 {
   struct frame_data *data;
   struct frame_unwind *unwinder;
+  int i;
+
+  /* Check that the instruction sequence contains a sentinel.  */
+  for (i = 0; i < ARRAY_SIZE (tramp_frame->insn); i++)
+    {
+      if (tramp_frame->insn[i] == TRAMP_SENTINEL_INSN)
+	break;
+    }
+  gdb_assert (i < ARRAY_SIZE (tramp_frame->insn));
+  gdb_assert (tramp_frame->insn_size <= sizeof (tramp_frame->insn[0]));
 
   data = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct frame_data);
   unwinder = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct frame_unwind);
@@ -158,5 +171,5 @@
   unwinder->sniffer = tramp_frame_sniffer;
   unwinder->this_id = tramp_frame_this_id;
   unwinder->prev_register = tramp_frame_prev_register;
-  frame_unwind_register_unwinder (gdbarch, unwinder);
+  frame_unwind_prepend_unwinder (gdbarch, unwinder);
 }
diff --git a/gdb/tramp-frame.h b/gdb/tramp-frame.h
index 44e266e..26d4178 100644
--- a/gdb/tramp-frame.h
+++ b/gdb/tramp-frame.h
@@ -39,6 +39,10 @@
 
 /* A trampoline descriptor.  */
 
+/* Magic instruction that to mark the end of the signal trampoline
+   instruction sequence.  */
+#define TRAMP_SENTINEL_INSN ((LONGEST) -1)
+
 struct tramp_frame
 {
   /* The trampoline's entire instruction sequence.  Search for this in
@@ -47,7 +51,8 @@
      one INSN_SIZE instruction.  It is also assumed that TRAMP[0]
      contains the first instruction of the trampoline and hence the
      address of the instruction matching TRAMP[0] is the trampoline's
-     "func" address.  */
+     "func" address.  The instruction sequence shall be terminated by
+     TRAMP_SENTINEL_INSN.  */
   int insn_size;
   ULONGEST insn[8];
   /* Initialize a trad-frame cache corresponding to the tramp-frame.
@@ -58,7 +63,7 @@
 		CORE_ADDR func);
 };
 
-void tramp_frame_append (struct gdbarch *gdbarch,
-			 const struct tramp_frame *tramp);
+void tramp_frame_prepend_unwinder (struct gdbarch *gdbarch,
+				   const struct tramp_frame *tramp);
 
 #endif
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index a864be2..64bcb99 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -35,7 +35,6 @@
 #include "gdb-events.h"
 #include "ui-out.h"
 #include "top.h"
-#include "readline/readline.h"
 #include <unistd.h>
 #include <fcntl.h>
 
@@ -52,6 +51,11 @@
 
 #include "gdb_curses.h"
 
+/* This redefines CTRL if it is not already defined, so it must come
+   after terminal state releated include files like <term.h> and
+   "gdb_curses.h".  */
+#include "readline/readline.h"
+
 int tui_target_has_run = 0;
 
 static void (* tui_target_new_objfile_chain) (struct objfile*);
@@ -123,7 +127,7 @@
   return retval;
 }
 
-/* Prevent recursion of registers_changed_hook().  */
+/* Prevent recursion of deprecated_registers_changed_hook().  */
 static int tui_refreshing_registers = 0;
 
 static void
@@ -279,34 +283,34 @@
 void
 tui_install_hooks (void)
 {
-  target_wait_hook = tui_target_wait_hook;
-  selected_frame_level_changed_hook = tui_selected_frame_level_changed_hook;
-  print_frame_info_listing_hook = tui_print_frame_info_listing_hook;
+  deprecated_target_wait_hook = tui_target_wait_hook;
+  deprecated_selected_frame_level_changed_hook = tui_selected_frame_level_changed_hook;
+  deprecated_print_frame_info_listing_hook = tui_print_frame_info_listing_hook;
 
-  query_hook = tui_query_hook;
+  deprecated_query_hook = tui_query_hook;
 
   /* Install the event hooks.  */
-  tui_old_event_hooks = set_gdb_event_hooks (&tui_event_hooks);
+  tui_old_event_hooks = deprecated_set_gdb_event_hooks (&tui_event_hooks);
 
-  registers_changed_hook = tui_registers_changed_hook;
-  register_changed_hook = tui_register_changed_hook;
-  detach_hook = tui_detach_hook;
+  deprecated_registers_changed_hook = tui_registers_changed_hook;
+  deprecated_register_changed_hook = tui_register_changed_hook;
+  deprecated_detach_hook = tui_detach_hook;
 }
 
 /* Remove the TUI specific hooks.  */
 void
 tui_remove_hooks (void)
 {
-  target_wait_hook = 0;
-  selected_frame_level_changed_hook = 0;
-  print_frame_info_listing_hook = 0;
-  query_hook = 0;
-  registers_changed_hook = 0;
-  register_changed_hook = 0;
-  detach_hook = 0;
+  deprecated_target_wait_hook = 0;
+  deprecated_selected_frame_level_changed_hook = 0;
+  deprecated_print_frame_info_listing_hook = 0;
+  deprecated_query_hook = 0;
+  deprecated_registers_changed_hook = 0;
+  deprecated_register_changed_hook = 0;
+  deprecated_detach_hook = 0;
 
   /* Restore the previous event hooks.  */
-  set_gdb_event_hooks (tui_old_event_hooks);
+  deprecated_set_gdb_event_hooks (tui_old_event_hooks);
 }
 
 void _initialize_tui_hooks (void);
@@ -315,6 +319,6 @@
 _initialize_tui_hooks (void)
 {
   /* Install the permanent hooks.  */
-  tui_target_new_objfile_chain = target_new_objfile_hook;
-  target_new_objfile_hook = tui_new_objfile_hook;
+  tui_target_new_objfile_chain = deprecated_target_new_objfile_hook;
+  deprecated_target_new_objfile_hook = tui_new_objfile_hook;
 }
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index addb3b0..07926d9 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -29,7 +29,6 @@
 #include "event-top.h"
 #include "command.h"
 #include "top.h"
-#include "readline/readline.h"
 #include "tui/tui.h"
 #include "tui/tui-data.h"
 #include "tui/tui-io.h"
@@ -45,6 +44,11 @@
 
 #include "gdb_curses.h"
 
+/* This redefines CTRL if it is not already defined, so it must come
+   after terminal state releated include files like <term.h> and
+   "gdb_curses.h".  */
+#include "readline/readline.h"
+
 int
 key_is_start_sequence (int ch)
 {
@@ -599,8 +603,8 @@
   tui_stderr = tui_fileopen (stderr);
   tui_out = tui_out_new (tui_stdout);
 
-  /* Create the default UI.  It is not created because we installed
-     a init_ui_hook.  */
+  /* Create the default UI.  It is not created because we installed a
+     deprecated_init_ui_hook.  */
   tui_old_uiout = uiout = cli_out_new (gdb_stdout);
 
 #ifdef TUI_USE_PIPE_FOR_READLINE
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index c0eab97..abb92a4 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -148,8 +148,17 @@
 tui_show_registers (struct reggroup *group)
 {
   enum tui_status ret = TUI_FAILURE;
-  struct tui_data_info *display_info = &TUI_DATA_WIN->detail.data_display_info;
+  struct tui_data_info *display_info;
 
+  /* Make sure the curses mode is enabled.  */
+  tui_enable ();
+
+  /* Make sure the register window is visible.  If not, select an
+     appropriate layout.  */
+  if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->generic.is_visible)
+    tui_set_layout_for_display_command (DATA_NAME);
+
+  display_info = &TUI_DATA_WIN->detail.data_display_info;
   if (group == 0)
     group = general_reggroup;
 
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index d6f344f..d88998a 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -58,7 +58,7 @@
 
 /* This redefines CTRL if it is not already defined, so it must come
    after terminal state releated include files like <term.h> and
-   "gdb_ncurses.h".  */
+   "gdb_curses.h".  */
 #include "readline/readline.h"
 
 /* Tells whether the TUI is active or not.  */
diff --git a/gdb/utils.c b/gdb/utils.c
index 3bc5fed..409e0bc 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -83,7 +83,7 @@
 /* readline defines this.  */
 #undef savestring
 
-void (*error_begin_hook) (void);
+void (*deprecated_error_begin_hook) (void);
 
 /* Holds the last error message issued by gdb */
 
@@ -566,8 +566,8 @@
 void
 vwarning (const char *string, va_list args)
 {
-  if (warning_hook)
-    (*warning_hook) (string, args);
+  if (deprecated_warning_hook)
+    (*deprecated_warning_hook) (string, args);
   else
     {
       target_terminal_ours ();
@@ -659,8 +659,8 @@
 NORETURN void
 error_stream (struct ui_file *stream)
 {
-  if (error_begin_hook)
-    error_begin_hook ();
+  if (deprecated_error_begin_hook)
+    deprecated_error_begin_hook ();
 
   /* Copy the stream into the GDB_LASTERR buffer.  */
   ui_file_rewind (gdb_lasterr);
@@ -752,8 +752,8 @@
      so that the user knows that they are living on the edge.  */
   {
     char *msg;
-    xvasprintf (&msg, fmt, ap);
-    xasprintf (&reason, "\
+    msg = xstrvprintf (fmt, ap);
+    reason = xstrprintf ("\
 %s:%d: %s: %s\n\
 A problem internal to GDB has been detected,\n\
 further debugging may prove unreliable.", file, line, problem->name, msg);
@@ -1156,7 +1156,7 @@
   char *ret;
   va_list args;
   va_start (args, format);
-  xvasprintf (&ret, format, args);
+  ret = xstrvprintf (format, args);
   va_end (args);
   return ret;
 }
@@ -1166,7 +1166,7 @@
 {
   va_list args;
   va_start (args, format);
-  xvasprintf (ret, format, args);
+  (*ret) = xstrvprintf (format, args);
   va_end (args);
 }
 
@@ -1186,6 +1186,21 @@
 		    "vasprintf call failed (errno %d)", errno);
 }
 
+char *
+xstrvprintf (const char *format, va_list ap)
+{
+  char *ret = NULL;
+  int status = vasprintf (&ret, format, ap);
+  /* NULL is returned when there was a memory allocation problem.  */
+  if (ret == NULL)
+    nomem (0);
+  /* A negative status (the printed length) with a non-NULL buffer
+     should never happen, but just to be sure.  */
+  if (status < 0)
+    internal_error (__FILE__, __LINE__,
+		    "vasprintf call failed (errno %d)", errno);
+  return ret;
+}
 
 /* My replacement for the read system call.
    Used like `read' but keeps going if `read' returns too soon.  */
@@ -1270,11 +1285,10 @@
   int ans2;
   int retval;
 
-  va_start (args, ctlstr);
-
-  if (query_hook)
+  if (deprecated_query_hook)
     {
-      return query_hook (ctlstr, args);
+      va_start (args, ctlstr);
+      return deprecated_query_hook (ctlstr, args);
     }
 
   /* Automatically answer "yes" if input is not from a terminal.  */
@@ -1289,7 +1303,9 @@
       if (annotation_level > 1)
 	printf_filtered ("\n\032\032pre-query\n");
 
+      va_start (args, ctlstr);
       vfprintf_filtered (gdb_stdout, ctlstr, args);
+      va_end (args);
       printf_filtered ("(y or n) ");
 
       if (annotation_level > 1)
@@ -1372,9 +1388,9 @@
       n_string = "[n]";
     }
 
-  if (query_hook)
+  if (deprecated_query_hook)
     {
-      return query_hook (ctlstr, args);
+      return deprecated_query_hook (ctlstr, args);
     }
 
   /* Automatically answer default value if input is not from a terminal.  */
@@ -1387,13 +1403,13 @@
       gdb_flush (gdb_stdout);
 
       if (annotation_level > 1)
-	printf_filtered ("\n\032\032pre-%cquery\n", defchar);
+	printf_filtered ("\n\032\032pre-query\n");
 
       vfprintf_filtered (gdb_stdout, ctlstr, args);
       printf_filtered ("(%s or %s) ", y_string, n_string);
 
       if (annotation_level > 1)
-	printf_filtered ("\n\032\032%cquery\n", defchar);
+	printf_filtered ("\n\032\032query\n");
 
       wrap_here ("");
       gdb_flush (gdb_stdout);
@@ -1437,7 +1453,7 @@
     }
 
   if (annotation_level > 1)
-    printf_filtered ("\n\032\032post-%cquery\n", defchar);
+    printf_filtered ("\n\032\032post-query\n");
   return retval;
 }
 
@@ -2259,7 +2275,7 @@
   char *linebuffer;
   struct cleanup *old_cleanups;
 
-  xvasprintf (&linebuffer, format, args);
+  linebuffer = xstrvprintf (format, args);
   old_cleanups = make_cleanup (xfree, linebuffer);
   fputs_maybe_filtered (linebuffer, stream, filter);
   do_cleanups (old_cleanups);
@@ -2278,7 +2294,7 @@
   char *linebuffer;
   struct cleanup *old_cleanups;
 
-  xvasprintf (&linebuffer, format, args);
+  linebuffer = xstrvprintf (format, args);
   old_cleanups = make_cleanup (xfree, linebuffer);
   fputs_unfiltered (linebuffer, stream);
   do_cleanups (old_cleanups);
diff --git a/gdb/uw-thread.c b/gdb/uw-thread.c
index cc6ed6d..c37e0ff 100644
--- a/gdb/uw-thread.c
+++ b/gdb/uw-thread.c
@@ -206,7 +206,8 @@
    they lack current_target's default callbacks. */
 static struct target_ops base_ops;
 
-/* Saved pointer to previous owner of target_new_objfile_hook. */
+/* Saved pointer to previous owner of
+   deprecated_target_new_objfile_hook.  */
 static void (*target_new_objfile_chain)(struct objfile *);
 
 /* Whether we are debugging a user-space thread program.  This isn't
@@ -796,12 +797,13 @@
    This function only gets called with uw_thread_active == 0. */
 
 static void
-uw_thread_create_inferior (char *exec_file, char *allargs, char **env)
+uw_thread_create_inferior (char *exec_file, char *allargs, char **env,
+			   int from_tty)
 {
   if (uw_thread_active)
     deactivate_uw_thread ();
 
-  procfs_ops.to_create_inferior (exec_file, allargs, env);
+  procfs_ops.to_create_inferior (exec_file, allargs, env, from_tty);
   if (uw_thread_active)
     {
       find_main ();
@@ -1000,7 +1002,7 @@
   deactivate_uw_thread ();
 }
 
-/* target_new_objfile_hook callback.
+/* deprecated_target_new_objfile_hook callback.
 
    If OBJFILE is non-null, check whether libthread.so was just loaded,
    and if so, prepare for user-mode thread debugging.
@@ -1062,6 +1064,6 @@
   procfs_suppress_run = 1;
 
   /* Notice when libthread.so gets loaded. */
-  target_new_objfile_chain = target_new_objfile_hook;
-  target_new_objfile_hook = uw_thread_new_objfile;
+  target_new_objfile_chain = deprecated_target_new_objfile_hook;
+  deprecated_target_new_objfile_hook = uw_thread_new_objfile;
 }
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 948143c..4ca2624 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -797,8 +797,7 @@
 v850_find_callers_reg (struct frame_info *fi, int regnum)
 {
   for (; fi; fi = get_next_frame (fi))
-    if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				     get_frame_base (fi)))
+    if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
       return deprecated_read_register_dummy (get_frame_pc (fi),
 					     get_frame_base (fi), regnum);
     else if (deprecated_get_frame_saved_regs (fi)[regnum] != 0)
@@ -825,7 +824,7 @@
   callers_pc = DEPRECATED_FRAME_SAVED_PC (fi);
   /* If caller is a call-dummy, then our FP bears no relation to his FP! */
   fp = v850_find_callers_reg (fi, E_FP_RAW_REGNUM);
-  if (DEPRECATED_PC_IN_CALL_DUMMY (callers_pc, fp, fp))
+  if (deprecated_pc_in_call_dummy (callers_pc))
     return fp;			/* caller is call-dummy: return oldest value of FP */
 
   /* Caller is NOT a call-dummy, so everything else should just work.
@@ -882,9 +881,7 @@
   struct frame_info *frame = get_current_frame ();
   int regnum;
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
-				   get_frame_base (frame),
-				   get_frame_base (frame)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (frame)))
     deprecated_pop_dummy_frame ();
   else
     {
@@ -1010,8 +1007,7 @@
 static CORE_ADDR
 v850_frame_saved_pc (struct frame_info *fi)
 {
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				   get_frame_base (fi)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
     return deprecated_read_register_dummy (get_frame_pc (fi),
 					   get_frame_base (fi), E_PC_REGNUM);
   else
@@ -1019,27 +1015,6 @@
 }
 
 
-/* Function: fix_call_dummy
-   Pokes the callee function's address into the CALL_DUMMY assembly stub.
-   Assumes that the CALL_DUMMY looks like this:
-   jarl <offset24>, r31
-   trap
- */
-
-static void
-v850_fix_call_dummy (char *dummy, CORE_ADDR sp, CORE_ADDR fun, int nargs,
-		     struct value **args, struct type *type, int gcc_p)
-{
-  long offset24;
-
-  offset24 = (long) fun - (long) entry_point_address ();
-  offset24 &= 0x3fffff;
-  offset24 |= 0xff800000;	/* jarl <offset24>, r31 */
-
-  store_unsigned_integer ((unsigned int *) &dummy[2], 2, offset24 & 0xffff);
-  store_unsigned_integer ((unsigned int *) &dummy[0], 2, offset24 >> 16);
-}
-
 static CORE_ADDR
 v850_saved_pc_after_call (struct frame_info *ignore)
 {
@@ -1107,8 +1082,7 @@
 
       /* The call dummy doesn't save any registers on the stack, so we
          can return now.  */
-      if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				       get_frame_base (fi)))
+      if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
 	return;
 
       /* Find the beginning of this function, so we can analyze its
@@ -1175,7 +1149,6 @@
 static struct gdbarch *
 v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
-  static LONGEST call_dummy_words[1] = { 0 };
   struct gdbarch_tdep *tdep = NULL;
   struct gdbarch *gdbarch;
   int i;
@@ -1221,9 +1194,7 @@
   set_gdbarch_deprecated_register_bytes (gdbarch, E_ALL_REGS_SIZE);
   set_gdbarch_deprecated_register_byte (gdbarch, v850_register_byte);
   set_gdbarch_deprecated_register_raw_size (gdbarch, v850_register_raw_size);
-  set_gdbarch_deprecated_max_register_raw_size (gdbarch, v850_reg_size);
   set_gdbarch_deprecated_register_virtual_size (gdbarch, v850_register_raw_size);
-  set_gdbarch_deprecated_max_register_virtual_size (gdbarch, v850_reg_size);
   set_gdbarch_deprecated_register_virtual_type (gdbarch, v850_reg_virtual_type);
 
   set_gdbarch_deprecated_target_read_fp (gdbarch, v850_target_read_fp);
@@ -1254,10 +1225,7 @@
   set_gdbarch_deprecated_pop_frame (gdbarch, v850_pop_frame);
   set_gdbarch_deprecated_store_struct_return (gdbarch, v850_store_struct_return);
   set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value);
-  set_gdbarch_use_struct_convention (gdbarch, v850_use_struct_convention);
-  set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_nil);
-  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
-  set_gdbarch_deprecated_fix_call_dummy (gdbarch, v850_fix_call_dummy);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, v850_use_struct_convention);
   set_gdbarch_breakpoint_from_pc (gdbarch, v850_breakpoint_from_pc);
 
   set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
diff --git a/gdb/v850ice.c b/gdb/v850ice.c
index 9f516a3..44a8f1d 100644
--- a/gdb/v850ice.c
+++ b/gdb/v850ice.c
@@ -50,8 +50,6 @@
 /* Prototypes for functions located in other files */
 extern void break_command (char *, int);
 
-extern int (*ui_loop_hook) (int);
-
 /* Prototypes for local functions */
 static int init_hidden_window (void);
 
@@ -443,7 +441,7 @@
     {
       if (count++ % 100000)
 	{
-	  ui_loop_hook (0);
+	  deprecated_ui_loop_hook (0);
 	  count = 0;
 	}
 
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 03282ea..7858f91 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -1,7 +1,7 @@
 /* Perform arithmetic and other operations on values, for GDB.
 
    Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
    Foundation, Inc.
 
    This file is part of GDB.
@@ -91,16 +91,15 @@
   LONGEST sz;
   struct type *type1, *type2, *valptrtype;
 
-  COERCE_NUMBER (arg1);
-  COERCE_NUMBER (arg2);
+  COERCE_ARRAY (arg1);
+  COERCE_ARRAY (arg2);
   type1 = check_typedef (VALUE_TYPE (arg1));
   type2 = check_typedef (VALUE_TYPE (arg2));
 
   if ((TYPE_CODE (type1) == TYPE_CODE_PTR
        || TYPE_CODE (type2) == TYPE_CODE_PTR)
       &&
-      (TYPE_CODE (type1) == TYPE_CODE_INT
-       || TYPE_CODE (type2) == TYPE_CODE_INT))
+      (is_integral_type (type1) || is_integral_type (type2)))
     /* Exactly one argument is a pointer, and one is an integer.  */
     {
       struct value *retval;
@@ -134,14 +133,14 @@
 value_sub (struct value *arg1, struct value *arg2)
 {
   struct type *type1, *type2;
-  COERCE_NUMBER (arg1);
-  COERCE_NUMBER (arg2);
+  COERCE_ARRAY (arg1);
+  COERCE_ARRAY (arg2);
   type1 = check_typedef (VALUE_TYPE (arg1));
   type2 = check_typedef (VALUE_TYPE (arg2));
 
   if (TYPE_CODE (type1) == TYPE_CODE_PTR)
     {
-      if (TYPE_CODE (type2) == TYPE_CODE_INT)
+      if (is_integral_type (type2))
 	{
 	  /* pointer - integer.  */
 	  LONGEST sz = find_size_for_pointer_math (type1);
@@ -752,22 +751,12 @@
 
   COERCE_REF (arg1);
   COERCE_REF (arg2);
-  COERCE_ENUM (arg1);
-  COERCE_ENUM (arg2);
   type1 = check_typedef (VALUE_TYPE (arg1));
   type2 = check_typedef (VALUE_TYPE (arg2));
 
-  if ((TYPE_CODE (type1) != TYPE_CODE_FLT
-       && TYPE_CODE (type1) != TYPE_CODE_CHAR
-       && TYPE_CODE (type1) != TYPE_CODE_INT
-       && TYPE_CODE (type1) != TYPE_CODE_BOOL
-       && TYPE_CODE (type1) != TYPE_CODE_RANGE)
+  if ((TYPE_CODE (type1) != TYPE_CODE_FLT && !is_integral_type (type1))
       ||
-      (TYPE_CODE (type2) != TYPE_CODE_FLT
-       && TYPE_CODE (type2) != TYPE_CODE_CHAR
-       && TYPE_CODE (type2) != TYPE_CODE_INT
-       && TYPE_CODE (type2) != TYPE_CODE_BOOL
-       && TYPE_CODE (type2) != TYPE_CODE_RANGE))
+      (TYPE_CODE (type2) != TYPE_CODE_FLT && !is_integral_type (type2)))
     error ("Argument to arithmetic operation not a number or boolean.");
 
   if (TYPE_CODE (type1) == TYPE_CODE_FLT
@@ -1051,7 +1040,10 @@
 	      break;
 
 	    case BINOP_DIV:
-	      v = v1 / v2;
+	      if (v2 != 0)
+		v = v1 / v2;
+	      else
+		error ("Division by zero");
               break;
 
             case BINOP_EXP:
@@ -1061,7 +1053,10 @@
 	      break;
 
 	    case BINOP_REM:
-	      v = v1 % v2;
+	      if (v2 != 0)
+		v = v1 % v2;
+	      else
+		error ("Division by zero");
 	      break;
 
 	    case BINOP_MOD:
@@ -1221,28 +1216,30 @@
   struct type *type1, *type2;
   enum type_code code1;
   enum type_code code2;
+  int is_int1, is_int2;
 
-  COERCE_NUMBER (arg1);
-  COERCE_NUMBER (arg2);
+  COERCE_ARRAY (arg1);
+  COERCE_ARRAY (arg2);
 
   type1 = check_typedef (VALUE_TYPE (arg1));
   type2 = check_typedef (VALUE_TYPE (arg2));
   code1 = TYPE_CODE (type1);
   code2 = TYPE_CODE (type2);
+  is_int1 = is_integral_type (type1);
+  is_int2 = is_integral_type (type2);
 
-  if ((code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL) &&
-      (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
+  if (is_int1 && is_int2)
     return longest_to_int (value_as_long (value_binop (arg1, arg2,
 						       BINOP_EQUAL)));
-  else if ((code1 == TYPE_CODE_FLT || code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL)
-	   && (code2 == TYPE_CODE_FLT || code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
+  else if ((code1 == TYPE_CODE_FLT || is_int1)
+	   && (code2 == TYPE_CODE_FLT || is_int2))
     return value_as_double (arg1) == value_as_double (arg2);
 
   /* FIXME: Need to promote to either CORE_ADDR or LONGEST, whichever
      is bigger.  */
-  else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
+  else if (code1 == TYPE_CODE_PTR && is_int2)
     return value_as_address (arg1) == (CORE_ADDR) value_as_long (arg2);
-  else if (code2 == TYPE_CODE_PTR && (code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL))
+  else if (code2 == TYPE_CODE_PTR && is_int1)
     return (CORE_ADDR) value_as_long (arg1) == value_as_address (arg2);
 
   else if (code1 == code2
@@ -1278,30 +1275,32 @@
   enum type_code code1;
   enum type_code code2;
   struct type *type1, *type2;
+  int is_int1, is_int2;
 
-  COERCE_NUMBER (arg1);
-  COERCE_NUMBER (arg2);
+  COERCE_ARRAY (arg1);
+  COERCE_ARRAY (arg2);
 
   type1 = check_typedef (VALUE_TYPE (arg1));
   type2 = check_typedef (VALUE_TYPE (arg2));
   code1 = TYPE_CODE (type1);
   code2 = TYPE_CODE (type2);
+  is_int1 = is_integral_type (type1);
+  is_int2 = is_integral_type (type2);
 
-  if ((code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL) &&
-      (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
+  if (is_int1 && is_int2)
     return longest_to_int (value_as_long (value_binop (arg1, arg2,
 						       BINOP_LESS)));
-  else if ((code1 == TYPE_CODE_FLT || code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL)
-	   && (code2 == TYPE_CODE_FLT || code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
+  else if ((code1 == TYPE_CODE_FLT || is_int1)
+	   && (code2 == TYPE_CODE_FLT || is_int2))
     return value_as_double (arg1) < value_as_double (arg2);
   else if (code1 == TYPE_CODE_PTR && code2 == TYPE_CODE_PTR)
     return value_as_address (arg1) < value_as_address (arg2);
 
   /* FIXME: Need to promote to either CORE_ADDR or LONGEST, whichever
      is bigger.  */
-  else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT || code2 == TYPE_CODE_BOOL))
+  else if (code1 == TYPE_CODE_PTR && is_int2)
     return value_as_address (arg1) < (CORE_ADDR) value_as_long (arg2);
-  else if (code2 == TYPE_CODE_PTR && (code1 == TYPE_CODE_INT || code1 == TYPE_CODE_BOOL))
+  else if (code2 == TYPE_CODE_PTR && is_int1)
     return (CORE_ADDR) value_as_long (arg1) < value_as_address (arg2);
   else if (code1 == TYPE_CODE_STRING && code2 == TYPE_CODE_STRING)
     return value_strcmp (arg1, arg2) < 0;
@@ -1321,13 +1320,12 @@
   struct type *result_type = VALUE_TYPE (arg1);
 
   COERCE_REF (arg1);
-  COERCE_ENUM (arg1);
 
   type = check_typedef (VALUE_TYPE (arg1));
 
   if (TYPE_CODE (type) == TYPE_CODE_FLT)
     return value_from_double (result_type, -value_as_double (arg1));
-  else if (TYPE_CODE (type) == TYPE_CODE_INT || TYPE_CODE (type) == TYPE_CODE_BOOL)
+  else if (is_integral_type (type))
     {
       /* Perform integral promotion for ANSI C/C++.  FIXME: What about
          FORTRAN and (the deleted) chill ?  */
@@ -1348,15 +1346,12 @@
 {
   struct type *type;
   struct type *result_type = VALUE_TYPE (arg1);
-  int typecode;
 
   COERCE_REF (arg1);
-  COERCE_ENUM (arg1);
 
   type = check_typedef (VALUE_TYPE (arg1));
 
-  typecode = TYPE_CODE (type);
-  if ((typecode != TYPE_CODE_INT) && (typecode != TYPE_CODE_BOOL))
+  if (!is_integral_type (type))
     error ("Argument to complement operation not an integer or boolean.");
 
   /* Perform integral promotion for ANSI C/C++.
diff --git a/gdb/valops.c b/gdb/valops.c
index 6042277..de6a8dd 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -42,10 +42,7 @@
 #include "gdb_string.h"
 #include "gdb_assert.h"
 #include "cp-support.h"
-
-/* Flag indicating HP compilers were used; needed to correctly handle some
-   value operations with HP aCC code/runtime. */
-extern int hp_som_som_object_present;
+#include "observer.h"
 
 extern int overload_debug;
 /* Local functions.  */
@@ -53,8 +50,6 @@
 static int typecmp (int staticp, int varargs, int nargs,
 		    struct field t1[], struct value *t2[]);
 
-static CORE_ADDR value_push (CORE_ADDR, struct value *);
-
 static struct value *search_struct_field (char *, struct value *, int,
 				      struct type *, int);
 
@@ -299,8 +294,8 @@
     {
       LONGEST longest;
 
-      if (hp_som_som_object_present &&	/* if target compiled by HP aCC */
-	  (code2 == TYPE_CODE_PTR))
+      if (deprecated_hp_som_som_object_present	/* if target compiled by HP aCC */
+	  && (code2 == TYPE_CODE_PTR))
 	{
 	  unsigned int *ptr;
 	  struct value *retvalp;
@@ -610,9 +605,8 @@
 	  }
 
 	write_memory (changed_addr, dest_buffer, changed_len);
-	if (memory_changed_hook)
-	  memory_changed_hook (changed_addr, changed_len);
-	target_changed_event ();
+	if (deprecated_memory_changed_hook)
+	  deprecated_memory_changed_hook (changed_addr, changed_len);
       }
       break;
 
@@ -702,9 +696,9 @@
 	      put_frame_register (frame, regno, buffer + amount_copied);
 
 	  }
-	if (register_changed_hook)
-	  register_changed_hook (-1);
-	target_changed_event ();
+	if (deprecated_register_changed_hook)
+	  deprecated_register_changed_hook (-1);
+	observer_notify_target_changed (&current_target);
 	break;
       }
       
@@ -1009,58 +1003,6 @@
   return sp;
 }
 
-#ifndef PARM_BOUNDARY
-#define PARM_BOUNDARY (0)
-#endif
-
-/* Push onto the stack the specified value VALUE.  Pad it correctly for
-   it to be an argument to a function.  */
-
-static CORE_ADDR
-value_push (CORE_ADDR sp, struct value *arg)
-{
-  int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg));
-  int container_len = len;
-  int offset;
-
-  /* How big is the container we're going to put this value in?  */
-  if (PARM_BOUNDARY)
-    container_len = ((len + PARM_BOUNDARY / TARGET_CHAR_BIT - 1)
-		     & ~(PARM_BOUNDARY / TARGET_CHAR_BIT - 1));
-
-  /* Are we going to put it at the high or low end of the container?  */
-  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
-    offset = container_len - len;
-  else
-    offset = 0;
-
-  if (INNER_THAN (1, 2))
-    {
-      /* stack grows downward */
-      sp -= container_len;
-      write_memory (sp + offset, VALUE_CONTENTS_ALL (arg), len);
-    }
-  else
-    {
-      /* stack grows upward */
-      write_memory (sp + offset, VALUE_CONTENTS_ALL (arg), len);
-      sp += container_len;
-    }
-
-  return sp;
-}
-
-CORE_ADDR
-legacy_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
-		       int struct_return, CORE_ADDR struct_addr)
-{
-  /* ASSERT ( !struct_return); */
-  int i;
-  for (i = nargs - 1; i >= 0; i--)
-    sp = value_push (sp, args[i]);
-  return sp;
-}
-
 /* Create a value for an array by allocating space in the inferior, copying
    the data into that space, and then setting up an array value.
 
diff --git a/gdb/value.h b/gdb/value.h
index 690edb9..c50c2ca 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -560,10 +560,6 @@
 
 extern struct value *value_allocate_space_in_inferior (int);
 
-extern CORE_ADDR legacy_push_arguments (int nargs, struct value ** args,
-					CORE_ADDR sp, int struct_return,
-					CORE_ADDR struct_addr);
-
 extern struct value *value_of_local (const char *name, int complain);
 
 #endif /* !defined (VALUE_H) */
diff --git a/gdb/values.c b/gdb/values.c
index 87baf21..a42e53a 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -1202,50 +1202,6 @@
   return val;
 }
 
-/* Deal with the return-value of a function that has "just returned".
-
-   Extract the return-value (as a "struct value") that a function,
-   using register convention, has just returned to its caller.  Assume
-   that the type of the function is VALTYPE, and that the "just
-   returned" register state is found in RETBUF.
-
-   The function has "just returned" because GDB halts a returning
-   function by setting a breakpoint at the return address (in the
-   caller), and not the return instruction (in the callee).
-
-   Because, in the case of a return from an inferior function call,
-   GDB needs to restore the inferiors registers, RETBUF is normally a
-   copy of the inferior's registers.  */
-
-struct value *
-register_value_being_returned (struct type *valtype, struct regcache *retbuf)
-{
-  struct value *val = allocate_value (valtype);
-
-  /* If the function returns void, don't bother fetching the return
-     value.  See also "using_struct_return".  */
-  if (TYPE_CODE (valtype) == TYPE_CODE_VOID)
-    return val;
-
-  if (!gdbarch_return_value_p (current_gdbarch))
-    {
-      /* NOTE: cagney/2003-10-20: Unlike "gdbarch_return_value", the
-         EXTRACT_RETURN_VALUE and USE_STRUCT_CONVENTION methods do not
-         handle the edge case of a function returning a small
-         structure / union in registers.  */
-      CHECK_TYPEDEF (valtype);
-      EXTRACT_RETURN_VALUE (valtype, retbuf, VALUE_CONTENTS_RAW (val));
-      return val;
-    }
-
-  /* This function only handles "register convention".  */
-  gdb_assert (gdbarch_return_value (current_gdbarch, valtype,
-				    NULL, NULL, NULL)
-	      == RETURN_VALUE_REGISTER_CONVENTION);
-  gdbarch_return_value (current_gdbarch, valtype, retbuf,
-			VALUE_CONTENTS_RAW (val) /*read*/, NULL /*write*/);
-  return val;
-}
 
 /* Should we use DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS instead of
    EXTRACT_RETURN_VALUE?  GCC_P is true if compiled with gcc and TYPE
@@ -1261,15 +1217,16 @@
    2.0-2.3.3.  This is somewhat unfortunate, but changing gcc2_compiled
    would cause more chaos than dealing with some struct returns being
    handled wrong.  */
+/* NOTE: cagney/2004-06-13: Deleted check for "gcc_p".  GCC 1.x is
+   dead.  */
 
 int
 generic_use_struct_convention (int gcc_p, struct type *value_type)
 {
-  return !((gcc_p == 1)
-	   && (TYPE_LENGTH (value_type) == 1
-	       || TYPE_LENGTH (value_type) == 2
-	       || TYPE_LENGTH (value_type) == 4
-	       || TYPE_LENGTH (value_type) == 8));
+  return !(TYPE_LENGTH (value_type) == 1
+	   || TYPE_LENGTH (value_type) == 2
+	   || TYPE_LENGTH (value_type) == 4
+	   || TYPE_LENGTH (value_type) == 8);
 }
 
 /* Return true if the function returning the specified type is using
@@ -1287,28 +1244,13 @@
 
   if (code == TYPE_CODE_VOID)
     /* A void return value is never in memory.  See also corresponding
-       code in "register_value_being_returned".  */
+       code in "print_return_value".  */
     return 0;
 
-  if (!gdbarch_return_value_p (current_gdbarch))
-    {
-      /* FIXME: cagney/2003-10-01: The below is dead.  Instead an
-	 architecture should implement "gdbarch_return_value".  Using
-	 that new function it is possible to exactly specify the ABIs
-	 "struct return" vs "register return" conventions.  */
-      if (code == TYPE_CODE_STRUCT
-	  || code == TYPE_CODE_UNION
-	  || code == TYPE_CODE_ARRAY
-	  || RETURN_VALUE_ON_STACK (value_type))
-	return USE_STRUCT_CONVENTION (gcc_p, value_type);
-      else
-	return 0;
-    }
-
   /* Probe the architecture for the return-value convention.  */
   return (gdbarch_return_value (current_gdbarch, value_type,
 				NULL, NULL, NULL)
-	  == RETURN_VALUE_STRUCT_CONVENTION);
+	  != RETURN_VALUE_REGISTER_CONVENTION);
 }
 
 void
diff --git a/gdb/varobj.c b/gdb/varobj.c
index c662518..ea4fa01 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -549,7 +549,7 @@
 
   /* generate a name for this object */
   id++;
-  xasprintf (&obj_name, "var%d", id);
+  obj_name = xstrprintf ("var%d", id);
 
   return obj_name;
 }
@@ -1254,7 +1254,7 @@
     child->error = 1;
   child->parent = parent;
   child->root = parent->root;
-  xasprintf (&childs_name, "%s.%s", parent->obj_name, name);
+  childs_name = xstrprintf ("%s.%s", parent->obj_name, name);
   child->obj_name = childs_name;
   install_variable (child);
 
@@ -1837,7 +1837,7 @@
   switch (TYPE_CODE (type))
     {
     case TYPE_CODE_ARRAY:
-      xasprintf (&name, "%d", index);
+      name = xstrprintf ("%d", index);
       break;
 
     case TYPE_CODE_STRUCT:
@@ -1856,7 +1856,7 @@
 	  break;
 
 	default:
-	  xasprintf (&name, "*%s", parent->name);
+	  name = xstrprintf ("*%s", parent->name);
 	  break;
 	}
       break;
@@ -2070,7 +2070,7 @@
     case TYPE_CODE_ARRAY:
       {
 	char *number;
-	xasprintf (&number, "[%d]", var->num_children);
+	number = xstrprintf ("[%d]", var->num_children);
 	return (number);
       }
       /* break; */
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index a0eac7d..78862fc 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -1,4 +1,4 @@
-/* Print VAX instructions for GDB, the GNU debugger.
+/* Target-dependent code for the VAX.
 
    Copyright 1986, 1989, 1991, 1992, 1995, 1996, 1998, 1999, 2000,
    2002, 2003, 2004 Free Software Foundation, Inc.
@@ -21,265 +21,247 @@
    Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
-#include "symtab.h"
-#include "opcode/vax.h"
-#include "gdbcore.h"
-#include "inferior.h"
-#include "regcache.h"
-#include "frame.h"
-#include "value.h"
 #include "arch-utils.h"
-#include "gdb_string.h"
-#include "osabi.h"
 #include "dis-asm.h"
+#include "frame.h"
+#include "frame-base.h"
+#include "frame-unwind.h"
+#include "gdbcore.h"
+#include "gdbtypes.h"
+#include "osabi.h"
+#include "regcache.h"
+#include "regset.h"
+#include "trad-frame.h"
+#include "value.h"
+
+#include "gdb_string.h"
 
 #include "vax-tdep.h"
 
-static gdbarch_register_name_ftype vax_register_name;
+/* Return the name of register REGNUM.  */
 
-static gdbarch_skip_prologue_ftype vax_skip_prologue;
-static gdbarch_frame_num_args_ftype vax_frame_num_args;
-static gdbarch_deprecated_frame_chain_ftype vax_frame_chain;
-
-static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value;
-
-static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame;
-
 static const char *
-vax_register_name (int regno)
+vax_register_name (int regnum)
 {
   static char *register_names[] =
   {
-    "r0",  "r1",  "r2",  "r3", "r4", "r5", "r6", "r7",
-    "r8",  "r9", "r10", "r11", "ap", "fp", "sp", "pc",
+    "r0", "r1", "r2",  "r3",  "r4", "r5", "r6", "r7",
+    "r8", "r9", "r10", "r11", "ap", "fp", "sp", "pc",
     "ps",
   };
 
-  if (regno < 0)
-    return (NULL);
-  if (regno >= (sizeof(register_names) / sizeof(*register_names)))
-    return (NULL);
-  return (register_names[regno]);
+  if (regnum >= 0 && regnum < ARRAY_SIZE (register_names))
+    return register_names[regnum];
+
+  return NULL;
 }
 
-static int
-vax_register_byte (int regno)
-{
-  return (regno * 4);
-}
-
-static int
-vax_register_raw_size (int regno)
-{
-  return (4);
-}
-
-static int
-vax_register_virtual_size (int regno)
-{
-  return (4);
-}
+/* Return the GDB type object for the "standard" data type of data in
+   register REGNUM. */
 
 static struct type *
-vax_register_virtual_type (int regno)
+vax_register_type (struct gdbarch *gdbarch, int regnum)
 {
-  return (builtin_type_int);
+  return builtin_type_int;
 }
 
+/* Core file support.  */
+
+/* Supply register REGNUM from the buffer specified by GREGS and LEN
+   in the general-purpose register set REGSET to register cache
+   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
+
 static void
-vax_frame_init_saved_regs (struct frame_info *frame)
+vax_supply_gregset (const struct regset *regset, struct regcache *regcache,
+		    int regnum, const void *gregs, size_t len)
 {
-  int regnum, regmask;
-  CORE_ADDR next_addr;
+  const char *regs = gregs;
+  int i;
 
-  if (deprecated_get_frame_saved_regs (frame))
-    return;
-
-  frame_saved_regs_zalloc (frame);
-
-  regmask = read_memory_integer (get_frame_base (frame) + 4, 4) >> 16;
-
-  next_addr = get_frame_base (frame) + 16;
-
-  /* regmask's low bit is for register 0, which is the first one
-     what would be pushed.  */
-  for (regnum = 0; regnum < VAX_AP_REGNUM; regnum++)
+  for (i = 0; i < VAX_NUM_REGS; i++)
     {
-      if (regmask & (1 << regnum))
-        deprecated_get_frame_saved_regs (frame)[regnum] = next_addr += 4;
+      if (regnum == i || regnum == -1)
+	regcache_raw_supply (regcache, i, regs + i * 4);
+    }
+}
+
+/* VAX register set.  */
+
+static struct regset vax_gregset =
+{
+  NULL,
+  vax_supply_gregset
+};
+
+/* Return the appropriate register set for the core section identified
+   by SECT_NAME and SECT_SIZE.  */
+
+static const struct regset *
+vax_regset_from_core_section (struct gdbarch *gdbarch,
+			      const char *sect_name, size_t sect_size)
+{
+  if (strcmp (sect_name, ".reg") == 0 && sect_size >= VAX_NUM_REGS * 4)
+    return &vax_gregset;
+
+  return NULL;
+}
+
+/* The VAX UNIX calling convention uses R1 to pass a structure return
+   value address instead of passing it as a first (hidden) argument as
+   the VMS calling convention suggests.  */
+
+static CORE_ADDR
+vax_store_arguments (struct regcache *regcache, int nargs,
+		     struct value **args, CORE_ADDR sp)
+{
+  char buf[4];
+  int count = 0;
+  int i;
+
+  /* We create an argument list on the stack, and make the argument
+     pointer to it.  */
+
+  /* Push arguments in reverse order.  */
+  for (i = nargs - 1; i >= 0; i--)
+    {
+      int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (args[i]));
+
+      sp -= (len + 3) & ~3;
+      count += (len + 3) / 4;
+      write_memory (sp, VALUE_CONTENTS_ALL (args[i]), len);
     }
 
-  deprecated_get_frame_saved_regs (frame)[SP_REGNUM] = next_addr + 4;
-  if (regmask & (1 << DEPRECATED_FP_REGNUM))
-    deprecated_get_frame_saved_regs (frame)[SP_REGNUM] +=
-      4 + (4 * read_memory_integer (next_addr + 4, 4));
+  /* Push argument count.  */
+  sp -= 4;
+  store_unsigned_integer (buf, 4, count);
+  write_memory (sp, buf, 4);
 
-  deprecated_get_frame_saved_regs (frame)[PC_REGNUM] = get_frame_base (frame) + 16;
-  deprecated_get_frame_saved_regs (frame)[DEPRECATED_FP_REGNUM] = get_frame_base (frame) + 12;
-  deprecated_get_frame_saved_regs (frame)[VAX_AP_REGNUM] = get_frame_base (frame) + 8;
-  deprecated_get_frame_saved_regs (frame)[PS_REGNUM] = get_frame_base (frame) + 4;
-}
+  /* Update the argument pointer.  */
+  store_unsigned_integer (buf, 4, sp);
+  regcache_cooked_write (regcache, VAX_AP_REGNUM, buf);
 
-/* Get saved user PC for sigtramp from sigcontext for BSD style sigtramp.  */
-
-static CORE_ADDR
-vax_sigtramp_saved_pc (struct frame_info *frame)
-{
-  CORE_ADDR sigcontext_addr;
-  char *buf;
-  int ptrbytes = TYPE_LENGTH (builtin_type_void_func_ptr);
-  int sigcontext_offs = (2 * TARGET_INT_BIT) / TARGET_CHAR_BIT;
-
-  buf = alloca (ptrbytes);
-  /* Get sigcontext address, it is the third parameter on the stack.  */
-  if (get_next_frame (frame))
-    sigcontext_addr = read_memory_typed_address
-      (DEPRECATED_FRAME_ARGS_ADDRESS (get_next_frame (frame))
-       + FRAME_ARGS_SKIP + sigcontext_offs,
-       builtin_type_void_data_ptr);
-  else
-    sigcontext_addr = read_memory_typed_address
-      (read_register (SP_REGNUM) + sigcontext_offs, builtin_type_void_data_ptr);
-
-  /* Offset to saved PC in sigcontext, from <sys/signal.h>.  Don't
-     cause a memory_error when accessing sigcontext in case the stack
-     layout has changed or the stack is corrupt.  */
-  target_read_memory (sigcontext_addr + 12, buf, ptrbytes);
-  return extract_typed_address (buf, builtin_type_void_func_ptr);
+  return sp;
 }
 
 static CORE_ADDR
-vax_frame_saved_pc (struct frame_info *frame)
+vax_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
+		     struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
+		     struct value **args, CORE_ADDR sp, int struct_return,
+		     CORE_ADDR struct_addr)
 {
-  if ((get_frame_type (frame) == SIGTRAMP_FRAME))
-    return (vax_sigtramp_saved_pc (frame)); /* XXXJRT */
+  CORE_ADDR fp = sp;
+  char buf[4];
 
-  return (read_memory_integer (get_frame_base (frame) + 16, 4));
+  /* Set up the function arguments.  */
+  sp = vax_store_arguments (regcache, nargs, args, sp);
+
+  /* Store return value address.  */
+  if (struct_return)
+    regcache_cooked_write_unsigned (regcache, VAX_R1_REGNUM, struct_addr);
+
+  /* Store return address in the PC slot.  */
+  sp -= 4;
+  store_unsigned_integer (buf, 4, bp_addr);
+  write_memory (sp, buf, 4);
+
+  /* Store the (fake) frame pointer in the FP slot.  */
+  sp -= 4;
+  store_unsigned_integer (buf, 4, fp);
+  write_memory (sp, buf, 4);
+
+  /* Skip the AP slot.  */
+  sp -= 4;
+
+  /* Store register save mask and control bits.  */
+  sp -= 4;
+  store_unsigned_integer (buf, 4, 0);
+  write_memory (sp, buf, 4);
+
+  /* Store condition handler.  */
+  sp -= 4;
+  store_unsigned_integer (buf, 4, 0);
+  write_memory (sp, buf, 4);
+
+  /* Update the stack pointer and frame pointer.  */
+  store_unsigned_integer (buf, 4, sp);
+  regcache_cooked_write (regcache, VAX_SP_REGNUM, buf);
+  regcache_cooked_write (regcache, VAX_FP_REGNUM, buf);
+
+  /* Return the saved (fake) frame pointer.  */
+  return fp;
 }
 
-static CORE_ADDR
-vax_frame_args_address (struct frame_info *frame)
+static struct frame_id
+vax_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
 {
-  /* In most of GDB, getting the args address is too important to just
-     say "I don't know".  This is sometimes wrong for functions that
-     aren't on top of the stack, but c'est la vie.  */
-  if (get_next_frame (frame))
-    return (read_memory_integer (get_frame_base (get_next_frame (frame)) + 8, 4));
-  /* Cannot find the AP register value directly from the FP value.
-     Must find it saved in the frame called by this one, or in the AP
-     register for the innermost frame.  However, there is no way to
-     tell the difference between the innermost frame and a frame for
-     which we just don't know the frame that it called (e.g. "info
-     frame 0x7ffec789").  For the sake of argument, suppose that the
-     stack is somewhat trashed (which is one reason that "info frame"
-     exists).  So, return 0 (indicating we don't know the address of
-     the arglist) if we don't know what frame this frame calls.  */
-  return 0;
-}
+  CORE_ADDR fp;
 
-static int
-vax_frame_num_args (struct frame_info *fi)
-{
-  return (0xff & read_memory_integer (DEPRECATED_FRAME_ARGS_ADDRESS (fi), 1));
-}
-
-static CORE_ADDR
-vax_frame_chain (struct frame_info *frame)
-{
-  /* In the case of the VAX, the frame's nominal address is the FP value,
-     and 12 bytes later comes the saved previous FP value as a 4-byte word.  */
-  return (read_memory_integer (get_frame_base (frame) + 12, 4));
+  fp = frame_unwind_register_unsigned (next_frame, VAX_FP_REGNUM);
+  return frame_id_build (fp, frame_pc_unwind (next_frame));
 }
 
-static void
-vax_push_dummy_frame (void)
+
+static enum return_value_convention
+vax_return_value (struct gdbarch *gdbarch, struct type *type,
+		  struct regcache *regcache, void *readbuf,
+		  const void *writebuf)
 {
-  CORE_ADDR sp = read_register (SP_REGNUM);
-  int regnum;
+  int len = TYPE_LENGTH (type);
+  char buf[8];
 
-  sp = push_word (sp, 0);	/* arglist */
-  for (regnum = 11; regnum >= 0; regnum--)
-    sp = push_word (sp, read_register (regnum));
-  sp = push_word (sp, read_register (PC_REGNUM));
-  sp = push_word (sp, read_register (DEPRECATED_FP_REGNUM));
-  sp = push_word (sp, read_register (VAX_AP_REGNUM));
-  sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) + 0x2fff0000);
-  sp = push_word (sp, 0);
-  write_register (SP_REGNUM, sp);
-  write_register (DEPRECATED_FP_REGNUM, sp);
-  write_register (VAX_AP_REGNUM, sp + (17 * 4));
-}
-
-static void
-vax_pop_frame (void)
-{
-  CORE_ADDR fp = read_register (DEPRECATED_FP_REGNUM);
-  int regnum;
-  int regmask = read_memory_integer (fp + 4, 4);
-
-  write_register (PS_REGNUM,
-		  (regmask & 0xffff)
-		  | (read_register (PS_REGNUM) & 0xffff0000));
-  write_register (PC_REGNUM, read_memory_integer (fp + 16, 4));
-  write_register (DEPRECATED_FP_REGNUM, read_memory_integer (fp + 12, 4));
-  write_register (VAX_AP_REGNUM, read_memory_integer (fp + 8, 4));
-  fp += 16;
-  for (regnum = 0; regnum < 12; regnum++)
-    if (regmask & (0x10000 << regnum))
-      write_register (regnum, read_memory_integer (fp += 4, 4));
-  fp = fp + 4 + ((regmask >> 30) & 3);
-  if (regmask & 0x20000000)
+  if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+      || TYPE_CODE (type) == TYPE_CODE_UNION
+      || TYPE_CODE (type) == TYPE_CODE_ARRAY)
     {
-      regnum = read_memory_integer (fp, 4);
-      fp += (regnum + 1) * 4;
+      /* The default on VAX is to return structures in static memory.
+         Consequently a function must return the address where we can
+         find the return value.  */
+
+      if (readbuf)
+	{
+	  ULONGEST addr;
+
+	  regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr);
+	  read_memory (addr, readbuf, len);
+	}
+
+      return RETURN_VALUE_ABI_RETURNS_ADDRESS;
     }
-  write_register (SP_REGNUM, fp);
-  flush_cached_frames ();
-}
 
-/* The VAX call dummy sequence:
+  if (readbuf)
+    {
+      /* Read the contents of R0 and (if necessary) R1.  */
+      regcache_cooked_read (regcache, VAX_R0_REGNUM, buf);
+      if (len > 4)
+	regcache_cooked_read (regcache, VAX_R1_REGNUM, buf + 4);
+      memcpy (readbuf, buf, len);
+    }
+  if (writebuf)
+    {
+      /* Read the contents to R0 and (if necessary) R1.  */
+      memcpy (buf, writebuf, len);
+      regcache_cooked_write (regcache, VAX_R0_REGNUM, buf);
+      if (len > 4)
+	regcache_cooked_write (regcache, VAX_R1_REGNUM, buf + 4);
+    }
 
-	calls #69, @#32323232
-	bpt
-
-   It is 8 bytes long.  The address and argc are patched by
-   vax_fix_call_dummy().  */
-static LONGEST vax_call_dummy_words[] = { 0x329f69fb, 0x03323232 };
-static int sizeof_vax_call_dummy_words = sizeof(vax_call_dummy_words);
-
-static void
-vax_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs,
-                    struct value **args, struct type *type, int gcc_p)
-{
-  dummy[1] = nargs;
-  store_unsigned_integer (dummy + 3, 4, fun);
+  return RETURN_VALUE_REGISTER_CONVENTION;
 }
 
-static void
-vax_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
-{
-  write_register (1, addr);
-}
 
-static void
-vax_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
-{
-  memcpy (valbuf, regbuf + DEPRECATED_REGISTER_BYTE (0), TYPE_LENGTH (valtype));
-}
-
-static void
-vax_store_return_value (struct type *valtype, char *valbuf)
-{
-  deprecated_write_register_bytes (0, valbuf, TYPE_LENGTH (valtype));
-}
-
+/* Use the program counter to determine the contents and size of a
+   breakpoint instruction.  Return a pointer to a string of bytes that
+   encode a breakpoint instruction, store the length of the string in
+   *LEN and optionally adjust *PC to point to the correct memory
+   location for inserting the breakpoint.  */
+   
 static const unsigned char *
-vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+vax_breakpoint_from_pc (CORE_ADDR *pc, int *len)
 {
-  static const unsigned char vax_breakpoint[] = { 3 };
+  static unsigned char break_insn[] = { 3 };
 
-  *lenptr = sizeof(vax_breakpoint);
-  return (vax_breakpoint);
+  *len = sizeof (break_insn);
+  return break_insn;
 }
 
 /* Advance PC across any function entry prologue instructions
@@ -288,35 +270,193 @@
 static CORE_ADDR
 vax_skip_prologue (CORE_ADDR pc)
 {
-  int op = (unsigned char) read_memory_integer (pc, 1);
+  unsigned char op = read_memory_unsigned_integer (pc, 1);
+
   if (op == 0x11)
     pc += 2;			/* skip brb */
   if (op == 0x31)
     pc += 3;			/* skip brw */
   if (op == 0xC2
-      && ((unsigned char) read_memory_integer (pc + 2, 1)) == 0x5E)
+      && (read_memory_unsigned_integer (pc + 2, 1)) == 0x5E)
     pc += 3;			/* skip subl2 */
   if (op == 0x9E
-      && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xAE
-      && ((unsigned char) read_memory_integer (pc + 3, 1)) == 0x5E)
+      && (read_memory_unsigned_integer (pc + 1, 1)) == 0xAE
+      && (read_memory_unsigned_integer (pc + 3, 1)) == 0x5E)
     pc += 4;			/* skip movab */
   if (op == 0x9E
-      && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xCE
-      && ((unsigned char) read_memory_integer (pc + 4, 1)) == 0x5E)
+      && (read_memory_unsigned_integer (pc + 1, 1)) == 0xCE
+      && (read_memory_unsigned_integer (pc + 4, 1)) == 0x5E)
     pc += 5;			/* skip movab */
   if (op == 0x9E
-      && ((unsigned char) read_memory_integer (pc + 1, 1)) == 0xEE
-      && ((unsigned char) read_memory_integer (pc + 6, 1)) == 0x5E)
+      && (read_memory_unsigned_integer (pc + 1, 1)) == 0xEE
+      && (read_memory_unsigned_integer (pc + 6, 1)) == 0x5E)
     pc += 7;			/* skip movab */
+
   return pc;
 }
+
+
+/* Unwinding the stack is relatively easy since the VAX has a
+   dedicated frame pointer, and frames are set up automatically as the
+   result of a function call.  Most of the relevant information can be
+   inferred from the documentation of the Procedure Call Instructions
+   in the VAX MACRO and Instruction Set Reference Manual.  */
+
+struct vax_frame_cache
+{
+  /* Base address.  */
+  CORE_ADDR base;
+
+  /* Table of saved registers.  */
+  struct trad_frame_saved_reg *saved_regs;
+};
+
+struct vax_frame_cache *
+vax_frame_cache (struct frame_info *next_frame, void **this_cache)
+{
+  struct vax_frame_cache *cache;
+  CORE_ADDR addr;
+  ULONGEST mask;
+  int regnum;
+
+  if (*this_cache)
+    return *this_cache;
+
+  /* Allocate a new cache.  */
+  cache = FRAME_OBSTACK_ZALLOC (struct vax_frame_cache);
+  cache->saved_regs = trad_frame_alloc_saved_regs (next_frame);
+
+  /* The frame pointer is used as the base for the frame.  */
+  cache->base = frame_unwind_register_unsigned (next_frame, VAX_FP_REGNUM);
+  if (cache->base == 0)
+    return cache;
+
+  /* The register save mask and control bits determine the layout of
+     the stack frame.  */
+  mask = get_frame_memory_unsigned (next_frame, cache->base + 4, 4) >> 16;
+
+  /* These are always saved.  */
+  cache->saved_regs[VAX_PC_REGNUM].addr = cache->base + 16;
+  cache->saved_regs[VAX_FP_REGNUM].addr = cache->base + 12;
+  cache->saved_regs[VAX_AP_REGNUM].addr = cache->base + 8;
+  cache->saved_regs[VAX_PS_REGNUM].addr = cache->base + 4;
+
+  /* Scan the register save mask and record the location of the saved
+     registers.  */
+  addr = cache->base + 20;
+  for (regnum = 0; regnum < VAX_AP_REGNUM; regnum++)
+    {
+      if (mask & (1 << regnum))
+	{
+	  cache->saved_regs[regnum].addr = addr;
+	  addr += 4;
+	}
+    }
+
+  /* The CALLS/CALLG flag determines whether this frame has a General
+     Argument List or a Stack Argument List.  */
+  if (mask & (1 << 13))
+    {
+      ULONGEST numarg;
+
+      /* This is a procedure with Stack Argument List.  Adjust the
+         stack address for the arguments that were pushed onto the
+         stack.  The return instruction will automatically pop the
+         arguments from the stack.  */
+      numarg = get_frame_memory_unsigned (next_frame, addr, 1);
+      addr += 4 + numarg * 4;
+    }
+
+  /* Bits 1:0 of the stack pointer were saved in the control bits.  */
+  trad_frame_set_value (cache->saved_regs, VAX_SP_REGNUM, addr + (mask >> 14));
+
+  return cache;
+}
+
+static void
+vax_frame_this_id (struct frame_info *next_frame, void **this_cache,
+		   struct frame_id *this_id)
+{
+  struct vax_frame_cache *cache = vax_frame_cache (next_frame, this_cache);
+
+  /* This marks the outermost frame.  */
+  if (cache->base == 0)
+    return;
+
+  (*this_id) = frame_id_build (cache->base, frame_pc_unwind (next_frame));
+}
+
+static void
+vax_frame_prev_register (struct frame_info *next_frame, void **this_cache,
+			 int regnum, int *optimizedp,
+			 enum lval_type *lvalp, CORE_ADDR *addrp,
+			 int *realnump, void *valuep)
+{
+  struct vax_frame_cache *cache = vax_frame_cache (next_frame, this_cache);
+
+  trad_frame_prev_register (next_frame, cache->saved_regs, regnum,
+			    optimizedp, lvalp, addrp, realnump, valuep);
+}
+
+static const struct frame_unwind vax_frame_unwind =
+{
+  NORMAL_FRAME,
+  vax_frame_this_id,
+  vax_frame_prev_register
+};
+
+static const struct frame_unwind *
+vax_frame_sniffer (struct frame_info *next_frame)
+{
+  return &vax_frame_unwind;
+}
+
+
+static CORE_ADDR
+vax_frame_base_address (struct frame_info *next_frame, void **this_cache)
+{
+  struct vax_frame_cache *cache = vax_frame_cache (next_frame, this_cache);
+
+  return cache->base;
+}
 
 static CORE_ADDR
-vax_saved_pc_after_call (struct frame_info *frame)
+vax_frame_args_address (struct frame_info *next_frame, void **this_cache)
 {
-  return (DEPRECATED_FRAME_SAVED_PC(frame));
+  return frame_unwind_register_unsigned (next_frame, VAX_AP_REGNUM);
+}
+
+static const struct frame_base vax_frame_base =
+{
+  &vax_frame_unwind,
+  vax_frame_base_address,
+  vax_frame_base_address,
+  vax_frame_args_address
+};
+
+/* Return number of arguments for FRAME.  */
+
+static int
+vax_frame_num_args (struct frame_info *frame)
+{
+  CORE_ADDR args;
+
+  /* Assume that the argument pointer for the outermost frame is
+     hosed, as is the case on NetBSD/vax ELF.  */
+  if (get_frame_base_address (frame) == 0)
+    return 0;
+
+  args = get_frame_register_unsigned (frame, VAX_AP_REGNUM);
+  return get_frame_memory_unsigned (frame, args, 1);
+}
+
+static CORE_ADDR
+vax_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
+{
+  return frame_unwind_register_unsigned (next_frame, VAX_PC_REGNUM);
 }
 
+
 /* Initialize the current architecture based on INFO.  If possible, re-use an
    architecture from ARCHES, which is a list of architectures already created
    during this debugging session.
@@ -336,80 +476,55 @@
 
   gdbarch = gdbarch_alloc (&info, NULL);
 
-  /* NOTE: cagney/2002-12-06: This can be deleted when this arch is
-     ready to unwind the PC first (see frame.c:get_prev_frame()).  */
-  set_gdbarch_deprecated_init_frame_pc (gdbarch, deprecated_init_frame_pc_default);
-
   /* Register info */
   set_gdbarch_num_regs (gdbarch, VAX_NUM_REGS);
+  set_gdbarch_register_name (gdbarch, vax_register_name);
+  set_gdbarch_register_type (gdbarch, vax_register_type);
   set_gdbarch_sp_regnum (gdbarch, VAX_SP_REGNUM);
-  set_gdbarch_deprecated_fp_regnum (gdbarch, VAX_FP_REGNUM);
   set_gdbarch_pc_regnum (gdbarch, VAX_PC_REGNUM);
   set_gdbarch_ps_regnum (gdbarch, VAX_PS_REGNUM);
 
-  set_gdbarch_register_name (gdbarch, vax_register_name);
-  set_gdbarch_deprecated_register_size (gdbarch, VAX_REGISTER_SIZE);
-  set_gdbarch_deprecated_register_bytes (gdbarch, VAX_REGISTER_BYTES);
-  set_gdbarch_deprecated_register_byte (gdbarch, vax_register_byte);
-  set_gdbarch_deprecated_register_raw_size (gdbarch, vax_register_raw_size);
-  set_gdbarch_deprecated_max_register_raw_size (gdbarch, VAX_MAX_REGISTER_RAW_SIZE);
-  set_gdbarch_deprecated_register_virtual_size (gdbarch, vax_register_virtual_size);
-  set_gdbarch_deprecated_max_register_virtual_size (gdbarch,
-                                         VAX_MAX_REGISTER_VIRTUAL_SIZE);
-  set_gdbarch_deprecated_register_virtual_type (gdbarch, vax_register_virtual_type);
+  set_gdbarch_regset_from_core_section
+    (gdbarch, vax_regset_from_core_section);
 
   /* Frame and stack info */
   set_gdbarch_skip_prologue (gdbarch, vax_skip_prologue);
-  set_gdbarch_deprecated_saved_pc_after_call (gdbarch, vax_saved_pc_after_call);
-
   set_gdbarch_frame_num_args (gdbarch, vax_frame_num_args);
-
-  set_gdbarch_deprecated_frame_chain (gdbarch, vax_frame_chain);
-  set_gdbarch_deprecated_frame_saved_pc (gdbarch, vax_frame_saved_pc);
-
-  set_gdbarch_deprecated_frame_args_address (gdbarch, vax_frame_args_address);
-
-  set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, vax_frame_init_saved_regs);
-
   set_gdbarch_frame_args_skip (gdbarch, 4);
 
+  /* Stack grows downward.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
 
   /* Return value info */
-  set_gdbarch_deprecated_store_struct_return (gdbarch, vax_store_struct_return);
-  set_gdbarch_deprecated_extract_return_value (gdbarch, vax_extract_return_value);
-  set_gdbarch_deprecated_store_return_value (gdbarch, vax_store_return_value);
+  set_gdbarch_return_value (gdbarch, vax_return_value);
 
-  /* Call dummy info */
-  set_gdbarch_deprecated_push_dummy_frame (gdbarch, vax_push_dummy_frame);
-  set_gdbarch_deprecated_pop_frame (gdbarch, vax_pop_frame);
-  set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
-  set_gdbarch_deprecated_call_dummy_words (gdbarch, vax_call_dummy_words);
-  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof_vax_call_dummy_words);
-  set_gdbarch_deprecated_fix_call_dummy (gdbarch, vax_fix_call_dummy);
-  set_gdbarch_deprecated_call_dummy_breakpoint_offset (gdbarch, 7);
-  set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
-  set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_on_stack);
+  /* Call dummy code.  */
+  set_gdbarch_push_dummy_call (gdbarch, vax_push_dummy_call);
+  set_gdbarch_unwind_dummy_id (gdbarch, vax_unwind_dummy_id);
 
   /* Breakpoint info */
   set_gdbarch_breakpoint_from_pc (gdbarch, vax_breakpoint_from_pc);
 
   /* Misc info */
-  set_gdbarch_function_start_offset (gdbarch, 2);
+  set_gdbarch_deprecated_function_start_offset (gdbarch, 2);
   set_gdbarch_believe_pcc_promotion (gdbarch, 1);
 
-  /* Should be using push_dummy_call.  */
-  set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+  set_gdbarch_print_insn (gdbarch, print_insn_vax);
+
+  set_gdbarch_unwind_pc (gdbarch, vax_unwind_pc);
+
+  frame_base_set_default (gdbarch, &vax_frame_base);
 
   /* Hook in ABI-specific overrides, if they have been registered.  */
   gdbarch_init_osabi (info, gdbarch);
 
-  set_gdbarch_print_insn (gdbarch, print_insn_vax);
+  frame_unwind_append_sniffer (gdbarch, vax_frame_sniffer);
 
   return (gdbarch);
 }
 
-extern initialize_file_ftype _initialize_vax_tdep; /* -Wmissing-prototypes */
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_vax_tdep (void);
 
 void
 _initialize_vax_tdep (void)
diff --git a/gdb/vax-tdep.h b/gdb/vax-tdep.h
index 1a19917..444d758 100644
--- a/gdb/vax-tdep.h
+++ b/gdb/vax-tdep.h
@@ -1,5 +1,6 @@
-/* Common target dependent code for GDB on VAX systems.
-   Copyright 2002, 2003 Free Software Foundation, Inc.
+/* Target-dependent code for the VAX.
+
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -21,35 +22,20 @@
 #ifndef VAX_TDEP_H
 #define VAX_TDEP_H
 
-/* Say how long (ordinary) registers are.  This is a piece of bogosity
-   used in push_word and a few other places;  DEPRECATED_REGISTER_RAW_SIZE is the
-   real way to know how big a register is.  */
-#define VAX_REGISTER_SIZE 4
+/* Register numbers of various important registers.  */
+
+enum vax_regnum
+{
+  VAX_R0_REGNUM,
+  VAX_R1_REGNUM,
+  VAX_AP_REGNUM = 12,		/* Argument pointer on user stack.  */
+  VAX_FP_REGNUM,		/* Address of executing stack frame.  */
+  VAX_SP_REGNUM,		/* Address of top of stack.  */
+  VAX_PC_REGNUM,		/* Program counter.  */
+  VAX_PS_REGNUM			/* Processor status.  */
+};
 
 /* Number of machine registers.  */
 #define VAX_NUM_REGS 17
 
-/* Total amount of space needed to store our copies of the machine's
-   register state.  */
-#define VAX_REGISTER_BYTES (VAX_NUM_REGS * 4)
-
-/* Largest value DEPRECATED_REGISTER_RAW_SIZE can have.  */
-#define VAX_MAX_REGISTER_RAW_SIZE 4
-
-/* Largest value DEPRECATED_REGISTER_VIRTUAL_SIZE can have.  */
-#define VAX_MAX_REGISTER_VIRTUAL_SIZE 4
-
-/* Register numbers of various important registers.
-   Note that most of these values are "real" register numbers,
-   and correspond to the general registers of the machine,
-   and are "phony" register numbers which is too large
-   to be an actual register number as far as the user is concerned
-   but serves to get the desired value when passed to read_register.  */
-
-#define VAX_AP_REGNUM     12  /* argument pointer */
-#define VAX_FP_REGNUM     13  /* Contains address of executing stack frame */
-#define VAX_SP_REGNUM     14  /* Contains address of top of stack */
-#define VAX_PC_REGNUM     15  /* Contains program counter */
-#define VAX_PS_REGNUM     16  /* Contains processor status */
-
-#endif /* VAX_TDEP_H */
+#endif /* vax-tdep.h */
diff --git a/gdb/vaxbsd-nat.c b/gdb/vaxbsd-nat.c
new file mode 100644
index 0000000..d2757c5
--- /dev/null
+++ b/gdb/vaxbsd-nat.c
@@ -0,0 +1,94 @@
+/* Native-dependent code for VAX BSD's.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "inferior.h"
+#include "regcache.h"
+
+#include <sys/types.h>
+#include <sys/ptrace.h>
+#include <machine/reg.h>
+
+#include "vax-tdep.h"
+
+/* Supply the general-purpose registers stored in GREGS to REGCACHE.  */
+
+static void
+vaxbsd_supply_gregset (struct regcache *regcache, const void *gregs)
+{
+  const char *regs = gregs;
+  int regnum;
+
+  for (regnum = 0; regnum < VAX_NUM_REGS; regnum++)
+    regcache_raw_supply (regcache, regnum, regs + regnum * 4);
+}
+
+/* Collect the general-purpose registers from REGCACHE and store them
+   in GREGS.  */
+
+static void
+vaxbsd_collect_gregset (const struct regcache *regcache,
+			void *gregs, int regnum)
+{
+  char *regs = gregs;
+  int i;
+
+  for (i = 0; i <= VAX_NUM_REGS; i++)
+    {
+      if (regnum == -1 || regnum == i)
+	regcache_raw_collect (regcache, i, regs + i * 4);
+    }
+}
+
+
+/* Fetch register REGNUM from the inferior.  If REGNUM is -1, do this
+   for all registers.  */
+
+void
+fetch_inferior_registers (int regnum)
+{
+  struct reg regs;
+
+  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't get registers");
+
+  vaxbsd_supply_gregset (current_regcache, &regs);
+}
+
+/* Store register REGNUM back into the inferior.  If REGNUM is -1, do
+   this for all registers.  */
+
+void
+store_inferior_registers (int regnum)
+{
+  struct reg regs;
+
+  if (ptrace (PT_GETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't get registers");
+
+  vaxbsd_collect_gregset (current_regcache, &regs, regnum);
+
+  if (ptrace (PT_SETREGS, PIDGET (inferior_ptid),
+	      (PTRACE_ARG3_TYPE) &regs, 0) == -1)
+    perror_with_name ("Couldn't write registers");
+}
diff --git a/gdb/vaxnbsd-tdep.c b/gdb/vaxnbsd-tdep.c
new file mode 100644
index 0000000..c324da8
--- /dev/null
+++ b/gdb/vaxnbsd-tdep.c
@@ -0,0 +1,75 @@
+/* Target-dependent code for NetBSD/vax.
+
+   Copyright 2004 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#include "defs.h"
+#include "arch-utils.h"
+#include "osabi.h"
+
+#include "vax-tdep.h"
+#include "solib-svr4.h"
+
+#include "gdb_string.h"
+
+/* Support for shared libraries.  */
+
+/* Return non-zero if we are in a shared library trampoline code stub.  */
+
+int
+vaxnbsd_aout_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+  return (name && !strcmp (name, "_DYNAMIC"));
+}
+
+
+/* NetBSD a.out.  */
+
+static void
+vaxnbsd_aout_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  /* Assume SunOS-style shared libraries.  */
+  set_gdbarch_in_solib_call_trampoline
+    (gdbarch, vaxnbsd_aout_in_solib_call_trampoline);
+}
+
+/* NetBSD ELF.  */
+
+static void
+vaxnbsd_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+{
+  /* NetBSD ELF uses SVR4-style shared libraries.  */
+  set_gdbarch_in_solib_call_trampoline
+    (gdbarch, generic_in_solib_call_trampoline);
+  set_solib_svr4_fetch_link_map_offsets
+    (gdbarch, svr4_ilp32_fetch_link_map_offsets);
+}
+
+
+/* Provide a prototype to silence -Wmissing-prototypes.  */
+void _initialize_vaxnbsd_tdep (void);
+
+void
+_initialize_vaxnbsd_tdep (void)
+{
+  gdbarch_register_osabi (bfd_arch_vax, 0, GDB_OSABI_NETBSD_AOUT,
+			  vaxnbsd_aout_init_abi);
+  gdbarch_register_osabi (bfd_arch_vax, 0, GDB_OSABI_NETBSD_ELF,
+			  vaxnbsd_elf_init_abi);
+}
diff --git a/gdb/version.in b/gdb/version.in
index 81a2d2c..2994b47 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2004-03-23-cvs
+2004-07-09-cvs
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index 8b26916..cdaac2d 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -1,7 +1,7 @@
 /* Target-vector operations for controlling win32 child processes, for GDB.
 
-   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free
-   Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions, A Red Hat Company.
 
@@ -56,9 +56,6 @@
 #include "i386-tdep.h"
 #include "i387-tdep.h"
 
-/* The ui's event loop. */
-extern int (*ui_loop_hook) (int signo);
-
 /* If we're not using the old Cygwin header file set, define the
    following which never should have been in the generic Win32 API
    headers in the first place since they were our own invention... */
@@ -1420,8 +1417,8 @@
 	{
 	  int detach = 0;
 
-	  if (ui_loop_hook != NULL)
-	    detach = ui_loop_hook (0);
+	  if (deprecated_ui_loop_hook != NULL)
+	    detach = deprecated_ui_loop_hook (0);
 
 	  if (detach)
 	    child_kill_inferior ();
@@ -1659,6 +1656,36 @@
   unpush_target (&child_ops);
 }
 
+char *
+child_pid_to_exec_file (int pid)
+{
+  /* Try to find the process path using the Cygwin internal process list
+     pid isn't a valid pid, unfortunately.  Use current_event.dwProcessId
+     instead.  */
+  /* TODO: Also find native Windows processes using CW_GETPINFO_FULL.  */
+
+  static char path[MAX_PATH + 1];
+  char *path_ptr = NULL;
+  int cpid;
+  struct external_pinfo *pinfo;
+
+  cygwin_internal (CW_LOCK_PINFO, 1000);
+  for (cpid = 0;
+       (pinfo = (struct external_pinfo *)
+                       cygwin_internal (CW_GETPINFO, cpid | CW_NEXTPID));
+       cpid = pinfo->pid)
+    {
+      if (pinfo->dwProcessId == current_event.dwProcessId) /* Got it */
+       {
+         cygwin_conv_to_full_posix_path (pinfo->progname, path);
+         path_ptr = path; 
+         break;
+       }
+    }
+  cygwin_internal (CW_UNLOCK_PINFO);
+  return path_ptr; 
+}
+
 /* Print status information about what we're accessing.  */
 
 static void
@@ -1680,7 +1707,8 @@
    ENV is the environment vector to pass.  Errors reported with error().  */
 
 static void
-child_create_inferior (char *exec_file, char *allargs, char **env)
+child_create_inferior (char *exec_file, char *allargs, char **env,
+		       int from_tty)
 {
   char *winenv;
   char *temp;
@@ -2080,6 +2108,7 @@
   child_ops.to_has_registers = 1;
   child_ops.to_has_execution = 1;
   child_ops.to_magic = OPS_MAGIC;
+  child_ops.to_pid_to_exec_file = child_pid_to_exec_file;
 }
 
 void
@@ -2238,65 +2267,65 @@
       }
   }
 
-    register_loaded_dll (dll_name, base_addr + 0x1000);
-    solib_symbols_add (dll_name, 0, (CORE_ADDR) base_addr + 0x1000);
+  register_loaded_dll (dll_name, base_addr + 0x1000);
+  solib_symbols_add (dll_name, 0, (CORE_ADDR) base_addr + 0x1000);
 
-  out:
-    return 1;
-  }
+ out:
+  return 1;
+}
 
-  typedef struct
-  {
-    struct target_ops *target;
-    bfd_vma addr;
-  } map_code_section_args;
+typedef struct
+{
+  struct target_ops *target;
+  bfd_vma addr;
+} map_code_section_args;
 
-  static void
-  map_single_dll_code_section (bfd * abfd, asection * sect, void *obj)
-  {
-    int old;
-    int update_coreops;
-    struct section_table *new_target_sect_ptr;
+static void
+map_single_dll_code_section (bfd * abfd, asection * sect, void *obj)
+{
+  int old;
+  int update_coreops;
+  struct section_table *new_target_sect_ptr;
 
-    map_code_section_args *args = (map_code_section_args *) obj;
-    struct target_ops *target = args->target;
-    if (sect->flags & SEC_CODE)
-      {
-	update_coreops = core_ops.to_sections == target->to_sections;
+  map_code_section_args *args = (map_code_section_args *) obj;
+  struct target_ops *target = args->target;
+  if (sect->flags & SEC_CODE)
+    {
+      update_coreops = core_ops.to_sections == target->to_sections;
 
-	if (target->to_sections)
-	  {
-	    old = target->to_sections_end - target->to_sections;
-	    target->to_sections = (struct section_table *)
-	      xrealloc ((char *) target->to_sections,
-			(sizeof (struct section_table)) * (1 + old));
-	  }
-	else
-	  {
-	    old = 0;
-	    target->to_sections = (struct section_table *)
-	      xmalloc ((sizeof (struct section_table)));
-	  }
-	target->to_sections_end = target->to_sections + (1 + old);
+      if (target->to_sections)
+	{
+	  old = target->to_sections_end - target->to_sections;
+	  target->to_sections = (struct section_table *)
+	    xrealloc ((char *) target->to_sections,
+		      (sizeof (struct section_table)) * (1 + old));
+	}
+      else
+	{
+	  old = 0;
+	  target->to_sections = (struct section_table *)
+	    xmalloc ((sizeof (struct section_table)));
+	}
+      target->to_sections_end = target->to_sections + (1 + old);
 
-	/* Update the to_sections field in the core_ops structure
-	   if needed.  */
-	if (update_coreops)
-	  {
-	    core_ops.to_sections = target->to_sections;
-	    core_ops.to_sections_end = target->to_sections_end;
-	  }
-	new_target_sect_ptr = target->to_sections + old;
-	new_target_sect_ptr->addr = args->addr + bfd_section_vma (abfd, sect);
-	new_target_sect_ptr->endaddr = args->addr + bfd_section_vma (abfd, sect) +
-	  bfd_section_size (abfd, sect);;
-	new_target_sect_ptr->the_bfd_section = sect;
-	new_target_sect_ptr->bfd = abfd;
-      }
-  }
+      /* Update the to_sections field in the core_ops structure
+	 if needed.  */
+      if (update_coreops)
+	{
+	  core_ops.to_sections = target->to_sections;
+	  core_ops.to_sections_end = target->to_sections_end;
+	}
+      new_target_sect_ptr = target->to_sections + old;
+      new_target_sect_ptr->addr = args->addr + bfd_section_vma (abfd, sect);
+      new_target_sect_ptr->endaddr = args->addr + bfd_section_vma (abfd, sect) +
+	bfd_section_size (abfd, sect);;
+      new_target_sect_ptr->the_bfd_section = sect;
+      new_target_sect_ptr->bfd = abfd;
+    }
+}
 
-  static int
-  dll_code_sections_add (const char *dll_name, int base_addr, struct target_ops *target)
+static int
+dll_code_sections_add (const char *dll_name, int base_addr, struct target_ops *target)
 {
   bfd *dll_bfd;
   map_code_section_args map_args;
@@ -2339,20 +2368,20 @@
   if (strncmp (sect->name, ".module", 7))
     return;
 
-  buf = (char *) xmalloc (sect->_raw_size + 1);
+  buf = (char *) xmalloc (bfd_get_section_size (sect) + 1);
   if (!buf)
     {
       printf_unfiltered ("memory allocation failed for %s\n", sect->name);
       goto out;
     }
-  if (!bfd_get_section_contents (abfd, sect, buf, 0, sect->_raw_size))
+  if (!bfd_get_section_contents (abfd, sect, buf, 0, bfd_get_section_size (sect)))
     goto out;
 
   pstatus = (struct win32_pstatus *) buf;
 
   memmove (&base_addr, &(pstatus->data.module_info.base_address), sizeof (base_addr));
   dll_name_size = pstatus->data.module_info.module_name_size;
-  if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > sect->_raw_size)
+  if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > bfd_get_section_size (sect))
       goto out;
 
   dll_name = (char *) xmalloc (dll_name_size + 1);
@@ -2427,7 +2456,7 @@
 void
 _initialize_core_win32 (void)
 {
-  add_core_fns (&win32_elf_core_fns);
+  deprecated_add_core_fns (&win32_elf_core_fns);
 }
 
 void
diff --git a/gdb/wince.c b/gdb/wince.c
index f15bbd4..02df7a6 100644
--- a/gdb/wince.c
+++ b/gdb/wince.c
@@ -60,9 +60,6 @@
 #include "mips-tdep.h"
 #endif
 
-/* The ui's event loop. */
-extern int (*ui_loop_hook) (int signo);
-
 /* If we're not using the old Cygwin header file set, define the
    following which never should have been in the generic Win32 API
    headers in the first place since they were our own invention... */
@@ -1510,8 +1507,8 @@
       {
 	int detach = 0;
 
-	if (ui_loop_hook != NULL)
-	  detach = ui_loop_hook (0);
+	if (deprecated_ui_loop_hook != NULL)
+	  detach = deprecated_ui_loop_hook (0);
 
 	if (detach)
 	  child_kill_inferior ();
@@ -1720,7 +1717,8 @@
    ALLARGS is a string containing the arguments to the program.
    ENV is the environment vector to pass.  Errors reported with error().  */
 static void
-child_create_inferior (char *exec_file, char *args, char **env)
+child_create_inferior (char *exec_file, char *args, char **env,
+		       int from_tty)
 {
   PROCESS_INFORMATION pi;
   struct target_waitstatus dummy;
diff --git a/gdb/xcoffsolib.c b/gdb/xcoffsolib.c
index 99d2cc8..62426c9 100644
--- a/gdb/xcoffsolib.c
+++ b/gdb/xcoffsolib.c
@@ -48,11 +48,11 @@
     if (vp->tstart <= addr && addr < vp->tend)
       {
 	xfree (buffer);
-	xasprintf (&buffer, "%s%s%s%s",
-			    vp->name,
-			    *vp->member ? "(" : "",
-			    vp->member,
-			    *vp->member ? ")" : "");
+	buffer = xstrprintf ("%s%s%s%s",
+			     vp->name,
+			     *vp->member ? "(" : "",
+			     vp->member,
+			     *vp->member ? ")" : "");
 	return buffer;
       }
   return NULL;
diff --git a/gdb/xmodem.c b/gdb/xmodem.c
deleted file mode 100644
index 7b8d77d..0000000
--- a/gdb/xmodem.c
+++ /dev/null
@@ -1,275 +0,0 @@
-/* XMODEM support for GDB, the GNU debugger.
-   Copyright 1995, 2000, 2001 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include "defs.h"
-#include "serial.h"
-#include "target.h"
-#include "xmodem.h"
-
-/* These definitions are for xmodem protocol. */
-
-#define SOH	0x01
-#define STX	0x02
-#define ACK	0x06
-#define NAK	0x15
-#define EOT	0x04
-#define CANCEL	0x18
-
-static int blknum;		/* XMODEM block number */
-static int crcflag;		/* Sez we are using CRC's instead of cksums */
-
-static int
-readchar (struct serial *desc, int timeout)
-{
-  int c;
-
-  c = serial_readchar (desc, timeout);
-
-  if (remote_debug > 0)
-    fputc_unfiltered (c, gdb_stdlog);
-
-  if (c >= 0)
-    return c;
-
-  if (c == SERIAL_TIMEOUT)
-    error ("Timeout reading from remote system.");
-
-  perror_with_name ("xmodem.c:readchar()");
-}
-
-#define CRC16 0x1021		/* Generator polynomial (X^16 + X^12 + X^5 + 1) */
-
-static unsigned short *crctab;
-
-/* Call this to init the fast CRC-16 calculation table.  */
-
-static void
-crcinit (void)
-{
-  static int crctab_inited = 0;
-  int val;
-
-  if (crctab_inited == 1)
-    return;
-
-  crctab = xmalloc (256 * sizeof (short));
-
-  for (val = 0; val <= 255; val++)
-    {
-      int i;
-      unsigned int crc;
-
-      crc = val << 8;
-
-      for (i = 0; i < 8; ++i)
-	{
-	  crc <<= 1;
-
-	  if (crc & 0x10000)
-	    crc ^= CRC16;
-	}
-
-      crctab[val] = crc;
-    }
-
-  crctab_inited = 1;
-}
-
-/* Calculate a CRC-16 for the LEN byte message pointed at by P.  */
-
-static unsigned short
-docrc (unsigned char *p, int len)
-{
-  unsigned short crc = 0;
-
-  while (len-- > 0)
-    crc = (crc << 8) ^ crctab[(crc >> 8) ^ *p++];
-
-  return crc;
-}
-
-/* Start up the transmit process.  Reset state variables.  Wait for receiver to
-   send NAK or CRC request.  */
-
-int
-xmodem_init_xfer (struct serial *desc)
-{
-  int c;
-  int i;
-
-  blknum = 1;
-  crcflag = 0;
-  crcinit ();
-
-  for (i = 1; i <= 10; i++)
-    {
-      c = readchar (desc, 6);
-
-      switch (c)
-	{
-	case 'C':
-	  crcflag = 1;
-	case NAK:
-	  return 0;
-	default:
-	  fprintf_unfiltered (gdb_stderr, "xmodem_init_xfer: Got unexpected character %c (0%o)\n", c, c);
-	  continue;
-	case CANCEL:		/* target aborted load */
-	  fprintf_unfiltered (gdb_stderr, "Got a CANCEL from the target.\n");
-	  continue;
-	}
-    }
-  error ("xmodem_init_xfer:  Too many unexpected characters.");
-}
-
-/* Take 128 bytes of data and make a packet out of it.
-
- *      Each packet looks like this:
- *      +-----+-------+-------+------+-----+
- *      | SOH | Seq1. | Seq2. | data | SUM |
- *      +-----+-------+-------+------+-----+
- *      SOH  = 0x01
- *      Seq1 = The sequence number.
- *      Seq2 = The complement of the sequence number.
- *      Data = A 128 bytes of data.
- *      SUM  = Add the contents of the 128 bytes and use the low-order
- *             8 bits of the result.
- *
- * send_xmodem_packet fills in the XMODEM fields of PACKET and sends it to the
- * remote system.  PACKET must be XMODEM_PACKETSIZE bytes long.  The data must
- * start 3 bytes after the beginning of the packet to leave room for the
- * XMODEM header.  LEN is the length of the data portion of the packet (and
- * must be <= 128 bytes).  If it is < 128 bytes, ^Z padding will be added.
- */
-
-void
-xmodem_send_packet (struct serial *desc, unsigned char *packet, int len, int hashmark)
-{
-  int i;
-  int retries;
-  int pktlen;
-  int datasize;
-
-  /* build the packet header */
-
-  packet[1] = blknum;
-  packet[2] = ~blknum;
-
-  blknum++;
-
-  if (len <= XMODEM_DATASIZE)
-    {
-      packet[0] = SOH;
-      datasize = XMODEM_DATASIZE;
-    }
-  else if (len <= XMODEM_1KDATASIZE)
-    {
-      packet[0] = STX;
-      datasize = XMODEM_1KDATASIZE;
-    }
-  else
-    internal_error (__FILE__, __LINE__, "failed internal consistency check");			/* Packet way too large */
-
-  /* Add ^Z padding if packet < 128 (or 1024) bytes */
-
-  memset (packet + 3 + len, '\026', datasize - len);
-
-  if (crcflag)
-    {
-      int crc;
-
-      crc = docrc (packet + 3, datasize);
-
-      packet[3 + datasize] = crc >> 8;
-      packet[3 + datasize + 1] = crc;
-      pktlen = datasize + 5;
-    }
-  else
-    {
-      int sum;
-
-      sum = 0;
-      for (i = 3; i < datasize + 3; i++)
-	sum += packet[i];
-
-      packet[3 + datasize] = sum;	/* add the checksum */
-      pktlen = datasize + 4;
-    }
-
-  for (retries = 3; retries >= 0; retries--)
-    {
-      int c;
-
-      serial_write (desc, packet, pktlen);
-
-      c = readchar (desc, 3);
-      switch (c)
-	{
-	case ACK:
-	  return;
-	case NAK:
-	  if (!hashmark)
-	    continue;
-	  putchar_unfiltered ('-');
-	  gdb_flush (gdb_stdout);
-	  continue;
-	case CANCEL:
-	  error ("xmodem_send_packet: Transfer aborted by receiver.");
-	default:
-	  fprintf_unfiltered (gdb_stderr, "xmodem_send_packet: Got unexpected character %c (0%o)\n", c, c);
-	  continue;
-	}
-    }
-
-  serial_write (desc, "\004", 1);	/* Send an EOT */
-
-  error ("xmodem_send_packet:  Excessive retries.");
-}
-
-/* Finish off the transfer.  Send out the EOT, and wait for an ACK.  */
-
-void
-xmodem_finish_xfer (struct serial *desc)
-{
-  int retries;
-
-  for (retries = 10; retries >= 0; retries--)
-    {
-      int c;
-
-      serial_write (desc, "\004", 1);	/* Send an EOT */
-
-      c = readchar (desc, 3);
-      switch (c)
-	{
-	case ACK:
-	  return;
-	case NAK:
-	  continue;
-	case CANCEL:
-	  error ("xmodem_finish_xfer: Transfer aborted by receiver.");
-	default:
-	  fprintf_unfiltered (gdb_stderr, "xmodem_send_packet: Got unexpected character %c (0%o)\n", c, c);
-	  continue;
-	}
-    }
-
-  error ("xmodem_finish_xfer:  Excessive retries.");
-}
diff --git a/gdb/xmodem.h b/gdb/xmodem.h
deleted file mode 100644
index 83aa24f..0000000
--- a/gdb/xmodem.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* XMODEM support for GDB, the GNU debugger.
-   Copyright 1995, 2000 Free Software Foundation, Inc.
-
-   This file is part of GDB.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-struct serial;
-
-int xmodem_init_xfer (struct serial *desc);
-void send_xmodem_packet (struct serial *desc, unsigned char *packet, int len,
-			 int hashmark);
-void xmodem_finish_xfer (struct serial *desc);
-
-#define XMODEM_DATASIZE	128	/* The data size is ALWAYS 128 */
-#define XMODEM_1KDATASIZE 1024	/* Unless it's 1024!!! */
-#define XMODEM_PACKETSIZE 133	/* data + packet headers and crc */
-#define XMODEM_1KPACKETSIZE 1024 + 5	/* data + packet headers and crc */
-#define XMODEM_DATAOFFSET 3	/* Offset to start of actual data */
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index 9e7b016..384b8f1 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -167,16 +167,116 @@
 }
 
 /* Function: xstormy16_get_saved_register
-   Find a register's saved value on the call stack. */
+   Find a register's saved value on the call stack.
+
+   Find register number REGNUM relative to FRAME and put its (raw,
+   target format) contents in *RAW_BUFFER.
+
+   Set *OPTIMIZED if the variable was optimized out (and thus can't be
+   fetched).  Note that this is never set to anything other than zero
+   in this implementation.
+
+   Set *LVAL to lval_memory, lval_register, or not_lval, depending on
+   whether the value was fetched from memory, from a register, or in a
+   strange and non-modifiable way (e.g. a frame pointer which was
+   calculated rather than fetched).  We will use not_lval for values
+   fetched from generic dummy frames.
+
+   Set *ADDRP to the address, either in memory or as a
+   DEPRECATED_REGISTER_BYTE offset into the registers array.  If the
+   value is stored in a dummy frame, set *ADDRP to zero.
+
+   The argument RAW_BUFFER must point to aligned memory.
+
+   The GET_SAVED_REGISTER architecture interface is entirely
+   redundant.  New architectures should implement per-frame unwinders
+   (ref "frame-unwind.h").  */
 
 static void
-xstormy16_get_saved_register (char *raw_buffer,
-			      int *optimized,
+xstormy16_get_saved_register (char *raw_buffer, int *optimized,
 			      CORE_ADDR *addrp,
-			      struct frame_info *fi,
-			      int regnum, enum lval_type *lval)
+			      struct frame_info *frame, int regnum,
+			      enum lval_type *lval)
 {
-  deprecated_generic_get_saved_register (raw_buffer, optimized, addrp, fi, regnum, lval);
+  if (!target_has_registers)
+    error ("No registers.");
+
+  /* Normal systems don't optimize out things with register numbers.  */
+  if (optimized != NULL)
+    *optimized = 0;
+
+  if (addrp)			/* default assumption: not found in memory */
+    *addrp = 0;
+
+  /* Note: since the current frame's registers could only have been
+     saved by frames INTERIOR TO the current frame, we skip examining
+     the current frame itself: otherwise, we would be getting the
+     previous frame's registers which were saved by the current frame.  */
+
+  if (frame != NULL)
+    {
+      for (frame = get_next_frame (frame);
+	   get_frame_type (frame) != SENTINEL_FRAME;
+	   frame = get_next_frame (frame))
+	{
+	  if (get_frame_type (frame) == DUMMY_FRAME)
+	    {
+	      if (lval)		/* found it in a CALL_DUMMY frame */
+		*lval = not_lval;
+	      if (raw_buffer)
+		{
+		  LONGEST val;
+		  /* FIXME: cagney/2002-06-26: This should be via the
+		     gdbarch_register_read() method so that it, on the
+		     fly, constructs either a raw or pseudo register
+		     from the raw register cache.  */
+		  val = deprecated_read_register_dummy (get_frame_pc (frame),
+							get_frame_base (frame),
+							regnum);
+		  store_unsigned_integer (raw_buffer,
+					  DEPRECATED_REGISTER_RAW_SIZE (regnum),
+					  val);
+		}
+	      return;
+	    }
+
+	  DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
+	  if (deprecated_get_frame_saved_regs (frame) != NULL
+	      && deprecated_get_frame_saved_regs (frame)[regnum] != 0)
+	    {
+	      if (lval)		/* found it saved on the stack */
+		*lval = lval_memory;
+	      if (regnum == SP_REGNUM)
+		{
+		  if (raw_buffer)	/* SP register treated specially */
+		    /* NOTE: cagney/2003-05-09: In-line store_address()
+                       with it's body - store_unsigned_integer().  */
+		    store_unsigned_integer (raw_buffer,
+					    DEPRECATED_REGISTER_RAW_SIZE (regnum),
+					    deprecated_get_frame_saved_regs (frame)[regnum]);
+		}
+	      else
+		{
+		  if (addrp)	/* any other register */
+		    *addrp = deprecated_get_frame_saved_regs (frame)[regnum];
+		  if (raw_buffer)
+		    read_memory (deprecated_get_frame_saved_regs (frame)[regnum], raw_buffer,
+				 DEPRECATED_REGISTER_RAW_SIZE (regnum));
+		}
+	      return;
+	    }
+	}
+    }
+
+  /* If we get thru the loop to this point, it means the register was
+     not saved in any frame.  Return the actual live-register value.  */
+
+  if (lval)			/* found it in a live register */
+    *lval = lval_register;
+  if (addrp)
+    *addrp = DEPRECATED_REGISTER_BYTE (regnum);
+  if (raw_buffer)
+    deprecated_read_register_gen (regnum, raw_buffer);
 }
 
 /* Function: xstormy16_type_is_scalar
@@ -323,8 +423,7 @@
   if (fi == NULL)
     return;			/* paranoia */
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				   get_frame_base (fi)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
     {
       deprecated_pop_dummy_frame ();
     }
@@ -433,7 +532,7 @@
   int size = xstormy16_register_raw_size (regnum);
   char *buf = (char *) alloca (size);
 
-  deprecated_generic_get_saved_register (buf, NULL, NULL, fi, regnum, NULL);
+  xstormy16_get_saved_register (buf, NULL, NULL, fi, regnum, NULL);
   return (CORE_ADDR) extract_unsigned_integer (buf, size);
 }
 
@@ -460,8 +559,7 @@
   if (fi)
     {
       /* In a call dummy, don't touch the frame. */
-      if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				       get_frame_base (fi)))
+      if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
 	return start_addr;
 
       /* Grab the frame-relative values of SP and FP, needed below. 
@@ -749,8 +847,7 @@
 {
   CORE_ADDR saved_pc;
 
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				   get_frame_base (fi)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
     {
       saved_pc = deprecated_read_register_dummy (get_frame_pc (fi),
 						 get_frame_base (fi),
@@ -811,8 +908,7 @@
 static CORE_ADDR
 xstormy16_frame_chain (struct frame_info *fi)
 {
-  if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
-				   get_frame_base (fi)))
+  if (deprecated_pc_in_call_dummy (get_frame_pc (fi)))
     {
       /* Call dummy's frame is the same as caller's.  */
       return get_frame_base (fi);
@@ -1002,7 +1098,6 @@
 static struct gdbarch *
 xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 {
-  static LONGEST call_dummy_words[1] = { 0 };
   struct gdbarch_tdep *tdep = NULL;
   struct gdbarch *gdbarch;
 
@@ -1035,9 +1130,7 @@
   set_gdbarch_deprecated_register_bytes (gdbarch, E_ALL_REGS_SIZE);
   set_gdbarch_deprecated_register_byte (gdbarch, xstormy16_register_byte);
   set_gdbarch_deprecated_register_raw_size (gdbarch, xstormy16_register_raw_size);
-  set_gdbarch_deprecated_max_register_raw_size (gdbarch, xstormy16_pc_size);
   set_gdbarch_deprecated_register_virtual_size (gdbarch, xstormy16_register_raw_size);
-  set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 4);
   set_gdbarch_deprecated_register_virtual_type (gdbarch, xstormy16_reg_virtual_type);
 
   /*
@@ -1074,10 +1167,7 @@
   set_gdbarch_deprecated_store_struct_return (gdbarch, xstormy16_store_struct_return);
   set_gdbarch_deprecated_store_return_value (gdbarch, xstormy16_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);
-  set_gdbarch_use_struct_convention (gdbarch,
-				     xstormy16_use_struct_convention);
-  set_gdbarch_deprecated_call_dummy_words (gdbarch, call_dummy_words);
-  set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, 0);
+  set_gdbarch_deprecated_use_struct_convention (gdbarch, xstormy16_use_struct_convention);
   set_gdbarch_breakpoint_from_pc (gdbarch, xstormy16_breakpoint_from_pc);
 
   set_gdbarch_char_signed (gdbarch, 0);
diff --git a/include/ChangeLog b/include/ChangeLog
index 7f60004..fd340f0 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,39 @@
+2004-07-07  Tomer Levi  <Tomer.Levi@nsc.com>
+
+	* dis-asm.h (print_insn_crx): Declare.
+
+2004-06-24  Alan Modra  <amodra@bigpond.net.au>
+
+	* bfdlink.h (struct bfd_link_order): Update comment.
+
+2004-05-11  Jakub Jelinek  <jakub@redhat.com>
+
+	* bfdlink.h (struct bfd_link_info): Add relro, relro_start and
+	relro_end fields.
+	* elf/common.h (PT_GNU_EH_FRAME, PT_GNU_STACK): Add comments.
+	(PT_GNU_RELRO): Define.
+
+2004-05-04  Andreas Jaeger  <aj@suse.de>
+
+	* demangle.h: Do not use C++ reserved keyword typename as
+	parameter for cplus_demangle_fill_builtin_type.
+
+2004-04-22  Richard Henderson  <rth@redhat.com>
+
+	* hashtab.h (struct htab): Add size_prime_index.
+
+2004-04-13  Jeff Law  <law@redhat.com>
+
+	* hashtab.h (htab_remove_elt_with_hash): Prototype new function.
+
+2004-03-30  Zack Weinberg  <zack@codesourcery.com>
+
+	* hashtab.h, splay-tree.h: Use new shorter form of GTY markers.
+
+2004-03-25  Stan Shebs  <shebs@apple.com>
+
+	* mpw/: Remove subdirectory and everything in it.
+
 2004-03-23  Alan Modra  <amodra@bigpond.net.au>
 
 	PR 51.
diff --git a/include/bfdlink.h b/include/bfdlink.h
index cc2043e..9a57dfe 100644
--- a/include/bfdlink.h
+++ b/include/bfdlink.h
@@ -302,6 +302,9 @@
      flags.  */
   unsigned int noexecstack: 1;
 
+  /* TRUE if PT_GNU_RELRO segment should be created.  */
+  unsigned int relro: 1;
+
   /* What to do with unresolved symbols in an object file.
      When producing executables the default is GENERATE_ERROR.
      When producing shared libraries the default is IGNORE.  The
@@ -391,6 +394,9 @@
 
   /* May be used to set DT_FLAGS_1 for ELF. */
   bfd_vma flags_1;
+
+  /* Start and end of RELRO region.  */
+  bfd_vma relro_start, relro_end;
 };
 
 /* This structures holds a set of callback functions.  These are
@@ -550,7 +556,7 @@
 	  /* Section to include.  If this is used, then
 	     section->output_section must be the section the
 	     link_order is attached to, section->output_offset must
-	     equal the link_order offset field, and section->_raw_size
+	     equal the link_order offset field, and section->size
 	     must equal the link_order size field.  Maybe these
 	     restrictions should be relaxed someday.  */
 	  asection *section;
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index 3316383..d5f9737 100644
--- a/include/coff/ChangeLog
+++ b/include/coff/ChangeLog
@@ -1,3 +1,13 @@
+2004-04-23  Chris Demetriou  <cgd@broadcom.com>
+
+	* mips.h (MIPS_R_RELHI, MIPS_R_RELLO, MIPS_R_SWITCH): Remove
+	(MIPS_R_PCREL16): Update comment.
+	* ecoff.h (struct ecoff_value_adjust): Remove structure.
+	(struct ecoff_debug_info): Remove 'adjust' member.
+
+2004-04-20  DJ Delorie  <dj@redhat.com>
+
+	* internal.h (R_SECREL32): Add.
 
 For older changes see ChangeLog-9103
 
diff --git a/include/coff/ecoff.h b/include/coff/ecoff.h
index 3a7aa4f..1a39fcb 100644
--- a/include/coff/ecoff.h
+++ b/include/coff/ecoff.h
@@ -322,34 +322,6 @@
      this changes in the future.  This is a pointer to an array, not a
      single structure.  */
   FDR *fdr;
-
-  /* When relaxing MIPS embedded PIC code, we may need to adjust
-     symbol values when they are output.  This is a linked list of
-     structures indicating how values should be adjusted.  There is no
-     requirement that the entries be in any order, or that they not
-     overlap.  This field is normally NULL, in which case no
-     adjustments need to be made.  */
-  struct ecoff_value_adjust *adjust;
-};
-
-/* This structure describes how to adjust symbol values when
-   outputting MIPS embedded PIC code.  These adjustments only apply to
-   the internal symbols, as the external symbol values will come from
-   the hash table and have already been adjusted.  */
-
-struct ecoff_value_adjust
-{
-  /* Next entry on adjustment list.  */
-  struct ecoff_value_adjust *next;
-  /* Starting VMA of adjustment.  This is the VMA in the ECOFF file,
-     not the offset from the start of the section.  Thus it should
-     indicate a particular section.  */
-  bfd_vma start;
-  /* Ending VMA of adjustment.  */
-  bfd_vma end;
-  /* Adjustment.  This should be added to the value of the symbol, or
-     FDR.  This is zero for the last entry in the array.  */
-  long adjust;
 };
 
 /* These structures are used by the ECOFF find_nearest_line function.  */
diff --git a/include/coff/internal.h b/include/coff/internal.h
index 2d41bf9..710e932 100644
--- a/include/coff/internal.h
+++ b/include/coff/internal.h
@@ -607,6 +607,7 @@
 #define R_REL24          5
 #define R_DIR32 	 6
 #define R_IMAGEBASE	 7
+#define R_SECREL32	11
 #define R_RELBYTE	15
 #define R_RELWORD	16
 #define R_RELLONG	17
diff --git a/include/coff/mips.h b/include/coff/mips.h
index b9503bd..bec8da2 100644
--- a/include/coff/mips.h
+++ b/include/coff/mips.h
@@ -105,34 +105,10 @@
 #define MIPS_R_GPREL	6
 #define MIPS_R_LITERAL	7
 
-/* These reloc types are a Cygnus extension used when generating
-   position independent code for embedded systems.  The numbers are
-   taken from Irix 4, but at least for internal relocs Irix 5 does not
-   give them the same meaning.  For an internal reloc the symbol index
-   of RELHI and RELLO is modified as described below for
-   MIPS_R_SWITCH.  */
+/* FIXME: This relocation is used (internally only) to represent branches
+   when assembling.  It should never appear in output files, and  
+   be removed.  (It used to be used for embedded-PIC support.)  */
 #define MIPS_R_PCREL16	12
-#define MIPS_R_RELHI	13
-#define MIPS_R_RELLO	14
-
-/* This reloc type is a Cygnus extension used when generating position
-   independent code for embedded systems.  It is used for an entry in
-   a switch table, which looks like this:
-     .word $L3-$LS12
-   The object file will contain the correct difference, and does not
-   require adjustment.  However, when the linker is relaxing PC
-   relative calls, it is possible for $L3 to move farther away.  This
-   reloc always appears in the .text section, and is always against
-   the .text section.  However, the symbol index is not
-   RELOC_SECTION_TEXT.  It is, instead, the distance between this
-   switch table entry and $LS12.  Thus, the original value of $L12 is
-     vaddr - symndx
-   and the original value of $L3 is
-     vaddr - symndx + addend
-   where addend is the value in the object file.  Knowing this, the
-   linker can know whether the addend in the object file must be
-   adjusted.  */
-#define MIPS_R_SWITCH	22
 
 /********************** STABS **********************/
 
diff --git a/include/demangle.h b/include/demangle.h
index 6e995e4..b3b8c58 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -458,7 +458,7 @@
 
 extern int
 cplus_demangle_fill_builtin_type PARAMS ((struct demangle_component *fill,
-					  const char *typename));
+					  const char *type_name));
 
 /* Fill in a DEMANGLE_COMPONENT_OPERATOR, using the name of the
    operator and the number of arguments which it takes (the latter is
diff --git a/include/dis-asm.h b/include/dis-asm.h
index 3670c51..7171c84 100644
--- a/include/dis-asm.h
+++ b/include/dis-asm.h
@@ -224,6 +224,7 @@
 extern int print_insn_mn10300		(bfd_vma, disassemble_info *);
 extern int print_insn_msp430		(bfd_vma, disassemble_info *);
 extern int print_insn_ns32k		(bfd_vma, disassemble_info *);
+extern int print_insn_crx               (bfd_vma, disassemble_info *);
 extern int print_insn_openrisc		(bfd_vma, disassemble_info *);
 extern int print_insn_big_or32		(bfd_vma, disassemble_info *);
 extern int print_insn_little_or32	(bfd_vma, disassemble_info *);
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog
index 385b857..5563ddb 100644
--- a/include/elf/ChangeLog
+++ b/include/elf/ChangeLog
@@ -1,3 +1,47 @@
+2004-07-06  Tomer Levi  <Tomer.Levi@nsc.com>
+
+	* common.h (EM_CRX): Define.
+	* crx.h: New file.
+
+2004-06-25  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
+
+	* m32r.h: Add defintions of R_M32R_GOTOFF_HI_ULO,
+	R_M32R_GOTOFF_HI_SLO and R_M32R_GOTOFF_LO.
+
+2004-06-19  Alan Modra  <amodra@bigpond.net.au>
+
+	* common.h (ELF64_R_INFO): Warning fix.
+
+2004-06-14  Chris Demetriou  <cgd@broadcom.com>
+
+	* mips.h (R_MIPS_PC32): Add back (undoing removal on 2004-04-24),
+	with an updated comment.
+
+2004-05-28  Andrew Stubbs <andrew.stubbs@superh.com>
+
+	* sh.h (EF_SH_HAS_DSP): Remove.
+	(EF_SH_HAS_FP): Remove.
+	(EF_SH_MERGE_MACH): Remove.
+	(EF_SH4_NOFPU): Convert to decimal.
+	(EF_SH4A_NOFPU): Likewise.
+	(EF_SH4_NOMMU_NOFPU): Likewise.
+	(EF_SH3_NOMMU): Add new macro.
+	(EF_SH_BFD_TABLE): Likewise.
+	(sh_find_elf_flags): Add prototype.
+	(sh_elf_get_flags_from_mach): Likewise.
+
+2004-04-24  Chris Demetriou  <cgd@broadcom.com>
+
+	* mips.h (R_MIPS_PC32, R_MIPS_PC64, R_MIPS_GNU_REL_LO16)
+	(R_MIPS_GNU_REL_HI16): Remove.
+	(R_MIPS_GNU_REL16_S2): Update comment.
+
+2004-30-30  Galit Heller  <Galit.Heller@nsc.com>
+            Tomer Levi  <Tomer.Levi@nsc.com>
+
+	* common.h (EM_CR): Define.
+	* cr16c.h: New file.
+
 2004-03-23  Paul Brook  <paul@codesourcery.com>
 
 	* arm.h (EF_ERM_BE8, EF_ARM_LE8, EF_ARM_EABI_VER3): Add.
diff --git a/include/elf/common.h b/include/elf/common.h
index bf233f6..5573fca 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -1,6 +1,6 @@
 /* ELF support for BFD.
    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003
+   2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    Written by Fred Fish @ Cygnus Support, from information published
@@ -180,7 +180,9 @@
 #define EM_ARC_A5	 93	/* ARC Cores Tangent-A5 */
 #define EM_XTENSA	 94	/* Tensilica Xtensa Architecture */
 #define EM_IP2K		101	/* Ubicom IP2022 micro controller */
+#define EM_CR		103	/* National Semiconductor CompactRISC */
 #define EM_MSP430	105	/* TI msp430 micro controller */
+#define EM_CRX		114	/* National Semiconductor CRX */
 
 /* If it is necessary to assign new unofficial EM_* values, please pick large
    random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision
@@ -287,8 +289,9 @@
 #define PT_LOPROC	0x70000000	/* Processor-specific */
 #define PT_HIPROC	0x7FFFFFFF	/* Processor-specific */
 
-#define PT_GNU_EH_FRAME	(PT_LOOS + 0x474e550)
-#define PT_GNU_STACK	(PT_LOOS + 0x474e551)
+#define PT_GNU_EH_FRAME	(PT_LOOS + 0x474e550) /* Frame unwind information */
+#define PT_GNU_STACK	(PT_LOOS + 0x474e551) /* Stack flags */
+#define PT_GNU_RELRO	(PT_LOOS + 0x474e552) /* Read-only after relocation */
 
 /* Program segment permissions, in program header p_flags field.  */
 
@@ -493,7 +496,7 @@
 
 #define ELF64_R_SYM(i)		((i) >> 32)
 #define ELF64_R_TYPE(i)		((i) & 0xffffffff)
-#define ELF64_R_INFO(s,t)	(((bfd_vma) (s) << 32) + (bfd_vma) (t))
+#define ELF64_R_INFO(s,t)	(((bfd_vma) (s) << 31 << 1) + (bfd_vma) (t))
 
 /* Dynamic section tags.  */
 
diff --git a/include/elf/cr16c.h b/include/elf/cr16c.h
new file mode 100644
index 0000000..1a91afe
--- /dev/null
+++ b/include/elf/cr16c.h
@@ -0,0 +1,258 @@
+/* CR16C ELF support for BFD.
+   Copyright 2004 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_CR16C_H
+#define _ELF_CR16C_H
+
+#include "bfd.h"
+#include "elf/reloc-macros.h"
+
+/* Creating indices for reloc_map_index array.  */
+START_RELOC_NUMBERS (elf_cr16c_reloc_type)
+     RELOC_NUMBER (RINDEX_16C_NUM08,		0)
+     RELOC_NUMBER (RINDEX_16C_NUM08_C,		1)
+     RELOC_NUMBER (RINDEX_16C_NUM16,		2)
+     RELOC_NUMBER (RINDEX_16C_NUM16_C,		3)
+     RELOC_NUMBER (RINDEX_16C_NUM32,		4)
+     RELOC_NUMBER (RINDEX_16C_NUM32_C,		5)
+     RELOC_NUMBER (RINDEX_16C_DISP04,		6)
+     RELOC_NUMBER (RINDEX_16C_DISP04_C,		7)
+     RELOC_NUMBER (RINDEX_16C_DISP08,		8)
+     RELOC_NUMBER (RINDEX_16C_DISP08_C,		9)
+     RELOC_NUMBER (RINDEX_16C_DISP16,		10)
+     RELOC_NUMBER (RINDEX_16C_DISP16_C,		11)
+     RELOC_NUMBER (RINDEX_16C_DISP24,		12)
+     RELOC_NUMBER (RINDEX_16C_DISP24_C,		13)
+     RELOC_NUMBER (RINDEX_16C_DISP24a,		14)
+     RELOC_NUMBER (RINDEX_16C_DISP24a_C,	15)
+     RELOC_NUMBER (RINDEX_16C_REG04,		16)
+     RELOC_NUMBER (RINDEX_16C_REG04_C,		17)
+     RELOC_NUMBER (RINDEX_16C_REG04a,		18)
+     RELOC_NUMBER (RINDEX_16C_REG04a_C,		19)
+     RELOC_NUMBER (RINDEX_16C_REG14,		20)
+     RELOC_NUMBER (RINDEX_16C_REG14_C,		21)
+     RELOC_NUMBER (RINDEX_16C_REG16,		22)
+     RELOC_NUMBER (RINDEX_16C_REG16_C,		23)
+     RELOC_NUMBER (RINDEX_16C_REG20,		24)
+     RELOC_NUMBER (RINDEX_16C_REG20_C,		25)
+     RELOC_NUMBER (RINDEX_16C_ABS20,		26)
+     RELOC_NUMBER (RINDEX_16C_ABS20_C,		27)
+     RELOC_NUMBER (RINDEX_16C_ABS24,		28)
+     RELOC_NUMBER (RINDEX_16C_ABS24_C,		29)
+     RELOC_NUMBER (RINDEX_16C_IMM04,		30)
+     RELOC_NUMBER (RINDEX_16C_IMM04_C,		31)
+     RELOC_NUMBER (RINDEX_16C_IMM16,		32)
+     RELOC_NUMBER (RINDEX_16C_IMM16_C,		33)
+     RELOC_NUMBER (RINDEX_16C_IMM20,		34)
+     RELOC_NUMBER (RINDEX_16C_IMM20_C,		35)
+     RELOC_NUMBER (RINDEX_16C_IMM24,		36)
+     RELOC_NUMBER (RINDEX_16C_IMM24_C,		37)
+     RELOC_NUMBER (RINDEX_16C_IMM32,		38)
+     RELOC_NUMBER (RINDEX_16C_IMM32_C,		39)
+END_RELOC_NUMBERS (RINDEX_16C_MAX)
+
+/* CR16C Relocation Types ('cr_reloc_type' entry in the reloc_map structure).
+   The relocation constant name is determined as follows :
+
+   R_16C_<format><size>[_C]
+
+   Where :
+
+     <format> is one of the following:
+	NUM  - R_NUMBER mnemonic,
+	DISP - R_16C_DISPL mnemonic,
+	REG  - R_16C_REGREL mnemonic,
+	ABS  - R_16C_ABS mnemonic,
+	IMM  - R_16C_IMMED mnemonic,
+     <size> stands for R_S_16C_<size> 
+     _C means 'code label' and is only added when R_ADDRTYPE subfield 
+     is of type R_CODE_ADDR.  */
+   
+/* The table below shows what the hex digits in the definition of the
+   relocation type constants correspond to.
+   ------------------------------------------------------------------
+	R_SIZESP	R_FORMAT	R_RELTO	      R_ADDRTYPE
+   ------------------------------------------------------------------  */
+/*	R_S_16C_08	R_NUMBER 	R_ABS 	      R_ADDRESS */
+#define R_16C_NUM08	0X0001
+
+/*	R_S_16C_08	R_NUMBER 	R_ABS 	      R_CODE_ADDR */
+#define R_16C_NUM08_C	0X0006
+
+/*	R_S_16C_16	R_NUMBER 	R_ABS 	      R_ADDRESS */
+#define R_16C_NUM16	0X1001
+
+/*	R_S_16C_16	R_NUMBER 	R_ABS 	      R_CODE_ADDR */
+#define R_16C_NUM16_C 	0X1006
+
+/*      R_S_16C_32      R_NUMBER	R_ABS	      R_ADDRESS */
+#define R_16C_NUM32     0X2001
+
+/*      R_S_16C_32      R_NUMBER	R_ABS	      R_CODE_ADDR */
+#define R_16C_NUM32_C   0X2006
+
+/*	R_S_16C_04	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
+#define R_16C_DISP04	0X5411
+
+/*	R_S_16C_04	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
+#define R_16C_DISP04_C	0X5416
+
+/*	R_S_16C_08	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
+#define R_16C_DISP08	0X0411
+
+/*	R_S_16C_08	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
+#define R_16C_DISP08_C	0X0416
+
+/*	R_S_16C_16	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
+#define R_16C_DISP16	0X1411
+
+/*	R_S_16C_16	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
+#define R_16C_DISP16_C	0X1416
+
+/*	R_S_16C_24	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
+#define R_16C_DISP24	0X7411
+
+/*	R_S_16C_24	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
+#define R_16C_DISP24_C	0X7416
+
+/*	R_S_16C_24a	R_16C_DISPL 	R_PCREL	      R_ADDRESS */
+#define R_16C_DISP24a	0X6411
+
+/*	R_S_16C_24a	R_16C_DISPL 	R_PCREL	      R_CODE_ADDR */
+#define R_16C_DISP24a_C	0X6416
+
+/*	R_S_16C_04	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
+#define R_16C_REG04	0X5201
+
+/*	R_S_16C_04	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
+#define R_16C_REG04_C	0X5206
+
+/*	R_S_16C_04_a	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
+#define R_16C_REG04a	0X4201
+
+/*	R_S_16C_04_a	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
+#define R_16C_REG04a_C	0X4206
+
+/*	R_S_16C_14	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
+#define R_16C_REG14	0X3201
+
+/*	R_S_16C_14	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
+#define R_16C_REG14_C	0X3206
+
+/*	R_S_16C_16	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
+#define R_16C_REG16	0X1201
+
+/*	R_S_16C_16	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
+#define R_16C_REG16_C	0X1206
+
+/*	R_S_16C_20	R_16C_REGREL 	R_ABS 	      R_ADDRESS */
+#define R_16C_REG20	0X8201
+
+/*	R_S_16C_20	R_16C_REGREL 	R_ABS 	      R_CODE_ADDR */
+#define R_16C_REG20_C	0X8206
+
+/*      R_S_16C_20      R_16C_ABS	R_ABS	      R_ADDRESS */
+#define R_16C_ABS20     0X8101
+
+/*      R_S_16C_20      R_16C_ABS	R_ABS	      R_CODE_ADDR */
+#define R_16C_ABS20_C   0X8106
+
+/*      R_S_16C_24      R_16C_ABS	R_ABS	      R_ADDRESS */
+#define R_16C_ABS24     0X7101
+
+/*      R_S_16C_24      R_16C_ABS	R_ABS	      R_CODE_ADDR */
+#define R_16C_ABS24_C   0X7106
+
+/*      R_S_16C_04      R_16C_IMMED	R_ABS	      R_ADDRESS */
+#define R_16C_IMM04     0X5301
+
+/*      R_S_16C_04      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
+#define R_16C_IMM04_C   0X5306
+
+/*      R_S_16C_16      R_16C_IMMED	R_ABS	      R_ADDRESS */
+#define R_16C_IMM16     0X1301
+
+/*      R_S_16C_16      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
+#define R_16C_IMM16_C   0X1306
+
+/*      R_S_16C_20      R_16C_IMMED	R_ABS	      R_ADDRESS */
+#define R_16C_IMM20     0X8301
+
+/*      R_S_16C_20      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
+#define R_16C_IMM20_C   0X8306
+
+/*      R_S_16C_24      R_16C_IMMED	R_ABS	      R_ADDRESS */
+#define R_16C_IMM24     0X7301
+
+/*      R_S_16C_24      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
+#define R_16C_IMM24_C   0X7306
+
+/*      R_S_16C_32      R_16C_IMMED	R_ABS	      R_ADDRESS */
+#define R_16C_IMM32     0X2301
+
+/*      R_S_16C_32      R_16C_IMMED	R_ABS	      R_CODE_ADDR */
+#define R_16C_IMM32_C   0X2306
+
+
+/* Relocation item type.  */
+#define   R_ADDRTYPE	 0x000f
+#define   R_ADDRESS      0x0001    /* Take address of symbol.  */
+#define   R_CODE_ADDR    0x0006    /* Take address of symbol divided by 2.  */
+
+/* Relocation action.  */
+#define   R_RELTO        0x00f0
+#define   R_ABS          0x0000    /* Keep symbol's address as such.  */
+#define   R_PCREL        0x0010    /* Subtract the pc address of hole.  */
+
+/* Relocation item data format.  */
+#define   R_FORMAT       0x0f00
+#define   R_NUMBER       0x0000    /* Retain as two's complement value.  */
+#define   R_16C_DISPL    0x0400    /* CR16C displacement type.  */
+#define   R_16C_ABS      0x0100    /* CR16C absolute type.  */
+#define   R_16C_REGREL   0x0200    /* CR16C register-relative type.  */
+#define   R_16C_IMMED    0x0300    /* CR16C immediate type.  */
+
+/* Relocation item size. */
+#define   R_SIZESP       0xf000
+#define   R_S_16C_04     0x5000
+#define   R_S_16C_04_a   0x4000
+#define   R_S_16C_08	 0x0000
+#define   R_S_16C_14     0x3000
+#define   R_S_16C_16	 0x1000
+#define   R_S_16C_20     0x8000
+#define   R_S_16C_24_a   0x6000
+#define   R_S_16C_24	 0x7000
+#define   R_S_16C_32     0x2000
+
+
+/* Processor specific section indices.  These sections do not actually
+   exist.  Symbols with a st_shndx field corresponding to one of these
+   values have a special meaning.  */
+
+/* Far common symbol.  */
+#define SHN_CR16C_FCOMMON	0xff00
+#define SHN_CR16C_NCOMMON	0xff01
+
+typedef struct reloc_map
+{
+  unsigned short            cr_reloc_type;  /* CR relocation type.  */
+  bfd_reloc_code_real_type  bfd_reloc_enum; /* BFD relocation enum.  */
+} RELOC_MAP;
+
+#endif /* _ELF_CR16C_H */
diff --git a/include/elf/crx.h b/include/elf/crx.h
new file mode 100644
index 0000000..755a610
--- /dev/null
+++ b/include/elf/crx.h
@@ -0,0 +1,50 @@
+/* CRX ELF support for BFD.
+   Copyright 2004 Free Software Foundation, Inc.
+   Contributed by Tomer Levi, NSC, Israel.
+   Originally written for GAS 2.12 by Tomer Levi, NSC, Israel.
+   Updates, BFDizing, GNUifying and ELF support by Tomer Levi.
+
+   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_CRX_H
+#define _ELF_CRX_H
+
+#include "elf/reloc-macros.h"
+
+/* Creating indices for reloc_map_index array.  */
+START_RELOC_NUMBERS(elf_crx_reloc_type)
+  RELOC_NUMBER (R_CRX_NONE,           0)
+  RELOC_NUMBER (R_CRX_REL4,           1)
+  RELOC_NUMBER (R_CRX_REL8,           2)
+  RELOC_NUMBER (R_CRX_REL8_CMP,       3)
+  RELOC_NUMBER (R_CRX_REL16,          4)
+  RELOC_NUMBER (R_CRX_REL24,          5)
+  RELOC_NUMBER (R_CRX_REL32,          6)
+  RELOC_NUMBER (R_CRX_REGREL12,       7)
+  RELOC_NUMBER (R_CRX_REGREL22,       8)
+  RELOC_NUMBER (R_CRX_REGREL28,       9)
+  RELOC_NUMBER (R_CRX_REGREL32,       10)
+  RELOC_NUMBER (R_CRX_ABS16,          11)
+  RELOC_NUMBER (R_CRX_ABS32,          12)
+  RELOC_NUMBER (R_CRX_NUM8,	      13)
+  RELOC_NUMBER (R_CRX_NUM16,          14)
+  RELOC_NUMBER (R_CRX_NUM32,          15)
+  RELOC_NUMBER (R_CRX_IMM16,	      16)
+  RELOC_NUMBER (R_CRX_IMM32,	      17)
+END_RELOC_NUMBERS(R_CRX_MAX)
+	
+#endif /* _ELF_CRX_H */
diff --git a/include/elf/m32r.h b/include/elf/m32r.h
index 709d792..6441efe 100644
--- a/include/elf/m32r.h
+++ b/include/elf/m32r.h
@@ -1,5 +1,5 @@
 /* M32R ELF support for BFD.
-   Copyright 1996, 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -67,6 +67,9 @@
   RELOC_NUMBER (R_M32R_GOTPC_HI_ULO, 59)
   RELOC_NUMBER (R_M32R_GOTPC_HI_SLO, 60)
   RELOC_NUMBER (R_M32R_GOTPC_LO, 61)
+  RELOC_NUMBER (R_M32R_GOTOFF_HI_ULO, 62)
+  RELOC_NUMBER (R_M32R_GOTOFF_HI_SLO, 63)
+  RELOC_NUMBER (R_M32R_GOTOFF_LO, 64)
 END_RELOC_NUMBERS (R_M32R_max)
 
 /* Processor specific section indices.  These sections do not actually
diff --git a/include/elf/mips.h b/include/elf/mips.h
index ce43158..b7d800a 100644
--- a/include/elf/mips.h
+++ b/include/elf/mips.h
@@ -76,12 +76,13 @@
   /* These relocs are used for the mips16.  */
   RELOC_NUMBER (R_MIPS16_26, 100)
   RELOC_NUMBER (R_MIPS16_GPREL, 101)
-  /* These are GNU extensions to handle embedded-pic.  */
+  /* This was a GNU extension used by embedded-PIC.  It was co-opted by
+     mips-linux for exception-handling data.  It is no longer used, but
+     should continue to be supported by the linker for backward
+     compatibility.  (GCC stopped using it in May, 2004.)  */
   RELOC_NUMBER (R_MIPS_PC32, 248)
-  RELOC_NUMBER (R_MIPS_PC64, 249)
+  /* FIXME: this relocation is used internally by gas.  */
   RELOC_NUMBER (R_MIPS_GNU_REL16_S2, 250)
-  RELOC_NUMBER (R_MIPS_GNU_REL_LO16, 251)
-  RELOC_NUMBER (R_MIPS_GNU_REL_HI16, 252)
   /* These are GNU extensions to enable C++ vtable garbage collection.  */
   RELOC_NUMBER (R_MIPS_GNU_VTINHERIT, 253)
   RELOC_NUMBER (R_MIPS_GNU_VTENTRY, 254)
diff --git a/include/elf/sh.h b/include/elf/sh.h
index c46a5ff..bab0928 100644
--- a/include/elf/sh.h
+++ b/include/elf/sh.h
@@ -27,57 +27,51 @@
 #define EF_SH1		   1
 #define EF_SH2		   2
 #define EF_SH3		   3
-#define EF_SH_HAS_DSP(flags) (((flags) & EF_SH_MACH_MASK & ~3) == 4)
 #define EF_SH_DSP	   4
 #define EF_SH3_DSP	   5
 #define EF_SH4AL_DSP	   6
-#define EF_SH_HAS_FP(flags) ((flags) & 8)
 #define EF_SH3E		   8
 #define EF_SH4		   9
 #define EF_SH2E            11
 #define EF_SH4A		   12
 
-#define EF_SH4_NOFPU	   0x10
-#define EF_SH4A_NOFPU	   0x11
-#define EF_SH4_NOMMU_NOFPU 0x12
+#define EF_SH4_NOFPU	   16
+#define EF_SH4A_NOFPU	   17
+#define EF_SH4_NOMMU_NOFPU 18
+#define EF_SH3_NOMMU       20
 
 /* This one can only mix in objects from other EF_SH5 objects.  */
 #define EF_SH5		  10
 
-#define EF_SH_MERGE_MACH(mach1, mach2) \
-  (((((mach1) == EF_SH3 || (mach1) == EF_SH_UNKNOWN) && (mach2) == EF_SH_DSP) \
-    || ((mach1) == EF_SH_DSP \
-	&& ((mach2) == EF_SH3 || (mach2) == EF_SH_UNKNOWN))) \
-   ? EF_SH3_DSP \
-   : (((mach1) < EF_SH3 && (mach2) == EF_SH_UNKNOWN) \
-      || ((mach2) < EF_SH3 && (mach1) == EF_SH_UNKNOWN)) \
-   ? EF_SH3 \
-   : ((mach1) == EF_SH2E && EF_SH_HAS_FP (mach2)) \
-   ? (mach2) \
-   : ((mach2) == EF_SH2E && EF_SH_HAS_FP (mach1)) \
-   ? (mach1) \
-   : (((mach1) == EF_SH2E && (mach2) == EF_SH_UNKNOWN) \
-      || ((mach2) == EF_SH2E && (mach1) == EF_SH_UNKNOWN)) \
-   ? EF_SH2E \
-   : (((mach1) == EF_SH3E && (mach2) == EF_SH_UNKNOWN) \
-      || ((mach2) == EF_SH3E && (mach1) == EF_SH_UNKNOWN)) \
-   ? EF_SH4 \
-   /* ??? SH4?  Why not SH3E?  */ \
-   : ((((mach1) == EF_SH4_NOFPU || (mach1) == EF_SH4A_NOFPU) \
-       && EF_SH_HAS_DSP (mach2)) \
-      || (((mach2) == EF_SH4_NOFPU || (mach2) == EF_SH4A_NOFPU) \
-	  && EF_SH_HAS_DSP (mach1))) \
-   ? EF_SH4AL_DSP \
-   : ((mach1) == EF_SH4_NOFPU && EF_SH_HAS_FP (mach2)) \
-   ? ((mach2) < EF_SH4A) ? EF_SH4 : (mach2) \
-   : ((mach2) == EF_SH4_NOFPU && EF_SH_HAS_FP (mach1)) \
-   ? ((mach1) < EF_SH4A) ? EF_SH4 : (mach1) \
-   : ((mach1) == EF_SH4A_NOFPU && EF_SH_HAS_FP (mach2)) \
-   ? ((mach2) <= EF_SH4A) ? EF_SH4A : (mach2) \
-   : ((mach2) == EF_SH4A_NOFPU && EF_SH_HAS_FP (mach1)) \
-   ? ((mach1) <= EF_SH4A) ? EF_SH4A : (mach1) \
-   : (((mach1) == EF_SH2E ? 7 : (mach1)) > ((mach2) == EF_SH2E ? 7 : (mach2)) \
-      ? (mach1) : (mach2)))
+/* Define the mapping from ELF to bfd mach numbers.
+   bfd_mach_* are defined in bfd_in2.h (generated from
+   archures.c).  */
+#define EF_SH_BFD_TABLE \
+/* EF_SH_UNKNOWN	*/ bfd_mach_sh3		, \
+/* EF_SH1		*/ bfd_mach_sh		, \
+/* EF_SH2		*/ bfd_mach_sh2		, \
+/* EF_SH3		*/ bfd_mach_sh3		, \
+/* EF_SH_DSP		*/ bfd_mach_sh_dsp	, \
+/* EF_SH3_DSP		*/ bfd_mach_sh3_dsp	, \
+/* EF_SHAL_DSP		*/ bfd_mach_sh4al_dsp	, \
+/* 7			*/ 0, \
+/* EF_SH3E		*/ bfd_mach_sh3e	, \
+/* EF_SH4		*/ bfd_mach_sh4		, \
+/* EF_SH5		*/ 0, \
+/* EF_SH2E		*/ bfd_mach_sh2e	, \
+/* EF_SH4A		*/ bfd_mach_sh4a	, \
+/* 13, 14, 15		*/ 0, 0, 0, \
+/* EF_SH4_NOFPU		*/ bfd_mach_sh4_nofpu	, \
+/* EF_SH4A_NOFPU	*/ bfd_mach_sh4a_nofpu	, \
+/* EF_SH4_NOMMU_NOFPU	*/ bfd_mach_sh4_nommu_nofpu, \
+/* 19			*/ 0, \
+/* EF_SH3_NOMMU		*/ bfd_mach_sh3_nommu
+
+/* Convert arch_sh* into EF_SH*.  */
+int sh_find_elf_flags (unsigned int arch_set);
+
+/* Convert bfd_mach_* into EF_SH*.  */
+int sh_elf_get_flags_from_mach (unsigned long mach);
 
 /* Flags for the st_other symbol field.
    Keep away from the STV_ visibility flags (bit 0..1).  */
diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog
index 3a17b1d..80a9e06 100644
--- a/include/gdb/ChangeLog
+++ b/include/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-25  J"orn Rennecke <joern.rennecke@superh.com>
+
+	* callback.h (host_callback_struct): Replace members fdopen and
+	alwaysopen with fd_buddy.
+	[sim/common: * callback.c: Changed all users.  ]
+
 2003-10-31  Kevin Buettner  <kevin@redhat.com>
 
 	* sim-frv.h: New file.
diff --git a/include/gdb/callback.h b/include/gdb/callback.h
index 3fa4191..aa956d0 100644
--- a/include/gdb/callback.h
+++ b/include/gdb/callback.h
@@ -123,8 +123,15 @@
   int last_errno;		/* host format */
 
   int fdmap[MAX_CALLBACK_FDS];
-  char fdopen[MAX_CALLBACK_FDS];
-  char alwaysopen[MAX_CALLBACK_FDS];
+  /* fd_buddy is used to contruct circular lists of target fds that point to
+     the same host fd.  A uniquely mapped fd points to itself; for a closed
+     one, fd_buddy has the value -1.  The host file descriptors for stdin /
+     stdout / stderr are never closed by the simulators, so they are put
+     in a special fd_buddy circular list which also has MAX_CALLBACK_FDS
+     as a member.  */
+  /* ??? We don't have a callback entry for dup, although it is trival to
+     implement now.  */
+  short fd_buddy[MAX_CALLBACK_FDS+1];
 
   /* System call numbers.  */
   CB_TARGET_DEFS_MAP *syscall_map;
diff --git a/include/hashtab.h b/include/hashtab.h
index f7bd4ae..de24ded 100644
--- a/include/hashtab.h
+++ b/include/hashtab.h
@@ -1,5 +1,5 @@
 /* An expandable hash tables datatype.  
-   Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Vladimir Makarov (vmakarov@cygnus.com).
 
 This program is free software; you can redistribute it and/or modify
@@ -99,15 +99,15 @@
   htab_del del_f;
 
   /* Table itself.  */
-  PTR * GTY ((use_param (""), length ("%h.size"))) entries;
+  PTR * GTY ((use_param, length ("%h.size"))) entries;
 
-  /* Current size (in entries) of the hash table */
+  /* Current size (in entries) of the hash table.  */
   size_t size;
 
-  /* Current number of elements including also deleted elements */
+  /* Current number of elements including also deleted elements.  */
   size_t n_elements;
 
-  /* Current number of deleted elements in the table */
+  /* Current number of deleted elements in the table.  */
   size_t n_deleted;
 
   /* The following member is used for debugging. Its value is number
@@ -123,9 +123,13 @@
   htab_free free_f;
 
   /* Alternate allocate/free functions, which take an extra argument.  */
-  PTR GTY((skip (""))) alloc_arg;
+  PTR GTY((skip)) alloc_arg;
   htab_alloc_with_arg alloc_with_arg_f;
   htab_free_with_arg free_with_arg_f;
+
+  /* Current size (in entries) of the hash table, as an index into the
+     table of primes.  */
+  unsigned int size_prime_index;
 };
 
 typedef struct htab *htab_t;
@@ -166,6 +170,7 @@
 						   enum insert_option));
 extern void	htab_clear_slot	PARAMS ((htab_t, void **));
 extern void	htab_remove_elt	PARAMS ((htab_t, void *));
+extern void	htab_remove_elt_with_hash PARAMS ((htab_t, void *, hashval_t));
 
 extern void	htab_traverse	PARAMS ((htab_t, htab_trav, void *));
 extern void	htab_traverse_noresize	PARAMS ((htab_t, htab_trav, void *));
diff --git a/include/mpw/ChangeLog b/include/mpw/ChangeLog
deleted file mode 100644
index 8dbad87..0000000
--- a/include/mpw/ChangeLog
+++ /dev/null
@@ -1,61 +0,0 @@
-Tue Feb 27 12:23:04 1996  Raymond Jou  <rjou@mexican.cygnus.com>
-
-	* mpw.h (HAVE_VPRINTF): Add and define to have the value 1.
-
-Fri Dec 29 14:40:46 1995  Stan Shebs  <shebs@andros.cygnus.com>
-
-	* mpw.h (HAVE_STDLIB_H, etc): Define to have the value 1.
-	(HAVE_FCNTL_H): Define.
-
-Mon Dec 11 15:39:06 1995  Stan Shebs  <shebs@andros.cygnus.com>
-
-	* mpw.h (open, access): Define as mpw_open and mpw_access.
-
-Thu Nov  9 15:38:37 1995  Stan Shebs  <shebs@andros.cygnus.com>
-
-	* mpw.h: Include unix.h if USE_MW_HEADERS, otherwise include
-	various original MPW include files (ioctl.h, etc).
-	(EIO): Define if not defined.
-	* sys/ioctl.h: Remove, not needed.
-
-Wed Oct 25 12:30:44 1995  Stan Shebs  <shebs@andros.cygnus.com>
-
-	* mpw.h: Don't include errno.h or ioctl.h.
-	(ENOENT, EACCES, ENOSYS): Define if not defined.
-	(fdopen): Declare if __STDC__.
-	(R_OK, W_OK, X_OK): Define if not defined.
-
-Tue Sep 26 14:57:21 1995  Stan Shebs  <shebs@andros.cygnus.com>
-
-	* mpw.h: New file, universally useful MPW host definitions.
-	Many of these used to live in bfd/hosts/mpw.h.
-	* grp.h: Remove RCS comment.
-	* sys/ioctl.h: Add a comment line.
-
-Wed Dec 14 13:12:14 1994  Stan Shebs  <shebs@andros.cygnus.com>
-
-	* spin.h: New file, cursor spinning for progress.
-
-Thu Jun 30 15:32:07 1994  Stan Shebs  (shebs@andros.cygnus.com)
-
-	* fcntl.h (open): Allow optional third arg.
-
-Thu Apr 14 12:54:51 1994  Stan Shebs  (shebs@andros.cygnus.com)
-
-	* dir.h, dirent.h, fcntl.h, grp.h, pwd.h, stat.h: New files.
-	* sys/ioctl.h: New file.
-
-Mon Feb 21 09:44:45 1994  Stan Shebs  (shebs@andros.cygnus.com)
-
-	* sys/stat.h (struct stat): New field st_rsize.
-	(S_IFMT, etc): Use different bit positions.
-	(fstat): Add parameter names to prototype.
-
-Mon Jan 31 19:30:16 1994  Stan Shebs  (shebs@andros.cygnus.com)
-
-	* README: New file.
-	* utime.h, varargs.h: New files, simulated Posix.
-	* sys/{file,param,resource,stat,time,types}.h: New files, more
-	simulated Posix.
-
-
diff --git a/include/mpw/README b/include/mpw/README
deleted file mode 100644
index 10e92de..0000000
--- a/include/mpw/README
+++ /dev/null
@@ -1 +0,0 @@
-This is a collection of include files that help imitate Posix in MPW.
diff --git a/include/mpw/dir.h b/include/mpw/dir.h
deleted file mode 100644
index e6ccd2d..0000000
--- a/include/mpw/dir.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* The <dir.h> header gives the layout of a directory. */
-
-#pragma once
-
-#ifndef _DIR_H
-#define _DIR_H
-
-#ifndef _TYPES_H		/* not quite right */
-#include <sys/types.h>
-#endif
-
-#define	DIRBLKSIZ	512	/* size of directory block */
-
-#ifndef DIRSIZ
-#define	DIRSIZ	14
-#endif
-
-struct direct {
-  ino_t d_ino;
-  char d_name[DIRSIZ];
-};
-
-#endif /* _DIR_H */
diff --git a/include/mpw/dirent.h b/include/mpw/dirent.h
deleted file mode 100644
index 38000b2..0000000
--- a/include/mpw/dirent.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef __dirent_h
-#define __dirent_h
-
-#include "sys/dir.h"
-
-struct dirent {
-  long d_ino;			/* inode number of entry */
-  off_t	d_off;			/* offset of disk directory entry */
-  unsigned short d_reclen;	/* length of this record */
-  char d_name[1];		/* name of file */
-};
-
-/*
-#define	DIRENTBASESIZE \
-	(((struct dirent *) 0)->d_name - (char *) 0)
-#define	DIRENTSIZE(namelen) \
-	((DIRENTBASESIZE + (namelen) + NBPW) & ~(NBPW - 1))
-*/
-
-/* from Mips posix/dirent.h */
-
-/*
-#undef rewinddir
-*/
-
-extern DIR *opendir();
-extern struct dirent *readdir();
-extern void		rewinddir();
-extern int		closedir();
-
-#endif /* ! __dirent_h */
diff --git a/include/mpw/fcntl.h b/include/mpw/fcntl.h
deleted file mode 100644
index 30999b4..0000000
--- a/include/mpw/fcntl.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * FCntl.h -- faccess(), fcntl(), and open() mode flags
- *
- * Portions copyright American Telephone & Telegraph
- * Used with permission, Apple Computer Inc. (1985,1988,1990,1992)
- * All rights reserved.
- */
-
-#ifndef __FCNTL__
-#define __FCNTL__
-
-#ifndef __TYPES__
-#include <Types.h>
-#endif
-
-/*
- *	For use by lseek():
- */
-
-#ifndef __STDIO__			/* these defns exactly paralled in StdIO.h for fseek() */
-#define SEEK_CUR	1
-#define SEEK_END	2
-#define SEEK_SET	0
-#endif
-
-/*
- * faccess() commands; for general use
- */
- 					/* 'd' => "directory" ops */
-#define F_DELETE		(('d'<<8)|0x01)
-#define F_RENAME		(('d'<<8)|0x02)
-
-/*
- * more faccess() commands; for use only by MPW tools
- */
- 
-#define F_OPEN 			(('d'<<8)|0x00)		/* reserved for operating system use */
-					/* 'e' => "editor" ops */
-#define F_GTABINFO 		(('e'<<8)|0x00)		/* get tab offset for file */	
-#define F_STABINFO 		(('e'<<8)|0x01)		/* set 	"	"		"	"  */
-#define F_GFONTINFO		(('e'<<8)|0x02)		/* get font number and size for file */
-#define F_SFONTINFO		(('e'<<8)|0x03)		/* set 	"		"	"	"	"	" 	 */
-#define F_GPRINTREC		(('e'<<8)|0x04)		/* get print record for file */
-#define F_SPRINTREC		(('e'<<8)|0x05)		/* set 	"		"	"	" 	 */
-#define F_GSELINFO 		(('e'<<8)|0x06)		/* get selection information for file */
-#define F_SSELINFO 		(('e'<<8)|0x07)		/* set		"		"		"		" */
-#define F_GWININFO 		(('e'<<8)|0x08)		/* get current window position */
-#define F_SWININFO 		(('e'<<8)|0x09)		/* set	"		"		" 	   */
-#define F_GSCROLLINFO	(('e'<<8)|0x0A)		/* get scroll information */
-#define F_SSCROLLINFO	(('e'<<8)|0x0B)		/* set    "   		"  	  */
-#define F_GMARKER		(('e'<<8)|0x0D)		/* Get Marker */
-#define F_SMARKER		(('e'<<8)|0x0C)		/* Set   " 	  */
-#define F_GSAVEONCLOSE	(('e'<<8)|0x0F)		/* Get Save on close */
-#define F_SSAVEONCLOSE	(('e'<<8)|0x0E)		/* Set   "	 "	 " 	 */
-
-/*
- *	argument structures used by various faccess() commands
- */
- 
-struct MarkElement {
-	int				start;			/* start position of mark */
-	int				end;			/* end position */
-	unsigned char	charCount;		/* number of chars in mark name */
-	char			name[64];		/* mark name */
-} ;									/* note: marker names may be up to 64 characters long */
-
-#ifndef __cplusplus
-typedef struct MarkElement MarkElement;
-#endif
-
-struct SelectionRecord {
-	long	startingPos;
-	long	endingPos;
-	long	displayTop;
-};
-
-#ifndef __cplusplus
-typedef struct SelectionRecord SelectionRecord;
-#endif
-
-
-/*
- * Mode values accessible to open()
- */
-#define O_RDONLY		 0 		/* Bits 0 and 1 are used internally */
-#define O_WRONLY		 1 		/* Values 0..2 are historical */
-#define O_RDWR 			 2		/* NOTE: it goes 0, 1, 2, *!* 8, 16, 32, ... */
-#define O_APPEND	(1<< 3)		/* append (writes guaranteed at the end) */
-#define O_RSRC 		(1<< 4)		/* Open the resource fork */
-#define O_ALIAS		(1<< 5)		/* Open alias file */
-#define O_CREAT		(1<< 8)		/* Open with file create */
-#define O_TRUNC		(1<< 9)		/* Open with truncation */
-#define O_EXCL 		(1<<10) 	/* w/ O_CREAT:  Exclusive "create-only" */
-#define O_BINARY	(1<<11) 	/* Open as a binary stream */
-#define O_NRESOLVE	(1<<14)		/* Don't resolve any aliases */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- *		function prototypes
- */
-int  close(int);
-int  creat(const char*);
-int	 dup(int filedes);		/* OBSOLETE: fcntl(filedes, F_DUPFD, 0) is preferred */
-int	 faccess(char*, unsigned int, long*);
-int  fcntl(int, unsigned int, int);
-long lseek(int, long, int);
-int  open(const char*, int, ...);
-int  read(int, char*, unsigned);
-int  unlink(char*);
-int  write(int, const char*, unsigned);
-
-#ifdef __cplusplus
-}
-#endif
-
-/*
- * fcntl() commands
- */
-#define F_DUPFD 0	   /* Duplicate files (file descriptor) */
-
-#endif __FCNTL__
diff --git a/include/mpw/grp.h b/include/mpw/grp.h
deleted file mode 100644
index faf2c6a..0000000
--- a/include/mpw/grp.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-
-#include "sys/types.h"
-
-struct group {
-  char *gr_name;
-  gid_t gr_gid;
-  char *gr_passwd;
-  char **gr_mem;
-};
diff --git a/include/mpw/mpw.h b/include/mpw/mpw.h
deleted file mode 100644
index 58702e7..0000000
--- a/include/mpw/mpw.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* Mac MPW host-specific definitions. */
-
-#ifndef	__INCLUDE_MPW_H
-#define __INCLUDE_MPW_H
-
-#ifndef MPW
-#define MPW
-#endif
-
-/* MPW C is basically ANSI, but doesn't actually enable __STDC__,
-   nor does it allow __STDC__ to be #defined. */
-
-#ifndef ALMOST_STDC
-#define ALMOST_STDC
-#endif
-
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-
-#define HAVE_TIME_T_IN_TIME_H 1
-
-#define HAVE_STDLIB_H 1
-
-#define HAVE_ERRNO_H 1
-
-#define HAVE_STDDEF_H 1
-
-#define HAVE_STRING_H 1
-
-#define HAVE_STDARG_H 1
-
-#define HAVE_VPRINTF 1
-
-#ifdef USE_MW_HEADERS
-
-#include <unix.h>
-
-#else
-
-#include <fcntl.h>
-#include <ioctl.h>
-#include <sys/stat.h>
-
-#define HAVE_FCNTL_H 1
-
-#ifndef	O_ACCMODE
-#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
-#endif
-
-#ifndef fileno
-#define fileno(fp) ((fp)->_file)
-#endif
-
-/* stdio.h does not define this if __STDC__, so define here. */
-
-#ifdef __STDC__
-FILE *fdopen(int fildes, const char *mode);
-#endif
-
-#endif /* USE_MW_HEADERS */
-
-/* Add ersatz definitions, for systems that lack them.  */
-
-#ifndef EIO
-#define EIO 96
-#endif
-#ifndef ENOENT
-#define ENOENT 97
-#endif
-#ifndef EACCES
-#define EACCES 98
-#endif
-#ifndef ENOSYS
-#define ENOSYS 99
-#endif
-
-#ifndef R_OK
-#define R_OK 4
-#define W_OK 2
-#define X_OK 1
-#endif
-
-/* Binary files have different characteristics; for instance, no cr/nl
-   translation. */
-
-#define USE_BINARY_FOPEN
-
-#include <spin.h>
-
-#ifdef MPW_C
-#undef  __PTR_TO_INT
-#define __PTR_TO_INT(P) ((int)(P))
-#undef __INT_TO_PTR
-#define __INT_TO_PTR(P) ((char *)(P))
-#endif /* MPW_C */
-
-#define NO_FCNTL
-
-int fstat ();
-
-FILE *mpw_fopen ();
-int mpw_fseek ();
-int mpw_fread ();
-int mpw_fwrite ();
-int mpw_access ();
-int mpw_open ();
-int mpw_creat ();
-void mpw_abort (void);
-
-/* Map these standard functions to improved versions in libiberty. */
-
-#define fopen mpw_fopen
-#define fseek mpw_fseek
-#define fread mpw_fread
-#define fwrite mpw_fwrite
-#define open mpw_open
-#define access mpw_access
-#define creat mpw_creat
-#define abort mpw_abort
-
-#define POSIX_UTIME
-
-#define LOSING_TOTALLY
-
-/* Define this so that files will be closed before being unlinked. */
-
-#define CLOSE_BEFORE_UNLINK
-
-#endif /* __INCLUDE_MPW_H */
diff --git a/include/mpw/pwd.h b/include/mpw/pwd.h
deleted file mode 100644
index 2d4fb70..0000000
--- a/include/mpw/pwd.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef __pwd_h
-#define __pwd_h
-
-#include <sys/types.h>
-
-struct passwd {
-  char *pw_name;
-  uid_t pw_uid;
-  gid_t pw_gid;
-  char *pw_dir;
-  char *pw_shell;
-  char *pw_passwd;
-};
-
-#endif /* ! __pwd_h */
diff --git a/include/mpw/spin.h b/include/mpw/spin.h
deleted file mode 100644
index 674b00a..0000000
--- a/include/mpw/spin.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Progress macros that use SpinCursor in MPW.
-   Copyright 1994 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
-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 _SPIN_H
-#define _SPIN_H
-
-/* For MPW, progress macros just need to "spin the cursor" frequently,
-   preferably several times per second on a 68K Mac.  */
-
-/* In order to determine if we're meeting the goal, define this macro
-   and information about frequency of spinning will be collected and
-   displayed.  */
-
-#define SPIN_MEASUREMENT
-
-#include <CursorCtl.h>
-
-/* Programs use this macro to indicate the start of a lengthy
-   activity.  STR identifies the particular activity, while N
-   indicates the expected duration, in unspecified units.  If N is
-   zero, then the expected time to completion is unknown.  */
-
-#undef START_PROGRESS
-#define START_PROGRESS(STR,N) mpw_start_progress (STR, N, __FILE__, __LINE__);
-
-/* Programs use this macro to indicate that progress has been made on a
-   lengthy activity.  */
-
-#undef PROGRESS
-#ifdef SPIN_MEASUREMENT
-#define PROGRESS(X) mpw_progress_measured (X, __FILE__, __LINE__);
-#else
-#define PROGRESS(X) mpw_progress (X);
-#endif 
-
-/* Programs use this macro to indicate the end of a lengthy activity.
-   STR must match a STR passed to START_PROGRESS previously.  */
-
-#undef END_PROGRESS
-#define END_PROGRESS(STR) mpw_end_progress (STR, __FILE__, __LINE__);
-
-extern void mpw_start_progress (char *, int, char *, int);
-
-extern void mpw_progress (int);
-
-extern void mpw_progress_measured (int, char *, int);
-
-extern void mpw_end_progress (char *, char *, int);
-
-#endif /* _SPIN_H */
diff --git a/include/mpw/stat.h b/include/mpw/stat.h
deleted file mode 100644
index 057b8d5..0000000
--- a/include/mpw/stat.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* The <sys/stat.h> header defines a struct that is used in the stat() and
- * fstat functions.  The information in this struct comes from the i-node of
- * some file.  These calls are the only approved way to inspect i-nodes.
- */
-
-#ifndef _STAT_H
-#define _STAT_H
-
-#ifndef _TYPES_H		/* not quite right */
-#include <sys/types.h>
-#endif
-
-struct stat {
-  dev_t st_dev;			/* major/minor device number */
-  ino_t st_ino;			/* i-node number */
-  mode_t st_mode;		/* file mode, protection bits, etc. */
-  short int st_nlink;		/* # links; TEMPORARY HACK: should be nlink_t*/
-  uid_t st_uid;			/* uid of the file's owner */
-  short int st_gid;		/* gid; TEMPORARY HACK: should be gid_t */
-  dev_t st_rdev;
-  off_t st_size;		/* file size */
-  time_t st_atime;		/* time of last access */
-  time_t st_mtime;		/* time of last data modification */
-  time_t st_ctime;		/* time of last file status change */
-};
-
-/* Traditional mask definitions for st_mode. */
-#define S_IFMT  0170000		/* type of file */
-#define S_IFREG 0100000		/* regular */
-#define S_IFBLK 0060000		/* block special */
-#define S_IFDIR 0040000  	/* directory */
-#define S_IFCHR 0020000		/* character special */
-#define S_IFIFO 0010000		/* this is a FIFO */
-#define S_ISUID 0004000		/* set user id on execution */
-#define S_ISGID 0002000		/* set group id on execution */
-				/* next is reserved for future use */
-#define S_ISVTX   01000		/* save swapped text even after use */
-
-/* POSIX masks for st_mode. */
-#define S_IRWXU   00700		/* owner:  rwx------ */
-#define S_IRUSR   00400		/* owner:  r-------- */
-#define S_IWUSR   00200		/* owner:  -w------- */
-#define S_IXUSR   00100		/* owner:  --x------ */
-
-#define S_IRWXG   00070		/* group:  ---rwx--- */
-#define S_IRGRP   00040		/* group:  ---r----- */
-#define S_IWGRP   00020		/* group:  ----w---- */
-#define S_IXGRP   00010		/* group:  -----x--- */
-
-#define S_IRWXO   00007		/* others: ------rwx */
-#define S_IROTH   00004		/* others: ------r-- */ 
-#define S_IWOTH   00002		/* others: -------w- */
-#define S_IXOTH   00001		/* others: --------x */
-
-/* The following macros test st_mode (from POSIX Sec. 5.6.1.1. */
-#define S_ISREG(m)	((m & S_IFMT) == S_IFREG)	/* is a reg file */
-#define S_ISDIR(m)	((m & S_IFMT) == S_IFDIR)	/* is a directory */
-#define S_ISCHR(m)	((m & S_IFMT) == S_IFCHR)	/* is a char spec */
-#define S_ISBLK(m)	((m & S_IFMT) == S_IFBLK)	/* is a block spec */
-#define S_ISFIFO(m)	((m & S_IFMT) == S_IFIFO)	/* is a pipe/FIFO */
-
-
-/* Function Prototypes. */
-#ifndef _ANSI_H
-#include <ansi.h>
-#endif
-
-_PROTOTYPE( int chmod, (const char *_path, int _mode)			);
-_PROTOTYPE( int fstat, (int _fildes, struct stat *_buf)			);
-_PROTOTYPE( int mkdir, (const char *_path, int _mode)			);
-_PROTOTYPE( int mkfifo, (const char *_path, int _mode)			);
-_PROTOTYPE( int stat , (const char *_path, struct stat *_buf)		);
-_PROTOTYPE( mode_t umask, (int _cmask)					);
-
-#endif /* _STAT_H */
diff --git a/include/mpw/sys/file.h b/include/mpw/sys/file.h
deleted file mode 100644
index 40a8c17..0000000
--- a/include/mpw/sys/file.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty */
diff --git a/include/mpw/sys/param.h b/include/mpw/sys/param.h
deleted file mode 100644
index 40a8c17..0000000
--- a/include/mpw/sys/param.h
+++ /dev/null
@@ -1 +0,0 @@
-/* empty */
diff --git a/include/mpw/sys/resource.h b/include/mpw/sys/resource.h
deleted file mode 100644
index d39439d..0000000
--- a/include/mpw/sys/resource.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef __SYS_RESOURCE_H__
-#define __SYS_RESOURCE_H__
-
-struct rusage {
-  struct timeval ru_utime;
-  struct timeval ru_stime;
-};
-
-#endif /* __SYS_RESOURCE_H__ */
diff --git a/include/mpw/sys/stat.h b/include/mpw/sys/stat.h
deleted file mode 100644
index b65c72e..0000000
--- a/include/mpw/sys/stat.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Imitation sys/stat.h. */
-
-#ifndef __SYS_STAT_H__
-#define __SYS_STAT_H__
-
-#include  <sys/types.h>
-#include  <time.h>
-
-struct stat {
-  dev_t   st_dev;
-  ino_t   st_ino;
-  mode_t  st_mode;
-  short   st_nlink;
-  uid_t   st_uid;
-  gid_t   st_gid;
-  dev_t   st_rdev;
-  off_t   st_size;
-  off_t   st_rsize;
-  time_t  st_atime;
-  int     st_spare1;
-  time_t  st_mtime;
-  int     st_spare2;
-  time_t  st_ctime;
-  int     st_spare3;
-  long    st_blksize;
-  long    st_blocks;
-  long    st_spare4[2];
-};
-
-#define S_IFMT	0170000L
-#define S_IFDIR	0040000L
-#define S_IFREG 0100000L
-#define S_IREAD    0400
-#define S_IWRITE   0200
-#define S_IEXEC    0100
-
-#define S_IFIFO 010000  /* FIFO special */
-#define S_IFCHR 020000  /* character special */
-#define S_IFBLK 030000  /* block special */
-
-int stat (char *path, struct stat *buf);
-int fstat (int fd, struct stat *buf);
-
-#endif /* __SYS_STAT_H___ */
diff --git a/include/mpw/sys/time.h b/include/mpw/sys/time.h
deleted file mode 100644
index f9e4852..0000000
--- a/include/mpw/sys/time.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Imitation sys/time.h. */
-
-#ifndef __SYS_TIME_H__
-#define __SYS_TIME_H__
-
-#include <time.h>
-
-struct timeval {
-  long tv_sec;
-  long tv_usec;
-};
-
-#endif /* __SYS_TIME_H__ */
diff --git a/include/mpw/sys/types.h b/include/mpw/sys/types.h
deleted file mode 100644
index d7d9c9f..0000000
--- a/include/mpw/sys/types.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Imitation sys/types.h. */
-
-#ifndef __SYS_TYPES_H__
-#define __SYS_TYPES_H__
-
-#include <Types.h>
-
-typedef short dev_t;
-typedef short ino_t;
-typedef unsigned short mode_t;
-typedef unsigned short uid_t;
-typedef unsigned short gid_t;
-typedef long off_t;
-
-#endif /* __SYS_TYPES_H__ */
diff --git a/include/mpw/utime.h b/include/mpw/utime.h
deleted file mode 100644
index e8bf66f2..0000000
--- a/include/mpw/utime.h
+++ /dev/null
@@ -1,7 +0,0 @@
-
-struct utimbuf {
-  time_t actime;
-  time_t modtime;
-};
-
-int utime (char *, struct utimbuf *);
diff --git a/include/mpw/varargs.h b/include/mpw/varargs.h
deleted file mode 100644
index acb9e45..0000000
--- a/include/mpw/varargs.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/* varargs.h. */
-#ifndef __va_list__
-#define __va_list__
-typedef char *va_list;
-#endif
-#define va_dcl int va_alist;
-#define va_start(list) list = (char *) &va_alist
-#define va_end(list)
-#define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1]
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index ebde6b6..bd6f448 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,31 @@
+2004-07-09  Andreas Schwab  <schwab@suse.de>
+
+	* m68k.h: Fix comment.
+
+2004-07-07  Tomer Levi  <Tomer.Levi@nsc.com>
+
+	* crx.h: New file.
+
+2004-06-24  Alan Modra  <amodra@bigpond.net.au>
+
+	* i386.h (i386_optab): Remove fildd, fistpd and fisttpd.
+
+2004-05-24  Peter Barada  <peter@the-baradas.com>
+
+	* m68k.h: Add 'size' to m68k_opcode.
+
+2004-05-05  Peter Barada  <peter@the-baradas.com>
+
+	* m68k.h: Switch from ColdFire chip name to core variant.
+
+2004-04-22  Peter Barada  <peter@the-baradas.com>
+
+	* m68k.h: Add mcfmac/mcfemac definitions.  Update operand
+	descriptions for new EMAC cases.
+	Remove ColdFire macmw/macml/msacmw/msacmw hacks and properly
+	handle Motorola MAC syntax.
+	Allow disassembly of ColdFire V4e object files.
+
 2004-03-16  Alan Modra  <amodra@bigpond.net.au>
 
 	* ppc.h (PPC_OPERAND_GPR_0): Define.  Bump other operand defines.
diff --git a/include/opcode/crx.h b/include/opcode/crx.h
new file mode 100644
index 0000000..1e0d573
--- /dev/null
+++ b/include/opcode/crx.h
@@ -0,0 +1,395 @@
+/* crx.h -- Header file for CRX opcode and register tables.
+   Copyright 2004 Free Software Foundation, Inc.
+   Contributed by Tomer Levi, NSC, Israel.
+   Originally written for GAS 2.12 by Tomer Levi, NSC, Israel.
+   Updates, BFDizing, GNUifying and ELF support by Tomer Levi.
+
+   This file is part of GAS, GDB and the GNU binutils.
+
+   GAS, GDB, and GNU binutils 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, GDB, and GNU binutils are distributed in the hope that they 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 _CRX_H_
+#define _CRX_H_
+
+/* CRX core/debug Registers :
+   The enums are used as indices to CRX registers table (crx_regtab).
+   Therefore, order MUST be preserved.  */
+
+typedef enum
+  {
+    /* 32-bit general purpose registers.  */
+    r0, r1, r2, r3, r4, r5, r6, r7, r8, r9,
+    r10, r11, r12, r13, r14, r15, ra, sp,
+    /* 32-bit user registers.  */
+    u0, u1, u2, u3, u4, u5, u6, u7, u8, u9,
+    u10, u11, u12, u13, u14, u15, ura, usp,
+    /* hi and lo registers.  */
+    hi, lo,
+    /* hi and lo user registers.  */
+    uhi, ulo,
+    /* Processor Status Register.  */
+    psr,
+    /* Configuration Register.  */
+    cfg,
+    /* Coprocessor Configuration Register.  */
+    cpcfg,
+    /* Cashe Configuration Register.  */
+    ccfg,
+    /* Interrupt Base Register.  */
+    intbase,
+    /* Interrupt Stack Pointer Register.  */
+    isp,
+    /* Coprocessor Enable Register.  */
+    cen,
+    /* Program Counter Register.  */
+    pc,
+    /* Not a register.  */
+    nullregister,
+    MAX_REG
+  }
+reg;
+
+/* CRX Coprocessor registers and special registers :
+   The enums are used as indices to CRX coprocessor registers table
+   (crx_copregtab). Therefore, order MUST be preserved.  */
+
+typedef enum
+  {
+    /* Coprocessor registers.  */
+    c0 = MAX_REG, c1, c2, c3, c4, c5, c6, c7, c8,
+    c9, c10, c11, c12, c13, c14, c15,
+    /* Coprocessor special registers.  */
+    cs0, cs1 ,cs2, cs3, cs4, cs5, cs6, cs7, cs8,
+    cs9, cs10, cs11, cs12, cs13, cs14, cs15,
+    /* Not a Coprocessor register.  */
+    nullcopregister,
+    MAX_COPREG
+  }
+copreg;
+
+/* CRX Register types. */
+
+typedef enum
+  {
+    CRX_PC_REGTYPE,   /*  pc type */
+    CRX_R_REGTYPE,    /*  r<N>	  */
+    CRX_U_REGTYPE,    /*  u<N>	  */
+    CRX_C_REGTYPE,    /*  c<N>	  */
+    CRX_CS_REGTYPE,   /*  cs<N>	  */
+    CRX_MTPR_REGTYPE, /*  mtpr	  */
+    CRX_CFG_REGTYPE   /*  *hi|lo, *cfg, psr */
+  }
+reg_type;
+
+/* CRX argument types :
+   The argument types correspond to instructions operands
+
+   Argument types :
+   r - register
+   c - constant
+   d - displacement
+   ic - immediate
+   icr - index register
+   rbase - register base
+   s - star ('*')
+   copr - coprocessor register
+   copsr - coprocessor special register.  */
+
+typedef enum
+  {
+    arg_r, arg_c, arg_cr, arg_dc, arg_dcr, arg_sc,
+    arg_ic, arg_icr, arg_rbase, arg_copr, arg_copsr,
+    /* Not an argument.  */
+    nullargs
+  }
+argtype;
+
+/* CRX operand types :
+   The operand types correspond to instructions operands
+
+   Operand Types :
+   cst4 - 4-bit encoded constant
+   iN - N-bit immediate field
+   d, dispsN - N-bit immediate signed displacement
+   dispuN - N-bit immediate unsigned displacement
+   absN - N-bit absolute address
+   rbase - 4-bit genaral-purpose register specifier
+   regr - 4-bit genaral-purpose register specifier
+   regr8 - 8-bit register address space
+   copregr - coprocessor register
+   copsregr - coprocessor special register
+   scl2 - 2-bit scaling factor for memory index
+   ridx - register index.  */
+
+typedef enum
+  {
+    dummy, cst4, disps9,
+    i3, i4, i5, i8, i12, i16, i32,
+    d5, d9, d17, d25, d33,
+    abs16, abs32,
+    rbase, rbase_cst4,
+    rbase_dispu8, rbase_dispu12, rbase_dispu16, rbase_dispu28, rbase_dispu32,
+    rbase_ridx_scl2_dispu6, rbase_ridx_scl2_dispu22,
+    regr, regr8, copregr,copregr8,copsregr,
+    /* Not an operand.  */
+    nulloperand,
+    /* Maximum supported operand.  */
+    MAX_OPRD
+  }
+operand_type;
+
+/* CRX instruction types.  */
+
+#define ARITH_INS         1
+#define LD_STOR_INS       2
+#define BRANCH_INS        3
+#define ARITH_BYTE_INS    4
+#define CMPBR_INS         5
+#define SHIFT_INS         6
+#define BRANCH_NEQ_INS    7
+#define LD_STOR_INS_INC   8
+#define STOR_IMM_INS	  9
+#define CSTBIT_INS       10
+#define SYS_INS		 11
+#define JMP_INS		 12
+#define MUL_INS		 13
+#define DIV_INS		 14
+#define COP_BRANCH_INS   15
+#define COP_REG_INS      16
+#define DCR_BRANCH_INS   17
+#define MMC_INS          18
+#define MMU_INS          19
+
+/* Maximum value supported for instruction types.  */
+#define CRX_INS_MAX	(1 << 5)
+/* Mask to record an instruction type.  */
+#define CRX_INS_MASK	(CRX_INS_MAX - 1)
+/* Return instruction type, given instruction's attributes.  */
+#define CRX_INS_TYPE(attr) ((attr) & CRX_INS_MASK)
+
+/* Indicates whether this instruction has a register list as parameter.  */
+#define REG_LIST	CRX_INS_MAX
+/* The operands in binary and assembly are placed in reverse order.
+   load - (REVERSE_MATCH)/store - (! REVERSE_MATCH).  */
+#define REVERSE_MATCH  (REG_LIST << 1)
+
+/* Kind of displacement map used DISPU[BWD]4.  */
+#define DISPUB4	       (REVERSE_MATCH << 1)
+#define DISPUW4	       (DISPUB4 << 1)
+#define DISPUD4	       (DISPUW4 << 1)
+#define CST4MAP	       (DISPUB4 | DISPUW4 | DISPUD4)
+
+/* Printing formats, where the instruction prefix isn't consecutive.  */
+#define FMT_1	       (DISPUD4 << 1) /* 0xF0F00000 */
+#define FMT_2	       (FMT_1 << 1)   /* 0xFFF0FF00 */
+#define FMT_3	       (FMT_2 << 1)   /* 0xFFF00F00 */
+#define FMT_4	       (FMT_3 << 1)   /* 0xFFF0F000 */
+#define FMT_5	       (FMT_4 << 1)   /* 0xFFF0FFF0 */
+#define FMT_CRX	       (FMT_1 | FMT_2 | FMT_3 | FMT_4 | FMT_5)
+
+#define RELAXABLE      (FMT_5 << 1)
+
+/* Maximum operands per instruction.  */
+#define MAX_OPERANDS	  5
+/* Maximum words per instruction.  */
+#define MAX_WORDS	  3
+/* Maximum register name length. */
+#define MAX_REGNAME_LEN	  10
+/* Maximum instruction length. */
+#define MAX_INST_LEN	  256
+
+/* Single operand description.  */
+
+typedef struct
+  {
+    /* Operand type.  */
+    operand_type op_type;
+    /* Operand location within the opcode.  */
+    unsigned int shift;
+  }
+operand_desc;
+
+/* Instruction data structure used in instruction table.  */
+
+typedef struct
+  {
+    /* Name.  */
+    const char *mnemonic;
+    /* Size (in words).  */
+    unsigned int size;
+    /* Constant prefix (matched by the disassembler).  */
+    unsigned long match;
+    /* Match size (in bits).  */
+    int match_bits;
+    /* Attributes.  */
+    unsigned int flags;
+    /* Operands (always last, so unreferenced operands are initialized).  */
+    operand_desc operands[MAX_OPERANDS];
+  }
+inst;
+
+/* Data structure for a single instruction's arguments (Operands).  */
+
+typedef struct
+  {
+    /* Register or base register.  */
+    reg r;
+    /* Index register.  */
+    reg i_r;
+    /* Coprocessor register.  */
+    copreg cr;
+    /* Constant/immediate/absolute value.  */
+    unsigned long int constant;
+    /* Scaled index mode.  */
+    unsigned int scale;
+    /* Argument type.  */
+    argtype type;
+    /* Size of the argument (in bits) required to represent.  */
+    int size;
+    /* Indicates whether a constant is positive or negative.  */
+    int signflag;
+  }
+argument;
+
+/* Internal structure to hold the various entities
+   corresponding to the current assembling instruction.  */
+
+typedef struct
+  {
+    /* Number of arguments.  */
+    int nargs;
+    /* The argument data structure for storing args (operands).  */
+    argument arg[MAX_OPERANDS];
+/* The following fields are required only by CRX-assembler.  */
+#ifdef TC_CRX
+    /* Expression used for setting the fixups (if any).  */
+    expressionS exp;
+    bfd_reloc_code_real_type rtype;
+#endif /* TC_CRX */
+    /* Instruction size (in bytes).  */
+    int size;
+  }
+ins;
+
+/* Structure to hold information about predefined operands.  */
+
+typedef struct
+  {
+    /* Size (in bits).  */
+    unsigned int bit_size;
+    /* Argument type.  */
+    argtype arg_type;
+  }
+operand_entry;
+
+/* Structure to hold trap handler information.  */
+
+typedef struct
+  {
+    /* Trap name.  */
+    char *name;
+    /* Index in dispatch table.  */
+    unsigned int entry;
+  }
+trap_entry;
+
+/* Structure to hold information about predefined registers.  */
+
+typedef struct
+  {
+    /* Name (string representation).  */
+    char *name;
+    /* Value (enum representation).  */
+    union
+    {
+      /* Register.  */
+      reg reg_val;
+      /* Coprocessor register.  */
+      copreg copreg_val;
+    } value;
+    /* Register image.  */
+    int image;
+    /* Register type.  */
+    reg_type type;
+  }
+reg_entry;
+
+/* Structure to hold a cst4 operand mapping.  */
+
+typedef struct
+  {
+    /* The binary value which is written to the object file.  */
+    int binary;
+    /* The value which is mapped.  */
+    int value;
+  }
+cst4_entry;
+
+/* CRX opcode table.  */
+extern const inst crx_instruction[];
+extern const int crx_num_opcodes;
+#define NUMOPCODES crx_num_opcodes
+
+/* CRX operands table.  */
+extern const operand_entry crx_optab[];
+
+/* CRX registers table.  */
+extern const reg_entry crx_regtab[];
+extern const int crx_num_regs;
+#define NUMREGS crx_num_regs
+
+/* CRX coprocessor registers table.  */
+extern const reg_entry crx_copregtab[];
+extern const int crx_num_copregs;
+#define NUMCOPREGS crx_num_copregs
+
+/* CRX trap/interrupt table.  */
+extern const trap_entry crx_traps[];
+extern const int crx_num_traps;
+#define NUMTRAPS crx_num_traps
+
+/* cst4 operand mapping.  */
+extern const cst4_entry cst4_map[];
+extern const int cst4_maps;
+
+/* Current instruction we're assembling.  */
+extern const inst *instruction;
+
+/* A macro for representing the instruction "constant" opcode, that is,
+   the FIXED part of the instruction. The "constant" opcode is represented
+   as a 32-bit unsigned long, where OPC is expanded (by a left SHIFT)
+   over that range.  */
+#define BIN(OPC,SHIFT)	(OPC << SHIFT)
+
+/* Is the current instruction type is TYPE ?  */
+#define IS_INSN_TYPE(TYPE)	      \
+  (CRX_INS_TYPE(instruction->flags) == TYPE)
+
+/* Is the current instruction mnemonic is MNEMONIC ?  */
+#define IS_INSN_MNEMONIC(MNEMONIC)    \
+  (strcmp(instruction->mnemonic,MNEMONIC) == 0)
+
+/* Does the current instruction has register list ?  */
+#define INST_HAS_REG_LIST	      \
+  (instruction->flags & REG_LIST)
+
+/* Long long type handling.  */
+/* Replace all appearances of 'long long int' with LONGLONG.  */
+typedef long long int LONGLONG;
+typedef unsigned long long ULONGLONG;
+/* A mask for the upper 31 bits of a 64 bits type.  */
+#define UPPER31_MASK	0xFFFFFFFE00000000LL
+
+#endif /* _CRX_H_ */
diff --git a/include/opcode/i386.h b/include/opcode/i386.h
index 5e3673e..2873885 100644
--- a/include/opcode/i386.h
+++ b/include/opcode/i386.h
@@ -583,7 +583,6 @@
 {"fld",    1,	0xdb, 5, 0,	 x_FP|Modrm,		{ LLongMem, 0, 0} },
 {"fild",   1,	0xdf, 0, 0,	 sl_FP|FloatMF|Modrm,	{ ShortMem|LongMem, 0, 0} },
 /* Intel Syntax */
-{"fildd",  1,	0xdf, 5, 0,	 FP|Modrm,		{ LLongMem, 0, 0} },
 {"fildq",  1,	0xdf, 5, 0,	 FP|Modrm,		{ LLongMem, 0, 0} },
 {"fildll", 1,	0xdf, 5, 0,	 FP|Modrm,		{ LLongMem, 0, 0} },
 {"fldt",   1,	0xdb, 5, 0,	 FP|Modrm,		{ LLongMem, 0, 0} },
@@ -603,7 +602,6 @@
 {"fstp",   1,	0xdb, 7, 0,	 x_FP|Modrm,		{ LLongMem, 0, 0} },
 {"fistp",  1,	0xdf, 3, 0,	 sl_FP|FloatMF|Modrm,	{ ShortMem|LongMem, 0, 0} },
 /* Intel Syntax */
-{"fistpd", 1,	0xdf, 7, 0,	 FP|Modrm,		{ LLongMem, 0, 0} },
 {"fistpq", 1,	0xdf, 7, 0,	 FP|Modrm,		{ LLongMem, 0, 0} },
 {"fistpll",1,	0xdf, 7, 0,	 FP|Modrm,		{ LLongMem, 0, 0} },
 {"fstpt",  1,	0xdb, 7, 0,	 FP|Modrm,		{ LLongMem, 0, 0} },
@@ -1308,7 +1306,6 @@
 {"addsubps",  2, 0xf20fd0,  X, CpuPNI, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
 {"fisttp",    1, 0xdf,      1, CpuPNI, sl_FP|FloatMF|Modrm, { ShortMem|LongMem, 0, 0} },
 /* Intel Syntax */
-{"fisttpd",   1, 0xdd,      1, CpuPNI, FP|Modrm,	{ LLongMem, 0, 0} },
 {"fisttpq",   1, 0xdd,      1, CpuPNI, FP|Modrm,	{ LLongMem, 0, 0} },
 {"fisttpll",  1, 0xdd,      1, CpuPNI, FP|Modrm,	{ LLongMem, 0, 0} },
 {"haddpd",    2, 0x660f7c,  X, CpuPNI, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
diff --git a/include/opcode/m68k.h b/include/opcode/m68k.h
index 3f18984..014495b 100644
--- a/include/opcode/m68k.h
+++ b/include/opcode/m68k.h
@@ -1,6 +1,6 @@
 /* Opcode table header for m680[01234]0/m6888[12]/m68851.
    Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2001,
-   2003 Free Software Foundation, Inc.
+   2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB, GAS, and the GNU binutils.
 
@@ -35,13 +35,27 @@
 #define	m68881   0x040
 #define	m68882   m68881 /* Synonym for -m68881.  otherwise unused.  */
 #define	m68851   0x080
-#define cpu32	 0x100	/* e.g., 68332 */
-#define mcf5200  0x200
-#define mcf5206e 0x400
-#define mcf5307  0x800
-#define mcf5407  0x1000
-#define mcfv4e   0x2000
-#define mcf528x  0x4000
+#define cpu32	 0x100		/* e.g., 68332 */
+
+#define mcfmac   0x200		/* ColdFire MAC. */
+#define mcfemac  0x400		/* ColdFire EMAC. */
+#define cfloat   0x800		/* ColdFire FPU.  */
+#define mcfhwdiv 0x1000		/* ColdFire hardware divide.  */
+
+#define mcfisa_a 0x2000		/* ColdFire ISA_A.  */
+#define mcfisa_aa 0x4000	/* ColdFire ISA_A+.  */
+#define mcfisa_b 0x8000		/* ColdFire ISA_B.  */
+#define mcfusp   0x10000	/* ColdFire USP instructions.  */
+
+#define mcf5200  0x20000
+#define mcf5206e 0x40000
+#define mcf521x  0x80000
+#define mcf5249  0x100000
+#define mcf528x  0x200000
+#define mcf5307  0x400000
+#define mcf5407  0x800000
+#define mcf5470  0x1000000
+#define mcf5480  0x2000000
 
  /* Handy aliases.  */
 #define	m68040up   (m68040 | m68060)
@@ -49,13 +63,7 @@
 #define	m68020up   (m68020 | m68030up)
 #define	m68010up   (m68010 | cpu32 | m68020up)
 #define	m68000up   (m68000 | m68010up)
-#define mcf        (mcf5200 | mcf5206e | mcf528x | mcf5307 | mcf5407 | mcfv4e)
-#define mcf5206eup (mcf5206e | mcf528x | mcf5307 | mcf5407 | mcfv4e)
-#define mcf5307up  (mcf5307 | mcf5407 | mcfv4e)
-#define mcfv4up    (mcf5407 | mcfv4e)
-#define mcfv4eup   (mcfv4e)
 
-#define cfloat  (mcfv4e)
 #define	mfloat  (m68881 | m68882 | m68040 | m68060)
 #define	mmmu    (m68851 | m68030 | m68040 | m68060)
 
@@ -65,6 +73,9 @@
 {
   /* The opcode name.  */
   const char *name;
+  /* The pseudo-size of the instruction(in bytes).  Used to determine
+     number of bytes necessary to disassemble the instruction.  */
+  unsigned int size;
   /* The opcode itself.  */
   unsigned long opcode;
   /* The mask used by the disassembler.  */
@@ -99,7 +110,7 @@
    operand; the second, the place it is stored.  */
 
 /* Kinds of operands:
-   Characters used: AaBbCcDdEFfGHIJkLlMmnOopQqRrSsTtU VvWwXxYyZz0123|*~%;@!&$?/<>#^+-
+   Characters used: AaBbCcDdEeFfGgHIiJkLlMmnOopQqRrSsTtU VvWwXxYyZz01234|*~%;@!&$?/<>#^+-
 
    D  data register only.  Stored as 3 bits.
    A  address register only.  Stored as 3 bits.
@@ -133,9 +144,12 @@
    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.
+   E  the MAC ACC.  No need to store, just as with CCR.
+   e  the EMAC ACC[0123].
+   G  the MAC/EMAC MACSR.  No need to store, just as with CCR.
+   g  the EMAC ACCEXT{01,23}.
    H  the MASK.  No need to store, just as with CCR.
+   i  the MAC/EMAC scale factor.
 
    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
@@ -205,7 +219,7 @@
    !  control					(modes 2,5,6,7.0-3)
 						(not 0,1,3,4,7.4)
    &  alterable control				(modes 2,5,6,7.0,7.1)
-						(not 0,1,7.2-4)
+						(not 0,1,3,4,7.2-4)
    $  alterable data				(modes 0,2-6,7.0,7.1)
 						(not 1,7.2-4)
    ?  alterable control, or data register	(modes 0,2,5,6,7.0,7.1)
@@ -230,7 +244,9 @@
    w                                            (modes 2-5,7.2)
    y						(modes 2,5)
    z						(modes 2,5,7.2)
-   x  mov3q immediate operand.  */
+   x  mov3q immediate operand.
+   4						(modes 2,3,4,5)
+  */
 
 /* For the 68851:  */
 /* I didn't use much imagination in choosing the
@@ -283,7 +299,7 @@
 */
 
 /* Places to put an operand, for non-general operands:
-   Characters used: BbCcDdghijkLlMmNnostWw123456789
+   Characters used: BbCcDdFfGgHhIijkLlMmNnostWw123456789/
 
    s  source, low bits of first word.
    d  dest, shifted 9 in first word
@@ -348,6 +364,13 @@
    F  double precision float, low bit of 1st word, immediate uses 8 bytes
    x  extended precision float, low bit of 1st word, immediate uses 12 bytes
    p  packed float, low bit of 1st word, immediate uses 12 bytes
+   G  EMAC accumulator, load  (bit 4 2nd word, !bit8 first word)
+   H  EMAC accumulator, non load  (bit 4 2nd word, bit 8 first word)
+   F  EMAC ACCx
+   f  EMAC ACCy
+   I  MAC/EMAC scale factor
+   /  Like 's', but set 2nd word, bit 5 if trailing_ampersand set
+   ]  first word, bit 10
 */
 
 extern const struct m68k_opcode m68k_opcodes[];
diff --git a/include/splay-tree.h b/include/splay-tree.h
index 86707fc..e05aeb5 100644
--- a/include/splay-tree.h
+++ b/include/splay-tree.h
@@ -81,21 +81,21 @@
 struct splay_tree_node_s GTY(())
 {
   /* The key.  */
-  splay_tree_key GTY ((use_param1 (""))) key;
+  splay_tree_key GTY ((use_param1)) key;
 
   /* The value.  */
-  splay_tree_value GTY ((use_param2 (""))) value;
+  splay_tree_value GTY ((use_param2)) value;
 
   /* The left and right children, respectively.  */
-  splay_tree_node GTY ((use_params (""))) left;
-  splay_tree_node GTY ((use_params (""))) right;
+  splay_tree_node GTY ((use_params)) left;
+  splay_tree_node GTY ((use_params)) right;
 };
 
 /* The splay tree itself.  */
 struct splay_tree_s GTY(())
 {
   /* The root of the tree.  */
-  splay_tree_node GTY ((use_params (""))) root;
+  splay_tree_node GTY ((use_params)) root;
 
   /* The comparision function.  */
   splay_tree_compare_fn comp;
@@ -109,7 +109,7 @@
   /* Allocate/free functions, and a data pointer to pass to them.  */
   splay_tree_allocate_fn allocate;
   splay_tree_deallocate_fn deallocate;
-  PTR GTY((skip (""))) allocate_data;
+  PTR GTY((skip)) allocate_data;
 
 };
 typedef struct splay_tree_s *splay_tree;
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 2dce4d8..f8e1c9c 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,74 @@
+2004-06-29  Danny Smith  <dannysmith@users.sourceforge.net> 
+
+	* lrealpath.c (lrealpath): Add _WIN32 support.
+
+2004-06-28  Zack Weinberg  <zack@codesourcery.com>
+
+	* cp-demangle.h: Declare cplus_demangle_operators,
+	cplus_demangle_builtin_types, cplus_demangle_mangled_name, and
+	cplus_demangle_type as static if IN_GLIBCPP_V3.
+
+2004-06-28  Ian Lance Taylor  <ian@wasabisystems.com>
+
+	PR other/16240
+	* cp-demangle.c (d_expr_primary): Check for a failure return from
+	cplus_demangle_type.
+	* testsuite/demangle-expected: Add test case.
+
+2004-05-31  Danny Smith  <dannysmith@users.sourceforge.net>
+
+	* pex-win32.c (fix_argv): Expand comment.
+
+2004-05-25  Daniel Jacobowitz  <drow@false.org>
+
+	* Makefile.in: Add .NOEXPORT.
+
+2004-04-29  Douglas B Rupp  <rupp@gnat.com>
+
+	* mkstemps.c (mkstemps) [VMS]: Remove special open option. Update
+	copyright.
+
+2004-04-26  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
+
+	* configure.ac (UNSIGNED_64BIT_TYPE): Unquote the definition.
+	* configure: Regenerate.
+
+2004-04-22  Richard Henderson  <rth@redhat.com>
+
+	* hashtab.c: Include limits.h, stdint.h, ansidecl.h.
+	(CHAR_BIT): Provide default.
+	(struct prime_ent, prime_tab): New.
+	(higher_prime_index): Rename from higher_prime_number, return index.
+	(htab_mod_1): New.
+	(htab_mod, htab_mod_m2): Use it.
+	(htab_create_alloc, htab_create_alloc_ex): Store prime index.
+	(htab_expand): Likewise.
+	* configure.ac: Check for stdint.h.
+	(UNSIGNED_64BIT_TYPE): New define and checks to fill it in.
+	* config.in, configure: Rebuild.
+
+2004-04-13  Ian Lance Taylor  <ian@wasabisystems.com>
+
+	* strerror.c: Include config.h, and redefine sys_nerr and
+	sys_errlist, before including ansidecl.h and libiberty.h.
+
+2004-04-13  Jeff Law  <law@redhat.com>
+
+	* hashtab.c (htab_remove_elt_with_hash): New function.
+	(htab_remove_elt): Implement in terms of htab_remove_elt_with_hash.
+
+2004-03-31  Richard Henderson  <rth@redhat.com>
+
+	* hashtab.c (htab_size): Move to top of file; mark inline.
+	(htab_elements): Likewise.
+	(htab_mod, htab_mod_m2): New.
+	(htab_delete): Refactor htab->size and htab->entries.
+	(htab_empty): Likewise.
+	(find_empty_slot_for_expand): Use htab_size, htab_mod, htab_mod_m2.
+	(htab_find_with_hash, htab_find_slot_with_hash): Likewise.
+	(htab_clear_slot): Use htab_size, htab_elements.
+	(htab_traverse_noresize, htab_traverse): Likewise.
+
 2004-03-17  Ian Lance Taylor  <ian@wasabisystems.com>
 
 	* pex-unix.c (pexecute): Use vfork instead of fork, with
@@ -543,7 +614,7 @@
 
 2003-08-12  Nathanael Nerode  <neroden@gcc.gnu.org>
 
-        * cp-demangle.c: Clarify what package(s) this is part of.
+	* cp-demangle.c: Clarify what package(s) this is part of.
 
 2003-07-05  Danny Smith  <dannysmith@users.sourceforge.net>
 
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 78cc4bc..9f95c01 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -1057,3 +1057,6 @@
 	else true; fi
 	$(COMPILE.c) $(srcdir)/xstrerror.c $(OUTPUT_OPTION)
 
+# Don't export variables to the environment, in order to not confuse
+# configure.
+.NOEXPORT:
diff --git a/libiberty/config.in b/libiberty/config.in
index 99ee082..3cce9aa 100644
--- a/libiberty/config.in
+++ b/libiberty/config.in
@@ -353,6 +353,9 @@
 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
 #undef TIME_WITH_SYS_TIME
 
+/* Define to an unsigned 64-bit type available in the compiler. */
+#undef UNSIGNED_64BIT_TYPE
+
 /* whether byteorder is bigendian */
 #undef WORDS_BIGENDIAN
 
diff --git a/libiberty/configure b/libiberty/configure
index 374d11b..e44984c 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -1305,6 +1305,7 @@
 
 
 
+
 # This works around the fact that libtool configuration may change LD
 # for this particular configuration, but some shells, instead of
 # keeping the changes in LD private, export them just because LD is
@@ -3538,7 +3539,8 @@
 
 
 
-for ac_header in sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h
+
+for ac_header in sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h stdint.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_header" >&5
@@ -4102,6 +4104,170 @@
 
 fi
 
+
+# Look for a 64-bit type.
+echo "$as_me:$LINENO: checking for a 64-bit type" >&5
+echo $ECHO_N "checking for a 64-bit type... $ECHO_C" >&6
+if test "${liberty_cv_uint64+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+int
+main ()
+{
+extern uint64_t foo;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  liberty_cv_uint64=uint64_t
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif
+int
+main ()
+{
+extern char foo[sizeof(long) * CHAR_BIT >= 64 ? 1 : -1];
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  liberty_cv_uint64="unsigned long"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif
+int
+main ()
+{
+extern char foo[sizeof(long long) * CHAR_BIT >= 64 ? 1 : -1];
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  liberty_cv_uint64="unsigned long long"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+liberty_cv_uint64=none
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+echo "$as_me:$LINENO: result: $liberty_cv_uint64" >&5
+echo "${ECHO_T}$liberty_cv_uint64" >&6
+if test "$liberty_cv_uint64" != none; then
+
+cat >>confdefs.h <<_ACEOF
+#define UNSIGNED_64BIT_TYPE $liberty_cv_uint64
+_ACEOF
+
+fi
+
 # Given the above check, we always have uintptr_t or a fallback
 # definition.  So define HAVE_UINTPTR_T in case any imported code
 # relies on it.
@@ -6601,7 +6767,9 @@
 
 # We need multilib support, but only if configuring for the target.
                     ac_config_files="$ac_config_files Makefile testsuite/Makefile"
+
           ac_config_commands="$ac_config_commands default"
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
diff --git a/libiberty/configure.ac b/libiberty/configure.ac
index 39bfb51..42fe85d 100644
--- a/libiberty/configure.ac
+++ b/libiberty/configure.ac
@@ -159,13 +159,47 @@
 # 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 limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h)
+AC_CHECK_HEADERS(sys/file.h sys/param.h limits.h stdlib.h malloc.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h sys/pstat.h sys/sysmp.h sys/sysinfo.h machine/hal_sysinfo.h sys/table.h sys/sysctl.h sys/systemcfg.h stdint.h)
 AC_HEADER_SYS_WAIT
 AC_HEADER_TIME
 
 libiberty_AC_DECLARE_ERRNO
 
 AC_CHECK_TYPE(uintptr_t, unsigned long)
+
+# Look for a 64-bit type.
+AC_MSG_CHECKING([for a 64-bit type])
+AC_CACHE_VAL(liberty_cv_uint64,
+[AC_TRY_COMPILE(
+[#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif],
+[extern uint64_t foo;],
+liberty_cv_uint64=uint64_t,
+[AC_TRY_COMPILE(
+[#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif],
+[extern char foo[sizeof(long) * CHAR_BIT >= 64 ? 1 : -1];],
+liberty_cv_uint64="unsigned long",
+[AC_TRY_COMPILE(
+[#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif],
+[extern char foo[sizeof(long long) * CHAR_BIT >= 64 ? 1 : -1];],
+liberty_cv_uint64="unsigned long long", liberty_cv_uint64=none)])])])
+AC_MSG_RESULT($liberty_cv_uint64)
+if test "$liberty_cv_uint64" != none; then
+  AC_DEFINE_UNQUOTED(UNSIGNED_64BIT_TYPE, $liberty_cv_uint64,
+                     [Define to an unsigned 64-bit type available in the compiler.])
+fi
+
 # Given the above check, we always have uintptr_t or a fallback
 # definition.  So define HAVE_UINTPTR_T in case any imported code
 # relies on it.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index fe4b367..8608bc8 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -2398,6 +2398,8 @@
       const char *s;
 
       type = cplus_demangle_type (di);
+      if (type == NULL)
+	return NULL;
 
       /* If we have a type we know how to print, we aren't going to
 	 print the type name itself.  */
diff --git a/libiberty/cp-demangle.h b/libiberty/cp-demangle.h
index eea0868..02e74ec 100644
--- a/libiberty/cp-demangle.h
+++ b/libiberty/cp-demangle.h
@@ -131,19 +131,31 @@
 
 /* Functions and arrays in cp-demangle.c which are referenced by
    functions in cp-demint.c.  */
+#ifdef IN_GLIBCPP_V3
+#define CP_STATIC_IF_GLIBCPP_V3 static
+#else
+#define CP_STATIC_IF_GLIBCPP_V3 extern
+#endif
 
-extern const struct demangle_operator_info cplus_demangle_operators[];
+CP_STATIC_IF_GLIBCPP_V3
+const struct demangle_operator_info cplus_demangle_operators[];
 
 #define D_BUILTIN_TYPE_COUNT (26)
 
-extern const struct demangle_builtin_type_info
+CP_STATIC_IF_GLIBCPP_V3
+const struct demangle_builtin_type_info
 cplus_demangle_builtin_types[D_BUILTIN_TYPE_COUNT];
 
-extern struct demangle_component *
+CP_STATIC_IF_GLIBCPP_V3
+struct demangle_component *
 cplus_demangle_mangled_name PARAMS ((struct d_info *, int));
 
-extern struct demangle_component *
+CP_STATIC_IF_GLIBCPP_V3
+struct demangle_component *
 cplus_demangle_type PARAMS ((struct d_info *));
 
 extern void
 cplus_demangle_init_info PARAMS ((const char *, int, size_t, struct d_info *));
+
+/* cp-demangle.c needs to define this a little differently */
+#undef CP_STATIC_IF_GLIBCPP_V3
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index 231fbc0..6e7a44b 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -1,5 +1,6 @@
 /* An expandable hash tables datatype.  
-   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    Contributed by Vladimir Makarov (vmakarov@cygnus.com).
 
 This file is part of the libiberty library.
@@ -40,20 +41,29 @@
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
-
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
-
 #ifdef HAVE_MALLOC_H
 #include <malloc.h>
 #endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
 
 #include <stdio.h>
 
 #include "libiberty.h"
+#include "ansidecl.h"
 #include "hashtab.h"
 
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif
+
 /* This macro defines reserved value for empty table entry. */
 
 #define EMPTY_ENTRY    ((PTR) 0)
@@ -63,7 +73,10 @@
 
 #define DELETED_ENTRY  ((PTR) 1)
 
-static unsigned long higher_prime_number PARAMS ((unsigned long));
+static unsigned int higher_prime_index PARAMS ((unsigned long));
+static hashval_t htab_mod_1 PARAMS ((hashval_t, hashval_t, hashval_t, int));
+static hashval_t htab_mod PARAMS ((hashval_t, htab_t));
+static hashval_t htab_mod_m2 PARAMS ((hashval_t, htab_t));
 static hashval_t hash_pointer PARAMS ((const void *));
 static int eq_pointer PARAMS ((const void *, const void *));
 static int htab_expand PARAMS ((htab_t));
@@ -75,69 +88,117 @@
 htab_hash htab_hash_pointer = hash_pointer;
 htab_eq htab_eq_pointer = eq_pointer;
 
-/* The following function returns a nearest prime number which is
-   greater than N, and near a power of two. */
+/* Table of primes and multiplicative inverses.
 
-static unsigned long
-higher_prime_number (n)
+   Note that these are not minimally reduced inverses.  Unlike when generating
+   code to divide by a constant, we want to be able to use the same algorithm
+   all the time.  All of these inverses (are implied to) have bit 32 set.
+
+   For the record, here's the function that computed the table; it's a 
+   vastly simplified version of the function of the same name from gcc.  */
+
+#if 0
+unsigned int
+ceil_log2 (unsigned int x)
+{
+  int i;
+  for (i = 31; i >= 0 ; --i)
+    if (x > (1u << i))
+      return i+1;
+  abort ();
+}
+
+unsigned int
+choose_multiplier (unsigned int d, unsigned int *mlp, unsigned char *shiftp)
+{
+  unsigned long long mhigh;
+  double nx;
+  int lgup, post_shift;
+  int pow, pow2;
+  int n = 32, precision = 32;
+
+  lgup = ceil_log2 (d);
+  pow = n + lgup;
+  pow2 = n + lgup - precision;
+
+  nx = ldexp (1.0, pow) + ldexp (1.0, pow2);
+  mhigh = nx / d;
+
+  *shiftp = lgup - 1;
+  *mlp = mhigh;
+  return mhigh >> 32;
+}
+#endif
+
+struct prime_ent
+{
+  hashval_t prime;
+  hashval_t inv;
+  hashval_t inv_m2;	/* inverse of prime-2 */
+  hashval_t shift;
+};
+
+static struct prime_ent const prime_tab[] = {
+  {          7, 0x24924925, 0x9999999b, 2 },
+  {         13, 0x3b13b13c, 0x745d1747, 3 },
+  {         31, 0x08421085, 0x1a7b9612, 4 },
+  {         61, 0x0c9714fc, 0x15b1e5f8, 5 },
+  {        127, 0x02040811, 0x0624dd30, 6 },
+  {        251, 0x05197f7e, 0x073260a5, 7 },
+  {        509, 0x01824366, 0x02864fc8, 8 },
+  {       1021, 0x00c0906d, 0x014191f7, 9 },
+  {       2039, 0x0121456f, 0x0161e69e, 10 },
+  {       4093, 0x00300902, 0x00501908, 11 },
+  {       8191, 0x00080041, 0x00180241, 12 },
+  {      16381, 0x000c0091, 0x00140191, 13 },
+  {      32749, 0x002605a5, 0x002a06e6, 14 },
+  {      65521, 0x000f00e2, 0x00110122, 15 },
+  {     131071, 0x00008001, 0x00018003, 16 },
+  {     262139, 0x00014002, 0x0001c004, 17 },
+  {     524287, 0x00002001, 0x00006001, 18 },
+  {    1048573, 0x00003001, 0x00005001, 19 },
+  {    2097143, 0x00004801, 0x00005801, 20 },
+  {    4194301, 0x00000c01, 0x00001401, 21 },
+  {    8388593, 0x00001e01, 0x00002201, 22 },
+  {   16777213, 0x00000301, 0x00000501, 23 },
+  {   33554393, 0x00001381, 0x00001481, 24 },
+  {   67108859, 0x00000141, 0x000001c1, 25 },
+  {  134217689, 0x000004e1, 0x00000521, 26 },
+  {  268435399, 0x00000391, 0x000003b1, 27 },
+  {  536870909, 0x00000019, 0x00000029, 28 },
+  { 1073741789, 0x0000008d, 0x00000095, 29 },
+  { 2147483647, 0x00000003, 0x00000007, 30 },
+  /* Avoid "decimal constant so large it is unsigned" for 4294967291.  */
+  { 0xfffffffb, 0x00000006, 0x00000008, 31 }
+};
+
+/* The following function returns an index into the above table of the
+   nearest prime number which is greater than N, and near a power of two. */
+
+static unsigned int
+higher_prime_index (n)
      unsigned long n;
 {
-  /* These are primes that are near, but slightly smaller than, a
-     power of two.  */
-  static const unsigned long primes[] = {
-    (unsigned long) 7,
-    (unsigned long) 13,
-    (unsigned long) 31,
-    (unsigned long) 61,
-    (unsigned long) 127,
-    (unsigned long) 251,
-    (unsigned long) 509,
-    (unsigned long) 1021,
-    (unsigned long) 2039,
-    (unsigned long) 4093,
-    (unsigned long) 8191,
-    (unsigned long) 16381,
-    (unsigned long) 32749,
-    (unsigned long) 65521,
-    (unsigned long) 131071,
-    (unsigned long) 262139,
-    (unsigned long) 524287,
-    (unsigned long) 1048573,
-    (unsigned long) 2097143,
-    (unsigned long) 4194301,
-    (unsigned long) 8388593,
-    (unsigned long) 16777213,
-    (unsigned long) 33554393,
-    (unsigned long) 67108859,
-    (unsigned long) 134217689,
-    (unsigned long) 268435399,
-    (unsigned long) 536870909,
-    (unsigned long) 1073741789,
-    (unsigned long) 2147483647,
-					/* 4294967291L */
-    ((unsigned long) 2147483647) + ((unsigned long) 2147483644),
-  };
-
-  const unsigned long *low = &primes[0];
-  const unsigned long *high = &primes[sizeof(primes) / sizeof(primes[0])];
+  unsigned int low = 0;
+  unsigned int high = sizeof(prime_tab) / sizeof(prime_tab[0]);
 
   while (low != high)
     {
-      const unsigned long *mid = low + (high - low) / 2;
-      if (n > *mid)
+      unsigned int mid = low + (high - low) / 2;
+      if (n > prime_tab[mid].prime)
 	low = mid + 1;
       else
 	high = mid;
     }
 
   /* If we've run out of primes, abort.  */
-  if (n > *low)
+  if (n > prime_tab[low].prime)
     {
       fprintf (stderr, "Cannot find prime bigger than %lu\n", n);
       abort ();
     }
 
-  return *low;
+  return low;
 }
 
 /* Returns a hash code for P.  */
@@ -159,6 +220,76 @@
   return p1 == p2;
 }
 
+/* Return the current size of given hash table. */
+
+inline size_t
+htab_size (htab)
+     htab_t htab;
+{
+  return htab->size;
+}
+
+/* Return the current number of elements in given hash table. */
+
+inline size_t
+htab_elements (htab)
+     htab_t htab;
+{
+  return htab->n_elements - htab->n_deleted;
+}
+
+/* Return X % Y.  */
+
+static inline hashval_t
+htab_mod_1 (x, y, inv, shift)
+     hashval_t x, y, inv;
+     int shift;
+{
+  /* The multiplicative inverses computed above are for 32-bit types, and
+     requires that we be able to compute a highpart multiply.  */
+#ifdef UNSIGNED_64BIT_TYPE
+  __extension__ typedef UNSIGNED_64BIT_TYPE ull;
+  if (sizeof (hashval_t) * CHAR_BIT <= 32)
+    {
+      hashval_t t1, t2, t3, t4, q, r;
+
+      t1 = ((ull)x * inv) >> 32;
+      t2 = x - t1;
+      t3 = t2 >> 1;
+      t4 = t1 + t3;
+      q  = t4 >> shift;
+      r  = x - (q * y);
+
+      return r;
+    }
+#endif
+
+  /* Otherwise just use the native division routines.  */
+  return x % y;
+}
+
+/* Compute the primary hash for HASH given HTAB's current size.  */
+
+static inline hashval_t
+htab_mod (hash, htab)
+     hashval_t hash;
+     htab_t htab;
+{
+  const struct prime_ent *p = &prime_tab[htab->size_prime_index];
+  return htab_mod_1 (hash, p->prime, p->inv, p->shift);
+}
+
+/* Compute the secondary hash for HASH given HTAB's current size.  */
+
+static inline hashval_t
+htab_mod_m2 (hash, htab)
+     hashval_t hash;
+     htab_t htab;
+{
+  const struct prime_ent *p = &prime_tab[htab->size_prime_index];
+  return 1 + htab_mod_1 (hash, p->prime - 2, p->inv_m2, p->shift);
+}
+
 /* This function creates table with length slightly longer than given
    source length.  Created hash table is initiated as empty (all the
    hash table entries are EMPTY_ENTRY).  The function returns the
@@ -174,8 +305,11 @@
      htab_free free_f;
 {
   htab_t result;
+  unsigned int size_prime_index;
 
-  size = higher_prime_number (size);
+  size_prime_index = higher_prime_index (size);
+  size = prime_tab[size_prime_index].prime;
+
   result = (htab_t) (*alloc_f) (1, sizeof (struct htab));
   if (result == NULL)
     return NULL;
@@ -187,6 +321,7 @@
       return NULL;
     }
   result->size = size;
+  result->size_prime_index = size_prime_index;
   result->hash_f = hash_f;
   result->eq_f = eq_f;
   result->del_f = del_f;
@@ -210,8 +345,11 @@
      htab_free_with_arg free_f;
 {
   htab_t result;
+  unsigned int size_prime_index;
 
-  size = higher_prime_number (size);
+  size_prime_index = higher_prime_index (size);
+  size = prime_tab[size_prime_index].prime;
+
   result = (htab_t) (*alloc_f) (alloc_arg, 1, sizeof (struct htab));
   if (result == NULL)
     return NULL;
@@ -223,6 +361,7 @@
       return NULL;
     }
   result->size = size;
+  result->size_prime_index = size_prime_index;
   result->hash_f = hash_f;
   result->eq_f = eq_f;
   result->del_f = del_f;
@@ -282,22 +421,23 @@
 htab_delete (htab)
      htab_t htab;
 {
+  size_t size = htab_size (htab);
+  PTR *entries = htab->entries;
   int i;
 
   if (htab->del_f)
-    for (i = htab->size - 1; i >= 0; i--)
-      if (htab->entries[i] != EMPTY_ENTRY
-	  && htab->entries[i] != DELETED_ENTRY)
-	(*htab->del_f) (htab->entries[i]);
+    for (i = size - 1; i >= 0; i--)
+      if (entries[i] != EMPTY_ENTRY && entries[i] != DELETED_ENTRY)
+	(*htab->del_f) (entries[i]);
 
   if (htab->free_f != NULL)
     {
-      (*htab->free_f) (htab->entries);
+      (*htab->free_f) (entries);
       (*htab->free_f) (htab);
     }
   else if (htab->free_with_arg_f != NULL)
     {
-      (*htab->free_with_arg_f) (htab->alloc_arg, htab->entries);
+      (*htab->free_with_arg_f) (htab->alloc_arg, entries);
       (*htab->free_with_arg_f) (htab->alloc_arg, htab);
     }
 }
@@ -308,15 +448,16 @@
 htab_empty (htab)
      htab_t htab;
 {
+  size_t size = htab_size (htab);
+  PTR *entries = htab->entries;
   int i;
 
   if (htab->del_f)
-    for (i = htab->size - 1; i >= 0; i--)
-      if (htab->entries[i] != EMPTY_ENTRY
-	  && htab->entries[i] != DELETED_ENTRY)
-	(*htab->del_f) (htab->entries[i]);
+    for (i = size - 1; i >= 0; i--)
+      if (entries[i] != EMPTY_ENTRY && entries[i] != DELETED_ENTRY)
+	(*htab->del_f) (entries[i]);
 
-  memset (htab->entries, 0, htab->size * sizeof (PTR));
+  memset (entries, 0, size * sizeof (PTR));
 }
 
 /* Similar to htab_find_slot, but without several unwanted side effects:
@@ -331,8 +472,8 @@
      htab_t htab;
      hashval_t hash;
 {
-  size_t size = htab->size;
-  unsigned int index = hash % size;
+  hashval_t index = htab_mod (hash, htab);
+  size_t size = htab_size (htab);
   PTR *slot = htab->entries + index;
   hashval_t hash2;
 
@@ -341,7 +482,7 @@
   else if (*slot == DELETED_ENTRY)
     abort ();
 
-  hash2 = 1 + hash % (size - 2);
+  hash2 = htab_mod_m2 (hash, htab);
   for (;;)
     {
       index += hash2;
@@ -372,19 +513,27 @@
   PTR *olimit;
   PTR *p;
   PTR *nentries;
-  size_t nsize;
+  size_t nsize, osize, elts;
+  unsigned int oindex, nindex;
 
   oentries = htab->entries;
-  olimit = oentries + htab->size;
+  oindex = htab->size_prime_index;
+  osize = htab->size;
+  olimit = oentries + osize;
+  elts = htab_elements (htab);
 
   /* Resize only when table after removal of unused elements is either
      too full or too empty.  */
-  if ((htab->n_elements - htab->n_deleted) * 2 > htab->size
-      || ((htab->n_elements - htab->n_deleted) * 8 < htab->size
-	  && htab->size > 32))
-    nsize = higher_prime_number ((htab->n_elements - htab->n_deleted) * 2);
+  if (elts * 2 > osize || (elts * 8 < osize && osize > 32))
+    {
+      nindex = higher_prime_index (elts * 2);
+      nsize = prime_tab[nindex].prime;
+    }
   else
-    nsize = htab->size;
+    {
+      nindex = oindex;
+      nsize = osize;
+    }
 
   if (htab->alloc_with_arg_f != NULL)
     nentries = (PTR *) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize,
@@ -395,7 +544,7 @@
     return 0;
   htab->entries = nentries;
   htab->size = nsize;
-
+  htab->size_prime_index = nindex;
   htab->n_elements -= htab->n_deleted;
   htab->n_deleted = 0;
 
@@ -431,22 +580,20 @@
      const PTR element;
      hashval_t hash;
 {
-  unsigned int index;
-  hashval_t hash2;
+  hashval_t index, hash2;
   size_t size;
   PTR entry;
 
   htab->searches++;
-  size = htab->size;
-  index = hash % size;
+  size = htab_size (htab);
+  index = htab_mod (hash, htab);
 
   entry = htab->entries[index];
   if (entry == EMPTY_ENTRY
       || (entry != DELETED_ENTRY && (*htab->eq_f) (entry, element)))
     return entry;
 
-  hash2 = 1 + hash % (size - 2);
-
+  hash2 = htab_mod_m2 (hash, htab);
   for (;;)
     {
       htab->collisions++;
@@ -488,17 +635,19 @@
      enum insert_option insert;
 {
   PTR *first_deleted_slot;
-  unsigned int index;
-  hashval_t hash2;
+  hashval_t index, hash2;
   size_t size;
   PTR entry;
 
-  if (insert == INSERT && htab->size * 3 <= htab->n_elements * 4
-      && htab_expand (htab) == 0)
-    return NULL;
+  size = htab_size (htab);
+  if (insert == INSERT && size * 3 <= htab->n_elements * 4)
+    {
+      if (htab_expand (htab) == 0)
+	return NULL;
+      size = htab_size (htab);
+    }
 
-  size = htab->size;
-  index = hash % size;
+  index = htab_mod (hash, htab);
 
   htab->searches++;
   first_deleted_slot = NULL;
@@ -511,7 +660,7 @@
   else if ((*htab->eq_f) (entry, element))
     return &htab->entries[index];
       
-  hash2 = 1 + hash % (size - 2);
+  hash2 = htab_mod_m2 (hash, htab);
   for (;;)
     {
       htab->collisions++;
@@ -560,17 +709,31 @@
 }
 
 /* This function deletes an element with the given value from hash
-   table.  If there is no matching element in the hash table, this
-   function does nothing.  */
+   table (the hash is computed from the element).  If there is no matching
+   element in the hash table, this function does nothing.  */
 
 void
 htab_remove_elt (htab, element)
      htab_t htab;
      PTR element;
 {
+  htab_remove_elt_with_hash (htab, element, (*htab->hash_f) (element));
+}
+
+
+/* This function deletes an element with the given value from hash
+   table.  If there is no matching element in the hash table, this
+   function does nothing.  */
+
+void
+htab_remove_elt_with_hash (htab, element, hash)
+     htab_t htab;
+     PTR element;
+     hashval_t hash;
+{
   PTR *slot;
 
-  slot = htab_find_slot (htab, element, NO_INSERT);
+  slot = htab_find_slot_with_hash (htab, element, hash, NO_INSERT);
   if (*slot == EMPTY_ENTRY)
     return;
 
@@ -590,7 +753,7 @@
      htab_t htab;
      PTR *slot;
 {
-  if (slot < htab->entries || slot >= htab->entries + htab->size
+  if (slot < htab->entries || slot >= htab->entries + htab_size (htab)
       || *slot == EMPTY_ENTRY || *slot == DELETED_ENTRY)
     abort ();
 
@@ -616,7 +779,7 @@
   PTR *limit;
 
   slot = htab->entries;
-  limit = slot + htab->size;
+  limit = slot + htab_size (htab);
 
   do
     {
@@ -638,30 +801,12 @@
      htab_trav callback;
      PTR info;
 {
-  if ((htab->n_elements - htab->n_deleted) * 8 < htab->size)
+  if (htab_elements (htab) * 8 < htab_size (htab))
     htab_expand (htab);
 
   htab_traverse_noresize (htab, callback, info);
 }
 
-/* Return the current size of given hash table. */
-
-size_t
-htab_size (htab)
-     htab_t htab;
-{
-  return htab->size;
-}
-
-/* Return the current number of elements in given hash table. */
-
-size_t
-htab_elements (htab)
-     htab_t htab;
-{
-  return htab->n_elements - htab->n_deleted;
-}
-
 /* Return the fraction of fixed collisions during all work with given
    hash table. */
 
diff --git a/libiberty/lrealpath.c b/libiberty/lrealpath.c
index b001b38..4877753 100644
--- a/libiberty/lrealpath.c
+++ b/libiberty/lrealpath.c
@@ -64,6 +64,12 @@
 #   define REALPATH_LIMIT MAXPATHLEN
 #  endif
 # endif
+#else
+  /* cygwin has realpath, so it won't get here.  */ 
+# if defined (_WIN32)
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h> /* for GetFullPathName */
+# endif
 #endif
 
 char *
@@ -123,6 +129,30 @@
   }
 #endif
 
+  /* The MS Windows method.  If we don't have realpath, we assume we
+     don't have symlinks and just canonicalize to a Windows absolute
+     path.  GetFullPath converts ../ and ./ in relative paths to
+     absolute paths, filling in current drive if one is not given
+     or using the current directory of a specified drive (eg, "E:foo").
+     It also converts all forward slashes to back slashes.  */
+#if defined (_WIN32)
+  {
+    char buf[MAX_PATH];
+    char* basename;
+    DWORD len = GetFullPathName (filename, MAX_PATH, buf, &basename);
+    if (len == 0 || len > MAX_PATH - 1)
+      return strdup (filename);
+    else
+      {
+	/* The file system is case-preserving but case-insensitive,
+	   Canonicalize to lowercase, using the codepage associated
+	   with the process locale.  */
+        CharLowerBuff (buf, len);
+        return strdup (buf);
+      }
+  }
+#endif
+
   /* This system is a lost cause, just duplicate the filename.  */
   return strdup (filename);
 }
diff --git a/libiberty/mkstemps.c b/libiberty/mkstemps.c
index 1f6600a..94edf78 100644
--- a/libiberty/mkstemps.c
+++ b/libiberty/mkstemps.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1996, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1998, 2004 Free Software Foundation, Inc.
    This file is derived from mkstemp.c from the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -121,11 +121,7 @@
       v /= 62;
       XXXXXX[5] = letters[v % 62];
 
-#ifdef VMS
-      fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600, "fop=tmd");
-#else
       fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600);
-#endif
       if (fd >= 0)
 	/* The file does not exist.  */
 	return fd;
diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c
index 27a5bb4..2b4abdf 100644
--- a/libiberty/pex-win32.c
+++ b/libiberty/pex-win32.c
@@ -59,7 +59,12 @@
   int i;
   char * command0 = argvec[0];
 
-  /* Ensure that the executable pathname uses Win32 backslashes.  */
+  /* Ensure that the executable pathname uses Win32 backslashes. This
+     is not necessary on NT, but on W9x, forward slashes causes failure
+     of spawn* and exec* functions (and probably any function that
+     calls CreateProcess) *iff* the executable pathname (argvec[0]) is
+     a quoted string.  And quoting is necessary in case a pathname
+     contains  embedded white space. You can't win.  */
   for (; *command0 != '\0'; command0++)
     if (*command0 == '/')
       *command0 = '\\';
diff --git a/libiberty/strerror.c b/libiberty/strerror.c
index 83a5992..c0edb47 100644
--- a/libiberty/strerror.c
+++ b/libiberty/strerror.c
@@ -2,9 +2,6 @@
    Written by Fred Fish.  fnf@cygnus.com
    This file is in the public domain.  --Per Bothner.  */
 
-#include "ansidecl.h"
-#include "libiberty.h"
-
 #include "config.h"
 
 #ifdef HAVE_SYS_ERRLIST
@@ -17,6 +14,9 @@
 #define sys_errlist sys_errlist__
 #endif
 
+#include "ansidecl.h"
+#include "libiberty.h"
+
 #include <stdio.h>
 #include <errno.h>
 
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 9a3f0b9..d38ce33 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3699,6 +3699,11 @@
 void foo<int (*) [3]>(int (* const&) [3])
 foo<int (*) [3]>
 #
+# This used to crash the demangler--PR 16240
+--format=gnu-v3 --no-params
+_ZN13PatternDriver23StringScalarDeleteValueC1ERKNS_25ConflateStringScalarValueERKNS_25AbstractStringScalarValueERKNS_12TemplateEnumINS_12pdcomplementELZNS_16complement_namesEELZNS_14COMPLEMENTENUMEEEE
+_ZN13PatternDriver23StringScalarDeleteValueC1ERKNS_25ConflateStringScalarValueERKNS_25AbstractStringScalarValueERKNS_12TemplateEnumINS_12pdcomplementELZNS_16complement_namesEELZNS_14COMPLEMENTENUMEEEE
+PatternDriver::StringScalarDeleteValue::StringScalarDeleteValue
 # Test GNU V3 constructor and destructor identification.
 # 0 means it is not a constructor/destructor.
 # Other integers correspond to enum gnu_v3_{c,d}tor_kinds in demangle.h.
diff --git a/mpw-README b/mpw-README
deleted file mode 100644
index 767140b..0000000
--- a/mpw-README
+++ /dev/null
@@ -1,376 +0,0 @@
-This is basic information about the Macintosh(tm) MPW(tm) port of the
-GNU tools.  The information below applies to both native and cross
-compilers.
-
-(Please note that there are two versions of this file; "mpw-README"
-is the source form, and "Read Me for MPW" is the distribution form.
-"Read Me for MPW" has 8-bit chars such as \Option-d embedded in it.)
-
-INSTALLING GNU TOOLS
-
-* System Requirements
-
-To use these tools, you will need a Mac with a 68020 or better or else
-any PowerMac, System 7.1 or later, and MPW 3.3 or 3.4.  You will *not*
-need any other MPW compiler unless you want to rebuild from sources,
-nor even any include files, unless you are building actual Mac
-applications.  For PowerMac native you will need PPCLink, however;
-also the executables are PowerPC-only.
-
-* Automated Installation
-
-The simplest way to install GNU tools is to run the Install script.
-The script will copy things to where you want to keep them, will build
-a UserStartup file with settings corresponding to where things were
-copied, and offer to put that UserStartup file in your MPW folder.
-
-The Install script does not alter anything in the System Folder, and
-it does not take any action without confirmation.
-
-The Install script will be at the top level of the binary
-distribution, or at the top level of the object directory if
-rebuilding from source.  (The sources include a file called
-"mpw-install" at the top level, but it is the source to the Install
-script and cannot be run directly.)
-
-* Manual Installation
-
-If you don't want to run the Install script, you can do installation
-manually; this section describes the steps involved.
-
-The GNU tools can go in any directory that is in your {Commands} list.
-We generally put all the tools somewhere like {Boot}Cygnus:latest:bin,
-and then add to a UserStartup file:
-
-	set Commands "{Boot}Cygnus:latest:bin:,{Commands}"
-
-However, the cpp and cc1 programs of GCC are not normally stored here.
-Instead, they will be in a "lib" directory that is alongside "bin",
-and organized by target and version underneath, with names like
-
-	:lib:gcc-lib:<target>:cygnus-<version>:
-
-If you build and install everything yourself according to the build
-instructions below, then you will not have any problems.  However, you
-may discover that GCC seems unable to find the right cpp and cc1;
-usually this will be because directory names have changed.  (Even
-renaming your hard disk will make this happen.)  In such cases, you
-have several choices.  One is just to add this directory to
-{Commands}, but then you will not be able to get any other cpp or cc1,
-such as those used by a different target or version.  Another way is
-to rename your disk and directories to match the prefix used when the
-tools were compiled.  Finally, you can set the variable
-GCC_EXEC_PREFIX to point to the library directory:
-
-	set GCC_EXEC_PREFIX MyDisk:Stuff:lib:gcc-lib:
-	export GCC_EXEC_PREFIX
-
-You may also want to edit MPW's HEXA 128 resource.  When GCC is built
-using a native GCC, it is compiled to use a special stack allocator
-function alloca().  While this is very efficient, it means that GCC
-will need considerable stack space to run, especially when compiling
-large programs with optimization turned on.  You give MPW more stack
-by editing the HEXA 128 resource of the MPW Shell.  A value of "0008
-0000" gives 512K of stack size, which is usually sufficient.
-
-USING GNU TOOLS
-
-* Using Native PowerMac GCC
-
-Using a native PowerMac GCC to produce MPW tools or MacOS applications
-is more complicated than just "gC foo.c", although no more complicated
-than with other Mac compilers.
-
-To build a native PowerMac MPW tool, use this sequence, where hello.c
-is the usual "hello world" program, and genericcfrg.r is the Rez file
-with the code fragment resource:
-
-gC -I{CIncludes} -fno-builtin -Dpascal= -c -g hello.c
-PPCLink hello.o -o hello \Option-d
-	"{PPCLibraries}"StdCRuntime.o \Option-d
-	"{SharedLibraries}"InterfaceLib \Option-d
-	"{SharedLibraries}"StdCLib \Option-d
-	"{PPCLibraries}"PPCToolLibs.o \Option-d
-	"{PPCLibraries}"PPCCRuntime.o \Option-d
-	"{GCCPPCLibraries}"libgcc.xcoff
-rez -d APPNAME='"'hello'"' GenericCFRG.r -o hello
-setfile -t 'MPST' -c 'MPS ' hello
-
-The same sequence works to build a MacOS application, but you set the file
-type to 'APPL' and don't link in PPCToolLibs.o.  For further details on
-using MPW to build Mac applications, see the general MPW documentation.
-
-Recent versions of PPCLink have an option to generate the code
-fragment resource and automatically set creator and file type;
-here is what GenericCFRG.r should look like if you have an older
-PPCLink or are using GNU ld:
-
-#include "CodeFragmentTypes.r"
-
-resource 'cfrg' (0) {
-        {
-                kPowerPC,
-                kFullLib,
-                kNoVersionNum,kNoVersionNum,
-                0,0,
-                kIsApp,kOnDiskFlat,kZeroOffset,kWholeFork,
-                APPNAME // must be defined on Rez command line with -d option
-        }
-};
-
-In general this port of GCC supports the same option syntax and
-behavior as its Unix counterpart.  It also has similar compilation
-rules, so it will run the assembler on .s files and so forth.
-
-The GCC manual includes full information on the available options.
-One option that may be especially useful is "-v", which shows you what
-tools and options are being used; unlike most Mac C compilers, GCC
-directs assembly and linking in addition to compilation.
-
-MPW GCC does feature two extensions to the option syntax; '-d macro=name'
-works just as '-Dmacro=name' does in Unix, and '-i directory' works the
-same as '-Idirectory'.
-
-MPW GCC supports the usual Pascal-style strings and alignment pragmas.
-
-To find standard include files you can set the variable GCCIncludes:
-
-	set GCCIncludes MyDisk:MyIncludes:
-	export GCCIncludes
-
-GCCIncludes is similar to MPW's CIncludes or CW's MWCIncludes.  In
-order to use MPW's usual include files, just say:
-
-	set GCCIncludes "{CIncludes}"
-	export GCCIncludes
-
-* Using GCC as a Cross-Compiler
-
-If you have a cross-compiler, and you have all of the correct
-target-side crt0 and libraries available, then to compile and link a
-file "foo.c", you can say just
-
-	gC foo.c
-
-The output file will be an MPW binary file named "a.out"; the format
-of the contents will depend on which target is in use, so for instance
-a MIPS-targeting GCC will produce ECOFF or ELF executables.
-
-Note that using MPW include files with a cross-compiler is somewhat
-dangerous.
-
-* Using the Assembler and Friends
-
-The assembler ("as") and linker ("ld") are faithful ports of their
-Unix counterparts.  Similarly, the binutils "ar", "cplusfilt", "nm",
-"objcopy", "objdump", "ranlib", "size", "strings", and "strip" are all
-like they are under Unix.  (Note that "cplusfilt" is usually called
-"c++filt" under Unix.)
-
-* Using GDB
-
-There are two flavors of GDB.  "gdb" is an MPW tool that works very
-much like it does in Unix; put a command into the MPW worksheet and
-type the <enter> key to send it to GDB.  While "gdb" is running, you
-cannot do anything else in MPW, although you can switch to other
-Mac applications and use them.
-
-"SiowGDB" is also a Mac application, but it is GDB using the SIOW
-package to provide console emulation.  Commands are exactly as for the
-MPW tool, but since this is its own application, you can switch
-between it and MPW.
-
-BUILDING GNU TOOLS
-
-This port of the GNU tools uses a configure script similar to
-that used for GNU tools under Unix, but rewritten for MPW.  As with
-Unix configuration, there is an "object" directory that may be
-different from the "source" directory.  In the example commands below,
-we will assume that we are currently in the object directory, and that
-the source directory is "{Boot}Cygnus:src:".
-
-* Requirements for Building
-
-In addition to the sources, you will need a set of tools that the
-configure and build scripts assume to be available.  These tools
-(and their versions, if relevant) are as follows:
-
-	byacc tool
-	flex (2.3.7) tool (and Flex.skel file)
-	forward-include script
-	MoveIfChange script
-	mpw-touch script
-	mpw-true script
-	NewFolderRecursive script
-	null-command script
-	open-brace script
-	sed (1.13) tool
-	tr-7to8 script
-	true script
-
-The scripts are in the sources, under utils:mpw:. You must arrange to
-get the other tools yourself (they are readily available from the
-"usual" net sites, and are also on many CDROMS).  In addition, there
-will usually be a set of these available at ftp.cygnus.com, in pub/mac.
-
-You may put the build tools in your usual Tools or Scripts
-directories, or keep them in a separate directories.  We prefer to
-make a directory called "buildtools" and we put this in one of our
-UserStartup files:
-
-	set Commands "{Boot}Cygnus:buildtools:,{Commands}"
-
-Flex uses an environment variable FLEX_SKELETON to locate its skeleton
-file, so you need to do something like this, preferably in a UserStartup:
-
-	Set FLEX_SKELETON "{Boot}"Cygnus:buildtools:Flex.skel
-	Export FLEX_SKELETON
-
-* Configuring
-
-Before you can build anything, you must configure.  You do this by
-creating an directory where object files will be stored, setdirectory
-to that directory and do a configure command:
-
-	{Boot}Cygnus:src:mpw-configure --target <name> --cc <compiler> --srcdir {Boot}Cygnus:src: --prefix <whatever>
-
-If the source directory is not in your {Commands} list, then you must
-supply a full pathname to mpw-configure, since mpw-configure invokes
-itself after switching into each subdirectory.  Using a relative
-pathname, even something like ':mpw-configure', will therefore not work.
-
-<name> must be a known target.  Valid ones include "m68k-apple-macos",
-"powerpc-apple-macos", "i386-unknown-go32", "mips-idt-ecoff", and
-"sh-hitachi-hms".  Not all target types are accepted for all of the
-tools yet.
-
-<compiler> must be the name of the compiler to use.  It defaults to "mpwc".
-
-	(m68k)
-	mpwc	MPW C
-	sc68k	Symantec C
-	mwc68k	Metrowerks C (Codewarrior)
-	gcc68k	GCC
-
-	(powerpc)
-	ppcc	PPCC
-	mrc	Macintosh on RisC (Mister C, aka(?) Frankenstein)
-	scppc	Symantec C
-	mwcppc	Metrowerks C (Codewarrior)
-	gccppc	GCC
-
-Not all compilers will compile all tools equally well!  For m68k Macs,
-MPW C has the best record so far (it has problems, but they can be
-worked around), while for PowerMacs, CodeWarrior is the only compiler
-that has successfully compiled everything into running code.
-
-<prefix> is the path that "gcc" will prepend when looking for tools
-to execute.  GCC_EXEC_PREFIX overrides this value, so you need not
-include it if you plan to use GCC_EXEC_PREFIX.
-
-As an example, here is the configure line that you could use to build
-native PowerMac GCC:
-
-"{Boot}"Cygnus:src:mpw-configure --cc mwcppc --target powerpc-apple-macos --srcdir "{Boot}"Cygnus:src: --prefix "{Boot}"GNUTools:
-
-* Building
-
-If you use CodeWarrior, you *must* first set MWCIncludes to
-{CIncludes}.  This is because you will be building MPW tools, and
-their standard I/O works by making references to data that is part of
-the MPW Shell, which means that the code must be compiled and linked
-with macros that refer to that data, and those macros are in
-{CIncludes}, not the default {MWCIncludes}.  Without this change, you
-will encounter problems compiling libiberty/mpw.c, but tweaking that
-file only masks the real problem, and does not fix it.
-
-The command
-
-	mpw-build
-
-will build everything. Building will take over an hour on a Quadra 800
-or PowerMac 8100/110, longer if the sources are on a shared volume.
-
-You may see some warnings; these are mostly likely benign, typically
-disagreements about declarations of library and system functions.
-
-* Installing
-
-To install the just-built tools, use the command
-
-	mpw-build install
-
-This part of the installation procedure just copies files to the
-location specified at configure time by <prefix>, and, in some cases,
-renames them from temporary internal names to their usual names. This
-install process is *not* the same as what the Install script does;
-Install can copy tools from the installation location chosen at
-configuration time to a user-chosen place, and sets up a UserStartup
-file.  Note that while the Install script is optional, the install
-build action performs some tasks would be very hard to replicate
-manually, so you should always do it before using the tools.
-
-* Known Problems With Using Various Compilers to Build
-
-Most versions of MPW C have problems with compiling GNU software.
-
-MPW C 3.2.x has preprocessing bugs that render it incapable of
-compiling the BFD library, so it can't be used at all for building BFD.
-
-MPW C 3.3, 3.3.1, and 3.3.2 will spontaneously claim to have found
-errors in the source code, but in fact the code is perfectly fine.  If
-this happens, just set the working directory back to the top-level
-objdir (where the configure command above was performed), and type
-"mpw-build all" again.  If it goes on through the supposed error, then
-you got one of the spurious errors.  A full build may require a number
-of these restarts.
-
-MPW C 3.3.3 seems to work OK, at least with the aid of a number of
-workarounds that are in the sources (look for #ifdef MPW_C).
-
-Versions of MPW Make earlier than 4.0d2 have exhibited bizarre behavior,
-failure to substitute variables and the like.
-
-Metrowerks CW6 PPC linker (MWLinkPPC) seems to do bad things with memory
-if the "Modern Memory Manager" is turned on (in the Memory control panel),
-but works OK if it is turned off.
-
-Metrowerks CW6 loses bigtime compiling opcodes:ppc-opc.c, which has
-some deeply nested macros.  (CW7 is OK.)  There is a way to patch the
-file, by substituting constant values.  If you need to do this,
-contact shebs@cygnus.com for details.
-
-<Gestalt.h> is missing from {CIncludes} in the MPW version that comes
-with CW7.  You can just copy the one in CW7's {MWCIncludes}.
-
-CW8 and later have changes to headers and such that will require changes
-to the source in order to be able to use them to rebuild.
-
-KNOWN BUGS
-
-The declarations for memcpy and memcmp in some versions of header files
-may conflict with GCC's builtin definition.  Either use -fno-builtin
-or ignore the warnings.
-
-This is not a bug, but - watch out for cr/nl translation!  For instance,
-if config/mpw-mh-mpw is not properly translated because it has been
-copied or updated separately, then everything will almost build, but
-you will get puzzling error messages from make or the compiler.
-
-'/' or ' ' embedded in any device, directory, or file name may or may
-not work.
-
-objcopy -O srec foo.o makes random output filenames.
-
-Mac-x-mips requires -mgas but Unix hosts don't.
-
-GDB will frequently require a '/' on the front of a device name in order
-to recognize it as an absolute rather than a relative pathname.
-
-GDB doesn't seem to use the printer port correctly, although it tries.
-
-The cursor doesn't always spin as much as it should.  To get elaborate
-statistics and warnings about spin rates, add this to UserStartup:
-
-	set MEASURE_SPIN all
-	export MEASURE_SPIN
diff --git a/mpw-build.in b/mpw-build.in
deleted file mode 100644
index 86d9530..0000000
--- a/mpw-build.in
+++ /dev/null
@@ -1,204 +0,0 @@
-# Top-level script fragment to build everything for MPW.
-
-Set savedir "`Directory`"
-
-#Set Echo 1
-
-Set ThisScript "{0}"
-
-Set objdir ":"
-
-Set verify 0
-
-Set BuildTarget "none"
-
-# Parse arguments.
-
-Loop
-	Break If {#} == 0
-		If "{BuildTarget}" =~ /none/
-			Set BuildTarget "{1}"
-		Else
-			Echo Only one build target allowed, ignoring "{1}"
-		End If
-	Shift 1
-End Loop
-
-If "{BuildTarget}" =~ /none/
-	Set BuildTarget "all"
-End If
-
-If {verify} == 1
-	Echo "#" Doing "{ThisScript}" "{BuildTarget}" in "`Directory`" ... 
-End If
-
-Set ranmake 0
-
-If "`Exists Makefile`" != ""
-	Echo "Set Echo 1" >{BuildTarget}.makeout
-	Make -f Makefile {BuildTarget} >>{BuildTarget}.makeout
-	{BuildTarget}.makeout
-	Delete {BuildTarget}.makeout
-	Set ranmake 1
-End If
-
-If "`Exists Makefile.PPC`" != ""
-	Echo "Set Echo 1" >{BuildTarget}.makeout.ppc
-	Make -f Makefile.PPC {BuildTarget} >>{BuildTarget}.makeout.ppc
-	{BuildTarget}.makeout.ppc
-	Delete {BuildTarget}.makeout.ppc
-	Set ranmake 1
-End If
-
-If {ranmake} == 1
-	Exit
-End If
-
-# Dispatch on various pseudo-targets.
-
-If "{BuildTarget}" =~ /all/
-	Echo Started `Date`
-	"{ThisScript}" all-gcc
-	"{ThisScript}" all-gdb
-	Echo Finished `Date`
-Else If "{BuildTarget}" =~ /all-libiberty/
-	"{ThisScript}" do-libiberty
-Else If "{BuildTarget}" =~ /all-bfd/
-	"{ThisScript}" do-bfd
-Else If "{BuildTarget}" =~ /all-opcodes/
-	"{ThisScript}" do-opcodes
-Else If "{BuildTarget}" =~ /all-byacc/
-	"{ThisScript}" do-byacc
-Else If "{BuildTarget}" =~ /all-flex/
-	"{ThisScript}" all-libiberty
-	"{ThisScript}" do-flex
-Else If "{BuildTarget}" =~ /all-binutils/
-	"{ThisScript}" all-libiberty
-	"{ThisScript}" all-bfd
-	"{ThisScript}" all-opcodes
-	"{ThisScript}" do-binutils
-Else If "{BuildTarget}" =~ /all-gas/
-	"{ThisScript}" all-libiberty
-	"{ThisScript}" all-bfd
-	"{ThisScript}" all-opcodes
-	"{ThisScript}" do-gas
-Else If "{BuildTarget}" =~ /all-gcc/
-	"{ThisScript}" all-libiberty
-	"{ThisScript}" all-gas
-	"{ThisScript}" all-binutils
-	"{ThisScript}" all-ld
-	"{ThisScript}" do-gcc
-Else If "{BuildTarget}" =~ /all-gdb/
-	"{ThisScript}" all-libiberty
-	"{ThisScript}" all-bfd
-	"{ThisScript}" all-opcodes
-	"{ThisScript}" do-gdb
-Else If "{BuildTarget}" =~ /all-grez/
-	"{ThisScript}" all-libiberty
-	"{ThisScript}" all-bfd
-	"{ThisScript}" do-grez
-Else If "{BuildTarget}" =~ /all-ld/
-	"{ThisScript}" all-libiberty
-	"{ThisScript}" all-bfd
-	"{ThisScript}" all-opcodes
-	"{ThisScript}" do-ld
-Else If "{BuildTarget}" =~ /do-byacc/
-	SetDirectory :byacc:
-	::mpw-build all
-Else If "{BuildTarget}" =~ /do-flex/
-	SetDirectory :flex:
-	::mpw-build _bootstrap
-	::mpw-build all
-Else If "{BuildTarget}" =~ /do-bfd/
-	SetDirectory :bfd:
-	::mpw-build all
-Else If "{BuildTarget}" =~ /do-libiberty/
-	SetDirectory :libiberty:
-	::mpw-build all
-Else If "{BuildTarget}" =~ /do-opcodes/
-	SetDirectory :opcodes:
-	::mpw-build all
-Else If "{BuildTarget}" =~ /do-binutils/
-	SetDirectory :binutils:
-	::mpw-build stamps
-	::mpw-build all
-Else If "{BuildTarget}" =~ /do-gas/
-	SetDirectory :gas:
-	::mpw-build stamps
-	::mpw-build all
-Else If "{BuildTarget}" =~ /do-gcc/
-	SetDirectory :gcc:
-	:mpw-build all
-Else If "{BuildTarget}" =~ /do-gdb/
-	SetDirectory :gdb:
-	::mpw-build all
-Else If "{BuildTarget}" =~ /do-grez/
-	SetDirectory :grez:
-	::mpw-build all
-Else If "{BuildTarget}" =~ /do-ld/
-	SetDirectory :ld:
-	::mpw-build all
-Else If "{BuildTarget}" =~ /do-newlib/
-	SetDirectory :newlib:
-	::mpw-build all
-Else If "{BuildTarget}" =~ /install/
-	"{ThisScript}" install-only-top
-	"{ThisScript}" install-binutils
-	"{ThisScript}" install-gas
-	"{ThisScript}" install-gcc
-	"{ThisScript}" install-ld
-	"{ThisScript}" install-gdb
-Else If "{BuildTarget}" =~ /install-binutils/
-	SetDirectory :binutils:
-	::mpw-build install
-Else If "{BuildTarget}" =~ /install-gas/
-	SetDirectory :gas:
-	::mpw-build install
-Else If "{BuildTarget}" =~ /install-gcc/
-	SetDirectory :gcc:
-	:mpw-build install
-Else If "{BuildTarget}" =~ /install-gdb/
-	SetDirectory :gdb:
-	::mpw-build install
-Else If "{BuildTarget}" =~ /install-grez/
-	SetDirectory :grez:
-	::mpw-build install
-Else If "{BuildTarget}" =~ /install-ld/
-	SetDirectory :ld:
-	::mpw-build install
-Else If "{BuildTarget}" =~ /install-only/
-	"{ThisScript}" install-only-top
-	"{ThisScript}" install-only-binutils
-	"{ThisScript}" install-only-gas
-	"{ThisScript}" install-only-gcc
-	"{ThisScript}" install-only-gdb
-	"{ThisScript}" install-only-ld
-Else If "{BuildTarget}" =~ /install-only-binutils/
-	SetDirectory :binutils:
-	::mpw-build install-only
-Else If "{BuildTarget}" =~ /install-only-gas/
-	SetDirectory :gas:
-	::mpw-build install-only
-Else If "{BuildTarget}" =~ /install-only-gcc/
-	SetDirectory :gcc:
-	:mpw-build install-only
-Else If "{BuildTarget}" =~ /install-only-gdb/
-	SetDirectory :gdb:
-	::mpw-build install-only
-Else If "{BuildTarget}" =~ /install-only-grez/
-	SetDirectory :grez:
-	::mpw-build install-only
-Else If "{BuildTarget}" =~ /install-only-ld/
-	SetDirectory :ld:
-	::mpw-build install-only
-Else If "{BuildTarget}" =~ /install-only-top/
-	NewFolderRecursive "{prefix}"
-	If "{prefix}" != "`Directory`"
-		Duplicate -y 'Read Me for MPW' "{prefix}"'Read Me for MPW'
-		Duplicate -y Install "{prefix}"Install
-	End If
-Else
-	Echo {BuildTarget} not understood, ignoring
-End If
-
-SetDirectory "{savedir}"
diff --git a/mpw-config.in b/mpw-config.in
deleted file mode 100644
index 8028737..0000000
--- a/mpw-config.in
+++ /dev/null
@@ -1,113 +0,0 @@
-# Configuration fragment for Cygnus source tree.
-
-# Check that we can find all the special tools that we will need.
-# The test for sed is semi-pointless, because it's already been invoked
-# by the calculation of target_cpu in the main configure script, but
-# the test will also show which one is being used.
-
-Set Exit 0
-Echo byacc is `Which byacc`
-Echo flex is `Which flex`
-Echo forward-include is `Which forward-include`
-Echo MoveIfChange is `Which MoveIfChange`
-Echo mpw-touch is `Which mpw-touch`
-Echo mpw-true is `Which mpw-true`
-Echo NewFolderRecursive is `Which NewFolderRecursive`
-Echo null-command is `Which null-command`
-Echo open-brace is `Which open-brace`
-Echo sed is `Which sed`
-Echo 'tr-7to8' is `Which tr-7to8`
-Echo true is `Which true`
-Set Exit 1
-
-Set host_libs "mmalloc libiberty opcodes bfd readline gash tcl tk tclX"
-
-Set host_tools "texinfo byacc flex bison binutils ld gas gcc gdb make patch \Option-d
-	    prms send-pr gprof gdbtest tgas etc expect dejagnu sim bash \Option-d
-	    m4 autoconf ispell grep diff rcs cvs fileutils shellutils time \Option-d
-	    textutils wdiff find emacs emacs19 uudecode hello tar gzip indent \Option-d
-	    recode release sed utils guile perl apache inet gawk"
-
-Set target_libs "newlib"
-
-Set target_tools "examples"
-
-# Configure the resource compiler if targeting Macs.
-If {target_os} =~ /macos/ || {target_os} =~ /mpw/
-	Set host_tools "{host_tools} grez"
-End If
-	
-Set configdirs "{host_libs} {host_tools} {target_libs} {target_tools}"
-Export configdirs
-
-# Make up a special include directory that tools will share.
-
-If "`Exists "{objdir}"extra-include`" == ""
-	NewFolder "{objdir}"extra-include
-End If
-
-Set edir "{objdir}extra-include:"
-
-forward-include "{srcdir}"include:mpw:sys:file.h "{edir}"'sys/file.h'
-forward-include "{srcdir}"include:mpw:sys:ioctl.h "{edir}"'sys/ioctl.h'
-forward-include "{srcdir}"include:mpw:sys:param.h "{edir}"'sys/param.h'
-forward-include "{srcdir}"include:mpw:sys:resource.h "{edir}"'sys/resource.h'
-forward-include "{srcdir}"include:mpw:sys:stat.h "{edir}"'sys/stat.h'
-forward-include "{srcdir}"include:mpw:sys:time.h "{edir}"'sys/time.h'
-forward-include "{srcdir}"include:mpw:sys:types.h "{edir}"'sys/types.h'
-
-forward-include "{srcroot}"include:aout:aout64.h "{edir}"'aout/aout64.h'
-forward-include "{srcroot}"include:aout:ar.h "{edir}"'aout/ar.h'
-forward-include "{srcroot}"include:aout:ranlib.h "{edir}"'aout/ranlib.h'
-forward-include "{srcroot}"include:aout:reloc.h "{edir}"'aout/reloc.h'
-forward-include "{srcroot}"include:aout:stab.def "{edir}"'aout/stab.def'
-forward-include "{srcroot}"include:aout:stab_gnu.h "{edir}"'aout/stab_gnu.h'
-
-If "`Exists "{srcroot}"include:aout:"{target_cpu}".h`" != ""
-	forward-include "{srcroot}"include:aout:"{target_cpu}".h "{edir}"'aout/'"{target_cpu}"'.h'
-End If
-
-forward-include "{srcroot}"include:coff:ecoff.h "{edir}"'coff/ecoff.h'
-forward-include "{srcroot}"include:coff:internal.h "{edir}"'coff/internal.h'
-forward-include "{srcroot}"include:coff:sym.h "{edir}"'coff/sym.h'
-forward-include "{srcroot}"include:coff:symconst.h "{edir}"'coff/symconst.h'
-
-If "`Exists "{srcroot}"include:coff:"{target_cpu}".h`" != ""
-	forward-include "{srcroot}"include:coff:"{target_cpu}".h "{edir}"'coff/'"{target_cpu}"'.h'
-End If
-If "{target_cpu}" =~ /powerpc/
-	forward-include "{srcroot}"include:coff:rs6000.h "{edir}"'coff/rs6000.h'
-End If
-
-forward-include "{srcroot}"include:elf:common.h "{edir}"'elf/common.h'
-forward-include "{srcroot}"include:elf:dwarf.h "{edir}"'elf/dwarf.h'
-forward-include "{srcroot}"include:elf:dwarf2.h "{edir}"'elf/dwarf2.h'
-forward-include "{srcroot}"include:elf:external.h "{edir}"'elf/external.h'
-forward-include "{srcroot}"include:elf:internal.h "{edir}"'elf/internal.h'
-
-# Believe it or not, GDB needs this for all targets.
-forward-include "{srcroot}"include:elf:mips.h "{edir}"'elf/mips.h'
-
-If "`Exists "{srcroot}"include:elf:"{target_cpu}".h`" != ""
-	forward-include "{srcroot}"include:elf:"{target_cpu}".h "{edir}"'elf/'"{target_cpu}"'.h'
-End If
-If "{target_cpu}" =~ /powerpc/
-	forward-include "{srcroot}"include:elf:ppc.h "{edir}"'elf/ppc.h'
-End If
-
-If "`Exists "{srcroot}"include:opcode:"{target_cpu}".h`" != ""
-	forward-include "{srcroot}"include:opcode:"{target_cpu}".h "{edir}"'opcode/'"{target_cpu}"'.h'
-End If
-If "{target_cpu}" =~ /powerpc/
-	forward-include "{srcroot}"include:opcode:ppc.h "{edir}"'opcode/ppc.h'
-End If
-
-# Add some bfd includes that get mentioned outside the bfd dir.
-	
-forward-include "{srcroot}"bfd:libcoff.h "{edir}"'bfd/libcoff.h'
-forward-include "{srcroot}"bfd:libecoff.h "{edir}"'bfd/libecoff.h'
-
-# Translate random files into MPW-only character set.
-
-tr-7to8 "{srcdir}"mpw-README > "{objdir}Read Me for MPW"
-tr-7to8 "{srcdir}"mpw-install > "{objdir}"Install
diff --git a/mpw-configure b/mpw-configure
deleted file mode 100644
index cf45148..0000000
--- a/mpw-configure
+++ /dev/null
@@ -1,448 +0,0 @@
-# Configuration script
-# Copyright (C) 1994, 1995, 1996 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
-# 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.
-
-### WARNING
-### This script must NOT use any 8-bit chars!
-### WARNING
-
-# This is an MPW Shell script that sets everything up for compilation,
-# mainly creating directories, and editing copies of files.
-
-Set savedir "`Directory`"
-
-#Set Echo 1
-
-Set ThisScript "{0}"
-
-Set srcroot "--------"
-
-Set srcdir ":"
-
-Set objdir ":"
-
-Set prefix "{MPW}":GNUTools:
-
-Set exec_prefix ""
-
-Set bindir ""
-
-Set host_alias "m68k-apple-mpw"
-
-Set target_alias {host_alias}
-
-Set host_cc "mpwc"
-
-Set with_gnu_ld 0
-
-Set helpoutput 0
-
-Set recurse 1
-
-Set verify 0
-Set verifystr ""
-
-Set enable_options ""
-Set disable_options ""
-
-# Parse arguments.
-
-Loop
-	Break If {#} == 0
-	If "{1}" =~ /--cc/
-		Set host_cc "{2}"
-		Shift 1
-	Else If "{1}" =~ /--bindir/
-		Set bindir "{2}"
-		Shift 1
-	Else If "{1}" =~ /--disable-?+/
-		Set `Echo {1} | sed -e 's/--disable-/enable_/'` no
-		Set disable_options "{disable_options} '{1}'"
-	Else If "{1}" =~ /--enable-?+/
-		Set `Echo {1} | sed -e 's/--enable-/enable_/'` yes
-		Set enable_options "{enable_options} '{1}'"
-	Else If "{1}" =~ /--exec-prefix/
-		Set exec_prefix "{2}"
-		Shift 1
-	Else If "{1}" =~ /--help/
-		Set helpoutput 1
-	Else If "{1}" =~ /--host/
-		Set host_alias "{2}"
-		Shift 1
-	Else If "{1}" =~ /--norecursion/
-		Set recurse 0
-	Else If "{1}" =~ /--prefix/
-		Set prefix "{2}"
-		Shift 1
-	Else If "{1}" =~ /--srcdir/
-		Set srcdir "{2}"
-		Shift 1
-	Else If "{1}" =~ /--srcroot/
-		Set srcroot "{2}"
-		Shift 1
-	Else If "{1}" =~ /--target/
-		Set target_alias "{2}"
-		Shift 1
-	Else If "{1}" =~ /-v/
-		Set verify 1
-		Set verifystr "-v"
-	Else If "{1}" =~ /--with-gnu-ld/
-		Set with_gnu_ld 1
-	Else
-		Echo -n 'mpw-configure: Unrecognized option: "'
-		Echo -n "{1}"
-		Echo '"; use --help for usage.'
-		Exit 1
-	End If
-	Shift 1
-End Loop
-
-If {helpoutput} == 1
-	Echo "Usage: mpw-configure [OPTIONS]"
-	Echo ""
-	Echo "Options: [defaults in brackets]"
-	Echo "--bindir DIR      directory for binaries []"
-	Echo "--cc CC           use C compiler CC [mpwc]"
-	Echo "--disable-FOO     do not include feature FOO"
-	Echo "--enable-FOO      include feature FOO"
-	Echo "--exec-prefix DIR install host-dependent files into DIR []"
-	Echo "--help            print this message"
-	Echo "--host HOST       configure for HOST [m68k-apple-mpw]"
-	Echo "--norecursion     configure this directory only [recurse]"
-	Echo "--prefix DIR      install into DIR [{MPW}:GNUTools:]"
-	Echo "--srcdir DIR      find the sources in DIR [:]"
-	Echo "--srcroot DIR     find the toplevel sources in DIR [:]"
-	Echo "--target TARGET   configure for TARGET [TARGET=HOST]"
-	Echo "-v                verbose"
-	Echo "--with-gnu-ld     link using GNU ld [no]"
-	Exit 0
-End If
-
-Set Exit 0
-
-# Default exec_prefix from prefix.
-
-If "{exec_prefix}" == ""
-	Set exec_prefix "{prefix}"
-End If
-
-If "{bindir}" == ""
-	Set bindir "{prefix}"bin:
-End If
-
-# Point to the correct set of tools to use with the chosen compiler.
-
-If "{host_cc}" =~ /mpwc/
-	Set host_alias "m68k-apple-mpw"
-	Set cc_name '{CC_MPW_C}'
-	Set segment_flag '-s '
-	Set ar_name '{AR_LIB}'
-	Set ranlib_name '{RANLIB_NULL}'
-	Set cc_ld_name '{CC_LD_LINK}'
-	Set prog_ext_name '{PROG_EXT_68K}'
-	Set extralibs_name '{EXTRALIBS_C}'
-	Set makepef_name '{MAKEPEF_NULL}'
-	Set rez_name '{REZ_68K}'
-Else If "{host_cc}" =~ /sc68k/
-	Set host_alias "m68k-apple-mpw"
-	Set cc_name '{CC_SC}'
-	Set segment_flag '-s '
-	Set ar_name '{AR_LIB}'
-	Set ranlib_name '{RANLIB_NULL}'
-	Set cc_ld_name '{CC_LD_LINK}'
-	Set prog_ext_name '{PROG_EXT_68K}'
-	Set extralibs_name '{EXTRALIBS_C}'
-	Set makepef_name '{MAKEPEF_NULL}'
-	Set rez_name '{REZ_68K}'
-Else If "{host_cc}" =~ /mwc68k/
-	Set host_alias "m68k-apple-mpw"
-	Set cc_name '{CC_MWC68K}'
-	Set segment_flag '-s '
-	Set ar_name '{AR_MWLINK68K}'
-	Set ranlib_name '{RANLIB_NULL}'
-	Set cc_ld_name '{CC_LD_MWLINK68K}'
-	Set prog_ext_name '{PROG_EXT_68K}'
-	Set extralibs_name '{EXTRALIBS_MWC68K}'
-	Set makepef_name '{MAKEPEF_NULL}'
-	Set rez_name '{REZ_68K}'
-Else If "{host_cc}" =~ /gcc68k/
-	Set host_alias "m68k-apple-mpw"
-	Set cc_name '{CC_68K_GCC}'
-	Set segment_flag '-s '
-	Set ar_name '{AR_68K_AR}'
-	Set ranlib_name '{RANLIB_RANLIB}'
-	Set cc_ld_name '{CC_68K_GCC}'
-	Set prog_ext_name '{PROG_EXT_68K}'
-	Set extralibs_name '{EXTRALIBS_C}'
-	Set makepef_name '{MAKEPEF_NULL}'
-	Set rez_name '{REZ_68K}'
-Else If "{host_cc}" =~ /ppcc/
-	Set host_alias "powerpc-apple-mpw"
-	Set cc_name '{CC_PPCC}'
-	Set segment_flag '-d ___s_e_g___='
-	Set ar_name '{AR_PPCLINK}'
-	Set ranlib_name '{RANLIB_NULL}'
-	Set cc_ld_name '{CC_LD_PPCLINK}'
-	Set prog_ext_name '{PROG_EXT_XCOFF}'
-	Set extralibs_name '{EXTRALIBS_PPC}'
-	Set makepef_name '{MAKEPEF_PPC}'
-	Set rez_name '{REZ_PPC}'
-Else If "{host_cc}" =~ /mrc/
-	Set host_alias "powerpc-apple-mpw"
-	Set cc_name '{CC_MRC}'
-	Set segment_flag '-d ___s_e_g___='
-	Set ar_name '{AR_PPCLINK}'
-	Set ranlib_name '{RANLIB_NULL}'
-	Set cc_ld_name '{CC_LD_PPCLINK}'
-	Set prog_ext_name '{PROG_EXT_XCOFF}'
-	Set extralibs_name '{EXTRALIBS_PPC}'
-	Set makepef_name '{MAKEPEF_PPC}'
-	Set rez_name '{REZ_PPC}'
-Else If "{host_cc}" =~ /scppc/
-	Set host_alias "powerpc-apple-mpw"
-	Set cc_name '{CC_SC}'
-	Set segment_flag '-d ___s_e_g___='
-	Set ar_name '{AR_PPCLINK}'
-	Set ranlib_name '{RANLIB_NULL}'
-	Set cc_ld_name '{CC_LD_PPCLINK}'
-	Set prog_ext_name '{PROG_EXT_XCOFF}'
-	Set extralibs_name '{EXTRALIBS_PPC}'
-	Set makepef_name '{MAKEPEF_PPC}'
-	Set rez_name '{REZ_PPC}'
-Else If "{host_cc}" =~ /mwcppc/
-	Set host_alias "powerpc-apple-mpw"
-	Set cc_name '{CC_MWCPPC}'
-	Set segment_flag '-d ___s_e_g___='
-	Set ar_name '{AR_MWLINKPPC}'
-	Set ranlib_name '{RANLIB_NULL}'
-	Set cc_ld_name '{CC_LD_MWLINKPPC}'
-	# Misleading, but we don't need a PEF step.
-	Set prog_ext_name '{PROG_EXT_68K}'
-	Set extralibs_name '{EXTRALIBS_MWCPPC}'
-	Set makepef_name '{MAKEPEF_NULL}'
-	Set rez_name '{REZ_PPC}'
-Else If "{host_cc}" =~ /gccppc/
-	Set host_alias "powerpc-apple-mpw"
-	Set cc_name '{CC_PPC_GCC}'
-	Set segment_flag '-d ___s_e_g___='
-	Set ar_name '{AR_PPCLINK}'
-	If {with_gnu_ld} == 1
-		Set ranlib_name '{RANLIB_RANLIB}'
-		Set cc_ld_name '{CC_LD_GLD}'
-	Else
-		Set ranlib_name '{RANLIB_NULL}'
-		Set cc_ld_name '{CC_LD_PPCLINK}'
-	End If
-	Set prog_ext_name '{PROG_EXT_XCOFF}'
-	Set extralibs_name '{EXTRALIBS_PPC}'
-	Set makepef_name '{MAKEPEF_PPC}'
-	Set rez_name '{REZ_PPC}'
-Else
-	Echo "{host_cc}" is not a known MPW compiler type
-End If
-
-Set dash_c_flag ''
-If "{host_cc}" =~ /gcc68k/
-	Set dash_c_flag '-c'
-Else If "{host_cc}" =~ /gccppc/
-	Set dash_c_flag '-c'
-End If
-
-# (should interpret aliases if not in canonical form)
-
-Set host_canonical "{host_alias}"
-
-Set target_canonical "{target_alias}"
-
-Set configdirs ""
-
-If "{srcroot}" =~ /--------/
-	Set srcroot "{srcdir}"
-End If
-If "`Exists "{srcdir}"`" == ""
-	Echo Source directory {srcdir} does not exist!
-	Exit 1
-End If
-If "`Exists "{srcroot}"`" == ""
-	Echo Top-level source directory {srcroot} does not exist!
-	Exit 1
-End If
-
-Set target_cpu "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`"
-Set target_vendor "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`"
-Set target_os "`echo {target_canonical} | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\3/'`"
-
-# Create a file that is guaranteed to be older than any other here.
-
-If "`Exists "{objdir}"_oldest`" == ""
-	mpw-touch _oldest
-End If
-
-# Record this before creating any files, makefiles sometimes mention
-# dependencies on config.status.
-
-Echo "# This directory was configured as follows:" >config.new
-Echo "{ThisScript} --host {host_alias} --target {target_alias} --srcdir {srcdir}  --srcroot {srcroot}  --prefix {prefix} --cc {host_cc} {verifystr} {enable_options} {disable_options} --norecursion" >>config.new
-MoveIfChange config.new config.status
-
-If "`Exists "{srcdir}"mpw-config.in`" != ""
-	tr-7to8 "{srcdir}"mpw-config.in >"{objdir}"mpw-config.in
-	Execute "{objdir}"mpw-config.in
-End If
-
-# Start Makefile construction by defining all the variables chosen by
-# configuration.
-
-Echo "# This Makefile produced by mpw-configure.  Changes may get lost!" > "{objdir}"Makefile.tem
-Echo "srcroot = " {srcroot}			>> "{objdir}"Makefile.tem
-Echo "topsrcdir = " {srcroot}			>> "{objdir}"Makefile.tem
-Echo "srcdir = " {srcdir}			>> "{objdir}"Makefile.tem
-Echo "mpw_prefix = " {prefix}			>> "{objdir}"Makefile.tem
-Echo "mpw_exec_prefix = " {exec_prefix}		>> "{objdir}"Makefile.tem
-Echo "mpw_bindir = " {bindir}			>> "{objdir}"Makefile.tem
-Echo "host_alias = " {host_alias}		>> "{objdir}"Makefile.tem
-Echo "target_alias = " {target_alias}		>> "{objdir}"Makefile.tem
-Echo "target_cpu = " {target_cpu}		>> "{objdir}"Makefile.tem
-Echo "target_vendor = " {target_vendor}		>> "{objdir}"Makefile.tem
-Echo "target_os = " {target_os}			>> "{objdir}"Makefile.tem
-Echo "target_canonical = " {target_canonical}	>> "{objdir}"Makefile.tem
-Echo "host_makefile_frag = "			>> "{objdir}"Makefile.tem
-Echo "target_makefile_frag = "			>> "{objdir}"Makefile.tem
-Echo "CC = " {cc_name}				>> "{objdir}"Makefile.tem
-Echo "AR = " {ar_name}				>> "{objdir}"Makefile.tem
-Echo "RANLIB = " {ranlib_name}			>> "{objdir}"Makefile.tem
-Echo "CC_LD = " {cc_ld_name}			>> "{objdir}"Makefile.tem
-Echo "PROG_EXT = " {prog_ext_name}		>> "{objdir}"Makefile.tem
-Echo "EXTRALIBS = " {extralibs_name}		>> "{objdir}"Makefile.tem
-Echo "MAKEPEF = " {makepef_name}		>> "{objdir}"Makefile.tem
-Echo "REZ = " {rez_name}			>> "{objdir}"Makefile.tem
-
-If {host_cc} =~ /gccppc/
-	Echo -n "dq =\Option-d\Option-d\Option-d" > "{objdir}"Makefile.tem0
-	Echo '"' 				 >> "{objdir}"Makefile.tem0
-	tr-7to8  "{objdir}"Makefile.tem0	>>"{objdir}"Makefile.tem
-Else
-	Echo -n "dq ='" 			>> "{objdir}"Makefile.tem
-	Echo -n '"' 				>> "{objdir}"Makefile.tem
-	Echo    "'" 				>> "{objdir}"Makefile.tem
-End If
-
-# Append the master set of definitions for the various compilers.
-
-If "`Exists "{srcdir}"config:mpw-mh-mpw`" != ""
-	tr-7to8 "{srcdir}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem
-Else If "`Exists "{srcroot}"config:mpw-mh-mpw`" != ""
-	tr-7to8 "{srcroot}"config:mpw-mh-mpw >>"{objdir}"Makefile.tem
-Else
-	Echo "can't find a host config file!"
-	Exit 0
-End If
-
-# Append anything produced by the directory's mpw-config.in.
-
-If "`Exists "{objdir}"mk.tmp`" != ""
-	Catenate "{objdir}"mk.tmp >>"{objdir}"Makefile.tem
-	# An mpw-config.in might change so as not to create this
-	# anymore, so get rid of it now to be safe.
-	Delete -i -y "{objdir}"mk.tmp
-End If
-
-# If there are sed scripts to edit the Unix Makefile.in, use them; otherwise
-# use an mpw-make.in if present.
-
-If "`Exists "{srcdir}"mpw-make.sed`" != ""
-	If "`Exists "{objdir}"hacked_Makefile.in`" != ""
-		Set MakefileIn "{objdir}"hacked_Makefile.in
-	Else
-		Set MakefileIn "{srcdir}"Makefile.in
-	End If
-	# Find the generic makefile editing script.
-	If "`Exists "{srcroot}"config:mpw:g-mpw-make.sed`" != ""
-		sed -f "{srcroot}"config:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1
-	Else If "`Exists "{srcroot}"utils:mpw:g-mpw-make.sed`" != ""
-		sed -f "{srcroot}"utils:mpw:g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1
-	Else If "`Exists "{srcdir}"g-mpw-make.sed`" != ""
-		sed -f "{srcdir}"g-mpw-make.sed "{MakefileIn}" >"{objdir}"Makefile.tem1
-	Else
-		Echo Warning: g-mpw-make.sed not found, copying "{MakefileIn}" verbatim...
-		Catenate "{MakefileIn}" >"{objdir}"Makefile.tem1
-	End If
-	sed -f "{srcdir}"mpw-make.sed "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2
-	sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' -e 's/^exec_prefix = .*$/exec_prefix = {mpw_exec_prefix}/g' -e 's/^bindir = @bindir@/bindir = {mpw_bindir}/g' "{objdir}"Makefile.tem2 >"{objdir}"Makefile.tem3
-	sed -e "s/@DASH_C_FLAG@/{dash_c_flag}/" -e "s/@SEGMENT_FLAG(\([^)]*\))@/{segment_flag}\1/" "{objdir}"Makefile.tem3 >"{objdir}"mpw-make.in
-	tr-7to8 "{objdir}"mpw-make.in >>"{objdir}"Makefile.tem
-	If "`Exists "{objdir}"mk.sed`" != ""
-		sed -f "{objdir}"mk.sed "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2
-		Rename -y "{objdir}"Makefile.tem2 "{objdir}"Makefile.tem
-	End If
-	MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile
-	Delete -i -y "{objdir}"Makefile.tem[12]
-	If {verify} == 1
-		Echo Created Makefile in "`Directory`"
-	End If
-Else If "`Exists "{srcdir}"mpw-make.in`" != ""
-	sed -e 's/^prefix = .*$/prefix = {mpw_prefix}/g' "{srcdir}"mpw-make.in >"{objdir}"Makefile.tem1
-	sed -e "s/@DASH_C_FLAG@/{dash_c_flag}/" -e "s/@SEGMENT_FLAG(\([^)]*\))@/{segment_flag}}\1/" "{objdir}"Makefile.tem1 >"{objdir}"Makefile.tem2
-	tr-7to8 "{objdir}"Makefile.tem2 >>"{objdir}"Makefile.tem
-	If "`Exists "{objdir}"mk.sed`" != ""
-		sed -f "{objdir}"mk.sed "{objdir}"Makefile.tem >"{objdir}"Makefile.tem2
-		Rename -y "{objdir}"Makefile.tem2 "{objdir}"Makefile.tem
-	End If
-	MoveIfChange "{objdir}"Makefile.tem "{objdir}"Makefile
-	Delete -i -y "{objdir}"Makefile.tem[12]
-	If {verify} == 1
-		Echo Created Makefile in "`Directory`"
-	End If
-End If
-
-# Produce a build script if the source is defined.
-
-If "`Exists "{srcdir}"mpw-build.in`" != ""
-	Echo "Set srcroot " {srcroot} > "{objdir}"mpw-build.tem
-	Echo "Set srcdir " {srcdir} >> "{objdir}"mpw-build.tem
-	Echo "Set target_canonical " {target_canonical} >> "{objdir}"mpw-build.tem
-	Echo "Set prefix " {prefix} >> "{objdir}"mpw-build.tem
-	tr-7to8 "{srcdir}"mpw-build.in >>"{objdir}"mpw-build.tem
-	MoveIfChange "{objdir}"mpw-build.tem "{objdir}"mpw-build
-	If {verify} == 1
-		Echo Created mpw-build in "`Directory`"
-	End If
-End If
-
-# Apply ourselves recursively to the list of subdirectories to configure.
-
-If {recurse} == 1
-	For subdir In {configdirs}
-		Set savedir "`Directory`"
-		If "`Exists "{srcdir}{subdir}:"`" == ""
-			If {verify} == 1
-				Echo No "{srcdir}{subdir}:" found, skipping
-			End If
-			Continue
-		End If
-		If {verify} == 1
-			Echo Configuring {subdir}...
-		End If
-		If "`Exists "{objdir}{subdir}:"`" == ""
-			NewFolder "{objdir}{subdir}"
-		End If
-		SetDirectory "{objdir}{subdir}:"
-		"{ThisScript}" --target "{target_canonical}" --srcdir "{srcdir}{subdir}:" --srcroot "{srcroot}" --prefix "{prefix}" --cc "{host_cc}" {verifystr} {enable_options} {disable_options}
-		SetDirectory "{savedir}"
-	End For
-End If
-
-SetDirectory "{savedir}"
diff --git a/mpw-install b/mpw-install
deleted file mode 100644
index 04c5aac..0000000
--- a/mpw-install
+++ /dev/null
@@ -1,122 +0,0 @@
-# GNU Install script for MPW.
-
-Set OldExit "{Exit}"
-Set Exit 0
-
-Set TempUserStartup "{TempFolder}"__temp__UserStartup
-
-Echo '# UserStartup generated by GNU Install script' > "{TempUserStartup}"
-Echo ''						>> "{TempUserStartup}"
-
-# (should) Check that disk space is sufficient for installation.
-
-# Assume that the install script is where everything else is.
-
-Set thisdir "`Directory`"
-
-# Copy the binaries to the desired place.
-
-Confirm -t "Copy the binaries to somewhere else?"
-Set TmpStatus {Status}
-If {TmpStatus} == 0
-	Set bindest "`GetFileName -d -m "Where to install the binaries?"`"
-	If {Status} == 0
-		If "`Exists "{thisdir}bin"`" != ""
-			For afile In "{thisdir}"bin:\Option-x
-				Duplicate -y "{afile}" "{bindest}"
-			End For
-		Else
-			Echo "bin directory not found, exiting"
-			Exit 1
-		End If
-	Else
-		Echo "No destination supplied, exiting"
-		Exit 1
-	End If
-Else If {TmpStatus} == 4
-	# Use the existing directory.
-	Set bindest "{thisdir}bin:"
-Else
-	# Cancelled from confirmation, escape altogether.
-	Exit 1
-End If
-
-# Copy the libraries to the desired place.
-
-Confirm -t "Copy the libraries to somewhere else?"
-Set TmpStatus {Status}
-If {TmpStatus} == 0
-	Set libdest "`GetFileName -d -m "Where to install the libraries?"`"
-	If {Status} == 0
-		If "`Exists "{thisdir}lib:"`" != ""
-			For afile In "{thisdir}"lib:\Option-x
-				Duplicate -y "{afile}" "{libdest}"
-			End For
-		Else
-			Echo "lib directory not found, exiting"
-			Exit 1
-		End If
-	Else
-		Echo "No destination supplied, exiting"
-		Exit 1
-	End If
-Else If {TmpStatus} == 4
-	# Use the existing directory.
-	Set libdest "{thisdir}lib:"
-Else
-	# Cancelled from confirmation, escape altogether.
-	Exit 1
-End If
-
-
-# Add the location of the binaries to the command path.
-
-Echo -n 'Set Commands "'			>> "{TempUserStartup}"
-Echo -n "{bindest}"				>> "{TempUserStartup}"
-Echo    ',{Commands}"'				>> "{TempUserStartup}"
-Echo ''						>> "{TempUserStartup}"
-
-# Set up GCC exec prefix.
-
-Set gcclibdir "{libdest}"gcc-lib:
-
-Echo -n 'Set GCC_EXEC_PREFIX "'			>> "{TempUserStartup}"
-Echo -n "{gcclibdir}"				>> "{TempUserStartup}"
-Echo    '"'					>> "{TempUserStartup}"
-Echo "Export GCC_EXEC_PREFIX"			>> "{TempUserStartup}"
-Echo ''						>> "{TempUserStartup}"
-
-# Set up path to libgcc.xcoff etc.
-
-Echo -n 'Set GCCPPCLibraries "'			>> "{TempUserStartup}"
-Echo -n "{libdest}"				>> "{TempUserStartup}"
-Echo    '"'					>> "{TempUserStartup}"
-Echo "Export GCCPPCLibraries"			>> "{TempUserStartup}"
-Echo ''						>> "{TempUserStartup}"
-
-# Display contents of UserStartup, confirm installation.
-
-Set UserStartupName "UserStartup\Option-8GNU"
-
-Echo "Contents of" {UserStartupName} "will be:"
-Catenate "{TempUserStartup}"
-
-Confirm "Install {UserStartupName} into the MPW folder {MPW} ?"
-If {Status} == 0
-	Duplicate "{TempUserStartup}" "{MPW}{UserStartupName}"
-	Delete -y "{TempUserStartup}"
-Else
-	Echo "{UserStartupName} file not installed"
-End If
-
-# (should) Check HEXA resource, warn if low.
-
-# (should) Check for spaces in pathnames, warn if found.
-
-Echo "Installation was successful."
-Echo ""
-Echo "Be sure to review the usage notes in 'Read Me for MPW' before proceeding!"
-
-# Restore previous settings.
-
-Set Exit "{OldExit}"
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 947ee4f..94a54aa 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,173 @@
+2004-07-09  Andreas Schwab  <schwab@suse.de>
+
+	* m68k-dis.c (m68k_valid_ea): Check validity of all codes.
+
+2004-07-07  Tomer Levi  <Tomer.Levi@nsc.com>
+
+	* Makefile.am (CFILES): Add crx-dis.c, crx-opc.c.
+	(ALL_MACHINES): Add crx-dis.lo, crx-opc.lo.
+	(crx-dis.lo): New target.
+	(crx-opc.lo): Likewise.
+	* Makefile.in: Regenerate.
+	* configure.in: Handle bfd_crx_arch.
+	* configure: Regenerate.
+	* crx-dis.c: New file.
+	* crx-opc.c: New file.
+	* disassemble.c (ARCH_crx): Define.
+	(disassembler): Handle ARCH_crx.
+
+2004-06-29  James E Wilson  <wilson@specifixinc.com>
+
+	* ia64-opc-a.c (ia64_opcodes_a): Delete mov immediate pseudo for adds.
+	* ia64-asmtab.c: Regnerate.
+
+2004-06-28  Alan Modra  <amodra@bigpond.net.au>
+
+	* ppc-opc.c (insert_fxm): Handle mfocrf and mtocrf.
+	(extract_fxm): Don't test dialect.
+	(XFXFXM_MASK): Include the power4 bit.
+	(XFXM): Add p4 param.
+	(powerpc_opcodes): Add mfocrf and mtocrf.  Adjust mtcr.
+
+2004-06-27  Alexandre Oliva  <aoliva@redhat.com>
+
+	2003-07-21  Richard Sandiford  <rsandifo@redhat.com>
+	* disassemble.c (disassembler): Handle bfd_mach_h8300sxn.
+
+2004-06-26  Alan Modra  <amodra@bigpond.net.au>
+
+	* ppc-opc.c (BH, XLBH_MASK): Define.
+	(powerpc_opcodes): Allow BH field on bclr, bclrl, bcctr, bcctrl.
+
+2004-06-24  Alan Modra  <amodra@bigpond.net.au>
+
+	* i386-dis.c (x_mode): Comment.
+	(two_source_ops): File scope.
+	(float_mem): Correct fisttpll and fistpll.
+	(float_mem_mode): New table.
+	(dofloat): Use it.
+	(OP_E): Correct intel mode PTR output.
+	(ptr_reg): Use open_char and close_char.
+	(PNI_Fixup): Handle possible suffix on sidt.  Use op1out etc. for
+	operands.  Set two_source_ops.
+
+2004-06-15  Alan Modra  <amodra@bigpond.net.au>
+
+	* arc-ext.c (build_ARC_extmap): Use bfd_get_section_size
+	instead of _raw_size.
+
+2004-06-08  Jakub Jelinek  <jakub@redhat.com>
+
+	* ia64-gen.c (in_iclass): Handle more postinc st
+	and ld variants.
+	* ia64-asmtab.c: Rebuilt.
+
+2004-06-01  Martin Schwidefsky  <schwidefsky@de.ibm.com>
+
+	* s390-opc.txt: Correct architecture mask for some opcodes.
+	lrv, lrvh, strv, ml, dl, alc, slb rll and mvclu are available
+	in the esa mode as well.
+
+2004-05-28  Andrew Stubbs <andrew.stubbs@superh.com>
+
+	* sh-dis.c (target_arch): Make unsigned.
+	(print_insn_sh): Replace (most of) switch with a call to
+	sh_get_arch_from_bfd_mach(). Also use new architecture flags system.
+	* sh-opc.h: Redefine architecture flags values.
+	Add sh3-nommu architecture.
+	Reorganise <arch>_up macros so they make more visual sense.
+	(SH_MERGE_ARCH_SET): Define new macro.
+	(SH_VALID_BASE_ARCH_SET): Likewise.
+	(SH_VALID_MMU_ARCH_SET): Likewise.
+	(SH_VALID_CO_ARCH_SET): Likewise.
+	(SH_VALID_ARCH_SET): Likewise.
+	(SH_MERGE_ARCH_SET_VALID): Likewise.
+	(SH_ARCH_SET_HAS_FPU): Likewise.
+	(SH_ARCH_SET_HAS_DSP): Likewise.
+	(SH_ARCH_UNKNOWN_ARCH): Likewise.
+	(sh_get_arch_from_bfd_mach): Add prototype.
+	(sh_get_arch_up_from_bfd_mach): Likewise.
+	(sh_get_bfd_mach_from_arch_set): Likewise.
+	(sh_merge_bfd_arc): Likewise.
+
+2004-05-24  Peter Barada  <peter@the-baradas.com>
+
+	* m68k-dis.c(print_insn_m68k): Strip body of diassembly out
+        into new match_insn_m68k function.  Loop over canidate
+        matches and select first that completely matches.
+	* m68k-dis.c(print_insn_arg): Fix 'g' case to only extract 1 bit.
+	* m68k-dis.c(print_insn_arg): Call new function m68k_valid_ea
+        to verify addressing for MAC/EMAC. 
+	* m68k-dis.c(print_insn_arg): Use reg_half_names for MAC/EMAC
+	reigster halves since 'fpu' and 'spl' look misleading.
+	* m68k-dis.c(fetch_arg): Fix 'G', 'H', 'I', 'f', 'M', 'N' cases.
+	* m68k-opc.c: Rearragne mac/emac cases to use longest for
+	first, tighten up match masks.
+	* m68k-opc.c: Add 'size' field to struct m68k_opcode.  Produce
+	'size' from special case code in print_insn_m68k to
+	determine decode size of insns.
+
+2004-05-19  Alan Modra  <amodra@bigpond.net.au>
+
+	* ppc-opc.c (insert_fxm): Enable two operand mfcr when -many as
+	well as when -mpower4.
+
+2004-05-13  Nick Clifton  <nickc@redhat.com>
+
+	* po/fr.po: Updated French translation.
+
+2004-05-05  Peter Barada  <peter@the-baradas.com>
+
+	* m68k-dis.c(print_insn_m68k): Add new chips, use core
+	variants in arch_mask.  Only set m68881/68851 for 68k chips.
+	* m68k-op.c: Switch from ColdFire chips to core variants.
+
+2004-05-05  Alan Modra  <amodra@bigpond.net.au>
+
+	PR 147.
+	* ppc-opc.c (PPCVEC): Remove PPC_OPCODE_PPC.
+
+2004-04-29  Ben Elliston  <bje@au.ibm.com>
+
+	* ppc-opc.c (XCMPL): Renmame to XOPL. Update users.
+	(powerpc_opcodes): Add "dbczl" instruction for PPC970.
+
+2004-04-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+	* sh-dis.c (print_insn_sh): Print the value in constant pool
+	as a symbol if it looks like a symbol.
+
+2004-04-22  Peter Barada <peter@the-baradas.com>
+
+	* m68k-dis.c(print_insn_m68k): Set mfcmac/mcfemac on
+	appropriate ColdFire architectures.
+	(print_insn_m68k): Handle EMAC, MAC/EMAC scalefactor, and MAC/EMAC
+	mask addressing.
+	Add EMAC instructions, fix MAC instructions. Remove
+	macmw/macml/msacmw/msacml instructions since mask addressing now
+	supported.
+
+2004-04-20  Jakub Jelinek  <jakub@redhat.com>
+
+	* sparc-opc.c (fmoviccx, fmovfccx, fmovccx): Define.
+	(fmovicc, fmovfcc, fmovcc): Remove fpsize argument, change opcode to
+	suffix.  Use fmov*x macros, create all 3 fpsize variants in one
+	macro.  Adjust all users.
+
+2004-04-15  Anil Paranjpe  <anilp1@kpitcummins.com>
+	
+	* h8300-dis.c (bfd_h8_disassemble) : Treat "adds" & "subs"
+	separately.
+
+2004-03-30  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
+
+	* m32r-asm.c: Regenerate.
+
+2004-03-29  Stan Shebs  <shebs@apple.com>
+
+	* mpw-config.in, mpw-make.sed: Remove MPW support files, no longer
+	used.
+
 2004-03-19  Alan Modra  <amodra@bigpond.net.au>
 
 	* aclocal.m4: Regenerate.
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index ea621f2..5c28971 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -57,6 +57,8 @@
 	cgen-opc.c \
 	cris-dis.c \
 	cris-opc.c \
+	crx-dis.c \
+	crx-opc.c \
 	d10v-dis.c \
 	d10v-opc.c \
 	d30v-dis.c \
@@ -179,6 +181,8 @@
 	cgen-opc.lo \
 	cris-dis.lo \
 	cris-opc.lo \
+	crx-dis.lo \
+	crx-opc.lo \
 	d10v-dis.lo \
 	d10v-opc.lo \
 	d30v-dis.lo \
@@ -548,6 +552,9 @@
   $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h sysdep.h config.h \
   $(INCDIR)/opcode/cris.h $(INCDIR)/libiberty.h
 cris-opc.lo: cris-opc.c $(INCDIR)/opcode/cris.h
+crx-dis.lo: crx-dis.c $(INCDIR)/opcode/crx.h \
+  $(INCDIR)/dis-asm.h sysdep.h $(INCDIR)/ansidecl.h
+crx-opc.lo: crx-opc.c $(INCDIR)/opcode/crx.h
 d10v-dis.lo: d10v-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/opcode/d10v.h $(INCDIR)/dis-asm.h $(BFD_H) \
   $(INCDIR)/symcat.h
diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in
index 559194d..c0d0ad8 100644
--- a/opcodes/Makefile.in
+++ b/opcodes/Makefile.in
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
 
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -168,6 +168,8 @@
 	cgen-opc.c \
 	cris-dis.c \
 	cris-opc.c \
+	crx-dis.c \
+	crx-opc.c \
 	d10v-dis.c \
 	d10v-opc.c \
 	d30v-dis.c \
@@ -291,6 +293,8 @@
 	cgen-opc.lo \
 	cris-dis.lo \
 	cris-opc.lo \
+	crx-dis.lo \
+	crx-opc.lo \
 	d10v-dis.lo \
 	d10v-opc.lo \
 	d30v-dis.lo \
@@ -473,7 +477,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.$(OBJEXT) $(libopcodes_la_OBJECTS)
@@ -622,7 +626,7 @@
 	dot_seen=no; \
 	rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
 	  rev="$$subdir $$rev"; \
-	  test "$$subdir" = "." && dot_seen=yes; \
+	  test "$$subdir" != "." || dot_seen=yes; \
 	done; \
 	test "$$dot_seen" = "no" && rev=". $$rev"; \
 	target=`echo $@ | sed s/-recursive//`; \
@@ -1044,6 +1048,9 @@
   $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h sysdep.h config.h \
   $(INCDIR)/opcode/cris.h $(INCDIR)/libiberty.h
 cris-opc.lo: cris-opc.c $(INCDIR)/opcode/cris.h
+crx-dis.lo: crx-dis.c $(INCDIR)/opcode/crx.h \
+  $(INCDIR)/dis-asm.h sysdep.h $(INCDIR)/ansidecl.h
+crx-opc.lo: crx-opc.c $(INCDIR)/opcode/crx.h
 d10v-dis.lo: d10v-dis.c sysdep.h config.h $(INCDIR)/ansidecl.h \
   $(INCDIR)/opcode/d10v.h $(INCDIR)/dis-asm.h $(BFD_H) \
   $(INCDIR)/symcat.h
diff --git a/opcodes/arc-ext.c b/opcodes/arc-ext.c
index fd43d29..6634534 100644
--- a/opcodes/arc-ext.c
+++ b/opcodes/arc-ext.c
@@ -1,5 +1,5 @@
 /* ARC target-dependent stuff. Extension structure access functions
-   Copyright 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1995, 1997, 2000, 2001, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -248,7 +248,7 @@
   for (p = text_bfd->sections; p != NULL; p = p->next)
     if (!strcmp (p->name, ".arcextmap"))
       {
-        count = p->_raw_size;
+        count = bfd_get_section_size (p);
         arcExtMap = (char *) xmalloc (count);
         if (bfd_get_section_contents (text_bfd, p, (PTR) arcExtMap, 0, count))
           {
diff --git a/opcodes/configure b/opcodes/configure
index 6cff4e7..b33d646 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -57,6 +57,7 @@
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -171,6 +172,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
@@ -341,6 +343,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=*)
@@ -506,12 +513,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
@@ -550,12 +561,12 @@
 fi
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:554: checking for Cygwin environment" >&5
+echo "configure:565: 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 559 "configure"
+#line 570 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -566,7 +577,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -583,19 +594,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:587: checking for mingw32 environment" >&5
+echo "configure:598: 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 592 "configure"
+#line 603 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -660,7 +671,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:664: checking host system type" >&5
+echo "configure:675: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -681,7 +692,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:685: checking target system type" >&5
+echo "configure:696: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -699,7 +710,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:703: checking build system type" >&5
+echo "configure:714: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -723,7 +734,7 @@
 
 
         echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:727: checking for strerror in -lcposix" >&5
+echo "configure:738: checking for strerror in -lcposix" >&5
 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -731,7 +742,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lcposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 735 "configure"
+#line 746 "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
@@ -742,7 +753,7 @@
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:757: \"$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
@@ -783,7 +794,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:787: checking for a BSD compatible install" >&5
+echo "configure:798: 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
@@ -836,7 +847,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:840: checking whether build environment is sane" >&5
+echo "configure:851: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -893,7 +904,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:897: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:908: 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
@@ -939,7 +950,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal-${am__api_version}""... $ac_c" 1>&6
-echo "configure:943: checking for working aclocal-${am__api_version}" >&5
+echo "configure:954: checking for working aclocal-${am__api_version}" >&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.
@@ -952,7 +963,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:956: checking for working autoconf" >&5
+echo "configure:967: 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.
@@ -965,7 +976,7 @@
 fi
 
 echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6
-echo "configure:969: checking for working automake-${am__api_version}" >&5
+echo "configure:980: checking for working automake-${am__api_version}" >&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.
@@ -978,7 +989,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:982: checking for working autoheader" >&5
+echo "configure:993: 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.
@@ -991,7 +1002,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:995: checking for working makeinfo" >&5
+echo "configure:1006: 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.
@@ -1014,7 +1025,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:1018: checking for $ac_word" >&5
+echo "configure:1029: 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
@@ -1046,7 +1057,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:1050: checking for $ac_word" >&5
+echo "configure:1061: 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
@@ -1078,7 +1089,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:1082: checking for $ac_word" >&5
+echo "configure:1093: 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
@@ -1184,7 +1195,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:1188: checking for $ac_word" >&5
+echo "configure:1199: 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
@@ -1214,7 +1225,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:1218: checking for $ac_word" >&5
+echo "configure:1229: 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
@@ -1265,7 +1276,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:1269: checking for $ac_word" >&5
+echo "configure:1280: 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
@@ -1297,7 +1308,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1301: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1312: 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.
@@ -1308,12 +1319,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1312 "configure"
+#line 1323 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1328: \"$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
@@ -1339,12 +1350,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:1343: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1354: 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:1348: checking whether we are using GNU C" >&5
+echo "configure:1359: 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
@@ -1353,7 +1364,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1357: \"$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:1368: \"$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
@@ -1372,7 +1383,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1376: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1387: 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
@@ -1415,7 +1426,7 @@
 if test "$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:1419: checking for ld used by GCC" >&5
+echo "configure:1430: checking for ld used by GCC" >&5
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -1445,10 +1456,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1449: checking for GNU ld" >&5
+echo "configure:1460: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1452: checking for non-GNU ld" >&5
+echo "configure:1463: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1483,7 +1494,7 @@
 fi
 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:1487: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1498: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1500,7 +1511,7 @@
 
 
 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1504: checking for $LD option to reload object files" >&5
+echo "configure:1515: checking for $LD option to reload object files" >&5
 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1512,7 +1523,7 @@
 test -n "$reload_flag" && reload_flag=" $reload_flag"
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1516: checking for BSD-compatible nm" >&5
+echo "configure:1527: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1550,7 +1561,7 @@
 echo "$ac_t""$NM" 1>&6
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1554: checking whether ln -s works" >&5
+echo "configure:1565: 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
@@ -1571,7 +1582,7 @@
 fi
 
 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1575: checking how to recognise dependant libraries" >&5
+echo "configure:1586: checking how to recognise dependant libraries" >&5
 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1744,13 +1755,13 @@
 deplibs_check_method=$lt_cv_deplibs_check_method
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1748: checking for object suffix" >&5
+echo "configure:1759: checking for object suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -1770,7 +1781,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1774: checking for executable suffix" >&5
+echo "configure:1785: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1780,10 +1791,10 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:1784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:1795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
-      *.c | *.o | *.obj) ;;
+      *.c | *.o | *.obj | *.ilk | *.pdb) ;;
       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
       esac
     done
@@ -1807,7 +1818,7 @@
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:1811: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1822: checking for ${ac_tool_prefix}file" >&5
 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1869,7 +1880,7 @@
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
     echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:1873: checking for file" >&5
+echo "configure:1884: checking for file" >&5
 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1940,7 +1951,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:1944: checking for $ac_word" >&5
+echo "configure:1955: 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
@@ -1972,7 +1983,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:1976: checking for $ac_word" >&5
+echo "configure:1987: 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
@@ -2007,7 +2018,7 @@
 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2011: checking for $ac_word" >&5
+echo "configure:2022: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2039,7 +2050,7 @@
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2043: checking for $ac_word" >&5
+echo "configure:2054: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2106,8 +2117,8 @@
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 2110 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 2121 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    if test "$lt_cv_prog_gnu_ld" = yes; then
     case `/usr/bin/file conftest.$ac_objext` in
     *32-bit*)
@@ -2140,7 +2151,7 @@
 ia64-*-hpux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
-  if { (eval echo configure:2144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:2155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *ELF-32*)
       HPUX_IA64_MODE="32"
@@ -2158,7 +2169,7 @@
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2162: checking whether the C compiler needs -belf" >&5
+echo "configure:2173: 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
@@ -2171,14 +2182,14 @@
 cross_compiling=$ac_cv_prog_cc_cross
 
      cat > conftest.$ac_ext <<EOF
-#line 2175 "configure"
+#line 2186 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2193: \"$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
@@ -2346,7 +2357,7 @@
 fi
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:2350: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2361: 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"
@@ -2369,7 +2380,7 @@
   
 
 echo $ac_n "checking whether to install libbfd""... $ac_c" 1>&6
-echo "configure:2373: checking whether to install libbfd" >&5
+echo "configure:2384: checking whether to install libbfd" >&5
   # Check whether --enable-install-libbfd or --disable-install-libbfd was given.
 if test "${enable_install_libbfd+set}" = set; then
   enableval="$enable_install_libbfd"
@@ -2406,7 +2417,7 @@
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2410: checking for executable suffix" >&5
+echo "configure:2421: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2416,10 +2427,10 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:2420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:2431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
-      *.c | *.o | *.obj) ;;
+      *.c | *.o | *.obj | *.ilk | *.pdb) ;;
       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
       esac
     done
@@ -2442,7 +2453,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:2446: checking for $ac_word" >&5
+echo "configure:2457: 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
@@ -2472,7 +2483,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:2476: checking for $ac_word" >&5
+echo "configure:2487: 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
@@ -2523,7 +2534,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:2527: checking for $ac_word" >&5
+echo "configure:2538: 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
@@ -2555,7 +2566,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2559: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2570: 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.
@@ -2566,12 +2577,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 2570 "configure"
+#line 2581 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2586: \"$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
@@ -2597,12 +2608,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:2601: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2612: 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:2606: checking whether we are using GNU C" >&5
+echo "configure:2617: 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
@@ -2611,7 +2622,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2615: \"$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:2626: \"$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
@@ -2630,7 +2641,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2634: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2645: 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
@@ -2664,7 +2675,7 @@
 
 ALL_LINGUAS="fr sv tr es da de id pt_BR ro nl"
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2668: checking how to run the C preprocessor" >&5
+echo "configure:2679: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2679,13 +2690,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2683 "configure"
+#line 2694 "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:2689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2700: \"$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
   :
@@ -2696,13 +2707,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2700 "configure"
+#line 2711 "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:2706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2717: \"$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
   :
@@ -2713,13 +2724,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2717 "configure"
+#line 2728 "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:2723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2734: \"$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
   :
@@ -2746,7 +2757,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:2750: checking for $ac_word" >&5
+echo "configure:2761: 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
@@ -2774,12 +2785,12 @@
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2778: checking for ANSI C header files" >&5
+echo "configure:2789: 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 2783 "configure"
+#line 2794 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2787,7 +2798,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2791: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2802: \"$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*
@@ -2804,7 +2815,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 2808 "configure"
+#line 2819 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2822,7 +2833,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 2826 "configure"
+#line 2837 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2843,7 +2854,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2847 "configure"
+#line 2858 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2854,7 +2865,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2878,12 +2889,12 @@
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2882: checking for working const" >&5
+echo "configure:2893: 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 2887 "configure"
+#line 2898 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2932,7 +2943,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2953,21 +2964,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2957: checking for inline" >&5
+echo "configure:2968: 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 2964 "configure"
+#line 2975 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2993,12 +3004,12 @@
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2997: checking for off_t" >&5
+echo "configure:3008: 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 3002 "configure"
+#line 3013 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3026,12 +3037,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3030: checking for size_t" >&5
+echo "configure:3041: 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 3035 "configure"
+#line 3046 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3061,19 +3072,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:3065: checking for working alloca.h" >&5
+echo "configure:3076: 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 3070 "configure"
+#line 3081 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:3077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3088: \"$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
@@ -3094,12 +3105,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3098: checking for alloca" >&5
+echo "configure:3109: 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 3103 "configure"
+#line 3114 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -3127,7 +3138,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:3131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3142: \"$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
@@ -3159,12 +3170,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3163: checking whether alloca needs Cray hooks" >&5
+echo "configure:3174: 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 3168 "configure"
+#line 3179 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -3189,12 +3200,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:3193: checking for $ac_func" >&5
+echo "configure:3204: 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 3198 "configure"
+#line 3209 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3217,7 +3228,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3232: \"$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
@@ -3244,7 +3255,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3248: checking stack direction for C alloca" >&5
+echo "configure:3259: 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
@@ -3252,7 +3263,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 3256 "configure"
+#line 3267 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -3271,7 +3282,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:3275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3286: \"$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
@@ -3292,21 +3303,21 @@
 
 fi
 
-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3300: checking for $ac_hdr" >&5
+echo "configure:3311: 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 3305 "configure"
+#line 3316 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3321: \"$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*
@@ -3335,12 +3346,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3339: checking for $ac_func" >&5
+echo "configure:3350: 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 3344 "configure"
+#line 3355 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3363,7 +3374,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3378: \"$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
@@ -3388,7 +3399,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3392: checking for working mmap" >&5
+echo "configure:3403: 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
@@ -3396,7 +3407,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3400 "configure"
+#line 3411 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3424,24 +3435,11 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+# endif
 
 /* Assume that all systems that can run configure have sys/param.h.  */
 # ifndef HAVE_SYS_PARAM_H
@@ -3549,7 +3547,7 @@
 }
 
 EOF
-if { (eval echo configure:3553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3551: \"$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
@@ -3577,17 +3575,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3581: checking for $ac_hdr" >&5
+echo "configure:3579: 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 3586 "configure"
+#line 3584 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3591: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3589: \"$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*
@@ -3617,12 +3615,12 @@
 __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3621: checking for $ac_func" >&5
+echo "configure:3619: 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 3626 "configure"
+#line 3624 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3645,7 +3643,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3647: \"$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
@@ -3674,12 +3672,12 @@
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3678: checking for $ac_func" >&5
+echo "configure:3676: 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 3683 "configure"
+#line 3681 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3702,7 +3700,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3704: \"$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
@@ -3736,19 +3734,19 @@
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3740: checking for LC_MESSAGES" >&5
+echo "configure:3738: 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 3745 "configure"
+#line 3743 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:3752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3750: \"$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
@@ -3769,7 +3767,7 @@
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3773: checking whether NLS is requested" >&5
+echo "configure:3771: 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"
@@ -3789,7 +3787,7 @@
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3793: checking whether included gettext is requested" >&5
+echo "configure:3791: 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"
@@ -3808,17 +3806,17 @@
 
 	ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3812: checking for libintl.h" >&5
+echo "configure:3810: 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 3817 "configure"
+#line 3815 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3822: \"$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*
@@ -3835,19 +3833,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:3839: checking for gettext in libc" >&5
+echo "configure:3837: 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 3844 "configure"
+#line 3842 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3849: \"$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
@@ -3863,7 +3861,7 @@
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 	     echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3867: checking for bindtextdomain in -lintl" >&5
+echo "configure:3865: 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
@@ -3871,7 +3869,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3875 "configure"
+#line 3873 "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
@@ -3882,7 +3880,7 @@
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3884: \"$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
@@ -3898,19 +3896,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:3902: checking for gettext in libintl" >&5
+echo "configure:3900: 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 3907 "configure"
+#line 3905 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3912: \"$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
@@ -3938,7 +3936,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:3942: checking for $ac_word" >&5
+echo "configure:3940: 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
@@ -3972,12 +3970,12 @@
 		for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3976: checking for $ac_func" >&5
+echo "configure:3974: 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 3981 "configure"
+#line 3979 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4000,7 +3998,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4002: \"$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
@@ -4027,7 +4025,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:4031: checking for $ac_word" >&5
+echo "configure:4029: 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
@@ -4063,7 +4061,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:4067: checking for $ac_word" >&5
+echo "configure:4065: 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
@@ -4095,7 +4093,7 @@
 fi
 
 		cat > conftest.$ac_ext <<EOF
-#line 4099 "configure"
+#line 4097 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4103,7 +4101,7 @@
 			       return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:4107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
 		   DATADIRNAME=share
@@ -4135,7 +4133,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:4139: checking for $ac_word" >&5
+echo "configure:4137: 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
@@ -4169,7 +4167,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:4173: checking for $ac_word" >&5
+echo "configure:4171: 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
@@ -4205,7 +4203,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:4209: checking for $ac_word" >&5
+echo "configure:4207: 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
@@ -4295,7 +4293,7 @@
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:4299: checking for catalogs to be installed" >&5
+echo "configure:4297: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -4323,17 +4321,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:4327: checking for linux/version.h" >&5
+echo "configure:4325: 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 4332 "configure"
+#line 4330 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4335: \"$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*
@@ -4411,7 +4409,7 @@
   EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
   echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:4415: checking for build system executable suffix" >&5
+echo "configure:4413: 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
@@ -4448,7 +4446,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:4452: checking for a BSD compatible install" >&5
+echo "configure:4450: 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
@@ -4505,17 +4503,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4509: checking for $ac_hdr" >&5
+echo "configure:4507: 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 4514 "configure"
+#line 4512 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4517: \"$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*
@@ -4639,6 +4637,7 @@
 	bfd_avr_arch)		ta="$ta avr-dis.lo" ;;
 	bfd_convex_arch)	;;
 	bfd_cris_arch)		ta="$ta cris-dis.lo cris-opc.lo" ;;
+	bfd_crx_arch)    	ta="$ta crx-dis.lo crx-opc.lo" ;;
 	bfd_d10v_arch)		ta="$ta d10v-dis.lo d10v-opc.lo" ;;
 	bfd_d30v_arch)		ta="$ta d30v-dis.lo d30v-opc.lo" ;;
 	bfd_dlx_arch)		ta="$ta dlx-dis.lo" ;;
diff --git a/opcodes/configure.in b/opcodes/configure.in
index 8919924..677ead2 100644
--- a/opcodes/configure.in
+++ b/opcodes/configure.in
@@ -177,6 +177,7 @@
 	bfd_avr_arch)		ta="$ta avr-dis.lo" ;;
 	bfd_convex_arch)	;;
 	bfd_cris_arch)		ta="$ta cris-dis.lo cris-opc.lo" ;;
+	bfd_crx_arch)    	ta="$ta crx-dis.lo crx-opc.lo" ;;
 	bfd_d10v_arch)		ta="$ta d10v-dis.lo d10v-opc.lo" ;;
 	bfd_d30v_arch)		ta="$ta d30v-dis.lo d30v-opc.lo" ;;
 	bfd_dlx_arch)		ta="$ta dlx-dis.lo" ;;
diff --git a/opcodes/crx-dis.c b/opcodes/crx-dis.c
new file mode 100644
index 0000000..5796a2e
--- /dev/null
+++ b/opcodes/crx-dis.c
@@ -0,0 +1,700 @@
+/* Disassembler code for CRX.
+   Copyright 2004 Free Software Foundation, Inc.
+   Contributed by Tomer Levi, NSC, Israel.
+   Written by Tomer Levi.
+
+   This file is part of the GNU binutils and GDB, the GNU debugger.
+
+   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, 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 "dis-asm.h"
+#include "sysdep.h"
+#include "opcode/crx.h"
+
+/* String to print when opcode was not matched.  */
+#define ILLEGAL	"illegal"
+  /* Escape to 16-bit immediate.  */
+#define ESCAPE_16_BIT  0xE
+
+/* Extract 'n_bits' from 'a' starting from offset 'offs'.  */
+#define EXTRACT(a, offs, n_bits)	    \
+  (n_bits == 32 ? (((a) >> (offs)) & ~0L)   \
+  : (((a) >> (offs)) & ((1 << (n_bits)) -1)))
+
+/* Set Bit Mask - a mask to set all bits starting from offset 'offs'.  */
+#define SBM(offs)  ((((1 << (32 - offs)) -1) << (offs)))
+
+typedef unsigned long dwordU;
+typedef unsigned short wordU;
+
+typedef struct
+{
+  dwordU val;
+  int nbits;
+} parameter;
+
+/* Structure to hold valid 'cinv' instruction options.  */
+
+typedef struct
+  {
+    /* Cinv printed string.  */
+    char *str;
+    /* Value corresponding to the string.  */
+    unsigned int value;
+  }
+cinv_entry;
+
+/* CRX 'cinv' options.  */
+const cinv_entry crx_cinvs[] =
+{
+  {"[i]", 2}, {"[i,u]", 3}, {"[d]", 4},
+  {"[d,u]", 5}, {"[d,i]", 6}, {"[d,i,u]", 7}
+};
+
+/* Number of valid 'cinv' instruction options.  */
+int NUMCINVS = ((sizeof crx_cinvs)/(sizeof crx_cinvs[0]));
+/* Current opcode table entry we're disassembling.  */
+const inst *instruction;
+/* Current instruction we're disassembling.  */
+ins currInsn;
+/* The current instruction is read into 3 consecutive words.  */
+wordU words[3];
+/* Contains all words in appropriate order.  */
+ULONGLONG allWords;
+/* Holds the current processed argument number.  */
+int processing_argument_number;
+/* Nonzero means a CST4 instruction.  */
+int cst4flag;
+/* Nonzero means the instruction's original size is
+   incremented (escape sequence is used).  */
+int size_changed;
+
+static int get_number_of_operands (void);
+static argtype getargtype     (operand_type);
+static int getbits	      (operand_type);
+static char *getregname	      (reg);
+static char *getcopregname    (copreg, reg_type);
+static char * getprocregname  (int);
+static char *gettrapstring    (unsigned);
+static char *getcinvstring    (unsigned);
+static void getregliststring  (int, char *, int);
+static wordU get_word_at_PC   (bfd_vma, struct disassemble_info *);
+static void get_words_at_PC   (bfd_vma, struct disassemble_info *);
+static unsigned long build_mask (void);
+static int powerof2	      (int);
+static int match_opcode	      (void);
+static void make_instruction  (void);
+static void print_arguments   (ins *, struct disassemble_info *);
+static void print_arg	      (argument *, struct disassemble_info *);
+
+/* Retrieve the number of operands for the current assembled instruction.  */
+
+static int
+get_number_of_operands (void)
+{
+  int i;
+
+  for (i = 0; instruction->operands[i].op_type && i < MAX_OPERANDS; i++)
+    ;
+
+  return i;
+}
+
+/* Return the bit size for a given operand.  */
+
+static int
+getbits (operand_type op)
+{
+  if (op < MAX_OPRD)
+    return crx_optab[op].bit_size;
+  else
+    return 0;
+}
+
+/* Return the argument type of a given operand.  */
+
+static argtype
+getargtype (operand_type op)
+{
+  if (op < MAX_OPRD)
+    return crx_optab[op].arg_type;
+  else
+    return nullargs;
+}
+
+/* Given the trap index in dispatch table, return its name.
+   This routine is used when disassembling the 'excp' instruction.  */
+
+static char *
+gettrapstring (unsigned int index)
+{
+  const trap_entry *trap;
+
+  for (trap = crx_traps; trap < crx_traps + NUMTRAPS; trap++)
+    if (trap->entry == index)
+      return trap->name;
+
+  return ILLEGAL;
+}
+
+/* Given a 'cinv' instruction constant operand, return its corresponding string.
+   This routine is used when disassembling the 'cinv' instruction.  */
+
+static char *
+getcinvstring (unsigned int num)
+{
+  const cinv_entry *cinv;
+
+  for (cinv = crx_cinvs; cinv < (crx_cinvs + NUMCINVS); cinv++)
+    if (cinv->value == num)
+      return cinv->str;
+
+  return ILLEGAL;
+}
+
+/* Given a register enum value, retrieve its name.  */
+
+char *
+getregname (reg r)
+{
+  const reg_entry *reg = &crx_regtab[r];
+
+  if (reg->type != CRX_R_REGTYPE)
+    return ILLEGAL;
+  else
+    return reg->name;
+}
+
+/* Given a coprocessor register enum value, retrieve its name.  */
+
+char *
+getcopregname (copreg r, reg_type type)
+{
+  const reg_entry *reg;
+
+  if (type == CRX_C_REGTYPE)
+    reg = &crx_copregtab[r];
+  else if (type == CRX_CS_REGTYPE)
+    reg = &crx_copregtab[r+(cs0-c0)];
+  else
+    return ILLEGAL;
+
+  return reg->name;
+}
+
+
+/* Getting a processor register name.  */
+
+static char *
+getprocregname (int index)
+{
+  const reg_entry *r;
+
+  for (r = crx_regtab; r < crx_regtab + NUMREGS; r++)
+    if (r->image == index)
+      return r->name;
+
+  return "ILLEGAL REGISTER";
+}
+
+/* Get the power of two for a given integer.  */
+
+static int
+powerof2 (int x)
+{
+  int product, i;
+
+  for (i = 0, product = 1; i < x; i++)
+    product *= 2;
+
+  return product;
+}
+
+/* Transform a register bit mask to a register list.  */
+
+void
+getregliststring (int trap, char *string, int core_cop)
+{
+  char temp_string[5];
+  int i;
+
+  string[0] = '{';
+  string[1] = '\0';
+
+  for (i = 0; i < 16; i++)
+    {
+      if (trap & 0x1)
+        {
+          if (core_cop)
+	    sprintf (temp_string, "r%d", i);
+          else
+	    sprintf (temp_string, "c%d", i);
+          strcat (string, temp_string);
+          if (trap & 0xfffe)
+	    strcat (string, ",");
+        }
+      trap = trap >> 1;
+    }
+
+  strcat (string, "}");
+}
+
+/* START and END are relating 'allWords' struct, which is 48 bits size.
+
+			  START|--------|END
+	    +---------+---------+---------+---------+
+	    |	      |	   V    |     A	  |   L	    |
+	    +---------+---------+---------+---------+
+	    	      0		16	  32	    48
+    words		  [0]	    [1]	      [2]	*/
+
+static parameter
+makelongparameter (ULONGLONG val, int start, int end)
+{
+  parameter p;
+
+  p.val = (dwordU) EXTRACT(val, 48 - end, end - start);
+  p.nbits = end - start;
+  return p;
+}
+
+/* Build a mask of the instruction's 'constant' opcode,
+   based on the instruction's printing flags.  */
+
+static unsigned long
+build_mask (void)
+{
+  unsigned int print_flags;
+  unsigned long mask;
+
+  print_flags = instruction->flags & FMT_CRX;
+  switch (print_flags)
+    {
+      case FMT_1:
+	mask = 0xF0F00000;
+	break;
+      case FMT_2:
+	mask = 0xFFF0FF00;
+	break;
+      case FMT_3:
+	mask = 0xFFF00F00;
+	break;
+      case FMT_4:
+	mask = 0xFFF0F000;
+	break;
+      case FMT_5:
+	mask = 0xFFF0FFF0;
+	break;
+      default:
+	mask = SBM(instruction->match_bits);
+	break;
+    }
+
+  return mask;
+}
+
+/* Search for a matching opcode. Return 1 for success, 0 for failure.  */
+
+static int
+match_opcode (void)
+{
+  unsigned long mask;
+
+  /* The instruction 'constant' opcode doewsn't exceed 32 bits.  */
+  unsigned long doubleWord = words[1] + (words[0] << 16);
+
+  /* Start searching from end of instruction table.  */
+  instruction = &crx_instruction[NUMOPCODES - 2];
+
+  /* Loop over instruction table until a full match is found.  */
+  while (instruction >= crx_instruction)
+    {
+      mask = build_mask ();
+      if ((doubleWord & mask) == BIN(instruction->match, instruction->match_bits))
+	return 1;
+      else
+	instruction--;
+    }
+  return 0;
+}
+
+/* Set the proper parameter value for different type of arguments.  */
+
+static void
+make_argument (argument * a, int start_bits)
+{
+  int inst_bit_size, total_size;
+  parameter p;
+
+  if ((instruction->size == 3) && a->size >= 16)
+    inst_bit_size = 48;
+  else
+    inst_bit_size = 32;
+
+  switch (a->type)
+    {
+    case arg_copr:
+    case arg_copsr:
+      p = makelongparameter (allWords, inst_bit_size - (start_bits + a->size),
+			     inst_bit_size - start_bits);
+      a->cr = p.val;
+      break;
+
+    case arg_r:
+      p = makelongparameter (allWords, inst_bit_size - (start_bits + a->size),
+			     inst_bit_size - start_bits);
+      a->r = p.val;
+      break;
+
+    case arg_ic:
+      p = makelongparameter (allWords, inst_bit_size - (start_bits + a->size),
+			     inst_bit_size - start_bits);
+
+      if ((p.nbits == 4) && cst4flag)
+        {
+	  if (IS_INSN_TYPE (CMPBR_INS) && (p.val == ESCAPE_16_BIT))
+	    {
+	      /* A special case, where the value is actually stored
+		 in the last 4 bits.  */
+	      p = makelongparameter (allWords, 44, 48);
+	      /* The size of the instruction should be incremented.  */
+	      size_changed = 1;
+	    }
+
+          if (p.val == 6)
+            p.val = -1;
+          else if (p.val == 13)
+            p.val = 48;
+          else if (p.val == 5)
+            p.val = -4;
+          else if (p.val == 10)
+            p.val = 32;
+          else if (p.val == 11)
+            p.val = 20;
+          else if (p.val == 9)
+            p.val = 16;
+        }
+
+      a->constant = p.val;
+      break;
+
+    case arg_icr:
+      a->scale = 0;
+      total_size = a->size + 10;  /* sizeof(rbase + ridx + scl2) = 10.  */
+      p = makelongparameter (allWords, inst_bit_size - total_size,
+			     inst_bit_size - (total_size - 4));
+      a->r = p.val;
+      p = makelongparameter (allWords, inst_bit_size - (total_size - 4),
+			     inst_bit_size - (total_size - 8));
+      a->i_r = p.val;
+      p = makelongparameter (allWords, inst_bit_size - (total_size - 8),
+			     inst_bit_size - (total_size - 10));
+      a->scale = p.val;
+      p = makelongparameter (allWords, inst_bit_size - (total_size - 10),
+			     inst_bit_size);
+      a->constant = p.val;
+      break;
+
+    case arg_rbase:
+      p = makelongparameter (allWords, inst_bit_size - (start_bits + 4),
+			     inst_bit_size - start_bits);
+      a->r = p.val;
+      break;
+
+    case arg_cr:
+      if (a->size <= 8)
+        {
+          p = makelongparameter (allWords, inst_bit_size - (start_bits + 4),
+				 inst_bit_size - start_bits);
+          a->r = p.val;
+          /* Case for opc4 r dispu rbase.  */
+          p = makelongparameter (allWords, inst_bit_size - (start_bits + 8),
+				 inst_bit_size - (start_bits + 4));
+        }
+      else
+        {
+	  /* The 'rbase' start_bits is always relative to a 32-bit data type.  */
+          p = makelongparameter (allWords, 32 - (start_bits + 4),
+				 32 - start_bits);
+          a->r = p.val;
+          p = makelongparameter (allWords, 32 - start_bits,
+				 inst_bit_size);
+        }
+      if ((p.nbits == 4) && cst4flag)
+        {
+          if (instruction->flags & DISPUW4)
+	    p.val *= 2;
+          else if (instruction->flags & DISPUD4)
+	    p.val *= 4;
+        }
+      a->constant = p.val;
+      break;
+
+    case arg_c:
+      p = makelongparameter (allWords, inst_bit_size - (start_bits + a->size),
+			     inst_bit_size - start_bits);
+      a->constant = p.val;
+      break;
+    default:
+      break;
+    }
+}
+
+/*  Print a single argument.  */
+
+static void
+print_arg (argument *a, struct disassemble_info *info)
+{
+  LONGLONG longdisp, mask;
+  char sign_flag;
+  int op_index = 0;
+  char string[200];
+  PTR stream = info->stream;
+  fprintf_ftype func = info->fprintf_func;
+
+  switch (a->type)
+    {
+    case arg_copr:
+      func (stream, "%s", getcopregname (a->cr, CRX_C_REGTYPE));
+      break;
+
+    case arg_copsr:
+      func (stream, "%s", getcopregname (a->cr, CRX_CS_REGTYPE));
+      break;
+
+    case arg_r:
+      if (IS_INSN_MNEMONIC ("mtpr") || IS_INSN_MNEMONIC ("mfpr"))
+	func (stream, "%s", getprocregname (a->r));
+      else
+	func (stream, "%s", getregname (a->r));
+      break;
+
+    case arg_ic:
+      if (IS_INSN_MNEMONIC ("excp"))
+	func (stream, "%s", gettrapstring (a->constant));
+
+      else if (IS_INSN_MNEMONIC ("cinv"))
+	func (stream, "%s", getcinvstring (a->constant));
+
+      else if (INST_HAS_REG_LIST)
+        {
+          if (!IS_INSN_TYPE (COP_REG_INS))
+            {
+              getregliststring (a->constant, string, 1);
+              func (stream, "%s", string);
+            }
+          else
+            {
+              /*  Check for proper argument number.  */
+              if (processing_argument_number == 2)
+                {
+                  getregliststring (a->constant, string, 0);
+                  func (stream, "%s", string);
+                }
+              else
+		func (stream, "$0x%x", a->constant);
+            }
+        }
+      else
+	func (stream, "$0x%x", a->constant);
+      break;
+
+    case arg_icr:
+      func (stream, "0x%x(%s,%s,%d)", a->constant, getregname (a->r),
+	    getregname (a->i_r), powerof2 (a->scale));
+      break;
+
+    case arg_rbase:
+      func (stream, "(%s)", getregname (a->r));
+      break;
+
+    case arg_cr:
+      func (stream, "0x%x(%s)", a->constant, getregname (a->r));
+
+      if (IS_INSN_TYPE (LD_STOR_INS_INC))
+	func (stream, "+");
+      break;
+
+    case arg_c:
+      /* Removed the *2 part as because implicit zeros are no more required.
+	 Have to fix this as this needs a bit of extension in terms of branchins.
+	 Have to add support for cmp and branch instructions.  */
+      if (IS_INSN_TYPE (BRANCH_INS) || IS_INSN_MNEMONIC ("bal")
+	  || IS_INSN_TYPE (CMPBR_INS) || IS_INSN_TYPE (DCR_BRANCH_INS)
+	  || IS_INSN_TYPE (COP_BRANCH_INS))
+        {
+          func (stream, "%c", '*');
+          longdisp = a->constant;
+          longdisp <<= 1;
+          sign_flag = '+';
+
+          switch (a->size)
+            {
+            case 8:
+	    case 16:
+	    case 24:
+	    case 32:
+	      mask = ((LONGLONG)1 << a->size) - 1;
+              if (longdisp & ((LONGLONG)1 << a->size))
+                {
+                  sign_flag = '-';
+                  longdisp = ~(longdisp) + 1;
+                }
+              a->constant = (unsigned long int) (longdisp & mask);
+              break;
+            default:
+	      func (stream,
+		    "Wrong offset used in branch/bal instruction");
+              break;
+            }
+
+	  func (stream, "%c", sign_flag);
+        }
+      /* For branch Neq instruction it is 2*offset + 2.  */
+      if (IS_INSN_TYPE (BRANCH_NEQ_INS))
+	a->constant = 2 * a->constant + 2;
+      if (IS_INSN_TYPE (LD_STOR_INS_INC)
+	  || IS_INSN_TYPE (LD_STOR_INS)
+	  || IS_INSN_TYPE (STOR_IMM_INS)
+	  || IS_INSN_TYPE (CSTBIT_INS))
+        {
+          op_index = instruction->flags & REVERSE_MATCH ? 0 : 1;
+          if (instruction->operands[op_index].op_type == abs16)
+	    a->constant |= 0xFFFF0000;
+        }
+      func (stream, "0x%x", a->constant);
+      break;
+    default:
+      break;
+    }
+}
+
+/* Print all the arguments of CURRINSN instruction.  */
+
+static void
+print_arguments (ins *currInsn, struct disassemble_info *info)
+{
+  int i;
+
+  for (i = 0; i < currInsn->nargs; i++)
+    {
+      processing_argument_number = i;
+
+      print_arg (&currInsn->arg[i], info);
+
+      if (i != currInsn->nargs - 1)
+	info->fprintf_func (info->stream, ", ");
+    }
+}
+
+/* Build the instruction's arguments.  */
+
+static void
+make_instruction (void)
+{
+  int i;
+  unsigned int temp_value, shift;
+  argument a;
+
+  for (i = 0; i < currInsn.nargs; i++)
+    {
+      a.type = getargtype (instruction->operands[i].op_type);
+      if (instruction->operands[i].op_type == cst4
+	  || instruction->operands[i].op_type == rbase_cst4)
+	cst4flag = 1;
+      a.size = getbits (instruction->operands[i].op_type);
+      shift = instruction->operands[i].shift;
+
+      make_argument (&a, shift);
+      currInsn.arg[i] = a;
+    }
+
+  /* Calculate instruction size (in bytes).  */
+  currInsn.size = instruction->size + (size_changed ? 1 : 0);
+  currInsn.size *= 2;
+
+  /* Swapping first and second arguments.  */
+  if (IS_INSN_TYPE (COP_BRANCH_INS))
+    {
+      temp_value = currInsn.arg[0].constant;
+      currInsn.arg[0].constant = currInsn.arg[1].constant;
+      currInsn.arg[1].constant = temp_value;
+    }
+}
+
+/* Retrieve a single word from a given memory address.  */
+
+static wordU
+get_word_at_PC (bfd_vma memaddr, struct disassemble_info *info)
+{
+  bfd_byte buffer[4];
+  int status;
+  wordU insn = 0;
+
+  status = info->read_memory_func (memaddr, buffer, 2, info);
+
+  if (status == 0)
+    insn = (wordU) bfd_getl16 (buffer);
+
+  return insn;
+}
+
+/* Retrieve multiple words (3) from a given memory address.  */
+
+static void
+get_words_at_PC (bfd_vma memaddr, struct disassemble_info *info)
+{
+  int i;
+  bfd_vma mem;
+
+  for (i = 0, mem = memaddr; i < 3; i++, mem += 2)
+    words[i] = get_word_at_PC (mem, info);
+
+  allWords =
+    ((ULONGLONG) words[0] << 32) + ((unsigned long) words[1] << 16) + words[2];
+}
+
+/* Prints the instruction by calling print_arguments after proper matching.  */
+
+int
+print_insn_crx (memaddr, info)
+     bfd_vma memaddr;
+     struct disassemble_info *info;
+{
+  int is_decoded;     /* Nonzero means instruction has a match.  */
+
+  /* Initialize global variables.  */
+  cst4flag = 0;
+  size_changed = 0;
+
+  /* Retrieve the encoding from current memory location.  */
+  get_words_at_PC (memaddr, info);
+  /* Find a matching opcode in table.  */
+  is_decoded = match_opcode ();
+  /* If found, print the instruction's mnemonic and arguments.  */
+  if (is_decoded > 0 && (words[0] << 16 || words[1]) != 0)
+    {
+      info->fprintf_func (info->stream, "%s", instruction->mnemonic);
+      if ((currInsn.nargs = get_number_of_operands ()) != 0)
+	info->fprintf_func (info->stream, "\t");
+      make_instruction ();
+      print_arguments (&currInsn, info);
+      return currInsn.size;
+    }
+
+  /* No match found.  */
+  info->fprintf_func (info->stream,"%s ",ILLEGAL);
+  return 2;
+}
diff --git a/opcodes/crx-opc.c b/opcodes/crx-opc.c
new file mode 100644
index 0000000..da1e322
--- /dev/null
+++ b/opcodes/crx-opc.c
@@ -0,0 +1,674 @@
+/* crx-opc.c -- Table of opcodes for the CRX processor.
+   Copyright 2004 Free Software Foundation, Inc.
+   Contributed by Tomer Levi NSC, Israel.
+   Originally written for GAS 2.12 by Tomer Levi.
+
+   This file is part of GAS, GDB and the GNU binutils.
+
+   GAS, GDB, and GNU binutils 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, GDB, and GNU binutils are distributed in the hope that they 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 <stdio.h>
+#include "libiberty.h"
+#include "symcat.h"
+#include "opcode/crx.h"
+
+const inst crx_instruction[] =
+{
+/* Create an arithmetic instruction - INST[bw].  */
+#define  ARITH_BYTE_INST(NAME, OPC) \
+  /* opc8 cst4 r */							   \
+  {NAME, 1, OPC,  24, ARITH_BYTE_INS, {{cst4,20}, {regr,16}}},		   \
+  /* opc8 i16 r */							   \
+  {NAME, 2, (OPC<<4)+0xE, 20, ARITH_BYTE_INS, {{i16,0},	{regr,16}}},	   \
+  /* opc8 r r */							   \
+  {NAME, 1, OPC+0x40, 24, ARITH_BYTE_INS, {{regr,20}, {regr,16}}}
+
+  ARITH_BYTE_INST ("addub", 0x0),
+  ARITH_BYTE_INST ("addb",  0x1),
+  ARITH_BYTE_INST ("addcb", 0x2),
+  ARITH_BYTE_INST ("andb",  0x3),
+  ARITH_BYTE_INST ("cmpb",  0x4),
+  ARITH_BYTE_INST ("movb",  0x5),
+  ARITH_BYTE_INST ("orb",   0x6),
+  ARITH_BYTE_INST ("subb",  0x7),
+  ARITH_BYTE_INST ("subcb", 0x8),
+  ARITH_BYTE_INST ("xorb",  0x9),
+  ARITH_BYTE_INST ("mulb",  0xA),
+
+  ARITH_BYTE_INST ("adduw", 0x10),
+  ARITH_BYTE_INST ("addw",  0x11),
+  ARITH_BYTE_INST ("addcw", 0x12),
+  ARITH_BYTE_INST ("andw",  0x13),
+  ARITH_BYTE_INST ("cmpw",  0x14),
+  ARITH_BYTE_INST ("movw",  0x15),
+  ARITH_BYTE_INST ("orw",   0x16),
+  ARITH_BYTE_INST ("subw",  0x17),
+  ARITH_BYTE_INST ("subcw", 0x18),
+  ARITH_BYTE_INST ("xorw",  0x19),
+  ARITH_BYTE_INST ("mulw",  0x1A),
+
+/* Create an arithmetic instruction - INST[d].  */
+#define  ARITH_INST(NAME, OPC) \
+  /* opc8 cst4 r */						      \
+  {NAME, 1, OPC,  24, ARITH_INS, {{cst4,20}, {regr,16}}},	      \
+  /* opc8 i16 r */						      \
+  {NAME, 2, (OPC<<4)+0xE, 20, ARITH_INS, {{i16,0},   {regr,16}}},     \
+  /* opc8 i32 r */						      \
+  {NAME, 3, (OPC<<4)+0xF, 20, ARITH_INS, {{i32,0},   {regr,16}}},     \
+  /* opc8 r r */						      \
+  {NAME, 1, OPC+0x40, 24, ARITH_INS, {{regr,20}, {regr,16}}}
+
+  ARITH_INST ("addud", 0x20),
+  ARITH_INST ("addd",  0x21),
+  ARITH_INST ("addcd", 0x22),
+  ARITH_INST ("andd",  0x23),
+  ARITH_INST ("cmpd",  0x24),
+  ARITH_INST ("movd",  0x25),
+  ARITH_INST ("ord",   0x26),
+  ARITH_INST ("subd",  0x27),
+  ARITH_INST ("subcd", 0x28),
+  ARITH_INST ("xord",  0x29),
+  ARITH_INST ("muld",  0x2A),
+
+/* Create a shift instruction.  */
+#define  SHIFT_INST(NAME, OPRD, OPC1, SHIFT1, OPC2) \
+  /* OPRD=i3 -->> opc9 i3 r */					      \
+  /* OPRD=i4 -->> opc8 i4 r */					      \
+  /* OPRD=i5 -->> opc7 i5 r */					      \
+  {NAME, 1, OPC1, SHIFT1, SHIFT_INS, {{OPRD,20}, {regr,16}}},	      \
+  /* opc8 r r */						      \
+  {NAME, 1, OPC2, 24, SHIFT_INS, {{regr,20}, {regr,16}}}
+
+  SHIFT_INST ("sllb", i3, 0x1F8, 23, 0x4D),
+  SHIFT_INST ("srlb", i3, 0x1F9, 23, 0x4E),
+  SHIFT_INST ("srab", i3, 0x1FA, 23, 0x4F),
+
+  SHIFT_INST ("sllw", i4, 0xB6,  24, 0x5D),
+  SHIFT_INST ("srlw", i4, 0xB7,  24, 0x5E),
+  SHIFT_INST ("sraw", i4, 0xB8,  24, 0x5F),
+
+  SHIFT_INST ("slld", i5, 0x78,  25, 0x6D),
+  SHIFT_INST ("srld", i5, 0x79,  25, 0x6E),
+  SHIFT_INST ("srad", i5, 0x7A,  25, 0x6F),
+
+/* Create a conditional branch instruction.  */
+#define  BRANCH_INST(NAME, OPC) \
+  /* opc4 c4 dispe9 */						    \
+  {NAME,  1, OPC, 24, BRANCH_INS | RELAXABLE, {{d9,16}}},	    \
+  /* opc4 c4 disps17 */						    \
+  {NAME,  2, (OPC<<8)+0x7E, 16,	BRANCH_INS | RELAXABLE, {{d17,0}}}, \
+  /* opc4 c4 disps33 */						    \
+  {NAME,  3, (OPC<<8)+0x7F, 16,	BRANCH_INS | RELAXABLE, {{d33,0}}}
+
+  BRANCH_INST ("beq", 0x70),
+  BRANCH_INST ("bne", 0x71),
+  BRANCH_INST ("bcs", 0x72),
+  BRANCH_INST ("bcc", 0x73),
+  BRANCH_INST ("bhi", 0x74),
+  BRANCH_INST ("bls", 0x75),
+  BRANCH_INST ("bgt", 0x76),
+  BRANCH_INST ("ble", 0x77),
+  BRANCH_INST ("bfs", 0x78),
+  BRANCH_INST ("bfc", 0x79),
+  BRANCH_INST ("blo", 0x7A),
+  BRANCH_INST ("bhs", 0x7B),
+  BRANCH_INST ("blt", 0x7C),
+  BRANCH_INST ("bge", 0x7D),
+  BRANCH_INST ("br",  0x7E),
+
+/* Create a 'Branch if Equal to 0' instruction.  */
+#define  BRANCH_NEQ_INST(NAME, OPC) \
+  /* opc8 dispu5 r */						\
+  {NAME,  1, OPC, 24, BRANCH_NEQ_INS, {{regr,16}, {d5,20}}}
+
+  BRANCH_NEQ_INST ("beq0b",  0xB0),
+  BRANCH_NEQ_INST ("bne0b",  0xB1),
+  BRANCH_NEQ_INST ("beq0w",  0xB2),
+  BRANCH_NEQ_INST ("bne0w",  0xB3),
+  BRANCH_NEQ_INST ("beq0d",  0xB4),
+  BRANCH_NEQ_INST ("bne0d",  0xB5),
+
+/* Create instruction with no operands.  */
+#define  NO_OP_INST(NAME, OPC) \
+  /* opc16 */				\
+  {NAME,  1, OPC, 16, 0, {{0, 0}}}
+
+  NO_OP_INST ("nop",	0x3002),
+  NO_OP_INST ("retx",	0x3003),
+  NO_OP_INST ("di",	0x3004),
+  NO_OP_INST ("ei",	0x3005),
+  NO_OP_INST ("wait",	0x3006),
+  NO_OP_INST ("eiwait",	0x3007),
+
+/* Create a 'Compare & Branch' instruction.  */
+#define  CMPBR_INST(NAME, OPC1, OPC2, C4) \
+  /* opc12 r r c4 disps9 */										\
+  {NAME, 2, ((0x300+OPC1)<<12)+C4,  8, CMPBR_INS | FMT_3 | RELAXABLE, {{regr,16}, {regr,12}, {d9,0}}},  \
+  /* opc12 r r c4 disps25 */										\
+  {NAME, 3, ((0x310+OPC1)<<12)+C4,  8, CMPBR_INS | FMT_3 | RELAXABLE, {{regr,16}, {regr,12}, {d25,0}}}, \
+  /* opc12 i4cst4 r c4 disps9 */									\
+  {NAME, 2, ((0x300+OPC2)<<12)+C4,  8, CMPBR_INS | FMT_3 | RELAXABLE, {{cst4,16}, {regr,12}, {d9,0}}},  \
+  /* opc12 i4cst4 r c4 disps25 */									\
+  {NAME, 3, ((0x310+OPC2)<<12)+C4,  8, CMPBR_INS | FMT_3 | RELAXABLE, {{cst4,16}, {regr,12}, {d25,0}}}
+
+  CMPBR_INST ("cmpbeqb", 0x8, 0xC, 0x0),
+  CMPBR_INST ("cmpbneb", 0x8, 0xC, 0x1),
+  CMPBR_INST ("cmpbhib", 0x8, 0xC, 0x4),
+  CMPBR_INST ("cmpblsb", 0x8, 0xC, 0x5),
+  CMPBR_INST ("cmpbgtb", 0x8, 0xC, 0x6),
+  CMPBR_INST ("cmpbleb", 0x8, 0xC, 0x7),
+  CMPBR_INST ("cmpblob", 0x8, 0xC, 0xA),
+  CMPBR_INST ("cmpbhsb", 0x8, 0xC, 0xB),
+  CMPBR_INST ("cmpbltb", 0x8, 0xC, 0xC),
+  CMPBR_INST ("cmpbgeb", 0x8, 0xC, 0xD),
+
+  CMPBR_INST ("cmpbeqw", 0x9, 0xD, 0x0),
+  CMPBR_INST ("cmpbnew", 0x9, 0xD, 0x1),
+  CMPBR_INST ("cmpbhiw", 0x9, 0xD, 0x4),
+  CMPBR_INST ("cmpblsw", 0x9, 0xD, 0x5),
+  CMPBR_INST ("cmpbgtw", 0x9, 0xD, 0x6),
+  CMPBR_INST ("cmpblew", 0x9, 0xD, 0x7),
+  CMPBR_INST ("cmpblow", 0x9, 0xD, 0xA),
+  CMPBR_INST ("cmpbhsw", 0x9, 0xD, 0xB),
+  CMPBR_INST ("cmpbltw", 0x9, 0xD, 0xC),
+  CMPBR_INST ("cmpbgew", 0x9, 0xD, 0xD),
+
+  CMPBR_INST ("cmpbeqd", 0xA, 0xE, 0x0),
+  CMPBR_INST ("cmpbned", 0xA, 0xE, 0x1),
+  CMPBR_INST ("cmpbhid", 0xA, 0xE, 0x4),
+  CMPBR_INST ("cmpblsd", 0xA, 0xE, 0x5),
+  CMPBR_INST ("cmpbgtd", 0xA, 0xE, 0x6),
+  CMPBR_INST ("cmpbled", 0xA, 0xE, 0x7),
+  CMPBR_INST ("cmpblod", 0xA, 0xE, 0xA),
+  CMPBR_INST ("cmpbhsd", 0xA, 0xE, 0xB),
+  CMPBR_INST ("cmpbltd", 0xA, 0xE, 0xC),
+  CMPBR_INST ("cmpbged", 0xA, 0xE, 0xD),
+
+/* Create an instruction using a single register operand.  */
+#define  REG1_INST(NAME, OPC) \
+  /* opc8 c4 r */			  \
+  {NAME,  1, OPC, 20, 0, {{regr,16}}}
+
+  /* JCond instructions	*/
+  REG1_INST ("jeq",  0xBA0),
+  REG1_INST ("jne",  0xBA1),
+  REG1_INST ("jcs",  0xBA2),
+  REG1_INST ("jcc",  0xBA3),
+  REG1_INST ("jhi",  0xBA4),
+  REG1_INST ("jls",  0xBA5),
+  REG1_INST ("jgt",  0xBA6),
+  REG1_INST ("jle",  0xBA7),
+  REG1_INST ("jfs",  0xBA8),
+  REG1_INST ("jfc",  0xBA9),
+  REG1_INST ("jlo",  0xBAA),
+  REG1_INST ("jhs",  0xBAB),
+  REG1_INST ("jlt",  0xBAC),
+  REG1_INST ("jge",  0xBAD),
+  REG1_INST ("jump", 0xBAE),
+
+  /* SCond instructions */
+  REG1_INST ("seq",  0xBB0),
+  REG1_INST ("sne",  0xBB1),
+  REG1_INST ("scs",  0xBB2),
+  REG1_INST ("scc",  0xBB3),
+  REG1_INST ("shi",  0xBB4),
+  REG1_INST ("sls",  0xBB5),
+  REG1_INST ("sgt",  0xBB6),
+  REG1_INST ("sle",  0xBB7),
+  REG1_INST ("sfs",  0xBB8),
+  REG1_INST ("sfc",  0xBB9),
+  REG1_INST ("slo",  0xBBA),
+  REG1_INST ("shs",  0xBBB),
+  REG1_INST ("slt",  0xBBC),
+  REG1_INST ("sge",  0xBBD),
+
+/* Create an instruction using two register operands.  */
+#define  REG2_INST(NAME, OPC) \
+  /* opc24 r r  OR  opc20 c4 r r */			      \
+  {NAME,  2, 0x300800+OPC,  8, 0, {{regr,4}, {regr,0}}}
+
+  /* MULTIPLY INSTRUCTIONS */
+  REG2_INST ("macsb",  0x40),
+  REG2_INST ("macub",  0x41),
+  REG2_INST ("macqb",  0x42),
+
+  REG2_INST ("macsw",  0x50),
+  REG2_INST ("macuw",  0x51),
+  REG2_INST ("macqw",  0x52),
+
+  REG2_INST ("macsd",  0x60),
+  REG2_INST ("macud",  0x61),
+  REG2_INST ("macqd",  0x62),
+
+  REG2_INST ("mullsd", 0x65),
+  REG2_INST ("mullud", 0x66),
+
+  REG2_INST ("mulsbw", 0x3B),
+  REG2_INST ("mulubw", 0x3C),
+  REG2_INST ("mulswd", 0x3D),
+  REG2_INST ("muluwd", 0x3E),
+
+  /*  SIGNEXTEND STUFF    */
+  REG2_INST ("sextbw", 0x30),
+  REG2_INST ("sextbd", 0x31),
+  REG2_INST ("sextwd", 0x32),
+  REG2_INST ("zextbw", 0x34),
+  REG2_INST ("zextbd", 0x35),
+  REG2_INST ("zextwd", 0x36),
+
+  REG2_INST ("bswap",  0x3F),
+
+  REG2_INST ("maxsb",  0x80),
+  REG2_INST ("minsb",  0x81),
+  REG2_INST ("maxub",  0x82),
+  REG2_INST ("minub",  0x83),
+  REG2_INST ("absb",   0x84),
+  REG2_INST ("negb",   0x85),
+  REG2_INST ("cntl0b", 0x86),
+  REG2_INST ("cntl1b", 0x87),
+  REG2_INST ("popcntb",0x88),
+  REG2_INST ("rotlb",  0x89),
+  REG2_INST ("rotrb",  0x8A),
+  REG2_INST ("mulqb",  0x8B),
+  REG2_INST ("addqb",  0x8C),
+  REG2_INST ("subqb",  0x8D),
+  REG2_INST ("cntlsb", 0x8E),
+
+  REG2_INST ("maxsw",  0x90),
+  REG2_INST ("minsw",  0x91),
+  REG2_INST ("maxuw",  0x92),
+  REG2_INST ("minuw",  0x93),
+  REG2_INST ("absw",   0x94),
+  REG2_INST ("negw",   0x95),
+  REG2_INST ("cntl0w", 0x96),
+  REG2_INST ("cntl1w", 0x97),
+  REG2_INST ("popcntw",0x98),
+  REG2_INST ("rotlw",  0x99),
+  REG2_INST ("rotrw",  0x9A),
+  REG2_INST ("mulqw",  0x9B),
+  REG2_INST ("addqw",  0x9C),
+  REG2_INST ("subqw",  0x9D),
+  REG2_INST ("cntlsw", 0x9E),
+
+  REG2_INST ("maxsd",  0xA0),
+  REG2_INST ("minsd",  0xA1),
+  REG2_INST ("maxud",  0xA2),
+  REG2_INST ("minud",  0xA3),
+  REG2_INST ("absd",   0xA4),
+  REG2_INST ("negd",   0xA5),
+  REG2_INST ("cntl0d", 0xA6),
+  REG2_INST ("cntl1d", 0xA7),
+  REG2_INST ("popcntd",0xA8),
+  REG2_INST ("rotld",  0xA9),
+  REG2_INST ("rotrd",  0xAA),
+  REG2_INST ("mulqd",  0xAB),
+  REG2_INST ("addqd",  0xAC),
+  REG2_INST ("subqd",  0xAD),
+  REG2_INST ("cntlsd", 0xAE),
+
+/* Conditional move instructions */
+  REG2_INST ("cmoveqd", 0x70),
+  REG2_INST ("cmovned", 0x71),
+  REG2_INST ("cmovcsd", 0x72),
+  REG2_INST ("cmovccd", 0x73),
+  REG2_INST ("cmovhid", 0x74),
+  REG2_INST ("cmovlsd", 0x75),
+  REG2_INST ("cmovgtd", 0x76),
+  REG2_INST ("cmovled", 0x77),
+  REG2_INST ("cmovfsd", 0x78),
+  REG2_INST ("cmovfcd", 0x79),
+  REG2_INST ("cmovlod", 0x7A),
+  REG2_INST ("cmovhsd", 0x7B),
+  REG2_INST ("cmovltd", 0x7C),
+  REG2_INST ("cmovged", 0x7D),
+
+/* Load instructions (from memory to register).  */
+#define  LD_REG_INST(NAME, OPC1, OPC2, DISP) \
+  /* opc12 r abs16 */									 \
+  {NAME,  2, 0x320+OPC1,  20, LD_STOR_INS | REVERSE_MATCH, {{abs16,0}, {regr,16}}},	 \
+  /* opc12 r abs32 */									 \
+  {NAME,  3, 0x330+OPC1,  20, LD_STOR_INS | REVERSE_MATCH, {{abs32,0}, {regr,16}}},	 \
+  /* opc4 r c4 rbase */									 \
+  {NAME,  1, ((0x8+OPC2)<<8),  20, LD_STOR_INS | DISP | FMT_1 | REVERSE_MATCH, {{rbase,20}, {regr,24}}},\
+  /* opc4 r rbase dispu[bwd]4 */							 \
+  {NAME,  1, 0x8+OPC2,  28, LD_STOR_INS | DISP | REVERSE_MATCH, {{rbase_cst4,16}, {regr,24}}},		 \
+  /* opc4 r rbase disps16 */								 \
+  {NAME,  2, ((0x8+OPC2)<<8)+0xE,  20, LD_STOR_INS | DISP | FMT_1 | REVERSE_MATCH, {{rbase_dispu16,16}, {regr,24}}}, \
+  /* opc4 r rbase disps32 */								 \
+  {NAME,  3, ((0x8+OPC2)<<8)+0xF,  20, LD_STOR_INS | FMT_1 | REVERSE_MATCH, {{rbase_dispu32,16}, {regr,24}}}, \
+  /* opc12 r rbase */									 \
+  {NAME,  2, 0x328+OPC1,  20, LD_STOR_INS_INC | REVERSE_MATCH, {{rbase,12}, {regr,16}}},		 \
+  /* opc12 r rbase disps12 */								 \
+  {NAME,  2, 0x328+OPC1,  20, LD_STOR_INS_INC | REVERSE_MATCH, {{rbase_dispu12,12}, {regr,16}}},	 \
+  /* opc12 r rbase ridx scl2 disps6 */							 \
+  {NAME,  2, 0x32C+OPC1,  20, LD_STOR_INS | REVERSE_MATCH, {{rbase_ridx_scl2_dispu6,0}, {regr,16}}},	 \
+  /* opc12 r rbase ridx scl2 disps22 */							 \
+  {NAME,  3, 0x33C+OPC1,  20, LD_STOR_INS | REVERSE_MATCH, {{rbase_ridx_scl2_dispu22,0}, {regr,16}}}
+
+  LD_REG_INST ("loadb", 0x0, 0x0,   DISPUB4),
+  LD_REG_INST ("loadw", 0x1, 0x1, DISPUW4),
+  LD_REG_INST ("loadd", 0x2, 0x2, DISPUD4),
+
+/* Store instructions (from Register to Memory).  */
+#define  ST_REG_INST(NAME, OPC1, OPC2, DISP) \
+  /* opc12 r abs16 */									 \
+  {NAME,  2, 0x320+OPC1,  20, LD_STOR_INS, {{regr,16}, {abs16,0}}},			 \
+  /* opc12 r abs32 */									 \
+  {NAME,  3, 0x330+OPC1,  20, LD_STOR_INS, {{regr,16}, {abs32,0}}},			 \
+  /* opc4 r c4 rbase */									 \
+  {NAME,  1, ((0x8+OPC2)<<8),  20, LD_STOR_INS | DISP | FMT_1, {{regr,24}, {rbase,20}}},\
+  /* opc4 r rbase dispu[bwd]4 */							 \
+  {NAME,  1, 0x8+OPC2,  28, LD_STOR_INS | DISP, {{regr,24}, {rbase_cst4,16}}},		 \
+  /* opc4 r rbase disps16 */								 \
+  {NAME,  2, ((0x8+OPC2)<<8)+0xE,  20, LD_STOR_INS | DISP | FMT_1, {{regr,24}, {rbase_dispu16,16}}}, \
+  /* opc4 r rbase disps32 */								 \
+  {NAME,  3, ((0x8+OPC2)<<8)+0xF,  20, LD_STOR_INS | FMT_1, {{regr,24}, {rbase_dispu32,16}}}, \
+  /* opc12 r rbase */									 \
+  {NAME,  2, 0x328+OPC1,  20, LD_STOR_INS_INC, {{regr,16}, {rbase,12}}},		 \
+  /* opc12 r rbase disps12 */								 \
+  {NAME,  2, 0x328+OPC1,  20, LD_STOR_INS_INC, {{regr,16}, {rbase_dispu12,12}}},	 \
+  /* opc12 r rbase ridx scl2 disps6 */							 \
+  {NAME,  2, 0x32C+OPC1,  20, LD_STOR_INS, {{regr,16}, {rbase_ridx_scl2_dispu6,0}}},	 \
+  /* opc12 r rbase ridx scl2 disps22 */							 \
+  {NAME,  3, 0x33C+OPC1,  20, LD_STOR_INS, {{regr,16}, {rbase_ridx_scl2_dispu22,0}}}
+
+/* Store instructions (Immediate to Memory).  */
+#define  ST_I_INST(NAME, OPC) \
+  /* opc12 i4 abs16 */								 \
+  {NAME,  2, 0x360+OPC,	20, STOR_IMM_INS, {{i4,16}, {abs16,0}}},		 \
+  /* opc12 i4 abs32 */								 \
+  {NAME,  3, 0x370+OPC,	20, STOR_IMM_INS, {{i4,16}, {abs32,0}}},		 \
+  /* opc12 i4 c4 rbase */							 \
+  {NAME,  1, 0x368+OPC,	20, LD_STOR_INS_INC, {{i4,16}, {rbase,12}}},		 \
+  /* opc12 i4 rbase disps12 */							 \
+  {NAME,  2, 0x368+OPC,	20, LD_STOR_INS_INC, {{i4,16}, {rbase_dispu12,12}}},	 \
+  /* opc4 i4 c4 rbase */							 \
+  {NAME,  1, 0x364+OPC,	20, STOR_IMM_INS, {{i4,16}, {rbase,12}}},		 \
+  /* opc12 i4 rbase disps12 */							 \
+  {NAME,  2, 0x364+OPC,	20, STOR_IMM_INS, {{i4,16}, {rbase_dispu12,12}}},	 \
+  /* opc12 i4 rbase disps28 */							 \
+  {NAME,  3, 0x374+OPC,	20, STOR_IMM_INS, {{i4,16}, {rbase_dispu28,12}}},	 \
+  /* opc12 i4 rbase ridx scl2 disps6 */						 \
+  {NAME,  2, 0x36C+OPC,	20, STOR_IMM_INS, {{i4,16}, {rbase_ridx_scl2_dispu6,0}}},\
+  /* opc12 i4 rbase ridx scl2 disps22 */					 \
+  {NAME,  3, 0x37C+OPC,	20, STOR_IMM_INS, {{i4,16}, {rbase_ridx_scl2_dispu22,0}}}
+
+  ST_REG_INST ("storb", 0x20, 0x4, DISPUB4),
+  ST_I_INST ("storb",  0x0),
+
+  ST_REG_INST ("storw", 0x21, 0x5, DISPUW4),
+  ST_I_INST ("storw",  0x1),
+
+  ST_REG_INST ("stord", 0x22, 0x6, DISPUD4),
+  ST_I_INST ("stord",  0x2),
+
+/* Create a bit instruction.  */
+#define  CSTBIT_INST(NAME, OP, OPC1, DIFF, SHIFT, OPC2) \
+  /* OP=i3 -->> opc13 i3 */								  \
+  /* OP=i4 -->> opc12 i4 */								  \
+  /* OP=i5 -->> opc11 i5 */								  \
+											  \
+  /* opcNN iN abs16 */									  \
+  {NAME,  2, OPC1+0*DIFF, SHIFT, CSTBIT_INS, {{OP,16}, {abs16,0}}},			  \
+  /* opcNN iN abs32 */									  \
+  {NAME,  3, OPC1+1*DIFF, SHIFT, CSTBIT_INS, {{OP,16}, {abs32,0}}},			  \
+  /* opcNN iN rbase */									  \
+  {NAME,  1, OPC2,  SHIFT+4,  CSTBIT_INS, {{OP,20}, {rbase,16}}},			  \
+  /* opcNN iN rbase disps12 */								  \
+  {NAME,  2, OPC1+2*DIFF, SHIFT, CSTBIT_INS, {{OP,16}, {rbase_dispu12,12}}},		  \
+  /* opcNN iN rbase disps28 */								  \
+  {NAME,  3, OPC1+3*DIFF, SHIFT, CSTBIT_INS, {{OP,16}, {rbase_dispu28,12}}},		  \
+  /* opcNN iN rbase ridx scl2 disps6 */							  \
+  {NAME,  2, OPC1+4*DIFF, SHIFT, CSTBIT_INS, {{OP,16}, {rbase_ridx_scl2_dispu6,0}}},	  \
+  /* opcNN iN rbase ridx scl2 disps22 */						  \
+  {NAME,  3, OPC1+5*DIFF, SHIFT, CSTBIT_INS, {{OP,16}, {rbase_ridx_scl2_dispu22,0}}}
+
+  CSTBIT_INST ("cbitb", i3, 0x700, 0x20, 19, 0x1FC),
+  CSTBIT_INST ("cbitw", i4, 0x382, 0x10, 20, 0xBD),
+  CSTBIT_INST ("cbitd", i5, 0x1C3, 0x8,  21, 0x7B),
+  {"cbitd",   2, 0x300838,  8, CSTBIT_INS, {{regr,4}, {regr,0}}},
+  {"cbitd",   2, 0x18047B,  9, CSTBIT_INS, {{i5,4},	 {regr,0}}},
+
+  CSTBIT_INST ("sbitb", i3, 0x701, 0x20, 19, 0x1FD),
+  CSTBIT_INST ("sbitw", i4, 0x383, 0x10, 20, 0xBE),
+  CSTBIT_INST ("sbitd", i5, 0x1C4, 0x8,  21, 0x7C),
+  {"sbitd",   2, 0x300839,  8, CSTBIT_INS, {{regr,4}, {regr,0}}},
+  {"sbitd",   2, 0x18047C,  9, CSTBIT_INS, {{i5,4},	 {regr,0}}},
+
+  CSTBIT_INST ("tbitb", i3, 0x702, 0x20, 19, 0x1FE),
+  CSTBIT_INST ("tbitw", i4, 0x384, 0x10, 20, 0xBF),
+  CSTBIT_INST ("tbitd", i5, 0x1C5, 0x8,  21, 0x7D),
+  {"tbitd",   2, 0x30083A,  8, CSTBIT_INS, {{regr,4}, {regr,0}}},
+  {"tbitd",   2, 0x18047D,  9, CSTBIT_INS, {{i5,4},	 {regr,0}}},
+
+/* Instructions including a register list (opcode is represented as a mask).  */
+#define  REGLIST_INST(NAME, OPC) \
+  /* opc12 r mask16 */					  \
+  {NAME,  2, OPC, 20, REG_LIST, {{regr,16}, {i16,0}}}
+
+  REG1_INST ("getrfid",	 0xFF9),
+  REG1_INST ("setrfid",   0xFFA),
+
+  REGLIST_INST ("push",	 0x346),
+  REG1_INST ("push",	 0xFFB),
+
+  REGLIST_INST ("pop",	 0x324),
+  REG1_INST ("pop",	 0xFFC),
+
+  REGLIST_INST ("popret", 0x326),
+  REG1_INST ("popret",    0xFFD),
+
+  REGLIST_INST ("loadm",	 0x324),
+  REGLIST_INST ("loadma", 0x325),
+  REGLIST_INST ("popma",	 0x325),
+
+  REGLIST_INST ("storm",	 0x344),
+  REGLIST_INST ("storma", 0x345),
+  REGLIST_INST ("pushma", 0x345),
+
+/* Create a branch instruction.  */
+#define  BR_INST(NAME, OPC1, OPC2, INS_TYPE) \
+  /* opc12 r disps17 */						      \
+  {NAME,  2, OPC1,  20, INS_TYPE | RELAXABLE, {{regr,16}, {d17,0}}},  \
+  /* opc12 r disps33 */						      \
+  {NAME,  3, OPC2,  20, INS_TYPE | RELAXABLE, {{regr,16}, {d33,0}}}
+
+  BR_INST ("bal",   0x307, 0x317, 0),
+
+  /* Decrement and Branch instructions */
+  BR_INST ("dbnzb", 0x304, 0x314, DCR_BRANCH_INS),
+  BR_INST ("dbnzw", 0x305, 0x315, DCR_BRANCH_INS),
+  BR_INST ("dbnzd", 0x306, 0x316, DCR_BRANCH_INS),
+
+  /* Jump and link instructions */
+  REG1_INST ("jal",    0xFF8),
+  REG2_INST ("jal",    0x37),
+  REG2_INST ("jalid",  0x33),
+
+  /* opc12 c4 opc12 r mask16 */
+  {"loadmcr", 3, 0x3110300, 4,	COP_REG_INS | REG_LIST | FMT_5, {{i4,16}, {regr,0}, {i16,0}}},
+  {"stormcr", 3, 0x3110301, 4,	COP_REG_INS | REG_LIST | FMT_5, {{i4,16}, {regr,0}, {i16,0}}},
+
+  /* esc16 r procreg */
+  {"mtpr",    2, 0x3009,  16, 0, {{regr8,8}, {regr8,0}}},
+  /* esc16 procreg r */
+  {"mfpr",    2, 0x300A,  16, 0, {{regr8,8}, {regr8,0}}},
+  /* opc12 c4 opc8 r copreg */
+  {"mtcr",    2, 0x301030,  8, COP_REG_INS | FMT_2, {{i4,16}, {regr,4}, {copregr,0}}},
+  /* opc12 c4 opc8 copreg r */
+  {"mfcr",    2, 0x301031,  8, COP_REG_INS | FMT_2, {{i4,16}, {copregr,4}, {regr,0}}},
+  /* opc12 c4 opc8 r copsreg */
+  {"mtcsr",   2, 0x301032,  8, COP_REG_INS | FMT_2, {{i4,16}, {regr,4}, {copregr,0}}},
+  /* opc12 c4 opc8 copsreg r */
+  {"mfcsr",   2, 0x301033,  8, COP_REG_INS | FMT_2, {{i4,16}, {copregr,4}, {regr,0}}},
+
+  /* CO-processor extensions */
+  /* opc12 c4 opc4 i4 disps9 */
+  {"bcop",    2, 0x30107, 12, COP_BRANCH_INS | FMT_4, {{i4,16}, {i4,8}, {d9,0}}},
+  /* opc12 c4 opc4 i4 disps25 */
+  {"bcop",    3, 0x31107, 12, COP_BRANCH_INS | FMT_4, {{i4,16}, {i4,8}, {d25,0}}},
+
+  /* opc12 i4 */
+  {"excp",    1, 0xFFF,	20, 0, {{i4,16}}},
+  /* opc28 i4 */
+  {"cinv",    2, 0x3010000, 4,	0, {{i4,0}}},
+
+  /* opc9 i5 i5 i5 r r */
+  {"ram",     2, 0x7C,	23, 0, {{i5,18}, {i5,13}, {i5,8}, {regr,4}, {regr,0}}},
+  {"rim",     2, 0x7D,	23, 0, {{i5,18}, {i5,13}, {i5,8}, {regr,4}, {regr,0}}},
+
+  /* opc9 i3 r */
+  {"rotb",    1, 0x1FB,	23, 0, {{i3,20}, {regr,16}}},
+  /* opc8 i4 r */
+  {"rotw",    1, 0xB9,	24, 0, {{i4,20}, {regr,16}}},
+  /* opc23 i5 r */
+  {"rotd",    2, 0x180478,  9, 0, {{i5,4}, {regr,0}}},
+
+  {NULL,      0, 0, 0,	0, {{0, 0}}}
+};
+
+const int crx_num_opcodes = ARRAY_SIZE (crx_instruction);
+
+/* Macro to build a reg_entry, which have an opcode image :
+   For example :
+      REG(u4, 0x84, CRX_U_REGTYPE)
+   is interpreted as :
+      {"u4",  u4, 0x84, CRX_U_REGTYPE}  */
+#define REG(NAME, N, TYPE)    {STRINGX(NAME), {NAME}, N, TYPE}
+
+const reg_entry crx_regtab[] =
+{
+/* Build a general purpose register r<N>.  */
+#define REG_R(N)    REG(CONCAT2(r,N), N, CRX_R_REGTYPE)
+
+  REG_R(0),  REG_R(1),	REG_R(2),  REG_R(3),
+  REG_R(4),  REG_R(5),	REG_R(6),  REG_R(7),
+  REG_R(8),  REG_R(9),	REG_R(10), REG_R(11),
+  REG_R(12), REG_R(13), REG_R(14), REG_R(15),
+  REG(ra, 0xe, CRX_R_REGTYPE),
+  REG(sp, 0xf, CRX_R_REGTYPE),
+
+/* Build a user register ur<N>.  */
+#define REG_U(N)    REG(CONCAT2(u,N), 0x80 + N, CRX_U_REGTYPE)
+
+  REG_U(0),  REG_U(1),  REG_U(2),  REG_U(3),
+  REG_U(4),  REG_U(5),  REG_U(6),  REG_U(7),
+  REG_U(8),  REG_U(9),  REG_U(10), REG_U(11),
+  REG_U(12), REG_U(13), REG_U(14), REG_U(15),
+  REG(ura, 0x8e, CRX_U_REGTYPE),
+  REG(usp, 0x8f, CRX_U_REGTYPE),
+
+/* Build a configuration register.  */
+#define REG_CFG(NAME, N)    REG(NAME, N, CRX_CFG_REGTYPE)
+
+  REG_CFG(hi,    0x10),
+  REG_CFG(lo,    0x11),
+  REG_CFG(uhi,   0x90),
+  REG_CFG(ulo,   0x91),
+  REG_CFG(psr,   0x12),
+  REG_CFG(cfg,   0x15),
+  REG_CFG(cpcfg, 0x16),
+  REG_CFG(ccfg,	 0x1b),
+
+/* Build a mptr register.  */
+#define REG_MPTR(NAME, N)    REG(NAME, N, CRX_MTPR_REGTYPE)
+
+  REG_MPTR(intbase, 0x13),
+  REG_MPTR(isp,     0x14),
+  REG_MPTR(cen,     0x17),
+
+/* Build a pc register.  */
+#define REG_PC(NAME, N)    REG(NAME, N, CRX_PC_REGTYPE)
+
+  REG_PC(pc,  0x0)
+};
+
+const int crx_num_regs = ARRAY_SIZE (crx_regtab);
+
+const reg_entry crx_copregtab[] =
+{
+/* Build a Coprocessor register c<N>.  */
+#define REG_C(N)    REG(CONCAT2(c,N), N, CRX_C_REGTYPE)
+
+  REG_C(0),  REG_C(1),	REG_C(2),  REG_C(3),
+  REG_C(4),  REG_C(5),	REG_C(6),  REG_C(7),
+  REG_C(8),  REG_C(9),	REG_C(10), REG_C(11),
+  REG_C(12), REG_C(13), REG_C(14), REG_C(15),
+
+/* Build a Coprocessor Special register c<N>.  */
+#define REG_CS(N)    REG(CONCAT2(cs,N), N, CRX_CS_REGTYPE)
+
+  REG_CS(0),  REG_CS(1),  REG_CS(2),  REG_CS(3),
+  REG_CS(4),  REG_CS(5),  REG_CS(6),  REG_CS(7),
+  REG_CS(8),  REG_CS(9),  REG_CS(10), REG_CS(11),
+  REG_CS(12), REG_CS(13), REG_CS(14), REG_CS(15)
+};
+
+const int crx_num_copregs = ARRAY_SIZE (crx_copregtab);
+
+/* CRX operands table.  */
+const operand_entry crx_optab[] =
+{
+  /* Index 0 is dummy, so we can count the instruction's operands.  */
+  {0,	nullargs},  /* dummy */
+  {4,	arg_ic},    /* cst4 */
+  {8,	arg_c},	    /* disps9 */
+  {3,	arg_ic},    /* i3 */
+  {4,	arg_ic},    /* i4 */
+  {5,	arg_ic},    /* i5 */
+  {8,	arg_ic},    /* i8 */
+  {12,	arg_ic},    /* i12 */
+  {16,	arg_ic},    /* i16 */
+  {32,	arg_ic},    /* i32 */
+  {4,	arg_c},	    /* d5 */
+  {8,	arg_c},	    /* d9 */
+  {16,	arg_c},	    /* d17 */
+  {24,	arg_c},	    /* d25 */
+  {32,	arg_c},	    /* d33 */
+  {16,	arg_c},	    /* abs16 */
+  {32,	arg_c},	    /* abs32 */
+  {4,	arg_rbase}, /* rbase */
+  {4,	arg_cr},    /* rbase_cst4 */
+  {8,	arg_cr},    /* rbase_dispu8 */
+  {12,	arg_cr},    /* rbase_dispu12 */
+  {16,	arg_cr},    /* rbase_dispu16 */
+  {28,	arg_cr},    /* rbase_dispu28 */
+  {32,	arg_cr},    /* rbase_dispu32 */
+  {6,	arg_icr},   /* rbase_ridx_scl2_dispu6 */
+  {22,  arg_icr},   /* rbase_ridx_scl2_dispu22 */
+  {4,	arg_r},	    /* regr */
+  {8,	arg_r},	    /* regr8 */
+  {4,	arg_copr},  /* copregr */
+  {8,	arg_copr},  /* copregr8 */
+  {4,	arg_copsr}  /* copsregr */
+};
+
+/* CRX traps/interrupts.  */
+const trap_entry crx_traps[] =
+{
+  {"nmi", 1}, {"svc", 5}, {"dvz", 6}, {"flg", 7},
+  {"bpt", 8}, {"und", 10}, {"prv", 11}, {"iberr", 12}
+};
+
+const int crx_num_traps = ARRAY_SIZE (crx_traps);
+
+/* cst4 operand mapping.  */
+const cst4_entry cst4_map[] =
+{
+  {0,0}, {1,1}, {2,2}, {3,3}, {4,4}, {5,-4}, {6,-1},
+  {7,7}, {8,8}, {9,16}, {10,32}, {11,20}, {12,12}, {13,48}
+};
+
+const int cst4_maps = ARRAY_SIZE (cst4_map);
diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c
index d5b17be..1bcd322 100644
--- a/opcodes/disassemble.c
+++ b/opcodes/disassemble.c
@@ -26,6 +26,7 @@
 #define ARCH_arm
 #define ARCH_avr
 #define ARCH_cris
+#define ARCH_crx
 #define ARCH_d10v
 #define ARCH_d30v
 #define ARCH_dlx
@@ -123,6 +124,11 @@
       disassemble = cris_get_disassembler (abfd);
       break;
 #endif
+#ifdef ARCH_crx
+    case bfd_arch_crx:
+      disassemble = print_insn_crx;
+      break;
+#endif
 #ifdef ARCH_d10v
     case bfd_arch_d10v:
       disassemble = print_insn_d10v;
@@ -146,7 +152,8 @@
 	disassemble = print_insn_h8300h;
       else if (bfd_get_mach (abfd) == bfd_mach_h8300s
 	       || bfd_get_mach (abfd) == bfd_mach_h8300sn
-	       || bfd_get_mach (abfd) == bfd_mach_h8300sx)
+	       || bfd_get_mach (abfd) == bfd_mach_h8300sx
+	       || bfd_get_mach (abfd) == bfd_mach_h8300sxn)
 	disassemble = print_insn_h8300s;
       else
 	disassemble = print_insn_h8300;
diff --git a/opcodes/h8300-dis.c b/opcodes/h8300-dis.c
index 895a9ef..2587919 100644
--- a/opcodes/h8300-dis.c
+++ b/opcodes/h8300-dis.c
@@ -716,6 +716,17 @@
 		    int hadone = 0;
 		    int nargs;
 
+		    /* Special case handling for the adds and subs instructions
+		       since in H8 mode thay can only take the r0-r7 registers but
+		       in other (higher) modes they can take the er0-er7 registers
+		       as well.  */
+		    if (strcmp (qi->opcode->name, "adds") == 0
+			|| strcmp (qi->opcode->name, "subs") == 0)
+		      {
+			outfn (stream, "#%d,%s", cst[0], pregnames[regno[1] & 0x7]);
+			return qi->length;
+		      }
+
 		    for (nargs = 0; 
 			 nargs < 3 && args[nargs] != (op_type) E; 
 			 nargs++)
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index a71eb0c..0bcd107 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -312,7 +312,7 @@
 #define w_mode 3  /* word operand */
 #define d_mode 4  /* double word operand  */
 #define q_mode 5  /* quad word operand */
-#define x_mode 6
+#define x_mode 6  /* 80 bit float operand */
 #define m_mode 7  /* d_mode in 32bit, q_mode in 64bit mode.  */
 #define cond_jump_mode 8
 #define loop_jcxz_mode 9
@@ -1881,6 +1881,7 @@
 
 static char op1out[100], op2out[100], op3out[100];
 static int op_ad, op_index[3];
+static int two_source_ops;
 static bfd_vma op_address[3];
 static bfd_vma op_riprel[3];
 static bfd_vma start_pc;
@@ -1932,7 +1933,6 @@
 {
   const struct dis386 *dp;
   int i;
-  int two_source_ops;
   char *first, *second, *third;
   int needcomma;
   unsigned char uses_SSE_prefix;
@@ -2364,7 +2364,7 @@
   "fdivr{l||l|}",
   /* dd */
   "fld{l||l|}",
-  "fisttpll",
+  "fisttp{ll||ll|}",
   "fst{l||l|}",
   "fstp{l||l|}",
   "frstor",
@@ -2388,7 +2388,82 @@
   "fbld",
   "fild{ll||ll|}",
   "fbstp",
-  "fistpll",
+  "fistp{ll||ll|}",
+};
+
+static const unsigned char float_mem_mode[] = {
+  /* d8 */
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  /* d9 */
+  d_mode,
+  0,
+  d_mode,
+  d_mode,
+  0,
+  w_mode,
+  0,
+  w_mode,
+  /* da */
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  /* db */
+  d_mode,
+  d_mode,
+  d_mode,
+  d_mode,
+  0,
+  x_mode,
+  0,
+  x_mode,
+  /* dc */
+  q_mode,
+  q_mode,
+  q_mode,
+  q_mode,
+  q_mode,
+  q_mode,
+  q_mode,
+  q_mode,
+  /* dd */
+  q_mode,
+  q_mode,
+  q_mode,
+  q_mode,
+  0,
+  0,
+  0,
+  w_mode,
+  /* de */
+  w_mode,
+  w_mode,
+  w_mode,
+  w_mode,
+  w_mode,
+  w_mode,
+  w_mode,
+  w_mode,
+  /* df */
+  w_mode,
+  w_mode,
+  w_mode,
+  w_mode,
+  x_mode,
+  q_mode,
+  x_mode,
+  q_mode
 };
 
 #define ST OP_ST, 0
@@ -2567,14 +2642,11 @@
 
   if (mod != 3)
     {
-      putop (float_mem[(floatop - 0xd8) * 8 + reg], sizeflag);
+      int fp_indx = (floatop - 0xd8) * 8 + reg;
+
+      putop (float_mem[fp_indx], sizeflag);
       obufp = op1out;
-      if (floatop == 0xdb)
-	OP_E (x_mode, sizeflag);
-      else if (floatop == 0xdd)
-	OP_E (d_mode, sizeflag);
-      else
-	OP_E (v_mode, sizeflag);
+      OP_E (float_mem_mode[fp_indx], sizeflag);
       return;
     }
   /* Skip mod/rm byte.  */
@@ -3135,9 +3207,15 @@
 		  oappend ("WORD PTR ");
 		  break;
 		case v_mode:
-		  oappend ("DWORD PTR ");
+		  if (sizeflag & DFLAG)
+		    oappend ("DWORD PTR ");
+		  else
+		    oappend ("WORD PTR ");
 		  break;
 		case d_mode:
+		  oappend ("DWORD PTR ");
+		  break;
+		case q_mode:
 		  oappend ("QWORD PTR ");
 		  break;
 		case m_mode:
@@ -3776,11 +3854,8 @@
 ptr_reg (int code, int sizeflag)
 {
   const char *s;
-  if (intel_syntax)
-    oappend ("[");
-  else
-    oappend ("(");
 
+  *obufp++ = open_char;
   USED_REX (REX_MODE64);
   if (rex & REX_MODE64)
     {
@@ -3794,10 +3869,8 @@
   else
     s = names16[code - eAX_reg];
   oappend (s);
-  if (intel_syntax)
-    oappend ("]");
-  else
-    oappend (")");
+  *obufp++ = close_char;
+  *obufp = 0;
 }
 
 static void
@@ -4162,21 +4235,29 @@
 static void
 PNI_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag)
 {
-  if (mod == 3 && reg == 1)
+  if (mod == 3 && reg == 1 && rm <= 1)
     {
-      char *p = obuf + strlen (obuf);
-
       /* Override "sidt".  */
+      char *p = obuf + strlen (obuf) - 4;
+
+      /* We might have a suffix.  */
+      if (*p == 'i')
+	--p;
+
       if (rm)
 	{
 	  /* mwait %eax,%ecx  */
-	  strcpy (p - 4, "mwait   %eax,%ecx");
+	  strcpy (p, "mwait");
 	}
       else
 	{
 	  /* monitor %eax,%ecx,%edx"  */
-	  strcpy (p - 4, "monitor %eax,%ecx,%edx");
+	  strcpy (p, "monitor");
+	  strcpy (op3out, names32[2]);
 	}
+      strcpy (op1out, names32[0]);
+      strcpy (op2out, names32[1]);
+      two_source_ops = 1;
 
       codep++;
     }
diff --git a/opcodes/ia64-asmtab.c b/opcodes/ia64-asmtab.c
index 2465d39..2b0af27 100644
--- a/opcodes/ia64-asmtab.c
+++ b/opcodes/ia64-asmtab.c
@@ -1544,36 +1544,82 @@
 };
 
 static const short dep236[] = {
+  96, 267, 2135, 2139, 2310, 2312, 18593, 18594, 18746, 18747, 18749, 18750, 
+  
+};
+
+static const short dep237[] = {
+  40, 41, 75, 76, 81, 83, 96, 108, 110, 127, 128, 130, 131, 134, 135, 136, 138, 
+  139, 146, 163, 174, 178, 267, 2137, 2138, 2139, 2165, 2166, 2169, 2172, 2310, 
+  2312, 4135, 16524, 16526, 18746, 18748, 18749, 18751, 20613, 
+};
+
+static const short dep238[] = {
+  40, 41, 44, 75, 76, 81, 83, 96, 108, 110, 127, 128, 130, 131, 134, 135, 136, 
+  138, 139, 146, 148, 163, 174, 178, 267, 2137, 2138, 2139, 2165, 2166, 2169, 
+  2172, 2310, 2312, 4135, 16524, 16526, 18746, 18748, 18749, 18751, 20613, 
+};
+
+static const short dep239[] = {
+  0, 96, 181, 267, 2135, 2139, 2310, 2312, 18593, 18594, 18746, 18747, 18749, 
+  18750, 
+};
+
+static const short dep240[] = {
+  0, 40, 41, 75, 76, 81, 83, 96, 108, 110, 127, 128, 130, 131, 134, 135, 136, 
+  138, 139, 146, 163, 174, 178, 181, 267, 2137, 2138, 2139, 2165, 2166, 2169, 
+  2172, 2310, 2312, 4135, 16524, 16526, 18746, 18748, 18749, 18751, 20613, 
+};
+
+static const short dep241[] = {
+  0, 40, 41, 44, 75, 76, 81, 83, 96, 108, 110, 127, 128, 130, 131, 134, 135, 
+  136, 138, 139, 146, 148, 163, 174, 178, 181, 267, 2137, 2138, 2139, 2165, 
+  2166, 2169, 2172, 2310, 2312, 4135, 16524, 16526, 18746, 18748, 18749, 18751, 
+  20613, 
+};
+
+static const short dep242[] = {
+  0, 96, 181, 267, 2136, 2139, 2310, 2312, 18593, 18594, 18746, 18747, 18749, 
+  18750, 
+};
+
+static const short dep243[] = {
   0, 40, 41, 75, 76, 81, 83, 96, 110, 127, 128, 130, 131, 134, 135, 136, 138, 
   139, 146, 163, 174, 178, 181, 267, 274, 2134, 2135, 2136, 2137, 2138, 2139, 
   2165, 2166, 2169, 2172, 4135, 16524, 16526, 20613, 
 };
 
-static const short dep237[] = {
+static const short dep244[] = {
   40, 41, 75, 96, 134, 148, 174, 267, 2165, 2166, 2169, 2172, 4135, 
 };
 
-static const short dep238[] = {
+static const short dep245[] = {
   40, 41, 75, 96, 134, 135, 139, 148, 174, 267, 2165, 2166, 2169, 2172, 4135, 
   
 };
 
-static const short dep239[] = {
+static const short dep246[] = {
   40, 41, 75, 96, 134, 148, 174, 267, 2137, 2138, 2139, 2165, 2166, 2169, 2172, 
   2312, 4135, 20613, 
 };
 
-static const short dep240[] = {
+static const short dep247[] = {
   40, 41, 75, 96, 134, 135, 139, 148, 174, 267, 2137, 2138, 2139, 2165, 2166, 
   2169, 2172, 2312, 4135, 20613, 
 };
 
-static const short dep241[] = {
+static const short dep248[] = {
   40, 41, 96, 174, 267, 2137, 2138, 2139, 2165, 2166, 2169, 2172, 2310, 4135, 
   16524, 16526, 18746, 18748, 18749, 18751, 20613, 
 };
 
-static const short dep242[] = {
+static const short dep249[] = {
+  0, 40, 41, 75, 76, 81, 83, 96, 110, 127, 128, 130, 131, 134, 135, 136, 138, 
+  139, 146, 163, 174, 178, 181, 267, 274, 2134, 2135, 2136, 2137, 2138, 2139, 
+  2165, 2166, 2169, 2172, 2312, 4135, 16524, 16526, 20613, 
+};
+
+static const short dep250[] = {
   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 
   22, 24, 26, 27, 28, 29, 30, 31, 96, 182, 183, 184, 185, 186, 187, 188, 189, 
   190, 191, 192, 193, 194, 195, 197, 198, 200, 201, 203, 204, 206, 207, 208, 
@@ -1581,7 +1627,7 @@
   2312, 28852, 29002, 
 };
 
-static const short dep243[] = {
+static const short dep251[] = {
   1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 
   22, 24, 25, 26, 28, 29, 30, 31, 40, 41, 96, 134, 171, 174, 182, 183, 184, 
   185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 197, 198, 200, 201, 
@@ -1738,14 +1784,20 @@
   { NELS(dep233), dep233, NELS(dep232), dep232, },
   { NELS(dep234), dep234, NELS(dep232), dep232, },
   { NELS(dep233), dep233, NELS(dep235), dep235, },
-  { NELS(dep236), dep236, NELS(dep217), dep217, },
-  { NELS(dep237), dep237, NELS(dep31), dep31, },
-  { NELS(dep238), dep238, NELS(dep31), dep31, },
-  { NELS(dep239), dep239, NELS(dep0), dep0, },
-  { NELS(dep240), dep240, NELS(dep0), dep0, },
-  { NELS(dep241), dep241, NELS(dep62), dep62, },
+  { NELS(dep237), dep237, NELS(dep236), dep236, },
+  { NELS(dep238), dep238, NELS(dep236), dep236, },
+  { NELS(dep240), dep240, NELS(dep239), dep239, },
+  { NELS(dep241), dep241, NELS(dep239), dep239, },
+  { NELS(dep240), dep240, NELS(dep242), dep242, },
+  { NELS(dep243), dep243, NELS(dep217), dep217, },
+  { NELS(dep244), dep244, NELS(dep31), dep31, },
+  { NELS(dep245), dep245, NELS(dep31), dep31, },
+  { NELS(dep246), dep246, NELS(dep0), dep0, },
+  { NELS(dep247), dep247, NELS(dep0), dep0, },
+  { NELS(dep248), dep248, NELS(dep62), dep62, },
+  { NELS(dep249), dep249, NELS(dep222), dep222, },
   { 0, NULL, 0, NULL, },
-  { NELS(dep243), dep243, NELS(dep242), dep242, },
+  { NELS(dep251), dep251, NELS(dep250), dep250, },
 };
 
 static const struct ia64_completer_table
@@ -1763,36 +1815,36 @@
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, 455, -1, 0, 1, 6 },
-  { 0x0, 0x0, 0, 518, -1, 0, 1, 17 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 151 },
-  { 0x0, 0x0, 0, 617, -1, 0, 1, 17 },
-  { 0x0, 0x0, 0, 1836, -1, 0, 1, 10 },
+  { 0x0, 0x0, 0, 454, -1, 0, 1, 6 },
+  { 0x0, 0x0, 0, 517, -1, 0, 1, 17 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 157 },
+  { 0x0, 0x0, 0, 616, -1, 0, 1, 17 },
+  { 0x0, 0x0, 0, 1835, -1, 0, 1, 10 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 9 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 13 },
   { 0x1, 0x1, 0, -1, -1, 13, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
-  { 0x0, 0x0, 0, 2014, -1, 0, 1, 29 },
+  { 0x0, 0x0, 0, 2013, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
-  { 0x0, 0x0, 0, 958, -1, 0, 1, 122 },
+  { 0x0, 0x0, 0, 957, -1, 0, 1, 122 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 44 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 40 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 78 },
-  { 0x0, 0x0, 0, 1878, -1, 0, 1, 29 },
+  { 0x0, 0x0, 0, 1877, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 29 },
-  { 0x0, 0x0, 0, 2057, -1, 0, 1, 29 },
-  { 0x0, 0x0, 0, 1882, -1, 0, 1, 29 },
+  { 0x0, 0x0, 0, 2056, -1, 0, 1, 29 },
+  { 0x0, 0x0, 0, 1881, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
-  { 0x0, 0x0, 0, 1884, -1, 0, 1, 29 },
-  { 0x0, 0x0, 0, 2066, -1, 0, 1, 29 },
-  { 0x0, 0x0, 0, 2069, -1, 0, 1, 29 },
+  { 0x0, 0x0, 0, 1883, -1, 0, 1, 29 },
+  { 0x0, 0x0, 0, 2065, -1, 0, 1, 29 },
+  { 0x0, 0x0, 0, 2068, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
@@ -1801,66 +1853,65 @@
   { 0x0, 0x0, 0, -1, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 29 },
-  { 0x0, 0x0, 0, 2091, -1, 0, 1, 29 },
+  { 0x0, 0x0, 0, 2090, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 29 },
-  { 0x0, 0x0, 0, 2094, -1, 0, 1, 29 },
+  { 0x0, 0x0, 0, 2093, -1, 0, 1, 29 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 24 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 24 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 24 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 24 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 35 },
-  { 0x0, 0x0, 0, 2102, -1, 0, 1, 29 },
-  { 0x0, 0x0, 0, 1181, -1, 0, 1, 33 },
+  { 0x0, 0x0, 0, 2101, -1, 0, 1, 29 },
+  { 0x0, 0x0, 0, 1180, -1, 0, 1, 33 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 40 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 151 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 157 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 77 },
-  { 0x0, 0x0, 0, 1216, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1225, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1234, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1236, -1, 0, 1, 125 },
-  { 0x0, 0x0, 0, 1245, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1254, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1263, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1272, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1281, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1290, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1300, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1310, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1320, -1, 0, 1, 124 },
-  { 0x0, 0x0, 0, 1329, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1335, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1341, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1347, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1353, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1359, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1365, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1371, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1377, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1383, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1389, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1395, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1401, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1407, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1413, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1419, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1425, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1431, -1, 0, 1, 140 },
-  { 0x0, 0x0, 0, 1435, -1, 0, 1, 146 },
-  { 0x0, 0x0, 0, 1439, -1, 0, 1, 148 },
-  { 0x0, 0x0, 0, 1443, -1, 0, 1, 148 },
+  { 0x0, 0x0, 0, 1215, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1224, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1233, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1235, -1, 0, 1, 125 },
+  { 0x0, 0x0, 0, 1244, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1253, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1262, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1271, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1280, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1289, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1299, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1309, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1319, -1, 0, 1, 124 },
+  { 0x0, 0x0, 0, 1328, -1, 0, 1, 140 },
+  { 0x0, 0x0, 0, 1334, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1340, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1346, -1, 0, 1, 140 },
+  { 0x0, 0x0, 0, 1352, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1358, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1364, -1, 0, 1, 140 },
+  { 0x0, 0x0, 0, 1370, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1376, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1382, -1, 0, 1, 140 },
+  { 0x0, 0x0, 0, 1388, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1394, -1, 0, 1, 140 },
+  { 0x0, 0x0, 0, 1400, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1406, -1, 0, 1, 140 },
+  { 0x0, 0x0, 0, 1412, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1418, -1, 0, 1, 140 },
+  { 0x0, 0x0, 0, 1424, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1430, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1434, -1, 0, 1, 151 },
+  { 0x0, 0x0, 0, 1438, -1, 0, 1, 153 },
+  { 0x0, 0x0, 0, 1442, -1, 0, 1, 153 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 79 },
-  { 0x0, 0x0, 0, 253, -1, 0, 1, 40 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, 252, -1, 0, 1, 40 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 33 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 67 },
-  { 0x1, 0x1, 0, 984, -1, 20, 1, 67 },
+  { 0x1, 0x1, 0, 983, -1, 20, 1, 67 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 68 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 69 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 70 },
@@ -1887,39 +1938,39 @@
   { 0x0, 0x0, 0, -1, -1, 0, 1, 111 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 112 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 113 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 152 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 152 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 152 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 158 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 158 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 158 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 71 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 151 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 157 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, 2393, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, 2394, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, 2395, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, 1847, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, 1848, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, 1849, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, 2408, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, 2409, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, 2410, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, 2411, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, 2412, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, 2413, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, 2395, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, 2396, -1, 0, 1, 0 },
-  { 0x0, 0x0, 0, 2397, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 11 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 84 },
@@ -1929,26 +1980,26 @@
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x1, 0x1, 0, -1, -1, 13, 1, 0 },
-  { 0x0, 0x0, 0, 2415, -1, 0, 1, 0 },
+  { 0x0, 0x0, 0, 2414, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 84 },
-  { 0x0, 0x0, 0, 1711, -1, 0, 1, 131 },
-  { 0x0, 0x0, 0, 1713, -1, 0, 1, 138 },
-  { 0x0, 0x0, 0, 1715, -1, 0, 1, 132 },
-  { 0x0, 0x0, 0, 1717, -1, 0, 1, 131 },
-  { 0x0, 0x0, 0, 1719, -1, 0, 1, 138 },
-  { 0x0, 0x0, 0, 1721, -1, 0, 1, 131 },
-  { 0x0, 0x0, 0, 1723, -1, 0, 1, 138 },
-  { 0x0, 0x0, 0, 1726, -1, 0, 1, 131 },
-  { 0x0, 0x0, 0, 1729, -1, 0, 1, 138 },
-  { 0x0, 0x0, 0, 1732, -1, 0, 1, 145 },
-  { 0x0, 0x0, 0, 1733, -1, 0, 1, 145 },
-  { 0x0, 0x0, 0, 1734, -1, 0, 1, 145 },
-  { 0x0, 0x0, 0, 1735, -1, 0, 1, 145 },
-  { 0x0, 0x0, 0, 1736, -1, 0, 1, 145 },
-  { 0x0, 0x0, 0, 1737, -1, 0, 1, 145 },
-  { 0x0, 0x0, 0, 1738, -1, 0, 1, 145 },
-  { 0x0, 0x0, 0, 1739, -1, 0, 1, 145 },
+  { 0x0, 0x0, 0, 1710, -1, 0, 1, 131 },
+  { 0x0, 0x0, 0, 1712, -1, 0, 1, 138 },
+  { 0x0, 0x0, 0, 1714, -1, 0, 1, 132 },
+  { 0x0, 0x0, 0, 1716, -1, 0, 1, 131 },
+  { 0x0, 0x0, 0, 1718, -1, 0, 1, 138 },
+  { 0x0, 0x0, 0, 1720, -1, 0, 1, 131 },
+  { 0x0, 0x0, 0, 1722, -1, 0, 1, 138 },
+  { 0x0, 0x0, 0, 1725, -1, 0, 1, 131 },
+  { 0x0, 0x0, 0, 1728, -1, 0, 1, 138 },
+  { 0x0, 0x0, 0, 1731, -1, 0, 1, 150 },
+  { 0x0, 0x0, 0, 1732, -1, 0, 1, 156 },
+  { 0x0, 0x0, 0, 1733, -1, 0, 1, 150 },
+  { 0x0, 0x0, 0, 1734, -1, 0, 1, 156 },
+  { 0x0, 0x0, 0, 1735, -1, 0, 1, 150 },
+  { 0x0, 0x0, 0, 1736, -1, 0, 1, 156 },
+  { 0x0, 0x0, 0, 1737, -1, 0, 1, 150 },
+  { 0x0, 0x0, 0, 1738, -1, 0, 1, 156 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
@@ -1960,94 +2011,95 @@
   { 0x0, 0x0, 0, -1, -1, 0, 1, 118 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 120 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 119 },
+  { 0x0, 0x0, 0, 1443, -1, 0, 1, 136 },
   { 0x0, 0x0, 0, 1444, -1, 0, 1, 136 },
   { 0x0, 0x0, 0, 1445, -1, 0, 1, 136 },
   { 0x0, 0x0, 0, 1446, -1, 0, 1, 136 },
-  { 0x0, 0x0, 0, 1447, -1, 0, 1, 136 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 0, -1, -1, 0, 1, 0 },
-  { 0x0, 0x0, 1, 220, -1, 0, 1, 12 },
+  { 0x0, 0x0, 1, 219, -1, 0, 1, 12 },
   { 0x1, 0x1, 2, -1, -1, 27, 1, 12 },
+  { 0x0, 0x0, 3, -1, 1122, 0, 0, -1 },
   { 0x0, 0x0, 3, -1, 1123, 0, 0, -1 },
-  { 0x0, 0x0, 3, -1, 1124, 0, 0, -1 },
-  { 0x1, 0x1, 3, 2285, 1209, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2286, 1218, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2287, 1227, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2288, 1238, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2289, 1247, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2290, 1256, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2291, 1265, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2292, 1274, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2293, 1283, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2294, 1292, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2295, 1302, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2296, 1312, 33, 1, 127 },
-  { 0x1, 0x1, 3, 2297, 1325, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2298, 1331, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2299, 1337, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2300, 1343, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2301, 1349, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2302, 1355, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2303, 1361, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2304, 1367, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2305, 1373, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2306, 1379, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2307, 1385, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2308, 1391, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2309, 1397, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2310, 1403, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2311, 1409, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2312, 1415, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2313, 1421, 33, 1, 142 },
-  { 0x1, 0x1, 3, 2314, 1427, 33, 1, 142 },
+  { 0x1, 0x1, 3, 2284, 1208, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2285, 1217, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2286, 1226, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2287, 1237, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2288, 1246, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2289, 1255, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2290, 1264, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2291, 1273, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2292, 1282, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2293, 1291, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2294, 1301, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2295, 1311, 33, 1, 127 },
+  { 0x1, 0x1, 3, 2296, 1324, 33, 1, 142 },
+  { 0x1, 0x1, 3, 2297, 1330, 33, 1, 147 },
+  { 0x1, 0x1, 3, 2298, 1336, 33, 1, 147 },
+  { 0x1, 0x1, 3, 2299, 1342, 33, 1, 142 },
+  { 0x1, 0x1, 3, 2300, 1348, 33, 1, 147 },
+  { 0x1, 0x1, 3, 2301, 1354, 33, 1, 147 },
+  { 0x1, 0x1, 3, 2302, 1360, 33, 1, 142 },
+  { 0x1, 0x1, 3, 2303, 1366, 33, 1, 147 },
+  { 0x1, 0x1, 3, 2304, 1372, 33, 1, 147 },
+  { 0x1, 0x1, 3, 2305, 1378, 33, 1, 142 },
+  { 0x1, 0x1, 3, 2306, 1384, 33, 1, 147 },
+  { 0x1, 0x1, 3, 2307, 1390, 33, 1, 142 },
+  { 0x1, 0x1, 3, 2308, 1396, 33, 1, 147 },
+  { 0x1, 0x1, 3, 2309, 1402, 33, 1, 142 },
+  { 0x1, 0x1, 3, 2310, 1408, 33, 1, 147 },
+  { 0x1, 0x1, 3, 2311, 1414, 33, 1, 142 },
+  { 0x1, 0x1, 3, 2312, 1420, 33, 1, 147 },
+  { 0x1, 0x1, 3, 2313, 1426, 33, 1, 147 },
   { 0x1, 0x1, 3, -1, -1, 27, 1, 40 },
-  { 0x0, 0x0, 4, 1850, 1194, 0, 1, 135 },
-  { 0x0, 0x0, 4, 1851, 1196, 0, 1, 134 },
-  { 0x0, 0x0, 4, 1852, 1198, 0, 1, 134 },
-  { 0x0, 0x0, 4, 1853, 1200, 0, 1, 134 },
-  { 0x0, 0x0, 4, 1854, 1202, 0, 1, 134 },
-  { 0x0, 0x0, 4, 1855, 1204, 0, 1, 136 },
-  { 0x0, 0x0, 4, 1856, 1206, 0, 1, 136 },
-  { 0x1, 0x1, 4, -1, 1213, 33, 1, 130 },
-  { 0x5, 0x5, 4, 413, 1212, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1222, 33, 1, 130 },
-  { 0x5, 0x5, 4, 414, 1221, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1231, 33, 1, 130 },
-  { 0x5, 0x5, 4, 415, 1230, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1235, 32, 1, 125 },
-  { 0x1, 0x1, 4, -1, 1242, 33, 1, 130 },
-  { 0x5, 0x5, 4, 416, 1241, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1251, 33, 1, 130 },
-  { 0x5, 0x5, 4, 417, 1250, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1260, 33, 1, 130 },
-  { 0x5, 0x5, 4, 418, 1259, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1269, 33, 1, 130 },
-  { 0x5, 0x5, 4, 419, 1268, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1278, 33, 1, 130 },
-  { 0x5, 0x5, 4, 420, 1277, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1287, 33, 1, 130 },
-  { 0x5, 0x5, 4, 421, 1286, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1297, 33, 1, 130 },
-  { 0x5, 0x5, 4, 888, 1295, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1307, 33, 1, 130 },
-  { 0x5, 0x5, 4, 889, 1305, 32, 1, 124 },
-  { 0x1, 0x1, 4, -1, 1317, 33, 1, 130 },
-  { 0x5, 0x5, 4, 890, 1315, 32, 1, 124 },
-  { 0x1, 0x21, 10, 1748, -1, 33, 1, 3 },
-  { 0x200001, 0x200001, 10, 1749, -1, 12, 1, 3 },
-  { 0x0, 0x0, 10, 1750, -1, 0, 1, 3 },
-  { 0x1, 0x1, 10, 1751, -1, 12, 1, 3 },
-  { 0x1, 0x1, 10, 1752, -1, 33, 1, 3 },
-  { 0x200001, 0x200001, 10, 1753, -1, 12, 1, 3 },
-  { 0x0, 0x0, 10, 351, -1, 0, 1, 3 },
-  { 0x1, 0x1, 10, 1779, -1, 12, 1, 3 },
-  { 0x1, 0x1, 10, 355, -1, 33, 1, 3 },
-  { 0x200001, 0x200001, 10, 1781, -1, 12, 1, 3 },
-  { 0x1, 0x21, 10, 1758, -1, 33, 1, 3 },
-  { 0x200001, 0x200001, 10, 1759, -1, 12, 1, 3 },
+  { 0x0, 0x0, 4, 1849, 1193, 0, 1, 135 },
+  { 0x0, 0x0, 4, 1850, 1195, 0, 1, 134 },
+  { 0x0, 0x0, 4, 1851, 1197, 0, 1, 134 },
+  { 0x0, 0x0, 4, 1852, 1199, 0, 1, 134 },
+  { 0x0, 0x0, 4, 1853, 1201, 0, 1, 134 },
+  { 0x0, 0x0, 4, 1854, 1203, 0, 1, 136 },
+  { 0x0, 0x0, 4, 1855, 1205, 0, 1, 136 },
+  { 0x1, 0x1, 4, -1, 1212, 33, 1, 130 },
+  { 0x5, 0x5, 4, 412, 1211, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1221, 33, 1, 130 },
+  { 0x5, 0x5, 4, 413, 1220, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1230, 33, 1, 130 },
+  { 0x5, 0x5, 4, 414, 1229, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1234, 32, 1, 125 },
+  { 0x1, 0x1, 4, -1, 1241, 33, 1, 130 },
+  { 0x5, 0x5, 4, 415, 1240, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1250, 33, 1, 130 },
+  { 0x5, 0x5, 4, 416, 1249, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1259, 33, 1, 130 },
+  { 0x5, 0x5, 4, 417, 1258, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1268, 33, 1, 130 },
+  { 0x5, 0x5, 4, 418, 1267, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1277, 33, 1, 130 },
+  { 0x5, 0x5, 4, 419, 1276, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1286, 33, 1, 130 },
+  { 0x5, 0x5, 4, 420, 1285, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1296, 33, 1, 130 },
+  { 0x5, 0x5, 4, 887, 1294, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1306, 33, 1, 130 },
+  { 0x5, 0x5, 4, 888, 1304, 32, 1, 124 },
+  { 0x1, 0x1, 4, -1, 1316, 33, 1, 130 },
+  { 0x5, 0x5, 4, 889, 1314, 32, 1, 124 },
+  { 0x1, 0x21, 10, 1747, -1, 33, 1, 3 },
+  { 0x200001, 0x200001, 10, 1748, -1, 12, 1, 3 },
+  { 0x0, 0x0, 10, 1749, -1, 0, 1, 3 },
+  { 0x1, 0x1, 10, 1750, -1, 12, 1, 3 },
+  { 0x1, 0x1, 10, 1751, -1, 33, 1, 3 },
+  { 0x200001, 0x200001, 10, 1752, -1, 12, 1, 3 },
+  { 0x0, 0x0, 10, 350, -1, 0, 1, 3 },
+  { 0x1, 0x1, 10, 1778, -1, 12, 1, 3 },
+  { 0x1, 0x1, 10, 354, -1, 33, 1, 3 },
+  { 0x200001, 0x200001, 10, 1780, -1, 12, 1, 3 },
+  { 0x1, 0x21, 10, 1757, -1, 33, 1, 3 },
+  { 0x200001, 0x200001, 10, 1758, -1, 12, 1, 3 },
+  { 0x0, 0x0, 10, -1, 1787, 0, 0, -1 },
   { 0x0, 0x0, 10, -1, 1788, 0, 0, -1 },
   { 0x0, 0x0, 10, -1, 1789, 0, 0, -1 },
   { 0x0, 0x0, 10, -1, 1790, 0, 0, -1 },
@@ -2059,19 +2111,19 @@
   { 0x0, 0x0, 10, -1, 1796, 0, 0, -1 },
   { 0x0, 0x0, 10, -1, 1797, 0, 0, -1 },
   { 0x0, 0x0, 10, -1, 1798, 0, 0, -1 },
-  { 0x0, 0x0, 10, -1, 1799, 0, 0, -1 },
-  { 0x1, 0x21, 10, 1760, -1, 33, 1, 3 },
-  { 0x200001, 0x200001, 10, 1761, -1, 12, 1, 3 },
-  { 0x0, 0x0, 10, 1762, -1, 0, 1, 3 },
-  { 0x1, 0x1, 10, 1763, -1, 12, 1, 3 },
-  { 0x1, 0x1, 10, 1764, -1, 33, 1, 3 },
-  { 0x200001, 0x200001, 10, 1765, -1, 12, 1, 3 },
-  { 0x0, 0x0, 10, 375, -1, 0, 1, 3 },
-  { 0x1, 0x1, 10, 1803, -1, 12, 1, 3 },
-  { 0x1, 0x1, 10, 379, -1, 33, 1, 3 },
-  { 0x200001, 0x200001, 10, 1805, -1, 12, 1, 3 },
-  { 0x1, 0x21, 10, 1770, -1, 33, 1, 3 },
-  { 0x200001, 0x200001, 10, 1771, -1, 12, 1, 3 },
+  { 0x1, 0x21, 10, 1759, -1, 33, 1, 3 },
+  { 0x200001, 0x200001, 10, 1760, -1, 12, 1, 3 },
+  { 0x0, 0x0, 10, 1761, -1, 0, 1, 3 },
+  { 0x1, 0x1, 10, 1762, -1, 12, 1, 3 },
+  { 0x1, 0x1, 10, 1763, -1, 33, 1, 3 },
+  { 0x200001, 0x200001, 10, 1764, -1, 12, 1, 3 },
+  { 0x0, 0x0, 10, 374, -1, 0, 1, 3 },
+  { 0x1, 0x1, 10, 1802, -1, 12, 1, 3 },
+  { 0x1, 0x1, 10, 378, -1, 33, 1, 3 },
+  { 0x200001, 0x200001, 10, 1804, -1, 12, 1, 3 },
+  { 0x1, 0x21, 10, 1769, -1, 33, 1, 3 },
+  { 0x200001, 0x200001, 10, 1770, -1, 12, 1, 3 },
+  { 0x0, 0x0, 10, -1, 1811, 0, 0, -1 },
   { 0x0, 0x0, 10, -1, 1812, 0, 0, -1 },
   { 0x0, 0x0, 10, -1, 1813, 0, 0, -1 },
   { 0x0, 0x0, 10, -1, 1814, 0, 0, -1 },
@@ -2083,86 +2135,86 @@
   { 0x0, 0x0, 10, -1, 1820, 0, 0, -1 },
   { 0x0, 0x0, 10, -1, 1821, 0, 0, -1 },
   { 0x0, 0x0, 10, -1, 1822, 0, 0, -1 },
+  { 0x1, 0x1, 10, 1771, -1, 36, 1, 3 },
+  { 0x1000001, 0x1000001, 10, 1772, -1, 12, 1, 3 },
   { 0x0, 0x0, 10, -1, 1823, 0, 0, -1 },
-  { 0x1, 0x1, 10, 1772, -1, 36, 1, 3 },
-  { 0x1000001, 0x1000001, 10, 1773, -1, 12, 1, 3 },
-  { 0x0, 0x0, 10, -1, 1824, 0, 0, -1 },
-  { 0x0, 0x0, 10, -1, 1826, 0, 0, -1 },
-  { 0x1, 0x1, 10, 1774, -1, 36, 1, 3 },
-  { 0x1000001, 0x1000001, 10, 1775, -1, 12, 1, 3 },
-  { 0x0, 0x0, 10, -1, 1828, 0, 0, -1 },
-  { 0x0, 0x0, 10, -1, 1830, 0, 0, -1 },
+  { 0x0, 0x0, 10, -1, 1825, 0, 0, -1 },
+  { 0x1, 0x1, 10, 1773, -1, 36, 1, 3 },
+  { 0x1000001, 0x1000001, 10, 1774, -1, 12, 1, 3 },
+  { 0x0, 0x0, 10, -1, 1827, 0, 0, -1 },
+  { 0x0, 0x0, 10, -1, 1829, 0, 0, -1 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x0, 0x0, 11, 1776, -1, 0, 1, 3 },
-  { 0x1, 0x1, 11, 1777, -1, 12, 1, 3 },
+  { 0x0, 0x0, 11, 1775, -1, 0, 1, 3 },
+  { 0x1, 0x1, 11, 1776, -1, 12, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x1, 0x1, 11, 1754, -1, 12, 1, 3 },
+  { 0x1, 0x1, 11, 1753, -1, 12, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x0, 0x0, 11, 293, -1, 0, 1, 3 },
+  { 0x0, 0x0, 11, 292, -1, 0, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x200001, 0x200001, 11, 1756, -1, 12, 1, 3 },
+  { 0x200001, 0x200001, 11, 1755, -1, 12, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x1, 0x1, 11, 295, -1, 33, 1, 3 },
-  { 0x0, 0x0, 11, 1782, -1, 0, 1, 3 },
-  { 0x1, 0x1, 11, 1783, -1, 12, 1, 3 },
-  { 0x1, 0x1, 11, 1784, -1, 33, 1, 3 },
-  { 0x200001, 0x200001, 11, 1785, -1, 12, 1, 3 },
+  { 0x1, 0x1, 11, 294, -1, 33, 1, 3 },
+  { 0x0, 0x0, 11, 1781, -1, 0, 1, 3 },
+  { 0x1, 0x1, 11, 1782, -1, 12, 1, 3 },
+  { 0x1, 0x1, 11, 1783, -1, 33, 1, 3 },
+  { 0x200001, 0x200001, 11, 1784, -1, 12, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x0, 0x0, 11, 1786, -1, 0, 1, 3 },
-  { 0x1, 0x1, 11, 1787, -1, 12, 1, 3 },
+  { 0x0, 0x0, 11, 1785, -1, 0, 1, 3 },
+  { 0x1, 0x1, 11, 1786, -1, 12, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x0, 0x0, 11, 1800, -1, 0, 1, 3 },
-  { 0x1, 0x1, 11, 1801, -1, 12, 1, 3 },
+  { 0x0, 0x0, 11, 1799, -1, 0, 1, 3 },
+  { 0x1, 0x1, 11, 1800, -1, 12, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x1, 0x1, 11, 1766, -1, 12, 1, 3 },
+  { 0x1, 0x1, 11, 1765, -1, 12, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x0, 0x0, 11, 317, -1, 0, 1, 3 },
+  { 0x0, 0x0, 11, 316, -1, 0, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x200001, 0x200001, 11, 1768, -1, 12, 1, 3 },
+  { 0x200001, 0x200001, 11, 1767, -1, 12, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x1, 0x1, 11, 319, -1, 33, 1, 3 },
-  { 0x0, 0x0, 11, 1806, -1, 0, 1, 3 },
-  { 0x1, 0x1, 11, 1807, -1, 12, 1, 3 },
-  { 0x1, 0x1, 11, 1808, -1, 33, 1, 3 },
-  { 0x200001, 0x200001, 11, 1809, -1, 12, 1, 3 },
+  { 0x1, 0x1, 11, 318, -1, 33, 1, 3 },
+  { 0x0, 0x0, 11, 1805, -1, 0, 1, 3 },
+  { 0x1, 0x1, 11, 1806, -1, 12, 1, 3 },
+  { 0x1, 0x1, 11, 1807, -1, 33, 1, 3 },
+  { 0x200001, 0x200001, 11, 1808, -1, 12, 1, 3 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
   { 0x2, 0x3, 11, -1, -1, 37, 1, 5 },
-  { 0x0, 0x0, 11, 1810, -1, 0, 1, 3 },
-  { 0x1, 0x1, 11, 1811, -1, 12, 1, 3 },
+  { 0x0, 0x0, 11, 1809, -1, 0, 1, 3 },
+  { 0x1, 0x1, 11, 1810, -1, 12, 1, 3 },
   { 0x1, 0x1, 11, -1, -1, 36, 1, 5 },
   { 0x1, 0x1, 11, -1, -1, 36, 1, 5 },
-  { 0x1, 0x1, 11, 1825, -1, 36, 1, 3 },
-  { 0x1000001, 0x1000001, 11, 1827, -1, 12, 1, 3 },
+  { 0x1, 0x1, 11, 1824, -1, 36, 1, 3 },
+  { 0x1000001, 0x1000001, 11, 1826, -1, 12, 1, 3 },
   { 0x1, 0x1, 11, -1, -1, 36, 1, 5 },
   { 0x1, 0x1, 11, -1, -1, 36, 1, 5 },
-  { 0x1, 0x1, 11, 1829, -1, 36, 1, 3 },
-  { 0x1000001, 0x1000001, 11, 1831, -1, 12, 1, 3 },
+  { 0x1, 0x1, 11, 1828, -1, 36, 1, 3 },
+  { 0x1000001, 0x1000001, 11, 1830, -1, 12, 1, 3 },
   { 0x0, 0x0, 12, -1, -1, 0, 1, 14 },
   { 0x0, 0x0, 12, -1, -1, 0, 1, 14 },
   { 0x0, 0x0, 12, -1, -1, 0, 1, 14 },
-  { 0x1, 0x1, 13, 262, 1211, 34, 1, 124 },
-  { 0x1, 0x1, 13, 264, 1220, 34, 1, 124 },
-  { 0x1, 0x1, 13, 266, 1229, 34, 1, 124 },
-  { 0x1, 0x1, 13, 269, 1240, 34, 1, 124 },
-  { 0x1, 0x1, 13, 271, 1249, 34, 1, 124 },
-  { 0x1, 0x1, 13, 273, 1258, 34, 1, 124 },
-  { 0x1, 0x1, 13, 275, 1267, 34, 1, 124 },
-  { 0x1, 0x1, 13, 277, 1276, 34, 1, 124 },
-  { 0x1, 0x1, 13, 279, 1285, 34, 1, 124 },
-  { 0x1, 0x1, 13, 281, 1294, 34, 1, 124 },
-  { 0x1, 0x1, 13, 283, 1304, 34, 1, 124 },
-  { 0x1, 0x1, 13, 285, 1314, 34, 1, 124 },
+  { 0x1, 0x1, 13, 261, 1210, 34, 1, 124 },
+  { 0x1, 0x1, 13, 263, 1219, 34, 1, 124 },
+  { 0x1, 0x1, 13, 265, 1228, 34, 1, 124 },
+  { 0x1, 0x1, 13, 268, 1239, 34, 1, 124 },
+  { 0x1, 0x1, 13, 270, 1248, 34, 1, 124 },
+  { 0x1, 0x1, 13, 272, 1257, 34, 1, 124 },
+  { 0x1, 0x1, 13, 274, 1266, 34, 1, 124 },
+  { 0x1, 0x1, 13, 276, 1275, 34, 1, 124 },
+  { 0x1, 0x1, 13, 278, 1284, 34, 1, 124 },
+  { 0x1, 0x1, 13, 280, 1293, 34, 1, 124 },
+  { 0x1, 0x1, 13, 282, 1303, 34, 1, 124 },
+  { 0x1, 0x1, 13, 284, 1313, 34, 1, 124 },
+  { 0x0, 0x0, 19, -1, 655, 0, 0, -1 },
   { 0x0, 0x0, 19, -1, 656, 0, 0, -1 },
   { 0x0, 0x0, 19, -1, 657, 0, 0, -1 },
   { 0x0, 0x0, 19, -1, 658, 0, 0, -1 },
@@ -2192,20 +2244,19 @@
   { 0x0, 0x0, 19, -1, 682, 0, 0, -1 },
   { 0x0, 0x0, 19, -1, 683, 0, 0, -1 },
   { 0x0, 0x0, 19, -1, 684, 0, 0, -1 },
-  { 0x0, 0x0, 19, -1, 685, 0, 0, -1 },
+  { 0x0, 0x0, 20, -1, 2362, 0, 0, -1 },
   { 0x0, 0x0, 20, -1, 2363, 0, 0, -1 },
-  { 0x0, 0x0, 20, -1, 2364, 0, 0, -1 },
+  { 0x0, 0x0, 20, -1, 2378, 0, 0, -1 },
   { 0x0, 0x0, 20, -1, 2379, 0, 0, -1 },
-  { 0x0, 0x0, 20, -1, 2380, 0, 0, -1 },
+  { 0x0, 0x0, 20, -1, 2384, 0, 0, -1 },
   { 0x0, 0x0, 20, -1, 2385, 0, 0, -1 },
-  { 0x0, 0x0, 20, -1, 2386, 0, 0, -1 },
-  { 0x0, 0x0, 21, 692, 2375, 0, 0, -1 },
-  { 0x0, 0x0, 21, 693, 2377, 0, 0, -1 },
+  { 0x0, 0x0, 21, 691, 2374, 0, 0, -1 },
+  { 0x0, 0x0, 21, 692, 2376, 0, 0, -1 },
+  { 0x0, 0x0, 23, -1, 2372, 0, 0, -1 },
   { 0x0, 0x0, 23, -1, 2373, 0, 0, -1 },
-  { 0x0, 0x0, 23, -1, 2374, 0, 0, -1 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 6 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 6 },
-  { 0x1, 0x1, 24, 1055, -1, 35, 1, 6 },
+  { 0x1, 0x1, 24, 1054, -1, 35, 1, 6 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 6 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 6 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 6 },
@@ -2268,7 +2319,7 @@
   { 0x1, 0x1, 24, -1, -1, 35, 1, 15 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 17 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 17 },
-  { 0x1, 0x1, 24, 1076, -1, 35, 1, 17 },
+  { 0x1, 0x1, 24, 1075, -1, 35, 1, 17 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 17 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 17 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 17 },
@@ -2367,7 +2418,7 @@
   { 0x1, 0x1, 24, -1, -1, 35, 1, 21 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 17 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 17 },
-  { 0x1, 0x1, 24, 1109, -1, 35, 1, 17 },
+  { 0x1, 0x1, 24, 1108, -1, 35, 1, 17 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 17 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 17 },
   { 0x1, 0x1, 24, -1, -1, 35, 1, 17 },
@@ -2406,304 +2457,304 @@
   { 0x1, 0x1, 24, -1, -1, 35, 1, 21 },
   { 0x1, 0x1, 24, -1, -1, 33, 1, 76 },
   { 0x1, 0x1, 24, -1, -1, 33, 1, 76 },
-  { 0x1, 0x1, 24, 1125, 1214, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1126, 1223, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1127, 1232, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1128, 1243, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1129, 1252, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1130, 1261, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1131, 1270, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1132, 1279, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1133, 1288, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1134, 1298, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1135, 1308, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1136, 1318, 35, 1, 130 },
-  { 0x1, 0x1, 24, 1137, 1327, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1138, 1333, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1139, 1339, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1140, 1345, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1141, 1351, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1142, 1357, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1143, 1363, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1144, 1369, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1145, 1375, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1146, 1381, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1147, 1387, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1148, 1393, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1149, 1399, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1150, 1405, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1151, 1411, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1152, 1417, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1153, 1423, 35, 1, 144 },
-  { 0x1, 0x1, 24, 1154, 1429, 35, 1, 144 },
-  { 0x0, 0x0, 33, 2357, 2355, 0, 0, -1 },
-  { 0x0, 0x0, 33, 2360, 2358, 0, 0, -1 },
-  { 0x0, 0x0, 33, 2366, 2365, 0, 0, -1 },
-  { 0x0, 0x0, 33, 2368, 2367, 0, 0, -1 },
-  { 0x0, 0x0, 33, 2382, 2381, 0, 0, -1 },
-  { 0x0, 0x0, 33, 2384, 2383, 0, 0, -1 },
-  { 0x0, 0x0, 35, -1, 2376, 0, 0, -1 },
-  { 0x0, 0x0, 35, -1, 2378, 0, 0, -1 },
-  { 0x1, 0x1, 38, -1, 1922, 37, 1, 29 },
-  { 0x1, 0x1, 38, -1, 1957, 37, 1, 29 },
-  { 0x0, 0x0, 38, -1, 1960, 0, 0, -1 },
+  { 0x1, 0x1, 24, 1124, 1213, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1125, 1222, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1126, 1231, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1127, 1242, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1128, 1251, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1129, 1260, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1130, 1269, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1131, 1278, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1132, 1287, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1133, 1297, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1134, 1307, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1135, 1317, 35, 1, 130 },
+  { 0x1, 0x1, 24, 1136, 1326, 35, 1, 144 },
+  { 0x1, 0x1, 24, 1137, 1332, 35, 1, 149 },
+  { 0x1, 0x1, 24, 1138, 1338, 35, 1, 149 },
+  { 0x1, 0x1, 24, 1139, 1344, 35, 1, 144 },
+  { 0x1, 0x1, 24, 1140, 1350, 35, 1, 149 },
+  { 0x1, 0x1, 24, 1141, 1356, 35, 1, 149 },
+  { 0x1, 0x1, 24, 1142, 1362, 35, 1, 144 },
+  { 0x1, 0x1, 24, 1143, 1368, 35, 1, 149 },
+  { 0x1, 0x1, 24, 1144, 1374, 35, 1, 149 },
+  { 0x1, 0x1, 24, 1145, 1380, 35, 1, 144 },
+  { 0x1, 0x1, 24, 1146, 1386, 35, 1, 149 },
+  { 0x1, 0x1, 24, 1147, 1392, 35, 1, 144 },
+  { 0x1, 0x1, 24, 1148, 1398, 35, 1, 149 },
+  { 0x1, 0x1, 24, 1149, 1404, 35, 1, 144 },
+  { 0x1, 0x1, 24, 1150, 1410, 35, 1, 149 },
+  { 0x1, 0x1, 24, 1151, 1416, 35, 1, 144 },
+  { 0x1, 0x1, 24, 1152, 1422, 35, 1, 149 },
+  { 0x1, 0x1, 24, 1153, 1428, 35, 1, 149 },
+  { 0x0, 0x0, 33, 2356, 2354, 0, 0, -1 },
+  { 0x0, 0x0, 33, 2359, 2357, 0, 0, -1 },
+  { 0x0, 0x0, 33, 2365, 2364, 0, 0, -1 },
+  { 0x0, 0x0, 33, 2367, 2366, 0, 0, -1 },
+  { 0x0, 0x0, 33, 2381, 2380, 0, 0, -1 },
+  { 0x0, 0x0, 33, 2383, 2382, 0, 0, -1 },
+  { 0x0, 0x0, 35, -1, 2375, 0, 0, -1 },
+  { 0x0, 0x0, 35, -1, 2377, 0, 0, -1 },
+  { 0x1, 0x1, 38, -1, 1921, 37, 1, 29 },
+  { 0x1, 0x1, 38, -1, 1956, 37, 1, 29 },
+  { 0x0, 0x0, 38, -1, 1959, 0, 0, -1 },
   { 0x1, 0x1, 38, -1, -1, 37, 1, 29 },
-  { 0x1, 0x1, 38, -1, 1965, 37, 1, 29 },
-  { 0x0, 0x0, 38, -1, 1968, 0, 0, -1 },
+  { 0x1, 0x1, 38, -1, 1964, 37, 1, 29 },
+  { 0x0, 0x0, 38, -1, 1967, 0, 0, -1 },
   { 0x1, 0x1, 38, -1, -1, 37, 1, 29 },
-  { 0x0, 0x0, 38, -1, 1971, 0, 0, -1 },
+  { 0x0, 0x0, 38, -1, 1970, 0, 0, -1 },
   { 0x1, 0x1, 38, -1, -1, 37, 1, 29 },
-  { 0x1, 0x1, 38, -1, 1974, 37, 1, 29 },
-  { 0x1, 0x1, 38, -1, 1977, 37, 1, 29 },
-  { 0x1, 0x1, 38, -1, 2010, 37, 1, 29 },
+  { 0x1, 0x1, 38, -1, 1973, 37, 1, 29 },
+  { 0x1, 0x1, 38, -1, 1976, 37, 1, 29 },
+  { 0x1, 0x1, 38, -1, 2009, 37, 1, 29 },
   { 0x3, 0x3, 38, -1, -1, 30, 1, 137 },
-  { 0x0, 0x0, 38, 960, -1, 0, 1, 95 },
+  { 0x0, 0x0, 38, 959, -1, 0, 1, 95 },
   { 0x0, 0x0, 38, -1, -1, 0, 1, 104 },
-  { 0x0, 0x0, 38, 966, -1, 0, 1, 116 },
-  { 0x3, 0x3, 38, -1, -1, 30, 1, 150 },
-  { 0x0, 0x0, 38, 967, -1, 0, 1, 40 },
-  { 0x0, 0x0, 40, -1, 825, 0, 0, -1 },
-  { 0x0, 0x0, 40, -1, 833, 0, 0, -1 },
-  { 0x0, 0x0, 40, 969, 829, 0, 0, -1 },
-  { 0x3, 0x3, 40, -1, 483, 33, 1, 6 },
-  { 0x18000001, 0x18000001, 40, -1, 491, 6, 1, 7 },
-  { 0x3, 0x3, 40, 970, 487, 33, 1, 6 },
-  { 0x0, 0x0, 40, -1, 837, 0, 0, -1 },
-  { 0x3, 0x3, 40, -1, 503, 33, 1, 8 },
-  { 0x0, 0x0, 40, -1, 841, 0, 0, -1 },
-  { 0x3, 0x3, 40, -1, 515, 33, 1, 15 },
-  { 0x0, 0x0, 40, -1, 846, 0, 0, -1 },
-  { 0x0, 0x0, 40, -1, 850, 0, 0, -1 },
-  { 0x3, 0x3, 40, -1, 538, 33, 1, 17 },
-  { 0x3, 0x3, 40, -1, 542, 33, 1, 17 },
-  { 0x0, 0x0, 40, -1, 854, 0, 0, -1 },
-  { 0x0, 0x0, 40, -1, 858, 0, 0, -1 },
-  { 0x3, 0x3, 40, -1, 562, 33, 1, 18 },
-  { 0x18000001, 0x18000001, 40, -1, 566, 6, 1, 18 },
-  { 0x0, 0x0, 40, -1, 862, 0, 0, -1 },
-  { 0x3, 0x3, 40, -1, 578, 33, 1, 19 },
-  { 0x0, 0x0, 40, -1, 866, 0, 0, -1 },
-  { 0x0, 0x0, 40, -1, 870, 0, 0, -1 },
-  { 0x3, 0x3, 40, -1, 598, 33, 1, 20 },
-  { 0x18000001, 0x18000001, 40, -1, 602, 6, 1, 20 },
-  { 0x0, 0x0, 40, -1, 874, 0, 0, -1 },
-  { 0x3, 0x3, 40, -1, 614, 33, 1, 21 },
-  { 0x0, 0x0, 40, -1, 879, 0, 0, -1 },
-  { 0x0, 0x0, 40, -1, 883, 0, 0, -1 },
-  { 0x3, 0x3, 40, -1, 637, 33, 1, 17 },
-  { 0x3, 0x3, 40, -1, 641, 33, 1, 17 },
-  { 0x0, 0x0, 40, -1, 887, 0, 0, -1 },
-  { 0x3, 0x3, 40, -1, 653, 33, 1, 21 },
-  { 0x0, 0x0, 41, 712, 824, 0, 0, -1 },
-  { 0x0, 0x0, 41, 713, 832, 0, 0, -1 },
-  { 0x0, 0x0, 41, 714, 828, 0, 0, -1 },
-  { 0x1, 0x1, 41, 715, 482, 34, 1, 6 },
-  { 0x10000001, 0x10000001, 41, 716, 490, 6, 1, 7 },
-  { 0x1, 0x1, 41, 717, 486, 34, 1, 6 },
-  { 0x0, 0x0, 41, 718, 836, 0, 0, -1 },
-  { 0x1, 0x1, 41, 719, 502, 34, 1, 8 },
-  { 0x0, 0x0, 41, 720, 840, 0, 0, -1 },
-  { 0x1, 0x1, 41, 721, 514, 34, 1, 15 },
-  { 0x0, 0x0, 41, 722, 845, 0, 0, -1 },
-  { 0x0, 0x0, 41, 723, 849, 0, 0, -1 },
-  { 0x1, 0x1, 41, 724, 537, 34, 1, 17 },
-  { 0x1, 0x1, 41, 725, 541, 34, 1, 17 },
-  { 0x0, 0x0, 41, 726, 853, 0, 0, -1 },
-  { 0x0, 0x0, 41, 727, 857, 0, 0, -1 },
-  { 0x1, 0x1, 41, 728, 561, 34, 1, 18 },
-  { 0x10000001, 0x10000001, 41, 729, 565, 6, 1, 18 },
-  { 0x0, 0x0, 41, 730, 861, 0, 0, -1 },
-  { 0x1, 0x1, 41, 731, 577, 34, 1, 19 },
-  { 0x0, 0x0, 41, 732, 865, 0, 0, -1 },
-  { 0x0, 0x0, 41, 733, 869, 0, 0, -1 },
-  { 0x1, 0x1, 41, 734, 597, 34, 1, 20 },
-  { 0x10000001, 0x10000001, 41, 735, 601, 6, 1, 20 },
-  { 0x0, 0x0, 41, 736, 873, 0, 0, -1 },
-  { 0x1, 0x1, 41, 737, 613, 34, 1, 21 },
-  { 0x0, 0x0, 41, 738, 878, 0, 0, -1 },
-  { 0x0, 0x0, 41, 739, 882, 0, 0, -1 },
-  { 0x1, 0x1, 41, 740, 636, 34, 1, 17 },
-  { 0x1, 0x1, 41, 741, 640, 34, 1, 17 },
-  { 0x0, 0x0, 41, 742, 886, 0, 0, -1 },
-  { 0x1, 0x1, 41, 743, 652, 34, 1, 21 },
-  { 0x800001, 0x800001, 41, -1, 974, 4, 1, 16 },
-  { 0x1, 0x1, 41, 1868, 972, 4, 1, 16 },
-  { 0x1, 0x1, 41, 809, 977, 4, 1, 22 },
-  { 0x2, 0x3, 41, -1, 982, 20, 1, 67 },
-  { 0x1, 0x1, 41, 1869, 980, 21, 1, 67 },
+  { 0x0, 0x0, 38, 965, -1, 0, 1, 116 },
+  { 0x3, 0x3, 38, -1, -1, 30, 1, 155 },
+  { 0x0, 0x0, 38, 966, -1, 0, 1, 40 },
+  { 0x0, 0x0, 40, -1, 824, 0, 0, -1 },
+  { 0x0, 0x0, 40, -1, 832, 0, 0, -1 },
+  { 0x0, 0x0, 40, 968, 828, 0, 0, -1 },
+  { 0x3, 0x3, 40, -1, 482, 33, 1, 6 },
+  { 0x18000001, 0x18000001, 40, -1, 490, 6, 1, 7 },
+  { 0x3, 0x3, 40, 969, 486, 33, 1, 6 },
+  { 0x0, 0x0, 40, -1, 836, 0, 0, -1 },
+  { 0x3, 0x3, 40, -1, 502, 33, 1, 8 },
+  { 0x0, 0x0, 40, -1, 840, 0, 0, -1 },
+  { 0x3, 0x3, 40, -1, 514, 33, 1, 15 },
+  { 0x0, 0x0, 40, -1, 845, 0, 0, -1 },
+  { 0x0, 0x0, 40, -1, 849, 0, 0, -1 },
+  { 0x3, 0x3, 40, -1, 537, 33, 1, 17 },
+  { 0x3, 0x3, 40, -1, 541, 33, 1, 17 },
+  { 0x0, 0x0, 40, -1, 853, 0, 0, -1 },
+  { 0x0, 0x0, 40, -1, 857, 0, 0, -1 },
+  { 0x3, 0x3, 40, -1, 561, 33, 1, 18 },
+  { 0x18000001, 0x18000001, 40, -1, 565, 6, 1, 18 },
+  { 0x0, 0x0, 40, -1, 861, 0, 0, -1 },
+  { 0x3, 0x3, 40, -1, 577, 33, 1, 19 },
+  { 0x0, 0x0, 40, -1, 865, 0, 0, -1 },
+  { 0x0, 0x0, 40, -1, 869, 0, 0, -1 },
+  { 0x3, 0x3, 40, -1, 597, 33, 1, 20 },
+  { 0x18000001, 0x18000001, 40, -1, 601, 6, 1, 20 },
+  { 0x0, 0x0, 40, -1, 873, 0, 0, -1 },
+  { 0x3, 0x3, 40, -1, 613, 33, 1, 21 },
+  { 0x0, 0x0, 40, -1, 878, 0, 0, -1 },
+  { 0x0, 0x0, 40, -1, 882, 0, 0, -1 },
+  { 0x3, 0x3, 40, -1, 636, 33, 1, 17 },
+  { 0x3, 0x3, 40, -1, 640, 33, 1, 17 },
+  { 0x0, 0x0, 40, -1, 886, 0, 0, -1 },
+  { 0x3, 0x3, 40, -1, 652, 33, 1, 21 },
+  { 0x0, 0x0, 41, 711, 823, 0, 0, -1 },
+  { 0x0, 0x0, 41, 712, 831, 0, 0, -1 },
+  { 0x0, 0x0, 41, 713, 827, 0, 0, -1 },
+  { 0x1, 0x1, 41, 714, 481, 34, 1, 6 },
+  { 0x10000001, 0x10000001, 41, 715, 489, 6, 1, 7 },
+  { 0x1, 0x1, 41, 716, 485, 34, 1, 6 },
+  { 0x0, 0x0, 41, 717, 835, 0, 0, -1 },
+  { 0x1, 0x1, 41, 718, 501, 34, 1, 8 },
+  { 0x0, 0x0, 41, 719, 839, 0, 0, -1 },
+  { 0x1, 0x1, 41, 720, 513, 34, 1, 15 },
+  { 0x0, 0x0, 41, 721, 844, 0, 0, -1 },
+  { 0x0, 0x0, 41, 722, 848, 0, 0, -1 },
+  { 0x1, 0x1, 41, 723, 536, 34, 1, 17 },
+  { 0x1, 0x1, 41, 724, 540, 34, 1, 17 },
+  { 0x0, 0x0, 41, 725, 852, 0, 0, -1 },
+  { 0x0, 0x0, 41, 726, 856, 0, 0, -1 },
+  { 0x1, 0x1, 41, 727, 560, 34, 1, 18 },
+  { 0x10000001, 0x10000001, 41, 728, 564, 6, 1, 18 },
+  { 0x0, 0x0, 41, 729, 860, 0, 0, -1 },
+  { 0x1, 0x1, 41, 730, 576, 34, 1, 19 },
+  { 0x0, 0x0, 41, 731, 864, 0, 0, -1 },
+  { 0x0, 0x0, 41, 732, 868, 0, 0, -1 },
+  { 0x1, 0x1, 41, 733, 596, 34, 1, 20 },
+  { 0x10000001, 0x10000001, 41, 734, 600, 6, 1, 20 },
+  { 0x0, 0x0, 41, 735, 872, 0, 0, -1 },
+  { 0x1, 0x1, 41, 736, 612, 34, 1, 21 },
+  { 0x0, 0x0, 41, 737, 877, 0, 0, -1 },
+  { 0x0, 0x0, 41, 738, 881, 0, 0, -1 },
+  { 0x1, 0x1, 41, 739, 635, 34, 1, 17 },
+  { 0x1, 0x1, 41, 740, 639, 34, 1, 17 },
+  { 0x0, 0x0, 41, 741, 885, 0, 0, -1 },
+  { 0x1, 0x1, 41, 742, 651, 34, 1, 21 },
+  { 0x800001, 0x800001, 41, -1, 973, 4, 1, 16 },
+  { 0x1, 0x1, 41, 1867, 971, 4, 1, 16 },
+  { 0x1, 0x1, 41, 808, 976, 4, 1, 22 },
+  { 0x2, 0x3, 41, -1, 981, 20, 1, 67 },
+  { 0x1, 0x1, 41, 1868, 979, 21, 1, 67 },
   { 0x0, 0x0, 42, -1, -1, 0, 1, 80 },
   { 0x0, 0x0, 42, -1, -1, 0, 1, 80 },
   { 0x0, 0x0, 42, -1, -1, 0, 1, 123 },
-  { 0x1, 0x1, 44, 1155, 286, 38, 1, 1 },
-  { 0x0, 0x0, 44, -1, 345, 0, 0, -1 },
-  { 0x1, 0x1, 44, 1158, 296, 38, 1, 1 },
-  { 0x0, 0x0, 44, -1, 365, 0, 0, -1 },
-  { 0x0, 0x0, 44, -1, 299, 0, 0, -1 },
-  { 0x0, 0x0, 44, -1, 309, 0, 0, -1 },
-  { 0x1, 0x1, 44, 1163, 310, 38, 1, 1 },
-  { 0x0, 0x0, 44, -1, 369, 0, 0, -1 },
-  { 0x1, 0x1, 44, 1166, 320, 38, 1, 1 },
-  { 0x0, 0x0, 44, -1, 389, 0, 0, -1 },
-  { 0x0, 0x0, 44, -1, 323, 0, 0, -1 },
-  { 0x0, 0x0, 44, -1, 333, 0, 0, -1 },
-  { 0x0, 0x0, 44, 1037, 1929, 0, 0, -1 },
-  { 0x0, 0x0, 44, 1038, 2462, 0, 1, 54 },
-  { 0x0, 0x0, 44, 1039, 1981, 0, 0, -1 },
-  { 0x0, 0x0, 44, 1040, -1, 0, 1, 49 },
+  { 0x1, 0x1, 44, 1154, 285, 38, 1, 1 },
+  { 0x0, 0x0, 44, -1, 344, 0, 0, -1 },
+  { 0x1, 0x1, 44, 1157, 295, 38, 1, 1 },
+  { 0x0, 0x0, 44, -1, 364, 0, 0, -1 },
+  { 0x0, 0x0, 44, -1, 298, 0, 0, -1 },
+  { 0x0, 0x0, 44, -1, 308, 0, 0, -1 },
+  { 0x1, 0x1, 44, 1162, 309, 38, 1, 1 },
+  { 0x0, 0x0, 44, -1, 368, 0, 0, -1 },
+  { 0x1, 0x1, 44, 1165, 319, 38, 1, 1 },
+  { 0x0, 0x0, 44, -1, 388, 0, 0, -1 },
+  { 0x0, 0x0, 44, -1, 322, 0, 0, -1 },
+  { 0x0, 0x0, 44, -1, 332, 0, 0, -1 },
+  { 0x0, 0x0, 44, 1036, 1928, 0, 0, -1 },
+  { 0x0, 0x0, 44, 1037, 2461, 0, 1, 54 },
+  { 0x0, 0x0, 44, 1038, 1980, 0, 0, -1 },
+  { 0x0, 0x0, 44, 1039, -1, 0, 1, 49 },
+  { 0x0, 0x0, 44, 941, -1, 0, 1, 0 },
   { 0x0, 0x0, 44, 942, -1, 0, 1, 0 },
   { 0x0, 0x0, 44, 943, -1, 0, 1, 0 },
-  { 0x0, 0x0, 44, 944, -1, 0, 1, 0 },
-  { 0x1, 0x1, 45, -1, 1433, 30, 1, 147 },
-  { 0x1, 0x1, 45, 815, 1432, 30, 1, 146 },
-  { 0x1, 0x1, 45, -1, 1437, 30, 1, 149 },
-  { 0x1, 0x1, 45, 816, 1436, 30, 1, 148 },
-  { 0x1, 0x1, 45, -1, 1441, 30, 1, 149 },
-  { 0x1, 0x1, 45, 817, 1440, 30, 1, 148 },
-  { 0x3, 0x3, 46, -1, 978, 3, 1, 22 },
-  { 0x1, 0x1, 47, 1889, -1, 30, 1, 137 },
-  { 0x1, 0x1, 47, 1920, -1, 30, 1, 150 },
+  { 0x1, 0x1, 45, -1, 1432, 30, 1, 152 },
+  { 0x1, 0x1, 45, 814, 1431, 30, 1, 151 },
+  { 0x1, 0x1, 45, -1, 1436, 30, 1, 154 },
+  { 0x1, 0x1, 45, 815, 1435, 30, 1, 153 },
+  { 0x1, 0x1, 45, -1, 1440, 30, 1, 154 },
+  { 0x1, 0x1, 45, 816, 1439, 30, 1, 153 },
+  { 0x3, 0x3, 46, -1, 977, 3, 1, 22 },
+  { 0x1, 0x1, 47, 1888, -1, 30, 1, 137 },
+  { 0x1, 0x1, 47, 1919, -1, 30, 1, 155 },
   { 0x0, 0x0, 49, -1, -1, 0, 1, 40 },
   { 0x0, 0x0, 49, -1, -1, 0, 1, 40 },
   { 0x0, 0x0, 49, -1, -1, 0, 1, 40 },
-  { 0x1, 0x1, 56, -1, 1434, 31, 1, 147 },
-  { 0x1, 0x1, 56, -1, 1438, 31, 1, 149 },
-  { 0x1, 0x1, 56, -1, 1442, 31, 1, 149 },
+  { 0x1, 0x1, 56, -1, 1433, 31, 1, 152 },
+  { 0x1, 0x1, 56, -1, 1437, 31, 1, 154 },
+  { 0x1, 0x1, 56, -1, 1441, 31, 1, 154 },
   { 0x0, 0x0, 56, -1, -1, 0, 1, 94 },
   { 0x2, 0x3, 56, -1, -1, 27, 1, 94 },
   { 0x1, 0x1, 56, -1, -1, 28, 1, 94 },
-  { 0x0, 0x0, 65, 13, 453, 0, 1, 6 },
-  { 0x0, 0x0, 65, 1056, 456, 0, 1, 6 },
-  { 0x1, 0x1, 65, 1057, 458, 33, 1, 6 },
-  { 0x1, 0x1, 65, 1058, 460, 34, 1, 6 },
-  { 0x3, 0x3, 65, 1059, 462, 33, 1, 6 },
-  { 0x0, 0x0, 65, 1060, 464, 0, 1, 6 },
-  { 0x1, 0x1, 65, 1061, 466, 33, 1, 6 },
-  { 0x1, 0x1, 65, 1062, 468, 34, 1, 6 },
-  { 0x3, 0x3, 65, 1063, 470, 33, 1, 6 },
-  { 0x1, 0x1, 65, 1064, 472, 6, 1, 7 },
-  { 0x8000001, 0x8000001, 65, 1065, 474, 6, 1, 7 },
-  { 0x10000001, 0x10000001, 65, 1066, 476, 6, 1, 7 },
-  { 0x18000001, 0x18000001, 65, 1067, 478, 6, 1, 7 },
-  { 0x0, 0x0, 65, 1068, 492, 0, 1, 8 },
-  { 0x1, 0x1, 65, 1069, 494, 33, 1, 8 },
-  { 0x1, 0x1, 65, 1070, 496, 34, 1, 8 },
-  { 0x3, 0x3, 65, 1071, 498, 33, 1, 8 },
-  { 0x0, 0x0, 65, 1072, 504, 0, 1, 15 },
-  { 0x1, 0x1, 65, 1073, 506, 33, 1, 15 },
-  { 0x1, 0x1, 65, 1074, 508, 34, 1, 15 },
-  { 0x3, 0x3, 65, 1075, 510, 33, 1, 15 },
-  { 0x0, 0x0, 65, 14, 516, 0, 1, 17 },
-  { 0x0, 0x0, 65, 1077, 519, 0, 1, 17 },
-  { 0x1, 0x1, 65, 1078, 521, 33, 1, 17 },
-  { 0x1, 0x1, 65, 1079, 523, 34, 1, 17 },
-  { 0x3, 0x3, 65, 1080, 525, 33, 1, 17 },
-  { 0x0, 0x0, 65, 1081, 527, 0, 1, 17 },
-  { 0x1, 0x1, 65, 1082, 529, 33, 1, 17 },
-  { 0x1, 0x1, 65, 1083, 531, 34, 1, 17 },
-  { 0x3, 0x3, 65, 1084, 533, 33, 1, 17 },
-  { 0x0, 0x0, 65, 1085, 543, 0, 1, 18 },
-  { 0x1, 0x1, 65, 1086, 545, 33, 1, 18 },
-  { 0x1, 0x1, 65, 1087, 547, 34, 1, 18 },
-  { 0x3, 0x3, 65, 1088, 549, 33, 1, 18 },
-  { 0x1, 0x1, 65, 1089, 551, 6, 1, 18 },
-  { 0x8000001, 0x8000001, 65, 1090, 553, 6, 1, 18 },
-  { 0x10000001, 0x10000001, 65, 1091, 555, 6, 1, 18 },
-  { 0x18000001, 0x18000001, 65, 1092, 557, 6, 1, 18 },
-  { 0x0, 0x0, 65, 1093, 567, 0, 1, 19 },
-  { 0x1, 0x1, 65, 1094, 569, 33, 1, 19 },
-  { 0x1, 0x1, 65, 1095, 571, 34, 1, 19 },
-  { 0x3, 0x3, 65, 1096, 573, 33, 1, 19 },
-  { 0x0, 0x0, 65, 1097, 579, 0, 1, 20 },
-  { 0x1, 0x1, 65, 1098, 581, 33, 1, 20 },
-  { 0x1, 0x1, 65, 1099, 583, 34, 1, 20 },
-  { 0x3, 0x3, 65, 1100, 585, 33, 1, 20 },
-  { 0x1, 0x1, 65, 1101, 587, 6, 1, 20 },
-  { 0x8000001, 0x8000001, 65, 1102, 589, 6, 1, 20 },
-  { 0x10000001, 0x10000001, 65, 1103, 591, 6, 1, 20 },
-  { 0x18000001, 0x18000001, 65, 1104, 593, 6, 1, 20 },
-  { 0x0, 0x0, 65, 1105, 603, 0, 1, 21 },
-  { 0x1, 0x1, 65, 1106, 605, 33, 1, 21 },
-  { 0x1, 0x1, 65, 1107, 607, 34, 1, 21 },
-  { 0x3, 0x3, 65, 1108, 609, 33, 1, 21 },
-  { 0x0, 0x0, 65, 16, 615, 0, 1, 17 },
-  { 0x0, 0x0, 65, 1110, 618, 0, 1, 17 },
-  { 0x1, 0x1, 65, 1111, 620, 33, 1, 17 },
-  { 0x1, 0x1, 65, 1112, 622, 34, 1, 17 },
-  { 0x3, 0x3, 65, 1113, 624, 33, 1, 17 },
-  { 0x0, 0x0, 65, 1114, 626, 0, 1, 17 },
-  { 0x1, 0x1, 65, 1115, 628, 33, 1, 17 },
-  { 0x1, 0x1, 65, 1116, 630, 34, 1, 17 },
-  { 0x3, 0x3, 65, 1117, 632, 33, 1, 17 },
-  { 0x0, 0x0, 65, 1118, 642, 0, 1, 21 },
-  { 0x1, 0x1, 65, 1119, 644, 33, 1, 21 },
-  { 0x1, 0x1, 65, 1120, 646, 34, 1, 21 },
-  { 0x3, 0x3, 65, 1121, 648, 33, 1, 21 },
-  { 0x3, 0x3, 66, 422, 1296, 33, 1, 129 },
-  { 0x3, 0x3, 66, 423, 1306, 33, 1, 129 },
-  { 0x3, 0x3, 66, 424, 1316, 33, 1, 129 },
-  { 0x0, 0x0, 66, -1, 1321, 0, 1, 140 },
-  { 0x0, 0x0, 66, -1, 1322, 0, 1, 140 },
-  { 0x0, 0x0, 66, -1, 1323, 0, 1, 140 },
-  { 0x0, 0x0, 107, 898, 1953, 0, 0, -1 },
-  { 0x0, 0x0, 107, 899, 2400, 0, 1, 29 },
-  { 0x0, 0x0, 107, 900, 1994, 0, 0, -1 },
-  { 0x0, 0x0, 107, 901, 2404, 0, 1, 29 },
-  { 0x0, 0x0, 109, -1, 1955, 0, 0, -1 },
-  { 0x1, 0x1, 109, -1, 2401, 27, 1, 29 },
-  { 0x0, 0x0, 109, -1, 1996, 0, 0, -1 },
-  { 0x1, 0x1, 109, -1, 2405, 27, 1, 29 },
-  { 0x0, 0x0, 110, 903, -1, 0, 1, 115 },
+  { 0x0, 0x0, 65, 13, 452, 0, 1, 6 },
+  { 0x0, 0x0, 65, 1055, 455, 0, 1, 6 },
+  { 0x1, 0x1, 65, 1056, 457, 33, 1, 6 },
+  { 0x1, 0x1, 65, 1057, 459, 34, 1, 6 },
+  { 0x3, 0x3, 65, 1058, 461, 33, 1, 6 },
+  { 0x0, 0x0, 65, 1059, 463, 0, 1, 6 },
+  { 0x1, 0x1, 65, 1060, 465, 33, 1, 6 },
+  { 0x1, 0x1, 65, 1061, 467, 34, 1, 6 },
+  { 0x3, 0x3, 65, 1062, 469, 33, 1, 6 },
+  { 0x1, 0x1, 65, 1063, 471, 6, 1, 7 },
+  { 0x8000001, 0x8000001, 65, 1064, 473, 6, 1, 7 },
+  { 0x10000001, 0x10000001, 65, 1065, 475, 6, 1, 7 },
+  { 0x18000001, 0x18000001, 65, 1066, 477, 6, 1, 7 },
+  { 0x0, 0x0, 65, 1067, 491, 0, 1, 8 },
+  { 0x1, 0x1, 65, 1068, 493, 33, 1, 8 },
+  { 0x1, 0x1, 65, 1069, 495, 34, 1, 8 },
+  { 0x3, 0x3, 65, 1070, 497, 33, 1, 8 },
+  { 0x0, 0x0, 65, 1071, 503, 0, 1, 15 },
+  { 0x1, 0x1, 65, 1072, 505, 33, 1, 15 },
+  { 0x1, 0x1, 65, 1073, 507, 34, 1, 15 },
+  { 0x3, 0x3, 65, 1074, 509, 33, 1, 15 },
+  { 0x0, 0x0, 65, 14, 515, 0, 1, 17 },
+  { 0x0, 0x0, 65, 1076, 518, 0, 1, 17 },
+  { 0x1, 0x1, 65, 1077, 520, 33, 1, 17 },
+  { 0x1, 0x1, 65, 1078, 522, 34, 1, 17 },
+  { 0x3, 0x3, 65, 1079, 524, 33, 1, 17 },
+  { 0x0, 0x0, 65, 1080, 526, 0, 1, 17 },
+  { 0x1, 0x1, 65, 1081, 528, 33, 1, 17 },
+  { 0x1, 0x1, 65, 1082, 530, 34, 1, 17 },
+  { 0x3, 0x3, 65, 1083, 532, 33, 1, 17 },
+  { 0x0, 0x0, 65, 1084, 542, 0, 1, 18 },
+  { 0x1, 0x1, 65, 1085, 544, 33, 1, 18 },
+  { 0x1, 0x1, 65, 1086, 546, 34, 1, 18 },
+  { 0x3, 0x3, 65, 1087, 548, 33, 1, 18 },
+  { 0x1, 0x1, 65, 1088, 550, 6, 1, 18 },
+  { 0x8000001, 0x8000001, 65, 1089, 552, 6, 1, 18 },
+  { 0x10000001, 0x10000001, 65, 1090, 554, 6, 1, 18 },
+  { 0x18000001, 0x18000001, 65, 1091, 556, 6, 1, 18 },
+  { 0x0, 0x0, 65, 1092, 566, 0, 1, 19 },
+  { 0x1, 0x1, 65, 1093, 568, 33, 1, 19 },
+  { 0x1, 0x1, 65, 1094, 570, 34, 1, 19 },
+  { 0x3, 0x3, 65, 1095, 572, 33, 1, 19 },
+  { 0x0, 0x0, 65, 1096, 578, 0, 1, 20 },
+  { 0x1, 0x1, 65, 1097, 580, 33, 1, 20 },
+  { 0x1, 0x1, 65, 1098, 582, 34, 1, 20 },
+  { 0x3, 0x3, 65, 1099, 584, 33, 1, 20 },
+  { 0x1, 0x1, 65, 1100, 586, 6, 1, 20 },
+  { 0x8000001, 0x8000001, 65, 1101, 588, 6, 1, 20 },
+  { 0x10000001, 0x10000001, 65, 1102, 590, 6, 1, 20 },
+  { 0x18000001, 0x18000001, 65, 1103, 592, 6, 1, 20 },
+  { 0x0, 0x0, 65, 1104, 602, 0, 1, 21 },
+  { 0x1, 0x1, 65, 1105, 604, 33, 1, 21 },
+  { 0x1, 0x1, 65, 1106, 606, 34, 1, 21 },
+  { 0x3, 0x3, 65, 1107, 608, 33, 1, 21 },
+  { 0x0, 0x0, 65, 16, 614, 0, 1, 17 },
+  { 0x0, 0x0, 65, 1109, 617, 0, 1, 17 },
+  { 0x1, 0x1, 65, 1110, 619, 33, 1, 17 },
+  { 0x1, 0x1, 65, 1111, 621, 34, 1, 17 },
+  { 0x3, 0x3, 65, 1112, 623, 33, 1, 17 },
+  { 0x0, 0x0, 65, 1113, 625, 0, 1, 17 },
+  { 0x1, 0x1, 65, 1114, 627, 33, 1, 17 },
+  { 0x1, 0x1, 65, 1115, 629, 34, 1, 17 },
+  { 0x3, 0x3, 65, 1116, 631, 33, 1, 17 },
+  { 0x0, 0x0, 65, 1117, 641, 0, 1, 21 },
+  { 0x1, 0x1, 65, 1118, 643, 33, 1, 21 },
+  { 0x1, 0x1, 65, 1119, 645, 34, 1, 21 },
+  { 0x3, 0x3, 65, 1120, 647, 33, 1, 21 },
+  { 0x3, 0x3, 66, 421, 1295, 33, 1, 129 },
+  { 0x3, 0x3, 66, 422, 1305, 33, 1, 129 },
+  { 0x3, 0x3, 66, 423, 1315, 33, 1, 129 },
+  { 0x0, 0x0, 66, -1, 1320, 0, 1, 140 },
+  { 0x0, 0x0, 66, -1, 1321, 0, 1, 145 },
+  { 0x0, 0x0, 66, -1, 1322, 0, 1, 145 },
+  { 0x0, 0x0, 107, 897, 1952, 0, 0, -1 },
+  { 0x0, 0x0, 107, 898, 2399, 0, 1, 29 },
+  { 0x0, 0x0, 107, 899, 1993, 0, 0, -1 },
+  { 0x0, 0x0, 107, 900, 2403, 0, 1, 29 },
+  { 0x0, 0x0, 109, -1, 1954, 0, 0, -1 },
+  { 0x1, 0x1, 109, -1, 2400, 27, 1, 29 },
+  { 0x0, 0x0, 109, -1, 1995, 0, 0, -1 },
+  { 0x1, 0x1, 109, -1, 2404, 27, 1, 29 },
+  { 0x0, 0x0, 110, 902, -1, 0, 1, 115 },
   { 0x1, 0x1, 111, -1, -1, 27, 1, 115 },
-  { 0x0, 0x0, 112, 921, 2423, 0, 1, 1 },
-  { 0x0, 0x0, 112, 1024, 290, 0, 0, -1 },
-  { 0x0, 0x0, 112, 1001, 353, 0, 0, -1 },
-  { 0x0, 0x0, 112, -1, 361, 0, 0, -1 },
-  { 0x0, 0x0, 112, 922, 2431, 0, 1, 1 },
-  { 0x0, 0x0, 112, -1, 303, 0, 0, -1 },
-  { 0x0, 0x0, 112, 1029, 304, 0, 0, -1 },
-  { 0x0, 0x0, 112, 923, 2443, 0, 1, 1 },
-  { 0x0, 0x0, 112, 1031, 314, 0, 0, -1 },
-  { 0x0, 0x0, 112, 1008, 377, 0, 0, -1 },
-  { 0x0, 0x0, 112, -1, 385, 0, 0, -1 },
-  { 0x0, 0x0, 112, 1167, 2450, 0, 1, 1 },
-  { 0x0, 0x0, 112, -1, 327, 0, 0, -1 },
-  { 0x0, 0x0, 112, 1036, 328, 0, 0, -1 },
-  { 0x0, 0x0, 112, -1, 1939, 0, 0, -1 },
-  { 0x1, 0x9, 112, -1, 2469, 33, 1, 54 },
-  { 0x2, 0x3, 112, 1180, 1990, 27, 1, 49 },
-  { 0x1, 0x1, 114, 1156, 2424, 37, 1, 1 },
-  { 0x1, 0x1, 114, 1159, 2432, 37, 1, 1 },
-  { 0x1, 0x1, 114, 1164, 2444, 37, 1, 1 },
-  { 0x0, 0x0, 114, -1, 2455, 0, 1, 1 },
-  { 0x0, 0x0, 115, 945, 2421, 0, 1, 1 },
-  { 0x0, 0x0, 115, 1000, 288, 0, 0, -1 },
-  { 0x0, 0x0, 115, -1, 357, 0, 0, -1 },
-  { 0x0, 0x0, 115, 1026, 359, 0, 0, -1 },
-  { 0x0, 0x0, 115, -1, 2430, 0, 1, 1 },
-  { 0x0, 0x0, 115, 1028, 301, 0, 0, -1 },
-  { 0x0, 0x0, 115, 1005, 306, 0, 0, -1 },
-  { 0x0, 0x0, 115, 947, 2441, 0, 1, 1 },
-  { 0x0, 0x0, 115, 1007, 312, 0, 0, -1 },
-  { 0x0, 0x0, 115, -1, 381, 0, 0, -1 },
-  { 0x0, 0x0, 115, 1033, 383, 0, 0, -1 },
-  { 0x0, 0x0, 115, -1, 2449, 0, 1, 1 },
-  { 0x0, 0x0, 115, 1035, 325, 0, 0, -1 },
-  { 0x0, 0x0, 115, 1012, 330, 0, 0, -1 },
-  { 0x0, 0x0, 115, 918, 1937, 0, 0, -1 },
-  { 0x0, 0x0, 115, 919, 2468, 0, 1, 54 },
-  { 0x0, 0x0, 115, 920, 1989, 0, 1, 49 },
+  { 0x0, 0x0, 112, 920, 2422, 0, 1, 1 },
+  { 0x0, 0x0, 112, 1023, 289, 0, 0, -1 },
+  { 0x0, 0x0, 112, 1000, 352, 0, 0, -1 },
+  { 0x0, 0x0, 112, -1, 360, 0, 0, -1 },
+  { 0x0, 0x0, 112, 921, 2430, 0, 1, 1 },
+  { 0x0, 0x0, 112, -1, 302, 0, 0, -1 },
+  { 0x0, 0x0, 112, 1028, 303, 0, 0, -1 },
+  { 0x0, 0x0, 112, 922, 2442, 0, 1, 1 },
+  { 0x0, 0x0, 112, 1030, 313, 0, 0, -1 },
+  { 0x0, 0x0, 112, 1007, 376, 0, 0, -1 },
+  { 0x0, 0x0, 112, -1, 384, 0, 0, -1 },
+  { 0x0, 0x0, 112, 1166, 2449, 0, 1, 1 },
+  { 0x0, 0x0, 112, -1, 326, 0, 0, -1 },
+  { 0x0, 0x0, 112, 1035, 327, 0, 0, -1 },
+  { 0x0, 0x0, 112, -1, 1938, 0, 0, -1 },
+  { 0x1, 0x9, 112, -1, 2468, 33, 1, 54 },
+  { 0x2, 0x3, 112, 1179, 1989, 27, 1, 49 },
+  { 0x1, 0x1, 114, 1155, 2423, 37, 1, 1 },
+  { 0x1, 0x1, 114, 1158, 2431, 37, 1, 1 },
+  { 0x1, 0x1, 114, 1163, 2443, 37, 1, 1 },
+  { 0x0, 0x0, 114, -1, 2454, 0, 1, 1 },
+  { 0x0, 0x0, 115, 944, 2420, 0, 1, 1 },
+  { 0x0, 0x0, 115, 999, 287, 0, 0, -1 },
+  { 0x0, 0x0, 115, -1, 356, 0, 0, -1 },
+  { 0x0, 0x0, 115, 1025, 358, 0, 0, -1 },
+  { 0x0, 0x0, 115, -1, 2429, 0, 1, 1 },
+  { 0x0, 0x0, 115, 1027, 300, 0, 0, -1 },
+  { 0x0, 0x0, 115, 1004, 305, 0, 0, -1 },
+  { 0x0, 0x0, 115, 946, 2440, 0, 1, 1 },
+  { 0x0, 0x0, 115, 1006, 311, 0, 0, -1 },
+  { 0x0, 0x0, 115, -1, 380, 0, 0, -1 },
+  { 0x0, 0x0, 115, 1032, 382, 0, 0, -1 },
+  { 0x0, 0x0, 115, -1, 2448, 0, 1, 1 },
+  { 0x0, 0x0, 115, 1034, 324, 0, 0, -1 },
+  { 0x0, 0x0, 115, 1011, 329, 0, 0, -1 },
+  { 0x0, 0x0, 115, 917, 1936, 0, 0, -1 },
+  { 0x0, 0x0, 115, 918, 2467, 0, 1, 54 },
+  { 0x0, 0x0, 115, 919, 1988, 0, 1, 49 },
   { 0x1, 0x1, 115, -1, -1, 27, 1, 0 },
   { 0x1, 0x1, 115, -1, -1, 27, 1, 0 },
   { 0x1, 0x1, 115, -1, -1, 27, 1, 0 },
-  { 0x1, 0x1, 116, -1, 2422, 37, 1, 1 },
-  { 0x0, 0x0, 116, -1, 2435, 0, 1, 1 },
-  { 0x1, 0x1, 116, -1, 2442, 37, 1, 1 },
-  { 0x0, 0x0, 116, -1, 2454, 0, 1, 1 },
+  { 0x1, 0x1, 116, -1, 2421, 37, 1, 1 },
+  { 0x0, 0x0, 116, -1, 2434, 0, 1, 1 },
+  { 0x1, 0x1, 116, -1, 2441, 37, 1, 1 },
+  { 0x0, 0x0, 116, -1, 2453, 0, 1, 1 },
+  { 0x0, 0x0, 117, 993, -1, 0, 1, 0 },
   { 0x0, 0x0, 117, 994, -1, 0, 1, 0 },
   { 0x0, 0x0, 117, 995, -1, 0, 1, 0 },
-  { 0x0, 0x0, 117, 996, -1, 0, 1, 0 },
-  { 0x3, 0x3, 117, 954, -1, 34, 1, 33 },
-  { 0x3, 0x3, 117, 955, -1, 34, 1, 40 },
+  { 0x3, 0x3, 117, 953, -1, 34, 1, 33 },
+  { 0x3, 0x3, 117, 954, -1, 34, 1, 40 },
   { 0x1, 0x1, 119, -1, -1, 35, 1, 33 },
   { 0x1, 0x1, 119, -1, -1, 35, 1, 40 },
   { 0x0, 0x0, 120, -1, -1, 0, 1, 40 },
@@ -2719,8 +2770,8 @@
   { 0x1, 0x1, 120, -1, -1, 27, 1, 117 },
   { 0x1, 0x1, 120, -1, -1, 27, 1, 40 },
   { 0x0, 0x0, 120, -1, -1, 0, 1, 40 },
-  { 0x0, 0x0, 121, -1, 2356, 0, 0, -1 },
-  { 0x0, 0x0, 121, -1, 2359, 0, 0, -1 },
+  { 0x0, 0x0, 121, -1, 2355, 0, 0, -1 },
+  { 0x0, 0x0, 121, -1, 2358, 0, 0, -1 },
   { 0x1, 0x1, 122, -1, -1, 35, 1, 16 },
   { 0x1, 0x1, 122, -1, -1, 35, 1, 16 },
   { 0x1, 0x1, 122, -1, -1, 35, 1, 16 },
@@ -2733,10 +2784,10 @@
   { 0x1, 0x1, 122, -1, -1, 23, 1, 67 },
   { 0x1, 0x1, 122, -1, -1, 23, 1, 67 },
   { 0x1, 0x1, 122, -1, -1, 23, 1, 67 },
-  { 0x1, 0x1, 122, 779, -1, 23, 1, 67 },
-  { 0x9, 0x9, 122, 780, -1, 20, 1, 67 },
+  { 0x1, 0x1, 122, 778, -1, 23, 1, 67 },
+  { 0x9, 0x9, 122, 779, -1, 20, 1, 67 },
+  { 0x0, 0x0, 126, 1836, -1, 0, 1, 0 },
   { 0x0, 0x0, 126, 1837, -1, 0, 1, 0 },
-  { 0x0, 0x0, 126, 1838, -1, 0, 1, 0 },
   { 0x1, 0x1, 126, -1, -1, 28, 1, 33 },
   { 0x1, 0x1, 126, -1, -1, 27, 1, 33 },
   { 0x1, 0x1, 126, -1, -1, 29, 1, 0 },
@@ -2747,205 +2798,206 @@
   { 0x1, 0x1, 126, -1, -1, 29, 1, 0 },
   { 0x1, 0x1, 126, -1, -1, 29, 1, 0 },
   { 0x1, 0x1, 126, -1, -1, 29, 1, 0 },
-  { 0x0, 0x0, 126, 952, -1, 0, 1, 33 },
-  { 0x0, 0x0, 126, 1046, -1, 0, 1, 40 },
-  { 0x0, 0x0, 140, 1017, 2419, 0, 1, 1 },
-  { 0x0, 0x0, 140, 905, 289, 0, 0, -1 },
-  { 0x0, 0x0, 140, 927, 294, 0, 0, -1 },
-  { 0x0, 0x0, 140, 928, 358, 0, 0, -1 },
-  { 0x0, 0x0, 140, -1, 2429, 0, 1, 1 },
-  { 0x0, 0x0, 140, 930, 300, 0, 0, -1 },
-  { 0x0, 0x0, 140, -1, 307, 0, 0, -1 },
-  { 0x0, 0x0, 140, 1019, 2439, 0, 1, 1 },
-  { 0x0, 0x0, 140, 912, 313, 0, 0, -1 },
-  { 0x0, 0x0, 140, 934, 318, 0, 0, -1 },
-  { 0x0, 0x0, 140, 935, 382, 0, 0, -1 },
-  { 0x0, 0x0, 140, -1, 2448, 0, 1, 1 },
-  { 0x0, 0x0, 140, 937, 324, 0, 0, -1 },
-  { 0x0, 0x0, 140, -1, 331, 0, 0, -1 },
-  { 0x0, 0x0, 140, 2486, 1933, 0, 0, -1 },
-  { 0x1, 0x1, 140, 2487, 2464, 33, 1, 54 },
-  { 0x0, 0x0, 140, 2488, 1983, 0, 0, -1 },
-  { 0x1, 0x1, 140, 2489, -1, 28, 1, 49 },
-  { 0x1, 0x1, 141, -1, 2420, 37, 1, 1 },
-  { 0x0, 0x0, 141, -1, 2434, 0, 1, 1 },
-  { 0x1, 0x1, 141, -1, 2440, 37, 1, 1 },
-  { 0x0, 0x0, 141, -1, 2453, 0, 1, 1 },
-  { 0x1, 0x1, 144, 778, 976, 3, 1, 22 },
-  { 0x0, 0x0, 145, 1839, -1, 0, 1, 33 },
-  { 0x0, 0x0, 146, 784, 2416, 0, 1, 1 },
-  { 0x0, 0x0, 146, -1, 291, 0, 0, -1 },
-  { 0x0, 0x0, 146, 906, 292, 0, 0, -1 },
-  { 0x0, 0x0, 146, 907, 360, 0, 0, -1 },
-  { 0x0, 0x0, 146, 786, 2426, 0, 1, 1 },
-  { 0x0, 0x0, 146, 909, 302, 0, 0, -1 },
-  { 0x0, 0x0, 146, 931, 305, 0, 0, -1 },
-  { 0x0, 0x0, 146, 790, 2436, 0, 1, 1 },
-  { 0x0, 0x0, 146, -1, 315, 0, 0, -1 },
-  { 0x0, 0x0, 146, 913, 316, 0, 0, -1 },
-  { 0x0, 0x0, 146, 914, 384, 0, 0, -1 },
-  { 0x0, 0x0, 146, 792, 2446, 0, 1, 1 },
-  { 0x0, 0x0, 146, 916, 326, 0, 0, -1 },
-  { 0x0, 0x0, 146, 938, 329, 0, 0, -1 },
-  { 0x0, 0x0, 146, 1013, 1931, 0, 0, -1 },
-  { 0x1, 0x1, 146, 1014, 2463, 36, 1, 54 },
-  { 0x0, 0x0, 146, 1015, 1982, 0, 0, -1 },
-  { 0x1, 0x1, 146, 1016, -1, 27, 1, 49 },
-  { 0x1, 0x1, 147, -1, 2418, 37, 1, 1 },
-  { 0x1, 0x1, 147, -1, 2428, 37, 1, 1 },
-  { 0x1, 0x1, 147, -1, 2438, 37, 1, 1 },
-  { 0x0, 0x0, 147, -1, 2452, 0, 1, 1 },
+  { 0x0, 0x0, 126, 951, -1, 0, 1, 33 },
+  { 0x0, 0x0, 126, 1045, -1, 0, 1, 40 },
+  { 0x0, 0x0, 140, 1016, 2418, 0, 1, 1 },
+  { 0x0, 0x0, 140, 904, 288, 0, 0, -1 },
+  { 0x0, 0x0, 140, 926, 293, 0, 0, -1 },
+  { 0x0, 0x0, 140, 927, 357, 0, 0, -1 },
+  { 0x0, 0x0, 140, -1, 2428, 0, 1, 1 },
+  { 0x0, 0x0, 140, 929, 299, 0, 0, -1 },
+  { 0x0, 0x0, 140, -1, 306, 0, 0, -1 },
+  { 0x0, 0x0, 140, 1018, 2438, 0, 1, 1 },
+  { 0x0, 0x0, 140, 911, 312, 0, 0, -1 },
+  { 0x0, 0x0, 140, 933, 317, 0, 0, -1 },
+  { 0x0, 0x0, 140, 934, 381, 0, 0, -1 },
+  { 0x0, 0x0, 140, -1, 2447, 0, 1, 1 },
+  { 0x0, 0x0, 140, 936, 323, 0, 0, -1 },
+  { 0x0, 0x0, 140, -1, 330, 0, 0, -1 },
+  { 0x0, 0x0, 140, 2485, 1932, 0, 0, -1 },
+  { 0x1, 0x1, 140, 2486, 2463, 33, 1, 54 },
+  { 0x0, 0x0, 140, 2487, 1982, 0, 0, -1 },
+  { 0x1, 0x1, 140, 2488, -1, 28, 1, 49 },
+  { 0x1, 0x1, 141, -1, 2419, 37, 1, 1 },
+  { 0x0, 0x0, 141, -1, 2433, 0, 1, 1 },
+  { 0x1, 0x1, 141, -1, 2439, 37, 1, 1 },
+  { 0x0, 0x0, 141, -1, 2452, 0, 1, 1 },
+  { 0x1, 0x1, 144, 777, 975, 3, 1, 22 },
+  { 0x0, 0x0, 145, 1838, -1, 0, 1, 33 },
+  { 0x0, 0x0, 146, 783, 2415, 0, 1, 1 },
+  { 0x0, 0x0, 146, -1, 290, 0, 0, -1 },
+  { 0x0, 0x0, 146, 905, 291, 0, 0, -1 },
+  { 0x0, 0x0, 146, 906, 359, 0, 0, -1 },
+  { 0x0, 0x0, 146, 785, 2425, 0, 1, 1 },
+  { 0x0, 0x0, 146, 908, 301, 0, 0, -1 },
+  { 0x0, 0x0, 146, 930, 304, 0, 0, -1 },
+  { 0x0, 0x0, 146, 789, 2435, 0, 1, 1 },
+  { 0x0, 0x0, 146, -1, 314, 0, 0, -1 },
+  { 0x0, 0x0, 146, 912, 315, 0, 0, -1 },
+  { 0x0, 0x0, 146, 913, 383, 0, 0, -1 },
+  { 0x0, 0x0, 146, 791, 2445, 0, 1, 1 },
+  { 0x0, 0x0, 146, 915, 325, 0, 0, -1 },
+  { 0x0, 0x0, 146, 937, 328, 0, 0, -1 },
+  { 0x0, 0x0, 146, 1012, 1930, 0, 0, -1 },
+  { 0x1, 0x1, 146, 1013, 2462, 36, 1, 54 },
+  { 0x0, 0x0, 146, 1014, 1981, 0, 0, -1 },
+  { 0x1, 0x1, 146, 1015, -1, 27, 1, 49 },
+  { 0x1, 0x1, 147, -1, 2417, 37, 1, 1 },
+  { 0x1, 0x1, 147, -1, 2427, 37, 1, 1 },
+  { 0x1, 0x1, 147, -1, 2437, 37, 1, 1 },
+  { 0x0, 0x0, 147, -1, 2451, 0, 1, 1 },
   { 0x0, 0x0, 148, -1, -1, 0, 1, 33 },
-  { 0x0, 0x0, 148, 953, -1, 0, 1, 40 },
+  { 0x0, 0x0, 148, 952, -1, 0, 1, 40 },
   { 0x0, 0x0, 149, -1, -1, 0, 1, 40 },
   { 0x0, 0x0, 149, -1, -1, 0, 1, 66 },
-  { 0x0, 0x0, 149, -1, 2456, 0, 1, 63 },
+  { 0x0, 0x0, 149, -1, 2455, 0, 1, 63 },
   { 0x0, 0x0, 149, -1, -1, 0, 1, 40 },
   { 0x0, 0x0, 149, -1, -1, 0, 1, 81 },
   { 0x0, 0x0, 149, -1, -1, 0, 1, 81 },
   { 0x0, 0x0, 149, -1, -1, 0, 1, 85 },
   { 0x0, 0x0, 149, -1, -1, 0, 1, 40 },
-  { 0x1, 0x1, 150, -1, 454, 12, 1, 6 },
-  { 0x1, 0x1, 150, -1, 457, 12, 1, 6 },
-  { 0x200001, 0x200001, 150, -1, 459, 12, 1, 6 },
-  { 0x400001, 0x400001, 150, -1, 461, 12, 1, 6 },
-  { 0x600001, 0x600001, 150, -1, 463, 12, 1, 6 },
-  { 0x1, 0x1, 150, -1, 465, 12, 1, 6 },
-  { 0x200001, 0x200001, 150, -1, 467, 12, 1, 6 },
-  { 0x400001, 0x400001, 150, -1, 469, 12, 1, 6 },
-  { 0x600001, 0x600001, 150, -1, 471, 12, 1, 6 },
-  { 0x41, 0x41, 150, -1, 473, 6, 1, 7 },
-  { 0x8000041, 0x8000041, 150, -1, 475, 6, 1, 7 },
-  { 0x10000041, 0x10000041, 150, -1, 477, 6, 1, 7 },
-  { 0x18000041, 0x18000041, 150, -1, 479, 6, 1, 7 },
-  { 0x1, 0x1, 150, -1, 493, 12, 1, 8 },
-  { 0x200001, 0x200001, 150, -1, 495, 12, 1, 8 },
-  { 0x400001, 0x400001, 150, -1, 497, 12, 1, 8 },
-  { 0x600001, 0x600001, 150, -1, 499, 12, 1, 8 },
-  { 0x1, 0x1, 150, -1, 505, 12, 1, 15 },
-  { 0x200001, 0x200001, 150, -1, 507, 12, 1, 15 },
-  { 0x400001, 0x400001, 150, -1, 509, 12, 1, 15 },
-  { 0x600001, 0x600001, 150, -1, 511, 12, 1, 15 },
-  { 0x1, 0x1, 150, -1, 517, 12, 1, 17 },
-  { 0x1, 0x1, 150, -1, 520, 12, 1, 17 },
-  { 0x200001, 0x200001, 150, -1, 522, 12, 1, 17 },
-  { 0x400001, 0x400001, 150, -1, 524, 12, 1, 17 },
-  { 0x600001, 0x600001, 150, -1, 526, 12, 1, 17 },
-  { 0x1, 0x1, 150, -1, 528, 12, 1, 17 },
-  { 0x200001, 0x200001, 150, -1, 530, 12, 1, 17 },
-  { 0x400001, 0x400001, 150, -1, 532, 12, 1, 17 },
-  { 0x600001, 0x600001, 150, -1, 534, 12, 1, 17 },
-  { 0x1, 0x1, 150, -1, 544, 12, 1, 18 },
-  { 0x200001, 0x200001, 150, -1, 546, 12, 1, 18 },
-  { 0x400001, 0x400001, 150, -1, 548, 12, 1, 18 },
-  { 0x600001, 0x600001, 150, -1, 550, 12, 1, 18 },
-  { 0x41, 0x41, 150, -1, 552, 6, 1, 18 },
-  { 0x8000041, 0x8000041, 150, -1, 554, 6, 1, 18 },
-  { 0x10000041, 0x10000041, 150, -1, 556, 6, 1, 18 },
-  { 0x18000041, 0x18000041, 150, -1, 558, 6, 1, 18 },
-  { 0x1, 0x1, 150, -1, 568, 12, 1, 19 },
-  { 0x200001, 0x200001, 150, -1, 570, 12, 1, 19 },
-  { 0x400001, 0x400001, 150, -1, 572, 12, 1, 19 },
-  { 0x600001, 0x600001, 150, -1, 574, 12, 1, 19 },
-  { 0x1, 0x1, 150, -1, 580, 12, 1, 20 },
-  { 0x200001, 0x200001, 150, -1, 582, 12, 1, 20 },
-  { 0x400001, 0x400001, 150, -1, 584, 12, 1, 20 },
-  { 0x600001, 0x600001, 150, -1, 586, 12, 1, 20 },
-  { 0x41, 0x41, 150, -1, 588, 6, 1, 20 },
-  { 0x8000041, 0x8000041, 150, -1, 590, 6, 1, 20 },
-  { 0x10000041, 0x10000041, 150, -1, 592, 6, 1, 20 },
-  { 0x18000041, 0x18000041, 150, -1, 594, 6, 1, 20 },
-  { 0x1, 0x1, 150, -1, 604, 12, 1, 21 },
-  { 0x200001, 0x200001, 150, -1, 606, 12, 1, 21 },
-  { 0x400001, 0x400001, 150, -1, 608, 12, 1, 21 },
-  { 0x600001, 0x600001, 150, -1, 610, 12, 1, 21 },
-  { 0x1, 0x1, 150, -1, 616, 12, 1, 17 },
-  { 0x1, 0x1, 150, -1, 619, 12, 1, 17 },
-  { 0x200001, 0x200001, 150, -1, 621, 12, 1, 17 },
-  { 0x400001, 0x400001, 150, -1, 623, 12, 1, 17 },
-  { 0x600001, 0x600001, 150, -1, 625, 12, 1, 17 },
-  { 0x1, 0x1, 150, -1, 627, 12, 1, 17 },
-  { 0x200001, 0x200001, 150, -1, 629, 12, 1, 17 },
-  { 0x400001, 0x400001, 150, -1, 631, 12, 1, 17 },
-  { 0x600001, 0x600001, 150, -1, 633, 12, 1, 17 },
-  { 0x1, 0x1, 150, -1, 643, 12, 1, 21 },
-  { 0x200001, 0x200001, 150, -1, 645, 12, 1, 21 },
-  { 0x400001, 0x400001, 150, -1, 647, 12, 1, 21 },
-  { 0x600001, 0x600001, 150, -1, 649, 12, 1, 21 },
+  { 0x1, 0x1, 150, -1, 453, 12, 1, 6 },
+  { 0x1, 0x1, 150, -1, 456, 12, 1, 6 },
+  { 0x200001, 0x200001, 150, -1, 458, 12, 1, 6 },
+  { 0x400001, 0x400001, 150, -1, 460, 12, 1, 6 },
+  { 0x600001, 0x600001, 150, -1, 462, 12, 1, 6 },
+  { 0x1, 0x1, 150, -1, 464, 12, 1, 6 },
+  { 0x200001, 0x200001, 150, -1, 466, 12, 1, 6 },
+  { 0x400001, 0x400001, 150, -1, 468, 12, 1, 6 },
+  { 0x600001, 0x600001, 150, -1, 470, 12, 1, 6 },
+  { 0x41, 0x41, 150, -1, 472, 6, 1, 7 },
+  { 0x8000041, 0x8000041, 150, -1, 474, 6, 1, 7 },
+  { 0x10000041, 0x10000041, 150, -1, 476, 6, 1, 7 },
+  { 0x18000041, 0x18000041, 150, -1, 478, 6, 1, 7 },
+  { 0x1, 0x1, 150, -1, 492, 12, 1, 8 },
+  { 0x200001, 0x200001, 150, -1, 494, 12, 1, 8 },
+  { 0x400001, 0x400001, 150, -1, 496, 12, 1, 8 },
+  { 0x600001, 0x600001, 150, -1, 498, 12, 1, 8 },
+  { 0x1, 0x1, 150, -1, 504, 12, 1, 15 },
+  { 0x200001, 0x200001, 150, -1, 506, 12, 1, 15 },
+  { 0x400001, 0x400001, 150, -1, 508, 12, 1, 15 },
+  { 0x600001, 0x600001, 150, -1, 510, 12, 1, 15 },
+  { 0x1, 0x1, 150, -1, 516, 12, 1, 17 },
+  { 0x1, 0x1, 150, -1, 519, 12, 1, 17 },
+  { 0x200001, 0x200001, 150, -1, 521, 12, 1, 17 },
+  { 0x400001, 0x400001, 150, -1, 523, 12, 1, 17 },
+  { 0x600001, 0x600001, 150, -1, 525, 12, 1, 17 },
+  { 0x1, 0x1, 150, -1, 527, 12, 1, 17 },
+  { 0x200001, 0x200001, 150, -1, 529, 12, 1, 17 },
+  { 0x400001, 0x400001, 150, -1, 531, 12, 1, 17 },
+  { 0x600001, 0x600001, 150, -1, 533, 12, 1, 17 },
+  { 0x1, 0x1, 150, -1, 543, 12, 1, 18 },
+  { 0x200001, 0x200001, 150, -1, 545, 12, 1, 18 },
+  { 0x400001, 0x400001, 150, -1, 547, 12, 1, 18 },
+  { 0x600001, 0x600001, 150, -1, 549, 12, 1, 18 },
+  { 0x41, 0x41, 150, -1, 551, 6, 1, 18 },
+  { 0x8000041, 0x8000041, 150, -1, 553, 6, 1, 18 },
+  { 0x10000041, 0x10000041, 150, -1, 555, 6, 1, 18 },
+  { 0x18000041, 0x18000041, 150, -1, 557, 6, 1, 18 },
+  { 0x1, 0x1, 150, -1, 567, 12, 1, 19 },
+  { 0x200001, 0x200001, 150, -1, 569, 12, 1, 19 },
+  { 0x400001, 0x400001, 150, -1, 571, 12, 1, 19 },
+  { 0x600001, 0x600001, 150, -1, 573, 12, 1, 19 },
+  { 0x1, 0x1, 150, -1, 579, 12, 1, 20 },
+  { 0x200001, 0x200001, 150, -1, 581, 12, 1, 20 },
+  { 0x400001, 0x400001, 150, -1, 583, 12, 1, 20 },
+  { 0x600001, 0x600001, 150, -1, 585, 12, 1, 20 },
+  { 0x41, 0x41, 150, -1, 587, 6, 1, 20 },
+  { 0x8000041, 0x8000041, 150, -1, 589, 6, 1, 20 },
+  { 0x10000041, 0x10000041, 150, -1, 591, 6, 1, 20 },
+  { 0x18000041, 0x18000041, 150, -1, 593, 6, 1, 20 },
+  { 0x1, 0x1, 150, -1, 603, 12, 1, 21 },
+  { 0x200001, 0x200001, 150, -1, 605, 12, 1, 21 },
+  { 0x400001, 0x400001, 150, -1, 607, 12, 1, 21 },
+  { 0x600001, 0x600001, 150, -1, 609, 12, 1, 21 },
+  { 0x1, 0x1, 150, -1, 615, 12, 1, 17 },
+  { 0x1, 0x1, 150, -1, 618, 12, 1, 17 },
+  { 0x200001, 0x200001, 150, -1, 620, 12, 1, 17 },
+  { 0x400001, 0x400001, 150, -1, 622, 12, 1, 17 },
+  { 0x600001, 0x600001, 150, -1, 624, 12, 1, 17 },
+  { 0x1, 0x1, 150, -1, 626, 12, 1, 17 },
+  { 0x200001, 0x200001, 150, -1, 628, 12, 1, 17 },
+  { 0x400001, 0x400001, 150, -1, 630, 12, 1, 17 },
+  { 0x600001, 0x600001, 150, -1, 632, 12, 1, 17 },
+  { 0x1, 0x1, 150, -1, 642, 12, 1, 21 },
+  { 0x200001, 0x200001, 150, -1, 644, 12, 1, 21 },
+  { 0x400001, 0x400001, 150, -1, 646, 12, 1, 21 },
+  { 0x600001, 0x600001, 150, -1, 648, 12, 1, 21 },
   { 0x0, 0x0, 155, -1, -1, 0, 1, 124 },
+  { 0x0, 0x0, 159, 653, -1, 0, 1, 75 },
   { 0x0, 0x0, 159, 654, -1, 0, 1, 75 },
-  { 0x0, 0x0, 159, 655, -1, 0, 1, 75 },
-  { 0x9, 0x9, 159, -1, 1215, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1224, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1233, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1244, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1253, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1262, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1271, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1280, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1289, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1299, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1309, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1319, 32, 1, 130 },
-  { 0x9, 0x9, 159, -1, 1328, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1334, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1340, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1346, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1352, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1358, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1364, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1370, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1376, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1382, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1388, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1394, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1400, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1406, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1412, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1418, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1424, 32, 1, 144 },
-  { 0x9, 0x9, 159, -1, 1430, 32, 1, 144 },
-  { 0x0, 0x0, 160, 1041, 287, 0, 0, -1 },
-  { 0x1, 0x1, 160, -1, 2425, 38, 1, 1 },
-  { 0x0, 0x0, 160, 785, 344, 0, 0, -1 },
-  { 0x0, 0x0, 160, 1042, 297, 0, 0, -1 },
-  { 0x1, 0x1, 160, -1, 2433, 38, 1, 1 },
-  { 0x0, 0x0, 160, 787, 364, 0, 0, -1 },
-  { 0x0, 0x0, 160, 788, 298, 0, 0, -1 },
-  { 0x0, 0x0, 160, 789, 308, 0, 0, -1 },
-  { 0x0, 0x0, 160, 1043, 311, 0, 0, -1 },
-  { 0x1, 0x1, 160, -1, 2445, 38, 1, 1 },
-  { 0x0, 0x0, 160, 791, 368, 0, 0, -1 },
-  { 0x0, 0x0, 160, -1, 321, 0, 0, -1 },
-  { 0x1, 0x1, 160, -1, 2451, 38, 1, 1 },
-  { 0x0, 0x0, 160, 793, 388, 0, 0, -1 },
-  { 0x0, 0x0, 160, 794, 322, 0, 0, -1 },
-  { 0x0, 0x0, 160, 795, 332, 0, 0, -1 },
-  { 0x0, 0x0, 161, 1186, 1941, 0, 0, -1 },
-  { 0x0, 0x0, 161, 1187, 2474, 0, 1, 54 },
-  { 0x0, 0x0, 161, 1188, 1985, 0, 0, -1 },
-  { 0x1, 0x1, 161, 1189, -1, 29, 1, 49 },
-  { 0x0, 0x0, 162, -1, 1951, 0, 0, -1 },
-  { 0x1, 0x9, 162, -1, 2481, 33, 1, 54 },
-  { 0x6, 0x7, 162, -1, 1992, 27, 1, 49 },
-  { 0x0, 0x0, 163, 1175, 1949, 0, 0, -1 },
-  { 0x0, 0x0, 163, 1176, 2480, 0, 1, 54 },
-  { 0x1, 0x1, 163, 1177, 1991, 29, 1, 49 },
-  { 0x1, 0x1, 164, 1191, -1, 27, 1, 33 },
-  { 0x0, 0x0, 165, 1832, 1945, 0, 0, -1 },
-  { 0x1, 0x1, 165, 1833, 2476, 33, 1, 54 },
-  { 0x0, 0x0, 165, 1834, 1987, 0, 0, -1 },
-  { 0x3, 0x3, 165, 1835, -1, 28, 1, 49 },
-  { 0x0, 0x0, 166, 1182, 1943, 0, 0, -1 },
-  { 0x1, 0x1, 166, 1183, 2475, 36, 1, 54 },
-  { 0x0, 0x0, 166, 1184, 1986, 0, 0, -1 },
-  { 0x5, 0x5, 166, 1185, -1, 27, 1, 49 },
-  { 0x0, 0x0, 167, -1, 2457, 0, 1, 63 },
+  { 0x9, 0x9, 159, -1, 1214, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1223, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1232, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1243, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1252, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1261, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1270, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1279, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1288, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1298, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1308, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1318, 32, 1, 130 },
+  { 0x9, 0x9, 159, -1, 1327, 32, 1, 144 },
+  { 0x9, 0x9, 159, -1, 1333, 32, 1, 149 },
+  { 0x9, 0x9, 159, -1, 1339, 32, 1, 149 },
+  { 0x9, 0x9, 159, -1, 1345, 32, 1, 144 },
+  { 0x9, 0x9, 159, -1, 1351, 32, 1, 149 },
+  { 0x9, 0x9, 159, -1, 1357, 32, 1, 149 },
+  { 0x9, 0x9, 159, -1, 1363, 32, 1, 144 },
+  { 0x9, 0x9, 159, -1, 1369, 32, 1, 149 },
+  { 0x9, 0x9, 159, -1, 1375, 32, 1, 149 },
+  { 0x9, 0x9, 159, -1, 1381, 32, 1, 144 },
+  { 0x9, 0x9, 159, -1, 1387, 32, 1, 149 },
+  { 0x9, 0x9, 159, -1, 1393, 32, 1, 144 },
+  { 0x9, 0x9, 159, -1, 1399, 32, 1, 149 },
+  { 0x9, 0x9, 159, -1, 1405, 32, 1, 144 },
+  { 0x9, 0x9, 159, -1, 1411, 32, 1, 149 },
+  { 0x9, 0x9, 159, -1, 1417, 32, 1, 144 },
+  { 0x9, 0x9, 159, -1, 1423, 32, 1, 149 },
+  { 0x9, 0x9, 159, -1, 1429, 32, 1, 149 },
+  { 0x0, 0x0, 160, 1040, 286, 0, 0, -1 },
+  { 0x1, 0x1, 160, -1, 2424, 38, 1, 1 },
+  { 0x0, 0x0, 160, 784, 343, 0, 0, -1 },
+  { 0x0, 0x0, 160, 1041, 296, 0, 0, -1 },
+  { 0x1, 0x1, 160, -1, 2432, 38, 1, 1 },
+  { 0x0, 0x0, 160, 786, 363, 0, 0, -1 },
+  { 0x0, 0x0, 160, 787, 297, 0, 0, -1 },
+  { 0x0, 0x0, 160, 788, 307, 0, 0, -1 },
+  { 0x0, 0x0, 160, 1042, 310, 0, 0, -1 },
+  { 0x1, 0x1, 160, -1, 2444, 38, 1, 1 },
+  { 0x0, 0x0, 160, 790, 367, 0, 0, -1 },
+  { 0x0, 0x0, 160, -1, 320, 0, 0, -1 },
+  { 0x1, 0x1, 160, -1, 2450, 38, 1, 1 },
+  { 0x0, 0x0, 160, 792, 387, 0, 0, -1 },
+  { 0x0, 0x0, 160, 793, 321, 0, 0, -1 },
+  { 0x0, 0x0, 160, 794, 331, 0, 0, -1 },
+  { 0x0, 0x0, 161, 1185, 1940, 0, 0, -1 },
+  { 0x0, 0x0, 161, 1186, 2473, 0, 1, 54 },
+  { 0x0, 0x0, 161, 1187, 1984, 0, 0, -1 },
+  { 0x1, 0x1, 161, 1188, -1, 29, 1, 49 },
+  { 0x0, 0x0, 162, -1, 1950, 0, 0, -1 },
+  { 0x1, 0x9, 162, -1, 2480, 33, 1, 54 },
+  { 0x6, 0x7, 162, -1, 1991, 27, 1, 49 },
+  { 0x0, 0x0, 163, 1174, 1948, 0, 0, -1 },
+  { 0x0, 0x0, 163, 1175, 2479, 0, 1, 54 },
+  { 0x1, 0x1, 163, 1176, 1990, 29, 1, 49 },
+  { 0x1, 0x1, 164, 1190, -1, 27, 1, 33 },
+  { 0x0, 0x0, 165, 1831, 1944, 0, 0, -1 },
+  { 0x1, 0x1, 165, 1832, 2475, 33, 1, 54 },
+  { 0x0, 0x0, 165, 1833, 1986, 0, 0, -1 },
+  { 0x3, 0x3, 165, 1834, -1, 28, 1, 49 },
+  { 0x0, 0x0, 166, 1181, 1942, 0, 0, -1 },
+  { 0x1, 0x1, 166, 1182, 2474, 36, 1, 54 },
+  { 0x0, 0x0, 166, 1183, 1985, 0, 0, -1 },
+  { 0x5, 0x5, 166, 1184, -1, 27, 1, 49 },
+  { 0x0, 0x0, 167, -1, 2456, 0, 1, 63 },
   { 0x1, 0x1, 169, -1, -1, 28, 1, 33 },
+  { 0x1, 0x1, 170, 2314, -1, 27, 1, 33 },
   { 0x1, 0x1, 170, 2315, -1, 27, 1, 33 },
-  { 0x1, 0x1, 170, 2316, -1, 27, 1, 33 },
+  { 0x1, 0x1, 171, 1459, -1, 28, 1, 135 },
   { 0x1, 0x1, 171, 1460, -1, 28, 1, 135 },
-  { 0x1, 0x1, 171, 1461, -1, 28, 1, 135 },
+  { 0x1, 0x1, 171, 1461, -1, 28, 1, 134 },
   { 0x1, 0x1, 171, 1462, -1, 28, 1, 134 },
   { 0x1, 0x1, 171, 1463, -1, 28, 1, 134 },
   { 0x1, 0x1, 171, 1464, -1, 28, 1, 134 },
@@ -2953,263 +3005,262 @@
   { 0x1, 0x1, 171, 1466, -1, 28, 1, 134 },
   { 0x1, 0x1, 171, 1467, -1, 28, 1, 134 },
   { 0x1, 0x1, 171, 1468, -1, 28, 1, 134 },
-  { 0x1, 0x1, 171, 1469, -1, 28, 1, 134 },
+  { 0x1, 0x1, 171, 1469, -1, 28, 1, 136 },
   { 0x1, 0x1, 171, 1470, -1, 28, 1, 136 },
   { 0x1, 0x1, 171, 1471, -1, 28, 1, 136 },
   { 0x1, 0x1, 171, 1472, -1, 28, 1, 136 },
-  { 0x1, 0x1, 171, 1473, -1, 28, 1, 136 },
-  { 0x1, 0x1, 171, 1474, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1475, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1476, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1473, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1474, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1475, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1476, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1477, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1478, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1478, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1479, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1480, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1481, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1482, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1483, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1484, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1485, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1481, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1482, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1483, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1484, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1485, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1486, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1487, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1487, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1488, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1489, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1490, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1491, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1492, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1493, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1494, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1490, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1491, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1492, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1493, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1494, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1495, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1496, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1496, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1497, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1498, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1499, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1500, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1499, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1500, -1, 28, 1, 125 },
   { 0x1, 0x1, 171, 1501, -1, 28, 1, 125 },
-  { 0x1, 0x1, 171, 1502, -1, 28, 1, 125 },
-  { 0x1, 0x1, 171, 1503, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1504, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1505, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1502, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1503, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1504, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1505, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1506, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1507, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1507, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1508, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1509, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1510, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1511, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1512, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1513, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1514, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1510, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1511, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1512, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1513, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1514, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1515, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1516, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1516, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1517, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1518, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1519, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1520, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1521, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1522, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1523, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1519, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1520, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1521, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1522, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1523, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1524, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1525, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1525, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1526, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1527, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1528, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1529, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1530, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1531, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1532, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1528, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1529, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1530, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1531, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1532, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1533, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1534, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1534, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1535, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1536, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1537, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1538, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1539, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1540, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1541, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1537, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1538, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1539, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1540, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1541, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1542, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1543, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1543, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1544, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1545, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1546, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1547, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1548, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1549, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1550, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1546, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1547, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1548, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1549, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1550, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1551, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1552, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1552, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1553, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1554, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1555, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1556, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1557, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1558, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1559, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1555, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1556, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1557, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1558, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1559, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1560, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1561, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1562, -1, 28, 1, 129 },
+  { 0x1, 0x1, 171, 1561, -1, 28, 1, 129 },
+  { 0x1, 0x1, 171, 1562, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1563, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1564, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1565, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1566, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1567, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1568, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1569, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1565, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1566, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1567, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1568, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1569, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1570, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1571, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1572, -1, 28, 1, 129 },
+  { 0x1, 0x1, 171, 1571, -1, 28, 1, 129 },
+  { 0x1, 0x1, 171, 1572, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1573, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1574, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1575, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1576, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1577, -1, 28, 1, 126 },
-  { 0x1, 0x1, 171, 1578, -1, 28, 1, 127 },
-  { 0x1, 0x1, 171, 1579, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1575, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1576, -1, 28, 1, 126 },
+  { 0x1, 0x1, 171, 1577, -1, 28, 1, 127 },
+  { 0x1, 0x1, 171, 1578, -1, 28, 1, 128 },
+  { 0x1, 0x1, 171, 1579, -1, 28, 1, 124 },
   { 0x1, 0x1, 171, 1580, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1581, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1582, -1, 28, 1, 129 },
+  { 0x1, 0x1, 171, 1581, -1, 28, 1, 129 },
+  { 0x1, 0x1, 171, 1582, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1583, -1, 28, 1, 130 },
   { 0x1, 0x1, 171, 1584, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1585, -1, 28, 1, 130 },
-  { 0x1, 0x1, 171, 1586, -1, 28, 1, 124 },
-  { 0x1, 0x1, 171, 1587, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1588, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1589, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1590, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1591, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1592, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1585, -1, 28, 1, 124 },
+  { 0x1, 0x1, 171, 1586, -1, 28, 1, 140 },
+  { 0x1, 0x1, 171, 1587, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1588, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1589, -1, 28, 1, 141 },
+  { 0x1, 0x1, 171, 1590, -1, 28, 1, 142 },
+  { 0x1, 0x1, 171, 1591, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1592, -1, 28, 1, 144 },
   { 0x1, 0x1, 171, 1593, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1594, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1595, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1596, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1597, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1598, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1599, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1600, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1601, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1602, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1603, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1604, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1605, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1606, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1607, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1608, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1609, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1610, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1594, -1, 28, 1, 140 },
+  { 0x1, 0x1, 171, 1595, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1596, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1597, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1598, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1599, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1600, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1601, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1602, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1603, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1604, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1605, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1606, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1607, -1, 28, 1, 141 },
+  { 0x1, 0x1, 171, 1608, -1, 28, 1, 142 },
+  { 0x1, 0x1, 171, 1609, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1610, -1, 28, 1, 144 },
   { 0x1, 0x1, 171, 1611, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1612, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1613, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1614, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1615, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1616, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1617, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1618, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1619, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1620, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1621, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1622, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1623, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1624, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1625, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1626, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1627, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1628, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1612, -1, 28, 1, 140 },
+  { 0x1, 0x1, 171, 1613, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1614, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1615, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1616, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1617, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1618, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1619, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1620, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1621, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1622, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1623, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1624, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1625, -1, 28, 1, 141 },
+  { 0x1, 0x1, 171, 1626, -1, 28, 1, 142 },
+  { 0x1, 0x1, 171, 1627, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1628, -1, 28, 1, 144 },
   { 0x1, 0x1, 171, 1629, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1630, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1631, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1632, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1633, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1634, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1635, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1636, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1637, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1638, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1639, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1640, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1641, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1642, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1643, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1644, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1645, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1646, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1630, -1, 28, 1, 140 },
+  { 0x1, 0x1, 171, 1631, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1632, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1633, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1634, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1635, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1636, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1637, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1638, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1639, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1640, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1641, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1642, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1643, -1, 28, 1, 141 },
+  { 0x1, 0x1, 171, 1644, -1, 28, 1, 142 },
+  { 0x1, 0x1, 171, 1645, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1646, -1, 28, 1, 144 },
   { 0x1, 0x1, 171, 1647, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1648, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1649, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1650, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1651, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1652, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1653, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1654, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1655, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1656, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1657, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1658, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1648, -1, 28, 1, 140 },
+  { 0x1, 0x1, 171, 1649, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1650, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1651, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1652, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1653, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1654, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1655, -1, 28, 1, 141 },
+  { 0x1, 0x1, 171, 1656, -1, 28, 1, 142 },
+  { 0x1, 0x1, 171, 1657, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1658, -1, 28, 1, 144 },
   { 0x1, 0x1, 171, 1659, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1660, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1661, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1662, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1663, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1664, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1665, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1666, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1667, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1668, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1669, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1670, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1660, -1, 28, 1, 140 },
+  { 0x1, 0x1, 171, 1661, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1662, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1663, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1664, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1665, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1666, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1667, -1, 28, 1, 141 },
+  { 0x1, 0x1, 171, 1668, -1, 28, 1, 142 },
+  { 0x1, 0x1, 171, 1669, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1670, -1, 28, 1, 144 },
   { 0x1, 0x1, 171, 1671, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1672, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1673, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1674, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1675, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1676, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1677, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1678, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1679, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1680, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1681, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1682, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1672, -1, 28, 1, 140 },
+  { 0x1, 0x1, 171, 1673, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1674, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1675, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1676, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1677, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1678, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1679, -1, 28, 1, 141 },
+  { 0x1, 0x1, 171, 1680, -1, 28, 1, 142 },
+  { 0x1, 0x1, 171, 1681, -1, 28, 1, 143 },
+  { 0x1, 0x1, 171, 1682, -1, 28, 1, 144 },
   { 0x1, 0x1, 171, 1683, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1684, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1685, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1686, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1687, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1688, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1689, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1690, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1691, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1692, -1, 28, 1, 141 },
-  { 0x1, 0x1, 171, 1693, -1, 28, 1, 142 },
-  { 0x1, 0x1, 171, 1694, -1, 28, 1, 143 },
-  { 0x1, 0x1, 171, 1695, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1696, -1, 28, 1, 144 },
-  { 0x1, 0x1, 171, 1697, -1, 28, 1, 140 },
-  { 0x1, 0x1, 171, 1448, -1, 28, 1, 146 },
-  { 0x1, 0x1, 171, 1449, -1, 28, 1, 147 },
-  { 0x1, 0x1, 171, 1450, -1, 28, 1, 147 },
-  { 0x1, 0x1, 171, 1451, -1, 28, 1, 146 },
-  { 0x1, 0x1, 171, 1452, -1, 28, 1, 148 },
-  { 0x1, 0x1, 171, 1453, -1, 28, 1, 149 },
-  { 0x1, 0x1, 171, 1454, -1, 28, 1, 149 },
-  { 0x1, 0x1, 171, 1455, -1, 28, 1, 148 },
-  { 0x1, 0x1, 171, 1456, -1, 28, 1, 148 },
-  { 0x1, 0x1, 171, 1457, -1, 28, 1, 149 },
-  { 0x1, 0x1, 171, 1458, -1, 28, 1, 149 },
-  { 0x1, 0x1, 171, 1459, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1684, -1, 28, 1, 140 },
+  { 0x1, 0x1, 171, 1685, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1686, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1687, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1688, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1689, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1690, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1691, -1, 28, 1, 146 },
+  { 0x1, 0x1, 171, 1692, -1, 28, 1, 147 },
+  { 0x1, 0x1, 171, 1693, -1, 28, 1, 148 },
+  { 0x1, 0x1, 171, 1694, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1695, -1, 28, 1, 149 },
+  { 0x1, 0x1, 171, 1696, -1, 28, 1, 145 },
+  { 0x1, 0x1, 171, 1447, -1, 28, 1, 151 },
+  { 0x1, 0x1, 171, 1448, -1, 28, 1, 152 },
+  { 0x1, 0x1, 171, 1449, -1, 28, 1, 152 },
+  { 0x1, 0x1, 171, 1450, -1, 28, 1, 151 },
+  { 0x1, 0x1, 171, 1451, -1, 28, 1, 153 },
+  { 0x1, 0x1, 171, 1452, -1, 28, 1, 154 },
+  { 0x1, 0x1, 171, 1453, -1, 28, 1, 154 },
+  { 0x1, 0x1, 171, 1454, -1, 28, 1, 153 },
+  { 0x1, 0x1, 171, 1455, -1, 28, 1, 153 },
+  { 0x1, 0x1, 171, 1456, -1, 28, 1, 154 },
+  { 0x1, 0x1, 171, 1457, -1, 28, 1, 154 },
+  { 0x1, 0x1, 171, 1458, -1, 28, 1, 153 },
+  { 0x1, 0x1, 171, 1739, -1, 28, 1, 136 },
   { 0x1, 0x1, 171, 1740, -1, 28, 1, 136 },
   { 0x1, 0x1, 171, 1741, -1, 28, 1, 136 },
   { 0x1, 0x1, 171, 1742, -1, 28, 1, 136 },
-  { 0x1, 0x1, 171, 1743, -1, 28, 1, 136 },
-  { 0x1, 0x1, 172, 1698, -1, 29, 1, 146 },
-  { 0x1, 0x1, 172, 1699, -1, 29, 1, 147 },
-  { 0x1, 0x1, 172, 1700, -1, 29, 1, 147 },
-  { 0x1, 0x1, 172, 1701, -1, 29, 1, 146 },
-  { 0x1, 0x1, 172, 1702, -1, 29, 1, 148 },
-  { 0x1, 0x1, 172, 1703, -1, 29, 1, 149 },
-  { 0x1, 0x1, 172, 1704, -1, 29, 1, 149 },
-  { 0x1, 0x1, 172, 1705, -1, 29, 1, 148 },
-  { 0x1, 0x1, 172, 1706, -1, 29, 1, 148 },
-  { 0x1, 0x1, 172, 1707, -1, 29, 1, 149 },
-  { 0x1, 0x1, 172, 1708, -1, 29, 1, 149 },
-  { 0x1, 0x1, 172, 1709, -1, 29, 1, 148 },
+  { 0x1, 0x1, 172, 1697, -1, 29, 1, 151 },
+  { 0x1, 0x1, 172, 1698, -1, 29, 1, 152 },
+  { 0x1, 0x1, 172, 1699, -1, 29, 1, 152 },
+  { 0x1, 0x1, 172, 1700, -1, 29, 1, 151 },
+  { 0x1, 0x1, 172, 1701, -1, 29, 1, 153 },
+  { 0x1, 0x1, 172, 1702, -1, 29, 1, 154 },
+  { 0x1, 0x1, 172, 1703, -1, 29, 1, 154 },
+  { 0x1, 0x1, 172, 1704, -1, 29, 1, 153 },
+  { 0x1, 0x1, 172, 1705, -1, 29, 1, 153 },
+  { 0x1, 0x1, 172, 1706, -1, 29, 1, 154 },
+  { 0x1, 0x1, 172, 1707, -1, 29, 1, 154 },
+  { 0x1, 0x1, 172, 1708, -1, 29, 1, 153 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 135 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 135 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 134 },
@@ -3230,7 +3281,16 @@
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 261, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 260, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 1889, -1, 28, 1, 124 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 127 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 128 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 262, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1890, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
@@ -3239,27 +3299,27 @@
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 263, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 264, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1891, -1, 28, 1, 124 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 125 },
+  { 0x3, 0x3, 173, 266, -1, 28, 1, 125 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 127 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 128 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 265, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 267, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1892, -1, 28, 1, 124 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 125 },
-  { 0x3, 0x3, 173, 267, -1, 28, 1, 125 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 127 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 128 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 268, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 269, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1893, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
@@ -3268,7 +3328,7 @@
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 270, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 271, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1894, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
@@ -3277,7 +3337,7 @@
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 272, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 273, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1895, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
@@ -3286,7 +3346,7 @@
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 274, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 275, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1896, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
@@ -3295,7 +3355,7 @@
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 276, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 277, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1897, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
@@ -3303,8 +3363,9 @@
   { 0x3, 0x3, 173, -1, -1, 28, 1, 128 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 129 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 278, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 279, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1898, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
@@ -3314,7 +3375,7 @@
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 129 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 280, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 281, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1899, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
@@ -3324,214 +3385,204 @@
   { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 129 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 282, -1, 28, 1, 130 },
+  { 0x3, 0x3, 173, 283, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
   { 0x3, 0x3, 173, 1900, -1, 28, 1, 124 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 126 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 127 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 128 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 124 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 129 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 284, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 130 },
-  { 0x3, 0x3, 173, 1901, -1, 28, 1, 124 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 140 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1902, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1903, -1, 28, 1, 140 },
+  { 0x3, 0x3, 173, 1901, -1, 28, 1, 140 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1902, -1, 28, 1, 145 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1903, -1, 28, 1, 145 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, 1904, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1905, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1906, -1, 28, 1, 140 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1905, -1, 28, 1, 145 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1906, -1, 28, 1, 145 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, 1907, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1908, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1909, -1, 28, 1, 140 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1908, -1, 28, 1, 145 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1909, -1, 28, 1, 145 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, 1910, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1911, -1, 28, 1, 140 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1911, -1, 28, 1, 145 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, 1912, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1913, -1, 28, 1, 140 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1913, -1, 28, 1, 145 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, 1914, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1915, -1, 28, 1, 140 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1915, -1, 28, 1, 145 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
   { 0x3, 0x3, 173, 1916, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1917, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1918, -1, 28, 1, 140 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 141 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 142 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 143 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 144 },
-  { 0x3, 0x3, 173, 1919, -1, 28, 1, 140 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
-  { 0x3, 0x3, 173, 803, -1, 28, 1, 147 },
-  { 0x3, 0x3, 173, 804, -1, 28, 1, 146 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
-  { 0x3, 0x3, 173, 805, -1, 28, 1, 149 },
-  { 0x3, 0x3, 173, 806, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1917, -1, 28, 1, 145 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 146 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 147 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 148 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
-  { 0x3, 0x3, 173, 807, -1, 28, 1, 149 },
-  { 0x3, 0x3, 173, 808, -1, 28, 1, 148 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 149 },
+  { 0x3, 0x3, 173, 1918, -1, 28, 1, 145 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 151 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 152 },
+  { 0x3, 0x3, 173, 802, -1, 28, 1, 152 },
+  { 0x3, 0x3, 173, 803, -1, 28, 1, 151 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 153 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 154 },
+  { 0x3, 0x3, 173, 804, -1, 28, 1, 154 },
+  { 0x3, 0x3, 173, 805, -1, 28, 1, 153 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 153 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 154 },
+  { 0x3, 0x3, 173, 806, -1, 28, 1, 154 },
+  { 0x3, 0x3, 173, 807, -1, 28, 1, 153 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 131 },
-  { 0x3, 0x3, 173, 1857, -1, 28, 1, 131 },
+  { 0x3, 0x3, 173, 1856, -1, 28, 1, 131 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 138 },
-  { 0x3, 0x3, 173, 1858, -1, 28, 1, 138 },
+  { 0x3, 0x3, 173, 1857, -1, 28, 1, 138 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 132 },
-  { 0x3, 0x3, 173, 1859, -1, 28, 1, 132 },
+  { 0x3, 0x3, 173, 1858, -1, 28, 1, 132 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 131 },
-  { 0x3, 0x3, 173, 1860, -1, 28, 1, 131 },
+  { 0x3, 0x3, 173, 1859, -1, 28, 1, 131 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 138 },
-  { 0x3, 0x3, 173, 1861, -1, 28, 1, 138 },
+  { 0x3, 0x3, 173, 1860, -1, 28, 1, 138 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 131 },
-  { 0x3, 0x3, 173, 1862, -1, 28, 1, 131 },
+  { 0x3, 0x3, 173, 1861, -1, 28, 1, 131 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 138 },
-  { 0x3, 0x3, 173, 1863, -1, 28, 1, 138 },
+  { 0x3, 0x3, 173, 1862, -1, 28, 1, 138 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 131 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 133 },
-  { 0x3, 0x3, 173, 1864, -1, 28, 1, 131 },
+  { 0x3, 0x3, 173, 1863, -1, 28, 1, 131 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 138 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 139 },
-  { 0x3, 0x3, 173, 1865, -1, 28, 1, 138 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
-  { 0x3, 0x3, 173, -1, -1, 28, 1, 145 },
+  { 0x3, 0x3, 173, 1864, -1, 28, 1, 138 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 150 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 156 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 150 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 156 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 150 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 156 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 150 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 156 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 150 },
+  { 0x3, 0x3, 173, -1, -1, 28, 1, 156 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 136 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 136 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 136 },
   { 0x3, 0x3, 173, -1, -1, 28, 1, 136 },
-  { 0x0, 0x0, 174, -1, 335, 0, 0, -1 },
-  { 0x0, 0x0, 174, 2514, 2483, 0, 1, 1 },
-  { 0x0, 0x0, 174, -1, 339, 0, 0, -1 },
-  { 0x0, 0x0, 174, 2516, 2485, 0, 1, 1 },
-  { 0x11, 0x31, 175, 2417, 342, 33, 1, 4 },
-  { 0x2200001, 0x2200001, 175, -1, 343, 12, 1, 4 },
-  { 0x1, 0x1, 175, -1, 346, 37, 1, 4 },
-  { 0x2000001, 0x2000001, 175, -1, 347, 12, 1, 4 },
-  { 0x11, 0x11, 175, -1, 348, 33, 1, 4 },
-  { 0x2200001, 0x2200001, 175, -1, 349, 12, 1, 4 },
-  { 0x1, 0x1, 175, 1778, 350, 37, 1, 4 },
-  { 0x2000001, 0x2000001, 175, -1, 352, 12, 1, 4 },
-  { 0x11, 0x11, 175, 1780, 354, 33, 1, 4 },
-  { 0x2200001, 0x2200001, 175, -1, 356, 12, 1, 4 },
-  { 0x11, 0x31, 175, 2427, 362, 33, 1, 4 },
-  { 0x2200001, 0x2200001, 175, -1, 363, 12, 1, 4 },
-  { 0x11, 0x31, 175, 2437, 366, 33, 1, 4 },
-  { 0x2200001, 0x2200001, 175, -1, 367, 12, 1, 4 },
-  { 0x1, 0x1, 175, -1, 370, 37, 1, 4 },
-  { 0x2000001, 0x2000001, 175, -1, 371, 12, 1, 4 },
-  { 0x11, 0x11, 175, -1, 372, 33, 1, 4 },
-  { 0x2200001, 0x2200001, 175, -1, 373, 12, 1, 4 },
-  { 0x1, 0x1, 175, 1802, 374, 37, 1, 4 },
-  { 0x2000001, 0x2000001, 175, -1, 376, 12, 1, 4 },
-  { 0x11, 0x11, 175, 1804, 378, 33, 1, 4 },
-  { 0x2200001, 0x2200001, 175, -1, 380, 12, 1, 4 },
-  { 0x11, 0x31, 175, 2447, 386, 33, 1, 4 },
-  { 0x2200001, 0x2200001, 175, -1, 387, 12, 1, 4 },
-  { 0x1, 0x1, 175, -1, 390, 33, 1, 4 },
-  { 0x200001, 0x200001, 175, -1, 391, 12, 1, 4 },
-  { 0x1, 0x1, 175, -1, 394, 33, 1, 4 },
-  { 0x200001, 0x200001, 175, -1, 395, 12, 1, 4 },
+  { 0x0, 0x0, 174, -1, 334, 0, 0, -1 },
+  { 0x0, 0x0, 174, 2513, 2482, 0, 1, 1 },
+  { 0x0, 0x0, 174, -1, 338, 0, 0, -1 },
+  { 0x0, 0x0, 174, 2515, 2484, 0, 1, 1 },
+  { 0x11, 0x31, 175, 2416, 341, 33, 1, 4 },
+  { 0x2200001, 0x2200001, 175, -1, 342, 12, 1, 4 },
+  { 0x1, 0x1, 175, -1, 345, 37, 1, 4 },
+  { 0x2000001, 0x2000001, 175, -1, 346, 12, 1, 4 },
+  { 0x11, 0x11, 175, -1, 347, 33, 1, 4 },
+  { 0x2200001, 0x2200001, 175, -1, 348, 12, 1, 4 },
+  { 0x1, 0x1, 175, 1777, 349, 37, 1, 4 },
+  { 0x2000001, 0x2000001, 175, -1, 351, 12, 1, 4 },
+  { 0x11, 0x11, 175, 1779, 353, 33, 1, 4 },
+  { 0x2200001, 0x2200001, 175, -1, 355, 12, 1, 4 },
+  { 0x11, 0x31, 175, 2426, 361, 33, 1, 4 },
+  { 0x2200001, 0x2200001, 175, -1, 362, 12, 1, 4 },
+  { 0x11, 0x31, 175, 2436, 365, 33, 1, 4 },
+  { 0x2200001, 0x2200001, 175, -1, 366, 12, 1, 4 },
+  { 0x1, 0x1, 175, -1, 369, 37, 1, 4 },
+  { 0x2000001, 0x2000001, 175, -1, 370, 12, 1, 4 },
+  { 0x11, 0x11, 175, -1, 371, 33, 1, 4 },
+  { 0x2200001, 0x2200001, 175, -1, 372, 12, 1, 4 },
+  { 0x1, 0x1, 175, 1801, 373, 37, 1, 4 },
+  { 0x2000001, 0x2000001, 175, -1, 375, 12, 1, 4 },
+  { 0x11, 0x11, 175, 1803, 377, 33, 1, 4 },
+  { 0x2200001, 0x2200001, 175, -1, 379, 12, 1, 4 },
+  { 0x11, 0x31, 175, 2446, 385, 33, 1, 4 },
+  { 0x2200001, 0x2200001, 175, -1, 386, 12, 1, 4 },
+  { 0x1, 0x1, 175, -1, 389, 33, 1, 4 },
+  { 0x200001, 0x200001, 175, -1, 390, 12, 1, 4 },
+  { 0x1, 0x1, 175, -1, 393, 33, 1, 4 },
+  { 0x200001, 0x200001, 175, -1, 394, 12, 1, 4 },
   { 0x1, 0x1, 176, -1, -1, 37, 1, 4 },
   { 0x2000001, 0x2000001, 176, -1, -1, 12, 1, 4 },
   { 0x2000001, 0x2000001, 176, -1, -1, 12, 1, 4 },
-  { 0x1, 0x1, 176, 1755, -1, 37, 1, 4 },
+  { 0x1, 0x1, 176, 1754, -1, 37, 1, 4 },
   { 0x2200001, 0x2200001, 176, -1, -1, 12, 1, 4 },
-  { 0x11, 0x11, 176, 1757, -1, 33, 1, 4 },
+  { 0x11, 0x11, 176, 1756, -1, 33, 1, 4 },
   { 0x1, 0x1, 176, -1, -1, 37, 1, 4 },
   { 0x2000001, 0x2000001, 176, -1, -1, 12, 1, 4 },
   { 0x11, 0x11, 176, -1, -1, 33, 1, 4 },
@@ -3553,9 +3604,9 @@
   { 0x1, 0x1, 176, -1, -1, 37, 1, 4 },
   { 0x2000001, 0x2000001, 176, -1, -1, 12, 1, 4 },
   { 0x2000001, 0x2000001, 176, -1, -1, 12, 1, 4 },
-  { 0x1, 0x1, 176, 1767, -1, 37, 1, 4 },
+  { 0x1, 0x1, 176, 1766, -1, 37, 1, 4 },
   { 0x2200001, 0x2200001, 176, -1, -1, 12, 1, 4 },
-  { 0x11, 0x11, 176, 1769, -1, 33, 1, 4 },
+  { 0x11, 0x11, 176, 1768, -1, 33, 1, 4 },
   { 0x1, 0x1, 176, -1, -1, 37, 1, 4 },
   { 0x2000001, 0x2000001, 176, -1, -1, 12, 1, 4 },
   { 0x11, 0x11, 176, -1, -1, 33, 1, 4 },
@@ -3575,433 +3626,433 @@
   { 0x0, 0x0, 176, -1, -1, 0, 1, 5 },
   { 0x1, 0x1, 176, -1, -1, 12, 1, 5 },
   { 0x9, 0x9, 176, -1, -1, 33, 1, 5 },
-  { 0x1, 0x1, 176, 336, -1, 33, 1, 4 },
+  { 0x1, 0x1, 176, 335, -1, 33, 1, 4 },
   { 0x1200001, 0x1200001, 176, -1, -1, 12, 1, 5 },
-  { 0x200001, 0x200001, 176, 337, -1, 12, 1, 4 },
+  { 0x200001, 0x200001, 176, 336, -1, 12, 1, 4 },
   { 0x9, 0x9, 176, -1, -1, 33, 1, 5 },
-  { 0x1, 0x1, 176, 340, -1, 33, 1, 4 },
+  { 0x1, 0x1, 176, 339, -1, 33, 1, 4 },
   { 0x1200001, 0x1200001, 176, -1, -1, 12, 1, 5 },
-  { 0x200001, 0x200001, 176, 341, -1, 12, 1, 4 },
-  { 0x0, 0x0, 177, -1, 1947, 0, 0, -1 },
-  { 0x9, 0x9, 177, -1, 2477, 33, 1, 49 },
-  { 0x0, 0x0, 177, -1, 1988, 0, 0, -1 },
+  { 0x200001, 0x200001, 176, 340, -1, 12, 1, 4 },
+  { 0x0, 0x0, 177, -1, 1946, 0, 0, -1 },
+  { 0x9, 0x9, 177, -1, 2476, 33, 1, 49 },
+  { 0x0, 0x0, 177, -1, 1987, 0, 0, -1 },
   { 0x7, 0x7, 177, -1, -1, 27, 1, 49 },
   { 0x1, 0x1, 197, -1, -1, 27, 1, 10 },
   { 0x1, 0x1, 211, -1, -1, 29, 1, 0 },
   { 0x1, 0x1, 211, -1, -1, 29, 1, 0 },
-  { 0x2, 0x3, 211, 987, -1, 27, 1, 33 },
-  { 0x0, 0x0, 211, 988, -1, 0, 1, 33 },
+  { 0x2, 0x3, 211, 986, -1, 27, 1, 33 },
+  { 0x0, 0x0, 211, 987, -1, 0, 1, 33 },
+  { 0x0, 0x0, 211, 988, -1, 0, 1, 0 },
   { 0x0, 0x0, 211, 989, -1, 0, 1, 0 },
   { 0x0, 0x0, 211, 990, -1, 0, 1, 0 },
   { 0x0, 0x0, 211, 991, -1, 0, 1, 0 },
-  { 0x0, 0x0, 211, 992, -1, 0, 1, 0 },
+  { 0x0, 0x0, 211, 2498, -1, 0, 1, 93 },
   { 0x0, 0x0, 211, 2499, -1, 0, 1, 93 },
-  { 0x0, 0x0, 211, 2500, -1, 0, 1, 93 },
-  { 0x0, 0x0, 211, 2501, 819, 0, 0, -1 },
+  { 0x0, 0x0, 211, 2500, 818, 0, 0, -1 },
   { 0x1, 0x1, 212, -1, -1, 27, 1, 0 },
   { 0x1, 0x1, 212, -1, -1, 27, 1, 0 },
-  { 0x1, 0x1, 213, -1, 1195, 32, 1, 135 },
-  { 0x1, 0x1, 213, -1, 1197, 32, 1, 134 },
-  { 0x1, 0x1, 213, -1, 1199, 32, 1, 134 },
-  { 0x1, 0x1, 213, -1, 1201, 32, 1, 134 },
-  { 0x1, 0x1, 213, -1, 1203, 32, 1, 134 },
-  { 0x1, 0x1, 213, -1, 1205, 32, 1, 136 },
-  { 0x1, 0x1, 213, -1, 1207, 32, 1, 136 },
-  { 0x1, 0x1, 213, -1, 1710, 32, 1, 131 },
-  { 0x1, 0x1, 213, -1, 1712, 32, 1, 138 },
-  { 0x1, 0x1, 213, -1, 1714, 32, 1, 132 },
-  { 0x1, 0x1, 213, -1, 1716, 32, 1, 131 },
-  { 0x1, 0x1, 213, -1, 1718, 32, 1, 138 },
-  { 0x1, 0x1, 213, -1, 1720, 32, 1, 131 },
-  { 0x1, 0x1, 213, -1, 1722, 32, 1, 138 },
-  { 0x1, 0x1, 213, 2319, 1724, 32, 1, 131 },
-  { 0x1, 0x1, 213, 2320, 1727, 32, 1, 138 },
+  { 0x1, 0x1, 213, -1, 1194, 32, 1, 135 },
+  { 0x1, 0x1, 213, -1, 1196, 32, 1, 134 },
+  { 0x1, 0x1, 213, -1, 1198, 32, 1, 134 },
+  { 0x1, 0x1, 213, -1, 1200, 32, 1, 134 },
+  { 0x1, 0x1, 213, -1, 1202, 32, 1, 134 },
+  { 0x1, 0x1, 213, -1, 1204, 32, 1, 136 },
+  { 0x1, 0x1, 213, -1, 1206, 32, 1, 136 },
+  { 0x1, 0x1, 213, -1, 1709, 32, 1, 131 },
+  { 0x1, 0x1, 213, -1, 1711, 32, 1, 138 },
+  { 0x1, 0x1, 213, -1, 1713, 32, 1, 132 },
+  { 0x1, 0x1, 213, -1, 1715, 32, 1, 131 },
+  { 0x1, 0x1, 213, -1, 1717, 32, 1, 138 },
+  { 0x1, 0x1, 213, -1, 1719, 32, 1, 131 },
+  { 0x1, 0x1, 213, -1, 1721, 32, 1, 138 },
+  { 0x1, 0x1, 213, 2318, 1723, 32, 1, 131 },
+  { 0x1, 0x1, 213, 2319, 1726, 32, 1, 138 },
+  { 0x0, 0x0, 214, -1, 2360, 0, 0, -1 },
   { 0x0, 0x0, 214, -1, 2361, 0, 0, -1 },
-  { 0x0, 0x0, 214, -1, 2362, 0, 0, -1 },
-  { 0x0, 0x0, 214, -1, 2387, 0, 0, -1 },
-  { 0x5, 0x5, 214, -1, 2390, 20, 1, 67 },
-  { 0x0, 0x0, 218, 1847, 818, 0, 0, -1 },
-  { 0x0, 0x0, 219, -1, 957, 0, 0, -1 },
-  { 0x0, 0x0, 219, -1, 1048, 0, 0, -1 },
+  { 0x0, 0x0, 214, -1, 2386, 0, 0, -1 },
+  { 0x5, 0x5, 214, -1, 2389, 20, 1, 67 },
+  { 0x0, 0x0, 218, 1846, 817, 0, 0, -1 },
+  { 0x0, 0x0, 219, -1, 956, 0, 0, -1 },
+  { 0x0, 0x0, 219, -1, 1047, 0, 0, -1 },
   { 0x0, 0x0, 219, -1, -1, 0, 1, 121 },
   { 0x0, 0x0, 219, -1, -1, 0, 1, 66 },
-  { 0x1, 0x1, 219, 694, 1921, 36, 1, 65 },
-  { 0x1, 0x1, 219, 695, 1956, 36, 1, 65 },
-  { 0x0, 0x0, 219, 696, 1959, 0, 0, -1 },
-  { 0x1, 0x1, 219, 697, -1, 36, 1, 65 },
+  { 0x1, 0x1, 219, 693, 1920, 36, 1, 65 },
+  { 0x1, 0x1, 219, 694, 1955, 36, 1, 65 },
+  { 0x0, 0x0, 219, 695, 1958, 0, 0, -1 },
+  { 0x1, 0x1, 219, 696, -1, 36, 1, 65 },
+  { 0x0, 0x0, 219, 1191, -1, 0, 1, 33 },
+  { 0x1, 0x1, 219, 697, 1963, 36, 1, 65 },
+  { 0x0, 0x0, 219, 698, 1966, 0, 0, -1 },
+  { 0x1, 0x1, 219, 699, -1, 36, 1, 65 },
+  { 0x0, 0x0, 219, 700, 1969, 0, 0, -1 },
+  { 0x1, 0x1, 219, 701, -1, 36, 1, 65 },
+  { 0x1, 0x1, 219, 702, 1972, 36, 1, 65 },
+  { 0x1, 0x1, 219, 703, 1975, 36, 1, 65 },
   { 0x0, 0x0, 219, 1192, -1, 0, 1, 33 },
-  { 0x1, 0x1, 219, 698, 1964, 36, 1, 65 },
-  { 0x0, 0x0, 219, 699, 1967, 0, 0, -1 },
-  { 0x1, 0x1, 219, 700, -1, 36, 1, 65 },
-  { 0x0, 0x0, 219, 701, 1970, 0, 0, -1 },
-  { 0x1, 0x1, 219, 702, -1, 36, 1, 65 },
-  { 0x1, 0x1, 219, 703, 1973, 36, 1, 65 },
-  { 0x1, 0x1, 219, 704, 1976, 36, 1, 65 },
-  { 0x0, 0x0, 219, 1193, -1, 0, 1, 33 },
-  { 0x1, 0x1, 219, 705, 2009, 36, 1, 65 },
-  { 0x1, 0x1, 219, 706, -1, 31, 1, 137 },
-  { 0x1, 0x1, 219, 223, 1208, 32, 1, 126 },
-  { 0x1, 0x1, 219, 224, 1217, 32, 1, 126 },
-  { 0x1, 0x1, 219, 225, 1226, 32, 1, 126 },
-  { 0x1, 0x1, 219, 226, 1237, 32, 1, 126 },
-  { 0x1, 0x1, 219, 227, 1246, 32, 1, 126 },
-  { 0x1, 0x1, 219, 228, 1255, 32, 1, 126 },
-  { 0x1, 0x1, 219, 229, 1264, 32, 1, 126 },
-  { 0x1, 0x1, 219, 230, 1273, 32, 1, 126 },
-  { 0x1, 0x1, 219, 231, 1282, 32, 1, 126 },
-  { 0x1, 0x1, 219, 232, 1291, 32, 1, 126 },
-  { 0x1, 0x1, 219, 233, 1301, 32, 1, 126 },
-  { 0x1, 0x1, 219, 234, 1311, 32, 1, 126 },
-  { 0x1, 0x1, 219, 235, 1324, 32, 1, 141 },
-  { 0x1, 0x1, 219, 236, 1330, 32, 1, 141 },
-  { 0x1, 0x1, 219, 237, 1336, 32, 1, 141 },
-  { 0x1, 0x1, 219, 238, 1342, 32, 1, 141 },
-  { 0x1, 0x1, 219, 239, 1348, 32, 1, 141 },
-  { 0x1, 0x1, 219, 240, 1354, 32, 1, 141 },
-  { 0x1, 0x1, 219, 241, 1360, 32, 1, 141 },
-  { 0x1, 0x1, 219, 242, 1366, 32, 1, 141 },
-  { 0x1, 0x1, 219, 243, 1372, 32, 1, 141 },
-  { 0x1, 0x1, 219, 244, 1378, 32, 1, 141 },
-  { 0x1, 0x1, 219, 245, 1384, 32, 1, 141 },
-  { 0x1, 0x1, 219, 246, 1390, 32, 1, 141 },
-  { 0x1, 0x1, 219, 247, 1396, 32, 1, 141 },
-  { 0x1, 0x1, 219, 248, 1402, 32, 1, 141 },
-  { 0x1, 0x1, 219, 249, 1408, 32, 1, 141 },
-  { 0x1, 0x1, 219, 250, 1414, 32, 1, 141 },
-  { 0x1, 0x1, 219, 251, 1420, 32, 1, 141 },
-  { 0x1, 0x1, 219, 252, 1426, 32, 1, 141 },
-  { 0x1, 0x1, 219, 710, -1, 31, 1, 150 },
-  { 0x0, 0x0, 220, 2012, -1, 0, 1, 65 },
-  { 0x0, 0x0, 220, 2013, -1, 0, 1, 28 },
+  { 0x1, 0x1, 219, 704, 2008, 36, 1, 65 },
+  { 0x1, 0x1, 219, 705, -1, 31, 1, 137 },
+  { 0x1, 0x1, 219, 222, 1207, 32, 1, 126 },
+  { 0x1, 0x1, 219, 223, 1216, 32, 1, 126 },
+  { 0x1, 0x1, 219, 224, 1225, 32, 1, 126 },
+  { 0x1, 0x1, 219, 225, 1236, 32, 1, 126 },
+  { 0x1, 0x1, 219, 226, 1245, 32, 1, 126 },
+  { 0x1, 0x1, 219, 227, 1254, 32, 1, 126 },
+  { 0x1, 0x1, 219, 228, 1263, 32, 1, 126 },
+  { 0x1, 0x1, 219, 229, 1272, 32, 1, 126 },
+  { 0x1, 0x1, 219, 230, 1281, 32, 1, 126 },
+  { 0x1, 0x1, 219, 231, 1290, 32, 1, 126 },
+  { 0x1, 0x1, 219, 232, 1300, 32, 1, 126 },
+  { 0x1, 0x1, 219, 233, 1310, 32, 1, 126 },
+  { 0x1, 0x1, 219, 234, 1323, 32, 1, 141 },
+  { 0x1, 0x1, 219, 235, 1329, 32, 1, 146 },
+  { 0x1, 0x1, 219, 236, 1335, 32, 1, 146 },
+  { 0x1, 0x1, 219, 237, 1341, 32, 1, 141 },
+  { 0x1, 0x1, 219, 238, 1347, 32, 1, 146 },
+  { 0x1, 0x1, 219, 239, 1353, 32, 1, 146 },
+  { 0x1, 0x1, 219, 240, 1359, 32, 1, 141 },
+  { 0x1, 0x1, 219, 241, 1365, 32, 1, 146 },
+  { 0x1, 0x1, 219, 242, 1371, 32, 1, 146 },
+  { 0x1, 0x1, 219, 243, 1377, 32, 1, 141 },
+  { 0x1, 0x1, 219, 244, 1383, 32, 1, 146 },
+  { 0x1, 0x1, 219, 245, 1389, 32, 1, 141 },
+  { 0x1, 0x1, 219, 246, 1395, 32, 1, 146 },
+  { 0x1, 0x1, 219, 247, 1401, 32, 1, 141 },
+  { 0x1, 0x1, 219, 248, 1407, 32, 1, 146 },
+  { 0x1, 0x1, 219, 249, 1413, 32, 1, 141 },
+  { 0x1, 0x1, 219, 250, 1419, 32, 1, 146 },
+  { 0x1, 0x1, 219, 251, 1425, 32, 1, 146 },
+  { 0x1, 0x1, 219, 709, -1, 31, 1, 155 },
+  { 0x0, 0x0, 220, 2011, -1, 0, 1, 65 },
+  { 0x0, 0x0, 220, 2012, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 24, -1, 0, 1, 28 },
+  { 0x0, 0x0, 220, 2014, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 2015, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2016, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2017, -1, 0, 1, 44 },
-  { 0x0, 0x0, 220, 2018, -1, 0, 1, 39 },
-  { 0x1, 0x1, 220, 2019, -1, 12, 1, 58 },
-  { 0x0, 0x0, 220, 2020, -1, 0, 1, 53 },
-  { 0x1000001, 0x1000001, 220, 2021, -1, 12, 1, 58 },
-  { 0x1, 0x1, 220, 2022, -1, 36, 1, 53 },
-  { 0x200001, 0x200001, 220, 2023, -1, 12, 1, 58 },
-  { 0x1, 0x1, 220, 2024, -1, 33, 1, 53 },
-  { 0x1200001, 0x1200001, 220, 2025, -1, 12, 1, 48 },
-  { 0x9, 0x9, 220, 2026, -1, 33, 1, 48 },
-  { 0x1, 0x1, 220, 2027, -1, 12, 1, 58 },
-  { 0x0, 0x0, 220, 2028, -1, 0, 1, 53 },
-  { 0x200001, 0x1200001, 220, 2029, -1, 12, 1, 58 },
-  { 0x1, 0x9, 220, 2030, -1, 33, 1, 53 },
-  { 0x1, 0x1, 220, 2031, -1, 12, 1, 58 },
-  { 0x0, 0x0, 220, 2032, -1, 0, 1, 53 },
-  { 0x1000001, 0x1000001, 220, 2033, -1, 12, 1, 58 },
-  { 0x1, 0x1, 220, 2034, -1, 36, 1, 53 },
-  { 0x200001, 0x200001, 220, 2035, -1, 12, 1, 58 },
-  { 0x1, 0x1, 220, 2036, -1, 33, 1, 53 },
-  { 0x1200001, 0x1200001, 220, 2037, -1, 12, 1, 48 },
-  { 0x9, 0x9, 220, 2038, -1, 33, 1, 48 },
-  { 0x1, 0x1, 220, 2039, -1, 12, 1, 58 },
-  { 0x0, 0x0, 220, 2040, -1, 0, 1, 53 },
-  { 0x200001, 0x1200001, 220, 2041, -1, 12, 1, 58 },
-  { 0x1, 0x9, 220, 2042, -1, 33, 1, 53 },
-  { 0x1, 0x1, 220, 2043, -1, 28, 1, 28 },
-  { 0x0, 0x0, 220, 2044, -1, 0, 1, 28 },
-  { 0x3, 0x3, 220, 2045, -1, 27, 1, 28 },
-  { 0x1, 0x1, 220, 2046, -1, 27, 1, 28 },
-  { 0x0, 0x0, 220, 2047, -1, 0, 1, 65 },
+  { 0x0, 0x0, 220, 2016, -1, 0, 1, 44 },
+  { 0x0, 0x0, 220, 2017, -1, 0, 1, 39 },
+  { 0x1, 0x1, 220, 2018, -1, 12, 1, 58 },
+  { 0x0, 0x0, 220, 2019, -1, 0, 1, 53 },
+  { 0x1000001, 0x1000001, 220, 2020, -1, 12, 1, 58 },
+  { 0x1, 0x1, 220, 2021, -1, 36, 1, 53 },
+  { 0x200001, 0x200001, 220, 2022, -1, 12, 1, 58 },
+  { 0x1, 0x1, 220, 2023, -1, 33, 1, 53 },
+  { 0x1200001, 0x1200001, 220, 2024, -1, 12, 1, 48 },
+  { 0x9, 0x9, 220, 2025, -1, 33, 1, 48 },
+  { 0x1, 0x1, 220, 2026, -1, 12, 1, 58 },
+  { 0x0, 0x0, 220, 2027, -1, 0, 1, 53 },
+  { 0x200001, 0x1200001, 220, 2028, -1, 12, 1, 58 },
+  { 0x1, 0x9, 220, 2029, -1, 33, 1, 53 },
+  { 0x1, 0x1, 220, 2030, -1, 12, 1, 58 },
+  { 0x0, 0x0, 220, 2031, -1, 0, 1, 53 },
+  { 0x1000001, 0x1000001, 220, 2032, -1, 12, 1, 58 },
+  { 0x1, 0x1, 220, 2033, -1, 36, 1, 53 },
+  { 0x200001, 0x200001, 220, 2034, -1, 12, 1, 58 },
+  { 0x1, 0x1, 220, 2035, -1, 33, 1, 53 },
+  { 0x1200001, 0x1200001, 220, 2036, -1, 12, 1, 48 },
+  { 0x9, 0x9, 220, 2037, -1, 33, 1, 48 },
+  { 0x1, 0x1, 220, 2038, -1, 12, 1, 58 },
+  { 0x0, 0x0, 220, 2039, -1, 0, 1, 53 },
+  { 0x200001, 0x1200001, 220, 2040, -1, 12, 1, 58 },
+  { 0x1, 0x9, 220, 2041, -1, 33, 1, 53 },
+  { 0x1, 0x1, 220, 2042, -1, 28, 1, 28 },
+  { 0x0, 0x0, 220, 2043, -1, 0, 1, 28 },
+  { 0x3, 0x3, 220, 2044, -1, 27, 1, 28 },
+  { 0x1, 0x1, 220, 2045, -1, 27, 1, 28 },
+  { 0x0, 0x0, 220, 2046, -1, 0, 1, 65 },
+  { 0x0, 0x0, 220, 2047, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 2048, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2049, -1, 0, 1, 28 },
-  { 0x1, 0x1, 220, 2050, -1, 36, 1, 65 },
-  { 0x1, 0x1, 220, 2051, -1, 37, 1, 28 },
+  { 0x1, 0x1, 220, 2049, -1, 36, 1, 65 },
+  { 0x1, 0x1, 220, 2050, -1, 37, 1, 28 },
+  { 0x0, 0x0, 220, 2051, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 2052, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 2053, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2054, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2055, -1, 0, 1, 65 },
-  { 0x0, 0x0, 220, 2056, -1, 0, 1, 28 },
+  { 0x0, 0x0, 220, 2054, -1, 0, 1, 65 },
+  { 0x0, 0x0, 220, 2055, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 36, -1, 0, 1, 28 },
-  { 0x1, 0x1, 220, 2058, -1, 36, 1, 65 },
-  { 0x1, 0x1, 220, 2059, -1, 37, 1, 28 },
-  { 0x0, 0x0, 220, 2060, -1, 0, 1, 28 },
-  { 0x1, 0x1, 220, 2061, -1, 36, 1, 65 },
-  { 0x1, 0x1, 220, 2062, -1, 37, 1, 28 },
-  { 0x0, 0x0, 220, 2063, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2064, -1, 0, 1, 65 },
-  { 0x0, 0x0, 220, 2065, -1, 0, 1, 28 },
+  { 0x1, 0x1, 220, 2057, -1, 36, 1, 65 },
+  { 0x1, 0x1, 220, 2058, -1, 37, 1, 28 },
+  { 0x0, 0x0, 220, 2059, -1, 0, 1, 28 },
+  { 0x1, 0x1, 220, 2060, -1, 36, 1, 65 },
+  { 0x1, 0x1, 220, 2061, -1, 37, 1, 28 },
+  { 0x0, 0x0, 220, 2062, -1, 0, 1, 28 },
+  { 0x0, 0x0, 220, 2063, -1, 0, 1, 65 },
+  { 0x0, 0x0, 220, 2064, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 41, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2067, -1, 0, 1, 65 },
-  { 0x0, 0x0, 220, 2068, -1, 0, 1, 28 },
+  { 0x0, 0x0, 220, 2066, -1, 0, 1, 65 },
+  { 0x0, 0x0, 220, 2067, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 42, -1, 0, 1, 28 },
+  { 0x0, 0x0, 220, 2069, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 2070, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2071, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2072, -1, 0, 1, 48 },
-  { 0x1, 0x1, 220, 2073, -1, 27, 1, 48 },
-  { 0x1, 0x1, 220, 2074, -1, 28, 1, 48 },
-  { 0x3, 0x3, 220, 2075, -1, 27, 1, 48 },
-  { 0x1, 0x1, 220, 2076, -1, 29, 1, 48 },
-  { 0x5, 0x5, 220, 2077, -1, 27, 1, 48 },
-  { 0x3, 0x3, 220, 2078, -1, 28, 1, 48 },
-  { 0x7, 0x7, 220, 2079, -1, 27, 1, 48 },
+  { 0x0, 0x0, 220, 2071, -1, 0, 1, 48 },
+  { 0x1, 0x1, 220, 2072, -1, 27, 1, 48 },
+  { 0x1, 0x1, 220, 2073, -1, 28, 1, 48 },
+  { 0x3, 0x3, 220, 2074, -1, 27, 1, 48 },
+  { 0x1, 0x1, 220, 2075, -1, 29, 1, 48 },
+  { 0x5, 0x5, 220, 2076, -1, 27, 1, 48 },
+  { 0x3, 0x3, 220, 2077, -1, 28, 1, 48 },
+  { 0x7, 0x7, 220, 2078, -1, 27, 1, 48 },
+  { 0x0, 0x0, 220, 2079, -1, 0, 1, 48 },
   { 0x0, 0x0, 220, 2080, -1, 0, 1, 48 },
   { 0x0, 0x0, 220, 2081, -1, 0, 1, 48 },
   { 0x0, 0x0, 220, 2082, -1, 0, 1, 48 },
-  { 0x0, 0x0, 220, 2083, -1, 0, 1, 48 },
-  { 0x1, 0x1, 220, 2084, -1, 28, 1, 28 },
-  { 0x0, 0x0, 220, 2085, -1, 0, 1, 28 },
-  { 0x3, 0x3, 220, 2086, -1, 27, 1, 28 },
-  { 0x1, 0x1, 220, 2087, -1, 27, 1, 28 },
+  { 0x1, 0x1, 220, 2083, -1, 28, 1, 28 },
+  { 0x0, 0x0, 220, 2084, -1, 0, 1, 28 },
+  { 0x3, 0x3, 220, 2085, -1, 27, 1, 28 },
+  { 0x1, 0x1, 220, 2086, -1, 27, 1, 28 },
+  { 0x0, 0x0, 220, 2087, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 2088, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 2089, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2090, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 51, -1, 0, 1, 28 },
+  { 0x0, 0x0, 220, 2091, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 2092, -1, 0, 1, 28 },
-  { 0x0, 0x0, 220, 2093, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 56, -1, 0, 1, 28 },
+  { 0x0, 0x0, 220, 2094, -1, 0, 1, 23 },
   { 0x0, 0x0, 220, 2095, -1, 0, 1, 23 },
   { 0x0, 0x0, 220, 2096, -1, 0, 1, 23 },
   { 0x0, 0x0, 220, 2097, -1, 0, 1, 23 },
-  { 0x0, 0x0, 220, 2098, -1, 0, 1, 23 },
-  { 0x0, 0x0, 220, 2099, -1, 0, 1, 34 },
-  { 0x0, 0x0, 220, 2100, -1, 0, 1, 65 },
-  { 0x0, 0x0, 220, 2101, -1, 0, 1, 28 },
+  { 0x0, 0x0, 220, 2098, -1, 0, 1, 34 },
+  { 0x0, 0x0, 220, 2099, -1, 0, 1, 65 },
+  { 0x0, 0x0, 220, 2100, -1, 0, 1, 28 },
   { 0x0, 0x0, 220, 63, -1, 0, 1, 28 },
-  { 0x1, 0x1, 221, 2103, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2102, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2103, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2104, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2105, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2106, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2107, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2108, -1, 34, 1, 45 },
-  { 0x1, 0x1, 221, 2109, -1, 34, 1, 41 },
-  { 0x400001, 0x400001, 221, 2110, -1, 12, 1, 60 },
-  { 0x1, 0x1, 221, 2111, -1, 34, 1, 55 },
-  { 0x1400001, 0x1400001, 221, 2112, -1, 12, 1, 60 },
-  { 0x5, 0x5, 221, 2113, -1, 34, 1, 55 },
-  { 0x600001, 0x600001, 221, 2114, -1, 12, 1, 60 },
-  { 0x3, 0x3, 221, 2115, -1, 33, 1, 55 },
-  { 0x1600001, 0x1600001, 221, 2116, -1, 12, 1, 50 },
-  { 0xb, 0xb, 221, 2117, -1, 33, 1, 50 },
-  { 0x400001, 0x400001, 221, 2118, -1, 12, 1, 60 },
-  { 0x1, 0x1, 221, 2119, -1, 34, 1, 55 },
-  { 0x600001, 0x1600001, 221, 2120, -1, 12, 1, 60 },
-  { 0x3, 0xb, 221, 2121, -1, 33, 1, 55 },
-  { 0x400001, 0x400001, 221, 2122, -1, 12, 1, 60 },
-  { 0x1, 0x1, 221, 2123, -1, 34, 1, 55 },
-  { 0x1400001, 0x1400001, 221, 2124, -1, 12, 1, 60 },
-  { 0x5, 0x5, 221, 2125, -1, 34, 1, 55 },
-  { 0x600001, 0x600001, 221, 2126, -1, 12, 1, 60 },
-  { 0x3, 0x3, 221, 2127, -1, 33, 1, 55 },
-  { 0x1600001, 0x1600001, 221, 2128, -1, 12, 1, 50 },
-  { 0xb, 0xb, 221, 2129, -1, 33, 1, 50 },
-  { 0x400001, 0x400001, 221, 2130, -1, 12, 1, 60 },
-  { 0x1, 0x1, 221, 2131, -1, 34, 1, 55 },
-  { 0x600001, 0x1600001, 221, 2132, -1, 12, 1, 60 },
-  { 0x3, 0xb, 221, 2133, -1, 33, 1, 55 },
-  { 0x41, 0x41, 221, 2134, -1, 28, 1, 30 },
-  { 0x1, 0x1, 221, 2135, -1, 34, 1, 30 },
-  { 0x83, 0x83, 221, 2136, -1, 27, 1, 30 },
-  { 0x81, 0x81, 221, 2137, -1, 27, 1, 30 },
-  { 0x1, 0x1, 221, 2138, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2107, -1, 34, 1, 45 },
+  { 0x1, 0x1, 221, 2108, -1, 34, 1, 41 },
+  { 0x400001, 0x400001, 221, 2109, -1, 12, 1, 60 },
+  { 0x1, 0x1, 221, 2110, -1, 34, 1, 55 },
+  { 0x1400001, 0x1400001, 221, 2111, -1, 12, 1, 60 },
+  { 0x5, 0x5, 221, 2112, -1, 34, 1, 55 },
+  { 0x600001, 0x600001, 221, 2113, -1, 12, 1, 60 },
+  { 0x3, 0x3, 221, 2114, -1, 33, 1, 55 },
+  { 0x1600001, 0x1600001, 221, 2115, -1, 12, 1, 50 },
+  { 0xb, 0xb, 221, 2116, -1, 33, 1, 50 },
+  { 0x400001, 0x400001, 221, 2117, -1, 12, 1, 60 },
+  { 0x1, 0x1, 221, 2118, -1, 34, 1, 55 },
+  { 0x600001, 0x1600001, 221, 2119, -1, 12, 1, 60 },
+  { 0x3, 0xb, 221, 2120, -1, 33, 1, 55 },
+  { 0x400001, 0x400001, 221, 2121, -1, 12, 1, 60 },
+  { 0x1, 0x1, 221, 2122, -1, 34, 1, 55 },
+  { 0x1400001, 0x1400001, 221, 2123, -1, 12, 1, 60 },
+  { 0x5, 0x5, 221, 2124, -1, 34, 1, 55 },
+  { 0x600001, 0x600001, 221, 2125, -1, 12, 1, 60 },
+  { 0x3, 0x3, 221, 2126, -1, 33, 1, 55 },
+  { 0x1600001, 0x1600001, 221, 2127, -1, 12, 1, 50 },
+  { 0xb, 0xb, 221, 2128, -1, 33, 1, 50 },
+  { 0x400001, 0x400001, 221, 2129, -1, 12, 1, 60 },
+  { 0x1, 0x1, 221, 2130, -1, 34, 1, 55 },
+  { 0x600001, 0x1600001, 221, 2131, -1, 12, 1, 60 },
+  { 0x3, 0xb, 221, 2132, -1, 33, 1, 55 },
+  { 0x41, 0x41, 221, 2133, -1, 28, 1, 30 },
+  { 0x1, 0x1, 221, 2134, -1, 34, 1, 30 },
+  { 0x83, 0x83, 221, 2135, -1, 27, 1, 30 },
+  { 0x81, 0x81, 221, 2136, -1, 27, 1, 30 },
+  { 0x1, 0x1, 221, 2137, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2138, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2139, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2140, -1, 34, 1, 30 },
-  { 0x5, 0x5, 221, 2141, -1, 34, 1, 65 },
-  { 0x9, 0x9, 221, 2142, -1, 34, 1, 30 },
+  { 0x5, 0x5, 221, 2140, -1, 34, 1, 65 },
+  { 0x9, 0x9, 221, 2141, -1, 34, 1, 30 },
+  { 0x1, 0x1, 221, 2142, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2143, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2144, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2145, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2146, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2145, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2146, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2147, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2148, -1, 34, 1, 30 },
-  { 0x5, 0x5, 221, 2149, -1, 34, 1, 65 },
-  { 0x9, 0x9, 221, 2150, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2151, -1, 34, 1, 30 },
-  { 0x5, 0x5, 221, 2152, -1, 34, 1, 65 },
-  { 0x9, 0x9, 221, 2153, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2154, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2155, -1, 34, 1, 65 },
+  { 0x5, 0x5, 221, 2148, -1, 34, 1, 65 },
+  { 0x9, 0x9, 221, 2149, -1, 34, 1, 30 },
+  { 0x1, 0x1, 221, 2150, -1, 34, 1, 30 },
+  { 0x5, 0x5, 221, 2151, -1, 34, 1, 65 },
+  { 0x9, 0x9, 221, 2152, -1, 34, 1, 30 },
+  { 0x1, 0x1, 221, 2153, -1, 34, 1, 30 },
+  { 0x1, 0x1, 221, 2154, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2155, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2156, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2157, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2158, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2157, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2158, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2159, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2160, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2161, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2162, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2163, -1, 34, 1, 50 },
-  { 0x81, 0x81, 221, 2164, -1, 27, 1, 50 },
-  { 0x41, 0x41, 221, 2165, -1, 28, 1, 50 },
-  { 0x83, 0x83, 221, 2166, -1, 27, 1, 50 },
-  { 0x21, 0x21, 221, 2167, -1, 29, 1, 50 },
-  { 0x85, 0x85, 221, 2168, -1, 27, 1, 50 },
-  { 0x43, 0x43, 221, 2169, -1, 28, 1, 50 },
-  { 0x87, 0x87, 221, 2170, -1, 27, 1, 50 },
+  { 0x1, 0x1, 221, 2162, -1, 34, 1, 50 },
+  { 0x81, 0x81, 221, 2163, -1, 27, 1, 50 },
+  { 0x41, 0x41, 221, 2164, -1, 28, 1, 50 },
+  { 0x83, 0x83, 221, 2165, -1, 27, 1, 50 },
+  { 0x21, 0x21, 221, 2166, -1, 29, 1, 50 },
+  { 0x85, 0x85, 221, 2167, -1, 27, 1, 50 },
+  { 0x43, 0x43, 221, 2168, -1, 28, 1, 50 },
+  { 0x87, 0x87, 221, 2169, -1, 27, 1, 50 },
+  { 0x1, 0x1, 221, 2170, -1, 34, 1, 50 },
   { 0x1, 0x1, 221, 2171, -1, 34, 1, 50 },
   { 0x1, 0x1, 221, 2172, -1, 34, 1, 50 },
   { 0x1, 0x1, 221, 2173, -1, 34, 1, 50 },
-  { 0x1, 0x1, 221, 2174, -1, 34, 1, 50 },
-  { 0x41, 0x41, 221, 2175, -1, 28, 1, 30 },
-  { 0x1, 0x1, 221, 2176, -1, 34, 1, 30 },
-  { 0x83, 0x83, 221, 2177, -1, 27, 1, 30 },
-  { 0x81, 0x81, 221, 2178, -1, 27, 1, 30 },
+  { 0x41, 0x41, 221, 2174, -1, 28, 1, 30 },
+  { 0x1, 0x1, 221, 2175, -1, 34, 1, 30 },
+  { 0x83, 0x83, 221, 2176, -1, 27, 1, 30 },
+  { 0x81, 0x81, 221, 2177, -1, 27, 1, 30 },
+  { 0x1, 0x1, 221, 2178, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2179, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2180, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2181, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2182, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2183, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2184, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2185, -1, 34, 1, 30 },
+  { 0x1, 0x1, 221, 2185, -1, 34, 1, 25 },
   { 0x1, 0x1, 221, 2186, -1, 34, 1, 25 },
   { 0x1, 0x1, 221, 2187, -1, 34, 1, 25 },
   { 0x1, 0x1, 221, 2188, -1, 34, 1, 25 },
-  { 0x1, 0x1, 221, 2189, -1, 34, 1, 25 },
-  { 0x1, 0x1, 221, 2190, -1, 34, 1, 36 },
-  { 0x1, 0x1, 221, 2191, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2189, -1, 34, 1, 36 },
+  { 0x1, 0x1, 221, 2190, -1, 34, 1, 65 },
+  { 0x1, 0x1, 221, 2191, -1, 34, 1, 30 },
   { 0x1, 0x1, 221, 2192, -1, 34, 1, 30 },
-  { 0x1, 0x1, 221, 2193, -1, 34, 1, 30 },
-  { 0x1, 0x1, 222, 2194, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2193, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2194, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2195, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2196, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2197, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2198, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2199, -1, 35, 1, 46 },
-  { 0x1, 0x1, 222, 2200, -1, 35, 1, 42 },
-  { 0x800001, 0x800001, 222, 2201, -1, 12, 1, 61 },
-  { 0x1, 0x1, 222, 2202, -1, 35, 1, 56 },
-  { 0x1800001, 0x1800001, 222, 2203, -1, 12, 1, 61 },
-  { 0x3, 0x3, 222, 2204, -1, 35, 1, 56 },
-  { 0xa00001, 0xa00001, 222, 2205, -1, 12, 1, 61 },
-  { 0x5, 0x5, 222, 2206, -1, 33, 1, 56 },
-  { 0x1a00001, 0x1a00001, 222, 2207, -1, 12, 1, 51 },
-  { 0xd, 0xd, 222, 2208, -1, 33, 1, 51 },
-  { 0x800001, 0x800001, 222, 2209, -1, 12, 1, 61 },
-  { 0x1, 0x1, 222, 2210, -1, 35, 1, 56 },
-  { 0xa00001, 0x1a00001, 222, 2211, -1, 12, 1, 61 },
-  { 0x5, 0xd, 222, 2212, -1, 33, 1, 56 },
-  { 0x800001, 0x800001, 222, 2213, -1, 12, 1, 61 },
-  { 0x1, 0x1, 222, 2214, -1, 35, 1, 56 },
-  { 0x1800001, 0x1800001, 222, 2215, -1, 12, 1, 61 },
-  { 0x3, 0x3, 222, 2216, -1, 35, 1, 56 },
-  { 0xa00001, 0xa00001, 222, 2217, -1, 12, 1, 61 },
-  { 0x5, 0x5, 222, 2218, -1, 33, 1, 56 },
-  { 0x1a00001, 0x1a00001, 222, 2219, -1, 12, 1, 51 },
-  { 0xd, 0xd, 222, 2220, -1, 33, 1, 51 },
-  { 0x800001, 0x800001, 222, 2221, -1, 12, 1, 61 },
-  { 0x1, 0x1, 222, 2222, -1, 35, 1, 56 },
-  { 0xa00001, 0x1a00001, 222, 2223, -1, 12, 1, 61 },
-  { 0x5, 0xd, 222, 2224, -1, 33, 1, 56 },
-  { 0x81, 0x81, 222, 2225, -1, 28, 1, 31 },
-  { 0x1, 0x1, 222, 2226, -1, 35, 1, 31 },
-  { 0x103, 0x103, 222, 2227, -1, 27, 1, 31 },
-  { 0x101, 0x101, 222, 2228, -1, 27, 1, 31 },
-  { 0x1, 0x1, 222, 2229, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2198, -1, 35, 1, 46 },
+  { 0x1, 0x1, 222, 2199, -1, 35, 1, 42 },
+  { 0x800001, 0x800001, 222, 2200, -1, 12, 1, 61 },
+  { 0x1, 0x1, 222, 2201, -1, 35, 1, 56 },
+  { 0x1800001, 0x1800001, 222, 2202, -1, 12, 1, 61 },
+  { 0x3, 0x3, 222, 2203, -1, 35, 1, 56 },
+  { 0xa00001, 0xa00001, 222, 2204, -1, 12, 1, 61 },
+  { 0x5, 0x5, 222, 2205, -1, 33, 1, 56 },
+  { 0x1a00001, 0x1a00001, 222, 2206, -1, 12, 1, 51 },
+  { 0xd, 0xd, 222, 2207, -1, 33, 1, 51 },
+  { 0x800001, 0x800001, 222, 2208, -1, 12, 1, 61 },
+  { 0x1, 0x1, 222, 2209, -1, 35, 1, 56 },
+  { 0xa00001, 0x1a00001, 222, 2210, -1, 12, 1, 61 },
+  { 0x5, 0xd, 222, 2211, -1, 33, 1, 56 },
+  { 0x800001, 0x800001, 222, 2212, -1, 12, 1, 61 },
+  { 0x1, 0x1, 222, 2213, -1, 35, 1, 56 },
+  { 0x1800001, 0x1800001, 222, 2214, -1, 12, 1, 61 },
+  { 0x3, 0x3, 222, 2215, -1, 35, 1, 56 },
+  { 0xa00001, 0xa00001, 222, 2216, -1, 12, 1, 61 },
+  { 0x5, 0x5, 222, 2217, -1, 33, 1, 56 },
+  { 0x1a00001, 0x1a00001, 222, 2218, -1, 12, 1, 51 },
+  { 0xd, 0xd, 222, 2219, -1, 33, 1, 51 },
+  { 0x800001, 0x800001, 222, 2220, -1, 12, 1, 61 },
+  { 0x1, 0x1, 222, 2221, -1, 35, 1, 56 },
+  { 0xa00001, 0x1a00001, 222, 2222, -1, 12, 1, 61 },
+  { 0x5, 0xd, 222, 2223, -1, 33, 1, 56 },
+  { 0x81, 0x81, 222, 2224, -1, 28, 1, 31 },
+  { 0x1, 0x1, 222, 2225, -1, 35, 1, 31 },
+  { 0x103, 0x103, 222, 2226, -1, 27, 1, 31 },
+  { 0x101, 0x101, 222, 2227, -1, 27, 1, 31 },
+  { 0x1, 0x1, 222, 2228, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2229, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2230, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2231, -1, 35, 1, 31 },
-  { 0x3, 0x3, 222, 2232, -1, 35, 1, 65 },
-  { 0x5, 0x5, 222, 2233, -1, 35, 1, 31 },
+  { 0x3, 0x3, 222, 2231, -1, 35, 1, 65 },
+  { 0x5, 0x5, 222, 2232, -1, 35, 1, 31 },
+  { 0x1, 0x1, 222, 2233, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2234, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2235, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2236, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2237, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2236, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2237, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2238, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2239, -1, 35, 1, 31 },
-  { 0x3, 0x3, 222, 2240, -1, 35, 1, 65 },
-  { 0x5, 0x5, 222, 2241, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2242, -1, 35, 1, 31 },
-  { 0x3, 0x3, 222, 2243, -1, 35, 1, 65 },
-  { 0x5, 0x5, 222, 2244, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2245, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2246, -1, 35, 1, 65 },
+  { 0x3, 0x3, 222, 2239, -1, 35, 1, 65 },
+  { 0x5, 0x5, 222, 2240, -1, 35, 1, 31 },
+  { 0x1, 0x1, 222, 2241, -1, 35, 1, 31 },
+  { 0x3, 0x3, 222, 2242, -1, 35, 1, 65 },
+  { 0x5, 0x5, 222, 2243, -1, 35, 1, 31 },
+  { 0x1, 0x1, 222, 2244, -1, 35, 1, 31 },
+  { 0x1, 0x1, 222, 2245, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2246, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2247, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2248, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2249, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2248, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2249, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2250, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2251, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2252, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2253, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2254, -1, 35, 1, 51 },
-  { 0x101, 0x101, 222, 2255, -1, 27, 1, 51 },
-  { 0x81, 0x81, 222, 2256, -1, 28, 1, 51 },
-  { 0x103, 0x103, 222, 2257, -1, 27, 1, 51 },
-  { 0x41, 0x41, 222, 2258, -1, 29, 1, 51 },
-  { 0x105, 0x105, 222, 2259, -1, 27, 1, 51 },
-  { 0x83, 0x83, 222, 2260, -1, 28, 1, 51 },
-  { 0x107, 0x107, 222, 2261, -1, 27, 1, 51 },
+  { 0x1, 0x1, 222, 2253, -1, 35, 1, 51 },
+  { 0x101, 0x101, 222, 2254, -1, 27, 1, 51 },
+  { 0x81, 0x81, 222, 2255, -1, 28, 1, 51 },
+  { 0x103, 0x103, 222, 2256, -1, 27, 1, 51 },
+  { 0x41, 0x41, 222, 2257, -1, 29, 1, 51 },
+  { 0x105, 0x105, 222, 2258, -1, 27, 1, 51 },
+  { 0x83, 0x83, 222, 2259, -1, 28, 1, 51 },
+  { 0x107, 0x107, 222, 2260, -1, 27, 1, 51 },
+  { 0x1, 0x1, 222, 2261, -1, 35, 1, 51 },
   { 0x1, 0x1, 222, 2262, -1, 35, 1, 51 },
   { 0x1, 0x1, 222, 2263, -1, 35, 1, 51 },
   { 0x1, 0x1, 222, 2264, -1, 35, 1, 51 },
-  { 0x1, 0x1, 222, 2265, -1, 35, 1, 51 },
-  { 0x81, 0x81, 222, 2266, -1, 28, 1, 31 },
-  { 0x1, 0x1, 222, 2267, -1, 35, 1, 31 },
-  { 0x103, 0x103, 222, 2268, -1, 27, 1, 31 },
-  { 0x101, 0x101, 222, 2269, -1, 27, 1, 31 },
+  { 0x81, 0x81, 222, 2265, -1, 28, 1, 31 },
+  { 0x1, 0x1, 222, 2266, -1, 35, 1, 31 },
+  { 0x103, 0x103, 222, 2267, -1, 27, 1, 31 },
+  { 0x101, 0x101, 222, 2268, -1, 27, 1, 31 },
+  { 0x1, 0x1, 222, 2269, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2270, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2271, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2272, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2273, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2274, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2275, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2276, -1, 35, 1, 31 },
+  { 0x1, 0x1, 222, 2276, -1, 35, 1, 26 },
   { 0x1, 0x1, 222, 2277, -1, 35, 1, 26 },
   { 0x1, 0x1, 222, 2278, -1, 35, 1, 26 },
   { 0x1, 0x1, 222, 2279, -1, 35, 1, 26 },
-  { 0x1, 0x1, 222, 2280, -1, 35, 1, 26 },
-  { 0x1, 0x1, 222, 2281, -1, 35, 1, 37 },
-  { 0x1, 0x1, 222, 2282, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2280, -1, 35, 1, 37 },
+  { 0x1, 0x1, 222, 2281, -1, 35, 1, 65 },
+  { 0x1, 0x1, 222, 2282, -1, 35, 1, 31 },
   { 0x1, 0x1, 222, 2283, -1, 35, 1, 31 },
-  { 0x1, 0x1, 222, 2284, -1, 35, 1, 31 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 65 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
-  { 0x3, 0x3, 223, 1875, -1, 34, 1, 32 },
+  { 0x3, 0x3, 223, 1874, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 47 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 43 },
   { 0xc00001, 0xc00001, 223, -1, -1, 12, 1, 62 },
-  { 0x3, 0x3, 223, 2458, -1, 34, 1, 57 },
+  { 0x3, 0x3, 223, 2457, -1, 34, 1, 57 },
   { 0x1c00001, 0x1c00001, 223, -1, -1, 12, 1, 62 },
-  { 0x7, 0x7, 223, 2459, -1, 34, 1, 57 },
+  { 0x7, 0x7, 223, 2458, -1, 34, 1, 57 },
   { 0xe00001, 0xe00001, 223, -1, -1, 12, 1, 62 },
-  { 0x7, 0x7, 223, 2460, -1, 33, 1, 57 },
+  { 0x7, 0x7, 223, 2459, -1, 33, 1, 57 },
   { 0x1e00001, 0x1e00001, 223, -1, -1, 12, 1, 52 },
-  { 0xf, 0xf, 223, 2461, -1, 33, 1, 52 },
+  { 0xf, 0xf, 223, 2460, -1, 33, 1, 52 },
   { 0xc00001, 0xc00001, 223, -1, -1, 12, 1, 62 },
-  { 0x3, 0x3, 223, 2466, -1, 34, 1, 57 },
+  { 0x3, 0x3, 223, 2465, -1, 34, 1, 57 },
   { 0xe00001, 0x1e00001, 223, -1, -1, 12, 1, 62 },
-  { 0x7, 0xf, 223, 2467, -1, 33, 1, 57 },
+  { 0x7, 0xf, 223, 2466, -1, 33, 1, 57 },
   { 0xc00001, 0xc00001, 223, -1, -1, 12, 1, 62 },
-  { 0x3, 0x3, 223, 2470, -1, 34, 1, 57 },
+  { 0x3, 0x3, 223, 2469, -1, 34, 1, 57 },
   { 0x1c00001, 0x1c00001, 223, -1, -1, 12, 1, 62 },
-  { 0x7, 0x7, 223, 2471, -1, 34, 1, 57 },
+  { 0x7, 0x7, 223, 2470, -1, 34, 1, 57 },
   { 0xe00001, 0xe00001, 223, -1, -1, 12, 1, 62 },
-  { 0x7, 0x7, 223, 2472, -1, 33, 1, 57 },
+  { 0x7, 0x7, 223, 2471, -1, 33, 1, 57 },
   { 0x1e00001, 0x1e00001, 223, -1, -1, 12, 1, 52 },
-  { 0xf, 0xf, 223, 2473, -1, 33, 1, 52 },
+  { 0xf, 0xf, 223, 2472, -1, 33, 1, 52 },
   { 0xc00001, 0xc00001, 223, -1, -1, 12, 1, 62 },
-  { 0x3, 0x3, 223, 2478, -1, 34, 1, 57 },
+  { 0x3, 0x3, 223, 2477, -1, 34, 1, 57 },
   { 0xe00001, 0x1e00001, 223, -1, -1, 12, 1, 62 },
-  { 0x7, 0xf, 223, 2479, -1, 33, 1, 57 },
+  { 0x7, 0xf, 223, 2478, -1, 33, 1, 57 },
   { 0xc1, 0xc1, 223, -1, -1, 28, 1, 32 },
-  { 0x3, 0x3, 223, 2398, -1, 34, 1, 32 },
+  { 0x3, 0x3, 223, 2397, -1, 34, 1, 32 },
   { 0x183, 0x183, 223, -1, -1, 27, 1, 32 },
-  { 0x181, 0x181, 223, 2399, -1, 27, 1, 32 },
+  { 0x181, 0x181, 223, 2398, -1, 27, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 65 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
-  { 0x3, 0x3, 223, 1876, -1, 34, 1, 32 },
+  { 0x3, 0x3, 223, 1875, -1, 34, 1, 32 },
   { 0x7, 0x7, 223, -1, -1, 34, 1, 65 },
   { 0xb, 0xb, 223, -1, -1, 34, 1, 32 },
-  { 0x3, 0x3, 223, 1877, -1, 34, 1, 32 },
+  { 0x3, 0x3, 223, 1876, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 65 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
+  { 0x3, 0x3, 223, 1879, -1, 34, 1, 32 },
+  { 0x7, 0x7, 223, -1, -1, 34, 1, 65 },
+  { 0xb, 0xb, 223, -1, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, 1880, -1, 34, 1, 32 },
   { 0x7, 0x7, 223, -1, -1, 34, 1, 65 },
   { 0xb, 0xb, 223, -1, -1, 34, 1, 32 },
-  { 0x3, 0x3, 223, 1881, -1, 34, 1, 32 },
-  { 0x7, 0x7, 223, -1, -1, 34, 1, 65 },
-  { 0xb, 0xb, 223, -1, -1, 34, 1, 32 },
-  { 0x3, 0x3, 223, 1883, -1, 34, 1, 32 },
+  { 0x3, 0x3, 223, 1882, -1, 34, 1, 32 },
+  { 0x3, 0x3, 223, -1, -1, 34, 1, 65 },
+  { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
+  { 0x3, 0x3, 223, 1884, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 65 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, 1885, -1, 34, 1, 32 },
-  { 0x3, 0x3, 223, -1, -1, 34, 1, 65 },
-  { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
-  { 0x3, 0x3, 223, 1886, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 52 },
@@ -4017,9 +4068,9 @@
   { 0x3, 0x3, 223, -1, -1, 34, 1, 52 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 52 },
   { 0xc1, 0xc1, 223, -1, -1, 28, 1, 32 },
-  { 0x3, 0x3, 223, 2402, -1, 34, 1, 32 },
+  { 0x3, 0x3, 223, 2401, -1, 34, 1, 32 },
   { 0x183, 0x183, 223, -1, -1, 27, 1, 32 },
-  { 0x181, 0x181, 223, 2403, -1, 27, 1, 32 },
+  { 0x181, 0x181, 223, 2402, -1, 27, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
@@ -4034,126 +4085,126 @@
   { 0x3, 0x3, 223, -1, -1, 34, 1, 38 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 65 },
   { 0x3, 0x3, 223, -1, -1, 34, 1, 32 },
-  { 0x3, 0x3, 223, 1888, -1, 34, 1, 32 },
-  { 0x3, 0x3, 224, 401, 1210, 32, 1, 128 },
-  { 0x3, 0x3, 224, 402, 1219, 32, 1, 128 },
-  { 0x3, 0x3, 224, 403, 1228, 32, 1, 128 },
-  { 0x3, 0x3, 224, 404, 1239, 32, 1, 128 },
-  { 0x3, 0x3, 224, 405, 1248, 32, 1, 128 },
-  { 0x3, 0x3, 224, 406, 1257, 32, 1, 128 },
-  { 0x3, 0x3, 224, 407, 1266, 32, 1, 128 },
-  { 0x3, 0x3, 224, 408, 1275, 32, 1, 128 },
-  { 0x3, 0x3, 224, 409, 1284, 32, 1, 128 },
-  { 0x3, 0x3, 224, 410, 1293, 32, 1, 128 },
-  { 0x3, 0x3, 224, 411, 1303, 32, 1, 128 },
-  { 0x3, 0x3, 224, 412, 1313, 32, 1, 128 },
-  { 0x3, 0x3, 224, 425, 1326, 32, 1, 143 },
-  { 0x3, 0x3, 224, 426, 1332, 32, 1, 143 },
-  { 0x3, 0x3, 224, 427, 1338, 32, 1, 143 },
-  { 0x3, 0x3, 224, 428, 1344, 32, 1, 143 },
-  { 0x3, 0x3, 224, 429, 1350, 32, 1, 143 },
-  { 0x3, 0x3, 224, 430, 1356, 32, 1, 143 },
-  { 0x3, 0x3, 224, 431, 1362, 32, 1, 143 },
-  { 0x3, 0x3, 224, 432, 1368, 32, 1, 143 },
-  { 0x3, 0x3, 224, 433, 1374, 32, 1, 143 },
-  { 0x3, 0x3, 224, 434, 1380, 32, 1, 143 },
-  { 0x3, 0x3, 224, 435, 1386, 32, 1, 143 },
-  { 0x3, 0x3, 224, 436, 1392, 32, 1, 143 },
-  { 0x3, 0x3, 224, 437, 1398, 32, 1, 143 },
-  { 0x3, 0x3, 224, 438, 1404, 32, 1, 143 },
-  { 0x3, 0x3, 224, 439, 1410, 32, 1, 143 },
-  { 0x3, 0x3, 224, 440, 1416, 32, 1, 143 },
-  { 0x3, 0x3, 224, 441, 1422, 32, 1, 143 },
-  { 0x3, 0x3, 224, 442, 1428, 32, 1, 143 },
+  { 0x3, 0x3, 223, 1887, -1, 34, 1, 32 },
+  { 0x3, 0x3, 224, 400, 1209, 32, 1, 128 },
+  { 0x3, 0x3, 224, 401, 1218, 32, 1, 128 },
+  { 0x3, 0x3, 224, 402, 1227, 32, 1, 128 },
+  { 0x3, 0x3, 224, 403, 1238, 32, 1, 128 },
+  { 0x3, 0x3, 224, 404, 1247, 32, 1, 128 },
+  { 0x3, 0x3, 224, 405, 1256, 32, 1, 128 },
+  { 0x3, 0x3, 224, 406, 1265, 32, 1, 128 },
+  { 0x3, 0x3, 224, 407, 1274, 32, 1, 128 },
+  { 0x3, 0x3, 224, 408, 1283, 32, 1, 128 },
+  { 0x3, 0x3, 224, 409, 1292, 32, 1, 128 },
+  { 0x3, 0x3, 224, 410, 1302, 32, 1, 128 },
+  { 0x3, 0x3, 224, 411, 1312, 32, 1, 128 },
+  { 0x3, 0x3, 224, 424, 1325, 32, 1, 143 },
+  { 0x3, 0x3, 224, 425, 1331, 32, 1, 148 },
+  { 0x3, 0x3, 224, 426, 1337, 32, 1, 148 },
+  { 0x3, 0x3, 224, 427, 1343, 32, 1, 143 },
+  { 0x3, 0x3, 224, 428, 1349, 32, 1, 148 },
+  { 0x3, 0x3, 224, 429, 1355, 32, 1, 148 },
+  { 0x3, 0x3, 224, 430, 1361, 32, 1, 143 },
+  { 0x3, 0x3, 224, 431, 1367, 32, 1, 148 },
+  { 0x3, 0x3, 224, 432, 1373, 32, 1, 148 },
+  { 0x3, 0x3, 224, 433, 1379, 32, 1, 143 },
+  { 0x3, 0x3, 224, 434, 1385, 32, 1, 148 },
+  { 0x3, 0x3, 224, 435, 1391, 32, 1, 143 },
+  { 0x3, 0x3, 224, 436, 1397, 32, 1, 148 },
+  { 0x3, 0x3, 224, 437, 1403, 32, 1, 143 },
+  { 0x3, 0x3, 224, 438, 1409, 32, 1, 148 },
+  { 0x3, 0x3, 224, 439, 1415, 32, 1, 143 },
+  { 0x3, 0x3, 224, 440, 1421, 32, 1, 148 },
+  { 0x3, 0x3, 224, 441, 1427, 32, 1, 148 },
   { 0x1, 0x1, 225, -1, -1, 28, 1, 33 },
   { 0x1, 0x1, 225, -1, -1, 28, 1, 33 },
-  { 0x0, 0x0, 232, 810, -1, 0, 1, 137 },
-  { 0x0, 0x0, 232, 811, -1, 0, 1, 150 },
-  { 0x1, 0x1, 233, -1, 1725, 33, 1, 133 },
-  { 0x1, 0x1, 233, -1, 1728, 33, 1, 139 },
-  { 0x0, 0x0, 233, -1, 1730, 0, 1, 145 },
-  { 0x0, 0x0, 233, -1, 1731, 0, 1, 145 },
-  { 0x0, 0x0, 234, 744, 823, 0, 0, -1 },
-  { 0x0, 0x0, 234, 745, 831, 0, 0, -1 },
-  { 0x0, 0x0, 234, 746, 827, 0, 0, -1 },
-  { 0x1, 0x1, 234, 747, 481, 33, 1, 6 },
-  { 0x8000001, 0x8000001, 234, 748, 489, 6, 1, 7 },
-  { 0x1, 0x1, 234, 749, 485, 33, 1, 6 },
-  { 0x0, 0x0, 234, 750, 835, 0, 0, -1 },
-  { 0x1, 0x1, 234, 751, 501, 33, 1, 8 },
-  { 0x0, 0x0, 234, 752, 839, 0, 0, -1 },
-  { 0x1, 0x1, 234, 753, 513, 33, 1, 15 },
-  { 0x0, 0x0, 234, 754, 844, 0, 0, -1 },
-  { 0x0, 0x0, 234, 755, 848, 0, 0, -1 },
-  { 0x1, 0x1, 234, 756, 536, 33, 1, 17 },
-  { 0x1, 0x1, 234, 757, 540, 33, 1, 17 },
-  { 0x0, 0x0, 234, 758, 852, 0, 0, -1 },
-  { 0x0, 0x0, 234, 759, 856, 0, 0, -1 },
-  { 0x1, 0x1, 234, 760, 560, 33, 1, 18 },
-  { 0x8000001, 0x8000001, 234, 761, 564, 6, 1, 18 },
-  { 0x0, 0x0, 234, 762, 860, 0, 0, -1 },
-  { 0x1, 0x1, 234, 763, 576, 33, 1, 19 },
-  { 0x0, 0x0, 234, 764, 864, 0, 0, -1 },
-  { 0x0, 0x0, 234, 765, 868, 0, 0, -1 },
-  { 0x1, 0x1, 234, 766, 596, 33, 1, 20 },
-  { 0x8000001, 0x8000001, 234, 767, 600, 6, 1, 20 },
-  { 0x0, 0x0, 234, 768, 872, 0, 0, -1 },
-  { 0x1, 0x1, 234, 769, 612, 33, 1, 21 },
-  { 0x0, 0x0, 234, 770, 877, 0, 0, -1 },
-  { 0x0, 0x0, 234, 771, 881, 0, 0, -1 },
-  { 0x1, 0x1, 234, 772, 635, 33, 1, 17 },
-  { 0x1, 0x1, 234, 773, 639, 33, 1, 17 },
-  { 0x0, 0x0, 234, 774, 885, 0, 0, -1 },
-  { 0x1, 0x1, 234, 775, 651, 33, 1, 21 },
-  { 0x0, 0x0, 235, 2323, 822, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2324, 830, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2325, 826, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2326, 480, 0, 1, 6 },
-  { 0x1, 0x1, 235, 2327, 488, 6, 1, 7 },
-  { 0x0, 0x0, 235, 2328, 484, 0, 1, 6 },
-  { 0x0, 0x0, 235, 2329, 834, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2330, 500, 0, 1, 8 },
-  { 0x0, 0x0, 235, 2331, 838, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2332, 512, 0, 1, 15 },
-  { 0x0, 0x0, 235, 2333, 843, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2334, 847, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2335, 535, 0, 1, 17 },
-  { 0x0, 0x0, 235, 2336, 539, 0, 1, 17 },
-  { 0x0, 0x0, 235, 2337, 851, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2338, 855, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2339, 559, 0, 1, 18 },
-  { 0x1, 0x1, 235, 2340, 563, 6, 1, 18 },
-  { 0x0, 0x0, 235, 2341, 859, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2342, 575, 0, 1, 19 },
-  { 0x0, 0x0, 235, 2343, 863, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2344, 867, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2345, 595, 0, 1, 20 },
-  { 0x1, 0x1, 235, 2346, 599, 6, 1, 20 },
-  { 0x0, 0x0, 235, 2347, 871, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2348, 611, 0, 1, 21 },
-  { 0x0, 0x0, 235, 2349, 876, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2350, 880, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2351, 634, 0, 1, 17 },
-  { 0x0, 0x0, 235, 2352, 638, 0, 1, 17 },
-  { 0x0, 0x0, 235, 2353, 884, 0, 0, -1 },
-  { 0x0, 0x0, 235, 2354, 650, 0, 1, 21 },
-  { 0x1, 0x1, 235, 776, 973, 27, 1, 16 },
-  { 0x0, 0x0, 235, 777, 971, 0, 1, 16 },
-  { 0x0, 0x0, 235, 1021, 975, 0, 1, 22 },
-  { 0x0, 0x1, 235, 983, 981, 20, 1, 67 },
-  { 0x0, 0x0, 235, 110, 979, 0, 1, 67 },
+  { 0x0, 0x0, 232, 809, -1, 0, 1, 137 },
+  { 0x0, 0x0, 232, 810, -1, 0, 1, 155 },
+  { 0x1, 0x1, 233, -1, 1724, 33, 1, 133 },
+  { 0x1, 0x1, 233, -1, 1727, 33, 1, 139 },
+  { 0x0, 0x0, 233, -1, 1729, 0, 1, 150 },
+  { 0x0, 0x0, 233, -1, 1730, 0, 1, 156 },
+  { 0x0, 0x0, 234, 743, 822, 0, 0, -1 },
+  { 0x0, 0x0, 234, 744, 830, 0, 0, -1 },
+  { 0x0, 0x0, 234, 745, 826, 0, 0, -1 },
+  { 0x1, 0x1, 234, 746, 480, 33, 1, 6 },
+  { 0x8000001, 0x8000001, 234, 747, 488, 6, 1, 7 },
+  { 0x1, 0x1, 234, 748, 484, 33, 1, 6 },
+  { 0x0, 0x0, 234, 749, 834, 0, 0, -1 },
+  { 0x1, 0x1, 234, 750, 500, 33, 1, 8 },
+  { 0x0, 0x0, 234, 751, 838, 0, 0, -1 },
+  { 0x1, 0x1, 234, 752, 512, 33, 1, 15 },
+  { 0x0, 0x0, 234, 753, 843, 0, 0, -1 },
+  { 0x0, 0x0, 234, 754, 847, 0, 0, -1 },
+  { 0x1, 0x1, 234, 755, 535, 33, 1, 17 },
+  { 0x1, 0x1, 234, 756, 539, 33, 1, 17 },
+  { 0x0, 0x0, 234, 757, 851, 0, 0, -1 },
+  { 0x0, 0x0, 234, 758, 855, 0, 0, -1 },
+  { 0x1, 0x1, 234, 759, 559, 33, 1, 18 },
+  { 0x8000001, 0x8000001, 234, 760, 563, 6, 1, 18 },
+  { 0x0, 0x0, 234, 761, 859, 0, 0, -1 },
+  { 0x1, 0x1, 234, 762, 575, 33, 1, 19 },
+  { 0x0, 0x0, 234, 763, 863, 0, 0, -1 },
+  { 0x0, 0x0, 234, 764, 867, 0, 0, -1 },
+  { 0x1, 0x1, 234, 765, 595, 33, 1, 20 },
+  { 0x8000001, 0x8000001, 234, 766, 599, 6, 1, 20 },
+  { 0x0, 0x0, 234, 767, 871, 0, 0, -1 },
+  { 0x1, 0x1, 234, 768, 611, 33, 1, 21 },
+  { 0x0, 0x0, 234, 769, 876, 0, 0, -1 },
+  { 0x0, 0x0, 234, 770, 880, 0, 0, -1 },
+  { 0x1, 0x1, 234, 771, 634, 33, 1, 17 },
+  { 0x1, 0x1, 234, 772, 638, 33, 1, 17 },
+  { 0x0, 0x0, 234, 773, 884, 0, 0, -1 },
+  { 0x1, 0x1, 234, 774, 650, 33, 1, 21 },
+  { 0x0, 0x0, 235, 2322, 821, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2323, 829, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2324, 825, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2325, 479, 0, 1, 6 },
+  { 0x1, 0x1, 235, 2326, 487, 6, 1, 7 },
+  { 0x0, 0x0, 235, 2327, 483, 0, 1, 6 },
+  { 0x0, 0x0, 235, 2328, 833, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2329, 499, 0, 1, 8 },
+  { 0x0, 0x0, 235, 2330, 837, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2331, 511, 0, 1, 15 },
+  { 0x0, 0x0, 235, 2332, 842, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2333, 846, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2334, 534, 0, 1, 17 },
+  { 0x0, 0x0, 235, 2335, 538, 0, 1, 17 },
+  { 0x0, 0x0, 235, 2336, 850, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2337, 854, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2338, 558, 0, 1, 18 },
+  { 0x1, 0x1, 235, 2339, 562, 6, 1, 18 },
+  { 0x0, 0x0, 235, 2340, 858, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2341, 574, 0, 1, 19 },
+  { 0x0, 0x0, 235, 2342, 862, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2343, 866, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2344, 594, 0, 1, 20 },
+  { 0x1, 0x1, 235, 2345, 598, 6, 1, 20 },
+  { 0x0, 0x0, 235, 2346, 870, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2347, 610, 0, 1, 21 },
+  { 0x0, 0x0, 235, 2348, 875, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2349, 879, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2350, 633, 0, 1, 17 },
+  { 0x0, 0x0, 235, 2351, 637, 0, 1, 17 },
+  { 0x0, 0x0, 235, 2352, 883, 0, 0, -1 },
+  { 0x0, 0x0, 235, 2353, 649, 0, 1, 21 },
+  { 0x1, 0x1, 235, 775, 972, 27, 1, 16 },
+  { 0x0, 0x0, 235, 776, 970, 0, 1, 16 },
+  { 0x0, 0x0, 235, 1020, 974, 0, 1, 22 },
+  { 0x0, 0x1, 235, 982, 980, 20, 1, 67 },
+  { 0x0, 0x0, 235, 109, 978, 0, 1, 67 },
   { 0x1, 0x1, 238, -1, -1, 29, 1, 0 },
   { 0x0, 0x0, 238, -1, -1, 0, 1, 0 },
+  { 0x1, 0x1, 238, 2494, -1, 27, 1, 0 },
   { 0x1, 0x1, 238, 2495, -1, 27, 1, 0 },
   { 0x1, 0x1, 238, 2496, -1, 27, 1, 0 },
   { 0x1, 0x1, 238, 2497, -1, 27, 1, 0 },
-  { 0x1, 0x1, 238, 2498, -1, 27, 1, 0 },
-  { 0x0, 0x0, 260, -1, 1952, 0, 0, -1 },
-  { 0x0, 0x0, 260, -1, 1954, 0, 0, -1 },
+  { 0x0, 0x0, 260, -1, 1951, 0, 0, -1 },
+  { 0x0, 0x0, 260, -1, 1953, 0, 0, -1 },
   { 0x1, 0x1, 260, -1, -1, 28, 1, 29 },
   { 0x1, 0x1, 260, -1, -1, 28, 1, 29 },
-  { 0x0, 0x0, 260, -1, 1993, 0, 0, -1 },
-  { 0x0, 0x0, 260, -1, 1995, 0, 0, -1 },
+  { 0x0, 0x0, 260, -1, 1992, 0, 0, -1 },
+  { 0x0, 0x0, 260, -1, 1994, 0, 0, -1 },
   { 0x1, 0x1, 260, -1, -1, 28, 1, 29 },
   { 0x1, 0x1, 260, -1, -1, 28, 1, 29 },
   { 0x0, 0x0, 262, 22, -1, 0, 1, 0 },
@@ -4164,7 +4215,7 @@
   { 0x0, 0x1, 262, -1, -1, 29, 1, 0 },
   { 0x0, 0x1, 262, -1, -1, 29, 1, 0 },
   { 0x0, 0x1, 262, -1, -1, 29, 1, 0 },
-  { 0x0, 0x0, 262, 178, -1, 0, 1, 0 },
+  { 0x0, 0x0, 262, 177, -1, 0, 1, 0 },
   { 0x0, 0x1, 262, -1, -1, 29, 1, 0 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 2 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 2 },
@@ -4208,65 +4259,65 @@
   { 0x1, 0x1, 263, -1, -1, 12, 1, 2 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 64 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 64 },
-  { 0x0, 0x0, 263, -1, 1928, 0, 0, -1 },
-  { 0x0, 0x0, 263, -1, 1930, 0, 0, -1 },
-  { 0x0, 0x0, 263, -1, 1932, 0, 0, -1 },
-  { 0x0, 0x0, 263, -1, 1934, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1927, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1929, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1931, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1933, 0, 0, -1 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 59 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 59 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 59 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 49 },
-  { 0x0, 0x0, 263, -1, 1936, 0, 0, -1 },
-  { 0x0, 0x0, 263, -1, 1938, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1935, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1937, 0, 0, -1 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 59 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 59 },
-  { 0x0, 0x0, 263, -1, 1940, 0, 0, -1 },
-  { 0x0, 0x0, 263, -1, 1942, 0, 0, -1 },
-  { 0x0, 0x0, 263, -1, 1944, 0, 0, -1 },
-  { 0x0, 0x0, 263, -1, 1946, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1939, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1941, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1943, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1945, 0, 0, -1 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 59 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 59 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 59 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 49 },
-  { 0x0, 0x0, 263, -1, 1948, 0, 0, -1 },
-  { 0x0, 0x0, 263, -1, 1950, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1947, 0, 0, -1 },
+  { 0x0, 0x0, 263, -1, 1949, 0, 0, -1 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 59 },
   { 0x1, 0x1, 263, -1, -1, 12, 1, 59 },
-  { 0x1, 0x1, 263, 334, -1, 12, 1, 2 },
-  { 0x1, 0x1, 263, 392, -1, 12, 1, 2 },
-  { 0x1, 0x1, 263, 338, -1, 12, 1, 2 },
-  { 0x1, 0x1, 263, 396, -1, 12, 1, 2 },
-  { 0x0, 0x0, 264, -1, 1935, 0, 0, -1 },
-  { 0x9, 0x9, 264, -1, 2465, 33, 1, 49 },
-  { 0x0, 0x0, 264, 1173, 1984, 0, 0, -1 },
-  { 0x3, 0x3, 264, 1174, -1, 27, 1, 49 },
-  { 0x0, 0x0, 268, 2392, -1, 0, 1, 0 },
+  { 0x1, 0x1, 263, 333, -1, 12, 1, 2 },
+  { 0x1, 0x1, 263, 391, -1, 12, 1, 2 },
+  { 0x1, 0x1, 263, 337, -1, 12, 1, 2 },
+  { 0x1, 0x1, 263, 395, -1, 12, 1, 2 },
+  { 0x0, 0x0, 264, -1, 1934, 0, 0, -1 },
+  { 0x9, 0x9, 264, -1, 2464, 33, 1, 49 },
+  { 0x0, 0x0, 264, 1172, 1983, 0, 0, -1 },
+  { 0x3, 0x3, 264, 1173, -1, 27, 1, 49 },
+  { 0x0, 0x0, 268, 2391, -1, 0, 1, 0 },
   { 0x3, 0x3, 269, -1, -1, 27, 1, 0 },
   { 0x3, 0x3, 269, -1, -1, 27, 1, 0 },
   { 0x3, 0x3, 269, -1, -1, 27, 1, 0 },
   { 0x3, 0x3, 269, -1, -1, 27, 1, 0 },
+  { 0x1, 0x1, 270, 2490, -1, 28, 1, 0 },
   { 0x1, 0x1, 270, 2491, -1, 28, 1, 0 },
   { 0x1, 0x1, 270, 2492, -1, 28, 1, 0 },
   { 0x1, 0x1, 270, 2493, -1, 28, 1, 0 },
-  { 0x1, 0x1, 270, 2494, -1, 28, 1, 0 },
   { 0x1, 0x1, 271, -1, -1, 27, 1, 93 },
   { 0x1, 0x1, 271, -1, -1, 27, 1, 93 },
-  { 0x0, 0x0, 271, -1, 820, 0, 0, -1 },
-  { 0x0, 0x0, 272, 2504, 2369, 0, 0, -1 },
-  { 0x0, 0x0, 272, 2505, 2371, 0, 0, -1 },
-  { 0x0, 0x0, 273, -1, 2370, 0, 0, -1 },
-  { 0x0, 0x0, 273, -1, 2372, 0, 0, -1 },
+  { 0x0, 0x0, 271, -1, 819, 0, 0, -1 },
+  { 0x0, 0x0, 272, 2503, 2368, 0, 0, -1 },
+  { 0x0, 0x0, 272, 2504, 2370, 0, 0, -1 },
+  { 0x0, 0x0, 273, -1, 2369, 0, 0, -1 },
+  { 0x0, 0x0, 273, -1, 2371, 0, 0, -1 },
   { 0x0, 0x0, 274, -1, -1, 0, 1, 40 },
   { 0x0, 0x0, 274, -1, -1, 0, 1, 40 },
   { 0x0, 0x0, 274, -1, -1, 0, 1, 40 },
   { 0x0, 0x0, 279, -1, -1, 0, 1, 33 },
-  { 0x0, 0x0, 283, -1, 1958, 0, 1, 29 },
+  { 0x0, 0x0, 283, -1, 1957, 0, 1, 29 },
   { 0x0, 0x0, 284, -1, -1, 0, 1, 0 },
   { 0x0, 0x0, 284, -1, -1, 0, 1, 71 },
-  { 0x0, 0x0, 284, 1744, 2482, 0, 1, 1 },
-  { 0x0, 0x0, 284, -1, 393, 0, 0, -1 },
-  { 0x0, 0x0, 284, 1746, 2484, 0, 1, 1 },
-  { 0x0, 0x0, 284, -1, 397, 0, 0, -1 },
+  { 0x0, 0x0, 284, 1743, 2481, 0, 1, 1 },
+  { 0x0, 0x0, 284, -1, 392, 0, 0, -1 },
+  { 0x0, 0x0, 284, 1745, 2483, 0, 1, 1 },
+  { 0x0, 0x0, 284, -1, 396, 0, 0, -1 },
 };
 
 static const struct ia64_main_table
@@ -4284,202 +4335,202 @@
   { 10, 1, 1, 0x0000010160000000ull, 0x000001eff8000000ull, { 24, 55, 26, 0, 0 }, 0x0, 10, },
   { 11, 1, 1, 0x0000010068000000ull, 0x000001eff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 11, },
   { 11, 1, 1, 0x0000010168000000ull, 0x000001eff8000000ull, { 24, 55, 26, 0, 0 }, 0x0, 12, },
-  { 14, 4, 0, 0x0000000100000000ull, 0x000001eff80011ffull, { 16, 0, 0, 0, 0 }, 0x40, 821, },
-  { 14, 4, 0, 0x0000000100000000ull, 0x000001eff80011c0ull, { 16, 0, 0, 0, 0 }, 0x0, 686, },
-  { 14, 4, 0, 0x0000000100000000ull, 0x000001eff80011c0ull, { 16, 0, 0, 0, 0 }, 0x40, 687, },
-  { 14, 4, 0, 0x0000000108000100ull, 0x000001eff80011c0ull, { 16, 0, 0, 0, 0 }, 0x200, 1866, },
-  { 14, 4, 0, 0x0000000108000100ull, 0x000001eff80011c0ull, { 16, 0, 0, 0, 0 }, 0x240, 1867, },
-  { 14, 4, 1, 0x0000002100000000ull, 0x000001ef00001000ull, { 15, 16, 0, 0, 0 }, 0x0, 443, },
-  { 14, 4, 1, 0x0000002100000000ull, 0x000001ef00001000ull, { 15, 16, 0, 0, 0 }, 0x40, 444, },
-  { 14, 4, 0, 0x0000008000000000ull, 0x000001ee000011ffull, { 81, 0, 0, 0, 0 }, 0x40, 842, },
-  { 14, 4, 0, 0x0000008000000000ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x0, 688, },
-  { 14, 4, 0, 0x0000008000000000ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x40, 689, },
-  { 14, 4, 0, 0x0000008000000080ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x210, 2502, },
-  { 14, 4, 0, 0x0000008000000080ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x250, 2503, },
-  { 14, 4, 0, 0x0000008000000140ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x30, 451, },
-  { 14, 4, 0, 0x0000008000000140ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x70, 452, },
-  { 14, 4, 0, 0x0000008000000180ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x230, 449, },
-  { 14, 4, 0, 0x0000008000000180ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x270, 450, },
-  { 14, 4, 1, 0x000000a000000000ull, 0x000001ee00001000ull, { 15, 81, 0, 0, 0 }, 0x0, 445, },
-  { 14, 4, 1, 0x000000a000000000ull, 0x000001ee00001000ull, { 15, 81, 0, 0, 0 }, 0x40, 446, },
-  { 15, 4, 0, 0x0000000000000000ull, 0x000001e1f8000000ull, { 65, 0, 0, 0, 0 }, 0x0, 398, },
-  { 15, 5, 0, 0x0000000000000000ull, 0x000001e3f8000000ull, { 65, 0, 0, 0, 0 }, 0x0, 812, },
-  { 15, 2, 0, 0x0000000000000000ull, 0x000001eff8000000ull, { 65, 0, 0, 0, 0 }, 0x2, 956, },
-  { 15, 3, 0, 0x0000000000000000ull, 0x000001eff8000000ull, { 65, 0, 0, 0, 0 }, 0x0, 1047, },
-  { 15, 6, 0, 0x0000000000000000ull, 0x000001eff8000000ull, { 69, 0, 0, 0, 0 }, 0x0, 2506, },
+  { 14, 4, 0, 0x0000000100000000ull, 0x000001eff80011ffull, { 16, 0, 0, 0, 0 }, 0x40, 820, },
+  { 14, 4, 0, 0x0000000100000000ull, 0x000001eff80011c0ull, { 16, 0, 0, 0, 0 }, 0x0, 685, },
+  { 14, 4, 0, 0x0000000100000000ull, 0x000001eff80011c0ull, { 16, 0, 0, 0, 0 }, 0x40, 686, },
+  { 14, 4, 0, 0x0000000108000100ull, 0x000001eff80011c0ull, { 16, 0, 0, 0, 0 }, 0x200, 1865, },
+  { 14, 4, 0, 0x0000000108000100ull, 0x000001eff80011c0ull, { 16, 0, 0, 0, 0 }, 0x240, 1866, },
+  { 14, 4, 1, 0x0000002100000000ull, 0x000001ef00001000ull, { 15, 16, 0, 0, 0 }, 0x0, 442, },
+  { 14, 4, 1, 0x0000002100000000ull, 0x000001ef00001000ull, { 15, 16, 0, 0, 0 }, 0x40, 443, },
+  { 14, 4, 0, 0x0000008000000000ull, 0x000001ee000011ffull, { 81, 0, 0, 0, 0 }, 0x40, 841, },
+  { 14, 4, 0, 0x0000008000000000ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x0, 687, },
+  { 14, 4, 0, 0x0000008000000000ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x40, 688, },
+  { 14, 4, 0, 0x0000008000000080ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x210, 2501, },
+  { 14, 4, 0, 0x0000008000000080ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x250, 2502, },
+  { 14, 4, 0, 0x0000008000000140ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x30, 450, },
+  { 14, 4, 0, 0x0000008000000140ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x70, 451, },
+  { 14, 4, 0, 0x0000008000000180ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x230, 448, },
+  { 14, 4, 0, 0x0000008000000180ull, 0x000001ee000011c0ull, { 81, 0, 0, 0, 0 }, 0x270, 449, },
+  { 14, 4, 1, 0x000000a000000000ull, 0x000001ee00001000ull, { 15, 81, 0, 0, 0 }, 0x0, 444, },
+  { 14, 4, 1, 0x000000a000000000ull, 0x000001ee00001000ull, { 15, 81, 0, 0, 0 }, 0x40, 445, },
+  { 15, 4, 0, 0x0000000000000000ull, 0x000001e1f8000000ull, { 65, 0, 0, 0, 0 }, 0x0, 397, },
+  { 15, 5, 0, 0x0000000000000000ull, 0x000001e3f8000000ull, { 65, 0, 0, 0, 0 }, 0x0, 811, },
+  { 15, 2, 0, 0x0000000000000000ull, 0x000001eff8000000ull, { 65, 0, 0, 0, 0 }, 0x2, 955, },
+  { 15, 3, 0, 0x0000000000000000ull, 0x000001eff8000000ull, { 65, 0, 0, 0, 0 }, 0x0, 1046, },
+  { 15, 6, 0, 0x0000000000000000ull, 0x000001eff8000000ull, { 69, 0, 0, 0, 0 }, 0x0, 2505, },
   { 15, 7, 0, 0x0000000000000000ull, 0x0000000000000000ull, { 65, 0, 0, 0, 0 }, 0x0, 15, },
-  { 16, 6, 0, 0x0000018000000000ull, 0x000001ee000011ffull, { 82, 0, 0, 0, 0 }, 0x40, 875, },
-  { 16, 6, 0, 0x0000018000000000ull, 0x000001ee000011c0ull, { 82, 0, 0, 0, 0 }, 0x0, 690, },
-  { 16, 6, 0, 0x0000018000000000ull, 0x000001ee000011c0ull, { 82, 0, 0, 0, 0 }, 0x40, 691, },
-  { 16, 6, 1, 0x000001a000000000ull, 0x000001ee00001000ull, { 15, 82, 0, 0, 0 }, 0x0, 447, },
-  { 16, 6, 1, 0x000001a000000000ull, 0x000001ee00001000ull, { 15, 82, 0, 0, 0 }, 0x40, 448, },
-  { 17, 4, 0, 0x0000004080000000ull, 0x000001e9f8000018ull, { 16, 77, 0, 0, 0 }, 0x20, 2388, },
-  { 17, 4, 0, 0x000000e000000000ull, 0x000001e800000018ull, { 81, 77, 0, 0, 0 }, 0x20, 2389, },
-  { 18, 4, 0, 0x0000000060000000ull, 0x000001e1f8000000ull, { 0, 0, 0, 0, 0 }, 0x2c, 219, },
-  { 22, 2, 0, 0x0000000200000000ull, 0x000001ee00000000ull, { 25, 80, 0, 0, 0 }, 0x0, 1871, },
-  { 22, 3, 0, 0x0000000800000000ull, 0x000001ee00000000ull, { 24, 81, 0, 0, 0 }, 0x0, 221, },
-  { 22, 3, 0, 0x0000000c00000000ull, 0x000001ee00000000ull, { 18, 81, 0, 0, 0 }, 0x0, 222, },
-  { 22, 3, 0, 0x0000002200000000ull, 0x000001ee00000000ull, { 25, 80, 0, 0, 0 }, 0x0, 1872, },
-  { 22, 3, 0, 0x0000002600000000ull, 0x000001ee00000000ull, { 19, 80, 0, 0, 0 }, 0x0, 1873, },
-  { 22, 7, 0, 0x0000000000000000ull, 0x0000000000000000ull, { 25, 80, 0, 0, 0 }, 0x0, 1874, },
+  { 16, 6, 0, 0x0000018000000000ull, 0x000001ee000011ffull, { 82, 0, 0, 0, 0 }, 0x40, 874, },
+  { 16, 6, 0, 0x0000018000000000ull, 0x000001ee000011c0ull, { 82, 0, 0, 0, 0 }, 0x0, 689, },
+  { 16, 6, 0, 0x0000018000000000ull, 0x000001ee000011c0ull, { 82, 0, 0, 0, 0 }, 0x40, 690, },
+  { 16, 6, 1, 0x000001a000000000ull, 0x000001ee00001000ull, { 15, 82, 0, 0, 0 }, 0x0, 446, },
+  { 16, 6, 1, 0x000001a000000000ull, 0x000001ee00001000ull, { 15, 82, 0, 0, 0 }, 0x40, 447, },
+  { 17, 4, 0, 0x0000004080000000ull, 0x000001e9f8000018ull, { 16, 77, 0, 0, 0 }, 0x20, 2387, },
+  { 17, 4, 0, 0x000000e000000000ull, 0x000001e800000018ull, { 81, 77, 0, 0, 0 }, 0x20, 2388, },
+  { 18, 4, 0, 0x0000000060000000ull, 0x000001e1f8000000ull, { 0, 0, 0, 0, 0 }, 0x2c, 218, },
+  { 22, 2, 0, 0x0000000200000000ull, 0x000001ee00000000ull, { 25, 80, 0, 0, 0 }, 0x0, 1870, },
+  { 22, 3, 0, 0x0000000800000000ull, 0x000001ee00000000ull, { 24, 81, 0, 0, 0 }, 0x0, 220, },
+  { 22, 3, 0, 0x0000000c00000000ull, 0x000001ee00000000ull, { 18, 81, 0, 0, 0 }, 0x0, 221, },
+  { 22, 3, 0, 0x0000002200000000ull, 0x000001ee00000000ull, { 25, 80, 0, 0, 0 }, 0x0, 1871, },
+  { 22, 3, 0, 0x0000002600000000ull, 0x000001ee00000000ull, { 19, 80, 0, 0, 0 }, 0x0, 1872, },
+  { 22, 7, 0, 0x0000000000000000ull, 0x0000000000000000ull, { 25, 80, 0, 0, 0 }, 0x0, 1873, },
   { 25, 4, 0, 0x0000000020000000ull, 0x000001e1f8000000ull, { 0, 0, 0, 0, 0 }, 0x224, 17, },
-  { 26, 1, 2, 0x0000018000000000ull, 0x000001fe00001000ull, { 22, 23, 25, 26, 0 }, 0x0, 1023, },
-  { 26, 1, 2, 0x0000018000000000ull, 0x000001fe00001000ull, { 23, 22, 26, 25, 0 }, 0x0, 999, },
-  { 26, 1, 2, 0x0000018000000000ull, 0x000001fe00001000ull, { 22, 23, 26, 25, 0 }, 0x0, 925, },
-  { 26, 1, 2, 0x0000018000000000ull, 0x000001fe00001000ull, { 23, 22, 25, 26, 0 }, 0x0, 904, },
-  { 26, 1, 2, 0x0000018200000000ull, 0x000001fe00001000ull, { 22, 23, 25, 26, 0 }, 0x40, 1157, },
-  { 26, 1, 2, 0x0000019000000000ull, 0x000001fe00001000ull, { 22, 23, 7, 26, 0 }, 0x0, 926, },
-  { 26, 1, 2, 0x0000019000000000ull, 0x000001fe00001000ull, { 22, 23, 26, 7, 0 }, 0x40, 1025, },
-  { 26, 1, 2, 0x0000019000000000ull, 0x000001fe00001000ull, { 22, 23, 7, 26, 0 }, 0x40, 1002, },
-  { 26, 1, 2, 0x0000018800000000ull, 0x000001ee00001000ull, { 22, 23, 55, 26, 0 }, 0x0, 1027, },
-  { 26, 1, 2, 0x0000018800000000ull, 0x000001ee00001000ull, { 22, 23, 57, 26, 0 }, 0x0, 1003, },
-  { 26, 1, 2, 0x0000018800000000ull, 0x000001ee00001000ull, { 23, 22, 57, 26, 0 }, 0x0, 929, },
-  { 26, 1, 2, 0x0000018800000000ull, 0x000001ee00001000ull, { 23, 22, 55, 26, 0 }, 0x0, 908, },
-  { 26, 1, 2, 0x0000018a00000000ull, 0x000001ee00001000ull, { 22, 23, 55, 26, 0 }, 0x40, 1160, },
-  { 26, 1, 2, 0x000001a800000000ull, 0x000001ee00001000ull, { 22, 23, 59, 26, 0 }, 0x0, 1018, },
-  { 26, 1, 2, 0x000001a800000000ull, 0x000001ee00001000ull, { 23, 22, 59, 26, 0 }, 0x0, 946, },
-  { 26, 1, 2, 0x000001c200000000ull, 0x000001fe00001000ull, { 23, 22, 25, 26, 0 }, 0x40, 1161, },
-  { 26, 1, 2, 0x000001d000000000ull, 0x000001fe00001000ull, { 23, 22, 7, 26, 0 }, 0x40, 1004, },
-  { 26, 1, 2, 0x000001d000000000ull, 0x000001fe00001000ull, { 23, 22, 26, 7, 0 }, 0x40, 910, },
-  { 26, 1, 2, 0x000001ca00000000ull, 0x000001ee00001000ull, { 23, 22, 55, 26, 0 }, 0x40, 1162, },
-  { 27, 1, 2, 0x0000018400000000ull, 0x000001fe00001000ull, { 22, 23, 25, 26, 0 }, 0x0, 1030, },
-  { 27, 1, 2, 0x0000018400000000ull, 0x000001fe00001000ull, { 23, 22, 26, 25, 0 }, 0x0, 1006, },
-  { 27, 1, 2, 0x0000018400000000ull, 0x000001fe00001000ull, { 22, 23, 26, 25, 0 }, 0x0, 932, },
-  { 27, 1, 2, 0x0000018400000000ull, 0x000001fe00001000ull, { 23, 22, 25, 26, 0 }, 0x0, 911, },
-  { 27, 1, 2, 0x0000018600000000ull, 0x000001fe00001000ull, { 22, 23, 25, 26, 0 }, 0x40, 1165, },
-  { 27, 1, 2, 0x0000019400000000ull, 0x000001fe00001000ull, { 22, 23, 7, 26, 0 }, 0x0, 933, },
-  { 27, 1, 2, 0x0000019400000000ull, 0x000001fe00001000ull, { 22, 23, 26, 7, 0 }, 0x40, 1032, },
-  { 27, 1, 2, 0x0000019400000000ull, 0x000001fe00001000ull, { 22, 23, 7, 26, 0 }, 0x40, 1009, },
-  { 27, 1, 2, 0x0000018c00000000ull, 0x000001ee00001000ull, { 22, 23, 55, 26, 0 }, 0x0, 1034, },
-  { 27, 1, 2, 0x0000018c00000000ull, 0x000001ee00001000ull, { 22, 23, 57, 26, 0 }, 0x0, 1010, },
-  { 27, 1, 2, 0x0000018c00000000ull, 0x000001ee00001000ull, { 23, 22, 57, 26, 0 }, 0x0, 936, },
-  { 27, 1, 2, 0x0000018c00000000ull, 0x000001ee00001000ull, { 23, 22, 55, 26, 0 }, 0x0, 915, },
-  { 27, 1, 2, 0x0000018e00000000ull, 0x000001ee00001000ull, { 22, 23, 55, 26, 0 }, 0x40, 1168, },
-  { 27, 1, 2, 0x000001ac00000000ull, 0x000001ee00001000ull, { 22, 23, 56, 26, 0 }, 0x0, 1044, },
-  { 27, 1, 2, 0x000001ac00000000ull, 0x000001ee00001000ull, { 22, 23, 58, 26, 0 }, 0x0, 1020, },
-  { 27, 1, 2, 0x000001ac00000000ull, 0x000001ee00001000ull, { 23, 22, 58, 26, 0 }, 0x0, 948, },
-  { 27, 1, 2, 0x000001ac00000000ull, 0x000001ee00001000ull, { 23, 22, 56, 26, 0 }, 0x0, 924, },
-  { 27, 1, 2, 0x000001c600000000ull, 0x000001fe00001000ull, { 23, 22, 25, 26, 0 }, 0x40, 1169, },
-  { 27, 1, 2, 0x000001d400000000ull, 0x000001fe00001000ull, { 23, 22, 7, 26, 0 }, 0x40, 1011, },
-  { 27, 1, 2, 0x000001d400000000ull, 0x000001fe00001000ull, { 23, 22, 26, 7, 0 }, 0x40, 917, },
-  { 27, 1, 2, 0x000001ce00000000ull, 0x000001ee00001000ull, { 23, 22, 55, 26, 0 }, 0x40, 1170, },
-  { 28, 3, 1, 0x0000008808000000ull, 0x000001fff8000000ull, { 24, 33, 25, 1, 2 }, 0x0, 254, },
-  { 29, 3, 1, 0x0000008008000000ull, 0x000001fff8000000ull, { 24, 33, 25, 2, 0 }, 0x0, 255, },
-  { 30, 3, 1, 0x0000008048000000ull, 0x000001fff8000000ull, { 24, 33, 25, 2, 0 }, 0x0, 256, },
-  { 31, 3, 1, 0x0000008088000000ull, 0x000001fff8000000ull, { 24, 33, 25, 2, 0 }, 0x0, 257, },
-  { 32, 3, 1, 0x00000080c8000000ull, 0x000001fff8000000ull, { 24, 33, 25, 2, 0 }, 0x0, 258, },
+  { 26, 1, 2, 0x0000018000000000ull, 0x000001fe00001000ull, { 22, 23, 25, 26, 0 }, 0x0, 1022, },
+  { 26, 1, 2, 0x0000018000000000ull, 0x000001fe00001000ull, { 23, 22, 26, 25, 0 }, 0x0, 998, },
+  { 26, 1, 2, 0x0000018000000000ull, 0x000001fe00001000ull, { 22, 23, 26, 25, 0 }, 0x0, 924, },
+  { 26, 1, 2, 0x0000018000000000ull, 0x000001fe00001000ull, { 23, 22, 25, 26, 0 }, 0x0, 903, },
+  { 26, 1, 2, 0x0000018200000000ull, 0x000001fe00001000ull, { 22, 23, 25, 26, 0 }, 0x40, 1156, },
+  { 26, 1, 2, 0x0000019000000000ull, 0x000001fe00001000ull, { 22, 23, 7, 26, 0 }, 0x0, 925, },
+  { 26, 1, 2, 0x0000019000000000ull, 0x000001fe00001000ull, { 22, 23, 26, 7, 0 }, 0x40, 1024, },
+  { 26, 1, 2, 0x0000019000000000ull, 0x000001fe00001000ull, { 22, 23, 7, 26, 0 }, 0x40, 1001, },
+  { 26, 1, 2, 0x0000018800000000ull, 0x000001ee00001000ull, { 22, 23, 55, 26, 0 }, 0x0, 1026, },
+  { 26, 1, 2, 0x0000018800000000ull, 0x000001ee00001000ull, { 22, 23, 57, 26, 0 }, 0x0, 1002, },
+  { 26, 1, 2, 0x0000018800000000ull, 0x000001ee00001000ull, { 23, 22, 57, 26, 0 }, 0x0, 928, },
+  { 26, 1, 2, 0x0000018800000000ull, 0x000001ee00001000ull, { 23, 22, 55, 26, 0 }, 0x0, 907, },
+  { 26, 1, 2, 0x0000018a00000000ull, 0x000001ee00001000ull, { 22, 23, 55, 26, 0 }, 0x40, 1159, },
+  { 26, 1, 2, 0x000001a800000000ull, 0x000001ee00001000ull, { 22, 23, 59, 26, 0 }, 0x0, 1017, },
+  { 26, 1, 2, 0x000001a800000000ull, 0x000001ee00001000ull, { 23, 22, 59, 26, 0 }, 0x0, 945, },
+  { 26, 1, 2, 0x000001c200000000ull, 0x000001fe00001000ull, { 23, 22, 25, 26, 0 }, 0x40, 1160, },
+  { 26, 1, 2, 0x000001d000000000ull, 0x000001fe00001000ull, { 23, 22, 7, 26, 0 }, 0x40, 1003, },
+  { 26, 1, 2, 0x000001d000000000ull, 0x000001fe00001000ull, { 23, 22, 26, 7, 0 }, 0x40, 909, },
+  { 26, 1, 2, 0x000001ca00000000ull, 0x000001ee00001000ull, { 23, 22, 55, 26, 0 }, 0x40, 1161, },
+  { 27, 1, 2, 0x0000018400000000ull, 0x000001fe00001000ull, { 22, 23, 25, 26, 0 }, 0x0, 1029, },
+  { 27, 1, 2, 0x0000018400000000ull, 0x000001fe00001000ull, { 23, 22, 26, 25, 0 }, 0x0, 1005, },
+  { 27, 1, 2, 0x0000018400000000ull, 0x000001fe00001000ull, { 22, 23, 26, 25, 0 }, 0x0, 931, },
+  { 27, 1, 2, 0x0000018400000000ull, 0x000001fe00001000ull, { 23, 22, 25, 26, 0 }, 0x0, 910, },
+  { 27, 1, 2, 0x0000018600000000ull, 0x000001fe00001000ull, { 22, 23, 25, 26, 0 }, 0x40, 1164, },
+  { 27, 1, 2, 0x0000019400000000ull, 0x000001fe00001000ull, { 22, 23, 7, 26, 0 }, 0x0, 932, },
+  { 27, 1, 2, 0x0000019400000000ull, 0x000001fe00001000ull, { 22, 23, 26, 7, 0 }, 0x40, 1031, },
+  { 27, 1, 2, 0x0000019400000000ull, 0x000001fe00001000ull, { 22, 23, 7, 26, 0 }, 0x40, 1008, },
+  { 27, 1, 2, 0x0000018c00000000ull, 0x000001ee00001000ull, { 22, 23, 55, 26, 0 }, 0x0, 1033, },
+  { 27, 1, 2, 0x0000018c00000000ull, 0x000001ee00001000ull, { 22, 23, 57, 26, 0 }, 0x0, 1009, },
+  { 27, 1, 2, 0x0000018c00000000ull, 0x000001ee00001000ull, { 23, 22, 57, 26, 0 }, 0x0, 935, },
+  { 27, 1, 2, 0x0000018c00000000ull, 0x000001ee00001000ull, { 23, 22, 55, 26, 0 }, 0x0, 914, },
+  { 27, 1, 2, 0x0000018e00000000ull, 0x000001ee00001000ull, { 22, 23, 55, 26, 0 }, 0x40, 1167, },
+  { 27, 1, 2, 0x000001ac00000000ull, 0x000001ee00001000ull, { 22, 23, 56, 26, 0 }, 0x0, 1043, },
+  { 27, 1, 2, 0x000001ac00000000ull, 0x000001ee00001000ull, { 22, 23, 58, 26, 0 }, 0x0, 1019, },
+  { 27, 1, 2, 0x000001ac00000000ull, 0x000001ee00001000ull, { 23, 22, 58, 26, 0 }, 0x0, 947, },
+  { 27, 1, 2, 0x000001ac00000000ull, 0x000001ee00001000ull, { 23, 22, 56, 26, 0 }, 0x0, 923, },
+  { 27, 1, 2, 0x000001c600000000ull, 0x000001fe00001000ull, { 23, 22, 25, 26, 0 }, 0x40, 1168, },
+  { 27, 1, 2, 0x000001d400000000ull, 0x000001fe00001000ull, { 23, 22, 7, 26, 0 }, 0x40, 1010, },
+  { 27, 1, 2, 0x000001d400000000ull, 0x000001fe00001000ull, { 23, 22, 26, 7, 0 }, 0x40, 916, },
+  { 27, 1, 2, 0x000001ce00000000ull, 0x000001ee00001000ull, { 23, 22, 55, 26, 0 }, 0x40, 1169, },
+  { 28, 3, 1, 0x0000008808000000ull, 0x000001fff8000000ull, { 24, 33, 25, 1, 2 }, 0x0, 253, },
+  { 29, 3, 1, 0x0000008008000000ull, 0x000001fff8000000ull, { 24, 33, 25, 2, 0 }, 0x0, 254, },
+  { 30, 3, 1, 0x0000008048000000ull, 0x000001fff8000000ull, { 24, 33, 25, 2, 0 }, 0x0, 255, },
+  { 31, 3, 1, 0x0000008088000000ull, 0x000001fff8000000ull, { 24, 33, 25, 2, 0 }, 0x0, 256, },
+  { 32, 3, 1, 0x00000080c8000000ull, 0x000001fff8000000ull, { 24, 33, 25, 2, 0 }, 0x0, 257, },
   { 34, 4, 0, 0x0000000010000000ull, 0x000001e1f8000000ull, { 0, 0, 0, 0, 0 }, 0x224, 18, },
-  { 36, 2, 1, 0x00000000c0000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 985, },
-  { 37, 2, 1, 0x00000000c8000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 986, },
+  { 36, 2, 1, 0x00000000c0000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 984, },
+  { 37, 2, 1, 0x00000000c8000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 985, },
   { 39, 2, 1, 0x0000008000000000ull, 0x000001e000000000ull, { 24, 25, 26, 47, 72 }, 0x0, 19, },
-  { 39, 2, 1, 0x000000a600000000ull, 0x000001ee04000000ull, { 24, 25, 45, 73, 0 }, 0x0, 2511, },
-  { 39, 2, 1, 0x000000a604000000ull, 0x000001ee04000000ull, { 24, 55, 45, 73, 0 }, 0x0, 2512, },
+  { 39, 2, 1, 0x000000a600000000ull, 0x000001ee04000000ull, { 24, 25, 45, 73, 0 }, 0x0, 2510, },
+  { 39, 2, 1, 0x000000a604000000ull, 0x000001ee04000000ull, { 24, 55, 45, 73, 0 }, 0x0, 2511, },
   { 39, 2, 1, 0x000000ae00000000ull, 0x000001ee00000000ull, { 24, 48, 26, 46, 73 }, 0x0, 20, },
   { 43, 4, 0, 0x0000000080000000ull, 0x000001e1f8000000ull, { 0, 0, 0, 0, 0 }, 0x20, 21, },
-  { 48, 2, 1, 0x000000a400000000ull, 0x000001ee00002000ull, { 24, 26, 76, 73, 0 }, 0x0, 2406, },
+  { 48, 2, 1, 0x000000a400000000ull, 0x000001ee00002000ull, { 24, 26, 76, 73, 0 }, 0x0, 2405, },
   { 50, 5, 1, 0x0000000080000000ull, 0x000001e3f80fe000ull, { 18, 20, 0, 0, 0 }, 0x40, 23, },
-  { 51, 5, 1, 0x0000010008000000ull, 0x000001fff8000000ull, { 18, 20, 19, 0, 0 }, 0x40, 1923, },
-  { 52, 5, 1, 0x00000000b8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1924, },
+  { 51, 5, 1, 0x0000010008000000ull, 0x000001fff8000000ull, { 18, 20, 19, 0, 0 }, 0x40, 1922, },
+  { 52, 5, 1, 0x00000000b8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1923, },
   { 52, 5, 1, 0x00000000b8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x40, 25, },
-  { 53, 5, 1, 0x00000000b0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1925, },
+  { 53, 5, 1, 0x00000000b0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1924, },
   { 53, 5, 1, 0x00000000b0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x40, 26, },
   { 54, 5, 1, 0x0000000160000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 27, },
   { 55, 5, 1, 0x0000000168000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 28, },
   { 57, 3, 0, 0x0000002180000000ull, 0x000001fff8000000ull, { 26, 0, 0, 0, 0 }, 0x0, 29, },
-  { 58, 5, 0, 0x0000000040000000ull, 0x000001eff8000000ull, { 79, 0, 0, 0, 0 }, 0x0, 1926, },
+  { 58, 5, 0, 0x0000000040000000ull, 0x000001eff8000000ull, { 79, 0, 0, 0, 0 }, 0x0, 1925, },
   { 58, 5, 0, 0x0000000040000000ull, 0x000001eff8000000ull, { 79, 0, 0, 0, 0 }, 0x40, 30, },
-  { 59, 5, 2, 0x000000a000000000ull, 0x000001e000001000ull, { 22, 23, 19, 60, 0 }, 0x0, 1049, },
-  { 59, 5, 2, 0x000000a000000000ull, 0x000001e000001000ull, { 23, 22, 19, 60, 0 }, 0x40, 1190, },
-  { 60, 5, 0, 0x0000000028000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 1927, },
+  { 59, 5, 2, 0x000000a000000000ull, 0x000001e000001000ull, { 22, 23, 19, 60, 0 }, 0x0, 1048, },
+  { 59, 5, 2, 0x000000a000000000ull, 0x000001e000001000ull, { 23, 22, 19, 60, 0 }, 0x40, 1189, },
+  { 60, 5, 0, 0x0000000028000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 1926, },
   { 60, 5, 0, 0x0000000028000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x40, 31, },
-  { 61, 5, 2, 0x0000008000000000ull, 0x000001fe00001000ull, { 22, 23, 19, 20, 0 }, 0x0, 796, },
-  { 61, 5, 2, 0x0000008000000000ull, 0x000001fe00001000ull, { 22, 23, 19, 20, 0 }, 0x40, 797, },
-  { 61, 5, 2, 0x0000009000000000ull, 0x000001fe00001000ull, { 22, 23, 20, 19, 0 }, 0x0, 939, },
-  { 61, 5, 2, 0x0000009000000000ull, 0x000001fe00001000ull, { 22, 23, 20, 19, 0 }, 0x40, 940, },
-  { 61, 5, 2, 0x0000008000000000ull, 0x000001fe00001000ull, { 23, 22, 19, 20, 0 }, 0x0, 1171, },
-  { 61, 5, 2, 0x0000008000000000ull, 0x000001fe00001000ull, { 23, 22, 19, 20, 0 }, 0x40, 1172, },
-  { 61, 5, 2, 0x0000009000000000ull, 0x000001fe00001000ull, { 23, 22, 20, 19, 0 }, 0x0, 1178, },
-  { 61, 5, 2, 0x0000009000000000ull, 0x000001fe00001000ull, { 23, 22, 20, 19, 0 }, 0x40, 1179, },
-  { 62, 5, 1, 0x00000000c0000000ull, 0x000001eff8000000ull, { 18, 19, 0, 0, 0 }, 0x0, 894, },
-  { 62, 5, 1, 0x00000000c0000000ull, 0x000001eff8000000ull, { 18, 19, 0, 0, 0 }, 0x40, 895, },
-  { 62, 5, 1, 0x00000000e0000000ull, 0x000001e3f8000000ull, { 18, 19, 0, 0, 0 }, 0x0, 2509, },
-  { 62, 5, 1, 0x0000010008000000ull, 0x000001fff80fe000ull, { 18, 20, 0, 0, 0 }, 0x40, 2510, },
-  { 63, 3, 1, 0x0000008488000000ull, 0x000001fff8000000ull, { 24, 33, 71, 0, 0 }, 0x0, 259, },
-  { 64, 3, 1, 0x00000084c8000000ull, 0x000001fff8000000ull, { 24, 33, 71, 0, 0 }, 0x0, 260, },
+  { 61, 5, 2, 0x0000008000000000ull, 0x000001fe00001000ull, { 22, 23, 19, 20, 0 }, 0x0, 795, },
+  { 61, 5, 2, 0x0000008000000000ull, 0x000001fe00001000ull, { 22, 23, 19, 20, 0 }, 0x40, 796, },
+  { 61, 5, 2, 0x0000009000000000ull, 0x000001fe00001000ull, { 22, 23, 20, 19, 0 }, 0x0, 938, },
+  { 61, 5, 2, 0x0000009000000000ull, 0x000001fe00001000ull, { 22, 23, 20, 19, 0 }, 0x40, 939, },
+  { 61, 5, 2, 0x0000008000000000ull, 0x000001fe00001000ull, { 23, 22, 19, 20, 0 }, 0x0, 1170, },
+  { 61, 5, 2, 0x0000008000000000ull, 0x000001fe00001000ull, { 23, 22, 19, 20, 0 }, 0x40, 1171, },
+  { 61, 5, 2, 0x0000009000000000ull, 0x000001fe00001000ull, { 23, 22, 20, 19, 0 }, 0x0, 1177, },
+  { 61, 5, 2, 0x0000009000000000ull, 0x000001fe00001000ull, { 23, 22, 20, 19, 0 }, 0x40, 1178, },
+  { 62, 5, 1, 0x00000000c0000000ull, 0x000001eff8000000ull, { 18, 19, 0, 0, 0 }, 0x0, 893, },
+  { 62, 5, 1, 0x00000000c0000000ull, 0x000001eff8000000ull, { 18, 19, 0, 0, 0 }, 0x40, 894, },
+  { 62, 5, 1, 0x00000000e0000000ull, 0x000001e3f8000000ull, { 18, 19, 0, 0, 0 }, 0x0, 2508, },
+  { 62, 5, 1, 0x0000010008000000ull, 0x000001fff80fe000ull, { 18, 20, 0, 0, 0 }, 0x40, 2509, },
+  { 63, 3, 1, 0x0000008488000000ull, 0x000001fff8000000ull, { 24, 33, 71, 0, 0 }, 0x0, 258, },
+  { 64, 3, 1, 0x00000084c8000000ull, 0x000001fff8000000ull, { 24, 33, 71, 0, 0 }, 0x0, 259, },
   { 67, 3, 0, 0x0000000060000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x21, 32, },
-  { 68, 5, 1, 0x0000010000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 1961, },
+  { 68, 5, 1, 0x0000010000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 1960, },
   { 68, 5, 1, 0x0000010000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x40, 33, },
-  { 69, 5, 1, 0x00000000a8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1962, },
+  { 69, 5, 1, 0x00000000a8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1961, },
   { 69, 5, 1, 0x00000000a8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x40, 34, },
-  { 70, 5, 1, 0x0000000080000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1879, },
-  { 71, 5, 1, 0x00000000a0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1963, },
+  { 70, 5, 1, 0x0000000080000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1878, },
+  { 71, 5, 1, 0x00000000a0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1962, },
   { 71, 5, 1, 0x00000000a0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x40, 35, },
-  { 72, 5, 1, 0x00000001c8000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1022, },
-  { 73, 5, 1, 0x0000010000000000ull, 0x000001fc000fe000ull, { 18, 20, 21, 0, 0 }, 0x40, 1966, },
-  { 74, 5, 1, 0x0000014000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 1969, },
+  { 72, 5, 1, 0x00000001c8000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1021, },
+  { 73, 5, 1, 0x0000010000000000ull, 0x000001fc000fe000ull, { 18, 20, 21, 0, 0 }, 0x40, 1965, },
+  { 74, 5, 1, 0x0000014000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 1968, },
   { 74, 5, 1, 0x0000014000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x40, 37, },
   { 75, 5, 1, 0x0000000088000000ull, 0x000001e3f8000000ull, { 18, 20, 0, 0, 0 }, 0xc0, 38, },
   { 76, 5, 1, 0x0000000088000000ull, 0x000001e3f80fe000ull, { 18, 20, 0, 0, 0 }, 0x40, 39, },
-  { 77, 5, 1, 0x0000018000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 1972, },
+  { 77, 5, 1, 0x0000018000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 1971, },
   { 77, 5, 1, 0x0000018000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x40, 40, },
-  { 78, 5, 1, 0x0000018000000000ull, 0x000001fc000fe000ull, { 18, 20, 21, 0, 0 }, 0x40, 1975, },
-  { 79, 5, 1, 0x0000010008000000ull, 0x000001fff80fe000ull, { 18, 20, 0, 0, 0 }, 0x40, 1978, },
+  { 78, 5, 1, 0x0000018000000000ull, 0x000001fc000fe000ull, { 18, 20, 21, 0, 0 }, 0x40, 1974, },
+  { 79, 5, 1, 0x0000010008000000ull, 0x000001fff80fe000ull, { 18, 20, 0, 0, 0 }, 0x40, 1977, },
   { 80, 5, 1, 0x0000000170000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 43, },
   { 81, 5, 1, 0x0000002080000000ull, 0x000001e3f80fe000ull, { 18, 20, 0, 0, 0 }, 0x40, 44, },
   { 82, 5, 1, 0x0000000140000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 45, },
-  { 83, 5, 1, 0x00000020b8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1979, },
+  { 83, 5, 1, 0x00000020b8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1978, },
   { 83, 5, 1, 0x00000020b8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x40, 46, },
-  { 84, 5, 1, 0x00000020b0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1980, },
+  { 84, 5, 1, 0x00000020b0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1979, },
   { 84, 5, 1, 0x00000020b0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x40, 47, },
-  { 85, 5, 1, 0x0000002180000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 798, },
-  { 85, 5, 1, 0x0000002180000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x40, 799, },
-  { 85, 5, 1, 0x0000002188000000ull, 0x000001eff8000000ull, { 18, 20, 19, 0, 0 }, 0x40, 941, },
-  { 86, 5, 1, 0x00000020c0000000ull, 0x000001eff8000000ull, { 18, 19, 0, 0, 0 }, 0x0, 896, },
-  { 86, 5, 1, 0x00000020c0000000ull, 0x000001eff8000000ull, { 18, 19, 0, 0, 0 }, 0x40, 897, },
-  { 87, 5, 1, 0x0000013000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 1997, },
+  { 85, 5, 1, 0x0000002180000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 797, },
+  { 85, 5, 1, 0x0000002180000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x40, 798, },
+  { 85, 5, 1, 0x0000002188000000ull, 0x000001eff8000000ull, { 18, 20, 19, 0, 0 }, 0x40, 940, },
+  { 86, 5, 1, 0x00000020c0000000ull, 0x000001eff8000000ull, { 18, 19, 0, 0, 0 }, 0x0, 895, },
+  { 86, 5, 1, 0x00000020c0000000ull, 0x000001eff8000000ull, { 18, 19, 0, 0, 0 }, 0x40, 896, },
+  { 87, 5, 1, 0x0000013000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 1996, },
   { 87, 5, 1, 0x0000013000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x40, 48, },
-  { 88, 5, 1, 0x00000020a8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1998, },
+  { 88, 5, 1, 0x00000020a8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1997, },
   { 88, 5, 1, 0x00000020a8000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x40, 49, },
-  { 89, 5, 1, 0x0000002080000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1887, },
-  { 90, 5, 1, 0x00000020a0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1999, },
+  { 89, 5, 1, 0x0000002080000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1886, },
+  { 90, 5, 1, 0x00000020a0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1998, },
   { 90, 5, 1, 0x00000020a0000000ull, 0x000001eff8000000ull, { 18, 19, 20, 0, 0 }, 0x40, 50, },
-  { 91, 5, 1, 0x0000013000000000ull, 0x000001fc000fe000ull, { 18, 20, 21, 0, 0 }, 0x40, 2000, },
-  { 92, 5, 1, 0x0000017000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 2001, },
+  { 91, 5, 1, 0x0000013000000000ull, 0x000001fc000fe000ull, { 18, 20, 21, 0, 0 }, 0x40, 1999, },
+  { 92, 5, 1, 0x0000017000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 2000, },
   { 92, 5, 1, 0x0000017000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x40, 52, },
   { 93, 5, 1, 0x0000002088000000ull, 0x000001e3f8000000ull, { 18, 20, 0, 0, 0 }, 0xc0, 53, },
   { 94, 5, 1, 0x0000002088000000ull, 0x000001e3f80fe000ull, { 18, 20, 0, 0, 0 }, 0x40, 54, },
-  { 95, 5, 1, 0x000001b000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 2002, },
+  { 95, 5, 1, 0x000001b000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 2001, },
   { 95, 5, 1, 0x000001b000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x40, 55, },
-  { 96, 5, 1, 0x000001b000000000ull, 0x000001fc000fe000ull, { 18, 20, 21, 0, 0 }, 0x40, 2003, },
-  { 97, 5, 2, 0x0000002200000000ull, 0x000001fe00000000ull, { 18, 23, 19, 20, 0 }, 0x0, 2004, },
+  { 96, 5, 1, 0x000001b000000000ull, 0x000001fc000fe000ull, { 18, 20, 21, 0, 0 }, 0x40, 2002, },
+  { 97, 5, 2, 0x0000002200000000ull, 0x000001fe00000000ull, { 18, 23, 19, 20, 0 }, 0x0, 2003, },
   { 97, 5, 2, 0x0000002200000000ull, 0x000001fe00000000ull, { 18, 23, 19, 20, 0 }, 0x40, 57, },
-  { 98, 5, 2, 0x0000003200000000ull, 0x000001fe00000000ull, { 18, 23, 20, 0, 0 }, 0x0, 2005, },
+  { 98, 5, 2, 0x0000003200000000ull, 0x000001fe00000000ull, { 18, 23, 20, 0, 0 }, 0x0, 2004, },
   { 98, 5, 2, 0x0000003200000000ull, 0x000001fe00000000ull, { 18, 23, 20, 0, 0 }, 0x40, 58, },
-  { 99, 5, 2, 0x0000000200000000ull, 0x000001fe00000000ull, { 18, 23, 19, 20, 0 }, 0x0, 2006, },
+  { 99, 5, 2, 0x0000000200000000ull, 0x000001fe00000000ull, { 18, 23, 19, 20, 0 }, 0x0, 2005, },
   { 99, 5, 2, 0x0000000200000000ull, 0x000001fe00000000ull, { 18, 23, 19, 20, 0 }, 0x40, 59, },
-  { 100, 5, 2, 0x0000001200000000ull, 0x000001fe00000000ull, { 18, 23, 20, 0, 0 }, 0x0, 2007, },
+  { 100, 5, 2, 0x0000001200000000ull, 0x000001fe00000000ull, { 18, 23, 20, 0, 0 }, 0x0, 2006, },
   { 100, 5, 2, 0x0000001200000000ull, 0x000001fe00000000ull, { 18, 23, 20, 0, 0 }, 0x40, 60, },
   { 101, 5, 1, 0x000001c000000000ull, 0x000001f000000000ull, { 18, 20, 21, 19, 0 }, 0x0, 61, },
-  { 102, 5, 0, 0x0000000020000000ull, 0x000001eff8000000ull, { 50, 51, 0, 0, 0 }, 0x0, 2008, },
+  { 102, 5, 0, 0x0000000020000000ull, 0x000001eff8000000ull, { 50, 51, 0, 0, 0 }, 0x0, 2007, },
   { 102, 5, 0, 0x0000000020000000ull, 0x000001eff8000000ull, { 50, 51, 0, 0, 0 }, 0x40, 62, },
-  { 103, 5, 1, 0x0000014008000000ull, 0x000001fff8000000ull, { 18, 20, 19, 0, 0 }, 0x40, 2011, },
+  { 103, 5, 1, 0x0000014008000000ull, 0x000001fff8000000ull, { 18, 20, 19, 0, 0 }, 0x40, 2010, },
   { 104, 5, 1, 0x00000001a0000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 64, },
-  { 105, 5, 1, 0x00000001e0000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1840, },
+  { 105, 5, 1, 0x00000001e0000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 1839, },
   { 106, 3, 0, 0x0000000100000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 65, },
   { 108, 5, 1, 0x0000000178000000ull, 0x000001e3f8000000ull, { 18, 19, 20, 0, 0 }, 0x0, 66, },
-  { 113, 3, 1, 0x0000008708000000ull, 0x000001ffc8000000ull, { 24, 19, 0, 0, 0 }, 0x0, 2317, },
-  { 118, 4, 0, 0x0000004008000000ull, 0x000001e1f8000000ull, { 65, 0, 0, 0, 0 }, 0x0, 399, },
-  { 118, 5, 0, 0x000000000c000000ull, 0x000001e3fc000000ull, { 65, 0, 0, 0, 0 }, 0x0, 813, },
-  { 118, 2, 0, 0x000000000c000000ull, 0x000001effc000000ull, { 65, 0, 0, 0, 0 }, 0x2, 959, },
-  { 118, 3, 0, 0x000000000c000000ull, 0x000001effc000000ull, { 65, 0, 0, 0, 0 }, 0x0, 1050, },
-  { 118, 6, 0, 0x000000000c000000ull, 0x000001effc000000ull, { 69, 0, 0, 0, 0 }, 0x0, 2507, },
+  { 113, 3, 1, 0x0000008708000000ull, 0x000001ffc8000000ull, { 24, 19, 0, 0, 0 }, 0x0, 2316, },
+  { 118, 4, 0, 0x0000004008000000ull, 0x000001e1f8000000ull, { 65, 0, 0, 0, 0 }, 0x0, 398, },
+  { 118, 5, 0, 0x000000000c000000ull, 0x000001e3fc000000ull, { 65, 0, 0, 0, 0 }, 0x0, 812, },
+  { 118, 2, 0, 0x000000000c000000ull, 0x000001effc000000ull, { 65, 0, 0, 0, 0 }, 0x2, 958, },
+  { 118, 3, 0, 0x000000000c000000ull, 0x000001effc000000ull, { 65, 0, 0, 0, 0 }, 0x0, 1049, },
+  { 118, 6, 0, 0x000000000c000000ull, 0x000001effc000000ull, { 69, 0, 0, 0, 0 }, 0x0, 2506, },
   { 118, 7, 0, 0x0000000000000000ull, 0x0000000000000000ull, { 65, 0, 0, 0, 0 }, 0x0, 67, },
   { 123, 3, 0, 0x0000000080000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 68, },
-  { 123, 3, 0, 0x0000000090000000ull, 0x000001eff8000000ull, { 24, 0, 0, 0, 0 }, 0x0, 781, },
-  { 123, 3, 0, 0x0000000098000000ull, 0x000001eff8000000ull, { 18, 0, 0, 0, 0 }, 0x0, 782, },
-  { 124, 3, 0, 0x0000002170000000ull, 0x000001eff8000000ull, { 25, 0, 0, 0, 0 }, 0xc, 707, },
-  { 125, 3, 1, 0x0000002070000000ull, 0x000001eff8000000ull, { 30, 25, 0, 0, 0 }, 0x8, 708, },
-  { 125, 3, 1, 0x0000002078000000ull, 0x000001eff8000000ull, { 31, 25, 0, 0, 0 }, 0x8, 961, },
+  { 123, 3, 0, 0x0000000090000000ull, 0x000001eff8000000ull, { 24, 0, 0, 0, 0 }, 0x0, 780, },
+  { 123, 3, 0, 0x0000000098000000ull, 0x000001eff8000000ull, { 18, 0, 0, 0, 0 }, 0x0, 781, },
+  { 124, 3, 0, 0x0000002170000000ull, 0x000001eff8000000ull, { 25, 0, 0, 0, 0 }, 0xc, 706, },
+  { 125, 3, 1, 0x0000002070000000ull, 0x000001eff8000000ull, { 30, 25, 0, 0, 0 }, 0x8, 707, },
+  { 125, 3, 1, 0x0000002078000000ull, 0x000001eff8000000ull, { 31, 25, 0, 0, 0 }, 0x8, 960, },
   { 127, 3, 1, 0x0000008000000000ull, 0x000001fff8000000ull, { 24, 33, 0, 0, 0 }, 0x0, 69, },
   { 127, 3, 1, 0x0000009000000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x400, 70, },
   { 127, 3, 1, 0x000000a000000000ull, 0x000001eff0000000ull, { 24, 33, 62, 0, 0 }, 0x400, 71, },
@@ -4491,12 +4542,12 @@
   { 130, 3, 1, 0x0000009080000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x400, 77, },
   { 130, 3, 1, 0x000000a080000000ull, 0x000001eff0000000ull, { 24, 33, 62, 0, 0 }, 0x400, 78, },
   { 131, 3, 1, 0x00000080c0000000ull, 0x000001fff8000000ull, { 24, 33, 0, 0, 0 }, 0x0, 79, },
-  { 131, 3, 1, 0x00000080c0000000ull, 0x000001fff8000000ull, { 24, 33, 83, 0, 0 }, 0x0, 1122, },
+  { 131, 3, 1, 0x00000080c0000000ull, 0x000001fff8000000ull, { 24, 33, 83, 0, 0 }, 0x0, 1121, },
   { 131, 3, 1, 0x00000090c0000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x400, 80, },
   { 131, 3, 1, 0x000000a0c0000000ull, 0x000001eff0000000ull, { 24, 33, 62, 0, 0 }, 0x400, 81, },
-  { 132, 3, 1, 0x000000c6c0000000ull, 0x000001fff8000000ull, { 18, 33, 0, 0, 0 }, 0x0, 891, },
-  { 132, 3, 1, 0x000000d6c0000000ull, 0x000001fff8000000ull, { 18, 33, 25, 0, 0 }, 0x400, 892, },
-  { 132, 3, 1, 0x000000e6c0000000ull, 0x000001eff0000000ull, { 18, 33, 62, 0, 0 }, 0x400, 893, },
+  { 132, 3, 1, 0x000000c6c0000000ull, 0x000001fff8000000ull, { 18, 33, 0, 0, 0 }, 0x0, 890, },
+  { 132, 3, 1, 0x000000d6c0000000ull, 0x000001fff8000000ull, { 18, 33, 25, 0, 0 }, 0x400, 891, },
+  { 132, 3, 1, 0x000000e6c0000000ull, 0x000001eff0000000ull, { 18, 33, 62, 0, 0 }, 0x400, 892, },
   { 133, 3, 1, 0x000000c040000000ull, 0x000001fff8000000ull, { 18, 33, 0, 0, 0 }, 0x0, 82, },
   { 133, 3, 1, 0x000000d040000000ull, 0x000001fff8000000ull, { 18, 33, 25, 0, 0 }, 0x400, 83, },
   { 133, 3, 1, 0x000000e040000000ull, 0x000001eff0000000ull, { 18, 33, 62, 0, 0 }, 0x400, 84, },
@@ -4520,164 +4571,163 @@
   { 142, 3, 0, 0x000000eb00000000ull, 0x000001eff0000000ull, { 33, 62, 0, 0, 0 }, 0x400, 102, },
   { 143, 3, 0, 0x0000000050000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x21, 103, },
   { 151, 3, 0, 0x0000000110000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 104, },
-  { 152, 2, 1, 0x000000e880000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 1841, },
-  { 153, 2, 1, 0x000000ea80000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 1842, },
-  { 154, 2, 1, 0x000000f880000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 1843, },
+  { 152, 2, 1, 0x000000e880000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 1840, },
+  { 153, 2, 1, 0x000000ea80000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 1841, },
+  { 154, 2, 1, 0x000000f880000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 1842, },
   { 155, 1, 1, 0x0000010800000000ull, 0x000001fff80fe000ull, { 24, 26, 0, 0, 0 }, 0x0, 105, },
-  { 155, 1, 1, 0x0000010800000000ull, 0x000001ee07f00000ull, { 24, 63, 0, 0, 0 }, 0x40, 106, },
-  { 155, 1, 1, 0x0000012000000000ull, 0x000001e000300000ull, { 24, 66, 0, 0, 0 }, 0x40, 107, },
-  { 155, 5, 1, 0x0000000080000000ull, 0x000001e3f8000000ull, { 18, 20, 0, 0, 0 }, 0xc0, 108, },
-  { 155, 2, 1, 0x0000000e00100000ull, 0x000001ee00f00000ull, { 15, 25, 0, 0, 0 }, 0x40, 109, },
-  { 155, 2, 1, 0x0000000e00000000ull, 0x000001ee00f00000ull, { 15, 25, 78, 0, 0 }, 0x0, 2391, },
-  { 155, 2, 1, 0x0000000188000000ull, 0x000001eff8000000ull, { 24, 16, 0, 0, 0 }, 0x0, 111, },
-  { 155, 2, 1, 0x0000000600000000ull, 0x000001ee00000000ull, { 9, 25, 64, 0, 0 }, 0x0, 112, },
-  { 155, 2, 1, 0x0000000400000000ull, 0x000001ee00000000ull, { 10, 68, 0, 0, 0 }, 0x0, 113, },
-  { 155, 2, 1, 0x0000000180000000ull, 0x000001eff8000000ull, { 24, 8, 0, 0, 0 }, 0x0, 114, },
-  { 155, 2, 1, 0x0000000198000000ull, 0x000001eff8000000ull, { 24, 9, 0, 0, 0 }, 0x0, 115, },
-  { 155, 2, 1, 0x0000000150000000ull, 0x000001eff8000000ull, { 14, 25, 0, 0, 0 }, 0x0, 962, },
-  { 155, 2, 1, 0x0000000050000000ull, 0x000001eff8000000ull, { 14, 55, 0, 0, 0 }, 0x0, 963, },
-  { 155, 2, 1, 0x0000000190000000ull, 0x000001eff8000000ull, { 24, 14, 0, 0, 0 }, 0x0, 964, },
-  { 155, 3, 1, 0x0000000140000000ull, 0x000001eff8000000ull, { 14, 55, 0, 0, 0 }, 0x0, 1051, },
-  { 155, 3, 1, 0x0000002150000000ull, 0x000001eff8000000ull, { 14, 25, 0, 0, 0 }, 0x0, 1052, },
-  { 155, 3, 1, 0x0000002110000000ull, 0x000001eff8000000ull, { 24, 14, 0, 0, 0 }, 0x0, 1053, },
-  { 155, 3, 1, 0x0000002160000000ull, 0x000001eff8000000ull, { 17, 25, 0, 0, 0 }, 0x8, 116, },
-  { 155, 3, 1, 0x0000002120000000ull, 0x000001eff8000000ull, { 24, 17, 0, 0, 0 }, 0x8, 117, },
-  { 155, 3, 1, 0x0000002168000000ull, 0x000001eff8000000ull, { 12, 25, 0, 0, 0 }, 0x8, 118, },
-  { 155, 3, 1, 0x0000002148000000ull, 0x000001eff8000000ull, { 13, 25, 0, 0, 0 }, 0x0, 119, },
-  { 155, 3, 1, 0x0000002128000000ull, 0x000001eff8000000ull, { 24, 11, 0, 0, 0 }, 0x8, 120, },
-  { 155, 3, 1, 0x0000002108000000ull, 0x000001eff8000000ull, { 24, 13, 0, 0, 0 }, 0x0, 121, },
-  { 155, 3, 1, 0x0000002000000000ull, 0x000001eff8000000ull, { 38, 25, 0, 0, 0 }, 0x8, 122, },
-  { 155, 3, 1, 0x0000002008000000ull, 0x000001eff8000000ull, { 29, 25, 0, 0, 0 }, 0x8, 123, },
-  { 155, 3, 1, 0x0000002010000000ull, 0x000001eff8000000ull, { 32, 25, 0, 0, 0 }, 0x8, 124, },
-  { 155, 3, 1, 0x0000002018000000ull, 0x000001eff8000000ull, { 35, 25, 0, 0, 0 }, 0x8, 125, },
-  { 155, 3, 1, 0x0000002020000000ull, 0x000001eff8000000ull, { 36, 25, 0, 0, 0 }, 0x8, 126, },
-  { 155, 3, 1, 0x0000002028000000ull, 0x000001eff8000000ull, { 37, 25, 0, 0, 0 }, 0x8, 127, },
-  { 155, 3, 1, 0x0000002030000000ull, 0x000001eff8000000ull, { 34, 25, 0, 0, 0 }, 0x8, 128, },
-  { 155, 3, 1, 0x0000002080000000ull, 0x000001eff8000000ull, { 24, 38, 0, 0, 0 }, 0x8, 129, },
-  { 155, 3, 1, 0x0000002088000000ull, 0x000001eff8000000ull, { 24, 29, 0, 0, 0 }, 0x8, 130, },
-  { 155, 3, 1, 0x0000002090000000ull, 0x000001eff8000000ull, { 24, 32, 0, 0, 0 }, 0x8, 131, },
-  { 155, 3, 1, 0x0000002098000000ull, 0x000001eff8000000ull, { 24, 35, 0, 0, 0 }, 0x8, 132, },
-  { 155, 3, 1, 0x00000020a0000000ull, 0x000001eff8000000ull, { 24, 36, 0, 0, 0 }, 0x8, 133, },
-  { 155, 3, 1, 0x00000020a8000000ull, 0x000001eff8000000ull, { 24, 37, 0, 0, 0 }, 0x0, 134, },
-  { 155, 3, 1, 0x00000020b0000000ull, 0x000001eff8000000ull, { 24, 34, 0, 0, 0 }, 0x8, 135, },
-  { 155, 3, 1, 0x00000020b8000000ull, 0x000001eff8000000ull, { 24, 28, 0, 0, 0 }, 0x0, 136, },
-  { 155, 7, 1, 0x0000000000000000ull, 0x0000000000000000ull, { 24, 14, 0, 0, 0 }, 0x0, 137, },
-  { 155, 7, 1, 0x0000000000000000ull, 0x0000000000000000ull, { 14, 55, 0, 0, 0 }, 0x0, 138, },
-  { 155, 7, 1, 0x0000000000000000ull, 0x0000000000000000ull, { 14, 25, 0, 0, 0 }, 0x0, 139, },
-  { 156, 6, 1, 0x000000c000000000ull, 0x000001e000100000ull, { 24, 70, 0, 0, 0 }, 0x0, 140, },
-  { 157, 2, 1, 0x000000eca0000000ull, 0x000001fff0000000ull, { 24, 25, 74, 0, 0 }, 0x0, 141, },
-  { 158, 2, 1, 0x000000eea0000000ull, 0x000001fff0000000ull, { 24, 25, 75, 0, 0 }, 0x0, 142, },
-  { 168, 4, 0, 0x0000004000000000ull, 0x000001e1f8000000ull, { 65, 0, 0, 0, 0 }, 0x0, 400, },
-  { 168, 5, 0, 0x0000000008000000ull, 0x000001e3fc000000ull, { 65, 0, 0, 0, 0 }, 0x0, 814, },
-  { 168, 2, 0, 0x0000000008000000ull, 0x000001effc000000ull, { 65, 0, 0, 0, 0 }, 0x2, 965, },
-  { 168, 3, 0, 0x0000000008000000ull, 0x000001effc000000ull, { 65, 0, 0, 0, 0 }, 0x0, 1054, },
-  { 168, 6, 0, 0x0000000008000000ull, 0x000001effc000000ull, { 69, 0, 0, 0, 0 }, 0x0, 2508, },
-  { 168, 7, 0, 0x0000000000000000ull, 0x0000000000000000ull, { 65, 0, 0, 0, 0 }, 0x0, 143, },
-  { 175, 1, 1, 0x0000010070000000ull, 0x000001eff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 144, },
-  { 175, 1, 1, 0x0000010170000000ull, 0x000001eff8000000ull, { 24, 55, 26, 0, 0 }, 0x0, 145, },
-  { 178, 2, 1, 0x000000ea00000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 2490, },
-  { 179, 2, 1, 0x000000f820000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 2393, },
-  { 180, 1, 1, 0x0000010400000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 146, },
-  { 181, 1, 1, 0x0000010600000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 147, },
-  { 182, 1, 1, 0x0000011400000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 148, },
-  { 183, 1, 1, 0x0000010450000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 149, },
-  { 184, 1, 1, 0x0000010650000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 150, },
-  { 185, 1, 1, 0x0000010470000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 151, },
-  { 186, 1, 1, 0x0000010670000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 152, },
-  { 187, 1, 1, 0x0000010520000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 800, },
-  { 188, 1, 1, 0x0000010720000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 801, },
-  { 189, 1, 1, 0x0000011520000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 802, },
-  { 190, 2, 1, 0x000000e850000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 2407, },
-  { 191, 2, 1, 0x000000ea70000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 153, },
-  { 192, 2, 1, 0x000000e810000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 2408, },
-  { 193, 2, 1, 0x000000ea30000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 154, },
-  { 194, 2, 1, 0x000000ead0000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 1844, },
-  { 195, 2, 1, 0x000000e230000000ull, 0x000001ff30000000ull, { 24, 25, 26, 42, 0 }, 0x0, 155, },
-  { 196, 2, 1, 0x000000e690000000ull, 0x000001fff0000000ull, { 24, 26, 0, 0, 0 }, 0x0, 156, },
-  { 198, 3, 1, 0x00000021c0000000ull, 0x000001eff8000000ull, { 24, 26, 25, 0, 0 }, 0x0, 1845, },
-  { 198, 3, 1, 0x00000020c0000000ull, 0x000001eff8000000ull, { 24, 26, 49, 0, 0 }, 0x0, 1846, },
-  { 198, 3, 0, 0x0000002188000000ull, 0x000001eff8000000ull, { 26, 49, 0, 0, 0 }, 0x0, 1870, },
-  { 199, 2, 1, 0x000000e8b0000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 157, },
-  { 200, 2, 1, 0x000000e240000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 158, },
-  { 200, 2, 1, 0x000000ee50000000ull, 0x000001fff0000000ull, { 24, 25, 39, 0, 0 }, 0x0, 159, },
-  { 201, 2, 1, 0x000000f040000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 160, },
-  { 201, 2, 1, 0x000000fc50000000ull, 0x000001fff0000000ull, { 24, 25, 39, 0, 0 }, 0x0, 161, },
-  { 202, 1, 1, 0x0000010680000000ull, 0x000001ffe0000000ull, { 24, 25, 41, 26, 0 }, 0x0, 162, },
-  { 203, 2, 1, 0x000000e220000000ull, 0x000001fff0000000ull, { 24, 26, 25, 0, 0 }, 0x0, 163, },
-  { 203, 2, 1, 0x000000e630000000ull, 0x000001fff0000000ull, { 24, 26, 43, 0, 0 }, 0x0, 164, },
-  { 204, 2, 1, 0x000000f020000000ull, 0x000001fff0000000ull, { 24, 26, 25, 0, 0 }, 0x0, 165, },
-  { 204, 2, 1, 0x000000f430000000ull, 0x000001fff0000000ull, { 24, 26, 43, 0, 0 }, 0x0, 166, },
-  { 205, 1, 1, 0x00000106c0000000ull, 0x000001ffe0000000ull, { 24, 25, 41, 26, 0 }, 0x0, 167, },
-  { 206, 1, 1, 0x0000010420000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 168, },
-  { 207, 1, 1, 0x0000010620000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 169, },
-  { 208, 1, 1, 0x0000011420000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 170, },
-  { 209, 3, 0, 0x0000002048000000ull, 0x000001eff8000000ull, { 26, 25, 0, 0, 0 }, 0x8, 993, },
-  { 209, 3, 0, 0x0000002050000000ull, 0x000001eff8000000ull, { 26, 25, 0, 0, 0 }, 0xc, 902, },
-  { 209, 3, 0, 0x00000021a0000000ull, 0x000001eff8000000ull, { 26, 0, 0, 0, 0 }, 0x8, 783, },
-  { 210, 3, 0, 0x0000002060000000ull, 0x000001eff8000000ull, { 26, 25, 0, 0, 0 }, 0x8, 709, },
-  { 215, 4, 0, 0x0000000040000000ull, 0x000001e1f8000000ull, { 0, 0, 0, 0, 0 }, 0x22c, 171, },
-  { 216, 3, 0, 0x0000000038000000ull, 0x000001ee78000000ull, { 67, 0, 0, 0, 0 }, 0x8, 172, },
-  { 217, 3, 0, 0x0000000028000000ull, 0x000001ee78000000ull, { 67, 0, 0, 0, 0 }, 0x0, 173, },
-  { 226, 3, 1, 0x000000c708000000ull, 0x000001ffc8000000ull, { 18, 25, 0, 0, 0 }, 0x0, 2318, },
-  { 227, 2, 1, 0x000000a600000000ull, 0x000001ee04000000ull, { 24, 25, 45, 0, 0 }, 0x140, 174, },
-  { 227, 2, 1, 0x000000f240000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 175, },
-  { 228, 1, 1, 0x0000010080000000ull, 0x000001efe0000000ull, { 24, 25, 40, 26, 0 }, 0x0, 176, },
-  { 229, 1, 1, 0x00000100c0000000ull, 0x000001efe0000000ull, { 24, 25, 40, 26, 0 }, 0x0, 177, },
-  { 230, 2, 1, 0x000000a400000000ull, 0x000001ee00002000ull, { 24, 26, 76, 0, 0 }, 0x140, 2414, },
-  { 230, 2, 1, 0x000000f220000000ull, 0x000001fff0000000ull, { 24, 26, 25, 0, 0 }, 0x0, 179, },
-  { 231, 2, 1, 0x000000ac00000000ull, 0x000001ee00000000ull, { 24, 25, 26, 44, 0 }, 0x0, 180, },
-  { 236, 3, 0, 0x0000000180000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 711, },
-  { 237, 3, 0, 0x0000000030000000ull, 0x000001ee78000000ull, { 67, 0, 0, 0, 0 }, 0x8, 181, },
-  { 239, 3, 1, 0x0000008c00000000ull, 0x000001fff8000000ull, { 33, 25, 0, 0, 0 }, 0x0, 182, },
-  { 239, 3, 1, 0x000000ac00000000ull, 0x000001eff0000000ull, { 33, 25, 61, 0, 0 }, 0x400, 183, },
-  { 240, 3, 1, 0x0000008c08000000ull, 0x000001fff8000000ull, { 33, 25, 1, 0, 0 }, 0x0, 184, },
-  { 241, 3, 1, 0x0000008c40000000ull, 0x000001fff8000000ull, { 33, 25, 0, 0, 0 }, 0x0, 185, },
-  { 241, 3, 1, 0x000000ac40000000ull, 0x000001eff0000000ull, { 33, 25, 61, 0, 0 }, 0x400, 186, },
-  { 242, 3, 1, 0x0000008c80000000ull, 0x000001fff8000000ull, { 33, 25, 0, 0, 0 }, 0x0, 187, },
-  { 242, 3, 1, 0x000000ac80000000ull, 0x000001eff0000000ull, { 33, 25, 61, 0, 0 }, 0x400, 188, },
-  { 243, 3, 1, 0x0000008cc0000000ull, 0x000001fff8000000ull, { 33, 25, 0, 0, 0 }, 0x0, 189, },
-  { 243, 3, 1, 0x000000acc0000000ull, 0x000001eff0000000ull, { 33, 25, 61, 0, 0 }, 0x400, 190, },
-  { 244, 3, 1, 0x000000cec0000000ull, 0x000001fff8000000ull, { 33, 19, 0, 0, 0 }, 0x0, 2321, },
-  { 244, 3, 1, 0x000000eec0000000ull, 0x000001eff0000000ull, { 33, 19, 61, 0, 0 }, 0x400, 2322, },
-  { 245, 3, 1, 0x000000cc40000000ull, 0x000001fff8000000ull, { 33, 19, 0, 0, 0 }, 0x0, 191, },
-  { 245, 3, 1, 0x000000ec40000000ull, 0x000001eff0000000ull, { 33, 19, 61, 0, 0 }, 0x400, 192, },
-  { 246, 3, 1, 0x000000ccc0000000ull, 0x000001fff8000000ull, { 33, 19, 0, 0, 0 }, 0x0, 193, },
-  { 246, 3, 1, 0x000000ecc0000000ull, 0x000001eff0000000ull, { 33, 19, 61, 0, 0 }, 0x400, 194, },
-  { 247, 3, 1, 0x000000cc00000000ull, 0x000001fff8000000ull, { 33, 19, 0, 0, 0 }, 0x0, 195, },
-  { 247, 3, 1, 0x000000ec00000000ull, 0x000001eff0000000ull, { 33, 19, 61, 0, 0 }, 0x400, 196, },
-  { 248, 3, 1, 0x000000cc80000000ull, 0x000001fff8000000ull, { 33, 19, 0, 0, 0 }, 0x0, 197, },
-  { 248, 3, 1, 0x000000ec80000000ull, 0x000001eff0000000ull, { 33, 19, 61, 0, 0 }, 0x400, 198, },
-  { 249, 1, 1, 0x0000010028000000ull, 0x000001eff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 199, },
-  { 249, 1, 1, 0x0000010020000000ull, 0x000001eff8000000ull, { 24, 25, 26, 4, 0 }, 0x0, 200, },
-  { 249, 1, 1, 0x0000010128000000ull, 0x000001eff8000000ull, { 24, 55, 26, 0, 0 }, 0x0, 201, },
-  { 250, 3, 0, 0x0000000020000000ull, 0x000001ee78000000ull, { 67, 0, 0, 0, 0 }, 0x0, 202, },
-  { 251, 2, 1, 0x00000000a0000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 203, },
-  { 252, 2, 1, 0x00000000a8000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 204, },
-  { 253, 2, 1, 0x00000000b0000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 205, },
-  { 254, 3, 0, 0x0000000198000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 968, },
-  { 255, 3, 1, 0x00000020f8000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x8, 206, },
-  { 256, 2, 2, 0x000000a000000000ull, 0x000001fe00003000ull, { 22, 23, 26, 76, 0 }, 0x0, 2513, },
-  { 256, 2, 2, 0x000000a000000000ull, 0x000001fe00003000ull, { 23, 22, 26, 76, 0 }, 0x40, 1745, },
-  { 257, 3, 1, 0x00000020d0000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 207, },
-  { 258, 2, 2, 0x000000a000002000ull, 0x000001fe00003000ull, { 22, 23, 26, 0, 0 }, 0x0, 2515, },
-  { 258, 2, 2, 0x000000a000002000ull, 0x000001fe00003000ull, { 23, 22, 26, 0, 0 }, 0x40, 1747, },
-  { 259, 3, 1, 0x00000020f0000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x8, 208, },
-  { 261, 3, 1, 0x00000020d8000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 209, },
-  { 265, 2, 1, 0x000000e840000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 949, },
-  { 266, 2, 1, 0x000000ea40000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 950, },
-  { 267, 2, 1, 0x000000f840000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 951, },
-  { 275, 3, 1, 0x0000008208000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x0, 210, },
-  { 276, 3, 1, 0x0000008248000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x0, 211, },
-  { 277, 3, 1, 0x0000008288000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x0, 212, },
-  { 278, 3, 1, 0x00000082c8000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x0, 213, },
-  { 280, 5, 1, 0x000001d000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 997, },
-  { 280, 5, 1, 0x000001d000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x40, 1045, },
-  { 281, 5, 1, 0x000001d000000000ull, 0x000001fc000fe000ull, { 18, 20, 21, 0, 0 }, 0x40, 998, },
-  { 282, 1, 1, 0x0000010078000000ull, 0x000001eff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 214, },
-  { 282, 1, 1, 0x0000010178000000ull, 0x000001eff8000000ull, { 24, 55, 26, 0, 0 }, 0x0, 215, },
-  { 285, 2, 1, 0x0000000080000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 216, },
-  { 286, 2, 1, 0x0000000088000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 217, },
-  { 287, 2, 1, 0x0000000090000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 218, },
+  { 155, 1, 1, 0x0000012000000000ull, 0x000001e000300000ull, { 24, 66, 0, 0, 0 }, 0x40, 106, },
+  { 155, 5, 1, 0x0000000080000000ull, 0x000001e3f8000000ull, { 18, 20, 0, 0, 0 }, 0xc0, 107, },
+  { 155, 2, 1, 0x0000000e00100000ull, 0x000001ee00f00000ull, { 15, 25, 0, 0, 0 }, 0x40, 108, },
+  { 155, 2, 1, 0x0000000e00000000ull, 0x000001ee00f00000ull, { 15, 25, 78, 0, 0 }, 0x0, 2390, },
+  { 155, 2, 1, 0x0000000188000000ull, 0x000001eff8000000ull, { 24, 16, 0, 0, 0 }, 0x0, 110, },
+  { 155, 2, 1, 0x0000000600000000ull, 0x000001ee00000000ull, { 9, 25, 64, 0, 0 }, 0x0, 111, },
+  { 155, 2, 1, 0x0000000400000000ull, 0x000001ee00000000ull, { 10, 68, 0, 0, 0 }, 0x0, 112, },
+  { 155, 2, 1, 0x0000000180000000ull, 0x000001eff8000000ull, { 24, 8, 0, 0, 0 }, 0x0, 113, },
+  { 155, 2, 1, 0x0000000198000000ull, 0x000001eff8000000ull, { 24, 9, 0, 0, 0 }, 0x0, 114, },
+  { 155, 2, 1, 0x0000000150000000ull, 0x000001eff8000000ull, { 14, 25, 0, 0, 0 }, 0x0, 961, },
+  { 155, 2, 1, 0x0000000050000000ull, 0x000001eff8000000ull, { 14, 55, 0, 0, 0 }, 0x0, 962, },
+  { 155, 2, 1, 0x0000000190000000ull, 0x000001eff8000000ull, { 24, 14, 0, 0, 0 }, 0x0, 963, },
+  { 155, 3, 1, 0x0000000140000000ull, 0x000001eff8000000ull, { 14, 55, 0, 0, 0 }, 0x0, 1050, },
+  { 155, 3, 1, 0x0000002150000000ull, 0x000001eff8000000ull, { 14, 25, 0, 0, 0 }, 0x0, 1051, },
+  { 155, 3, 1, 0x0000002110000000ull, 0x000001eff8000000ull, { 24, 14, 0, 0, 0 }, 0x0, 1052, },
+  { 155, 3, 1, 0x0000002160000000ull, 0x000001eff8000000ull, { 17, 25, 0, 0, 0 }, 0x8, 115, },
+  { 155, 3, 1, 0x0000002120000000ull, 0x000001eff8000000ull, { 24, 17, 0, 0, 0 }, 0x8, 116, },
+  { 155, 3, 1, 0x0000002168000000ull, 0x000001eff8000000ull, { 12, 25, 0, 0, 0 }, 0x8, 117, },
+  { 155, 3, 1, 0x0000002148000000ull, 0x000001eff8000000ull, { 13, 25, 0, 0, 0 }, 0x0, 118, },
+  { 155, 3, 1, 0x0000002128000000ull, 0x000001eff8000000ull, { 24, 11, 0, 0, 0 }, 0x8, 119, },
+  { 155, 3, 1, 0x0000002108000000ull, 0x000001eff8000000ull, { 24, 13, 0, 0, 0 }, 0x0, 120, },
+  { 155, 3, 1, 0x0000002000000000ull, 0x000001eff8000000ull, { 38, 25, 0, 0, 0 }, 0x8, 121, },
+  { 155, 3, 1, 0x0000002008000000ull, 0x000001eff8000000ull, { 29, 25, 0, 0, 0 }, 0x8, 122, },
+  { 155, 3, 1, 0x0000002010000000ull, 0x000001eff8000000ull, { 32, 25, 0, 0, 0 }, 0x8, 123, },
+  { 155, 3, 1, 0x0000002018000000ull, 0x000001eff8000000ull, { 35, 25, 0, 0, 0 }, 0x8, 124, },
+  { 155, 3, 1, 0x0000002020000000ull, 0x000001eff8000000ull, { 36, 25, 0, 0, 0 }, 0x8, 125, },
+  { 155, 3, 1, 0x0000002028000000ull, 0x000001eff8000000ull, { 37, 25, 0, 0, 0 }, 0x8, 126, },
+  { 155, 3, 1, 0x0000002030000000ull, 0x000001eff8000000ull, { 34, 25, 0, 0, 0 }, 0x8, 127, },
+  { 155, 3, 1, 0x0000002080000000ull, 0x000001eff8000000ull, { 24, 38, 0, 0, 0 }, 0x8, 128, },
+  { 155, 3, 1, 0x0000002088000000ull, 0x000001eff8000000ull, { 24, 29, 0, 0, 0 }, 0x8, 129, },
+  { 155, 3, 1, 0x0000002090000000ull, 0x000001eff8000000ull, { 24, 32, 0, 0, 0 }, 0x8, 130, },
+  { 155, 3, 1, 0x0000002098000000ull, 0x000001eff8000000ull, { 24, 35, 0, 0, 0 }, 0x8, 131, },
+  { 155, 3, 1, 0x00000020a0000000ull, 0x000001eff8000000ull, { 24, 36, 0, 0, 0 }, 0x8, 132, },
+  { 155, 3, 1, 0x00000020a8000000ull, 0x000001eff8000000ull, { 24, 37, 0, 0, 0 }, 0x0, 133, },
+  { 155, 3, 1, 0x00000020b0000000ull, 0x000001eff8000000ull, { 24, 34, 0, 0, 0 }, 0x8, 134, },
+  { 155, 3, 1, 0x00000020b8000000ull, 0x000001eff8000000ull, { 24, 28, 0, 0, 0 }, 0x0, 135, },
+  { 155, 7, 1, 0x0000000000000000ull, 0x0000000000000000ull, { 24, 14, 0, 0, 0 }, 0x0, 136, },
+  { 155, 7, 1, 0x0000000000000000ull, 0x0000000000000000ull, { 14, 55, 0, 0, 0 }, 0x0, 137, },
+  { 155, 7, 1, 0x0000000000000000ull, 0x0000000000000000ull, { 14, 25, 0, 0, 0 }, 0x0, 138, },
+  { 156, 6, 1, 0x000000c000000000ull, 0x000001e000100000ull, { 24, 70, 0, 0, 0 }, 0x0, 139, },
+  { 157, 2, 1, 0x000000eca0000000ull, 0x000001fff0000000ull, { 24, 25, 74, 0, 0 }, 0x0, 140, },
+  { 158, 2, 1, 0x000000eea0000000ull, 0x000001fff0000000ull, { 24, 25, 75, 0, 0 }, 0x0, 141, },
+  { 168, 4, 0, 0x0000004000000000ull, 0x000001e1f8000000ull, { 65, 0, 0, 0, 0 }, 0x0, 399, },
+  { 168, 5, 0, 0x0000000008000000ull, 0x000001e3fc000000ull, { 65, 0, 0, 0, 0 }, 0x0, 813, },
+  { 168, 2, 0, 0x0000000008000000ull, 0x000001effc000000ull, { 65, 0, 0, 0, 0 }, 0x2, 964, },
+  { 168, 3, 0, 0x0000000008000000ull, 0x000001effc000000ull, { 65, 0, 0, 0, 0 }, 0x0, 1053, },
+  { 168, 6, 0, 0x0000000008000000ull, 0x000001effc000000ull, { 69, 0, 0, 0, 0 }, 0x0, 2507, },
+  { 168, 7, 0, 0x0000000000000000ull, 0x0000000000000000ull, { 65, 0, 0, 0, 0 }, 0x0, 142, },
+  { 175, 1, 1, 0x0000010070000000ull, 0x000001eff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 143, },
+  { 175, 1, 1, 0x0000010170000000ull, 0x000001eff8000000ull, { 24, 55, 26, 0, 0 }, 0x0, 144, },
+  { 178, 2, 1, 0x000000ea00000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 2489, },
+  { 179, 2, 1, 0x000000f820000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 2392, },
+  { 180, 1, 1, 0x0000010400000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 145, },
+  { 181, 1, 1, 0x0000010600000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 146, },
+  { 182, 1, 1, 0x0000011400000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 147, },
+  { 183, 1, 1, 0x0000010450000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 148, },
+  { 184, 1, 1, 0x0000010650000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 149, },
+  { 185, 1, 1, 0x0000010470000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 150, },
+  { 186, 1, 1, 0x0000010670000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 151, },
+  { 187, 1, 1, 0x0000010520000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 799, },
+  { 188, 1, 1, 0x0000010720000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 800, },
+  { 189, 1, 1, 0x0000011520000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 801, },
+  { 190, 2, 1, 0x000000e850000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 2406, },
+  { 191, 2, 1, 0x000000ea70000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 152, },
+  { 192, 2, 1, 0x000000e810000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 2407, },
+  { 193, 2, 1, 0x000000ea30000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 153, },
+  { 194, 2, 1, 0x000000ead0000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 1843, },
+  { 195, 2, 1, 0x000000e230000000ull, 0x000001ff30000000ull, { 24, 25, 26, 42, 0 }, 0x0, 154, },
+  { 196, 2, 1, 0x000000e690000000ull, 0x000001fff0000000ull, { 24, 26, 0, 0, 0 }, 0x0, 155, },
+  { 198, 3, 1, 0x00000021c0000000ull, 0x000001eff8000000ull, { 24, 26, 25, 0, 0 }, 0x0, 1844, },
+  { 198, 3, 1, 0x00000020c0000000ull, 0x000001eff8000000ull, { 24, 26, 49, 0, 0 }, 0x0, 1845, },
+  { 198, 3, 0, 0x0000002188000000ull, 0x000001eff8000000ull, { 26, 49, 0, 0, 0 }, 0x0, 1869, },
+  { 199, 2, 1, 0x000000e8b0000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 156, },
+  { 200, 2, 1, 0x000000e240000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 157, },
+  { 200, 2, 1, 0x000000ee50000000ull, 0x000001fff0000000ull, { 24, 25, 39, 0, 0 }, 0x0, 158, },
+  { 201, 2, 1, 0x000000f040000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 159, },
+  { 201, 2, 1, 0x000000fc50000000ull, 0x000001fff0000000ull, { 24, 25, 39, 0, 0 }, 0x0, 160, },
+  { 202, 1, 1, 0x0000010680000000ull, 0x000001ffe0000000ull, { 24, 25, 41, 26, 0 }, 0x0, 161, },
+  { 203, 2, 1, 0x000000e220000000ull, 0x000001fff0000000ull, { 24, 26, 25, 0, 0 }, 0x0, 162, },
+  { 203, 2, 1, 0x000000e630000000ull, 0x000001fff0000000ull, { 24, 26, 43, 0, 0 }, 0x0, 163, },
+  { 204, 2, 1, 0x000000f020000000ull, 0x000001fff0000000ull, { 24, 26, 25, 0, 0 }, 0x0, 164, },
+  { 204, 2, 1, 0x000000f430000000ull, 0x000001fff0000000ull, { 24, 26, 43, 0, 0 }, 0x0, 165, },
+  { 205, 1, 1, 0x00000106c0000000ull, 0x000001ffe0000000ull, { 24, 25, 41, 26, 0 }, 0x0, 166, },
+  { 206, 1, 1, 0x0000010420000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 167, },
+  { 207, 1, 1, 0x0000010620000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 168, },
+  { 208, 1, 1, 0x0000011420000000ull, 0x000001fff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 169, },
+  { 209, 3, 0, 0x0000002048000000ull, 0x000001eff8000000ull, { 26, 25, 0, 0, 0 }, 0x8, 992, },
+  { 209, 3, 0, 0x0000002050000000ull, 0x000001eff8000000ull, { 26, 25, 0, 0, 0 }, 0xc, 901, },
+  { 209, 3, 0, 0x00000021a0000000ull, 0x000001eff8000000ull, { 26, 0, 0, 0, 0 }, 0x8, 782, },
+  { 210, 3, 0, 0x0000002060000000ull, 0x000001eff8000000ull, { 26, 25, 0, 0, 0 }, 0x8, 708, },
+  { 215, 4, 0, 0x0000000040000000ull, 0x000001e1f8000000ull, { 0, 0, 0, 0, 0 }, 0x22c, 170, },
+  { 216, 3, 0, 0x0000000038000000ull, 0x000001ee78000000ull, { 67, 0, 0, 0, 0 }, 0x8, 171, },
+  { 217, 3, 0, 0x0000000028000000ull, 0x000001ee78000000ull, { 67, 0, 0, 0, 0 }, 0x0, 172, },
+  { 226, 3, 1, 0x000000c708000000ull, 0x000001ffc8000000ull, { 18, 25, 0, 0, 0 }, 0x0, 2317, },
+  { 227, 2, 1, 0x000000a600000000ull, 0x000001ee04000000ull, { 24, 25, 45, 0, 0 }, 0x140, 173, },
+  { 227, 2, 1, 0x000000f240000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 174, },
+  { 228, 1, 1, 0x0000010080000000ull, 0x000001efe0000000ull, { 24, 25, 40, 26, 0 }, 0x0, 175, },
+  { 229, 1, 1, 0x00000100c0000000ull, 0x000001efe0000000ull, { 24, 25, 40, 26, 0 }, 0x0, 176, },
+  { 230, 2, 1, 0x000000a400000000ull, 0x000001ee00002000ull, { 24, 26, 76, 0, 0 }, 0x140, 2413, },
+  { 230, 2, 1, 0x000000f220000000ull, 0x000001fff0000000ull, { 24, 26, 25, 0, 0 }, 0x0, 178, },
+  { 231, 2, 1, 0x000000ac00000000ull, 0x000001ee00000000ull, { 24, 25, 26, 44, 0 }, 0x0, 179, },
+  { 236, 3, 0, 0x0000000180000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 710, },
+  { 237, 3, 0, 0x0000000030000000ull, 0x000001ee78000000ull, { 67, 0, 0, 0, 0 }, 0x8, 180, },
+  { 239, 3, 1, 0x0000008c00000000ull, 0x000001fff8000000ull, { 33, 25, 0, 0, 0 }, 0x0, 181, },
+  { 239, 3, 1, 0x000000ac00000000ull, 0x000001eff0000000ull, { 33, 25, 61, 0, 0 }, 0x400, 182, },
+  { 240, 3, 1, 0x0000008c08000000ull, 0x000001fff8000000ull, { 33, 25, 1, 0, 0 }, 0x0, 183, },
+  { 241, 3, 1, 0x0000008c40000000ull, 0x000001fff8000000ull, { 33, 25, 0, 0, 0 }, 0x0, 184, },
+  { 241, 3, 1, 0x000000ac40000000ull, 0x000001eff0000000ull, { 33, 25, 61, 0, 0 }, 0x400, 185, },
+  { 242, 3, 1, 0x0000008c80000000ull, 0x000001fff8000000ull, { 33, 25, 0, 0, 0 }, 0x0, 186, },
+  { 242, 3, 1, 0x000000ac80000000ull, 0x000001eff0000000ull, { 33, 25, 61, 0, 0 }, 0x400, 187, },
+  { 243, 3, 1, 0x0000008cc0000000ull, 0x000001fff8000000ull, { 33, 25, 0, 0, 0 }, 0x0, 188, },
+  { 243, 3, 1, 0x000000acc0000000ull, 0x000001eff0000000ull, { 33, 25, 61, 0, 0 }, 0x400, 189, },
+  { 244, 3, 1, 0x000000cec0000000ull, 0x000001fff8000000ull, { 33, 19, 0, 0, 0 }, 0x0, 2320, },
+  { 244, 3, 1, 0x000000eec0000000ull, 0x000001eff0000000ull, { 33, 19, 61, 0, 0 }, 0x400, 2321, },
+  { 245, 3, 1, 0x000000cc40000000ull, 0x000001fff8000000ull, { 33, 19, 0, 0, 0 }, 0x0, 190, },
+  { 245, 3, 1, 0x000000ec40000000ull, 0x000001eff0000000ull, { 33, 19, 61, 0, 0 }, 0x400, 191, },
+  { 246, 3, 1, 0x000000ccc0000000ull, 0x000001fff8000000ull, { 33, 19, 0, 0, 0 }, 0x0, 192, },
+  { 246, 3, 1, 0x000000ecc0000000ull, 0x000001eff0000000ull, { 33, 19, 61, 0, 0 }, 0x400, 193, },
+  { 247, 3, 1, 0x000000cc00000000ull, 0x000001fff8000000ull, { 33, 19, 0, 0, 0 }, 0x0, 194, },
+  { 247, 3, 1, 0x000000ec00000000ull, 0x000001eff0000000ull, { 33, 19, 61, 0, 0 }, 0x400, 195, },
+  { 248, 3, 1, 0x000000cc80000000ull, 0x000001fff8000000ull, { 33, 19, 0, 0, 0 }, 0x0, 196, },
+  { 248, 3, 1, 0x000000ec80000000ull, 0x000001eff0000000ull, { 33, 19, 61, 0, 0 }, 0x400, 197, },
+  { 249, 1, 1, 0x0000010028000000ull, 0x000001eff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 198, },
+  { 249, 1, 1, 0x0000010020000000ull, 0x000001eff8000000ull, { 24, 25, 26, 4, 0 }, 0x0, 199, },
+  { 249, 1, 1, 0x0000010128000000ull, 0x000001eff8000000ull, { 24, 55, 26, 0, 0 }, 0x0, 200, },
+  { 250, 3, 0, 0x0000000020000000ull, 0x000001ee78000000ull, { 67, 0, 0, 0, 0 }, 0x0, 201, },
+  { 251, 2, 1, 0x00000000a0000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 202, },
+  { 252, 2, 1, 0x00000000a8000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 203, },
+  { 253, 2, 1, 0x00000000b0000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 204, },
+  { 254, 3, 0, 0x0000000198000000ull, 0x000001eff8000000ull, { 0, 0, 0, 0, 0 }, 0x0, 967, },
+  { 255, 3, 1, 0x00000020f8000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x8, 205, },
+  { 256, 2, 2, 0x000000a000000000ull, 0x000001fe00003000ull, { 22, 23, 26, 76, 0 }, 0x0, 2512, },
+  { 256, 2, 2, 0x000000a000000000ull, 0x000001fe00003000ull, { 23, 22, 26, 76, 0 }, 0x40, 1744, },
+  { 257, 3, 1, 0x00000020d0000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 206, },
+  { 258, 2, 2, 0x000000a000002000ull, 0x000001fe00003000ull, { 22, 23, 26, 0, 0 }, 0x0, 2514, },
+  { 258, 2, 2, 0x000000a000002000ull, 0x000001fe00003000ull, { 23, 22, 26, 0, 0 }, 0x40, 1746, },
+  { 259, 3, 1, 0x00000020f0000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x8, 207, },
+  { 261, 3, 1, 0x00000020d8000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 208, },
+  { 265, 2, 1, 0x000000e840000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 948, },
+  { 266, 2, 1, 0x000000ea40000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 949, },
+  { 267, 2, 1, 0x000000f840000000ull, 0x000001fff0000000ull, { 24, 25, 26, 0, 0 }, 0x0, 950, },
+  { 275, 3, 1, 0x0000008208000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x0, 209, },
+  { 276, 3, 1, 0x0000008248000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x0, 210, },
+  { 277, 3, 1, 0x0000008288000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x0, 211, },
+  { 278, 3, 1, 0x00000082c8000000ull, 0x000001fff8000000ull, { 24, 33, 25, 0, 0 }, 0x0, 212, },
+  { 280, 5, 1, 0x000001d000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x0, 996, },
+  { 280, 5, 1, 0x000001d000000000ull, 0x000001fc00000000ull, { 18, 20, 21, 19, 0 }, 0x40, 1044, },
+  { 281, 5, 1, 0x000001d000000000ull, 0x000001fc000fe000ull, { 18, 20, 21, 0, 0 }, 0x40, 997, },
+  { 282, 1, 1, 0x0000010078000000ull, 0x000001eff8000000ull, { 24, 25, 26, 0, 0 }, 0x0, 213, },
+  { 282, 1, 1, 0x0000010178000000ull, 0x000001eff8000000ull, { 24, 55, 26, 0, 0 }, 0x0, 214, },
+  { 285, 2, 1, 0x0000000080000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 215, },
+  { 286, 2, 1, 0x0000000088000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 216, },
+  { 287, 2, 1, 0x0000000090000000ull, 0x000001eff8000000ull, { 24, 26, 0, 0, 0 }, 0x0, 217, },
 };
 
 static const char dis_table[] = {
@@ -5206,7 +5256,7 @@
 0xd8, 0x90, 0x28, 0x80, 0x30, 0x5a, 0x24, 0x02, 0xc8, 0x80, 0x10, 0x10, 
 0x10, 0x10, 0x90, 0x28, 0x80, 0x30, 0x53, 0x24, 0x02, 0xa0, 0xd7, 0x42, 
 0x00, 0xa4, 0x32, 0x30, 0x36, 0x48, 0xa4, 0x32, 0x10, 0x36, 0x44, 0xa0, 
-0x14, 0x90, 0xa0, 0x10, 0xb8, 0xa0, 0x0c, 0x88, 0x9e, 0x88, 0x09, 0xd0, 
+0x14, 0x68, 0xa0, 0x10, 0x90, 0xa0, 0x0c, 0x60, 0x9e, 0x88, 0x09, 0xd0, 
 0x94, 0xf0, 0x90, 0xb0, 0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 
 0x31, 0xc0, 0x85, 0x34, 0xe3, 0xcb, 0x61, 0x2a, 0x80, 0x85, 0x34, 0xb9, 
 0x9a, 0x00, 0x03, 0xf8, 0x91, 0x98, 0x80, 0x91, 0x10, 0x90, 0xa0, 0x90, 
@@ -5221,7 +5271,7 @@
 0x38, 0x95, 0x90, 0x28, 0x80, 0x38, 0x8e, 0x80, 0x38, 0x8d, 0x81, 0x10, 
 0x10, 0x80, 0xa4, 0x44, 0x88, 0x38, 0x92, 0xcb, 0x61, 0x2a, 0x40, 0x85, 
 0x34, 0xb8, 0x90, 0xd8, 0x88, 0x00, 0x90, 0x84, 0x90, 0x38, 0xc1, 0xc0, 
-0x85, 0x38, 0xb1, 0xc9, 0xe1, 0x31, 0x80, 0x85, 0x34, 0xdf, 0xcb, 0x61, 
+0x85, 0x38, 0xb0, 0xc9, 0xe1, 0x31, 0x80, 0x85, 0x34, 0xdf, 0xcb, 0x61, 
 0x2a, 0x00, 0x85, 0x34, 0xb7, 0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 
 0xe1, 0x31, 0x40, 0x85, 0x34, 0xdd, 0xcb, 0x61, 0x29, 0xc0, 0x85, 0x34, 
 0xb6, 0x91, 0xf8, 0x90, 0xb0, 0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 
@@ -5233,86 +5283,85 @@
 0xc9, 0xe1, 0x30, 0x40, 0x85, 0x34, 0xd5, 0xcb, 0x61, 0x28, 0xc0, 0x85, 
 0x34, 0xb2, 0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 0x30, 0x00, 
 0x85, 0x34, 0xd3, 0xcb, 0x61, 0x28, 0x80, 0x85, 0x34, 0xb1, 0x92, 0x38, 
-0x81, 0x91, 0x68, 0x91, 0x18, 0x90, 0x80, 0x90, 0x40, 0x80, 0xa4, 0x46, 
-0x00, 0x38, 0xc1, 0x80, 0xa4, 0x45, 0xf8, 0x38, 0xbe, 0x90, 0x28, 0x81, 
-0x38, 0xbd, 0x90, 0x38, 0xa4, 0x45, 0xd8, 0x38, 0xbc, 0xa4, 0x45, 0xc8, 
-0x38, 0xba, 0x90, 0x28, 0x80, 0x38, 0xb8, 0x80, 0x38, 0xb7, 0x80, 0x90, 
-0x40, 0x10, 0x10, 0x80, 0x24, 0x45, 0xb0, 0x10, 0x10, 0x90, 0x38, 0xa4, 
-0x45, 0xa0, 0x38, 0xb5, 0xa4, 0x45, 0x90, 0x38, 0xb3, 0x90, 0x50, 0x80, 
-0xc9, 0xa2, 0x2b, 0xc0, 0x85, 0x38, 0xb0, 0x80, 0x38, 0xae, 0x9a, 0xd0, 
-0x03, 0xe0, 0x91, 0x60, 0x90, 0xb0, 0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 
-0xc9, 0xe1, 0x2f, 0x80, 0x85, 0x34, 0xcf, 0xcb, 0x61, 0x28, 0x00, 0x85, 
-0x34, 0xaf, 0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 0x2f, 0x40, 
-0x85, 0x34, 0xcd, 0xcb, 0x61, 0x27, 0xc0, 0x85, 0x34, 0xae, 0x90, 0xb0, 
-0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 0x2f, 0x00, 0x85, 0x34, 
-0xcb, 0xcb, 0x61, 0x27, 0x80, 0x85, 0x34, 0xad, 0x88, 0x00, 0x68, 0x84, 
-0x10, 0x10, 0xc9, 0xe1, 0x2e, 0xc0, 0x85, 0x34, 0xc9, 0xcb, 0x61, 0x27, 
-0x40, 0x85, 0x34, 0xac, 0x90, 0x90, 0x90, 0x48, 0xcb, 0xa1, 0x25, 0x80, 
-0x85, 0x34, 0x9b, 0xcb, 0xa1, 0x25, 0x40, 0x85, 0x34, 0x9a, 0x90, 0x48, 
-0xcb, 0xa1, 0x25, 0x00, 0x85, 0x34, 0x99, 0xcb, 0xa1, 0x24, 0xc0, 0x85, 
-0x34, 0x98, 0xcb, 0xa2, 0x22, 0xc0, 0x80, 0x38, 0x8c, 0x92, 0x40, 0x91, 
-0x20, 0x90, 0x90, 0x90, 0x48, 0x8c, 0x24, 0x10, 0x84, 0x24, 0x24, 0x88, 
-0x8c, 0x24, 0x08, 0x84, 0x24, 0x24, 0x80, 0x90, 0x48, 0x8c, 0x24, 0x00, 
-0x84, 0x24, 0x24, 0x78, 0x8c, 0x23, 0xf8, 0x84, 0x24, 0x24, 0x70, 0x90, 
-0x90, 0x90, 0x48, 0x8c, 0x23, 0xe8, 0x84, 0x24, 0x24, 0x60, 0x8c, 0x23, 
-0xe0, 0x84, 0x24, 0x24, 0x58, 0x90, 0x48, 0x8c, 0x23, 0xd8, 0x84, 0x24, 
-0x24, 0x50, 0x8c, 0x23, 0xd0, 0x84, 0x24, 0x24, 0x48, 0x91, 0x20, 0x90, 
-0x90, 0x90, 0x48, 0x8c, 0x23, 0xc0, 0x84, 0x24, 0x24, 0x38, 0x8c, 0x23, 
-0xb8, 0x84, 0x24, 0x24, 0x30, 0x90, 0x48, 0x8c, 0x23, 0xb0, 0x84, 0x24, 
-0x24, 0x28, 0x8c, 0x23, 0xa8, 0x84, 0x24, 0x24, 0x20, 0x90, 0x38, 0xa4, 
-0x23, 0x90, 0x34, 0x73, 0xa4, 0x23, 0x80, 0x34, 0x71, 0xa0, 0x0f, 0x50, 
-0xa0, 0x09, 0x08, 0x9a, 0x30, 0x04, 0x40, 0x91, 0x90, 0x90, 0xc8, 0x98, 
-0x50, 0x00, 0x80, 0xe5, 0x22, 0x21, 0xc0, 0x38, 0x83, 0xe5, 0x22, 0x1d, 
-0xc0, 0x38, 0x81, 0xcb, 0x61, 0x17, 0xc0, 0x85, 0x34, 0x6e, 0x98, 0x50, 
-0x00, 0x80, 0xe5, 0x22, 0x19, 0xc0, 0x38, 0x63, 0xe5, 0x22, 0x15, 0xc0, 
-0x38, 0x61, 0xcb, 0x61, 0x17, 0x80, 0x85, 0x34, 0x6d, 0x90, 0x48, 0xcb, 
-0xa1, 0x17, 0x40, 0x85, 0x34, 0x6c, 0xcb, 0xa1, 0x17, 0x00, 0x85, 0x34, 
-0x6b, 0x91, 0x90, 0x90, 0xc8, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x0e, 
-0xc0, 0x38, 0x47, 0xe5, 0x22, 0x08, 0xc0, 0x38, 0x2f, 0xcb, 0x61, 0x16, 
-0x80, 0x85, 0x34, 0x69, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x02, 0xc0, 
-0x38, 0x17, 0xe5, 0x21, 0xfc, 0xc0, 0x37, 0xff, 0xcb, 0x61, 0x16, 0x40, 
-0x85, 0x34, 0x68, 0x90, 0x48, 0xcb, 0xa1, 0x16, 0x00, 0x85, 0x34, 0x67, 
-0xcb, 0xa1, 0x15, 0xc0, 0x85, 0x34, 0x66, 0x92, 0x20, 0x91, 0x30, 0x90, 
-0xb8, 0xd5, 0x03, 0x00, 0xc0, 0xc0, 0x81, 0x8c, 0x01, 0xa0, 0x84, 0x30, 
-0x3e, 0xc0, 0xc0, 0x81, 0x8c, 0x01, 0x80, 0x84, 0x30, 0x3c, 0xd5, 0x02, 
-0x00, 0xc0, 0xc0, 0x81, 0x30, 0x28, 0xc0, 0xc0, 0x81, 0x30, 0x24, 0x90, 
-0x78, 0xd5, 0x02, 0x00, 0xc0, 0xc0, 0x81, 0x30, 0x1c, 0xc0, 0xc0, 0x81, 
-0x30, 0x18, 0xd5, 0x02, 0x00, 0xc0, 0xc0, 0x81, 0x30, 0x10, 0xc0, 0xc0, 
-0x81, 0x30, 0x0c, 0x91, 0x70, 0x90, 0xd8, 0xd5, 0x03, 0x80, 0xc8, 0xe1, 
-0xf8, 0xc0, 0x81, 0x8c, 0x01, 0xc0, 0x84, 0x30, 0x40, 0xc8, 0xe1, 0xf9, 
-0xc0, 0x81, 0x8c, 0x01, 0x90, 0x84, 0x30, 0x3d, 0xd5, 0x02, 0x80, 0xc8, 
-0xe1, 0xf8, 0x40, 0x81, 0x30, 0x2c, 0xc8, 0xe1, 0xf5, 0x40, 0x81, 0x30, 
-0x26, 0x90, 0x98, 0xd5, 0x02, 0x80, 0xc8, 0xe1, 0xef, 0x40, 0x81, 0x30, 
-0x20, 0xc8, 0xe1, 0xf0, 0x40, 0x81, 0x30, 0x1a, 0xd5, 0x02, 0x80, 0xc8, 
-0xe1, 0xee, 0xc0, 0x81, 0x30, 0x14, 0xc8, 0xe1, 0xeb, 0xc0, 0x81, 0x30, 
-0x0e, 0x9a, 0x30, 0x04, 0x40, 0x91, 0x90, 0x90, 0xc8, 0x98, 0x50, 0x00, 
-0x80, 0xe5, 0x22, 0x1b, 0xc0, 0x38, 0x6b, 0xe5, 0x22, 0x1c, 0xc0, 0x38, 
-0x7d, 0xcb, 0x61, 0x15, 0x40, 0x85, 0x34, 0x64, 0x98, 0x50, 0x00, 0x80, 
-0xe5, 0x22, 0x13, 0xc0, 0x38, 0x4b, 0xe5, 0x22, 0x14, 0xc0, 0x38, 0x5d, 
-0xcb, 0x61, 0x15, 0x00, 0x85, 0x34, 0x63, 0x90, 0x48, 0xcb, 0xa1, 0x14, 
-0xc0, 0x85, 0x34, 0x62, 0xcb, 0xa1, 0x14, 0x80, 0x85, 0x34, 0x61, 0x91, 
-0x90, 0x90, 0xc8, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x0c, 0xc0, 0x38, 
-0x3f, 0xe5, 0x22, 0x06, 0xc0, 0x38, 0x27, 0xcb, 0x61, 0x12, 0xc0, 0x85, 
-0x34, 0x50, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x00, 0xc0, 0x38, 0x0f, 
-0xe5, 0x21, 0xfa, 0xc0, 0x37, 0xf7, 0xcb, 0x61, 0x12, 0x80, 0x85, 0x34, 
-0x4f, 0x90, 0x48, 0xcb, 0xa1, 0x12, 0x40, 0x85, 0x34, 0x4e, 0xcb, 0xa1, 
-0x12, 0x00, 0x85, 0x34, 0x4d, 0x91, 0x00, 0x90, 0x80, 0x90, 0x40, 0xe5, 
-0x20, 0x02, 0x40, 0x30, 0x0a, 0xe5, 0x20, 0x01, 0x80, 0x30, 0x07, 0x90, 
-0x40, 0xe5, 0x20, 0x00, 0xc0, 0x30, 0x04, 0xe5, 0x20, 0x00, 0x00, 0x30, 
-0x01, 0x90, 0x80, 0x90, 0x40, 0xe5, 0x21, 0xf2, 0xc0, 0x37, 0xc5, 0xe5, 
-0x21, 0xf4, 0x00, 0x37, 0xdb, 0x90, 0x40, 0xe5, 0x21, 0xe9, 0x40, 0x37, 
-0x9f, 0xe5, 0x21, 0xea, 0x80, 0x37, 0xb5, 0x80, 0x99, 0x28, 0x02, 0xf0, 
-0x8c, 0x21, 0xf8, 0x90, 0x80, 0x90, 0x40, 0xe5, 0x22, 0x1e, 0xc0, 0x38, 
-0x79, 0xe5, 0x22, 0x1d, 0x40, 0x38, 0x7f, 0x90, 0x40, 0xe5, 0x22, 0x16, 
-0xc0, 0x38, 0x59, 0xe5, 0x22, 0x15, 0x40, 0x38, 0x5f, 0x91, 0x48, 0x90, 
-0xc8, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x0d, 0xc0, 0x38, 0x43, 0xe5, 
-0x22, 0x07, 0xc0, 0x38, 0x2b, 0xcb, 0x61, 0x10, 0x80, 0x85, 0x34, 0x46, 
-0x90, 0x40, 0xe5, 0x22, 0x01, 0xc0, 0x38, 0x13, 0xe5, 0x21, 0xfb, 0xc0, 
-0x37, 0xfb, 0x90, 0x48, 0xcb, 0xa1, 0x10, 0x00, 0x85, 0x34, 0x44, 0xcb, 
-0xa1, 0x10, 0x40, 0x85, 0x34, 0x45, 0x10, 0x10, 0x90, 0x80, 0x90, 0x40, 
-0xe5, 0x21, 0xf6, 0x40, 0x37, 0xd7, 0xe5, 0x21, 0xf4, 0xc0, 0x37, 0xdf, 
-0x90, 0x40, 0xe5, 0x21, 0xec, 0xc0, 0x37, 0xb1, 0xe5, 0x21, 0xeb, 0x40, 
-0x37, 0xb9, 
+0x81, 0x91, 0x68, 0x91, 0x18, 0x90, 0x80, 0x90, 0x40, 0x80, 0xa4, 0x45, 
+0xf8, 0x38, 0xc0, 0x80, 0xa4, 0x45, 0xf0, 0x38, 0xbd, 0x90, 0x28, 0x81, 
+0x38, 0xbc, 0x90, 0x38, 0xa4, 0x45, 0xd0, 0x38, 0xbb, 0xa4, 0x45, 0xc0, 
+0x38, 0xb9, 0x90, 0x28, 0x80, 0x38, 0xb7, 0x80, 0x38, 0xb6, 0x80, 0x90, 
+0x40, 0x10, 0x10, 0x80, 0x24, 0x45, 0xa8, 0x10, 0x10, 0x90, 0x38, 0xa4, 
+0x45, 0x98, 0x38, 0xb4, 0xa4, 0x45, 0x88, 0x38, 0xb2, 0x90, 0x28, 0x80, 
+0x38, 0xaf, 0x80, 0x38, 0xae, 0x9a, 0xd0, 0x03, 0xe0, 0x91, 0x60, 0x90, 
+0xb0, 0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 0x2f, 0x80, 0x85, 
+0x34, 0xcf, 0xcb, 0x61, 0x28, 0x00, 0x85, 0x34, 0xaf, 0x88, 0x00, 0x68, 
+0x84, 0x10, 0x10, 0xc9, 0xe1, 0x2f, 0x40, 0x85, 0x34, 0xcd, 0xcb, 0x61, 
+0x27, 0xc0, 0x85, 0x34, 0xae, 0x90, 0xb0, 0x88, 0x00, 0x68, 0x84, 0x10, 
+0x10, 0xc9, 0xe1, 0x2f, 0x00, 0x85, 0x34, 0xcb, 0xcb, 0x61, 0x27, 0x80, 
+0x85, 0x34, 0xad, 0x88, 0x00, 0x68, 0x84, 0x10, 0x10, 0xc9, 0xe1, 0x2e, 
+0xc0, 0x85, 0x34, 0xc9, 0xcb, 0x61, 0x27, 0x40, 0x85, 0x34, 0xac, 0x90, 
+0x90, 0x90, 0x48, 0xcb, 0xa1, 0x25, 0x80, 0x85, 0x34, 0x9b, 0xcb, 0xa1, 
+0x25, 0x40, 0x85, 0x34, 0x9a, 0x90, 0x48, 0xcb, 0xa1, 0x25, 0x00, 0x85, 
+0x34, 0x99, 0xcb, 0xa1, 0x24, 0xc0, 0x85, 0x34, 0x98, 0xcb, 0xa2, 0x22, 
+0xc0, 0x80, 0x38, 0x8c, 0x92, 0x40, 0x91, 0x20, 0x90, 0x90, 0x90, 0x48, 
+0x8c, 0x24, 0x10, 0x84, 0x24, 0x24, 0x88, 0x8c, 0x24, 0x08, 0x84, 0x24, 
+0x24, 0x80, 0x90, 0x48, 0x8c, 0x24, 0x00, 0x84, 0x24, 0x24, 0x78, 0x8c, 
+0x23, 0xf8, 0x84, 0x24, 0x24, 0x70, 0x90, 0x90, 0x90, 0x48, 0x8c, 0x23, 
+0xe8, 0x84, 0x24, 0x24, 0x60, 0x8c, 0x23, 0xe0, 0x84, 0x24, 0x24, 0x58, 
+0x90, 0x48, 0x8c, 0x23, 0xd8, 0x84, 0x24, 0x24, 0x50, 0x8c, 0x23, 0xd0, 
+0x84, 0x24, 0x24, 0x48, 0x91, 0x20, 0x90, 0x90, 0x90, 0x48, 0x8c, 0x23, 
+0xc0, 0x84, 0x24, 0x24, 0x38, 0x8c, 0x23, 0xb8, 0x84, 0x24, 0x24, 0x30, 
+0x90, 0x48, 0x8c, 0x23, 0xb0, 0x84, 0x24, 0x24, 0x28, 0x8c, 0x23, 0xa8, 
+0x84, 0x24, 0x24, 0x20, 0x90, 0x38, 0xa4, 0x23, 0x90, 0x34, 0x73, 0xa4, 
+0x23, 0x80, 0x34, 0x71, 0xa0, 0x0f, 0x50, 0xa0, 0x09, 0x08, 0x9a, 0x30, 
+0x04, 0x40, 0x91, 0x90, 0x90, 0xc8, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 
+0x21, 0xc0, 0x38, 0x83, 0xe5, 0x22, 0x1d, 0xc0, 0x38, 0x81, 0xcb, 0x61, 
+0x17, 0xc0, 0x85, 0x34, 0x6e, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x19, 
+0xc0, 0x38, 0x63, 0xe5, 0x22, 0x15, 0xc0, 0x38, 0x61, 0xcb, 0x61, 0x17, 
+0x80, 0x85, 0x34, 0x6d, 0x90, 0x48, 0xcb, 0xa1, 0x17, 0x40, 0x85, 0x34, 
+0x6c, 0xcb, 0xa1, 0x17, 0x00, 0x85, 0x34, 0x6b, 0x91, 0x90, 0x90, 0xc8, 
+0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x0e, 0xc0, 0x38, 0x47, 0xe5, 0x22, 
+0x08, 0xc0, 0x38, 0x2f, 0xcb, 0x61, 0x16, 0x80, 0x85, 0x34, 0x69, 0x98, 
+0x50, 0x00, 0x80, 0xe5, 0x22, 0x02, 0xc0, 0x38, 0x17, 0xe5, 0x21, 0xfc, 
+0xc0, 0x37, 0xff, 0xcb, 0x61, 0x16, 0x40, 0x85, 0x34, 0x68, 0x90, 0x48, 
+0xcb, 0xa1, 0x16, 0x00, 0x85, 0x34, 0x67, 0xcb, 0xa1, 0x15, 0xc0, 0x85, 
+0x34, 0x66, 0x92, 0x20, 0x91, 0x30, 0x90, 0xb8, 0xd5, 0x03, 0x00, 0xc0, 
+0xc0, 0x81, 0x8c, 0x01, 0xa0, 0x84, 0x30, 0x3e, 0xc0, 0xc0, 0x81, 0x8c, 
+0x01, 0x80, 0x84, 0x30, 0x3c, 0xd5, 0x02, 0x00, 0xc0, 0xc0, 0x81, 0x30, 
+0x28, 0xc0, 0xc0, 0x81, 0x30, 0x24, 0x90, 0x78, 0xd5, 0x02, 0x00, 0xc0, 
+0xc0, 0x81, 0x30, 0x1c, 0xc0, 0xc0, 0x81, 0x30, 0x18, 0xd5, 0x02, 0x00, 
+0xc0, 0xc0, 0x81, 0x30, 0x10, 0xc0, 0xc0, 0x81, 0x30, 0x0c, 0x91, 0x70, 
+0x90, 0xd8, 0xd5, 0x03, 0x80, 0xc8, 0xe1, 0xf8, 0xc0, 0x81, 0x8c, 0x01, 
+0xc0, 0x84, 0x30, 0x40, 0xc8, 0xe1, 0xf9, 0xc0, 0x81, 0x8c, 0x01, 0x90, 
+0x84, 0x30, 0x3d, 0xd5, 0x02, 0x80, 0xc8, 0xe1, 0xf8, 0x40, 0x81, 0x30, 
+0x2c, 0xc8, 0xe1, 0xf5, 0x40, 0x81, 0x30, 0x26, 0x90, 0x98, 0xd5, 0x02, 
+0x80, 0xc8, 0xe1, 0xef, 0x40, 0x81, 0x30, 0x20, 0xc8, 0xe1, 0xf0, 0x40, 
+0x81, 0x30, 0x1a, 0xd5, 0x02, 0x80, 0xc8, 0xe1, 0xee, 0xc0, 0x81, 0x30, 
+0x14, 0xc8, 0xe1, 0xeb, 0xc0, 0x81, 0x30, 0x0e, 0x9a, 0x30, 0x04, 0x40, 
+0x91, 0x90, 0x90, 0xc8, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x1b, 0xc0, 
+0x38, 0x6b, 0xe5, 0x22, 0x1c, 0xc0, 0x38, 0x7d, 0xcb, 0x61, 0x15, 0x40, 
+0x85, 0x34, 0x64, 0x98, 0x50, 0x00, 0x80, 0xe5, 0x22, 0x13, 0xc0, 0x38, 
+0x4b, 0xe5, 0x22, 0x14, 0xc0, 0x38, 0x5d, 0xcb, 0x61, 0x15, 0x00, 0x85, 
+0x34, 0x63, 0x90, 0x48, 0xcb, 0xa1, 0x14, 0xc0, 0x85, 0x34, 0x62, 0xcb, 
+0xa1, 0x14, 0x80, 0x85, 0x34, 0x61, 0x91, 0x90, 0x90, 0xc8, 0x98, 0x50, 
+0x00, 0x80, 0xe5, 0x22, 0x0c, 0xc0, 0x38, 0x3f, 0xe5, 0x22, 0x06, 0xc0, 
+0x38, 0x27, 0xcb, 0x61, 0x12, 0xc0, 0x85, 0x34, 0x50, 0x98, 0x50, 0x00, 
+0x80, 0xe5, 0x22, 0x00, 0xc0, 0x38, 0x0f, 0xe5, 0x21, 0xfa, 0xc0, 0x37, 
+0xf7, 0xcb, 0x61, 0x12, 0x80, 0x85, 0x34, 0x4f, 0x90, 0x48, 0xcb, 0xa1, 
+0x12, 0x40, 0x85, 0x34, 0x4e, 0xcb, 0xa1, 0x12, 0x00, 0x85, 0x34, 0x4d, 
+0x91, 0x00, 0x90, 0x80, 0x90, 0x40, 0xe5, 0x20, 0x02, 0x40, 0x30, 0x0a, 
+0xe5, 0x20, 0x01, 0x80, 0x30, 0x07, 0x90, 0x40, 0xe5, 0x20, 0x00, 0xc0, 
+0x30, 0x04, 0xe5, 0x20, 0x00, 0x00, 0x30, 0x01, 0x90, 0x80, 0x90, 0x40, 
+0xe5, 0x21, 0xf2, 0xc0, 0x37, 0xc5, 0xe5, 0x21, 0xf4, 0x00, 0x37, 0xdb, 
+0x90, 0x40, 0xe5, 0x21, 0xe9, 0x40, 0x37, 0x9f, 0xe5, 0x21, 0xea, 0x80, 
+0x37, 0xb5, 0x80, 0x99, 0x28, 0x02, 0xf0, 0x8c, 0x21, 0xf8, 0x90, 0x80, 
+0x90, 0x40, 0xe5, 0x22, 0x1e, 0xc0, 0x38, 0x79, 0xe5, 0x22, 0x1d, 0x40, 
+0x38, 0x7f, 0x90, 0x40, 0xe5, 0x22, 0x16, 0xc0, 0x38, 0x59, 0xe5, 0x22, 
+0x15, 0x40, 0x38, 0x5f, 0x91, 0x48, 0x90, 0xc8, 0x98, 0x50, 0x00, 0x80, 
+0xe5, 0x22, 0x0d, 0xc0, 0x38, 0x43, 0xe5, 0x22, 0x07, 0xc0, 0x38, 0x2b, 
+0xcb, 0x61, 0x10, 0x80, 0x85, 0x34, 0x46, 0x90, 0x40, 0xe5, 0x22, 0x01, 
+0xc0, 0x38, 0x13, 0xe5, 0x21, 0xfb, 0xc0, 0x37, 0xfb, 0x90, 0x48, 0xcb, 
+0xa1, 0x10, 0x00, 0x85, 0x34, 0x44, 0xcb, 0xa1, 0x10, 0x40, 0x85, 0x34, 
+0x45, 0x10, 0x10, 0x90, 0x80, 0x90, 0x40, 0xe5, 0x21, 0xf6, 0x40, 0x37, 
+0xd7, 0xe5, 0x21, 0xf4, 0xc0, 0x37, 0xdf, 0x90, 0x40, 0xe5, 0x21, 0xec, 
+0xc0, 0x37, 0xb1, 0xe5, 0x21, 0xeb, 0x40, 0x37, 0xb9, 
 };
 
 static const struct ia64_dis_names ia64_dis_names[] = {
@@ -5382,7 +5431,7 @@
 { 0x2, 37, 0, 85 },
 { 0x3, 37, 1, 84 },
 { 0x4, 37, 0, 83 },
-{ 0x1, 293, 0, 87 },
+{ 0x1, 292, 0, 87 },
 { 0x20, 246, 0, 98 },
 { 0x220, 246, 0, 94 },
 { 0x1220, 246, 0, 91 },
@@ -5399,16 +5448,16 @@
 { 0x4, 246, 0, 104 },
 { 0x2, 246, 0, 105 },
 { 0x1, 246, 0, 106 },
-{ 0x1, 367, 0, 108 },
-{ 0x3, 367, 0, 107 },
-{ 0x2, 373, 0, 109 },
-{ 0x1, 373, 0, 110 },
-{ 0x2, 369, 0, 111 },
-{ 0x1, 369, 0, 112 },
-{ 0x2, 371, 0, 113 },
-{ 0x1, 371, 0, 114 },
-{ 0x2, 375, 0, 115 },
-{ 0x1, 375, 0, 116 },
+{ 0x1, 366, 0, 108 },
+{ 0x3, 366, 0, 107 },
+{ 0x2, 372, 0, 109 },
+{ 0x1, 372, 0, 110 },
+{ 0x2, 368, 0, 111 },
+{ 0x1, 368, 0, 112 },
+{ 0x2, 370, 0, 113 },
+{ 0x1, 370, 0, 114 },
+{ 0x2, 374, 0, 115 },
+{ 0x1, 374, 0, 116 },
 { 0x1, 225, 0, 143 },
 { 0x5, 225, 0, 141 },
 { 0x3, 225, 0, 142 },
@@ -5484,10 +5533,10 @@
 { 0x4, 243, 0, 189 },
 { 0x2, 243, 0, 190 },
 { 0x1, 243, 0, 191 },
-{ 0x8, 347, 0, 192 },
-{ 0x4, 347, 0, 193 },
-{ 0x2, 347, 0, 194 },
-{ 0x1, 347, 0, 195 },
+{ 0x8, 346, 0, 192 },
+{ 0x4, 346, 0, 193 },
+{ 0x2, 346, 0, 194 },
+{ 0x1, 346, 0, 195 },
 { 0x20, 245, 0, 203 },
 { 0x220, 245, 0, 199 },
 { 0x1220, 245, 0, 196 },
@@ -5628,16 +5677,16 @@
 { 0x4, 239, 0, 333 },
 { 0x2, 239, 0, 334 },
 { 0x1, 239, 0, 335 },
-{ 0x1, 366, 0, 337 },
-{ 0x3, 366, 0, 336 },
-{ 0x2, 372, 0, 338 },
-{ 0x1, 372, 0, 339 },
-{ 0x2, 368, 0, 340 },
-{ 0x1, 368, 0, 341 },
-{ 0x2, 370, 0, 342 },
-{ 0x1, 370, 0, 343 },
-{ 0x2, 374, 0, 344 },
-{ 0x1, 374, 0, 345 },
+{ 0x1, 365, 0, 337 },
+{ 0x3, 365, 0, 336 },
+{ 0x2, 371, 0, 338 },
+{ 0x1, 371, 0, 339 },
+{ 0x2, 367, 0, 340 },
+{ 0x1, 367, 0, 341 },
+{ 0x2, 369, 0, 342 },
+{ 0x1, 369, 0, 343 },
+{ 0x2, 373, 0, 344 },
+{ 0x1, 373, 0, 345 },
 { 0x1, 224, 0, 372 },
 { 0x5, 224, 0, 370 },
 { 0x3, 224, 0, 371 },
@@ -5788,24 +5837,24 @@
 { 0x4, 241, 0, 493 },
 { 0x2, 241, 0, 494 },
 { 0x1, 241, 0, 495 },
-{ 0x8, 365, 0, 497 },
-{ 0x18, 365, 0, 496 },
-{ 0x4, 365, 0, 499 },
-{ 0xc, 365, 0, 498 },
-{ 0x2, 365, 0, 506 },
-{ 0x1, 365, 0, 507 },
-{ 0x4, 363, 0, 501 },
-{ 0xc, 363, 0, 500 },
-{ 0x2, 363, 0, 508 },
-{ 0x1, 363, 0, 509 },
-{ 0x4, 361, 0, 503 },
-{ 0xc, 361, 0, 502 },
-{ 0x2, 361, 0, 510 },
-{ 0x1, 361, 0, 511 },
-{ 0x4, 358, 0, 505 },
-{ 0xc, 358, 0, 504 },
-{ 0x2, 358, 0, 512 },
-{ 0x1, 358, 0, 513 },
+{ 0x8, 364, 0, 497 },
+{ 0x18, 364, 0, 496 },
+{ 0x4, 364, 0, 499 },
+{ 0xc, 364, 0, 498 },
+{ 0x2, 364, 0, 506 },
+{ 0x1, 364, 0, 507 },
+{ 0x4, 362, 0, 501 },
+{ 0xc, 362, 0, 500 },
+{ 0x2, 362, 0, 508 },
+{ 0x1, 362, 0, 509 },
+{ 0x4, 360, 0, 503 },
+{ 0xc, 360, 0, 502 },
+{ 0x2, 360, 0, 510 },
+{ 0x1, 360, 0, 511 },
+{ 0x4, 357, 0, 505 },
+{ 0xc, 357, 0, 504 },
+{ 0x2, 357, 0, 512 },
+{ 0x1, 357, 0, 513 },
 { 0xa00, 222, 0, 528 },
 { 0x2a00, 222, 0, 526 },
 { 0x1a00, 222, 0, 527 },
@@ -5933,18 +5982,18 @@
 { 0x1, 133, 0, 640 },
 { 0x5, 133, 0, 638 },
 { 0x3, 133, 0, 639 },
-{ 0x4, 398, 0, 641 },
-{ 0x2, 398, 0, 642 },
-{ 0x1, 398, 0, 643 },
-{ 0x4, 397, 0, 644 },
-{ 0x2, 397, 0, 645 },
-{ 0x1, 397, 0, 646 },
-{ 0x4, 396, 0, 647 },
-{ 0x2, 396, 0, 648 },
-{ 0x1, 396, 0, 649 },
-{ 0x4, 395, 0, 650 },
-{ 0x2, 395, 0, 651 },
-{ 0x1, 395, 0, 652 },
+{ 0x4, 397, 0, 641 },
+{ 0x2, 397, 0, 642 },
+{ 0x1, 397, 0, 643 },
+{ 0x4, 396, 0, 644 },
+{ 0x2, 396, 0, 645 },
+{ 0x1, 396, 0, 646 },
+{ 0x4, 395, 0, 647 },
+{ 0x2, 395, 0, 648 },
+{ 0x1, 395, 0, 649 },
+{ 0x4, 394, 0, 650 },
+{ 0x2, 394, 0, 651 },
+{ 0x1, 394, 0, 652 },
 { 0x2, 92, 0, 655 },
 { 0xa, 92, 0, 653 },
 { 0x6, 92, 0, 654 },
@@ -5975,28 +6024,28 @@
 { 0x1, 93, 0, 682 },
 { 0x5, 93, 0, 680 },
 { 0x3, 93, 0, 681 },
-{ 0x4, 359, 0, 686 },
-{ 0xc, 359, 0, 685 },
-{ 0x2, 359, 0, 695 },
-{ 0x1, 359, 0, 696 },
-{ 0x8, 364, 0, 684 },
-{ 0x18, 364, 0, 683 },
-{ 0x4, 364, 0, 688 },
-{ 0xc, 364, 0, 687 },
-{ 0x2, 364, 0, 697 },
-{ 0x1, 364, 0, 698 },
-{ 0x4, 362, 0, 690 },
-{ 0xc, 362, 0, 689 },
-{ 0x2, 362, 0, 699 },
-{ 0x1, 362, 0, 700 },
-{ 0x4, 360, 0, 692 },
-{ 0xc, 360, 0, 691 },
-{ 0x2, 360, 0, 701 },
-{ 0x1, 360, 0, 702 },
-{ 0x4, 357, 0, 694 },
-{ 0xc, 357, 0, 693 },
-{ 0x2, 357, 0, 703 },
-{ 0x1, 357, 0, 704 },
+{ 0x4, 358, 0, 686 },
+{ 0xc, 358, 0, 685 },
+{ 0x2, 358, 0, 695 },
+{ 0x1, 358, 0, 696 },
+{ 0x8, 363, 0, 684 },
+{ 0x18, 363, 0, 683 },
+{ 0x4, 363, 0, 688 },
+{ 0xc, 363, 0, 687 },
+{ 0x2, 363, 0, 697 },
+{ 0x1, 363, 0, 698 },
+{ 0x4, 361, 0, 690 },
+{ 0xc, 361, 0, 689 },
+{ 0x2, 361, 0, 699 },
+{ 0x1, 361, 0, 700 },
+{ 0x4, 359, 0, 692 },
+{ 0xc, 359, 0, 691 },
+{ 0x2, 359, 0, 701 },
+{ 0x1, 359, 0, 702 },
+{ 0x4, 356, 0, 694 },
+{ 0xc, 356, 0, 693 },
+{ 0x2, 356, 0, 703 },
+{ 0x1, 356, 0, 704 },
 { 0xa00, 221, 0, 719 },
 { 0x2a00, 221, 0, 717 },
 { 0x1a00, 221, 0, 718 },
@@ -6230,44 +6279,44 @@
 { 0x1, 114, 0, 936 },
 { 0x1, 49, 0, 937 },
 { 0x3, 48, 0, 938 },
-{ 0x1, 384, 0, 939 },
-{ 0x1, 390, 0, 940 },
-{ 0x2, 343, 0, 943 },
-{ 0x1, 343, 0, 944 },
-{ 0x2, 341, 0, 945 },
-{ 0x1, 341, 0, 946 },
-{ 0x1, 340, 0, 947 },
-{ 0x1, 285, 0, 952 },
-{ 0x1, 284, 0, 953 },
-{ 0x1, 283, 0, 954 },
-{ 0x1, 282, 0, 955 },
+{ 0x1, 383, 0, 939 },
+{ 0x1, 389, 0, 940 },
+{ 0x2, 342, 0, 943 },
+{ 0x1, 342, 0, 944 },
+{ 0x2, 340, 0, 945 },
+{ 0x1, 340, 0, 946 },
+{ 0x1, 339, 0, 947 },
+{ 0x1, 284, 0, 952 },
+{ 0x1, 283, 0, 953 },
+{ 0x1, 282, 0, 954 },
+{ 0x1, 281, 0, 955 },
 { 0x1, 208, 0, 956 },
 { 0x1, 207, 0, 957 },
-{ 0x1, 281, 0, 958 },
-{ 0x1, 280, 0, 959 },
-{ 0x1, 279, 0, 960 },
-{ 0x1, 278, 0, 961 },
-{ 0x1, 277, 0, 962 },
-{ 0x1, 276, 0, 963 },
-{ 0x1, 275, 0, 964 },
+{ 0x1, 280, 0, 958 },
+{ 0x1, 279, 0, 959 },
+{ 0x1, 278, 0, 960 },
+{ 0x1, 277, 0, 961 },
+{ 0x1, 276, 0, 962 },
+{ 0x1, 275, 0, 963 },
+{ 0x1, 274, 0, 964 },
 { 0x2, 206, 0, 965 },
 { 0x1, 206, 0, 966 },
-{ 0x2, 323, 0, 972 },
-{ 0x1, 323, 0, 973 },
-{ 0x1, 274, 0, 974 },
-{ 0x1, 273, 0, 975 },
-{ 0x1, 272, 0, 976 },
-{ 0x1, 271, 0, 977 },
+{ 0x2, 322, 0, 972 },
+{ 0x1, 322, 0, 973 },
+{ 0x1, 273, 0, 974 },
+{ 0x1, 272, 0, 975 },
+{ 0x1, 271, 0, 976 },
+{ 0x1, 270, 0, 977 },
 { 0x1, 8, 0, 978 },
-{ 0x1, 270, 0, 979 },
-{ 0x1, 269, 0, 980 },
-{ 0x1, 268, 0, 981 },
-{ 0x1, 267, 0, 982 },
-{ 0x1, 345, 0, 983 },
-{ 0x1, 356, 0, 984 },
-{ 0x1, 346, 0, 985 },
-{ 0x1, 379, 0, 986 },
-{ 0x1, 266, 0, 990 },
+{ 0x1, 269, 0, 979 },
+{ 0x1, 268, 0, 980 },
+{ 0x1, 267, 0, 981 },
+{ 0x1, 266, 0, 982 },
+{ 0x1, 344, 0, 983 },
+{ 0x1, 355, 0, 984 },
+{ 0x1, 345, 0, 985 },
+{ 0x1, 378, 0, 986 },
+{ 0x1, 265, 0, 990 },
 { 0x1, 205, 0, 991 },
 { 0x1, 135, 0, 994 },
 { 0x2, 248, 0, 998 },
@@ -6277,141 +6326,141 @@
 { 0x3, 47, 0, 1003 },
 { 0x5, 46, 0, 1004 },
 { 0x3, 46, 0, 1005 },
-{ 0x1, 322, 0, 1006 },
-{ 0x1, 330, 0, 1007 },
-{ 0x1, 328, 0, 1008 },
-{ 0x1, 349, 0, 1009 },
-{ 0x1, 329, 0, 1010 },
-{ 0x1, 327, 0, 1011 },
-{ 0x2, 335, 0, 1012 },
-{ 0x1, 335, 0, 1014 },
-{ 0x2, 333, 0, 1013 },
-{ 0x1, 333, 0, 1015 },
-{ 0x2, 353, 0, 1016 },
-{ 0x1, 353, 0, 1019 },
-{ 0x2, 334, 0, 1017 },
-{ 0x1, 334, 0, 1020 },
-{ 0x2, 332, 0, 1018 },
-{ 0x1, 332, 0, 1021 },
-{ 0x1, 295, 0, 1022 },
-{ 0x1, 294, 0, 1023 },
-{ 0x1, 326, 0, 1024 },
-{ 0x1, 317, 0, 1025 },
-{ 0x1, 319, 0, 1026 },
-{ 0x1, 316, 0, 1027 },
-{ 0x1, 318, 0, 1028 },
-{ 0x2, 394, 0, 1029 },
-{ 0x1, 394, 0, 1032 },
-{ 0x2, 393, 0, 1030 },
-{ 0x1, 393, 0, 1033 },
-{ 0x2, 392, 0, 1031 },
-{ 0x1, 392, 0, 1034 },
-{ 0x1, 305, 0, 1035 },
-{ 0x2, 304, 0, 1036 },
-{ 0x1, 304, 0, 1037 },
+{ 0x1, 321, 0, 1006 },
+{ 0x1, 329, 0, 1007 },
+{ 0x1, 327, 0, 1008 },
+{ 0x1, 348, 0, 1009 },
+{ 0x1, 328, 0, 1010 },
+{ 0x1, 326, 0, 1011 },
+{ 0x2, 334, 0, 1012 },
+{ 0x1, 334, 0, 1014 },
+{ 0x2, 332, 0, 1013 },
+{ 0x1, 332, 0, 1015 },
+{ 0x2, 352, 0, 1016 },
+{ 0x1, 352, 0, 1019 },
+{ 0x2, 333, 0, 1017 },
+{ 0x1, 333, 0, 1020 },
+{ 0x2, 331, 0, 1018 },
+{ 0x1, 331, 0, 1021 },
+{ 0x1, 294, 0, 1022 },
+{ 0x1, 293, 0, 1023 },
+{ 0x1, 325, 0, 1024 },
+{ 0x1, 316, 0, 1025 },
+{ 0x1, 318, 0, 1026 },
+{ 0x1, 315, 0, 1027 },
+{ 0x1, 317, 0, 1028 },
+{ 0x2, 393, 0, 1029 },
+{ 0x1, 393, 0, 1032 },
+{ 0x2, 392, 0, 1030 },
+{ 0x1, 392, 0, 1033 },
+{ 0x2, 391, 0, 1031 },
+{ 0x1, 391, 0, 1034 },
+{ 0x1, 304, 0, 1035 },
+{ 0x2, 303, 0, 1036 },
+{ 0x1, 303, 0, 1037 },
 { 0x2, 251, 0, 1038 },
 { 0x1, 251, 0, 1041 },
 { 0x2, 250, 0, 1039 },
 { 0x1, 250, 0, 1042 },
 { 0x2, 249, 0, 1040 },
 { 0x1, 249, 0, 1043 },
-{ 0x2, 320, 0, 1044 },
-{ 0x1, 320, 0, 1045 },
-{ 0x2, 321, 0, 1046 },
-{ 0x1, 321, 0, 1047 },
-{ 0xa, 388, 1, 1053 },
-{ 0xa, 389, 0, 1052 },
-{ 0x1a, 388, 1, 1049 },
-{ 0x32, 389, 0, 1048 },
-{ 0x6, 388, 1, 1057 },
-{ 0x6, 389, 0, 1056 },
-{ 0x1, 388, 1, 1063 },
-{ 0x1, 389, 0, 1062 },
-{ 0x9, 388, 1, 1055 },
-{ 0x9, 389, 0, 1054 },
-{ 0x19, 388, 1, 1051 },
-{ 0x31, 389, 0, 1050 },
-{ 0x5, 388, 1, 1059 },
-{ 0x5, 389, 0, 1058 },
-{ 0x3, 388, 1, 1061 },
-{ 0x3, 389, 0, 1060 },
-{ 0xa, 385, 1, 1069 },
-{ 0xa, 386, 0, 1068 },
-{ 0x1a, 385, 1, 1065 },
-{ 0x32, 386, 0, 1064 },
-{ 0x6, 385, 1, 1073 },
-{ 0x6, 386, 0, 1072 },
-{ 0x1, 385, 1, 1079 },
-{ 0x1, 386, 0, 1078 },
-{ 0x9, 385, 1, 1071 },
-{ 0x9, 386, 0, 1070 },
-{ 0x19, 385, 1, 1067 },
-{ 0x31, 386, 0, 1066 },
-{ 0x5, 385, 1, 1075 },
-{ 0x5, 386, 0, 1074 },
-{ 0x3, 385, 1, 1077 },
-{ 0x3, 386, 0, 1076 },
+{ 0x2, 319, 0, 1044 },
+{ 0x1, 319, 0, 1045 },
+{ 0x2, 320, 0, 1046 },
+{ 0x1, 320, 0, 1047 },
+{ 0xa, 387, 1, 1053 },
+{ 0xa, 388, 0, 1052 },
+{ 0x1a, 387, 1, 1049 },
+{ 0x32, 388, 0, 1048 },
+{ 0x6, 387, 1, 1057 },
+{ 0x6, 388, 0, 1056 },
+{ 0x1, 387, 1, 1063 },
+{ 0x1, 388, 0, 1062 },
+{ 0x9, 387, 1, 1055 },
+{ 0x9, 388, 0, 1054 },
+{ 0x19, 387, 1, 1051 },
+{ 0x31, 388, 0, 1050 },
+{ 0x5, 387, 1, 1059 },
+{ 0x5, 388, 0, 1058 },
+{ 0x3, 387, 1, 1061 },
+{ 0x3, 388, 0, 1060 },
+{ 0xa, 384, 1, 1069 },
+{ 0xa, 385, 0, 1068 },
+{ 0x1a, 384, 1, 1065 },
+{ 0x32, 385, 0, 1064 },
+{ 0x6, 384, 1, 1073 },
+{ 0x6, 385, 0, 1072 },
+{ 0x1, 384, 1, 1079 },
+{ 0x1, 385, 0, 1078 },
+{ 0x9, 384, 1, 1071 },
+{ 0x9, 385, 0, 1070 },
+{ 0x19, 384, 1, 1067 },
+{ 0x31, 385, 0, 1066 },
+{ 0x5, 384, 1, 1075 },
+{ 0x5, 385, 0, 1074 },
+{ 0x3, 384, 1, 1077 },
+{ 0x3, 385, 0, 1076 },
 { 0x1, 103, 0, 1080 },
 { 0x1, 102, 0, 1081 },
-{ 0x1, 348, 1, 1083 },
+{ 0x1, 347, 1, 1083 },
 { 0x1, 101, 0, 1082 },
-{ 0x2, 352, 1, 1085 },
+{ 0x2, 351, 1, 1085 },
 { 0x2, 105, 0, 1084 },
-{ 0x1, 352, 1, 1087 },
+{ 0x1, 351, 1, 1087 },
 { 0x1, 105, 0, 1086 },
-{ 0x1, 354, 0, 1088 },
+{ 0x1, 353, 0, 1088 },
 { 0x1, 100, 0, 1089 },
 { 0x2, 99, 0, 1090 },
 { 0x2, 98, 0, 1091 },
-{ 0x1, 406, 1, 1097 },
+{ 0x1, 405, 1, 1097 },
 { 0x1, 204, 0, 992 },
-{ 0x1, 405, 0, 1098 },
-{ 0x1, 404, 1, 1099 },
+{ 0x1, 404, 0, 1098 },
+{ 0x1, 403, 1, 1099 },
 { 0x1, 203, 0, 1001 },
-{ 0x1, 265, 0, 1100 },
-{ 0x1, 264, 1, 1101 },
+{ 0x1, 264, 0, 1100 },
+{ 0x1, 263, 1, 1101 },
 { 0x1, 247, 0, 993 },
-{ 0x1, 263, 0, 1102 },
-{ 0x1, 262, 1, 1103 },
-{ 0x1, 383, 0, 995 },
-{ 0x1, 261, 1, 1104 },
-{ 0x1, 355, 0, 997 },
-{ 0x1, 260, 0, 1105 },
-{ 0x1, 259, 0, 1106 },
-{ 0x1, 258, 1, 1107 },
-{ 0x2, 355, 0, 996 },
-{ 0x10, 257, 0, 1111 },
-{ 0x90, 257, 0, 1109 },
-{ 0x190, 257, 0, 1108 },
-{ 0x50, 257, 0, 1110 },
-{ 0x30, 257, 0, 1113 },
-{ 0x70, 257, 0, 1112 },
-{ 0x8, 257, 0, 1115 },
-{ 0x18, 257, 0, 1114 },
-{ 0x4, 257, 0, 1116 },
-{ 0x1, 257, 0, 1119 },
-{ 0x3, 257, 0, 1118 },
-{ 0x1, 256, 1, 1120 },
-{ 0x2, 257, 0, 1117 },
+{ 0x1, 262, 0, 1102 },
+{ 0x1, 261, 1, 1103 },
+{ 0x1, 382, 0, 995 },
+{ 0x1, 260, 1, 1104 },
+{ 0x1, 354, 0, 997 },
+{ 0x1, 259, 0, 1105 },
+{ 0x1, 258, 0, 1106 },
+{ 0x1, 257, 1, 1107 },
+{ 0x2, 354, 0, 996 },
+{ 0x10, 256, 0, 1111 },
+{ 0x90, 256, 0, 1109 },
+{ 0x190, 256, 0, 1108 },
+{ 0x50, 256, 0, 1110 },
+{ 0x30, 256, 0, 1113 },
+{ 0x70, 256, 0, 1112 },
+{ 0x8, 256, 0, 1115 },
+{ 0x18, 256, 0, 1114 },
+{ 0x4, 256, 0, 1116 },
+{ 0x1, 256, 0, 1119 },
+{ 0x3, 256, 0, 1118 },
+{ 0x1, 255, 1, 1120 },
+{ 0x2, 256, 0, 1117 },
 { 0x3, 45, 0, 1121 },
 { 0x1, 199, 1, 1122 },
 { 0x1, 200, 1, 987 },
 { 0x1, 201, 0, 88 },
-{ 0x1, 298, 1, 1123 },
-{ 0x1, 299, 1, 988 },
-{ 0x1, 300, 0, 89 },
+{ 0x1, 297, 1, 1123 },
+{ 0x1, 298, 1, 988 },
+{ 0x1, 299, 0, 89 },
 { 0x1, 33, 1, 1124 },
 { 0x1, 34, 1, 989 },
 { 0x1, 35, 0, 90 },
 { 0x1, 188, 0, 1125 },
-{ 0x4, 399, 0, 1126 },
-{ 0x2, 399, 0, 1127 },
-{ 0x1, 399, 1, 1129 },
-{ 0x1, 400, 0, 1128 },
-{ 0x8, 401, 0, 1130 },
-{ 0x4, 401, 0, 1131 },
-{ 0x1, 401, 1, 1133 },
-{ 0x2, 401, 0, 1132 },
+{ 0x4, 398, 0, 1126 },
+{ 0x2, 398, 0, 1127 },
+{ 0x1, 398, 1, 1129 },
+{ 0x1, 399, 0, 1128 },
+{ 0x8, 400, 0, 1130 },
+{ 0x4, 400, 0, 1131 },
+{ 0x1, 400, 1, 1133 },
+{ 0x2, 400, 0, 1132 },
 { 0x8, 177, 0, 1134 },
 { 0x4, 177, 0, 1135 },
 { 0x2, 177, 0, 1136 },
@@ -6700,25 +6749,25 @@
 { 0x142, 163, 0, 1420 },
 { 0xc2, 163, 1, 1422 },
 { 0x6, 164, 1, 1421 },
-{ 0x1, 391, 0, 941 },
+{ 0x1, 390, 0, 941 },
 { 0x22, 163, 0, 1428 },
 { 0x12, 163, 0, 1429 },
 { 0xa, 163, 0, 1430 },
 { 0x6, 163, 1, 1432 },
 { 0x2, 164, 1, 1431 },
-{ 0x2, 324, 0, 970 },
+{ 0x2, 323, 0, 970 },
 { 0x221, 163, 0, 1423 },
 { 0x121, 163, 0, 1424 },
 { 0xa1, 163, 0, 1425 },
 { 0x61, 163, 1, 1427 },
 { 0x3, 164, 1, 1426 },
-{ 0x1, 387, 0, 942 },
+{ 0x1, 386, 0, 942 },
 { 0x11, 163, 0, 1433 },
 { 0x9, 163, 0, 1434 },
 { 0x5, 163, 0, 1435 },
 { 0x3, 163, 1, 1437 },
 { 0x1, 164, 1, 1436 },
-{ 0x1, 324, 0, 971 },
+{ 0x1, 323, 0, 971 },
 { 0x4, 169, 0, 1438 },
 { 0x1, 169, 0, 1440 },
 { 0x1, 176, 0, 1441 },
@@ -6755,13 +6804,13 @@
 { 0x50, 160, 0, 1471 },
 { 0x30, 160, 1, 1473 },
 { 0x10, 161, 1, 1472 },
-{ 0x1, 342, 0, 934 },
+{ 0x1, 341, 0, 934 },
 { 0x88, 160, 0, 1474 },
 { 0x48, 160, 0, 1475 },
 { 0x28, 160, 0, 1476 },
 { 0x18, 160, 1, 1478 },
 { 0x8, 161, 1, 1477 },
-{ 0xc, 325, 0, 967 },
+{ 0xc, 324, 0, 967 },
 { 0x44, 160, 1, 1489 },
 { 0x22, 162, 0, 1479 },
 { 0x24, 160, 1, 1490 },
@@ -6772,7 +6821,7 @@
 { 0x4, 161, 1, 1492 },
 { 0x6, 162, 1, 1483 },
 { 0x2, 162, 1, 1482 },
-{ 0x6, 325, 0, 968 },
+{ 0x6, 324, 0, 968 },
 { 0x22, 160, 1, 1494 },
 { 0x11, 162, 0, 1484 },
 { 0x12, 160, 1, 1495 },
@@ -6783,7 +6832,7 @@
 { 0x2, 161, 1, 1497 },
 { 0x3, 162, 1, 1488 },
 { 0x1, 162, 1, 1487 },
-{ 0x3, 325, 0, 969 },
+{ 0x3, 324, 0, 969 },
 { 0x11, 160, 0, 1499 },
 { 0x9, 160, 0, 1500 },
 { 0x5, 160, 0, 1501 },
@@ -6794,25 +6843,25 @@
 { 0x2, 156, 0, 1506 },
 { 0x1, 156, 1, 1508 },
 { 0x1, 157, 1, 1507 },
-{ 0x1, 289, 0, 948 },
+{ 0x1, 288, 0, 948 },
 { 0x8, 158, 0, 1509 },
 { 0x4, 158, 0, 1510 },
 { 0x2, 158, 0, 1511 },
 { 0x1, 158, 1, 1513 },
 { 0x1, 159, 1, 1512 },
-{ 0x1, 288, 0, 949 },
+{ 0x1, 287, 0, 949 },
 { 0x8, 167, 0, 1514 },
 { 0x4, 167, 0, 1515 },
 { 0x2, 167, 0, 1516 },
 { 0x1, 167, 1, 1518 },
 { 0x1, 168, 1, 1517 },
-{ 0x1, 287, 0, 950 },
+{ 0x1, 286, 0, 950 },
 { 0x8, 170, 0, 1519 },
 { 0x4, 170, 0, 1520 },
 { 0x2, 170, 0, 1521 },
 { 0x1, 170, 1, 1523 },
 { 0x1, 171, 1, 1522 },
-{ 0x1, 286, 0, 951 },
+{ 0x1, 285, 0, 951 },
 { 0x8, 182, 0, 1524 },
 { 0x4, 182, 0, 1525 },
 { 0x2, 182, 0, 1526 },
@@ -6824,7 +6873,7 @@
 { 0x1, 180, 1, 1533 },
 { 0x1, 181, 0, 1532 },
 { 0x1, 198, 0, 1534 },
-{ 0x1, 297, 0, 1535 },
+{ 0x1, 296, 0, 1535 },
 { 0x1, 32, 0, 1536 },
 { 0x8, 115, 0, 1537 },
 { 0x4, 115, 0, 1538 },
@@ -6882,7 +6931,7 @@
 { 0x1, 147, 1, 1590 },
 { 0x2, 140, 0, 1587 },
 { 0x1, 106, 0, 1591 },
-{ 0x1, 255, 1, 1592 },
+{ 0x1, 254, 1, 1592 },
 { 0x1, 140, 0, 1588 },
 { 0x8, 108, 0, 1593 },
 { 0x4, 108, 0, 1594 },
@@ -6894,19 +6943,19 @@
 { 0x2, 110, 0, 1600 },
 { 0x1, 110, 1, 1602 },
 { 0x1, 111, 1, 1601 },
-{ 0x1, 382, 0, 1094 },
+{ 0x1, 381, 0, 1094 },
 { 0x8, 138, 0, 1603 },
 { 0x4, 138, 0, 1604 },
 { 0x2, 138, 0, 1605 },
 { 0x1, 138, 1, 1607 },
 { 0x1, 139, 1, 1606 },
-{ 0x1, 381, 0, 1095 },
+{ 0x1, 380, 0, 1095 },
 { 0x8, 141, 0, 1608 },
 { 0x4, 141, 0, 1609 },
 { 0x2, 141, 0, 1610 },
 { 0x1, 141, 1, 1612 },
 { 0x1, 142, 1, 1611 },
-{ 0x1, 380, 0, 1096 },
+{ 0x1, 379, 0, 1096 },
 { 0x8, 186, 0, 1613 },
 { 0x4, 186, 0, 1614 },
 { 0x2, 186, 0, 1615 },
@@ -7124,7 +7173,7 @@
 { 0x3, 20, 1, 1826 },
 { 0x4, 20, 0, 1825 },
 { 0x1, 197, 0, 1829 },
-{ 0x1, 296, 0, 1830 },
+{ 0x1, 295, 0, 1830 },
 { 0x14, 42, 0, 1833 },
 { 0x34, 42, 0, 1831 },
 { 0xc, 42, 0, 1834 },
@@ -7161,7 +7210,7 @@
 { 0x1, 104, 0, 1864 },
 { 0x2, 44, 0, 1865 },
 { 0x1, 44, 0, 1866 },
-{ 0x1, 344, 0, 1867 },
+{ 0x1, 343, 0, 1867 },
 { 0x2, 51, 0, 1868 },
 { 0x1, 51, 0, 1869 },
 { 0x1, 97, 0, 1870 },
@@ -7504,59 +7553,58 @@
 { 0x3, 54, 1, 2190 },
 { 0x3, 55, 0, 2189 },
 { 0x1, 4, 0, 2197 },
-{ 0x1, 254, 0, 2198 },
-{ 0x1, 336, 0, 2199 },
-{ 0x1, 331, 0, 2200 },
-{ 0x2, 315, 0, 2201 },
-{ 0x1, 315, 0, 2204 },
-{ 0x2, 314, 0, 2202 },
-{ 0x1, 314, 0, 2205 },
-{ 0x2, 313, 0, 2203 },
-{ 0x1, 313, 0, 2206 },
-{ 0x1, 312, 0, 2207 },
-{ 0x1, 311, 0, 2208 },
-{ 0x2, 310, 0, 2209 },
-{ 0x1, 310, 0, 2211 },
-{ 0x2, 309, 0, 2210 },
-{ 0x1, 309, 0, 2212 },
-{ 0x1, 339, 0, 2219 },
-{ 0x8, 338, 0, 2213 },
-{ 0x4, 338, 0, 2215 },
-{ 0x2, 338, 0, 2217 },
-{ 0x1, 338, 0, 2220 },
-{ 0x8, 337, 0, 2214 },
-{ 0x4, 337, 0, 2216 },
-{ 0x2, 337, 0, 2218 },
-{ 0x1, 337, 0, 2221 },
-{ 0x1, 308, 0, 2228 },
-{ 0x8, 307, 0, 2222 },
-{ 0x4, 307, 0, 2224 },
-{ 0x2, 307, 0, 2226 },
-{ 0x1, 307, 0, 2229 },
-{ 0x8, 306, 0, 2223 },
-{ 0x4, 306, 0, 2225 },
-{ 0x2, 306, 1, 2227 },
+{ 0x1, 253, 0, 2198 },
+{ 0x1, 335, 0, 2199 },
+{ 0x1, 330, 0, 2200 },
+{ 0x2, 314, 0, 2201 },
+{ 0x1, 314, 0, 2204 },
+{ 0x2, 313, 0, 2202 },
+{ 0x1, 313, 0, 2205 },
+{ 0x2, 312, 0, 2203 },
+{ 0x1, 312, 0, 2206 },
+{ 0x1, 311, 0, 2207 },
+{ 0x1, 310, 0, 2208 },
+{ 0x2, 309, 0, 2209 },
+{ 0x1, 309, 0, 2211 },
+{ 0x2, 308, 0, 2210 },
+{ 0x1, 308, 0, 2212 },
+{ 0x1, 338, 0, 2219 },
+{ 0x8, 337, 0, 2213 },
+{ 0x4, 337, 0, 2215 },
+{ 0x2, 337, 0, 2217 },
+{ 0x1, 337, 0, 2220 },
+{ 0x8, 336, 0, 2214 },
+{ 0x4, 336, 0, 2216 },
+{ 0x2, 336, 0, 2218 },
+{ 0x1, 336, 0, 2221 },
+{ 0x1, 307, 0, 2228 },
+{ 0x8, 306, 0, 2222 },
+{ 0x4, 306, 0, 2224 },
+{ 0x2, 306, 0, 2226 },
+{ 0x1, 306, 0, 2229 },
+{ 0x8, 305, 0, 2223 },
+{ 0x4, 305, 0, 2225 },
+{ 0x2, 305, 1, 2227 },
 { 0x4, 107, 0, 1271 },
-{ 0x1, 306, 0, 2230 },
+{ 0x1, 305, 0, 2230 },
 { 0x1, 6, 0, 2231 },
 { 0x1, 7, 0, 2232 },
-{ 0x1, 253, 0, 2233 },
-{ 0x1, 252, 0, 2234 },
-{ 0x1, 403, 0, 2235 },
-{ 0x1, 303, 0, 2236 },
-{ 0x1, 12, 0, 2237 },
-{ 0x1, 10, 0, 2238 },
-{ 0x1, 378, 0, 2239 },
-{ 0x1, 351, 0, 2240 },
-{ 0x1, 350, 0, 2241 },
-{ 0x1, 402, 0, 2242 },
-{ 0x1, 302, 0, 2243 },
-{ 0x1, 11, 0, 2244 },
-{ 0x1, 9, 0, 2245 },
-{ 0x1, 5, 0, 2246 },
-{ 0x1, 377, 0, 2247 },
-{ 0x1, 376, 0, 2248 },
-{ 0x1, 1, 0, 2249 },
-{ 0x1, 0, 0, 2250 },
+{ 0x1, 252, 0, 2233 },
+{ 0x1, 402, 0, 2234 },
+{ 0x1, 302, 0, 2235 },
+{ 0x1, 12, 0, 2236 },
+{ 0x1, 10, 0, 2237 },
+{ 0x1, 377, 0, 2238 },
+{ 0x1, 350, 0, 2239 },
+{ 0x1, 349, 0, 2240 },
+{ 0x1, 401, 0, 2241 },
+{ 0x1, 301, 0, 2242 },
+{ 0x1, 11, 0, 2243 },
+{ 0x1, 9, 0, 2244 },
+{ 0x1, 5, 0, 2245 },
+{ 0x1, 376, 0, 2246 },
+{ 0x1, 375, 0, 2247 },
+{ 0x1, 1, 0, 2248 },
+{ 0x1, 0, 0, 2249 },
 };
 
diff --git a/opcodes/ia64-gen.c b/opcodes/ia64-gen.c
index a4e2cec..c38cc35 100644
--- a/opcodes/ia64-gen.c
+++ b/opcodes/ia64-gen.c
@@ -1134,7 +1134,13 @@
           else if (strcmp (ic->name, "invala") == 0)
             resolved = strcmp (idesc->name, ic->name) == 0;
 	  else if (strncmp (idesc->name, "st", 2) == 0
-		   && strstr (format, "M5") != NULL)
+		   && (strstr (format, "M5") != NULL
+		       || strstr (format, "M10") != NULL))
+	    resolved = idesc->flags & IA64_OPCODE_POSTINC;
+	  else if (strncmp (idesc->name, "ld", 2) == 0
+		   && (strstr (format, "M2 M3") != NULL
+		       || strstr (format, "M12") != NULL
+		       || strstr (format, "M7 M8") != NULL))
 	    resolved = idesc->flags & IA64_OPCODE_POSTINC;
           else
             resolved = 0;
diff --git a/opcodes/ia64-opc-a.c b/opcodes/ia64-opc-a.c
index c9e3162..9f1c5e3 100644
--- a/opcodes/ia64-opc-a.c
+++ b/opcodes/ia64-opc-a.c
@@ -107,7 +107,8 @@
     {"or",	 A, OpX2aVeX4X2b (8, 0, 0, 0xb, 2), {R1, IMM8, R3}, EMPTY},
     {"xor",	 A, OpX2aVeX4X2b (8, 0, 0, 0xb, 3), {R1, IMM8, R3}, EMPTY},
     {"mov",	 A, OpX2aVeImm14 (8, 2, 0, 0), {R1, R3}, EMPTY},
-    {"mov",	 A, OpX2aVeR3a (8, 2, 0, 0), {R1, IMM14}, PSEUDO, 0, NULL},
+    /* A mov immediate pseudo for adds was deleted.  It failed for immediate
+       operands requiring relocs, e.g. @pltoff(a).  */
     {"adds",	 A, OpX2aVe (8, 2, 0), {R1, IMM14, R3}, EMPTY},
     {"addp4",	 A, OpX2aVe (8, 3, 0), {R1, IMM14, R3}, EMPTY},
     {"padd1",		 A, OpX2aZaZbX4X2b (8, 1, 0, 0, 0, 0), {R1, R2, R3}, EMPTY},
diff --git a/opcodes/m32r-asm.c b/opcodes/m32r-asm.c
index 8c2cc81..87c33f0 100644
--- a/opcodes/m32r-asm.c
+++ b/opcodes/m32r-asm.c
@@ -4,7 +4,7 @@
 THIS FILE IS MACHINE GENERATED WITH CGEN.
 - the resultant file is machine generated, cgen-asm.in isn't
 
-Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
 
 This file is part of the GNU Binutils and GDB, the GNU debugger.
 
@@ -111,7 +111,10 @@
       ++*strp;
       if (errmsg == NULL
 	  && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
-	value = (value >> 16) + (value & 0x8000 ? 1 : 0);
+        {
+          value = value + (value & 0x8000 ? 0x10000 : 0);
+          value >>= 16;
+        }
       *valuep = value;
       return errmsg;
     }
diff --git a/opcodes/m68k-dis.c b/opcodes/m68k-dis.c
index bfd8c89..18489e3 100644
--- a/opcodes/m68k-dis.c
+++ b/opcodes/m68k-dis.c
@@ -1,6 +1,6 @@
 /* Print Motorola 68k instructions.
    Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001, 2002, 2003
+   1998, 1999, 2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is free software; you can redistribute it and/or modify
@@ -46,18 +46,31 @@
 print_insn_arg PARAMS ((const char *, unsigned char *, unsigned char *,
 			bfd_vma, disassemble_info *));
 
-const char * const fpcr_names[] = {
+static bfd_boolean m68k_valid_ea (char code, int val);
+
+const char * const fpcr_names[] =
+{
     "", "%fpiar", "%fpsr", "%fpiar/%fpsr", "%fpcr",
     "%fpiar/%fpcr", "%fpsr/%fpcr", "%fpiar/%fpsr/%fpcr"
 };
 
-static char *const reg_names[] = {
+static char *const reg_names[] =
+{
     "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",
     "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp",
     "%ps", "%pc"
 };
 
-/* Sign-extend an (unsigned char). */
+/* Name of register halves for MAC/EMAC.
+   Seperate from reg_names since 'spu', 'fpl' look weird.  */
+static char *const reg_half_names[] =
+{
+    "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",
+    "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%a7",
+    "%ps", "%pc"
+};
+
+/* Sign-extend an (unsigned char).  */
 #if __STDC__ == 1
 #define COERCE_SIGNED_CHAR(ch) ((signed char) (ch))
 #else
@@ -169,178 +182,21 @@
 {
 }
 
-/* Print the m68k instruction at address MEMADDR in debugged memory,
-   on INFO->STREAM.  Returns length of the instruction, in bytes.  */
+/* Try to match the current instruction to best and if so, return the
+   number of bytes consumed from the instruction stream, else zero.  */
 
-int
-print_insn_m68k (memaddr, info)
-     bfd_vma memaddr;
-     disassemble_info *info;
+static int
+match_insn_m68k (bfd_vma memaddr, disassemble_info * info,
+		 const struct m68k_opcode * best, struct private * priv)
 {
-  register int i;
-  register unsigned char *p;
   unsigned char *save_p;
-  register const char *d;
-  register unsigned long bestmask;
-  const struct m68k_opcode *best;
-  unsigned int arch_mask;
-  struct private priv;
-  bfd_byte *buffer = priv.the_buffer;
+  unsigned char *p;
+  const char *d;
+
+  bfd_byte *buffer = priv->the_buffer;
   fprintf_ftype save_printer = info->fprintf_func;
-  void (*save_print_address) PARAMS ((bfd_vma, struct disassemble_info *))
+  void (* save_print_address) (bfd_vma, struct disassemble_info *)
     = info->print_address_func;
-  int major_opcode;
-  static int numopcodes[16];
-  static const struct m68k_opcode **opcodes[16];
-
-  if (!opcodes[0])
-    {
-      /* Speed up the matching by sorting the opcode table on the upper
-	 four bits of the opcode.  */
-      const struct m68k_opcode **opc_pointer[16];
-
-      /* First count how many opcodes are in each of the sixteen buckets.  */
-      for (i = 0; i < m68k_numopcodes; i++)
-	numopcodes[(m68k_opcodes[i].opcode >> 28) & 15]++;
-
-      /* Then create a sorted table of pointers that point into the
-	 unsorted table.  */
-      opc_pointer[0] = ((const struct m68k_opcode **)
-			xmalloc (sizeof (struct m68k_opcode *)
-				 * m68k_numopcodes));
-      opcodes[0] = opc_pointer[0];
-      for (i = 1; i < 16; i++)
-	{
-	  opc_pointer[i] = opc_pointer[i - 1] + numopcodes[i - 1];
-	  opcodes[i] = opc_pointer[i];
-	}
-
-      for (i = 0; i < m68k_numopcodes; i++)
-	*opc_pointer[(m68k_opcodes[i].opcode >> 28) & 15]++ = &m68k_opcodes[i];
-
-    }
-
-  info->private_data = (PTR) &priv;
-  /* Tell objdump to use two bytes per chunk and six bytes per line for
-     displaying raw data.  */
-  info->bytes_per_chunk = 2;
-  info->bytes_per_line = 6;
-  info->display_endian = BFD_ENDIAN_BIG;
-  priv.max_fetched = priv.the_buffer;
-  priv.insn_start = memaddr;
-  if (setjmp (priv.bailout) != 0)
-    /* Error return.  */
-    return -1;
-
-  best = NULL;
-  switch (info->mach)
-    {
-    default:
-    case 0:
-      arch_mask = (unsigned int) -1;
-      break;
-    case bfd_mach_m68000:
-      arch_mask = m68000;
-      break;
-    case bfd_mach_m68008:
-      arch_mask = m68008;
-      break;
-    case bfd_mach_m68010:
-      arch_mask = m68010;
-      break;
-    case bfd_mach_m68020:
-      arch_mask = m68020;
-      break;
-    case bfd_mach_m68030:
-      arch_mask = m68030;
-      break;
-    case bfd_mach_m68040:
-      arch_mask = m68040;
-      break;
-    case bfd_mach_m68060:
-      arch_mask = m68060;
-      break;
-    case bfd_mach_mcf5200:
-      arch_mask = mcf5200;
-      break;
-    case bfd_mach_mcf528x:
-      arch_mask = mcf528x;
-      break;
-    case bfd_mach_mcf5206e:
-      arch_mask = mcf5206e;
-      break;
-    case bfd_mach_mcf5307:
-      arch_mask = mcf5307;
-      break;
-    case bfd_mach_mcf5407:
-      arch_mask = mcf5407;
-      break;
-    }
-
-  arch_mask |= m68881 | m68851;
-
-  bestmask = 0;
-  FETCH_DATA (info, buffer + 2);
-  major_opcode = (buffer[0] >> 4) & 15;
-  for (i = 0; i < numopcodes[major_opcode]; i++)
-    {
-      const struct m68k_opcode *opc = opcodes[major_opcode][i];
-      unsigned long opcode = opc->opcode;
-      unsigned long match = opc->match;
-
-      if (((0xff & buffer[0] & (match >> 24)) == (0xff & (opcode >> 24)))
-	  && ((0xff & buffer[1] & (match >> 16)) == (0xff & (opcode >> 16)))
-	  /* Only fetch the next two bytes if we need to.  */
-	  && (((0xffff & match) == 0)
-	      ||
-	      (FETCH_DATA (info, buffer + 4)
-	       && ((0xff & buffer[2] & (match >> 8)) == (0xff & (opcode >> 8)))
-	       && ((0xff & buffer[3] & match) == (0xff & opcode)))
-	      )
-	  && (opc->arch & arch_mask) != 0)
-	{
-	  /* Don't use for printout the variants of divul and divsl
-	     that have the same register number in two places.
-	     The more general variants will match instead.  */
-	  for (d = opc->args; *d; d += 2)
-	    if (d[1] == 'D')
-	      break;
-
-	  /* Don't use for printout the variants of most floating
-	     point coprocessor instructions which use the same
-	     register number in two places, as above. */
-	  if (*d == '\0')
-	    for (d = opc->args; *d; d += 2)
-	      if (d[1] == 't')
-		break;
-
-	  /* Don't match fmovel with more than one register; wait for
-             fmoveml.  */
-	  if (*d == '\0')
-	    {
-	      for (d = opc->args; *d; d += 2)
-		{
-		  if (d[0] == 's' && d[1] == '8')
-		    {
-		      int val;
-
-		      val = fetch_arg (buffer, d[1], 3, info);
-		      if ((val & (val - 1)) != 0)
-			break;
-		    }
-		}
-	    }
-
-	  if (*d == '\0' && match > bestmask)
-	    {
-	      best = opc;
-	      bestmask = match;
-	    }
-	}
-    }
-
-  if (best == NULL)
-    goto invalid;
 
   /* Point at first word of argument data,
      and at descriptor for first argument.  */
@@ -352,8 +208,8 @@
      or 3rd words of the instruction.  */
   for (d = best->args; *d; d += 2)
     {
-      /* I don't think it is necessary to be checking d[0] here; I suspect
-	 all this could be moved to the case statement below.  */
+      /* I don't think it is necessary to be checking d[0] here;
+	 I suspect all this could be moved to the case statement below.  */
       if (d[0] == '#')
 	{
 	  if (d[1] == 'l' && p - buffer < 6)
@@ -361,8 +217,10 @@
 	  else if (p - buffer < 4 && d[1] != 'C' && d[1] != '8')
 	    p = buffer + 4;
 	}
+
       if ((d[0] == 'L' || d[0] == 'l') && d[1] == 'w' && p - buffer < 4)
 	p = buffer + 4;
+
       switch (d[1])
 	{
 	case '1':
@@ -412,77 +270,248 @@
 
   d = best->args;
 
-  /* We scan the operands twice.  The first time we don't print anything,
-     but look for errors. */
-
   save_p = p;
   info->print_address_func = dummy_print_address;
   info->fprintf_func = (fprintf_ftype) dummy_printer;
+
+  /* We scan the operands twice.  The first time we don't print anything,
+     but look for errors. */
   for (; *d; d += 2)
     {
       int eaten = print_insn_arg (d, buffer, p, memaddr + (p - buffer), info);
+
       if (eaten >= 0)
 	p += eaten;
       else if (eaten == -1)
-	goto invalid;
+	{
+	  info->fprintf_func = save_printer;
+	  info->print_address_func = save_print_address;
+	  return 0;
+	}
       else
 	{
-	  (*info->fprintf_func) (info->stream,
-				 /* xgettext:c-format */
-				 _("<internal error in opcode table: %s %s>\n"),
-				 best->name,
-				 best->args);
-	  goto invalid;
+	  info->fprintf_func (info->stream,
+			      /* xgettext:c-format */
+			      _("<internal error in opcode table: %s %s>\n"),
+			      best->name,  best->args);
+	  info->fprintf_func = save_printer;
+	  info->print_address_func = save_print_address;
+	  return 2;
 	}
-
     }
+
   p = save_p;
   info->fprintf_func = save_printer;
   info->print_address_func = save_print_address;
 
   d = best->args;
 
-  (*info->fprintf_func) (info->stream, "%s", best->name);
+  info->fprintf_func (info->stream, "%s", best->name);
 
   if (*d)
-    (*info->fprintf_func) (info->stream, " ");
+    info->fprintf_func (info->stream, " ");
 
   while (*d)
     {
       p += print_insn_arg (d, buffer, p, memaddr + (p - buffer), info);
       d += 2;
-      if (*d && *(d - 2) != 'I' && *d != 'k')
-	(*info->fprintf_func) (info->stream, ",");
-    }
-  return p - buffer;
 
- invalid:
+      if (*d && *(d - 2) != 'I' && *d != 'k')
+	info->fprintf_func (info->stream, ",");
+    }
+
+  return p - buffer;
+}
+
+/* Print the m68k instruction at address MEMADDR in debugged memory,
+   on INFO->STREAM.  Returns length of the instruction, in bytes.  */
+
+int
+print_insn_m68k (memaddr, info)
+     bfd_vma memaddr;
+     disassemble_info *info;
+{
+  int i;
+  const char *d;
+  unsigned int arch_mask;
+  struct private priv;
+  bfd_byte *buffer = priv.the_buffer;
+  int major_opcode;
+  static int numopcodes[16];
+  static const struct m68k_opcode **opcodes[16];
+  int val;
+
+  if (!opcodes[0])
+    {
+      /* Speed up the matching by sorting the opcode
+	 table on the upper four bits of the opcode.  */
+      const struct m68k_opcode **opc_pointer[16];
+
+      /* First count how many opcodes are in each of the sixteen buckets.  */
+      for (i = 0; i < m68k_numopcodes; i++)
+	numopcodes[(m68k_opcodes[i].opcode >> 28) & 15]++;
+
+      /* Then create a sorted table of pointers
+	 that point into the unsorted table.  */
+      opc_pointer[0] = xmalloc (sizeof (struct m68k_opcode *)
+				* m68k_numopcodes);
+      opcodes[0] = opc_pointer[0];
+
+      for (i = 1; i < 16; i++)
+	{
+	  opc_pointer[i] = opc_pointer[i - 1] + numopcodes[i - 1];
+	  opcodes[i] = opc_pointer[i];
+	}
+
+      for (i = 0; i < m68k_numopcodes; i++)
+	*opc_pointer[(m68k_opcodes[i].opcode >> 28) & 15]++ = &m68k_opcodes[i];
+    }
+
+  info->private_data = (PTR) &priv;
+  /* Tell objdump to use two bytes per chunk
+     and six bytes per line for displaying raw data.  */
+  info->bytes_per_chunk = 2;
+  info->bytes_per_line = 6;
+  info->display_endian = BFD_ENDIAN_BIG;
+  priv.max_fetched = priv.the_buffer;
+  priv.insn_start = memaddr;
+
+  if (setjmp (priv.bailout) != 0)
+    /* Error return.  */
+    return -1;
+
+  switch (info->mach)
+    {
+    default:
+    case 0:
+      arch_mask = (unsigned int) -1;
+      break;
+    case bfd_mach_m68000:
+      arch_mask = m68000|m68881|m68851;
+      break;
+    case bfd_mach_m68008:
+      arch_mask = m68008|m68881|m68851;
+      break;
+    case bfd_mach_m68010:
+      arch_mask = m68010|m68881|m68851;
+      break;
+    case bfd_mach_m68020:
+      arch_mask = m68020|m68881|m68851;
+      break;
+    case bfd_mach_m68030:
+      arch_mask = m68030|m68881|m68851;
+      break;
+    case bfd_mach_m68040:
+      arch_mask = m68040|m68881|m68851;
+      break;
+    case bfd_mach_m68060:
+      arch_mask = m68060|m68881|m68851;
+      break;
+    case bfd_mach_mcf5200:
+      arch_mask = mcfisa_a;
+      break;
+    case bfd_mach_mcf521x:
+    case bfd_mach_mcf528x:
+      arch_mask = mcfisa_a|mcfhwdiv|mcfisa_aa|mcfusp|mcfemac;
+      break;
+    case bfd_mach_mcf5206e:
+      arch_mask = mcfisa_a|mcfhwdiv|mcfmac;
+      break;
+    case bfd_mach_mcf5249:
+      arch_mask = mcfisa_a|mcfhwdiv|mcfemac;
+      break;
+    case bfd_mach_mcf5307:
+      arch_mask = mcfisa_a|mcfhwdiv|mcfmac;
+      break;
+    case bfd_mach_mcf5407:
+      arch_mask = mcfisa_a|mcfhwdiv|mcfisa_b|mcfmac;
+      break;
+    case bfd_mach_mcf547x:
+    case bfd_mach_mcf548x:
+    case bfd_mach_mcfv4e:
+      arch_mask = mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat|mcfemac;
+      break;
+    }
+
+  FETCH_DATA (info, buffer + 2);
+  major_opcode = (buffer[0] >> 4) & 15;
+
+  for (i = 0; i < numopcodes[major_opcode]; i++)
+    {
+      const struct m68k_opcode *opc = opcodes[major_opcode][i];
+      unsigned long opcode = opc->opcode;
+      unsigned long match = opc->match;
+
+      if (((0xff & buffer[0] & (match >> 24)) == (0xff & (opcode >> 24)))
+	  && ((0xff & buffer[1] & (match >> 16)) == (0xff & (opcode >> 16)))
+	  /* Only fetch the next two bytes if we need to.  */
+	  && (((0xffff & match) == 0)
+	      ||
+	      (FETCH_DATA (info, buffer + 4)
+	       && ((0xff & buffer[2] & (match >> 8)) == (0xff & (opcode >> 8)))
+	       && ((0xff & buffer[3] & match) == (0xff & opcode)))
+	      )
+	  && (opc->arch & arch_mask) != 0)
+	{
+	  /* Don't use for printout the variants of divul and divsl
+	     that have the same register number in two places.
+	     The more general variants will match instead.  */
+	  for (d = opc->args; *d; d += 2)
+	    if (d[1] == 'D')
+	      break;
+
+	  /* Don't use for printout the variants of most floating
+	     point coprocessor instructions which use the same
+	     register number in two places, as above.  */
+	  if (*d == '\0')
+	    for (d = opc->args; *d; d += 2)
+	      if (d[1] == 't')
+		break;
+
+	  /* Don't match fmovel with more than one register;
+	     wait for fmoveml.  */
+	  if (*d == '\0')
+	    {
+	      for (d = opc->args; *d; d += 2)
+		{
+		  if (d[0] == 's' && d[1] == '8')
+		    {
+		      val = fetch_arg (buffer, d[1], 3, info);
+		      if ((val & (val - 1)) != 0)
+			break;
+		    }
+		}
+	    }
+
+	  if (*d == '\0')
+	    if ((val = match_insn_m68k (memaddr, info, opc, & priv)))
+	      return val;
+	}
+    }
+
   /* Handle undefined instructions.  */
-  info->fprintf_func = save_printer;
-  info->print_address_func = save_print_address;
-  (*info->fprintf_func) (info->stream, "0%o",
-			 (buffer[0] << 8) + buffer[1]);
+  info->fprintf_func (info->stream, "0%o", (buffer[0] << 8) + buffer[1]);
   return 2;
 }
 
 /* Returns number of bytes "eaten" by the operand, or
    return -1 if an invalid operand was found, or -2 if
-   an opcode tabe error was found. */
+   an opcode tabe error was found.  */
 
 static int
 print_insn_arg (d, buffer, p0, addr, info)
      const char *d;
      unsigned char *buffer;
      unsigned char *p0;
-     bfd_vma addr;		/* PC for this arg to be relative to */
+     bfd_vma addr;		/* PC for this arg to be relative to.  */
      disassemble_info *info;
 {
-  register int val = 0;
-  register int place = d[1];
-  register unsigned char *p = p0;
+  int val = 0;
+  int place = d[1];
+  unsigned char *p = p0;
   int regno;
-  register const char *regname;
-  register unsigned char *p1;
+  const char *regname;
+  unsigned char *p1;
   double flval;
   int flt_p;
   bfd_signed_vma disp;
@@ -490,7 +519,7 @@
 
   switch (*d)
     {
-    case 'c':		/* cache identifier */
+    case 'c':		/* Cache identifier.  */
       {
         static char *const cacheFieldName[] = { "nc", "dc", "ic", "bc" };
         val = fetch_arg (buffer, place, 2, info);
@@ -498,7 +527,7 @@
         break;
       }
 
-    case 'a':		/* address register indirect only. Cf. case '+'. */
+    case 'a':		/* Address register indirect only. Cf. case '+'.  */
       {
         (*info->fprintf_func)
 	  (info->stream,
@@ -507,7 +536,7 @@
         break;
       }
 
-    case '_':		/* 32-bit absolute address for move16. */
+    case '_':		/* 32-bit absolute address for move16.  */
       {
         uval = NEXTULONG (p);
 	(*info->print_address_func) (uval, info);
@@ -736,6 +765,26 @@
 			     fpcr_names[fetch_arg (buffer, place, 3, info)]);
       break;
 
+    case 'e':
+      val = fetch_arg(buffer, place, 2, info);
+      (*info->fprintf_func) (info->stream, "%%acc%d", val);
+      break;
+
+    case 'g':
+      val = fetch_arg(buffer, place, 1, info);
+      (*info->fprintf_func) (info->stream, "%%accext%s", val==0 ? "01" : "23");
+      break;
+      
+    case 'i':
+      val = fetch_arg(buffer, place, 2, info);
+      if (val == 1)
+	(*info->fprintf_func) (info->stream, "<<");
+      else if (val == 3)
+	(*info->fprintf_func) (info->stream, ">>");
+      else
+	return -1;
+      break;
+
     case 'I':
       /* Get coprocessor ID... */
       val = fetch_arg (buffer, 'd', 3, info);
@@ -744,6 +793,7 @@
 	(*info->fprintf_func) (info->stream, "(cpid=%d) ", val);
       break;
 
+    case '4':
     case '*':
     case '~':
     case '%':
@@ -775,6 +825,10 @@
       else
 	val = fetch_arg (buffer, 's', 6, info);
 
+      /* If the <ea> is invalid for *d, then reject this match.  */
+      if (!m68k_valid_ea (*d, val))
+	return -1;
+
       /* Get register number assuming address register.  */
       regno = (val & 7) + 8;
       regname = reg_names[regno];
@@ -881,6 +935,16 @@
 	      return -1;
 	    }
 	}
+
+      /* If place is '/', then this is the case of the mask bit for
+	 mac/emac loads. Now that the arg has been printed, grab the
+	 mask bit and if set, add a '&' to the arg.  */
+      if (place == '/')
+	{
+	  val = fetch_arg (buffer, place, 1, info);
+	  if (val)
+	    info->fprintf_func (info->stream, "&");
+	}
       break;
 
     case 'L':
@@ -1048,7 +1112,7 @@
 	    reg &= 0xf;
 	  }
 	(*info->fprintf_func) (info->stream, "%s%s",
-			       reg_names[reg],
+			       reg_half_names[reg],
 			       is_upper ? "u" : "l");
       }
       break;
@@ -1060,6 +1124,106 @@
   return p - p0;
 }
 
+/* Check if an EA is valid for a particular code.  This is required
+   for the EMAC instructions since the type of source address determines
+   if it is a EMAC-load instruciton if the EA is mode 2-5, otherwise it
+   is a non-load EMAC instruction and the bits mean register Ry.
+   A similar case exists for the movem instructions where the register
+   mask is interpreted differently for different EAs.  */
+
+static bfd_boolean
+m68k_valid_ea (char code, int val)
+{
+  int mode, mask;
+#define M(n0,n1,n2,n3,n4,n5,n6,n70,n71,n72,n73,n74) \
+  (n0 | n1 << 1 | n2 << 2 | n3 << 3 | n4 << 4 | n5 << 5 | n6 << 6 \
+   | n70 << 7 | n71 << 8 | n72 << 9 | n73 << 10 | n74 << 11)
+
+  switch (code)
+    {
+    case '*':
+      mask = M (1,1,1,1,1,1,1,1,1,1,1,1);
+      break;
+    case '~':
+      mask = M (0,0,1,1,1,1,1,1,1,0,0,0);
+      break;
+    case '%':
+      mask = M (1,1,1,1,1,1,1,1,1,0,0,0);
+      break;
+    case ';':
+      mask = M (1,0,1,1,1,1,1,1,1,1,1,1);
+      break;
+    case '@':
+      mask = M (1,0,1,1,1,1,1,1,1,1,1,0);
+      break;
+    case '!':
+      mask = M (0,0,1,0,0,1,1,1,1,1,1,0);
+      break;
+    case '&':
+      mask = M (0,0,1,0,0,1,1,1,1,0,0,0);
+      break;
+    case '$':
+      mask = M (1,0,1,1,1,1,1,1,1,0,0,0);
+      break;
+    case '?':
+      mask = M (0,1,0,0,1,1,1,1,1,0,0,0);
+      break;
+    case '/':
+      mask = M (1,0,1,0,0,1,1,1,1,1,1,0);
+      break;
+    case '|':
+      mask = M (0,0,1,0,0,1,1,1,1,1,1,0);
+      break;
+    case '>':
+      mask = M (0,0,1,0,1,1,1,1,1,1,1,0);
+      break;
+    case '<':
+      mask = M (0,0,1,1,0,1,1,1,1,0,0,0);
+      break;
+    case 'm':
+      mask = M (1,1,1,1,1,0,0,0,0,0,0,0);
+      break;
+    case 'n':
+      mask = M (0,0,0,0,0,1,0,0,0,1,0,0);
+      break;
+    case 'o':
+      mask = M (0,0,0,0,0,0,1,1,1,0,1,1);
+      break;
+    case 'p':
+      mask = M (1,1,1,1,1,1,0,0,0,0,0,0);
+      break;
+    case 'q':
+      mask = M (1,0,1,1,1,1,0,0,0,0,0,0);
+      break;
+    case 'v':
+      mask = M (1,0,1,1,1,1,0,1,1,0,0,0);
+      break;
+    case 'b':
+      mask = M (1,0,1,1,1,1,0,0,0,1,0,0);
+      break;
+    case 'w':
+      mask = M (0,0,1,1,1,1,0,0,0,1,0,0);
+      break;
+    case 'y':
+      mask = M (0,0,1,0,0,1,0,0,0,0,0,0);
+      break;
+    case 'z':
+      mask = M (0,0,1,0,0,1,0,0,0,1,0,0);
+      break;
+    case '4':
+      mask = M (0,0,1,1,1,1,0,0,0,0,0,0);
+      break;
+    default:
+      abort ();
+    }
+#undef M
+
+  mode = (val >> 3) & 7;
+  if (mode == 7)
+    mode += val & 7;
+  return (mask & (1 << mode)) != 0;
+}
+
 /* Fetch BITS bits from a position in the instruction specified by CODE.
    CODE is a "place to put an argument", or 'x' for a destination
    that is a general address (mode and register).
@@ -1072,9 +1236,38 @@
      int bits;
      disassemble_info *info;
 {
-  register int val = 0;
+  int val = 0;
+
   switch (code)
     {
+    case '/': /* MAC/EMAC mask bit.  */
+      val = buffer[3] >> 5;
+      break;
+
+    case 'G': /* EMAC ACC load.  */
+      val = ((buffer[3] >> 3) & 0x2) | ((~buffer[1] >> 7) & 0x1);
+      break;
+
+    case 'H': /* EMAC ACC !load.  */
+      val = ((buffer[3] >> 3) & 0x2) | ((buffer[1] >> 7) & 0x1);
+      break;
+
+    case ']': /* EMAC ACCEXT bit.  */
+      val = buffer[0] >> 2;
+      break;
+
+    case 'I': /* MAC/EMAC scale factor.  */
+      val = buffer[2] >> 1;
+      break;
+
+    case 'F': /* EMAC ACCx.  */
+      val = buffer[0] >> 1;
+      break;
+
+    case 'f':
+      val = buffer[1];
+      break;
+
     case 's':
       val = buffer[1];
       break;
@@ -1171,11 +1364,11 @@
       break;
 
     case 'M':
-      val = buffer[1] | (buffer[3] & 0x40 ? 0x10 : 0);
+      val = (buffer[1] & 0xf) | (buffer[3] & 0x40 ? 0x10 : 0);
       break;
 
     case 'N':
-      val = buffer[3] | (buffer[3] & 0x40 ? 0x10 : 0);
+      val = (buffer[3] & 0xf) | (buffer[3] & 0x40 ? 0x10 : 0);
       break;
 
     case 'h':
@@ -1222,7 +1415,7 @@
      bfd_vma addr;
      disassemble_info *info;
 {
-  register int word;
+  int word;
   static char *const scales[] = { "", ":2", ":4", ":8" };
   bfd_vma base_disp;
   bfd_vma outer_disp;
diff --git a/opcodes/m68k-opc.c b/opcodes/m68k-opc.c
index 8fa6c0e..82d1c42 100644
--- a/opcodes/m68k-opc.c
+++ b/opcodes/m68k-opc.c
@@ -1,6 +1,6 @@
 /* Opcode table for m680[012346]0/m6888[12]/m68851/mcf5200.
    Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2003
+   2000, 2001, 2003, 2004
    Free Software Foundation, Inc.
 
    This file is part of GDB, GAS, and the GNU binutils.
@@ -32,1471 +32,1460 @@
 
 const struct m68k_opcode m68k_opcodes[] =
 {
-{"abcd",	one(0140400),	one(0170770), "DsDd", m68000up },
-{"abcd",	one(0140410),	one(0170770), "-s-d", m68000up },
+{"abcd", 2,	one(0140400),	one(0170770), "DsDd", m68000up },
+{"abcd", 2,	one(0140410),	one(0170770), "-s-d", m68000up },
 
-{"addaw",	one(0150300),	one(0170700), "*wAd", m68000up },
-{"addal",	one(0150700),	one(0170700), "*lAd", m68000up | mcf },
+{"addaw", 2,	one(0150300),	one(0170700), "*wAd", m68000up },
+{"addal", 2,	one(0150700),	one(0170700), "*lAd", m68000up | mcfisa_a },
 
-{"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", mcf },
+{"addib", 4,	one(0003000),	one(0177700), "#b$s", m68000up },
+{"addiw", 4,	one(0003100),	one(0177700), "#w$s", m68000up },
+{"addil", 6,	one(0003200),	one(0177700), "#l$s", m68000up },
+{"addil", 6,	one(0003200),	one(0177700), "#lDs", mcfisa_a },
 
-{"addqb",	one(0050000),	one(0170700), "Qd$b", m68000up },
-{"addqw",	one(0050100),	one(0170700), "Qd%w", m68000up },
-{"addql",	one(0050200),	one(0170700), "Qd%l", m68000up | mcf },
+{"addqb", 2,	one(0050000),	one(0170700), "Qd$b", m68000up },
+{"addqw", 2,	one(0050100),	one(0170700), "Qd%w", m68000up },
+{"addql", 2,	one(0050200),	one(0170700), "Qd%l", m68000up | mcfisa_a },
 
 /* The add opcode can generate the adda, addi, and addq instructions.  */
-{"addb",	one(0050000),	one(0170700), "Qd$b", m68000up },
-{"addb",	one(0003000),	one(0177700), "#b$s", m68000up },
-{"addb",	one(0150000),	one(0170700), ";bDd", m68000up },
-{"addb",	one(0150400),	one(0170700), "Dd~b", m68000up },
-{"addw",	one(0050100),	one(0170700), "Qd%w", m68000up },
-{"addw",	one(0150300),	one(0170700), "*wAd", m68000up },
-{"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 | mcf },
-{"addl",	one(0003200),	one(0177700), "#l$s", m68000up },
-{"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 },
+{"addb", 2,	one(0050000),	one(0170700), "Qd$b", m68000up },
+{"addb", 4,	one(0003000),	one(0177700), "#b$s", m68000up },
+{"addb", 2,	one(0150000),	one(0170700), ";bDd", m68000up },
+{"addb", 2,	one(0150400),	one(0170700), "Dd~b", m68000up },
+{"addw", 2,	one(0050100),	one(0170700), "Qd%w", m68000up },
+{"addw", 2,	one(0150300),	one(0170700), "*wAd", m68000up },
+{"addw", 4,	one(0003100),	one(0177700), "#w$s", m68000up },
+{"addw", 2,	one(0150100),	one(0170700), "*wDd", m68000up },
+{"addw", 2,	one(0150500),	one(0170700), "Dd~w", m68000up },
+{"addl", 2,	one(0050200),	one(0170700), "Qd%l", m68000up | mcfisa_a },
+{"addl", 6,	one(0003200),	one(0177700), "#l$s", m68000up },
+{"addl", 6,	one(0003200),	one(0177700), "#lDs", mcfisa_a },
+{"addl", 2,	one(0150700),	one(0170700), "*lAd", m68000up | mcfisa_a },
+{"addl", 2,	one(0150200),	one(0170700), "*lDd", m68000up | mcfisa_a },
+{"addl", 2,	one(0150600),	one(0170700), "Dd~l", m68000up | mcfisa_a },
 
-{"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 | mcf },
-{"addxl",	one(0150610),	one(0170770), "-s-d", m68000up },
+{"addxb", 2,	one(0150400),	one(0170770), "DsDd", m68000up },
+{"addxb", 2,	one(0150410),	one(0170770), "-s-d", m68000up },
+{"addxw", 2,	one(0150500),	one(0170770), "DsDd", m68000up },
+{"addxw", 2,	one(0150510),	one(0170770), "-s-d", m68000up },
+{"addxl", 2,	one(0150600),	one(0170770), "DsDd", m68000up | mcfisa_a },
+{"addxl", 2,	one(0150610),	one(0170770), "-s-d", m68000up },
 
-{"andib",	one(0001000),	one(0177700), "#b$s", m68000up },
-{"andib",	one(0001074),	one(0177777), "#bCs", m68000up },
-{"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", mcf },
-{"andi",	one(0001100),	one(0177700), "#w$s", m68000up },
-{"andi",	one(0001074),	one(0177777), "#bCs", m68000up },
-{"andi",	one(0001174),	one(0177777), "#wSs", m68000up },
+{"andib", 4,	one(0001000),	one(0177700), "#b$s", m68000up },
+{"andib", 4,	one(0001074),	one(0177777), "#bCs", m68000up },
+{"andiw", 4,	one(0001100),	one(0177700), "#w$s", m68000up },
+{"andiw", 4,	one(0001174),	one(0177777), "#wSs", m68000up },
+{"andil", 6,	one(0001200),	one(0177700), "#l$s", m68000up },
+{"andil", 6,	one(0001200),	one(0177700), "#lDs", mcfisa_a },
+{"andi", 4,	one(0001100),	one(0177700), "#w$s", m68000up },
+{"andi", 4,	one(0001074),	one(0177777), "#bCs", m68000up },
+{"andi", 4,	one(0001174),	one(0177777), "#wSs", m68000up },
 
 /* The and opcode can generate the andi instruction.  */
-{"andb",	one(0001000),	one(0177700), "#b$s", m68000up },
-{"andb",	one(0001074),	one(0177777), "#bCs", m68000up },
-{"andb",	one(0140000),	one(0170700), ";bDd", m68000up },
-{"andb",	one(0140400),	one(0170700), "Dd~b", m68000up },
-{"andw",	one(0001100),	one(0177700), "#w$s", m68000up },
-{"andw",	one(0001174),	one(0177777), "#wSs", m68000up },
-{"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", 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 },
-{"and",		one(0140100),	one(0170700), ";wDd", m68000up },
-{"and",		one(0140500),	one(0170700), "Dd~w", m68000up },
+{"andb", 4,	one(0001000),	one(0177700), "#b$s", m68000up },
+{"andb", 4,	one(0001074),	one(0177777), "#bCs", m68000up },
+{"andb", 2,	one(0140000),	one(0170700), ";bDd", m68000up },
+{"andb", 2,	one(0140400),	one(0170700), "Dd~b", m68000up },
+{"andw", 4,	one(0001100),	one(0177700), "#w$s", m68000up },
+{"andw", 4,	one(0001174),	one(0177777), "#wSs", m68000up },
+{"andw", 2,	one(0140100),	one(0170700), ";wDd", m68000up },
+{"andw", 2,	one(0140500),	one(0170700), "Dd~w", m68000up },
+{"andl", 6,	one(0001200),	one(0177700), "#l$s", m68000up },
+{"andl", 6,	one(0001200),	one(0177700), "#lDs", mcfisa_a },
+{"andl", 2,	one(0140200),	one(0170700), ";lDd", m68000up | mcfisa_a },
+{"andl", 2,	one(0140600),	one(0170700), "Dd~l", m68000up | mcfisa_a },
+{"and", 4,		one(0001100),	one(0177700), "#w$w", m68000up },
+{"and", 4,		one(0001074),	one(0177777), "#bCs", m68000up },
+{"and", 4,		one(0001174),	one(0177777), "#wSs", m68000up },
+{"and", 2,		one(0140100),	one(0170700), ";wDd", m68000up },
+{"and", 2,		one(0140500),	one(0170700), "Dd~w", m68000up },
 
-{"aslb",	one(0160400),	one(0170770), "QdDs", m68000up },
-{"aslb",	one(0160440),	one(0170770), "DdDs", m68000up },
-{"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 | mcf },
-{"asll",	one(0160640),	one(0170770), "DdDs", m68000up | mcf },
+{"aslb", 2,	one(0160400),	one(0170770), "QdDs", m68000up },
+{"aslb", 2,	one(0160440),	one(0170770), "DdDs", m68000up },
+{"aslw", 2,	one(0160500),	one(0170770), "QdDs", m68000up },
+{"aslw", 2,	one(0160540),	one(0170770), "DdDs", m68000up },
+{"aslw", 2,	one(0160700),	one(0177700), "~s",   m68000up },
+{"asll", 2,	one(0160600),	one(0170770), "QdDs", m68000up | mcfisa_a },
+{"asll", 2,	one(0160640),	one(0170770), "DdDs", m68000up | mcfisa_a },
 
-{"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 | mcf },
-{"asrl",	one(0160240),	one(0170770), "DdDs", m68000up | mcf },
+{"asrb", 2,	one(0160000),	one(0170770), "QdDs", m68000up },
+{"asrb", 2,	one(0160040),	one(0170770), "DdDs", m68000up },
+{"asrw", 2,	one(0160100),	one(0170770), "QdDs", m68000up },
+{"asrw", 2,	one(0160140),	one(0170770), "DdDs", m68000up },
+{"asrw", 2,	one(0160300),	one(0177700), "~s",   m68000up },
+{"asrl", 2,	one(0160200),	one(0170770), "QdDs", m68000up | mcfisa_a },
+{"asrl", 2,	one(0160240),	one(0170770), "DdDs", m68000up | mcfisa_a },
 
-{"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 },
+{"bhiw", 2,	one(0061000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"blsw", 2,	one(0061400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bccw", 2,	one(0062000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bcsw", 2,	one(0062400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bnew", 2,	one(0063000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"beqw", 2,	one(0063400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bvcw", 2,	one(0064000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bvsw", 2,	one(0064400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bplw", 2,	one(0065000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bmiw", 2,	one(0065400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bgew", 2,	one(0066000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bltw", 2,	one(0066400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bgtw", 2,	one(0067000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"blew", 2,	one(0067400),	one(0177777), "BW", m68000up | mcfisa_a },
 
-{"bhil",	one(0061377),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"blsl",	one(0061777),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bccl",	one(0062377),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bcsl",	one(0062777),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bnel",	one(0063377),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"beql",	one(0063777),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bvcl",	one(0064377),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bvsl",	one(0064777),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bpll",	one(0065377),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bmil",	one(0065777),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bgel",	one(0066377),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bltl",	one(0066777),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bgtl",	one(0067377),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"blel",	one(0067777),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
+{"bhil", 2,	one(0061377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"blsl", 2,	one(0061777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bccl", 2,	one(0062377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bcsl", 2,	one(0062777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bnel", 2,	one(0063377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"beql", 2,	one(0063777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bvcl", 2,	one(0064377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bvsl", 2,	one(0064777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bpll", 2,	one(0065377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bmil", 2,	one(0065777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bgel", 2,	one(0066377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bltl", 2,	one(0066777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bgtl", 2,	one(0067377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"blel", 2,	one(0067777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
 
-{"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 },
+{"bhis", 2,	one(0061000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"blss", 2,	one(0061400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bccs", 2,	one(0062000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bcss", 2,	one(0062400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bnes", 2,	one(0063000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"beqs", 2,	one(0063400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bvcs", 2,	one(0064000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bvss", 2,	one(0064400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bpls", 2,	one(0065000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bmis", 2,	one(0065400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bges", 2,	one(0066000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"blts", 2,	one(0066400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bgts", 2,	one(0067000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bles", 2,	one(0067400),	one(0177400), "BB", m68000up | mcfisa_a },
 
-{"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 },
+{"jhi", 2,	one(0061000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jls", 2,	one(0061400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jcc", 2,	one(0062000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jcs", 2,	one(0062400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jne", 2,	one(0063000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jeq", 2,	one(0063400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jvc", 2,	one(0064000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jvs", 2,	one(0064400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jpl", 2,	one(0065000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jmi", 2,	one(0065400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jge", 2,	one(0066000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jlt", 2,	one(0066400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jgt", 2,	one(0067000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jle", 2,	one(0067400),	one(0177400), "Bg", m68000up | mcfisa_a },
 
-{"bchg",	one(0000500),	one(0170700), "Dd$s", m68000up | mcf },
-{"bchg",	one(0004100),	one(0177700), "#b$s", m68000up },
-{"bchg",	one(0004100),	one(0177700), "#bqs", mcf },
+{"bchg", 2,	one(0000500),	one(0170700), "Dd$s", m68000up | mcfisa_a },
+{"bchg", 4,	one(0004100),	one(0177700), "#b$s", m68000up },
+{"bchg", 4,	one(0004100),	one(0177700), "#bqs", mcfisa_a },
 
-{"bclr",	one(0000600),	one(0170700), "Dd$s", m68000up | mcf },
-{"bclr",	one(0004200),	one(0177700), "#b$s", m68000up },
-{"bclr",	one(0004200),	one(0177700), "#bqs", mcf },
+{"bclr", 2,	one(0000600),	one(0170700), "Dd$s", m68000up | mcfisa_a },
+{"bclr", 4,	one(0004200),	one(0177700), "#b$s", m68000up },
+{"bclr", 4,	one(0004200),	one(0177700), "#bqs", mcfisa_a },
 
-{"bfchg",	two(0165300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
-{"bfclr",	two(0166300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
-{"bfexts",	two(0165700, 0), two(0177700, 0100000),	"/sO2O3D1", m68020up },
-{"bfextu",	two(0164700, 0), two(0177700, 0100000),	"/sO2O3D1", m68020up },
-{"bfffo",	two(0166700, 0), two(0177700, 0100000),	"/sO2O3D1", m68020up },
-{"bfins",	two(0167700, 0), two(0177700, 0100000),	"D1?sO2O3", m68020up },
-{"bfset",	two(0167300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
-{"bftst",	two(0164300, 0), two(0177700, 0170000),	"/sO2O3",   m68020up },
+{"bfchg", 4,	two(0165300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
+{"bfclr", 4,	two(0166300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
+{"bfexts", 4,	two(0165700, 0), two(0177700, 0100000),	"/sO2O3D1", m68020up },
+{"bfextu", 4,	two(0164700, 0), two(0177700, 0100000),	"/sO2O3D1", m68020up },
+{"bfffo", 4,	two(0166700, 0), two(0177700, 0100000),	"/sO2O3D1", m68020up },
+{"bfins", 4,	two(0167700, 0), two(0177700, 0100000),	"D1?sO2O3", m68020up },
+{"bfset", 4,	two(0167300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
+{"bftst", 4,	two(0164300, 0), two(0177700, 0170000),	"/sO2O3",   m68020up },
 
-{"bgnd",	one(0045372),	one(0177777), "", cpu32 },
+{"bgnd", 2,	one(0045372),	one(0177777), "", cpu32 },
 
-{"bitrev",	one(0000300),	one(0177770), "Ds", mcf528x},
+{"bitrev", 2,	one(0000300),	one(0177770), "Ds", mcfisa_aa},
 
-{"bkpt",	one(0044110),	one(0177770), "ts", m68010up },
+{"bkpt", 2,	one(0044110),	one(0177770), "ts", m68010up },
 
-{"braw",	one(0060000),	one(0177777), "BW", m68000up | mcf },
-{"bral",	one(0060377),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bras",	one(0060000),	one(0177400), "BB", m68000up | mcf },
+{"braw", 2,	one(0060000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bral", 2,	one(0060377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bras", 2,	one(0060000),	one(0177400), "BB", m68000up | mcfisa_a },
 
-{"bset",	one(0000700),	one(0170700), "Dd$s", m68000up | mcf },
-{"bset",	one(0000700),	one(0170700), "Ddvs", mcf },
-{"bset",	one(0004300),	one(0177700), "#b$s", m68000up },
-{"bset",	one(0004300),	one(0177700), "#bqs", mcf },
+{"bset", 2,	one(0000700),	one(0170700), "Dd$s", m68000up | mcfisa_a },
+{"bset", 2,	one(0000700),	one(0170700), "Ddvs", mcfisa_a },
+{"bset", 4,	one(0004300),	one(0177700), "#b$s", m68000up },
+{"bset", 4,	one(0004300),	one(0177700), "#bqs", mcfisa_a },
 
-{"bsrw",	one(0060400),	one(0177777), "BW", m68000up | mcf },
-{"bsrl",	one(0060777),	one(0177777), "BL", m68020up | cpu32 | mcfv4up},
-{"bsrs",	one(0060400),	one(0177400), "BB", m68000up | mcf },
+{"bsrw", 2,	one(0060400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bsrl", 2,	one(0060777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bsrs", 2,	one(0060400),	one(0177400), "BB", m68000up | mcfisa_a },
 
-{"btst",	one(0000400),	one(0170700), "Dd;b", m68000up | mcf },
-{"btst",	one(0004000),	one(0177700), "#b@s", m68000up },
-{"btst",	one(0004000),	one(0177700), "#bqs", mcf },
+{"btst", 2,	one(0000400),	one(0170700), "Dd;b", m68000up | mcfisa_a },
+{"btst", 4,	one(0004000),	one(0177700), "#b@s", m68000up },
+{"btst", 4,	one(0004000),	one(0177700), "#bqs", mcfisa_a },
 
-{"byterev",	one(0001300),	one(0177770), "Ds", mcf528x},
+{"byterev", 2,	one(0001300),	one(0177770), "Ds", mcfisa_aa},
 
-{"callm",	one(0003300),	one(0177700), "#b!s", m68020 },
+{"callm", 4,	one(0003300),	one(0177700), "#b!s", m68020 },
 
-{"cas2w",     two(0006374,0), two(0177777,0007070), "D3D6D2D5r1r4", m68020up },
-{"cas2w",     two(0006374,0), two(0177777,0007070), "D3D6D2D5R1R4", m68020up },
-{"cas2l",     two(0007374,0), two(0177777,0007070), "D3D6D2D5r1r4", m68020up },
-{"cas2l",     two(0007374,0), two(0177777,0007070), "D3D6D2D5R1R4", m68020up },
+{"cas2w", 6,    two(0006374,0), two(0177777,0007070), "D3D6D2D5r1r4", m68020up },
+{"cas2w", 6,    two(0006374,0), two(0177777,0007070), "D3D6D2D5R1R4", m68020up },
+{"cas2l", 6,    two(0007374,0), two(0177777,0007070), "D3D6D2D5r1r4", m68020up },
+{"cas2l", 6,    two(0007374,0), two(0177777,0007070), "D3D6D2D5R1R4", m68020up },
 
-{"casb",	two(0005300, 0), two(0177700, 0177070),	"D3D2~s", m68020up },
-{"casw",	two(0006300, 0), two(0177700, 0177070),	"D3D2~s", m68020up },
-{"casl",	two(0007300, 0), two(0177700, 0177070),	"D3D2~s", m68020up },
+{"casb", 4,	two(0005300, 0), two(0177700, 0177070),	"D3D2~s", m68020up },
+{"casw", 4,	two(0006300, 0), two(0177700, 0177070),	"D3D2~s", m68020up },
+{"casl", 4,	two(0007300, 0), two(0177700, 0177070),	"D3D2~s", m68020up },
 
-{"chk2b", two(0000300,0004000), two(0177700,07777), "!sR1", m68020up | cpu32 },
-{"chk2w", two(0001300,0004000),	two(0177700,07777), "!sR1", m68020up | cpu32 },
-{"chk2l", two(0002300,0004000),	two(0177700,07777), "!sR1", m68020up | cpu32 },
+{"chk2b", 4, 	two(0000300,0004000), two(0177700,07777), "!sR1", m68020up | cpu32 },
+{"chk2w", 4, 	two(0001300,0004000),	two(0177700,07777), "!sR1", m68020up | cpu32 },
+{"chk2l", 4, 	two(0002300,0004000),	two(0177700,07777), "!sR1", m68020up | cpu32 },
 
-{"chkl",	one(0040400),		one(0170700), ";lDd", m68000up },
-{"chkw",	one(0040600),		one(0170700), ";wDd", m68000up },
+{"chkl", 2,	one(0040400),		one(0170700), ";lDd", m68000up },
+{"chkw", 2,	one(0040600),		one(0170700), ";wDd", m68000up },
 
 #define SCOPE_LINE (0x1 << 3)
 #define SCOPE_PAGE (0x2 << 3)
 #define SCOPE_ALL  (0x3 << 3)
 
-{"cinva",	one(0xf400|SCOPE_ALL),  one(0xff38), "ce",   m68040up },
-{"cinvl",	one(0xf400|SCOPE_LINE), one(0xff38), "ceas", m68040up },
-{"cinvp",	one(0xf400|SCOPE_PAGE), one(0xff38), "ceas", m68040up },
+{"cinva", 2,	one(0xf400|SCOPE_ALL),  one(0xff38), "ce",   m68040up },
+{"cinvl", 2,	one(0xf400|SCOPE_LINE), one(0xff38), "ceas", m68040up },
+{"cinvp", 2,	one(0xf400|SCOPE_PAGE), one(0xff38), "ceas", m68040up },
 
-{"cpusha",	one(0xf420|SCOPE_ALL),  one(0xff38), "ce",   m68040up },
-{"cpushl",	one(0xf420|SCOPE_LINE), one(0xff38), "ceas", m68040up | mcf },
-{"cpushp",	one(0xf420|SCOPE_PAGE), one(0xff38), "ceas", m68040up },
+{"cpusha", 2,	one(0xf420|SCOPE_ALL),  one(0xff38), "ce",   m68040up },
+{"cpushl", 2,	one(0xf420|SCOPE_LINE), one(0xff38), "ceas", m68040up | mcfisa_a },
+{"cpushp", 2,	one(0xf420|SCOPE_PAGE), one(0xff38), "ceas", m68040up },
 
 #undef SCOPE_LINE
 #undef SCOPE_PAGE
 #undef SCOPE_ALL
 
-{"clrb",	one(0041000),	one(0177700), "$s", m68000up | mcf },
-{"clrw",	one(0041100),	one(0177700), "$s", m68000up | mcf },
-{"clrl",	one(0041200),	one(0177700), "$s", m68000up | mcf },
+{"clrb", 2,	one(0041000),	one(0177700), "$s", m68000up | mcfisa_a },
+{"clrw", 2,	one(0041100),	one(0177700), "$s", m68000up | mcfisa_a },
+{"clrl", 2,	one(0041200),	one(0177700), "$s", m68000up | mcfisa_a },
 
-{"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 },
+{"cmp2b", 4,	two(0000300,0), two(0177700,07777), "!sR1", m68020up | cpu32 },
+{"cmp2w", 4,	two(0001300,0),	two(0177700,07777), "!sR1", m68020up | cpu32 },
+{"cmp2l", 4,	two(0002300,0),	two(0177700,07777), "!sR1", m68020up | cpu32 },
 
-{"cmpaw",	one(0130300),	one(0170700), "*wAd", m68000up },
-{"cmpal",	one(0130700),	one(0170700), "*lAd", m68000up | mcf },
+{"cmpaw", 2,	one(0130300),	one(0170700), "*wAd", m68000up },
+{"cmpal", 2,	one(0130700),	one(0170700), "*lAd", m68000up | mcfisa_a },
 
-{"cmpib",	one(0006000),	one(0177700), "#b@s", m68000up },
-{"cmpib",	one(0006000),	one(0177700), "#bDs", mcfv4up },
-{"cmpiw",	one(0006100),	one(0177700), "#w@s", m68000up },
-{"cmpiw",	one(0006100),	one(0177700), "#wDs", mcfv4up },
-{"cmpil",	one(0006200),	one(0177700), "#l@s", m68000up },
-{"cmpil",	one(0006200),	one(0177700), "#lDs", mcf },
+{"cmpib", 4,	one(0006000),	one(0177700), "#b@s", m68000up },
+{"cmpib", 4,	one(0006000),	one(0177700), "#bDs", mcfisa_b },
+{"cmpiw", 4,	one(0006100),	one(0177700), "#w@s", m68000up },
+{"cmpiw", 4,	one(0006100),	one(0177700), "#wDs", mcfisa_b },
+{"cmpil", 6,	one(0006200),	one(0177700), "#l@s", m68000up },
+{"cmpil", 6,	one(0006200),	one(0177700), "#lDs", mcfisa_a },
 
-{"cmpmb",	one(0130410),	one(0170770), "+s+d", m68000up },
-{"cmpmw",	one(0130510),	one(0170770), "+s+d", m68000up },
-{"cmpml",	one(0130610),	one(0170770), "+s+d", m68000up },
+{"cmpmb", 2,	one(0130410),	one(0170770), "+s+d", m68000up },
+{"cmpmw", 2,	one(0130510),	one(0170770), "+s+d", m68000up },
+{"cmpml", 2,	one(0130610),	one(0170770), "+s+d", m68000up },
 
 /* The cmp opcode can generate the cmpa, cmpm, and cmpi instructions.  */
-{"cmpb",	one(0006000),	one(0177700), "#b@s", m68000up },
-{"cmpb",	one(0006000),	one(0177700), "#bDs", mcfv4up },
-{"cmpb",	one(0130410),	one(0170770), "+s+d", m68000up },
-{"cmpb",	one(0130000),	one(0170700), ";bDd", m68000up },
-{"cmpb",	one(0130000),	one(0170700), "*bDd", mcfv4up },
-{"cmpw",	one(0130300),	one(0170700), "*wAd", m68000up },
-{"cmpw",	one(0006100),	one(0177700), "#w@s", m68000up },
-{"cmpw",	one(0006100),	one(0177700), "#wDs", mcfv4up },
-{"cmpw",	one(0130510),	one(0170770), "+s+d", m68000up },
-{"cmpw",	one(0130100),	one(0170700), "*wDd", m68000up | mcfv4up },
-{"cmpl",	one(0130700),	one(0170700), "*lAd", m68000up | mcf },
-{"cmpl",	one(0006200),	one(0177700), "#l@s", m68000up },
-{"cmpl",	one(0006200),	one(0177700), "#lDs", mcf },
-{"cmpl",	one(0130610),	one(0170770), "+s+d", m68000up },
-{"cmpl",	one(0130200),	one(0170700), "*lDd", m68000up | mcf },
+{"cmpb", 4,	one(0006000),	one(0177700), "#b@s", m68000up },
+{"cmpb", 4,	one(0006000),	one(0177700), "#bDs", mcfisa_b },
+{"cmpb", 2,	one(0130410),	one(0170770), "+s+d", m68000up },
+{"cmpb", 2,	one(0130000),	one(0170700), ";bDd", m68000up },
+{"cmpb", 2,	one(0130000),	one(0170700), "*bDd", mcfisa_b },
+{"cmpw", 2,	one(0130300),	one(0170700), "*wAd", m68000up },
+{"cmpw", 4,	one(0006100),	one(0177700), "#w@s", m68000up },
+{"cmpw", 4,	one(0006100),	one(0177700), "#wDs", mcfisa_b },
+{"cmpw", 2,	one(0130510),	one(0170770), "+s+d", m68000up },
+{"cmpw", 2,	one(0130100),	one(0170700), "*wDd", m68000up | mcfisa_b },
+{"cmpl", 2,	one(0130700),	one(0170700), "*lAd", m68000up | mcfisa_a },
+{"cmpl", 6,	one(0006200),	one(0177700), "#l@s", m68000up },
+{"cmpl", 6,	one(0006200),	one(0177700), "#lDs", mcfisa_a },
+{"cmpl", 2,	one(0130610),	one(0170770), "+s+d", m68000up },
+{"cmpl", 2,	one(0130200),	one(0170700), "*lDd", m68000up | mcfisa_a },
 
-{"dbcc",	one(0052310),	one(0177770), "DsBw", m68000up },
-{"dbcs",	one(0052710),	one(0177770), "DsBw", m68000up },
-{"dbeq",	one(0053710),	one(0177770), "DsBw", m68000up },
-{"dbf",		one(0050710),	one(0177770), "DsBw", m68000up },
-{"dbge",	one(0056310),	one(0177770), "DsBw", m68000up },
-{"dbgt",	one(0057310),	one(0177770), "DsBw", m68000up },
-{"dbhi",	one(0051310),	one(0177770), "DsBw", m68000up },
-{"dble",	one(0057710),	one(0177770), "DsBw", m68000up },
-{"dbls",	one(0051710),	one(0177770), "DsBw", m68000up },
-{"dblt",	one(0056710),	one(0177770), "DsBw", m68000up },
-{"dbmi",	one(0055710),	one(0177770), "DsBw", m68000up },
-{"dbne",	one(0053310),	one(0177770), "DsBw", m68000up },
-{"dbpl",	one(0055310),	one(0177770), "DsBw", m68000up },
-{"dbt",		one(0050310),	one(0177770), "DsBw", m68000up },
-{"dbvc",	one(0054310),	one(0177770), "DsBw", m68000up },
-{"dbvs",	one(0054710),	one(0177770), "DsBw", m68000up },
+{"dbcc", 2,	one(0052310),	one(0177770), "DsBw", m68000up },
+{"dbcs", 2,	one(0052710),	one(0177770), "DsBw", m68000up },
+{"dbeq", 2,	one(0053710),	one(0177770), "DsBw", m68000up },
+{"dbf", 2,	one(0050710),	one(0177770), "DsBw", m68000up },
+{"dbge", 2,	one(0056310),	one(0177770), "DsBw", m68000up },
+{"dbgt", 2,	one(0057310),	one(0177770), "DsBw", m68000up },
+{"dbhi", 2,	one(0051310),	one(0177770), "DsBw", m68000up },
+{"dble", 2,	one(0057710),	one(0177770), "DsBw", m68000up },
+{"dbls", 2,	one(0051710),	one(0177770), "DsBw", m68000up },
+{"dblt", 2,	one(0056710),	one(0177770), "DsBw", m68000up },
+{"dbmi", 2,	one(0055710),	one(0177770), "DsBw", m68000up },
+{"dbne", 2,	one(0053310),	one(0177770), "DsBw", m68000up },
+{"dbpl", 2,	one(0055310),	one(0177770), "DsBw", m68000up },
+{"dbt", 2,	one(0050310),	one(0177770), "DsBw", m68000up },
+{"dbvc", 2,	one(0054310),	one(0177770), "DsBw", m68000up },
+{"dbvs", 2,	one(0054710),	one(0177770), "DsBw", m68000up },
 
-{"divsw",	one(0100700),	one(0170700), ";wDd", m68000up | mcf5206eup },
+{"divsw", 2,	one(0100700),	one(0170700), ";wDd", m68000up | mcfhwdiv },
 
-{"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),"qsDD",   mcf5206eup },
+{"divsl", 4, 	two(0046100,0006000),two(0177700,0107770),";lD3D1", m68020up|cpu32 },
+{"divsl", 4, 	two(0046100,0004000),two(0177700,0107770),";lDD",   m68020up|cpu32 },
+{"divsl", 4, 	two(0046100,0004000),two(0177700,0107770),"qsDD",   mcfhwdiv },
 
-{"divsll", two(0046100,0004000),two(0177700,0107770),";lD3D1",m68020up|cpu32 },
-{"divsll", two(0046100,0004000),two(0177700,0107770),";lDD",  m68020up|cpu32 },
+{"divsll", 4, 	two(0046100,0004000),two(0177700,0107770),";lD3D1",m68020up|cpu32 },
+{"divsll", 4, 	two(0046100,0004000),two(0177700,0107770),";lDD",  m68020up|cpu32 },
 
-{"divuw",	one(0100300),		one(0170700), ";wDd", m68000up | mcf5206eup },
+{"divuw", 2,	one(0100300),		one(0170700), ";wDd", m68000up | mcfhwdiv },
 
-{"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),"qsDD",   mcf5206eup },
+{"divul", 4,	two(0046100,0002000),two(0177700,0107770),";lD3D1", m68020up|cpu32 },
+{"divul", 4,	two(0046100,0000000),two(0177700,0107770),";lDD",   m68020up|cpu32 },
+{"divul", 4,	two(0046100,0000000),two(0177700,0107770),"qsDD",   mcfhwdiv },
 
-{"divull", two(0046100,0000000),two(0177700,0107770),";lD3D1",m68020up|cpu32 },
-{"divull", two(0046100,0000000),two(0177700,0107770),";lDD",  m68020up|cpu32 },
+{"divull", 4,	two(0046100,0000000),two(0177700,0107770),";lD3D1",m68020up|cpu32 },
+{"divull", 4,	two(0046100,0000000),two(0177700,0107770),";lDD",  m68020up|cpu32 },
 
-{"eorib",	one(0005000),	one(0177700), "#b$s", m68000up },
-{"eorib",	one(0005074),	one(0177777), "#bCs", m68000up },
-{"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", mcf },
-{"eori",	one(0005074),	one(0177777), "#bCs", m68000up },
-{"eori",	one(0005174),	one(0177777), "#wSs", m68000up },
-{"eori",	one(0005100),	one(0177700), "#w$s", m68000up },
+{"eorib", 4,	one(0005000),	one(0177700), "#b$s", m68000up },
+{"eorib", 4,	one(0005074),	one(0177777), "#bCs", m68000up },
+{"eoriw", 4,	one(0005100),	one(0177700), "#w$s", m68000up },
+{"eoriw", 4,	one(0005174),	one(0177777), "#wSs", m68000up },
+{"eoril", 6,	one(0005200),	one(0177700), "#l$s", m68000up },
+{"eoril", 6,	one(0005200),	one(0177700), "#lDs", mcfisa_a },
+{"eori", 4,	one(0005074),	one(0177777), "#bCs", m68000up },
+{"eori", 4,	one(0005174),	one(0177777), "#wSs", m68000up },
+{"eori", 4,	one(0005100),	one(0177700), "#w$s", m68000up },
 
 /* The eor opcode can generate the eori instruction.  */
-{"eorb",	one(0005000),	one(0177700), "#b$s", m68000up },
-{"eorb",	one(0005074),	one(0177777), "#bCs", m68000up },
-{"eorb",	one(0130400),	one(0170700), "Dd$s", m68000up },
-{"eorw",	one(0005100),	one(0177700), "#w$s", m68000up },
-{"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", 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 },
-{"eor",		one(0130500),	one(0170700), "Dd$s", m68000up },
+{"eorb", 4,	one(0005000),	one(0177700), "#b$s", m68000up },
+{"eorb", 4,	one(0005074),	one(0177777), "#bCs", m68000up },
+{"eorb", 2,	one(0130400),	one(0170700), "Dd$s", m68000up },
+{"eorw", 4,	one(0005100),	one(0177700), "#w$s", m68000up },
+{"eorw", 4,	one(0005174),	one(0177777), "#wSs", m68000up },
+{"eorw", 2,	one(0130500),	one(0170700), "Dd$s", m68000up },
+{"eorl", 6,	one(0005200),	one(0177700), "#l$s", m68000up },
+{"eorl", 6,	one(0005200),	one(0177700), "#lDs", mcfisa_a },
+{"eorl", 2,	one(0130600),	one(0170700), "Dd$s", m68000up | mcfisa_a },
+{"eor", 4,	one(0005074),	one(0177777), "#bCs", m68000up },
+{"eor", 4,	one(0005174),	one(0177777), "#wSs", m68000up },
+{"eor", 4,	one(0005100),	one(0177700), "#w$s", m68000up },
+{"eor", 2,	one(0130500),	one(0170700), "Dd$s", m68000up },
+		
+{"exg", 2,	one(0140500),	one(0170770), "DdDs", m68000up },
+{"exg", 2,	one(0140510),	one(0170770), "AdAs", m68000up },
+{"exg", 2,	one(0140610),	one(0170770), "DdAs", m68000up },
+{"exg", 2,	one(0140610),	one(0170770), "AsDd", m68000up },
 
-{"exg",		one(0140500),	one(0170770), "DdDs", m68000up },
-{"exg",		one(0140510),	one(0170770), "AdAs", m68000up },
-{"exg",		one(0140610),	one(0170770), "DdAs", m68000up },
-{"exg",		one(0140610),	one(0170770), "AsDd", m68000up },
+{"extw", 2,	one(0044200),	one(0177770), "Ds", m68000up|mcfisa_a },
+{"extl", 2,	one(0044300),	one(0177770), "Ds", m68000up|mcfisa_a },
+{"extbl", 2,	one(0044700),	one(0177770), "Ds", m68020up|cpu32|mcfisa_a },
 
-{"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 },
-
-{"ff1",   one(0002300), one(0177770), "Ds", mcf528x},
+{"ff1", 2,   	one(0002300), one(0177770), "Ds", mcfisa_aa},
 
 /* float stuff starts here */
 
-{"fabsb",	two(0xF000, 0x5818), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fabsb",	two(0xF000, 0x5818), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fabsd",	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fabsd",	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiFt", cfloat },
-{"fabsd",	two(0xF000, 0x5418), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fabsd",	two(0xF000, 0x5418), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fabsl",	two(0xF000, 0x4018), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fabsl",	two(0xF000, 0x4018), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fabsp",	two(0xF000, 0x4C18), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fabss",	two(0xF000, 0x4418), two(0xF1C0, 0xFC7F), "Ii;fF7", cfloat },
-{"fabss",	two(0xF000, 0x4418), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fabsw",	two(0xF000, 0x5018), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fabsw",	two(0xF000, 0x5018), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fabsx",	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fabsx",	two(0xF000, 0x4818), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fabsx",	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fabsb", 4,	two(0xF000, 0x5818), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fabsb", 4,	two(0xF000, 0x5818), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fabsd", 4,	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fabsd", 4,	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiFt", cfloat },
+{"fabsd", 4,	two(0xF000, 0x5418), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fabsd", 4,	two(0xF000, 0x5418), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fabsl", 4,	two(0xF000, 0x4018), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fabsl", 4,	two(0xF000, 0x4018), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fabsp", 4,	two(0xF000, 0x4C18), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fabss", 4,	two(0xF000, 0x4418), two(0xF1C0, 0xFC7F), "Ii;fF7", cfloat },
+{"fabss", 4,	two(0xF000, 0x4418), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fabsw", 4,	two(0xF000, 0x5018), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fabsw", 4,	two(0xF000, 0x5018), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fabsx", 4,	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fabsx", 4,	two(0xF000, 0x4818), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fabsx", 4,	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fsabsb",	two(0xF000, 0x5858), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fsabsb",	two(0xF000, 0x5858), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsabsd",	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fsabsd",	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiFt", cfloat },
-{"fsabsd",	two(0xF000, 0x5458), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fsabsd",	two(0xF000, 0x5458), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fsabsl",	two(0xF000, 0x4058), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fsabsl",	two(0xF000, 0x4058), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsabsp",	two(0xF000, 0x4C58), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fsabss",	two(0xF000, 0x4258), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsabss",	two(0xF000, 0x4458), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fsabsw",	two(0xF000, 0x5058), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fsabsw",	two(0xF000, 0x5058), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsabsx",	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fsabsx",	two(0xF000, 0x4858), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
-{"fsabsx",	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+{"fsabsb", 4,	two(0xF000, 0x5858), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsabsb", 4,	two(0xF000, 0x5858), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsabsd", 4,	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsabsd", 4,	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiFt", cfloat },
+{"fsabsd", 4,	two(0xF000, 0x5458), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsabsd", 4,	two(0xF000, 0x5458), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsabsl", 4,	two(0xF000, 0x4058), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsabsl", 4,	two(0xF000, 0x4058), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsabsp", 4,	two(0xF000, 0x4C58), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsabss", 4,	two(0xF000, 0x4258), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsabss", 4,	two(0xF000, 0x4458), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsabsw", 4,	two(0xF000, 0x5058), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsabsw", 4,	two(0xF000, 0x5058), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsabsx", 4,	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsabsx", 4,	two(0xF000, 0x4858), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fsabsx", 4,	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
 
-{"fdabsb",	two(0xF000, 0x585C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdabsb",	two(0xF000, 0x585c), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up},
-{"fdabsd",	two(0xF000, 0x005C), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fdabsd",	two(0xF000, 0x005C), two(0xF1C0, 0xE07F), "IiFt", cfloat },
-{"fdabsd",	two(0xF000, 0x545C), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fdabsd",	two(0xF000, 0x545c), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up},
-{"fdabsl",	two(0xF000, 0x405C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdabsl",	two(0xF000, 0x405c), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up},
-{"fdabsp",	two(0xF000, 0x4C5c), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up},
-{"fdabss",	two(0xF000, 0x425C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdabss",	two(0xF000, 0x445c), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up},
-{"fdabsw",	two(0xF000, 0x505C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdabsw",	two(0xF000, 0x505c), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up},
-{"fdabsx",	two(0xF000, 0x005c), two(0xF1C0, 0xE07F), "IiF8F7", m68040up},
-{"fdabsx",	two(0xF000, 0x485c), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up},
-{"fdabsx",	two(0xF000, 0x005c), two(0xF1C0, 0xE07F), "IiFt",   m68040up},
+{"fdabsb", 4,	two(0xF000, 0x585C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdabsb", 4,	two(0xF000, 0x585c), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up},
+{"fdabsd", 4,	two(0xF000, 0x005C), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdabsd", 4,	two(0xF000, 0x005C), two(0xF1C0, 0xE07F), "IiFt", cfloat },
+{"fdabsd", 4,	two(0xF000, 0x545C), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdabsd", 4,	two(0xF000, 0x545c), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up},
+{"fdabsl", 4,	two(0xF000, 0x405C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdabsl", 4,	two(0xF000, 0x405c), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up},
+{"fdabsp", 4,	two(0xF000, 0x4C5c), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up},
+{"fdabss", 4,	two(0xF000, 0x425C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdabss", 4,	two(0xF000, 0x445c), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up},
+{"fdabsw", 4,	two(0xF000, 0x505C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdabsw", 4,	two(0xF000, 0x505c), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up},
+{"fdabsx", 4,	two(0xF000, 0x005c), two(0xF1C0, 0xE07F), "IiF8F7", m68040up},
+{"fdabsx", 4,	two(0xF000, 0x485c), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up},
+{"fdabsx", 4,	two(0xF000, 0x005c), two(0xF1C0, 0xE07F), "IiFt",   m68040up},
 
-{"facosb",	two(0xF000, 0x581C), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"facosd",	two(0xF000, 0x541C), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"facosl",	two(0xF000, 0x401C), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"facosp",	two(0xF000, 0x4C1C), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"facoss",	two(0xF000, 0x441C), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"facosw",	two(0xF000, 0x501C), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"facosx",	two(0xF000, 0x001C), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"facosx",	two(0xF000, 0x481C), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"facosx",	two(0xF000, 0x001C), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"facosb", 4,	two(0xF000, 0x581C), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"facosd", 4,	two(0xF000, 0x541C), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"facosl", 4,	two(0xF000, 0x401C), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"facosp", 4,	two(0xF000, 0x4C1C), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"facoss", 4,	two(0xF000, 0x441C), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"facosw", 4,	two(0xF000, 0x501C), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"facosx", 4,	two(0xF000, 0x001C), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"facosx", 4,	two(0xF000, 0x481C), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"facosx", 4,	two(0xF000, 0x001C), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"faddb",	two(0xF000, 0x5822), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"faddb",	two(0xF000, 0x5822), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"faddd",	two(0xF000, 0x0022), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"faddd",	two(0xF000, 0x5422), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"faddd",	two(0xF000, 0x5422), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"faddd",	two(0xF000, 0x5422), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"faddl",	two(0xF000, 0x4022), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"faddl",	two(0xF000, 0x4022), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"faddp",	two(0xF000, 0x4C22), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fadds",	two(0xF000, 0x4422), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fadds",	two(0xF000, 0x4422), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"faddw",	two(0xF000, 0x5022), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"faddw",	two(0xF000, 0x5022), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"faddx",	two(0xF000, 0x0022), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"faddx",	two(0xF000, 0x4822), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"faddb", 4,	two(0xF000, 0x5822), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"faddb", 4,	two(0xF000, 0x5822), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"faddd", 4,	two(0xF000, 0x0022), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"faddd", 4,	two(0xF000, 0x5422), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"faddd", 4,	two(0xF000, 0x5422), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"faddd", 4,	two(0xF000, 0x5422), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"faddl", 4,	two(0xF000, 0x4022), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"faddl", 4,	two(0xF000, 0x4022), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"faddp", 4,	two(0xF000, 0x4C22), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fadds", 4,	two(0xF000, 0x4422), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fadds", 4,	two(0xF000, 0x4422), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"faddw", 4,	two(0xF000, 0x5022), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"faddw", 4,	two(0xF000, 0x5022), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"faddx", 4,	two(0xF000, 0x0022), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"faddx", 4,	two(0xF000, 0x4822), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
 
-{"fsaddb",	two(0xF000, 0x5862), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fsaddb",	two(0xF000, 0x5862), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsaddd",	two(0xF000, 0x0066), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fsaddd",	two(0xF000, 0x5462), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fsaddd",	two(0xF000, 0x5462), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fsaddl",	two(0xF000, 0x4062), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fsaddl",	two(0xF000, 0x4062), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsaddp",	two(0xF000, 0x4C62), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fsadds",	two(0xF000, 0x4462), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fsadds",	two(0xF000, 0x4862), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsaddw",	two(0xF000, 0x5062), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fsaddw",	two(0xF000, 0x5062), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsaddx",	two(0xF000, 0x0062), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fsaddx",	two(0xF000, 0x4862), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fsaddb", 4,	two(0xF000, 0x5862), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsaddb", 4,	two(0xF000, 0x5862), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsaddd", 4,	two(0xF000, 0x0066), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsaddd", 4,	two(0xF000, 0x5462), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsaddd", 4,	two(0xF000, 0x5462), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsaddl", 4,	two(0xF000, 0x4062), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsaddl", 4,	two(0xF000, 0x4062), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsaddp", 4,	two(0xF000, 0x4C62), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsadds", 4,	two(0xF000, 0x4462), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsadds", 4,	two(0xF000, 0x4862), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsaddw", 4,	two(0xF000, 0x5062), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsaddw", 4,	two(0xF000, 0x5062), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsaddx", 4,	two(0xF000, 0x0062), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsaddx", 4,	two(0xF000, 0x4862), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
 
-{"fdaddb",	two(0xF000, 0x5826), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdaddb",	two(0xF000, 0x5866), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fdaddd",	two(0xF000, 0x0066), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fdaddd",	two(0xF000, 0x5426), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdaddd",	two(0xF000, 0x5466), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fdaddl",	two(0xF000, 0x4026), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fdaddl",	two(0xF000, 0x4066), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fdaddp",	two(0xF000, 0x4C66), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fdadds",	two(0xF000, 0x4466), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fdadds",	two(0xF000, 0x4826), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdaddw",	two(0xF000, 0x5026), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdaddw",	two(0xF000, 0x5066), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fdaddx",	two(0xF000, 0x0066), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fdaddx",	two(0xF000, 0x4866), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fdaddb", 4,	two(0xF000, 0x5826), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdaddb", 4,	two(0xF000, 0x5866), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdaddd", 4,	two(0xF000, 0x0066), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdaddd", 4,	two(0xF000, 0x5426), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdaddd", 4,	two(0xF000, 0x5466), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdaddl", 4,	two(0xF000, 0x4026), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdaddl", 4,	two(0xF000, 0x4066), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdaddp", 4,	two(0xF000, 0x4C66), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdadds", 4,	two(0xF000, 0x4466), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdadds", 4,	two(0xF000, 0x4826), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdaddw", 4,	two(0xF000, 0x5026), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdaddw", 4,	two(0xF000, 0x5066), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdaddx", 4,	two(0xF000, 0x0066), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdaddx", 4,	two(0xF000, 0x4866), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
 
-{"fasinb",	two(0xF000, 0x580C), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fasind",	two(0xF000, 0x540C), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fasinl",	two(0xF000, 0x400C), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fasinp",	two(0xF000, 0x4C0C), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fasins",	two(0xF000, 0x440C), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fasinw",	two(0xF000, 0x500C), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fasinx",	two(0xF000, 0x000C), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fasinx",	two(0xF000, 0x480C), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fasinx",	two(0xF000, 0x000C), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fasinb", 4,	two(0xF000, 0x580C), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fasind", 4,	two(0xF000, 0x540C), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fasinl", 4,	two(0xF000, 0x400C), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fasinp", 4,	two(0xF000, 0x4C0C), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fasins", 4,	two(0xF000, 0x440C), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fasinw", 4,	two(0xF000, 0x500C), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fasinx", 4,	two(0xF000, 0x000C), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fasinx", 4,	two(0xF000, 0x480C), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fasinx", 4,	two(0xF000, 0x000C), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fatanb",	two(0xF000, 0x580A), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fatand",	two(0xF000, 0x540A), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fatanl",	two(0xF000, 0x400A), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fatanp",	two(0xF000, 0x4C0A), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fatans",	two(0xF000, 0x440A), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fatanw",	two(0xF000, 0x500A), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fatanx",	two(0xF000, 0x000A), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fatanx",	two(0xF000, 0x480A), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fatanx",	two(0xF000, 0x000A), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fatanb", 4,	two(0xF000, 0x580A), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fatand", 4,	two(0xF000, 0x540A), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fatanl", 4,	two(0xF000, 0x400A), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fatanp", 4,	two(0xF000, 0x4C0A), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fatans", 4,	two(0xF000, 0x440A), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fatanw", 4,	two(0xF000, 0x500A), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fatanx", 4,	two(0xF000, 0x000A), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fatanx", 4,	two(0xF000, 0x480A), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fatanx", 4,	two(0xF000, 0x000A), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fatanhb",	two(0xF000, 0x580D), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fatanhd",	two(0xF000, 0x540D), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fatanhl",	two(0xF000, 0x400D), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fatanhp",	two(0xF000, 0x4C0D), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fatanhs",	two(0xF000, 0x440D), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fatanhw",	two(0xF000, 0x500D), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fatanhx",	two(0xF000, 0x000D), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fatanhx",	two(0xF000, 0x480D), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fatanhx",	two(0xF000, 0x000D), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fatanhb", 4,	two(0xF000, 0x580D), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fatanhd", 4,	two(0xF000, 0x540D), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fatanhl", 4,	two(0xF000, 0x400D), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fatanhp", 4,	two(0xF000, 0x4C0D), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fatanhs", 4,	two(0xF000, 0x440D), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fatanhw", 4,	two(0xF000, 0x500D), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fatanhx", 4,	two(0xF000, 0x000D), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fatanhx", 4,	two(0xF000, 0x480D), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fatanhx", 4,	two(0xF000, 0x000D), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fbeq",	one(0xF081),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbf",		one(0xF080),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbge",	one(0xF093),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbgl",	one(0xF096),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbgle",	one(0xF097),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbgt",	one(0xF092),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fble",	one(0xF095),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fblt",	one(0xF094),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbne",	one(0xF08E),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbnge",	one(0xF09C),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbngl",	one(0xF099),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbngle",	one(0xF098),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbngt",	one(0xF09D),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbnle",	one(0xF09A),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbnlt",	one(0xF09B),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fboge",	one(0xF083),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbogl",	one(0xF086),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbogt",	one(0xF082),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbole",	one(0xF085),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbolt",	one(0xF084),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbor",	one(0xF087),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbseq",	one(0xF091),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbsf",	one(0xF090),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbsne",	one(0xF09E),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbst",	one(0xF09F),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbt",		one(0xF08F),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbueq",	one(0xF089),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbuge",	one(0xF08B),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbugt",	one(0xF08A),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbule",	one(0xF08D),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbult",	one(0xF08C),		one(0xF1FF), "IdBW", mfloat | cfloat },
-{"fbun",	one(0xF088),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbeq", 2,	one(0xF081),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbf", 2,	one(0xF080),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbge", 2,	one(0xF093),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbgl", 2,	one(0xF096),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbgle", 2,	one(0xF097),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbgt", 2,	one(0xF092),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fble", 2,	one(0xF095),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fblt", 2,	one(0xF094),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbne", 2,	one(0xF08E),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbnge", 2,	one(0xF09C),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbngl", 2,	one(0xF099),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbngle", 2,	one(0xF098),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbngt", 2,	one(0xF09D),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbnle", 2,	one(0xF09A),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbnlt", 2,	one(0xF09B),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fboge", 2,	one(0xF083),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbogl", 2,	one(0xF086),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbogt", 2,	one(0xF082),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbole", 2,	one(0xF085),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbolt", 2,	one(0xF084),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbor", 2,	one(0xF087),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbseq", 2,	one(0xF091),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbsf", 2,	one(0xF090),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbsne", 2,	one(0xF09E),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbst", 2,	one(0xF09F),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbt", 2,	one(0xF08F),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbueq", 2,	one(0xF089),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbuge", 2,	one(0xF08B),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbugt", 2,	one(0xF08A),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbule", 2,	one(0xF08D),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbult", 2,	one(0xF08C),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbun", 2,	one(0xF088),		one(0xF1FF), "IdBW", mfloat | cfloat },
 
-{"fbeql",	one(0xF0C1),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbfl",	one(0xF0C0),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbgel",	one(0xF0D3),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbgll",	one(0xF0D6),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbglel",	one(0xF0D7),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbgtl",	one(0xF0D2),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fblel",	one(0xF0D5),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbltl",	one(0xF0D4),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbnel",	one(0xF0CE),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbngel",	one(0xF0DC),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbngll",	one(0xF0D9),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbnglel",	one(0xF0D8),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbngtl",	one(0xF0DD),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbnlel",	one(0xF0DA),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbnltl",	one(0xF0DB),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbogel",	one(0xF0C3),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbogll",	one(0xF0C6),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbogtl",	one(0xF0C2),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbolel",	one(0xF0C5),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fboltl",	one(0xF0C4),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fborl",	one(0xF0C7),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbseql",	one(0xF0D1),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbsfl",	one(0xF0D0),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbsnel",	one(0xF0DE),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbstl",	one(0xF0DF),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbtl",	one(0xF0CF),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbueql",	one(0xF0C9),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbugel",	one(0xF0CB),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbugtl",	one(0xF0CA),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbulel",	one(0xF0CD),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbultl",	one(0xF0CC),		one(0xF1FF), "IdBC", mfloat | cfloat },
-{"fbunl",	one(0xF0C8),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbeql", 2,	one(0xF0C1),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbfl", 2,	one(0xF0C0),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbgel", 2,	one(0xF0D3),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbgll", 2,	one(0xF0D6),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbglel", 2,	one(0xF0D7),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbgtl", 2,	one(0xF0D2),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fblel", 2,	one(0xF0D5),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbltl", 2,	one(0xF0D4),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbnel", 2,	one(0xF0CE),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbngel", 2,	one(0xF0DC),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbngll", 2,	one(0xF0D9),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbnglel", 2,	one(0xF0D8),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbngtl", 2,	one(0xF0DD),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbnlel", 2,	one(0xF0DA),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbnltl", 2,	one(0xF0DB),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbogel", 2,	one(0xF0C3),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbogll", 2,	one(0xF0C6),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbogtl", 2,	one(0xF0C2),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbolel", 2,	one(0xF0C5),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fboltl", 2,	one(0xF0C4),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fborl", 2,	one(0xF0C7),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbseql", 2,	one(0xF0D1),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbsfl", 2,	one(0xF0D0),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbsnel", 2,	one(0xF0DE),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbstl", 2,	one(0xF0DF),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbtl", 2,	one(0xF0CF),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbueql", 2,	one(0xF0C9),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbugel", 2,	one(0xF0CB),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbugtl", 2,	one(0xF0CA),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbulel", 2,	one(0xF0CD),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbultl", 2,	one(0xF0CC),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbunl", 2,	one(0xF0C8),		one(0xF1FF), "IdBC", mfloat | cfloat },
 
-{"fjeq",	one(0xF081),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjf",		one(0xF080),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjge",	one(0xF093),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjgl",	one(0xF096),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjgle",	one(0xF097),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjgt",	one(0xF092),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjle",	one(0xF095),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjlt",	one(0xF094),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjne",	one(0xF08E),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjnge",	one(0xF09C),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjngl",	one(0xF099),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjngle",	one(0xF098),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjngt",	one(0xF09D),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjnle",	one(0xF09A),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjnlt",	one(0xF09B),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjoge",	one(0xF083),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjogl",	one(0xF086),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjogt",	one(0xF082),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjole",	one(0xF085),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjolt",	one(0xF084),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjor",	one(0xF087),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjseq",	one(0xF091),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjsf",	one(0xF090),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjsne",	one(0xF09E),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjst",	one(0xF09F),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjt",		one(0xF08F),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjueq",	one(0xF089),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjuge",	one(0xF08B),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjugt",	one(0xF08A),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjule",	one(0xF08D),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjult",	one(0xF08C),		one(0xF1BF), "IdBc", mfloat | cfloat },
-{"fjun",	one(0xF088),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjeq", 2,	one(0xF081),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjf", 2,	one(0xF080),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjge", 2,	one(0xF093),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjgl", 2,	one(0xF096),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjgle", 2,	one(0xF097),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjgt", 2,	one(0xF092),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjle", 2,	one(0xF095),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjlt", 2,	one(0xF094),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjne", 2,	one(0xF08E),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjnge", 2,	one(0xF09C),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjngl", 2,	one(0xF099),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjngle", 2,	one(0xF098),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjngt", 2,	one(0xF09D),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjnle", 2,	one(0xF09A),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjnlt", 2,	one(0xF09B),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjoge", 2,	one(0xF083),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjogl", 2,	one(0xF086),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjogt", 2,	one(0xF082),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjole", 2,	one(0xF085),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjolt", 2,	one(0xF084),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjor", 2,	one(0xF087),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjseq", 2,	one(0xF091),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjsf", 2,	one(0xF090),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjsne", 2,	one(0xF09E),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjst", 2,	one(0xF09F),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjt", 2,	one(0xF08F),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjueq", 2,	one(0xF089),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjuge", 2,	one(0xF08B),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjugt", 2,	one(0xF08A),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjule", 2,	one(0xF08D),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjult", 2,	one(0xF08C),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjun", 2,	one(0xF088),		one(0xF1BF), "IdBc", mfloat | cfloat },
 
-{"fcmpb",	two(0xF000, 0x5838), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fcmpb",	two(0xF000, 0x5838), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fcmpd",	two(0xF000, 0x5438), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fcmpd",	two(0xF000, 0x5438), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fcmpd",	two(0xF000, 0x0038), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fcmpl",	two(0xF000, 0x4038), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fcmpl",	two(0xF000, 0x4038), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fcmpp",	two(0xF000, 0x4C38), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fcmps",	two(0xF000, 0x4438), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fcmps",	two(0xF000, 0x4438), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fcmpw",	two(0xF000, 0x5038), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fcmpw",	two(0xF000, 0x5038), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fcmpx",	two(0xF000, 0x0038), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fcmpx",	two(0xF000, 0x4838), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fcmpb", 4,	two(0xF000, 0x5838), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fcmpb", 4,	two(0xF000, 0x5838), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fcmpd", 4,	two(0xF000, 0x5438), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fcmpd", 4,	two(0xF000, 0x5438), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fcmpd", 4,	two(0xF000, 0x0038), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fcmpl", 4,	two(0xF000, 0x4038), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fcmpl", 4,	two(0xF000, 0x4038), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fcmpp", 4,	two(0xF000, 0x4C38), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fcmps", 4,	two(0xF000, 0x4438), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fcmps", 4,	two(0xF000, 0x4438), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fcmpw", 4,	two(0xF000, 0x5038), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fcmpw", 4,	two(0xF000, 0x5038), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fcmpx", 4,	two(0xF000, 0x0038), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fcmpx", 4,	two(0xF000, 0x4838), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
 
-{"fcosb",	two(0xF000, 0x581D), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fcosd",	two(0xF000, 0x541D), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fcosl",	two(0xF000, 0x401D), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fcosp",	two(0xF000, 0x4C1D), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fcoss",	two(0xF000, 0x441D), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fcosw",	two(0xF000, 0x501D), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fcosx",	two(0xF000, 0x001D), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fcosx",	two(0xF000, 0x481D), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fcosx",	two(0xF000, 0x001D), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fcosb", 4,	two(0xF000, 0x581D), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fcosd", 4,	two(0xF000, 0x541D), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fcosl", 4,	two(0xF000, 0x401D), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fcosp", 4,	two(0xF000, 0x4C1D), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fcoss", 4,	two(0xF000, 0x441D), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fcosw", 4,	two(0xF000, 0x501D), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fcosx", 4,	two(0xF000, 0x001D), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fcosx", 4,	two(0xF000, 0x481D), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fcosx", 4,	two(0xF000, 0x001D), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fcoshb",	two(0xF000, 0x5819), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fcoshd",	two(0xF000, 0x5419), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fcoshl",	two(0xF000, 0x4019), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fcoshp",	two(0xF000, 0x4C19), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fcoshs",	two(0xF000, 0x4419), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fcoshw",	two(0xF000, 0x5019), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fcoshx",	two(0xF000, 0x0019), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fcoshx",	two(0xF000, 0x4819), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fcoshx",	two(0xF000, 0x0019), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fcoshb", 4,	two(0xF000, 0x5819), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fcoshd", 4,	two(0xF000, 0x5419), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fcoshl", 4,	two(0xF000, 0x4019), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fcoshp", 4,	two(0xF000, 0x4C19), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fcoshs", 4,	two(0xF000, 0x4419), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fcoshw", 4,	two(0xF000, 0x5019), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fcoshx", 4,	two(0xF000, 0x0019), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fcoshx", 4,	two(0xF000, 0x4819), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fcoshx", 4,	two(0xF000, 0x0019), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fdbeq",	two(0xF048, 0x0001), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbf",	two(0xF048, 0x0000), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbge",	two(0xF048, 0x0013), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbgl",	two(0xF048, 0x0016), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbgle",	two(0xF048, 0x0017), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbgt",	two(0xF048, 0x0012), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdble",	two(0xF048, 0x0015), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdblt",	two(0xF048, 0x0014), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbne",	two(0xF048, 0x000E), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbnge",	two(0xF048, 0x001C), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbngl",	two(0xF048, 0x0019), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbngle",	two(0xF048, 0x0018), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbngt",	two(0xF048, 0x001D), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbnle",	two(0xF048, 0x001A), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbnlt",	two(0xF048, 0x001B), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdboge",	two(0xF048, 0x0003), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbogl",	two(0xF048, 0x0006), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbogt",	two(0xF048, 0x0002), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbole",	two(0xF048, 0x0005), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbolt",	two(0xF048, 0x0004), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbor",	two(0xF048, 0x0007), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbseq",	two(0xF048, 0x0011), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbsf",	two(0xF048, 0x0010), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbsne",	two(0xF048, 0x001E), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbst",	two(0xF048, 0x001F), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbt",	two(0xF048, 0x000F), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbueq",	two(0xF048, 0x0009), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbuge",	two(0xF048, 0x000B), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbugt",	two(0xF048, 0x000A), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbule",	two(0xF048, 0x000D), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbult",	two(0xF048, 0x000C), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
-{"fdbun",	two(0xF048, 0x0008), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbeq", 4,	two(0xF048, 0x0001), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbf", 4,	two(0xF048, 0x0000), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbge", 4,	two(0xF048, 0x0013), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbgl", 4,	two(0xF048, 0x0016), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbgle", 4,	two(0xF048, 0x0017), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbgt", 4,	two(0xF048, 0x0012), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdble", 4,	two(0xF048, 0x0015), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdblt", 4,	two(0xF048, 0x0014), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbne", 4,	two(0xF048, 0x000E), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbnge", 4,	two(0xF048, 0x001C), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbngl", 4,	two(0xF048, 0x0019), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbngle", 4,	two(0xF048, 0x0018), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbngt", 4,	two(0xF048, 0x001D), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbnle", 4,	two(0xF048, 0x001A), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbnlt", 4,	two(0xF048, 0x001B), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdboge", 4,	two(0xF048, 0x0003), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbogl", 4,	two(0xF048, 0x0006), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbogt", 4,	two(0xF048, 0x0002), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbole", 4,	two(0xF048, 0x0005), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbolt", 4,	two(0xF048, 0x0004), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbor", 4,	two(0xF048, 0x0007), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbseq", 4,	two(0xF048, 0x0011), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbsf", 4,	two(0xF048, 0x0010), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbsne", 4,	two(0xF048, 0x001E), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbst", 4,	two(0xF048, 0x001F), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbt", 4,	two(0xF048, 0x000F), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbueq", 4,	two(0xF048, 0x0009), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbuge", 4,	two(0xF048, 0x000B), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbugt", 4,	two(0xF048, 0x000A), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbule", 4,	two(0xF048, 0x000D), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbult", 4,	two(0xF048, 0x000C), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbun", 4,	two(0xF048, 0x0008), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
 
-{"fdivb",	two(0xF000, 0x5820), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fdivb",	two(0xF000, 0x5820), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdivd",	two(0xF000, 0x0020), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fdivd",	two(0xF000, 0x5420), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fdivd",	two(0xF000, 0x5420), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fdivl",	two(0xF000, 0x4020), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fdivl",	two(0xF000, 0x4020), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdivp",	two(0xF000, 0x4C20), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fdivs",	two(0xF000, 0x4420), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fdivs",	two(0xF000, 0x4420), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdivw",	two(0xF000, 0x5020), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fdivw",	two(0xF000, 0x5020), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdivx",	two(0xF000, 0x0020), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fdivx",	two(0xF000, 0x4820), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fdivb", 4,	two(0xF000, 0x5820), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fdivb", 4,	two(0xF000, 0x5820), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdivd", 4,	two(0xF000, 0x0020), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdivd", 4,	two(0xF000, 0x5420), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fdivd", 4,	two(0xF000, 0x5420), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdivl", 4,	two(0xF000, 0x4020), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fdivl", 4,	two(0xF000, 0x4020), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdivp", 4,	two(0xF000, 0x4C20), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fdivs", 4,	two(0xF000, 0x4420), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fdivs", 4,	two(0xF000, 0x4420), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdivw", 4,	two(0xF000, 0x5020), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fdivw", 4,	two(0xF000, 0x5020), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdivx", 4,	two(0xF000, 0x0020), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fdivx", 4,	two(0xF000, 0x4820), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
 
-{"fsdivb",	two(0xF000, 0x5860), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fsdivb",	two(0xF000, 0x5860), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsdivd",	two(0xF000, 0x0060), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fsdivd",	two(0xF000, 0x5460), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fsdivd",	two(0xF000, 0x5460), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fsdivl",	two(0xF000, 0x4060), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fsdivl",	two(0xF000, 0x4060), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsdivp",	two(0xF000, 0x4C60), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fsdivs",	two(0xF000, 0x4460), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fsdivs",	two(0xF000, 0x4460), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsdivw",	two(0xF000, 0x5060), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fsdivw",	two(0xF000, 0x5060), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsdivx",	two(0xF000, 0x0060), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fsdivx",	two(0xF000, 0x4860), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fsdivb", 4,	two(0xF000, 0x5860), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsdivb", 4,	two(0xF000, 0x5860), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsdivd", 4,	two(0xF000, 0x0060), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsdivd", 4,	two(0xF000, 0x5460), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsdivd", 4,	two(0xF000, 0x5460), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsdivl", 4,	two(0xF000, 0x4060), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsdivl", 4,	two(0xF000, 0x4060), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsdivp", 4,	two(0xF000, 0x4C60), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsdivs", 4,	two(0xF000, 0x4460), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsdivs", 4,	two(0xF000, 0x4460), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsdivw", 4,	two(0xF000, 0x5060), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsdivw", 4,	two(0xF000, 0x5060), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsdivx", 4,	two(0xF000, 0x0060), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsdivx", 4,	two(0xF000, 0x4860), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
 
-{"fddivb",	two(0xF000, 0x5864), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fddivb",	two(0xF000, 0x5864), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fddivd",	two(0xF000, 0x0064), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fddivd",	two(0xF000, 0x5464), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fddivd",	two(0xF000, 0x5464), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fddivl",	two(0xF000, 0x4064), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fddivl",	two(0xF000, 0x4064), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fddivp",	two(0xF000, 0x4C64), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fddivs",	two(0xF000, 0x4464), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fddivs",	two(0xF000, 0x4464), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fddivw",	two(0xF000, 0x5064), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fddivw",	two(0xF000, 0x5064), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fddivx",	two(0xF000, 0x0064), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fddivx",	two(0xF000, 0x4864), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fddivb", 4,	two(0xF000, 0x5864), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fddivb", 4,	two(0xF000, 0x5864), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fddivd", 4,	two(0xF000, 0x0064), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fddivd", 4,	two(0xF000, 0x5464), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fddivd", 4,	two(0xF000, 0x5464), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fddivl", 4,	two(0xF000, 0x4064), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fddivl", 4,	two(0xF000, 0x4064), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fddivp", 4,	two(0xF000, 0x4C64), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fddivs", 4,	two(0xF000, 0x4464), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fddivs", 4,	two(0xF000, 0x4464), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fddivw", 4,	two(0xF000, 0x5064), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fddivw", 4,	two(0xF000, 0x5064), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fddivx", 4,	two(0xF000, 0x0064), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fddivx", 4,	two(0xF000, 0x4864), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
 
-{"fetoxb",	two(0xF000, 0x5810), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fetoxd",	two(0xF000, 0x5410), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fetoxl",	two(0xF000, 0x4010), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fetoxp",	two(0xF000, 0x4C10), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fetoxs",	two(0xF000, 0x4410), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fetoxw",	two(0xF000, 0x5010), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fetoxx",	two(0xF000, 0x0010), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fetoxx",	two(0xF000, 0x4810), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fetoxx",	two(0xF000, 0x0010), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fetoxb", 4,	two(0xF000, 0x5810), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fetoxd", 4,	two(0xF000, 0x5410), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fetoxl", 4,	two(0xF000, 0x4010), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fetoxp", 4,	two(0xF000, 0x4C10), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fetoxs", 4,	two(0xF000, 0x4410), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fetoxw", 4,	two(0xF000, 0x5010), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fetoxx", 4,	two(0xF000, 0x0010), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fetoxx", 4,	two(0xF000, 0x4810), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fetoxx", 4,	two(0xF000, 0x0010), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fetoxm1b",	two(0xF000, 0x5808), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fetoxm1d",	two(0xF000, 0x5408), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fetoxm1l",	two(0xF000, 0x4008), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fetoxm1p",	two(0xF000, 0x4C08), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fetoxm1s",	two(0xF000, 0x4408), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fetoxm1w",	two(0xF000, 0x5008), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fetoxm1x",	two(0xF000, 0x0008), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fetoxm1x",	two(0xF000, 0x4808), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fetoxm1x",	two(0xF000, 0x0008), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fetoxm1b", 4,	two(0xF000, 0x5808), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fetoxm1d", 4,	two(0xF000, 0x5408), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fetoxm1l", 4,	two(0xF000, 0x4008), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fetoxm1p", 4,	two(0xF000, 0x4C08), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fetoxm1s", 4,	two(0xF000, 0x4408), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fetoxm1w", 4,	two(0xF000, 0x5008), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fetoxm1x", 4,	two(0xF000, 0x0008), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fetoxm1x", 4,	two(0xF000, 0x4808), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fetoxm1x", 4,	two(0xF000, 0x0008), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fgetexpb",	two(0xF000, 0x581E), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fgetexpd",	two(0xF000, 0x541E), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fgetexpl",	two(0xF000, 0x401E), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fgetexpp",	two(0xF000, 0x4C1E), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fgetexps",	two(0xF000, 0x441E), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fgetexpw",	two(0xF000, 0x501E), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fgetexpx",	two(0xF000, 0x001E), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fgetexpx",	two(0xF000, 0x481E), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fgetexpx",	two(0xF000, 0x001E), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fgetexpb", 4,	two(0xF000, 0x581E), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fgetexpd", 4,	two(0xF000, 0x541E), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fgetexpl", 4,	two(0xF000, 0x401E), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fgetexpp", 4,	two(0xF000, 0x4C1E), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fgetexps", 4,	two(0xF000, 0x441E), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fgetexpw", 4,	two(0xF000, 0x501E), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fgetexpx", 4,	two(0xF000, 0x001E), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fgetexpx", 4,	two(0xF000, 0x481E), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fgetexpx", 4,	two(0xF000, 0x001E), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fgetmanb",	two(0xF000, 0x581F), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fgetmand",	two(0xF000, 0x541F), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fgetmanl",	two(0xF000, 0x401F), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fgetmanp",	two(0xF000, 0x4C1F), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fgetmans",	two(0xF000, 0x441F), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fgetmanw",	two(0xF000, 0x501F), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fgetmanx",	two(0xF000, 0x001F), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fgetmanx",	two(0xF000, 0x481F), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fgetmanx",	two(0xF000, 0x001F), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fgetmanb", 4,	two(0xF000, 0x581F), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fgetmand", 4,	two(0xF000, 0x541F), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fgetmanl", 4,	two(0xF000, 0x401F), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fgetmanp", 4,	two(0xF000, 0x4C1F), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fgetmans", 4,	two(0xF000, 0x441F), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fgetmanw", 4,	two(0xF000, 0x501F), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fgetmanx", 4,	two(0xF000, 0x001F), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fgetmanx", 4,	two(0xF000, 0x481F), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fgetmanx", 4,	two(0xF000, 0x001F), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fintb",	two(0xF000, 0x5801), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fintb",	two(0xF000, 0x5801), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fintd",	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fintd",	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiFt", cfloat },
-{"fintd",	two(0xF000, 0x5401), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fintd",	two(0xF000, 0x5401), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fintl",	two(0xF000, 0x4001), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fintl",	two(0xF000, 0x4001), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fintp",	two(0xF000, 0x4C01), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fints",	two(0xF000, 0x4401), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fints",	two(0xF000, 0x4401), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fintw",	two(0xF000, 0x5001), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fintw",	two(0xF000, 0x5001), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fintx",	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fintx",	two(0xF000, 0x4801), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fintx",	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fintb", 4,	two(0xF000, 0x5801), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fintb", 4,	two(0xF000, 0x5801), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintd", 4,	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fintd", 4,	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiFt", cfloat },
+{"fintd", 4,	two(0xF000, 0x5401), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fintd", 4,	two(0xF000, 0x5401), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fintl", 4,	two(0xF000, 0x4001), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fintl", 4,	two(0xF000, 0x4001), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintp", 4,	two(0xF000, 0x4C01), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fints", 4,	two(0xF000, 0x4401), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fints", 4,	two(0xF000, 0x4401), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintw", 4,	two(0xF000, 0x5001), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fintw", 4,	two(0xF000, 0x5001), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintx", 4,	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fintx", 4,	two(0xF000, 0x4801), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fintx", 4,	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fintrzb",	two(0xF000, 0x5803), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fintrzb",	two(0xF000, 0x5803), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fintrzd",	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fintrzd",	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
-{"fintrzd",	two(0xF000, 0x5403), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fintrzd",	two(0xF000, 0x5403), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fintrzl",	two(0xF000, 0x4003), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fintrzl",	two(0xF000, 0x4003), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fintrzp",	two(0xF000, 0x4C03), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fintrzs",	two(0xF000, 0x4403), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fintrzs",	two(0xF000, 0x4403), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fintrzw",	two(0xF000, 0x5003), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fintrzw",	two(0xF000, 0x5003), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fintrzx",	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fintrzx",	two(0xF000, 0x4803), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fintrzx",	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fintrzb", 4,	two(0xF000, 0x5803), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fintrzb", 4,	two(0xF000, 0x5803), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintrzd", 4,	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fintrzd", 4,	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fintrzd", 4,	two(0xF000, 0x5403), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fintrzd", 4,	two(0xF000, 0x5403), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fintrzl", 4,	two(0xF000, 0x4003), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fintrzl", 4,	two(0xF000, 0x4003), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintrzp", 4,	two(0xF000, 0x4C03), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fintrzs", 4,	two(0xF000, 0x4403), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fintrzs", 4,	two(0xF000, 0x4403), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintrzw", 4,	two(0xF000, 0x5003), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fintrzw", 4,	two(0xF000, 0x5003), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintrzx", 4,	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fintrzx", 4,	two(0xF000, 0x4803), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fintrzx", 4,	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"flog10b",	two(0xF000, 0x5815), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"flog10d",	two(0xF000, 0x5415), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"flog10l",	two(0xF000, 0x4015), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"flog10p",	two(0xF000, 0x4C15), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"flog10s",	two(0xF000, 0x4415), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"flog10w",	two(0xF000, 0x5015), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"flog10x",	two(0xF000, 0x0015), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"flog10x",	two(0xF000, 0x4815), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"flog10x",	two(0xF000, 0x0015), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"flog10b", 4,	two(0xF000, 0x5815), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"flog10d", 4,	two(0xF000, 0x5415), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"flog10l", 4,	two(0xF000, 0x4015), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"flog10p", 4,	two(0xF000, 0x4C15), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"flog10s", 4,	two(0xF000, 0x4415), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"flog10w", 4,	two(0xF000, 0x5015), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"flog10x", 4,	two(0xF000, 0x0015), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"flog10x", 4,	two(0xF000, 0x4815), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"flog10x", 4,	two(0xF000, 0x0015), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"flog2b",	two(0xF000, 0x5816), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"flog2d",	two(0xF000, 0x5416), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"flog2l",	two(0xF000, 0x4016), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"flog2p",	two(0xF000, 0x4C16), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"flog2s",	two(0xF000, 0x4416), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"flog2w",	two(0xF000, 0x5016), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"flog2x",	two(0xF000, 0x0016), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"flog2x",	two(0xF000, 0x4816), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"flog2x",	two(0xF000, 0x0016), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"flog2b", 4,	two(0xF000, 0x5816), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"flog2d", 4,	two(0xF000, 0x5416), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"flog2l", 4,	two(0xF000, 0x4016), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"flog2p", 4,	two(0xF000, 0x4C16), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"flog2s", 4,	two(0xF000, 0x4416), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"flog2w", 4,	two(0xF000, 0x5016), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"flog2x", 4,	two(0xF000, 0x0016), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"flog2x", 4,	two(0xF000, 0x4816), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"flog2x", 4,	two(0xF000, 0x0016), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"flognb",	two(0xF000, 0x5814), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"flognd",	two(0xF000, 0x5414), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"flognl",	two(0xF000, 0x4014), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"flognp",	two(0xF000, 0x4C14), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"flogns",	two(0xF000, 0x4414), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"flognw",	two(0xF000, 0x5014), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"flognx",	two(0xF000, 0x0014), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"flognx",	two(0xF000, 0x4814), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"flognx",	two(0xF000, 0x0014), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"flognb", 4,	two(0xF000, 0x5814), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"flognd", 4,	two(0xF000, 0x5414), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"flognl", 4,	two(0xF000, 0x4014), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"flognp", 4,	two(0xF000, 0x4C14), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"flogns", 4,	two(0xF000, 0x4414), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"flognw", 4,	two(0xF000, 0x5014), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"flognx", 4,	two(0xF000, 0x0014), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"flognx", 4,	two(0xF000, 0x4814), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"flognx", 4,	two(0xF000, 0x0014), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"flognp1b",	two(0xF000, 0x5806), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"flognp1d",	two(0xF000, 0x5406), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"flognp1l",	two(0xF000, 0x4006), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"flognp1p",	two(0xF000, 0x4C06), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"flognp1s",	two(0xF000, 0x4406), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"flognp1w",	two(0xF000, 0x5006), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"flognp1x",	two(0xF000, 0x0006), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"flognp1x",	two(0xF000, 0x4806), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"flognp1x",	two(0xF000, 0x0006), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"flognp1b", 4,	two(0xF000, 0x5806), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"flognp1d", 4,	two(0xF000, 0x5406), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"flognp1l", 4,	two(0xF000, 0x4006), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"flognp1p", 4,	two(0xF000, 0x4C06), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"flognp1s", 4,	two(0xF000, 0x4406), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"flognp1w", 4,	two(0xF000, 0x5006), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"flognp1x", 4,	two(0xF000, 0x0006), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"flognp1x", 4,	two(0xF000, 0x4806), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"flognp1x", 4,	two(0xF000, 0x0006), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fmodb",	two(0xF000, 0x5821), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fmodd",	two(0xF000, 0x5421), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fmodl",	two(0xF000, 0x4021), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fmodp",	two(0xF000, 0x4C21), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fmods",	two(0xF000, 0x4421), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fmodw",	two(0xF000, 0x5021), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fmodx",	two(0xF000, 0x0021), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fmodx",	two(0xF000, 0x4821), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fmodb", 4,	two(0xF000, 0x5821), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fmodd", 4,	two(0xF000, 0x5421), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fmodl", 4,	two(0xF000, 0x4021), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fmodp", 4,	two(0xF000, 0x4C21), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fmods", 4,	two(0xF000, 0x4421), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fmodw", 4,	two(0xF000, 0x5021), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fmodx", 4,	two(0xF000, 0x0021), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fmodx", 4,	two(0xF000, 0x4821), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
 
-{"fmoveb",	two(0xF000, 0x5800), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fmoveb",	two(0xF000, 0x7800), two(0xF1C0, 0xFC7F), "IiF7bs", cfloat },
-{"fmoveb",	two(0xF000, 0x5800), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fmoveb",	two(0xF000, 0x7800), two(0xF1C0, 0xFC7F), "IiF7$b", mfloat },
-{"fmoved",	two(0xF000, 0x5400), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fmoved",	two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7~F", mfloat },
-{"fmoved",	two(0xF000, 0x0000), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fmoved",	two(0xF000, 0x5400), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fmoved",	two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7ws", cfloat },
-{"fmovel",	two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fmovel",	two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7$l", mfloat },
+{"fmoveb", 4,	two(0xF000, 0x5800), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmoveb", 4,	two(0xF000, 0x7800), two(0xF1C0, 0xFC7F), "IiF7bs", cfloat },
+{"fmoveb", 4,	two(0xF000, 0x5800), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fmoveb", 4,	two(0xF000, 0x7800), two(0xF1C0, 0xFC7F), "IiF7$b", mfloat },
+{"fmoved", 4,	two(0xF000, 0x5400), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fmoved", 4,	two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7~F", mfloat },
+{"fmoved", 4,	two(0xF000, 0x0000), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fmoved", 4,	two(0xF000, 0x5400), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fmoved", 4,	two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7ws", cfloat },
+{"fmovel", 4,	two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fmovel", 4,	two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7$l", mfloat },
 /* FIXME: the next two variants should not permit moving an address
    register to anything but the floating point instruction register.  */
-{"fmovel",	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
-{"fmovel",	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ls8", mfloat },
-{"fmovel",	two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fmovel",	two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7bs", cfloat },
-  /* Move the FP control registers */
-{"fmovel",	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8ps", cfloat },
-{"fmovel",	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Iibss8", cfloat },
-{"fmovep",	two(0xF000, 0x4C00), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fmovep",	two(0xF000, 0x6C00), two(0xF1C0, 0xFC00), "IiF7~pkC", mfloat },
-{"fmovep",	two(0xF000, 0x7C00), two(0xF1C0, 0xFC0F), "IiF7~pDk", mfloat },
-{"fmoves",	two(0xF000, 0x4400), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fmoves",	two(0xF000, 0x6400), two(0xF1C0, 0xFC7F), "IiF7$f", mfloat },
-{"fmoves",	two(0xF000, 0x4400), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fmoves",	two(0xF000, 0x6400), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fmovew",	two(0xF000, 0x5000), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fmovew",	two(0xF000, 0x7000), two(0xF1C0, 0xFC7F), "IiF7$w", mfloat },
-{"fmovew",	two(0xF000, 0x5000), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fmovew",	two(0xF000, 0x7000), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fmovex",	two(0xF000, 0x0000), two(0xF1FF, 0xE07F), "IiF8F7", mfloat },
-{"fmovex",	two(0xF000, 0x4800), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fmovex",	two(0xF000, 0x6800), two(0xF1C0, 0xFC7F), "IiF7~x", mfloat },
+{"fmovel", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
+{"fmovel", 4,	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ls8", mfloat },
+{"fmovel", 4,	two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmovel", 4,	two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7bs", cfloat },
+  /* Move the FP control registers.  */
+{"fmovel", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8ps", cfloat },
+{"fmovel", 4,	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Iibss8", cfloat },
+{"fmovep", 4,	two(0xF000, 0x4C00), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fmovep", 4,	two(0xF000, 0x6C00), two(0xF1C0, 0xFC00), "IiF7~pkC", mfloat },
+{"fmovep", 4,	two(0xF000, 0x7C00), two(0xF1C0, 0xFC0F), "IiF7~pDk", mfloat },
+{"fmoves", 4,	two(0xF000, 0x4400), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fmoves", 4,	two(0xF000, 0x6400), two(0xF1C0, 0xFC7F), "IiF7$f", mfloat },
+{"fmoves", 4,	two(0xF000, 0x4400), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmoves", 4,	two(0xF000, 0x6400), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fmovew", 4,	two(0xF000, 0x5000), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fmovew", 4,	two(0xF000, 0x7000), two(0xF1C0, 0xFC7F), "IiF7$w", mfloat },
+{"fmovew", 4,	two(0xF000, 0x5000), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmovew", 4,	two(0xF000, 0x7000), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fmovex", 4,	two(0xF000, 0x0000), two(0xF1FF, 0xE07F), "IiF8F7", mfloat },
+{"fmovex", 4,	two(0xF000, 0x4800), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fmovex", 4,	two(0xF000, 0x6800), two(0xF1C0, 0xFC7F), "IiF7~x", mfloat },
 
-{"fsmoveb",	two(0xF000, 0x5840), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fsmoveb",	two(0xF000, 0x5840), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsmoveb",	two(0xF000, 0x7840), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fsmoved",	two(0xF000, 0x0040), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fsmoved",	two(0xF000, 0x5440), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fsmoved",	two(0xF000, 0x5440), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fsmoved",	two(0xF000, 0x7440), two(0xF1C0, 0xFC7F), "IiF7ws", cfloat },
-{"fsmovel",	two(0xF000, 0x4040), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fsmovel",	two(0xF000, 0x4040), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsmovel",	two(0xF000, 0x6040), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fsmoves",	two(0xF000, 0x4440), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fsmoves",	two(0xF000, 0x4440), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsmoves",	two(0xF000, 0x6440), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fsmovew",	two(0xF000, 0x5040), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fsmovew",	two(0xF000, 0x5040), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsmovew",	two(0xF000, 0x7040), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fsmovex",	two(0xF000, 0x0040), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fsmovex",	two(0xF000, 0x4840), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
-{"fsmovep",	two(0xF000, 0x4C40), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsmoveb", 4,	two(0xF000, 0x5840), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsmoveb", 4,	two(0xF000, 0x5840), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmoveb", 4,	two(0xF000, 0x7840), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fsmoved", 4,	two(0xF000, 0x0040), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsmoved", 4,	two(0xF000, 0x5440), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsmoved", 4,	two(0xF000, 0x5440), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsmoved", 4,	two(0xF000, 0x7440), two(0xF1C0, 0xFC7F), "IiF7ws", cfloat },
+{"fsmovel", 4,	two(0xF000, 0x4040), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsmovel", 4,	two(0xF000, 0x4040), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmovel", 4,	two(0xF000, 0x6040), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fsmoves", 4,	two(0xF000, 0x4440), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsmoves", 4,	two(0xF000, 0x4440), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmoves", 4,	two(0xF000, 0x6440), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fsmovew", 4,	two(0xF000, 0x5040), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsmovew", 4,	two(0xF000, 0x5040), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmovew", 4,	two(0xF000, 0x7040), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fsmovex", 4,	two(0xF000, 0x0040), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsmovex", 4,	two(0xF000, 0x4840), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fsmovep", 4,	two(0xF000, 0x4C40), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
 
-{"fdmoveb",	two(0xF000, 0x5844), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fdmoveb",	two(0xF000, 0x5844), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdmoveb",	two(0xF000, 0x7844), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fdmoved",	two(0xF000, 0x0044), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fdmoved",	two(0xF000, 0x5444), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fdmoved",	two(0xF000, 0x5444), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fdmoved",	two(0xF000, 0x7444), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fdmovel",	two(0xF000, 0x4044), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fdmovel",	two(0xF000, 0x4044), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdmovel",	two(0xF000, 0x6044), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fdmoves",	two(0xF000, 0x4444), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fdmoves",	two(0xF000, 0x4444), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdmoves",	two(0xF000, 0x6444), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fdmovew",	two(0xF000, 0x5044), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fdmovew",	two(0xF000, 0x5044), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdmovew",	two(0xF000, 0x7044), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
-{"fdmovex",	two(0xF000, 0x0044), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fdmovex",	two(0xF000, 0x4844), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
-{"fdmovep",	two(0xF000, 0x4C44), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdmoveb", 4,	two(0xF000, 0x5844), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdmoveb", 4,	two(0xF000, 0x5844), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmoveb", 4,	two(0xF000, 0x7844), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fdmoved", 4,	two(0xF000, 0x0044), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdmoved", 4,	two(0xF000, 0x5444), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdmoved", 4,	two(0xF000, 0x5444), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdmoved", 4,	two(0xF000, 0x7444), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fdmovel", 4,	two(0xF000, 0x4044), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdmovel", 4,	two(0xF000, 0x4044), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmovel", 4,	two(0xF000, 0x6044), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fdmoves", 4,	two(0xF000, 0x4444), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdmoves", 4,	two(0xF000, 0x4444), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmoves", 4,	two(0xF000, 0x6444), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fdmovew", 4,	two(0xF000, 0x5044), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdmovew", 4,	two(0xF000, 0x5044), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmovew", 4,	two(0xF000, 0x7044), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fdmovex", 4,	two(0xF000, 0x0044), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdmovex", 4,	two(0xF000, 0x4844), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fdmovep", 4,	two(0xF000, 0x4C44), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
 
-{"fmovecrx",	two(0xF000, 0x5C00), two(0xF1FF, 0xFC00), "Ii#CF7", mfloat },
+{"fmovecrx", 4,	two(0xF000, 0x5C00), two(0xF1FF, 0xFC00), "Ii#CF7", mfloat },
 
-{"fmovemd",	two(0xF000, 0xD000), two(0xFFC0, 0xFF00), "Iizsl3", cfloat },
-{"fmovemd",	two(0xF000, 0xD000), two(0xFFC0, 0xFF00), "Iizs#3", cfloat },
-{"fmovemd",	two(0xF000, 0xF000), two(0xFFC0, 0xFF00), "Ii#3ys", cfloat },
-{"fmovemd",	two(0xF000, 0xF000), two(0xFFC0, 0xFF00), "Iil3ys", cfloat },
+{"fmovemd", 4,	two(0xF000, 0xD000), two(0xFFC0, 0xFF00), "Iizsl3", cfloat },
+{"fmovemd", 4,	two(0xF000, 0xD000), two(0xFFC0, 0xFF00), "Iizs#3", cfloat },
+{"fmovemd", 4,	two(0xF000, 0xF000), two(0xFFC0, 0xFF00), "Ii#3ys", cfloat },
+{"fmovemd", 4,	two(0xF000, 0xF000), two(0xFFC0, 0xFF00), "Iil3ys", cfloat },
 
-{"fmovemx",	two(0xF000, 0xF800), two(0xF1C0, 0xFF8F), "IiDk&s", mfloat },
-{"fmovemx",	two(0xF020, 0xE800), two(0xF1F8, 0xFF8F), "IiDk-s", mfloat },
-{"fmovemx",	two(0xF000, 0xD800), two(0xF1C0, 0xFF8F), "Ii&sDk", mfloat },
-{"fmovemx",	two(0xF018, 0xD800), two(0xF1F8, 0xFF8F), "Ii+sDk", mfloat },
-{"fmovemx",	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Idl3&s", mfloat },
-{"fmovemx",	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Id#3&s", mfloat },
-{"fmovemx",	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&sl3", mfloat },
-{"fmovemx",	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&s#3", mfloat },
-{"fmovemx",	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "IdL3-s", mfloat },
-{"fmovemx",	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "Id#3-s", mfloat },
-{"fmovemx",	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+sl3", mfloat },
-{"fmovemx",	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+s#3", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xF800), two(0xF1C0, 0xFF8F), "IiDk&s", mfloat },
+{"fmovemx", 4,	two(0xF020, 0xE800), two(0xF1F8, 0xFF8F), "IiDk-s", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xD800), two(0xF1C0, 0xFF8F), "Ii&sDk", mfloat },
+{"fmovemx", 4,	two(0xF018, 0xD800), two(0xF1F8, 0xFF8F), "Ii+sDk", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Idl3&s", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Id#3&s", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&sl3", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&s#3", mfloat },
+{"fmovemx", 4,	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "IdL3-s", mfloat },
+{"fmovemx", 4,	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "Id#3-s", mfloat },
+{"fmovemx", 4,	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+sl3", mfloat },
+{"fmovemx", 4,	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+s#3", mfloat },
 
-{"fmoveml",	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
-{"fmoveml",	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "IiL8~s", mfloat },
+{"fmoveml", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
+{"fmoveml", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "IiL8~s", mfloat },
 /* FIXME: In the next instruction, we should only permit %dn if the
    target is a single register.  We should only permit %an if the
    target is a single %fpiar.  */
-{"fmoveml",	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*lL8", mfloat },
+{"fmoveml", 4,	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*lL8", mfloat },
 
-{"fmovem",	two(0xF000, 0xD000), two(0xFFC0, 0xFF00), "IizsL3", cfloat },
-{"fmovem",	two(0xF000, 0xD000), two(0xFFC0, 0xFF00), "Iizs#3", cfloat },
-{"fmovem",	two(0xF000, 0xF000), two(0xFFC0, 0xFF00), "Ii#3ys", cfloat },
-{"fmovem",	two(0xF000, 0xF000), two(0xFFC0, 0xFF00), "IiL3ys", cfloat },
+{"fmovem", 4,	two(0xF000, 0xD000), two(0xFFC0, 0xFF00), "IizsL3", cfloat },
+{"fmovem", 4,	two(0xF000, 0xD000), two(0xFFC0, 0xFF00), "Iizs#3", cfloat },
+{"fmovem", 4,	two(0xF000, 0xF000), two(0xFFC0, 0xFF00), "Ii#3ys", cfloat },
+{"fmovem", 4,	two(0xF000, 0xF000), two(0xFFC0, 0xFF00), "IiL3ys", cfloat },
 
-{"fmovem",	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "IdL3-s", mfloat },
-{"fmovem",	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Idl3&s", mfloat },
-{"fmovem",	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+sl3", mfloat },
-{"fmovem",	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&sl3", mfloat },
-{"fmovem",	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "Id#3-s", mfloat },
-{"fmovem",	two(0xF020, 0xE800), two(0xF1F8, 0xFF8F), "IiDk-s", mfloat },
-{"fmovem",	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Id#3&s", mfloat },
-{"fmovem",	two(0xF000, 0xF800), two(0xF1C0, 0xFF8F), "IiDk&s", mfloat },
-{"fmovem",	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+s#3", mfloat },
-{"fmovem",	two(0xF018, 0xD800), two(0xF1F8, 0xFF8F), "Ii+sDk", mfloat },
-{"fmovem",	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&s#3", mfloat },
-{"fmovem",	two(0xF000, 0xD800), two(0xF1C0, 0xFF8F), "Ii&sDk", mfloat },
-{"fmovem",	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
-{"fmovem",	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ss8", mfloat },
-{"fmovem",	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "IiL8~s", mfloat },
-{"fmovem",	two(0xF000, 0x8000), two(0xF2C0, 0xE3FF), "Ii*sL8", mfloat },
+{"fmovem", 4,	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "IdL3-s", mfloat },
+{"fmovem", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Idl3&s", mfloat },
+{"fmovem", 4,	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+sl3", mfloat },
+{"fmovem", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&sl3", mfloat },
+{"fmovem", 4,	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "Id#3-s", mfloat },
+{"fmovem", 4,	two(0xF020, 0xE800), two(0xF1F8, 0xFF8F), "IiDk-s", mfloat },
+{"fmovem", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Id#3&s", mfloat },
+{"fmovem", 4,	two(0xF000, 0xF800), two(0xF1C0, 0xFF8F), "IiDk&s", mfloat },
+{"fmovem", 4,	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+s#3", mfloat },
+{"fmovem", 4,	two(0xF018, 0xD800), two(0xF1F8, 0xFF8F), "Ii+sDk", mfloat },
+{"fmovem", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&s#3", mfloat },
+{"fmovem", 4,	two(0xF000, 0xD800), two(0xF1C0, 0xFF8F), "Ii&sDk", mfloat },
+{"fmovem", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
+{"fmovem", 4,	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ss8", mfloat },
+{"fmovem", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "IiL8~s", mfloat },
+{"fmovem", 4,	two(0xF000, 0x8000), two(0xF2C0, 0xE3FF), "Ii*sL8", mfloat },
 
-{"fmulb",	two(0xF000, 0x5823), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fmulb",	two(0xF000, 0x5823), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fmuld",	two(0xF000, 0x0023), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fmuld",	two(0xF000, 0x5423), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fmuld",	two(0xF000, 0x5423), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fmull",	two(0xF000, 0x4023), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fmull",	two(0xF000, 0x4023), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fmulp",	two(0xF000, 0x4C23), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fmuls",	two(0xF000, 0x4423), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fmuls",	two(0xF000, 0x4423), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fmulw",	two(0xF000, 0x5023), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fmulw",	two(0xF000, 0x5023), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fmulx",	two(0xF000, 0x0023), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fmulx",	two(0xF000, 0x4823), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fmulb", 4,	two(0xF000, 0x5823), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fmulb", 4,	two(0xF000, 0x5823), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmuld", 4,	two(0xF000, 0x0023), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fmuld", 4,	two(0xF000, 0x5423), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fmuld", 4,	two(0xF000, 0x5423), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fmull", 4,	two(0xF000, 0x4023), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fmull", 4,	two(0xF000, 0x4023), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmulp", 4,	two(0xF000, 0x4C23), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fmuls", 4,	two(0xF000, 0x4423), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fmuls", 4,	two(0xF000, 0x4423), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmulw", 4,	two(0xF000, 0x5023), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fmulw", 4,	two(0xF000, 0x5023), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmulx", 4,	two(0xF000, 0x0023), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fmulx", 4,	two(0xF000, 0x4823), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
 
-{"fsmulb",	two(0xF000, 0x5863), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fsmulb",	two(0xF000, 0x5863), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsmuld",	two(0xF000, 0x0063), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fsmuld",	two(0xF000, 0x5463), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fsmuld",	two(0xF000, 0x5463), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fsmull",	two(0xF000, 0x4063), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fsmull",	two(0xF000, 0x4063), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsmulp",	two(0xF000, 0x4C63), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fsmuls",	two(0xF000, 0x4463), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fsmuls",	two(0xF000, 0x4463), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsmulw",	two(0xF000, 0x5063), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fsmulw",	two(0xF000, 0x5063), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsmulx",	two(0xF000, 0x0063), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fsmulx",	two(0xF000, 0x4863), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fsmulb", 4,	two(0xF000, 0x5863), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsmulb", 4,	two(0xF000, 0x5863), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmuld", 4,	two(0xF000, 0x0063), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsmuld", 4,	two(0xF000, 0x5463), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsmuld", 4,	two(0xF000, 0x5463), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsmull", 4,	two(0xF000, 0x4063), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsmull", 4,	two(0xF000, 0x4063), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmulp", 4,	two(0xF000, 0x4C63), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsmuls", 4,	two(0xF000, 0x4463), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsmuls", 4,	two(0xF000, 0x4463), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmulw", 4,	two(0xF000, 0x5063), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsmulw", 4,	two(0xF000, 0x5063), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmulx", 4,	two(0xF000, 0x0063), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsmulx", 4,	two(0xF000, 0x4863), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
 
-{"fdmulb",	two(0xF000, 0x5867), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fdmulb",	two(0xF000, 0x5867), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdmuld",	two(0xF000, 0x0067), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fdmuld",	two(0xF000, 0x5467), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fdmuld",	two(0xF000, 0x5467), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fdmull",	two(0xF000, 0x4067), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fdmull",	two(0xF000, 0x4067), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdmulp",	two(0xF000, 0x4C67), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fdmuls",	two(0xF000, 0x4467), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fdmuls",	two(0xF000, 0x4467), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdmulw",	two(0xF000, 0x5067), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fdmulw",	two(0xF000, 0x5067), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdmulx",	two(0xF000, 0x0067), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fdmulx",	two(0xF000, 0x4867), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fdmulb", 4,	two(0xF000, 0x5867), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdmulb", 4,	two(0xF000, 0x5867), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmuld", 4,	two(0xF000, 0x0067), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdmuld", 4,	two(0xF000, 0x5467), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdmuld", 4,	two(0xF000, 0x5467), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdmull", 4,	two(0xF000, 0x4067), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdmull", 4,	two(0xF000, 0x4067), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmulp", 4,	two(0xF000, 0x4C67), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdmuls", 4,	two(0xF000, 0x4467), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdmuls", 4,	two(0xF000, 0x4467), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmulw", 4,	two(0xF000, 0x5067), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdmulw", 4,	two(0xF000, 0x5067), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmulx", 4,	two(0xF000, 0x0067), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdmulx", 4,	two(0xF000, 0x4867), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
 
-{"fnegb",	two(0xF000, 0x581A), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fnegb",	two(0xF000, 0x581A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fnegd",	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fnegd",	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
-{"fnegd",	two(0xF000, 0x541A), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fnegd",	two(0xF000, 0x541A), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fnegl",	two(0xF000, 0x401A), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fnegl",	two(0xF000, 0x401A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fnegp",	two(0xF000, 0x4C1A), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fnegs",	two(0xF000, 0x441A), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fnegs",	two(0xF000, 0x441A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fnegw",	two(0xF000, 0x501A), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fnegw",	two(0xF000, 0x501A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fnegx",	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fnegx",	two(0xF000, 0x481A), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fnegx",	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fnegb", 4,	two(0xF000, 0x581A), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fnegb", 4,	two(0xF000, 0x581A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fnegd", 4,	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fnegd", 4,	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fnegd", 4,	two(0xF000, 0x541A), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fnegd", 4,	two(0xF000, 0x541A), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fnegl", 4,	two(0xF000, 0x401A), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fnegl", 4,	two(0xF000, 0x401A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fnegp", 4,	two(0xF000, 0x4C1A), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fnegs", 4,	two(0xF000, 0x441A), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fnegs", 4,	two(0xF000, 0x441A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fnegw", 4,	two(0xF000, 0x501A), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fnegw", 4,	two(0xF000, 0x501A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fnegx", 4,	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fnegx", 4,	two(0xF000, 0x481A), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fnegx", 4,	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fsnegb",	two(0xF000, 0x585A), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fsnegb",	two(0xF000, 0x585A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsnegd",	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fsnegd",	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
-{"fsnegd",	two(0xF000, 0x545A), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fsnegd",	two(0xF000, 0x545A), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fsnegl",	two(0xF000, 0x405A), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fsnegl",	two(0xF000, 0x405A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsnegp",	two(0xF000, 0x4C5A), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fsnegs",	two(0xF000, 0x445A), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fsnegs",	two(0xF000, 0x445A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsnegw",	two(0xF000, 0x505A), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fsnegw",	two(0xF000, 0x505A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsnegx",	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fsnegx",	two(0xF000, 0x485A), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
-{"fsnegx",	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+{"fsnegb", 4,	two(0xF000, 0x585A), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsnegb", 4,	two(0xF000, 0x585A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsnegd", 4,	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsnegd", 4,	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fsnegd", 4,	two(0xF000, 0x545A), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsnegd", 4,	two(0xF000, 0x545A), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsnegl", 4,	two(0xF000, 0x405A), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsnegl", 4,	two(0xF000, 0x405A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsnegp", 4,	two(0xF000, 0x4C5A), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsnegs", 4,	two(0xF000, 0x445A), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsnegs", 4,	two(0xF000, 0x445A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsnegw", 4,	two(0xF000, 0x505A), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsnegw", 4,	two(0xF000, 0x505A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsnegx", 4,	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsnegx", 4,	two(0xF000, 0x485A), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fsnegx", 4,	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
 
-{"fdnegb",	two(0xF000, 0x585E), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fdnegb",	two(0xF000, 0x585E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdnegd",	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fdnegd",	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
-{"fdnegd",	two(0xF000, 0x545E), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fdnegd",	two(0xF000, 0x545E), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fdnegl",	two(0xF000, 0x405E), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fdnegl",	two(0xF000, 0x405E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdnegp",	two(0xF000, 0x4C5E), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fdnegs",	two(0xF000, 0x445E), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fdnegs",	two(0xF000, 0x445E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdnegw",	two(0xF000, 0x505E), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fdnegw",	two(0xF000, 0x505E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdnegx",	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fdnegx",	two(0xF000, 0x485E), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
-{"fdnegx",	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+{"fdnegb", 4,	two(0xF000, 0x585E), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdnegb", 4,	two(0xF000, 0x585E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdnegd", 4,	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdnegd", 4,	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fdnegd", 4,	two(0xF000, 0x545E), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdnegd", 4,	two(0xF000, 0x545E), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdnegl", 4,	two(0xF000, 0x405E), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdnegl", 4,	two(0xF000, 0x405E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdnegp", 4,	two(0xF000, 0x4C5E), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdnegs", 4,	two(0xF000, 0x445E), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdnegs", 4,	two(0xF000, 0x445E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdnegw", 4,	two(0xF000, 0x505E), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdnegw", 4,	two(0xF000, 0x505E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdnegx", 4,	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdnegx", 4,	two(0xF000, 0x485E), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fdnegx", 4,	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
 
-{"fnop",	two(0xF280, 0x0000), two(0xFFFF, 0xFFFF), "Ii", mfloat | cfloat },
+{"fnop", 4,	two(0xF280, 0x0000), two(0xFFFF, 0xFFFF), "Ii", mfloat | cfloat },
 
-{"fremb",	two(0xF000, 0x5825), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fremd",	two(0xF000, 0x5425), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"freml",	two(0xF000, 0x4025), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fremp",	two(0xF000, 0x4C25), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"frems",	two(0xF000, 0x4425), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fremw",	two(0xF000, 0x5025), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fremx",	two(0xF000, 0x0025), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fremx",	two(0xF000, 0x4825), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fremb", 4,	two(0xF000, 0x5825), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fremd", 4,	two(0xF000, 0x5425), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"freml", 4,	two(0xF000, 0x4025), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fremp", 4,	two(0xF000, 0x4C25), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"frems", 4,	two(0xF000, 0x4425), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fremw", 4,	two(0xF000, 0x5025), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fremx", 4,	two(0xF000, 0x0025), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fremx", 4,	two(0xF000, 0x4825), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
 
-{"frestore",	one(0xF140),		one(0xF1C0), "Id<s", mfloat },
-{"frestore",	one(0xF140),		one(0xF1C0), "Idys", cfloat },
+{"frestore", 2,	one(0xF140),		one(0xF1C0), "Id<s", mfloat },
+{"frestore", 2,	one(0xF140),		one(0xF1C0), "Idys", cfloat },
 
-{"fsave",	one(0xF100),		one(0xF1C0), "Id>s", mfloat },
-{"fsave",	one(0xF100),		one(0xF1C0), "Idzs", cfloat },
+{"fsave", 2,	one(0xF100),		one(0xF1C0), "Id>s", mfloat },
+{"fsave", 2,	one(0xF100),		one(0xF1C0), "Idzs", cfloat },
 
-{"fscaleb",	two(0xF000, 0x5826), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fscaled",	two(0xF000, 0x5426), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fscalel",	two(0xF000, 0x4026), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fscalep",	two(0xF000, 0x4C26), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fscales",	two(0xF000, 0x4426), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fscalew",	two(0xF000, 0x5026), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fscalex",	two(0xF000, 0x0026), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fscalex",	two(0xF000, 0x4826), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fscaleb", 4,	two(0xF000, 0x5826), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fscaled", 4,	two(0xF000, 0x5426), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fscalel", 4,	two(0xF000, 0x4026), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fscalep", 4,	two(0xF000, 0x4C26), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fscales", 4,	two(0xF000, 0x4426), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fscalew", 4,	two(0xF000, 0x5026), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fscalex", 4,	two(0xF000, 0x0026), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fscalex", 4,	two(0xF000, 0x4826), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
 
 /* $ is necessary to prevent the assembler from using PC-relative.
-   If @ were used, "label: fseq label" could produce "ftrapeq",
+   If @ were used, "label: fseq label" could produce "ftrapeq", 2,
    because "label" became "pc@label".  */
-{"fseq",	two(0xF040, 0x0001), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsf",		two(0xF040, 0x0000), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsge",	two(0xF040, 0x0013), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsgl",	two(0xF040, 0x0016), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsgle",	two(0xF040, 0x0017), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsgt",	two(0xF040, 0x0012), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsle",	two(0xF040, 0x0015), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fslt",	two(0xF040, 0x0014), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsne",	two(0xF040, 0x000E), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsnge",	two(0xF040, 0x001C), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsngl",	two(0xF040, 0x0019), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsngle",	two(0xF040, 0x0018), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsngt",	two(0xF040, 0x001D), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsnle",	two(0xF040, 0x001A), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsnlt",	two(0xF040, 0x001B), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsoge",	two(0xF040, 0x0003), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsogl",	two(0xF040, 0x0006), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsogt",	two(0xF040, 0x0002), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsole",	two(0xF040, 0x0005), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsolt",	two(0xF040, 0x0004), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsor",	two(0xF040, 0x0007), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsseq",	two(0xF040, 0x0011), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fssf",	two(0xF040, 0x0010), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fssne",	two(0xF040, 0x001E), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsst",	two(0xF040, 0x001F), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fst",		two(0xF040, 0x000F), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsueq",	two(0xF040, 0x0009), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsuge",	two(0xF040, 0x000B), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsugt",	two(0xF040, 0x000A), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsule",	two(0xF040, 0x000D), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsult",	two(0xF040, 0x000C), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
-{"fsun",	two(0xF040, 0x0008), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fseq", 4,	two(0xF040, 0x0001), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsf", 4,	two(0xF040, 0x0000), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsge", 4,	two(0xF040, 0x0013), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsgl", 4,	two(0xF040, 0x0016), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsgle", 4,	two(0xF040, 0x0017), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsgt", 4,	two(0xF040, 0x0012), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsle", 4,	two(0xF040, 0x0015), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fslt", 4,	two(0xF040, 0x0014), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsne", 4,	two(0xF040, 0x000E), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsnge", 4,	two(0xF040, 0x001C), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsngl", 4,	two(0xF040, 0x0019), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsngle", 4,	two(0xF040, 0x0018), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsngt", 4,	two(0xF040, 0x001D), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsnle", 4,	two(0xF040, 0x001A), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsnlt", 4,	two(0xF040, 0x001B), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsoge", 4,	two(0xF040, 0x0003), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsogl", 4,	two(0xF040, 0x0006), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsogt", 4,	two(0xF040, 0x0002), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsole", 4,	two(0xF040, 0x0005), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsolt", 4,	two(0xF040, 0x0004), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsor", 4,	two(0xF040, 0x0007), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsseq", 4,	two(0xF040, 0x0011), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fssf", 4,	two(0xF040, 0x0010), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fssne", 4,	two(0xF040, 0x001E), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsst", 4,	two(0xF040, 0x001F), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fst", 4,	two(0xF040, 0x000F), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsueq", 4,	two(0xF040, 0x0009), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsuge", 4,	two(0xF040, 0x000B), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsugt", 4,	two(0xF040, 0x000A), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsule", 4,	two(0xF040, 0x000D), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsult", 4,	two(0xF040, 0x000C), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsun", 4,	two(0xF040, 0x0008), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
 
-{"fsgldivb",	two(0xF000, 0x5824), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fsgldivd",	two(0xF000, 0x5424), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fsgldivl",	two(0xF000, 0x4024), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fsgldivp",	two(0xF000, 0x4C24), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fsgldivs",	two(0xF000, 0x4424), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fsgldivw",	two(0xF000, 0x5024), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fsgldivx",	two(0xF000, 0x0024), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fsgldivx",	two(0xF000, 0x4824), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fsgldivx",	two(0xF000, 0x0024), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fsgldivb", 4,	two(0xF000, 0x5824), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsgldivd", 4,	two(0xF000, 0x5424), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsgldivl", 4,	two(0xF000, 0x4024), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsgldivp", 4,	two(0xF000, 0x4C24), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsgldivs", 4,	two(0xF000, 0x4424), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsgldivw", 4,	two(0xF000, 0x5024), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsgldivx", 4,	two(0xF000, 0x0024), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsgldivx", 4,	two(0xF000, 0x4824), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsgldivx", 4,	two(0xF000, 0x0024), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fsglmulb",	two(0xF000, 0x5827), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fsglmuld",	two(0xF000, 0x5427), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fsglmull",	two(0xF000, 0x4027), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fsglmulp",	two(0xF000, 0x4C27), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fsglmuls",	two(0xF000, 0x4427), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fsglmulw",	two(0xF000, 0x5027), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fsglmulx",	two(0xF000, 0x0027), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fsglmulx",	two(0xF000, 0x4827), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fsglmulx",	two(0xF000, 0x0027), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fsglmulb", 4,	two(0xF000, 0x5827), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsglmuld", 4,	two(0xF000, 0x5427), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsglmull", 4,	two(0xF000, 0x4027), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsglmulp", 4,	two(0xF000, 0x4C27), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsglmuls", 4,	two(0xF000, 0x4427), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsglmulw", 4,	two(0xF000, 0x5027), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsglmulx", 4,	two(0xF000, 0x0027), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsglmulx", 4,	two(0xF000, 0x4827), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsglmulx", 4,	two(0xF000, 0x0027), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fsinb",	two(0xF000, 0x580E), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fsind",	two(0xF000, 0x540E), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fsinl",	two(0xF000, 0x400E), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fsinp",	two(0xF000, 0x4C0E), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fsins",	two(0xF000, 0x440E), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fsinw",	two(0xF000, 0x500E), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fsinx",	two(0xF000, 0x000E), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fsinx",	two(0xF000, 0x480E), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fsinx",	two(0xF000, 0x000E), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fsinb", 4,	two(0xF000, 0x580E), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsind", 4,	two(0xF000, 0x540E), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsinl", 4,	two(0xF000, 0x400E), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsinp", 4,	two(0xF000, 0x4C0E), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsins", 4,	two(0xF000, 0x440E), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsinw", 4,	two(0xF000, 0x500E), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsinx", 4,	two(0xF000, 0x000E), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsinx", 4,	two(0xF000, 0x480E), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsinx", 4,	two(0xF000, 0x000E), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fsincosb",	two(0xF000, 0x5830), two(0xF1C0, 0xFC78), "Ii;bF3F7", mfloat },
-{"fsincosd",	two(0xF000, 0x5430), two(0xF1C0, 0xFC78), "Ii;FF3F7", mfloat },
-{"fsincosl",	two(0xF000, 0x4030), two(0xF1C0, 0xFC78), "Ii;lF3F7", mfloat },
-{"fsincosp",	two(0xF000, 0x4C30), two(0xF1C0, 0xFC78), "Ii;pF3F7", mfloat },
-{"fsincoss",	two(0xF000, 0x4430), two(0xF1C0, 0xFC78), "Ii;fF3F7", mfloat },
-{"fsincosw",	two(0xF000, 0x5030), two(0xF1C0, 0xFC78), "Ii;wF3F7", mfloat },
-{"fsincosx",	two(0xF000, 0x0030), two(0xF1C0, 0xE078), "IiF8F3F7", mfloat },
-{"fsincosx",	two(0xF000, 0x4830), two(0xF1C0, 0xFC78), "Ii;xF3F7", mfloat },
+{"fsincosb", 4,	two(0xF000, 0x5830), two(0xF1C0, 0xFC78), "Ii;bF3F7", mfloat },
+{"fsincosd", 4,	two(0xF000, 0x5430), two(0xF1C0, 0xFC78), "Ii;FF3F7", mfloat },
+{"fsincosl", 4,	two(0xF000, 0x4030), two(0xF1C0, 0xFC78), "Ii;lF3F7", mfloat },
+{"fsincosp", 4,	two(0xF000, 0x4C30), two(0xF1C0, 0xFC78), "Ii;pF3F7", mfloat },
+{"fsincoss", 4,	two(0xF000, 0x4430), two(0xF1C0, 0xFC78), "Ii;fF3F7", mfloat },
+{"fsincosw", 4,	two(0xF000, 0x5030), two(0xF1C0, 0xFC78), "Ii;wF3F7", mfloat },
+{"fsincosx", 4,	two(0xF000, 0x0030), two(0xF1C0, 0xE078), "IiF8F3F7", mfloat },
+{"fsincosx", 4,	two(0xF000, 0x4830), two(0xF1C0, 0xFC78), "Ii;xF3F7", mfloat },
 
-{"fsinhb",	two(0xF000, 0x5802), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fsinhd",	two(0xF000, 0x5402), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fsinhl",	two(0xF000, 0x4002), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fsinhp",	two(0xF000, 0x4C02), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fsinhs",	two(0xF000, 0x4402), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fsinhw",	two(0xF000, 0x5002), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fsinhx",	two(0xF000, 0x0002), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fsinhx",	two(0xF000, 0x4802), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fsinhx",	two(0xF000, 0x0002), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fsinhb", 4,	two(0xF000, 0x5802), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsinhd", 4,	two(0xF000, 0x5402), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsinhl", 4,	two(0xF000, 0x4002), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsinhp", 4,	two(0xF000, 0x4C02), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsinhs", 4,	two(0xF000, 0x4402), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsinhw", 4,	two(0xF000, 0x5002), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsinhx", 4,	two(0xF000, 0x0002), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsinhx", 4,	two(0xF000, 0x4802), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsinhx", 4,	two(0xF000, 0x0002), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fsqrtb",	two(0xF000, 0x5804), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fsqrtb",	two(0xF000, 0x5804), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsqrtd",	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fsqrtd",	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
-{"fsqrtd",	two(0xF000, 0x5404), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fsqrtd",	two(0xF000, 0x5404), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fsqrtl",	two(0xF000, 0x4004), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fsqrtl",	two(0xF000, 0x4004), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsqrtp",	two(0xF000, 0x4C04), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fsqrts",	two(0xF000, 0x4404), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fsqrts",	two(0xF000, 0x4404), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsqrtw",	two(0xF000, 0x5004), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fsqrtw",	two(0xF000, 0x5004), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsqrtx",	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fsqrtx",	two(0xF000, 0x4804), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fsqrtx",	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fsqrtb", 4,	two(0xF000, 0x5804), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsqrtb", 4,	two(0xF000, 0x5804), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsqrtd", 4,	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsqrtd", 4,	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fsqrtd", 4,	two(0xF000, 0x5404), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsqrtd", 4,	two(0xF000, 0x5404), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsqrtl", 4,	two(0xF000, 0x4004), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsqrtl", 4,	two(0xF000, 0x4004), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsqrtp", 4,	two(0xF000, 0x4C04), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsqrts", 4,	two(0xF000, 0x4404), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsqrts", 4,	two(0xF000, 0x4404), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsqrtw", 4,	two(0xF000, 0x5004), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsqrtw", 4,	two(0xF000, 0x5004), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsqrtx", 4,	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsqrtx", 4,	two(0xF000, 0x4804), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsqrtx", 4,	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fssqrtb",	two(0xF000, 0x5841), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fssqrtb",	two(0xF000, 0x5841), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fssqrtd",	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fssqrtd",	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
-{"fssqrtd",	two(0xF000, 0x5441), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fssqrtd",	two(0xF000, 0x5441), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fssqrtl",	two(0xF000, 0x4041), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fssqrtl",	two(0xF000, 0x4041), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fssqrtp",	two(0xF000, 0x4C41), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fssqrts",	two(0xF000, 0x4441), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fssqrts",	two(0xF000, 0x4441), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fssqrtw",	two(0xF000, 0x5041), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fssqrtw",	two(0xF000, 0x5041), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fssqrtx",	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fssqrtx",	two(0xF000, 0x4841), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
-{"fssqrtx",	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+{"fssqrtb", 4,	two(0xF000, 0x5841), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fssqrtb", 4,	two(0xF000, 0x5841), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssqrtd", 4,	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fssqrtd", 4,	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fssqrtd", 4,	two(0xF000, 0x5441), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fssqrtd", 4,	two(0xF000, 0x5441), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fssqrtl", 4,	two(0xF000, 0x4041), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fssqrtl", 4,	two(0xF000, 0x4041), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssqrtp", 4,	two(0xF000, 0x4C41), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fssqrts", 4,	two(0xF000, 0x4441), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fssqrts", 4,	two(0xF000, 0x4441), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssqrtw", 4,	two(0xF000, 0x5041), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fssqrtw", 4,	two(0xF000, 0x5041), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssqrtx", 4,	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fssqrtx", 4,	two(0xF000, 0x4841), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fssqrtx", 4,	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
 
-{"fdsqrtb",	two(0xF000, 0x5845), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fdsqrtb",	two(0xF000, 0x5845), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdsqrtd",	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fdsqrtd",	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
-{"fdsqrtd",	two(0xF000, 0x5445), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fdsqrtl",	two(0xF000, 0x4045), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fdsqrtl",	two(0xF000, 0x4045), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdsqrtp",	two(0xF000, 0x4C45), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fdsqrts",	two(0xF000, 0x4445), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fdsqrts",	two(0xF000, 0x4445), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdsqrtw",	two(0xF000, 0x5045), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fdsqrtw",	two(0xF000, 0x5045), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdsqrtx",	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fdsqrtx",	two(0xF000, 0x4845), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
-{"fdsqrtx",	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+{"fdsqrtb", 4,	two(0xF000, 0x5845), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdsqrtb", 4,	two(0xF000, 0x5845), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsqrtd", 4,	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdsqrtd", 4,	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fdsqrtd", 4,	two(0xF000, 0x5445), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdsqrtl", 4,	two(0xF000, 0x4045), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdsqrtl", 4,	two(0xF000, 0x4045), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsqrtp", 4,	two(0xF000, 0x4C45), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdsqrts", 4,	two(0xF000, 0x4445), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdsqrts", 4,	two(0xF000, 0x4445), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsqrtw", 4,	two(0xF000, 0x5045), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdsqrtw", 4,	two(0xF000, 0x5045), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsqrtx", 4,	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdsqrtx", 4,	two(0xF000, 0x4845), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fdsqrtx", 4,	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
 
-{"fsubb",	two(0xF000, 0x5828), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"fsubb",	two(0xF000, 0x5828), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsubd",	two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fsubd",	two(0xF000, 0x5428), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"fsubd",	two(0xF000, 0x5428), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fsubl",	two(0xF000, 0x4028), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"fsubl",	two(0xF000, 0x4028), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsubp",	two(0xF000, 0x4C28), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"fsubs",	two(0xF000, 0x4428), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"fsubs",	two(0xF000, 0x4428), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsubw",	two(0xF000, 0x5028), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"fsubw",	two(0xF000, 0x5028), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fsubx",	two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"fsubx",	two(0xF000, 0x4828), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"fsubx",	two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"fsubb", 4,	two(0xF000, 0x5828), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsubb", 4,	two(0xF000, 0x5828), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsubd", 4,	two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsubd", 4,	two(0xF000, 0x5428), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsubd", 4,	two(0xF000, 0x5428), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsubl", 4,	two(0xF000, 0x4028), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsubl", 4,	two(0xF000, 0x4028), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsubp", 4,	two(0xF000, 0x4C28), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsubs", 4,	two(0xF000, 0x4428), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsubs", 4,	two(0xF000, 0x4428), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsubw", 4,	two(0xF000, 0x5028), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsubw", 4,	two(0xF000, 0x5028), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsubx", 4,	two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsubx", 4,	two(0xF000, 0x4828), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsubx", 4,	two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"fssubb",	two(0xF000, 0x5828), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fssubb",	two(0xF000, 0x5868), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fssubd",	two(0xF000, 0x0068), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fssubd",	two(0xF000, 0x5468), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fssubd",	two(0xF000, 0x5468), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fssubl",	two(0xF000, 0x4068), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fssubl",	two(0xF000, 0x4068), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fssubp",	two(0xF000, 0x4C68), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fssubs",	two(0xF000, 0x4468), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fssubs",	two(0xF000, 0x4468), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fssubw",	two(0xF000, 0x5068), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fssubw",	two(0xF000, 0x5068), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fssubx",	two(0xF000, 0x0068), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fssubx",	two(0xF000, 0x4868), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
-{"fssubx",	two(0xF000, 0x0068), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+{"fssubb", 4,	two(0xF000, 0x5828), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssubb", 4,	two(0xF000, 0x5868), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fssubd", 4,	two(0xF000, 0x0068), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fssubd", 4,	two(0xF000, 0x5468), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fssubd", 4,	two(0xF000, 0x5468), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fssubl", 4,	two(0xF000, 0x4068), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fssubl", 4,	two(0xF000, 0x4068), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssubp", 4,	two(0xF000, 0x4C68), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fssubs", 4,	two(0xF000, 0x4468), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fssubs", 4,	two(0xF000, 0x4468), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssubw", 4,	two(0xF000, 0x5068), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fssubw", 4,	two(0xF000, 0x5068), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssubx", 4,	two(0xF000, 0x0068), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fssubx", 4,	two(0xF000, 0x4868), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fssubx", 4,	two(0xF000, 0x0068), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
 
-{"fdsubb",	two(0xF000, 0x586A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdsubb",	two(0xF000, 0x586c), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
-{"fdsubd",	two(0xF000, 0x006A), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
-{"fdsubd",	two(0xF000, 0x546A), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
-{"fdsubd",	two(0xF000, 0x546c), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
-{"fdsubl",	two(0xF000, 0x406A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdsubl",	two(0xF000, 0x406c), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
-{"fdsubp",	two(0xF000, 0x4C6c), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
-{"fdsubs",	two(0xF000, 0x446A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdsubs",	two(0xF000, 0x446c), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
-{"fdsubw",	two(0xF000, 0x506A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
-{"fdsubw",	two(0xF000, 0x506c), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
-{"fdsubx",	two(0xF000, 0x006c), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
-{"fdsubx",	two(0xF000, 0x486c), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
-{"fdsubx",	two(0xF000, 0x006c), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+{"fdsubb", 4,	two(0xF000, 0x586A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsubb", 4,	two(0xF000, 0x586c), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdsubd", 4,	two(0xF000, 0x006A), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdsubd", 4,	two(0xF000, 0x546A), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdsubd", 4,	two(0xF000, 0x546c), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdsubl", 4,	two(0xF000, 0x406A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsubl", 4,	two(0xF000, 0x406c), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdsubp", 4,	two(0xF000, 0x4C6c), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdsubs", 4,	two(0xF000, 0x446A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsubs", 4,	two(0xF000, 0x446c), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdsubw", 4,	two(0xF000, 0x506A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsubw", 4,	two(0xF000, 0x506c), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdsubx", 4,	two(0xF000, 0x006c), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdsubx", 4,	two(0xF000, 0x486c), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fdsubx", 4,	two(0xF000, 0x006c), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
 
-{"ftanb",	two(0xF000, 0x580F), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"ftand",	two(0xF000, 0x540F), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"ftanl",	two(0xF000, 0x400F), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"ftanp",	two(0xF000, 0x4C0F), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"ftans",	two(0xF000, 0x440F), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"ftanw",	two(0xF000, 0x500F), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"ftanx",	two(0xF000, 0x000F), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"ftanx",	two(0xF000, 0x480F), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"ftanx",	two(0xF000, 0x000F), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"ftanb", 4,	two(0xF000, 0x580F), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"ftand", 4,	two(0xF000, 0x540F), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"ftanl", 4,	two(0xF000, 0x400F), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"ftanp", 4,	two(0xF000, 0x4C0F), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"ftans", 4,	two(0xF000, 0x440F), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"ftanw", 4,	two(0xF000, 0x500F), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"ftanx", 4,	two(0xF000, 0x000F), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"ftanx", 4,	two(0xF000, 0x480F), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"ftanx", 4,	two(0xF000, 0x000F), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"ftanhb",	two(0xF000, 0x5809), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"ftanhd",	two(0xF000, 0x5409), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"ftanhl",	two(0xF000, 0x4009), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"ftanhp",	two(0xF000, 0x4C09), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"ftanhs",	two(0xF000, 0x4409), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"ftanhw",	two(0xF000, 0x5009), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"ftanhx",	two(0xF000, 0x0009), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"ftanhx",	two(0xF000, 0x4809), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"ftanhx",	two(0xF000, 0x0009), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"ftanhb", 4,	two(0xF000, 0x5809), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"ftanhd", 4,	two(0xF000, 0x5409), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"ftanhl", 4,	two(0xF000, 0x4009), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"ftanhp", 4,	two(0xF000, 0x4C09), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"ftanhs", 4,	two(0xF000, 0x4409), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"ftanhw", 4,	two(0xF000, 0x5009), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"ftanhx", 4,	two(0xF000, 0x0009), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"ftanhx", 4,	two(0xF000, 0x4809), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"ftanhx", 4,	two(0xF000, 0x0009), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"ftentoxb",	two(0xF000, 0x5812), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"ftentoxd",	two(0xF000, 0x5412), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"ftentoxl",	two(0xF000, 0x4012), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"ftentoxp",	two(0xF000, 0x4C12), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"ftentoxs",	two(0xF000, 0x4412), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"ftentoxw",	two(0xF000, 0x5012), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"ftentoxx",	two(0xF000, 0x0012), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"ftentoxx",	two(0xF000, 0x4812), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"ftentoxx",	two(0xF000, 0x0012), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"ftentoxb", 4,	two(0xF000, 0x5812), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"ftentoxd", 4,	two(0xF000, 0x5412), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"ftentoxl", 4,	two(0xF000, 0x4012), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"ftentoxp", 4,	two(0xF000, 0x4C12), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"ftentoxs", 4,	two(0xF000, 0x4412), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"ftentoxw", 4,	two(0xF000, 0x5012), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"ftentoxx", 4,	two(0xF000, 0x0012), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"ftentoxx", 4,	two(0xF000, 0x4812), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"ftentoxx", 4,	two(0xF000, 0x0012), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"ftrapeq",	two(0xF07C, 0x0001), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapf",	two(0xF07C, 0x0000), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapge",	two(0xF07C, 0x0013), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapgl",	two(0xF07C, 0x0016), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapgle",	two(0xF07C, 0x0017), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapgt",	two(0xF07C, 0x0012), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftraple",	two(0xF07C, 0x0015), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftraplt",	two(0xF07C, 0x0014), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapne",	two(0xF07C, 0x000E), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapnge",	two(0xF07C, 0x001C), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapngl",	two(0xF07C, 0x0019), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapngle",	two(0xF07C, 0x0018), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapngt",	two(0xF07C, 0x001D), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapnle",	two(0xF07C, 0x001A), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapnlt",	two(0xF07C, 0x001B), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapoge",	two(0xF07C, 0x0003), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapogl",	two(0xF07C, 0x0006), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapogt",	two(0xF07C, 0x0002), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapole",	two(0xF07C, 0x0005), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapolt",	two(0xF07C, 0x0004), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapor",	two(0xF07C, 0x0007), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapseq",	two(0xF07C, 0x0011), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapsf",	two(0xF07C, 0x0010), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapsne",	two(0xF07C, 0x001E), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapst",	two(0xF07C, 0x001F), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapt",	two(0xF07C, 0x000F), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapueq",	two(0xF07C, 0x0009), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapuge",	two(0xF07C, 0x000B), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapugt",	two(0xF07C, 0x000A), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapule",	two(0xF07C, 0x000D), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapult",	two(0xF07C, 0x000C), two(0xF1FF, 0xFFFF), "Ii", mfloat },
-{"ftrapun",	two(0xF07C, 0x0008), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapeq", 4,	two(0xF07C, 0x0001), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapf", 4,	two(0xF07C, 0x0000), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapge", 4,	two(0xF07C, 0x0013), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapgl", 4,	two(0xF07C, 0x0016), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapgle", 4,	two(0xF07C, 0x0017), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapgt", 4,	two(0xF07C, 0x0012), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftraple", 4,	two(0xF07C, 0x0015), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftraplt", 4,	two(0xF07C, 0x0014), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapne", 4,	two(0xF07C, 0x000E), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapnge", 4,	two(0xF07C, 0x001C), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapngl", 4,	two(0xF07C, 0x0019), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapngle", 4,two(0xF07C, 0x0018), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapngt", 4,	two(0xF07C, 0x001D), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapnle", 4,	two(0xF07C, 0x001A), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapnlt", 4,	two(0xF07C, 0x001B), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapoge", 4,	two(0xF07C, 0x0003), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapogl", 4,	two(0xF07C, 0x0006), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapogt", 4,	two(0xF07C, 0x0002), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapole", 4,	two(0xF07C, 0x0005), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapolt", 4,	two(0xF07C, 0x0004), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapor", 4,	two(0xF07C, 0x0007), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapseq", 4,	two(0xF07C, 0x0011), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapsf", 4,	two(0xF07C, 0x0010), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapsne", 4,	two(0xF07C, 0x001E), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapst", 4,	two(0xF07C, 0x001F), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapt", 4,	two(0xF07C, 0x000F), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapueq", 4,	two(0xF07C, 0x0009), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapuge", 4,	two(0xF07C, 0x000B), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapugt", 4,	two(0xF07C, 0x000A), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapule", 4,	two(0xF07C, 0x000D), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapult", 4,	two(0xF07C, 0x000C), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapun", 4,	two(0xF07C, 0x0008), two(0xF1FF, 0xFFFF), "Ii", mfloat },
 
-{"ftrapeqw",	two(0xF07A, 0x0001), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapfw",	two(0xF07A, 0x0000), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapgew",	two(0xF07A, 0x0013), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapglw",	two(0xF07A, 0x0016), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapglew",	two(0xF07A, 0x0017), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapgtw",	two(0xF07A, 0x0012), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftraplew",	two(0xF07A, 0x0015), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapltw",	two(0xF07A, 0x0014), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapnew",	two(0xF07A, 0x000E), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapngew",	two(0xF07A, 0x001C), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapnglw",	two(0xF07A, 0x0019), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapnglew",	two(0xF07A, 0x0018), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapngtw",	two(0xF07A, 0x001D), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapnlew",	two(0xF07A, 0x001A), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapnltw",	two(0xF07A, 0x001B), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapogew",	two(0xF07A, 0x0003), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapoglw",	two(0xF07A, 0x0006), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapogtw",	two(0xF07A, 0x0002), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapolew",	two(0xF07A, 0x0005), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapoltw",	two(0xF07A, 0x0004), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftraporw",	two(0xF07A, 0x0007), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapseqw",	two(0xF07A, 0x0011), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapsfw",	two(0xF07A, 0x0010), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapsnew",	two(0xF07A, 0x001E), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapstw",	two(0xF07A, 0x001F), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftraptw",	two(0xF07A, 0x000F), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapueqw",	two(0xF07A, 0x0009), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapugew",	two(0xF07A, 0x000B), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapugtw",	two(0xF07A, 0x000A), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapulew",	two(0xF07A, 0x000D), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapultw",	two(0xF07A, 0x000C), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
-{"ftrapunw",	two(0xF07A, 0x0008), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapeqw", 4,	two(0xF07A, 0x0001), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapfw", 4,	two(0xF07A, 0x0000), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapgew", 4,	two(0xF07A, 0x0013), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapglw", 4,	two(0xF07A, 0x0016), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapglew", 4,two(0xF07A, 0x0017), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapgtw", 4,	two(0xF07A, 0x0012), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftraplew", 4,	two(0xF07A, 0x0015), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapltw", 4,	two(0xF07A, 0x0014), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapnew", 4,	two(0xF07A, 0x000E), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapngew", 4,two(0xF07A, 0x001C), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapnglw", 4,two(0xF07A, 0x0019), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapnglew", 4,two(0xF07A, 0x0018), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapngtw", 4,two(0xF07A, 0x001D), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapnlew", 4,two(0xF07A, 0x001A), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapnltw", 4,two(0xF07A, 0x001B), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapogew", 4,two(0xF07A, 0x0003), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapoglw", 4,two(0xF07A, 0x0006), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapogtw", 4,two(0xF07A, 0x0002), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapolew", 4,two(0xF07A, 0x0005), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapoltw", 4,two(0xF07A, 0x0004), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftraporw", 4,	two(0xF07A, 0x0007), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapseqw", 4,two(0xF07A, 0x0011), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapsfw", 4,	two(0xF07A, 0x0010), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapsnew", 4,two(0xF07A, 0x001E), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapstw", 4,	two(0xF07A, 0x001F), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftraptw", 4,	two(0xF07A, 0x000F), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapueqw", 4,two(0xF07A, 0x0009), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapugew", 4,two(0xF07A, 0x000B), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapugtw", 4,two(0xF07A, 0x000A), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapulew", 4,two(0xF07A, 0x000D), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapultw", 4,two(0xF07A, 0x000C), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapunw", 4,	two(0xF07A, 0x0008), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
 
-{"ftrapeql",	two(0xF07B, 0x0001), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapfl",	two(0xF07B, 0x0000), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapgel",	two(0xF07B, 0x0013), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapgll",	two(0xF07B, 0x0016), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapglel",	two(0xF07B, 0x0017), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapgtl",	two(0xF07B, 0x0012), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftraplel",	two(0xF07B, 0x0015), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapltl",	two(0xF07B, 0x0014), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapnel",	two(0xF07B, 0x000E), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapngel",	two(0xF07B, 0x001C), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapngll",	two(0xF07B, 0x0019), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapnglel",	two(0xF07B, 0x0018), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapngtl",	two(0xF07B, 0x001D), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapnlel",	two(0xF07B, 0x001A), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapnltl",	two(0xF07B, 0x001B), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapogel",	two(0xF07B, 0x0003), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapogll",	two(0xF07B, 0x0006), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapogtl",	two(0xF07B, 0x0002), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapolel",	two(0xF07B, 0x0005), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapoltl",	two(0xF07B, 0x0004), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftraporl",	two(0xF07B, 0x0007), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapseql",	two(0xF07B, 0x0011), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapsfl",	two(0xF07B, 0x0010), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapsnel",	two(0xF07B, 0x001E), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapstl",	two(0xF07B, 0x001F), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftraptl",	two(0xF07B, 0x000F), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapueql",	two(0xF07B, 0x0009), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapugel",	two(0xF07B, 0x000B), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapugtl",	two(0xF07B, 0x000A), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapulel",	two(0xF07B, 0x000D), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapultl",	two(0xF07B, 0x000C), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
-{"ftrapunl",	two(0xF07B, 0x0008), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapeql", 4,	two(0xF07B, 0x0001), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapfl", 4,	two(0xF07B, 0x0000), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapgel", 4,	two(0xF07B, 0x0013), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapgll", 4,	two(0xF07B, 0x0016), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapglel", 4,two(0xF07B, 0x0017), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapgtl", 4,	two(0xF07B, 0x0012), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftraplel", 4,	two(0xF07B, 0x0015), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapltl", 4,	two(0xF07B, 0x0014), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapnel", 4,	two(0xF07B, 0x000E), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapngel", 4,two(0xF07B, 0x001C), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapngll", 4,two(0xF07B, 0x0019), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapnglel", 4,two(0xF07B, 0x0018), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapngtl", 4,two(0xF07B, 0x001D), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapnlel", 4,two(0xF07B, 0x001A), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapnltl", 4,two(0xF07B, 0x001B), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapogel", 4,two(0xF07B, 0x0003), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapogll", 4,two(0xF07B, 0x0006), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapogtl", 4,two(0xF07B, 0x0002), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapolel", 4,two(0xF07B, 0x0005), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapoltl", 4,two(0xF07B, 0x0004), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftraporl", 4,	two(0xF07B, 0x0007), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapseql", 4,two(0xF07B, 0x0011), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapsfl", 4,	two(0xF07B, 0x0010), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapsnel", 4,two(0xF07B, 0x001E), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapstl", 4,	two(0xF07B, 0x001F), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftraptl", 4,	two(0xF07B, 0x000F), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapueql", 4,two(0xF07B, 0x0009), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapugel", 4,two(0xF07B, 0x000B), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapugtl", 4,two(0xF07B, 0x000A), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapulel", 4,two(0xF07B, 0x000D), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapultl", 4,two(0xF07B, 0x000C), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapunl", 4,	two(0xF07B, 0x0008), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
 
-{"ftstb",	two(0xF000, 0x583A), two(0xF1C0, 0xFC7F), "Ii;b", mfloat },
-{"ftstb",	two(0xF000, 0x583A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
-{"ftstd",	two(0xF000, 0x003A), two(0xF1C0, 0xE07F), "IiF8", cfloat },
-{"ftstd",	two(0xF000, 0x543A), two(0xF1C0, 0xFC7F), "Ii;F", mfloat },
-{"ftstd",	two(0xF000, 0x543A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
-{"ftstl",	two(0xF000, 0x403A), two(0xF1C0, 0xFC7F), "Ii;l", mfloat },
-{"ftstl",	two(0xF000, 0x403A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
-{"ftstp",	two(0xF000, 0x4C3A), two(0xF1C0, 0xFC7F), "Ii;p", mfloat },
-{"ftsts",	two(0xF000, 0x443A), two(0xF1C0, 0xFC7F), "Ii;f", mfloat },
-{"ftsts",	two(0xF000, 0x443A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
-{"ftstw",	two(0xF000, 0x503A), two(0xF1C0, 0xFC7F), "Ii;w", mfloat },
-{"ftstw",	two(0xF000, 0x503A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
-{"ftstx",	two(0xF000, 0x003A), two(0xF1C0, 0xE07F), "IiF8", mfloat },
-{"ftstx",	two(0xF000, 0x483A), two(0xF1C0, 0xFC7F), "Ii;x", mfloat },
+{"ftstb", 4,	two(0xF000, 0x583A), two(0xF1C0, 0xFC7F), "Ii;b", mfloat },
+{"ftstb", 4,	two(0xF000, 0x583A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
+{"ftstd", 4,	two(0xF000, 0x003A), two(0xF1C0, 0xE07F), "IiF8", cfloat },
+{"ftstd", 4,	two(0xF000, 0x543A), two(0xF1C0, 0xFC7F), "Ii;F", mfloat },
+{"ftstd", 4,	two(0xF000, 0x543A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
+{"ftstl", 4,	two(0xF000, 0x403A), two(0xF1C0, 0xFC7F), "Ii;l", mfloat },
+{"ftstl", 4,	two(0xF000, 0x403A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
+{"ftstp", 4,	two(0xF000, 0x4C3A), two(0xF1C0, 0xFC7F), "Ii;p", mfloat },
+{"ftsts", 4,	two(0xF000, 0x443A), two(0xF1C0, 0xFC7F), "Ii;f", mfloat },
+{"ftsts", 4,	two(0xF000, 0x443A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
+{"ftstw", 4,	two(0xF000, 0x503A), two(0xF1C0, 0xFC7F), "Ii;w", mfloat },
+{"ftstw", 4,	two(0xF000, 0x503A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
+{"ftstx", 4,	two(0xF000, 0x003A), two(0xF1C0, 0xE07F), "IiF8", mfloat },
+{"ftstx", 4,	two(0xF000, 0x483A), two(0xF1C0, 0xFC7F), "Ii;x", mfloat },
 
-{"ftwotoxb",	two(0xF000, 0x5811), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
-{"ftwotoxd",	two(0xF000, 0x5411), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
-{"ftwotoxl",	two(0xF000, 0x4011), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
-{"ftwotoxp",	two(0xF000, 0x4C11), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
-{"ftwotoxs",	two(0xF000, 0x4411), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
-{"ftwotoxw",	two(0xF000, 0x5011), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
-{"ftwotoxx",	two(0xF000, 0x0011), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
-{"ftwotoxx",	two(0xF000, 0x4811), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
-{"ftwotoxx",	two(0xF000, 0x0011), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+{"ftwotoxb", 4,	two(0xF000, 0x5811), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"ftwotoxd", 4,	two(0xF000, 0x5411), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"ftwotoxl", 4,	two(0xF000, 0x4011), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"ftwotoxp", 4,	two(0xF000, 0x4C11), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"ftwotoxs", 4,	two(0xF000, 0x4411), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"ftwotoxw", 4,	two(0xF000, 0x5011), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"ftwotoxx", 4,	two(0xF000, 0x0011), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"ftwotoxx", 4,	two(0xF000, 0x4811), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"ftwotoxx", 4,	two(0xF000, 0x0011), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
 
-{"halt",	one(0045310),	one(0177777), "",     m68060 | mcf },
+{"halt", 2,	one(0045310),	one(0177777), "",     m68060 | mcfisa_a },
 
-{"illegal",	one(0045374),	one(0177777), "",     m68000up | mcf },
-{"intouch",	one(0xf428),	one(0xfff8), "As",    mcfv4eup },
+{"illegal", 2,	one(0045374),	one(0177777), "",     m68000up | mcfisa_a },
+{"intouch", 2,	one(0xf428),	one(0xfff8), "As",    mcfisa_b },
 
-{"jmp",		one(0047300),	one(0177700), "!s", m68000up | mcf },
+{"jmp", 2,	one(0047300),	one(0177700), "!s", m68000up | mcfisa_a },
 
-{"jra",		one(0060000),	one(0177400), "Bg", m68000up | mcf },
-{"jra",		one(0047300),	one(0177700), "!s", m68000up | mcf },
+{"jra", 2,	one(0060000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jra", 2,	one(0047300),	one(0177700), "!s", m68000up | mcfisa_a },
 
-{"jsr",		one(0047200),	one(0177700), "!s", m68000up | mcf },
+{"jsr", 2,	one(0047200),	one(0177700), "!s", m68000up | mcfisa_a },
 
-{"jbsr",	one(0060400),	one(0177400), "Bg", m68000up | mcf },
-{"jbsr",	one(0047200),	one(0177700), "!s", m68000up | mcf },
+{"jbsr", 2,	one(0060400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jbsr", 2,	one(0047200),	one(0177700), "!s", m68000up | mcfisa_a },
 
-{"lea",		one(0040700),	one(0170700), "!sAd", m68000up | mcf },
+{"lea", 2,	one(0040700),	one(0170700), "!sAd", m68000up | mcfisa_a },
 
-{"lpstop",	two(0174000,0000700),two(0177777,0177777),"#w", cpu32|m68060 },
+{"lpstop", 6,	two(0174000,0000700),two(0177777,0177777),"#w", cpu32|m68060 },
 
-{"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 | mcf },
-{"link",	one(0044010),	one(0177770), "As#l", m68020up | cpu32 },
+{"linkw", 4,	one(0047120),	one(0177770), "As#w", m68000up | mcfisa_a },
+{"linkl", 6,	one(0044010),	one(0177770), "As#l", m68020up | cpu32 },
+{"link", 4,	one(0047120),	one(0177770), "As#W", m68000up | mcfisa_a },
+{"link", 6,	one(0044010),	one(0177770), "As#l", m68020up | cpu32 },
 
-{"lslb",	one(0160410),	one(0170770), "QdDs", m68000up },
-{"lslb",	one(0160450),	one(0170770), "DdDs", m68000up },
-{"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 | mcf },
-{"lsll",	one(0160650),	one(0170770), "DdDs", m68000up | mcf },
+{"lslb", 2,	one(0160410),	one(0170770), "QdDs", m68000up },
+{"lslb", 2,	one(0160450),	one(0170770), "DdDs", m68000up },
+{"lslw", 2,	one(0160510),	one(0170770), "QdDs", m68000up },
+{"lslw", 2,	one(0160550),	one(0170770), "DdDs", m68000up },
+{"lslw", 2,	one(0161700),	one(0177700), "~s",   m68000up },
+{"lsll", 2,	one(0160610),	one(0170770), "QdDs", m68000up | mcfisa_a },
+{"lsll", 2,	one(0160650),	one(0170770), "DdDs", m68000up | mcfisa_a },
 
-{"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 | mcf },
-{"lsrl",	one(0160250),	one(0170770), "DdDs", m68000up | mcf },
+{"lsrb", 2,	one(0160010),	one(0170770), "QdDs", m68000up },
+{"lsrb", 2,	one(0160050),	one(0170770), "DdDs", m68000up },
+{"lsrw", 2,	one(0160110),	one(0170770), "QdDs", m68000up },
+{"lsrw", 2,	one(0160150),	one(0170770), "DdDs", m68000up },
+{"lsrw", 2,	one(0161300),	one(0177700), "~s",   m68000up },
+{"lsrl", 2,	one(0160210),	one(0170770), "QdDs", m68000up | mcfisa_a },
+{"lsrl", 2,	one(0160250),	one(0170770), "DdDs", m68000up | mcfisa_a },
 
-  /* FIXME: add MAM mode (`&' after <ea> operand) / remove MACM */
-{"macw",  two(0120000, 0000000), two(0170660, 0005400), "uMum", mcf5206eup },
-{"macw",  two(0120000, 0001000), two(0170660, 0005400), "uMumMh",mcf5206eup },
-{"macw",  two(0120220, 0000000), two(0170670, 0005460), "uNuoasRn", mcf5206eup },
-{"macw",  two(0120230, 0000000), two(0170670, 0005460), "uNuo+sRn", mcf5206eup },
-{"macw",  two(0120240, 0000000), two(0170670, 0005460), "uNuo-sRn", mcf5206eup },
-{"macw",  two(0120250, 0000000), two(0170670, 0005460), "uNuodsRn", mcf5206eup },
-{"macw",  two(0120220, 0001000), two(0170670, 0005460), "uNuoMhasRn", mcf5206eup },
-{"macw",  two(0120230, 0001000), two(0170670, 0005460), "uNuoMh+sRn", mcf5206eup },
-{"macw",  two(0120240, 0001000), two(0170670, 0005460), "uNuoMh-sRn", mcf5206eup },
-{"macw",  two(0120250, 0001000), two(0170670, 0005460), "uNuoMhdsRn", mcf5206eup },
-{"macmw", two(0120220, 0000040), two(0170670, 0005460), "uNuoasRn", mcf5206eup },
-{"macmw", two(0120230, 0000040), two(0170670, 0005460), "uNuo+sRn", mcf5206eup },
-{"macmw", two(0120240, 0000040), two(0170670, 0005460), "uNuo-sRn", mcf5206eup },
-{"macmw", two(0120250, 0000040), two(0170670, 0005460), "uNuodsRn", mcf5206eup },
-{"macmw", two(0120220, 0001040), two(0170670, 0005460), "uNuoMhasRn", mcf5206eup },
-{"macmw", two(0120230, 0001040), two(0170670, 0005460), "uNuoMh+sRn", mcf5206eup },
-{"macmw", two(0120240, 0001040), two(0170670, 0005460), "uNuoMh-sRn", mcf5206eup },
-{"macmw", two(0120250, 0001040), two(0170670, 0005460), "uNuoMhdsRn", mcf5206eup },
+{"macw", 4,  	two(0xa080, 0x0000), two(0xf180, 0x0910), "uNuoiI4/Rn", mcfmac },
+{"macw", 4,  	two(0xa080, 0x0200), two(0xf180, 0x0910), "uNuoMh4/Rn", mcfmac },
+{"macw", 4,  	two(0xa080, 0x0000), two(0xf180, 0x0f10), "uNuo4/Rn", mcfmac },
+{"macw", 4,  	two(0xa000, 0x0000), two(0xf1b0, 0x0900), "uMumiI", mcfmac },
+{"macw", 4,  	two(0xa000, 0x0200), two(0xf1b0, 0x0900), "uMumMh", mcfmac },
+{"macw", 4,  	two(0xa000, 0x0000), two(0xf1b0, 0x0f00), "uMum", mcfmac },
 
-{"macl",  two(0120000, 0004000), two(0170660, 0005400), "RsRm", mcf5206eup },
-{"macl",  two(0120000, 0005000), two(0170660, 0005400), "RsRmMh", mcf5206eup },
-{"macl",  two(0120220, 0004000), two(0170670, 0005460), "R3R1asRn", mcf5206eup },
-{"macl",  two(0120230, 0004000), two(0170670, 0005460), "R3R1+sRn", mcf5206eup },
-{"macl",  two(0120240, 0004000), two(0170670, 0005460), "R3R1-sRn", mcf5206eup },
-{"macl",  two(0120250, 0004000), two(0170670, 0005460), "R3R1dsRn", mcf5206eup },
-{"macl",  two(0120220, 0005000), two(0170670, 0005460), "R3R1MhasRn", mcf5206eup },
-{"macl",  two(0120230, 0005000), two(0170670, 0005460), "R3R1Mh+sRn", mcf5206eup },
-{"macl",  two(0120240, 0005000), two(0170670, 0005460), "R3R1Mh-sRn", mcf5206eup },
-{"macl",  two(0120250, 0005000), two(0170670, 0005460), "R3R1MhdsRn", mcf5206eup },
-{"macml", two(0120220, 0004040), two(0170670, 0005460), "R3R1asRn", mcf5206eup },
-{"macml", two(0120230, 0004040), two(0170670, 0005460), "R3R1+sRn", mcf5206eup },
-{"macml", two(0120240, 0004040), two(0170670, 0005460), "R3R1-sRn", mcf5206eup },
-{"macml", two(0120250, 0004040), two(0170670, 0005460), "R3R1dsRn", mcf5206eup },
-{"macml", two(0120220, 0005040), two(0170670, 0005460), "R3R1MhasRn", mcf5206eup },
-{"macml", two(0120230, 0005040), two(0170670, 0005460), "R3R1Mh+sRn", mcf5206eup },
-{"macml", two(0120240, 0005040), two(0170670, 0005460), "R3R1Mh-sRn", mcf5206eup },
-{"macml", two(0120250, 0005040), two(0170670, 0005460), "R3R1MhdsRn", mcf5206eup },
+{"macw", 4,  	two(0xa000, 0x0000), two(0xf100, 0x0900), "uNuoiI4/RneG", mcfemac },/* Ry,Rx,SF,<ea>,accX.  */
+{"macw", 4,  	two(0xa000, 0x0200), two(0xf100, 0x0900), "uNuoMh4/RneG", mcfemac },/* Ry,Rx,+1/-1,<ea>,accX.  */
+{"macw", 4,  	two(0xa000, 0x0000), two(0xf100, 0x0f00), "uNuo4/RneG", mcfemac },/* Ry,Rx,<ea>,accX.  */
+{"macw", 4,  	two(0xa000, 0x0000), two(0xf130, 0x0900), "uMumiIeH", mcfemac },/* Ry,Rx,SF,accX.  */
+{"macw", 4,  	two(0xa000, 0x0200), two(0xf130, 0x0900), "uMumMheH", mcfemac },/* Ry,Rx,+1/-1,accX.  */
+{"macw", 4,  	two(0xa000, 0x0000), two(0xf130, 0x0f00), "uMumeH", mcfemac }, /* Ry,Rx,accX.  */
+
+{"macl", 4,  	two(0xa080, 0x0800), two(0xf180, 0x0910), "RNRoiI4/Rn", mcfmac },
+{"macl", 4,  	two(0xa080, 0x0a00), two(0xf180, 0x0910), "RNRoMh4/Rn", mcfmac },
+{"macl", 4,  	two(0xa080, 0x0800), two(0xf180, 0x0f10), "RNRo4/Rn", mcfmac },
+{"macl", 4,  	two(0xa000, 0x0800), two(0xf1b0, 0x0b00), "RMRmiI", mcfmac },
+{"macl", 4,  	two(0xa000, 0x0a00), two(0xf1b0, 0x0b00), "RMRmMh", mcfmac },
+{"macl", 4,  	two(0xa000, 0x0800), two(0xf1b0, 0x0800), "RMRm", mcfmac },
+
+{"macl", 4,  	two(0xa000, 0x0800), two(0xf100, 0x0900), "R3R1iI4/RneG", mcfemac },
+{"macl", 4,  	two(0xa000, 0x0a00), two(0xf100, 0x0900), "R3R1Mh4/RneG", mcfemac },
+{"macl", 4,  	two(0xa000, 0x0800), two(0xf100, 0x0f00), "R3R14/RneG", mcfemac },
+{"macl", 4,  	two(0xa000, 0x0800), two(0xf130, 0x0900), "RMRmiIeH", mcfemac },
+{"macl", 4,  	two(0xa000, 0x0a00), two(0xf130, 0x0900), "RMRmMheH", mcfemac },
+{"macl", 4,  	two(0xa000, 0x0800), two(0xf130, 0x0f00), "RMRmeH", mcfemac },
 
 /* NOTE: The mcf5200 family programmer's reference manual does not
    indicate the byte form of the movea instruction is invalid (as it
@@ -1512,571 +1501,576 @@
    which replied that other coldfire assemblers reject movea.b.  For
    this reason I've decided to not allow moveab.
 
-	jtc@cygnus.com - 97/01/24
- */
+	jtc@cygnus.com - 97/01/24.  */
 
-{"moveal",	one(0020100),	one(0170700), "*lAd", m68000up | mcf },
-{"moveaw",	one(0030100),	one(0170700), "*wAd", m68000up | mcf },
+{"moveal", 2,	one(0020100),	one(0170700), "*lAd", m68000up | mcfisa_a },
+{"moveaw", 2,	one(0030100),	one(0170700), "*wAd", m68000up | mcfisa_a },
 
-{"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 },
+{"movclrl", 2,	one(0xA1C0),	one(0xf9f0), "eFRs", mcfemac },
 
-{"movemw",	one(0044200),	one(0177700), "Lw&s", m68000up },
-{"movemw",	one(0044240),	one(0177770), "lw-s", m68000up },
-{"movemw",	one(0044200),	one(0177700), "#w>s", m68000up },
-{"movemw",	one(0046200),	one(0177700), "<sLw", m68000up },
-{"movemw",	one(0046200),	one(0177700), "<s#w", m68000up },
-{"moveml",	one(0044300),	one(0177700), "Lw&s", m68000up },
-{"moveml",	one(0044340),	one(0177770), "lw-s", m68000up },
-{"moveml",	one(0044300),	one(0177700), "#w>s", m68000up },
-{"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", 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 },
+{"movec", 4,	one(0047173),	one(0177777), "R1Jj", m68010up | mcfisa_a },
+{"movec", 4,	one(0047173),	one(0177777), "R1#j", m68010up | mcfisa_a },
+{"movec", 4,	one(0047172),	one(0177777), "JjR1", m68010up },
+{"movec", 4,	one(0047172),	one(0177777), "#jR1", m68010up },
 
-{"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 },
+{"movemw", 4,	one(0044200),	one(0177700), "Lw&s", m68000up },
+{"movemw", 4,	one(0044240),	one(0177770), "lw-s", m68000up },
+{"movemw", 4,	one(0044200),	one(0177700), "#w>s", m68000up },
+{"movemw", 4,	one(0046200),	one(0177700), "<sLw", m68000up },
+{"movemw", 4,	one(0046200),	one(0177700), "<s#w", m68000up },
+{"moveml", 4,	one(0044300),	one(0177700), "Lw&s", m68000up },
+{"moveml", 4,	one(0044340),	one(0177770), "lw-s", m68000up },
+{"moveml", 4,	one(0044300),	one(0177700), "#w>s", m68000up },
+{"moveml", 4,	one(0046300),	one(0177700), "<sLw", m68000up },
+{"moveml", 4,	one(0046300),	one(0177700), "<s#w", m68000up },
+/* FIXME: need specifier for mode 2 and 5 to simplify below insn patterns.  */
+{"moveml", 4,	one(0044320),	one(0177770), "Lwas", mcfisa_a },
+{"moveml", 4,	one(0044320),	one(0177770), "#was", mcfisa_a },
+{"moveml", 4,	one(0044350),	one(0177770), "Lwds", mcfisa_a },
+{"moveml", 4,	one(0044350),	one(0177770), "#wds", mcfisa_a },
+{"moveml", 4,	one(0046320),	one(0177770), "asLw", mcfisa_a },
+{"moveml", 4,	one(0046320),	one(0177770), "as#w", mcfisa_a },
+{"moveml", 4,	one(0046350),	one(0177770), "dsLw", mcfisa_a },
+{"moveml", 4,	one(0046350),	one(0177770), "ds#w", mcfisa_a },
 
-{"moveq",	one(0070000),	one(0170400), "MsDd", m68000up | mcf },
-{"moveq",	one(0070000),	one(0170400), "#BDd", m68000up | mcf },
+{"movepw", 2,	one(0000410),	one(0170770), "dsDd", m68000up },
+{"movepw", 2,	one(0000610),	one(0170770), "Ddds", m68000up },
+{"movepl", 2,	one(0000510),	one(0170770), "dsDd", m68000up },
+{"movepl", 2,	one(0000710),	one(0170770), "Ddds", m68000up },
+
+{"moveq", 2,	one(0070000),	one(0170400), "MsDd", m68000up | mcfisa_a },
+{"moveq", 2,	one(0070000),	one(0170400), "#BDd", m68000up | mcfisa_a },
 
 /* The move opcode can generate the movea and moveq instructions.  */
-{"moveb",	one(0010000),	one(0170000), ";b$d", m68000up },
-{"moveb",	one(0010000),	one(0170070), "Ds$d", mcf },
-{"moveb",	one(0010020),	one(0170070), "as$d", mcf },
-{"moveb",	one(0010030),	one(0170070), "+s$d", mcf },
-{"moveb",	one(0010040),	one(0170070), "-s$d", mcf },
-{"moveb",	one(0010000),	one(0170000), "nsqd", mcf },
-{"moveb",	one(0010000),	one(0170700), "obDd", mcf },
-{"moveb",	one(0010200),	one(0170700), "obad", mcf },
-{"moveb",	one(0010300),	one(0170700), "ob+d", mcf },
-{"moveb",	one(0010400),	one(0170700), "ob-d", mcf },
-{"moveb",	one(0010000),	one(0170000), "obnd", mcfv4up },
+{"moveb", 2,	one(0010000),	one(0170000), ";b$d", m68000up },
+{"moveb", 2,	one(0010000),	one(0170070), "Ds$d", mcfisa_a },
+{"moveb", 2,	one(0010020),	one(0170070), "as$d", mcfisa_a },
+{"moveb", 2,	one(0010030),	one(0170070), "+s$d", mcfisa_a },
+{"moveb", 2,	one(0010040),	one(0170070), "-s$d", mcfisa_a },
+{"moveb", 2,	one(0010000),	one(0170000), "nsqd", mcfisa_a },
+{"moveb", 2,	one(0010000),	one(0170700), "obDd", mcfisa_a },
+{"moveb", 2,	one(0010200),	one(0170700), "obad", mcfisa_a },
+{"moveb", 2,	one(0010300),	one(0170700), "ob+d", mcfisa_a },
+{"moveb", 2,	one(0010400),	one(0170700), "ob-d", mcfisa_a },
+{"moveb", 2,	one(0010000),	one(0170000), "obnd", mcfisa_b },
 
-{"movew",	one(0030000),	one(0170000), "*w%d", m68000up },
-{"movew",	one(0030000),	one(0170000), "ms%d", mcf },
-{"movew",	one(0030000),	one(0170000), "nspd", mcf },
-{"movew",	one(0030000),	one(0170000), "owmd", mcf },
-{"movew",	one(0030000),	one(0170000), "ownd", mcfv4up },
-{"movew",	one(0040300),	one(0177700), "Ss$s", m68000up },
-{"movew",	one(0040300),	one(0177770), "SsDs", mcf },
-{"movew",	one(0041300),	one(0177700), "Cs$s", m68010up },
-{"movew",	one(0041300),	one(0177770), "CsDs", mcf },
-{"movew",	one(0042300),	one(0177700), ";wCd", m68000up },
-{"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", mcf },
-{"movew",	one(0043374),	one(0177777), "#wSd", mcf },
+{"movew", 2,	one(0030000),	one(0170000), "*w%d", m68000up },
+{"movew", 2,	one(0030000),	one(0170000), "ms%d", mcfisa_a },
+{"movew", 2,	one(0030000),	one(0170000), "nspd", mcfisa_a },
+{"movew", 2,	one(0030000),	one(0170000), "owmd", mcfisa_a },
+{"movew", 2,	one(0030000),	one(0170000), "ownd", mcfisa_b },
+{"movew", 2,	one(0040300),	one(0177700), "Ss$s", m68000up },
+{"movew", 2,	one(0040300),	one(0177770), "SsDs", mcfisa_a },
+{"movew", 2,	one(0041300),	one(0177700), "Cs$s", m68010up },
+{"movew", 2,	one(0041300),	one(0177770), "CsDs", mcfisa_a },
+{"movew", 2,	one(0042300),	one(0177700), ";wCd", m68000up },
+{"movew", 2,	one(0042300),	one(0177700), "DsCd", mcfisa_a },
+{"movew", 4,	one(0042374),	one(0177777), "#wCd", mcfisa_a },
+{"movew", 2,	one(0043300),	one(0177700), ";wSd", m68000up },
+{"movew", 2,	one(0043300),	one(0177700), "DsSd", mcfisa_a },
+{"movew", 4,	one(0043374),	one(0177777), "#wSd", mcfisa_a },
 
-{"movel",	one(0070000),	one(0170400), "MsDd", m68000up | mcf },
-{"movel",	one(0020000),	one(0170000), "*l%d", m68000up },
-{"movel",	one(0020000),	one(0170000), "ms%d", mcf },
-{"movel",	one(0020000),	one(0170000), "nspd", mcf },
-{"movel",	one(0020000),	one(0170000), "olmd", mcf },
-{"movel",	one(0020000),	one(0170000), "olnd", mcfv4up },
-{"movel",	one(0047140),	one(0177770), "AsUd", m68000up | mcfv4e },
-{"movel",	one(0047150),	one(0177770), "UdAs", m68000up | mcfv4e },
-{"movel",	one(0120600),	one(0177760), "EsRs", mcf5206eup },
-{"movel",	one(0120400),	one(0177760), "RsEs", mcf5206eup },
-{"movel",	one(0120474),	one(0177777), "#lEs", mcf5206eup },
-{"movel",	one(0124600),	one(0177760), "GsRs", mcf5206eup },
-{"movel",	one(0124400),	one(0177760), "RsGs", mcf5206eup },
-{"movel",	one(0124474),	one(0177777), "#lGs", mcf5206eup },
-{"movel",	one(0126600),	one(0177760), "HsRs", mcf5206eup },
-{"movel",	one(0126400),	one(0177760), "RsHs", mcf5206eup },
-{"movel",	one(0126474),	one(0177777), "#lHs", mcf5206eup },
-{"movel",	one(0124700),	one(0177777), "GsCs", mcf5206eup },
+{"movel", 2,	one(0070000),	one(0170400), "MsDd", m68000up | mcfisa_a },
+{"movel", 2,	one(0020000),	one(0170000), "*l%d", m68000up },
+{"movel", 2,	one(0020000),	one(0170000), "ms%d", mcfisa_a },
+{"movel", 2,	one(0020000),	one(0170000), "nspd", mcfisa_a },
+{"movel", 2,	one(0020000),	one(0170000), "olmd", mcfisa_a },
+{"movel", 2,	one(0020000),	one(0170000), "olnd", mcfisa_b },
+{"movel", 2,	one(0047140),	one(0177770), "AsUd", m68000up | mcfusp },
+{"movel", 2,	one(0047150),	one(0177770), "UdAs", m68000up | mcfusp },
+{"movel", 2,	one(0120600),	one(0177760), "EsRs", mcfmac },
+{"movel", 2,	one(0120400),	one(0177760), "RsEs", mcfmac },
+{"movel", 6,	one(0120474),	one(0177777), "#lEs", mcfmac },
+{"movel", 2,	one(0124600),	one(0177760), "GsRs", mcfmac },
+{"movel", 2,	one(0124400),	one(0177760), "RsGs", mcfmac },
+{"movel", 6,	one(0124474),	one(0177777), "#lGs", mcfmac },
+{"movel", 2,	one(0126600),	one(0177760), "HsRs", mcfmac },
+{"movel", 2,	one(0126400),	one(0177760), "RsHs", mcfmac },
+{"movel", 6,	one(0126474),	one(0177777), "#lHs", mcfmac },
+{"movel", 2,	one(0124700),	one(0177777), "GsCs", mcfmac },
 
-{"move",	one(0030000),	one(0170000), "*w%d", m68000up },
-{"move",	one(0030000),	one(0170000), "ms%d", mcf },
-{"move",	one(0030000),	one(0170000), "nspd", mcf },
-{"move",	one(0030000),	one(0170000), "owmd", mcf },
-{"move",	one(0030000),	one(0170000), "ownd", mcfv4up },
-{"move",	one(0040300),	one(0177700), "Ss$s", m68000up },
-{"move",	one(0040300),	one(0177770), "SsDs", mcf },
-{"move",	one(0041300),	one(0177700), "Cs$s", m68010up },
-{"move",	one(0041300),	one(0177770), "CsDs", mcf },
-{"move",	one(0042300),	one(0177700), ";wCd", m68000up },
-{"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", mcf },
-{"move",	one(0043374),	one(0177777), "#wSd", mcf },
+{"movel", 2,	one(0xa180),	one(0xf9f0), "eFRs", mcfemac }, /* ACCx,Rx.  */
+{"movel", 2,	one(0xab80),	one(0xfbf0), "g]Rs", mcfemac }, /* ACCEXTx,Rx.  */
+{"movel", 2,	one(0xa980),	one(0xfff0), "G-Rs", mcfemac }, /* macsr,Rx.  */
+{"movel", 2,	one(0xad80),	one(0xfff0), "H-Rs", mcfemac }, /* mask,Rx.  */
+{"movel", 2,	one(0xa110),	one(0xf9fc), "efeF", mcfemac }, /* ACCy,ACCx.  */
+{"movel", 2,	one(0xa9c0),	one(0xffff), "G-C-", mcfemac }, /* macsr,ccr.  */
+{"movel", 2,	one(0xa100),	one(0xf9f0), "RseF", mcfemac }, /* Rx,ACCx.  */
+{"movel", 6,	one(0xa13c),	one(0xf9ff), "#leF", mcfemac }, /* #,ACCx.  */
+{"movel", 2,	one(0xab00),	one(0xfbc0), "Rsg]", mcfemac }, /* Rx,ACCEXTx.  */
+{"movel", 6,	one(0xab3c),	one(0xfbff), "#lg]", mcfemac }, /* #,ACCEXTx.  */
+{"movel", 2,	one(0xa900),	one(0xffc0), "RsG-", mcfemac }, /* Rx,macsr.  */
+{"movel", 6,	one(0xa93c),	one(0xffff), "#lG-", mcfemac }, /* #,macsr.  */
+{"movel", 2,	one(0xad00),	one(0xffc0), "RsH-", mcfemac }, /* Rx,mask.  */
+{"movel", 6,	one(0xad3c),	one(0xffff), "#lH-", mcfemac }, /* #,mask.  */
 
-{"move",	one(0047140),	one(0177770), "AsUd", m68000up },
-{"move",	one(0047150),	one(0177770), "UdAs", m68000up },
+{"move", 2,	one(0030000),	one(0170000), "*w%d", m68000up },
+{"move", 2,	one(0030000),	one(0170000), "ms%d", mcfisa_a },
+{"move", 2,	one(0030000),	one(0170000), "nspd", mcfisa_a },
+{"move", 2,	one(0030000),	one(0170000), "owmd", mcfisa_a },
+{"move", 2,	one(0030000),	one(0170000), "ownd", mcfisa_b },
+{"move", 2,	one(0040300),	one(0177700), "Ss$s", m68000up },
+{"move", 2,	one(0040300),	one(0177770), "SsDs", mcfisa_a },
+{"move", 2,	one(0041300),	one(0177700), "Cs$s", m68010up },
+{"move", 2,	one(0041300),	one(0177770), "CsDs", mcfisa_a },
+{"move", 2,	one(0042300),	one(0177700), ";wCd", m68000up },
+{"move", 2,	one(0042300),	one(0177700), "DsCd", mcfisa_a },
+{"move", 4,	one(0042374),	one(0177777), "#wCd", mcfisa_a },
+{"move", 2,	one(0043300),	one(0177700), ";wSd", m68000up },
+{"move", 2,	one(0043300),	one(0177700), "DsSd", mcfisa_a },
+{"move", 4,	one(0043374),	one(0177777), "#wSd", mcfisa_a },
 
-{"mov3ql",	one(0120500),	one(0170700), "xd%s", mcfv4up },
-{"mvsb",	one(0070400),	one(0170700), "*bDd", mcfv4up },
-{"mvsw",	one(0070500),	one(0170700), "*wDd", mcfv4up },
-{"mvzb",	one(0070600),	one(0170700), "*bDd", mcfv4up },
-{"mvzw",	one(0070700),	one(0170700), "*wDd", mcfv4up },
+{"move", 2,	one(0047140),	one(0177770), "AsUd", m68000up },
+{"move", 2,	one(0047150),	one(0177770), "UdAs", m68000up },
 
-{"movesb",	two(0007000, 0),     two(0177700, 07777), "~sR1", m68010up },
-{"movesb",	two(0007000, 04000), two(0177700, 07777), "R1~s", m68010up },
-{"movesw",	two(0007100, 0),     two(0177700, 07777), "~sR1", m68010up },
-{"movesw",	two(0007100, 04000), two(0177700, 07777), "R1~s", m68010up },
-{"movesl",	two(0007200, 0),     two(0177700, 07777), "~sR1", m68010up },
-{"movesl",	two(0007200, 04000), two(0177700, 07777), "R1~s", m68010up },
+{"mov3ql", 2,	one(0120500),	one(0170700), "xd%s", mcfisa_b },
+{"mvsb", 2,	one(0070400),	one(0170700), "*bDd", mcfisa_b },
+{"mvsw", 2,	one(0070500),	one(0170700), "*wDd", mcfisa_b },
+{"mvzb", 2,	one(0070600),	one(0170700), "*bDd", mcfisa_b },
+{"mvzw", 2,	one(0070700),	one(0170700), "*wDd", mcfisa_b },
 
-{"move16",	two(0xf620, 0x8000), two(0xfff8, 0x8fff), "+s+1", m68040up },
-{"move16",	one(0xf600),		one(0xfff8), "+s_L", m68040up },
-{"move16",	one(0xf608),		one(0xfff8), "_L+s", m68040up },
-{"move16",	one(0xf610),		one(0xfff8), "as_L", m68040up },
-{"move16",	one(0xf618),		one(0xfff8), "_Las", m68040up },
+{"movesb", 4,	two(0007000, 0),     two(0177700, 07777), "~sR1", m68010up },
+{"movesb", 4,	two(0007000, 04000), two(0177700, 07777), "R1~s", m68010up },
+{"movesw", 4,	two(0007100, 0),     two(0177700, 07777), "~sR1", m68010up },
+{"movesw", 4,	two(0007100, 04000), two(0177700, 07777), "R1~s", m68010up },
+{"movesl", 4,	two(0007200, 0),     two(0177700, 07777), "~sR1", m68010up },
+{"movesl", 4,	two(0007200, 04000), two(0177700, 07777), "R1~s", m68010up },
 
-  /* FIXME: add MAM mode (`&' after <ea> operand) / remove MSACM */
-{"msacw",  two(0120000, 0000400), two(0170660, 0005400), "uMum", mcf5206eup },
-{"msacw",  two(0120000, 0001400), two(0170660, 0005400), "uMumMh", mcf5206eup },
-{"msacw",  two(0120220, 0000400), two(0170670, 0005460), "uNuoasRn", mcf5206eup },
-{"msacw",  two(0120230, 0000400), two(0170670, 0005460), "uNuo+sRn", mcf5206eup },
-{"msacw",  two(0120240, 0000400), two(0170670, 0005460), "uNuo-sRn", mcf5206eup },
-{"msacw",  two(0120250, 0000400), two(0170670, 0005460), "uNuodsRn", mcf5206eup },
-{"msacw",  two(0120220, 0001400), two(0170670, 0005460), "uNuoMhasRn", mcf5206eup },
-{"msacw",  two(0120230, 0001400), two(0170670, 0005460), "uNuoMh+sRn", mcf5206eup },
-{"msacw",  two(0120240, 0001400), two(0170670, 0005460), "uNuoMh-sRn", mcf5206eup },
-{"msacw",  two(0120250, 0001400), two(0170670, 0005460), "uNuoMhdsRn", mcf5206eup },
-{"msacmw", two(0120220, 0000440), two(0170670, 0005460), "uNuoasRn", mcf5206eup },
-{"msacmw", two(0120230, 0000440), two(0170670, 0005460), "uNuo+sRn", mcf5206eup },
-{"msacmw", two(0120240, 0000440), two(0170670, 0005460), "uNuo-sRn", mcf5206eup },
-{"msacmw", two(0120250, 0000440), two(0170670, 0005460), "uNuodsRn", mcf5206eup },
-{"msacmw", two(0120220, 0001440), two(0170670, 0005460), "uNuoMhasRn", mcf5206eup },
-{"msacmw", two(0120230, 0001440), two(0170670, 0005460), "uNuoMh+sRn", mcf5206eup },
-{"msacmw", two(0120240, 0001440), two(0170670, 0005460), "uNuoMh-sRn", mcf5206eup },
-{"msacmw", two(0120250, 0001440), two(0170670, 0005460), "uNuoMhdsRn", mcf5206eup },
+{"move16", 4,	two(0xf620, 0x8000), two(0xfff8, 0x8fff), "+s+1", m68040up },
+{"move16", 2,	one(0xf600),		one(0xfff8), "+s_L", m68040up },
+{"move16", 2,	one(0xf608),		one(0xfff8), "_L+s", m68040up },
+{"move16", 2,	one(0xf610),		one(0xfff8), "as_L", m68040up },
+{"move16", 2,	one(0xf618),		one(0xfff8), "_Las", m68040up },
 
-{"msacl",  two(0120000, 0004400), two(0170660, 0005400), "RsRm", mcf5206eup },
-{"msacl",  two(0120000, 0005400), two(0170660, 0005400), "RsRmMh", mcf5206eup },
-{"msacl",  two(0120220, 0004400), two(0170670, 0005460), "R3R1asRn", mcf5206eup },
-{"msacl",  two(0120230, 0004400), two(0170670, 0005460), "R3R1+sRn", mcf5206eup },
-{"msacl",  two(0120240, 0004400), two(0170670, 0005460), "R3R1-sRn", mcf5206eup },
-{"msacl",  two(0120250, 0004400), two(0170670, 0005460), "R3R1dsRn", mcf5206eup },
-{"msacl",  two(0120220, 0005400), two(0170670, 0005460), "R3R1MhasRn", mcf5206eup },
-{"msacl",  two(0120230, 0005400), two(0170670, 0005460), "R3R1Mh+sRn", mcf5206eup },
-{"msacl",  two(0120240, 0005400), two(0170670, 0005460), "R3R1Mh-sRn", mcf5206eup },
-{"msacl",  two(0120250, 0005400), two(0170670, 0005460), "R3R1MhdsRn", mcf5206eup },
-{"msacml", two(0120220, 0004440), two(0170670, 0005460), "R3R1asRn", mcf5206eup },
-{"msacml", two(0120230, 0004440), two(0170670, 0005460), "R3R1+sRn", mcf5206eup },
-{"msacml", two(0120240, 0004440), two(0170670, 0005460), "R3R1-sRn", mcf5206eup },
-{"msacml", two(0120250, 0004440), two(0170670, 0005460), "R3R1dsRn", mcf5206eup },
-{"msacml", two(0120220, 0005440), two(0170670, 0005460), "R3R1MhasRn", mcf5206eup },
-{"msacml", two(0120230, 0005440), two(0170670, 0005460), "R3R1Mh+sRn", mcf5206eup },
-{"msacml", two(0120240, 0005440), two(0170670, 0005460), "R3R1Mh-sRn", mcf5206eup },
-{"msacml", two(0120250, 0005440), two(0170670, 0005460), "R3R1MhdsRn", mcf5206eup },
+{"msacw", 4,  	two(0xa080, 0x0100), two(0xf180, 0x0910), "uNuoiI4/Rn", mcfmac },
+{"msacw", 4,  	two(0xa080, 0x0300), two(0xf180, 0x0910), "uNuoMh4/Rn", mcfmac },
+{"msacw", 4,  	two(0xa080, 0x0100), two(0xf180, 0x0f10), "uNuo4/Rn", mcfmac },
+{"msacw", 4,  	two(0xa000, 0x0100), two(0xf1b0, 0x0900), "uMumiI", mcfmac },
+{"msacw", 4,  	two(0xa000, 0x0300), two(0xf1b0, 0x0900), "uMumMh", mcfmac },
+{"msacw", 4,  	two(0xa000, 0x0100), two(0xf1b0, 0x0f00), "uMum", mcfmac },
 
-{"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", mcf },
-{"mulsl",	two(0046000,006000), two(0177700,0107770), ";lD3D1",m68020up|cpu32 },
+{"msacw", 4,  	two(0xa000, 0x0100), two(0xf100, 0x0900), "uMumiI4/RneG", mcfemac },/* Ry,Rx,SF,<ea>,accX.  */
+{"msacw", 4,  	two(0xa000, 0x0300), two(0xf100, 0x0900), "uMumMh4/RneG", mcfemac },/* Ry,Rx,+1/-1,<ea>,accX.  */
+{"msacw", 4,  	two(0xa000, 0x0100), two(0xf100, 0x0f00), "uMum4/RneG", mcfemac },/* Ry,Rx,<ea>,accX.  */
+{"msacw", 4,  	two(0xa000, 0x0100), two(0xf130, 0x0900), "uMumiIeH", mcfemac },/* Ry,Rx,SF,accX.  */
+{"msacw", 4,  	two(0xa000, 0x0300), two(0xf130, 0x0900), "uMumMheH", mcfemac },/* Ry,Rx,+1/-1,accX.  */
+{"msacw", 4,  	two(0xa000, 0x0100), two(0xf130, 0x0f00), "uMumeH", mcfemac }, /* Ry,Rx,accX.  */
 
-{"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", mcf },
-{"mulul",	two(0046000,002000), two(0177700,0107770), ";lD3D1",m68020up|cpu32 },
+{"msacl", 4,  	two(0xa080, 0x0900), two(0xf180, 0x0910), "RNRoiI4/Rn", mcfmac },
+{"msacl", 4,  	two(0xa080, 0x0b00), two(0xf180, 0x0910), "RNRoMh4/Rn", mcfmac },
+{"msacl", 4,  	two(0xa080, 0x0900), two(0xf180, 0x0f10), "RNRo4/Rn", mcfmac },
+{"msacl", 4,  	two(0xa000, 0x0900), two(0xf1b0, 0x0b00), "RMRmiI", mcfmac },
+{"msacl", 4,  	two(0xa000, 0x0b00), two(0xf1b0, 0x0b00), "RMRmMh", mcfmac },
+{"msacl", 4,  	two(0xa000, 0x0900), two(0xf1b0, 0x0800), "RMRm", mcfmac },
 
-{"nbcd",	one(0044000),	one(0177700), "$s", m68000up },
+{"msacl", 4,  	two(0xa000, 0x0900), two(0xf100, 0x0900), "R3R1iI4/RneG", mcfemac },
+{"msacl", 4,  	two(0xa000, 0x0b00), two(0xf100, 0x0900), "R3R1Mh4/RneG", mcfemac },
+{"msacl", 4,  	two(0xa000, 0x0900), two(0xf100, 0x0f00), "R3R14/RneG", mcfemac },
+{"msacl", 4,  	two(0xa000, 0x0900), two(0xf130, 0x0900), "RMRmiIeH", mcfemac },
+{"msacl", 4,  	two(0xa000, 0x0b00), two(0xf130, 0x0900), "RMRmMheH", mcfemac },
+{"msacl", 4,  	two(0xa000, 0x0900), two(0xf130, 0x0f00), "RMRmeH", mcfemac },
 
-{"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", mcf},
+{"mulsw", 2,	one(0140700),		one(0170700), ";wDd", m68000up|mcfisa_a },
+{"mulsl", 4,	two(0046000,004000), two(0177700,0107770), ";lD1", m68020up|cpu32 },
+{"mulsl", 4,	two(0046000,004000), two(0177700,0107770), "qsD1", mcfisa_a },
+{"mulsl", 4,	two(0046000,006000), two(0177700,0107770), ";lD3D1",m68020up|cpu32 },
 
-{"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", mcf},
+{"muluw", 2,	one(0140300),		one(0170700), ";wDd", m68000up|mcfisa_a },
+{"mulul", 4,	two(0046000,000000), two(0177700,0107770), ";lD1", m68020up|cpu32 },
+{"mulul", 4,	two(0046000,000000), two(0177700,0107770), "qsD1", mcfisa_a },
+{"mulul", 4,	two(0046000,002000), two(0177700,0107770), ";lD3D1",m68020up|cpu32 },
 
-{"nop",		one(0047161),	one(0177777), "", m68000up | mcf},
+{"nbcd", 2,	one(0044000),	one(0177700), "$s", m68000up },
 
-{"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", mcf},
+{"negb", 2,	one(0042000),	one(0177700), "$s", m68000up },
+{"negw", 2,	one(0042100),	one(0177700), "$s", m68000up },
+{"negl", 2,	one(0042200),	one(0177700), "$s", m68000up },
+{"negl", 2,	one(0042200),	one(0177700), "Ds", mcfisa_a},
 
-{"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", mcf },
-{"ori",		one(0000074),	one(0177777), "#bCs", m68000up },
-{"ori",		one(0000100),	one(0177700), "#w$s", m68000up },
-{"ori",		one(0000174),	one(0177777), "#wSs", m68000up },
+{"negxb", 2,	one(0040000),	one(0177700), "$s", m68000up },
+{"negxw", 2,	one(0040100),	one(0177700), "$s", m68000up },
+{"negxl", 2,	one(0040200),	one(0177700), "$s", m68000up },
+{"negxl", 2,	one(0040200),	one(0177700), "Ds", mcfisa_a},
+
+{"nop", 2,	one(0047161),	one(0177777), "", m68000up | mcfisa_a},
+
+{"notb", 2,	one(0043000),	one(0177700), "$s", m68000up },
+{"notw", 2,	one(0043100),	one(0177700), "$s", m68000up },
+{"notl", 2,	one(0043200),	one(0177700), "$s", m68000up },
+{"notl", 2,	one(0043200),	one(0177700), "Ds", mcfisa_a},
+
+{"orib", 4,	one(0000000),	one(0177700), "#b$s", m68000up },
+{"orib", 4,	one(0000074),	one(0177777), "#bCs", m68000up },
+{"oriw", 4,	one(0000100),	one(0177700), "#w$s", m68000up },
+{"oriw", 4,	one(0000174),	one(0177777), "#wSs", m68000up },
+{"oril", 6,	one(0000200),	one(0177700), "#l$s", m68000up },
+{"oril", 6,	one(0000200),	one(0177700), "#lDs", mcfisa_a },
+{"ori", 4,	one(0000074),	one(0177777), "#bCs", m68000up },
+{"ori", 4,	one(0000100),	one(0177700), "#w$s", m68000up },
+{"ori", 4,	one(0000174),	one(0177777), "#wSs", m68000up },
 
 /* The or opcode can generate the ori instruction.  */
-{"orb",		one(0000000),	one(0177700), "#b$s", m68000up },
-{"orb",		one(0000074),	one(0177777), "#bCs", m68000up },
-{"orb",		one(0100000),	one(0170700), ";bDd", m68000up },
-{"orb",		one(0100400),	one(0170700), "Dd~s", m68000up },
-{"orw",		one(0000100),	one(0177700), "#w$s", m68000up },
-{"orw",		one(0000174),	one(0177777), "#wSs", m68000up },
-{"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", 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 },
-{"or",		one(0100100),	one(0170700), ";wDd", m68000up },
-{"or",		one(0100500),	one(0170700), "Dd~s", m68000up },
+{"orb", 4,	one(0000000),	one(0177700), "#b$s", m68000up },
+{"orb", 4,	one(0000074),	one(0177777), "#bCs", m68000up },
+{"orb", 2,	one(0100000),	one(0170700), ";bDd", m68000up },
+{"orb", 2,	one(0100400),	one(0170700), "Dd~s", m68000up },
+{"orw", 4,	one(0000100),	one(0177700), "#w$s", m68000up },
+{"orw", 4,	one(0000174),	one(0177777), "#wSs", m68000up },
+{"orw", 2,	one(0100100),	one(0170700), ";wDd", m68000up },
+{"orw", 2,	one(0100500),	one(0170700), "Dd~s", m68000up },
+{"orl", 6,	one(0000200),	one(0177700), "#l$s", m68000up },
+{"orl", 6,	one(0000200),	one(0177700), "#lDs", mcfisa_a },
+{"orl", 2,	one(0100200),	one(0170700), ";lDd", m68000up | mcfisa_a },
+{"orl", 2,	one(0100600),	one(0170700), "Dd~s", m68000up | mcfisa_a },
+{"or", 4,	one(0000074),	one(0177777), "#bCs", m68000up },
+{"or", 4,	one(0000100),	one(0177700), "#w$s", m68000up },
+{"or", 4,	one(0000174),	one(0177777), "#wSs", m68000up },
+{"or", 2,	one(0100100),	one(0170700), ";wDd", m68000up },
+{"or", 2,	one(0100500),	one(0170700), "Dd~s", m68000up },
 
-{"pack",	one(0100500),	one(0170770), "DsDd#w", m68020up },
-{"pack",	one(0100510),	one(0170770), "-s-d#w", m68020up },
+{"pack", 4,	one(0100500),	one(0170770), "DsDd#w", m68020up },
+{"pack", 4,	one(0100510),	one(0170770), "-s-d#w", m68020up },
 
-{"pbac",	one(0xf087),		one(0xffbf), "Bc", m68851 },
-{"pbacw",	one(0xf087),		one(0xffff), "BW", m68851 },
-{"pbas",	one(0xf086),		one(0xffbf), "Bc", m68851 },
-{"pbasw",	one(0xf086),		one(0xffff), "BW", m68851 },
-{"pbbc",	one(0xf081),		one(0xffbf), "Bc", m68851 },
-{"pbbcw",	one(0xf081),		one(0xffff), "BW", m68851 },
-{"pbbs",	one(0xf080),		one(0xffbf), "Bc", m68851 },
-{"pbbsw",	one(0xf080),		one(0xffff), "BW", m68851 },
-{"pbcc",	one(0xf08f),		one(0xffbf), "Bc", m68851 },
-{"pbccw",	one(0xf08f),		one(0xffff), "BW", m68851 },
-{"pbcs",	one(0xf08e),		one(0xffbf), "Bc", m68851 },
-{"pbcsw",	one(0xf08e),		one(0xffff), "BW", m68851 },
-{"pbgc",	one(0xf08d),		one(0xffbf), "Bc", m68851 },
-{"pbgcw",	one(0xf08d),		one(0xffff), "BW", m68851 },
-{"pbgs",	one(0xf08c),		one(0xffbf), "Bc", m68851 },
-{"pbgsw",	one(0xf08c),		one(0xffff), "BW", m68851 },
-{"pbic",	one(0xf08b),		one(0xffbf), "Bc", m68851 },
-{"pbicw",	one(0xf08b),		one(0xffff), "BW", m68851 },
-{"pbis",	one(0xf08a),		one(0xffbf), "Bc", m68851 },
-{"pbisw",	one(0xf08a),		one(0xffff), "BW", m68851 },
-{"pblc",	one(0xf083),		one(0xffbf), "Bc", m68851 },
-{"pblcw",	one(0xf083),		one(0xffff), "BW", m68851 },
-{"pbls",	one(0xf082),		one(0xffbf), "Bc", m68851 },
-{"pblsw",	one(0xf082),		one(0xffff), "BW", m68851 },
-{"pbsc",	one(0xf085),		one(0xffbf), "Bc", m68851 },
-{"pbscw",	one(0xf085),		one(0xffff), "BW", m68851 },
-{"pbss",	one(0xf084),		one(0xffbf), "Bc", m68851 },
-{"pbssw",	one(0xf084),		one(0xffff), "BW", m68851 },
-{"pbwc",	one(0xf089),		one(0xffbf), "Bc", m68851 },
-{"pbwcw",	one(0xf089),		one(0xffff), "BW", m68851 },
-{"pbws",	one(0xf088),		one(0xffbf), "Bc", m68851 },
-{"pbwsw",	one(0xf088),		one(0xffff), "BW", m68851 },
+{"pbac", 2,	one(0xf087),	one(0xffbf), "Bc", m68851 },
+{"pbacw", 2,	one(0xf087),	one(0xffff), "BW", m68851 },
+{"pbas", 2,	one(0xf086),	one(0xffbf), "Bc", m68851 },
+{"pbasw", 2,	one(0xf086),	one(0xffff), "BW", m68851 },
+{"pbbc", 2,	one(0xf081),	one(0xffbf), "Bc", m68851 },
+{"pbbcw", 2,	one(0xf081),	one(0xffff), "BW", m68851 },
+{"pbbs", 2,	one(0xf080),	one(0xffbf), "Bc", m68851 },
+{"pbbsw", 2,	one(0xf080),	one(0xffff), "BW", m68851 },
+{"pbcc", 2,	one(0xf08f),	one(0xffbf), "Bc", m68851 },
+{"pbccw", 2,	one(0xf08f),	one(0xffff), "BW", m68851 },
+{"pbcs", 2,	one(0xf08e),	one(0xffbf), "Bc", m68851 },
+{"pbcsw", 2,	one(0xf08e),	one(0xffff), "BW", m68851 },
+{"pbgc", 2,	one(0xf08d),	one(0xffbf), "Bc", m68851 },
+{"pbgcw", 2,	one(0xf08d),	one(0xffff), "BW", m68851 },
+{"pbgs", 2,	one(0xf08c),	one(0xffbf), "Bc", m68851 },
+{"pbgsw", 2,	one(0xf08c),	one(0xffff), "BW", m68851 },
+{"pbic", 2,	one(0xf08b),	one(0xffbf), "Bc", m68851 },
+{"pbicw", 2,	one(0xf08b),	one(0xffff), "BW", m68851 },
+{"pbis", 2,	one(0xf08a),	one(0xffbf), "Bc", m68851 },
+{"pbisw", 2,	one(0xf08a),	one(0xffff), "BW", m68851 },
+{"pblc", 2,	one(0xf083),	one(0xffbf), "Bc", m68851 },
+{"pblcw", 2,	one(0xf083),	one(0xffff), "BW", m68851 },
+{"pbls", 2,	one(0xf082),	one(0xffbf), "Bc", m68851 },
+{"pblsw", 2,	one(0xf082),	one(0xffff), "BW", m68851 },
+{"pbsc", 2,	one(0xf085),	one(0xffbf), "Bc", m68851 },
+{"pbscw", 2,	one(0xf085),	one(0xffff), "BW", m68851 },
+{"pbss", 2,	one(0xf084),	one(0xffbf), "Bc", m68851 },
+{"pbssw", 2,	one(0xf084),	one(0xffff), "BW", m68851 },
+{"pbwc", 2,	one(0xf089),	one(0xffbf), "Bc", m68851 },
+{"pbwcw", 2,	one(0xf089),	one(0xffff), "BW", m68851 },
+{"pbws", 2,	one(0xf088),	one(0xffbf), "Bc", m68851 },
+{"pbwsw", 2,	one(0xf088),	one(0xffff), "BW", m68851 },
 
-{"pdbac",	two(0xf048, 0x0007),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbas",	two(0xf048, 0x0006),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbbc",	two(0xf048, 0x0001),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbbs",	two(0xf048, 0x0000),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbcc",	two(0xf048, 0x000f),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbcs",	two(0xf048, 0x000e),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbgc",	two(0xf048, 0x000d),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbgs",	two(0xf048, 0x000c),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbic",	two(0xf048, 0x000b),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbis",	two(0xf048, 0x000a),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdblc",	two(0xf048, 0x0003),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbls",	two(0xf048, 0x0002),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbsc",	two(0xf048, 0x0005),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbss",	two(0xf048, 0x0004),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbwc",	two(0xf048, 0x0009),	two(0xfff8, 0xffff), "DsBw", m68851 },
-{"pdbws",	two(0xf048, 0x0008),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbac", 4,	two(0xf048, 0x0007),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbas", 4,	two(0xf048, 0x0006),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbbc", 4,	two(0xf048, 0x0001),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbbs", 4,	two(0xf048, 0x0000),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbcc", 4,	two(0xf048, 0x000f),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbcs", 4,	two(0xf048, 0x000e),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbgc", 4,	two(0xf048, 0x000d),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbgs", 4,	two(0xf048, 0x000c),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbic", 4,	two(0xf048, 0x000b),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbis", 4,	two(0xf048, 0x000a),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdblc", 4,	two(0xf048, 0x0003),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbls", 4,	two(0xf048, 0x0002),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbsc", 4,	two(0xf048, 0x0005),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbss", 4,	two(0xf048, 0x0004),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbwc", 4,	two(0xf048, 0x0009),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbws", 4,	two(0xf048, 0x0008),	two(0xfff8, 0xffff), "DsBw", m68851 },
 
-{"pea",		one(0044100),		one(0177700), "!s", m68000up|mcf },
+{"pea", 2,	one(0044100),		one(0177700), "!s", m68000up|mcfisa_a },
 
-{"pflusha",	one(0xf518),		one(0xfff8), "", m68040up },
-{"pflusha",	two(0xf000,0x2400), two(0xffff,0xffff), "", m68030 | m68851 },
+{"pflusha", 2,	one(0xf518),		one(0xfff8), "", m68040up },
+{"pflusha", 4,	two(0xf000,0x2400), two(0xffff,0xffff), "", m68030 | m68851 },
 
-{"pflush",   two(0xf000,0x3010), two(0xffc0,0xfe10), "T3T9", m68030|m68851 },
-{"pflush",   two(0xf000,0x3810), two(0xffc0,0xfe10), "T3T9&s", m68030|m68851 },
-{"pflush",   two(0xf000,0x3008), two(0xffc0,0xfe18), "D3T9", m68030|m68851 },
-{"pflush",   two(0xf000,0x3808), two(0xffc0,0xfe18), "D3T9&s", m68030|m68851 },
-{"pflush",   two(0xf000,0x3000), two(0xffc0,0xfe1e), "f3T9", m68030|m68851 },
-{"pflush",   two(0xf000,0x3800), two(0xffc0,0xfe1e), "f3T9&s", m68030|m68851 },
-{"pflush",	one(0xf508),		one(0xfff8), "as", m68040up },
-{"pflush",	one(0xf508),		one(0xfff8), "As", m68040up },
+{"pflush", 4,   two(0xf000,0x3010), two(0xffc0,0xfe10), "T3T9", m68030|m68851 },
+{"pflush", 4,   two(0xf000,0x3810), two(0xffc0,0xfe10), "T3T9&s", m68030|m68851 },
+{"pflush", 4,   two(0xf000,0x3008), two(0xffc0,0xfe18), "D3T9", m68030|m68851 },
+{"pflush", 4,   two(0xf000,0x3808), two(0xffc0,0xfe18), "D3T9&s", m68030|m68851 },
+{"pflush", 4,   two(0xf000,0x3000), two(0xffc0,0xfe1e), "f3T9", m68030|m68851 },
+{"pflush", 4,   two(0xf000,0x3800), two(0xffc0,0xfe1e), "f3T9&s", m68030|m68851 },
+{"pflush", 2,	one(0xf508),		one(0xfff8), "as", m68040up },
+{"pflush", 2,	one(0xf508),		one(0xfff8), "As", m68040up },
 
-{"pflushan",	one(0xf510),		one(0xfff8), "", m68040up },
-{"pflushn",	one(0xf500),		one(0xfff8), "as", m68040up },
-{"pflushn",	one(0xf500),		one(0xfff8), "As", m68040up },
+{"pflushan", 2,	one(0xf510),		one(0xfff8), "", m68040up },
+{"pflushn", 2,	one(0xf500),		one(0xfff8), "as", m68040up },
+{"pflushn", 2,	one(0xf500),		one(0xfff8), "As", m68040up },
 
-{"pflushr",	two(0xf000, 0xa000), two(0xffc0, 0xffff), "|s", m68851 },
+{"pflushr", 4,	two(0xf000, 0xa000), two(0xffc0, 0xffff), "|s", m68851 },
 
-{"pflushs",	two(0xf000, 0x3410), two(0xfff8, 0xfe10), "T3T9", m68851 },
-{"pflushs",	two(0xf000, 0x3c10), two(0xfff8, 0xfe10), "T3T9&s", m68851 },
-{"pflushs",	two(0xf000, 0x3408), two(0xfff8, 0xfe18), "D3T9", m68851 },
-{"pflushs",	two(0xf000, 0x3c08), two(0xfff8, 0xfe18), "D3T9&s", m68851 },
-{"pflushs",	two(0xf000, 0x3400), two(0xfff8, 0xfe1e), "f3T9", m68851 },
-{"pflushs",	two(0xf000, 0x3c00), two(0xfff8, 0xfe1e), "f3T9&s", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3410), two(0xfff8, 0xfe10), "T3T9", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3c10), two(0xfff8, 0xfe10), "T3T9&s", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3408), two(0xfff8, 0xfe18), "D3T9", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3c08), two(0xfff8, 0xfe18), "D3T9&s", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3400), two(0xfff8, 0xfe1e), "f3T9", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3c00), two(0xfff8, 0xfe1e), "f3T9&s", m68851 },
 
-{"ploadr",     two(0xf000,0x2210), two(0xffc0,0xfff0), "T3&s", m68030|m68851 },
-{"ploadr",     two(0xf000,0x2208), two(0xffc0,0xfff8), "D3&s", m68030|m68851 },
-{"ploadr",     two(0xf000,0x2200), two(0xffc0,0xfffe), "f3&s", m68030|m68851 },
-{"ploadw",     two(0xf000,0x2010), two(0xffc0,0xfff0), "T3&s", m68030|m68851 },
-{"ploadw",     two(0xf000,0x2008), two(0xffc0,0xfff8), "D3&s", m68030|m68851 },
-{"ploadw",     two(0xf000,0x2000), two(0xffc0,0xfffe), "f3&s", m68030|m68851 },
+{"ploadr", 4,   two(0xf000,0x2210), two(0xffc0,0xfff0), "T3&s", m68030|m68851 },
+{"ploadr", 4,   two(0xf000,0x2208), two(0xffc0,0xfff8), "D3&s", m68030|m68851 },
+{"ploadr", 4,   two(0xf000,0x2200), two(0xffc0,0xfffe), "f3&s", m68030|m68851 },
+{"ploadw", 4,   two(0xf000,0x2010), two(0xffc0,0xfff0), "T3&s", m68030|m68851 },
+{"ploadw", 4,   two(0xf000,0x2008), two(0xffc0,0xfff8), "D3&s", m68030|m68851 },
+{"ploadw", 4,   two(0xf000,0x2000), two(0xffc0,0xfffe), "f3&s", m68030|m68851 },
 
-{"plpar",	one(0xf5c8),		one(0xfff8), "as", m68060 },
-{"plpaw",	one(0xf588),		one(0xfff8), "as", m68060 },
+{"plpar", 2,	one(0xf5c8),		one(0xfff8), "as", m68060 },
+{"plpaw", 2,	one(0xf588),		one(0xfff8), "as", m68060 },
 
-{"pmove",      two(0xf000,0x4000), two(0xffc0,0xffff), "*l08", m68030|m68851 },
-{"pmove",      two(0xf000,0x5c00), two(0xffc0,0xffff), "*w18", m68851 },
-{"pmove",      two(0xf000,0x4000), two(0xffc0,0xe3ff), "*b28", m68851 },
-{"pmove",      two(0xf000,0x4200), two(0xffc0,0xffff), "08%s", m68030|m68851 },
-{"pmove",      two(0xf000,0x5e00), two(0xffc0,0xffff), "18%s", m68851 },
-{"pmove",      two(0xf000,0x4200), two(0xffc0,0xe3ff), "28%s", m68851 },
-{"pmove",      two(0xf000,0x4000), two(0xffc0,0xe3ff), "|sW8", m68030|m68851 },
-{"pmove",      two(0xf000,0x4200), two(0xffc0,0xe3ff), "W8~s", m68030|m68851 },
-{"pmove",      two(0xf000,0x6200), two(0xffc0,0xe3e3), "*wX3", m68851 },
-{"pmove",      two(0xf000,0x6000), two(0xffc0,0xe3e3), "X3%s", m68851 },
-{"pmove",      two(0xf000,0x6000), two(0xffc0,0xffff), "*wY8", m68030|m68851 },
-{"pmove",      two(0xf000,0x6200), two(0xffc0,0xffff), "Y8%s", m68030|m68851 },
-{"pmove",      two(0xf000,0x6600), two(0xffc0,0xffff), "Z8%s", m68851 },
-{"pmove",      two(0xf000,0x0800), two(0xffc0,0xfbff), "*l38", m68030 },
-{"pmove",      two(0xf000,0x0a00), two(0xffc0,0xfbff), "38%s", m68030 },
+{"pmove", 4,    two(0xf000,0x4000), two(0xffc0,0xffff), "*l08", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x5c00), two(0xffc0,0xffff), "*w18", m68851 },
+{"pmove", 4,    two(0xf000,0x4000), two(0xffc0,0xe3ff), "*b28", m68851 },
+{"pmove", 4,    two(0xf000,0x4200), two(0xffc0,0xffff), "08%s", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x5e00), two(0xffc0,0xffff), "18%s", m68851 },
+{"pmove", 4,    two(0xf000,0x4200), two(0xffc0,0xe3ff), "28%s", m68851 },
+{"pmove", 4,    two(0xf000,0x4000), two(0xffc0,0xe3ff), "|sW8", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x4200), two(0xffc0,0xe3ff), "W8~s", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x6200), two(0xffc0,0xe3e3), "*wX3", m68851 },
+{"pmove", 4,    two(0xf000,0x6000), two(0xffc0,0xe3e3), "X3%s", m68851 },
+{"pmove", 4,    two(0xf000,0x6000), two(0xffc0,0xffff), "*wY8", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x6200), two(0xffc0,0xffff), "Y8%s", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x6600), two(0xffc0,0xffff), "Z8%s", m68851 },
+{"pmove", 4,    two(0xf000,0x0800), two(0xffc0,0xfbff), "*l38", m68030 },
+{"pmove", 4,    two(0xf000,0x0a00), two(0xffc0,0xfbff), "38%s", m68030 },
 
-{"pmovefd",	two(0xf000, 0x4100),	two(0xffc0, 0xe3ff), "*l08", m68030 },
-{"pmovefd",	two(0xf000, 0x4100),	two(0xffc0, 0xe3ff), "|sW8", m68030 },
-{"pmovefd",	two(0xf000, 0x0900),	two(0xffc0, 0xfbff), "*l38", m68030 },
+{"pmovefd", 4,	two(0xf000, 0x4100),	two(0xffc0, 0xe3ff), "*l08", m68030 },
+{"pmovefd", 4,	two(0xf000, 0x4100),	two(0xffc0, 0xe3ff), "|sW8", m68030 },
+{"pmovefd", 4,	two(0xf000, 0x0900),	two(0xffc0, 0xfbff), "*l38", m68030 },
 
-{"prestore",	one(0xf140),		one(0xffc0), "<s", m68851 },
+{"prestore", 2,	one(0xf140),		one(0xffc0), "<s", m68851 },
 
-{"psave",	one(0xf100),		one(0xffc0), ">s", m68851 },
+{"psave", 2,	one(0xf100),		one(0xffc0), ">s", m68851 },
 
-{"psac",	two(0xf040, 0x0007),	two(0xffc0, 0xffff), "$s", m68851 },
-{"psas",	two(0xf040, 0x0006),	two(0xffc0, 0xffff), "$s", m68851 },
-{"psbc",	two(0xf040, 0x0001),	two(0xffc0, 0xffff), "$s", m68851 },
-{"psbs",	two(0xf040, 0x0000),	two(0xffc0, 0xffff), "$s", m68851 },
-{"pscc",	two(0xf040, 0x000f),	two(0xffc0, 0xffff), "$s", m68851 },
-{"pscs",	two(0xf040, 0x000e),	two(0xffc0, 0xffff), "$s", m68851 },
-{"psgc",	two(0xf040, 0x000d),	two(0xffc0, 0xffff), "$s", m68851 },
-{"psgs",	two(0xf040, 0x000c),	two(0xffc0, 0xffff), "$s", m68851 },
-{"psic",	two(0xf040, 0x000b),	two(0xffc0, 0xffff), "$s", m68851 },
-{"psis",	two(0xf040, 0x000a),	two(0xffc0, 0xffff), "$s", m68851 },
-{"pslc",	two(0xf040, 0x0003),	two(0xffc0, 0xffff), "$s", m68851 },
-{"psls",	two(0xf040, 0x0002),	two(0xffc0, 0xffff), "$s", m68851 },
-{"pssc",	two(0xf040, 0x0005),	two(0xffc0, 0xffff), "$s", m68851 },
-{"psss",	two(0xf040, 0x0004),	two(0xffc0, 0xffff), "$s", m68851 },
-{"pswc",	two(0xf040, 0x0009),	two(0xffc0, 0xffff), "$s", m68851 },
-{"psws",	two(0xf040, 0x0008),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psac", 4,	two(0xf040, 0x0007),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psas", 4,	two(0xf040, 0x0006),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psbc", 4,	two(0xf040, 0x0001),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psbs", 4,	two(0xf040, 0x0000),	two(0xffc0, 0xffff), "$s", m68851 },
+{"pscc", 4,	two(0xf040, 0x000f),	two(0xffc0, 0xffff), "$s", m68851 },
+{"pscs", 4,	two(0xf040, 0x000e),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psgc", 4,	two(0xf040, 0x000d),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psgs", 4,	two(0xf040, 0x000c),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psic", 4,	two(0xf040, 0x000b),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psis", 4,	two(0xf040, 0x000a),	two(0xffc0, 0xffff), "$s", m68851 },
+{"pslc", 4,	two(0xf040, 0x0003),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psls", 4,	two(0xf040, 0x0002),	two(0xffc0, 0xffff), "$s", m68851 },
+{"pssc", 4,	two(0xf040, 0x0005),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psss", 4,	two(0xf040, 0x0004),	two(0xffc0, 0xffff), "$s", m68851 },
+{"pswc", 4,	two(0xf040, 0x0009),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psws", 4,	two(0xf040, 0x0008),	two(0xffc0, 0xffff), "$s", m68851 },
 
-{"ptestr", two(0xf000,0x8210), two(0xffc0, 0xe3f0), "T3&st8", m68030|m68851 },
-{"ptestr", two(0xf000,0x8310), two(0xffc0,0xe310), "T3&st8A9", m68030|m68851 },
-{"ptestr", two(0xf000,0x8208), two(0xffc0,0xe3f8), "D3&st8", m68030|m68851 },
-{"ptestr", two(0xf000,0x8308), two(0xffc0,0xe318), "D3&st8A9", m68030|m68851 },
-{"ptestr", two(0xf000,0x8200), two(0xffc0,0xe3fe), "f3&st8", m68030|m68851 },
-{"ptestr", two(0xf000,0x8300), two(0xffc0,0xe31e), "f3&st8A9", m68030|m68851 },
-{"ptestr",	one(0xf568),		one(0xfff8), "as", m68040 },
+{"ptestr", 4, 	two(0xf000,0x8210), two(0xffc0, 0xe3f0), "T3&st8", m68030|m68851 },
+{"ptestr", 4, 	two(0xf000,0x8310), two(0xffc0,0xe310), "T3&st8A9", m68030|m68851 },
+{"ptestr", 4, 	two(0xf000,0x8208), two(0xffc0,0xe3f8), "D3&st8", m68030|m68851 },
+{"ptestr", 4, 	two(0xf000,0x8308), two(0xffc0,0xe318), "D3&st8A9", m68030|m68851 },
+{"ptestr", 4, 	two(0xf000,0x8200), two(0xffc0,0xe3fe), "f3&st8", m68030|m68851 },
+{"ptestr", 4, 	two(0xf000,0x8300), two(0xffc0,0xe31e), "f3&st8A9", m68030|m68851 },
+{"ptestr", 2,	one(0xf568),		one(0xfff8), "as", m68040 },
 
-{"ptestw", two(0xf000,0x8010), two(0xffc0,0xe3f0), "T3&st8", m68030|m68851 },
-{"ptestw", two(0xf000,0x8110), two(0xffc0,0xe310), "T3&st8A9", m68030|m68851 },
-{"ptestw", two(0xf000,0x8008), two(0xffc0,0xe3f8), "D3&st8", m68030|m68851 },
-{"ptestw", two(0xf000,0x8108), two(0xffc0,0xe318), "D3&st8A9", m68030|m68851 },
-{"ptestw", two(0xf000,0x8000), two(0xffc0,0xe3fe), "f3&st8", m68030|m68851 },
-{"ptestw", two(0xf000,0x8100), two(0xffc0,0xe31e), "f3&st8A9", m68030|m68851 },
-{"ptestw",	one(0xf548),		one(0xfff8), "as", m68040 },
+{"ptestw", 4, 	two(0xf000,0x8010), two(0xffc0,0xe3f0), "T3&st8", m68030|m68851 },
+{"ptestw", 4, 	two(0xf000,0x8110), two(0xffc0,0xe310), "T3&st8A9", m68030|m68851 },
+{"ptestw", 4, 	two(0xf000,0x8008), two(0xffc0,0xe3f8), "D3&st8", m68030|m68851 },
+{"ptestw", 4, 	two(0xf000,0x8108), two(0xffc0,0xe318), "D3&st8A9", m68030|m68851 },
+{"ptestw", 4, 	two(0xf000,0x8000), two(0xffc0,0xe3fe), "f3&st8", m68030|m68851 },
+{"ptestw", 4, 	two(0xf000,0x8100), two(0xffc0,0xe31e), "f3&st8A9", m68030|m68851 },
+{"ptestw", 2,	one(0xf548),		one(0xfff8), "as", m68040 },
 
-{"ptrapacw",	two(0xf07a, 0x0007),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapacl",	two(0xf07b, 0x0007),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapac",	two(0xf07c, 0x0007),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapacw", 6,	two(0xf07a, 0x0007),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapacl", 6,	two(0xf07b, 0x0007),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapac", 4,	two(0xf07c, 0x0007),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapasw",	two(0xf07a, 0x0006),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapasl",	two(0xf07b, 0x0006),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapas",	two(0xf07c, 0x0006),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapasw", 6,	two(0xf07a, 0x0006),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapasl", 6,	two(0xf07b, 0x0006),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapas", 4,	two(0xf07c, 0x0006),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapbcw",	two(0xf07a, 0x0001),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapbcl",	two(0xf07b, 0x0001),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapbc",	two(0xf07c, 0x0001),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapbcw", 6,	two(0xf07a, 0x0001),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapbcl", 6,	two(0xf07b, 0x0001),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapbc", 4,	two(0xf07c, 0x0001),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapbsw",	two(0xf07a, 0x0000),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapbsl",	two(0xf07b, 0x0000),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapbs",	two(0xf07c, 0x0000),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapbsw", 6,	two(0xf07a, 0x0000),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapbsl", 6,	two(0xf07b, 0x0000),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapbs", 4,	two(0xf07c, 0x0000),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapccw",	two(0xf07a, 0x000f),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapccl",	two(0xf07b, 0x000f),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapcc",	two(0xf07c, 0x000f),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapccw", 6,	two(0xf07a, 0x000f),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapccl", 6,	two(0xf07b, 0x000f),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapcc", 4,	two(0xf07c, 0x000f),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapcsw",	two(0xf07a, 0x000e),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapcsl",	two(0xf07b, 0x000e),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapcs",	two(0xf07c, 0x000e),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapcsw", 6,	two(0xf07a, 0x000e),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapcsl", 6,	two(0xf07b, 0x000e),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapcs", 4,	two(0xf07c, 0x000e),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapgcw",	two(0xf07a, 0x000d),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapgcl",	two(0xf07b, 0x000d),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapgc",	two(0xf07c, 0x000d),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapgcw", 6,	two(0xf07a, 0x000d),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapgcl", 6,	two(0xf07b, 0x000d),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapgc", 4,	two(0xf07c, 0x000d),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapgsw",	two(0xf07a, 0x000c),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapgsl",	two(0xf07b, 0x000c),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapgs",	two(0xf07c, 0x000c),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapgsw", 6,	two(0xf07a, 0x000c),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapgsl", 6,	two(0xf07b, 0x000c),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapgs", 4,	two(0xf07c, 0x000c),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapicw",	two(0xf07a, 0x000b),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapicl",	two(0xf07b, 0x000b),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapic",	two(0xf07c, 0x000b),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapicw", 6,	two(0xf07a, 0x000b),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapicl", 6,	two(0xf07b, 0x000b),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapic", 4,	two(0xf07c, 0x000b),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapisw",	two(0xf07a, 0x000a),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapisl",	two(0xf07b, 0x000a),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapis",	two(0xf07c, 0x000a),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapisw", 6,	two(0xf07a, 0x000a),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapisl", 6,	two(0xf07b, 0x000a),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapis", 4,	two(0xf07c, 0x000a),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptraplcw",	two(0xf07a, 0x0003),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptraplcl",	two(0xf07b, 0x0003),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptraplc",	two(0xf07c, 0x0003),	two(0xffff, 0xffff), "",   m68851 },
+{"ptraplcw", 6,	two(0xf07a, 0x0003),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptraplcl", 6,	two(0xf07b, 0x0003),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptraplc", 4,	two(0xf07c, 0x0003),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptraplsw",	two(0xf07a, 0x0002),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptraplsl",	two(0xf07b, 0x0002),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapls",	two(0xf07c, 0x0002),	two(0xffff, 0xffff), "",   m68851 },
+{"ptraplsw", 6,	two(0xf07a, 0x0002),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptraplsl", 6,	two(0xf07b, 0x0002),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapls", 4,	two(0xf07c, 0x0002),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapscw",	two(0xf07a, 0x0005),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapscl",	two(0xf07b, 0x0005),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapsc",	two(0xf07c, 0x0005),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapscw", 6,	two(0xf07a, 0x0005),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapscl", 6,	two(0xf07b, 0x0005),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapsc", 4,	two(0xf07c, 0x0005),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapssw",	two(0xf07a, 0x0004),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapssl",	two(0xf07b, 0x0004),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapss",	two(0xf07c, 0x0004),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapssw", 6,	two(0xf07a, 0x0004),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapssl", 6,	two(0xf07b, 0x0004),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapss", 4,	two(0xf07c, 0x0004),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapwcw",	two(0xf07a, 0x0009),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapwcl",	two(0xf07b, 0x0009),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapwc",	two(0xf07c, 0x0009),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapwcw", 6,	two(0xf07a, 0x0009),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapwcl", 6,	two(0xf07b, 0x0009),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapwc", 4,	two(0xf07c, 0x0009),	two(0xffff, 0xffff), "",   m68851 },
 
-{"ptrapwsw",	two(0xf07a, 0x0008),	two(0xffff, 0xffff), "#w", m68851 },
-{"ptrapwsl",	two(0xf07b, 0x0008),	two(0xffff, 0xffff), "#l", m68851 },
-{"ptrapws",	two(0xf07c, 0x0008),	two(0xffff, 0xffff), "",   m68851 },
+{"ptrapwsw", 6,	two(0xf07a, 0x0008),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapwsl", 6,	two(0xf07b, 0x0008),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapws", 4,	two(0xf07c, 0x0008),	two(0xffff, 0xffff), "",   m68851 },
 
-{"pulse",	one(0045314),		one(0177777), "", m68060 | mcf },
+{"pulse", 2,	one(0045314),		one(0177777), "", m68060 | mcfisa_a },
 
-{"pvalid",	two(0xf000, 0x2800),	two(0xffc0, 0xffff), "Vs&s", m68851 },
-{"pvalid",	two(0xf000, 0x2c00),	two(0xffc0, 0xfff8), "A3&s", m68851 },
+{"pvalid", 4,	two(0xf000, 0x2800),	two(0xffc0, 0xffff), "Vs&s", m68851 },
+{"pvalid", 4,	two(0xf000, 0x2c00),	two(0xffc0, 0xfff8), "A3&s", m68851 },
 
   /* FIXME: don't allow Dw==Dx. */
-{"remsl",       two(0x4c40, 0x0800),    two(0xffc0, 0x8ff8), "qsD3D1", mcf5206eup },
-{"remul",       two(0x4c40, 0x0000),    two(0xffc0, 0x8ff8), "qsD3D1", mcf5206eup },
+{"remsl", 4,    two(0x4c40, 0x0800),    two(0xffc0, 0x8ff8), "qsD3D1", mcfhwdiv },
+{"remul", 4,    two(0x4c40, 0x0000),    two(0xffc0, 0x8ff8), "qsD3D1", mcfhwdiv },
 
-{"reset",	one(0047160),		one(0177777), "", m68000up },
+{"reset", 2,	one(0047160),		one(0177777), "", m68000up },
 
-{"rolb",	one(0160430),		one(0170770), "QdDs", m68000up },
-{"rolb",	one(0160470),		one(0170770), "DdDs", m68000up },
-{"rolw",	one(0160530),		one(0170770), "QdDs", m68000up },
-{"rolw",	one(0160570),		one(0170770), "DdDs", m68000up },
-{"rolw",	one(0163700),		one(0177700), "~s",   m68000up },
-{"roll",	one(0160630),		one(0170770), "QdDs", m68000up },
-{"roll",	one(0160670),		one(0170770), "DdDs", m68000up },
+{"rolb", 2,	one(0160430),		one(0170770), "QdDs", m68000up },
+{"rolb", 2,	one(0160470),		one(0170770), "DdDs", m68000up },
+{"rolw", 2,	one(0160530),		one(0170770), "QdDs", m68000up },
+{"rolw", 2,	one(0160570),		one(0170770), "DdDs", m68000up },
+{"rolw", 2,	one(0163700),		one(0177700), "~s",   m68000up },
+{"roll", 2,	one(0160630),		one(0170770), "QdDs", m68000up },
+{"roll", 2,	one(0160670),		one(0170770), "DdDs", m68000up },
 
-{"rorb",	one(0160030),		one(0170770), "QdDs", m68000up },
-{"rorb",	one(0160070),		one(0170770), "DdDs", m68000up },
-{"rorw",	one(0160130),		one(0170770), "QdDs", m68000up },
-{"rorw",	one(0160170),		one(0170770), "DdDs", m68000up },
-{"rorw",	one(0163300),		one(0177700), "~s",   m68000up },
-{"rorl",	one(0160230),		one(0170770), "QdDs", m68000up },
-{"rorl",	one(0160270),		one(0170770), "DdDs", m68000up },
+{"rorb", 2,	one(0160030),		one(0170770), "QdDs", m68000up },
+{"rorb", 2,	one(0160070),		one(0170770), "DdDs", m68000up },
+{"rorw", 2,	one(0160130),		one(0170770), "QdDs", m68000up },
+{"rorw", 2,	one(0160170),		one(0170770), "DdDs", m68000up },
+{"rorw", 2,	one(0163300),		one(0177700), "~s",   m68000up },
+{"rorl", 2,	one(0160230),		one(0170770), "QdDs", m68000up },
+{"rorl", 2,	one(0160270),		one(0170770), "DdDs", m68000up },
 
-{"roxlb",	one(0160420),		one(0170770), "QdDs", m68000up },
-{"roxlb",	one(0160460),		one(0170770), "DdDs", m68000up },
-{"roxlw",	one(0160520),		one(0170770), "QdDs", m68000up },
-{"roxlw",	one(0160560),		one(0170770), "DdDs", m68000up },
-{"roxlw",	one(0162700),		one(0177700), "~s",   m68000up },
-{"roxll",	one(0160620),		one(0170770), "QdDs", m68000up },
-{"roxll",	one(0160660),		one(0170770), "DdDs", m68000up },
+{"roxlb", 2,	one(0160420),		one(0170770), "QdDs", m68000up },
+{"roxlb", 2,	one(0160460),		one(0170770), "DdDs", m68000up },
+{"roxlw", 2,	one(0160520),		one(0170770), "QdDs", m68000up },
+{"roxlw", 2,	one(0160560),		one(0170770), "DdDs", m68000up },
+{"roxlw", 2,	one(0162700),		one(0177700), "~s",   m68000up },
+{"roxll", 2,	one(0160620),		one(0170770), "QdDs", m68000up },
+{"roxll", 2,	one(0160660),		one(0170770), "DdDs", m68000up },
 
-{"roxrb",	one(0160020),		one(0170770), "QdDs", m68000up },
-{"roxrb",	one(0160060),		one(0170770), "DdDs", m68000up },
-{"roxrw",	one(0160120),		one(0170770), "QdDs", m68000up },
-{"roxrw",	one(0160160),		one(0170770), "DdDs", m68000up },
-{"roxrw",	one(0162300),		one(0177700), "~s",   m68000up },
-{"roxrl",	one(0160220),		one(0170770), "QdDs", m68000up },
-{"roxrl",	one(0160260),		one(0170770), "DdDs", m68000up },
+{"roxrb", 2,	one(0160020),		one(0170770), "QdDs", m68000up },
+{"roxrb", 2,	one(0160060),		one(0170770), "DdDs", m68000up },
+{"roxrw", 2,	one(0160120),		one(0170770), "QdDs", m68000up },
+{"roxrw", 2,	one(0160160),		one(0170770), "DdDs", m68000up },
+{"roxrw", 2,	one(0162300),		one(0177700), "~s",   m68000up },
+{"roxrl", 2,	one(0160220),		one(0170770), "QdDs", m68000up },
+{"roxrl", 2,	one(0160260),		one(0170770), "DdDs", m68000up },
 
-{"rtd",		one(0047164),		one(0177777), "#w", m68010up },
+{"rtd", 4,	one(0047164),		one(0177777), "#w", m68010up },
+		
+{"rte", 2,	one(0047163),		one(0177777), "",   m68000up | mcfisa_a },
+		
+{"rtm", 2,	one(0003300),		one(0177760), "Rs", m68020 },
+		
+{"rtr", 2,	one(0047167),		one(0177777), "",   m68000up },
+		
+{"rts", 2,	one(0047165),		one(0177777), "",   m68000up | mcfisa_a },
 
-{"rte",		one(0047163),		one(0177777), "",   m68000up | mcf },
+{"satsl", 2,	one(0046200),		one(0177770), "Ds", mcfisa_b },
 
-{"rtm",		one(0003300),		one(0177760), "Rs", m68020 },
+{"sbcd", 2,	one(0100400),		one(0170770), "DsDd", m68000up },
+{"sbcd", 2,	one(0100410),		one(0170770), "-s-d", m68000up },
 
-{"rtr",		one(0047167),		one(0177777), "",   m68000up },
+{"scc", 2,	one(0052300),	one(0177700), "$s", m68000up },
+{"scc", 2,	one(0052300),	one(0177700), "Ds", mcfisa_a },
+{"scs", 2,	one(0052700),	one(0177700), "$s", m68000up },
+{"scs", 2,	one(0052700),	one(0177700), "Ds", mcfisa_a },
+{"seq", 2,	one(0053700),	one(0177700), "$s", m68000up },
+{"seq", 2,	one(0053700),	one(0177700), "Ds", mcfisa_a },
+{"sf", 2,	one(0050700),	one(0177700), "$s", m68000up },
+{"sf", 2,	one(0050700),	one(0177700), "Ds", mcfisa_a },
+{"sge", 2,	one(0056300),	one(0177700), "$s", m68000up },
+{"sge", 2,	one(0056300),	one(0177700), "Ds", mcfisa_a },
+{"sgt", 2,	one(0057300),	one(0177700), "$s", m68000up },
+{"sgt", 2,	one(0057300),	one(0177700), "Ds", mcfisa_a },
+{"shi", 2,	one(0051300),	one(0177700), "$s", m68000up },
+{"shi", 2,	one(0051300),	one(0177700), "Ds", mcfisa_a },
+{"sle", 2,	one(0057700),	one(0177700), "$s", m68000up },
+{"sle", 2,	one(0057700),	one(0177700), "Ds", mcfisa_a },
+{"sls", 2,	one(0051700),	one(0177700), "$s", m68000up },
+{"sls", 2,	one(0051700),	one(0177700), "Ds", mcfisa_a },
+{"slt", 2,	one(0056700),	one(0177700), "$s", m68000up },
+{"slt", 2,	one(0056700),	one(0177700), "Ds", mcfisa_a },
+{"smi", 2,	one(0055700),	one(0177700), "$s", m68000up },
+{"smi", 2,	one(0055700),	one(0177700), "Ds", mcfisa_a },
+{"sne", 2,	one(0053300),	one(0177700), "$s", m68000up },
+{"sne", 2,	one(0053300),	one(0177700), "Ds", mcfisa_a },
+{"spl", 2,	one(0055300),	one(0177700), "$s", m68000up },
+{"spl", 2,	one(0055300),	one(0177700), "Ds", mcfisa_a },
+{"st", 2,	one(0050300),	one(0177700), "$s", m68000up },
+{"st", 2,	one(0050300),	one(0177700), "Ds", mcfisa_a },
+{"svc", 2,	one(0054300),	one(0177700), "$s", m68000up },
+{"svc", 2,	one(0054300),	one(0177700), "Ds", mcfisa_a },
+{"svs", 2,	one(0054700),	one(0177700), "$s", m68000up },
+{"svs", 2,	one(0054700),	one(0177700), "Ds", mcfisa_a },
 
-{"rts",		one(0047165),		one(0177777), "",   m68000up | mcf },
+{"stop", 4,	one(0047162),	one(0177777), "#w", m68000up | mcfisa_a },
 
-{"satsl",	one(0046200),		one(0177770), "Ds", mcfv4up },
+{"strldsr", 4, two(0040347,0043374), two(0177777,0177777), "#w", mcfisa_aa},
 
-{"sbcd",	one(0100400),		one(0170770), "DsDd", m68000up },
-{"sbcd",	one(0100410),		one(0170770), "-s-d", m68000up },
+{"subal", 2,	one(0110700),	one(0170700), "*lAd", m68000up | mcfisa_a },
+{"subaw", 2,	one(0110300),	one(0170700), "*wAd", m68000up },
 
-{"scc",		one(0052300),	one(0177700), "$s", m68000up },
-{"scc",		one(0052300),	one(0177700), "Ds", mcf },
-{"scs",		one(0052700),	one(0177700), "$s", m68000up },
-{"scs",		one(0052700),	one(0177700), "Ds", mcf },
-{"seq",		one(0053700),	one(0177700), "$s", m68000up },
-{"seq",		one(0053700),	one(0177700), "Ds", mcf },
-{"sf",		one(0050700),	one(0177700), "$s", m68000up },
-{"sf",		one(0050700),	one(0177700), "Ds", mcf },
-{"sge",		one(0056300),	one(0177700), "$s", m68000up },
-{"sge",		one(0056300),	one(0177700), "Ds", mcf },
-{"sgt",		one(0057300),	one(0177700), "$s", m68000up },
-{"sgt",		one(0057300),	one(0177700), "Ds", mcf },
-{"shi",		one(0051300),	one(0177700), "$s", m68000up },
-{"shi",		one(0051300),	one(0177700), "Ds", mcf },
-{"sle",		one(0057700),	one(0177700), "$s", m68000up },
-{"sle",		one(0057700),	one(0177700), "Ds", mcf },
-{"sls",		one(0051700),	one(0177700), "$s", m68000up },
-{"sls",		one(0051700),	one(0177700), "Ds", mcf },
-{"slt",		one(0056700),	one(0177700), "$s", m68000up },
-{"slt",		one(0056700),	one(0177700), "Ds", mcf },
-{"smi",		one(0055700),	one(0177700), "$s", m68000up },
-{"smi",		one(0055700),	one(0177700), "Ds", mcf },
-{"sne",		one(0053300),	one(0177700), "$s", m68000up },
-{"sne",		one(0053300),	one(0177700), "Ds", mcf },
-{"spl",		one(0055300),	one(0177700), "$s", m68000up },
-{"spl",		one(0055300),	one(0177700), "Ds", mcf },
-{"st",		one(0050300),	one(0177700), "$s", m68000up },
-{"st",		one(0050300),	one(0177700), "Ds", mcf },
-{"svc",		one(0054300),	one(0177700), "$s", m68000up },
-{"svc",		one(0054300),	one(0177700), "Ds", mcf },
-{"svs",		one(0054700),	one(0177700), "$s", m68000up },
-{"svs",		one(0054700),	one(0177700), "Ds", mcf },
+{"subib", 4,	one(0002000),	one(0177700), "#b$s", m68000up },
+{"subiw", 4,	one(0002100),	one(0177700), "#w$s", m68000up },
+{"subil", 6,	one(0002200),	one(0177700), "#l$s", m68000up },
+{"subil", 6,	one(0002200),	one(0177700), "#lDs", mcfisa_a },
 
-{"stop",	one(0047162),	one(0177777), "#w", m68000up | mcf },
-
-{"strldsr", two(0040347,0043374), two(0177777,0177777), "#w", mcf528x},
-
-{"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", 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 | mcf },
+{"subqb", 2,	one(0050400),	one(0170700), "Qd%s", m68000up },
+{"subqw", 2,	one(0050500),	one(0170700), "Qd%s", m68000up },
+{"subql", 2,	one(0050600),	one(0170700), "Qd%s", m68000up | mcfisa_a },
 
 /* The sub opcode can generate the suba, subi, and subq instructions.  */
-{"subb",	one(0050400),	one(0170700), "Qd%s", m68000up },
-{"subb",	one(0002000),	one(0177700), "#b$s", m68000up },
-{"subb",	one(0110000),	one(0170700), ";bDd", m68000up },
-{"subb",	one(0110400),	one(0170700), "Dd~s", m68000up },
-{"subw",	one(0050500),	one(0170700), "Qd%s", m68000up },
-{"subw",	one(0002100),	one(0177700), "#w$s", m68000up },
-{"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 | mcf },
-{"subl",	one(0002200),	one(0177700), "#l$s", m68000up },
-{"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 },
+{"subb", 2,	one(0050400),	one(0170700), "Qd%s", m68000up },
+{"subb", 4,	one(0002000),	one(0177700), "#b$s", m68000up },
+{"subb", 2,	one(0110000),	one(0170700), ";bDd", m68000up },
+{"subb", 2,	one(0110400),	one(0170700), "Dd~s", m68000up },
+{"subw", 2,	one(0050500),	one(0170700), "Qd%s", m68000up },
+{"subw", 4,	one(0002100),	one(0177700), "#w$s", m68000up },
+{"subw", 2,	one(0110300),	one(0170700), "*wAd", m68000up },
+{"subw", 2,	one(0110100),	one(0170700), "*wDd", m68000up },
+{"subw", 2,	one(0110500),	one(0170700), "Dd~s", m68000up },
+{"subl", 2,	one(0050600),	one(0170700), "Qd%s", m68000up | mcfisa_a },
+{"subl", 6,	one(0002200),	one(0177700), "#l$s", m68000up },
+{"subl", 6,	one(0002200),	one(0177700), "#lDs", mcfisa_a },
+{"subl", 2,	one(0110700),	one(0170700), "*lAd", m68000up | mcfisa_a },
+{"subl", 2,	one(0110200),	one(0170700), "*lDd", m68000up | mcfisa_a },
+{"subl", 2,	one(0110600),	one(0170700), "Dd~s", m68000up | mcfisa_a },
 
-{"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 | mcf },
-{"subxl",	one(0110610),	one(0170770), "-s-d", m68000up },
+{"subxb", 2,	one(0110400),	one(0170770), "DsDd", m68000up },
+{"subxb", 2,	one(0110410),	one(0170770), "-s-d", m68000up },
+{"subxw", 2,	one(0110500),	one(0170770), "DsDd", m68000up },
+{"subxw", 2,	one(0110510),	one(0170770), "-s-d", m68000up },
+{"subxl", 2,	one(0110600),	one(0170770), "DsDd", m68000up | mcfisa_a },
+{"subxl", 2,	one(0110610),	one(0170770), "-s-d", m68000up },
 
-{"swap",	one(0044100),	one(0177770), "Ds", m68000up | mcf },
+{"swap", 2,	one(0044100),	one(0177770), "Ds", m68000up | mcfisa_a },
 
 /* swbeg and swbegl are magic constants used on sysV68.  The compiler
    generates them before a switch table.  They tell the debugger and
@@ -2084,96 +2078,96 @@
    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 | mcf },
-{"swbegl",	one(0045375),	one(0177777), "#l",   m68000up | mcf },
+{"swbeg", 4,	one(0045374),	one(0177777), "#w",   m68000up | mcfisa_a },
+{"swbegl", 6,	one(0045375),	one(0177777), "#l",   m68000up | mcfisa_a },
 
-{"tas",		one(0045300),	one(0177700), "$s", m68000up | mcfv4up},
+{"tas", 2,	one(0045300),	one(0177700), "$s", m68000up | mcfisa_b},
 
-#define TBL1(name,signed,round,size)					\
-  {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400),	\
+#define TBL1(name,insn_size,signed,round,size)					\
+  {name, insn_size, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400),	\
      two(0177700,0107777), "!sD1", cpu32 },				\
-  {name, two(0174000, (signed<<11)|(!round<<10)|(size<<6)),		\
+  {name, insn_size, two(0174000, (signed<<11)|(!round<<10)|(size<<6)),		\
      two(0177770,0107770), "DsD3D1", cpu32 }
 #define TBL(name1, name2, name3, s, r) \
-  TBL1(name1, s, r, 0), TBL1(name2, s, r, 1), TBL1(name3, s, r, 2)
-TBL("tblsb", "tblsw", "tblsl", 1, 1),
-TBL("tblsnb", "tblsnw", "tblsnl", 1, 0),
+  TBL1(name1, 4, s, r, 0), TBL1(name2, 4, s, r, 1), TBL1(name3, 4, s, r, 2)
+TBL("tblsb", "tblsw", "tblsl", 2, 1),
+TBL("tblsnb", "tblsnw", "tblsnl", 2, 0),
 TBL("tblub", "tbluw", "tblul", 0, 1),
 TBL("tblunb", "tblunw", "tblunl", 0, 0),
 
-{"trap",	one(0047100),	one(0177760), "Ts", m68000up | mcf },
+{"trap", 2,	one(0047100),	one(0177760), "Ts", m68000up | mcfisa_a },
 
-{"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 | mcf },
-{"trapge",	one(0056374),	one(0177777), "", m68020up | cpu32 },
-{"trapgt",	one(0057374),	one(0177777), "", m68020up | cpu32 },
-{"traphi",	one(0051374),	one(0177777), "", m68020up | cpu32 },
-{"traple",	one(0057774),	one(0177777), "", m68020up | cpu32 },
-{"trapls",	one(0051774),	one(0177777), "", m68020up | cpu32 },
-{"traplt",	one(0056774),	one(0177777), "", m68020up | cpu32 },
-{"trapmi",	one(0055774),	one(0177777), "", m68020up | cpu32 },
-{"trapne",	one(0053374),	one(0177777), "", m68020up | cpu32 },
-{"trappl",	one(0055374),	one(0177777), "", m68020up | cpu32 },
-{"trapt",	one(0050374),	one(0177777), "", m68020up | cpu32 },
-{"trapvc",	one(0054374),	one(0177777), "", m68020up | cpu32 },
-{"trapvs",	one(0054774),	one(0177777), "", m68020up | cpu32 },
+{"trapcc", 2,	one(0052374),	one(0177777), "", m68020up | cpu32 },
+{"trapcs", 2,	one(0052774),	one(0177777), "", m68020up | cpu32 },
+{"trapeq", 2,	one(0053774),	one(0177777), "", m68020up | cpu32 },
+{"trapf", 2,	one(0050774),	one(0177777), "", m68020up | cpu32 | mcfisa_a },
+{"trapge", 2,	one(0056374),	one(0177777), "", m68020up | cpu32 },
+{"trapgt", 2,	one(0057374),	one(0177777), "", m68020up | cpu32 },
+{"traphi", 2,	one(0051374),	one(0177777), "", m68020up | cpu32 },
+{"traple", 2,	one(0057774),	one(0177777), "", m68020up | cpu32 },
+{"trapls", 2,	one(0051774),	one(0177777), "", m68020up | cpu32 },
+{"traplt", 2,	one(0056774),	one(0177777), "", m68020up | cpu32 },
+{"trapmi", 2,	one(0055774),	one(0177777), "", m68020up | cpu32 },
+{"trapne", 2,	one(0053374),	one(0177777), "", m68020up | cpu32 },
+{"trappl", 2,	one(0055374),	one(0177777), "", m68020up | cpu32 },
+{"trapt", 2,	one(0050374),	one(0177777), "", m68020up | cpu32 },
+{"trapvc", 2,	one(0054374),	one(0177777), "", m68020up | cpu32 },
+{"trapvs", 2,	one(0054774),	one(0177777), "", m68020up | cpu32 },
 
-{"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|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 },
-{"traplew",	one(0057772),	one(0177777), "#w", m68020up|cpu32 },
-{"traplsw",	one(0051772),	one(0177777), "#w", m68020up|cpu32 },
-{"trapltw",	one(0056772),	one(0177777), "#w", m68020up|cpu32 },
-{"trapmiw",	one(0055772),	one(0177777), "#w", m68020up|cpu32 },
-{"trapnew",	one(0053372),	one(0177777), "#w", m68020up|cpu32 },
-{"trapplw",	one(0055372),	one(0177777), "#w", m68020up|cpu32 },
-{"traptw",	one(0050372),	one(0177777), "#w", m68020up|cpu32 },
-{"trapvcw",	one(0054372),	one(0177777), "#w", m68020up|cpu32 },
-{"trapvsw",	one(0054772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapccw", 4,	one(0052372),	one(0177777), "#w", m68020up|cpu32 },
+{"trapcsw", 4,	one(0052772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapeqw", 4,	one(0053772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapfw", 4,	one(0050772),	one(0177777), "#w", m68020up|cpu32|mcfisa_a},
+{"trapgew", 4,	one(0056372),	one(0177777), "#w", m68020up|cpu32 },
+{"trapgtw", 4,	one(0057372),	one(0177777), "#w", m68020up|cpu32 },
+{"traphiw", 4,	one(0051372),	one(0177777), "#w", m68020up|cpu32 },
+{"traplew", 4,	one(0057772),	one(0177777), "#w", m68020up|cpu32 },
+{"traplsw", 4,	one(0051772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapltw", 4,	one(0056772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapmiw", 4,	one(0055772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapnew", 4,	one(0053372),	one(0177777), "#w", m68020up|cpu32 },
+{"trapplw", 4,	one(0055372),	one(0177777), "#w", m68020up|cpu32 },
+{"traptw", 4,	one(0050372),	one(0177777), "#w", m68020up|cpu32 },
+{"trapvcw", 4,	one(0054372),	one(0177777), "#w", m68020up|cpu32 },
+{"trapvsw", 4,	one(0054772),	one(0177777), "#w", m68020up|cpu32 },
 
-{"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|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 },
-{"traplel",	one(0057773),	one(0177777), "#l", m68020up|cpu32 },
-{"traplsl",	one(0051773),	one(0177777), "#l", m68020up|cpu32 },
-{"trapltl",	one(0056773),	one(0177777), "#l", m68020up|cpu32 },
-{"trapmil",	one(0055773),	one(0177777), "#l", m68020up|cpu32 },
-{"trapnel",	one(0053373),	one(0177777), "#l", m68020up|cpu32 },
-{"trappll",	one(0055373),	one(0177777), "#l", m68020up|cpu32 },
-{"traptl",	one(0050373),	one(0177777), "#l", m68020up|cpu32 },
-{"trapvcl",	one(0054373),	one(0177777), "#l", m68020up|cpu32 },
-{"trapvsl",	one(0054773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapccl", 6,	one(0052373),	one(0177777), "#l", m68020up|cpu32 },
+{"trapcsl", 6,	one(0052773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapeql", 6,	one(0053773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapfl", 6,	one(0050773),	one(0177777), "#l", m68020up|cpu32|mcfisa_a},
+{"trapgel", 6,	one(0056373),	one(0177777), "#l", m68020up|cpu32 },
+{"trapgtl", 6,	one(0057373),	one(0177777), "#l", m68020up|cpu32 },
+{"traphil", 6,	one(0051373),	one(0177777), "#l", m68020up|cpu32 },
+{"traplel", 6,	one(0057773),	one(0177777), "#l", m68020up|cpu32 },
+{"traplsl", 6,	one(0051773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapltl", 6,	one(0056773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapmil", 6,	one(0055773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapnel", 6,	one(0053373),	one(0177777), "#l", m68020up|cpu32 },
+{"trappll", 6,	one(0055373),	one(0177777), "#l", m68020up|cpu32 },
+{"traptl", 6,	one(0050373),	one(0177777), "#l", m68020up|cpu32 },
+{"trapvcl", 6,	one(0054373),	one(0177777), "#l", m68020up|cpu32 },
+{"trapvsl", 6,	one(0054773),	one(0177777), "#l", m68020up|cpu32 },
 
-{"trapv",	one(0047166),	one(0177777), "", m68000up },
+{"trapv", 2,	one(0047166),	one(0177777), "", m68000up },
 
-{"tstb",	one(0045000),	one(0177700), ";b", m68020up|cpu32|mcf },
-{"tstb",	one(0045000),	one(0177700), "$b", m68000up },
-{"tstw",	one(0045100),	one(0177700), "*w", m68020up|cpu32|mcf },
-{"tstw",	one(0045100),	one(0177700), "$w", m68000up },
-{"tstl",	one(0045200),	one(0177700), "*l", m68020up|cpu32|mcf },
-{"tstl",	one(0045200),	one(0177700), "$l", m68000up },
+{"tstb", 2,	one(0045000),	one(0177700), ";b", m68020up|cpu32|mcfisa_a },
+{"tstb", 2,	one(0045000),	one(0177700), "$b", m68000up },
+{"tstw", 2,	one(0045100),	one(0177700), "*w", m68020up|cpu32|mcfisa_a },
+{"tstw", 2,	one(0045100),	one(0177700), "$w", m68000up },
+{"tstl", 2,	one(0045200),	one(0177700), "*l", m68020up|cpu32|mcfisa_a },
+{"tstl", 2,	one(0045200),	one(0177700), "$l", m68000up },
 
-{"unlk",	one(0047130),	one(0177770), "As", m68000up | mcf },
+{"unlk", 2,	one(0047130),	one(0177770), "As", m68000up | mcfisa_a },
 
-{"unpk",	one(0100600),	one(0170770), "DsDd#w", m68020up },
-{"unpk",	one(0100610),	one(0170770), "-s-d#w", m68020up },
+{"unpk", 4,	one(0100600),	one(0170770), "DsDd#w", m68020up },
+{"unpk", 4,	one(0100610),	one(0170770), "-s-d#w", m68020up },
 
-{"wddatab",	one(0175400),   one(0177700), "~s", mcf },
-{"wddataw",	one(0175500),   one(0177700), "~s", mcf },
-{"wddatal",	one(0175600),   one(0177700), "~s", mcf },
+{"wddatab", 2,	one(0175400),   one(0177700), "~s", mcfisa_a },
+{"wddataw", 2,	one(0175500),   one(0177700), "~s", mcfisa_a },
+{"wddatal", 2,	one(0175600),   one(0177700), "~s", mcfisa_a },
 
-{"wdebug",	two(0175720, 03),	two(0177770, 0xffff), "as", mcf },
-{"wdebug",	two(0175750, 03),	two(0177770, 0xffff), "ds", mcf },
+{"wdebug", 4,	two(0175720, 03),	two(0177770, 0xffff), "as", mcfisa_a },
+{"wdebug", 4,	two(0175750, 03),	two(0177770, 0xffff), "ds", mcfisa_a },
 };
 
 const int m68k_numopcodes = sizeof m68k_opcodes / sizeof m68k_opcodes[0];
@@ -2241,9 +2235,9 @@
   { "brb",	"bras", },
   { "brw",	"braw", },
   { "brl",	"bral", },
-  { "jfnlt",	"bcc", },	/* apparently a sun alias */
-  { "jfngt",	"ble", },	/* apparently a sun alias */
-  { "jfeq",	"beqs", },	/* apparently a sun alias */
+  { "jfnlt",	"bcc", },	/* Apparently a sun alias.  */
+  { "jfngt",	"ble", },	/* Apparently a sun alias.  */
+  { "jfeq",	"beqs", },	/* Apparently a sun alias.  */
   { "bchgb",	"bchg", },
   { "bchgl",	"bchg", },
   { "bclrb",	"bclr", },
@@ -2392,7 +2386,7 @@
   { "movsw",	"movesw", },
   { "mov3q",	"mov3ql", },
 
-  { "tdivul",	"divul", },	/* for m68k-svr4 */
+  { "tdivul",	"divul", },	/* For m68k-svr4.  */
   { "fmovb",	"fmoveb", },
   { "fsmovb",	"fsmoveb", },
   { "fdmovb",	"fdmoveb", },
@@ -2423,7 +2417,7 @@
   { "ftestw",	"ftstw", },
   { "ftestx",	"ftstx", },
 
-  { "bitrevl",  "bitrev", },  /* for mcf528x only */
+  { "bitrevl",  "bitrev", },
   { "byterevl", "byterev", },
   { "ff1l",     "ff1", },
 
diff --git a/opcodes/mpw-config.in b/opcodes/mpw-config.in
deleted file mode 100644
index ff9be9d..0000000
--- a/opcodes/mpw-config.in
+++ /dev/null
@@ -1,27 +0,0 @@
-# Configuration fragment for opcodes.
-
-Set target_arch `echo {target_canonical} | sed -e 's/-.*-.*//'`
-
-Set archname ARCH_{target_arch}
-
-If "{target_arch}" =~ /m68k/
-	Set BFD_MACHINES  '"{o}"m68k-dis.c.o "{o}"m68k-opc.c.o'
-Else If "{target_arch}" =~ /powerpc/
-	Set BFD_MACHINES  '"{o}"ppc-dis.c.o "{o}"ppc-opc.c.o'
-Else If "{target_arch}" =~ /i386/
-	Set BFD_MACHINES  '"{o}"i386-dis.c.o'
-Else If "{target_arch}" =~ /mips/
-	Set BFD_MACHINES  '"{o}"mips-dis.c.o "{o}"mips-opc.c.o'
-Else If "{target_arch}" =~ /sh/
-	Set BFD_MACHINES  '"{o}"sh-dis.c.o'
-End If
-
-Echo '# Start from mpw-config.in'			 > "{o}"mk.tmp
-Echo "BFD_MACHINES = " {BFD_MACHINES}			>> "{o}"mk.tmp
-Echo "ARCHDEFS = -d" {archname}				>> "{o}"mk.tmp
-Echo '# End from mpw-config.in'				>> "{o}"mk.tmp
-
-Echo '/* config.h.  Generated by mpw-configure.  */'	 > "{o}"config.new
-Echo '#include "mpw.h"'		 			>> "{o}"config.new
-
-MoveIfChange "{o}"config.new "{o}"config.h
diff --git a/opcodes/mpw-make.sed b/opcodes/mpw-make.sed
deleted file mode 100644
index ee60486..0000000
--- a/opcodes/mpw-make.sed
+++ /dev/null
@@ -1,25 +0,0 @@
-# Sed commands to finish translating the opcodes Makefile.in into MPW syntax.
-
-# Empty HDEFINES.
-/HDEFINES/s/@HDEFINES@//
-
-# Fix pathnames to include directories.
-/^INCDIR = /s/^INCDIR = .*$/INCDIR = "{topsrcdir}"include/
-/^CSEARCH = /s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/
-
-/BFD_MACHINES/s/@BFD_MACHINES@/{BFD_MACHINES}/
-/archdefs/s/@archdefs@/{ARCHDEFS}/
-
-# No PIC foolery in this environment.
-/@ALLLIBS@/s/@ALLLIBS@/{TARGETLIB}/
-/@PICLIST@/s/@PICLIST@//
-/@PICFLAG@/s/@PICFLAG@//
-/^{OFILES} \\Option-f stamp-picdir/,/^$/d
-
-# Remove the pic trickery from the default build rule.
-/^\.c\.o \\Option-f /,/End If/c\
-.c.o \\Option-f .c
-
-# Remove pic trickery from other rules - aimed at the rule
-# for disassemble.o in particular.
-/-n "{PICFLAG}"/,/End If/d
diff --git a/opcodes/po/fr.po b/opcodes/po/fr.po
index 7ec06af..ac64522 100644
--- a/opcodes/po/fr.po
+++ b/opcodes/po/fr.po
@@ -1,17 +1,18 @@
 # Messages français pour opcodes.
-# Copyright © 1996 Free Software Foundation, Inc.
+# Copyright © 2004 Free Software Foundation, Inc.
 # Michel Robitaille <robitail@IRO.UMontreal.CA>, traducteur depuis/since 1996.
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: opcodes 2.14rel030712\n"
 "POT-Creation-Date: 2003-07-11 13:56+0930\n"
-"PO-Revision-Date: 2003-08-05 08:00-0500\n"
+"PO-Revision-Date: 2004-05-10 08:00-0500\n"
 "Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n"
 "Language-Team: French <traduc@traduc.org>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=ISO-8859-1\n"
 "Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
 
 #: alpha-opc.c:335
 msgid "branch operand unaligned"
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index 36fe454..9936f3e 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -194,8 +194,11 @@
 #define BOE BO + 1
   { 5, 21, insert_boe, extract_boe, 0 },
 
+#define BH BOE + 1
+  { 2, 11, 0, 0, PPC_OPERAND_OPTIONAL },
+
   /* The BT field in an X or XL form instruction.  */
-#define BT BOE + 1
+#define BT BH + 1
   { 5, 21, 0, 0, PPC_OPERAND_CR },
 
   /* The condition register number portion of the BI field in a B form
@@ -995,17 +998,33 @@
 	    int dialect,
 	    const char **errmsg)
 {
+  /* If we're handling the mfocrf and mtocrf insns ensure that exactly
+     one bit of the mask field is set.  */
+  if ((insn & (1 << 20)) != 0)
+    {
+      if (value == 0 || (value & -value) != value)
+	{
+	  *errmsg = _("invalid mask field");
+	  value = 0;
+	}
+    }
+
   /* If the optional field on mfcr is missing that means we want to use
      the old form of the instruction that moves the whole cr.  In that
      case we'll have VALUE zero.  There doesn't seem to be a way to
      distinguish this from the case where someone writes mfcr %r3,0.  */
-  if (value == 0)
+  else if (value == 0)
     ;
 
   /* If only one bit of the FXM field is set, we can use the new form
      of the instruction, which is faster.  Unlike the Power4 branch hint
-     encoding, this is not backward compatible.  */
-  else if ((dialect & PPC_OPCODE_POWER4) != 0 && (value & -value) == value)
+     encoding, this is not backward compatible.  Do not generate the
+     new form unless -mpower4 has been given, or -many and the two
+     operand form of mfcr was used.  */
+  else if ((value & -value) == value
+	   && ((dialect & PPC_OPCODE_POWER4) != 0
+	       || ((dialect & PPC_OPCODE_ANY) != 0
+		   && (insn & (0x3ff << 1)) == 19 << 1)))
     insn |= 1 << 20;
 
   /* Any other value on mfcr is an error.  */
@@ -1020,7 +1039,7 @@
 
 static long
 extract_fxm (unsigned long insn,
-	     int dialect,
+	     int dialect ATTRIBUTE_UNUSED,
 	     int *invalid)
 {
   long mask = (insn >> 12) & 0xff;
@@ -1028,14 +1047,9 @@
   /* Is this a Power4 insn?  */
   if ((insn & (1 << 20)) != 0)
     {
-      if ((dialect & PPC_OPCODE_POWER4) == 0)
+      /* Exactly one bit of MASK should be set.  */
+      if (mask == 0 || (mask & -mask) != mask)
 	*invalid = 1;
-      else
-	{
-	  /* Exactly one bit of MASK should be set.  */
-	  if (mask == 0 || (mask & -mask) != mask)
-	    *invalid = 1;
-	}
     }
 
   /* Check that non-power4 form of mfcr has a zero MASK.  */
@@ -1585,8 +1599,8 @@
 /* An XRTRA_MASK, but with L bit clear.  */
 #define XRTLRA_MASK (XRTRA_MASK & ~((unsigned long) 1 << 21))
 
-/* An X form comparison instruction.  */
-#define XCMPL(op, xop, l) (X ((op), (xop)) | ((((unsigned long)(l)) & 1) << 21))
+/* An X form instruction with the L bit specified.  */
+#define XOPL(op, xop, l) (X ((op), (xop)) | ((((unsigned long)(l)) & 1) << 21))
 
 /* The mask for an X form comparison instruction.  */
 #define XCMP_MASK (X_MASK | (((unsigned long)1) << 22))
@@ -1651,6 +1665,9 @@
 #define XLYBB_MASK (XLYLK_MASK | BB_MASK)
 #define XLBOCBBB_MASK (XLOCB_MASK | BB_MASK)
 
+/* A mask for branch instructions using the BH field.  */
+#define XLBH_MASK (XL_MASK | (0x1c << 11))
+
 /* An XL_MASK with the BO and BB fields fixed.  */
 #define XLBOBB_MASK (XL_MASK | BO_MASK | BB_MASK)
 
@@ -1670,11 +1687,12 @@
 #define XS_MASK XS (0x3f, 0x1ff, 1)
 
 /* A mask for the FXM version of an XFX form instruction.  */
-#define XFXFXM_MASK (X_MASK | (1 << 11))
+#define XFXFXM_MASK (X_MASK | (1 << 11) | (1 << 20))
 
 /* An XFX form instruction with the FXM field filled in.  */
-#define XFXM(op, xop, fxm) \
-  (X ((op), (xop)) | ((((unsigned long)(fxm)) & 0xff) << 12))
+#define XFXM(op, xop, fxm, p4) \
+  (X ((op), (xop)) | ((((unsigned long)(fxm)) & 0xff) << 12) \
+   | ((unsigned long)(p4) << 20))
 
 /* An XFX form instruction with the SPR field filled in.  */
 #define XSPR(op, xop, spr) \
@@ -1764,7 +1782,7 @@
 #define PPC440	PPC_OPCODE_440
 #define PPC750	PPC
 #define PPC860	PPC
-#define PPCVEC	PPC_OPCODE_ALTIVEC | PPC_OPCODE_PPC
+#define PPCVEC	PPC_OPCODE_ALTIVEC
 #define	POWER   PPC_OPCODE_POWER
 #define	POWER2	PPC_OPCODE_POWER | PPC_OPCODE_POWER2
 #define PPCPWR2	PPC_OPCODE_PPC | PPC_OPCODE_POWER | PPC_OPCODE_POWER2
@@ -2878,12 +2896,12 @@
 { "bdzflrl", XLO(19,BODZF,16,1), XLBOBB_MASK, PPCCOM,	{ BI } },
 { "bdzflrl-",XLO(19,BODZF,16,1), XLBOBB_MASK, NOPOWER4,	{ BI } },
 { "bdzflrl+",XLO(19,BODZFP,16,1), XLBOBB_MASK, NOPOWER4, { BI } },
-{ "bclr",    XLLK(19,16,0), XLYBB_MASK,	PPCCOM,		{ BO, BI } },
-{ "bclrl",   XLLK(19,16,1), XLYBB_MASK,	PPCCOM,		{ BO, BI } },
 { "bclr+",   XLYLK(19,16,1,0), XLYBB_MASK, PPCCOM,	{ BOE, BI } },
 { "bclrl+",  XLYLK(19,16,1,1), XLYBB_MASK, PPCCOM,	{ BOE, BI } },
 { "bclr-",   XLYLK(19,16,0,0), XLYBB_MASK, PPCCOM,	{ BOE, BI } },
 { "bclrl-",  XLYLK(19,16,0,1), XLYBB_MASK, PPCCOM,	{ BOE, BI } },
+{ "bclr",    XLLK(19,16,0), XLBH_MASK,	PPCCOM,		{ BO, BI, BH } },
+{ "bclrl",   XLLK(19,16,1), XLBH_MASK,	PPCCOM,		{ BO, BI, BH } },
 { "bcr",     XLLK(19,16,0), XLBB_MASK,	PWRCOM,		{ BO, BI } },
 { "bcrl",    XLLK(19,16,1), XLBB_MASK,	PWRCOM,		{ BO, BI } },
 { "bclre",   XLLK(19,17,0), XLBB_MASK,	BOOKE64,	{ BO, BI } },
@@ -3062,12 +3080,12 @@
 { "bfctrl-", XLO(19,BOFM4,528,1), XLBOBB_MASK, POWER4, { BI } },
 { "bfctrl+", XLO(19,BOFP,528,1), XLBOBB_MASK, NOPOWER4, { BI } },
 { "bfctrl+", XLO(19,BOFP4,528,1), XLBOBB_MASK, POWER4, { BI } },
-{ "bcctr",   XLLK(19,528,0),     XLYBB_MASK,  PPCCOM,	{ BO, BI } },
 { "bcctr-",  XLYLK(19,528,0,0),  XLYBB_MASK,  PPCCOM,	{ BOE, BI } },
 { "bcctr+",  XLYLK(19,528,1,0),  XLYBB_MASK,  PPCCOM,	{ BOE, BI } },
-{ "bcctrl",  XLLK(19,528,1),     XLYBB_MASK,  PPCCOM,	{ BO, BI } },
 { "bcctrl-", XLYLK(19,528,0,1),  XLYBB_MASK,  PPCCOM,	{ BOE, BI } },
 { "bcctrl+", XLYLK(19,528,1,1),  XLYBB_MASK,  PPCCOM,	{ BOE, BI } },
+{ "bcctr",   XLLK(19,528,0),     XLBH_MASK,   PPCCOM,	{ BO, BI, BH } },
+{ "bcctrl",  XLLK(19,528,1),     XLBH_MASK,   PPCCOM,	{ BO, BI, BH } },
 { "bcc",     XLLK(19,528,0),     XLBB_MASK,   PWRCOM,	{ BO, BI } },
 { "bccl",    XLLK(19,528,1),     XLBB_MASK,   PWRCOM,	{ BO, BI } },
 { "bcctre",  XLLK(19,529,0),     XLYBB_MASK,  BOOKE64,	{ BO, BI } },
@@ -3146,8 +3164,8 @@
 { "rldcr",   MDS(30,9,0), MDS_MASK,	PPC64,		{ RA, RS, RB, ME6 } },
 { "rldcr.",  MDS(30,9,1), MDS_MASK,	PPC64,		{ RA, RS, RB, ME6 } },
 
-{ "cmpw",    XCMPL(31,0,0), XCMPL_MASK, PPCCOM,		{ OBF, RA, RB } },
-{ "cmpd",    XCMPL(31,0,1), XCMPL_MASK, PPC64,		{ OBF, RA, RB } },
+{ "cmpw",    XOPL(31,0,0), XCMPL_MASK, PPCCOM,		{ OBF, RA, RB } },
+{ "cmpd",    XOPL(31,0,1), XCMPL_MASK, PPC64,		{ OBF, RA, RB } },
 { "cmp",     X(31,0),	XCMP_MASK,	PPC,		{ BF, L, RA, RB } },
 { "cmp",     X(31,0),	XCMPL_MASK,	PWRCOM,		{ BF, RA, RB } },
 
@@ -3216,6 +3234,7 @@
 { "iseleq",  X(31,79),      X_MASK,	PPCISEL,	{ RT, RA, RB } },
 { "isel",    XISEL(31,15),  XISEL_MASK,	PPCISEL,	{ RT, RA, RB, CRB } },
 
+{ "mfocrf",  XFXM(31,19,0,1), XFXFXM_MASK, COM,		{ RT, FXM } },
 { "mfcr",    X(31,19),	XRARB_MASK,	NOPOWER4,	{ RT } },
 { "mfcr",    X(31,19),	XFXFXM_MASK,	POWER4,		{ RT, FXM4 } },
 
@@ -3252,8 +3271,8 @@
 
 { "lwzxe",   X(31,31),	X_MASK,		BOOKE64,	{ RT, RA0, RB } },
 
-{ "cmplw",   XCMPL(31,32,0), XCMPL_MASK, PPCCOM,	{ OBF, RA, RB } },
-{ "cmpld",   XCMPL(31,32,1), XCMPL_MASK, PPC64,		{ OBF, RA, RB } },
+{ "cmplw",   XOPL(31,32,0), XCMPL_MASK, PPCCOM,	{ OBF, RA, RB } },
+{ "cmpld",   XOPL(31,32,1), XCMPL_MASK, PPC64,		{ OBF, RA, RB } },
 { "cmpl",    X(31,32),	XCMP_MASK,	 PPC,		{ BF, L, RA, RB } },
 { "cmpl",    X(31,32),	XCMPL_MASK,	 PWRCOM,	{ BF, RA, RB } },
 
@@ -3371,7 +3390,8 @@
 
 { "dcbtstlse",X(31,142),X_MASK,		PPCCHLK64,	{ CT, RA, RB }},
 
-{ "mtcr",    XFXM(31,144,0xff), XRARB_MASK, COM,	{ RS }},
+{ "mtocrf",  XFXM(31,144,0,1), XFXFXM_MASK, COM,	{ FXM, RS } },
+{ "mtcr",    XFXM(31,144,0xff,0), XRARB_MASK, COM,	{ RS }},
 { "mtcrf",   X(31,144),	XFXFXM_MASK,	COM,		{ FXM, RS } },
 
 { "mtmsr",   X(31,146),	XRARB_MASK,	COM,		{ RS } },
@@ -4303,6 +4323,7 @@
 
 { "tlbli",   X(31,1010), XRTRA_MASK,	PPC,		{ RB } },
 
+{ "dcbzl",   XOPL(31,1014,1), XRT_MASK,POWER4,            { RA, RB } },
 { "dcbz",    X(31,1014), XRT_MASK,	PPC,		{ RA, RB } },
 { "dclz",    X(31,1014), XRT_MASK,	PPC,		{ RA, RB } },
 
diff --git a/opcodes/s390-opc.txt b/opcodes/s390-opc.txt
index be08c82..960a4cc 100644
--- a/opcodes/s390-opc.txt
+++ b/opcodes/s390-opc.txt
@@ -726,8 +726,8 @@
 e3000000001b slgf RXY_RRRD "subtract logical with long offset 64<32" z990 zarch
 e3000000001c msgf RXY_RRRD "multiply single with long offset 64<32" z990 zarch
 e3000000001d dsgf RXY_RRRD "divide single 64<32" z990 zarch
-e3000000001e lrv RXY_RRRD "load reversed 32" z990 zarch
-e3000000001f lrvh RXY_RRRD "load reversed 16" z990 zarch
+e3000000001e lrv RXY_RRRD "load reversed 32" z990 esa,zarch
+e3000000001f lrvh RXY_RRRD "load reversed 16" z990 esa,zarch
 e30000000020 cg RXY_RRRD "compare with long offset 64" z990 zarch
 e30000000021 clg RXY_RRRD "compare logical with long offset 64" z990 zarch
 e30000000024 stg RXY_RRRD "store with long offset 64" z990 zarch
@@ -735,7 +735,7 @@
 e3000000002f strvg RXY_RRRD "store reversed 64" z990 zarch
 e30000000030 cgf RXY_RRRD "compare with long offset 64<32" z990 zarch
 e30000000031 clgf RXY_RRRD "compare logical with long offset 64<32" z990 zarch
-e3000000003e strv RXY_RRRD "store reversed 32" z990 zarch
+e3000000003e strv RXY_RRRD "store reversed 32" z990 esa,zarch
 e3000000003f strvh RXY_RRRD "store reversed 64" z990 zarch
 e30000000046 bctg RXY_RRRD "branch on count 64" z990 zarch
 e30000000080 ng RXY_RRRD "and with long offset 64" z990 zarch
@@ -749,10 +749,10 @@
 e3000000008f lpq RXY_RRRD "load pair from quadword" z990 zarch
 e30000000090 llgc RXY_RRRD "load logical character" z990 zarch
 e30000000091 llgh RXY_RRRD "load logical halfword" z990 zarch
-e30000000096 ml RXY_RRRD "multiply logical 32" z990 zarch
-e30000000097 dl RXY_RRRD "divide logical 32" z990 zarch
-e30000000098 alc RXY_RRRD "add logical with carry 32" z990 zarch
-e30000000099 slb RXY_RRRD "subtract logical with borrow 32" z990 zarch
+e30000000096 ml RXY_RRRD "multiply logical 32" z990 esa,zarch
+e30000000097 dl RXY_RRRD "divide logical 32" z990 esa,zarch
+e30000000098 alc RXY_RRRD "add logical with carry 32" z990 esa,zarch
+e30000000099 slb RXY_RRRD "subtract logical with borrow 32" z990 esa,zarch
 eb0000000004 lmg RSY_RRRD "load multiple with long offset 64" z990 zarch
 eb000000000a srag RSY_RRRD "shift right single 64" z990 zarch
 eb000000000b slag RSY_RRRD "shift left single 64" z990 zarch
@@ -760,7 +760,7 @@
 eb000000000d sllg RSY_RRRD "shift left single logical 64" z990 zarch
 eb000000000f tracg RSY_RRRD "trace 64" z990 zarch
 eb000000001c rllg RSY_RRRD "rotate left single logical 64" z990 zarch
-eb000000001d rll RSY_RRRD "rotate left single logical 32" z990 zarch
+eb000000001d rll RSY_RRRD "rotate left single logical 32" z990 esa,zarch
 eb0000000020 clmh RSY_RURD "compare logical characters under mask high with long offset" z990 zarch
 eb0000000024 stmg RSY_RRRD "store multiple with long offset 64" z990 zarch
 eb0000000025 stctg RSY_RRRD "store control 64" z990 zarch
@@ -772,7 +772,7 @@
 eb0000000044 bxhg RSY_RRRD "branch on index high 64" z990 zarch
 eb0000000045 bxleg RSY_RRRD "branch on index low or equal 64" z990 zarch
 eb0000000080 icmh RSY_RURD "insert characters under mask high with long offset" z990 zarch
-eb000000008e mvclu RSY_RRRD "move long unicode" z990 zarch
+eb000000008e mvclu RSY_RRRD "move long unicode" z990 esa,zarch
 eb000000008f clclu RSY_RRRD "compare logical long unicode with long offset" z990 zarch
 eb0000000096 lmh RSY_RRRD "load multiple high" z990 zarch
 # new z990 instructions
diff --git a/opcodes/sh-dis.c b/opcodes/sh-dis.c
index 840823e..3ca5130 100644
--- a/opcodes/sh-dis.c
+++ b/opcodes/sh-dis.c
@@ -402,7 +402,7 @@
   int status;
   bfd_vma relmask = ~(bfd_vma) 0;
   const sh_opcode_info *op;
-  int target_arch;
+  unsigned int target_arch;
 
   switch (info->mach)
     {
@@ -415,40 +415,6 @@
 	  && bfd_asymbol_flavour(*info->symbols) == bfd_target_coff_flavour)
 	target_arch = arch_sh4;
       break;
-    case bfd_mach_sh2:
-      target_arch = arch_sh2;
-      break;
-    case bfd_mach_sh2e:
-      target_arch = arch_sh2e;
-      break;
-    case bfd_mach_sh_dsp:
-      target_arch = arch_sh_dsp;
-      break;
-    case bfd_mach_sh3:
-      target_arch = arch_sh3;
-      break;
-    case bfd_mach_sh3_dsp:
-      target_arch = arch_sh3_dsp;
-      break;
-    case bfd_mach_sh3e:
-      target_arch = arch_sh3e;
-      break;
-    case bfd_mach_sh4_nofpu:
-      target_arch = arch_sh4_nofpu;
-      break;
-    case bfd_mach_sh4:
-      target_arch = arch_sh4;
-      break;
-    case bfd_mach_sh4a:
-    case bfd_mach_sh4a_nofpu:
-      target_arch = arch_sh4a;
-      break;
-    case bfd_mach_sh4al_dsp:
-      target_arch = arch_sh4al_dsp;
-      break;
-    case bfd_mach_sh4_nommu_nofpu:
-      target_arch = arch_sh4_nommu_nofpu;
-      break;
     case bfd_mach_sh5:
 #ifdef INCLUDE_SHMEDIA
       status = print_insn_sh64 (memaddr, info);
@@ -460,7 +426,7 @@
       target_arch = arch_sh4;
       break;
     default:
-      abort ();
+      target_arch = sh_get_arch_from_bfd_mach (info->mach);
     }
 
   status = info->read_memory_func (memaddr, insn, 2, info);
@@ -488,7 +454,8 @@
       nibs[3] = insn[1] & 0xf;
     }
 
-  if (nibs[0] == 0xf && (nibs[1] & 4) == 0 && target_arch & arch_sh_dsp_up)
+  if (nibs[0] == 0xf && (nibs[1] & 4) == 0
+      && SH_MERGE_ARCH_SET_VALID (target_arch, arch_sh_dsp_up))
     {
       if (nibs[1] & 8)
 	{
@@ -524,7 +491,7 @@
       int disp_pc;
       bfd_vma disp_pc_addr = 0;
 
-      if ((op->arch & target_arch) == 0)
+      if (!SH_MERGE_ARCH_SET_VALID (op->arch, target_arch))
 	goto fail;
       for (n = 0; n < 4; n++)
 	{
@@ -855,7 +822,13 @@
 		  else
 		    val = bfd_getb32 (bytes);
 		}
-	      fprintf_fn (stream, "\t! 0x%x", val);
+	      if ((*info->symbol_at_address_func) (val, info))
+		{
+		  fprintf_fn (stream, "\t! 0x");
+		  (*info->print_address_func) (val, info);
+		}
+	      else
+		fprintf_fn (stream, "\t! 0x%x", val);
 	    }
 	}
 
diff --git a/opcodes/sh-opc.h b/opcodes/sh-opc.h
index a1877b3..d590685 100644
--- a/opcodes/sh-opc.h
+++ b/opcodes/sh-opc.h
@@ -16,6 +16,8 @@
    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"
+
 typedef enum
   {
     HEX_0,
@@ -176,47 +178,120 @@
   }
 sh_dsp_reg_nums;
 
-#define arch_sh1     0x0001
-#define arch_sh2     0x0002
-#define arch_sh3     0x0004
-#define arch_sh3e    0x0008
-#define arch_sh4     0x0010
-#define arch_sh2e    0x0020
-#define arch_sh4a    0x0040
-#define arch_sh_dsp  0x0100
-#define arch_sh3_dsp 0x0200
-#define arch_sh4al_dsp 0x0400
-#define arch_sh4_nofpu 0x1000
-#define arch_sh4a_nofpu 0x2000
-#define arch_sh4_nommu_nofpu 0x4000  /* no mmu nor fpu */
+#define arch_sh1_base	0x0001
+#define arch_sh2_base	0x0002
+#define arch_sh3_base	0x0004
+#define arch_sh4_base	0x0008
+#define arch_sh4a_base	0x0010
+#define arch_sh_no_mmu	0x04000000
+#define arch_sh_has_mmu 0x08000000
+#define arch_sh_no_co	0x10000000 /* neither FPU nor DSP co-processor */
+#define arch_sh_sp_fpu	0x20000000 /* single precision FPU */
+#define arch_sh_dp_fpu	0x40000000 /* double precision FPU */
+#define arch_sh_has_dsp	0x80000000
 
-#define arch_sh1_up  (arch_sh1 | arch_sh2_up)
-#define arch_sh2_up  (arch_sh2 | arch_sh2e_up | arch_sh3_up | arch_sh_dsp)
+#define arch_sh_base_mask 0x0000001f
+#define arch_sh_mmu_mask  0x0c000000
+#define arch_sh_co_mask   0xf0000000
+
+#define arch_sh1	(arch_sh1_base|arch_sh_no_mmu|arch_sh_no_co)
+#define arch_sh2	(arch_sh2_base|arch_sh_no_mmu|arch_sh_no_co)
+#define arch_sh2e	(arch_sh2_base|arch_sh_no_mmu|arch_sh_sp_fpu)
+#define arch_sh_dsp	(arch_sh2_base|arch_sh_no_mmu|arch_sh_has_dsp)
+#define arch_sh3_nommu	(arch_sh3_base|arch_sh_no_mmu|arch_sh_no_co)
+#define arch_sh3	(arch_sh3_base|arch_sh_has_mmu|arch_sh_no_co)
+#define arch_sh3e	(arch_sh3_base|arch_sh_has_mmu|arch_sh_sp_fpu)
+#define arch_sh3_dsp	(arch_sh3_base|arch_sh_has_mmu|arch_sh_has_dsp)
+#define arch_sh4	(arch_sh4_base|arch_sh_has_mmu|arch_sh_dp_fpu)
+#define arch_sh4a	(arch_sh4a_base|arch_sh_has_mmu|arch_sh_dp_fpu)
+#define arch_sh4al_dsp	(arch_sh4a_base|arch_sh_has_mmu|arch_sh_has_dsp)
+#define arch_sh4_nofpu	(arch_sh4_base|arch_sh_has_mmu|arch_sh_no_co)
+#define arch_sh4a_nofpu	(arch_sh4a_base|arch_sh_has_mmu|arch_sh_no_co)
+#define arch_sh4_nommu_nofpu (arch_sh4_base|arch_sh_no_mmu|arch_sh_no_co)
+
+#define SH_MERGE_ARCH_SET(SET1, SET2) ((SET1) & (SET2))
+#define SH_VALID_BASE_ARCH_SET(SET) (((SET) & arch_sh_base_mask) != 0)
+#define SH_VALID_MMU_ARCH_SET(SET)  (((SET) & arch_sh_mmu_mask) != 0)
+#define SH_VALID_CO_ARCH_SET(SET)   (((SET) & arch_sh_co_mask) != 0)
+#define SH_VALID_ARCH_SET(SET) \
+  (SH_VALID_BASE_ARCH_SET (SET) \
+   && SH_VALID_MMU_ARCH_SET (SET) \
+   && SH_VALID_CO_ARCH_SET (SET))
+#define SH_MERGE_ARCH_SET_VALID(SET1, SET2) \
+  SH_VALID_ARCH_SET (SH_MERGE_ARCH_SET (SET1, SET2))
+
+#define SH_ARCH_SET_HAS_FPU(SET) \
+  (((SET) & (arch_sh_sp_fpu | arch_sh_dp_fpu)) != 0)
+#define SH_ARCH_SET_HAS_DSP(SET) \
+  (((SET) & arch_sh_has_dsp) != 0)
+
+/* This is returned from the functions below when an error occurs
+   (in addition to a call to BFD_FAIL). The value should allow
+   the tools to continue to function in most cases - there may
+   be some confusion between DSP and FPU etc.  */
+#define SH_ARCH_UNKNOWN_ARCH 0xffffffff
+
+/* These are defined in bfd/cpu-sh.c .  */
+unsigned int sh_get_arch_from_bfd_mach (unsigned long mach);
+unsigned int sh_get_arch_up_from_bfd_mach (unsigned long mach);
+unsigned long sh_get_bfd_mach_from_arch_set (unsigned int arch_set);
+bfd_boolean sh_merge_bfd_arch (bfd *ibfd, bfd *obfd);
+
+/* Below are the 'architecture sets'.
+   They describe the following inheritance graph:
+
+                SH1
+                 |
+                SH2
+   .------------'|`--------------------.
+  /              |                      \
+SH-DSP          SH3-nommu               SH2E
+ |               |`--------.             |
+ |               |          \            |
+ |              SH3     SH4-nommu-nofpu  |
+ |               |           |           |
+ | .------------'|`----------+---------. |
+ |/                         /           \|
+ |               | .-------'             |
+ |               |/                      |
+SH3-dsp         SH4-nofpu               SH3E
+ |               |`--------------------. |
+ |               |                      \|
+ |              SH4A-nofpu              SH4
+ | .------------' `--------------------. |
+ |/                                     \|
+SH4AL-dsp                               SH4A
+
+*/
+
+/* Central branches */
+#define arch_sh1_up       (arch_sh1 | arch_sh2_up)
+#define arch_sh2_up       (arch_sh2 | arch_sh2e_up | arch_sh3_nommu_up | arch_sh_dsp_up)
+#define arch_sh3_nommu_up (arch_sh3_nommu | arch_sh3_up | arch_sh4_nommu_nofpu_up)
+#define arch_sh3_up       (arch_sh3 | arch_sh3e_up | arch_sh3_dsp_up | arch_sh4_nofp_up)
+#define arch_sh4_nommu_nofpu_up (arch_sh4_nommu_nofpu | arch_sh4_nofp_up)
+#define arch_sh4_nofp_up  (arch_sh4_nofpu | arch_sh4_up | arch_sh4a_nofp_up)
+#define arch_sh4a_nofp_up (arch_sh4a_nofpu | arch_sh4a_up | arch_sh4al_dsp_up)
+
+/* Right branch */
 #define arch_sh2e_up (arch_sh2e | arch_sh3e_up)
-#define arch_sh3_up  (arch_sh3 | arch_sh3e_up | arch_sh3_dsp_up \
-		      | arch_sh4_nommu_nofpu_up)
 #define arch_sh3e_up (arch_sh3e | arch_sh4_up)
 #define arch_sh4_up  (arch_sh4 | arch_sh4a_up)
 #define arch_sh4a_up (arch_sh4a)
 
-#define arch_sh_dsp_up (arch_sh_dsp | arch_sh3_dsp_up)
-#define arch_sh3_dsp_up (arch_sh3_dsp | arch_sh4al_dsp_up)
+/* Left branch */
+#define arch_sh_dsp_up    (arch_sh_dsp | arch_sh3_dsp_up)
+#define arch_sh3_dsp_up   (arch_sh3_dsp | arch_sh4al_dsp_up)
 #define arch_sh4al_dsp_up (arch_sh4al_dsp)
 
-#define arch_sh4_nommu_nofpu_up (arch_sh4_nommu_nofpu | arch_sh4_nofp_up)
 
-#define arch_sh4_nofp_up (arch_sh4_nofpu | arch_sh4_up | arch_sh4a_nofp_up)
-#define arch_sh4a_nofp_up (arch_sh4a_nofpu | arch_sh4a_up | arch_sh4al_dsp_up)
-
-#define arch_sh_any_with_mmu (arch_sh3 | arch_sh3e_up | arch_sh3_dsp_up \
-	| arch_sh4_nofp_up)  /* arch _sh3_up omitting arch_sh4_nommu_nofpu */
 
 typedef struct
 {
   char *name;
   sh_arg_type arg[4];
   sh_nibble_type nibbles[5];
-  int arch;
+  unsigned int arch;
 } sh_opcode_info;
 
 #ifdef DEFINE_TABLE
@@ -313,13 +388,13 @@
 
 /* 0100nnnn01101110 ldc <REG_N>,RS     */{"ldc",{A_REG_N,A_RS},{HEX_4,REG_N,HEX_6,HEX_E}, arch_sh_dsp_up},
 
-/* 0100nnnn00111110 ldc <REG_N>,SSR     */{"ldc",{A_REG_N,A_SSR},{HEX_4,REG_N,HEX_3,HEX_E}, arch_sh3_up},
+/* 0100nnnn00111110 ldc <REG_N>,SSR     */{"ldc",{A_REG_N,A_SSR},{HEX_4,REG_N,HEX_3,HEX_E}, arch_sh3_nommu_up},
 
-/* 0100nnnn01001110 ldc <REG_N>,SPC     */{"ldc",{A_REG_N,A_SPC},{HEX_4,REG_N,HEX_4,HEX_E}, arch_sh3_up},
+/* 0100nnnn01001110 ldc <REG_N>,SPC     */{"ldc",{A_REG_N,A_SPC},{HEX_4,REG_N,HEX_4,HEX_E}, arch_sh3_nommu_up},
 
 /* 0100nnnn11111010 ldc <REG_N>,DBR     */{"ldc",{A_REG_N,A_DBR},{HEX_4,REG_N,HEX_F,HEX_A}, arch_sh4_nommu_nofpu_up},
 
-/* 0100nnnn1xxx1110 ldc <REG_N>,Rn_BANK */{"ldc",{A_REG_N,A_REG_B},{HEX_4,REG_N,REG_B,HEX_E}, arch_sh3_up},
+/* 0100nnnn1xxx1110 ldc <REG_N>,Rn_BANK */{"ldc",{A_REG_N,A_REG_B},{HEX_4,REG_N,REG_B,HEX_E}, arch_sh3_nommu_up},
 
 /* 0100nnnn00000111 ldc.l @<REG_N>+,SR  */{"ldc.l",{A_INC_N,A_SR},{HEX_4,REG_N,HEX_0,HEX_7}, arch_sh1_up},
 
@@ -335,13 +410,13 @@
 
 /* 0100nnnn01100111 ldc.l @<REG_N>+,RS */{"ldc.l",{A_INC_N,A_RS},{HEX_4,REG_N,HEX_6,HEX_7}, arch_sh_dsp_up},
 
-/* 0100nnnn00110111 ldc.l @<REG_N>+,SSR */{"ldc.l",{A_INC_N,A_SSR},{HEX_4,REG_N,HEX_3,HEX_7}, arch_sh3_up},
+/* 0100nnnn00110111 ldc.l @<REG_N>+,SSR */{"ldc.l",{A_INC_N,A_SSR},{HEX_4,REG_N,HEX_3,HEX_7}, arch_sh3_nommu_up},
 
-/* 0100nnnn01000111 ldc.l @<REG_N>+,SPC */{"ldc.l",{A_INC_N,A_SPC},{HEX_4,REG_N,HEX_4,HEX_7}, arch_sh3_up},
+/* 0100nnnn01000111 ldc.l @<REG_N>+,SPC */{"ldc.l",{A_INC_N,A_SPC},{HEX_4,REG_N,HEX_4,HEX_7}, arch_sh3_nommu_up},
 
 /* 0100nnnn11110110 ldc.l @<REG_N>+,DBR */{"ldc.l",{A_INC_N,A_DBR},{HEX_4,REG_N,HEX_F,HEX_6}, arch_sh4_nommu_nofpu_up},
 
-/* 0100nnnn1xxx0111 ldc.l <REG_N>,Rn_BANK */{"ldc.l",{A_INC_N,A_REG_B},{HEX_4,REG_N,REG_B,HEX_7}, arch_sh3_up},
+/* 0100nnnn1xxx0111 ldc.l <REG_N>,Rn_BANK */{"ldc.l",{A_INC_N,A_REG_B},{HEX_4,REG_N,REG_B,HEX_7}, arch_sh3_nommu_up},
 
 /* 0100mmmm00110100 ldrc <REG_M>        */{"ldrc",{A_REG_M},{HEX_4,REG_M,HEX_3,HEX_4}, arch_sh4al_dsp_up},
 /* 10001010i8*1.... ldrc #<imm>         */{"ldrc",{A_IMM},{HEX_8,HEX_A,IMM0_8}, arch_sh4al_dsp_up},
@@ -394,7 +469,7 @@
   
 /* 0100nnnn01100110 lds.l @<REG_M>+,FPSCR*/{"lds.l",{A_INC_M,FPSCR_N},{HEX_4,REG_M,HEX_6,HEX_6}, arch_sh2e_up},
 
-/* 0000000000111000 ldtlb               */{"ldtlb",{0},{HEX_0,HEX_0,HEX_3,HEX_8}, arch_sh_any_with_mmu},
+/* 0000000000111000 ldtlb               */{"ldtlb",{0},{HEX_0,HEX_0,HEX_3,HEX_8}, arch_sh3_up},
 
 /* 0100nnnnmmmm1111 mac.w @<REG_M>+,@<REG_N>+*/{"mac.w",{A_INC_M,A_INC_N},{HEX_4,REG_N,REG_M,HEX_F}, arch_sh1_up},
 
@@ -535,9 +610,9 @@
 
 /* repeat start end #<imm>        	*/{"repeat",{A_DISP_PC,A_DISP_PC,A_IMM},{REPEAT,HEX_2,IMM0_8,HEX_8}, arch_sh_dsp_up},
 
-/* 0100nnnnmmmm1100 shad <REG_M>,<REG_N>*/{"shad",{ A_REG_M,A_REG_N},{HEX_4,REG_N,REG_M,HEX_C}, arch_sh3_up},
+/* 0100nnnnmmmm1100 shad <REG_M>,<REG_N>*/{"shad",{ A_REG_M,A_REG_N},{HEX_4,REG_N,REG_M,HEX_C}, arch_sh3_nommu_up},
 
-/* 0100nnnnmmmm1101 shld <REG_M>,<REG_N>*/{"shld",{ A_REG_M,A_REG_N},{HEX_4,REG_N,REG_M,HEX_D}, arch_sh3_up},
+/* 0100nnnnmmmm1101 shld <REG_M>,<REG_N>*/{"shld",{ A_REG_M,A_REG_N},{HEX_4,REG_N,REG_M,HEX_D}, arch_sh3_nommu_up},
 
 /* 0100nnnn00100000 shal <REG_N>        */{"shal",{A_REG_N},{HEX_4,REG_N,HEX_2,HEX_0}, arch_sh1_up},
 
@@ -573,15 +648,15 @@
 
 /* 0000nnnn01100010 stc RS,<REG_N>     */{"stc",{A_RS,A_REG_N},{HEX_0,REG_N,HEX_6,HEX_2}, arch_sh_dsp_up},
 
-/* 0000nnnn00110010 stc SSR,<REG_N>     */{"stc",{A_SSR,A_REG_N},{HEX_0,REG_N,HEX_3,HEX_2}, arch_sh3_up},
+/* 0000nnnn00110010 stc SSR,<REG_N>     */{"stc",{A_SSR,A_REG_N},{HEX_0,REG_N,HEX_3,HEX_2}, arch_sh3_nommu_up},
 
-/* 0000nnnn01000010 stc SPC,<REG_N>     */{"stc",{A_SPC,A_REG_N},{HEX_0,REG_N,HEX_4,HEX_2}, arch_sh3_up},
+/* 0000nnnn01000010 stc SPC,<REG_N>     */{"stc",{A_SPC,A_REG_N},{HEX_0,REG_N,HEX_4,HEX_2}, arch_sh3_nommu_up},
 
 /* 0000nnnn00111010 stc SGR,<REG_N>     */{"stc",{A_SGR,A_REG_N},{HEX_0,REG_N,HEX_3,HEX_A}, arch_sh4_nommu_nofpu_up},
 
 /* 0000nnnn11111010 stc DBR,<REG_N>     */{"stc",{A_DBR,A_REG_N},{HEX_0,REG_N,HEX_F,HEX_A}, arch_sh4_nommu_nofpu_up},
 
-/* 0000nnnn1xxx0010 stc Rn_BANK,<REG_N> */{"stc",{A_REG_B,A_REG_N},{HEX_0,REG_N,REG_B,HEX_2}, arch_sh3_up},
+/* 0000nnnn1xxx0010 stc Rn_BANK,<REG_N> */{"stc",{A_REG_B,A_REG_N},{HEX_0,REG_N,REG_B,HEX_2}, arch_sh3_nommu_up},
 
 /* 0100nnnn00000011 stc.l SR,@-<REG_N>  */{"stc.l",{A_SR,A_DEC_N},{HEX_4,REG_N,HEX_0,HEX_3}, arch_sh1_up},
 
@@ -593,9 +668,9 @@
 
 /* 0100nnnn01100011 stc.l RS,@-<REG_N>  */{"stc.l",{A_RS,A_DEC_N},{HEX_4,REG_N,HEX_6,HEX_3}, arch_sh_dsp_up},
 
-/* 0100nnnn00110011 stc.l SSR,@-<REG_N> */{"stc.l",{A_SSR,A_DEC_N},{HEX_4,REG_N,HEX_3,HEX_3}, arch_sh3_up},
+/* 0100nnnn00110011 stc.l SSR,@-<REG_N> */{"stc.l",{A_SSR,A_DEC_N},{HEX_4,REG_N,HEX_3,HEX_3}, arch_sh3_nommu_up},
 
-/* 0100nnnn01000011 stc.l SPC,@-<REG_N> */{"stc.l",{A_SPC,A_DEC_N},{HEX_4,REG_N,HEX_4,HEX_3}, arch_sh3_up},
+/* 0100nnnn01000011 stc.l SPC,@-<REG_N> */{"stc.l",{A_SPC,A_DEC_N},{HEX_4,REG_N,HEX_4,HEX_3}, arch_sh3_nommu_up},
 
 /* 0100nnnn00010011 stc.l GBR,@-<REG_N> */{"stc.l",{A_GBR,A_DEC_N},{HEX_4,REG_N,HEX_1,HEX_3}, arch_sh1_up},
 
@@ -603,7 +678,7 @@
 
 /* 0100nnnn11110010 stc.l DBR,@-<REG_N> */{"stc.l",{A_DBR,A_DEC_N},{HEX_4,REG_N,HEX_F,HEX_2}, arch_sh4_nommu_nofpu_up},
 
-/* 0100nnnn1xxx0011 stc.l Rn_BANK,@-<REG_N> */{"stc.l",{A_REG_B,A_DEC_N},{HEX_4,REG_N,REG_B,HEX_3}, arch_sh3_up},
+/* 0100nnnn1xxx0011 stc.l Rn_BANK,@-<REG_N> */{"stc.l",{A_REG_B,A_DEC_N},{HEX_4,REG_N,REG_B,HEX_3}, arch_sh3_nommu_up},
 
 /* 0000nnnn00001010 sts MACH,<REG_N>    */{"sts",{A_MACH,A_REG_N},{HEX_0,REG_N,HEX_0,HEX_A}, arch_sh1_up},
 
diff --git a/opcodes/sparc-opc.c b/opcodes/sparc-opc.c
index 22f18fa..9470898 100644
--- a/opcodes/sparc-opc.c
+++ b/opcodes/sparc-opc.c
@@ -1273,110 +1273,72 @@
 #define FM_DF 2		/* v9 */
 #define FM_QF 3		/* v9 */
 
-#define fmovicc(opcode, fpsize, cond, flags) /* v9 */ \
-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z,f,g", flags, v9 }, \
-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z,f,g", flags, v9 }
+#define fmoviccx(opcode, fpsize, args, cond, flags) /* v9 */ \
+{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z," args, flags, v9 }, \
+{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z," args, flags, v9 }
 
-#define fmovfcc(opcode, fpsize, fcond, flags) /* v9 */ \
-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags, v9 }, \
-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags, v9 }, \
-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags, v9 }, \
-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags, v9 }
+#define fmovfccx(opcode, fpsize, args, fcond, flags) /* v9 */ \
+{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags, v9 }, \
+{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags, v9 }, \
+{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags, v9 }, \
+{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags, v9 }
 
 /* FIXME: use fmovicc/fmovfcc? */ /* v9 */
-#define fmovcc(opcode, fpsize, cond, fcond, flags) /* v9 */ \
-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z,f,g", flags | F_FLOAT, v9 }, \
-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags | F_FLOAT, v9 }, \
-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z,f,g", flags | F_FLOAT, v9 }, \
-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags | F_FLOAT, v9 }, \
-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags | F_FLOAT, v9 }, \
-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags | F_FLOAT, v9 }
+#define fmovccx(opcode, fpsize, args, cond, fcond, flags) /* v9 */ \
+{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0),  "z," args, flags | F_FLOAT, v9 }, \
+{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags | F_FLOAT, v9 }, \
+{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0),  F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0),  "Z," args, flags | F_FLOAT, v9 }, \
+{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags | F_FLOAT, v9 }, \
+{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags | F_FLOAT, v9 }, \
+{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags | F_FLOAT, v9 }
 
-/* v9 */ fmovcc  ("fmovda",	FM_DF, CONDA, FCONDA, 0),
-/* v9 */ fmovcc  ("fmovqa",	FM_QF, CONDA, FCONDA, 0),
-/* v9 */ fmovcc  ("fmovsa",	FM_SF, CONDA, FCONDA, 0),
-/* v9 */ fmovicc ("fmovdcc",	FM_DF, CONDCC, 0),
-/* v9 */ fmovicc ("fmovqcc",	FM_QF, CONDCC, 0),
-/* v9 */ fmovicc ("fmovscc",	FM_SF, CONDCC, 0),
-/* v9 */ fmovicc ("fmovdcs",	FM_DF, CONDCS, 0),
-/* v9 */ fmovicc ("fmovqcs",	FM_QF, CONDCS, 0),
-/* v9 */ fmovicc ("fmovscs",	FM_SF, CONDCS, 0),
-/* v9 */ fmovcc  ("fmovde",	FM_DF, CONDE, FCONDE, 0),
-/* v9 */ fmovcc  ("fmovqe",	FM_QF, CONDE, FCONDE, 0),
-/* v9 */ fmovcc  ("fmovse",	FM_SF, CONDE, FCONDE, 0),
-/* v9 */ fmovcc  ("fmovdg",	FM_DF, CONDG, FCONDG, 0),
-/* v9 */ fmovcc  ("fmovqg",	FM_QF, CONDG, FCONDG, 0),
-/* v9 */ fmovcc  ("fmovsg",	FM_SF, CONDG, FCONDG, 0),
-/* v9 */ fmovcc  ("fmovdge",	FM_DF, CONDGE, FCONDGE, 0),
-/* v9 */ fmovcc  ("fmovqge",	FM_QF, CONDGE, FCONDGE, 0),
-/* v9 */ fmovcc  ("fmovsge",	FM_SF, CONDGE, FCONDGE, 0),
-/* v9 */ fmovicc ("fmovdgeu",	FM_DF, CONDGEU, F_ALIAS),
-/* v9 */ fmovicc ("fmovqgeu",	FM_QF, CONDGEU, F_ALIAS),
-/* v9 */ fmovicc ("fmovsgeu",	FM_SF, CONDGEU, F_ALIAS),
-/* v9 */ fmovicc ("fmovdgu",	FM_DF, CONDGU, 0),
-/* v9 */ fmovicc ("fmovqgu",	FM_QF, CONDGU, 0),
-/* v9 */ fmovicc ("fmovsgu",	FM_SF, CONDGU, 0),
-/* v9 */ fmovcc  ("fmovdl",	FM_DF, CONDL, FCONDL, 0),
-/* v9 */ fmovcc  ("fmovql",	FM_QF, CONDL, FCONDL, 0),
-/* v9 */ fmovcc  ("fmovsl",	FM_SF, CONDL, FCONDL, 0),
-/* v9 */ fmovcc  ("fmovdle",	FM_DF, CONDLE, FCONDLE, 0),
-/* v9 */ fmovcc  ("fmovqle",	FM_QF, CONDLE, FCONDLE, 0),
-/* v9 */ fmovcc  ("fmovsle",	FM_SF, CONDLE, FCONDLE, 0),
-/* v9 */ fmovicc ("fmovdleu",	FM_DF, CONDLEU, 0),
-/* v9 */ fmovicc ("fmovqleu",	FM_QF, CONDLEU, 0),
-/* v9 */ fmovicc ("fmovsleu",	FM_SF, CONDLEU, 0),
-/* v9 */ fmovfcc ("fmovdlg",	FM_DF, FCONDLG, 0),
-/* v9 */ fmovfcc ("fmovqlg",	FM_QF, FCONDLG, 0),
-/* v9 */ fmovfcc ("fmovslg",	FM_SF, FCONDLG, 0),
-/* v9 */ fmovicc ("fmovdlu",	FM_DF, CONDLU, F_ALIAS),
-/* v9 */ fmovicc ("fmovqlu",	FM_QF, CONDLU, F_ALIAS),
-/* v9 */ fmovicc ("fmovslu",	FM_SF, CONDLU, F_ALIAS),
-/* v9 */ fmovcc  ("fmovdn",	FM_DF, CONDN, FCONDN, 0),
-/* v9 */ fmovcc  ("fmovqn",	FM_QF, CONDN, FCONDN, 0),
-/* v9 */ fmovcc  ("fmovsn",	FM_SF, CONDN, FCONDN, 0),
-/* v9 */ fmovcc  ("fmovdne",	FM_DF, CONDNE, FCONDNE, 0),
-/* v9 */ fmovcc  ("fmovqne",	FM_QF, CONDNE, FCONDNE, 0),
-/* v9 */ fmovcc  ("fmovsne",	FM_SF, CONDNE, FCONDNE, 0),
-/* v9 */ fmovicc ("fmovdneg",	FM_DF, CONDNEG, 0),
-/* v9 */ fmovicc ("fmovqneg",	FM_QF, CONDNEG, 0),
-/* v9 */ fmovicc ("fmovsneg",	FM_SF, CONDNEG, 0),
-/* v9 */ fmovcc  ("fmovdnz",	FM_DF, CONDNZ, FCONDNZ, F_ALIAS),
-/* v9 */ fmovcc  ("fmovqnz",	FM_QF, CONDNZ, FCONDNZ, F_ALIAS),
-/* v9 */ fmovcc  ("fmovsnz",	FM_SF, CONDNZ, FCONDNZ, F_ALIAS),
-/* v9 */ fmovfcc ("fmovdo",	FM_DF, FCONDO, 0),
-/* v9 */ fmovfcc ("fmovqo",	FM_QF, FCONDO, 0),
-/* v9 */ fmovfcc ("fmovso",	FM_SF, FCONDO, 0),
-/* v9 */ fmovicc ("fmovdpos",	FM_DF, CONDPOS, 0),
-/* v9 */ fmovicc ("fmovqpos",	FM_QF, CONDPOS, 0),
-/* v9 */ fmovicc ("fmovspos",	FM_SF, CONDPOS, 0),
-/* v9 */ fmovfcc ("fmovdu",	FM_DF, FCONDU, 0),
-/* v9 */ fmovfcc ("fmovqu",	FM_QF, FCONDU, 0),
-/* v9 */ fmovfcc ("fmovsu",	FM_SF, FCONDU, 0),
-/* v9 */ fmovfcc ("fmovdue",	FM_DF, FCONDUE, 0),
-/* v9 */ fmovfcc ("fmovque",	FM_QF, FCONDUE, 0),
-/* v9 */ fmovfcc ("fmovsue",	FM_SF, FCONDUE, 0),
-/* v9 */ fmovfcc ("fmovdug",	FM_DF, FCONDUG, 0),
-/* v9 */ fmovfcc ("fmovqug",	FM_QF, FCONDUG, 0),
-/* v9 */ fmovfcc ("fmovsug",	FM_SF, FCONDUG, 0),
-/* v9 */ fmovfcc ("fmovduge",	FM_DF, FCONDUGE, 0),
-/* v9 */ fmovfcc ("fmovquge",	FM_QF, FCONDUGE, 0),
-/* v9 */ fmovfcc ("fmovsuge",	FM_SF, FCONDUGE, 0),
-/* v9 */ fmovfcc ("fmovdul",	FM_DF, FCONDUL, 0),
-/* v9 */ fmovfcc ("fmovqul",	FM_QF, FCONDUL, 0),
-/* v9 */ fmovfcc ("fmovsul",	FM_SF, FCONDUL, 0),
-/* v9 */ fmovfcc ("fmovdule",	FM_DF, FCONDULE, 0),
-/* v9 */ fmovfcc ("fmovqule",	FM_QF, FCONDULE, 0),
-/* v9 */ fmovfcc ("fmovsule",	FM_SF, FCONDULE, 0),
-/* v9 */ fmovicc ("fmovdvc",	FM_DF, CONDVC, 0),
-/* v9 */ fmovicc ("fmovqvc",	FM_QF, CONDVC, 0),
-/* v9 */ fmovicc ("fmovsvc",	FM_SF, CONDVC, 0),
-/* v9 */ fmovicc ("fmovdvs",	FM_DF, CONDVS, 0),
-/* v9 */ fmovicc ("fmovqvs",	FM_QF, CONDVS, 0),
-/* v9 */ fmovicc ("fmovsvs",	FM_SF, CONDVS, 0),
-/* v9 */ fmovcc  ("fmovdz",	FM_DF, CONDZ, FCONDZ, F_ALIAS),
-/* v9 */ fmovcc  ("fmovqz",	FM_QF, CONDZ, FCONDZ, F_ALIAS),
-/* v9 */ fmovcc  ("fmovsz",	FM_SF, CONDZ, FCONDZ, F_ALIAS),
+#define fmovicc(suffix, cond, flags) /* v9 */ \
+fmoviccx("fmovd" suffix, FM_DF, "B,H", cond, flags),		\
+fmoviccx("fmovq" suffix, FM_QF, "R,J", cond, flags),		\
+fmoviccx("fmovs" suffix, FM_SF, "f,g", cond, flags)
 
+#define fmovfcc(suffix, fcond, flags) /* v9 */ \
+fmovfccx("fmovd" suffix, FM_DF, "B,H", fcond, flags),		\
+fmovfccx("fmovq" suffix, FM_QF, "R,J", fcond, flags),		\
+fmovfccx("fmovs" suffix, FM_SF, "f,g", fcond, flags)
+
+#define fmovcc(suffix, cond, fcond, flags) /* v9 */ \
+fmovccx("fmovd" suffix, FM_DF, "B,H", cond, fcond, flags),	\
+fmovccx("fmovq" suffix, FM_QF, "R,J", cond, fcond, flags),	\
+fmovccx("fmovs" suffix, FM_SF, "f,g", cond, fcond, flags)
+
+/* v9 */ fmovcc  ("a", CONDA, FCONDA, 0),
+/* v9 */ fmovicc ("cc", CONDCC, 0),
+/* v9 */ fmovicc ("cs", CONDCS, 0),
+/* v9 */ fmovcc  ("e", CONDE, FCONDE, 0),
+/* v9 */ fmovcc  ("g", CONDG, FCONDG, 0),
+/* v9 */ fmovcc  ("ge", CONDGE, FCONDGE, 0),
+/* v9 */ fmovicc ("geu", CONDGEU, F_ALIAS),
+/* v9 */ fmovicc ("gu", CONDGU, 0),
+/* v9 */ fmovcc  ("l", CONDL, FCONDL, 0),
+/* v9 */ fmovcc  ("le", CONDLE, FCONDLE, 0),
+/* v9 */ fmovicc ("leu", CONDLEU, 0),
+/* v9 */ fmovfcc ("lg", FCONDLG, 0),
+/* v9 */ fmovicc ("lu", CONDLU, F_ALIAS),
+/* v9 */ fmovcc  ("n", CONDN, FCONDN, 0),
+/* v9 */ fmovcc  ("ne", CONDNE, FCONDNE, 0),
+/* v9 */ fmovicc ("neg", CONDNEG, 0),
+/* v9 */ fmovcc  ("nz", CONDNZ, FCONDNZ, F_ALIAS),
+/* v9 */ fmovfcc ("o", FCONDO, 0),
+/* v9 */ fmovicc ("pos", CONDPOS, 0),
+/* v9 */ fmovfcc ("u", FCONDU, 0),
+/* v9 */ fmovfcc ("ue", FCONDUE, 0),
+/* v9 */ fmovfcc ("ug", FCONDUG, 0),
+/* v9 */ fmovfcc ("uge", FCONDUGE, 0),
+/* v9 */ fmovfcc ("ul", FCONDUL, 0),
+/* v9 */ fmovfcc ("ule", FCONDULE, 0),
+/* v9 */ fmovicc ("vc", CONDVC, 0),
+/* v9 */ fmovicc ("vs", CONDVS, 0),
+/* v9 */ fmovcc  ("z", CONDZ, FCONDZ, F_ALIAS),
+
+#undef fmoviccx /* v9 */
+#undef fmovfccx /* v9 */
+#undef fmovccx /* v9 */
 #undef fmovicc /* v9 */
 #undef fmovfcc /* v9 */
 #undef fmovcc /* v9 */
diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog
index 6447e21..6dc94a5 100644
--- a/sim/arm/ChangeLog
+++ b/sim/arm/ChangeLog
@@ -1,3 +1,7 @@
+2004-06-28  Andrew Cagney  <cagney@gnu.org>
+
+	* armemu.c: Rename ui_loop_hook to deprecated_ui_loop_hook.
+
 2003-12-29  Mark Mitchell  <mark@codesourcery.com>
 
 	* armos.c (fcntl.h): Do not include it.
diff --git a/sim/arm/armemu.c b/sim/arm/armemu.c
index d12ad10..b484be4 100644
--- a/sim/arm/armemu.c
+++ b/sim/arm/armemu.c
@@ -56,7 +56,7 @@
 static long ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
 
 /* Actual hook to call to run through gdb's gui event loop.  */
-extern int (*ui_loop_hook) (int);
+extern int (*deprecated_ui_loop_hook) (int);
 #endif /* NEED_UI_LOOP_HOOK */
 
 extern int stop_simulator;
@@ -3564,10 +3564,10 @@
 #endif
 
 #ifdef NEED_UI_LOOP_HOOK
-      if (ui_loop_hook != NULL && ui_loop_hook_counter-- < 0)
+      if (deprecated_ui_loop_hook != NULL && ui_loop_hook_counter-- < 0)
 	{
 	  ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
-	  ui_loop_hook (0);
+	  deprecated_ui_loop_hook (0);
 	}
 #endif /* NEED_UI_LOOP_HOOK */
 
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index d287cdf..247ac57 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,44 @@
+2004-06-28  Andrew Cagney  <cagney@gnu.org>
+
+	* run.c: Rename ui_loop_hook to deprecated_ui_loop_hook.
+
+2004-06-27  J"orn Rennecke <joern.rennecke@superh.com>
+
+	* callback.c (os_shutdown): Fix bug in last change: actually
+	mark file descriptors as available on startup.
+
+2004-06-25  J"orn Rennecke <joern.rennecke@superh.com>
+
+	[ include/gdb: * callback.h (host_callback_struct): Replace
+		       members fdopen and alwaysopen with fd_buddy.  ]
+        * callback.c: Changed all users.
+
+2004-06-15  Alan Modra  <amodra@bigpond.net.au>
+
+	* sim-load.c (sim_load_file): Use bfd_get_section_size
+	instead of bfd_get_section_size_before_reloc.
+
+2004-05-18  Daniel Jacobowitz  <dan@debian.org>
+
+	* dv-glue.c (hw_glue_finish): Cast result of sizeof to long before
+	passing it to printf.
+
+2004-05-10  Daniel Jacobowitz  <dan@debian.org>
+
+	* callback.c: Update copyright dates.
+	* run.c: Likewise.
+	* sim-basics.h: Likewise.
+	* sim-load.c: Likewise.
+	* syscall.c: Likewise.
+
+2004-05-10  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
+
+	* callback.c: Include cconfig.h instead of config.h.
+	* run.c: Likewise.
+	* sim-basics.h: Likewise.
+	* sim-load.c: Likewise.
+	* syscall.c: Likewise.
+
 2004-01-16  Ben Elliston  <bje@wasabisystems.com>
 
 	* Makefile.in (clean): Remove rm -f $(ALL), as $(ALL) is empty.
diff --git a/sim/common/callback.c b/sim/common/callback.c
index aa2cf07..ca707fc 100644
--- a/sim/common/callback.c
+++ b/sim/common/callback.c
@@ -1,5 +1,6 @@
 /* Remote target callback routines.
-   Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1997, 2000, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
    This file is part of GDB.
@@ -22,7 +23,7 @@
    level.  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "cconfig.h"
 #endif
 #include "ansidecl.h"
 #ifdef ANSI_PROTOTYPES
@@ -109,7 +110,7 @@
      host_callback *p;
      int fd;
 {
-  if (fd < 0 || fd > MAX_CALLBACK_FDS || !p->fdopen[fd])
+  if (fd < 0 || fd > MAX_CALLBACK_FDS || p->fd_buddy[fd] < 0)
     {
       p->last_errno = EINVAL;
       return -1;
@@ -131,13 +132,20 @@
      int fd;
 {
   int result;
+  int i, next;
 
   result = fdbad (p, fd);
   if (result)
     return result;
-  result = wrap (p, close (fdmap (p, fd)));
-  if (result == 0 && !p->alwaysopen[fd])
-    p->fdopen[fd] = 0;
+  /* If this file descripter has one or more buddies (originals /
+     duplicates from a dup), just remove it from the circular list.  */
+  for (i = fd; (next = p->fd_buddy[i]) != fd; )
+    i = next;
+  if (fd != i)
+    p->fd_buddy[i] = p->fd_buddy[fd];
+  else
+    result = wrap (p, close (fdmap (p, fd)));
+  p->fd_buddy[fd] = -1;
 
   return result;
 }
@@ -233,7 +241,7 @@
   int i;
   for (i = 0; i < MAX_CALLBACK_FDS; i++)
     {
-      if (!p->fdopen[i])
+      if (p->fd_buddy[i] < 0)
 	{
 	  int f = open (name, cb_target_to_host_open (p, flags), 0644);
 	  if (f < 0)
@@ -241,7 +249,7 @@
 	      p->last_errno = errno;
 	      return f;
 	    }
-	  p->fdopen[i] = 1;
+	  p->fd_buddy[i] = i;
 	  p->fdmap[i] = f;
 	  return i;
 	}
@@ -427,13 +435,32 @@
 os_shutdown (p)
      host_callback *p;
 {
-  int i;
+  int i, next, j;
   for (i = 0; i < MAX_CALLBACK_FDS; i++)
     {
-      if (p->fdopen[i] && !p->alwaysopen[i]) {
+      int do_close = 1;
+
+      next = p->fd_buddy[i];
+      if (next < 0)
+	continue;
+      do
+	{
+	  j = next;
+	  if (j == MAX_CALLBACK_FDS)
+	    do_close = 0;
+	  next = p->fd_buddy[j];
+	  p->fd_buddy[j] = -1;
+	  /* At the initial call of os_init, we got -1, 0, 0, 0, ...  */
+	  if (next < 0)
+	    {
+	      p->fd_buddy[i] = -1;
+	      do_close = 0;
+	      break;
+	    }
+	}
+      while (j != i);
+      if (do_close)
 	close (p->fdmap[i]);
-	p->fdopen[i] = 0;
-      }
     }
   return 1;
 }
@@ -448,9 +475,10 @@
   for (i = 0; i < 3; i++)
     {
       p->fdmap[i] = i;
-      p->fdopen[i] = 1;
-      p->alwaysopen[i] = 1;
+      p->fd_buddy[i] = i - 1;
     }
+  p->fd_buddy[0] = MAX_CALLBACK_FDS;
+  p->fd_buddy[MAX_CALLBACK_FDS] = 2;
 
   p->syscall_map = cb_init_syscall_map;
   p->errno_map = cb_init_errno_map;
@@ -579,8 +607,7 @@
   0, 		/* last errno */
 
   { 0, },	/* fdmap */
-  { 0, },	/* fdopen */
-  { 0, },	/* alwaysopen */
+  { -1, },	/* fd_buddy */
 
   0, /* syscall_map */
   0, /* errno_map */
diff --git a/sim/common/dv-glue.c b/sim/common/dv-glue.c
index ab04fe7..1a94ae6 100644
--- a/sim/common/dv-glue.c
+++ b/sim/common/dv-glue.c
@@ -222,7 +222,7 @@
       hw_abort (me, "at least one reg property size must be nonzero");
     if (glue->sizeof_output % sizeof (unsigned_word) != 0)
       hw_abort (me, "reg property size must be %ld aligned",
-		sizeof (unsigned_word));
+		(long) sizeof (unsigned_word));
     /* and the address */
     hw_unit_address_to_attach_address (hw_parent (me),
 				       &unit.address,
@@ -231,7 +231,7 @@
 				       me);
     if (glue->address % (sizeof (unsigned_word) * max_nr_ports) != 0)
       hw_abort (me, "reg property address must be %ld aligned",
-		sizeof (unsigned_word) * max_nr_ports);
+		(long) (sizeof (unsigned_word) * max_nr_ports));
     glue->nr_outputs = glue->sizeof_output / sizeof (unsigned_word);
     glue->output = hw_zalloc (me, glue->sizeof_output);
   }
diff --git a/sim/common/run.c b/sim/common/run.c
index 7964200..a88e404 100644
--- a/sim/common/run.c
+++ b/sim/common/run.c
@@ -1,5 +1,6 @@
 /* run front end support for all the simulators.
-   Copyright (C) 1992, 93-96, 1997, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+   2001, 2002, 2003, 2004 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
@@ -18,8 +19,10 @@
 /* Steve Chamberlain sac@cygnus.com,
    and others at Cygnus.  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include "cconfig.h"
 #include "tconfig.h"
+#endif
 
 #include <signal.h>
 #include <stdio.h>
@@ -60,7 +63,7 @@
 
 #ifdef NEED_UI_LOOP_HOOK
 /* Gdb foolery. This is only needed for gdb using a gui.  */
-int (*ui_loop_hook) PARAMS ((int signo));
+int (*deprecated_ui_loop_hook) PARAMS ((int signo));
 #endif
 
 static SIM_DESC sd;
diff --git a/sim/common/sim-basics.h b/sim/common/sim-basics.h
index be6cb9e..b140566 100644
--- a/sim/common/sim-basics.h
+++ b/sim/common/sim-basics.h
@@ -1,6 +1,6 @@
 /* The common simulator framework for GDB, the GNU Debugger.
 
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2004 Free Software Foundation, Inc.
 
    Contributed by Andrew Cagney and Red Hat.
 
@@ -29,7 +29,7 @@
 /* Basic configuration */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "cconfig.h"
 #endif
 
 /* Basic host dependant mess - hopefully <stdio.h> + <stdarg.h> will
diff --git a/sim/common/sim-load.c b/sim/common/sim-load.c
index 314d2dd..5fc4c98 100644
--- a/sim/common/sim-load.c
+++ b/sim/common/sim-load.c
@@ -1,5 +1,5 @@
 /* Utility to load a file into the simulator.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2001, 2002, 2004 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
@@ -19,7 +19,9 @@
    as it is used by simulators that don't use it [though that doesn't mean
    to suggest that they shouldn't :-)].  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include "cconfig.h"
+#endif
 #include "ansidecl.h"
 #include <stdio.h> /* for NULL */
 #ifdef ANSI_PROTOTYPES
@@ -110,7 +112,7 @@
 	{
 	  bfd_size_type size;
 
-	  size = bfd_get_section_size_before_reloc (s);
+	  size = bfd_get_section_size (s);
 	  if (size > 0)
 	    {
 	      char *buffer;
diff --git a/sim/common/syscall.c b/sim/common/syscall.c
index 75121cf..04dc71e 100644
--- a/sim/common/syscall.c
+++ b/sim/common/syscall.c
@@ -1,5 +1,5 @@
 /* Remote target system call support.
-   Copyright 1997, 1998 Free Software Foundation, Inc.
+   Copyright 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
    This file is part of GDB.
@@ -25,7 +25,7 @@
    supported.  */
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "cconfig.h"
 #endif
 #include "ansidecl.h"
 #include "libiberty.h"
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog
index e5aff56..514acd2 100644
--- a/sim/d10v/ChangeLog
+++ b/sim/d10v/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-28  Andrew Cagney  <cagney@gnu.org>
+
+	* interp.c (sim_resume): Rename ui_loop_hook to
+	deprecated_ui_loop_hook.
+
 2003-10-30  Andrew Cagney  <cagney@redhat.com>
 
 	* simops.c: Replace "struct symbol_cache_entry" with "struct
diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c
index 284a4e1..e4bae22 100644
--- a/sim/d10v/interp.c
+++ b/sim/d10v/interp.c
@@ -49,7 +49,7 @@
 static long ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
 
 /* Actual hook to call to run through gdb's gui event loop */
-extern int (*ui_loop_hook) PARAMS ((int signo));
+extern int (*deprecated_ui_loop_hook) PARAMS ((int signo));
 #endif /* NEED_UI_LOOP_HOOK */
 
 #ifndef INLINE
@@ -1061,10 +1061,10 @@
       SLOT_FLUSH ();
 
 #ifdef NEED_UI_LOOP_HOOK
-      if (ui_loop_hook != NULL && ui_loop_hook_counter-- < 0)
+      if (deprecated_ui_loop_hook != NULL && ui_loop_hook_counter-- < 0)
 	{
 	  ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
-	  ui_loop_hook (0);
+	  deprecated_ui_loop_hook (0);
 	}
 #endif /* NEED_UI_LOOP_HOOK */
     }
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index 9938196..d1a4fa0 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,3 +1,19 @@
+2004-06-28  Alexandre Oliva  <aoliva@redhat.com>
+
+	2003-07-23  Richard Sandiford  <rsandifo@redhat.com>
+	* compile.c (sim_resume): Make sure that dst.reg refers to the
+	right register byte in mova/sz.l @(dd,RnL),ERn.
+	2003-07-21  Richard Sandiford  <rsandifo@redhat.com>
+	* compile.c (sim_resume): Zero-extend immediate to muls, mulsu,
+	mulxs, divs and divxs.
+
+	* compile.c (sim_load): Update sd->memory_size.
+
+2004-06-10  Michael Snyder  <msnyder@redhat.com>
+
+	Patch submitted by Nitin Yewale <NitinY@KPITCummins.com>.
+	* compile.c (sim_resume): Corrected ANDC operation on EXR for H8S.
+
 2004-01-05  Michael Snyder  <msnyder@redhat.com>
 
 	* compile.c (sim_load): Don't pass a type to bfd_openr.
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index ec5f974..3c11e82 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -2037,7 +2037,10 @@
 	      code->op3.literal = 0;
 
 	      if (OP_KIND (code->src.type) == OP_INDEXB)
-		code->dst.type = X (OP_REG, SB);
+		{
+		  code->dst.type = X (OP_REG, SB);
+		  code->dst.reg = code->op3.reg + 8;
+		}
 	      else
 		code->dst.type = X (OP_REG, SW);
 	    }
@@ -2566,7 +2569,7 @@
 	    {
 	      if (h8300smode)
 		h8_set_exr (sd, (trace << 7) | intMask);
-	      res = h8_get_exr (sd);
+	      rd = h8_get_exr (sd);
 	    }
 	  else
 	    goto illegal;
@@ -3886,13 +3889,7 @@
 	      fetch (sd, &code->dst, &rd))
 	    goto end;
 
-	  /* FIXME: is this the right place to be doing sign extend?  */
-	  if (OP_KIND (code->src.type) == OP_IMM &&
-	      (ea & 8) != 0)
-	    ea |= 0xfff0;
-	  else
-	    ea = SEXTSHORT (ea);
-
+	  ea = SEXTSHORT (ea);
 	  res = SEXTSHORT (ea * SEXTSHORT (rd));
 
 	  n  = res & 0x8000;
@@ -3907,11 +3904,6 @@
 	      fetch (sd, &code->dst, &rd))
 	    goto end;
 
-	  /* FIXME: is this the right place to be doing sign extend?  */
-	  if (OP_KIND (code->src.type) == OP_IMM &&
-	      (ea & 8) != 0)
-	    ea |= 0xfffffff0;
-
 	  res = ea * rd;
 
 	  n  = res & 0x80000000;
@@ -3925,11 +3917,6 @@
 	      fetch (sd, &code->dst, &rd))
 	    goto end;
 
-	  /* FIXME: is this the right place to be doing sign extend?  */
-	  if (OP_KIND (code->src.type) == OP_IMM &&
-	      (ea & 8) != 0)
-	    ea |= 0xfffffff0;
-
 	  /* Compute upper 32 bits of the 64-bit result.  */
 	  res = (((long long) ea) * ((long long) rd)) >> 32;
 
@@ -3985,13 +3972,7 @@
 	      fetch (sd, &code->dst, &rd))
 	    goto end;
 
-	  /* FIXME: is this the right place to be doing sign extend?  */
-	  if (OP_KIND (code->src.type) == OP_IMM &&
-	      (ea & 8) != 0)
-	    ea |= 0xfffffff0;
-	  else
-	    ea = SEXTCHAR (ea);
-
+	  ea = SEXTCHAR (ea);
 	  res = ea * SEXTCHAR (rd);
 
 	  n  = res & 0x8000;
@@ -4006,13 +3987,7 @@
 	      fetch (sd, &code->dst, &rd))
 	    goto end;
 
-	  /* FIXME: is this the right place to be doing sign extend?  */
-	  if (OP_KIND (code->src.type) == OP_IMM &&
-	      (ea & 8) != 0)
-	    ea |= 0xfff0;
-	  else
-	    ea = SEXTSHORT (ea);
-
+	  ea = SEXTSHORT (ea);
 	  res = ea * SEXTSHORT (rd & 0xffff);
 
 	  n  = res & 0x80000000;
@@ -4103,11 +4078,6 @@
 	      fetch (sd, &code->dst, &rd))
 	    goto end;
 
-	  /* FIXME: is this the right place to be doing sign extend?  */
-	  if (OP_KIND (code->src.type) == OP_IMM &&
-	      (ea & 8) != 0)
-	    ea |= 0xfffffff0;
-
 	  if (ea)
 	    {
 	      res = SEXTSHORT (rd) / SEXTSHORT (ea);
@@ -4129,11 +4099,6 @@
 	      fetch (sd, &code->dst, &rd))
 	    goto end;
 
-	  /* FIXME: is this the right place to be doing sign extend?  */
-	  if (OP_KIND (code->src.type) == OP_IMM &&
-	      (ea & 8) != 0)
-	    ea |= 0xfffffff0;
-
 	  if (ea)
 	    {
 	      res = rd / ea;
@@ -4205,13 +4170,7 @@
 	    goto end;
 
 	  rd = SEXTSHORT (rd);
-
-	  /* FIXME: is this the right place to be doing sign extend?  */
-	  if (OP_KIND (code->src.type) == OP_IMM &&
-	      (ea & 8) != 0)
-	    ea |= 0xfffffff0;
-	  else
-	    ea = SEXTCHAR (ea);
+	  ea = SEXTCHAR (ea);
 
 	  if (ea)
 	    {
@@ -4236,12 +4195,7 @@
 	      fetch (sd, &code->dst, &rd))
 	    goto end;
 
-	  /* FIXME: is this the right place to be doing sign extend?  */
-	  if (OP_KIND (code->src.type) == OP_IMM &&
-	      (ea & 8) != 0)
-	    ea |= 0xfffffff0;
-	  else
-	    ea = SEXTSHORT (ea);
+	  ea = SEXTSHORT (ea);
 
 	  if (ea)
 	    {
@@ -5096,6 +5050,7 @@
 		     calloc (sizeof (char), memory_size));
   h8_set_cache_idx_buf (sd, (unsigned short *) 
 			calloc (sizeof (short), memory_size));
+  sd->memory_size = memory_size;
   h8_set_eightbit_buf (sd, (unsigned char *) calloc (sizeof (char), 256));
 
   /* `msize' must be a power of two.  */
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog
index 7c2294c..8d3db71 100644
--- a/sim/m32r/ChangeLog
+++ b/sim/m32r/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-18  Daniel Jacobowitz  <dan@debian.org>
+
+	* Makefile.in (stamp-xmloop, stamp-2mloop): Use -outfile-suffix.
+
 2004-02-04  Andrew Cagney  <cagney@redhat.com>
 
 	Committed by Andrew Cagney.
diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
index eb29ab1..e2dc82f 100644
--- a/sim/m32r/Makefile.in
+++ b/sim/m32r/Makefile.in
@@ -1,5 +1,6 @@
 # Makefile template for Configure for the m32r simulator
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2003, 2004
+# Free Software Foundation, Inc.
 # Contributed by Cygnus Support.
 #
 # This file is part of GDB, the GNU debugger.
@@ -107,9 +108,10 @@
 stamp-xmloop: $(srcdir)/../common/genmloop.sh mloopx.in Makefile
 	$(SHELL) $(srccom)/genmloop.sh \
 		-mono -no-fast -pbb -parallel-write -switch semx-switch.c \
-		-cpu m32rxf -infile $(srcdir)/mloopx.in
-	$(SHELL) $(srcroot)/move-if-change eng.hin engx.h
-	$(SHELL) $(srcroot)/move-if-change mloop.cin mloopx.c
+		-cpu m32rxf -infile $(srcdir)/mloopx.in \
+		-outfile-suffix x
+	$(SHELL) $(srcroot)/move-if-change engx.hin engx.h
+	$(SHELL) $(srcroot)/move-if-change mloopx.cin mloopx.c
 	touch stamp-xmloop
 mloopx.o: mloopx.c semx-switch.c $(M32RXF_INCLUDE_DEPS)
 
@@ -131,9 +133,10 @@
 stamp-2mloop: $(srcdir)/../common/genmloop.sh mloop2.in Makefile
 	$(SHELL) $(srccom)/genmloop.sh \
 		-mono -no-fast -pbb -parallel-write -switch sem2-switch.c \
-		-cpu m32r2f -infile $(srcdir)/mloop2.in
-	$(SHELL) $(srcroot)/move-if-change eng.hin eng2.h
-	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop2.c
+		-cpu m32r2f -infile $(srcdir)/mloop2.in \
+		-outfile-suffix 2
+	$(SHELL) $(srcroot)/move-if-change eng2.hin eng2.h
+	$(SHELL) $(srcroot)/move-if-change mloop2.cin mloop2.c
 	touch stamp-2mloop
 
 mloop2.o:  mloop2.c sem2-switch.c $(M32R2F_INCLUDE_DEPS)
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index 3d019d7..341f0af 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-15  Alan Modra  <amodra@bigpond.net.au>
+
+	* interp.c (sim_prepare_for_program): Use bfd_get_section_size
+	instead of bfd_get_section_size_before_reloc.
+
 2003-08-08  Stephane Carrez  <stcarrez@nerim.fr>
 
 	* dv-m68hc11tim.c (cycle_to_string): Add flags parameter to better
diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c
index b80bc94..eed2d2c 100644
--- a/sim/m68hc11/interp.c
+++ b/sim/m68hc11/interp.c
@@ -1,5 +1,6 @@
 /* interp.c -- Simulator for Motorola 68HC11/68HC12
-   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
    Written by Stephane Carrez (stcarrez@nerim.fr)
 
 This file is part of GDB, the GNU debugger.
@@ -386,7 +387,7 @@
             {
               bfd_size_type size;
 
-              size = bfd_get_section_size_before_reloc (s);
+              size = bfd_get_section_size (s);
               if (size > 0)
                 {
                   bfd_vma lma;
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index fab4c6e..5a46086 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,3 +1,46 @@
+2004-06-25  Chris Demetriou  <cgd@broadcom.com>
+
+	* configure.in (sim_m16_machine): Include mipsIII.
+	* configure: Regenerate.
+
+2004-05-11  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
+
+	* mips/interp.c (decode_coproc): Sign-extend the address retrieved 
+	from COP0_BADVADDR.
+	* mips/sim-main.h (COP0_BADVADDR): Remove a cast.
+
+2004-04-10  Chris Demetriou  <cgd@broadcom.com>
+
+	* sb1.igen (DIV.PS, RECIP.PS, RSQRT.PS, SQRT.PS): New.
+
+2004-04-09  Chris Demetriou  <cgd@broadcom.com>
+
+	* mips.igen (check_fmt): Remove.
+	(ABS.fmt, ADD.fmt, C.cond.fmta, C.cond.fmtb, CEIL.L.fmt, CEIL.W)
+	(CVT.D.fmt, CVT.L.fmt, CVT.S.fmt, CVT.W.fmt, DIV.fmt, FLOOR.L.fmt)
+	(FLOOR.W.fmt, MADD.fmt, MOV.fmt, MOVtf.fmt, MOVN.fmt, MOVZ.fmt)
+	(MSUB.fmt, MUL.fmt, NEG.fmt, NMADD.fmt, NMSUB.fmt, RECIP.fmt)
+	(ROUND.L.fmt, ROUND.W.fmt, RSQRT.fmt, SQRT.fmt, SUB.fmt)
+	(TRUNC.L.fmt, TRUNC.W): Explicitly specify allowed FPU formats.
+	(check_fmt_p, CEIL.L.fmt, CEIL.W, DIV.fmt, FLOOR.L.fmt)
+	(FLOOR.W.fmt, RECIP.fmt, ROUND.L.fmt, ROUND.W.fmt, RSQRT.fmt)
+	(SQRT.fmt, TRUNC.L.fmt, TRUNC.W): Remove all uses of check_fmt.
+	(C.cnd.fmta): Remove incorrect call to check_fmt_p.
+
+2004-04-09  Chris Demetriou  <cgd@broadcom.com>
+
+	* sb1.igen (check_sbx): New function.
+	(PABSDIFF.fmt, PABSDIFC.fmt, PAVG.fmt): Use check_sbx.
+
+2004-03-29  Chris Demetriou  <cgd@broadcom.com>
+	    Richard Sandiford  <rsandifo@redhat.com>
+
+	* sim-main.h (MIPS_MACH_HAS_MT_HILO_HAZARD)
+	(MIPS_MACH_HAS_MULT_HILO_HAZARD, MIPS_MACH_HAS_DIV_HILO_HAZARD): New.
+	* mips.igen (check_mt_hilo, check_mult_hilo, check_div_hilo): Provide
+	separate implementations for mipsIV and mipsV.  Use new macros to
+	determine whether the restrictions apply.
+
 2004-01-19  Chris Demetriou  <cgd@broadcom.com>
 
 	* mips.igen (check_mf_cycles, check_mt_hilo, check_mf_hilo)
diff --git a/sim/mips/configure b/sim/mips/configure
index a0471b3..c0460e4 100755
--- a/sim/mips/configure
+++ b/sim/mips/configure
@@ -4061,7 +4061,7 @@
 #
 sim_gen=IGEN
 sim_igen_machine="-M mipsIV"
-sim_m16_machine="-M mips16"
+sim_m16_machine="-M mips16,mipsIII"
 sim_igen_filter="32,64,f"
 sim_m16_filter="16"
 sim_mach_default="mips8000"
diff --git a/sim/mips/configure.in b/sim/mips/configure.in
index 1ea4901..83ea774 100644
--- a/sim/mips/configure.in
+++ b/sim/mips/configure.in
@@ -99,7 +99,7 @@
 #
 sim_gen=IGEN
 sim_igen_machine="-M mipsIV"
-sim_m16_machine="-M mips16"
+sim_m16_machine="-M mips16,mipsIII"
 sim_igen_filter="32,64,f"
 sim_m16_filter="16"
 sim_mach_default="mips8000"
diff --git a/sim/mips/interp.c b/sim/mips/interp.c
index f8c14c8..043d76d 100644
--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -2102,7 +2102,7 @@
 	      case 8:
 		/* 8 = BadVAddr            R4000   VR4100  VR4300 */
 		if (code == 0x00)
-		  GPR[rt] = COP0_BADVADDR;
+		  GPR[rt] = (signed_word) (signed_address) COP0_BADVADDR;
 		else
 		  COP0_BADVADDR = GPR[rt];
 		break;
diff --git a/sim/mips/mips.igen b/sim/mips/mips.igen
index cfc2d6d..b6a4085 100644
--- a/sim/mips/mips.igen
+++ b/sim/mips/mips.igen
@@ -238,13 +238,15 @@
 // On the r3900, restriction (2) is not present, and restriction (3) is not
 // present for multiplication.
 //
-// For now this code is paranoid.  Historically the simulator
-// enforced restrictions (2) and (3) for more ISAs and CPU types than
-// necessary.  Unfortunately, at least some MIPS IV and later parts'
-// documentation describes them as having these hazards (e.g. vr5000),
-// so they can't be removed for at leats MIPS IV.  MIPS V hasn't been
-// checked (since there are no known hardware implementations).
-// 
+// Unfortunately, there seems to be some confusion about whether the last
+// two restrictions should apply to "MIPS IV" as well.  One edition of
+// the MIPS IV ISA says they do, but references in later ISA documents
+// suggest they don't.
+//
+// In reality, some MIPS IV parts, such as the VR5000 and VR5400, do have
+// these restrictions, while others, like the VR5500, don't.  To accomodate
+// such differences, the MIPS IV and MIPS V version of these helper functions
+// use auxillary routines to determine whether the restriction applies.
 
 // check_mf_cycles:
 //
@@ -274,8 +276,6 @@
 *mipsI:
 *mipsII:
 *mipsIII:
-*mipsIV:
-*mipsV:
 *vr4100:
 *vr5000:
 {
@@ -287,6 +287,18 @@
 }
 
 :function:::int:check_mt_hilo:hilo_history *history
+*mipsIV:
+*mipsV:
+{
+  signed64 time = sim_events_time (SD);
+  int ok = (! MIPS_MACH_HAS_MT_HILO_HAZARD (SD)
+	    || check_mf_cycles (SD_, history, time, "MT"));
+  history->mt.timestamp = time;
+  history->mt.cia = CIA;
+  return ok;
+}
+
+:function:::int:check_mt_hilo:hilo_history *history
 *mips32:
 *mips64:
 *r3900:
@@ -350,8 +362,6 @@
 *mipsI:
 *mipsII:
 *mipsIII:
-*mipsIV:
-*mipsV:
 *vr4100:
 *vr5000:
 {
@@ -366,6 +376,21 @@
 }
 
 :function:::int:check_mult_hilo:hilo_history *hi, hilo_history *lo
+*mipsIV:
+*mipsV:
+{
+  signed64 time = sim_events_time (SD);
+  int ok = (! MIPS_MACH_HAS_MULT_HILO_HAZARD (SD)
+	    || (check_mf_cycles (SD_, hi, time, "OP")
+	        && check_mf_cycles (SD_, lo, time, "OP")));
+  hi->op.timestamp = time;
+  lo->op.timestamp = time;
+  hi->op.cia = CIA;
+  lo->op.cia = CIA;
+  return ok;
+}
+
+:function:::int:check_mult_hilo:hilo_history *hi, hilo_history *lo
 *mips32:
 *mips64:
 *r3900:
@@ -389,8 +414,6 @@
 *mipsI:
 *mipsII:
 *mipsIII:
-*mipsIV:
-*mipsV:
 *vr4100:
 *vr5000:
 *r3900:
@@ -406,6 +429,21 @@
 }
 
 :function:::int:check_div_hilo:hilo_history *hi, hilo_history *lo
+*mipsIV:
+*mipsV:
+{
+  signed64 time = sim_events_time (SD);
+  int ok = (! MIPS_MACH_HAS_DIV_HILO_HAZARD (SD)
+	    || (check_mf_cycles (SD_, hi, time, "OP")
+	        && check_mf_cycles (SD_, lo, time, "OP")));
+  hi->op.timestamp = time;
+  lo->op.timestamp = time;
+  hi->op.cia = CIA;
+  lo->op.cia = CIA;
+  return ok;
+}
+
+:function:::int:check_div_hilo:hilo_history *hi, hilo_history *lo
 *mips32:
 *mips64:
 {
@@ -3605,23 +3643,6 @@
 // ReservedInstruction exception if not.
 //
 
-// check_fmt checks that the format is single or double.
-:function:::void:check_fmt:int fmt, instruction_word insn
-*mipsI:
-*mipsII:
-*mipsIII:
-*mipsIV:
-*mipsV:
-*mips32:
-*mips64:
-*vr4100:
-*vr5000:
-*r3900:
-{
-  if ((fmt != fmt_single) && (fmt != fmt_double))
-    SignalException (ReservedInstruction, insn);
-}
-
 // check_fmt_p checks that the format is single, double, or paired single.
 :function:::void:check_fmt_p:int fmt, instruction_word insn
 *mipsI:
@@ -3635,7 +3656,8 @@
 {
   /* None of these ISAs support Paired Single, so just fall back to
      the single/double check.  */
-  check_fmt (SD_, fmt, insn);
+  if ((fmt != fmt_single) && (fmt != fmt_double))
+    SignalException (ReservedInstruction, insn);
 }
 
 :function:::void:check_fmt_p:int fmt, instruction_word insn
@@ -3742,7 +3764,7 @@
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,000101:COP1:32,f::ABS.fmt
+010001,10,3.FMT!2!3!4!5!7,00000,5.FS,5.FD,000101:COP1:32,f::ABS.fmt
 "abs.%s<FMT> f<FD>, f<FS>"
 *mipsI:
 *mipsII:
@@ -3763,7 +3785,7 @@
 
 
 
-010001,10,3.FMT,5.FT,5.FS,5.FD,000000:COP1:32,f::ADD.fmt
+010001,10,3.FMT!2!3!4!5!7,5.FT,5.FS,5.FD,000000:COP1:32,f::ADD.fmt
 "add.%s<FMT> f<FD>, f<FS>, f<FT>"
 *mipsI:
 *mipsII:
@@ -3864,7 +3886,7 @@
 }
 
 
-010001,10,3.FMT,5.FT,5.FS,3.0,00,11,4.COND:COP1:32,f::C.cond.fmta
+010001,10,3.FMT!2!3!4!5!6!7,5.FT,5.FS,3.0,00,11,4.COND:COP1:32,f::C.cond.fmta
 "c.%s<COND>.%s<FMT> f<FS>, f<FT>"
 *mipsI:
 *mipsII:
@@ -3872,12 +3894,11 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt_p (SD_, fmt, instruction_0);
   Compare (ValueFPR (FS, fmt), ValueFPR (FT, fmt), fmt, COND, 0);
   TRACE_ALU_RESULT (ValueFCR (31));
 }
 
-010001,10,3.FMT,5.FT,5.FS,3.CC,00,11,4.COND:COP1:32,f::C.cond.fmtb
+010001,10,3.FMT!2!3!4!5!7,5.FT,5.FS,3.CC,00,11,4.COND:COP1:32,f::C.cond.fmtb
 "c.%s<COND>.%s<FMT> f<FS>, f<FT>":CC == 0
 "c.%s<COND>.%s<FMT> <CC>, f<FS>, f<FT>"
 *mipsIV:
@@ -3896,7 +3917,7 @@
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,001010:COP1:64,f::CEIL.L.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,001010:COP1:64,f::CEIL.L.fmt
 "ceil.l.%s<FMT> f<FD>, f<FS>"
 *mipsIII:
 *mipsIV:
@@ -3908,13 +3929,12 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt_long, Convert (FP_RM_TOPINF, ValueFPR (FS, fmt), fmt,
 	    fmt_long));
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,001110:COP1:32,f::CEIL.W
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,001110:COP1:32,f::CEIL.W
 "ceil.w.%s<FMT> f<FD>, f<FS>"
 *mipsII:
 *mipsIII:
@@ -3928,7 +3948,6 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt_word, Convert (FP_RM_TOPINF, ValueFPR (FS, fmt), fmt,
 	    fmt_word));
 }
@@ -4026,7 +4045,7 @@
 //
 // FIXME: Does not correctly differentiate between mips*
 //
-010001,10,3.FMT,00000,5.FS,5.FD,100001:COP1:32,f::CVT.D.fmt
+010001,10,3.FMT!1!2!3!6!7,00000,5.FS,5.FD,100001:COP1:32,f::CVT.D.fmt
 "cvt.d.%s<FMT> f<FD>, f<FS>"
 *mipsI:
 *mipsII:
@@ -4048,7 +4067,7 @@
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,100101:COP1:64,f::CVT.L.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,100101:COP1:64,f::CVT.L.fmt
 "cvt.l.%s<FMT> f<FD>, f<FS>"
 *mipsIII:
 *mipsIV:
@@ -4082,7 +4101,7 @@
 //
 // FIXME: Does not correctly differentiate between mips*
 //
-010001,10,3.FMT!6,00000,5.FS,5.FD,100000:COP1:32,f::CVT.S.fmt
+010001,10,3.FMT!0!2!3!6!7,00000,5.FS,5.FD,100000:COP1:32,f::CVT.S.fmt
 "cvt.s.%s<FMT> f<FD>, f<FS>"
 *mipsI:
 *mipsII:
@@ -4126,7 +4145,7 @@
 }
 
 
-010001,10,3.FMT!6,00000,5.FS,5.FD,100100:COP1:32,f::CVT.W.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,100100:COP1:32,f::CVT.W.fmt
 "cvt.w.%s<FMT> f<FD>, f<FS>"
 *mipsI:
 *mipsII:
@@ -4148,7 +4167,7 @@
 }
 
 
-010001,10,3.FMT,5.FT,5.FS,5.FD,000011:COP1:32,f::DIV.fmt
+010001,10,3.FMT!2!3!4!5!6!7,5.FT,5.FS,5.FD,000011:COP1:32,f::DIV.fmt
 "div.%s<FMT> f<FD>, f<FS>, f<FT>"
 *mipsI:
 *mipsII:
@@ -4163,7 +4182,6 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt, Divide (ValueFPR (FS, fmt), ValueFPR (FT, fmt), fmt));
 }
 
@@ -4245,7 +4263,7 @@
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,001011:COP1:64,f::FLOOR.L.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,001011:COP1:64,f::FLOOR.L.fmt
 "floor.l.%s<FMT> f<FD>, f<FS>"
 *mipsIII:
 *mipsIV:
@@ -4257,13 +4275,12 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt_long, Convert (FP_RM_TOMINF, ValueFPR (FS, fmt), fmt,
 	    fmt_long));
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,001111:COP1:32,f::FLOOR.W.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,001111:COP1:32,f::FLOOR.W.fmt
 "floor.w.%s<FMT> f<FD>, f<FS>"
 *mipsII:
 *mipsIII:
@@ -4277,7 +4294,6 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt_word, Convert (FP_RM_TOMINF, ValueFPR (FS, fmt), fmt,
 	    fmt_word));
 }
@@ -4370,7 +4386,7 @@
 
 
 
-010011,5.FR,5.FT,5.FS,5.FD,100,3.FMT:COP1X:64,f::MADD.fmt
+010011,5.FR,5.FT,5.FS,5.FD,100,3.FMT!2!3!4!5!7:COP1X:64,f::MADD.fmt
 "madd.%s<FMT> f<FD>, f<FR>, f<FS>, f<FT>"
 *mipsIV:
 *mipsV:
@@ -4415,7 +4431,7 @@
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,000110:COP1:32,f::MOV.fmt
+010001,10,3.FMT!2!3!4!5!7,00000,5.FS,5.FD,000110:COP1:32,f::MOV.fmt
 "mov.%s<FMT> f<FD>, f<FS>"
 *mipsI:
 *mipsII:
@@ -4453,7 +4469,7 @@
 
 // MOVF.fmt
 // MOVT.fmt
-010001,10,3.FMT,3.CC,0,1.TF,5.FS,5.FD,010001:COP1:32,f::MOVtf.fmt
+010001,10,3.FMT!2!3!4!5!7,3.CC,0,1.TF,5.FS,5.FD,010001:COP1:32,f::MOVtf.fmt
 "mov%s<TF>.%s<FMT> f<FD>, f<FS>, <CC>"
 *mipsIV:
 *mipsV:
@@ -4482,7 +4498,7 @@
 }
 
 
-010001,10,3.FMT,5.RT,5.FS,5.FD,010011:COP1:32,f::MOVN.fmt
+010001,10,3.FMT!2!3!4!5!7,5.RT,5.FS,5.FD,010011:COP1:32,f::MOVN.fmt
 "movn.%s<FMT> f<FD>, f<FS>, r<RT>"
 *mipsIV:
 *mipsV:
@@ -4505,7 +4521,7 @@
 
 
 
-010001,10,3.FMT,5.RT,5.FS,5.FD,010010:COP1:32,f::MOVZ.fmt
+010001,10,3.FMT!2!3!4!5!7,5.RT,5.FS,5.FD,010010:COP1:32,f::MOVZ.fmt
 "movz.%s<FMT> f<FD>, f<FS>, r<RT>"
 *mipsIV:
 *mipsV:
@@ -4521,7 +4537,7 @@
 }
 
 
-010011,5.FR,5.FT,5.FS,5.FD,101,3.FMT:COP1X:64,f::MSUB.fmt
+010011,5.FR,5.FT,5.FS,5.FD,101,3.FMT!2!3!4!5!7:COP1X:64,f::MSUB.fmt
 "msub.%s<FMT> f<FD>, f<FR>, f<FS>, f<FT>"
 *mipsIV:
 *mipsV:
@@ -4566,7 +4582,7 @@
 }
 
 
-010001,10,3.FMT,5.FT,5.FS,5.FD,000010:COP1:32,f::MUL.fmt
+010001,10,3.FMT!2!3!4!5!7,5.FT,5.FS,5.FD,000010:COP1:32,f::MUL.fmt
 "mul.%s<FMT> f<FD>, f<FS>, f<FT>"
 *mipsI:
 *mipsII:
@@ -4586,7 +4602,7 @@
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,000111:COP1:32,f::NEG.fmt
+010001,10,3.FMT!2!3!4!5!7,00000,5.FS,5.FD,000111:COP1:32,f::NEG.fmt
 "neg.%s<FMT> f<FD>, f<FS>"
 *mipsI:
 *mipsII:
@@ -4606,7 +4622,7 @@
 }
 
 
-010011,5.FR,5.FT,5.FS,5.FD,110,3.FMT:COP1X:64,f::NMADD.fmt
+010011,5.FR,5.FT,5.FS,5.FD,110,3.FMT!2!3!4!5!7:COP1X:64,f::NMADD.fmt
 "nmadd.%s<FMT> f<FD>, f<FR>, f<FS>, f<FT>"
 *mipsIV:
 *mipsV:
@@ -4622,7 +4638,7 @@
 }
 
 
-010011,5.FR,5.FT,5.FS,5.FD,111,3.FMT:COP1X:64,f::NMSUB.fmt
+010011,5.FR,5.FT,5.FS,5.FD,111,3.FMT!2!3!4!5!7:COP1X:64,f::NMSUB.fmt
 "nmsub.%s<FMT> f<FD>, f<FR>, f<FS>, f<FT>"
 *mipsIV:
 *mipsV:
@@ -4705,7 +4721,7 @@
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,010101:COP1:32,f::RECIP.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,010101:COP1:32,f::RECIP.fmt
 "recip.%s<FMT> f<FD>, f<FS>"
 *mipsIV:
 *mipsV:
@@ -4714,12 +4730,11 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt, Recip (ValueFPR (FS, fmt), fmt));
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,001000:COP1:64,f::ROUND.L.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,001000:COP1:64,f::ROUND.L.fmt
 "round.l.%s<FMT> f<FD>, f<FS>"
 *mipsIII:
 *mipsIV:
@@ -4731,13 +4746,12 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt_long, Convert (FP_RM_NEAREST, ValueFPR (FS, fmt), fmt,
 	    fmt_long));
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,001100:COP1:32,f::ROUND.W.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,001100:COP1:32,f::ROUND.W.fmt
 "round.w.%s<FMT> f<FD>, f<FS>"
 *mipsII:
 *mipsIII:
@@ -4751,13 +4765,12 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt_word, Convert (FP_RM_NEAREST, ValueFPR (FS, fmt), fmt,
 	    fmt_word));
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,010110:COP1:32,f::RSQRT.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,010110:COP1:32,f::RSQRT.fmt
 "rsqrt.%s<FMT> f<FD>, f<FS>"
 *mipsIV:
 *mipsV:
@@ -4766,7 +4779,6 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt, RSquareRoot (ValueFPR (FS, fmt), fmt));
 }
 
@@ -4827,7 +4839,7 @@
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,000100:COP1:32,f::SQRT.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,000100:COP1:32,f::SQRT.fmt
 "sqrt.%s<FMT> f<FD>, f<FS>"
 *mipsII:
 *mipsIII:
@@ -4841,12 +4853,11 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt,  (SquareRoot (ValueFPR (FS, fmt), fmt)));
 }
 
 
-010001,10,3.FMT,5.FT,5.FS,5.FD,000001:COP1:32,f::SUB.fmt
+010001,10,3.FMT!2!3!4!5!7,5.FT,5.FS,5.FD,000001:COP1:32,f::SUB.fmt
 "sub.%s<FMT> f<FD>, f<FS>, f<FT>"
 *mipsI:
 *mipsII:
@@ -4951,7 +4962,7 @@
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,001001:COP1:64,f::TRUNC.L.fmt
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,001001:COP1:64,f::TRUNC.L.fmt
 "trunc.l.%s<FMT> f<FD>, f<FS>"
 *mipsIII:
 *mipsIV:
@@ -4963,13 +4974,12 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt_long, Convert (FP_RM_TOZERO, ValueFPR (FS, fmt), fmt,
 	    fmt_long));
 }
 
 
-010001,10,3.FMT,00000,5.FS,5.FD,001101:COP1:32,f::TRUNC.W
+010001,10,3.FMT!2!3!4!5!6!7,00000,5.FS,5.FD,001101:COP1:32,f::TRUNC.W
 "trunc.w.%s<FMT> f<FD>, f<FS>"
 *mipsII:
 *mipsIII:
@@ -4983,7 +4993,6 @@
 {
   int fmt = FMT;
   check_fpu (SD_);
-  check_fmt (SD_, fmt, instruction_0);
   StoreFPR (FD, fmt_word, Convert (FP_RM_TOZERO, ValueFPR (FS, fmt), fmt,
 	    fmt_word));
 }
diff --git a/sim/mips/sb1.igen b/sim/mips/sb1.igen
index 33c5141..b6534cb 100644
--- a/sim/mips/sb1.igen
+++ b/sim/mips/sb1.igen
@@ -22,6 +22,20 @@
 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
+// Helper:
+//
+// Check that the SB-1 extension instruction can currently be used, and
+// signal a ReservedInstruction exception if not.
+//
+
+:function:::void:check_sbx:instruction_word insn
+*sb1:
+{
+  if ((SR & status_SBX) == 0)
+    SignalException(ReservedInstruction, insn);
+}
+
+
 //  MDMX ASE Instructions
 //  ---------------------
 //
@@ -152,13 +166,9 @@
 *sb1:
 {
   check_mdmx (SD_, instruction_0);
-  if (SR & status_SBX)
-    {
-      check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
-      StoreFPR(VD,fmt_mdmx,MX_AbsDiff(ValueFPR(VS,fmt_mdmx),VT,FMTSEL));
-    }
-  else
-    SignalException(ReservedInstruction, instruction_0);
+  check_sbx (SD_, instruction_0);
+  check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
+  StoreFPR(VD,fmt_mdmx,MX_AbsDiff(ValueFPR(VS,fmt_mdmx),VT,FMTSEL));
 }
 
 
@@ -167,13 +177,9 @@
 *sb1:
 {
   check_mdmx (SD_, instruction_0);
-  if (SR & status_SBX)
-    {
-      check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
-      MX_AbsDiffC(ValueFPR(VS,fmt_mdmx),VT,FMTSEL);
-    }
-  else
-    SignalException(ReservedInstruction, instruction_0);
+  check_sbx (SD_, instruction_0);
+  check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
+  MX_AbsDiffC(ValueFPR(VS,fmt_mdmx),VT,FMTSEL);
 }
 
 
@@ -182,11 +188,57 @@
 *sb1:
 {
   check_mdmx (SD_, instruction_0);
-  if (SR & status_SBX)
-    {
-      check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
-      StoreFPR(VD,fmt_mdmx,MX_Avg(ValueFPR(VS,fmt_mdmx),VT,FMTSEL));
-    }
-  else
-    SignalException(ReservedInstruction, instruction_0);
+  check_sbx (SD_, instruction_0);
+  check_mdmx_fmtsel (SD_, instruction_0, FMTSEL);
+  StoreFPR(VD,fmt_mdmx,MX_Avg(ValueFPR(VS,fmt_mdmx),VT,FMTSEL));
+}
+
+
+//  Paired-Single Extension Instructions
+//  ------------------------------------
+//
+//  The SB-1 implements several .PS format instructions that are
+//  extensions to the MIPS64 architecture.
+
+010001,10,3.FMT=6,5.FT,5.FS,5.FD,000011:COP1:32,f::DIV.PS
+"div.%s<FMT> f<FD>, f<FS>, f<FT>"
+*sb1:
+{
+  int fmt = FMT;
+  check_fpu (SD_);
+  check_sbx (SD_, instruction_0);
+  StoreFPR (FD, fmt, Divide (ValueFPR (FS, fmt), ValueFPR (FT, fmt), fmt));
+}
+
+
+010001,10,3.FMT=6,00000,5.FS,5.FD,010101:COP1:32,f::RECIP.PS
+"recip.%s<FMT> f<FD>, f<FS>"
+*sb1:
+{
+  int fmt = FMT;
+  check_fpu (SD_);
+  check_sbx (SD_, instruction_0);
+  StoreFPR (FD, fmt, Recip (ValueFPR (FS, fmt), fmt));
+}
+
+
+010001,10,3.FMT=6,00000,5.FS,5.FD,010110:COP1:32,f::RSQRT.PS
+"rsqrt.%s<FMT> f<FD>, f<FS>"
+*sb1:
+{
+  int fmt = FMT;
+  check_fpu (SD_);
+  check_sbx (SD_, instruction_0);
+  StoreFPR (FD, fmt, RSquareRoot (ValueFPR (FS, fmt), fmt));
+}
+
+
+010001,10,3.FMT=6,00000,5.FS,5.FD,000100:COP1:32,f::SQRT.PS
+"sqrt.%s<FMT> f<FD>, f<FS>"
+*sb1:
+{
+  int fmt = FMT;
+  check_fpu (SD_);
+  check_sbx (SD_, instruction_0);
+  StoreFPR (FD, fmt,  (SquareRoot (ValueFPR (FS, fmt), fmt)));
 }
diff --git a/sim/mips/sim-main.h b/sim/mips/sim-main.h
index 2f3ffa4..10ddbf2 100644
--- a/sim/mips/sim-main.h
+++ b/sim/mips/sim-main.h
@@ -383,7 +383,7 @@
 #define NR_COP0_GPR	32
   unsigned_word cop0_gpr[NR_COP0_GPR];
 #define COP0_GPR	((CPU)->cop0_gpr)
-#define COP0_BADVADDR ((unsigned32)(COP0_GPR[8]))
+#define COP0_BADVADDR	(COP0_GPR[8])
 
   /* While space is allocated for the floating point registers in the
      main registers array, they are stored separatly.  This is because
@@ -953,6 +953,18 @@
 #define	MIPS_MACH(SD)	MIPS_MACH_DEFAULT
 #endif
 
+/* Macros for determining whether a MIPS IV or MIPS V part is subject
+   to the hi/lo restrictions described in mips.igen.  */
+
+#define MIPS_MACH_HAS_MT_HILO_HAZARD(SD) \
+  (MIPS_MACH (SD) != bfd_mach_mips5500)
+
+#define MIPS_MACH_HAS_MULT_HILO_HAZARD(SD) \
+  (MIPS_MACH (SD) != bfd_mach_mips5500)
+
+#define MIPS_MACH_HAS_DIV_HILO_HAZARD(SD) \
+  (MIPS_MACH (SD) != bfd_mach_mips5500)
+
 #if H_REVEALS_MODULE_P (SIM_MAIN_INLINE)
 #include "sim-main.c"
 #endif
diff --git a/sim/mn10200/ChangeLog b/sim/mn10200/ChangeLog
index 090b05c..ea930dc 100644
--- a/sim/mn10200/ChangeLog
+++ b/sim/mn10200/ChangeLog
@@ -1,3 +1,7 @@
+2004-06-28  Andrew Cagney  <cagney@gnu.org>
+
+	* interp.c: Rename ui_loop_hook to deprecated_ui_loop_hook.
+
 2003-02-27  Andrew Cagney  <cagney@redhat.com>
 
 	* interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
diff --git a/sim/mn10200/interp.c b/sim/mn10200/interp.c
index ea4e04f..90529c8 100644
--- a/sim/mn10200/interp.c
+++ b/sim/mn10200/interp.c
@@ -12,7 +12,7 @@
 static long ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
 
 /* Actual hook to call to run through gdb's gui event loop */
-extern int (*ui_loop_hook) (int);
+extern int (*deprecated_ui_loop_hook) (int);
 #endif /* NEED_UI_LOOP_HOOK */
 
 host_callback *mn10200_callback;
@@ -326,10 +326,10 @@
       unsigned long insn, extension;
 
 #ifdef NEED_UI_LOOP_HOOK
-    if (ui_loop_hook != NULL && ui_loop_hook_counter-- < 0)
+    if (deprecated_ui_loop_hook != NULL && ui_loop_hook_counter-- < 0)
       {
 	ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
-	ui_loop_hook (0);
+	deprecated_ui_loop_hook (0);
       }
 #endif /* NEED_UI_LOOP_HOOK */
 
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog
index 5602ce8..0ef7ba3 100644
--- a/sim/mn10300/ChangeLog
+++ b/sim/mn10300/ChangeLog
@@ -1,3 +1,92 @@
+2004-06-26  Alexandre Oliva  <aoliva@redhat.com>
+
+	2000-08-07  Graham Stott  <grahams@cygnus.co.uk>
+	* am33-2.igen (fmadd, fmsub, fmnadd, fmnsub): Correct typo.
+	2000-05-29  Alexandre Oliva  <aoliva@cygnus.com>
+	* interp.c (fpu_disabled_exception, fpu_unimp_exception,
+	fpu_check_signal_exception): Take additional state arguments.
+	Print exception type and call program_interrupt.  Adjust callers.
+	(fpu_rsqrt, fpu_cmp, fpu_add, fpu_sub, fpu_mul, fpu_div,
+	fpu_fmadd, fpu_fmsub, fpu_fnmadd, fpu_fnmsub): Take additional
+	arguments.
+	* mn10300_sim.h (fpu_disabled_exception, fpu_unimp_exception,
+	fpu_check_signal_exception): Adjust prototypes.
+	(fpu_rsqrt, fpu_cmp, fpu_add, fpu_sub, fpu_mul, fpu_div,
+	fpu_fmadd, fpu_fmsub, fpu_fnmadd, fpu_fnmsub): Likewise.
+	* am33-2.igen: Adjust calls.
+	2000-05-19  Alexandre Oliva  <aoliva@cygnus.com>
+	* op_utils.c (cmp2fcc): Moved...
+	* interp.c: ... here.
+	2000-05-18  Alexandre Oliva  <aoliva@cygnus.com>
+	* am33-2.igen: Use `unsigned32', `signed32', `unsigned64' or
+	`signed64' where type width is relevant.
+	2000-05-15  Alexandre Oliva  <aoliva@cygnus.com>
+	* mn10300_sim.h: Include sim-fpu.h.
+	(FD2FPU, FPU2FD): Enclose the FD argument in parentheses.
+	(fpu_check_signal_exception): Declare.
+	(struct fp_prec_t, fp_single_prec, fp_double_prec): Likewise.
+	(FP_SINGLE, FP_DOUBLE): Shorthands for fp_*_prec.
+	(fpu_rsqrt, fpu_cmp, fpu_add, fpu_sub, fpu_mul, fpu_div,
+	fpu_fmadd, fpu_fmsub, fpu_fnmadd, fpu_fnmsub): Declare.
+	* interp.c (fpu_disabled_exception): Document.
+	(fpu_unimp_exception): Likewise.
+	(fpu_check_signal_exception): Define.
+	(reg2val_32, round_32, val2reg_32, fp_single_prec): Likewise.
+	(reg2val_64, round_64, val2reg_64, fp_double_prec): Likewise.
+	(REG2VAL, ROUND, VAL2REG): Define shorthands.
+	(fpu_status_ok): Define.
+	(fpu_rsqrt, fpu_cmp, fpu_add, fpu_sub, fpu_mul, fpu_div,
+	fpu_fmadd, fpu_fmsub, fpu_fnmadd, fpu_fnmsub): Define.
+	* am33-2.igen (frsqrt, fcmp, fadd, fsub, fmul, fdiv,
+	fmadd, fmsub, fnmadd, fnmsub): Use new functions.
+	2000-04-27  Alexandre Oliva  <aoliva@cygnus.com>
+	* interp.c (sim_create_inferior): Set PSW bit to enable FP insns
+	if architecture is AM33/2.0.
+	* am33.igen: Include am33-2.igen.
+	2000-04-23  Alexandre Oliva  <aoliva@cygnus.com>
+	* mn10300.igen (movm, call, ret, retf): Check for am33_2 too.
+	* am33.igen (movm): Likewise.
+	2000-04-19  Alexandre Oliva  <aoliva@cygnus.com>
+	* am33.igen: Added `*am33_2' to some instructions that were
+	missing it.
+	2000-04-07  Alexandre Oliva  <aoliva@cygnus.com>
+	* am33-2.igen: New file.  All insns implemented, but FP flags are
+	only set for fcmp, exceptional conditions are not handled yet.
+	* Makefile.in (IGEN_INSN): Added am33-2.igen.
+	(tmp-igen): Added -M am33_2.
+	* mn10300.igen, am33.igen: Added `*am33_2' to all insns.
+	* gencode.c: Support FMT_D3.
+	* mn10300_sim.h (dword): New type.
+	(struct _state): Added fpregs.
+	(REG_FPCR, FPCR): New define.  All assorted bitmaps.
+	(XS2FS, AS2FS, Xf2FD): New macros.
+	(FS2FPU, FD2FPU, FPU2FS, FPU2FD): Likewise.
+	(load_dword, store_dword): New functions or macros.
+	(u642dw, dw2u64): New functions.
+	(fpu_disabled_exception, fpu_unimp_exception): Declared.
+	* interp.c (fpu_disabled_exception): Defined; no actual
+	implementation.
+	(fpu_unimp_exception): Likewise.
+	* op_utils.c (cmp2fcc): New function.
+
+	* interp.c, mn10300_sim.h, op_utils.c: Convert function prototypes
+	and definitions to ISO C.
+
+	* gencode.c, simops.c: Delete.
+	* Makefile.in: Remove non-COMMON dependencies and commands.
+
+	* configure.in: Use common simulator always.  Don't subst sim_gen
+	nor mn10300_common.
+	* configure: Rebuilt.
+	* Makefile.in (WITHOUT_COMMON_OBJS, WITHOUT_COMMON_INTERP_DEP,
+	WITHOUT_COMMON_RUN_OBJS): Remove.
+	(WITH_COMMON_OBJS): Rename to MN10300_OBJS.
+	(WITH_COMMON_INTERP_DEP): Rename to MN10300_INTERP_DEP.
+	(WITH_COMMON_RUN_OBJS): Rename to SIM_RUN_OBJS.
+	(SIM_EXTRA_CFLAGS): Don't use @sim_gen@.
+	* interp.c: Remove non-common bits.
+	* mn10300_sim.h: Likewise.
+
 2003-08-28  Andrew Cagney  <cagney@redhat.com>
 
 	* dv-mn103ser.c (do_polling_event): Change type of "serial_reg" to
diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
index fc05552..53192f4 100644
--- a/sim/mn10300/Makefile.in
+++ b/sim/mn10300/Makefile.in
@@ -1,5 +1,5 @@
 #    Makefile template for Configure for the mn10300 sim library.
-#    Copyright (C) 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+#    Copyright (C) 1996, 1997, 2000, 2001, 2004 Free Software Foundation, Inc.
 #    Written by Cygnus Support.
 # 
 # This program is free software; you can redistribute it and/or modify
@@ -18,9 +18,7 @@
 
 ## COMMON_PRE_CONFIG_FRAG
 
-WITHOUT_COMMON_OBJS = table.o simops.o sim-load.o
-WITHOUT_COMMON_INTERP_DEP = table.c
-WITH_COMMON_OBJS = \
+MN10300_OBJS = \
 	itable.o semantics.o idecode.o icache.o engine.o irun.o support.o \
 	$(SIM_NEW_COMMON_OBJS) \
 	op_utils.o \
@@ -31,19 +29,13 @@
 	sim-reason.o \
 	sim-stop.o \
 	dv-sockser.o
-WITH_COMMON_INTERP_DEP = 
-
-MN10300_OBJS = $(@mn10300_common@_COMMON_OBJS)
-MN10300_INTERP_DEP = $(@mn10300_common@_COMMON_INTERP_DEP)
 
 SIM_OBJS = $(MN10300_OBJS) interp.o
 
 # List of main object files for `run'.
-WITHOUT_COMMON_RUN_OBJS = run.o
-WITH_COMMON_RUN_OBJS = nrun.o
-SIM_RUN_OBJS = $(@mn10300_common@_COMMON_RUN_OBJS)
+SIM_RUN_OBJS = nrun.o
 
-SIM_EXTRA_CLEAN = clean-extra
+SIM_EXTRA_CLEAN = clean-igen
 # Extra dependencies for "sim-main.h"
 SIM_EXTRA_DEPS = mn10300_sim.h itable.h idecode.h
 
@@ -53,32 +45,11 @@
 INCLUDE = mn10300_sim.h $(srcdir)/../../include/gdb/callback.h
 
 # List of extra flags to always pass to $(CC).
-SIM_EXTRA_CFLAGS = @sim_gen@ -DPOLL_QUIT_INTERVAL=0x20
+SIM_EXTRA_CFLAGS = -DPOLL_QUIT_INTERVAL=0x20
 
 ## COMMON_POST_CONFIG_FRAG
 
-
-#
-# Old generator (default)
-#
-
-simops.h: gencode
-	./gencode -h >$@
-
-table.c: gencode simops.h
-	./gencode >$@
-
-gencode.o: gencode.c $(INCLUDE)
-	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gencode.c
-
-m10300-opc.o: $(srcdir)/../../opcodes/m10300-opc.c
-	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/../../opcodes/m10300-opc.c
-
-gencode: gencode.o m10300-opc.o
-	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -o gencode gencode.o m10300-opc.o $(BUILD_LIB)
-
-idecode.o op_utils.o semantics.o simops.o: targ-vals.h
-
+idecode.o op_utils.o semantics.o: targ-vals.h
 
 BUILT_SRC_FROM_IGEN = \
 	icache.h \
@@ -108,7 +79,7 @@
 	cd ../igen && $(MAKE)
 
 IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries
-IGEN_INSN=$(srcdir)/mn10300.igen $(srcdir)/am33.igen
+IGEN_INSN=$(srcdir)/mn10300.igen $(srcdir)/am33.igen $(srcdir)/am33-2.igen
 IGEN_DC=$(srcdir)/mn10300.dc
 tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen
 	cd ../igen && $(MAKE)
@@ -116,6 +87,7 @@
 		$(IGEN_TRACE) \
 		-G gen-direct-access \
                 -M mn10300,am33 -G gen-multi-sim=am33 \
+		-M am33_2 \
 		-I $(srcdir) \
 		-i $(IGEN_INSN) \
 		-o $(IGEN_DC) \
@@ -152,10 +124,4 @@
 	$(SHELL) $(srcdir)/../../move-if-change tmp-irun.c irun.c
 	touch tmp-igen
 
-
-interp.o: interp.c $(MN10300_INTERP_DEP) $(INCLUDE)
-simops.o: simops.c simops.h $(INCLUDE)
-table.o: table.c
-
-clean-extra: clean-igen
-	rm -f table.c simops.h gencode
+interp.o: interp.c $(INCLUDE)
diff --git a/sim/mn10300/am33-2.igen b/sim/mn10300/am33-2.igen
new file mode 100644
index 0000000..bcf68b4
--- /dev/null
+++ b/sim/mn10300/am33-2.igen
@@ -0,0 +1,2285 @@
+// data cache pre-fetch:
+
+// 1111 1001 1010 0110 Rm.. 0000; dcpf (Rm)
+8.0xf9+8.0xa6+4.RN2,4.0000:D1a:::dcpf
+"dcpf"
+*am33_2
+{
+  int srcreg;
+
+  PC = cia;
+
+  srcreg = translate_rreg (SD_, RN2);
+  load_word (State.regs[srcreg]);
+}
+
+// 1111 1001 1010 0111 0000 0000; dcpf (sp)
+8.0xf9+8.0xa7+8.0x00:D1b:::dcpf
+"dcpf"
+*am33_2
+{
+  PC = cia;
+
+  load_word (SP);
+}
+
+// 1111 1011 1010 0110 Ri.. Rm.. 0000 0000; dcpf (Ri,Rm)
+8.0xfb+8.0xa6+4.RN2,4.RN0+8.0x00:D2a:::dcpf
+"dcpf"
+*am33_2
+{
+  int srci, srcm;
+
+  PC = cia;
+
+  srci = translate_rreg (SD_, RN2);
+  srcm = translate_rreg (SD_, RN0);
+
+  load_word (State.regs[srci] + State.regs[srcm]);
+}
+
+// 1111 1011 1010 0111 Rm.. 0000 IMM8; dcpf (d8,Rm)
+8.0xfb+8.0xa7+4.RN2,4.0000+8.IMM8:D2b:::dcpf
+"dcpf"
+*am33_2
+{
+  int srcreg;
+
+  PC = cia;
+
+  srcreg = translate_rreg (SD_, RN2);
+
+  load_word (State.regs[srcreg] + EXTEND8 (IMM8));
+}
+
+// 1111 1101 1010 0111 Rm.. 0000 IMM24; dcpf (d24,Rm)
+8.0xfd+8.0xa7+4.RN2,4.0000+8.IMM24A+8.IMM24B+8.IMM24C:D4a:::dcpf
+"dcpf"
+*am33_2
+{
+  int srcreg;
+
+  PC = cia;
+
+  srcreg = translate_rreg (SD_, RN2);
+
+  load_word (State.regs[srcreg] + EXTEND24 (FETCH24 (IMM24A,
+						     IMM24B, IMM24C)));
+}
+
+// 1111 1110 0100 0110 Rm.. 0000 IMM32; dcpf (d32,Rm)
+8.0xfe+8.0x46+4.RN2,4.0000+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5a:::dcpf
+"dcpf"
+*am33_2
+{
+  int srcreg;
+
+  PC = cia;
+
+  srcreg = translate_rreg (SD_, RN2);
+
+  load_word (State.regs[srcreg]
+	     + FETCH32 (IMM32A, IMM32B, IMM32C, IMM32D));
+}
+
+// bit operations with imm8,(abs16) addressing mode:
+
+// 1111 1110 1000 0010 ABS16 IMM8; btst imm8,(abs16)
+8.0xfe+8.0x82+8.IMM16A+8.IMM16B+8.IMM8:D3:::btst
+"btst"
+*am33_2
+{
+  PC = cia;
+  genericBtst (IMM8, FETCH16 (IMM16A, IMM16B));
+}
+
+// 1111 1110 1000 0000 ABS16 IMM8; bset imm8,(abs16)
+8.0xfe+8.0x80+8.IMM16A+8.IMM16B+8.IMM8:D3:::bset
+"bset"
+*am33_2
+{
+  unsigned32 temp;
+  int z;
+  
+  PC = cia;
+  temp = load_byte (FETCH16 (IMM16A, IMM16B));
+  z = (temp & IMM8) == 0;
+  temp |= IMM8;
+  store_byte (FETCH16 (IMM16A, IMM16B), temp);
+  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+  PSW |= (z ? PSW_Z : 0);
+}
+
+// 1111 1110 1000 0001 ABS16 IMM8; bclr imm8,(abs16)
+8.0xfe+8.0x81+8.IMM16A+8.IMM16B+8.IMM8:D3:::bclr
+"bclr"
+*am33_2
+{
+  unsigned32 temp;
+  int z;
+  
+  PC = cia;
+  temp = load_byte (FETCH16 (IMM16A, IMM16B));
+  z = (temp & IMM8) == 0;
+  temp = temp & ~(IMM8);
+  store_byte (FETCH16 (IMM16A, IMM16B), temp);
+  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
+  PSW |= (z ? PSW_Z : 0);
+}
+
+// single precision fmov:
+
+// 1111 1001 0010 000X Rm.. Sn..; fmov (Rm),FSn
+8.0xf9+4.2,3.0,1.X+4.Rm,4.Sn:D1a:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      XS2FS (X,Sn) = load_word (State.regs[reg]);
+    }
+}
+
+// 1111 1001 0010 001X Rm.. Sn..; fmov (Rm+),FSn
+8.0xf9+4.2,3.1,1.X+4.Rm,4.Sn:D1b:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      XS2FS (X,Sn) = load_word (State.regs[reg]);
+      State.regs[reg] += 4;
+    }
+}
+
+// 1111 1001 0010 010X ---- Sn..; fmov (SP),FSn
+8.0xf9+4.2,3.2,1.X+4.0,4.Sn:D1c:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      XS2FS (X,Sn) = load_word (State.regs[reg]);
+    }
+}
+
+// 1111 1001 0010 011X Rm.. Sn..; fmov Rm,FSn
+8.0xf9+4.2,3.3,1.X+4.Rm,4.Sn:D1d:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      XS2FS (X,Sn) = State.regs[reg];
+    }
+}
+
+// 1111 1001 0011 00Y0 Sm.. Rn..; fmov FSm,(Rn)
+8.0xf9+4.3,2.0,1.Y,1.0+4.Sm,4.Rn:D1e:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_word (State.regs[reg], XS2FS (Y,Sm));
+    }
+}
+
+// 1111 1001 0011 00Y1 Sm.. Rn..; fmov FSm,(Rn+)
+8.0xf9+4.3,2.0,1.Y,1.1+4.Sm,4.Rn:D1f:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_word (State.regs[reg], XS2FS (Y,Sm));
+      State.regs[reg] += 4;
+    }
+}
+
+// 1111 1001 0011 01Y0 Sm.. ----; fmov FSm,(SP)
+8.0xf9+4.3,2.1,1.Y,1.0+4.Sm,4.0:D1g:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      store_word (State.regs[reg], XS2FS (Y,Sm));
+    }
+}
+
+// 1111 1001 0011 01Y1 Sm.. Rn..; fmov FSm,Rn
+8.0xf9+4.3,2.1,1.Y,1.1+4.Sm,4.Rn:D1h:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      State.regs[reg] = XS2FS (Y,Sm);
+    }
+}
+
+// 1111 1001 0100 00YX Sm.. Sn..; fmov FSm,FSn
+8.0xf9+4.4,2.0,1.Y,1.X+4.Sm,4.Sn:D1i:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    XS2FS (X,Sn) = XS2FS (Y,Sm);
+}
+
+// 1111 1011 0010 000X Rm.. Sn.. d8; fmov (d8,Rm),FSn
+8.0xfb+4.2,3.0,1.X+4.Rm,4.Sn+8.IMM8:D2a:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      XS2FS (X, Sn) = load_word (State.regs[reg] + EXTEND8 (IMM8));
+    }
+}
+
+// 1111 1011 0010 001X Rm.. Sn.. d8; fmov (Rm+,imm8),FSn
+8.0xfb+4.2,3.1,1.X+4.Rm,4.Sn+8.IMM8:D2b:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      XS2FS (X, Sn) = load_word (State.regs[reg] + EXTEND8 (IMM8));
+      State.regs[reg] += 4;
+    }
+}
+
+// 1111 1011 0010 010X ---- Sn.. d8; fmov (d8,SP),FSn
+8.0xfb+4.2,3.2,1.X+4.0,4.Sn+8.IMM8:D2c:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      XS2FS (X, Sn) = load_word (State.regs[reg] + IMM8);
+    }
+}
+
+// 1111 1011 0010 0111 Ri.. Rm.. Sn.. --Z-; fmov (Ri,Rm),FSn
+8.0xfb+8.0x27+4.Ri,4.Rm+4.Sn,2.0,1.Z,1.0:D2d:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int ri = translate_rreg (SD_, Ri);
+      int rm = translate_rreg (SD_, Rm);
+      XS2FS (Z, Sn) = load_word (State.regs[ri] + State.regs[rm]);
+    }
+}
+
+// 1111 1011 0011 00Y0 Sm.. Rn.. d8; fmov FSm,(d8,Rn)
+8.0xfb+4.3,2.0,1.Y,1.0+4.Sm,4.Rn+8.IMM8:D2e:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_word (State.regs[reg] + EXTEND8 (IMM8), XS2FS (Y, Sm));
+    }
+}
+
+// 1111 1011 0011 00Y1 Sm.. Rn.. d8; fmov FSm,(Rn+,d8)
+8.0xfb+4.3,2.0,1.Y,1.1+4.Sm,4.Rn+8.IMM8:D2f:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_word (State.regs[reg] + EXTEND8 (IMM8), XS2FS (Y, Sm));
+      State.regs[reg] += 4;
+    }
+}
+
+// 1111 1011 0011 01Y0 Sm.. ---- d8; fmov FSm,(d8,SP)
+8.0xfb+4.3,2.1,1.Y,1.0+4.Sm,4.0+8.IMM8:D2g:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      store_word (State.regs[reg] + IMM8, XS2FS (Y, Sm));
+    }
+}
+
+// 1111 1011 0011 0111 Ri.. Rm.. Sm.. --Z-; fmov FSm,(Ri,Rm)
+8.0xfb+8.0x37+4.Ri,4.Rm+4.Sm,2.0,1.Z,1.0:D2h:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int ri = translate_rreg (SD_, Ri);
+      int rm = translate_rreg (SD_, Rm);
+      store_word (State.regs[ri] + State.regs[rm], XS2FS (Z, Sm));
+    }
+}
+
+// 1111 1101 0010 000X Rm.. Sn.. d24; fmov (d24,Rm),FSn
+8.0xfd+4.2,3.0,1.X+4.Rm,4.Sn+8.IMM24A+8.IMM24B+8.IMM24C:D4a:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      XS2FS (X, Sn) = load_word (State.regs[reg]
+				 + EXTEND24 (FETCH24 (IMM24A,
+						      IMM24B, IMM24C)));
+    }
+}
+
+// 1111 1101 0010 001X Rm.. Sn.. d24; fmov (Rm+,imm24),FSn
+8.0xfd+4.2,3.1,1.X+4.Rm,4.Sn+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      XS2FS (X, Sn) = load_word (State.regs[reg]
+				 + EXTEND24 (FETCH24 (IMM24A,
+						      IMM24B, IMM24C)));
+      State.regs[reg] += 4;
+    }
+}
+
+// 1111 1101 0010 010X ---- Sn.. d24; fmov (d24,SP),FSn
+8.0xfd+4.2,3.2,1.X+4.0,4.Sn+8.IMM24A+8.IMM24B+8.IMM24C:D4c:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      XS2FS (X, Sn) = load_word (State.regs[reg] + FETCH24 (IMM24A,
+							    IMM24B, IMM24C));
+    }
+}
+
+// 1111 1101 0011 00Y0 Sm.. Rn.. d24; fmov FSm,(d24,Rn)
+8.0xfd+4.3,2.0,1.Y,1.0+4.Sm,4.Rn+8.IMM24A+8.IMM24B+8.IMM24C:D4e:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_word (State.regs[reg]
+		  + EXTEND24 (FETCH24 (IMM24A,
+				       IMM24B, IMM24C)), XS2FS (Y, Sm));
+    }
+}
+
+// 1111 1101 0011 00Y1 Sm.. Rn.. d24; fmov FSm,(Rn+,d24)
+8.0xfd+4.3,2.0,1.Y,1.1+4.Sm,4.Rn+8.IMM24A+8.IMM24B+8.IMM24C:D4f:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_word (State.regs[reg]
+		  + EXTEND24 (FETCH24 (IMM24A,
+				       IMM24B, IMM24C)), XS2FS (Y, Sm));
+      State.regs[reg] += 4;
+    }
+}
+
+// 1111 1101 0011 01Y0 Sm.. ---- d24; fmov FSm,(d24,SP)
+8.0xfd+4.3,2.1,1.Y,1.0+4.Sm,4.0+8.IMM24A+8.IMM24B+8.IMM24C:D4g:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      store_word (State.regs[reg]
+		  + FETCH24 (IMM24A,
+			     IMM24B, IMM24C), XS2FS (Y, Sm));
+    }
+}
+
+// 1111 1110 0010 000X Rm.. Sn.. d32; fmov (d32,Rm),FSn
+8.0xfe+4.2,3.0,1.X+4.Rm,4.Sn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5a:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      XS2FS (X, Sn) = load_word (State.regs[reg]
+				 + EXTEND32 (FETCH32 (IMM32A, IMM32B,
+						      IMM32C, IMM32D)));
+    }
+}
+
+// 1111 1110 0010 001X Rm.. Sn.. d32; fmov (Rm+,imm32),FSn
+8.0xfe+4.2,3.1,1.X+4.Rm,4.Sn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5b:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      XS2FS (X, Sn) = load_word (State.regs[reg]
+				 + EXTEND32 (FETCH32 (IMM32A, IMM32B,
+						      IMM32C, IMM32D)));
+      State.regs[reg] += 4;
+    }
+}
+
+// 1111 1110 0010 010X ---- Sn.. d32; fmov (d32,SP),FSn
+8.0xfe+4.2,3.2,1.X+4.0,4.Sn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5c:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      XS2FS (X, Sn) = load_word (State.regs[reg]
+				 + FETCH32 (IMM32A, IMM32B,
+					    IMM32C, IMM32D));
+    }
+}
+
+// 1111 1110 0010 011X ---- Sn.. d32; fmov imm32,FSn
+8.0xfe+4.2,3.3,1.X+4.0,4.Sn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5d:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    XS2FS (X, Sn) = FETCH32 (IMM32A, IMM32B, IMM32C, IMM32D);
+}
+
+// 1111 1110 0011 00Y0 Sm.. Rn.. d32; fmov FSm,(d32,Rn)
+8.0xfe+4.3,2.0,1.Y,1.0+4.Sm,4.Rn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5e:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_word (State.regs[reg]
+		  + EXTEND32 (FETCH32 (IMM32A, IMM32B,
+				       IMM32C, IMM32D)), XS2FS (Y, Sm));
+    }
+}
+
+// 1111 1110 0011 00Y1 Sm.. Rn.. d32; fmov FSm,(Rn+,d32)
+8.0xfe+4.3,2.0,1.Y,1.1+4.Sm,4.Rn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5f:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_word (State.regs[reg]
+		  + EXTEND32 (FETCH32 (IMM32A, IMM32B,
+				       IMM32C, IMM32D)), XS2FS (Y, Sm));
+      State.regs[reg] += 4;
+    }
+}
+
+// 1111 1110 0011 01Y0 Sm.. ---- d32; fmov FSm,(d32,SP)
+8.0xfe+4.3,2.1,1.Y,1.0+4.Sm,4.0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5g:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      store_word (State.regs[reg]
+		  + FETCH32 (IMM32A, IMM32B,
+			     IMM32C, IMM32D), XS2FS (Y, Sm));
+    }
+}
+
+// double precision fmov:
+
+// 1111 1001 1010 000X Rm.. fn.-; fmov (Rm),FDn
+8.0xf9+4.0xa,3.0,1.X+4.Rm,3.fn,1.0:D1j:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      Xf2FD (X,fn) = load_dword (State.regs[reg]);
+    }
+}
+
+// 1111 1001 1010 001X Rm.. fn.-; fmov (Rm+),FDn
+8.0xf9+4.0xa,3.1,1.X+4.Rm,3.fn,1.0:D1k:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      Xf2FD (X,fn) = load_dword (State.regs[reg]);
+      State.regs[reg] += 8;
+    }
+}
+
+// 1111 1001 1010 010X ---- fn.-; fmov (SP),FDn
+8.0xf9+4.0xa,3.2,1.X+4.0,3.fn,1.0:D1l:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      Xf2FD (X,fn) = load_dword (State.regs[reg]);
+    }
+}
+
+// 1111 1001 1011 00Y0 fm.- Rn..; fmov FDm,(Rn)
+8.0xf9+4.0xb,2.0,1.Y,1.0+3.fm,1.0,4.Rn:D1m:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_dword (State.regs[reg], Xf2FD (Y,fm));
+    }
+}
+
+// 1111 1001 1011 00Y1 fm.- Rn..; fmov FDm,(Rn+)
+8.0xf9+4.0xb,2.0,1.Y,1.1+3.fm,1.0,4.Rn:D1n:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_dword (State.regs[reg], Xf2FD (Y,fm));
+      State.regs[reg] += 8;
+    }
+}
+
+// 1111 1001 1011 01Y0 fm.- ----; fmov FDm,(SP)
+8.0xf9+4.0xb,2.1,1.Y,1.0+3.fm,1.0,4.0:D1o:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      store_dword (State.regs[reg], Xf2FD (Y,fm));
+    }
+}
+
+// 1111 1001 1100 00YX fm.- fn.-; fmov FDm,FDn
+8.0xf9+4.0xc,2.0,1.Y,1.X+3.fm,1.0,3.fn,1.0:D1p:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0100 0111 Ri.. Rm.. fn.- --Z-; fmov (Ri,Rm),FDn
+8.0xfb+8.0x47+4.Ri,4.Rm+3.fn,1.0,2.0,1.Z,1.0:D2i:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int ri = translate_rreg (SD_, Ri);
+      int rm = translate_rreg (SD_, Rm);
+      Xf2FD (Z,fn) = load_dword (State.regs[ri] + State.regs[rm]);
+    }
+}
+      
+// 1111 1011 0101 0111 Ri.. Rn.. fm.- --Z-; fmov FDm,(Ri,Rn)
+8.0xfb+8.0x57+4.Ri,4.Rn+3.fm,1.0,2.0,1.Z,1.0:D2j:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int ri = translate_rreg (SD_, Ri);
+      int rn = translate_rreg (SD_, Rn);
+      store_dword (State.regs[ri] + State.regs[rn], Xf2FD (Z,fm));
+    }
+}
+      
+// 1111 1011 1010 000X Rm.. fn.- d8; fmov (d8,Rm),FDn
+8.0xfb+4.0xa,3.0,1.X+4.Rm,4.fn+8.IMM8:D2k:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      Xf2FD (X, fn) = load_dword (State.regs[reg] + EXTEND8 (IMM8));
+    }
+}
+
+// 1111 1011 1010 001X Rm.. fn.- d8; fmov (Rm+,imm8),FDn
+8.0xfb+4.0xa,3.1,1.X+4.Rm,4.fn+8.IMM8:D2l:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      Xf2FD (X, fn) = load_dword (State.regs[reg] + EXTEND8 (IMM8));
+      State.regs[reg] += 8;
+    }
+}
+
+// 1111 1011 1010 010X ---- fn.- d8; fmov (d8,SP),FDn
+8.0xfb+4.0xa,3.2,1.X+4.0,4.fn+8.IMM8:D2m:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      Xf2FD (X, fn) = load_dword (State.regs[reg] + IMM8);
+    }
+}
+
+// 1111 1011 1011 00Y0 fm.- Rn.. d8; fmov FDm,(d8,Rn)
+8.0xfb+4.0xb,2.0,1.Y,1.0+4.fm,4.Rn+8.IMM8:D2n:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_dword (State.regs[reg] + EXTEND8 (IMM8), Xf2FD (Y, fm));
+    }
+}
+
+// 1111 1011 1011 00Y1 fm.- Rn.. d8; fmov FDm,(Rn+,d8)
+8.0xfb+4.0xb,2.0,1.Y,1.1+4.fm,4.Rn+8.IMM8:D2o:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_dword (State.regs[reg] + EXTEND8 (IMM8), Xf2FD (Y, fm));
+      State.regs[reg] += 8;
+    }
+}
+
+// 1111 1011 1011 01Y0 fm.- ---- d8; fmov FDm,(d8,SP)
+8.0xfb+4.0xb,2.1,1.Y,1.0+4.fm,4.0+8.IMM8:D2p:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      store_dword (State.regs[reg] + IMM8, Xf2FD (Y, fm));
+    }
+}
+
+// 1111 1101 1010 000X Rm.. fn.- d24; fmov (d24,Rm),FDn
+8.0xfd+4.0xa,3.0,1.X+4.Rm,4.fn+8.IMM24A+8.IMM24B+8.IMM24C:D4k:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      Xf2FD (X, fn) = load_dword (State.regs[reg]
+				  + EXTEND24 (FETCH24 (IMM24A,
+						       IMM24B, IMM24C)));
+    }
+}
+
+// 1111 1101 1010 001X Rm.. fn.- d24; fmov (Rm+,imm24),FDn
+8.0xfd+4.0xa,3.1,1.X+4.Rm,4.fn+8.IMM24A+8.IMM24B+8.IMM24C:D4l:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      Xf2FD (X, fn) = load_dword (State.regs[reg]
+				  + EXTEND24 (FETCH24 (IMM24A,
+						       IMM24B, IMM24C)));
+      State.regs[reg] += 8;
+    }
+}
+
+// 1111 1101 1010 010X ---- fn.- d24; fmov (d24,SP),FDn
+8.0xfd+4.0xa,3.2,1.X+4.0,4.fn+8.IMM24A+8.IMM24B+8.IMM24C:D4m:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      Xf2FD (X, fn) = load_dword (State.regs[reg]
+				  + FETCH24 (IMM24A,
+					     IMM24B, IMM24C));
+    }
+}
+
+// 1111 1101 1011 00Y0 fm.- Rn.. d24; fmov FDm,(d24,Rn)
+8.0xfd+4.0xb,2.0,1.Y,1.0+4.fm,4.Rn+8.IMM24A+8.IMM24B+8.IMM24C:D4n:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_dword (State.regs[reg]
+		   + EXTEND24 (FETCH24 (IMM24A,
+					IMM24B, IMM24C)), Xf2FD (Y, fm));
+    }
+}
+
+// 1111 1101 1011 00Y1 fm.- Rn.. d24; fmov FDm,(Rn+,d24)
+8.0xfd+4.0xb,2.0,1.Y,1.1+4.fm,4.Rn+8.IMM24A+8.IMM24B+8.IMM24C:D4o:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_dword (State.regs[reg]
+		   + EXTEND24 (FETCH24 (IMM24A,
+					IMM24B, IMM24C)), Xf2FD (Y, fm));
+      State.regs[reg] += 8;
+    }
+}
+
+// 1111 1101 1011 01Y0 fm.- ---- d24; fmov FDm,(d24,SP)
+8.0xfd+4.0xb,2.1,1.Y,1.0+4.fm,4.0+8.IMM24A+8.IMM24B+8.IMM24C:D4p:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      store_dword (State.regs[reg] + FETCH24 (IMM24A,
+					      IMM24B, IMM24C), Xf2FD (Y, fm));
+    }
+}
+
+// 1111 1110 1010 000X Rm.. fn.- d32; fmov (d32,Rm),FDn
+8.0xfe+4.0xa,3.0,1.X+4.Rm,4.fn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5k:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      Xf2FD (X, fn) = load_dword (State.regs[reg]
+				  + EXTEND32 (FETCH32 (IMM32A, IMM32B,
+						       IMM32C, IMM32D)));
+    }
+}
+
+// 1111 1110 1010 001X Rm.. fn.- d32; fmov (Rm+,imm32),FDn
+8.0xfe+4.0xa,3.1,1.X+4.Rm,4.fn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5l:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      Xf2FD (X, fn) = load_dword (State.regs[reg]
+				  + EXTEND32 (FETCH32 (IMM32A, IMM32B,
+						       IMM32C, IMM32D)));
+      State.regs[reg] += 8;
+    }
+}
+
+// 1111 1110 1010 010X ---- fn.- d32; fmov (d32,SP),FDn
+8.0xfe+4.0xa,3.2,1.X+4.0,4.fn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5m:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      Xf2FD (X, fn) = load_dword (State.regs[reg]
+				  + FETCH32 (IMM32A, IMM32B,
+					     IMM32C, IMM32D));
+    }
+}
+
+// 1111 1110 1011 00Y0 fm.- Rn.. d32; fmov FDm,(d32,Rn)
+8.0xfe+4.0xb,2.0,1.Y,1.0+4.fm,4.Rn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5n:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_dword (State.regs[reg]
+		   + EXTEND32 (FETCH32 (IMM32A, IMM32B,
+					IMM32C, IMM32D)), Xf2FD (Y, fm));
+    }
+}
+
+// 1111 1110 1011 00Y1 fm.- Rn.. d32; fmov FDm,(Rn+,d32)
+8.0xfe+4.0xb,2.0,1.Y,1.1+4.fm,4.Rn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5o:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      store_dword (State.regs[reg]
+		   + EXTEND32 (FETCH32 (IMM32A, IMM32B,
+					IMM32C, IMM32D)), Xf2FD (Y, fm));
+      State.regs[reg] += 8;
+    }
+}
+
+// 1111 1110 1011 01Y0 fm.- ---- d32; fmov FDm,(d32,SP)
+8.0xfe+4.0xb,2.1,1.Y,1.0+4.fm,4.0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5p:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = REG_SP;
+      store_dword (State.regs[reg]
+		   + FETCH32 (IMM32A, IMM32B,
+			      IMM32C, IMM32D), Xf2FD (Y, fm));
+    }
+}
+
+// FPCR fmov:
+
+// 1111 1001 1011 0101 Rm.. ----; fmov Rm,FPCR
+8.0xf9+8.0xb5+4.Rm,4.0:D1q:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rm);
+      unsigned32 val = State.regs[reg];
+      FPCR = (val & (EC_MASK | EE_MASK | FCC_MASK))
+	| ((FPCR & ~val) & EF_MASK);
+    }
+}
+
+// 1111 1001 1011 0111 ---- Rn..; fmov FPCR,Rn
+8.0xf9+8.0xb7+4.0,4.Rn:D1r:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      int reg = translate_rreg (SD_, Rn);
+      State.regs[reg] = FPCR & FPCR_MASK;
+    }
+}
+
+// 1111 1101 1011 0101 imm32; fmov imm32,FPCR
+8.0xfd+8.0xb5+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::fmov
+"fmov"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      unsigned32 val = FETCH32 (IMM32A, IMM32B, IMM32C, IMM32D);
+      FPCR = (val & (EC_MASK | EE_MASK | FCC_MASK))
+	| ((FPCR & ~val) & EF_MASK);
+    }
+}
+
+// fabs:
+
+// 1111 1001 0100 010X ---- Sn..; fabs FSn
+8.0xf9+4.4,3.2,1.X+4.0,4.Sn:D1a:::fabs
+"fabs"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      sim_fpu in, out;
+
+      FS2FPU (XS2FS (X,Sn), in);
+      sim_fpu_abs (&out, &in);
+      FPU2FS (out, XS2FS (X,Sn));
+    }
+}
+
+// 1111 1001 1100 010X ---- Sn..; fabs FDn
+8.0xf9+4.0xc,3.2,1.X+4.0,3.fn,1.0:D1b:::fabs
+"fabs"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0100 0100 Sm.. ---- Sn.. X-Z-; fabs FSm,FSn
+8.0xfb+8.0x44+4.Sm,4.0+4.Sn,1.X,1.0,1.Z,1.0:D2a:::fabs
+"fabs"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      sim_fpu in, out;
+
+      FS2FPU (XS2FS (X,Sm), in);
+      sim_fpu_abs (&out, &in);
+      FPU2FS (out, XS2FS (Z,Sn));
+    }
+}
+
+// 1111 1011 1100 0100 fm.- ---- fn.- X-Z-; fabs FDm,FDn
+8.0xfb+8.0xc4+3.fm,1.0,4.0+3.fn,1.0,1.X,1.0,1.Z,1.0:D2b:::fabs
+"fabs"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1001 0100 011X ---- Sn..; fneg FSn
+8.0xf9+4.4,3.3,1.X+4.0,4.Sn:D1a:::fneg
+"fneg"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      sim_fpu in, out;
+
+      FS2FPU (XS2FS (X,Sn), in);
+      sim_fpu_neg (&out, &in);
+      FPU2FS (out, XS2FS (X,Sn));
+    }
+}
+
+// 1111 1001 1100 011X ---- Sn..; fneg FDn
+8.0xf9+4.0xc,3.3,1.X+4.0,3.fn,1.0:D1b:::fneg
+"fneg"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0100 0110 Sm.. ---- Sn.. X-Z-; fneg FSm,FSn
+8.0xfb+8.0x46+4.Sm,4.0+4.Sn,1.X,1.0,1.Z,1.0:D2a:::fneg
+"fneg"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      sim_fpu in, out;
+
+      FS2FPU (XS2FS (X,Sm), in);
+      sim_fpu_neg (&out, &in);
+      FPU2FS (out, XS2FS (Z,Sn));
+    }
+}
+
+// 1111 1011 1100 0110 fm.- ---- fn.- X-Z-; fneg FDm,FDn
+8.0xfb+8.0xc6+3.fm,1.0,4.0+3.fn,1.0,1.X,1.0,1.Z,1.0:D2b:::fneg
+"fneg"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1001 0101 000X ---- Sn..; frsqrt FSn
+8.0xf9+4.5,3.0,1.X+4.0,4.Sn:D1a:::frsqrt
+"frsqrt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_rsqrt (SD, CPU, cia, &XS2FS (X,Sn), &XS2FS (X,Sn), FP_SINGLE);
+}
+
+// 1111 1001 1101 000X ---- fn.-; frsqrt FDn
+8.0xf9+4.0xd,3.0,1.X+4.0,3.fn,1.0:D1b:::frsqrt
+"frsqrt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0101 0000 Sm.. ---- Sn.. X-Z-; frsqrt FSm,FSn
+8.0xfb+8.0x50+4.Sm,4.0+4.Sn,1.X,1.0,1.Z,1.0:D2a:::frsqrt
+"frsqrt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_rsqrt (SD, CPU, cia, &XS2FS (X,Sm), &XS2FS (Z,Sn), FP_SINGLE);
+}
+
+// 1111 1011 1101 0000 fm.- ---- fn.- X-Z-; frsqrt FDm,FDn
+8.0xfb+8.0xd0+3.fm,1.0,4.0+3.fn,1.0,1.X,1.0,1.Z,1.0:D2b:::frsqrt
+"frsqrt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1001 0101 001X ---- Sn..; fsqrt FSn
+8.0xf9+4.5,3.1,1.X+4.0,4.Sn:D1a:::fsqrt
+"fsqrt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1001 1101 001X ---- fn.-; fsqrt FDn
+8.0xf9+4.0xd,3.1,1.X+4.0,3.fn,1.0:D1b:::fsqrt
+"fsqrt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0101 0100 Sm.. ---- Sn.. X-Z-; fsqrt FSm,FSn
+8.0xfb+8.0x54+4.Sm,4.0+4.Sn,1.X,1.0,1.Z,1.0:D2a:::fsqrt
+"fsqrt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 1101 0100 fm.- ---- fn.- X-Z-; fsqrt FDm,FDn
+8.0xfb+8.0xd4+3.fm,1.0,4.0+3.fn,1.0,1.X,1.0,1.Z,1.0:D2b:::fsqrt
+"fsqrt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1001 0101 01YX Sm.. Sn..; fcmp FSm, FSn
+8.0xf9+4.5,2.1,1.Y,1.X+4.Sm,4.Sn:D1a:::fcmp
+"fcmp"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_cmp (SD, CPU, cia, &XS2FS (X,Sn), &XS2FS (Y,Sm), FP_SINGLE);
+}
+
+// 1111 1001 1101 01YX fm.- fn.-; fcmp FDm, FDn
+8.0xf9+4.0xd,2.1,1.Y,1.X+3.fm,1.0,3.fn,1.0:D1b:::fcmp
+"fcmp"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1110 0011 01Y1 Sm.. ---- IMM32; fcmp imm32, FSm
+8.0xfe+4.3,2.1,1.Y,1.1+4.Sm,4.0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::fcmp
+"fcmp"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      uint32 imm = FETCH32 (IMM32A, IMM32B, IMM32C, IMM32D);
+
+      fpu_cmp (SD, CPU, cia, &XS2FS (Y,Sm), &imm, FP_SINGLE);
+    }
+}
+
+// 1111 1001 0110 00YX Sm.. Sn..; fadd FSm, FSn
+8.0xf9+4.6,2.0,1.Y,1.X+4.Sm,4.Sn:D1a:::fadd
+"fadd"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_add (SD, CPU, cia,
+	     &XS2FS (Y,Sm), &XS2FS (X,Sn), &XS2FS (X,Sn), FP_SINGLE);
+}
+
+// 1111 1001 1110 00YX fm.- fn.-; fadd FDm, FDn
+8.0xf9+4.0xe,2.0,1.Y,1.X+3.fm,1.0,3.fn,1.0:D1b:::fadd
+"fadd"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0110 0000 Sm1. Sm2. Sn.. XYZ-; fadd FSm1, FSm2, FSn
+8.0xfb+8.0x60+4.Sm1,4.Sm2+4.Sn,1.X,1.Y,1.Z,1.0:D2a:::fadd
+"fadd"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_add (SD, CPU, cia,
+	     &XS2FS (X,Sm1), &XS2FS (Y,Sm2), &XS2FS (Z,Sn), FP_SINGLE);
+}
+
+// 1111 1011 1110 0000 fm1- fm2- fn.- XYZ-; fadd FDm1, FDm2, FDn
+8.0xfb+8.0xe0+3.fm1,1.0,3.fm2,1.0+3.fn,1.0,1.X,1.Y,1.Z,1.0:D2b:::fadd
+"fadd"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+
+// 1111 1110 0110 00YX Sm.. Sn.. IMM32; fadd imm32, FSm, FSn
+8.0xfe+4.6,2.0,1.Y,1.X+4.Sm,4.Sn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::fadd
+"fadd"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      uint32 imm = FETCH32 (IMM32A, IMM32B, IMM32C, IMM32D);
+
+      fpu_add (SD, CPU, cia,
+	       &XS2FS (Y,Sm), &imm, &XS2FS (X,Sn), FP_SINGLE);
+    }
+}
+
+// 1111 1001 0110 01YX Sm.. Sn..; fsub FSm, FSn
+8.0xf9+4.6,2.1,1.Y,1.X+4.Sm,4.Sn:D1a:::fsub
+"fsub"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_sub (SD, CPU, cia,
+	     &XS2FS (X,Sn), &XS2FS (Y,Sm), &XS2FS (X,Sn), FP_SINGLE);
+}
+
+// 1111 1001 1110 01YX fm.- fn.-; fsub FDm, FDn
+8.0xf9+4.0xe,2.1,1.Y,1.X+3.fm,1.0,3.fn,1.0:D1b:::fsub
+"fsub"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0110 0100 Sm1. Sm2. Sn.. XYZ-; fsub FSm1, FSm2, FSn
+8.0xfb+8.0x64+4.Sm1,4.Sm2+4.Sn,1.X,1.Y,1.Z,1.0:D2a:::fsub
+"fsub"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_sub (SD, CPU, cia,
+	     &XS2FS (Y,Sm2), &XS2FS (X,Sm1), &XS2FS (Z,Sn), FP_SINGLE);
+}
+
+// 1111 1011 1110 0100 fm1- fm2- fn.- XYZ-; fsub FDm1, FDm2, FDn
+8.0xfb+8.0xe4+3.fm1,1.0,3.fm2,1.0+3.fn,1.0,1.X,1.Y,1.Z,1.0:D2b:::fsub
+"fsub"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+
+// 1111 1110 0110 01YX Sm.. Sn.. IMM32; fsub imm32, FSm, FSn
+8.0xfe+4.6,2.1,1.Y,1.X+4.Sm,4.Sn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::fsub
+"fsub"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      uint32 imm = FETCH32 (IMM32A, IMM32B, IMM32C, IMM32D);
+
+      fpu_sub (SD, CPU, cia,
+	       &XS2FS (Y,Sm), &imm, &XS2FS (X,Sn), FP_SINGLE);
+    }
+}
+
+// 1111 1001 0111 00YX Sm.. Sn..; fmul FSm, FSn
+8.0xf9+4.7,2.0,1.Y,1.X+4.Sm,4.Sn:D1a:::fmul
+"fmul"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_mul (SD, CPU, cia,
+	     &XS2FS (Y,Sm), &XS2FS (X,Sn), &XS2FS (X,Sn), FP_SINGLE);
+}
+
+// 1111 1001 1111 00YX fm.- fn.-; fmul FDm, FDn
+8.0xf9+4.0xf,2.0,1.Y,1.X+3.fm,1.0,3.fn,1.0:D1b:::fmul
+"fmul"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0111 0000 Sm1. Sm2. Sn.. XYZ-; fmul FSm1, FSm2, FSn
+8.0xfb+8.0x70+4.Sm1,4.Sm2+4.Sn,1.X,1.Y,1.Z,1.0:D2a:::fmul
+"fmul"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_mul (SD, CPU, cia,
+	     &XS2FS (X,Sm1), &XS2FS (Y,Sm2), &XS2FS (Z,Sn), FP_SINGLE);
+}
+
+// 1111 1011 1111 0000 fm1- fm2- fn.- XYZ-; fmul FDm1, FDm2, FDn
+8.0xfb+8.0xf0+3.fm1,1.0,3.fm2,1.0+3.fn,1.0,1.X,1.Y,1.Z,1.0:D2b:::fmul
+"fmul"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+
+// 1111 1110 0111 00YX Sm.. Sn.. IMM32; fmul imm32, FSm, FSn
+8.0xfe+4.7,2.0,1.Y,1.X+4.Sm,4.Sn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::fmul
+"fmul"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      uint32 imm = FETCH32 (IMM32A, IMM32B, IMM32C, IMM32D);
+
+      fpu_mul (SD, CPU, cia,
+	       &imm, &XS2FS (Y,Sm), &XS2FS (X,Sn), FP_SINGLE);
+    }
+}
+
+// 1111 1001 0111 01YX Sm.. Sn..; fdiv FSm, FSn
+8.0xf9+4.7,2.1,1.Y,1.X+4.Sm,4.Sn:D1a:::fdiv
+"fdiv"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_div (SD, CPU, cia,
+	     &XS2FS (X,Sn), &XS2FS (Y,Sm), &XS2FS (X,Sn), FP_SINGLE);
+}
+
+// 1111 1001 1111 01YX fm.- fn.-; fdiv FDm, FDn
+8.0xf9+4.0xf,2.1,1.Y,1.X+3.fm,1.0,3.fn,1.0:D1b:::fdiv
+"fdiv"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0111 0100 Sm1. Sm2. Sn.. XYZ-; fdiv FSm1, FSm2, FSn
+8.0xfb+8.0x74+4.Sm1,4.Sm2+4.Sn,1.X,1.Y,1.Z,1.0:D2a:::fdiv
+"fdiv"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_div (SD, CPU, cia,
+	     &XS2FS (Y,Sm2), &XS2FS (X,Sm1), &XS2FS (Z,Sn), FP_SINGLE);
+}
+
+// 1111 1011 1111 0100 fm1- fm2- fn.- XYZ-; fdiv FDm1, FDm2, FDn
+8.0xfb+8.0xf4+3.fm1,1.0,3.fm2,1.0+3.fn,1.0,1.X,1.Y,1.Z,1.0:D2b:::fdiv
+"fdiv"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+
+// 1111 1110 0111 01YX Sm.. Sn.. IMM32; fdiv imm32, FSm, FSn
+8.0xfe+4.7,2.1,1.Y,1.X+4.Sm,4.Sn+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::fdiv
+"fdiv"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    {
+      uint32 imm = FETCH32 (IMM32A, IMM32B, IMM32C, IMM32D);
+
+      fpu_div (SD, CPU, cia,
+	       &XS2FS (Y,Sm), &imm, &XS2FS (X,Sn), FP_SINGLE);
+    }
+}
+
+// 1111 1011 1000 00Sn Sm1. Sm2. Sm3. XYZA; fmadd FSm1, FSm2, FSm3, FSn
+8.0xfb+4.8,2.0,2.Sn+4.Sm1,4.Sm2+4.Sm3,1.X,1.Y,1.Z,1.A:D2:::fmadd
+"fmadd"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_fmadd (SD, CPU, cia,
+	       &XS2FS (X,Sm1), &XS2FS (Y,Sm2), &XS2FS (Z,Sm3),
+	       &AS2FS (A,Sn), FP_SINGLE);
+}
+    
+// 1111 1011 1000 01Sn Sm1. Sm2. Sm3. XYZA; fmsub FSm1, FSm2, FSm3, FSn
+8.0xfb+4.8,2.1,2.Sn+4.Sm1,4.Sm2+4.Sm3,1.X,1.Y,1.Z,1.A:D2:::fmsub
+"fmsub"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_fmsub (SD, CPU, cia,
+	       &XS2FS (X,Sm1), &XS2FS (Y,Sm2), &XS2FS (Z,Sm3),
+	       &AS2FS (A,Sn), FP_SINGLE);
+}
+
+// 1111 1011 1001 00Sn Sm1. Sm2. Sm3. XYZA; fnmadd FSm1, FSm2, FSm3, FSn
+8.0xfb+4.9,2.0,2.Sn+4.Sm1,4.Sm2+4.Sm3,1.X,1.Y,1.Z,1.A:D2:::fnmadd
+"fnmadd"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_fnmadd (SD, CPU, cia,
+		&XS2FS (X,Sm1), &XS2FS (Y,Sm2), &XS2FS (Z,Sm3),
+		&AS2FS (A,Sn), FP_SINGLE);
+}
+    
+// 1111 1011 1001 01Sn Sm1. Sm2. Sm3. XYZA; fnmsub FSm1, FSm2, FSm3, FSn
+8.0xfb+4.9,2.1,2.Sn+4.Sm1,4.Sm2+4.Sm3,1.X,1.Y,1.Z,1.A:D2:::fnmsub
+"fnmsub"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_fnmsub (SD, CPU, cia,
+		&XS2FS (X,Sm1), &XS2FS (Y,Sm2), &XS2FS (Z,Sm3),
+		&AS2FS (A,Sn), FP_SINGLE);
+}
+
+// conversion:
+
+// 1111 1011 0100 0000 Sm.. ---- Sn.. X-Z-; ftoi FSm,FSn
+8.0xfb+8.0x40+4.Sm,4.0+4.Sn,1.X,1.0,1.Z,1.0:D2:::ftoi
+"ftoi"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0100 0010 Sm.. ---- Sn.. X-Z-; itof FSm,FSn
+8.0xfb+8.0x42+4.Sm,4.0+4.Sn,1.X,1.0,1.Z,1.0:D2:::itof
+"itof"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0101 0010 Sm.. ---- fn.- X-Z-; ftod FSm,FDn
+8.0xfb+8.0x52+4.Sm,4.0+3.fn,1.0,1.X,1.0,1.Z,1.0:D2:::ftod
+"ftod"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// 1111 1011 0101 0110 fm.- ---- Sn.. X-Z-; dtof FDm,FSn
+8.0xfb+8.0x56+3.fm,1.0,4.0+4.Sn,1.X,1.0,1.Z,1.0:D2:::dtof
+"dtof"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else
+    fpu_unimp_exception (SD, CPU, cia);
+}
+
+// branching:
+
+// 1111 1000 1101 0000 d8; fbeq (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xd0+8.D8:D1:::fbeq
+"fbeq"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & FCC_E))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 0001 d8; fbne (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xd1+8.D8:D1:::fbne
+"fbne"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_L | FCC_G)))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 0010 d8; fbgt (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xd2+8.D8:D1:::fbgt
+"fbgt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & FCC_G))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 0011 d8; fbge (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xd3+8.D8:D1:::fbge
+"fbge"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_G | FCC_E)))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 0100 d8; fblt (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xd4+8.D8:D1:::fblt
+"fblt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & FCC_L))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 0101 d8; fble (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xd5+8.D8:D1:::fble
+"fble"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_L | FCC_E)))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 0110 d8; fbuo (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xd6+8.D8:D1:::fbuo
+"fbuo"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & FCC_U))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 0111 d8; fblg (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xd7+8.D8:D1:::fblg
+"fblg"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_L | FCC_G)))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+// 1111 1000 1101 1000 d8; fbleg (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xd8+8.D8:D1:::fbleg
+"fbleg"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_L | FCC_E | FCC_G)))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 1001 d8; fbug (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xd9+8.D8:D1:::fbug
+"fbug"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_G)))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 1010 d8; fbuge (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xda+8.D8:D1:::fbuge
+"fbuge"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_G | FCC_E)))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 1011 d8; fbul (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xdb+8.D8:D1:::fbul
+"fbul"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_L)))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 1100 d8; fbule (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xdc+8.D8:D1:::fbule
+"fbule"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_L | FCC_E)))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 1000 1101 1101 d8; fbue (d8,PC) (d8 is sign-extended)
+8.0xf8+8.0xdd+8.D8:D1:::fbue
+"fbue"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_E)))
+    {
+      State.regs[REG_PC] += EXTEND8 (D8);
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 0000; fleq
+8.0xf0+8.0xd0:D0:::fleq
+"fleq"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & FCC_E))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 0001; flne
+8.0xf0+8.0xd1:D0:::flne
+"flne"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_L | FCC_G)))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 0010; flgt
+8.0xf0+8.0xd2:D0:::flgt
+"flgt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & FCC_G))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 0011; flge
+8.0xf0+8.0xd3:D0:::flge
+"flge"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_G | FCC_E)))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 0100; fllt
+8.0xf0+8.0xd4:D0:::fllt
+"fllt"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & FCC_L))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 0101; flle
+8.0xf0+8.0xd5:D0:::flle
+"flle"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_L | FCC_E)))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 0110; fluo
+8.0xf0+8.0xd6:D0:::fluo
+"fluo"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & FCC_U))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 0111; fllg
+8.0xf0+8.0xd7:D0:::fllg
+"fllg"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_L | FCC_G)))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+// 1111 0000 1101 1000; flleg
+8.0xf0+8.0xd8:D0:::flleg
+"flleg"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_L | FCC_E | FCC_G)))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 1001; flug
+8.0xf0+8.0xd9:D0:::flug
+"flug"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_G)))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 1010; fluge
+8.0xf0+8.0xda:D0:::fluge
+"fluge"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_G | FCC_E)))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 1011; flul
+8.0xf0+8.0xdb:D0:::flul
+"flul"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_L)))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 1100; flule
+8.0xf0+8.0xdc:D0:::flule
+"flule"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_L | FCC_E)))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
+
+// 1111 0000 1101 1101; flue
+8.0xf0+8.0xdd:D0:::flue
+"flue"
+*am33_2
+{
+  PC = cia;
+
+  if (FPU_DISABLED)
+    fpu_disabled_exception (SD, CPU, cia);
+  else if ((FPCR & (FCC_U | FCC_E)))
+    {
+      State.regs[REG_PC] = State.regs[REG_LAR] - 4;
+      nia = PC;
+    }
+}
diff --git a/sim/mn10300/am33.igen b/sim/mn10300/am33.igen
index db41889..f17283c 100644
--- a/sim/mn10300/am33.igen
+++ b/sim/mn10300/am33.igen
@@ -42,6 +42,7 @@
 8.0xf0+4.0x2,00,2.AN0:D0m:::mov
 "mov"
 *am33
+*am33_2
 {
   PC = cia;
   State.regs[REG_A0 + AN0] = State.regs[REG_USP];
@@ -52,6 +53,7 @@
 8.0xf0+4.0x2,01,2.AN0:D0n:::mov
 "mov"
 *am33
+*am33_2
 {
   PC = cia;
   State.regs[REG_A0 + AN0] = State.regs[REG_SSP];
@@ -62,6 +64,7 @@
 8.0xf0+4.0x2,10,2.AN0:D0o:::mov
 "mov"
 *am33
+*am33_2
 {
   PC = cia;
   State.regs[REG_A0 + AN0] = State.regs[REG_MSP];
@@ -72,6 +75,7 @@
 8.0xf0+4.0x2,11,2.AN0:D0p:::mov
 "mov"
 *am33
+*am33_2
 {
   PC = cia;
   State.regs[REG_A0 + AN0] = PC;
@@ -82,6 +86,7 @@
 8.0xf0+4.0x3,2.AM1,00:D0q:::mov
 "mov"
 *am33
+*am33_2
 {
   PC = cia;
   State.regs[REG_USP] = State.regs[REG_A0 + AM1];
@@ -91,6 +96,7 @@
 8.0xf0+4.0x3,2.AM1,01:D0r:::mov
 "mov"
 *am33
+*am33_2
 {
   PC = cia;
   State.regs[REG_SSP] = State.regs[REG_A0 + AM1];
@@ -100,6 +106,7 @@
 8.0xf0+4.0x3,2.AM1,10:D0s:::mov
 "mov"
 *am33
+*am33_2
 {
   PC = cia;
   State.regs[REG_MSP] = State.regs[REG_A0 + AM1];
@@ -110,6 +117,7 @@
 8.0xf0+4.0xe,IMM4:D0t:::syscall
 "syscall"
 *am33
+*am33_2
 {
   unsigned32 sp, next_pc;
 
@@ -127,6 +135,7 @@
 8.0xf2+4.0xe,11,2.DN0:D0u:::mov
 "mov"
 *am33
+*am33_2
 {
   PC = cia;
   State.regs[REG_D0 + DN0] = PSW;
@@ -137,6 +146,7 @@
 8.0xf2+4.0xf,2.DM1,01:D0v:::mov
 "mov"
 *am33
+*am33_2
 {
   PC = cia;
   PSW = State.regs[REG_D0 + DM1];
@@ -146,6 +156,7 @@
 8.0xf5+00,2.AM1,4.RN0:D0w:::mov
 "mov"
 *am33
+*am33_2
 {
   int destreg = translate_rreg (SD_, RN0);
 
@@ -157,6 +168,7 @@
 8.0xf5+01,2.DM1,4.RN0:D0x:::mov
 "mov"
 *am33
+*am33_2
 {
   int destreg = translate_rreg (SD_, RN0);
 
@@ -168,6 +180,7 @@
 8.0xf5+10,4.RM1,2.AN0:D0y:::mov
 "mov"
 *am33
+*am33_2
 {
   int destreg = translate_rreg (SD_, RM1);
 
@@ -179,6 +192,7 @@
 8.0xf5+11,4.RM1,2.DN0:D0z:::mov
 "mov"
 *am33
+*am33_2
 {
   int destreg = translate_rreg (SD_, RM1);
 
@@ -191,6 +205,7 @@
 8.0xf8+8.0xce+8.REGS:D1a:::movm
 "movm"
 *am33
+*am33_2
 {
   unsigned32 usp = State.regs[REG_USP];
   unsigned32 mask;
@@ -242,6 +257,7 @@
     }
 
   if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33
+      || STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2
       )
     {
       if (mask & 0x1)
@@ -283,6 +299,7 @@
 8.0xf8+8.0xcf+8.REGS:D1b:::movm
 "movm"
 *am33
+*am33_2
 {
   unsigned32 usp = State.regs[REG_USP];
   unsigned32 mask;
@@ -291,6 +308,7 @@
   mask = REGS;
 
   if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33
+      || STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2
       )
     {
       if (mask & 0x4)
@@ -375,6 +393,7 @@
 8.0xfc+8.0xfc+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:4a:::and
 "and"
 *am33
+*am33_2
 {
   PC = cia;
   PSW &= FETCH32(IMM32A, IMM32B, IMM32C, IMM32D);
@@ -384,6 +403,7 @@
 8.0xfc+8.0xfd+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D4a:::or
 "or"
 *am33
+*am33_2
 {
   PC = cia;
   PSW |= FETCH32(IMM32A, IMM32B, IMM32C, IMM32D);
@@ -393,6 +413,7 @@
 8.0xf9+8.0x08+4.RM2,4.RN0!RM2:D1g:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -407,6 +428,7 @@
 8.0xf9+8.0x18+4.RN0,4.RN2=RN0:D1:::ext
 "mov"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -422,6 +444,7 @@
 8.0xf9+8.0x28+4.RM2,4.RN0!RM2:D1:::extb
 "extb"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -435,6 +458,7 @@
 8.0xf9+8.0x38+4.RM2,4.RN0!RM2:D1:::extbu
 "extbu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -448,6 +472,7 @@
 8.0xf9+8.0x48+4.RM2,4.RN0!RM2:D1:::exth
 "exth"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -461,6 +486,7 @@
 8.0xf9+8.0x58+4.RM2,4.RN0!RM2:D1:::exthu
 "exthu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -474,6 +500,7 @@
 8.0xf9+8.0x68+4.RM2,4.RN0=RM2:D1:::clr
 "clr"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -488,6 +515,7 @@
 8.0xf9+8.0x78+4.RM2,4.RN0:D1b:::add
 "add"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -501,6 +529,7 @@
 8.0xf9+8.0x88+4.RM2,4.RN0:D1b:::addc
 "addc"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   int z, c, n, v;
@@ -530,6 +559,7 @@
 8.0xf9+8.0x98+4.RM2,4.RN0:D1b:::sub
 "sub"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -543,6 +573,7 @@
 8.0xf9+8.0xa8+4.RM2,4.RN0:D1b:::subc
 "subc"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   int z, c, n, v;
@@ -572,6 +603,7 @@
 8.0xf9+8.0xb8+4.RN0,4.RN2=RN0:D1:::inc
 "inc"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -584,6 +616,7 @@
 8.0xf9+8.0xc8+4.RN0,4.RN2=RN0:D1:::inc4
 "inc4"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -596,6 +629,7 @@
 8.0xf9+8.0xd8+4.RM2,4.RN0:D1:::cmp
 "cmp"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2;
 
@@ -609,6 +643,7 @@
 8.0xf9+8.0xe8+4.XRM2,4.RN0:D1l:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg, srcreg;
 
@@ -623,6 +658,7 @@
 8.0xf9+8.0xf8+4.RM2,4.XRN0:D1m:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -637,6 +673,7 @@
 8.0xf9+8.0x09+4.RM2,4.RN0:D1a:::and
 "and"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   int z, n;
@@ -657,6 +694,7 @@
 8.0xf9+8.0x19+4.RM2,4.RN0:D1a:::or
 "or"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   int z, n;
@@ -676,6 +714,7 @@
 8.0xf9+8.0x29+4.RM2,4.RN0:D1a:::xor
 "xor"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   int z, n;
@@ -695,6 +734,7 @@
 8.0xf9+8.0x39+4.RM2,4.RN0=RM2:D1:::not
 "not"
 *am33
+*am33_2
 {
   int dstreg;
   int z, n;
@@ -713,6 +753,7 @@
 8.0xf9+8.0x49+4.RM2,4.RN0:D1a:::asr
 "asr"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   signed32 temp;
@@ -736,6 +777,7 @@
 8.0xf9+8.0x59+4.RM2,4.RN0:D1a:::lsr
 "lsr"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   int z, n, c;
@@ -757,6 +799,7 @@
 8.0xf9+8.0x69+4.RM2,4.RN0:D1a:::asl
 "asl"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   int z, n;
@@ -776,6 +819,7 @@
 8.0xf9+8.0x79+4.RM2,4.RN0=RM2:D1:::asl2
 "asl2"
 *am33
+*am33_2
 {
   int dstreg;
   int n, z;
@@ -794,6 +838,7 @@
 8.0xf9+8.0x89+4.RM2,4.RN0=RM2:D1:::ror
 "ror"
 *am33
+*am33_2
 {
   int dstreg;
   int c, n, z;
@@ -818,6 +863,7 @@
 8.0xf9+8.0x99+4.RM2,4.RN0=RM2:D1:::rol
 "rol"
 *am33
+*am33_2
 {
   int dstreg;
   int c, n, z;
@@ -842,6 +888,7 @@
 8.0xf9+8.0xa9+4.RM2,4.RN0:D1b:::mul
 "mul"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   unsigned64 temp;
@@ -865,6 +912,7 @@
 8.0xf9+8.0xb9+4.RM2,4.RN0:D1b:::mulu
 "mulu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   unsigned64 temp;
@@ -888,6 +936,7 @@
 8.0xf9+8.0xc9+4.RM2,4.RN0:D1b:::div
 "div"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   signed64 temp;
@@ -913,6 +962,7 @@
 8.0xf9+8.0xd9+4.RM2,4.RN0:D1b:::divu
 "divu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   unsigned64 temp;
@@ -939,6 +989,7 @@
 8.0xf9+8.0x0a+4.RN2,4.RM0:D1h:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -952,6 +1003,7 @@
 8.0xf9+8.0x1a+4.RM2,4.RN0:D1i:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -965,6 +1017,7 @@
 8.0xf9+8.0x2a+4.RN2,4.RM0:D1g:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -978,6 +1031,7 @@
 8.0xf9+8.0x3a+4.RM2,4.RN0:D1i:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -991,6 +1045,7 @@
 8.0xf9+8.0x4a+4.RN2,4.RM0:D1g:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1004,6 +1059,7 @@
 8.0xf9+8.0x5a+4.RM2,4.RN0:D1i:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1017,6 +1073,7 @@
 8.0xf9+8.0x6a+4.RN2,4.RM0!RN2:D1y:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1031,6 +1088,7 @@
 8.0xf9+8.0x7a+4.RM2,4.RN0:D1z:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1045,6 +1103,7 @@
 8.0xf9+8.0x8a+4.RN2,4.0000:D1j:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -1057,6 +1116,7 @@
 8.0xf9+8.0x9a+4.RM2,4.0000:D1k:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -1069,6 +1129,7 @@
 8.0xf9+8.0xaa+4.RN2,4.0000:D1j:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -1081,6 +1142,7 @@
 8.0xf9+8.0xba+4.RM2,4.0000:D1k:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -1093,6 +1155,7 @@
 8.0xf9+8.0xca+4.RN2,4.0000:D1j:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -1105,6 +1168,7 @@
 8.0xf9+8.0xda+4.RM2,4.0000:D1k:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -1117,6 +1181,7 @@
 8.0xf9+8.0xea+4.RN2,4.RM0!RN2:D1y:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1131,6 +1196,7 @@
 8.0xf9+8.0xfa+4.RM2,4.RN0:D1z:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1146,6 +1212,7 @@
 8.0xf9+8.0x0b+4.RM2,4.RN0:D1:::mac
 "mac"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2;
   signed64 temp, sum;
@@ -1174,6 +1241,7 @@
 8.0xf9+8.0x1b+4.RM2,4.RN0:D1:::macu
 "macu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2;
   unsigned64 temp, sum;
@@ -1202,6 +1270,7 @@
 8.0xf9+8.0x2b+4.RM2,4.RN0:D1:::macb
 "macb"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2;
   signed32 temp, sum;
@@ -1225,6 +1294,7 @@
 8.0xf9+8.0x3b+4.RM2,4.RN0:D1:::macbu
 "macbu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2;
   signed64 temp, sum;
@@ -1248,6 +1318,7 @@
 8.0xf9+8.0x4b+4.RM2,4.RN0:D1:::mach
 "mach"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2;
   signed64 temp, sum;
@@ -1276,6 +1347,7 @@
 8.0xf9+8.0x5b+4.RM2,4.RN0:D1:::machu
 "machu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2;
   signed64 temp, sum;
@@ -1304,6 +1376,7 @@
 8.0xf9+8.0x6b+4.RM2,4.RN0:D1:::dmach
 "dmach"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2;
   signed32 temp, temp2, sum;
@@ -1329,6 +1402,7 @@
 8.0xf9+8.0x7b+4.RM2,4.RN0:D1:::dmachu
 "dmachu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2;
   unsigned32 temp, temp2, sum;
@@ -1354,6 +1428,7 @@
 8.0xf9+8.0x8b+4.RM2,4.RN0:D1:::dmulh
 "dmulh"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   signed32 temp;
@@ -1374,6 +1449,7 @@
 8.0xf9+8.0x9b+4.RM2,4.RN0:D1:::dumachu
 "dmachu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   unsigned32 temp;
@@ -1394,6 +1470,7 @@
 8.0xf9+8.0xab+4.RM2,4.RN0:D1:::sat16
 "sat16"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   int value, z, n;
@@ -1421,6 +1498,7 @@
 8.0xf9+8.0xbb+4.RM2,4.RN0:D1:::mcste
 "mcste"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1518,6 +1596,7 @@
 8.0xf9+8.0xcb+4.RM2,4.RN0:D1:::swap
 "swap"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1535,6 +1614,7 @@
 8.0xf9+8.0xdb+4.RM2,4.RN0:D1:::swaph
 "swaph"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1552,6 +1632,7 @@
 8.0xf9+8.0xeb+4.RM2,4.RN0:D1:::swhw
 "swhw"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1567,6 +1648,7 @@
 8.0xf9+8.0xfb+4.RM2,4.RN0:D1:::bsch
 "bsch"
 *am33
+*am33_2
 {
   int temp, c, i;
   int srcreg, dstreg;
@@ -1606,6 +1688,7 @@
 8.0xfb+8.0x08+4.RM2,4.RN0=RM2+8.IMM8:D2j:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -1618,6 +1701,7 @@
 8.0xfb+8.0x18+4.RM2,4.RN0=RM2+8.IMM8:D2:::movu
 "movu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -1630,6 +1714,7 @@
 8.0xfb+8.0x78+4.RM2,4.RN0=RM2+8.IMM8:D2d:::add
 "add"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -1642,6 +1727,7 @@
 8.0xfb+8.0x88+4.RM2,4.RN0=RM2+8.IMM8:D2d:::addc
 "addc"
 *am33
+*am33_2
 {
   int dstreg, imm;
   int z, c, n, v;
@@ -1670,6 +1756,7 @@
 8.0xfb+8.0x98+4.RM2,4.RN0=RM2+8.IMM8:D2d:::sub
 "sub"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -1683,6 +1770,7 @@
 8.0xfb+8.0xa8+4.RM2,4.RN0=RM2+8.IMM8:D2d:::subc
 "subc"
 *am33
+*am33_2
 {
   int imm, dstreg;
   int z, c, n, v;
@@ -1711,6 +1799,7 @@
 8.0xfb+8.0xd8+4.RM2,4.RN0=RM2+8.IMM8:D2b:::cmp
 "cmp"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -1723,6 +1812,7 @@
 8.0xfb+8.0xf8+4.XRM2,4.XRN0=XRM2+8.IMM8:D2k:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -1736,6 +1826,7 @@
 8.0xfb+8.0x09+4.RM2,4.RN0=RM2+8.IMM8:D2d:::and
 "and"
 *am33
+*am33_2
 {
   int dstreg;
   int z, n;
@@ -1754,6 +1845,7 @@
 8.0xfb+8.0x19+4.RM2,4.RN0=RM2+8.IMM8:D2d:::or
 "or"
 *am33
+*am33_2
 {
   int dstreg;
   int z, n;
@@ -1772,6 +1864,7 @@
 8.0xfb+8.0x29+4.RM2,4.RN0=RM2+8.IMM8:D2d:::xor
 "xor"
 *am33
+*am33_2
 {
   int dstreg;
   int z, n;
@@ -1790,6 +1883,7 @@
 8.0xfb+8.0x49+4.RM2,4.RN0=RM2+8.IMM8:D2a:::asr
 "asr"
 *am33
+*am33_2
 {
   int dstreg;
   signed32 temp;
@@ -1812,6 +1906,7 @@
 8.0xfb+8.0x59+4.RM2,4.RN0=RM2+8.IMM8:D2a:::lsr
 "lsr"
 *am33
+*am33_2
 {
   int dstreg;
   int z, n, c;
@@ -1831,6 +1926,7 @@
 8.0xfb+8.0x69+4.RM2,4.RN0=RM2+8.IMM8:D2a:::asl
 "asl"
 *am33
+*am33_2
 {
   int dstreg;
   int z, n;
@@ -1849,6 +1945,7 @@
 8.0xfb+8.0xa9+4.RM2,4.RN0=RM2+8.IMM8:D2a:::mul
 "mul"
 *am33
+*am33_2
 {
   int dstreg;
   unsigned64 temp;
@@ -1871,6 +1968,7 @@
 8.0xfb+8.0xb9+4.RM2,4.RN0=RM2+8.IMM8:D2a:::mulu
 "mulu"
 *am33
+*am33_2
 {
   int dstreg;
   unsigned64 temp;
@@ -1893,6 +1991,7 @@
 8.0xfb+8.0xe9+4.RN2,4.RM0=RN2+8.IMM8:D2l:::btst
 "btst"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -1905,6 +2004,7 @@
 8.0xfb+8.0x0a+4.RN2,4.RM0+8.IMM8:D2l:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1918,6 +2018,7 @@
 8.0xfb+8.0x1a+4.RM2,4.RN0+8.IMM8:D2m:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1931,6 +2032,7 @@
 8.0xfb+8.0x2a+4.RN2,4.RM0+8.IMM8:D2l:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1944,6 +2046,7 @@
 8.0xfb+8.0x3a+4.RM2,4.RN0+8.IMM8:D2m:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1957,6 +2060,7 @@
 8.0xfb+8.0x4a+4.RN2,4.RM0+8.IMM8:D2l:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1970,6 +2074,7 @@
 8.0xfb+8.0x5a+4.RM2,4.RN0+8.IMM8:D2m:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1983,6 +2088,7 @@
 8.0xfb+8.0x6a+4.RN2,4.RM0!RN2+8.IMM8:D2y:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -1997,6 +2103,7 @@
 8.0xfb+8.0x7a+4.RM2,4.RN0+8.IMM8:D2z:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -2012,6 +2119,7 @@
 8.0xfb+8.0x8a+4.RN2,4.0x0+8.IMM8:D2n:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -2024,6 +2132,7 @@
 8.0xfb+8.0x9a+4.RM2,4.0x0+8.IMM8:D2o:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -2036,6 +2145,7 @@
 8.0xfb+8.0xaa+4.RN2,4.0x0+8.IMM8:D2n:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -2048,6 +2158,7 @@
 8.0xfb+8.0xba+4.RM2,4.0x0+8.IMM8:D2o:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -2060,6 +2171,7 @@
 8.0xfb+8.0xca+4.RN2,4.0x0+8.IMM8:D2n:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -2072,6 +2184,7 @@
 8.0xfb+8.0xda+4.RM2,4.0x0+8.IMM8:D2o:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -2084,6 +2197,7 @@
 8.0xfb+8.0xea+4.RN2,4.RM0!RN2+8.IMM8:D2y:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -2098,6 +2212,7 @@
 8.0xfb+8.0xfa+4.RM2,4.RN0+8.IMM8:D2z:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -2113,6 +2228,7 @@
 8.0xfb+8.0x0b+4.RN2,4.RN0=RN2+8.IMM8:D2:::mac
 "mac"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -2140,6 +2256,7 @@
 8.0xfb+8.0x1b+4.RN2,4.RN0=RN2+8.IMM8:D2:::macu
 "macu"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -2167,6 +2284,7 @@
 8.0xfb+8.0x2b+4.RN2,4.RN0=RN2+8.IMM8:D2:::macb
 "macb"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -2194,6 +2312,7 @@
 8.0xfb+8.0x3b+4.RN2,4.RN0=RN2+8.IMM8:D2:::macbu
 "macbu"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -2221,6 +2340,7 @@
 8.0xfb+8.0x4b+4.RN2,4.RN0=RN2+8.IMM8:D2:::mach
 "mach"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -2248,6 +2368,7 @@
 8.0xfb+8.0x5b+4.RN2,4.RN0=RN2+8.IMM8:D2:::machu
 "machu"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -2275,6 +2396,7 @@
 8.0xfb+8.0xbb+4.RN2,4.RN0=RN2+8.IMM8:D2:::mcste
 "mcste"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -2371,6 +2493,7 @@
 8.0xfb+8.0x7c+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::add
 "add"
 *am33
+*am33_2
 {
   int z, c, n, v;
   unsigned32 sum, source1, source2;
@@ -2401,6 +2524,7 @@
 8.0xfb+8.0x8c+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::addc
 "addc"
 *am33
+*am33_2
 {
   int z, c, n, v;
   unsigned32 sum, source1, source2;
@@ -2431,6 +2555,7 @@
 8.0xfb+8.0x9c+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::sub
 "sub"
 *am33
+*am33_2
 {
   int z, c, n, v;
   unsigned32 difference, source1, source2;
@@ -2461,6 +2586,7 @@
 8.0xfb+8.0xac+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::subc
 "subc"
 *am33
+*am33_2
 {
   int z, c, n, v;
   unsigned32 difference, source1, source2;
@@ -2491,6 +2617,7 @@
 8.0xfb+8.0x0d+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::and
 "and"
 *am33
+*am33_2
 {
   int z, n;
   int srcreg1, srcreg2, dstreg;
@@ -2513,6 +2640,7 @@
 8.0xfb+8.0x1d+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::or
 "or"
 *am33
+*am33_2
 {
   int z, n;
   int srcreg1, srcreg2, dstreg;
@@ -2535,6 +2663,7 @@
 8.0xfb+8.0x2d+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::xor
 "xor"
 *am33
+*am33_2
 {
   int z, n;
   int srcreg1, srcreg2, dstreg;
@@ -2557,6 +2686,7 @@
 8.0xfb+8.0x4d+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::asr
 "asr"
 *am33
+*am33_2
 {
   int z, c, n;
   signed32 temp;
@@ -2583,6 +2713,7 @@
 8.0xfb+8.0x5d+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::lsr
 "lsr"
 *am33
+*am33_2
 {
   int z, c, n;
   int srcreg1, srcreg2, dstreg;
@@ -2606,6 +2737,7 @@
 8.0xfb+8.0x6d+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::asl
 "asl"
 *am33
+*am33_2
 {
   int z, n;
   int srcreg1, srcreg2, dstreg;
@@ -2628,6 +2760,7 @@
 8.0xfb+8.0xad+4.RM2,4.RN0+4.RD0,4.RD2!RD0:D2c:::mul
 "mul"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed64 temp;
@@ -2655,6 +2788,7 @@
 8.0xfb+8.0xbd+4.RM2,4.RN0+4.RD0,4.RD2!RD0:D2c:::mulu
 "mulu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed64 temp;
@@ -2682,6 +2816,7 @@
 8.0xfb+8.0x0e+4.RN2,4.0x0+8.IMM8:D2p:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -2694,6 +2829,7 @@
 8.0xfb+8.0x1e+4.RM2,4.0x0+8.IMM8:D2q:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -2706,6 +2842,7 @@
 8.0xfb+8.0x2e+4.RN2,4.0x0+8.IMM8:D2p:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -2718,6 +2855,7 @@
 8.0xfb+8.0x3e+4.RM2,4.0x0+8.IMM8:D2q:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -2730,6 +2868,7 @@
 8.0xfb+8.0x4e+4.RN2,4.0x0+8.IMM8:D2p:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -2742,6 +2881,7 @@
 8.0xfb+8.0x5e+4.RM2,4.0x0+8.IMM8:D2q:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -2754,6 +2894,7 @@
 8.0xfb+8.0x8e+4.RI0,4.RM0+4.RN0,4.0x0:D2r:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg;
 
@@ -2768,6 +2909,7 @@
 8.0xfb+8.0x9e+4.RI0,4.RN0+4.RM0,4.0x0:D2s:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg1, dstreg2;
 
@@ -2782,6 +2924,7 @@
 8.0xfb+8.0xae+4.RI0,4.RM0+4.RN0,4.0x0:D2r:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg;
 
@@ -2796,6 +2939,7 @@
 8.0xfb+8.0xbe+4.RI0,4.RN0+4.RM0,4.0x0:D2s:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg, dstreg1, dstreg2;
 
@@ -2810,6 +2954,7 @@
 8.0xfb+8.0xce+4.RI0,4.RM0+4.RN0,4.0x0:D2r:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg;
 
@@ -2824,6 +2969,7 @@
 8.0xfb+8.0xde+4.RI0,4.RN0+4.RM0,4.0x0:D2s:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg1, dstreg2;
 
@@ -2838,6 +2984,7 @@
 8.0xfb+8.0x0f+4.RM2,4.RN0+4.RD0,4.RD2!RD0:D2c:::mac
 "mac"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed64 temp;
@@ -2874,6 +3021,7 @@
 8.0xfb+8.0x1f+4.RM2,4.RN0+4.RD0,4.RD2!RD0:D2c:::macu
 "macu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed64 temp;
@@ -2910,6 +3058,7 @@
 8.0xfb+8.0x2f+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::macb
 "macb"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg;
   signed32 temp, sum;
@@ -2938,6 +3087,7 @@
 8.0xfb+8.0x3f+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::macbu
 "macbu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg;
   signed32 temp, sum;
@@ -2966,6 +3116,7 @@
 8.0xfb+8.0x4f+4.RM2,4.RN0+4.RD0,4.RD2!RD0:D2c:::mach
 "mach"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed64 temp, sum;
@@ -2996,6 +3147,7 @@
 8.0xfb+8.0x5f+4.RM2,4.RN0+4.RD0,4.RD2!RD0:D2c:::machu
 "machu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed64 temp, sum;
@@ -3026,6 +3178,7 @@
 8.0xfb+8.0x6f+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::dmach
 "dmach"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg;
   signed32 temp, temp2, sum;
@@ -3056,6 +3209,7 @@
 8.0xfb+8.0x7f+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::dmachu
 "dmachu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg;
   signed32 temp, temp2, sum;
@@ -3086,6 +3240,7 @@
 8.0xfb+8.0x8f+4.RM2,4.RN0+4.RD0,4.RD2!RD0:D2c:::dmulh
 "dmulh"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed64 temp;
@@ -3108,6 +3263,7 @@
 8.0xfb+8.0x9f+4.RM2,4.RN0+4.RD0,4.RD2!RD0:D2c:::dmulhu
 "dmulhu"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed64 temp;
@@ -3130,6 +3286,7 @@
 8.0xfb+8.0xaf+4.RM2,4.RN0+8.0x0:D2:::sat24
 "sat24"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
   int value, n, z;
@@ -3157,6 +3314,7 @@
 8.0xfb+8.0xff+4.RM2,4.RN0+4.RD0,4.0x0:D2c:::bsch
 "bsch"
 *am33
+*am33_2
 {
   int temp, c, i;
   int srcreg1, srcreg2, dstreg;
@@ -3196,6 +3354,7 @@
 8.0xfd+8.0x08+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4t:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3208,6 +3367,7 @@
 8.0xfd+8.0x18+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4k:::movu
 "movu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3220,6 +3380,7 @@
 8.0xfd+8.0x78+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4c:::add
 "add"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3232,6 +3393,7 @@
 8.0xfd+8.0x88+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::addc
 "addc"
 *am33
+*am33_2
 {
   int dstreg, z, n, c, v;
   unsigned32 sum, imm, reg2;
@@ -3259,6 +3421,7 @@
 8.0xfd+8.0x98+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::sub
 "sub"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3271,6 +3434,7 @@
 8.0xfd+8.0xa8+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::subc
 "subc"
 *am33
+*am33_2
 {
   int dstreg, z, n, c, v;
   unsigned32 difference, imm, reg2;
@@ -3298,6 +3462,7 @@
 8.0xfd+8.0xd8+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::cmp
 "cmp"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -3310,6 +3475,7 @@
 8.0xfd+8.0xf8+4.XRM2,4.XRN0=XRM2+8.IMM24A+8.IMM24B+8.IMM24C:D4o:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3323,6 +3489,7 @@
 8.0xfd+8.0x09+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::and
 "and"
 *am33
+*am33_2
 {
   int dstreg;
   int z,n;
@@ -3341,6 +3508,7 @@
 8.0xfd+8.0x19+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::or
 "or"
 *am33
+*am33_2
 {
   int dstreg;
   int z,n;
@@ -3359,6 +3527,7 @@
 8.0xfd+8.0x29+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::xor
 "xor"
 *am33
+*am33_2
 {
   int dstreg;
   int z,n;
@@ -3377,6 +3546,7 @@
 8.0xfd+8.0x49+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::asr
 "asr"
 *am33
+*am33_2
 {
   int dstreg;
   signed32 temp;
@@ -3400,6 +3570,7 @@
 8.0xfd+8.0x59+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::lsr
 "lsr"
 *am33
+*am33_2
 {
   int dstreg;
   int z, n, c;
@@ -3419,6 +3590,7 @@
 8.0xfd+8.0x69+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::asl
 "asl"
 *am33
+*am33_2
 {
   int dstreg;
   int z, n;
@@ -3437,6 +3609,7 @@
 8.0xfd+8.0xa9+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::mul
 "mul"
 *am33
+*am33_2
 {
   int dstreg;
   unsigned64 temp;
@@ -3459,6 +3632,7 @@
 8.0xfd+8.0xb9+4.RM2,4.RN0=RM2+8.IMM24A+8.IMM24B+8.IMM24C:D4b:::mulu
 "mulu"
 *am33
+*am33_2
 {
   int dstreg;
   unsigned64 temp;
@@ -3481,6 +3655,7 @@
 8.0xfd+8.0xe9+4.RN2,4.RN0=RN2+8.IMM24A+8.IMM24B+8.IMM24C:D4p:::btst
 "btst"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -3493,6 +3668,7 @@
 8.0xfd+8.0x0a+4.RN2,4.RM0+8.IMM24A+8.IMM24B+8.IMM24C:D4p:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -3508,6 +3684,7 @@
 8.0xfd+8.0x1a+4.RM2,4.RN0+8.IMM24A+8.IMM24B+8.IMM24C:D4q:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -3522,6 +3699,7 @@
 8.0xfd+8.0x2a+4.RN2,4.RM0+8.IMM24A+8.IMM24B+8.IMM24C:D4p:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -3537,6 +3715,7 @@
 8.0xfd+8.0x3a+4.RM2,4.RN0+8.IMM24A+8.IMM24B+8.IMM24C:D4q:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -3551,6 +3730,7 @@
 8.0xfd+8.0x4a+4.RN2,4.RM0+8.IMM24A+8.IMM24B+8.IMM24C:D4p:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -3566,6 +3746,7 @@
 8.0xfd+8.0x5a+4.RM2,4.RN0+8.IMM24A+8.IMM24B+8.IMM24C:D4q:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -3580,6 +3761,7 @@
 8.0xfd+8.0x6a+4.RN2,4.RM0!RN2+8.IMM24A+8.IMM24B+8.IMM24C:D4y:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -3594,6 +3776,7 @@
 8.0xfd+8.0x7a+4.RM2,4.RN0+8.IMM24A+8.IMM24B+8.IMM24C:D4z:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -3609,6 +3792,7 @@
 8.0xfd+8.0x8a+4.RN2,4.0x0+IMM24A+8.IMM24B+8.IMM24C:D4r:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3622,6 +3806,7 @@
 8.0xfd+8.0x9a+4.RM2,4.0x0+8.IMM24A+8.IMM24B+8.IMM24C:D4s:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -3635,6 +3820,7 @@
 8.0xfd+8.0xaa+4.RN2,4.0x0+8.IMM24A+8.IMM24B+8.IMM24C:D4r:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3648,6 +3834,7 @@
 8.0xfd+8.0xba+4.RM2,4.0x0+8.IMM24A+8.IMM24B+8.IMM24C:D4s:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -3661,6 +3848,7 @@
 8.0xfd+8.0xca+4.RN2,4.0x0+8.IMM24A+8.IMM24B+8.IMM24C:D4r:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3674,6 +3862,7 @@
 8.0xfd+8.0xda+4.RM2,4.RN0+8.IMM24A+8.IMM24B+8.IMM24C:D4s:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -3687,6 +3876,7 @@
 8.0xfd+8.0xea+4.RN2,4.RM0!RN2+8.IMM24A+8.IMM24B+8.IMM24C:D4y:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -3701,6 +3891,7 @@
 8.0xfd+8.0xfa+4.RM2,4.RN0+8.IMM24A+8.IMM24B+8.IMM24C:D4z:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -3715,6 +3906,7 @@
 8.0xfd+8.0x0b+4.RN2,4.RN0=RN2+8.IMM24A+8.IMM24B+8.IMM24C:D4z:::mac
 "mac"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -3742,6 +3934,7 @@
 8.0xfd+8.0x1b+4.RN2,4.RN0=RN2+8.IMM24A+8.IMM24B+8.IMM24C:D4z:::macu
 "macu"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -3769,6 +3962,7 @@
 8.0xfd+8.0x2b+4.RN2,4.RN0=RN2+8.IMM24A+8.IMM24B+8.IMM24C:D4z:::macb
 "macb"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -3796,6 +3990,7 @@
 8.0xfd+8.0x3b+4.RN2,4.RN0=RN2+8.IMM24A+8.IMM24B+8.IMM24C:D4z:::macbu
 "macbu"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -3823,6 +4018,7 @@
 8.0xfd+8.0x4b+4.RN2,4.RN0=RN2+8.IMM24A+8.IMM24B+8.IMM24C:D4z:::mach
 "mach"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -3850,6 +4046,7 @@
 8.0xfd+8.0x5b+4.RN2,4.RN0=RN2+8.IMM24A+8.IMM24B+8.IMM24C:D4z:::machu
 "machu"
 *am33
+*am33_2
 {
   int srcreg;
   signed64 temp, sum;
@@ -3877,6 +4074,7 @@
 8.0xfd+8.0x0e+4.RN2,4.0x0+8.IMM24A+8.IMM24B+8.IMM24C:D4u:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3889,6 +4087,7 @@
 8.0xfd+8.0x1e+4.RM2,4.0x0+8.IMM24A+8.IMM24B+8.IMM24C:D4v:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -3902,6 +4101,7 @@
 8.0xfd+8.0x2e+4.RN2,4.0x0+8.IMM24A+8.IMM24B+8.IMM24C:D4t:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3914,6 +4114,7 @@
 8.0xfd+8.0x3e+4.RM2,4.0x0+8.IMM24A+8.IMM24B+8.IMM24C:D4u:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -3927,6 +4128,7 @@
 8.0xfd+8.0x4e+4.RN2,4.0x0+8.IMM24A+8.IMM24B+8.IMM24C:D4t:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3939,6 +4141,7 @@
 8.0xfd+8.0x5e+4.RM2,4.0x0+8.IMM24A+8.IMM24B+8.IMM24C:D4u:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -3952,6 +4155,7 @@
 8.0xfe+8.0x08+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3964,6 +4168,7 @@
 8.0xfe+8.0x18+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::movu
 "movu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3976,6 +4181,7 @@
 8.0xfe+8.0x78+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::add
 "add"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -3988,6 +4194,7 @@
 8.0xfe+8.0x88+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::addc
 "addc"
 *am33
+*am33_2
 {
   int dstreg;
   unsigned32 imm, reg2, sum;
@@ -4016,6 +4223,7 @@
 8.0xfe+8.0x98+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::sub
 "sub"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -4028,6 +4236,7 @@
 8.0xfe+8.0xa8+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::subc
 "subc"
 *am33
+*am33_2
 {
   int dstreg;
   unsigned32 imm, reg2, difference;
@@ -4056,6 +4265,7 @@
 8.0xfe+8.0xd8+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::cmp
 "cmp"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -4068,6 +4278,7 @@
 8.0xfe+8.0xf8+4.XRM2,4.XRN0=XRM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5b:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -4081,6 +4292,7 @@
 8.0xfe+8.0x09+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::and
 "and"
 *am33
+*am33_2
 {
   int dstreg;
   int z,n;
@@ -4099,6 +4311,7 @@
 8.0xfe+8.0x19+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::or
 "or"
 *am33
+*am33_2
 {
   int dstreg;
   int z,n;
@@ -4117,6 +4330,7 @@
 8.0xfe+8.0x29+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::xor
 "xor"
 *am33
+*am33_2
 {
   int dstreg;
   int z,n;
@@ -4135,6 +4349,7 @@
 8.0xfe+8.0x49+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::asr
 "asr"
 *am33
+*am33_2
 {
   int dstreg;
   signed32 temp;
@@ -4157,6 +4372,7 @@
 8.0xfe+8.0x59+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::lsr
 "lsr"
 *am33
+*am33_2
 {
   int dstreg;
   int z, n, c;
@@ -4176,6 +4392,7 @@
 8.0xfe+8.0x69+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::asl
 "asl"
 *am33
+*am33_2
 {
   int dstreg;
   int z, n;
@@ -4194,6 +4411,7 @@
 8.0xfe+8.0xa9+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::mul
 "mul"
 *am33
+*am33_2
 {
   int dstreg;
   unsigned64 temp;
@@ -4216,6 +4434,7 @@
 8.0xfe+8.0xb9+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::mulu
 "mulu"
 *am33
+*am33_2
 {
   int dstreg;
   unsigned64 temp;
@@ -4238,6 +4457,7 @@
 8.0xfe+8.0xe9+4.RM2,4.RN0=RM2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5a:::btst
 "btst"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -4250,6 +4470,7 @@
 8.0xfe+8.0x0a+4.RN2,4.RM0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5f:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -4264,6 +4485,7 @@
 8.0xfe+8.0x1a+4.RM2,4.RN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5g:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -4278,6 +4500,7 @@
 8.0xfe+8.0x2a+4.RN2,4.RM0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -4292,6 +4515,7 @@
 8.0xfe+8.0x3a+4.RM2,4.RN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5b:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -4306,6 +4530,7 @@
 8.0xfe+8.0x4a+4.RN2,4.RM0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -4320,6 +4545,7 @@
 8.0xfe+8.0x5a+4.RM2,4.RN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5b:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -4334,6 +4560,7 @@
 8.0xfe+8.0x6a+4.RN2,4.RM0!RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5y:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -4348,6 +4575,7 @@
 8.0xfe+8.0x7a+4.RM2,4.RN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5z:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -4363,6 +4591,7 @@
 8.0xfe+8.0x8a+4.RN2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5c:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -4376,6 +4605,7 @@
 8.0xfe+8.0x9a+4.RM2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5d:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -4389,6 +4619,7 @@
 8.0xfe+8.0xaa+4.RN2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5c:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -4402,6 +4633,7 @@
 8.0xfe+8.0xba+4.RM2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5d:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -4415,6 +4647,7 @@
 8.0xfe+8.0xca+4.RN2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5c:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -4428,6 +4661,7 @@
 8.0xfe+8.0xda+4.RM2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5d:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -4442,6 +4676,7 @@
 8.0xfe+8.0xea+4.RN2,4.RM0!RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5y:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -4456,6 +4691,7 @@
 8.0xfe+8.0xfa+4.RM2,4.RN0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5f:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -4471,6 +4707,7 @@
 8.0xfe+8.0x0b+4.RN2,4.RN0=RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::mac
 "mac"
 *am33
+*am33_2
 {
   int srcreg, imm;
   signed64 temp, sum;
@@ -4499,6 +4736,7 @@
 8.0xfe+8.0x1b+4.RN2,4.RN0=RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::macu
 "macu"
 *am33
+*am33_2
 {
   int srcreg, imm;
   signed64 temp, sum;
@@ -4527,6 +4765,7 @@
 8.0xfe+8.0x2b+4.RN2,4.RN0=RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::macb
 "macb"
 *am33
+*am33_2
 {
   int srcreg, imm;
   signed32 temp, sum;
@@ -4550,6 +4789,7 @@
 8.0xfe+8.0x3b+4.RN2,4.RN0=RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::macbu
 "macbu"
 *am33
+*am33_2
 {
   int srcreg, imm;
   signed32 temp, sum;
@@ -4573,6 +4813,7 @@
 8.0xfe+8.0x4b+4.RN2,4.RN0=RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::mach
 "mach"
 *am33
+*am33_2
 {
   int srcreg, imm;
   signed32 temp, sum;
@@ -4596,6 +4837,7 @@
 8.0xfe+8.0x5b+4.RN2,4.RN0=RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::machu
 "machu"
 *am33
+*am33_2
 {
   int srcreg, imm;
   signed32 temp, sum;
@@ -4619,6 +4861,7 @@
 8.0xfe+8.0x6b+4.RN2,4.RN0=RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::dmach
 "dmach"
 *am33
+*am33_2
 {
   int srcreg, imm;
   signed32 temp, temp2, sum;
@@ -4644,6 +4887,7 @@
 8.0xfe+8.0x7b+4.RN2,4.RN0=RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::dmachu
 "dmachu"
 *am33
+*am33_2
 {
   int srcreg, imm;
   signed32 temp, temp2, sum;
@@ -4669,6 +4913,7 @@
 8.0xfe+8.0x8b+4.RN2,4.RN0=RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::dmulh
 "dmulh"
 *am33
+*am33_2
 {
   int imm, dstreg;
   signed32 temp;
@@ -4689,6 +4934,7 @@
 8.0xfe+8.0x9b+4.RN2,4.RN0=RN2+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5:::dmulhu
 "dmulhu"
 *am33
+*am33_2
 {
   int imm, dstreg;
   signed32 temp;
@@ -4709,6 +4955,7 @@
 8.0xfe+8.0x0e+4.RN2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5h:::mov
 "mov"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -4721,6 +4968,7 @@
 8.0xfe+8.0x1e+4.RM2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5e:::mov
 "mov"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -4733,6 +4981,7 @@
 8.0xfe+8.0x2e+4.RN2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5i:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -4745,6 +4994,7 @@
 8.0xfe+8.0x3e+4.RM2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5e:::movbu
 "movbu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -4757,6 +5007,7 @@
 8.0xfe+8.0x4e+4.RN2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5j:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int dstreg;
 
@@ -4769,6 +5020,7 @@
 8.0xfe+8.0x5e+4.RM2,4.0x0+8.IMM32A+8.IMM32B+8.IMM32C+8.IMM32D:D5e:::movhu
 "movhu"
 *am33
+*am33_2
 {
   int srcreg;
 
@@ -4781,6 +5033,7 @@
 8.0xf7+8.0x00+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::add_add
 "add_add"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -4800,6 +5053,7 @@
 8.0xf7+8.0x10+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::add_add
 "add_add"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -4818,6 +5072,7 @@
 8.0xf7+8.0x20+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::add_sub
 "add_sub"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -4837,6 +5092,7 @@
 8.0xf7+8.0x30+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::add_sub
 "add_sub"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -4855,6 +5111,7 @@
 8.0xf7+8.0x40+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::add_cmp
 "add_cmp"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -4872,6 +5129,7 @@
 8.0xf7+8.0x50+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::add_cmp
 "add_cmp"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -4888,6 +5146,7 @@
 8.0xf7+8.0x60+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::add_mov
 "add_mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -4907,6 +5166,7 @@
 8.0xf7+8.0x70+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::add_mov
 "add_mov"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -4925,6 +5185,7 @@
 8.0xf7+8.0x80+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::add_asr
 "add_asr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -4947,6 +5208,7 @@
 8.0xf7+8.0x90+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::add_asr
 "add_asr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -4968,6 +5230,7 @@
 8.0xf7+8.0xa0+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::add_lsr
 "add_lsr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -4987,6 +5250,7 @@
 8.0xf7+8.0xb0+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::add_lsr
 "add_lsr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5006,6 +5270,7 @@
 8.0xf7+8.0xc0+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::add_asl
 "add_asl"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5025,6 +5290,7 @@
 8.0xf7+8.0xd0+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::add_asl
 "add_asl"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5043,6 +5309,7 @@
 8.0xf7+8.0x01+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::cmp_add
 "cmp_add"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -5060,6 +5327,7 @@
 8.0xf7+8.0x11+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::cmp_add
 "cmp_add"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -5076,6 +5344,7 @@
 8.0xf7+8.0x21+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::cmp_sub
 "cmp_sub"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -5093,6 +5362,7 @@
 8.0xf7+8.0x31+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::cmp_sub
 "cmp_sub"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -5109,6 +5379,7 @@
 8.0xf7+8.0x61+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::cmp_mov
 "cmp_mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -5126,6 +5397,7 @@
 8.0xf7+8.0x71+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::cmp_mov
 "cmp_mov"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -5142,6 +5414,7 @@
 8.0xf7+8.0x81+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::cmp_asr
 "cmp_asr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed int temp;
@@ -5162,6 +5435,7 @@
 8.0xf7+8.0x91+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::cmp_asr
 "cmp_asr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   signed int temp;
@@ -5181,6 +5455,7 @@
 8.0xf7+8.0xa1+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::cmp_lsr
 "cmp_lsr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -5198,6 +5473,7 @@
 8.0xf7+8.0xb1+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::cmp_lsr
 "cmp_lsr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -5215,6 +5491,7 @@
 8.0xf7+8.0xc1+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::cmp_asl
 "cmp_asl"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -5232,6 +5509,7 @@
 8.0xf7+8.0xd1+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::cmp_asl
 "cmp_asl"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -5248,6 +5526,7 @@
 8.0xf7+8.0x02+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sub_add
 "sub_add"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5267,6 +5546,7 @@
 8.0xf7+8.0x12+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sub_add
 "sub_add"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5285,6 +5565,7 @@
 8.0xf7+8.0x22+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sub_sub
 "sub_sub"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5304,6 +5585,7 @@
 8.0xf7+8.0x32+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sub_sub
 "sub_sub"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5322,6 +5604,7 @@
 8.0xf7+8.0x42+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sub_cmp
 "sub_cmp"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -5339,6 +5622,7 @@
 8.0xf7+8.0x52+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sub_cmp
 "sub_cmp"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -5355,6 +5639,7 @@
 8.0xf7+8.0x62+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sub_mov
 "sub_mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5374,6 +5659,7 @@
 8.0xf7+8.0x72+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sub_mov
 "sub_mov"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5392,6 +5678,7 @@
 8.0xf7+8.0x82+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sub_asr
 "sub_asr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5414,6 +5701,7 @@
 8.0xf7+8.0x92+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sub_asr
 "sub_asr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5435,6 +5723,7 @@
 8.0xf7+8.0xa2+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sub_lsr
 "sub_lsr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5454,6 +5743,7 @@
 8.0xf7+8.0xb2+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sub_lsr
 "sub_lsr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5473,6 +5763,7 @@
 8.0xf7+8.0xc2+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sub_asl
 "sub_asl"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5492,6 +5783,7 @@
 8.0xf7+8.0xd2+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sub_asl
 "sub_asl"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5510,6 +5802,7 @@
 8.0xf7+8.0x03+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::mov_add
 "mov_add"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5529,6 +5822,7 @@
 8.0xf7+8.0x13+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::mov_add
 "mov_add"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5547,6 +5841,7 @@
 8.0xf7+8.0x23+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::mov_sub
 "mov_sub"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5566,6 +5861,7 @@
 8.0xf7+8.0x33+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::mov_sub
 "mov_sub"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5584,6 +5880,7 @@
 8.0xf7+8.0x43+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::mov_cmp
 "mov_cmp"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -5601,6 +5898,7 @@
 8.0xf7+8.0x53+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::mov_cmp
 "mov_cmp"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -5617,6 +5915,7 @@
 8.0xf7+8.0x63+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::mov_mov
 "mov_mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5636,6 +5935,7 @@
 8.0xf7+8.0x73+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::mov_mov
 "mov_mov"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5654,6 +5954,7 @@
 8.0xf7+8.0x83+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::mov_asr
 "mov_asr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5676,6 +5977,7 @@
 8.0xf7+8.0x93+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::mov_asr
 "mov_asr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5697,6 +5999,7 @@
 8.0xf7+8.0xa3+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::mov_lsr
 "mov_lsr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5716,6 +6019,7 @@
 8.0xf7+8.0xb3+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::mov_lsr
 "mov_lsr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5735,6 +6039,7 @@
 8.0xf7+8.0xc3+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::mov_asl
 "mov_asl"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5754,6 +6059,7 @@
 8.0xf7+8.0xd3+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::mov_asl
 "mov_asl"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -5772,6 +6078,7 @@
 8.0xf7+8.0x04+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::add_add
 "add_add"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5790,6 +6097,7 @@
 8.0xf7+8.0x14+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::add_add
 "add_add"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -5807,6 +6115,7 @@
 8.0xf7+8.0x24+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::add_sub
 "add_sub"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5825,6 +6134,7 @@
 8.0xf7+8.0x34+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::add_sub
 "add_sub"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -5842,6 +6152,7 @@
 8.0xf7+8.0x44+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::add_cmp
 "add_cmp"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
 
@@ -5858,6 +6169,7 @@
 8.0xf7+8.0x54+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::add_cmp
 "add_cmp"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
 
@@ -5873,6 +6185,7 @@
 8.0xf7+8.0x64+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::add_mov
 "add_mov"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5891,6 +6204,7 @@
 8.0xf7+8.0x74+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::add_mov
 "add_mov"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -5908,6 +6222,7 @@
 8.0xf7+8.0x84+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::add_asr
 "add_asr"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5929,6 +6244,7 @@
 8.0xf7+8.0x94+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::add_asr
 "add_asr"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -5949,6 +6265,7 @@
 8.0xf7+8.0xa4+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::add_lsr
 "add_lsr"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -5967,6 +6284,7 @@
 8.0xf7+8.0xb4+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::add_lsr
 "add_lsr"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -5985,6 +6303,7 @@
 8.0xf7+8.0xc4+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::add_asl
 "add_asl"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6003,6 +6322,7 @@
 8.0xf7+8.0xd4+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::add_asl
 "add_asl"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6020,6 +6340,7 @@
 8.0xf7+8.0x05+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::cmp_add
 "cmp_add"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
 
@@ -6036,6 +6357,7 @@
 8.0xf7+8.0x15+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::cmp_add
 "cmp_add"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
 
@@ -6051,6 +6373,7 @@
 8.0xf7+8.0x25+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::cmp_sub
 "cmp_sub"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
 
@@ -6067,6 +6390,7 @@
 8.0xf7+8.0x35+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::cmp_sub
 "cmp_sub"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
 
@@ -6082,6 +6406,7 @@
 8.0xf7+8.0x65+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::cmp_mov
 "cmp_mov"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
 
@@ -6098,6 +6423,7 @@
 8.0xf7+8.0x75+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::cmp_mov
 "cmp_mov"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
 
@@ -6113,6 +6439,7 @@
 8.0xf7+8.0x85+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::cmp_asr
 "cmp_asr"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   signed int temp;
@@ -6132,6 +6459,7 @@
 8.0xf7+8.0x95+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::cmp_asr
 "cmp_asr"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   signed int temp;
@@ -6150,6 +6478,7 @@
 8.0xf7+8.0xa5+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::cmp_lsr
 "cmp_lsr"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
 
@@ -6166,6 +6495,7 @@
 8.0xf7+8.0xb5+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::cmp_lsr
 "cmp_lsr"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
 
@@ -6182,6 +6512,7 @@
 8.0xf7+8.0xc5+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::cmp_asl
 "cmp_asl"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
 
@@ -6198,6 +6529,7 @@
 8.0xf7+8.0xd5+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::cmp_asl
 "cmp_asl"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
 
@@ -6213,6 +6545,7 @@
 8.0xf7+8.0x06+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::sub_add
 "sub_add"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6231,6 +6564,7 @@
 8.0xf7+8.0x16+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::sub_add
 "sub_add"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6248,6 +6582,7 @@
 8.0xf7+8.0x26+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::sub_sub
 "sub_sub"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6266,6 +6601,7 @@
 8.0xf7+8.0x36+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::sub_sub
 "sub_sub"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6283,6 +6619,7 @@
 8.0xf7+8.0x46+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::sub_cmp
 "sub_cmp"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
 
@@ -6299,6 +6636,7 @@
 8.0xf7+8.0x56+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::sub_cmp
 "sub_cmp"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
 
@@ -6314,6 +6652,7 @@
 8.0xf7+8.0x66+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::sub_mov
 "sub_mov"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6332,6 +6671,7 @@
 8.0xf7+8.0x76+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::sub_mov
 "sub_mov"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6349,6 +6689,7 @@
 8.0xf7+8.0x86+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::sub_asr
 "sub_asr"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6370,6 +6711,7 @@
 8.0xf7+8.0x96+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::sub_asr
 "sub_asr"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6390,6 +6732,7 @@
 8.0xf7+8.0xa6+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::sub_lsr
 "sub_lsr"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6408,6 +6751,7 @@
 8.0xf7+8.0xb6+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::sub_lsr
 "sub_lsr"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6426,6 +6770,7 @@
 8.0xf7+8.0xc6+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::sub_asl
 "sub_asl"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6444,6 +6789,7 @@
 8.0xf7+8.0xd6+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::sub_asl
 "sub_asl"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6461,6 +6807,7 @@
 8.0xf7+8.0x07+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::mov_add
 "mov_add"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6479,6 +6826,7 @@
 8.0xf7+8.0x17+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::mov_add
 "mov_add"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6496,6 +6844,7 @@
 8.0xf7+8.0x27+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::mov_sub
 "mov_sub"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6514,6 +6863,7 @@
 8.0xf7+8.0x37+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::mov_sub
 "mov_sub"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6531,6 +6881,7 @@
 8.0xf7+8.0x47+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::mov_cmp
 "mov_cmp"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
 
@@ -6547,6 +6898,7 @@
 8.0xf7+8.0x57+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::mov_cmp
 "mov_cmp"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
 
@@ -6562,6 +6914,7 @@
 8.0xf7+8.0x67+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::mov_mov
 "mov_mov"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6580,6 +6933,7 @@
 8.0xf7+8.0x77+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::mov_mov
 "mov_mov"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6597,6 +6951,7 @@
 8.0xf7+8.0x87+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::mov_asr
 "mov_asr"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6618,6 +6973,7 @@
 8.0xf7+8.0x97+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::mov_asr
 "mov_asr"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6638,6 +6994,7 @@
 8.0xf7+8.0xa7+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::mov_lsr
 "mov_lsr"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6656,6 +7013,7 @@
 8.0xf7+8.0xb7+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::mov_lsr
 "mov_lsr"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6674,6 +7032,7 @@
 8.0xf7+8.0xc7+4.IMM4A,4.RN1+4.RM2,4.RN2!RN1:D2c:::mov_asl
 "mov_asl"
 *am33
+*am33_2
 {
   int srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6692,6 +7051,7 @@
 8.0xf7+8.0xd7+4.IMM4A,4.RN1+4.IMM4,4.RN2!RN1:D2d:::mov_asl
 "mov_asl"
 *am33
+*am33_2
 {
   int dstreg1, dstreg2;
   int result1;
@@ -6709,6 +7069,7 @@
 8.0xf7+8.0x08+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::and_add
 "and_add"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6728,6 +7089,7 @@
 8.0xf7+8.0x18+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::and_add
 "and_add"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -6746,6 +7108,7 @@
 8.0xf7+8.0x28+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::and_sub
 "and_sub"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6765,6 +7128,7 @@
 8.0xf7+8.0x38+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::and_sub
 "and_sub"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -6783,6 +7147,7 @@
 8.0xf7+8.0x48+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::and_cmp
 "and_cmp"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -6800,6 +7165,7 @@
 8.0xf7+8.0x58+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::and_cmp
 "and_cmp"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -6816,6 +7182,7 @@
 8.0xf7+8.0x68+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::and_mov
 "and_mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6835,6 +7202,7 @@
 8.0xf7+8.0x78+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::and_mov
 "and_mov"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -6853,6 +7221,7 @@
 8.0xf7+8.0x88+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::and_asr
 "and_asr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6875,6 +7244,7 @@
 8.0xf7+8.0x98+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::and_asr
 "and_asr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -6896,6 +7266,7 @@
 8.0xf7+8.0xa8+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::and_lsr
 "and_lsr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6915,6 +7286,7 @@
 8.0xf7+8.0xb8+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::and_lsr
 "and_lsr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -6934,6 +7306,7 @@
 8.0xf7+8.0xc8+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::and_asl
 "and_asl"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -6953,6 +7326,7 @@
 8.0xf7+8.0xd8+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::and_asl
 "and_asl"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -6971,6 +7345,7 @@
 8.0xf7+8.0x09+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::dmach_add
 "dmach_add"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -6995,6 +7370,7 @@
 8.0xf7+8.0x19+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::dmach_add
 "dmach_add"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7018,6 +7394,7 @@
 8.0xf7+8.0x29+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::dmach_sub
 "dmach_sub"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7042,6 +7419,7 @@
 8.0xf7+8.0x39+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::dmach_sub
 "dmach_sub"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7065,6 +7443,7 @@
 8.0xf7+8.0x49+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::dmach_cmp
 "dmach_cmp"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7089,6 +7468,7 @@
 8.0xf7+8.0x59+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::dmach_cmp
 "dmach_cmp"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7112,6 +7492,7 @@
 8.0xf7+8.0x69+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::dmach_mov
 "dmach_mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7136,6 +7517,7 @@
 8.0xf7+8.0x79+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::dmach_mov
 "dmach_mov"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7159,6 +7541,7 @@
 8.0xf7+8.0x89+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::dmach_asr
 "dmach_asr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7185,6 +7568,7 @@
 8.0xf7+8.0x99+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::dmach_asr
 "dmach_asr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7210,6 +7594,7 @@
 8.0xf7+8.0xa9+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::dmach_lsr
 "dmach_lsr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7234,6 +7619,7 @@
 8.0xf7+8.0xb9+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::dmach_lsr
 "dmach_lsr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7258,6 +7644,7 @@
 8.0xf7+8.0xc9+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::dmach_asl
 "dmach_asl"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7282,6 +7669,7 @@
 8.0xf7+8.0xd9+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::dmach_asl
 "dmach_asl"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   signed32 temp, temp2, sum;
@@ -7305,6 +7693,7 @@
 8.0xf7+8.0x0a+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::xor_add
 "xor_add"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7324,6 +7713,7 @@
 8.0xf7+8.0x1a+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::xor_add
 "xor_add"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7342,6 +7732,7 @@
 8.0xf7+8.0x2a+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::xor_sub
 "xor_sub"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7361,6 +7752,7 @@
 8.0xf7+8.0x3a+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::xor_sub
 "xor_sub"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7379,6 +7771,7 @@
 8.0xf7+8.0x4a+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::xor_cmp
 "xor_cmp"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -7396,6 +7789,7 @@
 8.0xf7+8.0x5a+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::xor_cmp
 "xor_cmp"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -7412,6 +7806,7 @@
 8.0xf7+8.0x6a+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::xor_mov
 "xor_mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7431,6 +7826,7 @@
 8.0xf7+8.0x7a+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::xor_mov
 "xor_mov"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7449,6 +7845,7 @@
 8.0xf7+8.0x8a+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::xor_asr
 "xor_asr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7471,6 +7868,7 @@
 8.0xf7+8.0x9a+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::xor_asr
 "xor_asr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7492,6 +7890,7 @@
 8.0xf7+8.0xaa+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::xor_lsr
 "xor_lsr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7511,6 +7910,7 @@
 8.0xf7+8.0xba+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::xor_lsr
 "xor_lsr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7530,6 +7930,7 @@
 8.0xf7+8.0xca+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::xor_asl
 "xor_asl"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7549,6 +7950,7 @@
 8.0xf7+8.0xda+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::xor_asl
 "xor_asl"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7567,6 +7969,7 @@
 8.0xf7+8.0x0b+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::swhw_add
 "swhw_add"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7586,6 +7989,7 @@
 8.0xf7+8.0x1b+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::swhw_add
 "swhw_add"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7605,6 +8009,7 @@
 8.0xf7+8.0x2b+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::swhw_sub
 "swhw_sub"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7625,6 +8030,7 @@
 8.0xf7+8.0x3b+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::swhw_sub
 "swhw_sub"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7644,6 +8050,7 @@
 8.0xf7+8.0x4b+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::swhw_cmp
 "swhw_cmp"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -7662,6 +8069,7 @@
 8.0xf7+8.0x5b+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::swhw_cmp
 "swhw_cmp"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -7679,6 +8087,7 @@
 8.0xf7+8.0x6b+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::swhw_mov
 "swhw_mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7699,6 +8108,7 @@
 8.0xf7+8.0x7b+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::swhw_mov
 "swhw_mov"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7718,6 +8128,7 @@
 8.0xf7+8.0x8b+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::swhw_asr
 "swhw_asr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7741,6 +8152,7 @@
 8.0xf7+8.0x9b+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::swhw_asr
 "swhw_asr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7763,6 +8175,7 @@
 8.0xf7+8.0xab+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::swhw_lsr
 "swhw_lsr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7783,6 +8196,7 @@
 8.0xf7+8.0xbb+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::swhw_lsr
 "swhw_lsr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7803,6 +8217,7 @@
 8.0xf7+8.0xcb+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::swhw_asl
 "swhw_asl"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7823,6 +8238,7 @@
 8.0xf7+8.0xdb+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::swhw_asl
 "swhw_asl"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7842,6 +8258,7 @@
 8.0xf7+8.0x0c+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::or_add
 "or_add"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7861,6 +8278,7 @@
 8.0xf7+8.0x1c+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::or_add
 "or_add"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7879,6 +8297,7 @@
 8.0xf7+8.0x2c+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::or_sub
 "or_sub"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7898,6 +8317,7 @@
 8.0xf7+8.0x3c+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::or_sub
 "or_sub"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7916,6 +8336,7 @@
 8.0xf7+8.0x4c+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::or_cmp
 "or_cmp"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -7933,6 +8354,7 @@
 8.0xf7+8.0x5c+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::or_cmp
 "or_cmp"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -7949,6 +8371,7 @@
 8.0xf7+8.0x6c+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::or_mov
 "or_mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -7968,6 +8391,7 @@
 8.0xf7+8.0x7c+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::or_mov
 "or_mov"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -7986,6 +8410,7 @@
 8.0xf7+8.0x8c+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::or_asr
 "or_asr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -8008,6 +8433,7 @@
 8.0xf7+8.0x9c+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::or_asr
 "or_asr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -8029,6 +8455,7 @@
 8.0xf7+8.0xac+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::or_lsr
 "or_lsr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -8048,6 +8475,7 @@
 8.0xf7+8.0xbc+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::or_lsr
 "or_lsr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -8067,6 +8495,7 @@
 8.0xf7+8.0xcc+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::or_asl
 "or_asl"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -8086,6 +8515,7 @@
 8.0xf7+8.0xdc+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::or_asl
 "or_asl"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -8104,6 +8534,7 @@
 8.0xf7+8.0x0d+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sat16_add
 "sat16_add"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -8129,6 +8560,7 @@
 8.0xf7+8.0x1d+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sat16_add
 "sat16_add"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -8153,6 +8585,7 @@
 8.0xf7+8.0x2d+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sat16_sub
 "sat16_sub"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -8178,6 +8611,7 @@
 8.0xf7+8.0x3d+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sat16_sub
 "sat16_sub"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -8202,6 +8636,7 @@
 8.0xf7+8.0x4d+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sat16_cmp
 "sat16_cmp"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
 
@@ -8224,6 +8659,7 @@
 8.0xf7+8.0x5d+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sat16_cmp
 "sat16_cmp"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
 
@@ -8245,6 +8681,7 @@
 8.0xf7+8.0x6d+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sat16_mov
 "sat16_mov"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -8270,6 +8707,7 @@
 8.0xf7+8.0x7d+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sat16_mov
 "sat16_mov"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -8294,6 +8732,7 @@
 8.0xf7+8.0x8d+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sat16_asr
 "sat16_asr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -8322,6 +8761,7 @@
 8.0xf7+8.0x9d+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sat16_asr
 "sat16_asr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -8349,6 +8789,7 @@
 8.0xf7+8.0xad+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sat16_lsr
 "sat16_lsr"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -8374,6 +8815,7 @@
 8.0xf7+8.0xbd+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sat16_lsr
 "sat16_lsr"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -8399,6 +8841,7 @@
 8.0xf7+8.0xcd+4.RM1,4.RN1+4.RM2,4.RN2!RN1:D2:::sat16_asl
 "sat16_asl"
 *am33
+*am33_2
 {
   int srcreg1, srcreg2, dstreg1, dstreg2;
   int result1;
@@ -8424,6 +8867,7 @@
 8.0xf7+8.0xdd+4.RM1,4.RN1+4.IMM4,4.RN2!RN1:D2b:::sat16_asl
 "sat16_asl"
 *am33
+*am33_2
 {
   int srcreg1, dstreg1, dstreg2;
   int result1;
@@ -8448,6 +8892,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0x0:D2:::mov_llt
 "mov_llt"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8469,6 +8914,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0x1:D2:::mov_lgt
 "mov_lgt"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8491,6 +8937,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0x2:D2:::mov_lge
 "mov_lge"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8512,6 +8959,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0x3:D2:::mov_lle
 "mov_lle"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8534,6 +8982,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0x4:D2:::mov_lcs
 "mov_lcs"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8555,6 +9004,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0x5:D2:::mov_lhi
 "mov_lhi"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8576,6 +9026,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0x6:D2:::mov_lcc
 "mov_lcc"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8597,6 +9048,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0x7:D2:::mov_lls
 "mov_lls"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8618,6 +9070,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0x8:D2:::mov_leq
 "mov_leq"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8639,6 +9092,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0x9:D2:::mov_lne
 "mov_lne"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8660,6 +9114,7 @@
 8.0xf7+8.0xe0+4.RN,4.RM!RN+4.IMM4,4.0xa:D2:::mov_lra
 "mov_lra"
 *am33
+*am33_2
 {
   int srcreg, dstreg;
 
@@ -8674,3 +9129,4 @@
   nia = PC;
 }
 
+:include::am33_2:am33-2.igen
diff --git a/sim/mn10300/configure.in b/sim/mn10300/configure.in
index 8160609..aa6e3b1 100644
--- a/sim/mn10300/configure.in
+++ b/sim/mn10300/configure.in
@@ -18,20 +18,4 @@
 AC_CHECK_FUNCS(time chmod utime fork execve execv chown)
 AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h utime.h time.h)
 
-#
-# Enable common
-#
-AC_ARG_ENABLE(sim-common,
-[  --enable-sim-common			Enable common simulator],
-[case "${enableval}" in
-  yes) sim_gen="-DWITH_COMMON=1"; mn10300_common="WITH";;
-  no)  sim_gen="-DWITH_COMMON=0"; mn10300_common="WITHOUT";;
-  *)   AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-common"); sim_gen="";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_gen" != x""; then
-  echo "Setting sim_common = $sim_common" 6>&1
-fi],[sim_gen="-DWITH_COMMON=1"; mn10300_common="WITH"])dnl
-AC_SUBST(sim_gen)
-AC_SUBST(mn10300_common)
-
 SIM_AC_OUTPUT
diff --git a/sim/mn10300/gencode.c b/sim/mn10300/gencode.c
deleted file mode 100644
index bef312c..0000000
--- a/sim/mn10300/gencode.c
+++ /dev/null
@@ -1,163 +0,0 @@
-#include "mn10300_sim.h"
-
-static void write_header PARAMS ((void));
-static void write_opcodes PARAMS ((void));
-static void write_template PARAMS ((void));
-
-long Opcodes[512];
-static int curop=0;
-
-int
-main (argc, argv)
-     int argc;
-     char *argv[];
-{
-  if ((argc > 1) && (strcmp (argv[1], "-h") == 0))
-    write_header();
-  else if ((argc > 1) && (strcmp (argv[1], "-t") == 0))
-    write_template ();
-  else
-    write_opcodes();
-  return 0;
-}
-
-
-static void
-write_header ()
-{
-  struct mn10300_opcode *opcode;
-
-  for (opcode = (struct mn10300_opcode *)mn10300_opcodes; opcode->name; opcode++)
-    printf("void OP_%X PARAMS ((unsigned long, unsigned long));\t\t/* %s */\n",
-	   opcode->opcode, opcode->name);
-}
-
-
-/* write_template creates a file all required functions, ready */
-/* to be filled out */
-
-static void
-write_template ()
-{
-  struct mn10300_opcode *opcode;
-  int i,j;
-
-  printf ("#include \"mn10300_sim.h\"\n");
-  printf ("#include \"simops.h\"\n");
-
-  for (opcode = (struct mn10300_opcode *)mn10300_opcodes; opcode->name; opcode++)
-    {
-      printf("/* %s */\nvoid\nOP_%X (insn, extension)\n     unsigned long insn, extension;\n{\n", opcode->name, opcode->opcode);
-	  
-      /* count operands */
-      j = 0;
-      for (i = 0; i < 6; i++)
-	{
-	  int flags = mn10300_operands[opcode->operands[i]].flags;
-
-	  if (flags)
-	    j++;
-	}
-      switch (j)
-	{
-	case 0:
-	  printf ("printf(\"   %s\\n\");\n", opcode->name);
-	  break;
-	case 1:
-	  printf ("printf(\"   %s\\t%%x\\n\", OP[0]);\n", opcode->name);
-	  break;
-	case 2:
-	  printf ("printf(\"   %s\\t%%x,%%x\\n\",OP[0],OP[1]);\n",
-		  opcode->name);
-	  break;
-	case 3:
-	  printf ("printf(\"   %s\\t%%x,%%x,%%x\\n\",OP[0],OP[1],OP[2]);\n",
-		  opcode->name);
-	  break;
-	default:
-	  fprintf (stderr,"Too many operands: %d\n", j);
-	}
-      printf ("}\n\n");
-    }
-}
-
-static void
-write_opcodes ()
-{
-  struct mn10300_opcode *opcode;
-  int i, j;
-  int numops;
-  
-  /* write out opcode table */
-  printf ("#include \"mn10300_sim.h\"\n");
-  printf ("#include \"simops.h\"\n\n");
-  printf ("struct simops Simops[] = {\n");
-  
-  for (opcode = (struct mn10300_opcode *)mn10300_opcodes; opcode->name; opcode++)
-    {
-      int size;
-
-      if (opcode->format == FMT_S0)
-	size = 1;
-      else if (opcode->format == FMT_S1
-               || opcode->format == FMT_D0)
-	size = 2;
-      else if (opcode->format == FMT_S2
-               || opcode->format == FMT_D1)
-	size = 3;
-      else if (opcode->format == FMT_S4)
-	size = 5;
-      else if (opcode->format == FMT_D2)
-	size = 4;
-      else if (opcode->format == FMT_D4)
-	size = 6;
-      else
-	size = 7;
-
-      printf ("  { 0x%x,0x%x,OP_%X,%d,%d,",
-	      opcode->opcode, opcode->mask, opcode->opcode,
-	      size, opcode->format);
-      
-      Opcodes[curop++] = opcode->opcode;
-
-      /* count operands */
-      j = 0;
-      for (i = 0; i < 6; i++)
-	{
-	  int flags = mn10300_operands[opcode->operands[i]].flags;
-
-	  if (flags)
-	    j++;
-	}
-      printf ("%d,{",j);
-	  
-      j = 0;
-      numops = 0;
-      for (i = 0; i < 6; i++)
-	{
-	  int flags = mn10300_operands[opcode->operands[i]].flags;
-	  int shift = mn10300_operands[opcode->operands[i]].shift;
-
-	  if (flags)
-	    {
-	      if (j)
-		printf (", ");
-	      printf ("%d,%d,%d", shift,
-		      mn10300_operands[opcode->operands[i]].bits,flags);
-	      j = 1;
-	      numops++;
-	    }
-	}
-
-      switch (numops)
-	{
-	case 0:
-	  printf ("0,0,0");
-	case 1:
-	  printf (",0,0,0");
-	}
-
-      printf ("}},\n");
-    }
-  printf ("{ 0,0,NULL,0,0,0,{0,0,0,0,0,0}},\n};\n");
-}
diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c
index fd93b6d..6beac48 100644
--- a/sim/mn10300/interp.c
+++ b/sim/mn10300/interp.c
@@ -1,12 +1,8 @@
 #include <signal.h>
 
-#if WITH_COMMON
 #include "sim-main.h"
 #include "sim-options.h"
 #include "sim-hw.h"
-#else
-#include "mn10300_sim.h"
-#endif
 
 #include "sysdep.h"
 #include "bfd.h"
@@ -51,12 +47,11 @@
 };
 
 static SIM_RC
-mn10300_option_handler (sd, cpu, opt, arg, is_command)
-     SIM_DESC sd;
-     sim_cpu *cpu;
-     int opt;
-     char *arg;
-     int is_command;
+mn10300_option_handler (SIM_DESC sd,
+			sim_cpu *cpu,
+			int opt,
+			char *arg,
+			int is_command)
 {
   int cpu_nr;
   switch (opt)
@@ -86,868 +81,16 @@
   { {NULL, no_argument, NULL, 0}, '\0', NULL, NULL, NULL }
 };
 
-#if WITH_COMMON
-#else
-static void dispatch PARAMS ((uint32, uint32, int));
-static long hash PARAMS ((long));
-static void init_system PARAMS ((void));
-
-static SIM_OPEN_KIND sim_kind;
-static char *myname;
-#define MAX_HASH  127
-
-struct hash_entry
-{
-  struct hash_entry *next;
-  long opcode;
-  long mask;
-  struct simops *ops;
-#ifdef HASH_STAT
-  unsigned long count;
-#endif
-};
-
-static int max_mem = 0;
-struct hash_entry hash_table[MAX_HASH+1];
-
-
-/* This probably doesn't do a very good job at bucket filling, but
-   it's simple... */
-static INLINE long 
-hash(insn)
-     long insn;
-{
-  /* These are one byte insns, we special case these since, in theory,
-     they should be the most heavily used.  */
-  if ((insn & 0xffffff00) == 0)
-    {
-      switch (insn & 0xf0)
-	{
-	  case 0x00:
-	    return 0x70;
-
-	  case 0x40:
-	    return 0x71;
-
-	  case 0x10:
-	    return 0x72;
-
-	  case 0x30:
-	    return 0x73;
-
-	  case 0x50:
-	    return 0x74;
-
-	  case 0x60:
-	    return 0x75;
-
-	  case 0x70:
-	    return 0x76;
-
-	  case 0x80:
-	    return 0x77;
-
-	  case 0x90:
-	    return 0x78;
-
-	  case 0xa0:
-	    return 0x79;
-
-	  case 0xb0:
-	    return 0x7a;
-
-	  case 0xe0:
-	    return 0x7b;
-
-	  default:
-	    return 0x7c;
-	}
-    }
-
-  /* These are two byte insns */
-  if ((insn & 0xffff0000) == 0)
-    {
-      if ((insn & 0xf000) == 0x2000
-	  || (insn & 0xf000) == 0x5000)
-	return ((insn & 0xfc00) >> 8) & 0x7f;
-
-      if ((insn & 0xf000) == 0x4000)
-	return ((insn & 0xf300) >> 8) & 0x7f;
-
-      if ((insn & 0xf000) == 0x8000
-	  || (insn & 0xf000) == 0x9000
-	  || (insn & 0xf000) == 0xa000
-	  || (insn & 0xf000) == 0xb000)
-	return ((insn & 0xf000) >> 8) & 0x7f;
-
-      if ((insn & 0xff00) == 0xf000
-	  || (insn & 0xff00) == 0xf100
-	  || (insn & 0xff00) == 0xf200
-	  || (insn & 0xff00) == 0xf500
-	  || (insn & 0xff00) == 0xf600)
-	return ((insn & 0xfff0) >> 4) & 0x7f;
- 
-      if ((insn & 0xf000) == 0xc000)
-	return ((insn & 0xff00) >> 8) & 0x7f;
-
-      return ((insn & 0xffc0) >> 6) & 0x7f;
-    }
-
-  /* These are three byte insns.  */
-  if ((insn & 0xff000000) == 0)
-    {
-      if ((insn & 0xf00000) == 0x000000)
-	return ((insn & 0xf30000) >> 16) & 0x7f;
-
-      if ((insn & 0xf00000) == 0x200000
-	  || (insn & 0xf00000) == 0x300000)
-	return ((insn & 0xfc0000) >> 16) & 0x7f;
-
-      if ((insn & 0xff0000) == 0xf80000)
-	return ((insn & 0xfff000) >> 12) & 0x7f;
-
-      if ((insn & 0xff0000) == 0xf90000)
-	return ((insn & 0xfffc00) >> 10) & 0x7f;
-
-      return ((insn & 0xff0000) >> 16) & 0x7f;
-    }
-
-  /* These are four byte or larger insns.  */
-  if ((insn & 0xf0000000) == 0xf0000000)
-    return ((insn & 0xfff00000) >> 20) & 0x7f;
-
-  return ((insn & 0xff000000) >> 24) & 0x7f;
-}
-
-static INLINE void
-dispatch (insn, extension, length)
-     uint32 insn;
-     uint32 extension;
-     int length;
-{
-  struct hash_entry *h;
-
-  h = &hash_table[hash(insn)];
-
-  while ((insn & h->mask) != h->opcode
-	  || (length != h->ops->length))
-    {
-      if (!h->next)
-	{
-	  (*mn10300_callback->printf_filtered) (mn10300_callback,
-	    "ERROR looking up hash for 0x%x, PC=0x%x\n", insn, PC);
-	  exit(1);
-	}
-      h = h->next;
-    }
-
-
-#ifdef HASH_STAT
-  h->count++;
-#endif
-
-  /* Now call the right function.  */
-  (h->ops->func)(insn, extension);
-  PC += length;
-}
-
-void
-sim_size (power)
-     int power;
-
-{
-  if (State.mem)
-    free (State.mem);
-
-  max_mem = 1 << power;
-  State.mem = (uint8 *) calloc (1,  1 << power);
-  if (!State.mem)
-    {
-      (*mn10300_callback->printf_filtered) (mn10300_callback, "Allocation of main memory failed.\n");
-      exit (1);
-    }
-}
-
-static void
-init_system ()
-{
-  if (!State.mem)
-    sim_size(19);
-}
-
-int
-sim_write (sd, addr, buffer, size)
-     SIM_DESC sd;
-     SIM_ADDR addr;
-     unsigned char *buffer;
-     int size;
-{
-  int i;
-
-  init_system ();
-
-  for (i = 0; i < size; i++)
-    store_byte (addr + i, buffer[i]);
-
-  return size;
-}
-
-/* Compare two opcode table entries for qsort.  */
-static int
-compare_simops (arg1, arg2)
-     const PTR arg1;
-     const PTR arg2;
-{
-  unsigned long code1 = ((struct simops *)arg1)->opcode;
-  unsigned long code2 = ((struct simops *)arg2)->opcode;
-
-  if (code1 < code2)
-    return -1;
-  if (code2 < code1)
-    return 1;
-  return 0;
-}
-
-SIM_DESC
-sim_open (kind, cb, abfd, argv)
-     SIM_OPEN_KIND kind;
-     host_callback *cb;
-     struct bfd *abfd;
-     char **argv;
-{
-  struct simops *s;
-  struct hash_entry *h;
-  char **p;
-  int i;
-
-  mn10300_callback = cb;
-
-  /* Sort the opcode array from smallest opcode to largest.
-     This will generally improve simulator performance as the smaller
-     opcodes are generally preferred to the larger opcodes.  */
-  for (i = 0, s = Simops; s->func; s++, i++)
-    ;
-  qsort (Simops, i, sizeof (Simops[0]), compare_simops);
-
-  sim_kind = kind;
-  myname = argv[0];
-
-  for (p = argv + 1; *p; ++p)
-    {
-      if (strcmp (*p, "-E") == 0)
-	++p; /* ignore endian spec */
-      else
-#ifdef DEBUG
-      if (strcmp (*p, "-t") == 0)
-	mn10300_debug = DEBUG;
-      else
-#endif
-	(*mn10300_callback->printf_filtered) (mn10300_callback, "ERROR: unsupported option(s): %s\n",*p);
-    }
-
- /* put all the opcodes in the hash table */
-  for (s = Simops; s->func; s++)
-    {
-      h = &hash_table[hash(s->opcode)];
-
-      /* go to the last entry in the chain */
-      while (h->next)
-	{
-	  /* Don't insert the same opcode more than once.  */
-	  if (h->opcode == s->opcode
-	      && h->mask == s->mask
-	      && h->ops == s)
-	    break;
-	  else
-	    h = h->next;
-	}
-
-      /* Don't insert the same opcode more than once.  */
-      if (h->opcode == s->opcode
-	  && h->mask == s->mask
-	  && h->ops == s)
-	continue;
-
-      if (h->ops)
-	{
-	  h->next = calloc(1,sizeof(struct hash_entry));
-	  h = h->next;
-	}
-      h->ops = s;
-      h->mask = s->mask;
-      h->opcode = s->opcode;
-#if HASH_STAT
-      h->count = 0;
-#endif
-    }
-
-
-  /* fudge our descriptor for now */
-  return (SIM_DESC) 1;
-}
-
-
-void
-sim_close (sd, quitting)
-     SIM_DESC sd;
-     int quitting;
-{
-  /* nothing to do */
-}
-
-void
-sim_set_profile (n)
-     int n;
-{
-  (*mn10300_callback->printf_filtered) (mn10300_callback, "sim_set_profile %d\n", n);
-}
-
-void
-sim_set_profile_size (n)
-     int n;
-{
-  (*mn10300_callback->printf_filtered) (mn10300_callback, "sim_set_profile_size %d\n", n);
-}
-
-int
-sim_stop (sd)
-     SIM_DESC sd;
-{
-  return 0;
-}
-
-void
-sim_resume (sd, step, siggnal)
-     SIM_DESC sd;
-     int step, siggnal;
-{
-  uint32 inst;
-  reg_t oldpc;
-  struct hash_entry *h;
-
-  if (step)
-    State.exception = SIGTRAP;
-  else
-    State.exception = 0;
-
-  State.exited = 0;
-
-  do
-    {
-      unsigned long insn, extension;
-
-      /* Fetch the current instruction.  */
-      inst = load_mem_big (PC, 2);
-      oldpc = PC;
-
-      /* Using a giant case statement may seem like a waste because of the
- 	code/rodata size the table itself will consume.  However, using
- 	a giant case statement speeds up the simulator by 10-15% by avoiding
- 	cascading if/else statements or cascading case statements.  */
-
-      switch ((inst >> 8) & 0xff)
-	{
-	  /* All the single byte insns except 0x80, 0x90, 0xa0, 0xb0
-	     which must be handled specially.  */
-	  case 0x00:
-	  case 0x04:
-	  case 0x08:
-	  case 0x0c:
-	  case 0x10:
-	  case 0x11:
-	  case 0x12:
-	  case 0x13:
-	  case 0x14:
-	  case 0x15:
-	  case 0x16:
-	  case 0x17:
-	  case 0x18:
-	  case 0x19:
-	  case 0x1a:
-	  case 0x1b:
-	  case 0x1c:
-	  case 0x1d:
-	  case 0x1e:
-	  case 0x1f:
-	  case 0x3c:
-	  case 0x3d:
-	  case 0x3e:
-	  case 0x3f:
-	  case 0x40:
-	  case 0x41:
-	  case 0x44:
-	  case 0x45:
-	  case 0x48:
-	  case 0x49:
-	  case 0x4c:
-	  case 0x4d:
-	  case 0x50:
-	  case 0x51:
-	  case 0x52:
-	  case 0x53:
-	  case 0x54:
-	  case 0x55:
-	  case 0x56:
-	  case 0x57:
-	  case 0x60:
-	  case 0x61:
-	  case 0x62:
-	  case 0x63:
-	  case 0x64:
-	  case 0x65:
-	  case 0x66:
-	  case 0x67:
-	  case 0x68:
-	  case 0x69:
-	  case 0x6a:
-	  case 0x6b:
-	  case 0x6c:
-	  case 0x6d:
-	  case 0x6e:
-	  case 0x6f:
-	  case 0x70:
-	  case 0x71:
-	  case 0x72:
-	  case 0x73:
-	  case 0x74:
-	  case 0x75:
-	  case 0x76:
-	  case 0x77:
-	  case 0x78:
-	  case 0x79:
-	  case 0x7a:
-	  case 0x7b:
-	  case 0x7c:
-	  case 0x7d:
-	  case 0x7e:
-	  case 0x7f:
-	  case 0xcb:
-	  case 0xd0:
-	  case 0xd1:
-	  case 0xd2:
-	  case 0xd3:
-	  case 0xd4:
-	  case 0xd5:
-	  case 0xd6:
-	  case 0xd7:
-	  case 0xd8:
-	  case 0xd9:
-	  case 0xda:
-	  case 0xdb:
-	  case 0xe0:
-	  case 0xe1:
-	  case 0xe2:
-	  case 0xe3:
-	  case 0xe4:
-	  case 0xe5:
-	  case 0xe6:
-	  case 0xe7:
-	  case 0xe8:
-	  case 0xe9:
-	  case 0xea:
-	  case 0xeb:
-	  case 0xec:
-	  case 0xed:
-	  case 0xee:
-	  case 0xef:
-	  case 0xff:
-	    insn = (inst >> 8) & 0xff;
-	    extension = 0;
-	    dispatch (insn, extension, 1);
-	    break;
-
-	  /* Special cases where dm == dn is used to encode a different
-	     instruction.  */
-	  case 0x80:
-	  case 0x85:
-	  case 0x8a:
-	  case 0x8f:
-	  case 0x90:
-	  case 0x95:
-	  case 0x9a:
-	  case 0x9f:
-	  case 0xa0:
-	  case 0xa5:
-	  case 0xaa:
-	  case 0xaf:
-	  case 0xb0:
-	  case 0xb5:
-	  case 0xba:
-	  case 0xbf:
-	    insn = inst;
-	    extension = 0;
-	    dispatch (insn, extension, 2);
-	    break;
-
-	  case 0x81:
-	  case 0x82:
-	  case 0x83:
-	  case 0x84:
-	  case 0x86:
-	  case 0x87:
-	  case 0x88:
-	  case 0x89:
-	  case 0x8b:
-	  case 0x8c:
-	  case 0x8d:
-	  case 0x8e:
-	  case 0x91:
-	  case 0x92:
-	  case 0x93:
-	  case 0x94:
-	  case 0x96:
-	  case 0x97:
-	  case 0x98:
-	  case 0x99:
-	  case 0x9b:
-	  case 0x9c:
-	  case 0x9d:
-	  case 0x9e:
-	  case 0xa1:
-	  case 0xa2:
-	  case 0xa3:
-	  case 0xa4:
-	  case 0xa6:
-	  case 0xa7:
-	  case 0xa8:
-	  case 0xa9:
-	  case 0xab:
-	  case 0xac:
-	  case 0xad:
-	  case 0xae:
-	  case 0xb1:
-	  case 0xb2:
-	  case 0xb3:
-	  case 0xb4:
-	  case 0xb6:
-	  case 0xb7:
-	  case 0xb8:
-	  case 0xb9:
-	  case 0xbb:
-	  case 0xbc:
-	  case 0xbd:
-	  case 0xbe:
-	    insn = (inst >> 8) & 0xff;
-	    extension = 0;
-	  dispatch (insn, extension, 1);
-	  break;
-
-	  /* The two byte instructions.  */
-	  case 0x20:
-	  case 0x21:
-	  case 0x22:
-	  case 0x23:
-	  case 0x28:
-	  case 0x29:
-	  case 0x2a:
-	  case 0x2b:
-	  case 0x42:
-	  case 0x43:
-	  case 0x46:
-	  case 0x47:
-	  case 0x4a:
-	  case 0x4b:
-	  case 0x4e:
-	  case 0x4f:
-	  case 0x58:
-	  case 0x59:
-	  case 0x5a:
-	  case 0x5b:
-	  case 0x5c:
-	  case 0x5d:
-	  case 0x5e:
-	  case 0x5f:
-	  case 0xc0:
-	  case 0xc1:
-	  case 0xc2:
-	  case 0xc3:
-	  case 0xc4:
-	  case 0xc5:
-	  case 0xc6:
-	  case 0xc7:
-	  case 0xc8:
-	  case 0xc9:
-	  case 0xca:
-	  case 0xce:
-	  case 0xcf:
-	  case 0xf0:
-	  case 0xf1:
-	  case 0xf2:
-	  case 0xf3:
-	  case 0xf4:
-	  case 0xf5:
-	  case 0xf6:
-	    insn = inst;
-	    extension = 0;
-	    dispatch (insn, extension, 2);
-	    break;
-
-	  /* The three byte insns with a 16bit operand in little endian
-	     format.  */
-	  case 0x01:
-	  case 0x02:
-	  case 0x03:
-	  case 0x05:
-	  case 0x06:
-	  case 0x07:
-	  case 0x09:
-	  case 0x0a:
-	  case 0x0b:
-	  case 0x0d:
-	  case 0x0e:
-	  case 0x0f:
-	  case 0x24:
-	  case 0x25:
-	  case 0x26:
-	  case 0x27:
-	  case 0x2c:
-	  case 0x2d:
-	  case 0x2e:
-	  case 0x2f:
-	  case 0x30:
-	  case 0x31:
-	  case 0x32:
-	  case 0x33:
-	  case 0x34:
-	  case 0x35:
-	  case 0x36:
-	  case 0x37:
-	  case 0x38:
-	  case 0x39:
-	  case 0x3a:
-	  case 0x3b:
-	  case 0xcc:
-	    insn = load_byte (PC);
-	    insn <<= 16;
-	    insn |= load_half (PC + 1);
-	    extension = 0;
-	    dispatch (insn, extension, 3);
-	    break;
-
-	  /* The three byte insns without 16bit operand.  */
-	  case 0xde:
-	  case 0xdf:
-	  case 0xf8:
-	  case 0xf9:
-	    insn = load_mem_big (PC, 3);
-	    extension = 0;
-	    dispatch (insn, extension, 3);
-	    break;
-	  
-	  /* Four byte insns.  */
-	  case 0xfa:
-	  case 0xfb:
-	    if ((inst & 0xfffc) == 0xfaf0
-		|| (inst & 0xfffc) == 0xfaf4
-		|| (inst & 0xfffc) == 0xfaf8)
-	      insn = load_mem_big (PC, 4);
-	    else
-	      {
-		insn = inst;
-		insn <<= 16;
-		insn |= load_half (PC + 2);
-		extension = 0;
-	      }
-	    dispatch (insn, extension, 4);
-	    break;
-
-	  /* Five byte insns.  */
-	  case 0xcd:
-	    insn = load_byte (PC);
-	    insn <<= 24;
-	    insn |= (load_half (PC + 1) << 8);
-	    insn |= load_byte (PC + 3);
-	    extension = load_byte (PC + 4);
-	    dispatch (insn, extension, 5);
-	    break;
-
-	  case 0xdc:
-	    insn = load_byte (PC);
-	    insn <<= 24;
-	    extension = load_word (PC + 1);
-	    insn |= (extension & 0xffffff00) >> 8;
-	    extension &= 0xff;
-	    dispatch (insn, extension, 5);
-	    break;
-	
-	  /* Six byte insns.  */
-	  case 0xfc:
-	  case 0xfd:
-	    insn = (inst << 16);
-	    extension = load_word (PC + 2);
-	    insn |= ((extension & 0xffff0000) >> 16);
-	    extension &= 0xffff;
-	    dispatch (insn, extension, 6);
-	    break;
-	    
-	  case 0xdd:
-	    insn = load_byte (PC) << 24;
-	    extension = load_word (PC + 1);
-	    insn |= ((extension >> 8) & 0xffffff);
-	    extension = (extension & 0xff) << 16;
-	    extension |= load_byte (PC + 5) << 8;
-	    extension |= load_byte (PC + 6);
-	    dispatch (insn, extension, 7);
-	    break;
-
-	  case 0xfe:
-	    insn = inst << 16;
-	    extension = load_word (PC + 2);
-	    insn |= ((extension >> 16) & 0xffff);
-	    extension <<= 8;
-	    extension &= 0xffff00;
-	    extension |= load_byte (PC + 6);
-	    dispatch (insn, extension, 7);
-	    break;
-
-	  default:
-	    abort ();
-	}
-    }
-  while (!State.exception);
-
-#ifdef HASH_STAT
-  {
-    int i;
-    for (i = 0; i < MAX_HASH; i++)
-      {
-	 struct hash_entry *h;
-	 h = &hash_table[i];
-
-	 printf("hash 0x%x:\n", i);
-
-	 while (h)
-	   {
-	     printf("h->opcode = 0x%x, count = 0x%x\n", h->opcode, h->count);
-	     h = h->next;
-	   }
-
-	 printf("\n\n");
-      }
-    fflush (stdout);
-  }
-#endif
-
-}
-
-int
-sim_trace (sd)
-     SIM_DESC sd;
-{
-#ifdef DEBUG
-  mn10300_debug = DEBUG;
-#endif
-  sim_resume (sd, 0, 0);
-  return 1;
-}
-
-void
-sim_info (sd, verbose)
-     SIM_DESC sd;
-     int verbose;
-{
-  (*mn10300_callback->printf_filtered) (mn10300_callback, "sim_info\n");
-}
-
-SIM_RC
-sim_create_inferior (sd, abfd, argv, env)
-     SIM_DESC sd;
-     struct bfd *abfd;
-     char **argv;
-     char **env;
-{
-  if (abfd != NULL)
-    PC = bfd_get_start_address (abfd);
-  else
-    PC = 0;
-  return SIM_RC_OK;
-}
-
-void
-sim_set_callbacks (p)
-     host_callback *p;
-{
-  mn10300_callback = p;
-}
-
-/* All the code for exiting, signals, etc needs to be revamped.
-
-   This is enough to get c-torture limping though.  */
-
-void
-sim_stop_reason (sd, reason, sigrc)
-     SIM_DESC sd;
-     enum sim_stop *reason;
-     int *sigrc;
-{
-  if (State.exited)
-    *reason = sim_exited;
-  else
-    *reason = sim_stopped;
-
-  if (State.exception == SIGQUIT)
-    *sigrc = 0;
-  else
-    *sigrc = State.exception;
-}
-
-int
-sim_read (sd, addr, buffer, size)
-     SIM_DESC sd;
-     SIM_ADDR addr;
-     unsigned char *buffer;
-     int size;
-{
-  int i;
-  for (i = 0; i < size; i++)
-    buffer[i] = load_byte (addr + i);
-
-  return size;
-} 
-
-void
-sim_do_command (sd, cmd)
-     SIM_DESC sd;
-     char *cmd;
-{
-  (*mn10300_callback->printf_filtered) (mn10300_callback, "\"%s\" is not a valid mn10300 simulator command.\n", cmd);
-}
-
-SIM_RC
-sim_load (sd, prog, abfd, from_tty)
-     SIM_DESC sd;
-     char *prog;
-     bfd *abfd;
-     int from_tty;
-{
-  extern bfd *sim_load_file (); /* ??? Don't know where this should live.  */
-  bfd *prog_bfd;
-
-  prog_bfd = sim_load_file (sd, myname, mn10300_callback, prog, abfd,
-			    sim_kind == SIM_OPEN_DEBUG,
-			    0, sim_write);
-  if (prog_bfd == NULL)
-    return SIM_RC_FAIL;
-  if (abfd == NULL)
-    bfd_close (prog_bfd);
-  return SIM_RC_OK;
-} 
-#endif  /* not WITH_COMMON */
-
-
-#if WITH_COMMON
-
 /* For compatibility */
 SIM_DESC simulator;
 
 /* These default values correspond to expected usage for the chip.  */
 
 SIM_DESC
-sim_open (kind, cb, abfd, argv)
-     SIM_OPEN_KIND kind;
-     host_callback *cb;
-     struct bfd *abfd;
-     char **argv;
+sim_open (SIM_OPEN_KIND kind,
+	  host_callback *cb,
+	  struct bfd *abfd,
+	  char **argv)
 {
   SIM_DESC sd = sim_state_alloc (kind, cb);
   mn10300_callback = cb;
@@ -1159,20 +302,17 @@
 
 
 void
-sim_close (sd, quitting)
-     SIM_DESC sd;
-     int quitting;
+sim_close (SIM_DESC sd, int quitting)
 {
   sim_module_uninstall (sd);
 }
 
 
 SIM_RC
-sim_create_inferior (sd, prog_bfd, argv, env)
-     SIM_DESC sd;
-     struct bfd *prog_bfd;
-     char **argv;
-     char **env;
+sim_create_inferior (SIM_DESC sd,
+		     struct bfd *prog_bfd,
+		     char **argv,
+		     char **env)
 {
   memset (&State, 0, sizeof (State));
   if (prog_bfd != NULL) {
@@ -1182,13 +322,14 @@
   }
   CIA_SET (STATE_CPU (sd, 0), (unsigned64) PC);
 
+  if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2)
+    PSW |= PSW_FE;
+
   return SIM_RC_OK;
 }
 
 void
-sim_do_command (sd, cmd)
-     SIM_DESC sd;
-     char *cmd;
+sim_do_command (SIM_DESC sd, char *cmd)
 {
   char *mm_cmd = "memory-map";
   char *int_cmd = "interrupt";
@@ -1203,47 +344,39 @@
 	sim_io_eprintf (sd, "Unknown command `%s'\n", cmd);
     }
 }
-#endif  /* WITH_COMMON */
 
 /* FIXME These would more efficient to use than load_mem/store_mem,
    but need to be changed to use the memory map.  */
 
 uint8
-get_byte (x)
-     uint8 *x;
+get_byte (uint8 *x)
 {
   return *x;
 }
 
 uint16
-get_half (x)
-     uint8 *x;
+get_half (uint8 *x)
 {
   uint8 *a = x;
   return (a[1] << 8) + (a[0]);
 }
 
 uint32
-get_word (x)
-      uint8 *x;
+get_word (uint8 *x)
 {
   uint8 *a = x;
   return (a[3]<<24) + (a[2]<<16) + (a[1]<<8) + (a[0]);
 }
 
 void
-put_byte (addr, data)
-     uint8 *addr;
-     uint8 data;
+put_byte (uint8 *addr, uint8 data)
 {
   uint8 *a = addr;
   a[0] = data;
 }
 
 void
-put_half (addr, data)
-     uint8 *addr;
-     uint16 data;
+put_half (uint8 *addr, uint16 data)
 {
   uint8 *a = addr;
   a[0] = data & 0xff;
@@ -1251,9 +384,7 @@
 }
 
 void
-put_word (addr, data)
-     uint8 *addr;
-     uint32 data;
+put_word (uint8 *addr, uint32 data)
 {
   uint8 *a = addr;
   a[0] = data & 0xff;
@@ -1263,22 +394,20 @@
 }
 
 int
-sim_fetch_register (sd, rn, memory, length)
-     SIM_DESC sd;
-     int rn;
-     unsigned char *memory;
-     int length;
+sim_fetch_register (SIM_DESC sd,
+		    int rn,
+		    unsigned char *memory,
+		    int length)
 {
   put_word (memory, State.regs[rn]);
   return -1;
 }
  
 int
-sim_store_register (sd, rn, memory, length)
-     SIM_DESC sd;
-     int rn;
-     unsigned char *memory;
-     int length;
+sim_store_register (SIM_DESC sd,
+		    int rn,
+		    unsigned char *memory,
+		    int length)
 {
   State.regs[rn] = get_word (memory);
   return -1;
@@ -1287,13 +416,13 @@
 
 void
 mn10300_core_signal (SIM_DESC sd,
-                 sim_cpu *cpu,
-                 sim_cia cia,
-                 unsigned map,
-                 int nr_bytes,
-                 address_word addr,
-                 transfer_type transfer,
-                 sim_core_signals sig)
+		     sim_cpu *cpu,
+		     sim_cia cia,
+		     unsigned map,
+		     int nr_bytes,
+		     address_word addr,
+		     transfer_type transfer,
+		     sim_core_signals sig)
 {
   const char *copy = (transfer == read_transfer ? "read" : "write");
   address_word ip = CIA_ADDR (cia);
@@ -1420,3 +549,569 @@
     }
   State.exc_suspended = 0; 
 }
+
+/* This is called when an FP instruction is issued when the FP unit is
+   disabled, i.e., the FE bit of PSW is zero.  It raises interrupt
+   code 0x1c0.  */
+void
+fpu_disabled_exception (SIM_DESC sd, sim_cpu *cpu, sim_cia cia)
+{
+  sim_io_eprintf(sd, "FPU disabled exception\n");
+  program_interrupt (sd, cpu, cia, SIM_SIGFPE);
+}
+
+/* This is called when the FP unit is enabled but one of the
+   unimplemented insns is issued.  It raises interrupt code 0x1c8.  */
+void
+fpu_unimp_exception (SIM_DESC sd, sim_cpu *cpu, sim_cia cia)
+{
+  sim_io_eprintf(sd, "Unimplemented FPU instruction exception\n");
+  program_interrupt (sd, cpu, cia, SIM_SIGFPE);
+}
+
+/* This is called at the end of any FP insns that may have triggered
+   FP exceptions.  If no exception is enabled, it returns immediately.
+   Otherwise, it raises an exception code 0x1d0.  */
+void
+fpu_check_signal_exception (SIM_DESC sd, sim_cpu *cpu, sim_cia cia)
+{
+  if ((FPCR & EC_MASK) == 0)
+    return;
+
+  sim_io_eprintf(sd, "FPU %s%s%s%s%s exception\n",
+		 (FPCR & EC_V) ? "V" : "",
+		 (FPCR & EC_Z) ? "Z" : "",
+		 (FPCR & EC_O) ? "O" : "",
+		 (FPCR & EC_U) ? "U" : "",
+		 (FPCR & EC_I) ? "I" : "");
+  program_interrupt (sd, cpu, cia, SIM_SIGFPE);
+}
+
+/* Convert a 32-bit single-precision FP value in the target platform
+   format to a sim_fpu value.  */
+static void
+reg2val_32 (const void *reg, sim_fpu *val)
+{
+  FS2FPU (*(reg_t *)reg, *val);
+}
+
+/* Round the given sim_fpu value to single precision, following the
+   target platform rounding and denormalization conventions.  On
+   AM33/2.0, round_near is the only rounding mode.  */
+static int
+round_32 (sim_fpu *val)
+{
+  return sim_fpu_round_32 (val, sim_fpu_round_near, sim_fpu_denorm_zero);
+}
+
+/* Convert a sim_fpu value to the 32-bit single-precision target
+   representation.  */
+static void
+val2reg_32 (const sim_fpu *val, void *reg)
+{
+  FPU2FS (*val, *(reg_t *)reg);
+}
+
+/* Define the 32-bit single-precision conversion and rounding uniform
+   interface.  */
+const struct fp_prec_t
+fp_single_prec = {
+  reg2val_32, round_32, val2reg_32
+};
+
+/* Convert a 64-bit double-precision FP value in the target platform
+   format to a sim_fpu value.  */
+static void
+reg2val_64 (const void *reg, sim_fpu *val)
+{
+  FD2FPU (*(dword *)reg, *val);
+}
+
+/* Round the given sim_fpu value to double precision, following the
+   target platform rounding and denormalization conventions.  On
+   AM33/2.0, round_near is the only rounding mode.  */
+int
+round_64 (sim_fpu *val)
+{
+  return sim_fpu_round_64 (val, sim_fpu_round_near, sim_fpu_denorm_zero);
+}
+
+/* Convert a sim_fpu value to the 64-bit double-precision target
+   representation.  */
+static void
+val2reg_64 (const sim_fpu *val, void *reg)
+{
+  FPU2FD (*val, *(dword *)reg);
+}
+
+/* Define the 64-bit single-precision conversion and rounding uniform
+   interface.  */
+const struct fp_prec_t
+fp_double_prec = {
+  reg2val_64, round_64, val2reg_64
+};
+
+/* Define shortcuts to the uniform interface operations.  */
+#define REG2VAL(reg,val) (*ops->reg2val) (reg,val)
+#define ROUND(val) (*ops->round) (val)
+#define VAL2REG(val,reg) (*ops->val2reg) (val,reg)
+
+/* Check whether overflow, underflow or inexact exceptions should be
+   raised.  */
+int
+fpu_status_ok (sim_fpu_status stat)
+{
+  if ((stat & sim_fpu_status_overflow)
+      && (FPCR & EE_O))
+    FPCR |= EC_O;
+  else if ((stat & (sim_fpu_status_underflow | sim_fpu_status_denorm))
+	   && (FPCR & EE_U))
+    FPCR |= EC_U;
+  else if ((stat & (sim_fpu_status_inexact | sim_fpu_status_rounded))
+	   && (FPCR & EE_I))
+    FPCR |= EC_I;
+  else if (stat & ~ (sim_fpu_status_overflow
+		     | sim_fpu_status_underflow
+		     | sim_fpu_status_denorm
+		     | sim_fpu_status_inexact
+		     | sim_fpu_status_rounded))
+    abort ();
+  else
+    return 1;
+  return 0;
+}
+
+/* Implement a 32/64 bit reciprocal square root, signaling FP
+   exceptions when appropriate.  */
+void
+fpu_rsqrt (SIM_DESC sd, sim_cpu *cpu, sim_cia cia,
+	   const void *reg_in, void *reg_out, const struct fp_prec_t *ops)
+{
+  sim_fpu in, med, out;
+
+  REG2VAL (reg_in, &in);
+  ROUND (&in);
+  FPCR &= ~ EC_MASK;
+  switch (sim_fpu_is (&in))
+    {
+    case SIM_FPU_IS_SNAN:
+    case SIM_FPU_IS_NNUMBER:
+    case SIM_FPU_IS_NINF:
+      if (FPCR & EE_V)
+	FPCR |= EC_V;
+      else
+	VAL2REG (&sim_fpu_qnan, reg_out);
+      break;
+	    
+    case SIM_FPU_IS_QNAN:
+      VAL2REG (&sim_fpu_qnan, reg_out);
+      break;
+
+    case SIM_FPU_IS_PINF:
+      VAL2REG (&sim_fpu_zero, reg_out);
+      break;
+
+    case SIM_FPU_IS_PNUMBER:
+      {
+	/* Since we don't have a function to compute rsqrt directly,
+	   use sqrt and inv.  */
+	sim_fpu_status stat = 0;
+	stat |= sim_fpu_sqrt (&med, &in);
+	stat |= sim_fpu_inv (&out, &med);
+	stat |= ROUND (&out);
+	if (fpu_status_ok (stat))
+	  VAL2REG (&out, reg_out);
+      }
+      break;
+
+    case SIM_FPU_IS_NZERO:
+    case SIM_FPU_IS_PZERO:
+      if (FPCR & EE_Z)
+	FPCR |= EC_Z;
+      else
+	{
+	  /* Generate an INF with the same sign.  */
+	  sim_fpu_inv (&out, &in);
+	  VAL2REG (&out, reg_out);
+	}
+      break;
+
+    default:
+      abort ();
+    }
+
+  fpu_check_signal_exception (sd, cpu, cia);
+}
+
+static inline reg_t
+cmp2fcc (int res)
+{
+  switch (res)
+    {
+    case SIM_FPU_IS_SNAN:
+    case SIM_FPU_IS_QNAN:
+      return FCC_U;
+      
+    case SIM_FPU_IS_NINF:
+    case SIM_FPU_IS_NNUMBER:
+    case SIM_FPU_IS_NDENORM:
+      return FCC_L;
+      
+    case SIM_FPU_IS_PINF:
+    case SIM_FPU_IS_PNUMBER:
+    case SIM_FPU_IS_PDENORM:
+      return FCC_G;
+      
+    case SIM_FPU_IS_NZERO:
+    case SIM_FPU_IS_PZERO:
+      return FCC_E;
+      
+    default:
+      abort ();
+    }
+}
+
+/* Implement a 32/64 bit FP compare, setting the FPCR status and/or
+   exception bits as specified.  */
+void
+fpu_cmp (SIM_DESC sd, sim_cpu *cpu, sim_cia cia,
+	 const void *reg_in1, const void *reg_in2,
+	 const struct fp_prec_t *ops)
+{
+  sim_fpu m, n;
+
+  REG2VAL (reg_in1, &m);
+  REG2VAL (reg_in2, &n);
+  FPCR &= ~ EC_MASK;
+  FPCR &= ~ FCC_MASK;
+  ROUND (&m);
+  ROUND (&n);
+  if (sim_fpu_is_snan (&m) || sim_fpu_is_snan (&n))
+    {
+      if (FPCR & EE_V)
+	FPCR |= EC_V;
+      else
+	FPCR |= FCC_U;
+    }
+  else
+    FPCR |= cmp2fcc (sim_fpu_cmp (&m, &n));
+
+  fpu_check_signal_exception (sd, cpu, cia);
+}
+
+/* Implement a 32/64 bit FP add, setting FP exception bits when
+   appropriate.  */
+void
+fpu_add (SIM_DESC sd, sim_cpu *cpu, sim_cia cia,
+	 const void *reg_in1, const void *reg_in2,
+	 void *reg_out, const struct fp_prec_t *ops)
+{
+  sim_fpu m, n, r;
+
+  REG2VAL (reg_in1, &m);
+  REG2VAL (reg_in2, &n);
+  ROUND (&m);
+  ROUND (&n);
+  FPCR &= ~ EC_MASK;
+  if (sim_fpu_is_snan (&m) || sim_fpu_is_snan (&n)
+      || (sim_fpu_is (&m) == SIM_FPU_IS_PINF
+	  && sim_fpu_is (&n) == SIM_FPU_IS_NINF)
+      || (sim_fpu_is (&m) == SIM_FPU_IS_NINF
+	  && sim_fpu_is (&n) == SIM_FPU_IS_PINF))
+    {
+      if (FPCR & EE_V)
+	FPCR |= EC_V;
+      else
+	VAL2REG (&sim_fpu_qnan, reg_out);
+    }
+  else
+    {
+      sim_fpu_status stat = sim_fpu_add (&r, &m, &n);
+      stat |= ROUND (&r);
+      if (fpu_status_ok (stat))
+	VAL2REG (&r, reg_out);
+    }
+  
+  fpu_check_signal_exception (sd, cpu, cia);
+}
+
+/* Implement a 32/64 bit FP sub, setting FP exception bits when
+   appropriate.  */
+void
+fpu_sub (SIM_DESC sd, sim_cpu *cpu, sim_cia cia,
+	 const void *reg_in1, const void *reg_in2,
+	 void *reg_out, const struct fp_prec_t *ops)
+{
+  sim_fpu m, n, r;
+
+  REG2VAL (reg_in1, &m);
+  REG2VAL (reg_in2, &n);
+  ROUND (&m);
+  ROUND (&n);
+  FPCR &= ~ EC_MASK;
+  if (sim_fpu_is_snan (&m) || sim_fpu_is_snan (&n)
+      || (sim_fpu_is (&m) == SIM_FPU_IS_PINF
+	  && sim_fpu_is (&n) == SIM_FPU_IS_PINF)
+      || (sim_fpu_is (&m) == SIM_FPU_IS_NINF
+	  && sim_fpu_is (&n) == SIM_FPU_IS_NINF))
+    {
+      if (FPCR & EE_V)
+	FPCR |= EC_V;
+      else
+	VAL2REG (&sim_fpu_qnan, reg_out);
+    }
+  else
+    {
+      sim_fpu_status stat = sim_fpu_sub (&r, &m, &n);
+      stat |= ROUND (&r);
+      if (fpu_status_ok (stat))
+	VAL2REG (&r, reg_out);
+    }
+  
+  fpu_check_signal_exception (sd, cpu, cia);
+}
+
+/* Implement a 32/64 bit FP mul, setting FP exception bits when
+   appropriate.  */
+void
+fpu_mul (SIM_DESC sd, sim_cpu *cpu, sim_cia cia,
+	 const void *reg_in1, const void *reg_in2,
+	 void *reg_out, const struct fp_prec_t *ops)
+{
+  sim_fpu m, n, r;
+
+  REG2VAL (reg_in1, &m);
+  REG2VAL (reg_in2, &n);
+  ROUND (&m);
+  ROUND (&n);
+  FPCR &= ~ EC_MASK;
+  if (sim_fpu_is_snan (&m) || sim_fpu_is_snan (&n)
+      || (sim_fpu_is_infinity (&m) && sim_fpu_is_zero (&n))
+      || (sim_fpu_is_zero (&m) && sim_fpu_is_infinity (&n)))
+    {
+      if (FPCR & EE_V)
+	FPCR |= EC_V;
+      else
+	VAL2REG (&sim_fpu_qnan, reg_out);
+    }
+  else
+    {
+      sim_fpu_status stat = sim_fpu_mul (&r, &m, &n);
+      stat |= ROUND (&r);
+      if (fpu_status_ok (stat))
+	VAL2REG (&r, reg_out);
+    }
+  
+  fpu_check_signal_exception (sd, cpu, cia);
+}
+
+/* Implement a 32/64 bit FP div, setting FP exception bits when
+   appropriate.  */
+void
+fpu_div (SIM_DESC sd, sim_cpu *cpu, sim_cia cia,
+	 const void *reg_in1, const void *reg_in2,
+	 void *reg_out, const struct fp_prec_t *ops)
+{
+  sim_fpu m, n, r;
+
+  REG2VAL (reg_in1, &m);
+  REG2VAL (reg_in2, &n);
+  ROUND (&m);
+  ROUND (&n);
+  FPCR &= ~ EC_MASK;
+  if (sim_fpu_is_snan (&m) || sim_fpu_is_snan (&n)
+      || (sim_fpu_is_infinity (&m) && sim_fpu_is_infinity (&n))
+      || (sim_fpu_is_zero (&m) && sim_fpu_is_zero (&n)))
+    {
+      if (FPCR & EE_V)
+	FPCR |= EC_V;
+      else
+	VAL2REG (&sim_fpu_qnan, reg_out);
+    }
+  else if (sim_fpu_is_number (&m) && sim_fpu_is_zero (&n)
+	   && (FPCR & EE_Z))
+    FPCR |= EC_Z;
+  else
+    {
+      sim_fpu_status stat = sim_fpu_div (&r, &m, &n);
+      stat |= ROUND (&r);
+      if (fpu_status_ok (stat))
+	VAL2REG (&r, reg_out);
+    }
+  
+  fpu_check_signal_exception (sd, cpu, cia);
+}
+
+/* Implement a 32/64 bit FP madd, setting FP exception bits when
+   appropriate.  */
+void
+fpu_fmadd (SIM_DESC sd, sim_cpu *cpu, sim_cia cia,
+	   const void *reg_in1, const void *reg_in2, const void *reg_in3,
+	   void *reg_out, const struct fp_prec_t *ops)
+{
+  sim_fpu m1, m2, m, n, r;
+
+  REG2VAL (reg_in1, &m1);
+  REG2VAL (reg_in2, &m2);
+  REG2VAL (reg_in3, &n);
+  ROUND (&m1);
+  ROUND (&m2);
+  ROUND (&n);
+  FPCR &= ~ EC_MASK;
+  if (sim_fpu_is_snan (&m1) || sim_fpu_is_snan (&m2) || sim_fpu_is_snan (&n)
+      || (sim_fpu_is_infinity (&m1) && sim_fpu_is_zero (&m2))
+      || (sim_fpu_is_zero (&m1) && sim_fpu_is_infinity (&m2)))
+    {
+    invalid_operands:
+      if (FPCR & EE_V)
+	FPCR |= EC_V;
+      else
+	VAL2REG (&sim_fpu_qnan, reg_out);
+    }
+  else
+    {
+      sim_fpu_status stat = sim_fpu_mul (&m, &m1, &m2);
+
+      if (sim_fpu_is_infinity (&m) && sim_fpu_is_infinity (&n)
+	  && sim_fpu_sign (&m) != sim_fpu_sign (&n))
+	goto invalid_operands;
+
+      stat |= sim_fpu_add (&r, &m, &n);
+      stat |= ROUND (&r);
+      if (fpu_status_ok (stat))
+	VAL2REG (&r, reg_out);
+    }
+  
+  fpu_check_signal_exception (sd, cpu, cia);
+}
+
+/* Implement a 32/64 bit FP msub, setting FP exception bits when
+   appropriate.  */
+void
+fpu_fmsub (SIM_DESC sd, sim_cpu *cpu, sim_cia cia,
+	   const void *reg_in1, const void *reg_in2, const void *reg_in3,
+	   void *reg_out, const struct fp_prec_t *ops)
+{
+  sim_fpu m1, m2, m, n, r;
+
+  REG2VAL (reg_in1, &m1);
+  REG2VAL (reg_in2, &m2);
+  REG2VAL (reg_in3, &n);
+  ROUND (&m1);
+  ROUND (&m2);
+  ROUND (&n);
+  FPCR &= ~ EC_MASK;
+  if (sim_fpu_is_snan (&m1) || sim_fpu_is_snan (&m2) || sim_fpu_is_snan (&n)
+      || (sim_fpu_is_infinity (&m1) && sim_fpu_is_zero (&m2))
+      || (sim_fpu_is_zero (&m1) && sim_fpu_is_infinity (&m2)))
+    {
+    invalid_operands:
+      if (FPCR & EE_V)
+	FPCR |= EC_V;
+      else
+	VAL2REG (&sim_fpu_qnan, reg_out);
+    }
+  else
+    {
+      sim_fpu_status stat = sim_fpu_mul (&m, &m1, &m2);
+
+      if (sim_fpu_is_infinity (&m) && sim_fpu_is_infinity (&n)
+	  && sim_fpu_sign (&m) == sim_fpu_sign (&n))
+	goto invalid_operands;
+
+      stat |= sim_fpu_sub (&r, &m, &n);
+      stat |= ROUND (&r);
+      if (fpu_status_ok (stat))
+	VAL2REG (&r, reg_out);
+    }
+  
+  fpu_check_signal_exception (sd, cpu, cia);
+}
+
+/* Implement a 32/64 bit FP nmadd, setting FP exception bits when
+   appropriate.  */
+void
+fpu_fnmadd (SIM_DESC sd, sim_cpu *cpu, sim_cia cia,
+	    const void *reg_in1, const void *reg_in2, const void *reg_in3,
+	    void *reg_out, const struct fp_prec_t *ops)
+{
+  sim_fpu m1, m2, m, mm, n, r;
+
+  REG2VAL (reg_in1, &m1);
+  REG2VAL (reg_in2, &m2);
+  REG2VAL (reg_in3, &n);
+  ROUND (&m1);
+  ROUND (&m2);
+  ROUND (&n);
+  FPCR &= ~ EC_MASK;
+  if (sim_fpu_is_snan (&m1) || sim_fpu_is_snan (&m2) || sim_fpu_is_snan (&n)
+      || (sim_fpu_is_infinity (&m1) && sim_fpu_is_zero (&m2))
+      || (sim_fpu_is_zero (&m1) && sim_fpu_is_infinity (&m2)))
+    {
+    invalid_operands:
+      if (FPCR & EE_V)
+	FPCR |= EC_V;
+      else
+	VAL2REG (&sim_fpu_qnan, reg_out);
+    }
+  else
+    {
+      sim_fpu_status stat = sim_fpu_mul (&m, &m1, &m2);
+
+      if (sim_fpu_is_infinity (&m) && sim_fpu_is_infinity (&n)
+	  && sim_fpu_sign (&m) == sim_fpu_sign (&n))
+	goto invalid_operands;
+
+      stat |= sim_fpu_neg (&mm, &m);
+      stat |= sim_fpu_add (&r, &mm, &n);
+      stat |= ROUND (&r);
+      if (fpu_status_ok (stat))
+	VAL2REG (&r, reg_out);
+    }
+  
+  fpu_check_signal_exception (sd, cpu, cia);
+}
+
+/* Implement a 32/64 bit FP nmsub, setting FP exception bits when
+   appropriate.  */
+void
+fpu_fnmsub (SIM_DESC sd, sim_cpu *cpu, sim_cia cia,
+	    const void *reg_in1, const void *reg_in2, const void *reg_in3,
+	    void *reg_out, const struct fp_prec_t *ops)
+{
+  sim_fpu m1, m2, m, mm, n, r;
+
+  REG2VAL (reg_in1, &m1);
+  REG2VAL (reg_in2, &m2);
+  REG2VAL (reg_in3, &n);
+  ROUND (&m1);
+  ROUND (&m2);
+  ROUND (&n);
+  FPCR &= ~ EC_MASK;
+  if (sim_fpu_is_snan (&m1) || sim_fpu_is_snan (&m2) || sim_fpu_is_snan (&n)
+      || (sim_fpu_is_infinity (&m1) && sim_fpu_is_zero (&m2))
+      || (sim_fpu_is_zero (&m1) && sim_fpu_is_infinity (&m2)))
+    {
+    invalid_operands:
+      if (FPCR & EE_V)
+	FPCR |= EC_V;
+      else
+	VAL2REG (&sim_fpu_qnan, reg_out);
+    }
+  else
+    {
+      sim_fpu_status stat = sim_fpu_mul (&m, &m1, &m2);
+
+      if (sim_fpu_is_infinity (&m) && sim_fpu_is_infinity (&n)
+	  && sim_fpu_sign (&m) != sim_fpu_sign (&n))
+	goto invalid_operands;
+
+      stat |= sim_fpu_neg (&mm, &m);
+      stat |= sim_fpu_sub (&r, &mm, &n);
+      stat |= ROUND (&r);
+      if (fpu_status_ok (stat))
+	VAL2REG (&r, reg_out);
+    }
+  
+  fpu_check_signal_exception (sd, cpu, cia);
+}
diff --git a/sim/mn10300/mn10300.igen b/sim/mn10300/mn10300.igen
index b0ab89f..c7b83ed 100644
--- a/sim/mn10300/mn10300.igen
+++ b/sim/mn10300/mn10300.igen
@@ -4,6 +4,7 @@
 :option:::hi-bit-nr:7
 :model:::mn10300:mn10300:
 :model:::am33:am33:
+:model:::am33_2:am33_2:
 
 // What do we do with an illegal instruction?
 :internal::::illegal:
@@ -17,6 +18,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /*  OP_8000 (); */
   signed32 immed = EXTEND8 (IMM8);
@@ -29,6 +31,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   PC = cia;
   /* OP_80 (); */
@@ -41,6 +44,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F1E0 (); */
   PC = cia;
@@ -53,6 +57,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F1D0 (); */
   PC = cia;
@@ -65,6 +70,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
    PC = cia;
    /* OP_9000 (); */
@@ -77,6 +83,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
    PC = cia;
    /* OP_90 (); */
@@ -89,6 +96,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_3C (); */
   PC = cia;
@@ -101,6 +109,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F2F0 (); */
   PC = cia;
@@ -113,6 +122,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F2E4 (); */
   PC = cia;
@@ -125,6 +135,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F2F3 (); */
   PC = cia;
@@ -137,6 +148,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F2E0 (); */
   PC = cia;
@@ -149,6 +161,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F2F2 (); */
   PC = cia;
@@ -161,6 +174,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_70 (); */
   PC = cia;
@@ -173,6 +187,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F80000 (); */
   PC = cia;
@@ -186,6 +201,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FA000000 (); */
   PC = cia;
@@ -199,6 +215,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FC000000 (); */
   PC = cia;
@@ -213,6 +230,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_5800 (); */
   PC = cia;
@@ -225,6 +243,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FAB40000 (); */
   PC = cia;
@@ -238,6 +257,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FCB40000 (); */
   PC = cia;
@@ -251,6 +271,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F300 (); */
   PC = cia;
@@ -264,6 +285,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_300000 (); */
   PC = cia;
@@ -275,6 +297,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FCA40000 (); */
   PC = cia;
@@ -287,6 +310,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F000 (); */
   PC = cia;
@@ -299,6 +323,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F82000 (); */
   PC = cia;
@@ -312,6 +337,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FA200000 (); */
   PC = cia;
@@ -326,6 +352,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FC200000 (); */
   PC = cia;
@@ -340,6 +367,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_5C00 (); */
   PC = cia;
@@ -353,6 +381,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FAB00000 (); */
   PC = cia;
@@ -366,6 +395,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FCB00000 (); */
   PC = cia;
@@ -380,6 +410,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F380 (); */
   PC = cia;
@@ -394,6 +425,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FAA00000 (); */
   PC = cia;
@@ -406,6 +438,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FCA00000 (); */
   PC = cia;
@@ -419,6 +452,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F8F000 (); */
   PC = cia;
@@ -432,6 +466,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_60 (); */
   PC = cia;
@@ -444,6 +479,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F81000 (); */
   PC = cia;
@@ -457,6 +493,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FA100000 (); */
   PC = cia;
@@ -470,6 +507,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FC100000 (); */
   PC = cia;
@@ -484,6 +522,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_4200 (); */
   PC = cia;
@@ -496,6 +535,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FA910000 (); */
   PC = cia;
@@ -509,6 +549,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FC910000 (); */
   PC = cia;
@@ -522,6 +563,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F340 (); */
   PC = cia;
@@ -535,6 +577,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_10000 (); */
   PC = cia;
@@ -547,6 +590,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FC810000 (); */
   PC = cia;
@@ -560,6 +604,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F010 (); */
   PC = cia;
@@ -572,6 +617,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_F83000 (); */
   PC = cia;
@@ -585,6 +631,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FA300000 (); */
   PC = cia;
@@ -598,6 +645,7 @@
 "mov"
 *mn10300
 *am33
+*am33_2
 {
   /* OP_FC300000 (); */
   PC = cia;
@@ -613,6 +661,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_4300 (); */
@@ -627,6 +676,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FA900000 (); */
@@ -642,6 +692,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FC900000 (); */
@@ -657,6 +708,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F3C0 (); */
@@ -672,6 +724,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FA800000 (); */
@@ -687,6 +740,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FC800000 (); */
@@ -702,6 +756,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8F400 (); */
@@ -717,6 +772,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_2C0000 (); */
@@ -734,6 +790,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCCC0000 (); */
@@ -751,6 +808,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_240000 (); */
@@ -768,6 +826,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
     /* OP_FCDC0000 (); */
@@ -782,6 +841,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F040 (); */
@@ -797,6 +857,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F84000 (); */
@@ -812,6 +873,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FA400000 (); */
@@ -828,6 +890,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FC400000 (); */
@@ -844,6 +907,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8B800 (); */
@@ -859,6 +923,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAB80000 (); */
@@ -875,6 +940,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCB80000 (); */
@@ -891,6 +957,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F400 (); */
@@ -907,6 +974,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_340000 (); */
@@ -921,6 +989,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCA80000 (); */
@@ -936,6 +1005,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F050 (); */
@@ -950,6 +1020,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F85000 (); */
@@ -965,6 +1036,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FA500000 (); */
@@ -980,6 +1052,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FC500000 (); */
@@ -996,6 +1069,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F89200 (); */
@@ -1010,6 +1084,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FA920000 (); */
@@ -1025,6 +1100,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FC920000 (); */
@@ -1040,6 +1116,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F440 (); */
@@ -1055,6 +1132,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_20000 (); */
@@ -1070,6 +1148,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FC820000 (); */
@@ -1085,6 +1164,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F060 (); */
@@ -1100,6 +1180,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F86000 (); */
@@ -1115,6 +1196,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FA600000 (); */
@@ -1131,6 +1213,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FC600000 (); */
@@ -1147,6 +1230,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8BC00 (); */
@@ -1162,6 +1246,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FABC0000 (); */
@@ -1177,6 +1262,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCBC0000 (); */
@@ -1192,6 +1278,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F480 (); */
@@ -1207,6 +1294,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_380000 (); */
@@ -1221,6 +1309,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCAC0000 (); */
@@ -1236,6 +1325,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F070 (); */
@@ -1251,6 +1341,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F87000 (); */
@@ -1266,6 +1357,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FA700000 (); */
@@ -1281,6 +1373,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FC700000 (); */
@@ -1297,6 +1390,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F89300 (); */
@@ -1312,6 +1406,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FA930000 (); */
@@ -1327,6 +1422,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FC930000 (); */
@@ -1342,6 +1438,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F4C0 (); */
@@ -1357,6 +1454,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_30000 (); */
@@ -1371,6 +1469,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FC830000 (); */
@@ -1386,6 +1485,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F2D0 (); */
@@ -1403,6 +1503,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_10 (); */
@@ -1417,6 +1518,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_14 (); */
@@ -1431,6 +1533,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_18 (); */
@@ -1445,6 +1548,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_1C (); */
@@ -1459,6 +1563,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_0 (); */
@@ -1476,6 +1581,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_E0 (); */
@@ -1489,6 +1595,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F160 (); */
@@ -1503,6 +1610,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F150 (); */
@@ -1517,6 +1625,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F170 (); */
@@ -1531,6 +1640,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_2800 (); */
@@ -1545,6 +1655,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAC00000 (); */
@@ -1559,6 +1670,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCC00000 (); */
@@ -1573,6 +1685,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_2000 (); */
@@ -1587,6 +1700,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAD00000 (); */
@@ -1601,6 +1715,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCD00000 (); */
@@ -1615,6 +1730,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8FE00 (); */
@@ -1633,6 +1749,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAFE0000 (); */
@@ -1651,6 +1768,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCFE0000 (); */
@@ -1669,6 +1787,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F140 (); */
@@ -1699,6 +1818,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F100 (); */
@@ -1712,6 +1832,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F120 (); */
@@ -1726,6 +1847,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F110 (); */
@@ -1740,6 +1862,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F130 (); */
@@ -1754,6 +1877,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCC40000 (); */
@@ -1768,6 +1892,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCD40000 (); */
@@ -1782,6 +1907,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F180 (); */
@@ -1812,6 +1938,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F240 (); */
@@ -1836,6 +1963,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F250 (); */
@@ -1860,6 +1988,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F260 (); */
@@ -1897,6 +2026,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F270 (); */
@@ -1933,6 +2063,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_40 (); */
@@ -1950,6 +2081,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_41 (); */
@@ -1964,6 +2096,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_50 (); */
@@ -1978,6 +2111,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   PC = cia;
@@ -1992,6 +2126,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   PC = cia;
@@ -2006,6 +2141,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F1A0 (); */
@@ -2020,6 +2156,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F190 (); */
@@ -2034,6 +2171,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   PC = cia;
@@ -2049,6 +2187,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   PC = cia;
@@ -2063,6 +2202,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAC80000 (); */
@@ -2078,6 +2218,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCC80000 (); */
@@ -2093,6 +2234,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAD80000 (); */
@@ -2108,6 +2250,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCD80000 (); */
@@ -2123,6 +2266,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F200 (); */
@@ -2143,6 +2287,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8E000 (); */
@@ -2163,6 +2308,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAE00000 (); */
@@ -2183,6 +2329,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCE00000 (); */
@@ -2204,6 +2351,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAFC0000 (); */
@@ -2219,6 +2367,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F210 (); */
@@ -2233,6 +2382,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8E400 (); */
@@ -2247,6 +2397,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAE40000 (); */
@@ -2261,6 +2412,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCE40000 (); */
@@ -2275,6 +2427,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAFD0000 (); */
@@ -2289,6 +2442,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F220 (); */
@@ -2303,6 +2457,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAE80000 (); */
@@ -2317,6 +2472,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCE80000 (); */
@@ -2331,6 +2487,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F230 (); */
@@ -2351,6 +2508,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8EC00 (); */
@@ -2365,6 +2523,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAEC0000 (); */
@@ -2379,6 +2538,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCEC0000 (); */
@@ -2394,6 +2554,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FE020000 (); */
@@ -2410,6 +2571,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAF80000 (); */
@@ -2425,6 +2587,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F080 (); */
@@ -2448,6 +2611,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FE000000 (); */
@@ -2471,6 +2635,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAF00000 (); */
@@ -2493,6 +2658,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F090 (); */
@@ -2516,6 +2682,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FE010000 (); */
@@ -2539,6 +2706,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAF40000 (); */
@@ -2561,6 +2729,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F2B0 (); */
@@ -2585,6 +2754,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8C800 (); */
@@ -2609,6 +2779,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F2A0 (); */
@@ -2631,6 +2802,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8C400 (); */
@@ -2652,6 +2824,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F290 (); */
@@ -2673,6 +2846,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8C000 (); */
@@ -2693,6 +2867,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_54 (); */
@@ -2713,6 +2888,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F284 (); */
@@ -2739,6 +2915,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F280 (); */
@@ -2765,6 +2942,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_C800 (); */
@@ -2783,6 +2961,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_C900 (); */
@@ -2801,6 +2980,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_C100 (); */
@@ -2820,6 +3000,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_C200 (); */
@@ -2838,6 +3019,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_C300 (); */
@@ -2857,6 +3039,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_C000 (); */
@@ -2875,6 +3058,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_C500 (); */
@@ -2893,6 +3077,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_C600 (); */
@@ -2911,6 +3096,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_C700 (); */
@@ -2929,6 +3115,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_C400 (); */
@@ -2947,6 +3134,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8E800 (); */
@@ -2965,6 +3153,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8E900 (); */
@@ -2983,6 +3172,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8EA00 (); */
@@ -3001,6 +3191,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F8EB00 (); */
@@ -3019,6 +3210,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_CA00 (); */
@@ -3034,6 +3226,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_D8 (); */
@@ -3052,6 +3245,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_D9 (); */
@@ -3070,6 +3264,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_D1 (); */
@@ -3089,6 +3284,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_D2 (); */
@@ -3107,6 +3303,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_D3 (); */
@@ -3126,6 +3323,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_D0 (); */
@@ -3144,6 +3342,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_D5 (); */
@@ -3162,6 +3361,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_D6 (); */
@@ -3180,6 +3380,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_D7 (); */
@@ -3198,6 +3399,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_D4 (); */
@@ -3216,6 +3418,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_DA (); */
@@ -3231,6 +3434,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_DB (); */
@@ -3246,6 +3450,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F0F4 (); */
@@ -3260,6 +3465,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_CC0000 (); */
@@ -3274,6 +3480,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_DC000000 (); */
@@ -3288,6 +3495,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F0F0 (); */
@@ -3309,6 +3517,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FAFF0000 (); */
@@ -3330,6 +3539,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FCFF0000 (); */
@@ -3351,6 +3561,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F0FC (); */
@@ -3368,6 +3579,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F0FD (); */
@@ -3387,6 +3599,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F0FE (); */
@@ -3406,6 +3619,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F0FF (); */
@@ -3420,6 +3634,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_CB (); */
@@ -3444,6 +3659,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F6F0 (); */
@@ -3465,6 +3681,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F600 (); */
@@ -3489,6 +3706,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F90000 (); */
@@ -3513,6 +3731,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FB000000 (); */
@@ -3537,6 +3756,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FD000000 (); */
@@ -3561,6 +3781,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F610 (); */
@@ -3585,6 +3806,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F91400 (); */
@@ -3609,6 +3831,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FB140000 (); */
@@ -3633,6 +3856,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FD140000 (); */
@@ -3657,6 +3881,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F640 (); */
@@ -3676,6 +3901,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F650 (); */
@@ -3695,6 +3921,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F670 (); */
@@ -3715,6 +3942,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_F0C0 (); */
@@ -3729,6 +3957,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_FF (); */
@@ -3742,6 +3971,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_CE00 (); */
@@ -3795,6 +4025,7 @@
     }
 
   if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33
+      || STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2
       )
     {
       if (mask & 0x1)
@@ -3839,6 +4070,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_CF00 (); */
@@ -3849,6 +4081,7 @@
   mask = REGS;
 
   if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33
+      || STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2
       )
     {
       if (mask & 0x4)
@@ -3936,6 +4169,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_CD000000 (); */
@@ -3950,6 +4184,7 @@
   mask = REGS;
 
   if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33
+      || STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2
       )
     {
       if (mask & 0x4)
@@ -4043,6 +4278,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_DD000000 (); */
@@ -4058,6 +4294,7 @@
   mask = REGS;
 
   if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33
+      || STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2
       )
     {
       if (mask & 0x4)
@@ -4150,6 +4387,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_DF0000 (); */
@@ -4164,6 +4402,7 @@
   mask = REGS;
 
   if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33
+      || STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2
       )
     {
 
@@ -4253,6 +4492,7 @@
 *mn10300
 
 *am33
+*am33_2
 
 {
   /* OP_DE0000 (); */
@@ -4268,6 +4508,7 @@
   mask = REGS;
 
   if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33
+      || STATE_ARCHITECTURE (sd)->mach == bfd_mach_am33_2
       )
     {
 
diff --git a/sim/mn10300/mn10300_sim.h b/sim/mn10300/mn10300_sim.h
index 6a2c571..4ea5d3e 100644
--- a/sim/mn10300/mn10300_sim.h
+++ b/sim/mn10300/mn10300_sim.h
@@ -6,6 +6,7 @@
 #include <limits.h>
 #include "gdb/remote-sim.h"
 #include "bfd.h"
+#include "sim-fpu.h"
 
 #ifndef INLINE
 #ifdef __GNUC__
@@ -53,6 +54,10 @@
 #  endif
 #endif
 
+typedef struct
+{
+  uint32 low, high;
+} dword;
 typedef uint32 reg_t;
 
 struct simops 
@@ -73,6 +78,11 @@
   reg_t regs[32];		/* registers, d0-d3, a0-a3, sp, pc, mdr, psw,
 				   lir, lar, mdrq, plus some room for processor
 				   specific regs.  */
+  union
+  {
+    reg_t fs[32]; /* FS0-31 */
+    dword fd[16]; /* FD0,2,...,30 */
+  } fpregs;
   uint8 *mem;			/* main memory */
   int exception;
   int exited;
@@ -123,42 +133,57 @@
 #define REG_MCRL 27
 #define REG_MCVF 28
 
-#if WITH_COMMON
-/* These definitions conflict with similar macros in common.  */
-#else
-#define SEXT3(x)	((((x)&0x7)^(~0x3))+0x4)	
+#define REG_FPCR 29
 
-/* sign-extend a 4-bit number */
-#define SEXT4(x)	((((x)&0xf)^(~0x7))+0x8)	
+#define FPCR (State.regs[REG_FPCR])
 
-/* sign-extend a 5-bit number */
-#define SEXT5(x)	((((x)&0x1f)^(~0xf))+0x10)	
+#define FCC_MASK LSMASK (21, 18)
+#define RM_MASK  LSMASK (17, 16) /* Must always be zero.  */
+#define EC_MASK  LSMASK (14, 10)
+#define EE_MASK  LSMASK ( 9,  5)
+#define EF_MASK  LSMASK ( 4,  0)
+#define FPCR_MASK (FCC_MASK | EC_MASK | EE_MASK | EF_MASK)
 
-/* sign-extend an 8-bit number */
-#define SEXT8(x)	((((x)&0xff)^(~0x7f))+0x80)
+#define FCC_L LSBIT (21)
+#define FCC_G LSBIT (20)
+#define FCC_E LSBIT (19)
+#define FCC_U LSBIT (18)
 
-/* sign-extend a 9-bit number */
-#define SEXT9(x)	((((x)&0x1ff)^(~0xff))+0x100)
+#define EC_V LSBIT (14)
+#define EC_Z LSBIT (13)
+#define EC_O LSBIT (12)
+#define EC_U LSBIT (11)
+#define EC_I LSBIT (10)
 
-/* sign-extend a 16-bit number */
-#define SEXT16(x)	((((x)&0xffff)^(~0x7fff))+0x8000)
+#define EE_V LSBIT (9)
+#define EE_Z LSBIT (8)
+#define EE_O LSBIT (7)
+#define EE_U LSBIT (6)
+#define EE_I LSBIT (5)
 
-/* sign-extend a 22-bit number */
-#define SEXT22(x)	((((x)&0x3fffff)^(~0x1fffff))+0x200000)
+#define EF_V LSBIT (4)
+#define EF_Z LSBIT (3)
+#define EF_O LSBIT (2)
+#define EF_U LSBIT (1)
+#define EF_I LSBIT (0)
 
-#define MAX32	0x7fffffffLL
-#define MIN32	0xff80000000LL
-#define MASK32	0xffffffffLL
-#define MASK40	0xffffffffffLL
-#endif  /* not WITH_COMMON */
+#define PSW_FE LSBIT(20)
+#define FPU_DISABLED !(PSW & PSW_FE)
+
+#define XS2FS(X,S) State.fpregs.fs[((X<<4)|(S))]
+#define AS2FS(A,S) State.fpregs.fs[((A<<2)|(S))]
+#define Xf2FD(X,f) State.fpregs.fd[((X<<3)|(f))]
+
+#define FS2FPU(FS,F) sim_fpu_32to (&(F), (FS))
+#define FD2FPU(FD,F) sim_fpu_232to (&(F), ((FD).high), ((FD).low))
+#define FPU2FS(F,FS) sim_fpu_to32 (&(FS), &(F))
+#define FPU2FD(F,FD) sim_fpu_to232 (&((FD).high), &((FD).low), &(F))
 
 #ifdef _WIN32
 #define SIGTRAP 5
 #define SIGQUIT 3
 #endif
 
-#if WITH_COMMON
-
 #define FETCH32(a,b,c,d) \
  ((a)+((b)<<8)+((c)<<16)+((d)<<24))
 
@@ -176,6 +201,20 @@
 #define load_word(ADDR) \
 sim_core_read_unaligned_4 (STATE_CPU (simulator, 0), PC, read_map, (ADDR))
 
+#define load_dword(ADDR) \
+u642dw (sim_core_read_unaligned_8 (STATE_CPU (simulator, 0), \
+				   PC, read_map, (ADDR)))
+
+static INLINE dword
+u642dw (unsigned64 dw)
+{
+  dword r;
+
+  r.low = (unsigned32)dw;
+  r.high = (unsigned32)(dw >> 32);
+  return r;
+}
+
 #define store_byte(ADDR, DATA) \
 sim_core_write_unaligned_1 (STATE_CPU (simulator, 0), \
 			    PC, write_map, (ADDR), (DATA))
@@ -189,202 +228,72 @@
 #define store_word(ADDR, DATA) \
 sim_core_write_unaligned_4 (STATE_CPU (simulator, 0), \
 			    PC, write_map, (ADDR), (DATA))
-#endif  /* WITH_COMMON */
+#define store_dword(ADDR, DATA) \
+sim_core_write_unaligned_8 (STATE_CPU (simulator, 0), \
+			    PC, write_map, (ADDR), dw2u64 (DATA))
 
-#if WITH_COMMON
-#else
-#define load_mem_big(addr,len) \
-  (len == 1 ? *((addr) + State.mem) : \
-   len == 2 ? ((*((addr) + State.mem) << 8) \
-	       | *(((addr) + 1) + State.mem)) : \
-   len == 3 ? ((*((addr) + State.mem) << 16) \
-	       | (*(((addr) + 1) + State.mem) << 8) \
-	       | *(((addr) + 2) + State.mem)) : \
-	      ((*((addr) + State.mem) << 24) \
-	       | (*(((addr) + 1) + State.mem) << 16) \
-	       | (*(((addr) + 2) + State.mem) << 8) \
-	       | *(((addr) + 3) + State.mem)))
-
-static INLINE uint32
-load_byte (addr)
-     SIM_ADDR addr;
+static INLINE unsigned64
+dw2u64 (dword data)
 {
-  uint8 *p = (addr & 0xffffff) + State.mem;
-
-#ifdef CHECK_ADDR
-  if ((addr & 0xffffff) > max_mem)
-    abort ();
-#endif
-
-  return p[0];
+  return data.low | (((unsigned64)data.high) << 32);
 }
 
-static INLINE uint32
-load_half (addr)
-     SIM_ADDR addr;
-{
-  uint8 *p = (addr & 0xffffff) + State.mem;
-
-#ifdef CHECK_ADDR
-  if ((addr & 0xffffff) > max_mem)
-    abort ();
-#endif
-
-  return p[1] << 8 | p[0];
-}
-
-static INLINE uint32
-load_3_byte (addr)
-     SIM_ADDR addr;
-{
-  uint8 *p = (addr & 0xffffff) + State.mem;
-
-#ifdef CHECK_ADDR
-  if ((addr & 0xffffff) > max_mem)
-    abort ();
-#endif
-
-  return p[2] << 16 | p[1] << 8 | p[0];
-}
-
-static INLINE uint32
-load_word (addr)
-     SIM_ADDR addr;
-{
-  uint8 *p = (addr & 0xffffff) + State.mem;
-
-#ifdef CHECK_ADDR
-  if ((addr & 0xffffff) > max_mem)
-    abort ();
-#endif
-
-  return p[3] << 24 | p[2] << 16 | p[1] << 8 | p[0];
-}
-
-static INLINE uint32
-load_mem (addr, len)
-     SIM_ADDR addr;
-     int len;
-{
-  uint8 *p = (addr & 0xffffff) + State.mem;
-
-#ifdef CHECK_ADDR
-  if ((addr & 0xffffff) > max_mem)
-    abort ();
-#endif
-
-  switch (len)
-    {
-    case 1:
-      return p[0];
-    case 2:
-      return p[1] << 8 | p[0];
-    case 3:
-      return p[2] << 16 | p[1] << 8 | p[0];
-    case 4:
-      return p[3] << 24 | p[2] << 16 | p[1] << 8 | p[0];
-    default:
-      abort ();
-    }
-}
-
-static INLINE void
-store_byte (addr, data)
-     SIM_ADDR addr;
-     uint32 data;
-{
-  uint8 *p = (addr & 0xffffff) + State.mem;
-
-#ifdef CHECK_ADDR
-  if ((addr & 0xffffff) > max_mem)
-    abort ();
-#endif
-
-  p[0] = data;
-}
-
-static INLINE void
-store_half (addr, data)
-     SIM_ADDR addr;
-     uint32 data;
-{
-  uint8 *p = (addr & 0xffffff) + State.mem;
-
-#ifdef CHECK_ADDR
-  if ((addr & 0xffffff) > max_mem)
-    abort ();
-#endif
-
-  p[0] = data;
-  p[1] = data >> 8;
-}
-
-static INLINE void
-store_3_byte (addr, data)
-     SIM_ADDR addr;
-     uint32 data;
-{
-  uint8 *p = (addr & 0xffffff) + State.mem;
-
-#ifdef CHECK_ADDR
-  if ((addr & 0xffffff) > max_mem)
-    abort ();
-#endif
-
-  p[0] = data;
-  p[1] = data >> 8;
-  p[2] = data >> 16;
-}
-
-static INLINE void
-store_word (addr, data)
-     SIM_ADDR addr;
-     uint32 data;
-{
-  uint8 *p = (addr & 0xffffff) + State.mem;
-
-#ifdef CHECK_ADDR
-  if ((addr & 0xffffff) > max_mem)
-    abort ();
-#endif
-
-  p[0] = data;
-  p[1] = data >> 8;
-  p[2] = data >> 16;
-  p[3] = data >> 24;
-}
-#endif  /* not WITH_COMMON */
-
 /* Function declarations.  */
 
-uint32 get_word PARAMS ((uint8 *));
-uint16 get_half PARAMS ((uint8 *));
-uint8 get_byte PARAMS ((uint8 *));
-void put_word PARAMS ((uint8 *, uint32));
-void put_half PARAMS ((uint8 *, uint16));
-void put_byte PARAMS ((uint8 *, uint8));
+uint32 get_word (uint8 *);
+uint16 get_half (uint8 *);
+uint8 get_byte (uint8 *);
+void put_word (uint8 *, uint32);
+void put_half (uint8 *, uint16);
+void put_byte (uint8 *, uint8);
 
-extern uint8 *map PARAMS ((SIM_ADDR addr));
+extern uint8 *map (SIM_ADDR addr);
 
-INLINE_SIM_MAIN (void) genericAdd PARAMS ((unsigned32 source, unsigned32 destReg));
-INLINE_SIM_MAIN (void) genericSub PARAMS ((unsigned32 source, unsigned32 destReg));
-INLINE_SIM_MAIN (void) genericCmp PARAMS ((unsigned32 leftOpnd, unsigned32 rightOpnd));
-INLINE_SIM_MAIN (void) genericOr PARAMS ((unsigned32 source, unsigned32 destReg));
-INLINE_SIM_MAIN (void) genericXor PARAMS ((unsigned32 source, unsigned32 destReg));
-INLINE_SIM_MAIN (void) genericBtst PARAMS ((unsigned32 leftOpnd, unsigned32 rightOpnd));
-INLINE_SIM_MAIN (int) syscall_read_mem PARAMS ((host_callback *cb,
-						struct cb_syscall *sc,
-						unsigned long taddr,
-						char *buf,
-						int bytes)); 
-INLINE_SIM_MAIN (int) syscall_write_mem PARAMS ((host_callback *cb,
-						struct cb_syscall *sc,
-						unsigned long taddr,
-						const char *buf,
-						int bytes)); 
-INLINE_SIM_MAIN (void) do_syscall PARAMS ((void));
+INLINE_SIM_MAIN (void) genericAdd (unsigned32 source, unsigned32 destReg);
+INLINE_SIM_MAIN (void) genericSub (unsigned32 source, unsigned32 destReg);
+INLINE_SIM_MAIN (void) genericCmp (unsigned32 leftOpnd, unsigned32 rightOpnd);
+INLINE_SIM_MAIN (void) genericOr (unsigned32 source, unsigned32 destReg);
+INLINE_SIM_MAIN (void) genericXor (unsigned32 source, unsigned32 destReg);
+INLINE_SIM_MAIN (void) genericBtst (unsigned32 leftOpnd, unsigned32 rightOpnd);
+INLINE_SIM_MAIN (int) syscall_read_mem (host_callback *cb,
+					struct cb_syscall *sc,
+					unsigned long taddr,
+					char *buf,
+					int bytes);
+INLINE_SIM_MAIN (int) syscall_write_mem (host_callback *cb,
+					 struct cb_syscall *sc,
+					 unsigned long taddr,
+					 const char *buf,
+					 int bytes); 
+INLINE_SIM_MAIN (void) do_syscall (void);
 void program_interrupt (SIM_DESC sd, sim_cpu *cpu, sim_cia cia, SIM_SIGNAL sig);
 
 void mn10300_cpu_exception_trigger(SIM_DESC sd, sim_cpu* cpu, address_word pc);
 void mn10300_cpu_exception_suspend(SIM_DESC sd, sim_cpu* cpu, int exception);
 void mn10300_cpu_exception_resume(SIM_DESC sd, sim_cpu* cpu, int exception);
+
+void fpu_disabled_exception     (SIM_DESC, sim_cpu *, address_word);
+void fpu_unimp_exception        (SIM_DESC, sim_cpu *, address_word);
+void fpu_check_signal_exception (SIM_DESC, sim_cpu *, address_word);
+
+extern const struct fp_prec_t
+{
+  void (* reg2val) (const void *, sim_fpu *);
+  int (*  round)   (sim_fpu *);
+  void (* val2reg) (const sim_fpu *, void *);
+} fp_single_prec, fp_double_prec;
+
+#define FP_SINGLE (&fp_single_prec)
+#define FP_DOUBLE (&fp_double_prec)
+
+void fpu_rsqrt  (SIM_DESC, sim_cpu *, address_word, const void *, void *, const struct fp_prec_t *);
+void fpu_sqrt   (SIM_DESC, sim_cpu *, address_word, const void *, void *, const struct fp_prec_t *);
+void fpu_cmp    (SIM_DESC, sim_cpu *, address_word, const void *, const void *, const struct fp_prec_t *);
+void fpu_add    (SIM_DESC, sim_cpu *, address_word, const void *, const void *, void *, const struct fp_prec_t *);
+void fpu_sub    (SIM_DESC, sim_cpu *, address_word, const void *, const void *, void *, const struct fp_prec_t *);
+void fpu_mul    (SIM_DESC, sim_cpu *, address_word, const void *, const void *, void *, const struct fp_prec_t *);
+void fpu_div    (SIM_DESC, sim_cpu *, address_word, const void *, const void *, void *, const struct fp_prec_t *);
+void fpu_fmadd  (SIM_DESC, sim_cpu *, address_word, const void *, const void *, const void *, void *, const struct fp_prec_t *);
+void fpu_fmsub  (SIM_DESC, sim_cpu *, address_word, const void *, const void *, const void *, void *, const struct fp_prec_t *);
+void fpu_fnmadd (SIM_DESC, sim_cpu *, address_word, const void *, const void *, const void *, void *, const struct fp_prec_t *);
+void fpu_fnmsub (SIM_DESC, sim_cpu *, address_word, const void *, const void *, const void *, void *, const struct fp_prec_t *);
diff --git a/sim/mn10300/op_utils.c b/sim/mn10300/op_utils.c
index b46210f..36f387c 100644
--- a/sim/mn10300/op_utils.c
+++ b/sim/mn10300/op_utils.c
@@ -164,7 +164,7 @@
 
 /* syscall */
 INLINE_SIM_MAIN (void)
-do_syscall ()
+do_syscall (void)
 {
 
   /* We use this for simulated system calls; we may need to change
diff --git a/sim/mn10300/simops.c b/sim/mn10300/simops.c
deleted file mode 100644
index 7a19056..0000000
--- a/sim/mn10300/simops.c
+++ /dev/null
@@ -1,3239 +0,0 @@
-#include "config.h"
-
-#include <signal.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include "mn10300_sim.h"
-#include "simops.h"
-#include "sim-types.h"
-#include "targ-vals.h"
-#include "bfd.h"
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/times.h>
-#include <sys/time.h>
-
-#define REG0(X) ((X) & 0x3)
-#define REG1(X) (((X) & 0xc) >> 2)
-#define REG0_4(X) (((X) & 0x30) >> 4)
-#define REG0_8(X) (((X) & 0x300) >> 8)
-#define REG1_8(X) (((X) & 0xc00) >> 10)
-#define REG0_16(X) (((X) & 0x30000) >> 16)
-#define REG1_16(X) (((X) & 0xc0000) >> 18)
-
-/* mov imm8, dn */
-void OP_8000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_8 (insn)] = SEXT8 (insn & 0xff);
-}
-
-/* mov dm, dn */
-void OP_80 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0 (insn)] = State.regs[REG_D0 + REG1 (insn)];
-}
-
-/* mov dm, an */
-void OP_F1E0 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0 (insn)] = State.regs[REG_D0 + REG1 (insn)];
-}
-
-/* mov am, dn */
-void OP_F1D0 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0 (insn)] = State.regs[REG_A0 + REG1 (insn)];
-}
-
-/* mov imm8, an */
-void OP_9000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0_8 (insn)] = insn & 0xff;
-}
-
-/* mov am, an */
-void OP_90 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0 (insn)] = State.regs[REG_A0 + REG1 (insn)];
-}
-
-/* mov sp, an */
-void OP_3C (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0 (insn)] = State.regs[REG_SP];
-}
-
-/* mov am, sp */
-void OP_F2F0 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_SP] = State.regs[REG_A0 + REG1 (insn)];
-}
-
-/* mov psw, dn */
-void OP_F2E4 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0 (insn)] = PSW;
-}
-
-/* mov dm, psw */
-void OP_F2F3 (insn, extension)
-     unsigned long insn, extension;
-{
-  PSW = State.regs[REG_D0 + REG1 (insn)];
-}
-
-/* mov mdr, dn */
-void OP_F2E0 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0 (insn)] = State.regs[REG_MDR];
-}
-
-/* mov dm, mdr */
-void OP_F2F2 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_MDR] = State.regs[REG_D0 + REG1 (insn)];
-}
-
-/* mov (am), dn */
-void OP_70 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1 (insn)]
-    = load_word (State.regs[REG_A0 + REG0 (insn)]);
-}
-
-/* mov (d8,am), dn */
-void OP_F80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1_8 (insn)]
-    = load_word ((State.regs[REG_A0 + REG0_8 (insn)] + SEXT8 (insn & 0xff)));
-}
-
-/* mov (d16,am), dn */
-void OP_FA000000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1_16 (insn)]
-    = load_word ((State.regs[REG_A0 + REG0_16 (insn)]
-		  + SEXT16 (insn & 0xffff)));
-}
-
-/* mov (d32,am), dn */
-void OP_FC000000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1_16 (insn)]
-    = load_word ((State.regs[REG_A0 + REG0_16 (insn)]
-		  + ((insn & 0xffff) << 16) + extension));
-}
-
-/* mov (d8,sp), dn */
-void OP_5800 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_8 (insn)]
-    = load_word (State.regs[REG_SP] + (insn & 0xff));
-}
-
-/* mov (d16,sp), dn */
-void OP_FAB40000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)]
-    = load_word (State.regs[REG_SP] + (insn & 0xffff));
-}
-
-/* mov (d32,sp), dn */
-void OP_FCB40000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)]
-    = load_word (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension));
-}
-
-/* mov (di,am), dn */
-void OP_F300 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_4 (insn)]
-    = load_word ((State.regs[REG_A0 + REG0 (insn)]
-		  + State.regs[REG_D0 + REG1 (insn)]));
-}
-
-/* mov (abs16), dn */
-void OP_300000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)] = load_word ((insn & 0xffff));
-}
-
-/* mov (abs32), dn */
-void OP_FCA40000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)]
-    = load_word ((((insn & 0xffff) << 16) + extension));
-}
-
-/* mov (am), an */
-void OP_F000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG1 (insn)]
-    = load_word (State.regs[REG_A0 + REG0 (insn)]);
-}
-
-/* mov (d8,am), an */
-void OP_F82000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG1_8 (insn)]
-    = load_word ((State.regs[REG_A0 + REG0_8 (insn)]
-		  + SEXT8 (insn & 0xff)));
-}
-
-/* mov (d16,am), an */
-void OP_FA200000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG1_16 (insn)]
-    = load_word ((State.regs[REG_A0 + REG0_16 (insn)]
-		  + SEXT16 (insn & 0xffff)));
-}
-
-/* mov (d32,am), an */
-void OP_FC200000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG1_16 (insn)]
-    = load_word ((State.regs[REG_A0 + REG0_16 (insn)]
-		  + ((insn & 0xffff) << 16) + extension));
-}
-
-/* mov (d8,sp), an */
-void OP_5C00 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0_8 (insn)]
-    = load_word (State.regs[REG_SP] + (insn & 0xff));
-}
-
-/* mov (d16,sp), an */
-void OP_FAB00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0_16 (insn)]
-    = load_word (State.regs[REG_SP] + (insn & 0xffff));
-}
-
-/* mov (d32,sp), an */
-void OP_FCB00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0_16 (insn)]
-    = load_word (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension));
-}
-
-/* mov (di,am), an */
-void OP_F380 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0_4 (insn)]
-    = load_word ((State.regs[REG_A0 + REG0 (insn)]
-		 + State.regs[REG_D0 + REG1 (insn)]));
-}
-
-/* mov (abs16), an */
-void OP_FAA00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0_16 (insn)] = load_word ((insn & 0xffff));
-}
-
-/* mov (abs32), an */
-void OP_FCA00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0_16 (insn)]
-    = load_word ((((insn & 0xffff) << 16) + extension));
-}
-
-/* mov (d8,am), sp */
-void OP_F8F000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_SP]
-    = load_word ((State.regs[REG_A0 + REG0_8 (insn)]
-		  + SEXT8 (insn & 0xff)));
-}
-
-/* mov dm, (an) */
-void OP_60 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word (State.regs[REG_A0 + REG0 (insn)],
-	      State.regs[REG_D0 + REG1 (insn)]);
-}
-
-/* mov dm, (d8,an) */
-void OP_F81000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((State.regs[REG_A0 + REG0_8 (insn)] + SEXT8 (insn & 0xff)),
-	      State.regs[REG_D0 + REG1_8 (insn)]);
-}
-
-/* mov dm (d16,an) */
-void OP_FA100000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((State.regs[REG_A0 + REG0_16 (insn)] + SEXT16 (insn & 0xffff)),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* mov dm (d32,an) */
-void OP_FC100000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((State.regs[REG_A0 + REG0_16 (insn)]
-	       + ((insn & 0xffff) << 16) + extension),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* mov dm, (d8,sp) */
-void OP_4200 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word (State.regs[REG_SP] + (insn & 0xff),
-	      State.regs[REG_D0 + REG1_8 (insn)]);
-}
-
-/* mov dm, (d16,sp) */
-void OP_FA910000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word (State.regs[REG_SP] + (insn & 0xffff),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* mov dm, (d32,sp) */
-void OP_FC910000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* mov dm, (di,an) */
-void OP_F340 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((State.regs[REG_A0 + REG0 (insn)]
-	       + State.regs[REG_D0 + REG1 (insn)]),
-	      State.regs[REG_D0 + REG0_4 (insn)]);
-}
-
-/* mov dm, (abs16) */
-void OP_10000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((insn & 0xffff), State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* mov dm, (abs32) */
-void OP_FC810000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((((insn & 0xffff) << 16) + extension), 
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* mov am, (an) */
-void OP_F010 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word (State.regs[REG_A0 + REG0 (insn)],
-	      State.regs[REG_A0 + REG1 (insn)]);
-}
-
-/* mov am, (d8,an) */
-void OP_F83000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((State.regs[REG_A0 + REG0_8 (insn)] + SEXT8 (insn & 0xff)),
-	      State.regs[REG_A0 + REG1_8 (insn)]);
-}
-
-/* mov am, (d16,an) */
-void OP_FA300000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((State.regs[REG_A0 + REG0_16 (insn)] + SEXT16 (insn & 0xffff)),
-	      State.regs[REG_A0 + REG1_16 (insn)]);
-}
-
-/* mov am, (d32,an) */
-void OP_FC300000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((State.regs[REG_A0 + REG0_16 (insn)]
-	       + ((insn & 0xffff) << 16) + extension),
-	      State.regs[REG_A0 + REG1_16 (insn)]);
-}
-
-/* mov am, (d8,sp) */
-void OP_4300 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word (State.regs[REG_SP] + (insn & 0xff),
-	      State.regs[REG_A0 + REG1_8 (insn)]);
-}
-
-/* mov am, (d16,sp) */
-void OP_FA900000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word (State.regs[REG_SP] + (insn & 0xffff),
-	      State.regs[REG_A0 + REG1_16 (insn)]);
-}
-
-/* mov am, (d32,sp) */
-void OP_FC900000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension),
-	      State.regs[REG_A0 + REG1_16 (insn)]);
-}
-
-/* mov am, (di,an) */
-void OP_F3C0 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((State.regs[REG_A0 + REG0 (insn)]
-	       + State.regs[REG_D0 + REG1 (insn)]),
-	      State.regs[REG_A0 + REG0_4 (insn)]);
-}
-
-/* mov am, (abs16) */
-void OP_FA800000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((insn & 0xffff), State.regs[REG_A0 + REG1_16 (insn)]);
-}
-
-/* mov am, (abs32) */
-void OP_FC800000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word ((((insn & 0xffff) << 16) + extension), State.regs[REG_A0 + REG1_16 (insn)]);
-}
-
-/* mov sp, (d8,an) */
-void OP_F8F400 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_word (State.regs[REG_A0 + REG0_8 (insn)] + SEXT8 (insn & 0xff),
-	      State.regs[REG_SP]);
-}
-
-/* mov imm16, dn */
-void OP_2C0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long value;
-
-  value = SEXT16 (insn & 0xffff);
-  State.regs[REG_D0 + REG0_16 (insn)] = value;
-}
-
-/* mov imm32,dn */
-void OP_FCCC0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long value;
-
-  value = ((insn & 0xffff) << 16) + extension;
-  State.regs[REG_D0 + REG0_16 (insn)] = value;
-}
-
-/* mov imm16, an */
-void OP_240000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long value;
-
-  value = insn & 0xffff;
-  State.regs[REG_A0 + REG0_16 (insn)] = value;
-}
-
-/* mov imm32, an */
-void OP_FCDC0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long value;
-
-  value = ((insn & 0xffff) << 16) + extension;
-  State.regs[REG_A0 + REG0_16 (insn)] = value;
-}
-
-/* movbu (am), dn */
-void OP_F040 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1 (insn)]
-    = load_byte (State.regs[REG_A0 + REG0 (insn)]);
-}
-
-/* movbu (d8,am), dn */
-void OP_F84000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1_8 (insn)]
-    = load_byte ((State.regs[REG_A0 + REG0_8 (insn)]
-		  + SEXT8 (insn & 0xff)));
-}
-
-/* movbu (d16,am), dn */
-void OP_FA400000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1_16 (insn)]
-    = load_byte ((State.regs[REG_A0 + REG0_16 (insn)]
-		  + SEXT16 (insn & 0xffff)));
-}
-
-/* movbu (d32,am), dn */
-void OP_FC400000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1_16 (insn)]
-    = load_byte ((State.regs[REG_A0 + REG0_16 (insn)]
-		  + ((insn & 0xffff) << 16) + extension));
-}
-
-/* movbu (d8,sp), dn */
-void OP_F8B800 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_8 (insn)]
-    = load_byte ((State.regs[REG_SP] + (insn & 0xff)));
-}
-
-/* movbu (d16,sp), dn */
-void OP_FAB80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)]
-    = load_byte ((State.regs[REG_SP] + (insn & 0xffff)));
-}
-
-/* movbu (d32,sp), dn */
-void OP_FCB80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)]
-    = load_byte (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension));
-}
-
-/* movbu (di,am), dn */
-void OP_F400 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_4 (insn)]
-    = load_byte ((State.regs[REG_A0 + REG0 (insn)]
-		  + State.regs[REG_D0 + REG1 (insn)]));
-}
-
-/* movbu (abs16), dn */
-void OP_340000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)] = load_byte ((insn & 0xffff));
-}
-
-/* movbu (abs32), dn */
-void OP_FCA80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)]
-    = load_byte ((((insn & 0xffff) << 16) + extension));
-}
-
-/* movbu dm, (an) */
-void OP_F050 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_byte (State.regs[REG_A0 + REG0 (insn)],
-	      State.regs[REG_D0 + REG1 (insn)]);
-}
-
-/* movbu dm, (d8,an) */
-void OP_F85000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_byte ((State.regs[REG_A0 + REG0_8 (insn)] + SEXT8 (insn & 0xff)),
-	      State.regs[REG_D0 + REG1_8 (insn)]);
-}
-
-/* movbu dm, (d16,an) */
-void OP_FA500000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_byte ((State.regs[REG_A0 + REG0_16 (insn)] + SEXT16 (insn & 0xffff)),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movbu dm, (d32,an) */
-void OP_FC500000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_byte ((State.regs[REG_A0 + REG0_16 (insn)]
-	       + ((insn & 0xffff) << 16) + extension),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movbu dm, (d8,sp) */
-void OP_F89200 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_byte (State.regs[REG_SP] + (insn & 0xff),
-	      State.regs[REG_D0 + REG1_8 (insn)]);
-}
-
-/* movbu dm, (d16,sp) */
-void OP_FA920000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_byte (State.regs[REG_SP] + (insn & 0xffff),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movbu dm (d32,sp) */
-void OP_FC920000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_byte (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movbu dm, (di,an) */
-void OP_F440 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_byte ((State.regs[REG_A0 + REG0 (insn)]
-	       + State.regs[REG_D0 + REG1 (insn)]),
-	      State.regs[REG_D0 + REG0_4 (insn)]);
-}
-
-/* movbu dm, (abs16) */
-void OP_20000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_byte ((insn & 0xffff), State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movbu dm, (abs32) */
-void OP_FC820000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_byte ((((insn & 0xffff) << 16) + extension), State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movhu (am), dn */
-void OP_F060 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1 (insn)]
-    = load_half (State.regs[REG_A0 + REG0 (insn)]);
-}
-
-/* movhu (d8,am), dn */
-void OP_F86000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1_8 (insn)]
-    = load_half ((State.regs[REG_A0 + REG0_8 (insn)]
-		  + SEXT8 (insn & 0xff)));
-}
-
-/* movhu (d16,am), dn */
-void OP_FA600000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1_16 (insn)]
-    = load_half ((State.regs[REG_A0 + REG0_16 (insn)]
-		  + SEXT16 (insn & 0xffff)));
-}
-
-/* movhu (d32,am), dn */
-void OP_FC600000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1_16 (insn)]
-    = load_half ((State.regs[REG_A0 + REG0_16 (insn)]
-		  + ((insn & 0xffff) << 16) + extension));
-}
-
-/* movhu (d8,sp) dn */
-void OP_F8BC00 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_8 (insn)]
-    = load_half ((State.regs[REG_SP] + (insn & 0xff)));
-}
-
-/* movhu (d16,sp), dn */
-void OP_FABC0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)]
-    = load_half ((State.regs[REG_SP] + (insn & 0xffff)));
-}
-
-/* movhu (d32,sp), dn */
-void OP_FCBC0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)]
-    = load_half (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension));
-}
-
-/* movhu (di,am), dn */
-void OP_F480 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_4 (insn)]
-    = load_half ((State.regs[REG_A0 + REG0 (insn)]
-		  + State.regs[REG_D0 + REG1 (insn)]));
-}
-
-/* movhu (abs16), dn */
-void OP_380000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)] = load_half ((insn & 0xffff));
-}
-
-/* movhu (abs32), dn */
-void OP_FCAC0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0_16 (insn)]
-    = load_half ((((insn & 0xffff) << 16) + extension));
-}
-
-/* movhu dm, (an) */
-void OP_F070 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_half (State.regs[REG_A0 + REG0 (insn)],
-	      State.regs[REG_D0 + REG1 (insn)]);
-}
-
-/* movhu dm, (d8,an) */
-void OP_F87000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_half ((State.regs[REG_A0 + REG0_8 (insn)] + SEXT8 (insn & 0xff)),
-	      State.regs[REG_D0 + REG1_8 (insn)]);
-}
-
-/* movhu dm, (d16,an) */
-void OP_FA700000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_half ((State.regs[REG_A0 + REG0_16 (insn)] + SEXT16 (insn & 0xffff)),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movhu dm, (d32,an) */
-void OP_FC700000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_half ((State.regs[REG_A0 + REG0_16 (insn)]
-	       + ((insn & 0xffff) << 16) + extension),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movhu dm,(d8,sp) */
-void OP_F89300 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_half (State.regs[REG_SP] + (insn & 0xff),
-	      State.regs[REG_D0 + REG1_8 (insn)]);
-}
-
-/* movhu dm,(d16,sp) */
-void OP_FA930000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_half (State.regs[REG_SP] + (insn & 0xffff),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movhu dm,(d32,sp) */
-void OP_FC930000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_half (State.regs[REG_SP] + (((insn & 0xffff) << 16) + extension),
-	      State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movhu dm, (di,an) */
-void OP_F4C0 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_half ((State.regs[REG_A0 + REG0 (insn)]
-	       + State.regs[REG_D0 + REG1 (insn)]),
-	      State.regs[REG_D0 + REG0_4 (insn)]);
-}
-
-/* movhu dm, (abs16) */
-void OP_30000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_half ((insn & 0xffff), State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* movhu dm, (abs32) */
-void OP_FC830000 (insn, extension)
-     unsigned long insn, extension;
-{
-  store_half ((((insn & 0xffff) << 16) + extension), State.regs[REG_D0 + REG1_16 (insn)]);
-}
-
-/* ext dn */
-void OP_F2D0 (insn, extension)
-     unsigned long insn, extension;
-{
-  if (State.regs[REG_D0 + REG0 (insn)] & 0x80000000)
-    State.regs[REG_MDR] = -1;
-  else
-    State.regs[REG_MDR] = 0;
-}
-
-/* extb dn */
-void OP_10 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0 (insn)] = SEXT8 (State.regs[REG_D0 + REG0 (insn)]);
-}
-
-/* extbu dn */
-void OP_14 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0 (insn)] &= 0xff;
-}
-
-/* exth dn */
-void OP_18 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0 (insn)]
-    = SEXT16 (State.regs[REG_D0 + REG0 (insn)]);
-}
-
-/* exthu dn */
-void OP_1C (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG0 (insn)] &= 0xffff;
-}
-
-/* movm (sp), reg_list */
-void OP_CE00 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long sp = State.regs[REG_SP];
-  unsigned long mask;
-
-  mask = insn & 0xff;
-
-  if (mask & 0x8)
-    {
-      sp += 4;
-      State.regs[REG_LAR] = load_word (sp);
-      sp += 4;
-      State.regs[REG_LIR] = load_word (sp);
-      sp += 4;
-      State.regs[REG_MDR] = load_word (sp);
-      sp += 4;
-      State.regs[REG_A0 + 1] = load_word (sp);
-      sp += 4;
-      State.regs[REG_A0] = load_word (sp);
-      sp += 4;
-      State.regs[REG_D0 + 1] = load_word (sp);
-      sp += 4;
-      State.regs[REG_D0] = load_word (sp);
-      sp += 4;
-    }
-
-  if (mask & 0x10)
-    {
-      State.regs[REG_A0 + 3] = load_word (sp);
-      sp += 4;
-    }
-
-  if (mask & 0x20)
-    {
-      State.regs[REG_A0 + 2] = load_word (sp);
-      sp += 4;
-    }
-
-  if (mask & 0x40)
-    {
-      State.regs[REG_D0 + 3] = load_word (sp);
-      sp += 4;
-    }
-
-  if (mask & 0x80)
-    {
-      State.regs[REG_D0 + 2] = load_word (sp);
-      sp += 4;
-    }
-
-  /* And make sure to update the stack pointer.  */
-  State.regs[REG_SP] = sp;
-}
-
-/* movm reg_list, (sp) */
-void OP_CF00 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long sp = State.regs[REG_SP];
-  unsigned long mask;
-
-  mask = insn & 0xff;
-
-  if (mask & 0x80)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0 + 2]);
-    }
-
-  if (mask & 0x40)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0 + 3]);
-    }
-
-  if (mask & 0x20)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0 + 2]);
-    }
-
-  if (mask & 0x10)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0 + 3]);
-    }
-
-  if (mask & 0x8)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0 + 1]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0 + 1]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_MDR]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_LIR]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_LAR]);
-      sp -= 4;
-    }
-
-  /* And make sure to update the stack pointer.  */
-  State.regs[REG_SP] = sp;
-}
-
-/* clr dn */
-void OP_0 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_D0 + REG1 (insn)] = 0;
-
-  PSW |= PSW_Z;
-  PSW &= ~(PSW_V | PSW_C | PSW_N);
-}
-
-/* add dm,dn */
-void OP_E0 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_D0 + REG1 (insn)];
-  reg2 = State.regs[REG_D0 + REG0 (insn)];
-  value = reg1 + reg2;
-  State.regs[REG_D0 + REG0 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < reg2);
-  v = ((reg2 & 0x80000000) == (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* add dm, an */
-void OP_F160 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_D0 + REG1 (insn)];
-  reg2 = State.regs[REG_A0 + REG0 (insn)];
-  value = reg1 + reg2;
-  State.regs[REG_A0 + REG0 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < reg2);
-  v = ((reg2 & 0x80000000) == (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* add am, dn */
-void OP_F150 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_A0 + REG1 (insn)];
-  reg2 = State.regs[REG_D0 + REG0 (insn)];
-  value = reg1 + reg2;
-  State.regs[REG_D0 + REG0 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < reg2);
-  v = ((reg2 & 0x80000000) == (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* add am,an */
-void OP_F170 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_A0 + REG1 (insn)];
-  reg2 = State.regs[REG_A0 + REG0 (insn)];
-  value = reg1 + reg2;
-  State.regs[REG_A0 + REG0 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < reg2);
-  v = ((reg2 & 0x80000000) == (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* add imm8, dn */
-void OP_2800 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_D0 + REG0_8 (insn)];
-  imm = SEXT8 (insn & 0xff);
-  value = reg1 + imm;
-  State.regs[REG_D0 + REG0_8 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < imm);
-  v = ((reg1 & 0x80000000) == (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* add imm16, dn */
-void OP_FAC00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_D0 + REG0_16 (insn)];
-  imm = SEXT16 (insn & 0xffff);
-  value = reg1 + imm;
-  State.regs[REG_D0 + REG0_16 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < imm);
-  v = ((reg1 & 0x80000000) == (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* add imm32,dn */
-void OP_FCC00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_D0 + REG0_16 (insn)];
-  imm = ((insn & 0xffff) << 16) + extension;
-  value = reg1 + imm;
-  State.regs[REG_D0 + REG0_16 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < imm);
-  v = ((reg1 & 0x80000000) == (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* add imm8, an */
-void OP_2000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_A0 + REG0_8 (insn)];
-  imm = SEXT8 (insn & 0xff);
-  value = reg1 + imm;
-  State.regs[REG_A0 + REG0_8 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < imm);
-  v = ((reg1 & 0x80000000) == (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* add imm16, an */
-void OP_FAD00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_A0 + REG0_16 (insn)];
-  imm = SEXT16 (insn & 0xffff);
-  value = reg1 + imm;
-  State.regs[REG_A0 + REG0_16 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < imm);
-  v = ((reg1 & 0x80000000) == (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* add imm32, an */
-void OP_FCD00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_A0 + REG0_16 (insn)];
-  imm = ((insn & 0xffff) << 16) + extension;
-  value = reg1 + imm;
-  State.regs[REG_A0 + REG0_16 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < imm);
-  v = ((reg1 & 0x80000000) == (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* add imm8, sp */
-void OP_F8FE00 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_SP];
-  imm = SEXT8 (insn & 0xff);
-  value = reg1 + imm;
-  State.regs[REG_SP] = value;
-}
-
-/* add imm16,sp */
-void OP_FAFE0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_SP];
-  imm = SEXT16 (insn & 0xffff);
-  value = reg1 + imm;
-  State.regs[REG_SP] = value;
-}
-
-/* add imm32, sp */
-void OP_FCFE0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_SP];
-  imm = ((insn & 0xffff) << 16) + extension;
-  value = reg1 + imm;
-  State.regs[REG_SP] = value;
-}
-
-/* addc dm,dn */
-void OP_F140 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_D0 + REG1 (insn)];
-  reg2 = State.regs[REG_D0 + REG0 (insn)];
-  value = reg1 + reg2 + ((PSW & PSW_C) != 0);
-  State.regs[REG_D0 + REG0 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < reg1) || (value < reg2);
-  v = ((reg2 & 0x80000000) == (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* sub dm, dn */
-void OP_F100 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_D0 + REG1 (insn)];
-  reg2 = State.regs[REG_D0 + REG0 (insn)];
-  value = reg2 - reg1;
-  State.regs[REG_D0 + REG0 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 > reg2);
-  v = ((reg2 & 0x80000000) != (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* sub dm, an */
-void OP_F120 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_D0 + REG1 (insn)];
-  reg2 = State.regs[REG_A0 + REG0 (insn)];
-  value = reg2 - reg1;
-  State.regs[REG_A0 + REG0 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 > reg2);
-  v = ((reg2 & 0x80000000) != (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* sub am, dn */
-void OP_F110 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_A0 + REG1 (insn)];
-  reg2 = State.regs[REG_D0 + REG0 (insn)];
-  value = reg2 - reg1;
-  State.regs[REG_D0 + REG0 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 > reg2);
-  v = ((reg2 & 0x80000000) != (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* sub am, an */
-void OP_F130 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_A0 + REG1 (insn)];
-  reg2 = State.regs[REG_A0 + REG0 (insn)];
-  value = reg2 - reg1;
-  State.regs[REG_A0 + REG0 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 > reg2);
-  v = ((reg2 & 0x80000000) != (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* sub imm32, dn */
-void OP_FCC40000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_D0 + REG0_16 (insn)];
-  imm = ((insn & 0xffff) << 16) + extension;
-  value = reg1 - imm;
-  State.regs[REG_D0 + REG0_16 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 < imm);
-  v = ((reg1 & 0x80000000) != (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* sub imm32, an */
-void OP_FCD40000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_A0 + REG0_16 (insn)];
-  imm = ((insn & 0xffff) << 16) + extension;
-  value = reg1 - imm;
-  State.regs[REG_A0 + REG0_16 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 < imm);
-  v = ((reg1 & 0x80000000) != (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* subc dm, dn */
-void OP_F180 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_D0 + REG1 (insn)];
-  reg2 = State.regs[REG_D0 + REG0 (insn)];
-  value = reg2 - reg1 - ((PSW & PSW_C) != 0);
-  State.regs[REG_D0 + REG0 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 > reg2);
-  v = ((reg2 & 0x80000000) != (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* mul dm, dn */
-void OP_F240 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = ((signed64)(signed32)State.regs[REG_D0 + REG0 (insn)]
-          *  (signed64)(signed32)State.regs[REG_D0 + REG1 (insn)]);
-  State.regs[REG_D0 + REG0 (insn)] = temp & 0xffffffff;
-  State.regs[REG_MDR] = (temp & 0xffffffff00000000LL) >> 32;;
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* mulu dm, dn */
-void OP_F250 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = ((unsigned64)State.regs[REG_D0 + REG0 (insn)]
-          * (unsigned64)State.regs[REG_D0 + REG1 (insn)]);
-  State.regs[REG_D0 + REG0 (insn)] = temp & 0xffffffff;
-  State.regs[REG_MDR] = (temp & 0xffffffff00000000LL) >> 32;
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* div dm, dn */
-void OP_F260 (insn, extension)
-     unsigned long insn, extension;
-{
-  long long temp;
-  int n, z;
-
-  temp = State.regs[REG_MDR];
-  temp <<= 32;
-  temp |= State.regs[REG_D0 + REG0 (insn)];
-  State.regs[REG_MDR] = temp % (long)State.regs[REG_D0 + REG1 (insn)];
-  temp /= (long)State.regs[REG_D0 + REG1 (insn)];
-  State.regs[REG_D0 + REG0 (insn)] = temp & 0xffffffff;
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* divu dm, dn */
-void OP_F270 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = State.regs[REG_MDR];
-  temp <<= 32;
-  temp |= State.regs[REG_D0 + REG0 (insn)];
-  State.regs[REG_MDR] = temp % State.regs[REG_D0 + REG1 (insn)];
-  temp /= State.regs[REG_D0 + REG1 (insn)];
-  State.regs[REG_D0 + REG0 (insn)] = temp & 0xffffffff;
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* inc dn */
-void OP_40 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z,n,c,v;
-  unsigned int value, imm, reg1;
-
-  reg1 = State.regs[REG_D0 + REG1 (insn)];
-  imm = 1;
-  value = reg1 + imm;
-  State.regs[REG_D0 + REG1 (insn)] = value;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (value < imm);
-  v = ((reg1 & 0x80000000) == (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* inc an */
-void OP_41 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG1 (insn)] += 1;
-}
-
-/* inc4 an */
-void OP_50 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_A0 + REG0 (insn)] += 4;
-}
-
-/* cmp imm8, dn */
-void OP_A000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_D0 + REG0_8 (insn)];
-  imm = SEXT8 (insn & 0xff);
-  value = reg1 - imm;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 < imm);
-  v = ((reg1 & 0x80000000) != (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* cmp dm, dn */
-void OP_A0 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_D0 + REG1 (insn)];
-  reg2 = State.regs[REG_D0 + REG0 (insn)];
-  value = reg2 - reg1;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 > reg2);
-  v = ((reg2 & 0x80000000) != (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* cmp dm, an */
-void OP_F1A0 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_D0 + REG1 (insn)];
-  reg2 = State.regs[REG_A0 + REG0 (insn)];
-  value = reg2 - reg1;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 > reg2);
-  v = ((reg2 & 0x80000000) != (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* cmp am, dn */
-void OP_F190 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_A0 + REG1 (insn)];
-  reg2 = State.regs[REG_D0 + REG0 (insn)];
-  value = reg2 - reg1;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 > reg2);
-  v = ((reg2 & 0x80000000) != (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* cmp imm8, an */
-void OP_B000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_A0 + REG0_8 (insn)];
-  imm = insn & 0xff;
-  value = reg1 - imm;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 < imm);
-  v = ((reg1 & 0x80000000) != (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* cmp am, an */
-void OP_B0 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, reg2, value;
-
-  reg1 = State.regs[REG_A0 + REG1 (insn)];
-  reg2 = State.regs[REG_A0 + REG0 (insn)];
-  value = reg2 - reg1;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 > reg2);
-  v = ((reg2 & 0x80000000) != (reg1 & 0x80000000)
-       && (reg2 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* cmp imm16, dn */
-void OP_FAC80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_D0 + REG0_16 (insn)];
-  imm = SEXT16 (insn & 0xffff);
-  value = reg1 - imm;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 < imm);
-  v = ((reg1 & 0x80000000) != (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* cmp imm32, dn */
-void OP_FCC80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_D0 + REG0_16 (insn)];
-  imm = ((insn & 0xffff) << 16) + extension;
-  value = reg1 - imm;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 < imm);
-  v = ((reg1 & 0x80000000) != (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* cmp imm16, an */
-void OP_FAD80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_A0 + REG0_16 (insn)];
-  imm = insn & 0xffff;
-  value = reg1 - imm;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 < imm);
-  v = ((reg1 & 0x80000000) != (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* cmp imm32, an */
-void OP_FCD80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, c, n, v;
-  unsigned long reg1, imm, value;
-
-  reg1 = State.regs[REG_A0 + REG0_16 (insn)];
-  imm = ((insn & 0xffff) << 16) + extension;
-  value = reg1 - imm;
-
-  z = (value == 0);
-  n = (value & 0x80000000);
-  c = (reg1 < imm);
-  v = ((reg1 & 0x80000000) != (imm & 0x80000000)
-       && (reg1 & 0x80000000) != (value & 0x80000000));
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | ( n ? PSW_N : 0)
-	  | (c ? PSW_C : 0) | (v ? PSW_V : 0));
-}
-
-/* and dm, dn */
-void OP_F200 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0 (insn)] &= State.regs[REG_D0 + REG1 (insn)];
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* and imm8, dn */
-void OP_F8E000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0_8 (insn)] &= (insn & 0xff);
-  z = (State.regs[REG_D0 + REG0_8 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_8 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* and imm16, dn */
-void OP_FAE00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0_16 (insn)] &= (insn & 0xffff);
-  z = (State.regs[REG_D0 + REG0_16 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* and imm32, dn */
-void OP_FCE00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0_16 (insn)]
-    &= ((insn & 0xffff) << 16) + extension;
-  z = (State.regs[REG_D0 + REG0_16 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* and imm16, psw */
-void OP_FAFC0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  PSW &= (insn & 0xffff);
-}
-
-/* or dm, dn*/
-void OP_F210 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0 (insn)] |= State.regs[REG_D0 + REG1 (insn)];
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* or imm8, dn */
-void OP_F8E400 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0_8 (insn)] |= insn & 0xff;
-  z = (State.regs[REG_D0 + REG0_8 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_8 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* or imm16, dn*/
-void OP_FAE40000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0_16 (insn)] |= insn & 0xffff;
-  z = (State.regs[REG_D0 + REG0_16 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* or imm32, dn */
-void OP_FCE40000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0_16 (insn)]
-    |= ((insn & 0xffff) << 16) + extension;
-  z = (State.regs[REG_D0 + REG0_16 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* or imm16,psw */
-void OP_FAFD0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  PSW |= (insn & 0xffff);
-}
-
-/* xor dm, dn */
-void OP_F220 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0 (insn)] ^= State.regs[REG_D0 + REG1 (insn)];
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* xor imm16, dn */
-void OP_FAE80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0_16 (insn)] ^= insn & 0xffff;
-  z = (State.regs[REG_D0 + REG0_16 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* xor imm32, dn */
-void OP_FCE80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0_16 (insn)]
-    ^= ((insn & 0xffff) << 16) + extension;
-  z = (State.regs[REG_D0 + REG0_16 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* not dn */
-void OP_F230 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0 (insn)] = ~State.regs[REG_D0 + REG0 (insn)];
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* btst imm8, dn */
-void OP_F8EC00 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int z, n;
-
-  temp = State.regs[REG_D0 + REG0_8 (insn)];
-  temp &= (insn & 0xff);
-  n = (temp & 0x80000000) != 0;
-  z = (temp == 0);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0) | (n ? PSW_N : 0);
-}
-
-/* btst imm16, dn */
-void OP_FAEC0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int z, n;
-
-  temp = State.regs[REG_D0 + REG0_16 (insn)];
-  temp &= (insn & 0xffff);
-  n = (temp & 0x80000000) != 0;
-  z = (temp == 0);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0) | (n ? PSW_N : 0);
-}
-
-/* btst imm32, dn */
-void OP_FCEC0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int z, n;
-
-  temp = State.regs[REG_D0 + REG0_16 (insn)];
-  temp &= ((insn & 0xffff) << 16) + extension;
-  n = (temp & 0x80000000) != 0;
-  z = (temp == 0);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0) | (n ? PSW_N : 0);
-}
-
-/* btst imm8,(abs32) */
-void OP_FE020000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int n, z;
-
-  temp = load_byte (((insn & 0xffff) << 16) | (extension >> 8));
-  temp &= (extension & 0xff);
-  n = (temp & 0x80000000) != 0;
-  z = (temp == 0);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0) | (n ? PSW_N : 0);
-}
-
-/* btst imm8,(d8,an) */
-void OP_FAF80000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int n, z;
-
-  temp = load_byte ((State.regs[REG_A0 + REG0_16 (insn)]
-                     + SEXT8 ((insn & 0xff00) >> 8)));
-  temp &= (insn & 0xff);
-  n = (temp & 0x80000000) != 0;
-  z = (temp == 0);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0) | (n ? PSW_N : 0);
-}
-
-/* bset dm, (an) */
-void OP_F080 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int z;
-
-  temp = load_byte (State.regs[REG_A0 + REG0 (insn)]);
-  z = (temp & State.regs[REG_D0 + REG1 (insn)]) == 0;
-  temp |= State.regs[REG_D0 + REG1 (insn)];
-  store_byte (State.regs[REG_A0 + REG0 (insn)], temp);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0);
-}
-
-/* bset imm8, (abs32) */
-void OP_FE000000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int z;
-
-  temp = load_byte (((insn & 0xffff) << 16 | (extension >> 8)));
-  z = (temp & (extension & 0xff)) == 0;
-  temp |= (extension & 0xff);
-  store_byte ((((insn & 0xffff) << 16) | (extension >> 8)), temp);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0);
-}
-
-/* bset imm8,(d8,an) */
-void OP_FAF00000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int z;
-
-  temp = load_byte ((State.regs[REG_A0 + REG0_16 (insn)]
-                     + SEXT8 ((insn & 0xff00) >> 8)));
-  z = (temp & (insn & 0xff)) == 0;
-  temp |= (insn & 0xff);
-  store_byte ((State.regs[REG_A0 + REG0_16 (insn)]
-	       + SEXT8 ((insn & 0xff00) >> 8)), temp);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0);
-}
-
-/* bclr dm, (an) */
-void OP_F090 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int z;
-
-  temp = load_byte (State.regs[REG_A0 + REG0 (insn)]);
-  z = (temp & State.regs[REG_D0 + REG1 (insn)]) == 0;
-  temp = temp & ~State.regs[REG_D0 + REG1 (insn)];
-  store_byte (State.regs[REG_A0 + REG0 (insn)], temp);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0);
-}
-
-/* bclr imm8, (abs32) */
-void OP_FE010000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int z;
-
-  temp = load_byte (((insn & 0xffff) << 16) | (extension >> 8));
-  z = (temp & (extension & 0xff)) == 0;
-  temp = temp & ~(extension & 0xff);
-  store_byte (((insn & 0xffff) << 16) | (extension >> 8), temp);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0);
-}
-
-/* bclr imm8,(d8,an) */
-void OP_FAF40000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long temp;
-  int z;
-
-  temp = load_byte ((State.regs[REG_A0 + REG0_16 (insn)]
-                     + SEXT8 ((insn & 0xff00) >> 8)));
-  z = (temp & (insn & 0xff)) == 0;
-  temp = temp & ~(insn & 0xff);
-  store_byte ((State.regs[REG_A0 + REG0_16 (insn)]
-	       + SEXT8 ((insn & 0xff00) >> 8)), temp);
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0);
-}
-
-/* asr dm, dn */
-void OP_F2B0 (insn, extension)
-     unsigned long insn, extension;
-{
-  long temp;
-  int z, n, c;
-
-  temp = State.regs[REG_D0 + REG0 (insn)];
-  c = temp & 1;
-  temp >>= State.regs[REG_D0 + REG1 (insn)];
-  State.regs[REG_D0 + REG0 (insn)] = temp;
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0) | (c ? PSW_C : 0));
-}
-
-/* asr imm8, dn */
-void OP_F8C800 (insn, extension)
-     unsigned long insn, extension;
-{
-  long temp;
-  int z, n, c;
-
-  temp = State.regs[REG_D0 + REG0_8 (insn)];
-  c = temp & 1;
-  temp >>= (insn & 0xff);
-  State.regs[REG_D0 + REG0_8 (insn)] = temp;
-  z = (State.regs[REG_D0 + REG0_8 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_8 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0) | (c ? PSW_C : 0));
-}
-
-/* lsr dm, dn */
-void OP_F2A0 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, n, c;
-
-  c = State.regs[REG_D0 + REG0 (insn)] & 1;
-  State.regs[REG_D0 + REG0 (insn)]
-    >>= State.regs[REG_D0 + REG1 (insn)];
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0) | (c ? PSW_C : 0));
-}
-
-/* lsr imm8, dn */
-void OP_F8C400 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, n, c;
-
-  c = State.regs[REG_D0 + REG0_8 (insn)] & 1;
-  State.regs[REG_D0 + REG0_8 (insn)] >>=  (insn & 0xff);
-  z = (State.regs[REG_D0 + REG0_8 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_8 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0) | (c ? PSW_C : 0));
-}
-
-/* asl dm, dn */
-void OP_F290 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0 (insn)]
-    <<= State.regs[REG_D0 + REG1 (insn)];
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* asl imm8, dn */
-void OP_F8C000 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0_8 (insn)] <<= (insn & 0xff);
-  z = (State.regs[REG_D0 + REG0_8 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_8 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* asl2 dn */
-void OP_54 (insn, extension)
-     unsigned long insn, extension;
-{
-  int n, z;
-
-  State.regs[REG_D0 + REG0 (insn)] <<= 2;
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* ror dn */
-void OP_F284 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long value;
-  int c,n,z;
-
-  value = State.regs[REG_D0 + REG0 (insn)];
-  c = (value & 0x1);
-
-  value >>= 1;
-  value |= ((PSW & PSW_C) != 0) ? 0x80000000 : 0;
-  State.regs[REG_D0 + REG0 (insn)] = value;
-  z = (value == 0);
-  n = (value & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0) | (c ? PSW_C : 0));
-}
-
-/* rol dn */
-void OP_F280 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long value;
-  int c,n,z;
-
-  value = State.regs[REG_D0 + REG0 (insn)];
-  c = (value & 0x80000000) ? 1 : 0;
-
-  value <<= 1;
-  value |= ((PSW & PSW_C) != 0);
-  State.regs[REG_D0 + REG0 (insn)] = value;
-  z = (value == 0);
-  n = (value & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0) | (c ? PSW_C : 0));
-}
-
-/* beq label:8 */
-void OP_C800 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  if (PSW & PSW_Z)
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* bne label:8 */
-void OP_C900 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  if (!(PSW & PSW_Z))
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* bgt label:8 */
-void OP_C100 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  if (!((PSW & PSW_Z)
-        || (((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0))))
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* bge label:8 */
-void OP_C200 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  if (!(((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0)))
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* ble label:8 */
-void OP_C300 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  if ((PSW & PSW_Z)
-       || (((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0)))
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* blt label:8 */
-void OP_C000 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  if (((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0))
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* bhi label:8 */
-void OP_C500 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  if (!(((PSW & PSW_C) != 0) || (PSW & PSW_Z) != 0))
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* bcc label:8 */
-void OP_C600 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  if (!(PSW & PSW_C))
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* bls label:8 */
-void OP_C700 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  if (((PSW & PSW_C) != 0) || (PSW & PSW_Z) != 0)
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* bcs label:8 */
-void OP_C400 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  if (PSW & PSW_C)
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* bvc label:8 */
-void OP_F8E800 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 3 after we return, so
-     we subtract two here to make things right.  */
-  if (!(PSW & PSW_V))
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 3;
-}
-
-/* bvs label:8 */
-void OP_F8E900 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 3 after we return, so
-     we subtract two here to make things right.  */
-  if (PSW & PSW_V)
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 3;
-}
-
-/* bnc label:8 */
-void OP_F8EA00 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 3 after we return, so
-     we subtract two here to make things right.  */
-  if (!(PSW & PSW_N))
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 3;
-}
-
-/* bns label:8 */
-void OP_F8EB00 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 3 after we return, so
-     we subtract two here to make things right.  */
-  if (PSW & PSW_N)
-    State.regs[REG_PC] += SEXT8 (insn & 0xff) - 3;
-}
-
-/* bra label:8 */
-void OP_CA00 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 2 after we return, so
-     we subtract two here to make things right.  */
-  State.regs[REG_PC] += SEXT8 (insn & 0xff) - 2;
-}
-
-/* leq */
-void OP_D8 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 1 after we return, so
-     we subtract one here to make things right.  */
-  if (PSW & PSW_Z)
-    State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* lne */
-void OP_D9 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 1 after we return, so
-     we subtract one here to make things right.  */
-  if (!(PSW & PSW_Z))
-    State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* lgt */
-void OP_D1 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 1 after we return, so
-     we subtract one here to make things right.  */
-  if (!((PSW & PSW_Z)
-        || (((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0))))
-    State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* lge */
-void OP_D2 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 1 after we return, so
-     we subtract one here to make things right.  */
-  if (!(((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0)))
-    State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* lle */
-void OP_D3 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 1 after we return, so
-     we subtract one here to make things right.  */
-  if ((PSW & PSW_Z)
-       || (((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0)))
-    State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* llt */
-void OP_D0 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 1 after we return, so
-     we subtract one here to make things right.  */
-  if (((PSW & PSW_N) != 0) ^ ((PSW & PSW_V) != 0))
-    State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* lhi */
-void OP_D5 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 1 after we return, so
-     we subtract one here to make things right.  */
-  if (!(((PSW & PSW_C) != 0) || (PSW & PSW_Z) != 0))
-    State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* lcc */
-void OP_D6 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 1 after we return, so
-     we subtract one here to make things right.  */
-  if (!(PSW & PSW_C))
-    State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* lls */
-void OP_D7 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 1 after we return, so
-     we subtract one here to make things right.  */
-  if (((PSW & PSW_C) != 0) || (PSW & PSW_Z) != 0)
-    State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* lcs */
-void OP_D4 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* The dispatching code will add 1 after we return, so
-     we subtract one here to make things right.  */
-  if (PSW & PSW_C)
-    State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* lra */
-void OP_DA (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_PC] = State.regs[REG_LAR] - 4 - 1;
-}
-
-/* setlb */
-void OP_DB (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_LIR] = load_mem_big (State.regs[REG_PC] + 1, 4);
-  State.regs[REG_LAR] = State.regs[REG_PC] + 5;
-}
-
-/* jmp (an) */
-void OP_F0F4 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_PC] = State.regs[REG_A0 + REG0 (insn)] - 2;
-}
-
-/* jmp label:16 */
-void OP_CC0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_PC] += SEXT16 (insn & 0xffff) - 3;
-}
-
-/* jmp label:32 */
-void OP_DC000000 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_PC] += (((insn & 0xffffff) << 8) + extension) - 5;
-}
-
-/* call label:16,reg_list,imm8 */
-void OP_CD000000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned int next_pc, sp;
-  unsigned long mask;
-
-  sp = State.regs[REG_SP];
-  next_pc = State.regs[REG_PC] + 5;
-  State.mem[sp] = next_pc & 0xff;
-  State.mem[sp+1] = (next_pc & 0xff00) >> 8;
-  State.mem[sp+2] = (next_pc & 0xff0000) >> 16;
-  State.mem[sp+3] = (next_pc & 0xff000000) >> 24;
-
-  mask = insn & 0xff;
-
-  if (mask & 0x80)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0 + 2]);
-    }
-
-  if (mask & 0x40)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0 + 3]);
-    }
-
-  if (mask & 0x20)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0 + 2]);
-    }
-
-  if (mask & 0x10)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0 + 3]);
-    }
-
-  if (mask & 0x8)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0 + 1]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0 + 1]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_MDR]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_LIR]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_LAR]);
-      sp -= 4;
-    }
-
-  /* Update the stack pointer, note that the register saves to do not
-     modify SP.  The SP adjustment is derived totally from the imm8
-     field.  */
-  State.regs[REG_SP] -= extension;
-  State.regs[REG_MDR] = next_pc;
-  State.regs[REG_PC] += SEXT16 ((insn & 0xffff00) >> 8) - 5;
-}
-
-/* call label:32,reg_list,imm8*/
-void OP_DD000000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned int next_pc, sp, adjust;
-  unsigned long mask;
-
-  sp = State.regs[REG_SP];
-  next_pc = State.regs[REG_PC] + 7;
-  State.mem[sp] = next_pc & 0xff;
-  State.mem[sp+1] = (next_pc & 0xff00) >> 8;
-  State.mem[sp+2] = (next_pc & 0xff0000) >> 16;
-  State.mem[sp+3] = (next_pc & 0xff000000) >> 24;
-
-  mask = (extension & 0xff00) >> 8;
-
-  if (mask & 0x80)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0 + 2]);
-    }
-
-  if (mask & 0x40)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0 + 3]);
-    }
-
-  if (mask & 0x20)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0 + 2]);
-    }
-
-  if (mask & 0x10)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0 + 3]);
-    }
-
-  if (mask & 0x8)
-    {
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_D0 + 1]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_A0 + 1]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_MDR]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_LIR]);
-      sp -= 4;
-      store_word (sp, State.regs[REG_LAR]);
-      sp -= 4;
-    }
-
-  /* Update the stack pointer, note that the register saves to do not
-     modify SP.  The SP adjustment is derived totally from the imm8
-     field.  */
-  State.regs[REG_SP] -= (extension & 0xff);
-  State.regs[REG_MDR] = next_pc;
-  State.regs[REG_PC] += (((insn & 0xffffff) << 8) | ((extension & 0xff0000) >> 16)) - 7;
-}
-
-/* calls (an) */
-void OP_F0F0 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned int next_pc, sp;
-
-  sp = State.regs[REG_SP];
-  next_pc = State.regs[REG_PC] + 2;
-  State.mem[sp] = next_pc & 0xff;
-  State.mem[sp+1] = (next_pc & 0xff00) >> 8;
-  State.mem[sp+2] = (next_pc & 0xff0000) >> 16;
-  State.mem[sp+3] = (next_pc & 0xff000000) >> 24;
-  State.regs[REG_MDR] = next_pc;
-  State.regs[REG_PC] = State.regs[REG_A0 + REG0 (insn)] - 2;
-}
-
-/* calls label:16 */
-void OP_FAFF0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned int next_pc, sp;
-
-  sp = State.regs[REG_SP];
-  next_pc = State.regs[REG_PC] + 4;
-  State.mem[sp] = next_pc & 0xff;
-  State.mem[sp+1] = (next_pc & 0xff00) >> 8;
-  State.mem[sp+2] = (next_pc & 0xff0000) >> 16;
-  State.mem[sp+3] = (next_pc & 0xff000000) >> 24;
-  State.regs[REG_MDR] = next_pc;
-  State.regs[REG_PC] += SEXT16 (insn & 0xffff) - 4;
-}
-
-/* calls label:32 */
-void OP_FCFF0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned int next_pc, sp;
-
-  sp = State.regs[REG_SP];
-  next_pc = State.regs[REG_PC] + 6;
-  State.mem[sp] = next_pc & 0xff;
-  State.mem[sp+1] = (next_pc & 0xff00) >> 8;
-  State.mem[sp+2] = (next_pc & 0xff0000) >> 16;
-  State.mem[sp+3] = (next_pc & 0xff000000) >> 24;
-  State.regs[REG_MDR] = next_pc;
-  State.regs[REG_PC] += (((insn & 0xffff) << 16) + extension) - 6;
-}
-
-/* ret reg_list, imm8 */
-void OP_DF0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned int sp, offset;
-  unsigned long mask;
-
-  State.regs[REG_SP] += insn & 0xff;
-  sp = State.regs[REG_SP];
-
-  offset = -4;
-  mask = (insn & 0xff00) >> 8;
-
-  if (mask & 0x80)
-    {
-      State.regs[REG_D0 + 2] = load_word (sp + offset);
-      offset -= 4;
-    }
-
-  if (mask & 0x40)
-    {
-      State.regs[REG_D0 + 3] = load_word (sp + offset);
-      offset -= 4;
-    }
-
-  if (mask & 0x20)
-    {
-      State.regs[REG_A0 + 2] = load_word (sp + offset);
-      offset -= 4;
-    }
-
-  if (mask & 0x10)
-    {
-      State.regs[REG_A0 + 3] = load_word (sp + offset);
-      offset -= 4;
-    }
-
-  if (mask & 0x8)
-    {
-      State.regs[REG_D0] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_D0 + 1] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_A0] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_A0 + 1] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_MDR] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_LIR] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_LAR] = load_word (sp + offset);
-      offset -= 4;
-    }
-
-  /* Restore the PC value.  */
-  State.regs[REG_PC] = (State.mem[sp] | (State.mem[sp+1] << 8)
-	      | (State.mem[sp+2] << 16) | (State.mem[sp+3] << 24));
-  State.regs[REG_PC] -= 3;
-}
-
-/* retf reg_list,imm8 */
-void OP_DE0000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned int sp, offset;
-  unsigned long mask;
-
-  State.regs[REG_SP] += (insn & 0xff);
-  sp = State.regs[REG_SP];
-  State.regs[REG_PC] = State.regs[REG_MDR] - 3;
-
-  offset = -4;
-  mask = (insn & 0xff00) >> 8;
-
-  if (mask & 0x80)
-    {
-      State.regs[REG_D0 + 2] = load_word (sp + offset);
-      offset -= 4;
-    }
-
-  if (mask & 0x40)
-    {
-      State.regs[REG_D0 + 3] = load_word (sp + offset);
-      offset -= 4;
-    }
-
-  if (mask & 0x20)
-    {
-      State.regs[REG_A0 + 2] = load_word (sp + offset);
-      offset -= 4;
-    }
-
-  if (mask & 0x10)
-    {
-      State.regs[REG_A0 + 3] = load_word (sp + offset);
-      offset -= 4;
-    }
-
-  if (mask & 0x8)
-    {
-      State.regs[REG_D0] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_D0 + 1] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_A0] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_A0 + 1] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_MDR] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_LIR] = load_word (sp + offset);
-      offset -= 4;
-      State.regs[REG_LAR] = load_word (sp + offset);
-      offset -= 4;
-    }
-}
-
-/* rets */
-void OP_F0FC (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned int sp;
-
-  sp = State.regs[REG_SP];
-  State.regs[REG_PC] = (State.mem[sp] | (State.mem[sp+1] << 8)
-	      | (State.mem[sp+2] << 16) | (State.mem[sp+3] << 24));
-  State.regs[REG_PC] -= 2;
-}
-
-/* rti */
-void OP_F0FD (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned int sp, next_pc;
-
-  sp = State.regs[REG_SP];
-  PSW = State.mem[sp] | (State.mem[sp + 1] << 8);
-  State.regs[REG_PC] = (State.mem[sp+4] | (State.mem[sp+5] << 8)
-	      | (State.mem[sp+6] << 16) | (State.mem[sp+7] << 24));
-  State.regs[REG_SP] += 8;
-}
-
-/* trap */
-void OP_F0FE (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned int sp, next_pc;
-
-  sp = State.regs[REG_SP];
-  next_pc = State.regs[REG_PC] + 2;
-  State.mem[sp] = next_pc & 0xff;
-  State.mem[sp+1] = (next_pc & 0xff00) >> 8;
-  State.mem[sp+2] = (next_pc & 0xff0000) >> 16;
-  State.mem[sp+3] = (next_pc & 0xff000000) >> 24;
-  State.regs[REG_PC] = 0x40000010 - 2;
-}
-
-/* syscall */
-void OP_F0C0 (insn, extension)
-     unsigned long insn, extension;
-{
-  /* We use this for simulated system calls; we may need to change
-     it to a reserved instruction if we conflict with uses at
-     Matsushita.  */
-  int save_errno = errno;	
-  errno = 0;
-
-/* Registers passed to trap 0 */
-
-/* Function number.  */
-#define FUNC   (State.regs[0])
-
-/* Parameters.  */
-#define PARM1   (State.regs[1])
-#define PARM2   (load_word (State.regs[REG_SP] + 12))
-#define PARM3   (load_word (State.regs[REG_SP] + 16))
-
-/* Registers set by trap 0 */
-
-#define RETVAL State.regs[0]	/* return value */
-#define RETERR State.regs[1]	/* return error code */
-
-/* Turn a pointer in a register into a pointer into real memory. */
-
-#define MEMPTR(x) (State.mem + x)
-
-  switch (FUNC)
-    {
-#if !defined(__GO32__) && !defined(_WIN32)
-#ifdef TARGET_SYS_fork
-      case TARGET_SYS_fork:
-      RETVAL = fork ();
-      break;
-#endif
-#ifdef TARGET_SYS_execve
-    case TARGET_SYS_execve:
-      RETVAL = execve (MEMPTR (PARM1), (char **) MEMPTR (PARM2),
-		       (char **)MEMPTR (PARM3));
-      break;
-#endif
-#ifdef TARGET_SYS_execv
-    case TARGET_SYS_execv:
-      RETVAL = execve (MEMPTR (PARM1), (char **) MEMPTR (PARM2), NULL);
-      break;
-#endif
-#endif	/* ! GO32 and ! WIN32 */
-
-    case TARGET_SYS_read:
-      RETVAL = mn10300_callback->read (mn10300_callback, PARM1,
-				    MEMPTR (PARM2), PARM3);
-      break;
-    case TARGET_SYS_write:
-      RETVAL = (int)mn10300_callback->write (mn10300_callback, PARM1,
-					     MEMPTR (PARM2), PARM3);
-      break;
-    case TARGET_SYS_lseek:
-      RETVAL = mn10300_callback->lseek (mn10300_callback, PARM1, PARM2, PARM3);
-      break;
-    case TARGET_SYS_close:
-      RETVAL = mn10300_callback->close (mn10300_callback, PARM1);
-      break;
-    case TARGET_SYS_open:
-      RETVAL = mn10300_callback->open (mn10300_callback, MEMPTR (PARM1), PARM2);
-      break;
-    case TARGET_SYS_exit:
-      /* EXIT - caller can look in PARM1 to work out the 
-	 reason */
-      if (PARM1 == 0xdead)
-	State.exception = SIGABRT;
-      else
-	State.exception = SIGQUIT;
-      State.exited = 1;
-      break;
-
-    case TARGET_SYS_stat:	/* added at hmsi */
-      /* stat system call */
-      {
-	struct stat host_stat;
-	reg_t buf;
-
-	RETVAL = stat (MEMPTR (PARM1), &host_stat);
-	
-	buf = PARM2;
-
-	/* Just wild-assed guesses.  */
-	store_half (buf, host_stat.st_dev);
-	store_half (buf + 2, host_stat.st_ino);
-	store_word (buf + 4, host_stat.st_mode);
-	store_half (buf + 8, host_stat.st_nlink);
-	store_half (buf + 10, host_stat.st_uid);
-	store_half (buf + 12, host_stat.st_gid);
-	store_half (buf + 14, host_stat.st_rdev);
-	store_word (buf + 16, host_stat.st_size);
-	store_word (buf + 20, host_stat.st_atime);
-	store_word (buf + 28, host_stat.st_mtime);
-	store_word (buf + 36, host_stat.st_ctime);
-      }
-      break;
-
-#ifdef TARGET_SYS_chown
-    case TARGET_SYS_chown:
-      RETVAL = chown (MEMPTR (PARM1), PARM2, PARM3);
-      break;
-#endif
-    case TARGET_SYS_chmod:
-      RETVAL = chmod (MEMPTR (PARM1), PARM2);
-      break;
-#ifdef TARGET_SYS_time
-    case TARGET_SYS_time:
-      RETVAL = time ((void*) MEMPTR (PARM1));
-      break;
-#endif
-#ifdef TARGET_SYS_times
-    case TARGET_SYS_times:
-      {
-	struct tms tms;
-	RETVAL = times (&tms);
-	store_word (PARM1, tms.tms_utime);
-	store_word (PARM1 + 4, tms.tms_stime);
-	store_word (PARM1 + 8, tms.tms_cutime);
-	store_word (PARM1 + 12, tms.tms_cstime);
-	break;
-      }
-#endif
-#ifdef TARGET_SYS_gettimeofday
-    case TARGET_SYS_gettimeofday:
-      {
-	struct timeval t;
-	struct timezone tz;
-	RETVAL = gettimeofday (&t, &tz);
-	store_word (PARM1, t.tv_sec);
-	store_word (PARM1 + 4, t.tv_usec);
-	store_word (PARM2, tz.tz_minuteswest);
-	store_word (PARM2 + 4, tz.tz_dsttime);
-	break;
-      }
-#endif
-#ifdef TARGET_SYS_utime
-    case TARGET_SYS_utime:
-      /* Cast the second argument to void *, to avoid type mismatch
-	 if a prototype is present.  */
-      RETVAL = utime (MEMPTR (PARM1), (void *) MEMPTR (PARM2));
-      break;
-#endif
-    default:
-      abort ();
-    }
-  RETERR = errno;
-  errno = save_errno;
-}
-
-/* rtm */
-void OP_F0FF (insn, extension)
-     unsigned long insn, extension;
-{
- abort ();
-}
-
-/* nop */
-void OP_CB (insn, extension)
-     unsigned long insn, extension;
-{
-}
-
-/* putx dm,dm */
-void OP_F500 (insn, extension)
-     unsigned long insn, extension;
-{
-  State.regs[REG_MDRQ] = State.regs[REG_D0 + REG0 (insn)];
-}
-
-/* getx dm,dm */
-void OP_F6F0 (insn, extension)
-     unsigned long insn, extension;
-{
-  int z, n;
-  z = (State.regs[REG_MDRQ] == 0);
-  n = ((State.regs[REG_MDRQ] & 0x80000000) != 0);
-  State.regs[REG_D0 + REG0 (insn)] = State.regs[REG_MDRQ];
-
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= (z ? PSW_Z : 0) | (n ? PSW_N : 0);
-}
-
-/* mulq dm,dn */
-void OP_F600 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = ((signed64)(signed32)State.regs[REG_D0 + REG0 (insn)]
-          *  (signed64)(signed32)State.regs[REG_D0 + REG1 (insn)]);
-  State.regs[REG_D0 + REG0 (insn)] = temp & 0xffffffff;
-  State.regs[REG_MDRQ] = (temp & 0xffffffff00000000LL) >> 32;;
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* mulq imm8,dn */
-void OP_F90000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = ((signed64)(signed32)State.regs[REG_D0 + REG0_8 (insn)]
-          * (signed64)(signed32)SEXT8 (insn & 0xff));
-  State.regs[REG_D0 + REG0_8 (insn)] = temp & 0xffffffff;
-  State.regs[REG_MDRQ] = (temp & 0xffffffff00000000LL) >> 32;;
-  z = (State.regs[REG_D0 + REG0_8 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_8 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* mulq imm16,dn */
-void OP_FB000000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = ((signed64)(signed32)State.regs[REG_D0 + REG0_16 (insn)]
-          * (signed64)(signed32)SEXT16 (insn & 0xffff));
-  State.regs[REG_D0 + REG0_16 (insn)] = temp & 0xffffffff;
-  State.regs[REG_MDRQ] = (temp & 0xffffffff00000000LL) >> 32;;
-  z = (State.regs[REG_D0 + REG0_16 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* mulq imm32,dn */
-void OP_FD000000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = ((signed64)(signed32)State.regs[REG_D0 + REG0_16 (insn)]
-          * (signed64)(signed32)(((insn & 0xffff) << 16) + extension));
-  State.regs[REG_D0 + REG0_16 (insn)] = temp & 0xffffffff;
-  State.regs[REG_MDRQ] = (temp & 0xffffffff00000000LL) >> 32;;
-  z = (State.regs[REG_D0 + REG0_16 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* mulqu dm,dn */
-void OP_F610 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = ((unsigned64) State.regs[REG_D0 + REG0 (insn)]
-	  * (unsigned64) State.regs[REG_D0 + REG1 (insn)]);
-  State.regs[REG_D0 + REG0 (insn)] = temp & 0xffffffff;
-  State.regs[REG_MDRQ] = (temp & 0xffffffff00000000LL) >> 32;;
-  z = (State.regs[REG_D0 + REG0 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* mulqu imm8,dn */
-void OP_F91400 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = ((unsigned64)State.regs[REG_D0 + REG0_8 (insn)]
-	  * (unsigned64)SEXT8 (insn & 0xff));
-  State.regs[REG_D0 + REG0_8 (insn)] = temp & 0xffffffff;
-  State.regs[REG_MDRQ] = (temp & 0xffffffff00000000LL) >> 32;;
-  z = (State.regs[REG_D0 + REG0_8 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_8 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* mulqu imm16,dn */
-void OP_FB140000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = ((unsigned64)State.regs[REG_D0 + REG0_16 (insn)]
-	  * (unsigned64) SEXT16 (insn & 0xffff));
-  State.regs[REG_D0 + REG0_16 (insn)] = temp & 0xffffffff;
-  State.regs[REG_MDRQ] = (temp & 0xffffffff00000000LL) >> 32;;
-  z = (State.regs[REG_D0 + REG0_16 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* mulqu imm32,dn */
-void OP_FD140000 (insn, extension)
-     unsigned long insn, extension;
-{
-  unsigned long long temp;
-  int n, z;
-
-  temp = ((unsigned64)State.regs[REG_D0 + REG0_16 (insn)]
-          * (unsigned64)(((insn & 0xffff) << 16) + extension));
-  State.regs[REG_D0 + REG0_16 (insn)] = temp & 0xffffffff;
-  State.regs[REG_MDRQ] = (temp & 0xffffffff00000000LL) >> 32;;
-  z = (State.regs[REG_D0 + REG0_16 (insn)] == 0);
-  n = (State.regs[REG_D0 + REG0_16 (insn)] & 0x80000000) != 0;
-  PSW &= ~(PSW_Z | PSW_N | PSW_C | PSW_V);
-  PSW |= ((z ? PSW_Z : 0) | (n ? PSW_N : 0));
-}
-
-/* sat16 dm,dn */
-void OP_F640 (insn, extension)
-     unsigned long insn, extension;
-{
-  int temp;
-
-  temp = State.regs[REG_D0 + REG1 (insn)];
-  temp = (temp > 0x7fff ? 0x7fff : temp);
-  temp = (temp < -0x8000 ? -0x8000 : temp);
-  State.regs[REG_D0 + REG0 (insn)] = temp;
-}
-
-/* sat24 dm,dn */
-void OP_F650 (insn, extension)
-     unsigned long insn, extension;
-{
-  int temp;
-
-  temp = State.regs[REG_D0 + REG1 (insn)];
-  temp = (temp > 0x7fffff ? 0x7fffff : temp);
-  temp = (temp < -0x800000 ? -0x800000 : temp);
-  State.regs[REG_D0 + REG0 (insn)] = temp;
-}
-
-/* bsch dm,dn */
-void OP_F670 (insn, extension)
-     unsigned long insn, extension;
-{
-  int temp, c;
-
-  temp = State.regs[REG_D0 + REG1 (insn)];
-  temp <<= (State.regs[REG_D0 + REG0 (insn)] & 0x1f);
-  c = (temp != 0 ? 1 : 0);
-  PSW &= ~(PSW_C);
-  PSW |= (c ? PSW_C : 0);
-}
-
-/* breakpoint */
-void
-OP_FF (insn, extension)
-     unsigned long insn, extension;
-{
-  State.exception = SIGTRAP;
-  PC -= 1;
-}
-
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index d4f94c3..61a539b 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,53 @@
+2004-07-06  Jim Blandy  <jimb@redhat.com>
+
+	* Makefile.in: Update all dependency information.
+	(BASICS_H, CPU_H, IDECODE_H, PSIM_H, REGISTERS_H, DEVICE_TABLE_H)
+	(EMUL_GENERIC_H): Values updated.
+	(ACCONFIG_H, ALTIVEC_EXPRESSION_H, ALTIVEC_REGISTERS_H)
+	(ANSIDECL_H, BFD_H, BITS_H, CAP_H, COMMON_SIM_BASE_H)
+	(COMMON_SIM_BASICS_H, COMMON_SIM_FPU_H, COMMON_SIM_INLINE_H)
+	(COMMON_SIM_SIGNAL_H, CONFIG_H, COREFILE_H, COREFILE_N_H, DEBUG_H)
+	(DEFINES_H, DEFS_H, DEVICE_H, E500_EXPRESSION_H, E500_REGISTERS_H)
+	(EMUL_BUGAPI_H, EMUL_CHIRP_H, EMUL_NETBSD_H, EMUL_UNIX_H, EVENTS_H)
+	(FILTER_FILENAME_H, FILTER_H, GDB_CALLBACK_H, GDB_REMOTE_SIM_H)
+	(GEN_ICACHE_H, GEN_IDECODE_H, GEN_ITABLE_H, GEN_MODEL_H)
+	(GEN_SEMANTICS_H, GEN_SUPPORT_H, HW_CPU_H, HW_H, HW_PHB_H)
+	(ICACHE_H, IDECODE_BRANCH_H, IDECODE_EXPRESSION_H)
+	(IDECODE_FIELDS_H, IGEN_H, INLINE_H, INTERRUPTS_H, ITABLE_H)
+	(LD_CACHE_H, LD_DECODE_H, LD_INSN_H, LF_H, MISC_H, MODEL_H, MON_H)
+	(OPTIONS_H, OS_EMUL_H, PK_H, PPC_CONFIG_H, SEMANTICS_H)
+	(SIM_CALLBACKS_H, SIM_ENDIAN_H, SIM_ENDIAN_N_H, SIM_MAIN_H)
+	(SPREG_H, STD_CONFIG_H, SUPPORT_H, TABLE_H, TARG_VALS_H, TCONFIG_H)
+	(TREE_H, VM_H, VM_N_H, WORDS_H): New variables.
+	(callback.o, cap.o, corefile.o, debug.o, device.o, device_table.o)
+	(dgen.o, emul_bugapi.o, emul_chirp.o, emul_netbsd.o, emul_unix.o)
+	(events.o, filter.o, filter_filename.o, filter_host.o)
+	(gen-icache.o, gen-idecode.o, gen-itable.o, gen-model.o)
+	(gen-semantics.o, gen-support.o, hw_core.o, hw_cpu.o, hw_disk.o)
+	(hw_htab.o, hw_init.o, hw_phb.o, hw_register.o, icache.o)
+	(idecode.o, igen.o, interrupts.o, itable.o, ld-cache.o)
+	(ld-decode.o, ld-insn.o, lf.o, main.o, misc.o, model.o, mon.o)
+	(options.o, os_emul.o, pk_disklabel.o, psim.o, registers.o)
+	(semantics.o, sim-endian.o, sim-fpu.o, sim_calls.o, spreg.o)
+	(support.o, table.o, targ-map.o, tree.o, vm.o): Update dependencies.
+
+2004-06-28  Jim Blandy  <jimb@redhat.com>
+
+	* e500_registers.h (EVR): Cast the 32-bit value of the GPR to an
+	unsigned type before or-ing it with a 64-bit value.
+
+2004-06-15  Alan Modra  <amodra@bigpond.net.au>
+
+	* hw_htab.c (htab_sum_binary(bfd): Use bfd_get_section_size
+	instead of bfd_get_section_size_before_reloc.
+	(htab_dma_binary(bfd): Likewise.
+	* hw_init.c (update_for_binary_section(bfd): Likewise.
+
+2004-05-10  Daniel Jacobowitz  <dan@debian.org>
+
+	* configure.in (sim_fpu_cflags): Add -I../common.
+	* configure: Regenerated.
+
 2004-01-27  Andrew Cagney  <cagney@redhat.com>
 
 	* ppc-instructions: Update copyright.
diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 335a8b4..5dbd686 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -169,64 +169,282 @@
 	$(CC) -c $(STD_CFLAGS) $<
 
 
+# Headers outside sim/ppc.
+ANSIDECL_H = $(srcroot)/include/ansidecl.h
+BFD_H = ../../bfd/bfd.h
+DEFS_H = $(srcroot)/gdb/defs.h
+GDB_CALLBACK_H = $(srcroot)/include/gdb/callback.h
+GDB_REMOTE_SIM_H = $(srcroot)/include/gdb/remote-sim.h
+COMMON_SIM_BASE_H = $(srcroot)/sim/common/sim-base.h
+COMMON_SIM_BASICS_H = $(srcroot)/sim/common/sim-basics.h
+COMMON_SIM_FPU_H = $(srcroot)/sim/common/sim-fpu.h
+COMMON_SIM_INLINE_H = $(srcroot)/sim/common/sim-inline.h
+COMMON_SIM_SIGNAL_H = $(srcroot)/sim/common/sim-signal.h
+
+# Headers in sim/ppc.
+ACCONFIG_H = \
+	acconfig.h
+
+ALTIVEC_EXPRESSION_H = \
+	altivec_expression.h
+
+ALTIVEC_REGISTERS_H = \
+	altivec_registers.h
 
 BASICS_H = \
 	basics.h \
-	config.h \
-	ppc-config.h \
-	inline.h \
-	sim_callbacks.h \
-	debug.h filter_filename.h \
-	words.h \
-	bits.h \
-	sim-endian.h
+	$(CONFIG_H) \
+	$(PPC_CONFIG_H) \
+	$(INLINE_H) \
+	$(SIM_CALLBACKS_H) \
+	$(DEBUG_H) \
+	$(WORDS_H) \
+	$(BITS_H) \
+	$(SIM_ENDIAN_H)
 
-PSIM_H = \
-	psim.h \
+BITS_H = \
+	bits.h \
+	bits.c
+
+CAP_H = \
+	cap.h \
 	$(BASICS_H)
 
-IDECODE_H = \
-	idecode.h \
-	idecode_expression.h e500_expression.h altivec_expression.h \
-	idecode_branch.h \
-	idecode_fields.h \
-	icache.h
+COREFILE_H = \
+	corefile.h
 
-REGISTERS_H = \
-	registers.h \
-	e500_registers.h \
-	altivec_registers.h \
-	spreg.h
+COREFILE_N_H = \
+	corefile-n.h
 
 CPU_H = \
 	cpu.h \
 	$(BASICS_H) \
 	$(REGISTERS_H) \
+	$(DEVICE_H) \
+	$(COREFILE_H) \
+	$(VM_H) \
+	$(EVENTS_H) \
+	$(INTERRUPTS_H) \
+	$(PSIM_H) \
 	$(IDECODE_H) \
-	device.h \
-	corefile.h \
-	vm.h \
-	events.h \
-	interrupts.h \
-	psim.h \
-	itable.h \
-	mon.h \
-	model.h
+	$(ITABLE_H) \
+	$(OS_EMUL_H) \
+	$(MON_H) \
+	$(MODEL_H) \
+	cpu.c
+
+DEBUG_H = \
+	debug.h \
+	$(FILTER_FILENAME_H)
+
+DEVICE_H = \
+	device.h
 
 DEVICE_TABLE_H = \
-	$(BASICS_H) \
 	device_table.h \
-	device.h \
-	tree.h \
-	hw.h
+	$(BASICS_H) \
+	$(DEVICE_H) \
+	$(TREE_H) \
+	$(HW_H)
+
+E500_EXPRESSION_H = \
+	e500_expression.h
+
+E500_REGISTERS_H = \
+	e500_registers.h
+
+EMUL_BUGAPI_H = \
+	emul_bugapi.h
+
+EMUL_CHIRP_H = \
+	emul_chirp.h
 
 EMUL_GENERIC_H = \
+	emul_generic.h \
 	$(CPU_H) \
 	$(IDECODE_H) \
-	emul_generic.h \
-	tree.h \
+	$(OS_EMUL_H) \
+	$(TREE_H) \
+	$(BFD_H)
+
+EMUL_NETBSD_H = \
+	emul_netbsd.h
+
+EMUL_UNIX_H = \
+	emul_unix.h
+
+EVENTS_H = \
+	events.h
+
+FILTER_FILENAME_H = \
+	filter_filename.h
+
+FILTER_H = \
+	filter.h
+
+GEN_ICACHE_H = \
+	gen-icache.h
+
+GEN_IDECODE_H = \
+	gen-idecode.h
+
+GEN_ITABLE_H = \
+	gen-itable.h
+
+GEN_MODEL_H = \
+	gen-model.h
+
+GEN_SEMANTICS_H = \
+	gen-semantics.h
+
+GEN_SUPPORT_H = \
+	gen-support.h
+
+HW_CPU_H = \
+	hw_cpu.h
+
+HW_PHB_H = \
+	hw_phb.h
+
+IDECODE_BRANCH_H = \
+	idecode_branch.h
+
+IDECODE_EXPRESSION_H = \
+	idecode_expression.h \
+	$(ALTIVEC_EXPRESSION_H) \
+	$(E500_EXPRESSION_H)
+
+IDECODE_FIELDS_H = \
+	idecode_fields.h
+
+IGEN_H = \
+	igen.h
+
+INLINE_H = \
+	inline.h
+
+INTERRUPTS_H = \
+	interrupts.h
+
+LD_CACHE_H = \
+	ld-cache.h
+
+LD_DECODE_H = \
+	ld-decode.h
+
+LD_INSN_H = \
+	ld-insn.h
+
+LF_H = \
+	lf.h
+
+MISC_H = \
+	misc.h \
+	$(CONFIG_H) \
+	$(FILTER_FILENAME_H)
+
+MON_H = \
+	mon.h \
+	$(BASICS_H) \
+	$(ITABLE_H)
+
+OPTIONS_H = \
+	options.h
+
+OS_EMUL_H = \
 	os_emul.h
 
+PSIM_H = \
+	psim.h \
+	$(BASICS_H)
+
+REGISTERS_H = \
+	registers.h \
+	$(E500_REGISTERS_H) \
+	$(ALTIVEC_REGISTERS_H) \
+	$(SPREG_H)
+
+SIM_CALLBACKS_H = \
+	sim_callbacks.h
+
+SIM_ENDIAN_H = \
+	sim-endian.h \
+	sim-endian.c
+
+SIM_ENDIAN_N_H = \
+	sim-endian-n.h
+
+SIM_MAIN_H = \
+	sim-main.h \
+	$(COMMON_SIM_BASICS_H) \
+	$(COMMON_SIM_SIGNAL_H) \
+	$(COMMON_SIM_BASE_H)
+
+STD_CONFIG_H = \
+	std-config.h
+
+TABLE_H = \
+	table.h
+
+TREE_H = \
+	tree.h
+
+VM_H = \
+	vm.h
+
+VM_N_H = \
+	vm_n.h
+
+WORDS_H = \
+	words.h
+
+
+# Generated headers.
+CONFIG_H = \
+        config.h
+
+DEFINES_H = \
+        defines.h
+
+HW_H = \
+        hw.h
+
+ICACHE_H = \
+        icache.h
+
+IDECODE_H = \
+        idecode.h \
+        $(IDECODE_EXPRESSION_H) \
+        $(IDECODE_FIELDS_H) \
+        $(IDECODE_BRANCH_H)
+
+ITABLE_H = \
+        itable.h
+
+MODEL_H = \
+        model.h
+
+PK_H = \
+        pk.h
+
+PPC_CONFIG_H = \
+        ppc-config.h
+
+SEMANTICS_H = \
+        semantics.h
+
+SPREG_H = \
+        spreg.h
+
+SUPPORT_H = \
+        support.h \
+        support.c
+
+TARG_VALS_H = \
+        targ-vals.h
+
+TCONFIG_H = \
+        tconfig.h
 
 INLINE = \
 	inline.h \
@@ -342,66 +560,66 @@
 	$(AR) $(AR_FLAGS) $(TARGETLIB) $(LIB_OBJ) $(GDB_OBJ)
 	$(RANLIB) $(TARGETLIB)
 
-psim.o: psim.c psim.h tree.h $(CPU_H) $(IDECODE_H)
+psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)
 
 bits.o: bits.c $(BASICS_H)
 
-debug.o: debug.c $(BASICS_H)
-filter_filename.o: filter_filename.c filter_filename.h config.h ppc-config.h
+debug.o: debug.c $(CONFIG_H) $(BASICS_H)
+filter_filename.o: filter_filename.c $(CONFIG_H) $(PPC_CONFIG_H) $(FILTER_FILENAME_H)
 
-sim-endian.o: sim-endian.c sim-endian-n.h $(BASICS_H)
+sim-endian.o: sim-endian.c $(CONFIG_H) $(BASICS_H) $(SIM_ENDIAN_N_H)
 
-os_emul.o: os_emul.c emul_netbsd.h emul_unix.h emul_chirp.h emul_bugapi.h $(EMUL_GENERIC_H)
+os_emul.o: os_emul.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H) $(EMUL_GENERIC_H) $(EMUL_NETBSD_H) $(EMUL_UNIX_H) $(EMUL_CHIRP_H) $(EMUL_BUGAPI_H)
 emul_generic.o: emul_generic.c $(EMUL_GENERIC_H)
 
-emul_bugapi.o: emul_bugapi.c emul_bugapi.h $(EMUL_GENERIC_H)
-emul_chirp.o: emul_chirp.c emul_chirp.h $(EMUL_GENERIC_H)
-emul_netbsd.o: emul_netbsd.c emul_netbsd.h $(EMUL_GENERIC_H)
-emul_unix.o: emul_unix.c emul_unix.h $(EMUL_GENERIC_H)
+emul_bugapi.o: emul_bugapi.c $(EMUL_GENERIC_H) $(EMUL_BUGAPI_H)
+emul_chirp.o: emul_chirp.c $(EMUL_GENERIC_H) $(EMUL_CHIRP_H)
+emul_netbsd.o: emul_netbsd.c $(EMUL_GENERIC_H) $(EMUL_NETBSD_H)
+emul_unix.o: emul_unix.c $(EMUL_GENERIC_H) $(EMUL_UNIX_H)
 
-registers.o: registers.c $(REGISTERS_H) $(BASICS_H) 
+registers.o: registers.c $(BASICS_H) $(REGISTERS_H)
 
 cpu.o: cpu.c $(CPU_H) $(IDECODE_H)
 
-interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) os_emul.h
+interrupts.o: interrupts.c $(CPU_H) $(IDECODE_H) $(OS_EMUL_H)
 
 # Given that inlines are turned on now, rebuild idecode whenever
 # anything changes.
-idecode.o: idecode.c $(CPU_H) $(IDECODE_H) semantics.h $(LIB_INLINE_SRC) $(BUILT_SRC)
+idecode.o: idecode.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(LIB_INLINE_SRC) $(BUILT_SRC)
 
 # double.o: double.c dp-bit.c
 
-vm.o: vm.c vm.h vm_n.h $(CPU_H)
+vm.o: vm.c $(BASICS_H) $(REGISTERS_H) $(DEVICE_H) $(COREFILE_H) $(VM_H) $(INTERRUPTS_H) $(MON_H) $(CPU_H) $(VM_N_H)
 
-corefile.o: corefile.c corefile.h corefile-n.h $(BASICS_H) $(DEVICE_TABLE_H)
+corefile.o: corefile.c $(BASICS_H) $(DEVICE_TABLE_H) $(COREFILE_H) $(COREFILE_N_H)
 
-model.o: model.c $(CPU_H)
+model.o: model.c $(CPU_H) $(MON_H)
 
-events.o: events.c events.h $(BASICS_H) 
+events.o: events.c $(BASICS_H) $(EVENTS_H)
 
-sim_calls.o: sim_calls.c $(PSIM_H) itable.h options.h
+sim_calls.o: sim_calls.c $(PSIM_H) $(OPTIONS_H) $(DEFS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
 
-spreg.o: spreg.c spreg.h spreg.c $(BASICS_H)
+spreg.o: spreg.c $(BASICS_H) $(SPREG_H)
 
-main.o: main.c $(PSIM_H) itable.h options.h
+main.o: main.c $(PSIM_H) $(OPTIONS_H) $(DEVICE_H) $(EVENTS_H) $(BFD_H) $(GDB_CALLBACK_H) $(GDB_REMOTE_SIM_H)
 
-device.o: device.c $(DEVICE_TABLE_H) cap.h
+device.o: device.c $(DEVICE_TABLE_H) $(CAP_H) $(EVENTS_H) $(PSIM_H)
 
-tree.o: tree.c tree.h device.h $(DEVICE_TABLE_H)
+tree.o: tree.c $(BASICS_H) $(DEVICE_H) $(TREE_H)
 
-device_table.o: device_table.c $(DEVICE_TABLE_H) events.h hw.c
+device_table.o: device_table.c $(DEVICE_TABLE_H) hw.c
 
-cap.o: cap.c cap.h $(BASICS_H)
+cap.o: cap.c $(CAP_H)
 
-semantics.o: semantics.c semantics.h $(CPU_H) $(IDECODE_H)
+semantics.o: semantics.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
 
-icache.o: icache.c icache.h $(IDECODE_H) $(CPU_H)
+icache.o: icache.c $(CPU_H) $(IDECODE_H) $(SEMANTICS_H) $(ICACHE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
 
-support.o: support.c support.h $(IDECODE_H) $(CPU_H)
+support.o: support.c $(CPU_H) $(IDECODE_H) $(COMMON_SIM_INLINE_H) $(COMMON_SIM_FPU_H) $(SUPPORT_H)
 
-itable.o: itable.c itable.h
+itable.o: itable.c $(ITABLE_H)
 
-mon.o: mon.c $(CPU_H)
+mon.o: mon.c $(BASICS_H) $(CPU_H) $(MON_H)
 
 # GDB after 4.16 expects the default_callback structure to be setup.
 # As a kludge, build the common stuff here for now.
@@ -423,12 +641,12 @@
 	./gentmap -c > tmp-map.c
 	$(SHELL) $(srcdir)/../../move-if-change tmp-map.c targ-map.c
 
-callback.o: ../common/callback.c targ-vals.h config.h
+callback.o: ../common/callback.c $(TARG_VALS_H) $(CONFIG_H)
 	$(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $<
 
-targ-map.o: targ-map.c targ-vals.h
+targ-map.o: targ-map.c $(ANSIDECL_H) $(GDB_CALLBACK_H) $(TARG_VALS_H)
 
-sim-fpu.o: $(srcdir)/../common/sim-fpu.c config.h tconfig.h
+sim-fpu.o: $(srcdir)/../common/sim-fpu.c $(CONFIG_H) $(TCONFIG_H)
 	$(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/sim-fpu.c 
 
 tconfig.h:
@@ -436,7 +654,7 @@
 	echo > tconfig.h
 
 # Rebuild options whenever something changes so the date/time is up to date.
-options.o: options.c $(BASICS_H) $(CPU_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile defines.h
+options.o: options.c $(CPU_H) $(OPTIONS_H) $(DEFINES_H) $(BASICS_H) $(IDECODE_H) $(INLINE) $(LIB_SRC) $(BUILT_SRC) config.status Makefile
 	$(CC) -c $(STD_CFLAGS) '-DOPCODE_RULES="@sim_opcode@"' '-DIGEN_FLAGS="$(IGEN_FLAGS)"' '-DDGEN_FLAGS="$(DGEN_FLAGS)"' $<
 
 tmp-defines: config.h Makefile
@@ -507,60 +725,60 @@
 filter_host.c: filter_filename.c
 	cat $(srcdir)/filter_filename.c > filter_host.c
 
-filter_host.o: filter_host.c filter_filename.h config.h ppc-config.h
+filter_host.o: filter_host.c $(CONFIG_H) $(PPC_CONFIG_H) $(FILTER_FILENAME_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c filter_host.c
 
-table.o: table.c misc.h filter_filename.h lf.h table.h
+table.o: table.c $(CONFIG_H) $(MISC_H) $(LF_H) $(TABLE_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/table.c
 
-lf.o: lf.c misc.h filter_filename.h lf.h
+lf.o: lf.c $(CONFIG_H) $(MISC_H) $(LF_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/lf.c
 
-filter.o: filter.c misc.h lf.h table.h filter.h
+filter.o: filter.c $(CONFIG_H) $(MISC_H) $(FILTER_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/filter.c
-tmp-filter: filter.c misc.h misc.o
+tmp-filter: filter.c $(MISC_H) misc.o
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-filter -DMAIN $(srcdir)/filter.c misc.o $(BUILD_LIBS)
 
-ld-decode.o: ld-decode.c misc.h lf.h table.h ld-decode.h
+ld-decode.o: ld-decode.c $(MISC_H) $(LF_H) $(TABLE_H) $(LD_DECODE_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-decode.c
 tmp-ld-decode: ld-decode.o misc.o lf.o table.o filter_host.o 
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-decode -DMAIN $(srcdir)/ld-decode.c misc.o lf.o table.o filter_host.o $(BUILD_LIBS)
 
-ld-cache.o: ld-cache.c misc.h lf.h table.h ld-cache.h
+ld-cache.o: ld-cache.c $(MISC_H) $(LF_H) $(TABLE_H) $(LD_CACHE_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-cache.c
 tmp-ld-cache: ld-cache.o misc.o lf.o table.o filter_host.o 
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-cache -DMAIN $(srcdir)/ld-cache.c misc.o lf.o table.o filter_host.o $(BUILD_LIBS)
 
-ld-insn.o: ld-insn.c misc.h lf.h table.h ld-insn.h ld-decode.h igen.h
+ld-insn.o: ld-insn.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/ld-insn.c
 tmp-ld-insn: ld-insn.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o tmp-ld-insn -DMAIN $(srcdir)/ld-insn.c ld-cache.o misc.o lf.o table.o ld-decode.o filter_host.o filter.o $(BUILD_LIBS)
 
-gen-model.o: gen-model.c misc.h lf.h table.h gen-model.h ld-decode.h igen.h ld-insn.h ld-cache.h
+gen-model.o: gen-model.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(GEN_MODEL_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-model.c
 
-gen-itable.o: gen-itable.c misc.h lf.h table.h gen-itable.h ld-decode.h igen.h ld-insn.h igen.h ld-cache.h
+gen-itable.o: gen-itable.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_ITABLE_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-itable.c
 
-gen-icache.o: gen-icache.c misc.h lf.h table.h gen-icache.h ld-decode.h igen.h ld-insn.h gen-semantics.h gen-idecode.h
+gen-icache.o: gen-icache.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_IDECODE_H) $(GEN_ICACHE_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-icache.c
 
-gen-semantics.o: gen-semantics.c misc.h lf.h table.h gen-semantics.h ld-decode.h igen.h ld-insn.h
+gen-semantics.o: gen-semantics.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_ICACHE_H) $(GEN_IDECODE_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-semantics.c
 
-gen-idecode.o: gen-idecode.c misc.h lf.h table.h gen-idecode.h gen-icache.h gen-semantics.h ld-decode.h igen.h ld-insn.h 
+gen-idecode.o: gen-idecode.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_IDECODE_H) $(GEN_ICACHE_H) $(GEN_SEMANTICS_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-idecode.c
 
-gen-support.o: gen-support.c misc.h lf.h table.h gen-support.h ld-decode.h igen.h ld-insn.h
+gen-support.o: gen-support.c $(MISC_H) $(LF_H) $(TABLE_H) $(FILTER_H) $(LD_DECODE_H) $(LD_CACHE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_SEMANTICS_H) $(GEN_SUPPORT_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gen-support.c
 
-dgen.o: dgen.c misc.h filter_filename.h lf.h table.h
+dgen.o: dgen.c $(CONFIG_H) $(MISC_H) $(LF_H) $(TABLE_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/dgen.c
 
-igen.o: igen.c misc.h filter_filename.h lf.h table.h ld-decode.h ld-cache.h ld-insn.h filter.h gen-model.h gen-itable.h gen-icache.h gen-idecode.h gen-semantics.h gen-support.h igen.h 
+igen.o: igen.c $(MISC_H) $(LF_H) $(TABLE_H) $(CONFIG_H) $(FILTER_H) $(LD_CACHE_H) $(LD_DECODE_H) $(LD_INSN_H) $(IGEN_H) $(GEN_MODEL_H) $(GEN_ICACHE_H) $(GEN_ITABLE_H) $(GEN_IDECODE_H) $(GEN_SEMANTICS_H) $(GEN_SUPPORT_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/igen.c
 
-misc.o: misc.c misc.h filter_filename.h
+misc.o: misc.c $(CONFIG_H) $(MISC_H)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/misc.c
 
 
@@ -596,20 +814,20 @@
 	$(SHELL) $(srcdir)/../../move-if-change tmp-hw.c hw.c
 	touch tmp-hw
 
-hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(CPU_H)
-hw_core.o: hw_core.c $(DEVICE_TABLE_H)
-hw_disk.o: hw_disk.c $(DEVICE_TABLE_H) pk.h
+hw_cpu.o: hw_cpu.c $(DEVICE_TABLE_H) $(HW_CPU_H) $(INTERRUPTS_H) $(CPU_H)
+hw_core.o: hw_core.c $(DEVICE_TABLE_H) $(COREFILE_H)
+hw_disk.o: hw_disk.c $(DEVICE_TABLE_H) $(PK_H)
 hw_glue.o: hw_glue.c $(DEVICE_TABLE_H)
-hw_htab.o: hw_htab.c $(DEVICE_TABLE_H)
+hw_htab.o: hw_htab.c $(DEVICE_TABLE_H) $(BFD_H)
 hw_ide.o: hw_ide.c $(DEVICE_TABLE_H)
-hw_init.o: hw_init.c $(DEVICE_TABLE_H)
+hw_init.o: hw_init.c $(DEVICE_TABLE_H) $(BFD_H) $(PSIM_H)
 hw_iobus.o: hw_iobus.c $(DEVICE_TABLE_H)
 hw_memory.o: hw_memory.c $(DEVICE_TABLE_H)
 hw_nvram.o: hw_nvram.c $(DEVICE_TABLE_H)
 hw_opic.o: hw_opic.c $(DEVICE_TABLE_H)
 hw_pal.o: hw_pal.c $(DEVICE_TABLE_H) $(CPU_H)
-hw_phb.o: hw_phb.c $(DEVICE_TABLE_H) hw_phb.h
-hw_register.o: hw_register.c $(DEVICE_TABLE_H)
+hw_phb.o: hw_phb.c $(DEVICE_TABLE_H) $(HW_PHB_H) $(COREFILE_H)
+hw_register.o: hw_register.c $(DEVICE_TABLE_H) $(PSIM_H)
 hw_trace.o: hw_trace.c $(DEVICE_TABLE_H)
 hw_vm.o: hw_vm.c $(DEVICE_TABLE_H) $(CPU_H)
 # ignore this line, it stops make from getting confused
@@ -634,7 +852,7 @@
 	$(SHELL) $(srcdir)/../../move-if-change tmp-pk.h pk.h
 	touch tmp-pk
 
-pk_disklabel.o: pk.h $(DEVICE_TABLE_H)
+pk_disklabel.o: pk_disklabel.c $(DEVICE_TABLE_H) $(PK_H)
 # ignore this line, it stops make from getting confused
 
 
diff --git a/sim/ppc/configure b/sim/ppc/configure
index a48a831..51f50c5 100755
--- a/sim/ppc/configure
+++ b/sim/ppc/configure
@@ -4675,7 +4675,7 @@
 echo "configure:4676: checking for common simulator directory fpu implementation" >&5
 if test -f "${srcdir}/../common/sim-fpu.c"; then
   echo "$ac_t""yes" 1>&6
-  sim_fpu_cflags="-DHAVE_COMMON_FPU -I${srcdir}/../common"
+  sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
   sim_fpu="sim-fpu.o"
 else
   echo "$ac_t""no" 1>&6
diff --git a/sim/ppc/configure.in b/sim/ppc/configure.in
index 0d7a094..1f0693c 100644
--- a/sim/ppc/configure.in
+++ b/sim/ppc/configure.in
@@ -700,7 +700,7 @@
 AC_MSG_CHECKING(for common simulator directory fpu implementation)
 if test -f "${srcdir}/../common/sim-fpu.c"; then
   AC_MSG_RESULT(yes)
-  sim_fpu_cflags="-DHAVE_COMMON_FPU -I${srcdir}/../common"
+  sim_fpu_cflags="-DHAVE_COMMON_FPU -I../common -I${srcdir}/../common"
   sim_fpu="sim-fpu.o"
 else
   AC_MSG_RESULT(no)
diff --git a/sim/ppc/e500_registers.h b/sim/ppc/e500_registers.h
index cd12ab5..ccf5e0f 100644
--- a/sim/ppc/e500_registers.h
+++ b/sim/ppc/e500_registers.h
@@ -79,5 +79,8 @@
 /* e500 register high bits */
 #define GPRH(N)		cpu_registers(processor)->e500.gprh[N]
 
-/* e500 unified vector register */
-#define EVR(N)		((((unsigned64)GPRH(N)) << 32) | GPR(N))
+/* e500 unified vector register
+   We need to cast the gpr value to an unsigned type so that it
+   doesn't get sign-extended when it's or-ed with a 64-bit value; that
+   would wipe out the upper 32 bits of the register's value.  */
+#define EVR(N)		((((unsigned64)GPRH(N)) << 32) | (unsigned32) GPR(N))
diff --git a/sim/ppc/hw_htab.c b/sim/ppc/hw_htab.c
index d536068..d9b280a 100644
--- a/sim/ppc/hw_htab.c
+++ b/sim/ppc/hw_htab.c
@@ -1,6 +1,6 @@
 /*  This file is part of the program psim.
 
-    Copyright 1994, 1995, 1996, 2003 Andrew Cagney
+    Copyright 1994, 1995, 1996, 2003, 2004 Andrew Cagney
 
     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
@@ -391,7 +391,7 @@
 		PTR data)
 {
   htab_binary_sizes *sizes = (htab_binary_sizes*)data;
-  unsigned_word size = bfd_get_section_size_before_reloc (sec);
+  unsigned_word size = bfd_get_section_size (sec);
   unsigned_word vma = bfd_get_section_vma (abfd, sec);
 #define bfd_get_section_lma(abfd, sec) ((sec)->lma + 0)
   unsigned_word ra = bfd_get_section_lma (abfd, sec);
@@ -437,7 +437,7 @@
     return;
 
   /* check/ignore any sections of size zero */
-  section_size = bfd_get_section_size_before_reloc(sec);
+  section_size = bfd_get_section_size (sec);
   if (section_size == 0)
     return;
 
diff --git a/sim/ppc/hw_init.c b/sim/ppc/hw_init.c
index 253ef7c..1ac5434 100644
--- a/sim/ppc/hw_init.c
+++ b/sim/ppc/hw_init.c
@@ -1,6 +1,6 @@
 /*  This file is part of the program psim.
     
-    Copyright 1994, 1997, 2003 Andrew Cagney
+    Copyright 1994, 1997, 2003, 2004 Andrew Cagney
     
     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
@@ -329,7 +329,7 @@
     return;
 
   /* check/ignore any sections of size zero */
-  section_size = bfd_get_section_size_before_reloc(the_section);
+  section_size = bfd_get_section_size (the_section);
   if (section_size == 0)
     return;
 
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index a344a6d..8c58cf4 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-12  Ben Elliston  <bje@au.ibm.com>
+
+	* lib/sim-defs.exp: Remove stray semicolons.
+
 2004-03-01  Richard Sandiford  <rsandifo@redhat.com>
 
 	* sim/frv/allinsn.exp (all_machs): Add fr405 and fr450.
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index e755717..0b9ea73 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -93,7 +93,7 @@
 	set prog [remote_download host $prog]
 	if { $prog == "" } {
 	    error "download failed"
-	    return -1;
+	    return -1
 	}
     }
 
diff --git a/sim/testsuite/sim/h8300/ChangeLog b/sim/testsuite/sim/h8300/ChangeLog
index 4dc6559..21c0266 100644
--- a/sim/testsuite/sim/h8300/ChangeLog
+++ b/sim/testsuite/sim/h8300/ChangeLog
@@ -1,3 +1,16 @@
+2004-06-28  Alexandre Oliva  <aoliva@redhat.com>
+
+	2003-07-22  Michael Snyder  <msnyder@redhat.com>
+	* mul.s: Don't try to use negative immediate (it's always
+	unsigned).
+	* div.s: Ditto.
+
+2004-06-24  Alexandre Oliva  <aoliva@redhat.com>
+
+	2004-06-17  Alexandre Oliva  <aoliva@redhat.com>
+	* band.s, biand.s: imm3_abs16 is not available on h8300h.
+	* bset.s: Likewise.  Ditto for rn_abs32.
+
 2003-07-22  Michael Snyder  <msnyder@redhat.com>
 
 	* cmpw.s: Add test for less-than-zero immediate.
diff --git a/sim/testsuite/sim/h8300/band.s b/sim/testsuite/sim/h8300/band.s
index f3455ad..3c7e5a3 100644
--- a/sim/testsuite/sim/h8300/band.s
+++ b/sim/testsuite/sim/h8300/band.s
@@ -104,7 +104,7 @@
 
 	test_grs_a5a5		; general registers should not be changed.
 
-.if (sim_cpu)			; non-zero means not h8300
+.if (sim_cpu > h8300h)
 band_imm3_abs16:
 	set_grs_a5a5
 	set_ccr_zero
@@ -314,7 +314,7 @@
 
 	test_grs_a5a5		; general registers should not be changed.
 
-.if (sim_cpu)			; non-zero means not h8300
+.if (sim_cpu > h8300h)
 bld_imm3_abs16:
 	set_grs_a5a5
 	set_ccr_zero
@@ -491,7 +491,7 @@
 
 	test_grs_a5a5		; general registers should not be changed.
 
-.if (sim_cpu)			; non-zero means not h8300
+.if (sim_cpu > h8300h)
 btst_imm3_abs16:
 	set_grs_a5a5
 	set_ccr_zero
diff --git a/sim/testsuite/sim/h8300/biand.s b/sim/testsuite/sim/h8300/biand.s
index 07d3ecf..c4cf285 100644
--- a/sim/testsuite/sim/h8300/biand.s
+++ b/sim/testsuite/sim/h8300/biand.s
@@ -104,7 +104,7 @@
 
 	test_grs_a5a5		; general registers should not be changed.
 
-.if (sim_cpu)			; non-zero means not h8300
+.if (sim_cpu > h8300h)
 biand_imm3_abs16:
 	set_grs_a5a5
 	set_ccr_zero
@@ -314,7 +314,7 @@
 
 	test_grs_a5a5		; general registers should not be changed.
 
-.if (sim_cpu)			; non-zero means not h8300
+.if (sim_cpu > h8300h)
 bild_imm3_abs16:
 	set_grs_a5a5
 	set_ccr_zero
diff --git a/sim/testsuite/sim/h8300/bset.s b/sim/testsuite/sim/h8300/bset.s
index a94e916..0e16fc1 100644
--- a/sim/testsuite/sim/h8300/bset.s
+++ b/sim/testsuite/sim/h8300/bset.s
@@ -263,6 +263,7 @@
 	test_gr_a5a5 6
 	test_gr_a5a5 7
 
+.if (sim_cpu > h8300h)
 bset_imm3_abs16:
 	set_grs_a5a5		; Fill all general regs with a fixed pattern
 
@@ -383,6 +384,7 @@
 	test_gr_a5a5 6
 	test_gr_a5a5 7
 .endif
+.endif
 
 bset_rs8_rd8:
 	set_grs_a5a5		; Fill all general regs with a fixed pattern
@@ -644,6 +646,7 @@
 	test_gr_a5a5 6
 	test_gr_a5a5 7
 
+.if (sim_cpu > h8300h)
 bset_rs8_abs32:
 	set_grs_a5a5		; Fill all general regs with a fixed pattern
 
@@ -780,6 +783,7 @@
 	test_gr_a5a5 6
 	test_gr_a5a5 7
 .endif
+.endif
 
 .if (sim_cpu == h8sx)
 bset_eq_imm3_abs16:
diff --git a/sim/testsuite/sim/h8300/div.s b/sim/testsuite/sim/h8300/div.s
index 518b62f..fd53baf 100644
--- a/sim/testsuite/sim/h8300/div.s
+++ b/sim/testsuite/sim/h8300/div.s
@@ -41,9 +41,9 @@
 	set_grs_a5a5
 
 	;; divs.w xx:4, rd
-	mov.w	#32, r1
+	mov.w	#-32, r1
 	set_ccr_zero
-	divs.w	#-2:4, r1
+	divs.w	#2:4, r1
 
 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
 	test_neg_set
@@ -88,9 +88,9 @@
 	set_grs_a5a5
 
 	;; divs.l xx:4, rd
-	mov.l	#320000, er1
+	mov.l	#-320000, er1
 	set_ccr_zero
-	divs.l	#-2:4, er1
+	divs.l	#2:4, er1
 
 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
 	test_neg_set
@@ -221,9 +221,9 @@
 	set_grs_a5a5
 
 	;; divxs.b xx:4, rd
-	mov.w	#32, r1
+	mov.w	#-32, r1
 	set_ccr_zero
-	divxs.b	#-2:4, r1
+	divxs.b	#2:4, r1
 
 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
 	test_neg_set
diff --git a/sim/testsuite/sim/h8300/mul.s b/sim/testsuite/sim/h8300/mul.s
index 70ab7ec..02b9e9f 100644
--- a/sim/testsuite/sim/h8300/mul.s
+++ b/sim/testsuite/sim/h8300/mul.s
@@ -41,9 +41,9 @@
 	set_grs_a5a5
 
 	;; muls.w xx:4, rd
-	mov.w	#32, r1
+	mov.w	#-32, r1
 	set_ccr_zero
-	muls.w	#-2:4, r1
+	muls.w	#2:4, r1
 
 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
 	test_neg_set
@@ -88,9 +88,9 @@
 	set_grs_a5a5
 
 	;; muls.l xx:4, rd
-	mov.l	#320000, er1
+	mov.l	#-320000, er1
 	set_ccr_zero
-	muls.l	#-2:4, er1
+	muls.l	#2:4, er1
 
 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
 	test_neg_set
@@ -308,9 +308,9 @@
 	set_grs_a5a5
 
 	;; mulxs.b xx:4, rd
-	mov.w	#32, r1
+	mov.w	#-32, r1
 	set_ccr_zero
-	mulxs.b	#-2:4, r1
+	mulxs.b	#2:4, r1
 
 	;; test ccr		; H=0 N=1 Z=0 V=0 C=0
 	test_neg_set
@@ -408,9 +408,9 @@
 	set_grs_a5a5
 
 	;; mulxu.b xx:4, rd
-	mov.b	#32, r1l
+	mov.b	#-32, r1l
 	set_ccr_zero
-	mulxu.b	#-2:4, r1
+	mulxu.b	#2:4, r1
 
 	;; test ccr		; H=0 N=0 Z=0 V=0 C=0
 	test_cc_clear
diff --git a/sim/testsuite/sim/mips/ChangeLog b/sim/testsuite/sim/mips/ChangeLog
index 67e7bfa..7d75661 100644
--- a/sim/testsuite/sim/mips/ChangeLog
+++ b/sim/testsuite/sim/mips/ChangeLog
@@ -1,3 +1,38 @@
+2004-04-11  Chris Demetriou  <cgd@broadcom.com>
+
+	* utils-fpu.inc (enable_fpu, ckm_fp_cc): New macros.
+	(clrset_fp_cc): Fix mask used for upper 7 condition codes.
+	* utils-mdmx.inc: Include utils-fpu.inc.
+	(enable_mdmx): Use enable_fpu.
+
+2004-04-10  Chris Demetriou  <cgd@broadcom.com>
+
+	* utils-fpu.inc: New file.
+	* utils-mdmx.inc: New file.
+	* mdmx-ob.s: New file.
+	* mdmx-ob-sb1.s: New file.
+	* basic.exp: Run new mdmx-ob and mdmx-ob-sb1 tests.
+
+2004-04-10  Chris Demetriou  <cgd@broadcom.com>
+
+	* fpu64-ps-sb1.s: New file.
+	* basic.exp: Recognize mipsisa64sb1 targets, and run fpu64-ps-sb1.s
+	if appropriate.
+
+2004-04-10  Chris Demetriou  <cgd@broadcom.com>
+
+	* fpu64-ps.s: New file.
+	* basic.exp: Run fpu64-ps.s.
+
+2004-03-29  Richard Sandiford  <rsandifo@redhat.com>
+
+	* hilo-hazard-[123].s: New files.
+	* basic.exp (run_hilo_test): New procedure.
+	(models): Only list models that are included in the configuration.
+	(submodels): New variable, set to submodels of the above.
+	(mips64vr-*-elf, mips64vrel-*-elf): New configuration stanza.
+	Run hilo-hazard-[123].s.
+
 2004-01-26  Chris Demetriou  <cgd@broadcom.com>
 
 	* basic.exp: New file.
diff --git a/sim/testsuite/sim/mips/basic.exp b/sim/testsuite/sim/mips/basic.exp
index 63dc086..b7cb057 100644
--- a/sim/testsuite/sim/mips/basic.exp
+++ b/sim/testsuite/sim/mips/basic.exp
@@ -6,21 +6,69 @@
 # than the compiler) can't necessarily find.
 unset_currtarget_info ldscript
 
+# Do "run_sim_test TESTFILE MODELS" for each combination of the
+# mf{lo,hi} -> mult/div/mt{lo,hi} hazard described in mips.igen.
+# Insert NOPS nops after the mflo or mfhi.
+proc run_hilo_test {testfile models nops} {
+    foreach reg {lo hi} {
+	foreach insn "{mult\t\$4,\$4} {div\t\$0,\$4,\$4} {mt$reg\t\$4}" {
+	    set contents ""
+	    append contents "\t.macro hilo\n"
+	    append contents "\tmf$reg\t\$4\n"
+	    append contents "\t.rept\t$nops\n"
+	    append contents "\tnop\n"
+	    append contents "\t.endr\n"
+	    append contents "\t$insn\n"
+	    append contents "\t.endm"
+
+	    verbose -log "HILO test:\n$contents"
+	    set file [open hilo-hazard.inc w]
+	    puts $file $contents
+	    close $file
+
+	    run_sim_test $testfile $models
+	}
+    }
+}
+
+
 # Only test mips*-elf (e.g., no mips-linux), and only test if the target
 # board really is a simulator (sim tests don't work on real HW).
 if {[istarget mips*-elf] && [board_info target exists is_simulator]} {
 
-    if {[istarget mipsisa64*-elf]} {
-	set models "mips1 mips2 mips3 mips4 mips32 mips64"
+    if {[istarget mipsisa64sb1*-elf]} {
+	set models "sb1"
+	set submodels "mips1 mips2 mips3 mips4 mips32 mips64"
+    } elseif {[istarget mipsisa64*-elf]} {
+	set models "mips32 mips64"
+	set submodels "mips1 mips2 mips3 mips4"
     } elseif {[istarget mipsisa32*-elf]} {
-	set models "mips1 mips2 mips32"
+	set models "mips32"
+	set submodels "mips1 mips2"
+    } elseif {[istarget mips64vr-*-elf] || [istarget mips64vrel-*-elf]} {
+	set models "vr4100 vr4111 vr4120 vr5000 vr5400 vr5500"
+	set submodels "mips1 mips2 mips3 mips4"
     } elseif {[istarget mips64*-elf]} {
-	set models "mips1 mips2 mips3"
+	set models "mips3"
+	set submodels "mips1 mips2"
     } else {
 	# fall back to just testing mips1 code.
 	set models "mips1"
+	set submodels ""
     }
+    append submodels " " $models
     set cpu_option -march
 
-    run_sim_test sanity.s $models
+    run_sim_test sanity.s $submodels
+    foreach nops {0 1} {
+	run_hilo_test hilo-hazard-1.s $models $nops
+	run_hilo_test hilo-hazard-2.s $models $nops
+    }
+    run_hilo_test hilo-hazard-3.s $models 2
+
+    run_sim_test fpu64-ps.s $submodels
+    run_sim_test fpu64-ps-sb1.s $submodels
+
+    run_sim_test mdmx-ob.s $submodels
+    run_sim_test mdmx-ob-sb1.s $submodels
 }
diff --git a/sim/testsuite/sim/mips/fpu64-ps-sb1.s b/sim/testsuite/sim/mips/fpu64-ps-sb1.s
new file mode 100644
index 0000000..a39d079
--- /dev/null
+++ b/sim/testsuite/sim/mips/fpu64-ps-sb1.s
@@ -0,0 +1,72 @@
+# mips test sanity, expected to pass.
+# mach:	 sb1
+# as:		-mabi=eabi
+# ld:		-N -Ttext=0x80010000
+# output:	*\\npass\\n
+
+	.include "testutils.inc"
+
+        .macro check_ps psval, upperval, lowerval
+	.set push
+	.set noreorder
+	cvt.s.pu	$f0, \psval		# upper
+	cvt.s.pl	$f2, \psval		# lower
+	li.s		$f4, \upperval
+	li.s		$f6, \lowerval
+	c.eq.s		$fcc0, $f0, $f4
+	bc1f		$fcc0, _fail
+	 c.eq.s		$fcc0, $f2, $f6
+	bc1f		$fcc0, _fail
+	 nop
+	.set pop
+        .endm
+
+	setup
+
+	.set noreorder
+
+	.ent DIAG
+DIAG:
+
+	# make sure that Status.FR, .CU1, and .SBX are set.
+	mfc0	$2, $12
+	or	$2, $2, (1 << 26) | (1 << 29) | (1 << 16)
+	mtc0	$2, $12
+
+
+	li.s	$f10, 4.0
+	li.s	$f12, 16.0
+	cvt.ps.s $f20, $f10, $f12		# $f20: u=4.0, l=16.0
+
+	li.s	$f10, -1.0
+	li.s	$f12, 2.0
+	cvt.ps.s $f22, $f10, $f12		# $f22: u=-1.0, l=2.0
+
+
+	writemsg "div.ps"
+
+	div.ps $f8, $f20, $f22
+	check_ps $f8, -4.0, 8.0
+
+
+	writemsg "recip.ps"
+
+	recip.ps $f8, $f20
+	check_ps $f8, 0.25, 0.0625
+
+
+	writemsg "rsqrt.ps"
+
+	rsqrt.ps $f8, $f20
+	check_ps $f8, 0.5, 0.25
+
+
+	writemsg "sqrt.ps"
+
+	sqrt.ps $f8, $f20
+	check_ps $f8, 2.0, 4.0
+
+
+	pass
+
+	.end DIAG
diff --git a/sim/testsuite/sim/mips/fpu64-ps.s b/sim/testsuite/sim/mips/fpu64-ps.s
new file mode 100644
index 0000000..ad493b8
--- /dev/null
+++ b/sim/testsuite/sim/mips/fpu64-ps.s
@@ -0,0 +1,367 @@
+# mips test sanity, expected to pass.
+# mach:	 mips64 sb1
+# as:		-mabi=eabi
+# ld:		-N -Ttext=0x80010000
+# output:	*\\npass\\n
+
+	.include "testutils.inc"
+
+        .macro check_ps psval, upperval, lowerval
+	.set push
+	.set noreorder
+	cvt.s.pu	$f0, \psval		# upper
+	cvt.s.pl	$f2, \psval		# lower
+	li.s		$f4, \upperval
+	li.s		$f6, \lowerval
+	c.eq.s		$fcc0, $f0, $f4
+	bc1f		$fcc0, _fail
+	 c.eq.s		$fcc0, $f2, $f6
+	bc1f		$fcc0, _fail
+	 nop
+	.set pop
+        .endm
+
+	setup
+
+	.set noreorder
+
+	.ent DIAG
+DIAG:
+
+	# make sure that Status.FR and .CU1 are set.
+	mfc0	$2, $12
+	or	$2, $2, (1 << 26) | (1 << 29)
+	mtc0	$2, $12
+
+
+	writemsg "ldc1"
+
+	.data
+1:	.dword	0xc1a8000042200000		# -21.0, 40.0
+	.text
+	la	$2, 1b
+	ldc1	$f8, 0($2)
+	check_ps $f8, -21.0, 40.0
+
+
+	writemsg "cvt.ps.s"
+
+	li.s	$f10, 1.0
+	li.s	$f12, 3.0
+	cvt.ps.s $f8, $f10, $f12		# upper, lower
+	check_ps $f8, 1.0, 3.0
+
+
+	writemsg "cvt.ps.s, sdc1, copy, ldc1"
+
+	.data
+1:	.dword	0
+	.dword	0
+	.text
+	la	$2, 1b
+	li.s	$f12, -4.0
+	li.s	$f14, 32.0
+	cvt.ps.s $f10, $f12, $f14		# upper, lower
+	sdc1	$f10, 8($2)
+	lw	$3, 8($2)
+	lw	$4, 12($2)
+	sw	$3, 0($2)
+	sw	$4, 4($2)
+	ldc1	$f8, 0($2)
+	check_ps $f8, -4.0, 32.0
+
+
+	# Load some constants for later use
+
+	li.s	$f10, 4.0
+	li.s	$f12, 16.0
+	cvt.ps.s $f20, $f10, $f12		# $f20: u=4.0, l=16.0
+
+	li.s	$f10, -1.0
+	li.s	$f12, 2.0
+	cvt.ps.s $f22, $f10, $f12		# $f22: u=-1.0, l=2.0
+
+	li.s	$f10, 17.0
+	li.s	$f12, -8.0
+	cvt.ps.s $f24, $f10, $f12		# $f24: u=17.0, l=-8.0
+
+
+	writemsg "pll.ps"
+
+	pll.ps	$f8, $f20, $f22
+	check_ps $f8, 16.0, 2.0
+
+
+	writemsg "plu.ps"
+
+	plu.ps	$f8, $f20, $f22
+	check_ps $f8, 16.0, -1.0
+
+
+	writemsg "pul.ps"
+
+	pul.ps	$f8, $f20, $f22
+	check_ps $f8, 4.0, 2.0
+
+
+	writemsg "puu.ps"
+
+	puu.ps	$f8, $f20, $f22
+	check_ps $f8, 4.0, -1.0
+
+
+	writemsg "abs.ps"
+
+	abs.ps	$f8, $f22
+	check_ps $f8, 1.0, 2.0
+
+
+	writemsg "mov.ps"
+
+	mov.ps	$f8, $f22
+	check_ps $f8, -1.0, 2.0
+
+
+	writemsg "neg.ps"
+
+	neg.ps	$f8, $f22
+	check_ps $f8, 1.0, -2.0
+
+
+	writemsg "add.ps"
+
+	add.ps	$f8, $f20, $f22
+	check_ps $f8, 3.0, 18.0
+
+
+	writemsg "mul.ps"
+
+	mul.ps	$f8, $f20, $f22
+	check_ps $f8, -4.0, 32.0
+
+
+	writemsg "sub.ps"
+
+	sub.ps	$f8, $f20, $f22
+	check_ps $f8, 5.0, 14.0
+
+
+	writemsg "madd.ps"
+
+	madd.ps	$f8, $f24, $f20, $f22
+	check_ps $f8, 13.0, 24.0
+
+
+	writemsg "msub.ps"
+
+	msub.ps	$f8, $f24, $f20, $f22
+	check_ps $f8, -21.0, 40.0
+
+
+	writemsg "nmadd.ps"
+
+	nmadd.ps $f8, $f24, $f20, $f22
+	check_ps $f8, -13.0, -24.0
+
+
+	writemsg "nmsub.ps"
+
+	nmsub.ps $f8, $f24, $f20, $f22
+	check_ps $f8, 21.0, -40.0
+
+
+	writemsg "movn.ps (n)"
+
+	li	$2, 0
+	mov.ps	$f8, $f20
+	movn.ps	$f8, $f22, $2		# doesn't move
+	check_ps $f8, 4.0, 16.0
+
+
+	writemsg "movn.ps (y)"
+
+	li	$2, 1
+	mov.ps	$f8, $f20
+	movn.ps	$f8, $f22, $2		# does move
+	check_ps $f8, -1.0, 2.0
+
+
+	writemsg "movz.ps (y)"
+
+	li	$2, 0
+	mov.ps	$f8, $f20
+	movz.ps	$f8, $f22, $2		# does move
+	check_ps $f8, -1.0, 2.0
+
+
+	writemsg "movz.ps (n)"
+
+	li	$2, 1
+	mov.ps	$f8, $f20
+	movz.ps	$f8, $f22, $2		# doesn't move
+	check_ps $f8, 4.0, 16.0
+
+
+	writemsg "movf.ps (y,y)"
+
+	cfc1	$2, $31	
+	or	$2, $2, (1 << 23) | (1 << 25)
+	xor	$2, $2, (1 << 23) | (1 << 25)
+	ctc1	$2, $31			# clear fcc0, clear fcc1
+	mov.ps	$f8, $f20
+	movf.ps	$f8, $f22, $fcc0	# moves both halves
+	check_ps $f8, -1.0, 2.0
+
+
+	writemsg "movf.ps (y,n)"
+
+	cfc1	$2, $31	
+	or	$2, $2, (1 << 23) | (1 << 25)
+	xor	$2, $2, (0 << 23) | (1 << 25)
+	ctc1	$2, $31			# set fcc0, clear fcc1
+	mov.ps	$f8, $f20
+	movf.ps	$f8, $f22, $fcc0	# moves upper half only
+	check_ps $f8, -1.0, 16.0
+
+
+	writemsg "movf.ps (n,y)"
+
+	cfc1	$2, $31	
+	or	$2, $2, (1 << 23) | (1 << 25)
+	xor	$2, $2, (1 << 23) | (0 << 25)
+	ctc1	$2, $31			# clear fcc0, set fcc1
+	mov.ps	$f8, $f20
+	movf.ps	$f8, $f22, $fcc0	# moves lower half only
+	check_ps $f8, 4.0, 2.0
+
+
+	writemsg "movf.ps (n,n)"
+
+	cfc1	$2, $31	
+	or	$2, $2, (1 << 23) | (1 << 25)
+	xor	$2, $2, (0 << 23) | (0 << 25)
+	ctc1	$2, $31			# set fcc0, set fcc1
+	mov.ps	$f8, $f20
+	movf.ps	$f8, $f22, $fcc0	# doesn't move either half
+	check_ps $f8, 4.0, 16.0
+
+
+	writemsg "movt.ps (n,n)"
+
+	cfc1	$2, $31	
+	or	$2, $2, (1 << 23) | (1 << 25)
+	xor	$2, $2, (1 << 23) | (1 << 25)
+	ctc1	$2, $31			# clear fcc0, clear fcc1
+	mov.ps	$f8, $f20
+	movt.ps	$f8, $f22, $fcc0	# doesn't move either half
+	check_ps $f8, 4.0, 16.0
+
+
+	writemsg "movt.ps (n,y)"
+
+	cfc1	$2, $31	
+	or	$2, $2, (1 << 23) | (1 << 25)
+	xor	$2, $2, (0 << 23) | (1 << 25)
+	ctc1	$2, $31			# set fcc0, clear fcc1
+	mov.ps	$f8, $f20
+	movt.ps	$f8, $f22, $fcc0	# moves lower half only
+	check_ps $f8, 4.0, 2.0
+
+
+	writemsg "movt.ps (y,n)"
+
+	cfc1	$2, $31	
+	or	$2, $2, (1 << 23) | (1 << 25)
+	xor	$2, $2, (1 << 23) | (0 << 25)
+	ctc1	$2, $31			# clear fcc0, set fcc1
+	mov.ps	$f8, $f20
+	movt.ps	$f8, $f22, $fcc0	# moves upper half only
+	check_ps $f8, -1.0, 16.0
+
+
+	writemsg "movt.ps (y,y)"
+
+	cfc1	$2, $31	
+	or	$2, $2, (1 << 23) | (1 << 25)
+	xor	$2, $2, (0 << 23) | (0 << 25)
+	ctc1	$2, $31			# set fcc0, set fcc1
+	mov.ps	$f8, $f20
+	movt.ps	$f8, $f22, $fcc0	# moves both halves
+	check_ps $f8, -1.0, 2.0
+
+
+	writemsg "alnv.ps (aligned)"
+
+	.data
+1:	.dword	0xc1a8000042200000		# -21.0, 40.0
+	.dword	0xc228000041a00000		# -42.0, 20.0
+	.text
+	la	$2, 1b
+	li	$3, 0
+	addu	$4, $3, 8
+	luxc1	$f10, $3($2)
+	luxc1	$f12, $4($2)
+	alnv.ps	$f8, $f10, $f12, $3
+	check_ps $f8, -21.0, 40.0
+
+
+	writemsg "alnv.ps (unaligned)"
+
+	.data
+1:	.dword	0xc1a8000042200000		# -21.0, 40.0
+	.dword	0xc228000041a00000		# -42.0, 20.0
+	.hword	0x0001
+	.text
+	la	$2, 1b
+	li	$3, 4
+	addu	$4, $3, 8
+	luxc1	$f10, $3($2)
+	luxc1	$f12, $4($2)
+	alnv.ps	$f8, $f10, $f12, $3
+
+	lb	$5, 16($2)
+	bnez	$5, 2f				# little endian
+	 nop
+
+	# big endian
+	check_ps $f8, 40.0, -42.0
+	b	3f
+	 nop
+2:
+	# little endian
+	check_ps $f8, 20.0, -21.0
+3:
+
+
+	# We test c.cond.ps only lightly, just to make sure it modifies
+	# two bits and compares the halves separately.  Perhaps it should
+	# be tested more thoroughly.
+
+	writemsg "c.f.ps"
+
+	cfc1	$2, $31	
+	or	$2, $2, (1 << 23) | (0x7f << 25)
+	ctc1	$2, $31			# set all fcc bits
+	c.f.ps	$fcc0, $f8, $f8		# -> f, f
+	bc1t	$fcc0, _fail
+	 nop
+	bc1t	$fcc1, _fail
+	 nop
+
+	
+	writemsg "c.olt.ps"
+
+	cfc1	$2, $31	
+	or	$2, $2, (1 << 23) | (0x7f << 25)
+	xor	$2, $2, (1 << 23) | (0x7f << 25)
+	ctc1	$2, $31			# clear all fcc bits
+	c.lt.ps $fcc0, $f22, $f24	# -> f, t
+	bc1t	$fcc0, _fail
+	 nop
+	bc1f	$fcc1, _fail
+	 nop
+	
+
+	pass
+
+	.end DIAG
diff --git a/sim/testsuite/sim/mips/hilo-hazard-1.s b/sim/testsuite/sim/mips/hilo-hazard-1.s
new file mode 100644
index 0000000..f20c939
--- /dev/null
+++ b/sim/testsuite/sim/mips/hilo-hazard-1.s
@@ -0,0 +1,19 @@
+# Test for architectures with mf{hi,lo} -> mult/div/mt{hi,lo} hazards.
+#
+# mach:		mips1 mips2 mips3 mips4 vr4100 vr4111 vr4120 vr5000 vr5400
+# as:		-mabi=eabi
+# ld:		-N -Ttext=0x80010000
+# output:	HILO: * too close to MF at *\\n\\nprogram stopped*\\n
+# xerror:
+
+	.include "hilo-hazard.inc"
+	.include "testutils.inc"
+
+	setup
+
+	.set noreorder
+	.ent DIAG
+DIAG:
+	hilo
+	pass
+	.end DIAG
diff --git a/sim/testsuite/sim/mips/hilo-hazard-2.s b/sim/testsuite/sim/mips/hilo-hazard-2.s
new file mode 100644
index 0000000..07b84d2
--- /dev/null
+++ b/sim/testsuite/sim/mips/hilo-hazard-2.s
@@ -0,0 +1,18 @@
+# Test for architectures without mf{hi,lo} -> mult/div/mt{hi,lo} hazards.
+#
+# mach:		vr5500 mips32 mips64
+# as:		-mabi=eabi
+# ld:		-N -Ttext=0x80010000
+# output:	pass\\n
+
+	.include "hilo-hazard.inc"
+	.include "testutils.inc"
+
+	setup
+
+	.set noreorder
+	.ent DIAG
+DIAG:
+	hilo
+	pass
+	.end DIAG
diff --git a/sim/testsuite/sim/mips/hilo-hazard-3.s b/sim/testsuite/sim/mips/hilo-hazard-3.s
new file mode 100644
index 0000000..1a0949d
--- /dev/null
+++ b/sim/testsuite/sim/mips/hilo-hazard-3.s
@@ -0,0 +1,18 @@
+# Test for mf{hi,lo} -> mult/div/mt{hi,lo} with 2 nops inbetween.
+#
+# mach:		all
+# as:		-mabi=eabi
+# ld:		-N -Ttext=0x80010000
+# output:	pass\\n
+
+	.include "hilo-hazard.inc"
+	.include "testutils.inc"
+
+	setup
+
+	.set noreorder
+	.ent DIAG
+DIAG:
+	hilo
+	pass
+	.end DIAG
diff --git a/sim/testsuite/sim/mips/mdmx-ob-sb1.s b/sim/testsuite/sim/mips/mdmx-ob-sb1.s
new file mode 100644
index 0000000..c8409fc
--- /dev/null
+++ b/sim/testsuite/sim/mips/mdmx-ob-sb1.s
@@ -0,0 +1,102 @@
+# MDMX .OB op tests.
+# mach:	 sb1
+# as:		-mabi=eabi
+# ld:		-N -Ttext=0x80010000
+# output:	*\\npass\\n
+
+	.include "testutils.inc"
+	.include "utils-mdmx.inc"
+
+	setup
+
+	.set noreorder
+
+	.ent DIAG
+DIAG:
+
+	enable_mdmx
+
+	# set Status.SBX to enable SB-1 extensions.
+	mfc0	$2, $12
+	or	$2, $2, (1 << 16)
+	mtc0	$2, $12
+
+
+	###
+	### SB-1 Non-accumulator .ob format ops.
+	###
+	### Key: v = vector
+	###      ev = vector of single element
+	###      cv = vector of constant.
+	###
+
+
+	writemsg "pavg.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	pavg.ob	$f10, $f8, $f9
+	ck_ob $f10, 0x3c4d5e6f8091a2b3
+
+	writemsg "pavg.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	pavg.ob	$f10, $f8, $f9[6]
+	ck_ob $f10, 0x444d555e666f7780
+
+	writemsg "pavg.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	pavg.ob	$f10, $f8, 0x10
+	ck_ob $f10, 0x1119222a333b444c
+
+
+	writemsg "pabsdiff.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	pabsdiff.ob	$f10, $f8, $f9
+	ck_ob $f10, 0x5555555555555555
+
+	writemsg "pabsdiff.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	pabsdiff.ob	$f10, $f8, $f9[7]
+	ck_ob $f10, 0x5544332211001122
+
+	writemsg "pabsdiff.ob (cv)"
+	ld_ob	$f8, 0x0001020304050607
+	pabsdiff.ob	$f10, $f8, 0x04
+	ck_ob $f10, 0x0403020100010203
+
+
+	###
+	### SB-1 Accumulator .ob format ops
+	###
+	### Key: v = vector
+	###      ev = vector of single element
+	###      cv = vector of constant.
+	###
+
+
+	writemsg "pabsdiffc.ob (v)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	pabsdiffc.ob $f8, $f9
+	ck_acc_ob 0x0001020304050607, 0x0000000000000000, 0x5555555555555555
+
+	writemsg "pabsdiffc.ob (ev)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	pabsdiffc.ob $f8, $f9[7]
+	ck_acc_ob 0x0001020304050607, 0x0000000000000000, 0x5544332211001122
+
+	writemsg "pabsdiffc.ob (cv)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x0001020304050607
+	pabsdiffc.ob $f8, 0x04
+	ck_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0403020100010203
+
+
+	pass
+
+	.end DIAG
diff --git a/sim/testsuite/sim/mips/mdmx-ob.s b/sim/testsuite/sim/mips/mdmx-ob.s
new file mode 100644
index 0000000..ad9bbda
--- /dev/null
+++ b/sim/testsuite/sim/mips/mdmx-ob.s
@@ -0,0 +1,631 @@
+# MDMX .OB op tests.
+# mach:	 mips64 sb1
+# as:		-mabi=eabi
+# as(mips64):	-mabi=eabi -mdmx
+# ld:		-N -Ttext=0x80010000
+# output:	*\\npass\\n
+
+	.include "testutils.inc"
+	.include "utils-fpu.inc"
+	.include "utils-mdmx.inc"
+
+	setup
+
+	.set noreorder
+
+	.ent DIAG
+DIAG:
+
+	enable_mdmx
+
+
+	###
+	### Non-accumulator, non-CC-using .ob format ops.
+	###
+	### Key: v = vector
+	###      ev = vector of single element
+	###      cv = vector of constant.
+	###
+
+
+	writemsg "add.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	add.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x7799bbddffffffff
+
+	writemsg "add.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	add.ob	$f10, $f8, $f9[6]
+	ck_ob	$f10, 0x8899aabbccddeeff
+
+	writemsg "add.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	add.ob	$f10, $f8, 0x10
+	ck_ob	$f10, 0x2132435465768798
+
+
+	writemsg "alni.ob"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	alni.ob	$f10, $f8, $f9, 3
+	ck_ob	$f10, 0x4455667788667788
+
+
+	writemsg "alnv.ob"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	li	$4, 5
+	alnv.ob	$f10, $f8, $f9, $4
+	ck_ob	$f10, 0x66778866778899aa
+
+
+	writemsg "and.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	and.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x0022000000224488
+
+	writemsg "and.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	and.ob	$f10, $f8, $f9[4]
+	ck_ob	$f10, 0x1100110011001188
+
+	writemsg "and.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	and.ob	$f10, $f8, 0x1e
+	ck_ob	$f10, 0x1002120414061608
+
+
+	writemsg "max.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	max.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x66778899aabbccdd
+
+	writemsg "max.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	max.ob	$f10, $f8, $f9[7]
+	ck_ob	$f10, 0x6666666666667788
+
+	writemsg "max.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	max.ob	$f10, $f8, 0x15
+	ck_ob	$f10, 0x1522334455667788
+
+
+	writemsg "min.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	min.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x1122334455667788
+
+	writemsg "min.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	min.ob	$f10, $f8, $f9[7]
+	ck_ob	$f10, 0x1122334455666666
+
+	writemsg "min.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	min.ob	$f10, $f8, 0x15
+	ck_ob	$f10, 0x1115151515151515
+
+
+	writemsg "mul.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x0001020304050607
+	mul.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x002266ccffffffff
+
+	writemsg "mul.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x0001020304050607
+	mul.ob	$f10, $f8, $f9[4]
+	ck_ob	$f10, 0x336699ccffffffff
+
+	writemsg "mul.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	mul.ob	$f10, $f8, 2
+	ck_ob	$f10, 0x22446688aacceeff
+
+
+	writemsg "nor.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	nor.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x8888442200000022
+
+	writemsg "nor.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	nor.ob	$f10, $f8, $f9[6]
+	ck_ob	$f10, 0x8888888888888800
+
+	writemsg "nor.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	nor.ob	$f10, $f8, 0x08
+	ck_ob	$f10, 0xe6d5c4b3a2918077
+
+
+	writemsg "or.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	or.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x7777bbddffffffdd
+
+	writemsg "or.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	or.ob	$f10, $f8, $f9[6]
+	ck_ob	$f10, 0x77777777777777ff
+
+	writemsg "or.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	or.ob	$f10, $f8, 0x08
+	ck_ob	$f10, 0x192a3b4c5d6e7f88
+
+
+	writemsg "shfl.mixh.ob"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	shfl.mixh.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x1166227733884499
+
+
+	writemsg "shfl.mixl.ob"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	shfl.mixl.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x55aa66bb77cc88dd
+
+
+	writemsg "shfl.pach.ob"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	shfl.pach.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x113355776688aacc
+
+
+	writemsg "shfl.upsl.ob"
+	ld_ob	$f8, 0x1122334455667788
+	shfl.upsl.ob	$f10, $f8, $f8
+	ck_ob	$f10, 0x005500660077ff88
+
+
+	writemsg "sll.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x0001020304050607
+	sll.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x1144cc2050c0c000
+
+	writemsg "sll.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x0001020304050607
+	sll.ob	$f10, $f8, $f9[3]
+	ck_ob	$f10, 0x1020304050607080
+
+	writemsg "sll.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	sll.ob	$f10, $f8, 1
+	ck_ob	$f10, 0x22446688aaccee10
+
+
+	writemsg "srl.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x0001020304050607
+	srl.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x11110c0805030101
+
+	writemsg "srl.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x0001020304050607
+	srl.ob	$f10, $f8, $f9[3]
+	ck_ob	$f10, 0x0102030405060708
+
+	writemsg "srl.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	srl.ob	$f10, $f8, 1
+	ck_ob	$f10, 0x081119222a333b44
+
+
+	writemsg "sub.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x0001020304050607
+	sub.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x1121314151617181
+
+	writemsg "sub.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	sub.ob	$f10, $f8, $f9[7]
+	ck_ob	$f10, 0x0000000000001122
+
+	writemsg "sub.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	sub.ob	$f10, $f8, 0x10
+	ck_ob	$f10, 0x0112233445566778
+
+
+	writemsg "xor.ob (v)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	xor.ob	$f10, $f8, $f9
+	ck_ob	$f10, 0x7755bbddffddbb55
+
+	writemsg "xor.ob (ev)"
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	xor.ob	$f10, $f8, $f9[6]
+	ck_ob	$f10, 0x66554433221100ff
+
+	writemsg "xor.ob (cv)"
+	ld_ob	$f8, 0x1122334455667788
+	xor.ob	$f10, $f8, 0x08
+	ck_ob	$f10, 0x192a3b4c5d6e7f80
+
+
+	###
+	### Accumulator .ob format ops (in order: rd/wr, math, scale/round)
+	###
+	### Key: v = vector
+	###      ev = vector of single element
+	###      cv = vector of constant.
+	###
+
+
+	writemsg "wacl.ob / rac[hml].ob"
+	ld_ob	$f8, 0x8001028304850687
+	ld_ob	$f9, 0x1011121314151617
+	wacl.ob	$f8, $f9
+	ck_acc_ob 0xff0000ff00ff00ff, 0x8001028304850687, 0x1011121314151617
+
+	# Note: relies on data left in accumulator by previous test.
+	writemsg "wach.ob / rac[hml].ob"
+	ld_ob	$f8, 0x2021222324252627
+	wach.ob	$f8
+	ck_acc_ob 0x2021222324252627, 0x8001028304850687, 0x1011121314151617
+
+
+	writemsg "adda.ob (v)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	adda.ob	$f8, $f9
+	ck_acc_ob 0x0001020304050607, 0x0000000000010101, 0x7799bbddff214365
+
+	writemsg "adda.ob (ev)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	adda.ob	$f8, $f9[2]
+	ck_acc_ob 0x0001020304050607, 0x0000000001010101, 0xccddeeff10213243
+
+	writemsg "adda.ob (cv)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	adda.ob	$f8, 0x1f
+	ck_acc_ob 0x0001020304050607, 0x0000000000000000, 0x30415263748596a7
+
+
+	writemsg "addl.ob (v)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	addl.ob	$f8, $f9
+	ck_acc_ob 0x0000000000000000, 0x0000000000010101, 0x7799bbddff214365
+
+	writemsg "addl.ob (ev)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	addl.ob	$f8, $f9[2]
+	ck_acc_ob 0x0000000000000000, 0x0000000001010101, 0xccddeeff10213243
+
+	writemsg "addl.ob (cv)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	addl.ob	$f8, 0x1f
+	ck_acc_ob 0x0000000000000000, 0x0000000000000000, 0x30415263748596a7
+
+
+	writemsg "mula.ob (v)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	mula.ob	$f8, $f9
+	ck_acc_ob 0x0001020304050607, 0x060f1b28384a5e75, 0xc6ce18a47282d468
+
+	writemsg "mula.ob (ev)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	mula.ob	$f8, $f9[2]
+	ck_acc_ob 0x0001020304050607, 0x0c1825313e4a5663, 0x6bd641ac1782ed58
+
+	writemsg "mula.ob (cv)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	mula.ob	$f8, 0x1f
+	ck_acc_ob 0x0001020304050607, 0x020406080a0c0e10, 0x0f1e2d3c4b5a6978
+
+
+	writemsg "mull.ob (v)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	mull.ob	$f8, $f9
+	ck_acc_ob 0x0000000000000000, 0x060f1b28384a5e75, 0xc6ce18a47282d468
+
+	writemsg "mull.ob (ev)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	mull.ob	$f8, $f9[2]
+	ck_acc_ob 0x0000000000000000, 0x0c1825313e4a5663, 0x6bd641ac1782ed58
+
+	writemsg "mull.ob (cv)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	mull.ob	$f8, 0x1f
+	ck_acc_ob 0x0000000000000000, 0x020406080a0c0e10, 0x0f1e2d3c4b5a6978
+
+
+	writemsg "muls.ob (v)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	muls.ob	$f8, $f9
+	ck_acc_ob 0xff00010203040506, 0xf9f0e4d7c7b5a18a, 0x3a32e85c8e7e2c98
+
+	writemsg "muls.ob (ev)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	muls.ob	$f8, $f9[2]
+	ck_acc_ob 0xff00010203040506, 0xf3e7dacec1b5a99c, 0x952abf54e97e13a8
+
+	writemsg "muls.ob (cv)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	muls.ob	$f8, 0x1f
+	ck_acc_ob 0xff00010203040506, 0xfdfbf9f7f5f3f1ef, 0xf1e2d3c4b5a69788
+
+
+	writemsg "mulsl.ob (v)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	mulsl.ob $f8, $f9
+	ck_acc_ob 0xffffffffffffffff, 0xf9f0e4d7c7b5a18a, 0x3a32e85c8e7e2c98
+
+	writemsg "mulsl.ob (ev)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	mulsl.ob $f8, $f9[2]
+	ck_acc_ob 0xffffffffffffffff, 0xf3e7dacec1b5a99c, 0x952abf54e97e13a8
+
+	writemsg "mulsl.ob (cv)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	mulsl.ob $f8, 0x1f
+	ck_acc_ob 0xffffffffffffffff, 0xfdfbf9f7f5f3f1ef, 0xf1e2d3c4b5a69788
+
+
+	writemsg "suba.ob (v)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	suba.ob	$f8, $f9
+	ck_acc_ob 0xff00010203040506, 0xffffffffffffffff, 0xabababababababab
+
+	writemsg "suba.ob (ev)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	suba.ob	$f8, $f9[2]
+	ck_acc_ob 0xff00010203040506, 0xffffffffffffffff, 0x566778899aabbccd
+
+	writemsg "suba.ob (cv)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	suba.ob	$f8, 0x1f
+	ck_acc_ob 0xff01020304050607, 0xff00000000000000, 0xf203142536475869
+
+
+	writemsg "subl.ob (v)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	subl.ob	$f8, $f9
+	ck_acc_ob 0xffffffffffffffff, 0xffffffffffffffff, 0xabababababababab
+
+	writemsg "subl.ob (ev)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	ld_ob	$f9, 0x66778899aabbccdd
+	subl.ob	$f8, $f9[2]
+	ck_acc_ob 0xffffffffffffffff, 0xffffffffffffffff, 0x566778899aabbccd
+
+	writemsg "subl.ob (cv)"
+	ld_acc_ob 0x0001020304050607, 0x0000000000000000, 0x0000000000000000
+	ld_ob	$f8, 0x1122334455667788
+	subl.ob	$f8, 0x1f
+	ck_acc_ob 0xff00000000000000, 0xff00000000000000, 0xf203142536475869
+
+
+	writemsg "rnau.ob (v)"
+	ld_acc_ob 0x0000000000000000, 0x0000000003030303, 0x40424446f8fafcfe
+	ld_ob	$f8, 0x0001020304050607
+	rnau.ob	$f9, $f8
+	ck_ob	$f9, 0x4021110940201008
+
+	writemsg "rnau.ob (ev)"
+	ld_acc_ob 0x0000000000000000, 0x0000000003030303, 0x40424446f8fafcfe
+	ld_ob	$f8, 0x0001020304050607
+	rnau.ob	$f9, $f8[4]
+	ck_ob	$f9, 0x080809097f7f8080
+
+	writemsg "rnau.ob (cv)"
+	ld_acc_ob 0x0000000000000000, 0x0000000003030303, 0x40424446f8fafcfe
+	rnau.ob	$f9, 2
+	ck_ob	$f9, 0x10111112feffffff
+
+
+	writemsg "rneu.ob (v)"
+	ld_acc_ob 0x0000000000000000, 0x0000000003030303, 0x40424446f8fafcfe
+	ld_ob	$f8, 0x0001020304050607
+	rneu.ob	$f9, $f8
+	ck_ob	$f9, 0x4021110940201008
+
+	writemsg "rneu.ob (ev)"
+	ld_acc_ob 0x0000000000000000, 0x0000000003030303, 0x40424446f8fafcfe
+	ld_ob	$f8, 0x0001020304050607
+	rneu.ob	$f9, $f8[4]
+	ck_ob	$f9, 0x080808097f7f8080
+
+	writemsg "rneu.ob (cv)"
+	ld_acc_ob 0x0000000000000000, 0x0000000003030303, 0x40424446f8fafcfe
+	rneu.ob	$f9, 2
+	ck_ob	$f9, 0x10101112fefeffff
+
+
+	writemsg "rzu.ob (v)"
+	ld_acc_ob 0x0000000000000000, 0x0000000003030303, 0x40424446f8fafcfe
+	ld_ob	$f8, 0x0001020304050607
+	rzu.ob	$f9, $f8
+	ck_ob	$f9, 0x402111083f1f0f07
+
+	writemsg "rzu.ob (ev)"
+	ld_acc_ob 0x0000000000000000, 0x0000000003030303, 0x40424446f8fafcfe
+	ld_ob	$f8, 0x0001020304050607
+	rzu.ob	$f9, $f8[4]
+	ck_ob	$f9, 0x080808087f7f7f7f
+
+	writemsg "rzu.ob (cv)"
+	ld_acc_ob 0x0000000000000000, 0x0000000003030303, 0x40424446f8fafcfe
+	rzu.ob	$f9, 2
+	ck_ob	$f9, 0x10101111fefeffff
+
+
+	###
+	### CC-using .ob format ops.
+	###
+	### Key: v = vector
+	###      ev = vector of single element
+	###      cv = vector of constant.
+	###
+
+
+	writemsg "c.eq.ob (v)"
+	ld_ob	$f8, 0x0001010202030304
+	ld_ob	$f9, 0x0101020203030404
+	clr_fp_cc 0xff
+	c.eq.ob	$f8, $f9
+	ck_fp_cc 0x55
+
+	writemsg "c.eq.ob (ev)"
+	ld_ob	$f8, 0x0001010202030304
+	ld_ob	$f9, 0x0101020203030404
+	clr_fp_cc 0xff
+	c.eq.ob	$f8, $f9[5]
+	ck_fp_cc 0x18
+
+	writemsg "c.eq.ob (cv)"
+	ld_ob	$f8, 0x0001010202030304
+	clr_fp_cc 0xff
+	c.eq.ob	$f8, 0x03
+	ck_fp_cc 0x06
+
+
+	writemsg "c.le.ob (v)"
+	ld_ob	$f8, 0x0001010202030304
+	ld_ob	$f9, 0x0101020203030404
+	clr_fp_cc 0xff
+	c.le.ob	$f8, $f9
+	ck_fp_cc 0xff
+
+	writemsg "c.le.ob (ev)"
+	ld_ob	$f8, 0x0001010202030304
+	ld_ob	$f9, 0x0101020203030404
+	clr_fp_cc 0xff
+	c.le.ob	$f8, $f9[5]
+	ck_fp_cc 0xf8
+
+	writemsg "c.le.ob (cv)"
+	ld_ob	$f8, 0x0001010202030304
+	clr_fp_cc 0xff
+	c.le.ob	$f8, 0x03
+	ck_fp_cc 0xfe
+
+
+	writemsg "c.lt.ob (v)"
+	ld_ob	$f8, 0x0001010202030304
+	ld_ob	$f9, 0x0101020203030404
+	clr_fp_cc 0xff
+	c.lt.ob	$f8, $f9
+	ck_fp_cc 0xaa
+
+	writemsg "c.lt.ob (ev)"
+	ld_ob	$f8, 0x0001010202030304
+	ld_ob	$f9, 0x0101020203030404
+	clr_fp_cc 0xff
+	c.lt.ob	$f8, $f9[5]
+	ck_fp_cc 0xe0
+
+	writemsg "c.lt.ob (cv)"
+	ld_ob	$f8, 0x0001010202030304
+	clr_fp_cc 0xff
+	c.lt.ob	$f8, 0x03
+	ck_fp_cc 0xf8
+
+
+	writemsg "pickf.ob (v)"
+	ld_ob	$f8, 0x0001020304050607
+	ld_ob	$f9, 0x08090a0b0c0d0e0f
+	clrset_fp_cc 0xff, 0xaa
+	pickf.ob $f10, $f8, $f9
+	ck_ob	$f10, 0x08010a030c050e07
+
+	writemsg "pickf.ob (ev)"
+	ld_ob	$f8, 0x0001020304050607
+	ld_ob	$f9, 0x08090a0b0c0d0e0f
+	clrset_fp_cc 0xff, 0xaa
+	pickf.ob $f10, $f8, $f9[4]
+	ck_ob	$f10, 0x0b010b030b050b07
+
+	writemsg "pickf.ob (cv)"
+	ld_ob	$f8, 0x0001020304050607
+	clrset_fp_cc 0xff, 0xaa
+	pickf.ob $f10, $f8, 0x10
+	ck_ob	$f10, 0x1001100310051007
+
+
+	writemsg "pickt.ob (v)"
+	ld_ob	$f8, 0x0001020304050607
+	ld_ob	$f9, 0x08090a0b0c0d0e0f
+	clrset_fp_cc 0xff, 0xaa
+	pickt.ob $f10, $f8, $f9
+	ck_ob	$f10, 0x0009020b040d060f
+
+	writemsg "pickt.ob (ev)"
+	ld_ob	$f8, 0x0001020304050607
+	ld_ob	$f9, 0x08090a0b0c0d0e0f
+	clrset_fp_cc 0xff, 0xaa
+	pickt.ob $f10, $f8, $f9[5]
+	ck_ob	$f10, 0x000a020a040a060a
+
+	writemsg "pickt.ob (cv)"
+	ld_ob	$f8, 0x0001020304050607
+	clrset_fp_cc 0xff, 0xaa
+	pickt.ob $f10, $f8, 0x10
+	ck_ob	$f10, 0x0010021004100610
+
+
+	pass
+
+	.end DIAG
diff --git a/sim/testsuite/sim/mips/utils-fpu.inc b/sim/testsuite/sim/mips/utils-fpu.inc
new file mode 100644
index 0000000..82feb61
--- /dev/null
+++ b/sim/testsuite/sim/mips/utils-fpu.inc
@@ -0,0 +1,105 @@
+# MIPS simulator testsuite FPU utility functions.
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Contributed by Chris Demetriou of Broadcom Corporation.
+#
+# This file is part of the GNU simulators.
+#
+# 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, 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.  */
+
+	.macro	enable_fpu fr
+        mfc0    $20, $12
+        or      $20, $20, (1 << 29) | (\fr << 26)
+        mtc0    $20, $20
+	.endm
+
+	###
+	### Data movement macros
+	###
+
+	.macro ld_fp_df r, v
+	.data
+1:	.double	\v
+	.previous
+	ldc1	\r, 1b
+	.endm
+
+	.macro ld_fp_di r, v
+	.data
+1:	.dword	\v
+	.previous
+	ldc1	\r, 1b
+	.endm
+
+	.macro ld_fp_sf r, v
+	.data
+1:	.float	\v
+	.previous
+	lwc1	\r, 1b
+	.endm
+
+	.macro ld_fp_si r, v
+	.data
+1:	.word	\v
+	.previous
+	lwc1	\r, 1b
+	.endm
+
+
+	###
+	### FP condition code manipulation macros
+	###
+
+	.macro clrset_fp_cc clr, set
+	cfc1	$20, $31	
+	or	$20, $20, (((\clr & 0xfe) << 24) | ((\clr & 0x01) << 23))
+	xor	$20, $20, (((\clr & 0xfe) << 24) | ((\clr & 0x01) << 23))
+	or	$20, $20, (((\set & 0xfe) << 24) | ((\set & 0x01) << 23))
+	ctc1	$20, $31
+	.endm
+
+	.macro clr_fp_cc clr
+	clrset_fp_cc \clr, 0
+	.endm
+
+	.macro set_fp_cc set
+	clrset_fp_cc 0, \set
+	.endm
+
+	.macro get_fp_cc r
+	.set push
+	.set noat
+	cfc1	$1, $31
+	srl	$1, $1, 23
+	andi	\r, $1, 0x1fc
+	andi	$1, $1, 0x1
+	srl	\r, \r, 1
+	or	\r, \r, $1
+	.set pop
+	.endm
+
+	.macro ck_fp_cc v
+	get_fp_cc $20
+	xori	$20, $20, \v
+	bnez	$20, _fail
+	 nop
+	.endm
+
+	.macro ckm_fp_cc v, mask
+	get_fp_cc $20
+	xori	$20, $20, \v
+	andi	$20, $20, \mask
+	bnez	$20, _fail
+	 nop
+	.endm
diff --git a/sim/testsuite/sim/mips/utils-mdmx.inc b/sim/testsuite/sim/mips/utils-mdmx.inc
new file mode 100644
index 0000000..cda6550
--- /dev/null
+++ b/sim/testsuite/sim/mips/utils-mdmx.inc
@@ -0,0 +1,72 @@
+# MIPS simulator testsuite MDMX utility functions.
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Contributed by Chris Demetriou of Broadcom Corporation.
+#
+# This file is part of the GNU simulators.
+#
+# 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, 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 "utils-fpu.inc"
+
+	###
+	### Shared macros
+	###
+
+	# Enable MDMX: enable the FPU w/ FR=1, then set Status.MX
+	.macro	enable_mdmx
+	enable_fpu 1
+	mfc0	$20, $12
+	or	$20, $20, (1 << 24)
+	mtc0	$20, $12
+	.endm
+
+
+	###
+	### .OB-format macros
+	###
+
+	.macro ld_ob r, v
+	.data
+1:	.dword	\v
+	.previous
+	ldc1	\r, 1b
+	.endm
+
+	.macro ck_ob r, v
+	.data
+1:	.dword	\v
+	.previous
+	dmfc1	$20, \r
+	ld	$21, 1b
+	bne	$20, $21, _fail
+	 nop
+	.endm
+
+	.macro ld_acc_ob h, m, l
+	ld_ob	$f20, \m
+	ld_ob	$f21, \l
+	wacl.ob	$f20, $f21
+	ld_ob	$f20, \h
+	wach.ob	$f20
+	.endm
+
+	.macro ck_acc_ob h, m, l
+	rach.ob	$f20
+	ck_ob	$f20, \h
+	racm.ob	$f20
+	ck_ob	$f20, \m
+	racl.ob	$f20
+	ck_ob	$f20, \l
+	.endm
diff --git a/src-release b/src-release
index 4fec631..42d5c20 100644
--- a/src-release
+++ b/src-release
@@ -45,7 +45,6 @@
 # distribution (perhaps it would be better to include it anyway).
 DEVO_SUPPORT= README Makefile.in configure configure.in \
 	config.guess config.if config.sub config move-if-change \
-	mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
 	COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
 	mkinstalldirs ltconfig ltmain.sh missing ylwrap \
 	libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh \